mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-04-11 09:21:48 +00:00
On mainline/development, also link GDBserver with -lmcheck.
This factors --enable-libmcheck related bits from GDB's configure.ac and makes GDBserver use them too. Specifically, the 'development' global is moved to a separate script to it can be sourced by both GDB and GDBserver, and the --enable-libmcheck/--disable-libmcheck bits proper are moved to a new m4 file. I started out by defining 'development' in the m4 file, but in the end decided against it, as a separate script has the advantage that changing it in release branches does not require regenerating configure, unlike today. I had also started out by making the new GDB_AC_LIBMCHECK itself handle the yes/no default fallback depending on release/developement, but since I had split out 'development' to a separate script, and, GDB needs the python checks anyway (hence we'd need to do the python checks in gdb's configure.ac, and pass in a 'default lmcheck yes/no' parameter to GDB_AC_LIBMCHECK anyway), I ended up keeping GDB_AC_LIBMCHECK isolated from the 'development' global. IOW, it's the caller's business to handle it. Tested on x86_64 Fedora 17. Built GDB and GDBserver with and without --enable-libmcheck, and observed --enable-libmcheck overrides the disablement of -lmcheck caused by python supporting threads, and that GDBserver links with -lmcheck when expected. Also observed that changing the 'development' global, and issuing "make" triggers a relink, and '-lmcheck' is included or not from the link accordingly. gdb/ 2013-07-03 Pedro Alves <palves@redhat.com> * Makefile.in (config.status): Depend on development.sh. (aclocal_m4_deps): Add libmcheck.m4. * acinclude.m4: Include libmcheck.m4. * configure.ac: Source development.sh instead of setting 'development' here. --enable-libmcheck/--disable-libmcheck code factored out to GDB_AC_LIBMCHECK. Run it. * development.sh: New file. * libmcheck.m4: New file. * configure: Regenerate. gdb/gdbserver/ 2013-07-03 Pedro Alves <palves@redhat.com> * Makefile.in (config.status): Depend on development.sh. * acinclude.m4: Include libmcheck.m4. * configure: Regenerate.
This commit is contained in:
parent
5295321caf
commit
17ef446eed
@ -1,3 +1,15 @@
|
|||||||
|
2013-07-03 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* Makefile.in (config.status): Depend on development.sh.
|
||||||
|
(aclocal_m4_deps): Add libmcheck.m4.
|
||||||
|
* acinclude.m4: Include libmcheck.m4.
|
||||||
|
* configure.ac: Source development.sh instead of setting
|
||||||
|
'development' here. --enable-libmcheck/--disable-libmcheck code
|
||||||
|
factored out to GDB_AC_LIBMCHECK. Run it.
|
||||||
|
* development.sh: New file.
|
||||||
|
* libmcheck.m4: New file.
|
||||||
|
* configure: Regenerate.
|
||||||
|
|
||||||
2013-07-02 Tom Tromey <tromey@redhat.com>
|
2013-07-02 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* contrib/ari/update-web-ari.sh: Update for version.in change.
|
* contrib/ari/update-web-ari.sh: Update for version.in change.
|
||||||
|
@ -1348,7 +1348,7 @@ stamp-h: $(srcdir)/config.in config.status
|
|||||||
CONFIG_LINKS= \
|
CONFIG_LINKS= \
|
||||||
$(SHELL) config.status
|
$(SHELL) config.status
|
||||||
|
|
||||||
config.status: $(srcdir)/configure configure.tgt configure.host
|
config.status: $(srcdir)/configure configure.tgt configure.host development.sh
|
||||||
$(SHELL) config.status --recheck
|
$(SHELL) config.status --recheck
|
||||||
|
|
||||||
ACLOCAL = aclocal
|
ACLOCAL = aclocal
|
||||||
@ -1358,6 +1358,7 @@ ACLOCAL_AMFLAGS = -I ../config
|
|||||||
aclocal_m4_deps = \
|
aclocal_m4_deps = \
|
||||||
configure.ac \
|
configure.ac \
|
||||||
acx_configure_dir.m4 \
|
acx_configure_dir.m4 \
|
||||||
|
libmcheck.m4 \
|
||||||
../bfd/bfd.m4 \
|
../bfd/bfd.m4 \
|
||||||
../config/acinclude.m4 \
|
../config/acinclude.m4 \
|
||||||
../config/plugins.m4 \
|
../config/plugins.m4 \
|
||||||
|
@ -6,6 +6,9 @@ dnl major rewriting for Tcl 7.5 by Don Libes <libes@nist.gov>
|
|||||||
|
|
||||||
sinclude(acx_configure_dir.m4)
|
sinclude(acx_configure_dir.m4)
|
||||||
|
|
||||||
|
# This gets GDB_AC_LIBMCHECK.
|
||||||
|
sinclude(libmcheck.m4)
|
||||||
|
|
||||||
dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition.
|
dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition.
|
||||||
sinclude(../bfd/bfd.m4)
|
sinclude(../bfd/bfd.m4)
|
||||||
|
|
||||||
|
59
gdb/configure
vendored
59
gdb/configure
vendored
@ -1480,7 +1480,7 @@ Optional Features:
|
|||||||
--enable-gdbtk enable gdbtk graphical user interface (GUI)
|
--enable-gdbtk enable gdbtk graphical user interface (GUI)
|
||||||
--enable-profiling enable profiling of GDB
|
--enable-profiling enable profiling of GDB
|
||||||
--disable-rpath do not hardcode runtime library paths
|
--disable-rpath do not hardcode runtime library paths
|
||||||
--enable-libmcheck Try building GDB with -lmcheck if available
|
--enable-libmcheck Try linking with -lmcheck if available
|
||||||
--enable-werror treat compile warnings as errors
|
--enable-werror treat compile warnings as errors
|
||||||
--enable-build-warnings enable build-time compiler warnings if gcc is used
|
--enable-build-warnings enable build-time compiler warnings if gcc is used
|
||||||
--enable-gdb-build-warnings
|
--enable-gdb-build-warnings
|
||||||
@ -2704,10 +2704,8 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Provide more thorough testing by -lmcheck.
|
# Set the 'development' global.
|
||||||
# Set it to 'true' for development snapshots, 'false' for releases or
|
. $srcdir/development.sh
|
||||||
# pre-releases.
|
|
||||||
development=true
|
|
||||||
|
|
||||||
ac_ext=c
|
ac_ext=c
|
||||||
ac_cpp='$CPP $CPPFLAGS'
|
ac_cpp='$CPP $CPPFLAGS'
|
||||||
@ -8565,36 +8563,33 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 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),
|
# Enable -lmcheck by default (it provides cheap-enough memory mangling),
|
||||||
# but turn it off if Python is enabled with threads, since -lmcheck is
|
# but turn it off if Python is enabled with threads, since -lmcheck is
|
||||||
# not thread safe (http://sourceware.org/bugzilla/show_bug.cgi?id=9939),
|
# not thread safe (http://sourceware.org/bugzilla/show_bug.cgi?id=9939),
|
||||||
# and for releases.
|
# and for releases.
|
||||||
if test -z "${ENABLE_LIBMCHECK}" \
|
if test \( "${have_libpython}" = "no" -o "${python_has_threads}" = "no" \) \
|
||||||
-a \( "${have_libpython}" = "no" \
|
&& $development; then
|
||||||
-o "${python_has_threads}" = "no" \) \
|
libmcheck_default=yes
|
||||||
&& $development; then
|
else
|
||||||
ENABLE_LIBMCHECK=yes
|
libmcheck_default=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$ENABLE_LIBMCHECK" = "yes" ; then
|
# Check whether --enable-libmcheck was given.
|
||||||
if test "${have_libpython}" != "no" -a "${python_has_threads}" = "yes" ; then
|
if test "${enable_libmcheck+set}" = set; then :
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-libmcheck may lead to spurious crashes if threads are used in python" >&5
|
enableval=$enable_libmcheck; case "${enableval}" in
|
||||||
$as_echo "$as_me: WARNING: --enable-libmcheck may lead to spurious crashes if threads are used in python" >&2;}
|
yes | y) ENABLE_LIBMCHECK="yes" ;;
|
||||||
|
no | n) ENABLE_LIBMCHECK="no" ;;
|
||||||
|
*) as_fn_error "bad value ${enableval} for --enable-libmcheck" "$LINENO" 5 ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if test -z "${ENABLE_LIBMCHECK}"; then
|
||||||
|
ENABLE_LIBMCHECK=${libmcheck_default}
|
||||||
fi
|
fi
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmcheck" >&5
|
|
||||||
|
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; }
|
$as_echo_n "checking for main in -lmcheck... " >&6; }
|
||||||
if test "${ac_cv_lib_mcheck_main+set}" = set; then :
|
if test "${ac_cv_lib_mcheck_main+set}" = set; then :
|
||||||
$as_echo_n "(cached) " >&6
|
$as_echo_n "(cached) " >&6
|
||||||
@ -8633,6 +8628,14 @@ _ACEOF
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if test "$ENABLE_LIBMCHECK" = "yes" \
|
||||||
|
-a "${have_libpython}" != "no" \
|
||||||
|
-a "${python_has_threads}" = "yes" ; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-libmcheck may lead to spurious crashes if threads are used in python" >&5
|
||||||
|
$as_echo "$as_me: WARNING: --enable-libmcheck may lead to spurious crashes if threads are used in python" >&2;}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ------------------------- #
|
# ------------------------- #
|
||||||
|
@ -23,10 +23,8 @@ AC_INIT(main.c)
|
|||||||
AC_CONFIG_HEADER(config.h:config.in)
|
AC_CONFIG_HEADER(config.h:config.in)
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
# Provide more thorough testing by -lmcheck.
|
# Set the 'development' global.
|
||||||
# Set it to 'true' for development snapshots, 'false' for releases or
|
. $srcdir/development.sh
|
||||||
# pre-releases.
|
|
||||||
development=true
|
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_USE_SYSTEM_EXTENSIONS
|
AC_USE_SYSTEM_EXTENSIONS
|
||||||
@ -1052,34 +1050,22 @@ AC_SUBST(PYTHON_CFLAGS)
|
|||||||
AC_SUBST(PYTHON_CPPFLAGS)
|
AC_SUBST(PYTHON_CPPFLAGS)
|
||||||
AC_SUBST(PYTHON_LIBS)
|
AC_SUBST(PYTHON_LIBS)
|
||||||
|
|
||||||
# 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),
|
# Enable -lmcheck by default (it provides cheap-enough memory mangling),
|
||||||
# but turn it off if Python is enabled with threads, since -lmcheck is
|
# but turn it off if Python is enabled with threads, since -lmcheck is
|
||||||
# not thread safe (http://sourceware.org/bugzilla/show_bug.cgi?id=9939),
|
# not thread safe (http://sourceware.org/bugzilla/show_bug.cgi?id=9939),
|
||||||
# and for releases.
|
# and for releases.
|
||||||
if test -z "${ENABLE_LIBMCHECK}" \
|
if test \( "${have_libpython}" = "no" -o "${python_has_threads}" = "no" \) \
|
||||||
-a \( "${have_libpython}" = "no" \
|
&& $development; then
|
||||||
-o "${python_has_threads}" = "no" \) \
|
libmcheck_default=yes
|
||||||
&& $development; then
|
else
|
||||||
ENABLE_LIBMCHECK=yes
|
libmcheck_default=no
|
||||||
fi
|
fi
|
||||||
|
GDB_AC_LIBMCHECK(${libmcheck_default})
|
||||||
|
|
||||||
if test "$ENABLE_LIBMCHECK" = "yes" ; then
|
if test "$ENABLE_LIBMCHECK" = "yes" \
|
||||||
if test "${have_libpython}" != "no" -a "${python_has_threads}" = "yes" ; then
|
-a "${have_libpython}" != "no" \
|
||||||
AC_MSG_WARN(--enable-libmcheck may lead to spurious crashes if threads are used in python)
|
-a "${python_has_threads}" = "yes" ; then
|
||||||
fi
|
AC_MSG_WARN(--enable-libmcheck may lead to spurious crashes if threads are used in python)
|
||||||
AC_CHECK_LIB(mcheck, main)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ------------------------- #
|
# ------------------------- #
|
||||||
|
21
gdb/development.sh
Normal file
21
gdb/development.sh
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
||||||
|
#
|
||||||
|
# This file is part of GDB.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Set to 'true' for development snapshots, 'false' for releases and
|
||||||
|
# pre-releases. When true, provide more thorough testing with
|
||||||
|
# -lmcheck.
|
||||||
|
development=true
|
@ -1,3 +1,9 @@
|
|||||||
|
2013-07-03 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* Makefile.in (config.status): Depend on development.sh.
|
||||||
|
* acinclude.m4: Include libmcheck.m4.
|
||||||
|
* configure: Regenerate.
|
||||||
|
|
||||||
2013-07-02 Mircea Gherzan <mircea.gherzan@intel.com>
|
2013-07-02 Mircea Gherzan <mircea.gherzan@intel.com>
|
||||||
|
|
||||||
* win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
|
* win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
|
||||||
|
@ -379,7 +379,7 @@ $(GNULIB_BUILDDIR)/Makefile: $(srcdir)/../gnulib/Makefile.in config.status
|
|||||||
CONFIG_LINKS= \
|
CONFIG_LINKS= \
|
||||||
$(SHELL) config.status
|
$(SHELL) config.status
|
||||||
|
|
||||||
config.status: configure configure.srv
|
config.status: configure configure.srv $(srcdir)/../development.sh
|
||||||
$(SHELL) ./config.status --recheck
|
$(SHELL) ./config.status --recheck
|
||||||
|
|
||||||
# automatic rebuilding in automake-generated Makefiles requires
|
# automatic rebuilding in automake-generated Makefiles requires
|
||||||
|
@ -3,6 +3,9 @@ sinclude(../../bfd/bfd.m4)
|
|||||||
|
|
||||||
sinclude(../acx_configure_dir.m4)
|
sinclude(../acx_configure_dir.m4)
|
||||||
|
|
||||||
|
# This gets GDB_AC_LIBMCHECK.
|
||||||
|
sinclude(../libmcheck.m4)
|
||||||
|
|
||||||
dnl This gets autoconf bugfixes
|
dnl This gets autoconf bugfixes
|
||||||
sinclude(../../config/override.m4)
|
sinclude(../../config/override.m4)
|
||||||
|
|
||||||
|
70
gdb/gdbserver/configure
vendored
70
gdb/gdbserver/configure
vendored
@ -687,6 +687,7 @@ ac_user_opts='
|
|||||||
enable_option_checking
|
enable_option_checking
|
||||||
enable_maintainer_mode
|
enable_maintainer_mode
|
||||||
enable_largefile
|
enable_largefile
|
||||||
|
enable_libmcheck
|
||||||
with_ust
|
with_ust
|
||||||
with_ust_include
|
with_ust_include
|
||||||
with_ust_lib
|
with_ust_lib
|
||||||
@ -1326,6 +1327,7 @@ Optional Features:
|
|||||||
--enable-maintainer-mode enable make rules and dependencies not useful
|
--enable-maintainer-mode enable make rules and dependencies not useful
|
||||||
(and sometimes confusing) to the casual installer
|
(and sometimes confusing) to the casual installer
|
||||||
--disable-largefile omit support for large files
|
--disable-largefile omit support for large files
|
||||||
|
--enable-libmcheck Try linking with -lmcheck if available
|
||||||
--enable-werror treat compile warnings as errors
|
--enable-werror treat compile warnings as errors
|
||||||
--enable-inprocess-agent
|
--enable-inprocess-agent
|
||||||
inprocess agent
|
inprocess agent
|
||||||
@ -4480,6 +4482,74 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Set the 'development' global.
|
||||||
|
. $srcdir/../development.sh
|
||||||
|
|
||||||
|
# Enable -lmcheck by default (it provides cheap-enough memory
|
||||||
|
# mangling), but turn it off for releases.
|
||||||
|
if $development; then
|
||||||
|
libmcheck_default=yes
|
||||||
|
else
|
||||||
|
libmcheck_default=no
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
if test -z "${ENABLE_LIBMCHECK}"; then
|
||||||
|
ENABLE_LIBMCHECK=${libmcheck_default}
|
||||||
|
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 :
|
||||||
|
$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
|
||||||
|
|
||||||
|
|
||||||
# Dependency checking.
|
# Dependency checking.
|
||||||
rm -rf .tst 2>/dev/null
|
rm -rf .tst 2>/dev/null
|
||||||
mkdir .tst 2>/dev/null
|
mkdir .tst 2>/dev/null
|
||||||
|
@ -41,6 +41,18 @@ AC_HEADER_DIRENT
|
|||||||
|
|
||||||
AC_FUNC_ALLOCA
|
AC_FUNC_ALLOCA
|
||||||
|
|
||||||
|
# Set the 'development' global.
|
||||||
|
. $srcdir/../development.sh
|
||||||
|
|
||||||
|
# Enable -lmcheck by default (it provides cheap-enough memory
|
||||||
|
# mangling), but turn it off for releases.
|
||||||
|
if $development; then
|
||||||
|
libmcheck_default=yes
|
||||||
|
else
|
||||||
|
libmcheck_default=no
|
||||||
|
fi
|
||||||
|
GDB_AC_LIBMCHECK(${libmcheck_default})
|
||||||
|
|
||||||
# Dependency checking.
|
# Dependency checking.
|
||||||
ZW_CREATE_DEPDIR
|
ZW_CREATE_DEPDIR
|
||||||
ZW_PROG_COMPILER_DEPENDENCIES([CC])
|
ZW_PROG_COMPILER_DEPENDENCIES([CC])
|
||||||
|
43
gdb/libmcheck.m4
Normal file
43
gdb/libmcheck.m4
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
dnl Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
||||||
|
dnl
|
||||||
|
dnl This file is part of GDB.
|
||||||
|
dnl
|
||||||
|
dnl This program is free software; you can redistribute it and/or modify
|
||||||
|
dnl it under the terms of the GNU General Public License as published by
|
||||||
|
dnl the Free Software Foundation; either version 3 of the License, or
|
||||||
|
dnl (at your option) any later version.
|
||||||
|
dnl
|
||||||
|
dnl This program is distributed in the hope that it will be useful,
|
||||||
|
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
dnl GNU General Public License for more details.
|
||||||
|
dnl
|
||||||
|
dnl You should have received a copy of the GNU General Public License
|
||||||
|
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
dnl GDB_AC_LIBMCHECK([DEFAULT])
|
||||||
|
dnl Provide an --enable-libmcheck/--disable-libmcheck set of options
|
||||||
|
dnl allowing a user to enable this option even when building releases,
|
||||||
|
dnl or to disable it when building a snapshot.
|
||||||
|
dnl DEFAULT (yes/no) is used as default if the user doesn't set
|
||||||
|
dnl the option explicitly.
|
||||||
|
|
||||||
|
AC_DEFUN([GDB_AC_LIBMCHECK],
|
||||||
|
[
|
||||||
|
AC_ARG_ENABLE(libmcheck,
|
||||||
|
AS_HELP_STRING([--enable-libmcheck],
|
||||||
|
[Try linking 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])
|
||||||
|
|
||||||
|
if test -z "${ENABLE_LIBMCHECK}"; then
|
||||||
|
ENABLE_LIBMCHECK=[$1]
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$ENABLE_LIBMCHECK" = "yes" ; then
|
||||||
|
AC_CHECK_LIB(mcheck, main)
|
||||||
|
fi
|
||||||
|
])
|
Loading…
x
Reference in New Issue
Block a user