]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Fix up configure test for <valgrind/memcheck.h>
authorRoland Dreier <rolandd@cisco.com>
Thu, 5 Oct 2006 18:52:20 +0000 (18:52 +0000)
committerRoland Dreier <rolandd@cisco.com>
Thu, 9 Nov 2006 19:36:02 +0000 (11:36 -0800)
Print a warning if Valgrind annotations are requested but
<valgrind/memcheck.h> is not found.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
configure.in

index 56eb38630fc32e2a23910a4183fcf0b1cc1e7101..d5d17124ea71f50a45be587aeb12aa1ff5de68d5 100644 (file)
@@ -12,7 +12,7 @@ AM_PROG_LIBTOOL
 AC_ARG_WITH([valgrind],
     AC_HELP_STRING([--with-valgrind],
         [Enable Valgrind annotations (small runtime overhead, default NO)]))
-if test "x$with_valgrind" != "xyes"; then
+if test x$with_valgrind != xyes; then
     AC_DEFINE([NVALGRIND], 1, [disable Valgrind annotations])
 fi
 
@@ -27,7 +27,11 @@ AC_CHECK_LIB(pthread, pthread_mutex_init, [],
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(valgrind/memcheck.h)
+AC_CHECK_HEADER(valgrind/memcheck.h, memcheck_ok=yes, memcheck_ok=no)
+
+if test x$with_valgrind = xyes && test $memcheck_ok = no; then
+    AC_MSG_WARN([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
+fi
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST