]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/configure.in
h8300.md (addhi3_incdec): Change the name to *addhi3_incdec.
[thirdparty/gcc.git] / gcc / configure.in
index e75215ac11605b7316013c5270ec6a70c7e853a8..a0dd7e50e64dc8b0dddd02cbd1320d451f73485e 100644 (file)
@@ -1,7 +1,8 @@
 # configure.in for GCC
 # Process this file with autoconf to generate a configuration script.
 
-# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -176,12 +177,104 @@ changequote([, ])dnl
   fi
 fi
 
+# Determine the host, build, and target systems
+AC_CANONICAL_SYSTEM
+
+# Set program_transform_name
+AC_ARG_PROGRAM
+
+# Find the native compiler
+AC_PROG_CC
+AC_PROG_CC_C_O
+# autoconf is lame and doesn't give us any substitution variable for this.
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
+  NO_MINUS_C_MINUS_O=yes
+else
+  OUTPUT_OPTION='-o $@'
+fi
+AC_SUBST(NO_MINUS_C_MINUS_O)
+AC_SUBST(OUTPUT_OPTION)
+
+# See if GNAT has been installed
+gcc_AC_PROG_GNAT
+
+AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long,
+ac_cv_prog_cc_no_long_long,
+[save_CFLAGS="$CFLAGS"
+CFLAGS="-Wno-long-long"
+AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes,
+              ac_cv_prog_cc_no_long_long=no)
+CFLAGS="$save_CFLAGS"])
+
+if test x$have_gnat != xno ; then 
+AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long,
+ac_cv_prog_adac_no_long_long,
+[cat >conftest.adb <<EOF
+procedure conftest is begin null; end conftest;
+EOF
+if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then
+  ac_cv_prog_adac_no_long_long=yes
+else
+  ac_cv_prog_adac_no_long_long=no
+fi
+rm -f conftest*])
+else
+  ac_cv_prog_adac_no_long_long=yes
+fi
+
+strict1_warn=
+if test $ac_cv_prog_cc_no_long_long = yes && \
+    test $ac_cv_prog_adac_no_long_long = yes ; then
+  strict1_warn="-pedantic -Wno-long-long"
+fi
+AC_SUBST(strict1_warn)
+
+AC_PROG_CPP
+AC_C_INLINE
+gcc_AC_C_VOLATILE
+
+gcc_AC_C_LONG_DOUBLE
+gcc_AC_C_LONG_LONG
+gcc_AC_C__BOOL
+
+# sizeof(char) is 1 by definition.
+AC_COMPILE_CHECK_SIZEOF(short)
+AC_COMPILE_CHECK_SIZEOF(int)
+AC_COMPILE_CHECK_SIZEOF(long)
+if test $ac_cv_c_long_long = yes; then
+  AC_COMPILE_CHECK_SIZEOF(long long)
+fi
+if test $ac_cv_c___int64 = yes; then
+  AC_COMPILE_CHECK_SIZEOF(__int64)
+fi
+
+gcc_AC_C_CHARSET
+
+# If the native compiler is GCC, we can enable warnings even in stage1.  
+# That's useful for people building cross-compilers, or just running a
+# quick `make'.
+warn_cflags=
+if test "x$GCC" = "xyes"; then
+  warn_cflags='$(GCC_WARN_CFLAGS)'
+fi
+AC_SUBST(warn_cflags)
+
 # Determine whether or not multilibs are enabled.
 AC_ARG_ENABLE(multilib,
 [  --enable-multilib       enable library support for multiple ABIs],
 [], [enable_multilib=yes])
 AC_SUBST(enable_multilib)
 
+# Enable -Werror in bootstrap stage2 and later.
+# Change the default to "no" on release branches.
+AC_ARG_ENABLE(werror, 
+[  --enable-werror         enable -Werror in bootstrap stage2 and later], [],
+[enable_werror=yes])
+if test x$enable_werror = xyes ; then
+  WERROR=-Werror
+fi
+AC_SUBST(WERROR)
+
 # Enable expensive internal checks
 AC_ARG_ENABLE(checking,
 [  --enable-checking[=LIST]
@@ -211,6 +304,7 @@ no) ;;
                rtl)    ac_rtl_checking=1 ;;
                gc)     ac_gc_checking=1 ;;
                gcac)   ac_gc_always_collect=1 ;;
+               valgrind)       ac_checking_valgrind=1 ;;
                *)      AC_MSG_ERROR(unknown check category $check) ;;
                esac
        done
@@ -219,11 +313,14 @@ esac
 ], 
 # Enable some checks by default for development versions of GCC
 [ac_checking=1; ac_tree_checking=1; ac_gc_checking=1; ac_rtlflag_checking=1;])
+nocommon_flag=""
 if test x$ac_checking != x ; then
   AC_DEFINE(ENABLE_CHECKING, 1,
 [Define if you want more run-time sanity checks.  This one gets a grab
    bag of miscellaneous but relatively cheap checks.])
+  nocommon_flag=-fno-common
 fi
+AC_SUBST(nocommon_flag)
 if test x$ac_tree_checking != x ; then
   AC_DEFINE(ENABLE_TREE_CHECKING, 1,
 [Define if you want all operations on trees (the basic data
@@ -253,6 +350,47 @@ if test x$ac_gc_always_collect != x ; then
    paranoid mode, validating the entire heap and collecting garbage at
    every opportunity.  This is extremely expensive.])
 fi
+valgrind_path_defines=
+valgrind_command=
+if test x$ac_checking_valgrind != x ; then
+  # It is certainly possible that there's valgrind but no valgrind.h.
+  # GCC relies on making annotations so we must have both.
+  AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
+  AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind,
+       [$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1])
+  if test "x$valgrind_path" = "x" || test $have_valgrind_h = no; then
+       AC_MSG_ERROR([*** Can't find both valgrind and valgrind.h])
+  fi
+  valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
+  valgrind_command="$valgrind_path -q"
+  AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
+[Define if you want to run subprograms and generated programs
+   through valgrind (a memory checker).  This is extremely expensive.])
+fi
+AC_SUBST(valgrind_path_defines)
+AC_SUBST(valgrind_command)
+
+# Enable code coverage collection
+AC_ARG_ENABLE(coverage,
+[  --enable-coverage[=LEVEL]
+                         enable compiler\'s code coverage collection.
+                         Use to measure compiler performance and locate
+                         unused parts of the compiler. With LEVEL, specify
+                         optimization. Values are opt, noopt,
+                         default is noopt],
+[case "${enableval}" in
+yes|noopt)
+       coverage_flags="-fprofile-arcs -ftest-coverage -O0 -DSELF_COVERAGE=1"
+       ;;
+opt)
+       coverage_flags="-fprofile-arcs -ftest-coverage -O2 -DSELF_COVERAGE=2"
+       ;;
+*)
+       AC_MSG_ERROR(unknown coverage setting $enableval)
+       ;;
+esac],
+[coverage_flags=""])
+AC_SUBST(coverage_flags)
 
 AC_ARG_WITH(cpp_install_dir,
 [  --with-cpp-install-dir=DIR
@@ -348,87 +486,40 @@ AC_ARG_ENABLE(shared,
 ], [enable_shared=yes])
 AC_SUBST(enable_shared)
 
-# Determine the host, build, and target systems
-AC_CANONICAL_SYSTEM
-
-# Set program_transform_name
-AC_ARG_PROGRAM
-
-# Find the native compiler
-AC_PROG_CC
-AC_PROG_CC_C_O
-# autoconf is lame and doesn't give us any substitution variable for this.
-if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
-  NO_MINUS_C_MINUS_O=yes
-else
-  OUTPUT_OPTION='-o $@'
-fi
-AC_SUBST(NO_MINUS_C_MINUS_O)
-AC_SUBST(OUTPUT_OPTION)
-
-# See if GNAT has been installed
-gcc_AC_PROG_GNAT
-
-AC_CACHE_CHECK(whether ${CC-cc} accepts -Wno-long-long,
-ac_cv_prog_cc_no_long_long,
-[save_CFLAGS="$CFLAGS"
-CFLAGS="-Wno-long-long"
-AC_TRY_COMPILE(,,ac_cv_prog_cc_no_long_long=yes,
-              ac_cv_prog_cc_no_long_long=no)
-CFLAGS="$save_CFLAGS"])
-
-if test x$have_gnat != xno ; then 
-AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long,
-ac_cv_prog_adac_no_long_long,
-[cat >conftest.adb <<EOF
-procedure conftest is begin null; end conftest;
-EOF
-if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then
-  ac_cv_prog_adac_no_long_long=yes
-else
-  ac_cv_prog_adac_no_long_long=no
-fi
-rm -f conftest*])
-else
-  ac_cv_prog_adac_no_long_long=yes
-fi
-
-strict1_warn=
-if test $ac_cv_prog_cc_no_long_long = yes && \
-    test $ac_cv_prog_adac_no_long_long = yes ; then
-  strict1_warn="-pedantic -Wno-long-long"
-fi
-AC_SUBST(strict1_warn)
-
-AC_PROG_CPP
-AC_C_INLINE
-gcc_AC_C_VOLATILE
-
-gcc_AC_C_LONG_DOUBLE
-gcc_AC_C_LONG_LONG
-gcc_AC_C__BOOL
-
-# sizeof(char) is 1 by definition.
-gcc_AC_COMPILE_CHECK_SIZEOF(short)
-gcc_AC_COMPILE_CHECK_SIZEOF(int)
-gcc_AC_COMPILE_CHECK_SIZEOF(long)
-if test $ac_cv_c_long_long = yes; then
-  gcc_AC_COMPILE_CHECK_SIZEOF(long long)
-fi
-if test $ac_cv_c___int64 = yes; then
-  gcc_AC_COMPILE_CHECK_SIZEOF(__int64)
-fi
-
-gcc_AC_C_CHARSET
-
-# If the native compiler is GCC, we can enable warnings even in stage1.  
-# That's useful for people building cross-compilers, or just running a
-# quick `make'.
-warn_cflags=
-if test "x$GCC" = "xyes"; then
-  warn_cflags='$(GCC_WARN_CFLAGS)'
-fi
-AC_SUBST(warn_cflags)
+AC_ARG_WITH(sysroot,
+[  --with-sysroot[=DIR] Search for usr/lib, usr/include, et al, within DIR.],
+[
+ case ${with_sysroot} in
+ yes) TARGET_SYSTEM_ROOT='${gcc_tooldir}/sys-root' ;;
+ *) TARGET_SYSTEM_ROOT=$with_sysroot ;;
+ esac
+   
+ TARGET_SYSTEM_ROOT_DEFINE='-DTARGET_SYSTEM_ROOT=\"$(TARGET_SYSTEM_ROOT)\"'
+ CROSS_SYSTEM_HEADER_DIR='$(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR)'
+
+ 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}*)
+   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=0'
+ CROSS_SYSTEM_HEADER_DIR='$(gcc_tooldir)/sys-include'
+])
+AC_SUBST(TARGET_SYSTEM_ROOT)
+AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+AC_SUBST(CROSS_SYSTEM_HEADER_DIR)
 
 # Stage specific cflags for build.
 stage1_cflags=
@@ -504,7 +595,7 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
                 fcntl.h unistd.h sys/file.h sys/time.h \
                 sys/resource.h sys/param.h sys/times.h sys/stat.h \
-                direct.h malloc.h langinfo.h)
+                direct.h malloc.h langinfo.h ldfcn.h)
 
 # Check for thread headers.
 AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
@@ -512,7 +603,7 @@ AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
 
 # These tests can't be done till we know if we have limits.h.
 gcc_AC_C_CHAR_BIT
-gcc_AC_C_COMPILE_ENDIAN
+AC_C_BIGENDIAN_CROSS
 gcc_AC_C_FLOAT_FORMAT
 
 # See if we have the mktemp command.
@@ -528,7 +619,7 @@ else
   # that we can use it.
   gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
   [GNU texinfo.* \([0-9][0-9.]*\)],
-  [4.[1-9]*])
+  [4.[2-9]*])
 fi
 
 if test $gcc_cv_prog_makeinfo_modern = no; then
@@ -556,7 +647,7 @@ dnl LEXLIB is not useful in gcc.
 if test -f $srcdir/../flex/skel.c; then
   FLEX='$(objdir)/../flex/flex'
 else
-  AC_CHECK_PROG(FLEX, flex, flex, false)
+  AC_CHECK_PROG(FLEX, flex, flex, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing flex)
 fi
 
 # Bison?
@@ -564,7 +655,7 @@ fi
 if test -f $srcdir/../bison/bison.simple; then
   BISON='$(objdir)/../bison/bison -L $(srcdir)/../bison/'
 else
-  AC_CHECK_PROG(BISON, bison, bison, false)
+  AC_CHECK_PROG(BISON, bison, bison, ${CONFIG_SHELL-/bin/sh} ${srcdir}/../missing bison)
 fi
 
 # These libraries may be used by collect2.
@@ -672,7 +763,7 @@ saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
 gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
        strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
-        fprintf_unlocked strstr errno \
+        fprintf_unlocked strstr errno vasprintf \
        malloc realloc calloc free basename getopt clock, , ,[
 #include "ansidecl.h"
 #include "system.h"])
@@ -685,6 +776,14 @@ gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[
 #endif
 ])
 
+gcc_AC_CHECK_DECLS(ldgetname, , ,[
+#include "ansidecl.h"
+#include "system.h"
+#ifdef HAVE_LDFCN_H
+#include <ldfcn.h>
+#endif
+])
+
 gcc_AC_CHECK_DECLS(times, , ,[
 #include "ansidecl.h"
 #include "system.h"
@@ -719,9 +818,24 @@ if test $gcc_cv_type_clock_t = yes; then
   [Define if <time.h> defines clock_t.])
 fi
 
+AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
+[AC_TRY_COMPILE([
+#include "ansidecl.h"
+#include "system.h"
+], 
+[if ((uchar *)0) return 0;
+ if (sizeof(uchar)) return 0;],
+ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
+if test $ac_cv_type_uchar = yes; then
+  AC_DEFINE(HAVE_UCHAR, 1,
+  [Define if <sys/types.h> defines \`uchar'.])
+fi
+
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
 CFLAGS="$saved_CFLAGS"
 
+gcc_AC_INITFINI_ARRAY
+
 # mkdir takes a single argument on some systems. 
 gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
 
@@ -731,7 +845,26 @@ objext='.o'
 AC_SUBST(manext)
 AC_SUBST(objext)
 
-config_gtfiles=
+# With Setjmp/Longjmp based exception handling.
+AC_ARG_ENABLE(sjlj-exceptions,
+[  --enable-sjlj-exceptions
+                          arrange to use setjmp/longjmp exception handling],
+[sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
+  [Define 0/1 to force the choice for exception handling model.])])
+
+AC_CHECK_LIB(unwind, main, use_libunwind_default=yes, use_libunwind_default=no)
+# Use libunwind based exception handling.
+AC_ARG_ENABLE(libunwind-exceptions,
+[  --enable-libunwind-exceptions  force use libunwind for exceptions],
+use_libunwind_exceptions=$enableval,
+use_libunwind_exceptions=$use_libunwind_default)
+if test x"$use_libunwind_exceptions" = xyes; then
+   AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1,
+       [Define if gcc should use -lunwind.])
+fi
+
+target_gtfiles=
 build_xm_file=
 build_xm_defines=
 build_install_headers_dir=install-headers-tar
@@ -773,15 +906,6 @@ if test x"$dwarf2" = xyes
 then tm_file="$tm_file tm-dwarf2.h"
 fi
 
-if test x$float_format = x
-then float_format=i64
-fi
-
-if test $float_format = none
-then float_h_file=Makefile.in
-else float_h_file=float-$float_format.h
-fi
-
 # Say what files are being used for the output code and MD file.
 echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
 echo "Using \`$srcdir/config/$md_file' as machine description file."
@@ -829,6 +953,11 @@ else
        done
 fi
 
+if test x$need_64bit_hwint = xyes; then
+       AC_DEFINE(NEED_64BIT_HOST_WIDE_INT, 1,
+[Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h).])
+fi
+
 count=a
 for f in $host_xm_file; do
        count=${count}x
@@ -843,6 +972,7 @@ else
                echo "  $srcdir/config/$f"
        done
 fi
+echo "Using ${out_host_hook_obj} for host machine hooks."
 
 if test "$host_xm_file" != "$build_xm_file"; then
        count=a
@@ -883,7 +1013,7 @@ fi
 
 # auto-host.h is the file containing items generated by autoconf and is
 # the first file included by config.h.
-# If host=build, it is correct to have hconfig include auto-host.h
+# If host=build, it is correct to have bconfig include auto-host.h
 # as well.  If host!=build, we are in error and need to do more 
 # work to find out the build config parameters.
 if test x$host = x$build
@@ -915,14 +1045,17 @@ else
        cd ..
        rm -rf $tempdir
        build_auto=auto-build.h
-       FORBUILD=../$build
+       FORBUILD=../build-$build_alias
 fi
 AC_SUBST(FORBUILD)
 
 tm_file="${tm_file} defaults.h"
-host_xm_file="auto-host.h ansidecl.h ${host_xm_file} ${tm_file}"
-build_xm_file="${build_auto} ansidecl.h ${build_xm_file} ${tm_file}"
-xm_file="ansidecl.h ${xm_file} ${tm_file}"
+tm_p_file="${tm_p_file} tm-preds.h"
+host_xm_file="auto-host.h ansidecl.h ${host_xm_file}"
+build_xm_file="${build_auto} ansidecl.h ${build_xm_file}"
+# We don't want ansidecl.h in target files, write code there in ISO/GNU C.
+# put this back in temporarily.
+xm_file="ansidecl.h ${xm_file}"
 
 # Truncate the target if necessary
 if test x$host_truncate_target != x; then
@@ -1094,7 +1227,11 @@ done
 
 tm_p_file_list=
 for f in $tm_p_file; do
-    tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f"
+  case $f in
+    tm-preds.h )
+       tm_p_file_list="${tm_p_file_list} $f" ;;
+    *) tm_p_file_list="${tm_p_file_list} \$(srcdir)/config/$f" ;;
+  esac
 done
 
 host_xm_file_list=
@@ -1148,26 +1285,21 @@ fi
 # This prevents libgcc2 from containing any code which requires libc
 # support.
 inhibit_libc=
-if [test x$host != x$target] && [test x$with_headers = x]; then
+if { test x$host != x$target && test "x$with_headers" = x &&
+     test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then
        inhibit_libc=-Dinhibit_libc
-else
-       if [test x$with_newlib = xyes]; then
-               inhibit_libc=-Dinhibit_libc
-       fi
 fi
 AC_SUBST(inhibit_libc)
 
 # When building gcc with a cross-compiler, we need to adjust things so
 # that the generator programs are still built with the native compiler.
 # Also, we cannot run fixincludes or fix-header.
-# Note that the terminology here is wrong; it should be BUILD_* throughout.
-# FIXME.
 
 # These are the normal (build=host) settings:
 BUILD_PREFIX=                  AC_SUBST(BUILD_PREFIX)
 BUILD_PREFIX_1=ignore-         AC_SUBST(BUILD_PREFIX_1)
-HOST_CC='$(CC)'                        AC_SUBST(HOST_CC)
-HOST_CFLAGS='$(ALL_CFLAGS)'    AC_SUBST(HOST_CFLAGS)
+BUILD_CC='$(CC)'               AC_SUBST(BUILD_CC)
+BUILD_CFLAGS='$(ALL_CFLAGS)'   AC_SUBST(BUILD_CFLAGS)
 
 STMP_FIXINC=stmp-fixinc                AC_SUBST(STMP_FIXINC)
 STMP_FIXPROTO=stmp-fixproto    AC_SUBST(STMP_FIXPROTO)
@@ -1177,8 +1309,8 @@ if test x$build != x$host
 then
     BUILD_PREFIX=build-
     BUILD_PREFIX_1=build-
-    HOST_CC='$(CC_FOR_BUILD)'
-    HOST_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
+    BUILD_CC='$(CC_FOR_BUILD)'
+    BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
 
     STMP_FIXINC=
     STMP_FIXPROTO=
@@ -1592,6 +1724,19 @@ if test x"$gcc_cv_as_hidden" = xyes; then
 fi
 AC_MSG_RESULT($gcc_cv_as_hidden)
 libgcc_visibility=$gcc_cv_as_hidden
+case "$target" in
+  mips-sgi-irix6*)
+    if test x"$gnu_ld_flag" = x"no"; then
+      # Even if using gas with .hidden support, the resulting object files
+      # cannot be linked with the IRIX 6 O32 linker.  With the N32 and
+      # N64 linkers, the problem is that the linker refuses to accept
+      # -call_shared (passed by default to the linker) and -r (used to
+      # link the object file generated without .hidden directives with
+      # one that hides symbols), so we also lose.
+      libgcc_visibility=no
+    fi
+    ;;
+esac
 AC_SUBST(libgcc_visibility)
 
 AC_MSG_CHECKING(assembler leb128 support)
@@ -1777,11 +1922,27 @@ foo:    .long   25
        leal    foo@DTPOFF(%eax), %edx
        movl    foo@GOTTPOFF(%ebx), %eax
        subl    foo@GOTTPOFF(%ebx), %eax
+       addl    foo@GOTNTPOFF(%ebx), %eax
+       movl    foo@INDNTPOFF, %eax
        movl    $foo@TPOFF, %eax
        subl    $foo@TPOFF, %eax
        leal    foo@NTPOFF(%ecx), %eax'
        tls_first_major=2
-       tls_first_minor=13
+       tls_first_minor=14
+       ;;
+  x86_64-*-*)
+    conftest_s='
+       .section ".tdata","awT",@progbits
+foo:   .long   25
+       .text
+       movq    %fs:0, %rax
+       leaq    foo@TLSGD(%rip), %rdi
+       leaq    foo@TLSLD(%rip), %rdi
+       leaq    foo@DTPOFF(%rax), %rdx
+       movq    foo@GOTTPOFF(%rip), %rax
+       movq    $foo@TPOFF, %rax'
+       tls_first_major=2
+       tls_first_minor=14
        ;;
   ia64-*-*)
     conftest_s='
@@ -1800,6 +1961,41 @@ foo:     data8   25
        tls_first_major=2
        tls_first_minor=13
        ;;
+  s390-*-*)
+    conftest_s='
+       .section ".tdata","awT",@progbits
+foo:   .long   25
+       .text
+       .long   foo@TLSGD
+       .long   foo@TLSLDM
+       .long   foo@DTPOFF
+       .long   foo@NTPOFF
+       .long   foo@GOTNTPOFF
+       .long   foo@INDNTPOFF
+       l       %r1,foo@GOTNTPOFF(%r12)
+       l       %r1,0(%r1):tls_load:foo
+       bas     %r14,0(%r1,%r13):tls_gdcall:foo
+       bas     %r14,0(%r1,%r13):tls_ldcall:foo'
+       tls_first_major=2
+       tls_first_minor=14
+       ;;
+  s390x-*-*)
+    conftest_s='
+       .section ".tdata","awT",@progbits
+foo:   .long   25
+       .text
+       .quad   foo@TLSGD
+       .quad   foo@TLSLDM
+       .quad   foo@DTPOFF
+       .quad   foo@NTPOFF
+       .quad   foo@GOTNTPOFF
+       lg      %r1,foo@GOTNTPOFF(%r12)
+       larl    %r1,foo@INDNTPOFF
+       brasl   %r14,__tls_get_offset@PLT:tls_gdcall:foo
+       brasl   %r14,__tls_get_offset@PLT:tls_ldcall:foo'
+       tls_first_major=2
+       tls_first_minor=14
+       ;;
 esac
 if test -z "$tls_first_major"; then
   :
@@ -1955,33 +2151,31 @@ EOF
                [Define if your assembler and linker support unaligned PC relative relocs against hidden symbols.])
     fi
 
-    if test "x$gcc_cv_as_flags64" != xno; then
-       AC_CACHE_CHECK([for assembler offsetable %lo() support],
-           gcc_cv_as_offsetable_lo10, [
-           gcc_cv_as_offsetable_lo10=unknown
-           if test "x$gcc_cv_as" != x; then
-               # Check if assembler has offsetable %lo()
-               echo "or %g1, %lo(ab) + 12, %g1" > conftest.s
-               echo "or %g1, %lo(ab + 12), %g1" > conftest1.s
-               if $gcc_cv_as $gcc_cv_as_flags64 -o conftest.o conftest.s \
-                       > /dev/null 2>&1 &&
-                  $gcc_cv_as $gcc_cv_as_flags64 -o conftest1.o conftest1.s \
-                       > /dev/null 2>&1; then
-                   if cmp conftest.o conftest1.o > /dev/null 2>&1; then
-                       gcc_cv_as_offsetable_lo10=no
-                   else
-                       gcc_cv_as_offsetable_lo10=yes
-                   fi
-               else
+    AC_CACHE_CHECK([for assembler offsetable %lo() support],
+       gcc_cv_as_offsetable_lo10, [
+       gcc_cv_as_offsetable_lo10=unknown
+       if test "x$gcc_cv_as" != x; then
+           # Check if assembler has offsetable %lo()
+           echo "or %g1, %lo(ab) + 12, %g1" > conftest.s
+           echo "or %g1, %lo(ab + 12), %g1" > conftest1.s
+           if $gcc_cv_as -xarch=v9 -o conftest.o conftest.s \
+                   > /dev/null 2>&1 &&
+              $gcc_cv_as -xarch=v9 -o conftest1.o conftest1.s \
+                   > /dev/null 2>&1; then
+               if cmp conftest.o conftest1.o > /dev/null 2>&1; then
                    gcc_cv_as_offsetable_lo10=no
+               else
+                   gcc_cv_as_offsetable_lo10=yes
                fi
-               rm -f conftest.s conftest.o conftest1.s conftest1.o
+           else
+               gcc_cv_as_offsetable_lo10=no
            fi
-       ])
-       if test "x$gcc_cv_as_offsetable_lo10" = xyes; then
-           AC_DEFINE(HAVE_AS_OFFSETABLE_LO10, 1,
-               [Define if your assembler supports offsetable %lo().])
+           rm -f conftest.s conftest.o conftest1.s conftest1.o
        fi
+    ])
+    if test "x$gcc_cv_as_offsetable_lo10" = xyes; then
+       AC_DEFINE(HAVE_AS_OFFSETABLE_LO10, 1,
+           [Define if your assembler supports offsetable %lo().])
     fi
 
     ;;
@@ -2049,7 +2243,8 @@ gcc_cv_as_dwarf2_debug_line=no
 # ??? Once 2.11 is released, probably need to add first known working
 # version to the per-target configury.
 case "$target" in
-  i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* | x86_64*-*-* | hppa*-*-*)
+  i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
+  | x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-*)
     insn="nop"
     ;;
   ia64*-*-*)
@@ -2145,6 +2340,44 @@ if test x"$gcc_cv_as_gstabs_flag" = xyes; then
 fi
 AC_MSG_RESULT($gcc_cv_as_gstabs_flag)
 
+AC_MSG_CHECKING(linker read-only and read-write section mixing)
+gcc_cv_ld_ro_rw_mix=unknown
+if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
+  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
+    gcc_cv_ld_ro_rw_mix=read-write
+  fi
+elif test x$gcc_cv_as != x -a x$gcc_cv_ld != x -a x$gcc_cv_objdump != x ; then
+  echo '.section "myfoosect", "a"' > conftest1.s
+  echo '.section "myfoosect", "aw"' > conftest2.s
+  echo '.byte 1' >> conftest2.s
+  echo '.section "myfoosect", "a"' > conftest3.s
+  echo '.byte 0' >> conftest3.s
+  if $gcc_cv_as -o conftest1.o conftest1.s > /dev/null 2>&1 \
+     && $gcc_cv_as -o conftest2.o conftest2.s > /dev/null 2>&1 \
+     && $gcc_cv_as -o conftest3.o conftest3.s > /dev/null 2>&1 \
+     && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
+       conftest2.o conftest3.o; then
+    gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
+                        | grep -A1 myfoosect`
+    if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
+      if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
+       gcc_cv_ld_ro_rw_mix=read-only
+      else
+       gcc_cv_ld_ro_rw_mix=read-write
+      fi
+    fi
+  fi
+changequote(,)dnl
+  rm -f conftest.* conftest[123].*
+changequote([,])dnl
+fi
+if test x$gcc_cv_ld_ro_rw_mix = xread-write; then
+       AC_DEFINE(HAVE_LD_RO_RW_SECTION_MIXING, 1,
+  [Define if your linker links a mix of read-only
+   and read-write sections into a read-write section.])
+fi
+AC_MSG_RESULT($gcc_cv_ld_ro_rw_mix)
+
 AC_MSG_CHECKING(linker PT_GNU_EH_FRAME support)
 gcc_cv_ld_eh_frame_hdr=no
 if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
@@ -2163,7 +2396,38 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
 fi
 AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
 
-if test "$prefix" != "/usr" && test "$prefix" != "/usr/local" ; then
+# Miscellaneous target-specific checks.
+case "$target" in
+  mips*-*-*)
+    AC_MSG_CHECKING(whether libgloss uses STARTUP directives consistently)
+    gcc_cv_mips_libgloss_startup=no
+    gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
+    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
+    for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_alias/lib/idt.ld
+    do
+      if grep '^STARTUP' $f > /dev/null 2>&1; then
+        gcc_cv_mips_libgloss_startup=yes
+        break
+      fi
+    done
+    if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
+      AC_DEFINE(HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES, 1,
+        [Define if your MIPS libgloss linker scripts consistently include STARTUP directives.])
+    fi
+    AC_MSG_RESULT($gcc_cv_mips_libgloss_startup)
+    ;;
+esac
+
+if test x$with_sysroot = x && test x$host = x$target \
+   && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
   AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include")
 fi
 
@@ -2351,24 +2615,6 @@ else
 fi
 AC_SUBST(MAINT)dnl
 
-# With Setjmp/Longjmp based exception handling.
-AC_ARG_ENABLE(sjlj-exceptions,
-[  --enable-sjlj-exceptions
-                          arrange to use setjmp/longjmp exception handling],
-[sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi`
-AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj,
-  [Define 0/1 to force the choice for exception handling model.])])
-
-# Use libunwind based exception handling.
-AC_ARG_ENABLE(libunwind-exceptions,
-[  --enable-libunwind-exceptions  force use libunwind for exceptions],
-use_libunwind_exceptions=$enableval,
-use_libunwind_exceptions=no)
-if test x"$use_libunwind_exceptions" = xyes; then
-   AC_DEFINE(USE_LIBUNWIND_EXCEPTIONS, 1,
-       [Define if gcc should use -lunwind.])
-fi
-
 # Make empty files to contain the specs and options for each language.
 # Then add #include lines to for a compiler that has specs and/or options.
 
@@ -2398,7 +2644,10 @@ all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
 # List of language makefile fragments.
 all_lang_makefiles=
 # Files for gengtype
-all_gtfiles="$config_gtfiles"
+all_gtfiles="$target_gtfiles"
+# Files for gengtype with language
+all_gtfiles_files_langs=
+all_gtfiles_files_files=
 
 # Add the language fragments.
 # Languages are added via two mechanisms.  Some information must be
@@ -2439,9 +2688,31 @@ do
                all_stagestuff="$all_stagestuff $stagestuff"
                all_outputs="$all_outputs $outputs"
                all_gtfiles="$all_gtfiles $gtfiles"
+                for f in .. $gtfiles
+                do
+                    if test $f != ".."
+                     then
+                         all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
+                         all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
+                     fi
+                done
        fi
 done
 
+# Pick up gtfiles for c
+gtfiles=
+s="c"
+. ${srcdir}/c-config-lang.in
+all_gtfiles="$all_gtfiles $gtfiles"
+for f in .. $gtfiles
+do
+     if test $f != ".."
+     then
+        all_gtfiles_files_langs="$all_gtfiles_files_langs ${s} "
+        all_gtfiles_files_files="$all_gtfiles_files_files ${f} "
+     fi
+done
+
 check_languages=
 for language in .. $all_languages
 do
@@ -2560,7 +2831,6 @@ else
 fi)
 AC_SUBST(slibdir)
 
-# Nothing to do for FLOAT_H, float_format already handled.
 objdir=`${PWDCMD-pwd}`
 AC_SUBST(objdir)
 
@@ -2569,9 +2839,12 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
 
 # Substitute configuration variables
 AC_SUBST(subdirs)
+AC_SUBST(srcdir)
 AC_SUBST(all_boot_languages)
 AC_SUBST(all_compilers)
 AC_SUBST(all_gtfiles)
+AC_SUBST(all_gtfiles_files_langs)
+AC_SUBST(all_gtfiles_files_files)
 AC_SUBST(all_lang_makefiles)
 AC_SUBST(all_languages)
 AC_SUBST(all_stagestuff)
@@ -2603,6 +2876,7 @@ AC_SUBST(host_extra_gcc_objs)
 AC_SUBST(host_xm_file_list)
 AC_SUBST(host_xm_file)
 AC_SUBST(host_xm_defines)
+AC_SUBST(out_host_hook_obj)
 AC_SUBST(install)
 AC_SUBST(lang_options_files)
 AC_SUBST(lang_specs_files)