OSDN Git Service

* Make-lang.in (stmp-f2c.h): Don't configure the runtime
[pf3gnuchains/gcc-fork.git] / gcc / configure.in
index d7a53d5..4cc80d2 100644 (file)
@@ -22,7 +22,8 @@
 
 # Initialization and defaults
 AC_INIT(tree.c)
-native_prefix=/usr
+AC_CONFIG_HEADER(config.h:config.in)
+
 remove=rm
 hard_link=ln
 symbolic_link='ln -s'
@@ -77,6 +78,14 @@ if [[ x$gxx_include_dir = x ]]; then
        gxx_include_dir='${prefix}/include/g++'
 fi
 
+# Enable use of cpplib for C.
+AC_ARG_ENABLE(c-cpplib,
+[  --enable-c-cpplib       Use cpplib for C.],
+if [[[ x$enable_c_cpplib != xno ]]]; then
+  extra_c_objs="${extra_c_objs} cpplib.o cppexp.o cpphash.o cpperror.o"
+  extra_c_flags=-DUSE_CPPLIB=1
+fi)
+
 # Enable threads
 # Pass with no value to take the default
 # Pass with a value to specify a thread package
@@ -114,15 +123,27 @@ AC_CANONICAL_SYSTEM
 # Find some useful tools
 AC_PROG_AWK
 AC_PROG_LEX
-AC_PROG_LN_S
+GCC_PROG_LN
+GCC_PROG_LN_S
 AC_PROG_RANLIB
 AC_PROG_YACC
-AC_PROG_INSTALL
+EGCS_PROG_INSTALL
 
 # Find the native compiler
 AC_PROG_CC
 AC_PROG_MAKE_SET
 
+AC_CHECK_HEADERS(stddef.h string.h strings.h stdlib.h time.h unistd.h varargs.h sys/varargs.h)
+
+GCC_NEED_DECLARATION(malloc)
+GCC_NEED_DECLARATION(realloc)
+GCC_NEED_DECLARATION(calloc)
+GCC_NEED_DECLARATION(free)
+
+AC_DECL_SYS_SIGLIST
+
+AC_CHECK_FUNCS(strerror strtoul bsearch)
+
 # File extensions
 manext='.1'
 objext='.o'
@@ -130,7 +151,6 @@ AC_SUBST(manext)
 AC_SUBST(objext)
 
 build_xm_file=
-build_broken_install=
 build_install_headers_dir=install-headers-tar
 build_exeext=
 host_xm_file=
@@ -158,8 +178,6 @@ for machine in $build $host $target; do
        use_collect2=
        # Set this to override the default target model.
        target_cpu_default=
-       # Set this to force use of install.sh.
-       broken_install=
        # Set this to control which fixincludes program to use.
        fixincludes=fixincludes
        # Set this to control how the header file directory is installed.
@@ -179,6 +197,9 @@ for machine in $build $host $target; do
        # each machine entry.
        cpu_type=`echo $machine | sed 's/-.*$//'`
        case $machine in
+       alpha*-*-*)
+               cpu_type=alpha
+               ;;
        arm*-*-*)
                cpu_type=arm
                ;;
@@ -247,28 +268,40 @@ for machine in $build $host $target; do
        a29k-*-*)                       # Default a29k environment.
                use_collect2=yes
                ;;
-       alpha-*-linux-gnuecoff*)
+       alpha*-*-linux-gnuecoff*)
                tm_file="${tm_file} alpha/linux.h"
                xm_file="${xm_file} alpha/xm-linux.h"
-               target_cpu_default=4
+               target_cpu_default="MASK_GAS"
+               gas=no
                xmake_file=none
                fixincludes=Makefile.in
                gas=yes gnu_ld=yes
                ;;
-       alpha-*-linux-gnu*)
+       alpha*-*-linux-gnulibc1*)
                tm_file="${tm_file} alpha/linux.h alpha/elf.h"
                xm_file="${xm_file} alpha/xm-linux.h"
-               target_cpu_default=4
+               target_cpu_default="MASK_GAS"
+               tmake_file="t-linux t-linux-gnulibc1 alpha/t-linux"
+               xmake_file=none
+               fixincludes=Makefile.in
+               gas=yes gnu_ld=yes
+               if [[ x$enable_threads = xyes ]]; then
+                       thread_file='posix'
+               fi
+               ;;
+       alpha*-*-linux-gnu*)
+               tm_file="${tm_file} alpha/linux.h alpha/elf.h"
+               xm_file="${xm_file} alpha/xm-linux.h"
+               target_cpu_default="MASK_GAS"
                tmake_file="t-linux alpha/t-linux"
                xmake_file=none
                fixincludes=Makefile.in
-               extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
                gas=yes gnu_ld=yes
-               if [[ x$thread_file = x ]]; then
+               if [[ x$enable_threads = xyes ]]; then
                        thread_file='posix'
                fi
                ;;
-       alpha-dec-osf[[456789]]*)
+       alpha*-dec-osf[[456789]]*)
                if [[ x$stabs = xyes ]]
                then
                        tm_file="${tm_file} dbx.h"
@@ -277,17 +310,16 @@ for machine in $build $host $target; do
                then
                        extra_passes="mips-tfile mips-tdump"
                fi
-               broken_install=yes
                use_collect2=yes
                # Some versions of OSF4 (specifically X4.0-9 296.7) have
                # a broken tar, so we use cpio instead.
                case $machine in
-                 alpha-dec-osf4*)
+                 alpha*-dec-osf4*)
                    install_headers_dir=install-headers-cpio
                    ;;
                esac
                ;;
-       alpha-dec-osf[[23]]*)
+       alpha*-dec-osf[[23]]*)
                tm_file="${tm_file} alpha/osf2or3.h"
                if [[ x$stabs = xyes ]]
                then
@@ -297,10 +329,9 @@ for machine in $build $host $target; do
                then
                        extra_passes="mips-tfile mips-tdump"
                fi
-               broken_install=yes
                use_collect2=yes
                ;;
-       alpha-dec-osf1.2)
+       alpha*-dec-osf1.2)
                tm_file="${tm_file} alpha/osf12.h"
                if [[ x$stabs = xyes ]]
                then
@@ -310,10 +341,9 @@ for machine in $build $host $target; do
                then
                        extra_passes="mips-tfile mips-tdump"
                fi
-               broken_install=yes
                use_collect2=yes
                ;;
-       alpha-*-osf*)
+       alpha*-*-osf*)
                if [[ x$stabs = xyes ]]
                then
                        tm_file="${tm_file} dbx.h"
@@ -322,12 +352,11 @@ for machine in $build $host $target; do
                then
                        extra_passes="mips-tfile mips-tdump"
                fi
-               broken_install=yes
                use_collect2=yes
                ;;
-       alpha-*-winnt3*)
+       alpha*-*-winnt3*)
                tm_file="${tm_file} alpha/win-nt.h"
-               target_cpu_default=64
+               target_cpu_default=MASK_WINDOWS_NT
                xm_file="${xm_file} config/winnt/xm-winnt.h alpha/xm-winnt.h"
                tmake_file=t-libc-ok
                xmake_file=winnt/x-winnt
@@ -342,12 +371,15 @@ for machine in $build $host $target; do
                        thread_file='win32'
                fi
                ;;
-       alpha-dec-vms*)
+       alpha*-dec-vms*)
                tm_file=alpha/vms.h
                xm_file="${xm_file} alpha/xm-vms.h"
                tmake_file=alpha/t-vms
                fixincludes=Makefile.in
                ;;
+       arc-*-elf*)
+               extra_parts="crtinit.o crtfini.o"
+               ;;
        arm-*-coff* | armel-*-coff*)
                tm_file=arm/coff.h
                tmake_file=arm/t-bare
@@ -380,9 +412,9 @@ for machine in $build $host $target; do
        arm-*-netbsd*)
                tm_file=arm/netbsd.h
                xm_file=arm/xm-netbsd.h
-               tmake_file=arm-t-netbsd
-               # On NetBSD, the headers are already okay.
-               fixincludes=Makefile.in
+               tmake_file=arm/t-netbsd
+               # On NetBSD, the headers are already okay, except for math.h.
+               fixincludes=fixinc.math
                use_collect2=yes
                ;;
        arm-*-linux-gnuaout*)           # ARM Linux
@@ -392,10 +424,10 @@ for machine in $build $host $target; do
                tm_file=arm/linux-gas.h
                tmake_file=arm/t-linux
                fixincludes=Makefile.in
-               broken_install=yes
                gnu_ld=yes
                ;;
-       arm-*-*)                        # generic version
+       arm-*-aout)
+               tm_file=arm/aout.h
                ;;
        c1-convex-*)                    # Convex C1
                target_cpu_default=1
@@ -429,7 +461,6 @@ for machine in $build $host $target; do
                extra_headers=va-clipper.h
                extra_parts="crtbegin.o crtend.o"
                install_headers_dir=install-headers-cpio
-               broken_install=yes
                ;;
        dsp16xx-*)
                ;;
@@ -443,36 +474,57 @@ for machine in $build $host $target; do
                float_format=i32
                ;;
        hppa1.1-*-pro*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h"
                xm_file=pa/xm-papro.h
                tmake_file=pa/t-pro
                ;;
        hppa1.1-*-osf*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                target_cpu_default=1
                tm_file="${tm_file} pa/pa-osf.h"
                use_collect2=yes
                fixincludes=Makefile.in
                ;;
        hppa1.1-*-rtems*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="pa/pa-pro.h ${tm_file} pa/pa-pro-end.h libgloss.h pa/rtems.h"
                xm_file=pa/xm-papro.h
                tmake_file=pa/t-pro
                ;;
        hppa1.0-*-osf*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="${tm_file} pa/pa-osf.h"
                use_collect2=yes
                fixincludes=Makefile.in
                ;;
        hppa1.1-*-bsd*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                target_cpu_default=1
                use_collect2=yes
                fixincludes=Makefile.in
                ;;
        hppa1.0-*-bsd*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                use_collect2=yes
                fixincludes=Makefile.in
                ;;
        hppa1.0-*-hpux7*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="pa/pa-oldas.h ${tm_file} pa/pa-hpux7.h"
                xm_file=pa/xm-pahpux.h
                xmake_file=pa/x-pa-hpux
@@ -480,11 +532,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.0-*-hpux8.0[[0-2]]*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="${tm_file} pa/pa-hpux.h"
                xm_file=pa/xm-pahpux.h
                xmake_file=pa/x-pa-hpux
@@ -494,11 +548,13 @@ for machine in $build $host $target; do
                else
                        tm_file="pa/pa-oldas.h ${tm_file}"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.1-*-hpux8.0[[0-2]]*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                target_cpu_default=1
                tm_file="${tm_file} pa/pa-hpux.h"
                xm_file=pa/xm-pahpux.h
@@ -509,11 +565,13 @@ for machine in $build $host $target; do
                else
                        tm_file="pa/pa-oldas.h ${tm_file}"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.1-*-hpux8*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                target_cpu_default=1
                tm_file="${tm_file} pa/pa-hpux.h"
                xm_file=pa/xm-pahpux.h
@@ -522,11 +580,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/pa-gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.0-*-hpux8*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="${tm_file} pa/pa-hpux.h"
                xm_file=pa/xm-pahpux.h
                xmake_file=pa/x-pa-hpux
@@ -534,11 +594,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/pa-gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.1-*-hpux10*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                target_cpu_default=1
                tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h"
                xm_file=pa/xm-pahpux.h
@@ -547,11 +609,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/pa-gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.0-*-hpux10*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux10.h"
                xm_file=pa/xm-pahpux.h
                xmake_file=pa/x-pa-hpux
@@ -559,11 +623,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/pa-gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.1-*-hpux*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                target_cpu_default=1
                tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h"
                xm_file=pa/xm-pahpux.h
@@ -572,11 +638,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/pa-gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.0-*-hpux*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="${tm_file} pa/pa-hpux.h pa/pa-hpux9.h"
                xm_file=pa/xm-pahpux.h
                xmake_file=pa/x-pa-hpux
@@ -584,11 +652,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/pa-gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.1-*-hiux*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                target_cpu_default=1
                tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h"
                xm_file=pa/xm-pahpux.h
@@ -597,11 +667,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/pa-gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa1.0-*-hiux*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                tm_file="${tm_file} pa/pa-hpux.h pa/pa-hiux.h"
                xm_file=pa/xm-pahpux.h
                xmake_file=pa/x-pa-hpux
@@ -609,11 +681,13 @@ for machine in $build $host $target; do
                then
                        tm_file="${tm_file} pa/pa-gas.h"
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                ;;
        hppa*-*-lites*)
+               if [[ x$enable_haifa != xno ]]; then
+                       enable_haifa=yes
+               fi
                target_cpu_default=1
                use_collect2=yes
                fixincludes=Makefile.in
@@ -632,7 +706,6 @@ for machine in $build $host $target; do
                fi
                xm_file=i386/xm-aix.h
                xmake_file=i386/x-aix
-               broken_install=yes
                ;;
        i486-ncr-sysv4*)                # NCR 3000 - i486 running system V.4
                xm_file=i386/xm-sysv4.h
@@ -673,7 +746,6 @@ for machine in $build $host $target; do
                fixincludes=fixinc.ptx
                extra_parts="crtbegin.o crtend.o"
                install_headers_dir=install-headers-cpio
-               broken_install=yes
                ;;
        i[[3456]]86-sequent-ptx2* | i[[3456]]86-sequent-sysv3*)
                xm_file=i386/xm-sysv3.h
@@ -683,7 +755,6 @@ for machine in $build $host $target; do
                extra_parts="crtbegin.o crtend.o"
                fixincludes=fixinc.ptx
                install_headers_dir=install-headers-cpio
-               broken_install=yes
                ;;
        i[[3456]]86-sequent-ptx4* | i[[3456]]86-sequent-sysv4*)
                xm_file=i386/xm-sysv4.h
@@ -693,7 +764,6 @@ for machine in $build $host $target; do
                extra_parts="crtbegin.o crtend.o"
                fixincludes=fixinc.ptx
                install_headers_dir=install-headers-cpio
-               broken_install=yes
                ;;
        i386-sun-sunos*)                # Sun i386 roadrunner
                xm_file=i386/xm-sun.h
@@ -719,8 +789,8 @@ for machine in $build $host $target; do
        i[[3456]]86-*-freebsdelf*)
                tm_file="i386/i386.h i386/att.h linux.h i386/freebsd-elf.h i386/perform.h"
                xm_file=i386/xm-freebsd.h
-               # On FreeBSD, the headers are already ok.
-               fixincludes=Makefile.in
+               # On FreeBSD, the headers are already ok, except for math.h.
+               fixincludes=fixinc.math
                tmake_file=i386/t-freebsd
                gas=yes
                gnu_ld=yes
@@ -729,15 +799,15 @@ for machine in $build $host $target; do
        i[[3456]]86-*-freebsd*)
                tm_file=i386/freebsd.h
                xm_file=i386/xm-freebsd.h
-               # On FreeBSD, the headers are already ok.
-               fixincludes=Makefile.in
+               # On FreeBSD, the headers are already ok, except for math.h.
+               fixincludes=fixinc.math
                tmake_file=i386/t-freebsd
                ;;
        i[[3456]]86-*-netbsd*)
                tm_file=i386/netbsd.h
                xm_file=i386/xm-netbsd.h
-               # On NetBSD, the headers are already okay.
-               fixincludes=Makefile.in
+               # On NetBSD, the headers are already okay, except for math.h.
+               fixincludes=fixinc.math
                tmake_file=t-netbsd
                ;;
        i[[3456]]86-*-coff*)
@@ -765,7 +835,6 @@ for machine in $build $host $target; do
                        extra_parts="crtbegin.o crtend.o"
                fi
                install_headers_dir=install-headers-cpio
-               broken_install=yes
                ;;
        i[[3456]]86-*-linux-gnuoldld*)  # Intel 80386's running Linux
                xm_file=i386/xm-linux.h # with a.out format using pre BFD linkers
@@ -773,7 +842,6 @@ for machine in $build $host $target; do
                tmake_file="t-linux-aout i386/t-crtstuff"
                tm_file=i386/linux-oldld.h
                fixincludes=Makefile.in #On Linux, the headers are ok already.
-               broken_install=yes
                gnu_ld=yes
                ;;
        i[[3456]]86-*-linux-gnuaout*)           # Intel 80386's running Linux
@@ -782,7 +850,6 @@ for machine in $build $host $target; do
                tmake_file="t-linux-aout i386/t-crtstuff"
                tm_file=i386/linux-aout.h
                fixincludes=Makefile.in #On Linux, the headers are ok already.
-               broken_install=yes
                gnu_ld=yes
                ;;
        i[[3456]]86-*-linux-gnulibc1)
@@ -792,7 +859,6 @@ for machine in $build $host $target; do
                tmake_file="t-linux t-linux-gnulibc1 i386/t-crtstuff"
                extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
                fixincludes=Makefile.in #On Linux, the headers are ok already.
-               broken_install=yes
                gnu_ld=yes
                if [[ x$enable_threads = xyes ]]; then
                        thread_file='single'
@@ -805,7 +871,6 @@ for machine in $build $host $target; do
                tmake_file="t-linux i386/t-crtstuff"
                extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
                fixincludes=Makefile.in #On Linux, the headers are ok already.
-               broken_install=yes
                gnu_ld=yes
                if [[ x$enable_threads = xyes ]]; then
                        thread_file='posix'
@@ -870,7 +935,6 @@ for machine in $build $host $target; do
                xm_file=i386/xm-sco5.h
                xmake_file=i386/x-sco5
                fixincludes=fixinc.sco
-               broken_install=yes
                tm_file=i386/sco5.h
                tmake_file=i386/t-sco5
                extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
@@ -879,7 +943,6 @@ for machine in $build $host $target; do
                xm_file=i386/xm-sco.h
                xmake_file=i386/x-sco4
                fixincludes=fixinc.sco
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                 if [[ x$stabs = xyes ]]
                then
@@ -896,7 +959,6 @@ for machine in $build $host $target; do
        i[[3456]]86-*-sco*)             # 80386 running SCO system
                xm_file=i386/xm-sco.h
                xmake_file=i386/x-sco
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                 if [[ x$stabs = xyes ]]
                then
@@ -922,7 +984,6 @@ for machine in $build $host $target; do
                extra_parts="crt1.o crti.o crtn.o crtbegin.o crtend.o"
                xmake_file=x-svr4
                fixincludes=fixinc.svr4
-               broken_install=yes
                if [[ x$enable_threads = xyes ]]; then
                        thread_file='solaris'
                fi
@@ -1038,7 +1099,6 @@ for machine in $build $host $target; do
                tm_file="${tm_file} svr3.h i860/paragon.h"
                xm_file="${xm_file} xm-svr3.h"
                tmake_file=t-osf
-               broken_install=yes
                ;;
        i860-*-sysv3*)
                tm_file="${tm_file} svr3.h i860/sysv3.h"
@@ -1106,7 +1166,6 @@ for machine in $build $host $target; do
                        xmake_file=m68k/x-hp320
                        tm_file=m68k/hp310.h
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                extra_headers=math-68881.h
@@ -1135,7 +1194,6 @@ for machine in $build $host $target; do
        m68k-apple-aux*)                # Apple Macintosh running A/UX
                xm_file=m68k/xm-aux.h
                tmake_file=m68k/t-aux
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                extra_headers=math-68881.h
                extra_parts="crt1.o mcrt1.o maccrt1.o crt2.o crtn.o"
@@ -1244,7 +1302,6 @@ for machine in $build $host $target; do
                xm_file=m68k/xm-crds.h
                xmake_file=m68k/x-crds
                tm_file=m68k/crds.h
-               broken_install=yes
                use_collect2=yes
                extra_headers=math-68881.h
                ;;
@@ -1261,7 +1318,6 @@ for machine in $build $host $target; do
                xmake_file=m68k/x-ccur
                extra_headers=math-68881.h
                use_collect2=yes
-               broken_install=yes
                ;;
        m68k-hp-bsd4.4*)                # HP 9000/3xx running 4.4bsd
                tm_file=m68k/hp3bsd44.h
@@ -1294,7 +1350,6 @@ for machine in $build $host $target; do
                        xmake_file=m68k/x-hp320
                        tm_file=m68k/hpux7.h
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                extra_headers=math-68881.h
@@ -1309,7 +1364,6 @@ for machine in $build $host $target; do
                        xmake_file=m68k/x-hp320
                        tm_file=m68k/hp320.h
                fi
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                use_collect2=yes
                extra_headers=math-68881.h
@@ -1410,8 +1464,8 @@ for machine in $build $host $target; do
        m68k-*-netbsd*)
                tm_file=m68k/netbsd.h
                xm_file=m68k/xm-netbsd.h
-               # On NetBSD, the headers are already okay.
-               fixincludes=Makefile.in
+               # On NetBSD, the headers are already okay, except for math.h.
+               fixincludes=fixinc.math
                tmake_file=t-netbsd
                ;;
        m68k-*-sysv3*)                  # Motorola m68k's running system V.3
@@ -1455,7 +1509,7 @@ for machine in $build $host $target; do
                fixincludes=Makefile.in #On Linux, the headers are ok already.
                extra_headers=math-68881.h
                gnu_ld=yes
-               if [[ x$thread_file = x ]]; then
+               if [[ x$enable_threads = xyes ]]; then
                        thread_file='posix'
                fi
                ;;
@@ -1482,7 +1536,6 @@ for machine in $build $host $target; do
                    ;;
                esac
                extra_parts="crtbegin.o bcscrtbegin.o crtend.o m88kdgux.ld"
-               broken_install=yes
                xmake_file=m88k/x-dgux
                if [[ x$gas = xyes ]]
                then
@@ -1546,7 +1599,6 @@ for machine in $build $host $target; do
        mips-sgi-irix6*)                # SGI System V.4., IRIX 6
                tm_file=mips/iris6.h
                xm_file=mips/xm-iris6.h
-               broken_install=yes
                fixincludes=fixinc.irix
                xmake_file=mips/x-iris6
                tmake_file=mips/t-iris6
@@ -1557,7 +1609,6 @@ for machine in $build $host $target; do
        mips-sgi-irix5cross64)          # Irix5 host, Irix 6 target, cross64
                tm_file=mips/cross64.h
                xm_file=mips/xm-iris5.h
-               broken_install=yes
                fixincludes=Makefile.in
                xmake_file=mips/x-iris
                tmake_file=mips/t-cross64
@@ -1586,7 +1637,6 @@ for machine in $build $host $target; do
                 then
                         use_collect2=yes
                 fi
-                broken_install=yes
                 ;;
        mips-sgi-irix5*)                # SGI System V.4., IRIX 5
                if [[ x$gas = xyes ]]
@@ -1600,7 +1650,6 @@ for machine in $build $host $target; do
                        tm_file=mips/iris5.h
                fi
                xm_file=mips/xm-iris5.h
-               broken_install=yes
                fixincludes=fixinc.irix
                xmake_file=mips/x-iris
                # mips-tfile doesn't work yet
@@ -1617,7 +1666,6 @@ for machine in $build $host $target; do
                        tm_file="${tm_file} dbx.h"
                fi
                xm_file=mips/xm-iris4.h
-               broken_install=yes
                xmake_file=mips/x-iris
                if [[ x$gas = xyes ]]
                then
@@ -1639,7 +1687,6 @@ for machine in $build $host $target; do
                        tm_file="${tm_file} dbx.h"
                fi
                xm_file=mips/xm-iris4.h
-               broken_install=yes
                xmake_file=mips/x-iris
                if [[ x$gas = xyes ]]
                then
@@ -1661,7 +1708,6 @@ for machine in $build $host $target; do
                        tm_file="${tm_file} dbx.h"
                fi
                xm_file=mips/xm-iris3.h
-               broken_install=yes
                xmake_file=mips/x-iris3
                if [[ x$gas = xyes ]]
                then
@@ -1717,13 +1763,9 @@ for machine in $build $host $target; do
        mips-dec-netbsd*)                  # Decstation running NetBSD
                tm_file=mips/netbsd.h
                xm_file=mips/xm-netbsd.h
-               # On NetBSD, the headers are already okay.
-               fixincludes=Makefile.in
+               # On NetBSD, the headers are already okay, except for math.h.
+               fixincludes=fixinc.math
                tmake_file=t-netbsd
-               if [[ x$prefix = xNONE ]]; then
-                       prefix=$native_prefix
-               fi
-               prefix=$native_prefix
                ;;
        mips-sony-bsd* | mips-sony-newsos*)     # Sony NEWS 3600 or risc/news.
                tm_file=mips/news4.h
@@ -1780,7 +1822,6 @@ for machine in $build $host $target; do
                then
                        use_collect2=yes
                fi
-               broken_install=yes
                ;;
        mips-*-ultrix* | mips-dec-mach3)        # Decstation.
                tm_file=mips/ultrix.h
@@ -1816,7 +1857,6 @@ for machine in $build $host $target; do
                then
                        use_collect2=yes
                fi
-               broken_install=yes
                ;;
        mips-*-bsd* | mips-*-riscosbsd* | mips-*-riscos[[1234]]bsd*)
                tm_file=mips/bsd-4.h    # MIPS BSD 4.3, RISC-OS 4.0
@@ -1834,7 +1874,6 @@ for machine in $build $host $target; do
                then
                        use_collect2=yes
                fi
-               broken_install=yes
                ;;
        mips-*-riscos[[56789]]sysv4*)
                tm_file=mips/svr4-5.h   # MIPS System V.4., RISC-OS 5.0
@@ -1854,7 +1893,6 @@ for machine in $build $host $target; do
                then
                        use_collect2=yes
                fi
-               broken_install=yes
                ;;
        mips-*-sysv4* | mips-*-riscos[[1234]]sysv4* | mips-*-riscossysv4*)
                tm_file=mips/svr4-4.h   # MIPS System V.4. RISC-OS 4.0
@@ -1874,7 +1912,6 @@ for machine in $build $host $target; do
                then
                        use_collect2=yes
                fi
-               broken_install=yes
                ;;
        mips-*-riscos[[56789]]sysv*)
                tm_file=mips/svr3-5.h   # MIPS System V.3, RISC-OS 5.0
@@ -1894,7 +1931,6 @@ for machine in $build $host $target; do
                then
                        use_collect2=yes
                fi
-               broken_install=yes
                ;;
        mips-*-sysv* | mips-*-riscos*sysv*)
                tm_file=mips/svr3-4.h   # MIPS System V.3, RISC-OS 4.0
@@ -1914,7 +1950,6 @@ for machine in $build $host $target; do
                then
                        use_collect2=yes
                fi
-               broken_install=yes
                ;;
        mips-*-riscos[[56789]]*)                # Default MIPS RISC-OS 5.0.
                tm_file=mips/mips-5.h
@@ -1931,7 +1966,6 @@ for machine in $build $host $target; do
                then
                        use_collect2=yes
                fi
-               broken_install=yes
                ;;
        mips-*-gnu*)
                ;;
@@ -1948,7 +1982,6 @@ for machine in $build $host $target; do
                        tm_file="${tm_file} dbx.h"
                fi
                tmake_file=mips/t-ecoff
-               broken_install=yes
                ;;
        mipsel-*-elf*)
                tm_file="mips/elfl.h libgloss.h"
@@ -2021,12 +2054,10 @@ for machine in $build $host $target; do
                ;;
        ns32k-tek6100-bsd*)
                tm_file=ns32k/tek6100.h
-               broken_install=yes
                use_collect2=yes
                ;;
        ns32k-tek6200-bsd*)
                tm_file=ns32k/tek6200.h
-               broken_install=yes
                use_collect2=yes
                ;;
 # This has not been updated to GCC 2.
@@ -2034,7 +2065,6 @@ for machine in $build $host $target; do
 #              xm_file=ns32k/xm-genix.h
 #              xmake_file=ns32k/x-genix
 #              tm_file=ns32k/genix.h
-#              broken_install=yes
 #              use_collect2=yes
 #              ;;
        ns32k-merlin-*)
@@ -2053,8 +2083,8 @@ for machine in $build $host $target; do
        ns32k-pc532-netbsd*)
                tm_file=ns32k/netbsd.h
                xm_file=ns32k/xm-netbsd.h
-               # On NetBSD, the headers are already okay.
-               fixincludes=Makefile.in
+               # On NetBSD, the headers are already okay, except for math.h.
+               fixincludes=fixinc.math
                tmake_file=t-netbsd
                ;;
         pdp11-*-bsd)
@@ -2134,7 +2164,7 @@ for machine in $build $host $target; do
                fixincludes=Makefile.in
                extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
                extra_headers=ppc-asm.h
-               if [[ x$thread_file = x ]]; then
+               if [[ x$enable_threads = xyes ]]; then
                        thread_file='posix'
                fi
                ;;
@@ -2259,6 +2289,11 @@ for machine in $build $host $target; do
                tm_file=sh/elf.h
                float_format=sh
                ;;
+       sh-*-rtems*)
+               tmake_file="sh/t-sh t-rtems"
+               tm_file=sh/rtems.h
+               float_format=sh
+               ;;
        sh-*-*)
                float_format=sh
                ;;
@@ -2278,41 +2313,38 @@ for machine in $build $host $target; do
        sparc-*-netbsd*)
                tm_file=sparc/netbsd.h
                xm_file=sparc/xm-netbsd.h
-               # On NetBSD, the headers are already okay.
-               fixincludes=Makefile.in
+               # On NetBSD, the headers are already okay, except for math.h.
+               fixincludes=fixinc.math
                tmake_file=t-netbsd
                ;;
        sparc-*-bsd*)
                tm_file=sparc/bsd.h
                ;;
        sparc-*-linux-gnuaout*)         # Sparc's running Linux, a.out
-               xm_file=sparc/xm-linux.h
+               xm_file="sparc/xm-sparc.h sparc/xm-linux.h"
                tm_file=sparc/linux-aout.h
                xmake_file=x-linux
                fixincludes=Makefile.in #On Linux, the headers are ok already.
-               broken_install=yes
                gnu_ld=yes
                ;;
-       sparc-*-linux-gnulibc1*)                 # Sparc's running Linux
-               xm_file=sparc/xm-linux.h # with ELF format using the
-               xmake_file=x-linux       # Linux C library 5.
+       sparc-*-linux-gnulibc1*)        # Sparc's running Linux, libc5
+               xm_file="sparc/xm-sparc.h sparc/xm-linux.h"
+               xmake_file=x-linux
                tm_file=sparc/linux.h
                tmake_file="t-linux t-linux-gnulibc1 sparc/t-linux"
                extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
                fixincludes=Makefile.in #On Linux, the headers are ok already.
-               broken_install=yes
                gnu_ld=yes
                ;;
-       sparc-*-linux-gnu*)                      # Sparc's running Linux
-               xm_file=sparc/xm-linux.h # with ELF format using glibc 2
-               xmake_file=x-linux       # aka the Linux C library 6.
+       sparc-*-linux-gnu*)             # Sparc's running Linux, libc6
+               xm_file="sparc/xm-sparc.h sparc/xm-linux.h"
+               xmake_file=x-linux
                tm_file=sparc/linux.h
                tmake_file="t-linux sparc/t-linux"
                extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
                fixincludes=Makefile.in #On Linux, the headers are ok already.
-               broken_install=yes
                gnu_ld=yes
-               if [[ x$thread_file = x ]]; then
+               if [[ x$enable_threads = xyes ]]; then
                        thread_file='posix'
                fi
                ;;
@@ -2338,7 +2370,6 @@ for machine in $build $host $target; do
                xmake_file=sparc/x-sysv4
                extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
                fixincludes=fixinc.svr4
-               broken_install=yes
                if [[ x$enable_threads = xyes ]]; then
                        thread_file='solaris'
                fi
@@ -2352,6 +2383,9 @@ for machine in $build $host $target; do
                tm_file=sparc/sunos4.h
                tmake_file=sparc/t-sunos41
                use_collect2=yes
+               if [[ x$gas = xyes ]]; then
+                       tm_file="${tm_file} sparc/sun4gas.h"
+               fi
                ;;
        sparc-*-sunos3*)
                tm_file=sparc/sun4o3.h
@@ -2391,6 +2425,14 @@ for machine in $build $host $target; do
                tm_file=sparc/sp64-elf.h
                extra_parts="crtbegin.o crtend.o"
                ;;
+       sparc64-*-linux*)               # 64-bit Sparc's running Linux
+               tmake_file=sparc/t-sp64
+               xm_file="sparc/xm-sp64.h sparc/xm-linux.h"
+               tm_file=sparc/linux64.h
+               xmake_file=x-linux
+               fixincludes=Makefile.in # On Linux, the headers are ok already.
+               gnu_ld=yes
+               ;;
 # This hasn't been upgraded to GCC 2.
 #      tahoe-harris-*)                 # Harris tahoe, using COFF.
 #              tm_file=tahoe/harris.h
@@ -2402,6 +2444,16 @@ for machine in $build $host $target; do
 #              cpu_type=gmicro
 #              use_collect2=yes
 #              ;;
+       v850-*-*)
+               cpu_type=v850
+               tm_file="v850/v850.h"
+               xm_file="v850/xm-v850.h"
+               if [[ x$stabs = xyes ]]
+               then
+                       tm_file="${tm_file} dbx.h"
+               fi
+               use_collect2=no
+               ;;
        vax-*-bsd*)                     # vaxen running BSD
                use_collect2=yes
                float_format=vax
@@ -2414,8 +2466,8 @@ for machine in $build $host $target; do
        vax-*-netbsd*)
                tm_file="${tm_file} netbsd.h vax/netbsd.h"
                xm_file="${xm_file} xm-netbsd.h"
-               # On NetBSD, the headers are already okay.
-               fixincludes=Makefile.in
+               # On NetBSD, the headers are already okay, except for math.h.
+               fixincludes=fixinc.math
                tmake_file=t-netbsd
                float_format=vax
                ;;
@@ -2465,11 +2517,9 @@ for machine in $build $host $target; do
        *-*-sysv4*)
                fixincludes=fixinc.svr4
                xmake_try_sysv=x-sysv
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                ;;
        *-*-sysv*)
-               broken_install=yes
                install_headers_dir=install-headers-cpio
                ;;
        esac
@@ -2488,10 +2538,24 @@ for machine in $build $host $target; do
        i686-*-*)
                target_cpu_default2=3
                ;;
-       alpha-*-*)
+       alpha*-*-*)
+               case $machine in
+                       alphaev56*)
+                               target_cpu_default2="MASK_CPU_EV5|MASK_BYTE_OPS"
+                               ;;
+                       alphaev5*)
+                               target_cpu_default2="MASK_CPU_EV5"
+                               ;;
+               esac
+                               
                if [[ x$gas = xyes ]]
                then
-                       target_cpu_default2=4
+                       if [[ x$target_cpu_default2 = x ]]
+                       then
+                               target_cpu_default2="MASK_GAS"
+                       else
+                               target_cpu_default2="${target_cpu_default2}|MASK_GAS"
+                       fi
                fi
                ;;
        mips*-*-ecoff* | mips*-*-elf*)
@@ -2520,7 +2584,7 @@ for machine in $build $host $target; do
                          | xrios1 | xrios2 | xrsc | xrsc1 \
                          | x601 | x602 | x603 | x603e | x604 | x604e | x620 \
                          | x403 | x505 | x801 | x821 | x823 | x860)
-                               target_cpu_default2="'\"$with_cpu\"'"
+                               target_cpu_default2="\"$with_cpu\""
                                ;;
 
                        xyes | xno)
@@ -2575,7 +2639,6 @@ for machine in $build $host $target; do
                then build_xm_file=$cpu_type/xm-$cpu_type.h
                else build_xm_file=$xm_file
                fi
-               build_broken_install=$broken_install
                build_install_headers_dir=$install_headers_dir
                build_exeext=$exeext
                pass1done=yes
@@ -2675,8 +2738,10 @@ fi
 # Set up the header files.
 # $links is the list of header files to create.
 # $vars is the list of shell variables with file names to include.
+# config2.h is the old config.h.  It is included by the new config.h which
+# created from config.in.  The goal is to simplify the transition to autoconf.
 vars="host_xm_file tm_file xm_file build_xm_file"
-links="config.h tm.h tconfig.h hconfig.h"
+links="config2.h tm.h tconfig.h hconfig.h"
 
 rm -f config.bak
 if [[ -f config.status ]]; then mv -f config.status config.bak; fi
 # Get the version number from the toplevel
 version=`sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/' < ${srcdir}/version.c`
 
-# For the current directory and all of the language subdirectories,
-# do the rest of the script ...
-
-subdirs=
-for lang in ${srcdir}/*/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}/[[*]]/config-lang.in) ;;
-       *) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([[^/]]*\)/config-lang.in$,\1,'`" ;;
-       esac
-done
-
-# Are we using gcc as the native compiler?
-case $host in
-*linux*)       # All Linux's use gcc as the native compiler.
-       if [[ x$prefix = xNONE ]]; then
-               prefix=$native_prefix
-       fi
-       ;;
-esac
-
-# Make empty files to contain the specs and options for each language.
-# Then add #include lines to for a compiler that has specs and/or options.
-
-lang_specs_files=
-lang_options_files=
-rm -f specs.h options.h
-touch specs.h options.h
-for subdir in . $subdirs
-do
-       if [[ -f $srcdir/$subdir/lang-specs.h ]]; then
-               echo "#include \"$subdir/lang-specs.h\"" >>specs.h
-               lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
-       fi
-       if [[ -f $srcdir/$subdir/lang-options.h ]]; then
-               echo "#include \"$subdir/lang-options.h\"" >>options.h
-               lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
-       fi
-done
-
 # Get an absolute path to the GCC top-level source directory
 holddir=`pwd`
 cd $srcdir
 topdir=`pwd`
 cd $holddir
 
-# These (without "all_") are set in each config-lang.in.
-# `language' must be a single word so is spelled singularly.
-all_languages=
-all_boot_languages=
-all_compilers=
-all_stagestuff=
-all_diff_excludes=
-# List of language makefile fragments.
-all_lang_makefiles=
-all_headers=
-all_lib2funcs=
-
-host_overrides="Make-host"
-target_overrides="Make-target"
-cross_overrides="/dev/null"
-build_overrides="/dev/null"
-language_fragments="Make-lang"
-language_hooks="Make-hooks"
-
-rm -f Make-host Make-target Make-hooks
-touch Make-host
-touch Make-target
-touch Make-hooks
-
 # Conditionalize the makefile for this host machine.
+# Make-host contains the concatenation of all host makefile fragments
+# [there can be more than one].  This file is built by configure.frag.
+host_overrides=Make-host
 dep_host_xmake_file=
 for f in .. ${host_xmake_file}
 do
        if [[ -f ${srcdir}/config/$f ]]
        then
-               cat ${srcdir}/config/$f >> Make-host
-               dep_host_xmake_file="${dep_host_xmake_file} \$(srcdir)/config/$f"
+               dep_host_xmake_file="${dep_host_xmake_file} ${srcdir}/config/$f"
        fi
 done
 
 # Conditionalize the makefile for this target machine.
+# Make-target contains the concatenation of all host makefile fragments
+# [there can be more than one].  This file is built by configure.frag.
+target_overrides=Make-target
 dep_tmake_file=
 for f in .. ${tmake_file}
 do
        if [[ -f ${srcdir}/config/$f ]]
        then
-               cat ${srcdir}/config/$f >> Make-target
-               dep_tmake_file="${dep_tmake_file} \$(srcdir)/config/$f"
+               dep_tmake_file="${dep_tmake_file} ${srcdir}/config/$f"
        fi
 done
 
-# Add the language fragments.
-# Languages are added via two mechanisms.  Some information must be
-# recorded in makefile variables, these are defined in config-lang.in.
-# We accumulate them and plug them into the main Makefile.
-# The other mechanism is a set of hooks for each of the main targets
-# like `clean', `install', etc.
-
-for s in .. $subdirs
-do
-       if [[ $s != ".." ]]
-       then
-               language=
-               boot_language=
-               compilers=
-               stagestuff=
-               diff_excludes=
-               headers=
-               lib2funcs=
-               . ${srcdir}/$s/config-lang.in
-               if [[ "x$language" = x ]]
-               then
-                       echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
-                       exit 1
-               fi
-               all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in ${srcdir}/$s/Makefile.in"
-               all_languages="$all_languages $language"
-               if [[ "x$boot_language" = xyes ]]
-               then
-                       all_boot_languages="$all_boot_languages $language"
-               fi
-               all_compilers="$all_compilers $compilers"
-               all_stagestuff="$all_stagestuff $stagestuff"
-               all_diff_excludes="$all_diff_excludes $diff_excludes"
-               all_headers="$all_headers $headers"
-               all_lib2funcs="$all_lib2funcs $lib2funcs"
-       fi
-done
-
-# Since we can't use `::' targets, we link each language in
-# with a set of hooks, reached indirectly via lang.${target}.
-
-target_list="all.build all.cross start.encap rest.encap \
-       info dvi \
-       install-normal install-common install-info install-man \
-       uninstall distdir \
-       mostlyclean clean distclean extraclean maintainer-clean \
-       stage1 stage2 stage3 stage4"
-for t in $target_list
-do
-       x=
-       for l in .. $all_languages
-       do
-               if [[ $l != ".." ]]; then
-                       x="$x $l.$t"
-               fi
-       done
-       echo "lang.$t: $x" >> Make-hooks
-done
-
 # If the host doesn't support symlinks, modify CC in
 # FLAGS_TO_PASS so CC="stage1/xgcc -Bstage1/" works.
 # Otherwise, we can use "CC=$(CC)".
@@ -2899,6 +2842,7 @@ done
 # if this is a cross-compiler.
 # Also use all.cross instead of all.internal
 # and add cross-make to Makefile.
+cross_overrides="/dev/null"
 if [[ x$host != x$target ]]
 then
        cross_defines="CROSS=-DCROSS_COMPILE"
@@ -2908,6 +2852,7 @@ fi
 # When building gcc with a cross-compiler, we need to fix a few things.
 # This must come after cross-make as we want all.build to override
 # all.cross.
+build_overrides="/dev/null"
 if [[ x$build != x$host ]]
 then
        build_overrides="${topdir}/build-make"
 
 # If we have gas in the build tree, make a link to it.
 if [[ -f ../gas/Makefile ]]; then
-       rm -f as; $symbolic_link ../gas/as.new as 2>/dev/null
+       rm -f as; $symbolic_link ../gas/as-new as 2>/dev/null
 fi
 
 # If we have ld in the build tree, make a link to it.
 if [[ -f ../ld/Makefile ]]; then
-       if [[ x$use_collect2 = x ]]; then
-               rm -f ld; $symbolic_link ../ld/ld.new ld 2>/dev/null
-       else
-               rm -f collect-ld; $symbolic_link ../ld/ld.new collect-ld 2>/dev/null
+#      if [[ x$use_collect2 = x ]]; then
+#              rm -f ld; $symbolic_link ../ld/ld-new ld 2>/dev/null
+#      else
+               rm -f collect-ld; $symbolic_link ../ld/ld-new collect-ld 2>/dev/null
+#      fi
+fi
+
+# Figure out what language subdirectories are present.
+subdirs=
+for lang in ${srcdir}/*/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}/[[*]]/config-lang.in) ;;
+       *) subdirs="$subdirs `echo $lang | sed -e 's,^.*/\([[^/]]*\)/config-lang.in$,\1,'`" ;;
+       esac
+done
+
+# Make empty files to contain the specs and options for each language.
+# Then add #include lines to for a compiler that has specs and/or options.
+
+lang_specs_files=
+lang_options_files=
+rm -f specs.h options.h
+touch specs.h options.h
+for subdir in . $subdirs
+do
+       if [[ -f $srcdir/$subdir/lang-specs.h ]]; then
+               echo "#include \"$subdir/lang-specs.h\"" >>specs.h
+               lang_specs_files="$lang_specs_files $srcdir/$subdir/lang-specs.h"
        fi
+       if [[ -f $srcdir/$subdir/lang-options.h ]]; then
+               echo "#include \"$subdir/lang-options.h\"" >>options.h
+               lang_options_files="$lang_options_files $srcdir/$subdir/lang-options.h"
+       fi
+done
+
+# These (without "all_") are set in each config-lang.in.
+# `language' must be a single word so is spelled singularly.
+all_languages=
+all_boot_languages=
+all_compilers=
+all_stagestuff=
+all_diff_excludes=
+all_outputs=Makefile
+# List of language makefile fragments.
+all_lang_makefiles=
+all_headers=
+all_lib2funcs=
+
+# Add the language fragments.
+# Languages are added via two mechanisms.  Some information must be
+# recorded in makefile variables, these are defined in config-lang.in.
+# We accumulate them and plug them into the main Makefile.
+# The other mechanism is a set of hooks for each of the main targets
+# like `clean', `install', etc.
+
+language_fragments="Make-lang"
+language_hooks="Make-hooks"
+oldstyle_subdirs=
+
+for s in .. $subdirs
+do
+       if [[ $s != ".." ]]
+       then
+               language=
+               boot_language=
+               compilers=
+               stagestuff=
+               diff_excludes=
+               headers=
+               outputs=
+               lib2funcs=
+               . ${srcdir}/$s/config-lang.in
+               if [[ "x$language" = x ]]
+               then
+                       echo "${srcdir}/$s/config-lang.in doesn't set \$language." 1>&2
+                       exit 1
+               fi
+               all_lang_makefiles="$all_lang_makefiles ${srcdir}/$s/Make-lang.in ${srcdir}/$s/Makefile.in"
+               all_languages="$all_languages $language"
+               if [[ "x$boot_language" = xyes ]]
+               then
+                       all_boot_languages="$all_boot_languages $language"
+               fi
+               all_compilers="$all_compilers $compilers"
+               all_stagestuff="$all_stagestuff $stagestuff"
+               all_diff_excludes="$all_diff_excludes $diff_excludes"
+               all_headers="$all_headers $headers"
+               all_outputs="$all_outputs $outputs"
+               if [[ x$outputs = x ]]
+               then
+                       oldstyle_subdirs="$oldstyle_subdirs $s"
+               fi
+               all_lib2funcs="$all_lib2funcs $lib2funcs"
+       fi
+done
+
+# Since we can't use `::' targets, we link each language in
+# with a set of hooks, reached indirectly via lang.${target}.
+
+rm -f Make-hooks
+touch Make-hooks
+target_list="all.build all.cross start.encap rest.encap \
+       info dvi \
+       install-normal install-common install-info install-man \
+       uninstall distdir \
+       mostlyclean clean distclean extraclean maintainer-clean \
+       stage1 stage2 stage3 stage4"
+for t in $target_list
+do
+       x=
+       for l in .. $all_languages
+       do
+               if [[ $l != ".." ]]; then
+                       x="$x $l.$t"
+               fi
+       done
+       echo "lang.$t: $x" >> Make-hooks
+done
+
+# If we're not building in srcdir, create .gdbinit.
+
+if [[ ! -f Makefile.in ]]; then
+       echo "dir ." > .gdbinit
+       echo "dir ${srcdir}" >> .gdbinit
+       if [[ x$gdb_needs_out_file_path = xyes ]]
+       then
+               echo "dir ${srcdir}/config/"`dirname ${out_file}` >> .gdbinit
+       fi
+       if [[ "x$subdirs" != x ]]; then
+               for s in $subdirs
+               do
+                       echo "dir ${srcdir}/$s" >> .gdbinit
+               done
+       fi
+       echo "source ${srcdir}/.gdbinit" >> .gdbinit
 fi
 
-# Process the language fragments
-${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs"
+# If this is using newlib, then define inhibit_libc in
+# LIBGCC2_CFLAGS.  This will cause __eprintf to be left out of
+# libgcc.a, but that's OK because newib should have its own version of
+# assert.h.
+inhibit_libc=
+if [[ x$with_newlib = xyes ]]; then
+       inhibit_libc=-Dinhibit_libc
+fi
+AC_SUBST(inhibit_libc)
+
+# Override SCHED_OBJ and SCHED_CFLAGS to enable the Haifa scheduler.
+sched_prefix=
+sched_cflags=
+if [[ x$enable_haifa = xyes ]]; then
+    echo "Using the Haifa scheduler."
+    sched_prefix=haifa-
+    sched_cflags=-DHAIFA
+fi
+AC_SUBST(sched_prefix)
+AC_SUBST(sched_cflags)
+if [[ x$enable_haifa != x ]]; then
+    # Explicitly remove files that need to be recompiled for the Haifa scheduler.
+    for x in genattrtab.o toplev.o loop.o unroll.o *sched.o; do
+       if [[ -f $x ]]; then
+           echo "Removing $x"
+           rm -f $x
+       fi
+    done
+fi
+
+# Process the language and host/target makefile fragments.
+${CONFIG_SHELL-/bin/sh} $srcdir/configure.frag $srcdir "$subdirs" "$dep_host_xmake_file" "$dep_tmake_file"
 
 # Substitute configuration variables
 AC_SUBST(subdirs)
@@ -2982,6 +3091,8 @@ AC_SUBST(all_headers)
 AC_SUBST(extra_passes)
 AC_SUBST(extra_programs)
 AC_SUBST(extra_parts)
+AC_SUBST(extra_c_objs)
+AC_SUBST(extra_c_flags)
 AC_SUBST(extra_objs)
 AC_SUBST(host_extra_gcc_objs)
 AC_SUBST(extra_headers_list)
@@ -3007,6 +3118,7 @@ AC_SUBST(will_use_collect2)
 AC_SUBST(maybe_use_collect2)
 AC_SUBST(cc_set_by_configure)
 AC_SUBST(stage_prefix_set_by_configure)
+AC_SUBST(install)
 
 AC_SUBST_FILE(target_overrides)
 AC_SUBST_FILE(host_overrides)
@@ -3047,14 +3159,42 @@ fi
 
 # Create the Makefile
 # and configure language subdirectories
-AC_OUTPUT(Makefile,
-. $srcdir/configure.lang,
+AC_OUTPUT($all_outputs,
+[
+. $srcdir/configure.lang
+case x$CONFIG_HEADERS in
+xconfig.h:config.in)
+echo > cstamp-h ;;
+esac
+# If the host supports symlinks, point stage[1234] at ../stage[1234] so
+# bootstrapping and the installation procedure can still use
+# CC="stage1/xgcc -Bstage1/".  If the host doesn't support symlinks,
+# FLAGS_TO_PASS has been modified to solve the problem there.
+# This is virtually a duplicate of what happens in configure.lang; we do
+# an extra check to make sure this only happens if ln -s can be used.
+if [[ "$symbolic_link" = "ln -s" ]]; then
+ for d in .. ${subdirs} ; do
+   if [[ $d != .. ]]; then
+       STARTDIR=`pwd`
+       cd $d
+       for t in stage1 stage2 stage3 stage4 include
+       do
+               rm -f $t
+               $symbolic_link ../$t $t 2>/dev/null
+       done
+       cd $STARTDIR
+   fi
+ done
+else true ; fi
+],
+[
 host='${host}'
 build='${build}'
 target='${target}'
 target_alias='${target_alias}'
 srcdir='${srcdir}'
 subdirs='${subdirs}'
+oldstyle_subdirs='${oldstyle_subdirs}'
 symbolic_link='${symbolic_link}'
 program_transform_set='${program_transform_set}'
 program_transform_name='${program_transform_name}'
@@ -3067,13 +3207,13 @@ version='${version}'
 local_prefix='${local_prefix}'
 build_install_headers_dir='${build_install_headers_dir}'
 build_exeext='${build_exeext}'
+out_file='${out_file}'
 gdb_needs_out_file_path='${gdb_needs_out_file_path}'
 SET_MAKE='${SET_MAKE}'
-build_broken_install='${build_broken_install}'
 target_list='${target_list}'
 target_overrides='${target_overrides}'
 host_overrides='${host_overrides}'
 cross_defines='${cross_defines}'
 cross_overrides='${cross_overrides}'
 build_overrides='${build_overrides}'
-)
+])