OSDN Git Service

Fix bad regexp
[pf3gnuchains/gcc-fork.git] / gcc / configure.in
index 680a64a..ec25554 100644 (file)
@@ -1,24 +1,24 @@
-# configure.in for GNU CC
+# configure.in for GCC
 # Process this file with autoconf to generate a configuration script.
 
-# Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
-#This file is part of GNU CC.
+#This file is part of GCC.
 
-#GNU CC is free software; you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation; either version 2, or (at your option)
-#any later version.
+#GCC is free software; you can redistribute it and/or modify it under
+#the terms of the GNU General Public License as published by the Free
+#Software Foundation; either version 2, or (at your option) any later
+#version.
 
-#GNU CC is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#GNU General Public License for more details.
+#GCC is distributed in the hope that it will be useful, but WITHOUT
+#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#for more details.
 
 #You should have received a copy of the GNU General Public License
-#along with GNU CC; see the file COPYING.  If not, write to
-#the Free Software Foundation, 59 Temple Place - Suite 330,
-#Boston, MA 02111-1307, USA.
+#along with GCC; see the file COPYING.  If not, write to the Free
+#Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+#02111-1307, USA.
 
 # Initialization and defaults
 AC_PREREQ(2.13)
@@ -93,7 +93,7 @@ gnu_ld_flag=no)
 
 # With pre-defined ld
 AC_ARG_WITH(ld,
-[  --with-ld               arrange to use the specified ld (full pathname).],
+[  --with-ld               arrange to use the specified ld (full pathname)],
 DEFAULT_LINKER="$with_ld")
 if test x"${DEFAULT_LINKER+set}" = x"set"; then
   if test ! -x "$DEFAULT_LINKER"; then
@@ -107,12 +107,12 @@ fi
 
 # With GNU as
 AC_ARG_WITH(gnu-as,
-[  --with-gnu-as           arrange to work with GNU as.],
+[  --with-gnu-as           arrange to work with GNU as],
 gas_flag="$with_gnu_as",
 gas_flag=no)
 
 AC_ARG_WITH(as,
-[  --with-as               arrange to use the specified as (full pathname).],
+[  --with-as               arrange to use the specified as (full pathname)],
 DEFAULT_ASSEMBLER="$with_as")
 if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then
   if test ! -x "$DEFAULT_ASSEMBLER"; then
@@ -126,20 +126,20 @@ fi
 
 # With stabs
 AC_ARG_WITH(stabs,
-[  --with-stabs            arrange to use stabs instead of host debug format.],
+[  --with-stabs            arrange to use stabs instead of host debug format],
 stabs="$with_stabs",
 stabs=no)
 
 # With ELF
 AC_ARG_WITH(elf,
-[  --with-elf              arrange to use ELF instead of host debug format.],
+[  --with-elf              arrange to use ELF instead of host debug format],
 elf="$with_elf",
 elf=no)
 
 # Specify the local prefix
 local_prefix=
 AC_ARG_WITH(local-prefix,
-[  --with-local-prefix=DIR specifies directory to put local include.],
+[  --with-local-prefix=DIR specifies directory to put local include],
 [case "${withval}" in
 yes)   AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
 no)    ;;
@@ -158,7 +158,7 @@ gcc_gxx_include_dir=
 # Specify the g++ header file directory
 AC_ARG_WITH(gxx-include-dir,
 [  --with-gxx-include-dir=DIR
-                          specifies directory to put g++ header files.],
+                          specifies directory to put g++ header files],
 [case "${withval}" in
 yes)   AC_MSG_ERROR(bad value ${withval} given for g++ include directory) ;;
 no)    ;;
@@ -178,7 +178,7 @@ fi
 
 # Determine whether or not multilibs are enabled.
 AC_ARG_ENABLE(multilib,
-[  --enable-multilib      enable library support for multiple ABIs],
+[  --enable-multilib       enable library support for multiple ABIs],
 [], [enable_multilib=yes])
 AC_SUBST(enable_multilib)
 
@@ -247,13 +247,13 @@ fi
 
 
 AC_ARG_ENABLE(cpp,
-[  --disable-cpp           don't provide a user-visible C preprocessor.],
+[  --disable-cpp           don't provide a user-visible C preprocessor],
 [], [enable_cpp=yes])
 
 AC_ARG_WITH(cpp_install_dir,
 [  --with-cpp-install-dir=DIR
                           install the user visible C preprocessor in DIR
-                          (relative to PREFIX) as well as PREFIX/bin.],
+                          (relative to PREFIX) as well as PREFIX/bin],
 [if test x$withval = xyes; then
   AC_MSG_ERROR([option --with-cpp-install-dir requires an argument])
 elif test x$withval != xno; then
@@ -262,7 +262,7 @@ fi])
 
 # Enable Multibyte Characters for C/C++
 AC_ARG_ENABLE(c-mbchar,
-[  --enable-c-mbchar       Enable multibyte characters for C and C++.],
+[  --enable-c-mbchar       enable multibyte characters for C and C++],
 if test x$enable_c_mbchar != xno; then
   AC_DEFINE(MULTIBYTE_CHARS, 1,
   [Define if you want the C and C++ compilers to support multibyte
@@ -273,8 +273,8 @@ fi)
 # Pass with no value to take the default
 # Pass with a value to specify a thread package
 AC_ARG_ENABLE(threads,
-[  --enable-threads        enable thread usage for target GCC.
-  --enable-threads=LIB    use LIB thread package for target GCC.],,
+[  --enable-threads        enable thread usage for target GCC
+  --enable-threads=LIB    use LIB thread package for target GCC],,
 enable_threads='')
 
 enable_threads_flag=$enable_threads
@@ -289,7 +289,7 @@ case x${enable_threads_flag} in
                target_thread_file=''
                ;;
        xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
-       xsolaris | xwin32 | xdce | xvxworks | xaix)
+       xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix)
                target_thread_file=$enable_threads_flag
                ;;
        *)
@@ -300,7 +300,7 @@ esac
 
 AC_ARG_ENABLE(objc-gc,
 [  --enable-objc-gc      enable the use of Boehm's garbage collector with
-                         the GNU Objective-C runtime.],
+                         the GNU Objective-C runtime],
 if test x$enable_objc_gc = xno; then
        objc_boehm_gc=''
 else
@@ -309,12 +309,12 @@ fi,
 objc_boehm_gc='')
 
 AC_ARG_WITH(dwarf2,
-[  --with-dwarf2         force the default debug format to be DWARF2.],
+[  --with-dwarf2           force the default debug format to be DWARF 2],
 dwarf2="$with_dwarf2",
 dwarf2=no)
 
 AC_ARG_ENABLE(shared,
-[  --disable-shared       don't provide a shared libgcc.],
+[  --disable-shared        don't provide a shared libgcc],
 [
   case $enable_shared in
   yes | no) ;;
@@ -335,6 +335,9 @@ 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
@@ -347,6 +350,9 @@ 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"
@@ -354,17 +360,37 @@ 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; then
+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)
@@ -377,6 +403,8 @@ 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'.
@@ -397,6 +425,13 @@ vax-*-*)
     stage1_cflags="-J"
   fi
   ;;
+powerpc-*-darwin*)
+  # The spiffy cpp-precomp chokes on some legitimate constructs in GCC
+  # sources; use -no-cpp-precomp to get to GNU cpp.
+  # Apple's GCC has bugs in designated initializer handling, so disable
+  # that too.
+  stage1_cflags="-no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0"
+  ;;
 esac
 AC_SUBST(stage1_cflags)
 
@@ -447,22 +482,22 @@ gcc_AC_PROG_INSTALL
 
 AC_HEADER_STDC
 AC_HEADER_TIME
+gcc_AC_HEADER_STDBOOL
 gcc_AC_HEADER_STRING
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
-                fcntl.h unistd.h stab.h sys/file.h sys/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 iconv.h stdbool.h)
+                direct.h malloc.h langinfo.h)
 
 # Check for thread headers.
 AC_CHECK_HEADER(thread.h, [have_thread_h=yes], [have_thread_h=])
 AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=])
 
-# This test can't be done till we know if we have limits.h.
+# These tests can't be done till we know if we have limits.h.
 gcc_AC_C_CHAR_BIT
