summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-05-25 21:15:22 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-05-25 22:14:56 +0100
commite4efc80b8e89b05afc22d74f984f4ec9012bc39b (patch)
tree7ab4cefd99e732e52419822839f6ba7317977f6c /build
parentd840deb57b51236820dc8c320ecd7540973de873 (diff)
[build] Make valgrind support user-configurable
As the number of places where we add valgrind client requests grows, it becomes imperative that we should be able to disable them with a simple configure time option.
Diffstat (limited to 'build')
-rw-r--r--build/configure.ac.analysis37
1 files changed, 22 insertions, 15 deletions
diff --git a/build/configure.ac.analysis b/build/configure.ac.analysis
index f425a9af..4e8a02da 100644
--- a/build/configure.ac.analysis
+++ b/build/configure.ac.analysis
@@ -82,18 +82,25 @@ AM_CONDITIONAL(CAIRO_HAS_LCOV, test "x$cairo_has_lcov" = "xyes")
dnl ===========================================================================
dnl Check for some custom valgrind modules
-PKG_CHECK_MODULES(VALGRIND, valgrind, [
- _save_CFLAGS="$CFLAGS"
- _save_CPPFLAGS="$CPPFLAGS"
- CFLAGS="$CFLAGS $VALGRIND_CFLAGS"
- CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
- AC_CHECK_HEADER([valgrind.h], [AC_DEFINE([HAVE_VALGRIND], [1],
- [Define to 1 if you have Valgrind])])
- AC_CHECK_HEADER([lockdep.h], [AC_DEFINE([HAVE_LOCKDEP], [1],
- [Define to 1 if you have the Valgrind lockdep tool])])
- AC_CHECK_HEADER([memfault.h], [AC_DEFINE([HAVE_MEMFAULT], [1],
- [Define to 1 if you have the Valgrind memfault tool])])
- CAIRO_CFLAGS="$VALGRIND_CFLAGS $CAIRO_CFLAGS"
- CFLAGS="$_save_CFLAGS"
- CPPFLAGS="$_save_CPPFLAGS"
- ], AC_MSG_RESULT(no))
+AC_ARG_ENABLE(valgrind,
+ AS_HELP_STRING([--disable-valgrind],
+ [Disable valgrind support]),
+ [use_valgrind=$enableval], [use_valgrind=yes])
+
+if test "x$use_valgrind" = "xyes"; then
+ PKG_CHECK_MODULES(VALGRIND, valgrind, [
+ _save_CFLAGS="$CFLAGS"
+ _save_CPPFLAGS="$CPPFLAGS"
+ CFLAGS="$CFLAGS $VALGRIND_CFLAGS"
+ CPPFLAGS="$CPPFLAGS $VALGRIND_CFLAGS"
+ AC_CHECK_HEADER([valgrind.h], [AC_DEFINE([HAVE_VALGRIND], [1],
+ [Define to 1 if you have Valgrind])])
+ AC_CHECK_HEADER([lockdep.h], [AC_DEFINE([HAVE_LOCKDEP], [1],
+ [Define to 1 if you have the Valgrind lockdep tool])])
+ AC_CHECK_HEADER([memfault.h], [AC_DEFINE([HAVE_MEMFAULT], [1],
+ [Define to 1 if you have the Valgrind memfault tool])])
+ CAIRO_CFLAGS="$VALGRIND_CFLAGS $CAIRO_CFLAGS"
+ CFLAGS="$_save_CFLAGS"
+ CPPFLAGS="$_save_CPPFLAGS"
+ ], AC_MSG_RESULT(no))
+fi