[PATCH] [FreeBSD 10] Check for dmalloc at the end of the configure

Timur I. Bakeyev timur at com.bat.ru
Sun Jun 7 12:50:15 GMT 2009


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.
-------------- next part --------------
--- ./source3/configure.in.orig	2009-04-30 07:53:01.000000000 +0000
+++ ./source3/configure.in	2009-06-01 11:49:40.000000000 +0000
@@ -216,16 +216,6 @@
        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)
@@ -6406,6 +6439,16 @@
 	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)


More information about the samba-technical mailing list