-
-# See if GNAT has been installed
-AC_CHECK_PROG(have_gnat, gnatbind, yes, no)
+gcc_AC_C_COMPILE_ENDIAN
+gcc_AC_C_FLOAT_FORMAT
 
 # See if we have the mktemp command.
 AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
@@ -477,7 +512,7 @@ else
   # that we can use it.
   gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
   [GNU texinfo.* \([0-9][0-9.]*\)],
-  [4.*])
+  [4.[1-9]*])
 fi
 
 if test $gcc_cv_prog_makeinfo_modern = no; then
@@ -491,7 +526,7 @@ fi
 
 # Is pod2man recent enough to regenerate manpages?
 AC_MSG_CHECKING([for recent Pod::Man])
-if perl -e 'use 1.10 Pod::Man' >/dev/null 2>&1; then
+if (perl -e 'use 1.10 Pod::Man') >/dev/null 2>&1; then
   AC_MSG_RESULT(yes)
   GENERATED_MANPAGES=generated-manpages                AC_SUBST(GENERATED_MANPAGES)
 else
@@ -516,8 +551,37 @@ else
   AC_CHECK_PROG(BISON, bison, bison, false)
 fi
 
+# These libraries may be used by collect2.
+# We may need a special search path to get them linked.
+AC_CACHE_CHECK(for collect2 libraries, gcc_cv_collect2_libs,
+[save_LIBS="$LIBS"
+for libs in '' -lld -lmld \
+               '-L/usr/lib/cmplrs/cc2.11 -lmld' \
+               '-L/usr/lib/cmplrs/cc3.11 -lmld'
+do
+       LIBS="$libs"
+       AC_TRY_LINK_FUNC(ldopen,
+               [gcc_cv_collect2_libs="$libs"; break])
+done
+LIBS="$save_LIBS"
+test -z "$gcc_cv_collect2_libs" && gcc_cv_collect2_libs='none required'])
+case $gcc_cv_collect2_libs in
+       "none required")        ;;
+       *)      COLLECT2_LIBS=$gcc_cv_collect2_libs ;;
+esac
+AC_SUBST(COLLECT2_LIBS)
+
+# When building Ada code on Alpha, we need exc_resume which is usually in
+# -lexc.  So test for it.
+save_LIBS="$LIBS"
+LIBS=
+AC_SEARCH_LIBS(exc_resume, exc)
+GNAT_LIBEXC="$LIBS"
+LIBS="$save_LIBS"
+AC_SUBST(GNAT_LIBEXC)
+
 # See if the stage1 system preprocessor understands the ANSI C
-# preprocessor stringification operator.
+# preprocessor stringification operator.  (Used by symcat.h.)
 AC_C_STRINGIZE
 
 # Use <inttypes.h> only if it exists,
@@ -539,10 +603,9 @@ fi
 dnl Disabled until we have a complete test for buggy enum bitfields.
 dnl gcc_AC_C_ENUM_BF_UNSIGNED
 
-AC_CHECK_FUNCS(strtoul bsearch putenv popen bcopy \
-       strchr strrchr kill getrlimit setrlimit atoll atoq \
-       sysconf isascii gettimeofday strsignal putc_unlocked fputc_unlocked \
-       fputs_unlocked getrusage iconv nl_langinfo)
+AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
+       sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
+       fwrite_unlocked fprintf_unlocked getrusage nl_langinfo lstat)
 
 AC_CHECK_TYPE(ssize_t, int)
 
@@ -566,8 +629,6 @@ else
 fi
 AC_SUBST(TARGET_GETGROUPS_T)
 
-gcc_AC_FUNC_VFPRINTF_DOPRNT
-gcc_AC_FUNC_STRSTR
 gcc_AC_FUNC_PRINTF_PTR
 
 case "${host}" in
@@ -576,29 +637,71 @@ case "${host}" in
 *** UWIN may not be used as a host platform because
 *** linking with posix.dll is not allowed by the GNU GPL])
   ;;
+*-*-*vms*)
+  # Under VMS, vfork works very different than on Unix. The standard test 
+  # won't work, and it isn't easily adaptable. It makes more sense to
+  # just force it.
+  ac_cv_func_vfork_works=yes
+  ;;
 esac
 AC_FUNC_VFORK
 AC_FUNC_MMAP_ANYWHERE
 AC_FUNC_MMAP_FILE
 
+AM_ICONV
+
 # We will need to find libiberty.h and ansidecl.h
 saved_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
-gcc_AC_CHECK_DECLS(bcopy \
-       getenv atol sbrk abort atof getcwd getwd \
-       strsignal putc_unlocked fputs_unlocked strstr environ \
-       malloc realloc calloc free basename getopt, , ,[
-#include "gansidecl.h"
+gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
+       strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
+        fprintf_unlocked strstr errno \
+       malloc realloc calloc free basename getopt clock, , ,[
+#include "ansidecl.h"
 #include "system.h"])
 
 gcc_AC_CHECK_DECLS(getrlimit setrlimit getrusage, , ,[
-#include "gansidecl.h"
+#include "ansidecl.h"
 #include "system.h"
 #ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
 #endif
 ])
 
+gcc_AC_CHECK_DECLS(times, , ,[
+#include "ansidecl.h"
+#include "system.h"
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+])
+
+# More time-related stuff.
+AC_CACHE_CHECK(for struct tms, ac_cv_struct_tms, [
+AC_TRY_COMPILE([
+#include "ansidecl.h"
+#include "system.h"
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+], [struct tms tms;], ac_cv_struct_tms=yes, ac_cv_struct_tms=no)])
+if test $ac_cv_struct_tms = yes; then
+  AC_DEFINE(HAVE_STRUCT_TMS, 1,
+  [Define if <sys/times.h> defines struct tms.])
+fi
+
+# use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
+# revisit after autoconf 2.50.
+AC_CACHE_CHECK(for clock_t, gcc_cv_type_clock_t, [
+AC_TRY_COMPILE([
+#include "ansidecl.h"
+#include "system.h"
+], [clock_t x;], gcc_cv_type_clock_t=yes, gcc_cv_type_clock_t=no)])
+if test $gcc_cv_type_clock_t = yes; then
+  AC_DEFINE(HAVE_CLOCK_T, 1,
+  [Define if <time.h> defines clock_t.])
+fi
+
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
 CFLAGS="$saved_CFLAGS"
 
@@ -638,9 +741,6 @@ then tm_file=$cpu_type/$cpu_type.h; fi
 if test x"$extra_headers" = x
 then extra_headers=; fi
 
-if test x"$xm_file" = x
-then xm_file=$cpu_type/xm-$cpu_type.h; fi
-
 if test x$md_file = x
 then md_file=$cpu_type/$cpu_type.md; fi
 
@@ -675,15 +775,12 @@ echo "Using \`$srcdir/config/$out_file' for machine-specific logic."
 echo "Using \`$srcdir/config/$md_file' as machine description file."
 
 # If any of the xm_file variables contain nonexistent files, warn
-# about them and drop them.  But $cpu/xm-$cpu.h is allowed not to
-# exist, if we have nothing for it to do.
-changequote(,)dnl
+# about them and drop them.
+
 bx=
 for x in $build_xm_file; do
   if    test -f $srcdir/config/$x
   then      bx="$bx $x"
-  elif  expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null
-  then      :
   else      AC_MSG_WARN($srcdir/config/$x does not exist.)
   fi
 done
@@ -693,8 +790,6 @@ hx=
 for x in $host_xm_file; do
   if    test -f $srcdir/config/$x
   then      hx="$hx $x"
-  elif  expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null
-  then      :
   else      AC_MSG_WARN($srcdir/config/$x does not exist.)
   fi
 done
@@ -704,13 +799,10 @@ tx=
 for x in $xm_file; do
   if    test -f $srcdir/config/$x
   then      tx="$tx $x"
-  elif  expr $x : '\([^/]*\)/xm-\1\.h' >/dev/null
-  then      :
   else      AC_MSG_WARN($srcdir/config/$x does not exist.)
   fi
 done
 xm_file="$tx"
-changequote([,])dnl
 
 count=a
 for f in $tm_file; do
@@ -773,6 +865,7 @@ fi
 if test x$host = x$build
 then
        build_auto=auto-host.h
+       FORBUILD=..
 else
        # We create a subdir, then run autoconf in the subdir.
        # To prevent recursion we set host and build for the new
@@ -786,8 +879,11 @@ else
        /* | [A-Za-z]:[\\/]* ) realsrcdir=${srcdir};;
        *) realsrcdir=../${srcdir};;
        esac
-       CC=${CC_FOR_BUILD} ${realsrcdir}/configure \
-               --target=$target --host=$build --build=$build
+       saved_CFLAGS="${CFLAGS}"
+       CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \
+       ${realsrcdir}/configure \
+               --target=$target_alias --host=$build_alias --build=$build_alias
+       CFLAGS="${saved_CFLAGS}"
 
        # We just finished tests for the build machine, so rename
        # the file auto-build.h in the gcc directory.
@@ -795,12 +891,14 @@ else
        cd ..
        rm -rf $tempdir
        build_auto=auto-build.h
+       FORBUILD=../$build
 fi
+AC_SUBST(FORBUILD)
 
 tm_file="${tm_file} defaults.h"
-host_xm_file="auto-host.h gansidecl.h ${host_xm_file} ${tm_file}"
-build_xm_file="${build_auto} gansidecl.h ${build_xm_file} ${tm_file}"
-xm_file="gansidecl.h ${xm_file} ${tm_file}"
+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}"
 
 # Truncate the target if necessary
 if test x$host_truncate_target != x; then
@@ -814,13 +912,13 @@ else
        gcc_version_trigger=${srcdir}/version.c
 fi
 changequote(,)dnl
-gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^"]*\)".*/\1/'`
 gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
 
 # Compile in configure arguments.
 if test -f configargs.h ; then
        # Being re-configured.
-       gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*\"\([^\"]*\)\".*/\1/'`
+       gcc_config_arguments=`grep configuration_arguments configargs.h | sed -e 's/.*"\([^"]*\)".*/\1/'`
        gcc_config_arguments="$gcc_config_arguments : (reconfigured) $TOPLEVEL_CONFIGURE_ARGUMENTS"
 else
        gcc_config_arguments="$TOPLEVEL_CONFIGURE_ARGUMENTS"
@@ -828,21 +926,16 @@ fi
 cat > configargs.h <<EOF
 /* Generated automatically. */
 static const char configuration_arguments[] = "$gcc_config_arguments";
+static const char thread_model[] = "$thread_file";
 EOF
 changequote([,])dnl
 
 # Internationalization
 PACKAGE=gcc
 VERSION="$gcc_version"
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",
-       [Define to the name of the distribution.])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION",
-       [Define to the version of the distribution.])
 AC_SUBST(PACKAGE)
 AC_SUBST(VERSION)
 
-ALL_LINGUAS="sv"
-
 # Enable NLS support by default
 AC_ARG_ENABLE(nls,
   [  --enable-nls            use Native Language Support (default)],
@@ -856,40 +949,32 @@ if test "${build}" != "${host}" && test "x$enable_nls" = "xyes"; then
   enable_nls=no
 fi
 
-# if NLS is enabled, also enable check in po subdir
-if test $enable_nls = yes; then
-  CHECK_PO=check-po
-else
-  CHECK_PO=""
-fi
-
-AC_SUBST(CHECK_PO)
-
 AM_GNU_GETTEXT
-XGETTEXT="AWK='$AWK' \$(SHELL) \$(top_srcdir)/exgettext $XGETTEXT"
 
 # Windows32 Registry support for specifying GCC installation paths.
 AC_ARG_ENABLE(win32-registry,
 [  --disable-win32-registry
-                          Disable lookup of installation paths in the
-                         Registry on Windows hosts.
-  --enable-win32-registry Enable registry lookup (default).
+                          disable lookup of installation paths in the
+                          Registry on Windows hosts
+  --enable-win32-registry enable registry lookup (default)
   --enable-win32-registry=KEY
-                          Use KEY instead of GCC version as the last portion
-                         of the registry key.],,)
-
+                          use KEY instead of GCC version as the last portion
+                          of the registry key],,)
+case $host_os in
+       win32 | pe | cygwin* | mingw32* | uwin*)
 AC_MSG_CHECKING(whether windows registry support is requested)
-if test x$enable_win32_registry != xno; then
+if test "x$enable_win32_registry" != xno; then
   AC_DEFINE(ENABLE_WIN32_REGISTRY, 1,
 [Define to 1 if installation paths should be looked up in Windows32
    Registry. Ignored on non windows32 hosts.])
   AC_MSG_RESULT(yes)
+  AC_SEARCH_LIBS(RegOpenKeyExA, advapi32)
 else
   AC_MSG_RESULT(no)
 fi
 
 # Check if user specified a different registry key.
-case x${enable_win32_registry} in
+case "x${enable_win32_registry}" in
 x | xyes)
   # default.
   gcc_cv_win32_registry_key="$VERSION"
@@ -904,12 +989,14 @@ xno)
   ;;
 esac
 
-if test x$enable_win32_registry != xno; then
+if test "x$enable_win32_registry" != xno; then
   AC_MSG_CHECKING(registry key on windows hosts)
   AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$gcc_cv_win32_registry_key",
        [Define to be the last portion of registry key on windows hosts.])
   AC_MSG_RESULT($gcc_cv_win32_registry_key)
 fi
+;;
+esac
 
 # Get an absolute path to the GCC top-level source directory
 holddir=`pwd`
@@ -952,6 +1039,7 @@ then
        cc_set_by_configure="\$(CC)"
        quoted_cc_set_by_configure="\$(CC)"
        stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
+       quoted_stage_prefix_set_by_configure="\$(STAGE_PREFIX)"
 else
        rm -f symtest.tem
        if cp -p $srcdir/gcc.c symtest.tem 2>/dev/null
@@ -963,6 +1051,7 @@ else
        cc_set_by_configure="\`case '\$(CC)' in stage*) echo '\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\$(CC)';; esac\`"
        quoted_cc_set_by_configure="\\\`case '\\\$(CC)' in stage*) echo '\\\$(CC)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(CC)';; esac\\\`"
        stage_prefix_set_by_configure="\`case '\$(STAGE_PREFIX)' in stage*) echo '\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\$(STAGE_PREFIX)';; esac\`"
+       quoted_stage_prefix_set_by_configure="\\\`case '\\\$(STAGE_PREFIX)' in stage*) echo '\\\$(STAGE_PREFIX)' | sed -e 's|stage|../stage|g';; *) echo '\\\$(STAGE_PREFIX)';; esac\\\`"
 fi
 rm -f symtest.tem
 
@@ -971,7 +1060,9 @@ out_object_file=`basename $out_file .c`.o
 tm_file_list=
 for f in $tm_file; do
   case $f in
-    gansidecl.h | defaults.h )
+    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)/config/$f" ;;
   esac
@@ -985,7 +1076,9 @@ done
 host_xm_file_list=
 for f in $host_xm_file; do
   case $f in
-    auto-host.h | gansidecl.h | defaults.h )
+    ansidecl.h )
+       host_xm_file_list="${host_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+    auto-host.h | defaults.h )
        host_xm_file_list="${host_xm_file_list} $f" ;;
     *) host_xm_file_list="${host_xm_file_list} \$(srcdir)/config/$f" ;;
   esac
@@ -994,31 +1087,33 @@ done
 build_xm_file_list=
 for f in $build_xm_file; do
   case $f in
-    auto-build.h | auto-host.h | gansidecl.h | defaults.h )
+    ansidecl.h )
+       build_xm_file_list="${build_xm_file_list} \$(srcdir)/../include/ansidecl.h" ;;
+    auto-build.h | auto-host.h | defaults.h )
        build_xm_file_list="${build_xm_file_list} $f" ;;
     *) build_xm_file_list="${build_xm_file_list} \$(srcdir)/config/$f" ;;
   esac
 done
 
-# Define macro CROSS_COMPILE in compilation
-# if this is a cross-compiler.
-# Also use all.cross instead of all.internal
-# and add cross-make to Makefile.
-cross_overrides="/dev/null"
+# Define macro CROSS_COMPILE in compilation if this is a cross-compiler.
+# Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR.
+CROSS=                                         AC_SUBST(CROSS)
+ALL=all.internal                               AC_SUBST(ALL)
+SYSTEM_HEADER_DIR='$(NATIVE_SYSTEM_HEADER_DIR)'        AC_SUBST(SYSTEM_HEADER_DIR)
 if test x$host != x$target
 then
-       cross_defines="CROSS=-DCROSS_COMPILE"
-       cross_overrides="${topdir}/cross-make"
+       CROSS="-DCROSS_COMPILE"
+       ALL=all.cross
+       SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)'
 fi
 
 # If this is a cross-compiler that does not
 # have its own set of headers then define
 # inhibit_libc
 
-# If this is using newlib, then define inhibit_libc in
-# LIBGCC2_CFLAGS.  This will cause __eprintf to be left out of
-# libgcc.a, but that's OK because newlib should have its own version of
-# assert.h.
+# If this is using newlib, then define inhibit_libc in LIBGCC2_CFLAGS.
+# 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
        inhibit_libc=-Dinhibit_libc
@@ -1029,13 +1124,31 @@ else
 fi
 AC_SUBST(inhibit_libc)
 
-# When building gcc with a cross-compiler, we need to fix a few things.
-# This must come after cross-make as we want all.build to override
-# all.cross.
-build_overrides="/dev/null"
+# 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)
+
+STMP_FIXINC=stmp-fixinc                AC_SUBST(STMP_FIXINC)
+STMP_FIXPROTO=stmp-fixproto    AC_SUBST(STMP_FIXPROTO)
+
+# And these apply if build != host.
 if test x$build != x$host
 then
-       build_overrides="${topdir}/build-make"
+    HOST_PREFIX=build-
+    HOST_PREFIX_1=build-
+    HOST_CC='$(CC_FOR_BUILD)'
+    HOST_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD) $(XCFLAGS)'
+
+    STMP_FIXINC=
+    STMP_FIXPROTO=
 fi
 
 # Expand extra_headers to include complete path.
@@ -1044,10 +1157,10 @@ extra_headers_list=
 if test "x$extra_headers" = x
 then true
 else
-       # Prepend ${srcdir}/ginclude/ to every entry in extra_headers.
+       # Prepend ${srcdir}/config/${cpu_type}/ to every entry in extra_headers.
        for file in $extra_headers;
        do
-               extra_headers_list="${extra_headers_list} \$(srcdir)/ginclude/${file}"
+               extra_headers_list="${extra_headers_list} \$(srcdir)/config/${cpu_type}/${file}"
        done
 fi
 
@@ -1056,15 +1169,10 @@ if test x$use_collect2 = xno; then
 fi
 
 # Add a definition of USE_COLLECT2 if system wants one.
-# Also tell toplev.c what to do.
-# This substitutes for lots of t-* files.
-if test x$use_collect2 = x
+if test x$use_collect2 != x
 then
-       will_use_collect2=
-       maybe_use_collect2=
-else
-       will_use_collect2="collect2"
-       maybe_use_collect2="-DUSE_COLLECT2"
+       host_xm_defines="${host_xm_defines} USE_COLLECT2"
+       xm_defines="${xm_defines} USE_COLLECT2"
 fi
 
 # If we have gas in the build tree, make a link to it.
@@ -1072,18 +1180,15 @@ if test -f ../gas/Makefile; then
        rm -f as; $symbolic_link ../gas/as-new$host_exeext as$host_exeext 2>/dev/null
 fi
 
-# If we have nm in the build tree, make a link to it.
+# If we have nm and objdump in the build tree, make a link to them.
 if test -f ../binutils/Makefile; then
        rm -f nm; $symbolic_link ../binutils/nm-new$host_exeext nm$host_exeext 2>/dev/null
+       rm -f objdump; $symbolic_link ../binutils/objdump$host_exeext objdump$host_exeext 2>/dev/null
 fi
 
 # If we have ld in the build tree, make a link to it.
 if test -f ../ld/Makefile; then
-#      if test x$use_collect2 = x; then
-#              rm -f ld; $symbolic_link ../ld/ld-new$host_exeext ld$host_exeext 2>/dev/null
-#      else
-               rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null
-#      fi
+       rm -f collect-ld; $symbolic_link ../ld/ld-new$host_exeext collect-ld$host_exeext 2>/dev/null
 fi
 
 # Figure out what assembler we will be using.
@@ -1092,6 +1197,7 @@ gcc_cv_as=
 gcc_cv_gas_major_version=
 gcc_cv_gas_minor_version=
 gcc_cv_as_gas_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/gas
+gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
 if test -x "$DEFAULT_ASSEMBLER"; then
        gcc_cv_as="$DEFAULT_ASSEMBLER"
 elif test -x "$AS"; then
@@ -1101,7 +1207,7 @@ elif test -x as$host_exeext; then
        gcc_cv_as=./as$host_exeext
 elif test -f $gcc_cv_as_gas_srcdir/configure.in -a -f ../gas/Makefile; then
        # Single tree build which includes gas.
-       for f in $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
+       for f in $gcc_cv_as_bfd_srcdir/configure $gcc_cv_as_gas_srcdir/configure $gcc_cv_as_gas_srcdir/configure.in $gcc_cv_as_gas_srcdir/Makefile.in
        do
 changequote(,)dnl
                gcc_cv_gas_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
@@ -1116,8 +1222,7 @@ changequote(,)dnl
 changequote([,])dnl
 fi
 
-if test "x$gcc_cv_as" = x -a x$host = x$target; then
-       # Native build.
+if test "x$gcc_cv_as" = x; then
        # Search the same directories that the installed compiler will
        # search.  Else we may find the wrong assembler and lose.  If we
        # do not find a suitable assembler binary, then try the user's
@@ -1142,14 +1247,21 @@ if test "x$gcc_cv_as" = x -a x$host = x$target; then
        # If the loop below does not find an assembler, then use whatever
        # one we can find in the users's path.
        # user's path.
-       gcc_cv_as=as$host_exeext
-
-       test_dirs="$test_prefix/lib/gcc-lib/$target/$gcc_version \
-                  $test_prefix/lib/gcc-lib/$target \
-                  /usr/lib/gcc/$target/$gcc_version \
-                  /usr/lib/gcc/$target \
-                  $test_prefix/$target/bin/$target/$gcc_version \
-                  $test_prefix/$target/bin \
+       if test "x$program_prefix" != xNONE; then
+               gcc_cv_as=${program_prefix}as$host_exeext
+       else
+               gcc_cv_as=`echo as | sed ${program_transform_name}`$host_exeext
+       fi
+
+       test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
+                  $test_prefix/lib/gcc-lib/$target_alias \
+                  /usr/lib/gcc/$target_alias/$gcc_version \
+                  /usr/lib/gcc/$target_alias \
+                  $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
+                  $test_prefix/$target_alias/bin"
+
+       if test x$host = x$target; then
+           test_dirs="$test_dirs \
                   /usr/libexec \
                   /usr/ccs/gcc \
                   /usr/ccs/bin \
@@ -1160,9 +1272,10 @@ if test "x$gcc_cv_as" = x -a x$host = x$target; then
                   /sysv/usr/lib/cmplrs/cc \
                   /svr4/usr/lib/cmplrs/cc \
                   /usr/bin"
+       fi
 
        for dir in $test_dirs; do
-               if test -f $dir/as$host_exeext; then
+               if test -x $dir/as$host_exeext; then
                        gcc_cv_as=$dir/as$host_exeext
                        break;
                fi
@@ -1174,16 +1287,124 @@ else
   AC_MSG_RESULT($gcc_cv_as)
 fi
 
