Move construction of IA-32 vector types to i386-tdep.c.
[deliverable/binutils-gdb.git] / gdb / configure.ac
index 55e19c410c2c0110653cba9fd04514df818d4d98..6113b0dc89fde4cd41deba39457fa5b094d02ef0 100644 (file)
@@ -34,14 +34,6 @@ AM_PROG_CC_STDC
 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
 AC_CANONICAL_SYSTEM
 
-# FIXME: kettenis/20030102: The AC_PROG_RANLIB from Autoconf 2.13
-# 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
-# 2.5x.
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-
 dnl List of object files and targets accumulated by configure.
 
 CONFIG_OBS=
@@ -202,7 +194,7 @@ AC_ARG_ENABLE(gdbtk,
     *)
       AC_MSG_ERROR([bad value $enableval for --enable-gdbtk]) ;;
   esac],
-  [if test -d $srcdir/gdbtk; then
+  [if test -d $srcdir/gdbtk -a -d $srcdir/../itcl; then
     enable_gdbtk=yes
   else
     enable_gdbtk=no
@@ -409,30 +401,31 @@ case $host_os in
     fi ;;
 esac
 AC_CHECK_HEADERS(curses.h cursesX.h ncurses.h ncurses/ncurses.h)
-AC_CHECK_HEADERS(ncurses/term.h term.h)
+AC_CHECK_HEADERS(ncurses/term.h)
+AC_CHECK_HEADERS(term.h, [], [],
+[#if HAVE_CURSES_H
+# include <curses.h>
+#endif
+])
 
 # FIXME: kettenis/20030102: In most cases we include these
 # unconditionally, so what's the point in checking these?
 AC_CHECK_HEADERS(ctype.h time.h)
 
-dnl Check for struct stat with an st_blocks member
-AC_MSG_CHECKING(for member st_blocks in struct stat)
-AC_CACHE_VAL(gdb_cv_have_struct_stat_with_st_blocks_member,
-  [AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/stat.h>],
-                  [struct stat st; (void) st.st_blocks;],
-                  gdb_cv_have_struct_stat_with_st_blocks_member=yes,
-                  gdb_cv_have_struct_stat_with_st_blocks_member=no)])
-AC_MSG_RESULT($gdb_cv_have_struct_stat_with_st_blocks_member)
-if test $gdb_cv_have_struct_stat_with_st_blocks_member = yes; then
-  AC_DEFINE(HAVE_STRUCT_STAT_ST_BLOCKS)
-fi
-
 # ------------------------- #
 # Checks for declarations.  #
 # ------------------------- #
 
-gcc_AC_CHECK_DECLS(getopt)
+AC_CHECK_DECLS([free, malloc, realloc])
+AC_CHECK_DECLS([strerror, strstr])
+AC_CHECK_DECLS(getopt)
+
+# ----------------------- #
+# Checks for structures.  #
+# ----------------------- #
+
+AC_CHECK_MEMBERS([struct stat.st_blocks])
+AC_CHECK_MEMBERS([struct stat.st_blksize])
 
 # ------------------ #
 # Checks for types.  #
@@ -455,6 +448,7 @@ AC_FUNC_ALLOCA
 AC_FUNC_MMAP
 AC_FUNC_VFORK
 AC_CHECK_FUNCS(canonicalize_file_name realpath)
+AC_CHECK_FUNCS(getuid getgid)
 AC_CHECK_FUNCS(poll)
 AC_CHECK_FUNCS(pread64)
 AC_CHECK_FUNCS(sbrk)
@@ -479,7 +473,7 @@ gdb_ptrace_headers='
 #endif
 '
 # There is no point in checking if we don't have a prototype.
