* README: Update for 4.16 release.
[binutils-gdb.git] / gdb / configure.in
index 959e7b4bb10d8b78fcd8d883faa0c8cca6288698..71ec9ec332ea84f5b56e5e15b406fd023d56b816 100644 (file)
@@ -15,12 +15,13 @@ 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, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.3)dnl
 AC_INIT(main.c)
+AC_CONFIG_HEADER(config.h:config.in)
 
 AC_PROG_CC
 AC_AIX
@@ -28,17 +29,71 @@ AC_MINIX
 AC_ISC_POSIX
 
 AC_PROG_INSTALL
-AC_PROG_RANLIB
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_PROG_YACC
+AC_PROG_AWK
 
 AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
 AC_HEADER_STDC
-AC_CHECK_HEADERS(memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h)
+AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h link.h endian.h)
 AC_HEADER_STAT
 
+AC_CHECK_FUNCS(setpgid sbrk)
+
+AC_MSG_CHECKING([for gregset_t type])
+AC_CACHE_VAL(gdb_cv_have_gregset_t,
+[AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
+gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
+AC_MSG_RESULT($gdb_cv_have_gregset_t)
+if test $gdb_cv_have_gregset_t = yes; then
+  AC_DEFINE(HAVE_GREGSET_T)
+fi
+
+AC_MSG_CHECKING([for fpregset_t type])
+AC_CACHE_VAL(gdb_cv_have_fpregset_t,
+[AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
+gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
+AC_MSG_RESULT($gdb_cv_have_fpregset_t)
+if test $gdb_cv_have_fpregset_t = yes; then
+  AC_DEFINE(HAVE_FPREGSET_T)
+fi
+
+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)
+fi
+
+dnl See 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];
+  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)])
+if test $gdb_cv_printf_has_long_double = yes; then
+  AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
+fi
+AC_MSG_RESULT($gdb_cv_printf_has_long_double)
+
 AC_FUNC_MMAP
 
 dnl Handle optional features that can be enabled.
@@ -115,8 +170,16 @@ if test "${enable_gdbtk}" = "yes"; then
     AC_PATH_X
     AC_PATH_XTRA
 
-    CYGNUS_PATH_TK
-    CYGNUS_PATH_TCL
+    CY_AC_PATH_TCL
+    CY_AC_PATH_TK
+
+    # Look for dynamic linking libraries that Tcl might need.  This is
+    # only done for Tcl 7.5 and greater.  It would be good to look for and
+    # use the "configInfo" file that Tcl generates, but for now that is
+    # beyond us.
+    if test $tclmajor -ge 7 -a $tclminor -ge 5 ; then
+       AC_CHECK_LIB(dl, main, , AC_CHECK_LIB(dld, main))
+    fi
 
     ENABLE_GDBTK=1
 
@@ -139,7 +202,7 @@ if test "${enable_gdbtk}" = "yes"; then
 #
 # gdb linked statically w/ Solaris iff GCC is used, otherwise dynamic
 #
-            sparc-sun-solaris2*)
+            sparc*-sun-solaris2*)
                 if test "x$GCC" = "xyes";
                 then
                     X_LIBS="-Wl,-Bstatic -lX11 -lXext -lX11 -Wl,-Bdynamic -ldl -lw"
@@ -213,6 +276,7 @@ m88*)                       gdb_host_cpu=m88k ;;
 np1)                   gdb_host_cpu=gould ;;
 pyramid)               gdb_host_cpu=pyr ;;
 powerpc*)              gdb_host_cpu=powerpc ;;
+sparc64)               gdb_host_cpu=sparc ;;
 *)                     gdb_host_cpu=$host_cpu ;;
 
 esac
@@ -250,7 +314,9 @@ i[3456]86-*-linux*) gdb_host=linux ;;
 i[3456]86-*-lynxos*)   gdb_host=i386lynx ;;
 i[3456]86-*-mach3*)    gdb_host=i386m3 ;;
 i[3456]86-*-mach*)     gdb_host=i386mach ;;
+i[3456]86-*-gnu*)      gdb_host=i386gnu ;;
 i[3456]86-*-osf1mk*)   gdb_host=osf1mk ;;
+i[3456]86-*-sco3.2v5*) gdb_host=i386sco5 ;;
 i[3456]86-*-sco3.2v4*) gdb_host=i386sco4 ;;
 i[3456]86-*-sco*)      gdb_host=i386sco ;;
 i[3456]86-*-solaris*)  gdb_host=i386sol2 ;;
@@ -262,7 +328,7 @@ i[3456]86-*-unixware)       gdb_host=i386v4 ;;
 i[3456]86-*-sysv*)     gdb_host=i386v ;;
 i[3456]86-*-isc*)      gdb_host=i386v32 ;;
 i[3456]86-*-os9k)      gdb_host=i386os9k ;;
-i[3456]86-*-win32*)    gdb_host=win32 ;;
+i[3456]86-*-cygwin32)  gdb_host=cygwin32 ;;
 m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;;
 m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;;
 m68030-sony-*)         gdb_host=news1000 ;;
@@ -276,6 +342,7 @@ m68*-hp-bsd*)               gdb_host=hp300bsd ;;
 m68*-hp-hpux*)         gdb_host=hp300hpux ;;
 m68*-isi-*)            gdb_host=isi ;;
 m68*-*-lynxos*)                gdb_host=m68klynx ;;
+m68*-*-netbsd*)                gdb_host=nbsd ;;
 m68*-*-sysv4*)         gdb_host=m68kv4 ;;
 m68*-motorola-*)       gdb_host=delta68 ;;
 m68*-sony-*)           gdb_host=news ;;
