From: Timur I. Bakeyev Date: Sun, 7 Jun 2009 12:50:15 +0000 (+0000) Subject: Check for dmalloc at the end of the configure X-Git-Tag: tdb-1.1.5~193 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16f5aedea0cd05113b5fbed06e140d7fedbad095;p=thirdparty%2Fsamba.git Check for dmalloc at the end of the configure 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 --- diff --git a/source3/configure.in b/source3/configure.in index bbd40dbefe3..5ea214b6f5d 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -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)