+# Figure out what linker we will be using.
+AC_MSG_CHECKING(what linker to use)
+gcc_cv_ld=
+gcc_cv_gld_major_version=
+gcc_cv_gld_minor_version=
+gcc_cv_ld_gld_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/ld
+gcc_cv_ld_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
+if test -x "$DEFAULT_LINKER"; then
+       gcc_cv_ld="$DEFAULT_LINKER"
+elif test -x "$LD"; then
+       gcc_cv_ld="$LD"
+elif test -x ld$host_exeext; then
+       # Build using linker in the current directory.
+       gcc_cv_ld=./ld$host_exeext
+elif test -f $gcc_cv_ld_gld_srcdir/configure.in -a -f ../ld/Makefile; then
+       # Single tree build which includes ld.
+       for f in $gcc_cv_ld_bfd_srcdir/configure $gcc_cv_ld_gld_srcdir/configure $gcc_cv_ld_gld_srcdir/configure.in $gcc_cv_ld_gld_srcdir/Makefile.in
+       do
+changequote(,)dnl
+               gcc_cv_gld_version=`grep '^VERSION=[0-9]*\.[0-9]*' $f`
+changequote([,])dnl
+               if test x$gcc_cv_gld_version != x; then
+                       break
+               fi
+       done
+changequote(,)dnl
+       gcc_cv_gld_major_version=`expr "$gcc_cv_gld_version" : "VERSION=\([0-9]*\)"`
+       gcc_cv_gld_minor_version=`expr "$gcc_cv_gld_version" : "VERSION=[0-9]*\.\([0-9]*\)"`
+changequote([,])dnl
+fi
+
+if test "x$gcc_cv_ld" = x; then
+       # Search the same directories that the installed compiler will
+       # search.  Else we may find the wrong linker and lose.  If we
+       # do not find a suitable linker binary, then try the user's
+       # path.
+       #
+       # Also note we have to check MD_EXEC_PREFIX before checking the
+       # user's path.  Unfortunately, there is no good way to get at the
+       # value of MD_EXEC_PREFIX here.  So we do a brute force search
+       # through all the known MD_EXEC_PREFIX values.  Ugh.  This needs
+       # to be fixed as part of the make/configure rewrite too.
+
+       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
+
+       # If the loop below does not find an linker, then use whatever
+       # one we can find in the users's path.
+       # user's path.
+       if test "x$program_prefix" != xNONE; then
+               gcc_cv_ld=${program_prefix}ld$host_exeext
+       else
+               gcc_cv_ld=`echo ld | sed ${program_transform_name}`$host_exeext
+       fi
+
+       test_dirs="$test_prefix/lib/gcc-lib/$target_alias/$gcc_version \
+                  $test_prefix/lib/gcc-lib/$target_alias \
+                  /usr/lib/gcc/$target_alias/$gcc_version \
+                  /usr/lib/gcc/$target_alias \
+                  $test_prefix/$target_alias/bin/$target_alias/$gcc_version \
+                  $test_prefix/$target_alias/bin"
+
+       if test x$host = x$target; then
+           test_dirs="$test_dirs \
+                  /usr/libexec \
+                  /usr/ccs/gcc \
+                  /usr/ccs/bin \
+                  /udk/usr/ccs/bin \
+                  /bsd43/usr/lib/cmplrs/cc \
+                  /usr/cross64/usr/bin \
+                  /usr/lib/cmplrs/cc \
+                  /sysv/usr/lib/cmplrs/cc \
+                  /svr4/usr/lib/cmplrs/cc \
+                  /usr/bin"
+       fi
+
+       for dir in $test_dirs; do
+               if test -x $dir/ld$host_exeext; then
+                       gcc_cv_ld=$dir/ld$host_exeext
+                       break;
+               fi
+       done
+fi
+if test x$gcc_cv_gld_major_version != x -a x$gcc_cv_gld_minor_version != x; then
+  AC_MSG_RESULT("newly built ld")
+else
+  AC_MSG_RESULT($gcc_cv_ld)
+fi
+
 # Figure out what nm we will be using.
 AC_MSG_CHECKING(what nm to use)
 if test -x nm$host_exeext; then
        gcc_cv_nm=./nm$host_exeext
-elif test x$host = x$target; then
-       # Native build.
-       gcc_cv_nm=nm$host_exeext
+elif test "x$program_prefix" != xNONE; then
+       gcc_cv_nm=${program_prefix}nm$host_exeext
+else
+       gcc_cv_nm=`echo nm | sed ${program_transform_name}`$host_exeext
 fi
 AC_MSG_RESULT($gcc_cv_nm)
 
+# Figure out what objdump we will be using.
+AC_MSG_CHECKING(what objdump to use)
+if test -x objdump$host_exeext; then
+       gcc_cv_objdump=./objdump$host_exeext
+elif test "x$program_prefix" != xNONE; then
+       gcc_cv_objdump=${program_prefix}objdump$host_exeext
+else
+       gcc_cv_objdump=`echo objdump | sed ${program_transform_name}`$host_exeext
+fi
+AC_MSG_RESULT($gcc_cv_objdump)
+
 # Figure out what assembler alignment features are present.
 AC_MSG_CHECKING(assembler alignment features)
 gcc_cv_as_alignment_features=none
@@ -1297,11 +1518,13 @@ if test x"$gcc_cv_as_hidden" = xyes; then
                [Define if your assembler supports .hidden.])
 fi
 AC_MSG_RESULT($gcc_cv_as_hidden)
+libgcc_visibility=$gcc_cv_as_hidden
+AC_SUBST(libgcc_visibility)
 
 AC_MSG_CHECKING(assembler leb128 support)
-gcc_cv_as_hidden=no
+gcc_cv_as_leb128=no
 if 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 2 -a "$gcc_cv_gas_minor_version" -ge 10 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+  if test "$gcc_cv_gas_major_version" -eq 2 -a "$gcc_cv_gas_minor_version" -ge 11 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
     gcc_cv_as_leb128="yes"
   fi
 elif test x$gcc_cv_as != x; then
@@ -1316,6 +1539,23 @@ L2:
 EOF
        if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
                gcc_cv_as_leb128="yes"
