[ofa-general] [PATCH] librdmacm 1/2: add valgrind support to auto-tools configuration file

Dotan Barak dotanb at dev.mellanox.co.il
Wed Aug 15 03:52:41 PDT 2007


Added valgrind support to the auto-tools configuration file.

Signed-off-by: Dotan Barak <dotanb at dev.mellanox.co.il>

---

diff --git a/configure.in b/configure.in
index ce15f44..9171319 100644
--- a/configure.in
+++ b/configure.in
@@ -15,6 +15,19 @@ AC_ARG_ENABLE(libcheck, [  --disable-libcheck      do not test for presence of i
         fi
 ])
 
+AC_ARG_WITH([valgrind],
+    AC_HELP_STRING([--with-valgrind],
+        [Enable Valgrind annotations (small runtime overhead, default NO)]))
+if test x$with_valgrind = x || test x$with_valgrind = xno; then
+    want_valgrind=no
+    AC_DEFINE([NVALGRIND], 1, [Define to 1 to disable Valgrind annotations.])
+else
+    want_valgrind=yes
+    if test -d $with_valgrind; then
+        CPPFLAGS="$CPPFLAGS -I$with_valgrind/include"
+    fi
+fi
+
 dnl Checks for programs
 AC_PROG_CC
 
@@ -37,6 +50,13 @@ AC_CHECK_HEADER(infiniband/verbs.h, [],
     AC_MSG_ERROR([<infiniband/verbs.h> not found.  Is libibverbs installed?]))
 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])
+
 AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
     if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
         ac_cv_version_script=yes



More information about the general mailing list