revert 1.9. Not approved.
[deliverable/binutils-gdb.git] / gdb / configure.in
index b883fbfc1a4ddc791c271f83d303882274958f65..5f112c0854e3dc4e6fbb1952687fe217a3990b84 100644 (file)
@@ -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
@@ -88,6 +89,14 @@ AC_TYPE_SIGNAL
 
 AC_HEADER_STDC
 
+dnl Solaris 7 needs _MSE_INT_H defined to avoid a clash between <widec.h>
+dnl and <wchar.h> that causes AC_CHECK_HEADERS to think <curses.h> doesn't
+dnl exist.
+
+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 \
        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 \
@@ -176,10 +185,7 @@ if test "${target}" = "${host}"; then
   *-*-unixware* | *-*-sysv4.2* | *-*-sysv5*)
       AC_DEFINE(NEW_PROC_API)
       ;;
-  # FIXME: we would like to define NEW_PROC_API for all versions of
-  # Solaris from 2.6 on... but it isn't quite working yet.  Seems
-  # to work on sparc 2.6, so let's try it out there.
-  sparc-sun-solaris2.6)
+  *-*-solaris2.[[678]])
       AC_DEFINE(NEW_PROC_API)
       ;;
   esac
@@ -195,6 +201,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)
@@ -447,15 +479,16 @@ esac])
 if test "${enable_netrom}" = "yes"; then
        CONFIG_OBS="${CONFIG_OBS} remote-nrom.o" 
         CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
-       CONFIG_INITS="${CONFIG_INITS} remote-nrom.c"
 fi
 
+
+build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
+-Wformat -Wparentheses -Wpointer-arith"
+# Not yet: -Wall -Wpointer-arith -Wstrict-prototypes
+# -Wmissing-prototypes -Wmissing-declarations
 AC_ARG_ENABLE(build-warnings,
 [  --enable-build-warnings Enable build-time compiler warnings if gcc is used],
-[
-# not yet: -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith"
-case "${enableval}" in
+[case "${enableval}" in
   yes) ;;
   no)  build_warnings="-w";;
   ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
@@ -466,7 +499,7 @@ case "${enableval}" in
 esac
 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
   echo "Setting warning flags = $build_warnings" 6>&1
-fi
+fi])dnl
 WARN_CFLAGS=""
 WERROR_CFLAGS=""
 if test "x${build_warnings}" != x -a "x$GCC" = xyes
@@ -479,8 +512,7 @@ then
     *) WARN_CFLAGS="${WARN_CFLAGS} $w"
     esac
   done
-fi],[build_warnings=""])dnl
-
+fi
 AC_SUBST(WARN_CFLAGS)
 AC_SUBST(WERROR_CFLAGS)
 
@@ -504,6 +536,37 @@ if test x$want_mmalloc = xtrue; then
    MMALLOC='../mmalloc/libmmalloc.a'
 fi
 
+AC_ARG_WITH(included-regex,
+[  --with-included-regex          Use included regex],
+[case "${withval}" in
+  yes)  want_included_regex=true ;;
+  no)   want_included_regex=false;;
+  *)    AC_MSG_ERROR(bad value ${withval} for GDB with-included-regex option) ;;
+esac],[want_included_regex=true])dnl
+
+if test $want_included_regex = false; then
+  AC_MSG_CHECKING(for GNU regex)
+  AC_CACHE_VAL(gdb_cv_have_gnu_regex,
+[AC_TRY_COMPILE([#include <gnu-versions.h>
+#include <sys/types.h>
+#include <regex.h>],
+[#if !defined _GNU_REGEX_INTERFACE_VERSION || !defined __GLIBC__ || __GLIBC__ < 2
+#error No valid GNU regex.
+#endif
+],
+               [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 = 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)
 
 # In the Cygwin environment, we need some additional flags.
 AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
@@ -811,7 +874,7 @@ if test "${shared}" = "true"; then
     ;;
   *-*-linux*aout*)
     ;;
-  *-*-linux* | *-pc-linux-gnu)
+  *-*-linux* | *-pc-linux-gnu*)
     HLDFLAGS='-Wl,-rpath,$(libdir)'
     ;;
   *-*-solaris*)
This page took 0.025718 seconds and 4 git commands to generate.