diff options
Diffstat (limited to 'gdb/configure.in')
-rw-r--r-- | gdb/configure.in | 122 |
1 files changed, 91 insertions, 31 deletions
diff --git a/gdb/configure.in b/gdb/configure.in index 4d475140cde..63264bb9261 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -22,6 +22,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13)dnl AC_INIT(main.c) AC_CONFIG_HEADER(config.h:config.in) +AM_MAINTAINER_MODE AC_PROG_CC AC_AIX @@ -96,12 +97,14 @@ case $host_os in solaris2.7) case "$GCC" in yes) AC_DEFINE(_MSE_INT_H) esac; esac -AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h thread_db.h proc_service.h \ +AC_CHECK_HEADERS(ctype.h endian.h link.h thread_db.h proc_service.h \ memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \ string.h sys/procfs.h sys/ptrace.h sys/reg.h stdint.h \ term.h termio.h termios.h unistd.h wait.h sys/wait.h \ wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \ - time.h sys/ioctl.h) + time.h sys/ioctl.h sys/user.h \ + dirent.h sys/ndir.h sys/dir.h ndir.h \ + curses.h ncurses.h) AC_HEADER_STAT AC_C_CONST @@ -109,6 +112,21 @@ AC_C_CONST AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll sigprocmask) AC_FUNC_ALLOCA +# See if machine/reg.h supports the %fs and %gs i386 segment registers. +# Older i386 BSD's don't have the r_fs and r_gs members of `struct reg'. +AC_CACHE_CHECK([for r_fs in struct reg], gdb_cv_struct_r_fs, +[AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_fs;], +gdb_cv_struct_r_fs=yes, gdb_cv_struct_r_fs=no)]) +if test $gdb_cv_struct_r_fs = yes; then + AC_DEFINE(HAVE_R_FS) +fi +AC_CACHE_CHECK([for r_gs in struct reg], gdb_cv_struct_r_gs, +[AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_gs;], +gdb_cv_struct_r_gs=yes, gdb_cv_struct_r_gs=no)]) +if test $gdb_cv_struct_r_gs = yes; then + AC_DEFINE(HAVE_R_GS) +fi + dnl See if ptrace.h provides the PTRACE_GETREGS request. AC_MSG_CHECKING(for PTRACE_GETREGS) AC_CACHE_VAL(gdb_cv_have_ptrace_getregs, @@ -200,6 +218,32 @@ if test "$ac_cv_header_sys_procfs_h" = yes; then BFD_HAVE_SYS_PROCFS_TYPE(lwpid_t) BFD_HAVE_SYS_PROCFS_TYPE(psaddr_t) + dnl Check for broken prfpregset_t type + + dnl For Linux/i386, glibc 2.1.3 was released with a bogus + dnl prfpregset_t type (it's a typedef for the pointer to a struct + dnl instead of the struct itself). We detect this here, and work + dnl around it in lin-thread.c. + + if test $bfd_cv_have_sys_procfs_type_prfpregset_t = yes; then + AC_MSG_CHECKING(whether prfpregset_t type is broken) + AC_CACHE_VAL(gdb_cv_prfpregset_t_broken, + [AC_TRY_RUN([#include <sys/procfs.h> + int main () + { + if (sizeof (prfpregset_t) == sizeof (void *)) + return 1; + return 0; + }], + gdb_cv_prfpregset_t_broken=no, + gdb_cv_prfpregset_t_broken=yes, + gdb_cv_prfpregset_t_broken=yes)]) + AC_MSG_RESULT($gdb_cv_prfpregset_t_broken) + if test $gdb_cv_prfpregset_t_broken = yes; then + AC_DEFINE(PRFPREGSET_T_BROKEN) + fi + fi + dnl Check for PIOCSET ioctl entry AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h) @@ -429,17 +473,19 @@ AC_ARG_ENABLE(tui, ]) case ${enable_tui} in "yes" ) - AC_DEFINE(TUI) - BUILD_TUI=all-tui - TUI_LIBRARY=tui/libtui.a - ;; - * ) - BUILD_TUI= - TUI_LIBRARY= - ;; + if test -d "${srcdir}/tui" ; then + CONFIG_OBS="${CONFIG_OBS} \$(SUBDIR_TUI_OBS)" + CONFIG_DEPS="${CONFIG_DEPS} \$(SUBDIR_TUI_DEPS)" + CONFIG_SRCS="${CONFIG_SRS} \$(SUBDIR_TUI_SRCS)" + CONFIG_INITS="${CONFIG_INITS} \$(SUBDIR_TUI_INITS)" + ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_TUI_CFLAGS)" + CONFIG_ALL="${CONFIG_ALL} \$(SUBDIR_TUI_ALL)" + CONFIG_CLEAN="${CONFIG_CLEAN} \$(SUBDIR_TUI_CLEAN)" + CONFIG_INSTALL="${CONFIG_INSTALL} \$(SUBDIR_TUI_INSTALL)" + CONFIG_UNINSTALL="${CONFIG_UNINSTALL} \$(SUBDIR_TUI_UNINSTALL)" + fi + ;; esac -AC_SUBST(BUILD_TUI) -AC_SUBST(TUI_LIBRARY) AC_ARG_ENABLE(netrom, [ --enable-netrom Enable NetROM support], @@ -455,10 +501,16 @@ if test "${enable_netrom}" = "yes"; then fi +# Don't add -Wall or -Wunused, they include -Wunused-parameter which +# causes noise. build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \ --Wformat -Wparentheses -Wpointer-arith" -# Not yet: -Wall -Wpointer-arith -Wstrict-prototypes -# -Wmissing-prototypes -Wmissing-declarations +-Wformat -Wparentheses -Wpointer-arith -Wuninitialized" +# Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs +# -Wunused-function -Wunused-label -Wunused-variable -Wunused-value +# -Wchar-subscripts -Wuninitialized -Wtraditional -Wshadow -Wcast-qual +# -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes +# -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls +# -Woverloaded-virtual -Winline -Werror" AC_ARG_ENABLE(build-warnings, [ --enable-build-warnings Enable build-time compiler warnings if gcc is used], [case "${enableval}" in @@ -471,20 +523,27 @@ AC_ARG_ENABLE(build-warnings, *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; esac if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then - echo "Setting warning flags = $build_warnings" 6>&1 + echo "Setting compiler warning flags = $build_warnings" 6>&1 fi])dnl WARN_CFLAGS="" WERROR_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes then - # Separate out the -Werror flag as some files just cannot be - # compiled with it enabled. - for w in ${build_warnings}; do - case $w in - -Werr*) WERROR_CFLAGS=-Werror ;; - *) WARN_CFLAGS="${WARN_CFLAGS} $w" - esac - done + AC_MSG_CHECKING(compiler warning flags) + # Separate out the -Werror flag as some files just cannot be + # compiled with it enabled. + for w in ${build_warnings}; do + case $w in + -Werr*) WERROR_CFLAGS=-Werror ;; + *) # Check that GCC accepts it + if $CC $w 2>&1 | grep 'unrecognized option' > /dev/null; then + : + else + WARN_CFLAGS="${WARN_CFLAGS} $w" + fi + esac + done + AC_MSG_RESULT(${WARN_CFLAGS}${WERROR_CFLAGS}) fi AC_SUBST(WARN_CFLAGS) AC_SUBST(WERROR_CFLAGS) @@ -517,8 +576,6 @@ AC_ARG_WITH(included-regex, *) AC_MSG_ERROR(bad value ${withval} for GDB with-included-regex option) ;; esac],[want_included_regex=true])dnl -REGEX="gnu-regex.o" -REGEX_CFLAGS="-DUSE_INCLUDED_REGEX" if test $want_included_regex = false; then AC_MSG_CHECKING(for GNU regex) AC_CACHE_VAL(gdb_cv_have_gnu_regex, @@ -532,13 +589,16 @@ if test $want_included_regex = false; then [gdb_cv_have_gnu_regex=yes], [gdb_cv_have_gnu_regex=no])]) AC_MSG_RESULT($gdb_cv_have_gnu_regex) - if test $gdb_cv_have_gnu_regex = yes; then - REGEX= - REGEX_CFLAGS= + if test $gdb_cv_have_gnu_regex = no; then + want_included_regex=true fi fi + +if test x${want_included_regex} = xtrue; then + REGEX="gnu-regex.o" + AC_DEFINE(USE_INCLUDED_REGEX) +fi AC_SUBST(REGEX) -AC_SUBST(REGEX_CFLAGS) # In the Cygwin environment, we need some additional flags. AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin, @@ -973,7 +1033,7 @@ dnl Check for exe extension set on certain hosts (e.g. Win32) AC_EXEEXT AC_CONFIG_SUBDIRS($configdirs) -AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in, +AC_OUTPUT(Makefile .gdbinit:gdbinit.in, [ dnl Autoconf doesn't provide a mechanism for modifying definitions dnl provided by makefile fragments. |