+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.
+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
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
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
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
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)
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
*) 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