@@ -311,7 +378,7 @@ ns32k-umax-*)               gdb_host=umax ;;
 ns32k-utek-sysv*)      gdb_host=merlin ;;
 
 powerpc-*-aix*)                gdb_host=aix ;;
-
+powerpcle-*-cygwin32)  gdb_host=cygwin32 ;;
 pn-*-*)                        gdb_host=pn ;;
 
 pyramid-*-*)           gdb_host=pyramid ;;
@@ -328,6 +395,7 @@ sparc-*-solaris2*)  gdb_host=sun4sol2 ;;
 sparc-*-sunos4*)       gdb_host=sun4os4 ;;
 sparc-*-sunos5*)       gdb_host=sun4sol2 ;;
 sparc-*-*)             gdb_host=sun4os4 ;;
+sparc64-*-*)           gdb_host=sun4sol2 ;;
 
 tahoe-*-*)             gdb_host=tahoe ;;
 
@@ -421,18 +489,21 @@ i[3456]86-*-sunos*)       gdb_target=sun386 ;;
 i[3456]86-*-sysv4*)    gdb_target=i386v4 ;;
 i[3456]86-*-sco*)      gdb_target=i386v ;;
 i[3456]86-*-sysv*)     gdb_target=i386v ;;
-i[3456]86-*-linux*)    gdb_target=linux ;;
+i[3456]86-*-linux*)    gdb_target=linux
+               configdirs="${configdirs} gdbserver" ;;
 i[3456]86-*-isc*)      gdb_target=i386v ;;
 i[3456]86-*-mach3*)    gdb_target=i386m3 ;;
 i[3456]86-*-mach*)     gdb_target=i386mach ;;
+i[3456]86-*-gnu*)      gdb_target=i386gnu ;;
 i[3456]86-*-netware*)  gdb_target=i386nw
                configdirs="${configdirs} nlm" ;;
 i[3456]86-*-osf1mk*)   gdb_target=i386mk ;;
-i[3456]86-*-win32)     gdb_target=win32  ;;
-
+i[3456]86-*-cygwin32)  gdb_target=cygwin32  ;;
 i960-*-bout*)          gdb_target=vxworks960 ;;
-i960-*-coff*)          gdb_target=nindy960 ;;
-i960-*-elf*)           gdb_target=nindy960 ;;
+i960-nindy-coff*)      gdb_target=nindy960 ;;
+i960-*-coff*)          gdb_target=mon960 ;;
+i960-nindy-elf*)       gdb_target=nindy960 ;;
+i960-*-elf*)           gdb_target=mon960 ;;
 
 i960-*-nindy*)         gdb_target=nindy960 ;;
 i960-*-vxworks*)       gdb_target=vxworks960 ;;
@@ -462,6 +533,7 @@ m68*-*-coff*)               gdb_target=monitor ;;
 m68*-*-elf*)           gdb_target=monitor ;;
 m68*-*-lynxos*)                gdb_target=m68klynx
                configdirs="${configdirs} gdbserver" ;;
+m68*-*-netbsd*)                gdb_target=nbsd ;;
 m68*-*-os68k*)         gdb_target=os68k ;;
 m68*-*-sunos3*)                gdb_target=sun3os3 ;;
 m68*-*-sunos4*)                gdb_target=sun3os4 ;;
@@ -499,6 +571,7 @@ mips*-*-mach3*)             gdb_target=mach3 ;;
 mips*-*-sysv4*)                gdb_target=mipsv4 ;;
 mips*-*-sysv*)         gdb_target=bigmips ;;
 mips*-*-riscos*)       gdb_target=bigmips ;;
+mips*-*-vxworks*)       gdb_target=vxmips ;;
 
 none-*-*)              gdb_target=none ;;
 
@@ -516,6 +589,7 @@ powerpc-*-netware*) gdb_target=ppc-nw
 
 powerpc-*-aix4*)       gdb_target=aix4 ;;
 powerpc-*-aix*)                gdb_target=aix ;;
+powerpcle-*-cygwin32)  gdb_target=cygwin32 ;;
 powerpc-*-eabi*)       if test x"$powerpc_sim" = x"yes"; then
                          gdb_target=ppc-sim
                        else
@@ -544,7 +618,15 @@ sparc-*-sunos4*)   gdb_target=sun4os4 ;;
 sparc-*-sunos5*)       gdb_target=sun4sol2 ;;
 sparc-*-vxworks*)      gdb_target=vxsparc ;;
 sparc-*-*)             gdb_target=sun4os4 ;;
+# Use sparc-em for sparclet for now.
+sparclet-*-*)          gdb_target=sparc-em ;;
 sparclite*-*-*)                gdb_target=sparclite ;;
+# It's not clear what the right solution for "v8plus" systems is yet.
+# For now, stick with sparc-sun-solaris2 since that's what config.guess
+# should return.  Work is still needed to get gdb to print the 64 bit
+# regs (some of which are usable in v8plus) so sp64sol.mt hasn't been
+# deleted though presumably it should be eventually.
+#sparc64-*-solaris2*)  gdb_target=sp64sol2 ;;
 sparc64-*-*)           gdb_target=sp64 ;;
 
 tahoe-*-*)             gdb_target=tahoe ;;
@@ -663,6 +745,11 @@ case ${srcdir} in
 grep "source ${srcdir}/.gdbinit" .gdbinit >/dev/null 2>/dev/null || \
 echo "source ${srcdir}/.gdbinit" >> .gdbinit
 esac
+
+case x$CONFIG_HEADERS in
+xconfig.h:config.in)
+echo > stamp-h ;;
+esac
 ],
 [
 gdb_host_cpu=$gdb_host_cpu
@@ -671,3 +758,4 @@ nativefile=$nativefile
 ])
 
 exit 0
+