# HG changeset patch # User Richard Laager # Date 1177696538 0 # Node ID fe6fd0568d0422abef9deaa3b77274b934a633b9 # Parent ff7a7fe880499d75e6043068287d63a29e0b9966 Passing --enable-mcheck or --enable-debug will add "-lmcheck", which will do the same thing as MALLOC_CHECK_=2 without it having to be specified every time. I encourage everyone to use at least --enable-debug and --enable-fatal-asserts if you can. ;) See this page for more information: http://www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html diff -r ff7a7fe88049 -r fe6fd0568d04 configure.ac --- a/configure.ac Fri Apr 27 14:37:15 2007 +0000 +++ b/configure.ac Fri Apr 27 17:55:38 2007 +0000 @@ -807,7 +807,22 @@ AC_CHECK_HEADER(sys/utsname.h) AC_CHECK_FUNC(uname) -AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], , enable_fortify=yes) +AC_ARG_ENABLE(fortify, [AC_HELP_STRING([--disable-fortify], [compile without FORTIFY_SOURCE support])], enable_fortify="$enableval", enable_fortify=yes) + +AC_ARG_ENABLE(mcheck, [AC_HELP_STRING([--enable-mcheck], [compile with mcheck (malloc debugging) support])], enable_mcheck="$enableval", enable_mcheck="$enable_debug") +if test "x$enable_mcheck" = "xyes" ; then + orig_LIBS="$LIBS" + LIBS="$LIBS -lmcheck" + AC_MSG_CHECKING(for mcheck support) + AC_TRY_COMPILE([], [ + int main() {return 0;} + ], [ + AC_MSG_RESULT(yes) + ], [ + AC_MSG_RESULT(no) + LIBS="$orig_LIBS" + ]) +fi if test "x$GCC" = "xyes"; then dnl We enable -Wall later.