OSDN Git Service

2007-05-21 H.J. Lu <hongjiu.lu@intel.com>
[pf3gnuchains/gcc-fork.git] / configure
index 00f35ec..6e989c2 100755 (executable)
--- a/configure
+++ b/configure
@@ -272,7 +272,7 @@ PACKAGE_STRING=
 PACKAGE_BUGREPORT=
 
 ac_unique_file="move-if-change"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GNATBIND ac_ct_GNATBIND do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs CC_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES OBJCOPY OBJDUMP CXX CFLAGS_FOR_BUILD CXXFLAGS CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET FLAGS_FOR_TARGET RAW_CXX_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage2_werror_flag LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os build_noncanonical host_noncanonical target_noncanonical host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN LN_S TOPLEVEL_CONFIGURE_ARGUMENTS build_libsubdir build_subdir host_subdir target_subdir CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GNATBIND ac_ct_GNATBIND GNATMAKE ac_ct_GNATMAKE do_compare gmplibs gmpinc stage1_languages SYSROOT_CFLAGS_FOR_TARGET RPATH_ENVVAR tooldir build_tooldir CONFIGURE_GDB_TK GDB_TK INSTALL_GDB_TK build_configargs build_configdirs host_configargs configdirs target_configargs CC_FOR_BUILD config_shell YACC BISON M4 LEX FLEX MAKEINFO EXPECT RUNTEST AR AS DLLTOOL LD LIPO NM RANLIB STRIP WINDRES OBJCOPY OBJDUMP CFLAGS_FOR_BUILD CC_FOR_TARGET CXX_FOR_TARGET GCC_FOR_TARGET GCJ_FOR_TARGET GFORTRAN_FOR_TARGET AR_FOR_TARGET AS_FOR_TARGET DLLTOOL_FOR_TARGET LD_FOR_TARGET LIPO_FOR_TARGET NM_FOR_TARGET OBJDUMP_FOR_TARGET RANLIB_FOR_TARGET STRIP_FOR_TARGET WINDRES_FOR_TARGET RAW_CXX_FOR_TARGET FLAGS_FOR_TARGET COMPILER_AS_FOR_TARGET COMPILER_LD_FOR_TARGET COMPILER_NM_FOR_TARGET MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT stage1_cflags stage1_checking stage2_werror_flag datarootdir docdir pdfdir htmldir LIBOBJS LTLIBOBJS'
 ac_subst_files='serialization_dependencies host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag'
 
 # Initialize some variables set by options.
@@ -729,6 +729,118 @@ ac_env_CPPFLAGS_set=${CPPFLAGS+set}
 ac_env_CPPFLAGS_value=$CPPFLAGS
 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_AR_set=${AR+set}
+ac_env_AR_value=$AR
+ac_cv_env_AR_set=${AR+set}
+ac_cv_env_AR_value=$AR
+ac_env_AS_set=${AS+set}
+ac_env_AS_value=$AS
+ac_cv_env_AS_set=${AS+set}
+ac_cv_env_AS_value=$AS
+ac_env_DLLTOOL_set=${DLLTOOL+set}
+ac_env_DLLTOOL_value=$DLLTOOL
+ac_cv_env_DLLTOOL_set=${DLLTOOL+set}
+ac_cv_env_DLLTOOL_value=$DLLTOOL
+ac_env_LD_set=${LD+set}
+ac_env_LD_value=$LD
+ac_cv_env_LD_set=${LD+set}
+ac_cv_env_LD_value=$LD
+ac_env_LIPO_set=${LIPO+set}
+ac_env_LIPO_value=$LIPO
+ac_cv_env_LIPO_set=${LIPO+set}
+ac_cv_env_LIPO_value=$LIPO
+ac_env_NM_set=${NM+set}
+ac_env_NM_value=$NM
+ac_cv_env_NM_set=${NM+set}
+ac_cv_env_NM_value=$NM
+ac_env_RANLIB_set=${RANLIB+set}
+ac_env_RANLIB_value=$RANLIB
+ac_cv_env_RANLIB_set=${RANLIB+set}
+ac_cv_env_RANLIB_value=$RANLIB
+ac_env_STRIP_set=${STRIP+set}
+ac_env_STRIP_value=$STRIP
+ac_cv_env_STRIP_set=${STRIP+set}
+ac_cv_env_STRIP_value=$STRIP
+ac_env_WINDRES_set=${WINDRES+set}
+ac_env_WINDRES_value=$WINDRES
+ac_cv_env_WINDRES_set=${WINDRES+set}
+ac_cv_env_WINDRES_value=$WINDRES
+ac_env_OBJCOPY_set=${OBJCOPY+set}
+ac_env_OBJCOPY_value=$OBJCOPY
+ac_cv_env_OBJCOPY_set=${OBJCOPY+set}
+ac_cv_env_OBJCOPY_value=$OBJCOPY
+ac_env_OBJDUMP_set=${OBJDUMP+set}
+ac_env_OBJDUMP_value=$OBJDUMP
+ac_cv_env_OBJDUMP_set=${OBJDUMP+set}
+ac_cv_env_OBJDUMP_value=$OBJDUMP
+ac_env_CC_FOR_TARGET_set=${CC_FOR_TARGET+set}
+ac_env_CC_FOR_TARGET_value=$CC_FOR_TARGET
+ac_cv_env_CC_FOR_TARGET_set=${CC_FOR_TARGET+set}
+ac_cv_env_CC_FOR_TARGET_value=$CC_FOR_TARGET
+ac_env_CXX_FOR_TARGET_set=${CXX_FOR_TARGET+set}
+ac_env_CXX_FOR_TARGET_value=$CXX_FOR_TARGET
+ac_cv_env_CXX_FOR_TARGET_set=${CXX_FOR_TARGET+set}
+ac_cv_env_CXX_FOR_TARGET_value=$CXX_FOR_TARGET
+ac_env_GCC_FOR_TARGET_set=${GCC_FOR_TARGET+set}
+ac_env_GCC_FOR_TARGET_value=$GCC_FOR_TARGET
+ac_cv_env_GCC_FOR_TARGET_set=${GCC_FOR_TARGET+set}
+ac_cv_env_GCC_FOR_TARGET_value=$GCC_FOR_TARGET
+ac_env_GCJ_FOR_TARGET_set=${GCJ_FOR_TARGET+set}
+ac_env_GCJ_FOR_TARGET_value=$GCJ_FOR_TARGET
+ac_cv_env_GCJ_FOR_TARGET_set=${GCJ_FOR_TARGET+set}
+ac_cv_env_GCJ_FOR_TARGET_value=$GCJ_FOR_TARGET
+ac_env_GFORTRAN_FOR_TARGET_set=${GFORTRAN_FOR_TARGET+set}
+ac_env_GFORTRAN_FOR_TARGET_value=$GFORTRAN_FOR_TARGET
+ac_cv_env_GFORTRAN_FOR_TARGET_set=${GFORTRAN_FOR_TARGET+set}
+ac_cv_env_GFORTRAN_FOR_TARGET_value=$GFORTRAN_FOR_TARGET
+ac_env_AR_FOR_TARGET_set=${AR_FOR_TARGET+set}
+ac_env_AR_FOR_TARGET_value=$AR_FOR_TARGET
+ac_cv_env_AR_FOR_TARGET_set=${AR_FOR_TARGET+set}
+ac_cv_env_AR_FOR_TARGET_value=$AR_FOR_TARGET
+ac_env_AS_FOR_TARGET_set=${AS_FOR_TARGET+set}
+ac_env_AS_FOR_TARGET_value=$AS_FOR_TARGET
+ac_cv_env_AS_FOR_TARGET_set=${AS_FOR_TARGET+set}
+ac_cv_env_AS_FOR_TARGET_value=$AS_FOR_TARGET
+ac_env_DLLTOOL_FOR_TARGET_set=${DLLTOOL_FOR_TARGET+set}
+ac_env_DLLTOOL_FOR_TARGET_value=$DLLTOOL_FOR_TARGET
+ac_cv_env_DLLTOOL_FOR_TARGET_set=${DLLTOOL_FOR_TARGET+set}
+ac_cv_env_DLLTOOL_FOR_TARGET_value=$DLLTOOL_FOR_TARGET
+ac_env_LD_FOR_TARGET_set=${LD_FOR_TARGET+set}
+ac_env_LD_FOR_TARGET_value=$LD_FOR_TARGET
+ac_cv_env_LD_FOR_TARGET_set=${LD_FOR_TARGET+set}
+ac_cv_env_LD_FOR_TARGET_value=$LD_FOR_TARGET
+ac_env_LIPO_FOR_TARGET_set=${LIPO_FOR_TARGET+set}
+ac_env_LIPO_FOR_TARGET_value=$LIPO_FOR_TARGET
+ac_cv_env_LIPO_FOR_TARGET_set=${LIPO_FOR_TARGET+set}
+ac_cv_env_LIPO_FOR_TARGET_value=$LIPO_FOR_TARGET
+ac_env_NM_FOR_TARGET_set=${NM_FOR_TARGET+set}
+ac_env_NM_FOR_TARGET_value=$NM_FOR_TARGET
+ac_cv_env_NM_FOR_TARGET_set=${NM_FOR_TARGET+set}
+ac_cv_env_NM_FOR_TARGET_value=$NM_FOR_TARGET
+ac_env_OBJDUMP_FOR_TARGET_set=${OBJDUMP_FOR_TARGET+set}
+ac_env_OBJDUMP_FOR_TARGET_value=$OBJDUMP_FOR_TARGET
+ac_cv_env_OBJDUMP_FOR_TARGET_set=${OBJDUMP_FOR_TARGET+set}
+ac_cv_env_OBJDUMP_FOR_TARGET_value=$OBJDUMP_FOR_TARGET
+ac_env_RANLIB_FOR_TARGET_set=${RANLIB_FOR_TARGET+set}
+ac_env_RANLIB_FOR_TARGET_value=$RANLIB_FOR_TARGET
+ac_cv_env_RANLIB_FOR_TARGET_set=${RANLIB_FOR_TARGET+set}
+ac_cv_env_RANLIB_FOR_TARGET_value=$RANLIB_FOR_TARGET
+ac_env_STRIP_FOR_TARGET_set=${STRIP_FOR_TARGET+set}
+ac_env_STRIP_FOR_TARGET_value=$STRIP_FOR_TARGET
+ac_cv_env_STRIP_FOR_TARGET_set=${STRIP_FOR_TARGET+set}
+ac_cv_env_STRIP_FOR_TARGET_value=$STRIP_FOR_TARGET
+ac_env_WINDRES_FOR_TARGET_set=${WINDRES_FOR_TARGET+set}
+ac_env_WINDRES_FOR_TARGET_value=$WINDRES_FOR_TARGET
+ac_cv_env_WINDRES_FOR_TARGET_set=${WINDRES_FOR_TARGET+set}
+ac_cv_env_WINDRES_FOR_TARGET_value=$WINDRES_FOR_TARGET
 
 #
 # Report the --help message.
@@ -811,7 +923,10 @@ Optional Features:
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-libada        Builds libada directory
   --enable-libssp        Builds libssp directory
-  --enable-libgcc-math   Builds libgcc-math directory
+  --enable-stage1-languages=all   choose additional languages to build during
+                          stage1.  Mostly useful for compiler development.
+  --enable-objc-gc       enable the use of Boehm's garbage collector with
+                          the GNU Objective-C runtime.
   --enable-bootstrap           Enable bootstrapping yes if native build
   --enable-serial-{host,target,build}-configure
                           Force sequential configuration of
@@ -819,19 +934,35 @@ Optional Features:
                          machine, or all sub-packages
   --enable-maintainer-mode enable make rules and dependencies not useful
                           (and sometimes confusing) to the casual installer
+  --enable-stage1-checking=all   choose additional checking for stage1
+                          of the compiler.
   --enable-werror         enable -Werror in bootstrap stage2 and later
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-mpfr-dir=PATH    Specify source directory for MPFR library
-  --with-mpfr=PATH        Specify directory for installed MPFR library
-  --with-gmp-dir=PATH     Specify source directory for GMP library
-  --with-gmp=PATH         Specify directory for installed GMP library
+  --with-build-libsubdir=DIR  Directory where to find libraries for build system
+  --with-mpfr-dir=PATH    This option has been REMOVED
+  --with-mpfr=PATH        Specify prefix directory for installed MPFR package
+                          Equivalent to --with-mpfr-include=PATH/include
+                          plus --with-mpfr-lib=PATH/lib
+  --with-mpfr-include=PATH
+                          Specify directory for installed MPFR include files
+  --with-mpfr-lib=PATH    Specify the directory for the installed MPFR library
+  --with-gmp-dir=PATH     This option has been REMOVED
+  --with-gmp=PATH         Specify prefix directory for the installed GMP package
+                          Equivalent to --with-gmp-include=PATH/include
+                          plus --with-gmp-lib=PATH/lib
+  --with-gmp-include=PATH Specify directory for installed GMP include files
+  --with-gmp-lib=PATH     Specify the directory for the installed GMP library
   --with-build-sysroot=sysroot
                           use sysroot as the system root during the build
   --with-build-time-tools=path
                           use given path to find target tools during the build
+  --with-datarootdir   Use datarootdir as the data root directory.
+  --with-docdir        Install documentation in this directory.
+  --with-pdfdir        Install pdf in this directory.
+  --with-htmldir       Install html in this directory.
 
 Some influential environment variables:
   CC          C compiler command
