Skip to content

Commit

Permalink
Check for dmalloc at the end of the configure
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
b-a-t authored and metze-samba committed Jun 8, 2009
1 parent 40178dd commit 16f5aed
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions source3/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 16f5aed

Please sign in to comment.