* 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.
This commit is contained in:
Jan Kratochvil 2012-06-01 18:20:18 +00:00
parent 89dc0afdc9
commit a68ffae9e6
4 changed files with 69 additions and 6 deletions

View 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.

View file

@ -201,6 +201,9 @@
/* 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

50
gdb/configure vendored
View file

@ -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

View 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