Check for dmalloc at the end of the configure
authorTimur I. Bakeyev <timur@com.bat.ru>
Sun, 7 Jun 2009 12:50:15 +0000 (12:50 +0000)
committerStefan Metzmacher <metze@samba.org>
Mon, 8 Jun 2009 11:20:52 +0000 (13:20 +0200)
Enabling dmalloc in Samba3 build leads to the wrong detection of the
strndup() function - there isn't one in FreeBSD prior to 7.2, but
dmalloc defines it, so, farther tests with -ldmalloc added wrongly
find it. the cheapest fix is to move dmalloc detection and inclusion
to the bottom of configure, so it can't affect detection of the system
capabilities.

Here is the patch.

With regards,
Timur Bakeyev.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/configure.in

index bbd40dbefe392d0b112cf43c113defd8defe1e97..5ea214b6f5dcd3a26203b0f6c4848bc430317fb1 100644 (file)
@@ -216,16 +216,6 @@ if test x"$ac_cv_prog_gcc" = x"yes" ; then
        fi
 fi
 
-AC_ARG_ENABLE(dmalloc, [AS_HELP_STRING([--enable-dmalloc], [Enable heap debugging [default=no]])])
-
-if test "x$enable_dmalloc" = xyes
-then
-       AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
-       AC_DEFINE(DMALLOC_FUNC_CHECK, 1,
-                  [Define to check invariants around some common functions])
-       LIBS="$LIBS -ldmalloc"  
-fi
-
 #################################################
 # check for a shared memory profiling support
 AC_MSG_CHECKING(whether to use profiling)
@@ -6459,6 +6449,16 @@ AC_ZLIB([ZLIB_OBJS=""], [
        CFLAGS="-I../lib/zlib $CFLAGS"
 ])
 
+AC_ARG_ENABLE(dmalloc, [AS_HELP_STRING([--enable-dmalloc], [Enable heap debugging [default=no]])])
+
+if test "x$enable_dmalloc" = xyes
+then
+       AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
+       AC_DEFINE(DMALLOC_FUNC_CHECK, 1,
+                  [Define to check invariants around some common functions])
+       LIBS="$LIBS -ldmalloc"
+fi
+
 dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
 LIB_REMOVE_USR_LIB(LDFLAGS)
 LIB_REMOVE_USR_LIB(LIBS)