-gcc_AC_CHECK_DECLS(ptrace, , [
+AC_CHECK_DECLS(ptrace, [], [
   : ${gdb_cv_func_ptrace_ret='int'}
   : ${gdb_cv_func_ptrace_args='int,int,long,long'}
 ], $gdb_ptrace_headers)
@@ -589,15 +583,11 @@ if test "$gdb_with_regex" = yes; then
     [Define to 1 if the regex included in libiberty should be used.])
 fi
 
-# See if <sys/proc.h> defines `struct thread' with a td_pcb member.
-AC_CACHE_CHECK([for td_pcb in struct thread], gdb_cv_struct_thread_td_pcb,
-[AC_TRY_COMPILE([#include <sys/param.h>
-#include <sys/proc.h>], [struct thread td; td.td_pcb;],
-gdb_cv_struct_thread_td_pcb=yes, gdb_cv_struct_thread_td_pcb=no)])
-if test $gdb_cv_struct_thread_td_pcb = yes; then
-  AC_DEFINE(HAVE_STRUCT_THREAD_TD_PCB, 1,
-            [Define to 1 if your system has td_pcb in struct thread.])
-fi
+# Check if <sys/proc.h> defines `struct thread' with a td_pcb member.
+AC_CHECK_MEMBERS([struct thread.td_pcb], [], [],
+[#include <sys/param.h>
+#include <sys/proc.h>
+])
 
 # See if <sys/lwp.h> defines `struct lwp`.
 AC_CACHE_CHECK([for struct lwp], gdb_cv_struct_lwp,
@@ -621,18 +611,8 @@ fi
 
 # 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_reg_r_fs,
-[AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_fs;],
-gdb_cv_struct_reg_r_fs=yes, gdb_cv_struct_reg_r_fs=no)])
-if test $gdb_cv_struct_reg_r_fs = yes; then
-  AC_DEFINE(HAVE_STRUCT_REG_R_FS)
-fi
-AC_CACHE_CHECK([for r_gs in struct reg], gdb_cv_struct_reg_r_gs,
-[AC_TRY_COMPILE([#include <machine/reg.h>], [struct reg r; r.r_gs;],
-gdb_cv_struct_reg_r_gs=yes, gdb_cv_struct_reg_r_gs=no)])
-if test $gdb_cv_struct_reg_r_gs = yes; then
-  AC_DEFINE(HAVE_STRUCT_REG_R_GS)
-fi
+AC_CHECK_MEMBERS([struct reg.r_fs, struct reg.r_gs], [], [],
+                 [#include <machine/reg.h>])
 
 # See if <sys/ptrace.h> provides the PTRACE_GETREGS request.
 AC_MSG_CHECKING(for PTRACE_GETREGS)
@@ -696,34 +676,6 @@ 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)
-BFD_NEED_DECLARATION(free)
-BFD_NEED_DECLARATION(strerror)
-BFD_NEED_DECLARATION(strdup)
-BFD_NEED_DECLARATION(strstr)
-BFD_NEED_DECLARATION(canonicalize_file_name)
-
-# The following save_state_t checkery is only necessary for HPUX 
-# versions earlier than 10.20.  When those fade from memory, this 
-# could be expunged. --jsm 1999-03-22
-
-AC_MSG_CHECKING(for HPUX save_state structure)
-AC_EGREP_HEADER(save_state_t, machine/save_state.h, 
-                gdb_cv_hpux_savestate=yes, gdb_cv_hpux_savestate=no)
-AC_EGREP_HEADER(ss_wide, machine/save_state.h, gdb_cv_hpux_sswide=yes,
-                gdb_cv_hpux_sswide=no)
-if test $gdb_cv_hpux_savestate = yes
-then
-  AC_DEFINE(HAVE_STRUCT_SAVE_STATE_T, 1)
-fi
-if test $gdb_cv_hpux_sswide = yes
-then
-  AC_DEFINE(HAVE_STRUCT_MEMBER_SS_WIDE, 1)
-fi
-AC_MSG_RESULT($gdb_cv_hpux_sswide)
-
-
 # If we are configured native on GNU/Linux, work around problems with
 # sys/procfs.h
 # Also detect which type of /proc is in use, such as for Unixware or Solaris.
@@ -734,9 +686,6 @@ if test "${target}" = "${host}"; then
        AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
        AC_DEFINE(sys_quotactl)
        ;;
-  ia64-*-aix*)
-      AC_DEFINE(NEW_PROC_API)
-      ;;
   *-*-unixware* | *-*-sysv4.2* | *-*-sysv5* | *-*-interix* )
       AC_DEFINE(NEW_PROC_API)
       ;;
@@ -877,93 +826,88 @@ if test ${host} = ${target} ; then
   fi
 fi
 
-dnl See if compiler supports "long long" type.
+# Check if the compiler supports the `long long' type.
 
-AC_MSG_CHECKING(for long long support in compiler)
-AC_CACHE_VAL(gdb_cv_c_long_long,
-[AC_TRY_COMPILE(, [
-  extern long long foo;
-  switch (foo & 2) { case 0: return 1; }
-],
-gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
-AC_MSG_RESULT($gdb_cv_c_long_long)
+AC_CACHE_CHECK([for long long support in compiler], gdb_cv_c_long_long,
+               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[extern long long foo;]],
+[[switch (foo & 2) { case 0: return 1; }]])],
+                                  gdb_cv_c_long_long=yes,
+                                  gdb_cv_c_long_long=no)])
 if test $gdb_cv_c_long_long = yes; then
