changeset 16531:fe6fd0568d04

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
author Richard Laager <rlaager@wiktel.com>
date Fri, 27 Apr 2007 17:55:38 +0000
parents ff7a7fe88049
children d29c995c815b d603b5fb7292
files configure.ac
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.