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

Dotan Barak dotanb at dev.mellanox.co.il
Tue Sep 4 00:34:22 PDT 2007


Added valgrind support to the auto-tools configuration file.

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

---

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



More information about the general mailing list