summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2012-07-25 18:27:03 +0000
committerJoel Brobecker <brobecker@gnat.com>2012-07-25 18:27:03 +0000
commit09a215f4c6aabd8a86402f15e7abd8bc37933993 (patch)
treefd9f95ffe60e9e8ee22c3ffb4adf78dd3ec79caa
parent47bbf2c7f8fb4d2ef8e46ce1ae6f02c15736b1e6 (diff)
downloadgdb-09a215f4c6aabd8a86402f15e7abd8bc37933993.tar.gz
Add support for --enable-lmcheck configure option.
This allows the user to enable this option at configure time if building a release, or to disable it if building a snapshot. gdb/ChangeLog: * configure.ac: Add --enable-lmcheck configure option. * configure: Regenerate.
-rw-r--r--gdb/ChangeLog5
-rwxr-xr-xgdb/configure23
-rw-r--r--gdb/configure.ac21
3 files changed, 46 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b2ddbb283c5..b5aa8716000 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-25 Joel Brobecker <brobecker@adacore.com>
+
+ * configure.ac: Add --enable-lmcheck configure option.
+ * configure: Regenerate.
+
2012-07-25 Tom Tromey <tromey@redhat.com>
* NEWS: Mention maint info bfds.
diff --git a/gdb/configure b/gdb/configure
index 819967d5234..90927fffce5 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -795,6 +795,7 @@ with_zlib
with_libiconv_prefix
with_iconv_bin
with_system_readline
+enable_libmcheck
with_jit_reader_dir
with_expat
with_gnu_ld
@@ -1465,6 +1466,7 @@ Optional Features:
--enable-tui enable full-screen terminal user interface (TUI)
--enable-gdbtk enable gdbtk graphical user interface (GUI)
--enable-profiling enable profiling of GDB
+ --enable-libmcheck Try building GDB with -lmcheck if available
--disable-rpath do not hardcode runtime library paths
--enable-werror treat compile warnings as errors
--enable-build-warnings enable build-time compiler warnings if gcc is used
@@ -7039,7 +7041,26 @@ fi
-if $development; then
+# Provide a --enable-libmcheck/--disable-libmcheck set of options
+# allowing a user to enable this option even when building releases,
+# or to disable it when building a snapshot.
+# Check whether --enable-libmcheck was given.
+if test "${enable_libmcheck+set}" = set; then :
+ enableval=$enable_libmcheck; case "${enableval}" in
+ yes | y) ENABLE_LIBMCHECK="yes" ;;
+ no | n) ENABLE_LIBMCHECK="no" ;;
+ *) as_fn_error "bad value ${enableval} for --enable-libmcheck" "$LINENO" 5 ;;
+ esac
+fi
+
+
+# Enable -lmcheck by default (it provides cheap-enough memory mangling),
+# but turn it off for releases.
+if test -z "${ENABLE_LIBMCHECK}" && $development; then
+ ENABLE_LIBMCHECK=yes
+fi
+
+if test "$ENABLE_LIBMCHECK" = "yes" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmcheck" >&5
$as_echo_n "checking for main in -lmcheck... " >&6; }
if test "${ac_cv_lib_mcheck_main+set}" = set; then :
diff --git a/gdb/configure.ac b/gdb/configure.ac
index f3d75b16af4..b33de61e22b 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -645,8 +645,25 @@ AC_SUBST(READLINE_DEPS)
AC_SUBST(READLINE_CFLAGS)
AC_SUBST(READLINE_TEXI_INCFLAG)
-dnl -lmcheck provides cheap enough memory mangling for debugging purposes.
-if $development; then
+# Provide a --enable-libmcheck/--disable-libmcheck set of options
+# allowing a user to enable this option even when building releases,
+# or to disable it when building a snapshot.
+AC_ARG_ENABLE(libmcheck,
+ AS_HELP_STRING([--enable-libmcheck],
+ [Try building GDB with -lmcheck if available]),
+ [case "${enableval}" in
+ yes | y) ENABLE_LIBMCHECK="yes" ;;
+ no | n) ENABLE_LIBMCHECK="no" ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmcheck) ;;
+ esac])
+
+# Enable -lmcheck by default (it provides cheap-enough memory mangling),
+# but turn it off for releases.
+if test -z "${ENABLE_LIBMCHECK}" && $development; then
+ ENABLE_LIBMCHECK=yes
+fi
+
+if test "$ENABLE_LIBMCHECK" = "yes" ; then
AC_CHECK_LIB(mcheck, main)
fi