+
+               # GAS versions before 2.11 do not support uleb128,
+               # despite appearing to.
+               # ??? There exists an elf-specific test that will crash
+               # the assembler.  Perhaps it's better to figure out whether
+               # arbitrary sections are supported and try the test.
+               as_ver=`$gcc_cv_as --version 2>/dev/null | head -1`
+               if echo "$as_ver" | grep GNU > /dev/null; then
+changequote(,)dnl
+                       as_ver=`echo $as_ver | sed -e 's/GNU assembler \([0-9.][0-9.]*\).*/\1/'`
+                       as_major=`echo $as_ver | sed 's/\..*//'`
+                       as_minor=`echo $as_ver | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
+changequote([,])dnl
+                       if test $as_major -eq 2 -a $as_minor -lt 11; then
+                               gcc_cv_as_leb128="no"
+                       fi
+               fi
        fi
        rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
 fi
@@ -1325,7 +1565,147 @@ if test x"$gcc_cv_as_leb128" = xyes; then
 fi
 AC_MSG_RESULT($gcc_cv_as_leb128)
 
-case "$target" in 
+AC_MSG_CHECKING(assembler eh_frame optimization)
+gcc_cv_as_eh_frame=no
+if 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 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+    gcc_cv_as_eh_frame="yes"
+  fi
+elif test x$gcc_cv_as != x; then
+       # Check if this is GAS.
+       as_ver=`$gcc_cv_as --version < /dev/null 2> /dev/null | head -1`
+       rm -f a.out 2> /dev/null
+       if echo "$as_ver" | grep GNU > /dev/null; then
+               # Versions up to and including 2.11.0 may mis-optimize
+               # .eh_frame data.  Try something.
+               cat > conftest.s <<EOF
+       .text
+.LFB1:
+       .4byte  0
+.L1:
+       .4byte  0
+.LFE1:
+       .section        .eh_frame,"aw",@progbits
+__FRAME_BEGIN__:
+       .4byte  .LECIE1-.LSCIE1
+.LSCIE1:
+       .4byte  0x0
+       .byte   0x1
+       .ascii "z\0"
+       .byte   0x1
+       .byte   0x78
+       .byte   0x1a
+       .byte   0x0
+       .byte   0x4
+       .4byte  1
+       .p2align 1
+.LECIE1:
+.LSFDE1:
+       .4byte  .LEFDE1-.LASFDE1
+.LASFDE1:
+       .4byte  .LASFDE1-__FRAME_BEGIN__
+       .4byte  .LFB1
+       .4byte  .LFE1-.LFB1
+       .byte   0x4
+       .4byte  .LFE1-.LFB1
+       .byte   0x4
+       .4byte  .L1-.LFB1
+.LEFDE1:
+EOF
+               cat > conftest.lit <<EOF
+ 0000 10000000 00000000 017a0001 781a0004  .........z..x...
+ 0010 01000000 12000000 18000000 00000000  ................
+ 0020 08000000 04080000 0044               .........D      
+EOF
+               cat > conftest.big <<EOF
+ 0000 00000010 00000000 017a0001 781a0004  .........z..x...
+ 0010 00000001 00000012 00000018 00000000  ................
+ 0020 00000008 04000000 0844               .........D      
+EOF
+               # If the assembler didn't choke, and we can objdump,
+               # and we got the correct data, then succeed.
+               if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
+                  && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
+                     | tail -3 > conftest.got \
+                  && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
+                       || cmp conftest.big conftest.got > /dev/null 2>&1; }
+               then
+                       gcc_cv_as_eh_frame="yes"
+               else
+                       gcc_cv_as_eh_frame="bad"
+                       if $gcc_cv_as -o conftest.o --traditional-format /dev/null; then
+                               AC_DEFINE(USE_AS_TRADITIONAL_FORMAT, 1,
+       [Define if your assembler mis-optimizes .eh_frame data.])
+                       fi
+               fi
+       fi
+       rm -f conftest.*
+fi
+AC_MSG_RESULT($gcc_cv_as_eh_frame)
+
+AC_MSG_CHECKING(assembler section merging support)
+gcc_cv_as_shf_merge=no
+if 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 2 -a "$gcc_cv_gas_minor_version" -ge 12 -o "$gcc_cv_gas_major_version" -gt 2 && grep 'obj_format = elf' ../gas/Makefile > /dev/null; then
+    gcc_cv_as_shf_merge=yes
+  fi
+elif test x$gcc_cv_as != x; then
+       # Check if we support SHF_MERGE sections
+       echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
+       if $gcc_cv_as --fatal-warnings -o conftest.o conftest.s > /dev/null 2>&1; then
+               gcc_cv_as_shf_merge=yes
+       fi
+       rm -f conftest.s conftest.o
+fi
+if test x"$gcc_cv_as_shf_merge" = xyes; then
+       AC_DEFINE(HAVE_GAS_SHF_MERGE, 1,
+[Define if your assembler supports marking sections with SHF_MERGE flag.])
+fi
+AC_MSG_RESULT($gcc_cv_as_shf_merge)
+
+case "$target" in
+  # All TARGET_ABI_OSF targets.
+  alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
+    AC_CACHE_CHECK([assembler supports explicit relocations],
+       gcc_cv_as_explicit_relocs, [
+       gcc_cv_as_explicit_relocs=unknown
+       if 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 2 \
+                  -a "$gcc_cv_gas_minor_version" -ge 12 \
+                  -o "$gcc_cv_gas_major_version" -gt 2; then
+             gcc_cv_as_explicit_relocs=yes
+          fi
+       elif test x$gcc_cv_as != x; then
+           cat > conftest.s << 'EOF'
+       .set nomacro
+       .text
+       extbl   $3, $2, $3      !lituse_bytoff!1
+       ldq     $2, a($29)      !literal!1
+       ldq     $4, b($29)      !literal!2
+       ldq_u   $3, 0($2)       !lituse_base!1
+       ldq     $27, f($29)     !literal!5
+       jsr     $26, ($27), f   !lituse_jsr!5
+       ldah    $29, 0($26)     !gpdisp!3
+       lda     $0, c($29)      !gprel
+       ldah    $1, d($29)      !gprelhigh
+       lda     $1, d($1)       !gprellow
+       lda     $29, 0($29)     !gpdisp!3
+EOF
+           if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+               gcc_cv_as_explicit_relocs=yes
+           else
+               gcc_cv_as_explicit_relocs=no
+           fi
+           rm -f conftest.s conftest.o
+       fi
+    ])
+    if test "x$gcc_cv_as_explicit_relocs" = xyes; then
+       AC_DEFINE(HAVE_AS_EXPLICIT_RELOCS, 1,
+               [Define if your assembler supports explicit relocations.])
+    fi
+    ;;
   sparc*-*-*)
     AC_CACHE_CHECK([assembler .register pseudo-op support],
        gcc_cv_as_register_pseudo_op, [
@@ -1365,42 +1745,54 @@ case "$target" in
                [Define if your assembler supports -relax option.])
     fi
 
-    case "$tm_file" in
-    *64*)
-       AC_CACHE_CHECK([for 64 bit support in assembler ($gcc_cv_as)],
-           gcc_cv_as_flags64, [
-               if test -n "$gcc_cv_as"; then
-                   echo ".xword foo" > conftest.s
-                   gcc_cv_as_flags64=no
-                   for flag in "-xarch=v9" "-64 -Av9"; do
-                       if $gcc_cv_as $flag -o conftest.o conftest.s \
-                           > /dev/null 2>&1; then
-                           gcc_cv_as_flags64=$flag
-                           break
-                       fi
-                   done
-                   rm -f conftest.s conftest.o
-               else
-                   if test "$gas" = yes; then
-                       gcc_cv_as_flags64="-64 -Av9"
+    AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
+       gcc_cv_as_sparc_ua_pcrel, [
+       gcc_cv_as_sparc_ua_pcrel=unknown
+       if test x$gcc_cv_as != x -a x$gcc_cv_ld != x; then
+           gcc_cv_as_sparc_ua_pcrel=no
+           echo ".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo)" > conftest.s
+           if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
+              && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
+               gcc_cv_as_sparc_ua_pcrel=yes
+           fi
+           rm -f conftest.s conftest.o conftest
+       fi
+    ])
+    if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
+       AC_DEFINE(HAVE_AS_SPARC_UA_PCREL, 1,
+               [Define if your assembler and linker support unaligned PC relative relocs.])
+    fi
+
+    AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs against hidden symbols],
+       gcc_cv_as_sparc_ua_pcrel_hidden, [
+       if test "x$gcc_cv_as_sparc_ua_pcrel" = xyes; then
+           gcc_cv_as_sparc_ua_pcrel_hidden=unknown
+           if test x$gcc_cv_objdump != x; then
+               gcc_cv_as_sparc_ua_pcrel_hidden=no
+               echo ".data; .align 4; .byte 0x31; .uaword %r_disp32(foo)" > conftest.s
+               echo ".byte 0x32, 0x33, 0x34; .global foo; .hidden foo" >> conftest.s
+               echo "foo: .skip 4" >> conftest.s
+               if $gcc_cv_as -K PIC -o conftest.o conftest.s > /dev/null 2>&1 \
+                  && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
+                  && $gcc_cv_objdump -s -j .data conftest 2> /dev/null \
+                     | grep ' 31000000 07323334' > /dev/null 2>&1; then
+                   if $gcc_cv_objdump -R conftest 2> /dev/null \
+                      | grep 'DISP32' > /dev/null 2>&1; then
+                       :
                    else
-                       gcc_cv_as_flags64="-xarch=v9"
+                       gcc_cv_as_sparc_ua_pcrel_hidden=yes
                    fi
                fi
-       ])
-       if test "x$gcc_cv_as_flags64" = xno; then
-changequote(, )
-           tmake_file=`echo " $tmake_file " | sed -e 's, sparc/t-sol2-64 , ,' -e 's,^ ,,' -e 's, $,,'`
-           dep_tmake_file=`echo " $dep_tmake_file " | sed -e 's, [^ ]*/config/sparc/t-sol2-64 , ,' -e 's,^ ,,' -e 's, $,,'`
-changequote([, ])
+           fi
+           rm -f conftest.s conftest.o conftest
        else
-           AC_DEFINE_UNQUOTED(AS_SPARC64_FLAG, "$gcc_cv_as_flags64",
-                       [Define if the assembler supports 64bit sparc.])
+           gcc_cv_as_sparc_ua_pcrel_hidden="$gcc_cv_as_sparc_ua_pcrel"
        fi
-       ;;
-    *) gcc_cv_as_flags64=${gcc_cv_as_flags64-no}
-       ;;
-    esac
+    ])
+    if test "x$gcc_cv_as_sparc_ua_pcrel_hidden" = xyes; then
+       AC_DEFINE(HAVE_AS_SPARC_UA_PCREL_HIDDEN, 1,
+               [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],
@@ -1430,10 +1822,11 @@ changequote([, ])
                [Define if your assembler supports offsetable %lo().])
        fi
     fi
+
     ;;
 
 changequote(,)dnl
-  i[34567]86-*-*)
+  i[34567]86-*-* | x86_64-*-*)
 changequote([,])dnl
     AC_MSG_CHECKING(assembler instructions)
     gcc_cv_as_instructions=
@@ -1457,6 +1850,32 @@ changequote([,])dnl
        AC_DEFINE_UNQUOTED(HAVE_GAS_`echo "$gcc_cv_as_instructions" | sed -e 's/ $//' | tr '[a-z ]' '[A-Z_]'`)
     fi
     AC_MSG_RESULT($gcc_cv_as_instructions)
+
+    AC_MSG_CHECKING(assembler GOTOFF in data directives)
+    gcc_cv_as_gotoff_in_data=no
+    if 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 2 \
+        -a "$gcc_cv_gas_minor_version" -ge 11 \
+        -o "$gcc_cv_gas_major_version" -gt 2; then
+       gcc_cv_as_gotoff_in_data=yes
+      fi
+    elif test x$gcc_cv_as != x; then
+       cat > conftest.s <<EOF
+       .text
+.L0:
+       nop
+       .data
+       .long .L0@GOTOFF
+EOF
+       if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1; then
+         gcc_cv_as_gotoff_in_data=yes
+       fi
+    fi
+    AC_DEFINE_UNQUOTED(HAVE_AS_GOTOFF_IN_DATA,
+      [`if test $gcc_cv_as_gotoff_in_data = yes; then echo 1; else echo 0; fi`],
+      [Define true if the assembler supports '.long foo@GOTOFF'.])
+    AC_MSG_RESULT($gcc_cv_as_gotoff_in_data)
     ;;
 esac
 
@@ -1469,7 +1888,7 @@ 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*-*-*)
+  i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* | x86_64*-*-* | hppa*-*-*)
     insn="nop"
     ;;
   ia64*-*-*)
@@ -1486,36 +1905,128 @@ then
     gcc_cv_as_dwarf2_debug_line="yes"
   fi
 elif test x$gcc_cv_as != x -a x"$insn" != x ; then
-       echo '  .file 0 "conftest.s"' > conftest.s
-       echo '  .loc 0 3 0' >> conftest.s
+       echo '  .file 1 "conftest.s"' > conftest.s
+       echo '  .loc 1 3 0' >> conftest.s
        echo "  $insn" >> conftest.s
+       # ??? This fails with non-gnu grep.
        if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1 \
           && grep debug_line conftest.o > /dev/null 2>&1 ; then
-               gcc_cv_as_dwarf2_debug_line="yes"
+               # The .debug_line file table must be in the exact order that
+               # we specified the files, since these indices are also used
+               # by DW_AT_decl_file.  Approximate this test by testing if
+               # the assembler bitches if the same index is assigned twice.
+               echo '  .file 1 "foo.s"' > conftest.s
+               echo '  .file 1 "bar.s"' >> conftest.s
+               if $gcc_cv_as -o conftest.o conftest.s > /dev/null 2>&1
+               then
+                 gcc_cv_as_dwarf2_debug_line="no"
+               else
+                 gcc_cv_as_dwarf2_debug_line="yes"
+               fi
        fi
        rm -f conftest.s conftest.o conftest.nm1 conftest.nm2
 fi
 if test x"$gcc_cv_as_dwarf2_debug_line" = xyes; then
        AC_DEFINE(HAVE_AS_DWARF2_DEBUG_LINE, 1,
-         [Define if your assembler supports dwarf2 .file/.loc directives.])
+[Define if your assembler supports dwarf2 .file/.loc directives,
+   and preserves file table indices exactly as given.])
 fi
 AC_MSG_RESULT($gcc_cv_as_dwarf2_debug_line)
 
+AC_MSG_CHECKING(assembler --gdwarf2 support)
+gcc_cv_as_gdwarf2_flag=no
+if 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 2 \
+       -a "$gcc_cv_gas_minor_version" -ge 11 \
+       -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"
+  fi
+elif test x$gcc_cv_as != x -a x"$insn" != x ; then
+       echo '' > conftest.s
+       # ??? This fails with non-gnu grep.
+       if $gcc_cv_as --gdwarf2 -o conftest.o conftest.s > /dev/null 2>&1
+         then
+         gcc_cv_as_gdwarf2_flag="yes"
+       fi
+       rm -f conftest.s conftest.o
+fi
+if test x"$gcc_cv_as_gdwarf2_flag" = xyes; then
+       AC_DEFINE(HAVE_AS_GDWARF2_DEBUG_FLAG, 1,
+[Define if your assembler supports the --gdwarf2 option.])
+fi
+AC_MSG_RESULT($gcc_cv_as_gdwarf2_flag)
+
+AC_MSG_CHECKING(assembler --gstabs support)
+gcc_cv_as_gstabs_flag=no
+if 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 2 \
+       -a "$gcc_cv_gas_minor_version" -ge 11 \
+       -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"
+  fi
+elif test x$gcc_cv_as != x -a x"$insn" != x ; then
+       echo '' > conftest.s
+       # ??? This fails with non-gnu grep.
+       if $gcc_cv_as --gstabs -o conftest.o conftest.s > /dev/null 2>&1 ; then
+         gcc_cv_as_gstabs_flag="yes"
+       fi
+       rm -f conftest.s conftest.o
+fi
+if test x"$gcc_cv_as_gstabs_flag" = xyes; then
+       AC_DEFINE(HAVE_AS_GSTABS_DEBUG_FLAG, 1,
+[Define if your assembler supports the --gstabs option.])
+fi
+AC_MSG_RESULT($gcc_cv_as_gstabs_flag)
+
+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
+  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 && grep 'EMUL = elf' ../ld/Makefile > /dev/null; then
+    gcc_cv_ld_eh_frame_hdr=yes
+  fi
+elif test x$gcc_cv_ld != x; then
+       # Check if linker supports --eh-frame-hdr option
+       if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then
+               gcc_cv_ld_eh_frame_hdr=yes
+       fi
+fi
+if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
+       AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1,
+[Define if your linker supports --eh-frame-hdr option.])
+fi
+AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
+
+if test "$prefix" != "/usr" && test "$prefix" != "/usr/local" ; then
+  AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include")
+fi
+
 # Figure out what language subdirectories are present.
 # Look if the user specified --enable-languages="..."; if not, use
 # the environment variable $LANGUAGES if defined. $LANGUAGES might
 # go away some day.
+# NB:  embedded tabs in this IF block -- do not untabify
 if test x"${enable_languages+set}" != xset; then
        if test x"${LANGUAGES+set}" = xset; then
-               enable_languages="`echo ${LANGUAGES} | tr ' ' ','`"
+               enable_languages="${LANGUAGES}"
+               AC_MSG_WARN([setting LANGUAGES is deprecated, use --enable-languages instead])
+
        else
                enable_languages=all
        fi
 else
-       if test x"${enable_languages}" = x; then
-               AC_MSG_ERROR([--enable-languages needs at least one argument])
+       if test x"${enable_languages}" = x ||
+          test x"${enable_languages}" = xyes;
+       then
+               AC_MSG_ERROR([--enable-languages needs at least one language argument])
        fi
 fi
+enable_languages=`echo "${enable_languages}" | sed -e 's/[[    ,]][[   ,]]*/,/g' -e 's/,$//'`
 
 # First scan to see if an enabled language requires some other language.
 # We assume that a given config-lang.in will list all the language
@@ -1602,8 +2113,8 @@ AC_SUBST(gthread_flags)
 
 # Find out what GC implementation we want, or may, use.
 AC_ARG_WITH(gc,
-[  --with-gc={simple,page} Choose the garbage collection mechanism to use
-                           with the compiler.],
+[  --with-gc={simple,page} choose the garbage collection mechanism to use
+                          with the compiler],
 [case "$withval" in
   simple | page)
     GGC=ggc-$withval
@@ -1627,15 +2138,13 @@ zlibinc=
 AC_SUBST(zlibdir)
 AC_SUBST(zlibinc)
 
-AC_DEFINE_UNQUOTED(ENABLE_STD_NAMESPACE, 1,
-  [Define to 1 if you want to enable namespaces (-fhonor-std) by default.])
-
 dnl Very limited version of automake's enable-maintainer-mode
 
 AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
   dnl maintainer-mode is disabled by default
   AC_ARG_ENABLE(maintainer-mode,
-[  --enable-maintainer-mode enable make rules and dependencies not useful
+[  --enable-maintainer-mode
+                          enable make rules and dependencies not useful
                           (and sometimes confusing) to the casual installer],
       maintainer_mode=$enableval,
       maintainer_mode=no)
@@ -1649,27 +2158,30 @@ 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.
 
 lang_specs_files=
 lang_options_files=
 lang_tree_files=
-rm -f specs.h options.h gencheck.h
-touch specs.h options.h gencheck.h
 for subdir in . $subdirs
 do
        if test -f $srcdir/$subdir/lang-specs.h; then
-               echo "#include \"$subdir/lang-specs.h\"" >>specs.h
-               lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
+           lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
        fi
        if test -f $srcdir/$subdir/lang-options.h; then
-               echo "#include \"$subdir/lang-options.h\"" >>options.h
-               lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
+           lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
        fi
        if test -f $srcdir/$subdir/$subdir-tree.def; then
-               echo "#include \"$subdir/$subdir-tree.def\"" >>gencheck.h
-               lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
+           lang_tree_files="$lang_tree_files $srcdir/$subdir/$subdir-tree.def"
        fi
 done
 
@@ -1679,12 +2191,9 @@ all_languages=
 all_boot_languages=
 all_compilers=
 all_stagestuff=
-all_diff_excludes=
-all_outputs='Makefile intl/Makefile po/Makefile.in fixinc/Makefile gccbug mklibgcc'
+all_outputs='Makefile intl/Makefile fixinc/Makefile gccbug mklibgcc'
 # List of language makefile fragments.
 all_lang_makefiles=
-all_headers=
-all_lib2funcs=
 
 # Add the language fragments.
 # Languages are added via two mechanisms.  Some information must be
@@ -1704,10 +2213,7 @@ do
                boot_language=
                compilers=
                stagestuff=
-               diff_excludes=
-               headers=
                outputs=
-               lib2funcs=
                . ${srcdir}/$s/config-lang.in
                if test "x$language" = x
                then
@@ -1725,10 +2231,7 @@ do
                fi
                all_compilers="$all_compilers $compilers"
                all_stagestuff="$all_stagestuff $stagestuff"
-               all_diff_excludes="$all_diff_excludes $diff_excludes"
-               all_headers="$all_headers $headers"
                all_outputs="$all_outputs $outputs"
-               all_lib2funcs="$all_lib2funcs $lib2funcs"
        fi
 done
 
@@ -1747,7 +2250,7 @@ done
 rm -f Make-hooks
 touch Make-hooks
 target_list="all.build all.cross start.encap rest.encap \
-       info dvi \
+       info dvi generated-manpages \
        install-normal install-common install-info install-man \
        uninstall \
        mostlyclean clean distclean extraclean maintainer-clean \
@@ -1786,7 +2289,7 @@ build_canonical=${build}
 host_canonical=${host}
 target_subdir=
 if test "${host}" != "${target}" ; then
-    target_subdir=${target}/
+    target_subdir=${target_alias}/
 fi
 AC_SUBST(build_canonical)
 AC_SUBST(host_canonical)
@@ -1807,7 +2310,7 @@ changequote(<<, >>)dnl
 #  -e 's|^\$(prefix)||'   matches and eliminates 'prefix' from 'exec_prefix'
 #  -e 's|/$||'            match a trailing forward slash and eliminates it
 #  -e 's|^[^/]|/|'        forces the string to start with a forward slash (*)
-#  -e 's|/[^/]*|../|g'    replaces each occurance of /<directory> with ../
+#  -e 's|/[^/]*|../|g'    replaces each occurrence of /<directory> with ../
 #
 # (*) Note this pattern overwrites the first character of the string
 # with a forward slash if one is not already present.  This is not a
@@ -1834,8 +2337,9 @@ AC_SUBST(dollar)
 # Find a directory in which to install a shared libgcc.
 
 AC_ARG_ENABLE(version-specific-runtime-libs,
-[  --enable-version-specific-runtime-libs    Specify that runtime libraries shou
-ld be installed in a compiler-specific directory ])
+[  --enable-version-specific-runtime-libs
+                          specify that runtime libraries should be
+                          installed in a compiler-specific directory])
 
 AC_ARG_WITH(slibdir,
 [  --with-slibdir=DIR      shared libraries in DIR [LIBDIR]],
@@ -1860,11 +2364,8 @@ ${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xma
 AC_SUBST(subdirs)
 AC_SUBST(all_boot_languages)
 AC_SUBST(all_compilers)
-AC_SUBST(all_diff_excludes)
-AC_SUBST(all_headers)
 AC_SUBST(all_lang_makefiles)
 AC_SUBST(all_languages)
-AC_SUBST(all_lib2funcs)
 AC_SUBST(all_stagestuff)
 AC_SUBST(build_exeext)
 AC_SUBST(build_install_headers_dir)
@@ -1877,7 +2378,6 @@ AC_SUBST(quoted_cc_set_by_configure)
 AC_SUBST(cpp_install_dir)
 AC_SUBST(dep_host_xmake_file)
 AC_SUBST(dep_tmake_file)
-AC_SUBST(extra_c_flags)
 AC_SUBST(extra_headers_list)
 AC_SUBST(extra_objs)
 AC_SUBST(extra_parts)
@@ -1900,12 +2400,12 @@ AC_SUBST(lang_options_files)
 AC_SUBST(lang_specs_files)
 AC_SUBST(lang_tree_files)
 AC_SUBST(local_prefix)
-AC_SUBST(maybe_use_collect2)
 AC_SUBST(md_file)
 AC_SUBST(objc_boehm_gc)
 AC_SUBST(out_file)
 AC_SUBST(out_object_file)
 AC_SUBST(stage_prefix_set_by_configure)
+AC_SUBST(quoted_stage_prefix_set_by_configure)
 AC_SUBST(symbolic_link)
 AC_SUBST(thread_file)
 AC_SUBST(tm_file_list)
@@ -1914,16 +2414,13 @@ AC_SUBST(tm_p_file_list)
 AC_SUBST(tm_p_file)
 AC_SUBST(xm_file)
 AC_SUBST(xm_defines)
-AC_SUBST(will_use_collect2)
+AC_SUBST(target_alias)
 AC_SUBST(c_target_objs)
 AC_SUBST(cxx_target_objs)
 AC_SUBST(target_cpu_default)
 
 AC_SUBST_FILE(target_overrides)
 AC_SUBST_FILE(host_overrides)
-AC_SUBST(cross_defines)
-AC_SUBST_FILE(cross_overrides)
-AC_SUBST_FILE(build_overrides)
 AC_SUBST_FILE(language_fragments)
 AC_SUBST_FILE(language_hooks)
 
@@ -1976,7 +2473,7 @@ esac
 # This is virtually a duplicate of what happens in configure.lang; we do
 # an extra check to make sure this only happens if ln -s can be used.
 if test "$symbolic_link" = "ln -s"; then
- for d in .. ${subdirs} ; do
+ for d in .. ${subdirs} fixinc ; do
    if test $d != ..; then
        STARTDIR=`pwd`
        cd $d
@@ -1994,38 +2491,7 @@ if test -f intl/libintl.h; then
   echo creating libintl.h
   echo '#include "intl/libintl.h"' >libintl.h
 fi
-],
-[
-host='${host}'
-build='${build}'
-target='${target}'
-target_alias='${target_alias}'
-srcdir='${srcdir}'
-subdirs='${subdirs}'
-symbolic_link='${symbolic_link}'
-program_transform_set='${program_transform_set}'
-program_transform_name='${program_transform_name}'
-dep_host_xmake_file='${dep_host_xmake_file}'
-host_xmake_file='${host_xmake_file}'
-dep_tmake_file='${dep_tmake_file}'
-tmake_file='${tmake_file}'
-thread_file='${thread_file}'
-gcc_config_arguments='${gcc_config_arguments}'
-gcc_version='${gcc_version}'
-gcc_version_full='${gcc_version_full}'
-gcc_version_trigger='${gcc_version_trigger}'
-local_prefix='${local_prefix}'
-build_install_headers_dir='${build_install_headers_dir}'
-build_exeext='${build_exeext}'
-host_exeext='${host_exeext}'
-out_file='${out_file}'
-gdb_needs_out_file_path='${gdb_needs_out_file_path}'
-SET_MAKE='${SET_MAKE}'
-target_list='${target_list}'
-target_overrides='${target_overrides}'
-host_overrides='${host_overrides}'
-cross_defines='${cross_defines}'
-cross_overrides='${cross_overrides}'
-build_overrides='${build_overrides}'
-cpp_install_dir='${cpp_install_dir}'
+], 
+[subdirs='$subdirs'
+symbolic_link='$symbolic_link'
 ])