-  AC_DEFINE(CC_HAS_LONG_LONG)
+  AC_DEFINE(CC_HAS_LONG_LONG, 1,
+            [Define to 1 if the compiler supports long long.])
 fi
 
-dnl See if the compiler and runtime support printing long long
+# Check if the compiler and runtime support printing long longs.
 
-AC_MSG_CHECKING(for long long support in printf)
-AC_CACHE_VAL(gdb_cv_printf_has_long_long,
-[AC_TRY_RUN([
-int main () {
-  char buf[32];
+AC_CACHE_CHECK([for long long support in printf],
+               gdb_cv_printf_has_long_long,
+               [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+[[char buf[32];
   long long l = 0;
   l = (l << 16) + 0x0123;
   l = (l << 16) + 0x4567;
   l = (l << 16) + 0x89ab;
   l = (l << 16) + 0xcdef;
   sprintf (buf, "0x%016llx", l);
-  return (strcmp ("0x0123456789abcdef", buf));
-}],
-gdb_cv_printf_has_long_long=yes,
-gdb_cv_printf_has_long_long=no,
-gdb_cv_printf_has_long_long=no)])
+  return (strcmp ("0x0123456789abcdef", buf));]])],
+                              gdb_cv_printf_has_long_long=yes,
+                              gdb_cv_printf_has_long_long=no,
+                              gdb_cv_printf_has_long_long=no)])
 if test $gdb_cv_printf_has_long_long = yes; then
-  AC_DEFINE(PRINTF_HAS_LONG_LONG)
+  AC_DEFINE(PRINTF_HAS_LONG_LONG, 1,
+            [Define to 1 if the "%ll" format works to print long longs.])
 fi
-AC_MSG_RESULT($gdb_cv_printf_has_long_long)
-
-dnl See if compiler supports "long double" type.  Can't use AC_C_LONG_DOUBLE
-dnl because autoconf complains about cross-compilation issues.  However, this
-dnl code uses the same variables as the macro for compatibility.
-
-AC_MSG_CHECKING(for long double support in compiler)
-AC_CACHE_VAL(ac_cv_c_long_double,
-[AC_TRY_COMPILE(, [long double foo;],
-ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
-AC_MSG_RESULT($ac_cv_c_long_double)
-if test $ac_cv_c_long_double = yes; then
-  AC_DEFINE(HAVE_LONG_DOUBLE)
+
+# Check if the compiler supports the `long double' type.  We can't use
+# AC_C_LONG_DOUBLE because that one does additional checks on the
+# constants defined in <float.h> that fail on some systems,
+# e.g. FreeBSD/i386 4.7 and OpenBSD/i386 3.6.
+
+AC_CACHE_CHECK([for long double support in compiler], gdb_cv_c_long_double,
+               [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[long double foo;]])],
+                                  gdb_cv_c_long_double=yes,
+                                  gdb_cv_c_long_double=no)])
+if test $gdb_cv_c_long_double = yes; then
+  AC_DEFINE(HAVE_LONG_DOUBLE, 1,
+           [Define to 1 if the compiler supports long double.])
 fi
 
-dnl See if the compiler and runtime support printing long doubles
+# Check if the compiler and runtime support printing long doubles.
 
-AC_MSG_CHECKING(for long double support in printf)
-AC_CACHE_VAL(gdb_cv_printf_has_long_double,
-[AC_TRY_RUN([
-int main () {
-  char buf[16];
+AC_CACHE_CHECK([for long double support in printf],
+               gdb_cv_printf_has_long_double,
+               [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+[[char buf[16];
   long double f = 3.141592653;
   sprintf (buf, "%Lg", f);
-  return (strncmp ("3.14159", buf, 7));
-}],
-gdb_cv_printf_has_long_double=yes,
-gdb_cv_printf_has_long_double=no,
-gdb_cv_printf_has_long_double=no)])
+  return (strncmp ("3.14159", buf, 7));]])],
+                              gdb_cv_printf_has_long_double=yes,
+                              gdb_cv_printf_has_long_double=no,
+                              gdb_cv_printf_has_long_double=no)])
 if test $gdb_cv_printf_has_long_double = yes; then
-  AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
+  AC_DEFINE(PRINTF_HAS_LONG_DOUBLE, 1,
+            [Define to 1 if the "%Lg" format works to print long doubles.])
 fi
-AC_MSG_RESULT($gdb_cv_printf_has_long_double)
 
-dnl See if the compiler and runtime support scanning long doubles
+# Check if the compiler and runtime support scanning long doubles.
 