@@ -840,6 +971,49 @@ Some influential environment variables:
               nonstandard directory <lib dir>
   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
               headers in a nonstandard directory <include dir>
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  AR          AR for the host
+  AS          AS for the host
+  DLLTOOL     DLLTOOL for the host
+  LD          LD for the host
+  LIPO        LIPO for the host
+  NM          NM for the host
+  RANLIB      RANLIB for the host
+  STRIP       STRIP for the host
+  WINDRES     WINDRES for the host
+  OBJCOPY     OBJCOPY for the host
+  OBJDUMP     OBJDUMP for the host
+  CC_FOR_TARGET
+              CC for the target
+  CXX_FOR_TARGET
+              CXX for the target
+  GCC_FOR_TARGET
+              GCC for the target
+  GCJ_FOR_TARGET
+              GCJ for the target
+  GFORTRAN_FOR_TARGET
+              GFORTRAN for the target
+  AR_FOR_TARGET
+              AR for the target
+  AS_FOR_TARGET
+              AS for the target
+  DLLTOOL_FOR_TARGET
+              DLLTOOL for the target
+  LD_FOR_TARGET
+              LD for the target
+  LIPO_FOR_TARGET
+              LIPO for the target
+  NM_FOR_TARGET
+              NM for the target
+  OBJDUMP_FOR_TARGET
+              OBJDUMP for the target
+  RANLIB_FOR_TARGET
+              RANLIB for the target
+  STRIP_FOR_TARGET
+              STRIP for the target
+  WINDRES_FOR_TARGET
+              WINDRES for the target
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1280,6 +1454,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+
+# Find the build, host, and target systems.
 ac_aux_dir=
 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
   if test -f $ac_dir/install-sh; then
@@ -1337,6 +1513,33 @@ build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
 
+ case ${build_alias} in
+  "") build_noncanonical=${build} ;;
+  *) build_noncanonical=${build_alias} ;;
+esac
+
+
+
+ case ${host_alias} in
+  "") host_noncanonical=${build_noncanonical} ;;
+  *) host_noncanonical=${host_alias} ;;
+esac
+
+
+
+ case ${target_alias} in
+  "") target_noncanonical=${host_noncanonical} ;;
+  *) target_noncanonical=${target_alias} ;;
+esac
+
+
+
+
+test "$host_noncanonical" = "$target_noncanonical" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_transform_name=s,y,y,
+
 echo "$as_me:$LINENO: checking host system type" >&5
 echo $ECHO_N "checking host system type... $ECHO_C" >&6
 if test "${ac_cv_host+set}" = set; then
@@ -1401,6 +1604,7 @@ program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
 rm conftest.sed
 
 
+
 # Get 'install' or 'install-sh' and its variants.
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
@@ -1557,14 +1761,25 @@ progname=$0
 # if PWD already has a value, it is probably wrong.
 if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi
 
-# Export original configure arguments for use by sub-configures.  These
-# will be expanded by make, so quote '$'.
-tmp="$progname $@"
-sed -e 's,\$,$$,g' <<EOF_SED > conftestsed.out
-$tmp
-EOF_SED
-TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out`
-rm -f conftestsed.out
+# Export original configure arguments for use by sub-configures.
+# Quote arguments with shell meta charatcers.
+TOPLEVEL_CONFIGURE_ARGUMENTS=
+set -- "$progname" "$@"
+for ac_arg
+do
+  case "$ac_arg" in
+  *" "*|*"     "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\']*)
+    ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
+    # if the argument is of the form -foo=baz, quote the baz part only
+    ac_arg=`echo "'$ac_arg'" | sed "s/^'\([-a-zA-Z0-9]*=\)/\\1'/"` ;;
+  *) ;;
+  esac
+  # Add the quoted argument to the list.
+  TOPLEVEL_CONFIGURE_ARGUMENTS="$TOPLEVEL_CONFIGURE_ARGUMENTS $ac_arg"
+done
+# Remove the initial space we just introduced and, as these will be
+# expanded by make, quote '$'.
+TOPLEVEL_CONFIGURE_ARGUMENTS=`echo "x$TOPLEVEL_CONFIGURE_ARGUMENTS" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
 
 
 moveifchange=${srcdir}/move-if-change
@@ -1612,7 +1827,7 @@ build_tools="build-texinfo build-byacc build-flex build-bison build-m4 build-fix
 
 # these libraries are used by various programs built for the host environment
 #
-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber"
+host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr"
 
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
@@ -1623,7 +1838,6 @@ host_tools="texinfo byacc flex bison binutils gas ld fixincludes gcc sid sim gdb
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj="target-libffi \
-       target-boehm-gc \
        target-zlib \
        target-qthreads \
        target-libjava"
@@ -1631,14 +1845,15 @@ libgcj="target-libffi \
 # these libraries are built for the target environment, and are built after
 # the host libraries and the host tools (which may be a cross compiler)
 #
-target_libraries="target-libiberty \
+target_libraries="target-libgcc \
+               target-libiberty \
                target-libgloss \
                target-newlib \
                target-libstdc++-v3 \
                target-libmudflap \
                target-libssp \
-               target-libgcc-math \
                target-libgfortran \
+               target-boehm-gc \
                ${libgcj} \
                target-libobjc \
                target-libada \
@@ -1680,23 +1895,26 @@ else
 fi
 
 # Find the build and target subdir names.
- case ${build_alias} in
-  "") build_noncanonical=${build} ;;
-  *) build_noncanonical=${build_alias} ;;
-esac
-
- case ${host_alias} in
-  "") host_noncanonical=${build_noncanonical} ;;
-  *) host_noncanonical=${host_alias} ;;
-esac
 
- case ${target_alias} in
-  "") target_noncanonical=${host_noncanonical} ;;
-  *) target_noncanonical=${target_alias} ;;
-esac
+# post-stage1 host modules use a different CC_FOR_BUILD so, in order to
+# have matching libraries, they should use host libraries: Makefile.tpl
+# arranges to pass --with-build-libsubdir=$(HOST_SUBDIR).
+# However, they still use the build modules, because the corresponding
+# host modules (e.g. bison) are only built for the host when bootstrap
+# finishes. So:
+# - build_subdir is where we find build modules, and never changes.
+# - build_libsubdir is where we find build libraries, and can be overridden.
 
-  # Prefix 'build-' so this never conflicts with target_subdir.
+# Prefix 'build-' so this never conflicts with target_subdir.
 build_subdir="build-${build_noncanonical}"
+
+# Check whether --with-build-libsubdir or --without-build-libsubdir was given.
+if test "${with_build_libsubdir+set}" = set; then
+  withval="$with_build_libsubdir"
+  build_libsubdir="$withval"
+else
+  build_libsubdir="$build_subdir"
+fi;
 # --srcdir=. covers the toplevel, while "test -d" covers the subdirectories
 if ( test $srcdir = . && test -d gcc ) \
    || test -d $srcdir/../host-${host_noncanonical}; then
@@ -1742,7 +1960,7 @@ esac
 
 # Some tools are only suitable for building in a "native" situation.
 # Remove these if host!=target.
-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf"
 
 # Similarly, some are only suitable for cross toolchains.
 # Remove these if host=target.
@@ -1793,9 +2011,12 @@ case "${host}" in
   i[3456789]86-*-go32* | i[3456789]86-*-msdosdjgpp*)
     noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl gnuserv libffi"
     ;;
+  x86_64-*-mingw*)
+    noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib"
+    ;;
   i[3456789]86-*-mingw32*)
     # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl gnuserv"
-    noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
+    noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool newlib"
     ;;
   i[3456789]86-*-beos*)
     noconfigdirs="$noconfigdirs tk itcl libgui gdb"
@@ -1834,22 +2055,6 @@ else
   ENABLE_LIBSSP=yes
 fi;
 
-# Set the default so we build libgcc-math for ix86 and x86_64
-# Check whether --enable-libgcc-math or --disable-libgcc-math was given.
-if test "${enable_libgcc_math+set}" = set; then
-  enableval="$enable_libgcc_math"
-
-else
-
-case "${target}" in
-  i?86-* | x86_64-* )
-    enable_libgcc_math=yes ;;
-  *)
-    enable_libgcc_math=no ;;
-esac
-
-fi;
-
 # Save it here so that, even in case of --enable-libgcj, if the Java
 # front-end isn't enabled, we still get libgcj disabled.
 libgcj_saved=$libgcj
@@ -1891,7 +2096,7 @@ if test x$enable_libgomp = x ; then
        ;;
     *-*-netbsd* | *-*-freebsd* | *-*-openbsd*)
        ;;
-    *-*-solaris2* | *-*-sysv4* | *-*-irix* | *-*-osf* | *-*-hpux*)
+    *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*)
        ;;
     *-*-darwin* | *-*-aix*)
        ;;
@@ -1906,7 +2111,7 @@ case "${target}" in
   *-*-chorusos)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
-  powerpc-*-darwin*)
+  powerpc-*-darwin* | i[3456789]86-*-darwin*)
     noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
     noconfigdirs="$noconfigdirs sim target-rda"
     ;;
@@ -1970,9 +2175,6 @@ case "${target}" in
   *-*-vxworks*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty target-libstdc++-v3 ${libgcj}"
     ;;
-  m32c-*-*)
-    noconfigdirs="$noconfigdirs target-libstdc++-v3"
-    ;;
   alpha*-dec-osf*)
     # ld works, but does not support shared libraries.
     # newlib is not 64 bit ready.  I'm not sure about fileutils.
@@ -2048,7 +2250,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
     ;;
   bfin-*-*)
-    noconfigdirs="$noconfigdirs target-libgloss gdb"
+    noconfigdirs="$noconfigdirs gdb"
     if test x${is_cross_compiler} != xno ; then
       target_configdirs="${target_configdirs} target-bsp target-cygmon"
     fi
@@ -2112,6 +2314,9 @@ case "${target}" in
   hppa*64*-*-*)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
+  hppa*-hp-hpux11*)
+    noconfigdirs="$noconfigdirs ld shellutils"
+    ;;
   hppa*-*-*)
     # According to Alexandre Oliva <aoliva@redhat.com>, libjava won't
     # build on HP-UX 10.20.
@@ -2153,32 +2358,22 @@ case "${target}" in
     # 'target-newlib' will appear in skipdirs.
     ;;
   i[3456789]86-*-mingw32*)
-    target_configdirs="$target_configdirs target-mingw"
-    noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}"
-
-    # Can't build gdb for mingw32 if not native.
-    case "${host}" in
-      i[3456789]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
-      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl gnuserv"
-         ;;
-    esac
+    target_configdirs="$target_configdirs target-winsup"
+    noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
+    ;;
+  x86_64-*-mingw*)
+    target_configdirs="$target_configdirs target-winsup"
+    noconfigdirs="$noconfigdirs expect target-libgloss target-newlib ${libgcj}"
     ;;
   *-*-cygwin*)
     target_configdirs="$target_configdirs target-libtermcap target-winsup"
     noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}"
     # always build newlib if winsup directory is present.
-    if test -d "$srcdir/winsup"; then
+    if test -d "$srcdir/winsup/cygwin"; then
       skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
     elif test -d "$srcdir/newlib"; then
-      echo "Warning: winsup is missing so newlib can't be built."
+      echo "Warning: winsup/cygwin is missing so newlib can't be built."
     fi
-
-    # Can't build gdb for Cygwin if not native.
-    case "${host}" in
-      *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
-      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl libgui gnuserv"
-         ;;
-    esac
     ;;
   i[3456789]86-moss-msdos | i[3456789]86-*-moss* | \
   i[3456789]86-*-uwin* | i[3456789]86-*-interix* )
@@ -2280,17 +2475,11 @@ case "${target}" in
     # <oldham@codesourcery.com>
     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
-  mips*-dec-bsd*)
-    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
-    ;;
   mips*-*-bsd*)
     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
-  mipstx39-*-*)
-    noconfigdirs="$noconfigdirs gprof ${libgcj}"   # same as generic mips
-    ;;
   mips64*-*-linux*)
-    noconfigdirs="$noconfigdirs target-newlib ${libgcj}"
+    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
   mips*-*-linux*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
@@ -2332,6 +2521,9 @@ case "${target}" in
     ;;
   sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
     ;;
+  spu-*-*)
+    skipdirs="target-libssp"
+    ;;
   v810-*-*)
     noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
     ;;
@@ -2488,6 +2680,8 @@ case "${host}" in
     ;;
   *-mingw32*)
     ;;
+  *-mingw64*)
+    ;;
   *-interix*)
     host_makefile_frag="config/mh-interix"
     ;;
@@ -2558,26 +2752,12 @@ if test -z "${CC}" && test "${build}" = "${host}" ; then
 fi
 
 if test "${build}" != "${host}" ; then
-  # If we are doing a Canadian Cross, in which the host and build systems
-  # are not the same, we set reasonable default values for the tools.
-
-  CC=${CC-${host_alias}-gcc}
-  CFLAGS=${CFLAGS-"-g -O2"}
-  CXX=${CXX-${host_alias}-c++}
-  CXXFLAGS=${CXXFLAGS-"-g -O2"}
   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
-
 else
-  # Set reasonable default values for some tools even if not Canadian.
-  # Of course, these are different reasonable default values, originally
-  # specified directly in the Makefile.
-  # We don't export, so that autoconf can do its job.
-  # Note that all these settings are above the fragment inclusion point
-  # in Makefile.in, so can still be overridden by fragments.
-  # This is all going to change when we autoconfiscate...
-
   CC_FOR_BUILD="\$(CC)"
-  ac_ext=c
+fi
+
+ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@@ -3507,44 +3687,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-
-  # We must set the default linker to the linker used by gcc for the correct
-  # operation of libtool.  If LD is not defined and we are using gcc, try to
-  # set the LD default to the ld used by gcc.
-  if test -z "$LD"; then
-    if test "$GCC" = yes; then
-      case $build in
-      *-*-mingw*)
-       gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
-      *)
-       gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
-      esac
-      case $gcc_prog_ld in
-      # Accept absolute paths.
-      [\\/]* | [A-Za-z]:[\\/]*)
-        LD="$gcc_prog_ld" ;;
-      esac
-    fi
-  fi
-
-  CXX=${CXX-"c++"}
-  CFLAGS=${CFLAGS-"-g"}
-  CXXFLAGS=${CXXFLAGS-"-g -O2"}
-fi
-
-
-
-
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_GNATBIND+set}" = set; then
+if test "${ac_cv_prog_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$GNATBIND"; then
-  ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test.
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -3553,7 +3712,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_GNATBIND="${ac_tool_prefix}gnatbind"
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -3562,27 +3721,31 @@ done
 
 fi
 fi
-GNATBIND=$ac_cv_prog_GNATBIND
-if test -n "$GNATBIND"; then
-  echo "$as_me:$LINENO: result: $GNATBIND" >&5
-echo "${ECHO_T}$GNATBIND" >&6
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
+    test -n "$CXX" && break
+  done
 fi
