summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-04-14 13:02:48 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-04-15 09:41:15 -0700
commit2d5bd66e4f5ba15464c1e915a259d2442e88f736 (patch)
tree272b7bb724bc2cd366af476701500297d7842ed7 /configure.ac
parent7e4628da48290f76dd0d4ddc29faf083db0d78ae (diff)
configure: Add support for detecting valgrind headers
We have several places where the Vulkan driver explicitly hooks into valgrind when it's available. We need to be able to detect it. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8c82c43501b1..4313aff9116b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2446,6 +2446,27 @@ AC_SUBST([XA_MINOR], $XA_MINOR)
AC_SUBST([XA_TINY], $XA_TINY)
AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
+AC_ARG_ENABLE(valgrind,
+ [AS_HELP_STRING([--enable-valgrind],
+ [Build mesa with valgrind support (default: auto)])],
+ [VALGRIND=$enableval], [VALGRIND=auto])
+if test "x$VALGRIND" != xno; then
+ PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
+fi
+AC_MSG_CHECKING([whether to enable Valgrind support])
+if test "x$VALGRIND" = xauto; then
+ VALGRIND="$have_valgrind"
+fi
+
+if test "x$VALGRIND" = "xyes"; then
+ if ! test "x$have_valgrind" = xyes; then
+ AC_MSG_ERROR([Valgrind support required but not present])
+ fi
+ AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
+fi
+
+AC_MSG_RESULT([$VALGRIND])
+
dnl Restore LDFLAGS and CPPFLAGS
LDFLAGS="$_SAVE_LDFLAGS"
CPPFLAGS="$_SAVE_CPPFLAGS"