AM_MAINTAINER_MODE
AC_PROG_CC
+AC_GNU_SOURCE
AC_AIX
AC_ISC_POSIX
AM_PROG_CC_STDC
# doesn't support cross-compilation, but the one from Autoconf 2.5x
# does. Override RANLIB here (i.e. before running AC_PROG_RANLIB) to
# deal with the lossage. Note that CY_GNU_GETTEXT currently calls
-# AC_PROG_RANLIB. This can be removed when we switch to # Autoconf
+# AC_PROG_RANLIB. This can be removed when we switch to Autoconf
# 2.5x.
AC_CHECK_TOOL(RANLIB, ranlib, :)
CY_GNU_GETTEXT
AC_DEFINE(PACKAGE, "gdb", [Name of this package. ])
+debugdir=${libdir}/debug
+
+AC_ARG_WITH(separate-debug-dir,
+[ --with-separate-debug-dir=path Look for global separate debug info in this path [LIBDIR/debug]],
+[debugdir="${withval}"])
+
+AC_DEFINE_DIR(DEBUGDIR, debugdir,
+ [Global directory for separate debug files. ])
+#AC_DEFINE_UNQUOTED(DEBUGDIR, "$debugdir"),
dnl List of object files added by configure.
CONFIG_INSTALL=
CONFIG_UNINSTALL=
-SUBDIRS="doc testsuite nlm"
-configdirs="doc testsuite"
-
-AC_ARG_ENABLE(multi-ice,
-[ --enable-multi-ice Build the multi-ice-gdb-server],
-[case "${enableval}" in
- yes ) enable_multi_ice="yes" ;;
- no) enable_multi_ice="no" ;;
- *) AC_MSG_ERROR(Bad value for --enable-multi-ice: ${enableval}) ;;
- esac
-])
-
-if test "${enable_multi_ice}" = "yes"; then
- configdirs="${configdirs} multi-ice"
-fi
+AC_CONFIG_SUBDIRS(doc testsuite)
+configdirs=
. $srcdir/configure.host
fi
fi
+# Enable gdbtk.
+AC_ARG_ENABLE(gdbtk,
+[ --enable-gdbtk enable gdbtk graphical user interface (GUI)],
+ [case $enableval in
+ yes | no)
+ ;;
+ *)
+ AC_MSG_ERROR([bad value $enableval for --enable-gdbtk]) ;;
+ esac],
+ [if test -d $srcdir/gdbtk; then
+ enable_gdbtk=yes
+ else
+ enable_gdbtk=no
+ fi])
+# We unconditionally disable gdbtk tests on selected platforms.
+case $host_os in
+ go32* | windows*)
+ AC_MSG_WARN([gdbtk isn't supported on $host; disabling])
+ enable_gdbtk=no ;;
+esac
+
+# Profiling support.
+AC_ARG_ENABLE(profiling,
+[ --enable-profiling enable profiling of GDB],
+ [case $enableval in
+ yes | no)
+ ;;
+ *)
+ AC_MSG_ERROR([bad value $enableval for --enable-profile]) ;;
+ esac],
+ [enable_profiling=no])
+
+AC_CHECK_FUNCS(monstartup _mcleanup)
+AC_CACHE_CHECK([for _etext], ac_cv_var__etext,
+[AC_TRY_LINK(
+[#include <stdlib.h>
+extern char _etext;
+],
+[free (&_etext);], ac_cv_var__etext=yes, ac_cv_var__etext=no)])
+if test $ac_cv_var__etext = yes; then
+ AC_DEFINE(HAVE__ETEXT, 1,
+ [Define to 1 if your system has the _etext variable. ])
+fi
+if test "$enable_profiling" = yes ; then
+ if test $ac_cv_func_monstartup = no || test $ac_cv_func__mcleanup = no; then
+ AC_MSG_ERROR(--enable-profiling requires monstartup and _mcleanup)
+ fi
+ PROFILE_CFLAGS=-pg
+ OLD_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PROFILE_CFLAGS"
+
+ AC_CACHE_CHECK([whether $CC supports -pg], ac_cv_cc_supports_pg,
+ [AC_TRY_COMPILE([], [int x;], ac_cv_cc_supports_pg=yes,
+ ac_cv_cc_supports_pg=no)])
+
+ if test $ac_cv_cc_supports_pg = no; then
+ AC_MSG_ERROR(--enable-profiling requires a compiler which supports -pg)
+ fi
+
+ CFLAGS="$OLD_CFLAGS"
+fi
+
# --------------------- #
# Checks for programs. #
# --------------------- #
AC_FUNC_VFORK
AC_CHECK_FUNCS(canonicalize_file_name realpath)
AC_CHECK_FUNCS(poll)
+AC_CHECK_FUNCS(pread64)
AC_CHECK_FUNCS(sbrk)
AC_CHECK_FUNCS(setpgid setpgrp)
AC_CHECK_FUNCS(sigaction sigprocmask sigsetmask)
AC_DEFINE(HAVE_PT_GETXMMREGS)
fi
+# See if stdint.h provides the uintptr_t type.
+# Autoconf 2.5X has an improved AC_CHECK_TYPE which will simplify this.
+AC_CACHE_CHECK([for uintptr_t in stdint.h], gdb_cv_have_uintptr_t,
+ [AC_TRY_COMPILE(
+ [#include <stdint.h>],
+ [uintptr_t foo = 0;],
+ gdb_cv_have_uintptr_t=yes,
+ gdb_cv_have_uintptr_t=no)])
+AC_MSG_RESULT($gdb_cv_have_uintptr_t)
+if test $gdb_cv_have_uintptr_t = yes; then
+ AC_DEFINE(HAVE_UINTPTR_T, 1, [Define if <stdint.h> provides the uintptr_t type.])
+fi
BFD_NEED_DECLARATION(malloc)
BFD_NEED_DECLARATION(realloc)
[Define if <thread_db.h> has the TD_NOTALLOC error code.])
fi
-dnl linux-proc.c wants to use pread64, which may require special CFLAGS
-dnl -D_BSD_SOURCE is normally assumed but we have to specify it because of
-dnl -D_XOPEN_SOURCE=500.
-if test $host = $target; then
- case $target in
- *-linux*)
- save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
- AC_TRY_LINK([#include <unistd.h>],
- [pread64 (0, NULL, 0, 0);],
- [ENABLE_CFLAGS="$ENABLE_CFLAGS -D_BSD_SOURCE -D_XOPEN_SOURCE=500 -D_LARGEFILE64_SOURCE"
- AC_DEFINE(HAVE_PREAD64)], [])
- CFLAGS=$save_CFLAGS
- ;;
- esac
-fi
-
dnl Handle optional features that can be enabled.
-AC_ARG_ENABLE(netrom,
-[ --enable-netrom Enable NetROM support],
-[case "${enableval}" in
-yes) enable_netrom=yes ;;
-no) enable_netrom=no ;;
-*) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
-esac])
-
-if test "${enable_netrom}" = "yes"; then
- CONFIG_LIB_OBS="${CONFIG_LIB_OBS} remote-nrom.o"
- CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
-fi
+AC_ARG_WITH(sysroot,
+[ --with-sysroot[=DIR] Search for usr/lib et al within DIR.],
+[
+ case ${with_sysroot} in
+ yes) TARGET_SYSTEM_ROOT='${exec_prefix}/${target_alias}/sys-root' ;;
+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
+ esac
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+
+ if test "x$exec_prefix" = xNONE; then
+ if test "x$prefix" = xNONE; then
+ test_prefix=/usr/local
+ else
+ test_prefix=$prefix
+ fi
+ else
+ test_prefix=$exec_prefix
+ fi
+ case ${TARGET_SYSTEM_ROOT} in
+ "${test_prefix}"|"${test_prefix}/"*|\
+ '${exec_prefix}'|'${exec_prefix}/'*)
+ t="$TARGET_SYSTEM_ROOT_DEFINE -DTARGET_SYSTEM_ROOT_RELOCATABLE"
+ TARGET_SYSTEM_ROOT_DEFINE="$t"
+ ;;
+ esac
+], [
+ TARGET_SYSTEM_ROOT=
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"\"'
+])
+AC_SUBST(TARGET_SYSTEM_ROOT)
+AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
# NOTE: Don't add -Wall or -Wunused, they both include
# -Wunused-parameter which reports bogus warnings.
AC_SUBST(LIBGUI)
AC_SUBST(GUI_CFLAGS_X)
-AC_ARG_WITH(cpu,
-[ --with-cpu=CPU Set the default CPU variant to debug],
-[case "${target}" in
- powerpc-* | powerpcle-* )
- ## It would be nice to keep this table in sync with the one in
- ## gcc/configure.
- case "${with_cpu}" in
- ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
- | 604 | 750 )
- ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
- ;;
- common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
- ## These are all RS6000 variants, as far as GDB is concerned.
- with_cpu=rs6000
- ;;
- 603e | ec603e )
- with_cpu=603
- ;;
- 604e )
- with_cpu=604
- ;;
- * )
- AC_MSG_WARN(GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'.)
- with_cpu=ppc-uisa
- ;;
- esac
- ;;
- * )
- AC_MSG_WARN(GDB may ignore the --with-cpu flag for ${target} targets)
- ;;
-esac
-AC_DEFINE_UNQUOTED(TARGET_CPU_DEFAULT, "${with_cpu}")
-],)
-
-
-AC_ARG_ENABLE(gdbtk,
-[ --enable-gdbtk Enable GDBTK GUI front end],
-[case "${enableval}" in
- yes)
- case "$host" in
- *go32*)
- AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
- enable_gdbtk=no ;;
- *windows*)
- AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
- enable_gdbtk=no ;;
- *)
- enable_gdbtk=yes ;;
- esac ;;
- no)
- enable_gdbtk=no ;;
- *)
- AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
-esac],
-[
-# Default is on for everything but go32 and Cygwin
-case "$host" in
- *go32* | *windows*)
- ;;
- *)
- if test -d "${srcdir}/gdbtk" ; then
- enable_gdbtk=yes
- fi
- ;;
-esac
-])
-
WIN32LDAPP=
AC_SUBST(WIN32LIBS)
AC_SUBST(WIN32LDAPP)
fi
fi
- SUBDIRS="${SUBDIRS} gdbtk"
configdirs="${configdirs} gdbtk"
fi
AC_SUBST(IGNORE_SIM_OBS)
AC_SUBST(ENABLE_CFLAGS)
+AC_SUBST(PROFILE_CFLAGS)
AC_SUBST(CONFIG_OBS)
AC_SUBST(CONFIG_LIB_OBS)
AC_SUBST(CONFIG_INSTALL)
AC_SUBST(CONFIG_UNINSTALL)
-# Begin stuff to support --enable-shared
-AC_ARG_ENABLE(shared,
-[ --enable-shared Use shared libraries],
-[case "${enableval}" in
- yes) shared=true ;;
- no) shared=false ;;
- *) shared=true ;;
-esac])dnl
-
-HLDFLAGS=
-HLDENV=
-# If we have shared libraries, try to set rpath reasonably.
-if test "${shared}" = "true"; then
- case "${host}" in
- *-*-hpux*)
- HLDFLAGS='-Wl,+s,+b,$(libdir)'
- ;;
- *-*-irix5* | *-*-irix6*)
- HLDFLAGS='-Wl,-rpath,$(libdir)'
- ;;
- *-*-linux*aout*)
- ;;
- *-*-linux* | *-pc-linux-gnu*)
- HLDFLAGS='-Wl,-rpath,$(libdir)'
- ;;
- *-*-solaris*)
- HLDFLAGS='-R $(libdir)'
- ;;
- *-*-sysv4*)
- HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
- ;;
- esac
-fi
-
-# On SunOS, if the linker supports the -rpath option, use it to
-# prevent ../bfd and ../opcodes from being included in the run time
-# search path.
-case "${host}" in
- *-*-sunos*)
- echo 'main () { }' > conftest.c
- ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
- if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
- :
- elif grep 'No such file' conftest.t >/dev/null 2>&1; then
- :
- elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
- :
- elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
- :
- elif test "${shared}" = "true"; then
- HLDFLAGS='-Wl,-rpath=$(libdir)'
- else
- HLDFLAGS='-Wl,-rpath='
- fi
- rm -f conftest.t conftest.c conftest
- ;;
-esac
-AC_SUBST(HLDFLAGS)
-AC_SUBST(HLDENV)
-# End stuff to support --enable-shared
-
# target_subdir is used by the testsuite to find the target libraries.
target_subdir=
if test "${host}" != "${target}"; then
*) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
esac
-if test "${enable_multi_ice}" = "yes"; then
- SUBDIRS="${SUBDIRS} multi-ice"
+if test x"${gdb_osabi}" != x ; then
+ AC_DEFINE_UNQUOTED(GDB_OSABI_DEFAULT, $gdb_osabi,
+ [Define to the default OS ABI for this configuration.])
fi
-# ``gdbserver'' can only be built in a native configuration.
-if test x"${target}" = x"${host}"; then
- AC_MSG_CHECKING(whether gdbserver is supported on this host)
- if test x"${build_gdbserver}" = xyes ; then
- configdirs="${configdirs} gdbserver"
- SUBDIRS="${SUBDIRS} gdbserver"
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
+# Enable multi-ice-gdb-server.
+AC_ARG_ENABLE(multi-ice,
+[ --enable-multi-ice build the multi-ice-gdb-server],
+ [case $enableval in
+ yes | no)
+ ;;
+ *) AC_MSG_ERROR([bad value $enableval for --enable-multi-ice]) ;;
+ esac])
+if test "x$enable_multi_ice" = xyes; then
+ configdirs="$configdirs multi-ice"
fi
-AC_SUBST(SUBDIRS)
+# We only build gdbserver automatically if host and target are the same.
+if test "x$target" = "x$host"; then
+ AC_MSG_CHECKING(whether gdbserver is supported on this host)
+ if test "x$build_gdbserver" = xyes; then
+ configdirs="$configdirs gdbserver"
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+
+AC_CONFIG_SUBDIRS($configdirs)
# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
# (NAT_FILE) is not set in config/*/*.m[ht] files, we link to an empty
AM_ICONV
-AC_CONFIG_SUBDIRS($configdirs)
AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
[
dnl Autoconf doesn't provide a mechanism for modifying definitions