]> 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 a67f0228480e8e2307a7f6ad3b48b383b215a52e..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.
 
@@ -167,7 +168,7 @@ esac])
 
 if test x${gcc_gxx_include_dir} = x; then
   if test x${enable_version_specific_runtime_libs} = xyes; then
-    gcc_gxx_include_dir='${libsubdir}/include/g++'
+    gcc_gxx_include_dir='${libsubdir}/include/c++'
   else
     topsrcdir=${srcdir}/.. . ${srcdir}/../config.if
 changequote(<<, >>)dnl
@@ -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,11 +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
-
-
-AC_ARG_ENABLE(cpp,
-[  --disable-cpp           don't provide a user-visible C preprocessor],
-[], [enable_cpp=yes])
+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
@@ -269,6 +402,18 @@ elif test x$withval != xno; then
   cpp_install_dir=$withval
 fi])
 
+# Enable __cxa_atexit for C++.
+AC_ARG_ENABLE(__cxa_atexit,
+[  --enable-__cxa_atexit   enable __cxa_atexit for C++],
+[], [])
+if test x$enable___cxa_atexit = xyes; then
+  AC_DEFINE(DEFAULT_USE_CXA_ATEXIT, 1,
+  [Define if you want to use __cxa_atexit, rather than atexit, to
+   register C++ destructors for local statics and global objects.
+   This is essential for fully standards-compliant handling of
+   destructors, but requires __cxa_atexit in libc.])
+fi
+  
 # Enable Multibyte Characters for C/C++
 AC_ARG_ENABLE(c-mbchar,
 [  --enable-c-mbchar       enable multibyte characters for C and C++],
@@ -341,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=
@@ -497,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=])
@@ -505,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.
@@ -521,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
@@ -549,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?
@@ -557,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.
@@ -665,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"])
@@ -678,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"
@@ -712,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
 
@@ -724,6 +845,26 @@ objext='.o'
 AC_SUBST(manext)
 AC_SUBST(objext)
 
+# 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
@@ -765,21 +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
-
-# Handle cpp installation.
-if test x$enable_cpp != xno
-then
-  tmake_file="$tmake_file t-install-cpp"
-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."
@@ -827,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
@@ -841,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
@@ -867,9 +999,21 @@ if test x$thread_file = x; then
        fi
 fi
 
+# Look for a file containing extra machine modes.
+if test -n "$extra_modes" && test -f $srcdir/config/$extra_modes; then
+  extra_modes_file='$(srcdir)'/config/${extra_modes}
+  AC_SUBST(extra_modes_file)
+  AC_DEFINE_UNQUOTED(EXTRA_MODES_FILE, "$extra_modes",
+  [Define to the name of a file containing a list of extra machine modes
+   for this architecture.])
+  AC_DEFINE(EXTRA_CC_MODES, 1,
+  [Define if the target architecture needs extra machine modes to represent
+   the results of comparisons.])
+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
@@ -901,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
@@ -1073,14 +1220,18 @@ for f in $tm_file; do
     ansidecl.h )
        tm_file_list="${tm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
     defaults.h )
-       tm_file_list="${tm_file_list} $f" ;;
+       tm_file_list="${tm_file_list} \$(srcdir)/$f" ;;
     *) tm_file_list="${tm_file_list} \$(srcdir)/config/$f" ;;
   esac
 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=
@@ -1088,8 +1239,10 @@ for f in $host_xm_file; do
   case $f in
     ansidecl.h )
        host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
-    auto-host.h | defaults.h )
+    auto-host.h )
        host_xm_file_list="${host_xm_file_list} $f" ;;
+    defaults.h )
+       host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
     *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
   esac
 done
@@ -1099,8 +1252,10 @@ for f in $build_xm_file; do
   case $f in
     ansidecl.h )
        build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
-    auto-build.h | auto-host.h | defaults.h )
+    auto-build.h | auto-host.h )
        build_xm_file_list="${build_xm_file_list} $f" ;;
+    defaults.h )
+       host_xm_file_list="${host_xm_file_list} \$(srcdir)/$f" ;;
     *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
   esac
 done
@@ -1130,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:
-HOST_PREFIX=                   AC_SUBST(HOST_PREFIX)
-HOST_PREFIX_1=ignore-          AC_SUBST(HOST_PREFIX_1)
-HOST_CC='$(CC)'                        AC_SUBST(HOST_CC)
-HOST_CFLAGS='$(ALL_CFLAGS)'    AC_SUBST(HOST_CFLAGS)
+BUILD_PREFIX=                  AC_SUBST(BUILD_PREFIX)
+BUILD_PREFIX_1=ignore-         AC_SUBST(BUILD_PREFIX_1)
+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)
@@ -1157,10 +1307,10 @@ STMP_FIXPROTO=stmp-fixproto     AC_SUBST(STMP_FIXPROTO)
 # And these apply if build != host.
 if test x$build != x$host
 then
-    HOST_PREFIX=build-
-    HOST_PREFIX_1=build-
-    HOST_CC='$(CC_FOR_BUILD)'
-    HOST_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
+    BUILD_PREFIX=build-
+    BUILD_PREFIX_1=build-
+    BUILD_CC='$(CC_FOR_BUILD)'
+    BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
 
     STMP_FIXINC=
     STMP_FIXPROTO=
@@ -1541,11 +1691,31 @@ elif test x$gcc_cv_as != x; then
        ld_ver=`$gcc_cv_ld --version 2>/dev/null | head -1`
        if echo "$ld_ver" | grep GNU > /dev/null; then
 changequote(,)dnl
-               ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,;p'`
-changequote([,])dnl
+               ld_vers=`echo $ld_ver | sed -n 's,^.*[  ]\([0-9][0-9]*\.[0-9][0-9]*\(\|\.[0-9][0-9]*\)\)\([     ].*\|\)$,\1,p'`
+               ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
                if test 0"$ld_date" -lt 20020404; then
-                       gcc_cv_as_hidden="no"
+                       if test -n "$ld_date"; then
+                               # If there was date string, but was earlier than 2002-04-04, fail
+                               gcc_cv_as_hidden="no"
+                       elif test -z "$ld_vers"; then
+                               # If there was no date string nor ld version number, something is wrong
+                               gcc_cv_as_hidden="no"
+                       else
+                               ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
+                               ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
+                               ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+                               test -z "$ld_vers_patch" && ld_vers_patch=0
+                               if test "$ld_vers_major" -lt 2; then
+                                       gcc_cv_as_hidden="no"
+                               elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 12; then
+                                       gcc_cv_as_hidden="no"
+                               elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -eq 12 \
+                                         -a "$ld_vers_patch" -eq 0; then
+                                       gcc_cv_as_hidden="no"
+                               fi
+                       fi
                fi
+changequote([,])dnl
        fi
 fi
 if test x"$gcc_cv_as_hidden" = xyes; then
@@ -1554,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)
@@ -1698,6 +1881,145 @@ if test x"$gcc_cv_as_shf_merge" = xyes; then
 fi
 AC_MSG_RESULT($gcc_cv_as_shf_merge)
 
+AC_MSG_CHECKING(assembler thread-local storage support)
+gcc_cv_as_tls=no
+conftest_s=
+tls_first_major=
+tls_first_minor=
+case "$target" in
+changequote(,)dnl
+  alpha*-*-*)
+    conftest_s='
+       .section ".tdata","awT",@progbits
+foo:   .long   25
+       .text
+       ldq     $27,__tls_get_addr($29)         !literal!1
+       lda     $16,foo($29)                    !tlsgd!1
+       jsr     $26,($27),__tls_get_addr        !lituse_tlsgd!1
+       ldq     $27,__tls_get_addr($29)         !literal!2
+       lda     $16,foo($29)                    !tlsldm!2
+       jsr     $26,($27),__tls_get_addr        !lituse_tlsldm!2
+       ldq     $1,foo($29)                     !gotdtprel
+       ldah    $2,foo($29)                     !dtprelhi
+       lda     $3,foo($2)                      !dtprello
+       lda     $4,foo($29)                     !dtprel
+       ldq     $1,foo($29)                     !gottprel
+       ldah    $2,foo($29)                     !tprelhi
+       lda     $3,foo($2)                      !tprello
+       lda     $4,foo($29)                     !tprel'
+       tls_first_major=2
+       tls_first_minor=13
+       ;;
+  i[34567]86-*-*)
+changequote([,])dnl
+    conftest_s='
+       .section ".tdata","awT",@progbits
+foo:   .long   25
+       .text
+       movl    %gs:0, %eax
+       leal    foo@TLSGD(,%ebx,1), %eax
+       leal    foo@TLSLDM(%ebx), %eax
+       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=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='
+       .section ".tdata","awT",@progbits
+foo:   data8   25
+       .text
+       addl    r16 = @ltoff(@dtpmod(foo#)), gp
+       addl    r17 = @ltoff(@dtprel(foo#)), gp
+       addl    r18 = @ltoff(@tprel(foo#)), gp
+       addl    r19 = @dtprel(foo#), gp
+       adds    r21 = @dtprel(foo#), r13
+       movl    r23 = @dtprel(foo#)
+       addl    r20 = @tprel(foo#), gp
+       adds    r22 = @tprel(foo#), r13
+       movl    r24 = @tprel(foo#)'
+       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
+  :
+elif test x$gcc_cv_gas_major_version != x -a x$gcc_cv_gas_minor_version != x
+then
+  if test "$gcc_cv_gas_major_version" -eq "$tls_first_major" \
+         -a "$gcc_cv_gas_minor_version" -ge "$tls_first_minor" \
+         -o "$gcc_cv_gas_major_version" -gt "$tls_first_major"; then
+    gcc_cv_as_tls=yes
+  fi
+elif test x$gcc_cv_as != x; then
+  echo "$conftest_s" > conftest.s
+  if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1
+  then
+    gcc_cv_as_tls=yes
+  fi
+  rm -f conftest.s conftest.o
+fi
+if test "$gcc_cv_as_tls" = yes; then
+  AC_DEFINE(HAVE_AS_TLS, 1,
+           [Define if your assembler supports thread-local storage.])
+fi
+AC_MSG_RESULT($gcc_cv_as_tls)
+
 case "$target" in
   # All TARGET_ABI_OSF targets.
   alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
@@ -1829,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
 
     ;;
@@ -1923,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*-*-*)
@@ -1977,7 +2298,7 @@ then
        -o "$gcc_cv_gas_major_version" -gt 2 \
      && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
      && test x"$insn" != x ; then
-    gcc_cv_as_gdwarf2_debug_flag="yes"
+    gcc_cv_as_gdwarf2_flag="yes"
   fi
 elif test x$gcc_cv_as != x -a x"$insn" != x ; then
        echo '' > conftest.s
@@ -2003,7 +2324,7 @@ then
        -o "$gcc_cv_gas_major_version" -gt 2 \
      && grep 'obj_format = elf' ../gas/Makefile > /dev/null \
      && test x"$insn" != x ; then
-    gcc_cv_as_gstabs_debug_flag="yes"
+    gcc_cv_as_gstabs_flag="yes"
   fi
 elif test x$gcc_cv_as != x -a x"$insn" != x ; then
        echo '' > conftest.s
@@ -2019,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
@@ -2037,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
 
@@ -2055,8 +2445,8 @@ if test x"${enable_languages+set}" != xset; then
                enable_languages=all
        fi
 else
-       if test x"${enable_languages}" = x ||
-          test x"${enable_languages}" = xyes;
+       if test x"${enable_languages}" = x \
+        || test x"${enable_languages}" = xyes;
        then
                AC_MSG_ERROR([--enable-languages needs at least one language argument])
        fi
@@ -2096,6 +2486,8 @@ changequote([,])dnl
    esac
 done
 
+expected_languages=`echo ,${enable_languages}, | sed -e 's:,: :g' -e 's:  *: :g' -e 's:  *: :g' -e 's:^ ::' -e 's: $::'`
+found_languages=
 subdirs=
 for lang in ${srcdir}/*/config-lang.in ..
 do
@@ -2120,6 +2512,7 @@ changequote(,)dnl
          *,all,*) add_this_lang=yes ;;
          *) add_this_lang=no ;;
          esac
+          found_languages="${found_languages} ${lang_alias}"
          if test x"${add_this_lang}" = xyes; then
                case $lang in
                    ${srcdir}/ada/config-lang.in)
@@ -2137,6 +2530,35 @@ changequote([,])dnl
        esac
 done
 
+missing_languages=
+for expected_language in ${expected_languages} ..
+do 
+    if test "${expected_language}" != ..; then
+        missing_language="${expected_language}"
+        if test "${expected_language}" = "c" \
+           || test "${expected_language}" = "all"; then
+                missing_language=
+        fi
+        for found_language in ${found_languages} ..
+        do 
+            if test "${found_language}" != ..; then
+                if test "${expected_language}" = "${found_language}"; then
+                    missing_language=
+                fi
+            fi
+        done
+        if test "x${missing_language}" != x; then
+           missing_languages="${missing_languages} ${missing_language}"
+        fi
+    fi
+done
+
+if test "x$missing_languages" != x; then
+  AC_MSG_ERROR([
+The following requested languages were not found:${missing_languages}
+The following languages were available: c${found_languages}])
+fi
+
 # Make gthr-default.h if we have a thread file.
 gthread_flags=
 if test $thread_file != single; then
@@ -2193,14 +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.])])
-
 # 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.
 
@@ -2226,9 +2640,14 @@ all_languages=
 all_boot_languages=
 all_compilers=
 all_stagestuff=
-all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc'
+all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc mkheaders'
 # List of language makefile fragments.
 all_lang_makefiles=
+# Files for gengtype
+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
@@ -2249,6 +2668,7 @@ do
                compilers=
                stagestuff=
                outputs=
+               gtfiles=
                . ${srcdir}/$s/config-lang.in
                if test "x$language" = x
                then
@@ -2267,9 +2687,32 @@ do
                all_compilers="$all_compilers $compilers"
                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
@@ -2388,7 +2831,6 @@ else
 fi)
 AC_SUBST(slibdir)
 
-# Nothing to do for FLOAT_H, float_format already handled.
 objdir=`${PWDCMD-pwd}`
 AC_SUBST(objdir)
 
@@ -2397,8 +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)
@@ -2430,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)
@@ -2445,6 +2892,7 @@ AC_SUBST(symbolic_link)
 AC_SUBST(thread_file)
 AC_SUBST(tm_file_list)
 AC_SUBST(tm_file)
+AC_SUBST(tm_defines)
 AC_SUBST(tm_p_file_list)
 AC_SUBST(tm_p_file)
 AC_SUBST(xm_file)