-AC_MSG_CHECKING(for long double support in scanf)
-AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
-[AC_TRY_RUN([
-int main () {
-  char *buf = "3.141592653";
+AC_CACHE_CHECK([for long double support in scanf], 
+               gdb_cv_scanf_has_long_double,
+               [AC_RUN_IFELSE([AC_LANG_PROGRAM(
+[[#include <stdio.h>]],
+[[char *buf = "3.141592653";
   long double f = 0;
   sscanf (buf, "%Lg", &f);
-  return !(f > 3.14159 && f < 3.14160);
-}],
-gdb_cv_scanf_has_long_double=yes,
-gdb_cv_scanf_has_long_double=no,
-gdb_cv_scanf_has_long_double=no)])
+  return !(f > 3.14159 && f < 3.14160);]])],
+                              gdb_cv_scanf_has_long_double=yes,
+                              gdb_cv_scanf_has_long_double=no,
+                              gdb_cv_scanf_has_long_double=no)])
 if test $gdb_cv_scanf_has_long_double = yes; then
-  AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
+  AC_DEFINE(SCANF_HAS_LONG_DOUBLE, 1,
+            [Define to 1 if the "%Lg" format works to scan long doubles.])
 fi
-AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
 
 case ${host_os} in
 aix*)
@@ -1146,8 +1090,21 @@ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
 # NOTE: If you add to this list, remember to update
 # gdb/doc/gdbint.texinfo.
 build_warnings="-Wimplicit -Wreturn-type -Wcomment -Wtrigraphs \
--Wformat -Wparentheses -Wpointer-arith -Wuninitialized -Wformat-nonliteral \
+-Wformat -Wparentheses -Wpointer-arith -Wformat-nonliteral \
 -Wunused-label -Wunused-function"
+
+# GCC supports -Wuninitialized only with -O or -On, n != 0.
+if test x${CFLAGS+set} = xset; then
+  case "${CFLAGS}" in
+    *"-O0"* ) ;;
+    *"-O"* )
+      build_warnings="${build_warnings} -Wuninitialized"
+    ;;
+  esac
+else
+  build_warnings="${build_warnings} -Wuninitialized"
+fi
+
 # Up for debate: -Wswitch -Wcomment -trigraphs -Wtrigraphs
 # -Wunused-function -Wunused-variable -Wunused-value
 # -Wchar-subscripts -Wtraditional -Wshadow -Wcast-qual
@@ -1213,10 +1170,11 @@ lose
 
 
 dnl Figure out which of the many generic ser-*.c files the _host_ supports.
-SER_HARDWIRE="ser-unix.o ser-pipe.o ser-tcp.o"
+SER_HARDWIRE="ser-base.o ser-unix.o ser-pipe.o ser-tcp.o"
 case ${host} in
   *go32* ) SER_HARDWIRE=ser-go32.o ;;
   *djgpp* ) SER_HARDWIRE=ser-go32.o ;;
+  *mingw32*) SER_HARDWIRE="ser-base.o ser-tcp.o" ;;
 esac
 AC_SUBST(SER_HARDWIRE)
 
@@ -1307,15 +1265,6 @@ if test "${enable_gdbtk}" = "yes"; then
            fi
 
            ENABLE_CFLAGS="${ENABLE_CFLAGS} \$(SUBDIR_GDBTK_CFLAGS)"
-          # Tcl/Tk 8.1 require -fwritable strings.  I don't
-           # know whether 8.2 will or not, but I bet it will.
-           # I don't have to worry about 7.x since we don't support it.
-           GDBTK_CFLAGS=""
-          if test "$GCC" = "yes"; then
-               if test "$TCL_VERSION" != "8.0" ; then
-                   GDBTK_CFLAGS="-fwritable-strings"
-              fi
-           fi
 
           # Include some libraries that Tcl and Tk want.
           TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
@@ -1503,6 +1452,17 @@ if test "x$target" = "x$host"; then
   fi
 fi
 
+# We build rdi-share on ARM-based targets, as instructed by configure.tgt.
+if test "x$build_rdi_share" = xyes; then
+   AC_CONFIG_SUBDIRS(rdi-share)
+fi
+
+# We configure the nlm subdirectory on netware targets, as instructed
+# by configure.tgt.
+if test "x$build_nlm" = xyes; then
+   AC_CONFIG_SUBDIRS(nlm)
+fi
+
 # If hostfile (XM_FILE) and/or targetfile (DEPRECATED_TM_FILE) and/or
 # nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
 # to an empty version.
This page took 0.029406 seconds and 4 git commands to generate.