-if test -z "$ac_cv_prog_GNATBIND"; then
-  ac_ct_GNATBIND=$GNATBIND
-  # Extract the first word of "gnatbind", so it can be a program name with args.
-set dummy gnatbind; ac_word=$2
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_GNATBIND+set}" = set; then
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$ac_ct_GNATBIND"; then
-  ac_cv_prog_ac_ct_GNATBIND="$ac_ct_GNATBIND" # Let the user override the test.
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_GNATBIND="gnatbind"
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
 
-  test -z "$ac_cv_prog_ac_ct_GNATBIND" && ac_cv_prog_ac_ct_GNATBIND="no"
 fi
 fi
-ac_ct_GNATBIND=$ac_cv_prog_ac_ct_GNATBIND
-if test -n "$ac_ct_GNATBIND"; then
-  echo "$as_me:$LINENO: result: $ac_ct_GNATBIND" >&5
-echo "${ECHO_T}$ac_ct_GNATBIND" >&6
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-  GNATBIND=$ac_ct_GNATBIND
-else
-  GNATBIND="$ac_cv_prog_GNATBIND"
+  test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+  CXX=$ac_ct_CXX
 fi
 
-echo "$as_me:$LINENO: checking whether compiler driver understands Ada" >&5
-echo $ECHO_N "checking whether compiler driver understands Ada... $ECHO_C" >&6
-if test "${acx_cv_cc_gcc_supports_ada+set}" = set; then
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.adb <<EOF
-procedure conftest is begin null; end conftest;
-EOF
-acx_cv_cc_gcc_supports_ada=no
-# There is a bug in old released versions of GCC which causes the
-# driver to exit successfully when the appropriate language module
-# has not been installed.  This is fixed in 2.95.4, 3.0.2, and 3.1.
-# Therefore we must check for the error message as well as an
-# unsuccessful exit.
-# Other compilers, like HP Tru64 UNIX cc, exit successfully when
-# given a .adb file, but produce no object file.  So we must check
-# if an object file was really produced to guard against this.
-errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
-if test x"$errors" = x && test -f conftest.$ac_objext; then
-  acx_cv_cc_gcc_supports_ada=yes
-fi
-rm -f conftest.*
-fi
-echo "$as_me:$LINENO: result: $acx_cv_cc_gcc_supports_ada" >&5
-echo "${ECHO_T}$acx_cv_cc_gcc_supports_ada" >&6
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-if test x$GNATBIND != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
-  have_gnat=yes
-else
-  have_gnat=no
-fi
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
 
-echo "$as_me:$LINENO: checking how to compare bootstrapped objects" >&5
-echo $ECHO_N "checking how to compare bootstrapped objects... $ECHO_C" >&6
-if test "${gcc_cv_prog_cmp_skip+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
 else
-   echo abfoo >t1
-  echo cdfoo >t2
-  gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
-  if cmp t1 t2 2 2 > /dev/null 2>&1; then
-    if cmp t1 t2 1 1 > /dev/null 2>&1; then
-      :
-    else
-      gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
-    fi
-  fi
-  if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
-    if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
-      :
-    else
-      gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
-    fi
-  fi
-  rm t1 t2
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_compiler_gnu=no
 fi
-echo "$as_me:$LINENO: result: $gcc_cv_prog_cmp_skip" >&5
-echo "${ECHO_T}$gcc_cv_prog_cmp_skip" >&6
-do_compare="$gcc_cv_prog_cmp_skip"
-
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cxx_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+for ac_declaration in \
+   '' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_cxx_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# We must set the default linker to the linker used by gcc for the correct
+# operation of libtool.  If LD is not defined and we are using gcc, try to
+# set the LD default to the ld used by gcc.
+if test -z "$LD"; then
+  if test "$GCC" = yes; then
+    case $build in
+    *-*-mingw*)
+      gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;;
+    *)
+      gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;;
+    esac
+    case $gcc_prog_ld in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      LD="$gcc_prog_ld" ;;
+    esac
+  fi
+fi
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GNATBIND+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GNATBIND"; then
+  ac_cv_prog_GNATBIND="$GNATBIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GNATBIND="${ac_tool_prefix}gnatbind"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+GNATBIND=$ac_cv_prog_GNATBIND
+if test -n "$GNATBIND"; then
+  echo "$as_me:$LINENO: result: $GNATBIND" >&5
+echo "${ECHO_T}$GNATBIND" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_GNATBIND"; then
+  ac_ct_GNATBIND=$GNATBIND
+  # Extract the first word of "gnatbind", so it can be a program name with args.
+set dummy gnatbind; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_GNATBIND+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_GNATBIND"; then
+  ac_cv_prog_ac_ct_GNATBIND="$ac_ct_GNATBIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_GNATBIND="gnatbind"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_GNATBIND" && ac_cv_prog_ac_ct_GNATBIND="no"
+fi
+fi
+ac_ct_GNATBIND=$ac_cv_prog_ac_ct_GNATBIND
+if test -n "$ac_ct_GNATBIND"; then
+  echo "$as_me:$LINENO: result: $ac_ct_GNATBIND" >&5
+echo "${ECHO_T}$ac_ct_GNATBIND" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  GNATBIND=$ac_ct_GNATBIND
+else
+  GNATBIND="$ac_cv_prog_GNATBIND"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gnatmake", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gnatmake; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GNATMAKE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GNATMAKE"; then
+  ac_cv_prog_GNATMAKE="$GNATMAKE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GNATMAKE="${ac_tool_prefix}gnatmake"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+GNATMAKE=$ac_cv_prog_GNATMAKE
+if test -n "$GNATMAKE"; then
+  echo "$as_me:$LINENO: result: $GNATMAKE" >&5
+echo "${ECHO_T}$GNATMAKE" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_GNATMAKE"; then
+  ac_ct_GNATMAKE=$GNATMAKE
+  # Extract the first word of "gnatmake", so it can be a program name with args.
+set dummy gnatmake; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_GNATMAKE+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_GNATMAKE"; then
+  ac_cv_prog_ac_ct_GNATMAKE="$ac_ct_GNATMAKE" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_GNATMAKE="gnatmake"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_GNATMAKE" && ac_cv_prog_ac_ct_GNATMAKE="no"
+fi
+fi
+ac_ct_GNATMAKE=$ac_cv_prog_ac_ct_GNATMAKE
+if test -n "$ac_ct_GNATMAKE"; then
+  echo "$as_me:$LINENO: result: $ac_ct_GNATMAKE" >&5
+echo "${ECHO_T}$ac_ct_GNATMAKE" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  GNATMAKE=$ac_ct_GNATMAKE
+else
+  GNATMAKE="$ac_cv_prog_GNATMAKE"
+fi
+
+echo "$as_me:$LINENO: checking whether compiler driver understands Ada" >&5
+echo $ECHO_N "checking whether compiler driver understands Ada... $ECHO_C" >&6
+if test "${acx_cv_cc_gcc_supports_ada+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.adb <<EOF
+procedure conftest is begin null; end conftest;
+EOF
+acx_cv_cc_gcc_supports_ada=no
+# There is a bug in old released versions of GCC which causes the
+# driver to exit successfully when the appropriate language module
+# has not been installed.  This is fixed in 2.95.4, 3.0.2, and 3.1.
+# Therefore we must check for the error message as well as an
+# unsuccessful exit.
+# Other compilers, like HP Tru64 UNIX cc, exit successfully when
+# given a .adb file, but produce no object file.  So we must check
+# if an object file was really produced to guard against this.
+errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
+if test x"$errors" = x && test -f conftest.$ac_objext; then
+  acx_cv_cc_gcc_supports_ada=yes
+fi
+rm -f conftest.*
+fi
+echo "$as_me:$LINENO: result: $acx_cv_cc_gcc_supports_ada" >&5
+echo "${ECHO_T}$acx_cv_cc_gcc_supports_ada" >&6
+
+if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then
+  have_gnat=yes
+else
+  have_gnat=no
+fi
+
+echo "$as_me:$LINENO: checking how to compare bootstrapped objects" >&5
+echo $ECHO_N "checking how to compare bootstrapped objects... $ECHO_C" >&6
+if test "${gcc_cv_prog_cmp_skip+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+   echo abfoo >t1
+  echo cdfoo >t2
+  gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
+  if cmp t1 t2 2 2 > /dev/null 2>&1; then
+    if cmp t1 t2 1 1 > /dev/null 2>&1; then
+      :
+    else
+      gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16'
+    fi
+  fi
+  if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
+    if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
+      :
+    else
+      gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
+    fi
+  fi
+  rm t1 t2
+
+fi
+echo "$as_me:$LINENO: result: $gcc_cv_prog_cmp_skip" >&5
+echo "${ECHO_T}$gcc_cv_prog_cmp_skip" >&6
+do_compare="$gcc_cv_prog_cmp_skip"
+
 
 
 # Check for GMP and MPFR
-gmplibs=
+gmplibs="-lmpfr -lgmp"
 gmpinc=
-have_gmp=yes
+have_gmp=no
+
 # Specify a location for mpfr
 # check for this first so it ends up on the link line before gmp.
 
 # Check whether --with-mpfr-dir or --without-mpfr-dir was given.
 if test "${with_mpfr_dir+set}" = set; then
   withval="$with_mpfr_dir"
