Added valgrind support to the auto-tools configuration file.

Signed-off-by: Dotan Barak <[EMAIL PROTECTED]>

---

Index: connectx_user/src/userspace/management/libibumad/configure.in
===================================================================
--- connectx_user.orig/src/userspace/management/libibumad/configure.in  
2007-09-02 08:01:42.000000000 +0300
+++ connectx_user/src/userspace/management/libibumad/configure.in       
2007-09-04 10:24:39.000000000 +0300
@@ -20,6 +20,19 @@ AC_ARG_ENABLE(libcheck, [  --disable-lib
         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_CXX
 AC_PROG_CC
@@ -55,6 +68,13 @@ AC_CHECK_FUNCS([memset])
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_INLINE
 
+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
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to