summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2015-06-22 09:56:33 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2015-06-29 19:19:22 +0100
commit47a2de27a0f087908e3063fdd6dfdececd2db75b (patch)
tree9deee04acbda4b49b89c33a18fec11785eb361db
parent5f76273d51fee5c176302ae5f57673461b80333b (diff)
configure: Add flag to disable valgrind support.
v2 [Emil Velikov]: Autodetect valgrind. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r--configure.ac16
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 78a0010d..32d034ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -403,11 +403,25 @@ else
fi
AM_CONDITIONAL([HAVE_MANPAGES_STYLESHEET], [test "x$HAVE_MANPAGES_STYLESHEET" = "xyes"])
+AC_ARG_ENABLE(valgrind,
+ [AS_HELP_STRING([--enable-valgrind],
+ [Build libdrm with valgrind support (default: auto)])],
+ [VALGRIND=$enableval], [VALGRIND=yes])
PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
-if test "x$have_valgrind" = "xyes"; then
+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])
+
AC_ARG_WITH([kernel-source],
[AS_HELP_STRING([--with-kernel-source],
[specify path to linux kernel source])],