]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Fix Valgrind annotations so they can actually be built
authorRoland Dreier <rolandd@cisco.com>
Tue, 3 Jul 2007 18:53:47 +0000 (11:53 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 3 Jul 2007 18:53:47 +0000 (11:53 -0700)
The AC_CHECK_HEADER() test for <valgrind/memcheck.h> will never result
in HAVE_VALGRIND_MEMCHECK_H being defined, so ibverbs.h will never
include <valgrind/memcheck.h> and Valgrind annotations will never actually
get built.  Fix this by adding an AC_DEFINE() of HAVE_VALGRIND_MEMCHECK_H
if the header is found.

Pointed out by Jeff Squyres <jsquyres@cisco.com>.

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

index 2b4cbb61a448933b6051d56d690788c483b32d36..f9cab7608ef6203bee5c3ef18f6f9da1a5bc40be 100644 (file)
@@ -34,11 +34,12 @@ AC_CHECK_LIB(pthread, pthread_mutex_init, [],
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADER(valgrind/memcheck.h, memcheck_ok=yes, memcheck_ok=no)
-
-if test $want_valgrind = yes && test $memcheck_ok = no; then
-    AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
-fi
+AC_CHECK_HEADER(valgrind/memcheck.h,
+    [AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
+        [Define to 1 if you have the <valgrind/memcheck.h> header file.])],
+    [if test $want_valgrind = yes; then
+        AC_MSG_ERROR([Valgrind memcheck support requested, but <valgrind/memcheck.h> not found.])
+    fi])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST