OSDN Git Service

PR c/10175
[pf3gnuchains/gcc-fork.git] / configure.in
index f5a650a..45239e2 100644 (file)
@@ -1,5 +1,5 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+#   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
 ### WARNING: this file contains embedded tabs.  Do not run untabify on this file.
 
 AC_INIT(move-if-change)
+AC_PREREQ(2.13)
 AC_CANONICAL_SYSTEM
 AC_ARG_PROGRAM
 
 sinclude(config/acx.m4)
 
-# clear some things potentially inherited from environment.
-
-enable_threads=no
-enable_shared=no
-enable_libstdcxx_v3=yes
-floating_point=default
-gas=default
-x11=default
-
 ### we might need to use some other shell than /bin/sh for running subshells
 ### If we are on Windows, search for the shell.  This will permit people
 ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure
@@ -67,22 +59,13 @@ esac
 
 config_shell=${CONFIG_SHELL-/bin/sh}
 
-## this is a little touchy and won't always work, but...
-##
-## if the argv[[0]] starts with a slash then it is an absolute name that can (and
-## must) be used as is.
-##
-## otherwise, if argv[[0]] has no slash in it, we can assume that it is on the
-## path.  Since PATH might include "." we also add `pwd` to the end of PATH.
-##
-
 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.
 TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@"
-export TOPLEVEL_CONFIGURE_ARGUMENTS
+AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS)
 
 moveifchange=${srcdir}/move-if-change
 
@@ -134,16 +117,14 @@ fi
 
 # these libraries are used by various programs built for the host environment
 #
-host_libs="intl mmalloc libiberty opcodes bfd readline db tcl tk itcl tix libgui zlib"
-
-libstdcxx_version="target-libstdc++-v3"
+host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib"
 
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
 # know that we are building the simulator.
 # binutils, gas and ld appear in that order because it makes sense to run
 # "make check" in that particular order.
-host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator gettext zip fastjar"
+host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
 
 # libgcj represents the runtime libraries only used by gcj.
 libgcj="target-libffi \
@@ -158,9 +139,9 @@ libgcj="target-libffi \
 target_libs="target-libiberty \
                target-libgloss \
                target-newlib \
-               ${libstdcxx_version} \
+               target-libstdc++-v3 \
                target-libf2c \
-               ${libgcj}
+               ${libgcj} \
                target-libobjc"
 
 # these tools are built using the target libs, and are intended to run only
@@ -257,7 +238,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 grep gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms snavigator gnuserv target-gperf"
+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"
 
 # Similarly, some are only suitable for cross toolchains.
 # Remove these if host=target.
@@ -298,26 +279,26 @@ case "${host}" in
     noconfigdirs="$noconfigdirs byacc"
     ;;
   i[[3456]]86-*-vsta)
-    noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix db snavigator gnuserv gettext"
+    noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix gnuserv gettext"
     ;;
   i[[3456]]86-*-go32* | i[[3456]]86-*-msdosdjgpp*)
-    noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix db snavigator gnuserv libffi"
-       ;;
+    noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi"
+    ;;
   i[[3456]]86-*-mingw32*)
-    # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix db snavigator gnuserv"
-     noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
-       ;;
+    # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv"
+    noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool"
+    ;;
   i[[3456]]86-*-beos*)
-     noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
-     ;;
+    noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
+    ;;
   *-*-cygwin*)
-     noconfigdirs="autoconf automake send-pr rcs guile perl"
+    noconfigdirs="autoconf automake send-pr rcs guile perl"
     ;;
   *-*-netbsd*)
     noconfigdirs="rcs"
     ;;
   ppc*-*-pe)
-     noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix db snavigator gnuserv"
+    noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv"
     ;;
   powerpc-*-beos*)
     noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline"
@@ -347,9 +328,20 @@ case "${target}" in
   *-*-chorusos)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
+  *-*-darwin*)
+    noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+    noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
+    ;;
   *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
+  *-*-kaos*)
+    # Remove unsupported stuff on all kaOS configurations.
+    skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx"
+    skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf"
+    skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib"
+    noconfigdirs="$noconfigdirs target-libgloss"
+    ;;
   *-*-netbsd*)
     # Skip some stuff on all NetBSD configurations.
     noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss"
@@ -363,7 +355,7 @@ case "${target}" in
     esac
     ;;
   *-*-netware)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}"
     ;;
   *-*-rtems*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -407,11 +399,11 @@ case "${target}" in
     noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim"
     noconfigdirs="$noconfigdirs expect dejagnu"
     # the C++ libraries don't build on top of CE's C libraries
-    noconfigdirs="$noconfigdirs ${libstdcxx_version}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3"
     noconfigdirs="$noconfigdirs target-newlib"
     case "${host}" in
       *-*-cygwin*) ;; # keep gdb and readline
-      *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}"
+      *) noconfigdirs="$noconfigdirs gdb readline"
         ;;
     esac
     ;;
@@ -446,19 +438,19 @@ case "${target}" in
     noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}"
     ;;
   avr-*-*)
-    noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
     ;;
   c4x-*-* | tic4x-*-*)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
     ;;
   c54x*-*-* | tic54x-*-*)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib"
     ;;
   cris-*-*)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
   d10v-*-*)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
     ;;
   d30v-*-*)
     noconfigdirs="$noconfigdirs ${libgcj}"
@@ -473,7 +465,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs target-libgloss"
     ;;
   h8500-*-*)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c"
     ;;
   hppa*64*-*-linux* | parisc*64*-*-linux*)
     # In this case, it's because the hppa64-linux target is for
@@ -519,7 +511,7 @@ case "${target}" in
     # This section makes it possible to build newlib natively on linux.
     # If we are using a cross compiler then don't configure newlib.
     if test x${is_cross_compiler} != xno ; then
-         noconfigdirs="$noconfigdirs target-newlib"
+      noconfigdirs="$noconfigdirs target-newlib"
     fi
     noconfigdirs="$noconfigdirs target-libgloss"
     # If we are not using a cross compiler, do configure newlib.
@@ -534,7 +526,7 @@ case "${target}" in
     # Can't build gdb for mingw32 if not native.
     case "${host}" in
       i[[3456]]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
-      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
+      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix gnuserv"
          ;;
     esac
     ;;    
@@ -547,12 +539,12 @@ case "${target}" in
     # 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 tix libgui db snavigator gnuserv"
+      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui gnuserv"
          ;;
     esac
     ;;    
   i[[3456]]86-*-pe)
-    noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
     ;;
   i[[3456]]86-*-sco3.2v5*)
     # The linker does not yet know about weak symbols in COFF,
@@ -569,10 +561,10 @@ case "${target}" in
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
   i[[3456]]86-*-beos*)
-     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
-     ;;
+    noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
+    ;;
   m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)
-    noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
     ;;
   m68k-*-elf*)
     noconfigdirs="$noconfigdirs ${libgcj}"
@@ -600,20 +592,17 @@ case "${target}" in
     ;;
   powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
     target_configdirs="$target_configdirs target-winsup"
-    noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv ${libgcj}"
+    noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix gnuserv ${libgcj}"
     # always build newlib.
     skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
     ;;
     # This is temporary until we can link against shared libraries
   powerpcle-*-solaris*)
-    noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv ${libgcj}"
+    noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix gnuserv ${libgcj}"
     ;;
   powerpc-*-beos*)
     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
     ;;
-  powerpc-*-darwin*)
-    noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof ${libgcj}"
-    ;;
   powerpc-*-eabi)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
@@ -639,12 +628,11 @@ case "${target}" in
     noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}"
     ;;
   mips*-*-irix6*)
-    # The GNU assembler does not support IRIX 6.
     # Linking libjava exceeds command-line length limits on at least
     # IRIX 6.2, but not on IRIX 6.5.
     # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham
     # <oldham@codesourcery.com>
-    noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
     ;;
   mips*-dec-bsd*)
     noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}"
@@ -654,7 +642,7 @@ case "${target}" in
     ;;
   mipstx39-*-*)
     noconfigdirs="$noconfigdirs gprof ${libgcj}"   # same as generic mips
-   ;;
+    ;;
   mips*-*-linux*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
@@ -696,7 +684,7 @@ case "${target}" in
   sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
     ;;
   v810-*-*)
-    noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
     ;;
   v850-*-*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
@@ -714,7 +702,7 @@ case "${target}" in
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
   ip2k-*-*)
-    noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
     ;;
   *-*-linux*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
@@ -740,19 +728,19 @@ esac
 # go away some day.
 # NB:  embedded tabs in this IF block -- do not untabify
 if test x"${enable_languages+set}" != xset; then
-       if test x"${LANGUAGES+set}" = xset; then
-               enable_languages="${LANGUAGES}"
-               echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
-       else
-               enable_languages=all
-       fi
+  if test x"${LANGUAGES+set}" = xset; then
+    enable_languages="${LANGUAGES}"
+      echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2
+  else
+    enable_languages=all
+  fi
 else
-       if test x"${enable_languages}" = x ||
-          test x"${enable_languages}" = xyes;
-       then
-               echo configure.in: --enable-languages needs at least one language argument 1>&2
-               exit 1
-       fi
+  if test x"${enable_languages}" = x ||
+     test x"${enable_languages}" = xyes;
+     then
+    echo configure.in: --enable-languages needs at least one language argument 1>&2
+    exit 1
+  fi
 fi
 enable_languages=`echo "${enable_languages}" | sed -e 's/[[    ,]][[   ,]]*/,/g' -e 's/,$//'`
 
@@ -761,64 +749,60 @@ enable_languages=`echo "${enable_languages}" | sed -e 's/[[       ,]][[   ,]]*/,/g' -e
 # front ends it requires, even if some are required indirectly.
 for lang in ${srcdir}/gcc/*/config-lang.in ..
 do
-   case $lang in
-    ..)
-       ;;
+  case $lang in
+    ..) ;;
     # The odd quoting in the next line works around
     # an apparent bug in bash 1.12 on linux.
-    ${srcdir}/gcc/[[*]]/config-lang.in)
-       ;;
+    ${srcdir}/gcc/[[*]]/config-lang.in) ;;
     *)
-       lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^        ]]*\).*$,\1,p' $lang`
-       this_lang_requires=`sed -n -e 's,^lang_requires=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_requires=\([[^      ]]*\).*$,\1,p' $lang`
-       for other in $this_lang_requires
-       do
-         case ,${enable_languages}, in
-          *,$other,*)
-             ;;
-          *,all,*)
-             ;;
-          *,$lang_alias,*)
-             echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
-             enable_languages="$enable_languages,$other"
-             ;;
-         esac
-       done
-       ;;
-   esac
+      lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^         ]]*\).*$,\1,p' $lang`
+      this_lang_requires=`sed -n -e 's,^lang_requires=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_requires=\([[^       ]]*\).*$,\1,p' $lang`
+      for other in $this_lang_requires
+      do
+        case ,${enable_languages}, in
+         *,$other,*) ;;
+         *,all,*) ;;
+         *,$lang_alias,*)
+           echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2
+           enable_languages="$enable_languages,$other"
+           ;;
+       esac
+      done
+      ;;
+  esac
 done
 
 subdirs=
 for lang in ${srcdir}/gcc/*/config-lang.in ..
 do
-       case $lang in
-       ..) ;;
-       # The odd quoting in the next line works around
-       # an apparent bug in bash 1.12 on linux.
-       ${srcdir}/gcc/[[*]]/config-lang.in) ;;
-       *)
-         lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^      ]]*\).*$,\1,p' $lang`
-         this_lang_libs=`sed -n -e 's,^target_libs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^target_libs=\([[^    ]]*\).*$,\1,p' $lang`
-         this_lang_dirs=`sed -n -e 's,^lang_dirs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_dirs=\([[^        ]]*\).*$,\1,p' $lang`
-         build_by_default=`sed -n -e 's,^build_by_default=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^build_by_default=\([[^        ]]*\).*$,\1,p' $lang`
-         if test "x$lang_alias" = x
-         then
-               echo "$lang doesn't set \$language." 1>&2
-               exit 1
-         fi
-         case ${build_by_default},${enable_languages}, in
-         *,$lang_alias,*) add_this_lang=yes ;;
-         no,*) add_this_lang=no ;;
-         *,all,*) add_this_lang=yes ;;
-         *) add_this_lang=no ;;
-         esac
-         if test x"${add_this_lang}" = xyes; then
-             eval target_libs='"$target_libs "'\"$this_lang_libs\"
-         else
-             eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
-         fi
-         ;;
-       esac
+  case $lang in
+    ..) ;;
+    # The odd quoting in the next line works around
+    # an apparent bug in bash 1.12 on linux.
+    ${srcdir}/gcc/[[*]]/config-lang.in) ;;
+    *)
+      lang_alias=`sed -n -e 's,^language=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^language=\([[^         ]]*\).*$,\1,p' $lang`
+      this_lang_libs=`sed -n -e 's,^target_libs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^target_libs=\([[^       ]]*\).*$,\1,p' $lang`
+      this_lang_dirs=`sed -n -e 's,^lang_dirs=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^lang_dirs=\([[^   ]]*\).*$,\1,p' $lang`
+      build_by_default=`sed -n -e 's,^build_by_default=[['"'"'"'"]]\(.*\)[["'"'"'"']].*$,\1,p' -e 's,^build_by_default=\([[^   ]]*\).*$,\1,p' $lang`
+      if test "x$lang_alias" = x
+         then
+        echo "$lang doesn't set \$language." 1>&2
+        exit 1
+      fi
+      case ${build_by_default},${enable_languages}, in
+        *,$lang_alias,*) add_this_lang=yes ;;
+        no,*) add_this_lang=no ;;
+        *,all,*) add_this_lang=yes ;;
+        *) add_this_lang=no ;;
+      esac
+      if test x"${add_this_lang}" = xyes; then
+        eval target_libs='"$target_libs "'\"$this_lang_libs\"
+      else
+        eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\"
+      fi
+      ;;
+  esac
 done
 
 # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
@@ -867,20 +851,6 @@ if test -n "${target_configdirs}" ; then
   fi
 fi
 
-# Deconfigure all subdirectories, in case we are changing the
-# configuration from one where a subdirectory is supported to one where it
-# is not.
-if test -z "${norecursion}" && test -n "${configdirs}" ; then
-  for i in `echo ${configdirs} | sed -e s/target-//g` ; do
-    rm -f $i/Makefile
-  done
-fi
-if test -z "${norecursion}" && test -n "${target_configdirs}" ; then
-  for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
-    rm -f ${target_subdir}/$i/Makefile
-  done
-fi
-
 # Quietly strip out all directories which aren't configurable in this tree.
 # This relies on all configurable subdirectories being autoconfiscated, which
 # is now the case.
@@ -1037,7 +1007,6 @@ case "${host}" in
     ;;
   m88k-dg-dgux*)
     tentative_cc="gcc -Wall -ansi -D__using_DGUX"
-    host_makefile_frag="config/mh-dgux"
     ;;
   m88k-harris-cxux*)
     # Under CX/UX, we want to tell the compiler to use ANSI mode.
@@ -1255,24 +1224,6 @@ if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-
   extra_host_args="$extra_host_args --with-newlib"
 fi
 
-# We default to --with-shared on platforms where -fpic is meaningless.
-# Well, we don't yet, but we will.
-if false && test "${host}" = "${target}" && test x${enable_shared} = x ; then
-  case "${target}" in
-    alpha*-dec-osf*)   enable_shared=yes ;;
-    alpha*-*-linux*)   enable_shared=yes ;;
-    mips-sgi-irix5*)   enable_shared=yes ;;
-    *)                 enable_shared=no ;;
-  esac
-fi
-
-case "${enable_shared}" in
-  yes) shared=yes ;;
-  no) shared=no ;;
-  "") shared=no ;;
-  *) shared=yes ;;
-esac
-
 
 # Default to using --with-stabs for certain targets.
 if test x${with_stabs} = x ; then
@@ -1456,12 +1407,14 @@ else
   YACC="\$(USUAL_YACC)"
 
   # If CC is still not set, try to get gcc.
+  cc_prog_is_gcc=
   if test -z "${CC}" ; then
     IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}:"
     for dir in $PATH; do
       test -z "$dir" && dir=.
       if test -f $dir/gcc; then
        CC="gcc"
+       cc_prog_is_gcc=yes
        echo 'void f(){}' > conftest.c
        if test -z "`${CC} -g -c conftest.c 2>&1`"; then
          CFLAGS=${CFLAGS-"-g -O2"}
@@ -1477,11 +1430,20 @@ else
     IFS="$save_ifs"
     CC=${CC-cc}
   else
+    # Determine if we are using gcc.
+    cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+    if ${CC} -E conftest.c | grep yes >/dev/null 2>&1; then
+      cc_prog_is_gcc=yes
+    fi
+    rm -f conftest.c
     if test -z "${CFLAGS}"; then
       # Here CC is set but CFLAGS is not.  Use a quick hack to use -O2 if CC
       # is set to a version of gcc.
-      case "${CC}" in
-      *gcc)
+      if test "$cc_prog_is_gcc" = yes; then
        echo 'void f(){}' > conftest.c
        if test -z "`${CC} -g -c conftest.c 2>&1`"; then
          CFLAGS=${CFLAGS-"-g -O2"}
@@ -1491,7 +1453,25 @@ else
          CXXFLAGS=${CXXFLAGS-"-O2"}
        fi
        rm -f conftest*
-       ;;
+      fi
+    fi
+  fi
+
+  # 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 "$cc_prog_is_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
@@ -1561,12 +1541,6 @@ EOF
   esac
 fi
 
-# record if we want runtime library stuff installed in libsubdir.
-# Blank means no.
-if test -z "${enable_version_specific_runtime_libs}"; then
-  enable_version_specific_runtime_libs=no
-fi
-
 # Make sure that the compiler is able to generate an executable.  If it
 # can't, we are probably in trouble.  We don't care whether we can run the
 # executable--we might be using a cross compiler--we only care whether it
@@ -1619,12 +1593,10 @@ esac
 
 # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
 # binutils tools will find libbfd.so.
-if test "${shared}" = "yes" ; then
-  SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
-else
-  SET_LIB_PATH=
-fi
-
+case "${enable_shared}" in
+  no | "") SET_LIB_PATH= ;;
+  *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;;
+esac
 
 case "${host}" in
   *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
@@ -1638,13 +1610,24 @@ target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
 # This is the final value for target_configdirs.  configdirs already
 # has its final value.  It's time to create some lists of valid targets.
 
+# While at that, we remove Makefiles if we were started for recursive
+# configuration, such that the top-level Makefile reconfigures them,
+# like we used to do when configure itself was recursive.
+
 all_build_modules=
 configure_build_modules=
 # Only make build modules if build != host.
 # This should be done more generally, but at the moment it doesn't matter.
 if test ${host_alias} != ${build_alias} ; then
-  all_build_modules=all-build-libiberty
-  configure_build_modules=configure-build-libiberty
+  for module in libiberty ; do
+    all_build_modules=all-build-${module}
+    configure_build_modules=configure-build-${module}
+    if test -z "${no_recursion}" \
+       && test -f ${build_subdir}/${module}/Makefile; then
+      echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
+      rm -f ${build_subdir}/${module}/Makefile
+    fi
+  done
 fi
 
 all_host_modules=
@@ -1656,6 +1639,11 @@ for module in ${configdirs} ; do
   check_host_modules="${check_host_modules} check-${module}"
   install_host_modules="${install_host_modules} install-${module}"
   configure_host_modules="${configure_host_modules} configure-${module}"
+  if test -z "${no_recursion}" \
+     && test -f ${module}/Makefile; then
+    echo 1>&2 "*** removing ${module}/Makefile to force reconfigure"
+    rm -f ${module}/Makefile
+  fi
 done
 install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'`
 
@@ -1668,6 +1656,11 @@ for module in ${target_configdirs} ; do
   check_target_modules="${check_target_modules} check-target-${module}"
   install_target_modules="${install_target_modules} install-target-${module}"
   configure_target_modules="${configure_target_modules} configure-target-${module}"
+  if test -z "${no_recursion}" \
+     && test -f ${target_subdir}/${module}/Makefile; then
+    echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
+    rm -f ${target_subdir}/${module}/Makefile
+  fi
 done
 
 # Determine whether gdb needs tk/tcl or not.
@@ -1677,11 +1670,23 @@ done
 # so we should be able to put the 'maybe's in unconditionally and
 # leave out the maybe dependencies when enable_gdbtk is false.  I'm not
 # 100% sure that that's safe though.
+
+gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui"
 case "$enable_gdbtk" in
   no)
     GDB_TK="" ;;
+  yes)
+    GDB_TK="${gdb_tk}" ;;
   *)
-    GDB_TK="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui" ;;
+    # Only add the dependency on gdbtk when GDBtk is part of the gdb
+    # distro.  Eventually someone will fix this and move Insight, nee
+    # gdbtk to a separate directory.
+    if test -d ${srcdir}/gdb/gdbtk ; then
+      GDB_TK="${gdb_tk}"
+    else
+      GDB_TK=""
+    fi
+    ;;
 esac
 
 # Create the 'maybe dependencies'.  This uses a temporary file.
@@ -1746,12 +1751,17 @@ AC_SUBST_FILE(serialization_dependencies)
 # down to subconfigures.
 baseargs=`echo " ${ac_configure_args} " | \
        sed -e 's/ --no[[^ ]]* / /' \
-           -e 's/ --cache[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ --sr[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ --ho[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ --bu[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ --ta[[a-z-]]*=[[^ ]]* / /' \
-           -e 's/ [[^-][^ ]*] / /' \
+           -e 's/ --c[[a-z-]]*[[= ]][[^ ]]* / /' \
+           -e 's/ --sr[[a-z-]]*[[= ]][[^ ]]* / /' \
+           -e 's/ --ho[[a-z-]]*[[= ]][[^ ]]* / /' \
+           -e 's/ --bu[[a-z-]]*[[= ]][[^ ]]* / /' \
+           -e 's/ --t[[a-z-]]*[[= ]][[^ ]]* / /' \
+           -e 's/ -cache-file[[= ]][[^ ]]* / /' \
+           -e 's/ -srcdir[[= ]][[^ ]]* / /' \
+           -e 's/ -host[[= ]][[^ ]]* / /' \
+           -e 's/ -build[[= ]][[^ ]]* / /' \
+           -e 's/ -target[[= ]][[^ ]]* / /' \
+           -e 's/ [[^ -][^ ]*] / /' \
            -e 's/^ *//;s/ *$//'`
 
 # For the build-side libraries, we just need to pretend we're native,
@@ -1800,30 +1810,19 @@ target_configargs="--cache-file=../config.cache --host=${target_alias} --build=$
 # Note, if you change the default, make sure to fix both here and in
 # the gcc and libstdc++-v3 subdirectories.
 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
-gxx_include_dir=
-if test -n "${with_gxx_include_dir}"; then
-  case "${with_gxx_include_dir}" in
-    yes )
-      echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
-      exit 1
-      ;;
-    no )
-      ;;
-    * )
-      gxx_include_dir=${with_gxx_include_dir}
-      ;;
-  esac
-fi
-if test x${gxx_include_dir} = x; then
-  if test x${enable_version_specific_runtime_libs} = xyes; then
-    gxx_include_dir='${libsubdir}/include/c++'
-  else
-    . ${srcdir}/config.if
-    gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
-  fi
-else
-  gxx_include_dir=${gxx_include_dir}
-fi
+case "${with_gxx_include_dir}" in
+  yes)
+    AC_MSG_ERROR([--with-gxx-include-dir=[[dir]] requires a directory])
+    ;;
+  no | "")
+    case "${enable_version_specific_runtime_libs}" in
+      yes) gxx_include_dir='${libsubdir}/include/c++' ;;
+      *)
+        . ${srcdir}/config.if
+        gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;;
+    esac ;;
+  *) gxx_include_dir=${with_gxx_include_dir} ;;
+esac
 
 FLAGS_FOR_TARGET=
 case " $target_configdirs " in
@@ -1882,7 +1881,7 @@ esac
 # being built; programs in there won't even run.
 if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
   # Search for pre-installed headers if nothing else fits.
-  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include'
+  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
 fi
 
 if test "x${use_gnu_ld}" = x &&
@@ -1898,7 +1897,7 @@ elif test -d ${srcdir}/gcc; then
 elif test "$host" = "$target"; then
   CC_FOR_TARGET='$(CC)'
 else
-  CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}`
+  CC_FOR_TARGET=`echo gcc | sed "${program_transform_name}"`
 fi
 CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)'
 
@@ -1909,7 +1908,7 @@ elif test -d ${srcdir}/gcc; then
 elif test "$host" = "$target"; then
   GCJ_FOR_TARGET='gcj'
 else
-  GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}`
+  GCJ_FOR_TARGET=`echo gcj | sed "${program_transform_name}"`
 fi
 GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
 
@@ -1931,7 +1930,7 @@ elif test "$host" = "$target"; then
   CXX_FOR_TARGET='$(CXX)'
   RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
 else
-  CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}`
+  CXX_FOR_TARGET=`echo c++ | sed "${program_transform_name}"`
   RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET}
 fi
 CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)'
@@ -1973,9 +1972,6 @@ AC_SUBST(RPATH_ENVVAR)
 AC_SUBST(BUILD_PREFIX)
 AC_SUBST(BUILD_PREFIX_1)
 AC_SUBST(configlinks)
-AC_SUBST(enable_shared)
-AC_SUBST(enable_threads)
-AC_SUBST(enable_version_specific_runtime_libs)
 AC_SUBST(gcc_version_trigger)
 AC_SUBST(gcc_version)
 AC_SUBST(tooldir)
@@ -2073,4 +2069,23 @@ AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target}
 RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
 
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+AC_ARG_ENABLE(maintainer-mode,
+[  --enable-maintainer-mode enable make rules and dependencies not useful
+                          (and sometimes confusing) to the casual installer],
+      USE_MAINTAINER_MODE=$enableval,
+      USE_MAINTAINER_MODE=no)
+AC_MSG_RESULT($USE_MAINTAINER_MODE)
+AC_SUBST(MAINTAINER_MODE_TRUE)
+AC_SUBST(MAINTAINER_MODE_FALSE)
+if test "$USE_MAINTAINER_MODE" = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi     
+MAINT=$MAINTAINER_MODE_TRUE
+AC_SUBST(MAINT)dnl
+
 AC_OUTPUT(Makefile)