gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 1 Jun 2012 18:20:18 +0000 (18:20 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Fri, 1 Jun 2012 18:20:18 +0000 (18:20 +0000)
* configure.ac (development): Define new variable.
Call AC_CHECK_LIB for mcheck if $development.
(ERROR_ON_WARNING): Enable it by default only if $development.
* config.in: Regenerate.
* configure: Regenerate.

gdb/ChangeLog
gdb/config.in
gdb/configure
gdb/configure.ac

index 68600fb0287ce3ee3a1dbbf5a57ce33a93886146..84ec8f096eb95eb6728559feb50cfb48d8873417 100644 (file)
@@ -1,3 +1,11 @@
+2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       * configure.ac (development): Define new variable.
+       Call AC_CHECK_LIB for mcheck if $development.
+       (ERROR_ON_WARNING): Enable it by default only if $development.
+       * config.in: Regenerate.
+       * configure: Regenerate.
+
 2012-06-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
        * target.c (target_read_memory): Make LEN argument as size_t.
index a3bd8dddd1a181d1a3f61456419831e4204faab5..5767773a6af22b8ec2d04f8d1b93c4b523d94782 100644 (file)
 /* Define to 1 if you have the `m' library (-lm). */
 #undef HAVE_LIBM
 
+/* Define to 1 if you have the `mcheck' library (-lmcheck). */
+#undef HAVE_LIBMCHECK
+
 /* Define if Python 2.4 is being used. */
 #undef HAVE_LIBPYTHON2_4
 
index f638268c2be22c4243f50f6b6efbfa83f64e87b7..6e92ddfe4e77baa4e8686c50c40b415c8a61d7ca 100755 (executable)
@@ -7034,6 +7034,48 @@ fi
 
 
 
+if $development; 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 :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmcheck  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_mcheck_main=yes
+else
+  ac_cv_lib_mcheck_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mcheck_main" >&5
+$as_echo "$ac_cv_lib_mcheck_main" >&6; }
+if test "x$ac_cv_lib_mcheck_main" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBMCHECK 1
+_ACEOF
+
+  LIBS="-lmcheck $LIBS"
+
+fi
+
+fi
+
 # Generate jit-reader.h
 
 # This is typedeffed to GDB_CORE_ADDR in jit-reader.h
@@ -12300,8 +12342,8 @@ if test "${enable_werror+set}" = set; then :
 fi
 
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
     ERROR_ON_WARNING=yes
 fi
 
@@ -12805,7 +12847,7 @@ $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; }
     elif test "`uname -s`" = "Darwin"; then
        # If Tcl was built as a framework, attempt to use the libraries
        # from the framework at the given location so that linking works
-       # against Tcl.framework installed in an arbitary location.
+       # against Tcl.framework installed in an arbitrary location.
        case ${TCL_DEFS} in
            *TCL_FRAMEWORK*)
                if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then
@@ -12920,7 +12962,7 @@ $as_echo "could not find ${TK_BIN_DIR}/tkConfig.sh" >&6; }
     elif test "`uname -s`" = "Darwin"; then
        # If Tk was built as a framework, attempt to use the libraries
        # from the framework at the given location so that linking works
-       # against Tk.framework installed in an arbitary location.
+       # against Tk.framework installed in an arbitrary location.
        case ${TK_DEFS} in
            *TK_FRAMEWORK*)
                if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then
index d7409d0d6ef36613096d7edac71e07e196070e4f..5ae3a6b2c8aec0abf0a4f4e8b12e84d6fb629fda 100644 (file)
@@ -18,6 +18,11 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 dnl Process this file with autoconf to produce a configure script.
 
+dnl Provide more thorough testing by -lmcheck.
+dnl Set it to 'true' for development snapshots, 'false' for releases or
+dnl pre-releases.
+development=true
+
 AC_PREREQ(2.59)dnl
 AC_INIT(main.c)
 AC_CONFIG_HEADER(config.h:config.in)
@@ -640,6 +645,11 @@ 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
+  AC_CHECK_LIB(mcheck, main)
+fi
+
 # Generate jit-reader.h
 
 # This is typedeffed to GDB_CORE_ADDR in jit-reader.h
@@ -1822,8 +1832,8 @@ AC_ARG_ENABLE(werror,
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
    esac])
 
-# Enable -Werror by default when using gcc
-if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
     ERROR_ON_WARNING=yes
 fi
 
This page took 0.038771 seconds and 4 git commands to generate.