-
+  { { echo "$as_me:$LINENO: error: The --with-mpfr-dir=PATH option has been removed.
+Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" >&5
+echo "$as_me: error: The --with-mpfr-dir=PATH option has been removed.
+Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" >&2;}
+   { (exit 1); exit 1; }; }
 fi;
 
-if test "x$with_mpfr_dir" != x; then
-  gmpinc="-I$with_mpfr_dir"
-  gmplibs="$with_mpfr_dir/libmpfr.a"
-else
-  gmplibs="-lmpfr"
-fi
-
 
 # Check whether --with-mpfr or --without-mpfr was given.
 if test "${with_mpfr+set}" = set; then
@@ -3705,31 +4313,50 @@ if test "${with_mpfr+set}" = set; then
 
 fi;
 
+# Check whether --with-mpfr_include or --without-mpfr_include was given.
+if test "${with_mpfr_include+set}" = set; then
+  withval="$with_mpfr_include"
+
+fi;
+
+# Check whether --with-mpfr_lib or --without-mpfr_lib was given.
+if test "${with_mpfr_lib+set}" = set; then
+  withval="$with_mpfr_lib"
+
+fi;
+
 if test "x$with_mpfr" != x; then
   gmplibs="-L$with_mpfr/lib $gmplibs"
   gmpinc="-I$with_mpfr/include"
 fi
+if test "x$with_mpfr_include" != x; then
+  gmpinc="-I$with_mpfr_include"
+fi
+if test "x$with_mpfr_lib" != x; then
+  gmplibs="-L$with_mpfr_lib $gmplibs"
+fi
+if test "x$with_mpfr$with_mpfr_include$with_mpfr_lib" = x && test -d ${srcdir}/mpfr; then
+  gmplibs='-L$$r/$(HOST_SUBDIR)/mpfr/.libs -L$$r/$(HOST_SUBDIR)/mpfr/_libs '"$gmplibs"
+  gmpinc='-I$$r/$(HOST_SUBDIR)/mpfr -I$$s/mpfr '"$gmpinc"
+  # Do not test the mpfr version.  Assume that it is sufficient, since
+  # it is in the source tree, and the library has not been built yet
+  # but it would be included on the link line in the version check below
+  # hence making the test fail.
+  have_gmp=yes
+fi
 
 # Specify a location for gmp
 
 # Check whether --with-gmp-dir or --without-gmp-dir was given.
 if test "${with_gmp_dir+set}" = set; then
   withval="$with_gmp_dir"
-
+  { { echo "$as_me:$LINENO: error: The --with-gmp-dir=PATH option has been removed.
+Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" >&5
+echo "$as_me: error: The --with-gmp-dir=PATH option has been removed.
+Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" >&2;}
+   { (exit 1); exit 1; }; }
 fi;
 
-if test "x$with_gmp_dir" != x; then
-  gmpinc="$gmpinc -I$with_gmp_dir"
-  if test -f "$with_gmp_dir/.libs/libgmp.a"; then
-    gmplibs="$gmplibs $with_gmp_dir/.libs/libgmp.a"
-  elif test -f "$with_gmp_dir/_libs/libgmp.a"; then
-    gmplibs="$gmplibs $with_gmp_dir/_libs/libgmp.a"
-  fi
-  # One of the later tests will catch the error if neither library is present.
-else
-  gmplibs="$gmplibs -lgmp"
-fi
-
 
 # Check whether --with-gmp or --without-gmp was given.
 if test "${with_gmp+set}" = set; then
@@ -3737,15 +4364,45 @@ if test "${with_gmp+set}" = set; then
 
 fi;
 
+# Check whether --with-gmp_include or --without-gmp_include was given.
+if test "${with_gmp_include+set}" = set; then
+  withval="$with_gmp_include"
+
+fi;
+
+# Check whether --with-gmp_lib or --without-gmp_lib was given.
+if test "${with_gmp_lib+set}" = set; then
+  withval="$with_gmp_lib"
+
+fi;
+
+
 if test "x$with_gmp" != x; then
   gmplibs="-L$with_gmp/lib $gmplibs"
   gmpinc="-I$with_gmp/include $gmpinc"
 fi
+if test "x$with_gmp_include" != x; then
+  gmpinc="-I$with_gmp_include $gmpinc"
+fi
+if test "x$with_gmp_lib" != x; then
+  gmplibs="-L$with_gmp_lib $gmplibs"
+fi
+if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then
+  gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/.libs -L$$r/$(HOST_SUBDIR)/gmp/_libs '"$gmplibs"
+  gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc"
+  # Do not test the gmp version.  Assume that it is sufficient, since
+  # it is in the source tree, and the library has not been built yet
+  # but it would be included on the link line in the version check below
+  # hence making the test fail.
+  have_gmp=yes
+fi
 
-saved_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $gmpinc"
-# Check GMP actually works
-echo "$as_me:$LINENO: checking for correct version of gmp.h" >&5
+if test -d ${srcdir}/gcc && test "x$have_gmp" = xno; then
+  have_gmp=yes
+  saved_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS $gmpinc"
+  # Check GMP actually works
+  echo "$as_me:$LINENO: checking for correct version of gmp.h" >&5
 echo $ECHO_N "checking for correct version of gmp.h... $ECHO_C" >&6
 
 cat >conftest.$ac_ext <<_ACEOF
@@ -3759,9 +4416,9 @@ int
 main ()
 {
 
-#if __GNU_MP_VERSION < 3
-choke me
-#endif
+  #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1)
+  choke me
+  #endif
 
   ;
   return 0;
@@ -3800,12 +4457,61 @@ echo "${ECHO_T}no" >&6; have_gmp=no
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-if test x"$have_gmp" = xyes; then
-  echo "$as_me:$LINENO: checking for MPFR" >&5
-echo $ECHO_N "checking for MPFR... $ECHO_C" >&6
+  if test x"$have_gmp" = xyes; then
+    saved_LIBS="$LIBS"
+    LIBS="$LIBS $gmplibs"
+        echo "$as_me:$LINENO: checking for correct version of mpfr.h" >&5
+echo $ECHO_N "checking for correct version of mpfr.h... $ECHO_C" >&6
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <gmp.h>
+    #include <mpfr.h>
+int
+main ()
+{
+
+    #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,0)
+    choke me
+    #endif
+    mpfr_t n;
+    mpfr_t x;
+    int t;
+    mpfr_init (n);
+    mpfr_init (x);
+    mpfr_atan2 (n, n, x, GMP_RNDN);
+    mpfr_erfc (n, x, GMP_RNDN);
+    mpfr_subnormalize (x, t, GMP_RNDN);
 
-  saved_LIBS="$LIBS"
-  LIBS="$LIBS $gmplibs"
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3813,11 +4519,16 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <gmp.h>
-#include <mpfr.h>
+    #include <mpfr.h>
 int
 main ()
 {
-mpfr_t n; mpfr_init(n);
+
+    #if MPFR_VERSION < MPFR_VERSION_NUM(2,2,1)
+    choke me
+    #endif
+    mpfr_t n; mpfr_init(n);
+
   ;
   return 0;
 }
@@ -3850,13 +4561,43 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+echo "$as_me:$LINENO: result: buggy but acceptable" >&5
+echo "${ECHO_T}buggy but acceptable" >&6
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; have_gmp=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-  LIBS="$saved_LIBS"
+      LIBS="$saved_LIBS"
+  fi
   CFLAGS="$saved_CFLAGS"
+
+  if test x$have_gmp != xyes; then
+    { { echo "$as_me:$LINENO: error: Building GCC requires GMP 4.1+ and MPFR 2.2.1+.
+Try the --with-gmp and/or --with-mpfr options to specify their locations.
+Copies of these libraries' source code can be found at their respective
+hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
+See also http://gcc.gnu.org/install/prerequisites.html for additional info.
+If you obtained GMP and/or MPFR from a vendor distribution package, make
+sure that you have installed both the libraries and the header files.
+They may be located in separate packages." >&5
+echo "$as_me: error: Building GCC requires GMP 4.1+ and MPFR 2.2.1+.
+Try the --with-gmp and/or --with-mpfr options to specify their locations.
+Copies of these libraries' source code can be found at their respective
+hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
+See also http://gcc.gnu.org/install/prerequisites.html for additional info.
+If you obtained GMP and/or MPFR from a vendor distribution package, make
+sure that you have installed both the libraries and the header files.
+They may be located in separate packages." >&2;}
+   { (exit 1); exit 1; }; }
+  fi
 fi
 
 # Flags needed for both GMP and/or MPFR
@@ -3864,8 +4605,7 @@ fi
 
 
 # By default, C is the only stage 1 language.
-stage1_languages=c
-
+stage1_languages=,c,
 
 # Figure out what language subdirectories are present.
 # Look if the user specified --enable-languages="..."; if not, use
@@ -3927,9 +4667,9 @@ if test -d ${srcdir}/gcc; then
     esac
   done
 
-  new_enable_languages=c
+  new_enable_languages=,c,
   missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
-  potential_languages=c
+  potential_languages=,c,
 
   for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do
     case ${lang_frag} in
@@ -3943,72 +4683,85 @@ if test -d ${srcdir}/gcc; then
         language=
         target_libs=
         lang_dirs=
-        boot_language=
-        build_by_default=
-        need_gmp=
+        subdir_requires=
+        boot_language=no
+        build_by_default=yes
         . ${lang_frag}
-        potential_languages="${potential_languages},${language}"
-        # This is quite sensitive to the ordering of the case statement arms.
-        case ,${enable_languages},:${language}:${have_gnat}:${build_by_default} in
-          *::*:*)
-            echo "${lang_frag} doesn't set \$language." 1>&2
-            exit 1
-            ;;
-          *:ada:no:*)
-            # Ada was requested with no preexisting GNAT.  Disable unconditionally.
-            add_this_lang=no
-            ;;
-          *,${language},*:*:*:*)
+        if test x${language} = x; then
+          echo "${lang_frag} doesn't set \$language." 1>&2
+          exit 1
+        fi
+
+        case ,${enable_languages}, in
+          *,${language},*)
             # Language was explicitly selected; include it.
             add_this_lang=yes
             ;;
-          *,all,*:*:*:no)
-            # 'all' was selected, but this is not a default language
-            # so do not include it.
-            add_this_lang=no
-            ;;
-          *,all,*:*:*:*)
-            # 'all' was selected and this is a default language; include it.
-            add_this_lang=yes
+          *,all,*)
+            # 'all' was selected, select it if it is a default language
+            add_this_lang=${build_by_default}
             ;;
           *)
             add_this_lang=no
             ;;
         esac
 
-        # Disable languages that need GMP if it isn't available.
-        case ,${enable_languages},:${have_gmp}:${need_gmp} in
-          *,${language},*:no:yes)
+        # Disable languages that need other directories if these aren't available.
+       for i in $subdir_requires; do
+         test -f "$srcdir/gcc/$i/config-lang.in" && continue
+         case ,${enable_languages}, in
+            *,${language},*)
+              # Specifically requested language; tell them.
+              { { echo "$as_me:$LINENO: error: The gcc/$i directory contains parts of $language but is missing" >&5
+echo "$as_me: error: The gcc/$i directory contains parts of $language but is missing" >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            *)
+              # Silently disable.
+              add_this_lang=unsupported
+              ;;
+          esac
+       done
+
+        # Disable Ada if no preexisting GNAT is available.
+        case ,${enable_languages},:${language}:${have_gnat} in
+          *,${language},*:ada:no)
             # Specifically requested language; tell them.
-            { { echo "$as_me:$LINENO: error: GMP with MPFR support is required to build $language" >&5
-echo "$as_me: error: GMP with MPFR support is required to build $language" >&2;}
+            { { echo "$as_me:$LINENO: error: GNAT is required to build $language" >&5
+echo "$as_me: error: GNAT is required to build $language" >&2;}
    { (exit 1); exit 1; }; }
             ;;
-          *:no:yes)
+          *:ada:no)
             # Silently disable.
-            add_this_lang=no
+            add_this_lang=unsupported
             ;;
         esac
 
        # Disable a language that is unsupported by the target.
        case " $unsupported_languages " in
          *" $language "*)
-           add_this_lang=no
+           add_this_lang=unsupported
            ;;
        esac
 
        case $add_this_lang in
-         no)
+         unsupported)
             # Remove language-dependent dirs.
             eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
            ;;
-          *)
-           new_enable_languages="$new_enable_languages,$language"
+         no)
+            # Remove language-dependent dirs; still show language as supported.
+            eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\"
+            potential_languages="${potential_languages}${language},"
+           ;;
+          yes)
+           new_enable_languages="${new_enable_languages}${language},"
+            potential_languages="${potential_languages}${language},"
            missing_languages=`echo "$missing_languages" | sed "s/,$language,/,/"`
            case ${boot_language} in
              yes)
                # Add to (comma-separated) list of stage 1 languages.
-               stage1_languages="${stage1_languages},${language}"
+               stage1_languages="${stage1_languages}${language},"
                ;;
            esac
            ;;
@@ -4017,22 +4770,61 @@ echo "$as_me: error: GMP with MPFR support is required to build $language" >&2;}
     esac
   done
 
+  # Check whether --enable-stage1-languages or --disable-stage1-languages was given.
+if test "${enable_stage1_languages+set}" = set; then
+  enableval="$enable_stage1_languages"
+  case ,${enable_stage1_languages}, in
+    ,no,|,,)
+      # Set it to something that will have no effect in the loop below
+      enable_stage1_languages=c ;;
+    ,yes,)
+      enable_stage1_languages=`echo $new_enable_languages | \
+       sed -e "s/^,//" -e "s/,$//" ` ;;
+    *,all,*)
+      enable_stage1_languages=`echo ,$enable_stage1_languages, | \
+       sed -e "s/,all,/$new_enable_languages/" -e "s/^,//" -e "s/,$//" ` ;;
+  esac
+
+  # Add "good" languages from enable_stage1_languages to stage1_languages,
+  # while "bad" languages go in missing_languages.  Leave no duplicates.
+  for i in `echo $enable_stage1_languages | sed 's/,/ /g' `; do
+    case $potential_languages in
+      *,$i,*)
+        case $stage1_languages in
+          *,$i,*) ;;
+          *) stage1_languages="$stage1_languages$i," ;;
+        esac ;;
+      *)
+        case $missing_languages in
+          *,$i,*) ;;
+          *) missing_languages="$missing_languages$i," ;;
+        esac ;;
+     esac
+  done
+fi;
+
+  # Remove leading/trailing commas that were added for simplicity
+  potential_languages=`echo "$potential_languages" | sed -e "s/^,//" -e "s/,$//"`
   missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"`
+  stage1_languages=`echo "$stage1_languages" | sed -e "s/^,//" -e "s/,$//"`
+  new_enable_languages=`echo "$new_enable_languages" | sed -e "s/^,//" -e "s/,$//"`
+
   if test "x$missing_languages" != x; then
     { { echo "$as_me:$LINENO: error:
 The following requested languages could not be built: ${missing_languages}
-Recognised languages are: ${potential_languages}" >&5
+Supported languages are: ${potential_languages}" >&5
 echo "$as_me: error:
 The following requested languages could not be built: ${missing_languages}
-Recognised languages are: ${potential_languages}" >&2;}
+Supported languages are: ${potential_languages}" >&2;}
    { (exit 1); exit 1; }; }
   fi
-
   if test "x$new_enable_languages" != "x$enable_languages"; then
     echo The following languages will be built: ${new_enable_languages}
+    enable_languages="$new_enable_languages"
   fi
-  enable_languages="$new_enable_languages"
-  ac_configure_args=`echo " $ac_configure_args" | sed -e 's/ --enable-languages=[^ ]*//' -e 's/$/ --enable-languages='"$enable_languages"/ `
+
+
+  ac_configure_args=`echo " $ac_configure_args" | sed -e "s/ '--enable-languages=[^ ]*'//g" -e "s/$/ '--enable-languages="$enable_languages"'/" `
 fi
 
 # Handle --disable-<component> generically.
@@ -4043,6 +4835,32 @@ for dir in $configdirs $build_configdirs $target_configdirs ; do
   fi
 done
 
+# Check for Boehm's garbage collector
+# Check whether --enable-objc-gc or --disable-objc-gc was given.
+if test "${enable_objc_gc+set}" = set; then
+  enableval="$enable_objc_gc"
+  case ,${enable_languages},:${enable_objc_gc}:${noconfigdirs} in
+  *,objc,*:*:yes:*target-boehm-gc*)
+    { { echo "$as_me:$LINENO: error: Boehm's garbage collector was requested yet not supported in this configuration" >&5
+echo "$as_me: error: Boehm's garbage collector was requested yet not supported in this configuration" >&2;}
+   { (exit 1); exit 1; }; }
+    ;;
+esac
+fi;
+
+# Make sure we only build Boehm's garbage collector if required.
+case ,${enable_languages},:${enable_objc_gc} in
+  *,objc,*:yes)
+    # Keep target-boehm-gc if requested for Objective-C.
+    ;;
+  *)
+    # Otherwise remove target-boehm-gc depending on target-libjava.
+    if echo " ${noconfigdirs} " | grep "target-libjava" >/dev/null 2>&1; then
+      noconfigdirs="$noconfigdirs target-boehm-gc"
+    fi
+    ;;
+esac
+
 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs,
 # $build_configdirs and $target_configdirs.
 # If we have the source for $noconfigdirs entries, add them to $notsupp.
@@ -4084,10 +4902,14 @@ done
 
 # Sometimes the tools are distributed with libiberty but with no other
 # libraries.  In that case, we don't want to build target-libiberty.
+# Don't let libgcc imply libiberty either.
 if test -n "${target_configdirs}" ; then
+  libgcc=
   others=
   for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
-    if test "$i" != "libiberty" ; then
+    if test "$i" = "libgcc"; then
+      libgcc=target-libgcc
+    elif test "$i" != "libiberty" ; then
       if test -r $srcdir/$i/configure ; then
        others=yes;
        break;
@@ -4095,7 +4917,7 @@ if test -n "${target_configdirs}" ; then
     fi
   done
   if test -z "${others}" ; then
-    target_configdirs=
+    target_configdirs=$libgcc
   fi
 fi
 
@@ -4133,40 +4955,88 @@ done
 # FSF releases, it's important to let people know when their machine isn't
 # supported by the one or two programs in a package.
 
-if test -n "${notsupp}" && test -z "${norecursion}" ; then
-  # If $appdirs is non-empty, at least one of those directories must still
-  # be configured, or we error out.  (E.g., if the gas release supports a
-  # specified target in some subdirs but not the gas subdir, we shouldn't
-  # pretend that all is well.)
-  if test -n "$appdirs" ; then
-    for dir in $appdirs ; do
-      if test -r $dir/Makefile.in ; then
-       if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
-         appdirs=""
-         break
-       fi
-       if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
-         appdirs=""
-         break
-       fi
-      fi
-    done
-    if test -n "$appdirs" ; then
-      echo "*** This configuration is not supported by this package." 1>&2
-      exit 1
-    fi
-  fi
-  # Okay, some application will build, or we don't care to check.  Still
-  # notify of subdirs not getting built.
-  echo "*** This configuration is not supported in the following subdirectories:" 1>&2
-  echo "    ${notsupp}" 1>&2
-  echo "    (Any other directories should still work fine.)" 1>&2
+if test -n "${notsupp}" && test -z "${norecursion}" ; then
+  # If $appdirs is non-empty, at least one of those directories must still
+  # be configured, or we error out.  (E.g., if the gas release supports a
+  # specified target in some subdirs but not the gas subdir, we shouldn't
+  # pretend that all is well.)
+  if test -n "$appdirs" ; then
+    for dir in $appdirs ; do
+      if test -r $dir/Makefile.in ; then
+       if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
+         appdirs=""
+         break
+       fi
+       if echo " ${target_configdirs} " | grep " target-${dir} " >/dev/null 2>&1; then
+         appdirs=""
+         break
+       fi
+      fi
+    done
+    if test -n "$appdirs" ; then
+      echo "*** This configuration is not supported by this package." 1>&2
+      exit 1
+    fi
+  fi
+  # Okay, some application will build, or we don't care to check.  Still
+  # notify of subdirs not getting built.
+  echo "*** This configuration is not supported in the following subdirectories:" 1>&2
+  echo "    ${notsupp}" 1>&2
+  echo "    (Any other directories should still work fine.)" 1>&2
+fi
+
+case "$host" in
+  *msdosdjgpp*)
+    enable_gdbtk=no ;;
+esac
+
+# To find our prefix, in gcc_cv_tool_prefix.
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+
+if test "x$exec_prefix" = xNONE; then
+        if test "x$prefix" = xNONE; then
+                gcc_cv_tool_prefix=$ac_default_prefix
+        else
+                gcc_cv_tool_prefix=$prefix
+        fi
+else
+        gcc_cv_tool_prefix=$exec_prefix
+fi
+
+# If there is no compiler in the tree, use the PATH only.  In any
+# case, if there is no compiler in the tree nobody should use
+# AS_FOR_TARGET and LD_FOR_TARGET.
+if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then
+    gcc_version=`cat $srcdir/gcc/BASE-VER`
+    gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical$PATH_SEPARATOR"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
+    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin$PATH_SEPARATOR"
+else
+    gcc_cv_tool_dirs=
+fi
+
+if test x$build = x$target && test -n "$md_exec_prefix"; then
+        gcc_cv_tool_dirs="$gcc_cv_tool_dirs$md_exec_prefix$PATH_SEPARATOR"
 fi
 
-case "$host" in
-  *msdosdjgpp*)
-    enable_gdbtk=no ;;
-esac
+
 
 copy_dirs=
 
@@ -4190,11 +5060,8 @@ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
     exit 1
   fi
   if test x"${with_headers}" != xyes ; then
-    case "${exec_prefixoption}" in
-    "") x=${prefix} ;;
-    *) x=${exec_prefix} ;;
-    esac
-    copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
+    x=${gcc_cv_tool_prefix}
+    copy_dirs="${copy_dirs} ${with_headers} $x/${target_noncanonical}/sys-include"
   fi
 fi
 
@@ -4209,12 +5076,9 @@ if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then
   if test x"${with_libs}" != xyes ; then
     # Copy the libraries in reverse order, so that files in the first named
     # library override files in subsequent libraries.
-    case "${exec_prefixoption}" in
-    "") x=${prefix} ;;
-    *) x=${exec_prefix} ;;
-    esac
+    x=${gcc_cv_tool_prefix}
     for l in ${with_libs}; do
-      copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
+      copy_dirs="$l $x/${target_noncanonical}/lib ${copy_dirs}"
     done
   fi
 fi
@@ -4337,6 +5201,12 @@ extra_nmflags_for_target=
 extra_ranlibflags_for_target=
 target_makefile_frag=/dev/null
 case "${target}" in
+  mep*-*-*)
+    target_makefile_frag="config/mt-mep"
+    ;;
+  spu-*-*)
+    target_makefile_frag="config/mt-spu"
+    ;;
   *-*-netware*)
     target_makefile_frag="config/mt-netware"
     ;;
@@ -4411,7 +5281,7 @@ esac
 
 # Some systems (e.g., one of the i386-aix systems the gas testers are
 # using) don't handle "\$" correctly, so don't use it here.
-tooldir='${exec_prefix}'/${target_alias}
+tooldir='${exec_prefix}'/${target_noncanonical}
 build_tooldir=${tooldir}
 
 # Create a .gdbinit file which runs the one in srcdir
@@ -4604,7 +5474,7 @@ for module in ${build_configdirs} ; do
 done
 for module in ${configdirs} ; do
   if test -z "${no_recursion}"; then
-    for file in stage*-${module}/Makefile ${module}/Makefile; do
+    for file in stage*-${module}/Makefile prev-${module}/Makefile ${module}/Makefile; do
       if test -f ${file}; then
        echo 1>&2 "*** removing ${file} to force reconfigure"
        rm -f ${file}
@@ -4684,40 +5554,87 @@ serialization_dependencies=serdep.tmp
 
 
 # Base args.  Strip norecursion, cache-file, srcdir, host, build,
-# target and nonopt.  These are the ones we might not want to pass
-# down to subconfigures.  Also strip program-prefix, program-suffix,
-# and program-transform-name, so that we can pass down a consistent
-# program-transform-name.  If autoconf has put single quotes around
-# any of these arguments (because they contain shell metacharacters)
-# then this will fail; in practice this only happens for
-# --program-transform-name, so be sure to override --program-transform-name
-# at the end of the argument list.
-# These will be expanded by make, so quote '$'.
-cat <<\EOF_SED > conftestsed
-s/ --no[^ ]*/ /g
-s/ --c[a-z-]*[= ][^ ]*//g
-s/ --sr[a-z-]*[= ][^ ]*//g
-s/ --ho[a-z-]*[= ][^ ]*//g
-s/ --bu[a-z-]*[= ][^ ]*//g
-s/ --t[a-z-]*[= ][^ ]*//g
-s/ --program-[pst][a-z-]*[= ][^ ]*//g
-s/ -cache-file[= ][^ ]*//g
-s/ -srcdir[= ][^ ]*//g
-s/ -host[= ][^ ]*//g
-s/ -build[= ][^ ]*//g
-s/ -target[= ][^ ]*//g
-s/ -program-prefix[= ][^ ]*//g
-s/ -program-suffix[= ][^ ]*//g
-s/ -program-transform-name[= ][^ ]*//g
-s/ [^' -][^ ]* / /
-s/^ *//;s/ *$//
-s,\$,$$,g
-EOF_SED
-sed -f conftestsed <<EOF_SED > conftestsed.out
- ${ac_configure_args}
-EOF_SED
-baseargs=`cat conftestsed.out`
-rm -f conftestsed conftestsed.out
+# target, nonopt, and variable assignments.  These are the ones we
+# might not want to pass down to subconfigures.  Also strip
+# program-prefix, program-suffix, and program-transform-name, so that
+# we can pass down a consistent program-transform-name.
+baseargs=
+keep_next=no
+skip_next=no
+eval "set -- $ac_configure_args"
+for ac_arg
+do
+  if test X"$skip_next" = X"yes"; then
+    skip_next=no
+    continue
+  fi
+  if test X"$keep_next" = X"yes"; then
+    case $ac_arg in
+      *\'*)
+       ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    baseargs="$baseargs '$ac_arg'"
+    keep_next=no
+    continue
+  fi
+
+  # Handle separated arguments.  Based on the logic generated by
+  # autoconf 2.59.
+  case $ac_arg in
+    *=* | --config-cache | -C | -disable-* | --disable-* \
+      | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+      | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+      | -with-* | --with-* | -without-* | --without-* | --x)
+      separate_arg=no
+      ;;
+    -*)
+      separate_arg=yes
+      ;;
+    *)
+      separate_arg=no
+      ;;
+  esac
+
+  case "$ac_arg" in
+    --no*)
+      continue
+      ;;
+    --c* | \
+    --sr* | \
+    --ho* | \
+    --bu* | \
+    --t* | \
+    --program-* | \
+    -cache_file* | \
+    -srcdir* | \
+    -host* | \
+    -build* | \
+    -target* | \
+    -program-prefix* | \
+    -program-suffix* | \
+    -program-transform-name* )
+      skip_next=$separate_arg
+      continue
+      ;;
+    -*)
+      # An option.  Add it.
+      case $ac_arg in
+       *\'*)
+         ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      esac
+      baseargs="$baseargs '$ac_arg'"
+      keep_next=$separate_arg
+      ;;
+    *)
+      # Either a variable assignment, or a nonopt (triplet).  Don't
+      # pass it down; let the Makefile handle this.
+      continue
+      ;;
+  esac
+done
+# Remove the initial space we just introduced and, as these will be
+# expanded by make, quote '$'.
+baseargs=`echo "x$baseargs" | sed -e 's/^x *//' -e 's,\\$,$$,g'`
 
 # Add in --program-transform-name, after --program-prefix and
 # --program-suffix have been applied to it.  Autoconf has already
@@ -4736,7 +5653,7 @@ baseargs="$baseargs --program-transform-name='${gcc_transform_name}'"
 # For the build-side libraries, we just need to pretend we're native,
 # and not use the same cache file.  Multilibs are neither needed nor
 # desired.
-build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} --target=${target_alias} ${baseargs}"
+build_configargs="--cache-file=../config.cache ${baseargs}"
 
 # For host modules, accept cache file option, or specification as blank.
 case "${cache_file}" in
@@ -4750,7 +5667,7 @@ esac
 
 # Host dirs don't like to share a cache file either, horribly enough.
 # This seems to be due to autoconf 2.5x stupidity.
-host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}"
+host_configargs="--cache-file=./config.cache ${extra_host_args} ${baseargs}"
 
 target_configargs=${baseargs}
 
@@ -4760,7 +5677,7 @@ target_configargs=${baseargs}
 # sorts of decisions they want to make on this basis.  Please consider
 # this option to be deprecated.  FIXME.
 if test x${is_cross_compiler} = xyes ; then
-  target_configargs="--with-cross-host=${host_alias} ${target_configargs}"
+  target_configargs="--with-cross-host=${host_noncanonical} ${target_configargs}"
 fi
 
 # Default to --enable-multilib.
@@ -4786,7 +5703,7 @@ fi
 # Pass the appropriate --build, --host, --target and --cache-file arguments.
 # We need to pass --target, as newer autoconf's requires consistency
 # for target_alias and gcc doesn't manage it consistently.
-target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}"
+target_configargs="--cache-file=./config.cache ${target_configargs}"
 
 FLAGS_FOR_TARGET=
 case " $target_configdirs " in
@@ -4838,6 +5755,11 @@ case " $target_configdirs " in
   esac
   ;;
 esac
+case "$target" in
+*-mingw*)
+  # Can't be handled as Cygwin above since Mingw does not use newlib.
+  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup/mingw -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/mingw/include -isystem $$s/winsup/w32api/include' ;;
+esac
 
 # Allow the user to override the flags for
 # our build compiler if desired.
@@ -4858,6 +5780,23 @@ if test "x${use_gnu_ld}" = x &&
   FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(HOST_SUBDIR)/ld'
 fi
 
+# Search for other target-specific linker scripts and such.
+case "${target}" in
+  m32c-*-* )
+    if test -d ${srcdir}/libgloss/m32c; then
+      # This is for crt0.o
+      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/libgloss/m32c'
+      # This is for r8c.ld
+      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/m32c'
+      # This is for libnosys.a
+      FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/libgloss/libnosys'
+    fi
+    ;;
+  mep*)
+    FLAGS_FOR_TARGET="$FLAGS_FOR_TARGET -mlibrary"
+    ;;
+esac
+
 # Makefile fragments.
 for frag in host_makefile_frag target_makefile_frag alphaieee_frag ospace_frag;
 do
@@ -5172,10 +6111,10 @@ case " $build_configdirs " in
   *" texinfo "*) MAKEINFO='$$r/$(BUILD_SUBDIR)/texinfo/makeinfo/makeinfo' ;;
   *)
 
-    # For an installed makeinfo, we require it to be from texinfo 4.2 or
+    # For an installed makeinfo, we require it to be from texinfo 4.4 or
     # higher, else we use the "missing" dummy.
     if ${MAKEINFO} --version \
-       | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])' >/dev/null 2>&1; then
+       | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
       :
     else
       MAKEINFO="$MISSING makeinfo"
@@ -5276,7 +6215,7 @@ test -n "$RUNTEST" || RUNTEST="runtest"
 
 case " $configdirs " in
   *" dejagnu "*)
-    test $host = $build && RUNTEST='$$r/$(HOST_SUBDIR)/dejagnu/runtest'
+    test $host = $build && RUNTEST='$$s/$(HOST_SUBDIR)/dejagnu/runtest'
     ;;
 esac
 
@@ -5287,7 +6226,55 @@ test -n "$host_alias" && ncn_tool_prefix=$host_alias-
 ncn_target_tool_prefix=
 test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
 
- for ncn_progname in ar; do
+
+
+if test -n "$AR"; then
+  ac_cv_prog_AR=$AR
+elif test -n "$ac_cv_prog_AR"; then
+  AR=$ac_cv_prog_AR
+fi
+
+if test -n "$ac_cv_prog_AR"; then
+  for ncn_progname in ar; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in ar; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -5374,7 +6361,55 @@ if test -z "$ac_cv_prog_AR" ; then
   fi
 fi
 
- for ncn_progname in as; do
+
+
+if test -n "$AS"; then
+  ac_cv_prog_AS=$AS
+elif test -n "$ac_cv_prog_AS"; then
+  AS=$ac_cv_prog_AS
+fi
+
+if test -n "$ac_cv_prog_AS"; then
+  for ncn_progname in as; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AS="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+  echo "$as_me:$LINENO: result: $AS" >&5
+echo "${ECHO_T}$AS" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in as; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -5461,7 +6496,55 @@ if test -z "$ac_cv_prog_AS" ; then
   fi
 fi
 
- for ncn_progname in dlltool; do
+
+
+if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL=$DLLTOOL
+elif test -n "$ac_cv_prog_DLLTOOL"; then
+  DLLTOOL=$ac_cv_prog_DLLTOOL
+fi
+
+if test -n "$ac_cv_prog_DLLTOOL"; then
+  for ncn_progname in dlltool; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DLLTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  echo "$as_me:$LINENO: result: $DLLTOOL" >&5
+echo "${ECHO_T}$DLLTOOL" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in dlltool; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -5498,17 +6581,75 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
-  fi
-  if test -z "$ac_cv_prog_DLLTOOL" && test $build = $host ; then
+  fi
+  if test -z "$ac_cv_prog_DLLTOOL" && test $build = $host ; then
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DLLTOOL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  echo "$as_me:$LINENO: result: $DLLTOOL" >&5
+echo "${ECHO_T}$DLLTOOL" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  fi
+  test -n "$ac_cv_prog_DLLTOOL" && break
+done
+
+if test -z "$ac_cv_prog_DLLTOOL" ; then
+  set dummy dlltool
+  if test $build = $host ; then
+    DLLTOOL="$2"
+  else
+    DLLTOOL="${ncn_tool_prefix}$2"
+  fi
+fi
+
+
+
+if test -n "$LD"; then
+  ac_cv_prog_LD=$LD
+elif test -n "$ac_cv_prog_LD"; then
+  LD=$ac_cv_prog_LD
+fi
+
+if test -n "$ac_cv_prog_LD"; then
+  for ncn_progname in ld; do
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_DLLTOOL+set}" = set; then
+if test "${ac_cv_prog_LD+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+  if test -n "$LD"; then
+  ac_cv_prog_LD="$LD" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -5517,7 +6658,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_DLLTOOL="${ncn_progname}"
+    ac_cv_prog_LD="${ncn_progname}"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -5526,29 +6667,19 @@ done
 
 fi
 fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  echo "$as_me:$LINENO: result: $DLLTOOL" >&5
-echo "${ECHO_T}$DLLTOOL" >&6
+LD=$ac_cv_prog_LD
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-  fi
-  test -n "$ac_cv_prog_DLLTOOL" && break
-done
-
-if test -z "$ac_cv_prog_DLLTOOL" ; then
-  set dummy dlltool
-  if test $build = $host ; then
-    DLLTOOL="$2"
-  else
-    DLLTOOL="${ncn_tool_prefix}$2"
-  fi
+  done
 fi
 
- for ncn_progname in ld; do
+for ncn_progname in ld; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -5635,7 +6766,55 @@ if test -z "$ac_cv_prog_LD" ; then
   fi
 fi
 
- for ncn_progname in lipo; do
+
+
+if test -n "$LIPO"; then
+  ac_cv_prog_LIPO=$LIPO
+elif test -n "$ac_cv_prog_LIPO"; then
+  LIPO=$ac_cv_prog_LIPO
+fi
+
+if test -n "$ac_cv_prog_LIPO"; then
+  for ncn_progname in lipo; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LIPO+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LIPO="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  echo "$as_me:$LINENO: result: $LIPO" >&5
+echo "${ECHO_T}$LIPO" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in lipo; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -5722,7 +6901,55 @@ if test -z "$ac_cv_prog_LIPO" ; then
   fi
 fi
 
- for ncn_progname in nm; do
+
+
+if test -n "$NM"; then
+  ac_cv_prog_NM=$NM
+elif test -n "$ac_cv_prog_NM"; then
+  NM=$ac_cv_prog_NM
+fi
+
+if test -n "$ac_cv_prog_NM"; then
+  for ncn_progname in nm; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NM+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM"; then
+  ac_cv_prog_NM="$NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NM="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+NM=$ac_cv_prog_NM
+if test -n "$NM"; then
+  echo "$as_me:$LINENO: result: $NM" >&5
+echo "${ECHO_T}$NM" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in nm; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -5809,7 +7036,55 @@ if test -z "$ac_cv_prog_NM" ; then
   fi
 fi
 
- for ncn_progname in ranlib; do
+
+
+if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB=$RANLIB
+elif test -n "$ac_cv_prog_RANLIB"; then
+  RANLIB=$ac_cv_prog_RANLIB
+fi
+
+if test -n "$ac_cv_prog_RANLIB"; then
+  for ncn_progname in ranlib; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in ranlib; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -5891,7 +7166,55 @@ if test -z "$ac_cv_prog_RANLIB" ; then
   RANLIB=":"
 fi
 
- for ncn_progname in strip; do
+
+
+if test -n "$STRIP"; then
+  ac_cv_prog_STRIP=$STRIP
+elif test -n "$ac_cv_prog_STRIP"; then
+  STRIP=$ac_cv_prog_STRIP
+fi
+
+if test -n "$ac_cv_prog_STRIP"; then
+  for ncn_progname in strip; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in strip; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -5928,17 +7251,70 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
-  fi
-  if test -z "$ac_cv_prog_STRIP" && test $build = $host ; then
+  fi
+  if test -z "$ac_cv_prog_STRIP" && test $build = $host ; then
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  fi
+  test -n "$ac_cv_prog_STRIP" && break
+done
+
+if test -z "$ac_cv_prog_STRIP" ; then
+  STRIP=":"
+fi
+
+
+
+if test -n "$WINDRES"; then
+  ac_cv_prog_WINDRES=$WINDRES
+elif test -n "$ac_cv_prog_WINDRES"; then
+  WINDRES=$ac_cv_prog_WINDRES
+fi
+
+if test -n "$ac_cv_prog_WINDRES"; then
+  for ncn_progname in windres; do
     # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_STRIP+set}" = set; then
+if test "${ac_cv_prog_WINDRES+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+  if test -n "$WINDRES"; then
+  ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -5947,7 +7323,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ncn_progname}"
+    ac_cv_prog_WINDRES="${ncn_progname}"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -5956,24 +7332,19 @@ done
 
 fi
 fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+WINDRES=$ac_cv_prog_WINDRES
+if test -n "$WINDRES"; then
+  echo "$as_me:$LINENO: result: $WINDRES" >&5
+echo "${ECHO_T}$WINDRES" >&6
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-  fi
-  test -n "$ac_cv_prog_STRIP" && break
-done
-
-if test -z "$ac_cv_prog_STRIP" ; then
-  STRIP=":"
+  done
 fi
 
- for ncn_progname in windres; do
+for ncn_progname in windres; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -6060,7 +7431,55 @@ if test -z "$ac_cv_prog_WINDRES" ; then
   fi
 fi
 
- for ncn_progname in objcopy; do
+
+
+if test -n "$OBJCOPY"; then
+  ac_cv_prog_OBJCOPY=$OBJCOPY
+elif test -n "$ac_cv_prog_OBJCOPY"; then
+  OBJCOPY=$ac_cv_prog_OBJCOPY
+fi
+
+if test -n "$ac_cv_prog_OBJCOPY"; then
+  for ncn_progname in objcopy; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_OBJCOPY+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OBJCOPY"; then
+  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJCOPY="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+OBJCOPY=$ac_cv_prog_OBJCOPY
+if test -n "$OBJCOPY"; then
+  echo "$as_me:$LINENO: result: $OBJCOPY" >&5
+echo "${ECHO_T}$OBJCOPY" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in objcopy; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -6147,7 +7566,55 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
   fi
 fi
 
- for ncn_progname in objdump; do
+
+
+if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP=$OBJDUMP
+elif test -n "$ac_cv_prog_OBJDUMP"; then
+  OBJDUMP=$ac_cv_prog_OBJDUMP
+fi
+
+if test -n "$ac_cv_prog_OBJDUMP"; then
+  for ncn_progname in objdump; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+echo "${ECHO_T}$OBJDUMP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+for ncn_progname in objdump; do
   if test -n "$ncn_tool_prefix"; then
     # Extract the first word of "${ncn_tool_prefix}${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}${ncn_progname}; ac_word=$2
@@ -6257,7 +7724,55 @@ else
   with_build_time_tools=
 fi;
 
- if test -n "$with_build_time_tools"; then
+
+
+if test -n "$CC_FOR_TARGET"; then
+  ac_cv_prog_CC_FOR_TARGET=$CC_FOR_TARGET
+elif test -n "$ac_cv_prog_CC_FOR_TARGET"; then
+  CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_CC_FOR_TARGET"; then
+  for ncn_progname in cc gcc; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC_FOR_TARGET"; then
+  ac_cv_prog_CC_FOR_TARGET="$CC_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC_FOR_TARGET=$ac_cv_prog_CC_FOR_TARGET
+if test -n "$CC_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $CC_FOR_TARGET" >&5
+echo "${ECHO_T}$CC_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_CC_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in cc gcc; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -6362,7 +7877,55 @@ if test -z "$ac_cv_prog_CC_FOR_TARGET" ; then
   fi
 fi
 
- if test -n "$with_build_time_tools"; then
+
+
+if test -n "$CXX_FOR_TARGET"; then
+  ac_cv_prog_CXX_FOR_TARGET=$CXX_FOR_TARGET
+elif test -n "$ac_cv_prog_CXX_FOR_TARGET"; then
+  CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_CXX_FOR_TARGET"; then
+  for ncn_progname in c++ g++ cxx gxx; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX_FOR_TARGET"; then
+  ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET
+if test -n "$CXX_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5
+echo "${ECHO_T}$CXX_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_CXX_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in c++ g++ cxx gxx; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -6416,17 +7979,76 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
-    fi
-    if test -z "$ac_cv_prog_CXX_FOR_TARGET" && test $build = $target ; then
-      # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+    fi
+    if test -z "$ac_cv_prog_CXX_FOR_TARGET" && test $build = $target ; then
+      # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CXX_FOR_TARGET"; then
+  ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET
+if test -n "$CXX_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5
+echo "${ECHO_T}$CXX_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    fi
+    test -n "$ac_cv_prog_CXX_FOR_TARGET" && break
+  done
+fi
+
+if test -z "$ac_cv_prog_CXX_FOR_TARGET" ; then
+  set dummy c++ g++ cxx gxx
+  if test $build = $target ; then
+    CXX_FOR_TARGET="$2"
+  else
+    CXX_FOR_TARGET="${ncn_target_tool_prefix}$2"
+  fi
+fi
+
+
+
+if test -n "$GCC_FOR_TARGET"; then
+  ac_cv_prog_GCC_FOR_TARGET=$GCC_FOR_TARGET
+elif test -n "$ac_cv_prog_GCC_FOR_TARGET"; then
+  GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_GCC_FOR_TARGET"; then
+  for ncn_progname in gcc; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
 set dummy ${ncn_progname}; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_CXX_FOR_TARGET+set}" = set; then
+if test "${ac_cv_prog_GCC_FOR_TARGET+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test -n "$CXX_FOR_TARGET"; then
-  ac_cv_prog_CXX_FOR_TARGET="$CXX_FOR_TARGET" # Let the user override the test.
+  if test -n "$GCC_FOR_TARGET"; then
+  ac_cv_prog_GCC_FOR_TARGET="$GCC_FOR_TARGET" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6435,7 +8057,7 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX_FOR_TARGET="${ncn_progname}"
+    ac_cv_prog_GCC_FOR_TARGET="${ncn_progname}"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -6444,30 +8066,19 @@ done
 
 fi
 fi
-CXX_FOR_TARGET=$ac_cv_prog_CXX_FOR_TARGET
-if test -n "$CXX_FOR_TARGET"; then
-  echo "$as_me:$LINENO: result: $CXX_FOR_TARGET" >&5
-echo "${ECHO_T}$CXX_FOR_TARGET" >&6
+GCC_FOR_TARGET=$ac_cv_prog_GCC_FOR_TARGET
+if test -n "$GCC_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $GCC_FOR_TARGET" >&5
+echo "${ECHO_T}$GCC_FOR_TARGET" >&6
 else
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
 fi
 
-    fi
-    test -n "$ac_cv_prog_CXX_FOR_TARGET" && break
   done
 fi
 
-if test -z "$ac_cv_prog_CXX_FOR_TARGET" ; then
-  set dummy c++ g++ cxx gxx
-  if test $build = $target ; then
-    CXX_FOR_TARGET="$2"
-  else
-    CXX_FOR_TARGET="${ncn_target_tool_prefix}$2"
-  fi
-fi
-
- if test -n "$with_build_time_tools"; then
+if test -z "$ac_cv_prog_GCC_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in gcc; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -6567,7 +8178,55 @@ if test -z "$ac_cv_prog_GCC_FOR_TARGET" ; then
   GCC_FOR_TARGET="${CC_FOR_TARGET}"
 fi
 
- if test -n "$with_build_time_tools"; then
+
+
+if test -n "$GCJ_FOR_TARGET"; then
+  ac_cv_prog_GCJ_FOR_TARGET=$GCJ_FOR_TARGET
+elif test -n "$ac_cv_prog_GCJ_FOR_TARGET"; then
+  GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_GCJ_FOR_TARGET"; then
+  for ncn_progname in gcj; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GCJ_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GCJ_FOR_TARGET"; then
+  ac_cv_prog_GCJ_FOR_TARGET="$GCJ_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GCJ_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+GCJ_FOR_TARGET=$ac_cv_prog_GCJ_FOR_TARGET
+if test -n "$GCJ_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $GCJ_FOR_TARGET" >&5
+echo "${ECHO_T}$GCJ_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_GCJ_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in gcj; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -6672,7 +8331,55 @@ if test -z "$ac_cv_prog_GCJ_FOR_TARGET" ; then
   fi
 fi
 
- if test -n "$with_build_time_tools"; then
+
+
+if test -n "$GFORTRAN_FOR_TARGET"; then
+  ac_cv_prog_GFORTRAN_FOR_TARGET=$GFORTRAN_FOR_TARGET
+elif test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then
+  GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_GFORTRAN_FOR_TARGET"; then
+  for ncn_progname in gfortran; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_GFORTRAN_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$GFORTRAN_FOR_TARGET"; then
+  ac_cv_prog_GFORTRAN_FOR_TARGET="$GFORTRAN_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_GFORTRAN_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+GFORTRAN_FOR_TARGET=$ac_cv_prog_GFORTRAN_FOR_TARGET
+if test -n "$GFORTRAN_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $GFORTRAN_FOR_TARGET" >&5
+echo "${ECHO_T}$GFORTRAN_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_GFORTRAN_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in gfortran; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -6779,52 +8486,6 @@ fi
 
 
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-
-
-if test "x$exec_prefix" = xNONE; then
-        if test "x$prefix" = xNONE; then
-                gcc_cv_tool_prefix=$ac_default_prefix
-        else
-                gcc_cv_tool_prefix=$prefix
-        fi
-else
-        gcc_cv_tool_prefix=$exec_prefix
-fi
-
-# If there is no compiler in the tree, use the PATH only.  In any
-# case, if there is no compiler in the tree nobody should use
-# AS_FOR_TARGET and LD_FOR_TARGET.
-if test x$host = x$build && test -f $srcdir/gcc/BASE-VER; then
-    gcc_version=`cat $srcdir/gcc/BASE-VER`
-    gcc_cv_tool_dirs="$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
-    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/libexec/gcc/$target_noncanonical$PATH_SEPARATOR"
-    gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
-    gcc_cv_tool_dirs="$gcc_cv_tool_dirs/usr/lib/gcc/$target_noncanonical$PATH_SEPARATOR"
-    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin/$target_noncanonical/$gcc_version$PATH_SEPARATOR"
-    gcc_cv_tool_dirs="$gcc_cv_tool_dirs$gcc_cv_tool_prefix/$target_noncanonical/bin$PATH_SEPARATOR"
-else
-    gcc_cv_tool_dirs=
-fi
-
-if test x$build = x$target && test -n "$md_exec_prefix"; then
-        gcc_cv_tool_dirs="$gcc_cv_tool_dirs$md_exec_prefix$PATH_SEPARATOR"
-fi
-
-
-
 cat > conftest.c << \EOF
 #ifdef __GNUC__
   gcc_yay;
@@ -6860,7 +8521,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_AR_FOR_TARGET=$AR_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_AR_FOR_TARGET" ; then
+if test -z "$ac_cv_path_AR_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -6902,7 +8563,55 @@ fi
 
 fi
 if test -z "$ac_cv_path_AR_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+
+if test -n "$AR_FOR_TARGET"; then
+  ac_cv_prog_AR_FOR_TARGET=$AR_FOR_TARGET
+elif test -n "$ac_cv_prog_AR_FOR_TARGET"; then
+  AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_AR_FOR_TARGET"; then
+  for ncn_progname in ar; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AR_FOR_TARGET"; then
+  ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AR_FOR_TARGET=$ac_cv_prog_AR_FOR_TARGET
+if test -n "$AR_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $AR_FOR_TARGET" >&5
+echo "${ECHO_T}$AR_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_AR_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in ar; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -7033,38 +8742,85 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_AS_FOR_TARGET=$AS_FOR_TARGET
   fi
 fi
+if test -z "$ac_cv_path_AS_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_AS_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $AS_FOR_TARGET in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $gcc_cv_tool_dirs
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_AS_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+AS_FOR_TARGET=$ac_cv_path_AS_FOR_TARGET
+
+if test -n "$AS_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5
+echo "${ECHO_T}$AS_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
 if test -z "$ac_cv_path_AS_FOR_TARGET" ; then
-  # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
+
+
+if test -n "$AS_FOR_TARGET"; then
+  ac_cv_prog_AS_FOR_TARGET=$AS_FOR_TARGET
+elif test -n "$ac_cv_prog_AS_FOR_TARGET"; then
+  AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_AS_FOR_TARGET"; then
+  for ncn_progname in as; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AS_FOR_TARGET+set}" = set; then
+if test "${ac_cv_prog_AS_FOR_TARGET+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $AS_FOR_TARGET in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $gcc_cv_tool_dirs
+  if test -n "$AS_FOR_TARGET"; then
+  ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_AS_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_prog_AS_FOR_TARGET="${ncn_progname}"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
 
-  ;;
-esac
 fi
-AS_FOR_TARGET=$ac_cv_path_AS_FOR_TARGET
-
+fi
+AS_FOR_TARGET=$ac_cv_prog_AS_FOR_TARGET
 if test -n "$AS_FOR_TARGET"; then
   echo "$as_me:$LINENO: result: $AS_FOR_TARGET" >&5
 echo "${ECHO_T}$AS_FOR_TARGET" >&6
@@ -7073,9 +8829,10 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
+  done
 fi
-if test -z "$ac_cv_path_AS_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+if test -z "$ac_cv_prog_AS_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in as; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -7206,7 +8963,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then
+if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7248,7 +9005,55 @@ fi
 
 fi
 if test -z "$ac_cv_path_DLLTOOL_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+
+if test -n "$DLLTOOL_FOR_TARGET"; then
+  ac_cv_prog_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET
+elif test -n "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then
+  DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_DLLTOOL_FOR_TARGET"; then
+  for ncn_progname in dlltool; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DLLTOOL_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$DLLTOOL_FOR_TARGET"; then
+  ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+DLLTOOL_FOR_TARGET=$ac_cv_prog_DLLTOOL_FOR_TARGET
+if test -n "$DLLTOOL_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $DLLTOOL_FOR_TARGET" >&5
+echo "${ECHO_T}$DLLTOOL_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in dlltool; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -7379,7 +9184,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_LD_FOR_TARGET=$LD_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_LD_FOR_TARGET" ; then
+if test -z "$ac_cv_path_LD_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7421,7 +9226,55 @@ fi
 
 fi
 if test -z "$ac_cv_path_LD_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+
+if test -n "$LD_FOR_TARGET"; then
+  ac_cv_prog_LD_FOR_TARGET=$LD_FOR_TARGET
+elif test -n "$ac_cv_prog_LD_FOR_TARGET"; then
+  LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_LD_FOR_TARGET"; then
+  for ncn_progname in ld; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LD_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LD_FOR_TARGET"; then
+  ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LD_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+LD_FOR_TARGET=$ac_cv_prog_LD_FOR_TARGET
+if test -n "$LD_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $LD_FOR_TARGET" >&5
+echo "${ECHO_T}$LD_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_LD_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in ld; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -7552,7 +9405,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_LIPO_FOR_TARGET=$LIPO_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then
+if test -z "$ac_cv_path_LIPO_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "lipo", so it can be a program name with args.
 set dummy lipo; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7594,7 +9447,55 @@ fi
 
 fi
 if test -z "$ac_cv_path_LIPO_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+
+if test -n "$LIPO_FOR_TARGET"; then
+  ac_cv_prog_LIPO_FOR_TARGET=$LIPO_FOR_TARGET
+elif test -n "$ac_cv_prog_LIPO_FOR_TARGET"; then
+  LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_LIPO_FOR_TARGET"; then
+  for ncn_progname in lipo; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LIPO_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LIPO_FOR_TARGET"; then
+  ac_cv_prog_LIPO_FOR_TARGET="$LIPO_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_LIPO_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+LIPO_FOR_TARGET=$ac_cv_prog_LIPO_FOR_TARGET
+if test -n "$LIPO_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $LIPO_FOR_TARGET" >&5
+echo "${ECHO_T}$LIPO_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_LIPO_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in lipo; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -7725,7 +9626,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_NM_FOR_TARGET=$NM_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_NM_FOR_TARGET" ; then
+if test -z "$ac_cv_path_NM_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7767,7 +9668,55 @@ fi
 
 fi
 if test -z "$ac_cv_path_NM_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+
+if test -n "$NM_FOR_TARGET"; then
+  ac_cv_prog_NM_FOR_TARGET=$NM_FOR_TARGET
+elif test -n "$ac_cv_prog_NM_FOR_TARGET"; then
+  NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_NM_FOR_TARGET"; then
+  for ncn_progname in nm; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NM_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$NM_FOR_TARGET"; then
+  ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NM_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+NM_FOR_TARGET=$ac_cv_prog_NM_FOR_TARGET
+if test -n "$NM_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $NM_FOR_TARGET" >&5
+echo "${ECHO_T}$NM_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_NM_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in nm; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -7898,7 +9847,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
+if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -7918,18 +9867,65 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_OBJDUMP_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_OBJDUMP_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+OBJDUMP_FOR_TARGET=$ac_cv_path_OBJDUMP_FOR_TARGET
+
+if test -n "$OBJDUMP_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5
+echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
+
+
+if test -n "$OBJDUMP_FOR_TARGET"; then
+  ac_cv_prog_OBJDUMP_FOR_TARGET=$OBJDUMP_FOR_TARGET
+elif test -n "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then
+  OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_OBJDUMP_FOR_TARGET"; then
+  for ncn_progname in objdump; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_OBJDUMP_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$OBJDUMP_FOR_TARGET"; then
+  ac_cv_prog_OBJDUMP_FOR_TARGET="$OBJDUMP_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP_FOR_TARGET="${ncn_progname}"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
 
-  ;;
-esac
 fi
-OBJDUMP_FOR_TARGET=$ac_cv_path_OBJDUMP_FOR_TARGET
-
+fi
+OBJDUMP_FOR_TARGET=$ac_cv_prog_OBJDUMP_FOR_TARGET
 if test -n "$OBJDUMP_FOR_TARGET"; then
   echo "$as_me:$LINENO: result: $OBJDUMP_FOR_TARGET" >&5
 echo "${ECHO_T}$OBJDUMP_FOR_TARGET" >&6
@@ -7938,9 +9934,10 @@ else
 echo "${ECHO_T}no" >&6
 fi
 
+  done
 fi
-if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+if test -z "$ac_cv_prog_OBJDUMP_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in objdump; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -8071,7 +10068,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then
+if test -z "$ac_cv_path_RANLIB_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -8113,7 +10110,55 @@ fi
 
 fi
 if test -z "$ac_cv_path_RANLIB_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+
+if test -n "$RANLIB_FOR_TARGET"; then
+  ac_cv_prog_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET
+elif test -n "$ac_cv_prog_RANLIB_FOR_TARGET"; then
+  RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_RANLIB_FOR_TARGET"; then
+  for ncn_progname in ranlib; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB_FOR_TARGET"; then
+  ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB_FOR_TARGET=$ac_cv_prog_RANLIB_FOR_TARGET
+if test -n "$RANLIB_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $RANLIB_FOR_TARGET" >&5
+echo "${ECHO_T}$RANLIB_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in ranlib; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -8244,7 +10289,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_STRIP_FOR_TARGET=$STRIP_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then
+if test -z "$ac_cv_path_STRIP_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -8286,7 +10331,55 @@ fi
 
 fi
 if test -z "$ac_cv_path_STRIP_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+
+if test -n "$STRIP_FOR_TARGET"; then
+  ac_cv_prog_STRIP_FOR_TARGET=$STRIP_FOR_TARGET
+elif test -n "$ac_cv_prog_STRIP_FOR_TARGET"; then
+  STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_STRIP_FOR_TARGET"; then
+  for ncn_progname in strip; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP_FOR_TARGET"; then
+  ac_cv_prog_STRIP_FOR_TARGET="$STRIP_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP_FOR_TARGET=$ac_cv_prog_STRIP_FOR_TARGET
+if test -n "$STRIP_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $STRIP_FOR_TARGET" >&5
+echo "${ECHO_T}$STRIP_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_STRIP_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in strip; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -8417,7 +10510,7 @@ echo "${ECHO_T}no" >&6
     ac_cv_path_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET
   fi
 fi
-if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then
+if test -z "$ac_cv_path_WINDRES_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
   # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -8459,7 +10552,55 @@ fi
 
 fi
 if test -z "$ac_cv_path_WINDRES_FOR_TARGET" ; then
-   if test -n "$with_build_time_tools"; then
+
+
+if test -n "$WINDRES_FOR_TARGET"; then
+  ac_cv_prog_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET
+elif test -n "$ac_cv_prog_WINDRES_FOR_TARGET"; then
+  WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_WINDRES_FOR_TARGET"; then
+  for ncn_progname in windres; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_WINDRES_FOR_TARGET+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$WINDRES_FOR_TARGET"; then
+  ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_WINDRES_FOR_TARGET="${ncn_progname}"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+WINDRES_FOR_TARGET=$ac_cv_prog_WINDRES_FOR_TARGET
+if test -n "$WINDRES_FOR_TARGET"; then
+  echo "$as_me:$LINENO: result: $WINDRES_FOR_TARGET" >&5
+echo "${ECHO_T}$WINDRES_FOR_TARGET" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  done
+fi
+
+if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" && test -n "$with_build_time_tools"; then
   for ncn_progname in windres; do
     echo "$as_me:$LINENO: checking for ${ncn_progname} in $with_build_time_tools" >&5
 echo $ECHO_N "checking for ${ncn_progname} in $with_build_time_tools... $ECHO_C" >&6
@@ -8576,8 +10717,9 @@ echo $ECHO_N "checking where to find the target ar... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $AR_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $AR_FOR_TARGET\`" >&6
+    ac_dir=`dirname $AR_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8597,8 +10739,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$AR_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $AR_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $AR_FOR_TARGET\`" >&6
+    ac_dir=`dirname $AR_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     AR_FOR_TARGET='$(AR)'
@@ -8610,13 +10753,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target as" >&5
 echo $ECHO_N "checking where to find the target as... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $AS_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $AS_FOR_TARGET\`" >&6
+    ac_dir=`dirname $AS_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8636,8 +10781,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$AS_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $AS_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $AS_FOR_TARGET\`" >&6
+    ac_dir=`dirname $AS_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     AS_FOR_TARGET='$(AS)'
@@ -8649,13 +10795,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target cc" >&5
 echo $ECHO_N "checking where to find the target cc... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $CC_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $CC_FOR_TARGET\`" >&6
+    ac_dir=`dirname $CC_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8675,8 +10823,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$CC_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $CC_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $CC_FOR_TARGET\`" >&6
+    ac_dir=`dirname $CC_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     CC_FOR_TARGET='$(CC)'
@@ -8688,13 +10837,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target c++" >&5
 echo $ECHO_N "checking where to find the target c++... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $CXX_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $CXX_FOR_TARGET\`" >&6
+    ac_dir=`dirname $CXX_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8717,8 +10868,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $CXX_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $CXX_FOR_TARGET\`" >&6
+    ac_dir=`dirname $CXX_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     CXX_FOR_TARGET='$(CXX)'
@@ -8730,13 +10882,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target c++ for libstdc++" >&5
 echo $ECHO_N "checking where to find the target c++ for libstdc++... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $RAW_CXX_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $RAW_CXX_FOR_TARGET\`" >&6
+    ac_dir=`dirname $RAW_CXX_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8759,8 +10913,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $RAW_CXX_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $RAW_CXX_FOR_TARGET\`" >&6
+    ac_dir=`dirname $RAW_CXX_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     RAW_CXX_FOR_TARGET='$(CXX)'
@@ -8772,13 +10927,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target dlltool" >&5
 echo $ECHO_N "checking where to find the target dlltool... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $DLLTOOL_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $DLLTOOL_FOR_TARGET\`" >&6
+    ac_dir=`dirname $DLLTOOL_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8798,8 +10955,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$DLLTOOL_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $DLLTOOL_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $DLLTOOL_FOR_TARGET\`" >&6
+    ac_dir=`dirname $DLLTOOL_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     DLLTOOL_FOR_TARGET='$(DLLTOOL)'
@@ -8811,13 +10969,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target gcc" >&5
 echo $ECHO_N "checking where to find the target gcc... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $GCC_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $GCC_FOR_TARGET\`" >&6
+    ac_dir=`dirname $GCC_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8837,8 +10997,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$GCC_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $GCC_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $GCC_FOR_TARGET\`" >&6
+    ac_dir=`dirname $GCC_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     GCC_FOR_TARGET='$()'
@@ -8850,13 +11011,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target gcj" >&5
 echo $ECHO_N "checking where to find the target gcj... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$GCJ_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $GCJ_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $GCJ_FOR_TARGET\`" >&6
+    ac_dir=`dirname $GCJ_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8879,8 +11042,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$GCJ_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $GCJ_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $GCJ_FOR_TARGET\`" >&6
+    ac_dir=`dirname $GCJ_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     GCJ_FOR_TARGET='$(GCJ)'
@@ -8892,13 +11056,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target gfortran" >&5
 echo $ECHO_N "checking where to find the target gfortran... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $GFORTRAN_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $GFORTRAN_FOR_TARGET\`" >&6
+    ac_dir=`dirname $GFORTRAN_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8921,8 +11087,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$GFORTRAN_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $GFORTRAN_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $GFORTRAN_FOR_TARGET\`" >&6
+    ac_dir=`dirname $GFORTRAN_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     GFORTRAN_FOR_TARGET='$(GFORTRAN)'
@@ -8934,13 +11101,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target ld" >&5
 echo $ECHO_N "checking where to find the target ld... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $LD_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $LD_FOR_TARGET\`" >&6
+    ac_dir=`dirname $LD_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8960,8 +11129,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$LD_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $LD_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $LD_FOR_TARGET\`" >&6
+    ac_dir=`dirname $LD_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     LD_FOR_TARGET='$(LD)'
@@ -8973,13 +11143,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target lipo" >&5
 echo $ECHO_N "checking where to find the target lipo... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $LIPO_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $LIPO_FOR_TARGET\`" >&6
+    ac_dir=`dirname $LIPO_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -8988,8 +11160,9 @@ echo "${ECHO_T}pre-installed" >&6
 else
   if expr "x$LIPO_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $LIPO_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $LIPO_FOR_TARGET\`" >&6
+    ac_dir=`dirname $LIPO_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     LIPO_FOR_TARGET='$(LIPO)'
@@ -9001,13 +11174,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target nm" >&5
 echo $ECHO_N "checking where to find the target nm... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $NM_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $NM_FOR_TARGET\`" >&6
+    ac_dir=`dirname $NM_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -9027,8 +11202,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$NM_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $NM_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $NM_FOR_TARGET\`" >&6
+    ac_dir=`dirname $NM_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     NM_FOR_TARGET='$(NM)'
@@ -9040,13 +11216,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target objdump" >&5
 echo $ECHO_N "checking where to find the target objdump... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $OBJDUMP_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $OBJDUMP_FOR_TARGET\`" >&6
+    ac_dir=`dirname $OBJDUMP_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -9066,8 +11244,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$OBJDUMP_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $OBJDUMP_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $OBJDUMP_FOR_TARGET\`" >&6
+    ac_dir=`dirname $OBJDUMP_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     OBJDUMP_FOR_TARGET='$(OBJDUMP)'
@@ -9079,13 +11258,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target ranlib" >&5
 echo $ECHO_N "checking where to find the target ranlib... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $RANLIB_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $RANLIB_FOR_TARGET\`" >&6
+    ac_dir=`dirname $RANLIB_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -9105,8 +11286,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$RANLIB_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $RANLIB_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $RANLIB_FOR_TARGET\`" >&6
+    ac_dir=`dirname $RANLIB_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     RANLIB_FOR_TARGET='$(RANLIB)'
@@ -9118,13 +11300,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target strip" >&5
 echo $ECHO_N "checking where to find the target strip... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $STRIP_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $STRIP_FOR_TARGET\`" >&6
+    ac_dir=`dirname $STRIP_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -9144,8 +11328,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$STRIP_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $STRIP_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $STRIP_FOR_TARGET\`" >&6
+    ac_dir=`dirname $STRIP_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     STRIP_FOR_TARGET='$(STRIP)'
@@ -9157,13 +11342,15 @@ echo "${ECHO_T}host tool" >&6
 echo "${ECHO_T}pre-installed" >&6
   fi
 fi
+
 echo "$as_me:$LINENO: checking where to find the target windres" >&5
 echo $ECHO_N "checking where to find the target windres... $ECHO_C" >&6
 if test "x${build}" != "x${host}" ; then
   if expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $WINDRES_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $WINDRES_FOR_TARGET\`" >&6
+    ac_dir=`dirname $WINDRES_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   else
     # Canadian cross, just use what we found
     echo "$as_me:$LINENO: result: pre-installed" >&5
@@ -9183,8 +11370,9 @@ else
 echo "${ECHO_T}just compiled" >&6
   elif expr "x$WINDRES_FOR_TARGET" : "x/" > /dev/null; then
     # We already found the complete path
-    echo "$as_me:$LINENO: result: pre-installed in \`dirname $WINDRES_FOR_TARGET\`" >&5
-echo "${ECHO_T}pre-installed in \`dirname $WINDRES_FOR_TARGET\`" >&6
+    ac_dir=`dirname $WINDRES_FOR_TARGET`
+    echo "$as_me:$LINENO: result: pre-installed in $ac_dir" >&5
+echo "${ECHO_T}pre-installed in $ac_dir" >&6
   elif test "x$target" = "x$host"; then
     # We can use an host tool
     WINDRES_FOR_TARGET='$(WINDRES)'
@@ -9200,6 +11388,7 @@ fi
 
 
 
+
 # Certain tools may need extra flags.
 AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
@@ -9258,24 +11447,94 @@ case $build in
       yes) stage1_cflags="-g -Wa,-J" ;;
       *) stage1_cflags="-g -J" ;;
     esac ;;
-  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="-g -no-cpp-precomp -DHAVE_DESIGNATED_INITIALIZERS=0"
-    ;;
 esac
 
+# This is aimed to mimic bootstrap with a non-GCC compiler to catch problems.
+if test "$GCC" = yes; then
+  saved_CFLAGS="$CFLAGS"
+
+  # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it.
+  CFLAGS="$CFLAGS -fkeep-inline-functions"
+  echo "$as_me:$LINENO: checking whether -fkeep-inline-functions is supported" >&5
+echo $ECHO_N "checking whether -fkeep-inline-functions is supported... $ECHO_C" >&6
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; stage1_cflags="$stage1_cflags -fkeep-inline-functions"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  CFLAGS="$saved_CFLAGS"
+fi
+
+
+
+# Enable --enable-checking in stage1 of the compiler.
+# Check whether --enable-stage1-checking or --disable-stage1-checking was given.
+if test "${enable_stage1_checking+set}" = set; then
+  enableval="$enable_stage1_checking"
+  stage1_checking=--enable-checking=${enable_stage1_checking}
+else
+  if test "x$enable_checking" = xno; then
+  stage1_checking=--enable-checking
+else
+  stage1_checking=--enable-checking${enable_checking+=}$enable_checking
+fi
+fi;
+
 
 # Enable -Werror in bootstrap stage2 and later.
-# Change the default to "no" on release branches.
 # Check whether --enable-werror or --disable-werror was given.
 if test "${enable_werror+set}" = set; then
   enableval="$enable_werror"
 
 else
+  if test -d ${srcdir}/gcc && test x"`cat $srcdir/gcc/DEV-PHASE`" = xexperimental; then
   enable_werror=yes
+else
+  enable_werror=no
+fi
 fi;
 case ${enable_werror} in
   yes) stage2_werror_flag="--enable-werror-always" ;;
@@ -9283,6 +11542,48 @@ case ${enable_werror} in
 esac
 
 
+# Flags needed to enable html installing and building
+
+# Check whether --with-datarootdir or --without-datarootdir was given.
+if test "${with_datarootdir+set}" = set; then
+  withval="$with_datarootdir"
+  datarootdir="\${prefix}/${withval}"
+else
+  datarootdir="\${prefix}/share"
+fi;
+
+
+# Check whether --with-docdir or --without-docdir was given.
+if test "${with_docdir+set}" = set; then
+  withval="$with_docdir"
+  docdir="\${prefix}/${withval}"
+else
+  docdir="\${datarootdir}/doc"
+fi;
+
+
+# Check whether --with-pdfdir or --without-pdfdir was given.
+if test "${with_pdfdir+set}" = set; then
+  withval="$with_pdfdir"
+  pdfdir="\${prefix}/${withval}"
+else
+  pdfdir="\${docdir}"
+fi;
+
+
+# Check whether --with-htmldir or --without-htmldir was given.
+if test "${with_htmldir+set}" = set; then
+  withval="$with_htmldir"
+  htmldir="\${prefix}/${withval}"
+else
+  htmldir="\${docdir}"
+fi;
+
+
+
+
+
+
           ac_config_files="$ac_config_files Makefile"
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -9923,6 +12224,9 @@ s,@build@,$build,;t t
 s,@build_cpu@,$build_cpu,;t t
 s,@build_vendor@,$build_vendor,;t t
 s,@build_os@,$build_os,;t t
+s,@build_noncanonical@,$build_noncanonical,;t t
+s,@host_noncanonical@,$host_noncanonical,;t t
+s,@target_noncanonical@,$target_noncanonical,;t t
 s,@host@,$host,;t t
 s,@host_cpu@,$host_cpu,;t t
 s,@host_vendor@,$host_vendor,;t t
@@ -9937,6 +12241,7 @@ s,@INSTALL_DATA@,$INSTALL_DATA,;t t
 s,@LN@,$LN,;t t
 s,@LN_S@,$LN_S,;t t
 s,@TOPLEVEL_CONFIGURE_ARGUMENTS@,$TOPLEVEL_CONFIGURE_ARGUMENTS,;t t
+s,@build_libsubdir@,$build_libsubdir,;t t
 s,@build_subdir@,$build_subdir,;t t
 s,@host_subdir@,$host_subdir,;t t
 s,@target_subdir@,$target_subdir,;t t
@@ -9947,8 +12252,13 @@ s,@CPPFLAGS@,$CPPFLAGS,;t t
 s,@ac_ct_CC@,$ac_ct_CC,;t t
 s,@EXEEXT@,$EXEEXT,;t t
 s,@OBJEXT@,$OBJEXT,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
 s,@GNATBIND@,$GNATBIND,;t t
 s,@ac_ct_GNATBIND@,$ac_ct_GNATBIND,;t t
+s,@GNATMAKE@,$GNATMAKE,;t t
+s,@ac_ct_GNATMAKE@,$ac_ct_GNATMAKE,;t t
 s,@do_compare@,$do_compare,;t t
 s,@gmplibs@,$gmplibs,;t t
 s,@gmpinc@,$gmpinc,;t t
@@ -9986,9 +12296,7 @@ s,@STRIP@,$STRIP,;t t
 s,@WINDRES@,$WINDRES,;t t
 s,@OBJCOPY@,$OBJCOPY,;t t
 s,@OBJDUMP@,$OBJDUMP,;t t
-s,@CXX@,$CXX,;t t
 s,@CFLAGS_FOR_BUILD@,$CFLAGS_FOR_BUILD,;t t
-s,@CXXFLAGS@,$CXXFLAGS,;t t
 s,@CC_FOR_TARGET@,$CC_FOR_TARGET,;t t
 s,@CXX_FOR_TARGET@,$CXX_FOR_TARGET,;t t
 s,@GCC_FOR_TARGET@,$GCC_FOR_TARGET,;t t
@@ -10004,8 +12312,8 @@ s,@OBJDUMP_FOR_TARGET@,$OBJDUMP_FOR_TARGET,;t t
 s,@RANLIB_FOR_TARGET@,$RANLIB_FOR_TARGET,;t t
 s,@STRIP_FOR_TARGET@,$STRIP_FOR_TARGET,;t t
 s,@WINDRES_FOR_TARGET@,$WINDRES_FOR_TARGET,;t t
-s,@FLAGS_FOR_TARGET@,$FLAGS_FOR_TARGET,;t t
 s,@RAW_CXX_FOR_TARGET@,$RAW_CXX_FOR_TARGET,;t t
+s,@FLAGS_FOR_TARGET@,$FLAGS_FOR_TARGET,;t t
 s,@COMPILER_AS_FOR_TARGET@,$COMPILER_AS_FOR_TARGET,;t t
 s,@COMPILER_LD_FOR_TARGET@,$COMPILER_LD_FOR_TARGET,;t t
 s,@COMPILER_NM_FOR_TARGET@,$COMPILER_NM_FOR_TARGET,;t t
@@ -10013,7 +12321,12 @@ s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
 s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
 s,@MAINT@,$MAINT,;t t
 s,@stage1_cflags@,$stage1_cflags,;t t
+s,@stage1_checking@,$stage1_checking,;t t
 s,@stage2_werror_flag@,$stage2_werror_flag,;t t
+s,@datarootdir@,$datarootdir,;t t
+s,@docdir@,$docdir,;t t
+s,@pdfdir@,$pdfdir,;t t
+s,@htmldir@,$htmldir,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 /@serialization_dependencies@/r $serialization_dependencies