OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / gcc / config.gcc
index 508aaf9..3a834d4 100644 (file)
 #  build_install_headers_dir
 #                      Target to use when installing header files.
 #
-#  host_truncate_target
-#                      Non-empty if the target name should be truncated
-#                      on this host, due to filename length issues.
-#
 #  gdb_needs_out_file_path
 #                      Set to yes if gdb needs a dir command with
 #                      `dirname $out_file`.
 #                      determines the underlying integral type for
 #                      HOST_WIDE_INT cannot see the definition of
 #                      MAX_LONG_TYPE_SIZE.)
+#
+#  configure_default_options
+#                      Set to an initializer for configure_default_options
+#                      in configargs.h, based on --with-cpu et cetera.
 
 # The following variables are used in each case-construct to build up the
 # outgoing variables:
 #                      is installed, when this system is a build system,
 #                      for build_install_headers_dir.
 #
-#  truncate_target     Non-empty if the target name should be truncated
-#                      when this system is a host, due to filename length
-#                      issues.  For host_truncate_target.
-#
 #  exeext              The suffix for executables on this system.
 #
 #  gnu_ld              Set to yes or no depending on whether the target
@@ -212,8 +208,6 @@ use_collect2=
 target_cpu_default=
 # Set this to control how the header file directory is installed.
 install_headers_dir=install-headers-tar
-# Set this if directory names should be truncated to 14 characters.
-truncate_target=
 # Set this if gdb needs a dir command with `dirname $out_file`
 gdb_needs_out_file_path=
 # Set this if the build machine requires executables to have a
@@ -287,20 +281,22 @@ strongarm*-*-*)
        ;;
 arm*-*-*)
        cpu_type=arm
+       extra_headers="mmintrin.h"
        ;;
 ep9312*-*-*)
        cpu_type=arm
        ;;
 xscale-*-*)
        cpu_type=arm
+       extra_headers="mmintrin.h"
        ;;
 i[34567]86-*-*)
        cpu_type=i386
-       extra_headers="mmintrin.h xmmintrin.h"
+       extra_headers="mmintrin.h xmmintrin.h emmintrin.h pmmintrin.h"
        ;;
 x86_64-*-*)
        cpu_type=i386
-       extra_headers="mmintrin.h xmmintrin.h"
+       extra_headers="mmintrin.h xmmintrin.h emmintrin.h"
        need_64bit_hwint=yes
        ;;
 ia64-*-*)
@@ -421,7 +417,7 @@ case $machine in
        fi
        ;;
 *-*-netbsd*)
-       tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd"
+       tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd t-libgcc-pic"
        gas=yes
        gnu_ld=yes
 
@@ -701,11 +697,20 @@ arm*-*-elf | ep9312-*-elf)
        tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h"
        tmake_file=arm/t-arm-elf
        ;;
+arm*-wince-pe*)
+       tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h arm/pe.h arm/wince-pe.h"
+       tmake_file=arm/t-wince-pe
+       extra_objs="pe.o"
+       ;;
 arm-*-pe*)
        tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h arm/pe.h"
        tmake_file=arm/t-pe
        extra_objs="pe.o"
        ;;
+arm*-*-kaos*)
+       tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h kaos.h arm/kaos-arm.h"
+       tmake_file=arm/t-arm-elf
+       ;;
 avr-*-*)
        ;;
 c4x-*-rtems* | tic4x-*-rtems*)
@@ -1019,7 +1024,7 @@ i[34567]86-*-gnu*)
        ;;
 i[34567]86-pc-msdosdjgpp*)
        xm_file=i386/xm-djgpp.h
-       tm_file="dbxcoff.h ${tm_file} i386/djgpp.h"
+       tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h"
        tmake_file=i386/t-djgpp
        gnu_ld=yes
        gas=yes
@@ -1204,6 +1209,10 @@ i[34567]86-*-interix*)
                tm_file="${tm_file} dbxcoff.h"
        fi
        ;;
+i[34567]86-*-kaos*)
+       tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h kaos.h i386/kaos-i386.h"
+       tmake_file="i386/t-i386elf t-svr4"
+       ;;
 i960-*-coff*)
        tm_file="${tm_file} dbxcoff.h i960/i960-coff.h libgloss.h"
        tmake_file=i960/t-960bare
@@ -1266,10 +1275,11 @@ ia64*-*-hpux*)
        cxx_target_objs="ia64-c.o"
        ;;
 ip2k-*-elf)
+       tm_file="elfos.h ${tm_file}"
        ;;
 m32r-*-elf*)
        tm_file="dbxelf.h elfos.h svr4.h ${tm_file}"
-       extra_parts="crtinit.o crtfini.o m32rx/crtinit.o m32rx/crtfini.o"
+       extra_parts="crtinit.o crtfini.o"
        ;;
 # m68hc11 and m68hc12 share the same machine description.
 m68hc11-*-*|m6811-*-*)
@@ -1381,21 +1391,23 @@ mcore-*-pe*)
        tmake_file=mcore/t-mcore-pe
        ;;
 mips-sgi-irix6*o32)            # SGI System V.4., IRIX 6, O32 ABI
+       tm_file="${tm_file} mips/iris5.h"
        if test x$gas = xyes
        then
-               tm_file="mips/iris5.h mips/iris5gas.h mips/iris6-o32-gas.h"
+               tm_file="${tm_file} mips/iris5gas.h mips/iris6-o32-gas.h"
                if test x$stabs = xyes
                then
-                       tm_file="${tm_file} dbx.h"
+                       tm_file="${tm_file} dbx.h mips/dbxmdebug.h"
                fi
                tmake_file=mips/t-iris5-gas
        else
-               tm_file="mips/iris5.h mips/iris6-o32-as.h"
+               tm_file="${tm_file} mips/iris6-o32-as.h"
                tmake_file=mips/t-iris5-as
        fi
        tm_file="${tm_file} mips/iris6-o32.h"
        tmake_file="${tmake_file} mips/t-iris mips/t-iris5-6"
        xm_file=mips/xm-iris5.h
+       target_cpu_default="MASK_ABICALLS"
        # mips-tfile doesn't work yet
        # See comment in mips/iris5.h file.
        use_collect2=yes
@@ -1404,21 +1416,24 @@ mips-sgi-irix6*o32)             # SGI System V.4., IRIX 6, O32 ABI
 #      fi
        ;;
 mips-sgi-irix6*)               # SGI System V.4., IRIX 6
+       tm_file="${tm_file} mips/iris5.h mips/iris6.h"
        if test "x$gnu_ld" = xyes
        then
-               tm_file="mips/iris6.h mips/iris6gld.h"
-       else
-               tm_file=mips/iris6.h
+               tm_file="${tm_file} mips/iris6gld.h"
        fi
        tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6"
+       target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT"
+       tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
 #      if test x$enable_threads = xyes; then
 #              thread_file='irix'
 #      fi
        ;;
 mips-sgi-irix5cross64)         # Irix5 host, Irix 6 target, cross64
-       tm_file="mips/iris6.h mips/cross64.h"
+       tm_file="${tm_file} mips/iris5.h mips/iris6.h mips/cross64.h"
        xm_file=mips/xm-iris5.h
        tmake_file="mips/t-iris mips/t-cross64"
+       target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT"
+       tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
        # See comment in mips/iris[56].h files.
        use_collect2=yes
 #      if test x$enable_threads = xyes; then
@@ -1426,20 +1441,21 @@ mips-sgi-irix5cross64)          # Irix5 host, Irix 6 target, cross64
 #      fi
        ;;
 mips-sgi-irix5*)               # SGI System V.4., IRIX 5
+       tm_file="${tm_file} mips/iris5.h"
        if test x$gas = xyes
        then
-               tm_file="mips/iris5.h mips/iris5gas.h"
+               tm_file="${tm_file} mips/iris5gas.h"
                if test x$stabs = xyes
                then
-                       tm_file="${tm_file} dbx.h"
+                       tm_file="${tm_file} dbx.h mips/dbxmdebug.h"
                fi
                tmake_file=mips/t-iris5-gas
        else
-               tm_file=mips/iris5.h
                tmake_file=mips/t-iris5-as
        fi
        tmake_file="${tmake_file} mips/t-iris mips/t-iris5-6"
        xm_file=mips/xm-iris5.h
+       target_cpu_default="MASK_ABICALLS"
        # mips-tfile doesn't work yet
        # See comment in mips/iris5.h file.
        use_collect2=yes
@@ -1710,6 +1726,14 @@ powerpcle-*-eabi*)
        tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
        tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
        ;;
+powerpc-*-kaos*)
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h kaos.h rs6000/kaos-ppc.h"
+       tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
+       ;;
+powerpcle-*-kaos*)
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h kaos.h rs6000/kaos-ppc.h"
+       tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
+       ;;
 rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*)
        tm_file="${tm_file} rs6000/aix.h rs6000/aix41.h rs6000/xcoff.h"
        tmake_file="rs6000/t-fprules rs6000/t-newas"
@@ -1754,7 +1778,7 @@ s390x-*-linux*)
        out_file=s390/s390.c
        tmake_file="t-slibgcc-elf-ver t-linux s390/t-crtstuff s390/t-linux64"
        ;;
-sh-*-elf* | sh[2346l]*-*-elf*)
+sh-*-elf* | sh[2346l]*-*-elf* | sh*-*-kaos*)
        tmake_file="sh/t-sh sh/t-elf"
        case $machine in
        shl* | sh64l*)
@@ -1779,6 +1803,9 @@ sh-*-elf* | sh[2346l]*-*-elf*)
        case $machine in
        sh[234]*) tmake_file="${tmake_file} sh/t-monolib" ;;
        esac
+       case $machine in
+       sh*-*-kaos*) tm_file="${tm_file} kaos.h sh/kaos-sh.h" ;;
+       esac
        ;;
 sh-*-rtemself*)
        tmake_file="sh/t-sh sh/t-elf t-rtems"
@@ -1789,7 +1816,7 @@ sh-*-rtemself*)
        ;;
 sh-*-rtems*)
        tmake_file="sh/t-sh t-rtems"
-       tm_file="${tm_file} sh/coff.h sh/rtems.h rtems.h"
+       tm_file="${tm_file} dbxcoff.h sh/coff.h sh/rtems.h rtems.h"
        if test x$enable_threads = xyes; then
          thread_file='rtems'
        fi
@@ -1857,7 +1884,7 @@ sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
        esac
        ;;
 sh-*-*)
-       tm_file="${tm_file} sh/coff.h"
+       tm_file="${tm_file} dbxcoff.h sh/coff.h"
        ;;
 sparc-tti-*)
        tm_file="${tm_file} sparc/pbd.h"
@@ -1988,7 +2015,7 @@ sparc86x-*-elf*)
         extra_parts="crtbegin.o crtend.o"
        ;;
 sparc64-*-aout*)
-       tm_file="sparc/sparc.h aoutos.h sparc/aout.h sparc/sp64-aout.h"
+       tm_file="sparc/sparc.h sparc/aout.h sparc/sp64-aout.h"
        ;;
 sparc64-*-elf*)
        tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sp64-elf.h"
@@ -2030,6 +2057,13 @@ strongarm-*-pe)
        extra_modes=arm/arm-modes.def
        extra_objs=pe.o
        ;;
+strongarm-*-kaos*)
+       tm_file="arm/strongarm-elf.h dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h kaos.h arm/kaos-strongarm.h"
+       tmake_file=arm/t-strongarm-elf
+       out_file=arm/arm.c
+       md_file=arm/arm.md
+       extra_modes=arm/arm-modes.def
+       ;;
 v850e-*-*)
        target_cpu_default="TARGET_CPU_v850e"
        tm_file="dbxelf.h elfos.h svr4.h v850/v850.h"
@@ -2129,262 +2163,523 @@ case $machine in
        ;;
 esac
 
-# Distinguish i[34567]86
-# Also, do not run mips-tfile on MIPS if using gas.
-# Process --with-cpu= for PowerPC/rs6000
-target_cpu_default2=
-case $machine in
-i486-*-*)
-       target_cpu_default2=TARGET_CPU_DEFAULT_i486
-       ;;
-i586-*-*)
-       case $target_alias in
-               k6_2-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_k6_2
+# Support for --with-cpu and related options (and a few unrelated options,
+# too).  Only do this if $machine is the target, or we'll try to validate
+# the CPU argument against the wrong machine type.
+
+if test "x$pass2done" = xyes
+then
+       case "x$with_cpu" in
+       xyes | xno)
+               echo "--with-cpu must be passed a value" 1>&2
+               exit 1
+               ;;
+       esac
+
+       # If there is no $with_cpu option, try to infer one from ${machine}.
+       # This block sets nothing except for with_cpu.
+       if test x$with_cpu = x
+       then
+               case $machine in
+               ep9312-*-*)
+                       # A Cirrus ARM variant.
+                       with_cpu="ep9312"
                        ;;
-               k6_3-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_k6_3
+               i486-*-*)
+                       with_cpu=i486
                        ;;
-               k6-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_k6
+               i586-*-*)
+                       case $target_alias in
+                       k6_2-*)
+                               with_cpu=k6-2
+                               ;;
+                       k6_3-*)
+                               with_cpu=k6-3
+                               ;;
+                       k6-*)
+                               with_cpu=k6
+                               ;;
+                       pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
+                               with_cpu=pentium-mmx
+                               ;;
+                       *)
+                               with_cpu=pentium
+                               ;;
+                       esac
                        ;;
-               pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_pentium_mmx
+               i686-*-* | i786-*-*)
+                       case $target_alias in
+                       k8-*)
+                               with_cpu=k8
+                               ;;
+                       athlon_xp-*|athlon_mp-*|athlon_4-*)
+                               with_cpu=athlon-4
+                               ;;
+                       athlon_tbird-*|athlon-*)
+                               with_cpu=athlon
+                               ;;
+                       pentium2-*)
+                               with_cpu=pentium2
+                               ;;
+                       pentium3-*)
+                               with_cpu=pentium3
+                               ;;
+                       pentium4-*)
+                               with_cpu=pentium4
+                               ;;
+                       *)
+                               with_cpu=pentiumpro
+                               ;;
+                       esac
                        ;;
-               *)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_pentium
+               x86_64-*-*)
+                       with_cpu=k8
                        ;;
-       esac
-       ;;
-i686-*-* | i786-*-*)
-       case $target_alias in
-               k8-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_k8
+               alpha*-*-*)
+                       case $machine in
+                       alphaev6[78]*)
+                               with_cpu=ev67
+                               ;;
+                       alphaev6*)
+                               with_cpu=ev6
+                               ;;
+                       alphapca56*)
+                               with_cpu=pca56
+                               ;;
+                       alphaev56*)
+                               with_cpu=ev56
+                               ;;
+                       alphaev5*)
+                               with_cpu=ev5
+                               ;;
+                       esac
                        ;;
-               athlon_xp-*|athlon_mp-*|athlon_4-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_athlon_sse
+               sparc*-*-*)
+                       with_cpu="`echo $machine | sed 's/-.*$//'`"
+                       if [ x$with_cpu = xsparc64 ]; then
+                               with_cpu=v9
+                       fi
                        ;;
-               athlon_tbird-*|athlon-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_athlon
+               esac
+       fi
+
+       # Similarly for --with-schedule.
+       if test x$with_schedule = x; then
+               case $machine in
+               hppa1* | parisc1*)
+                       # Override default PA8000 scheduling model.
+                       with_schedule=7100LC
                        ;;
-               pentium2-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_pentium2
+               esac
+       fi
+
+       # Validate and mark as valid any --with options supported
+       # by this target.  In order to use a particular --with option
+       # you must list it in supported_defaults; validating the value
+       # is optional.  This case statement should set nothing besides
+       # supported_defaults.
+
+       supported_defaults=
+       case "$machine" in
+       alpha*-*-*)
+               supported_defaults="cpu tune"
+               for which in cpu tune; do
+                       eval "val=\$with_$which"
+                       case "x$val" in
+                       x \
+                       | xev4 | xev45 | x21064 | xev5 | x21164 | xev56 | x21164a \
+                       | xpca56 | x21164PC | x21164pc | xev6 | x21264 | xev67 \
+                       | x21264a)
+                               ;;
+                       *)
+                               echo "Unknown CPU used in --with-$which=$val" 1>&2
+                               exit 1
+                               ;;
+                       esac
+               done
+               ;;
+
+       arm*-*-*)
+               supported_defaults="arch cpu float tune"
+               for which in cpu tune; do
+                       eval "val=\$with_$which"
+                       case "x$val" in
+                       x \
+                       | xarm[236789] | xarm250 | xarm[67][01]0 \
+                       | xarm60 | xarm620 | xarm7d | xarm7di \
+                       | xarm7m | xarm7dm | xarm7dmi | xarm[79]tdmi \
+                       | xarm70 | xarm700i | xarm710t | xarm720 \
+                       | xarm720t | xarm740t | xarm710c | xarm920 \
+                       | xarm920t | xarm940t | xarm9e | xarm10tdmi \
+                       | xarm7100 | xarm7500 | xarm7500fe | xarm810 \
+                       | xarm1020t \
+                       | xxscale | xiwmmxt \
+                       | xep9312 \
+                       | xstrongarm | xstrongarm110 | xstrongarm11[01]0)
+                               # OK
+                               ;;
+                       *)
+                               echo "Unknown CPU used in --with-$which=$val" 1>&2
+                               exit 1
+                               ;;
+                       esac
+               done
+
+               case "x$with_arch" in
+               x \
+               | xarmv[2345] | xarmv2a | xarmv3m | xarmv4t | xarmv5t \
+               | xarmv5te | ep9312)
+                       # OK
                        ;;
-               pentium3-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_pentium3
+               *)
+                       echo "Unknown arch used in --with-arch=$with_arch" 1>&2
+                       exit 1
                        ;;
-               pentium4-*)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_pentium4
+               esac
+
+               case "x$with_float" in
+               x \
+               | xsoft | xhard)
+                       # OK
                        ;;
                *)
-                       target_cpu_default2=TARGET_CPU_DEFAULT_pentiumpro
-                       ;;
-       esac
-       ;;
-x86_64-*-*)
-       # We should have hammer chip here, but it does not exist yet and
-       # thus it is not supported.  Athlon_SSE is probably equivalent feature
-       # wise to hammer from our point of view except for 64bit mode.
-       target_cpu_default2=TARGET_CPU_DEFAULT_k8
-       ;;
-alpha*-*-*)
-       case $machine in
-               alphaev6[78]*)
-                       target_cpu_default2="MASK_CPU_EV6|MASK_BWX|MASK_MAX|MASK_FIX|MASK_CIX"
+                       echo "Unknown floating point type used in --with-float=$with_float" 1>&2
+                       exit 1
                        ;;
-               alphaev6*)
-                       target_cpu_default2="MASK_CPU_EV6|MASK_BWX|MASK_MAX|MASK_FIX"
+               esac
+
+               if test "x$with_arch" != x && test "x$with_cpu" != x; then
+                       echo "Warning: --with-arch overrides --with-cpu" 1>&2
+               fi
+               ;;
+
+       hppa*-*-* | parisc*-*-*)
+               supported_defaults="arch schedule"
+
+               case "x$with_arch" in
+               x | x1.0 | x1.1 | x2.0)
+                       # OK
                        ;;
-               alphapca56*)
-                       target_cpu_default2="MASK_CPU_EV5|MASK_BWX|MASK_MAX"
+               *)
+                       echo "Unknown architecture used in --with-arch=$with_arch" 1>&2
+                       exit 1
                        ;;
-               alphaev56*)
-                       target_cpu_default2="MASK_CPU_EV5|MASK_BWX"
+               esac
+
+               case "x$with_schedule" in
+               x | x700 | x7100 | x7100LC | x7200 | x7300 | x8000)
+                       # OK
                        ;;
-               alphaev5*)
-                       target_cpu_default2="MASK_CPU_EV5"
+               *)
+                       echo "Unknown processor used in --with-schedule=$with_schedule." 1>&2
+                       exit 1
                        ;;
-       esac
+               esac
+               ;;
 
-       if test x$gas = xyes
-       then
-               if test "$target_cpu_default2" = ""
-               then
-                       target_cpu_default2="MASK_GAS"
-               else
-                       target_cpu_default2="${target_cpu_default2}|MASK_GAS"
-               fi
-       fi
-       ;;
-arm*-*-*)
-       case "x$with_cpu" in
-               x)
-                       # The most generic
-                       target_cpu_default2="TARGET_CPU_generic"
-                       ;;
+       i[34567]86-*-* | x86_64-*-*)
+               supported_defaults="arch cpu tune"
+               for which in arch cpu tune; do
+                       eval "val=\$with_$which"
+                       case "x$val" in
+                       x \
+                       | xi386 | xi486 \
+                       | xi586 | xpentium | xpentium-mmx | xwinchip-c6 | xwinchip2 \
+                       | xc3 | xc3-2 | xi686 | xpentiumpro | xpentium2 | xpentium3 \
+                       | xpentium4 | xk6 | xk6-2 | xk6-3 | xathlon | xathlon-tbird \
+                       | xathlon-4 | xathlon-xp | xathlon-mp | xk8)
+                               # OK
+                               ;;
+                       *)
+                               echo "Unknown CPU given in --with-$which=$val." 1>&2
+                               exit 1
+                               ;;
+                       esac
+               done
+               ;;
 
-               # Distinguish cores, and major variants
-               # arm7m doesn't exist, but D & I don't affect code
-               xarm[236789] | xarm250 | xarm[67][01]0 \
-               | xarm7m | xarm7dm | xarm7dmi | xarm[79]tdmi \
-               | xarm7100 | xarm7500 | xarm7500fe | xarm810 \
-               | xxscale \
-               | xep9312 \
-               | xstrongarm | xstrongarm110 | xstrongarm1100)
-                       target_cpu_default2="TARGET_CPU_$with_cpu"
+       mips*-*-*)
+               supported_defaults="abi arch float tune"
+
+               case "x$with_float" in
+               x \
+               | xsoft | xhard)
+                       # OK
                        ;;
+               *)
+                       echo "Unknown floating point type used in --with-float=$with_float" 1>&2
+                       exit 1
+                       ;;
+               esac
 
-               xyes | xno)
-                       echo "--with-cpu must be passed a value" 1>&2
+               case "x$with_abi" in
+               x \
+               | x32 | xo64 | xn32 | x64 | xeabi)
+                       # OK
+                       ;;
+               *)
+                       echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
                        exit 1
                        ;;
+               esac
+               ;;
 
+       powerpc*-*-* | rs6000-*-*)
+               supported_defaults="cpu float tune"
+
+               for which in cpu tune; do
+                       eval "val=\$with_$which"
+                       case "x$val" in
+                       x \
+                       | xdefault32 | xdefault64 \
+                       | xcommon \
+                       | xpower | xpower2 | xpower3 | xpower4 \
+                       | xpowerpc | xpowerpc64 \
+                       | xrios | xrios1 | xrios2 | xrsc | xrsc1 | xrs64a \
+                       | x401 | x403 | x405 | x405fp | x440 | x440fp | x505 \
+                       | x601 | x602 | x603 | x603e | xec603e | x604 \
+                       | x604e | x620 | x630 | x740 | x750 | x7400 | x7450 \
+                       | x8540 | x801 | x821 | x823 | x860 | x970)
+                               # OK
+                               ;;
+                       *)
+                               echo "Unknown cpu used in --with-$which=$val." 1>&2
+                               exit 1
+                               ;;
+                       esac
+               done
+               ;;
+
+       s390*-*-*)
+               supported_defaults="arch mode tune"
+
+               for which in arch tune; do
+                       eval "val=\$with_$which"
+                       case x$val in
+                       x \
+                       | xg5 | xg6 | xz900 | xz990)
+                               # OK
+                               ;;
+                       *)
+                               echo "Unknown cpu used in --with-$which=$val." 1>&2
+                               exit 1
+                               ;;
+                       esac
+               done
+
+               case "x$with_mode" in
+               x \
+               | xesa | xzarch)
+                       # OK
+                       ;;
                *)
-                       if test x$pass2done = xyes
-                       then
-                               echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
+                       echo "Unknown architecture mode used in --with-mode=$with_mode." 1>&2
+                       exit 1
+                       ;;
+               esac
+               ;;
+
+       sparc*-*-*)
+               supported_defaults="cpu float tune"
+
+               for which in cpu tune; do
+                       eval "val=\$with_$which"
+                       case x$val in
+                       x \
+                       | xsparc | xsparcv9 | xsparc64 | xsparc86x \
+                       | xv7 | xcypress | xv8 | xsupersparc | xsparclite | xf930 \
+                       | xf934 | xhypersparc | xsparclite86x | xsparclet | tsc701 \
+                       | xv9 | xultrasparc | xultrasparc3)
+                               # OK
+                               ;;
+                       *)
+                               echo "Unknown cpu used in --with-$which=$val" 1>&2
                                exit 1
-                       fi
+                               ;;
+                       esac
+               done
+
+               case "x$with_float" in
+               x \
+               | xsoft | xhard)
+                       # OK
                        ;;
-       esac
-       case $machine in
-               9ep9312-*-*)
-                       target_cpu_default2="TARGET_CPU_9ep9312"
+               *)
+                       echo "Unknown floating point type used in --with-float=$with_float" 1>&2
+                       exit 1
                        ;;
-       esac
-       ;;
+               esac
+               ;;
 
-hppa*-*-* | parisc*-*-*)
-       if test x$gas = xyes
-       then
-               target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY"
-       fi
-       case $machine in
-               hppa1* | parisc1*)
-                       tm_defines="TARGET_SCHED_DEFAULT=\\\"7100LC\\\""
+       v850*-*-*)
+               supported_defaults=cpu
+               case "x$with_cpu" in
+               x | xv850e)
+                       # OK
+                       ;;
+               *)
+                       echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
+                       exit 1
                        ;;
+               esac
+               ;;
        esac
-       ;;
-mips*-*-*)
+
+       # Set some miscellaneous flags for particular targets.
+       target_cpu_default2=
        case $machine in
-       mips*-*-ecoff* | mips*-*-elf*)
-               if test x$gas = xyes
-               then
-                       if test x$gnu_ld = xyes
-                       then
-                               target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR"
-                       else
-                               target_cpu_default2="MASK_GAS"
-                       fi
-               fi
-               ;;
-       mips*-*-*)
+       alpha*-*-*)
                if test x$gas = xyes
                then
                        target_cpu_default2="MASK_GAS"
                fi
                ;;
-       esac
-       case $machine in
-               mips*el-*-*)
-                       tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
-                       ;;
-       esac
-       case $tm_file in
-               *mips/elf.h* | *mips/elf64.h*)
-                       tm_defines="OBJECT_FORMAT_ELF $tm_defines"
-                       ;;
-       esac
-       if test "x$enable_gofast" = xyes
-       then
-               tm_defines="INIT_SUBTARGET_OPTABS=INIT_GOFAST_OPTABS $tm_defines"
-               tm_file="gofast.h $tm_file"
-               tmake_file="mips/t-gofast $tmake_file"
-       else
-               tmake_file="mips/t-mips $tmake_file"
-       fi
-       ;;
-powerpc*-*-* | rs6000-*-*)
-        if test x$enable_altivec = xyes
-        then
-                tm_file="$tm_file rs6000/altivec-defs.h"
-        fi
-       case "x$with_cpu" in
-               x | xdefault32 | xdefault64)
-                       ;;
 
-               xcommon | xpowerpc | xpowerpc64 \
-                 | xpower | xpower2 | xpower3 | xpower4 \
-                 | xrios | xrios1 | xrios2 | xrsc | xrsc1 | xrs64a \
-                 | x601 | x602 | x603 | x603e | x604 | x604e | x620 | x630 \
-                 | x740 | x750 | x7400 | x7450 | x505)
-                       target_cpu_default2="\\\"$with_cpu\\\""
+       arm*-*-*)
+               case "x$with_cpu" in
+               x)
+                       # The most generic
+                       target_cpu_default2="TARGET_CPU_generic"
                        ;;
 
-               x401 | x403 | x405 | xec603e | x801 | x821 | x823 | x860)
-                       target_cpu_default2="\\\"$with_cpu\\\""
+               *)
+                       target_cpu_default2="TARGET_CPU_$with_cpu"
                        ;;
+               esac
+               ;;
 
-               xyes | xno)
-                       echo "--with-cpu must be passed a value" 1>&2
-                       exit 1
-                       ;;
+       hppa*-*-* | parisc*-*-*)
+               if test x$gas = xyes
+               then
+                       target_cpu_default2="MASK_GAS|MASK_JUMP_IN_DELAY"
+               fi
+               ;;
 
-               *)
-                       if test x$pass2done = xyes
+       mips*-*-*)
+               case $machine in
+               mips*-*-ecoff* | mips*-*-elf*)
+                       if test x$gas = xyes
                        then
-                               echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
-                               exit 1
+                               if test x$gnu_ld = xyes
+                               then
+                                       target_cpu_default2="MASK_GAS|MASK_SPLIT_ADDR"
+                               else
+                                       target_cpu_default2="MASK_GAS"
+                               fi
                        fi
                        ;;
-       esac
-       out_file=rs6000/rs6000.c
-       c_target_objs="${c_target_objs} rs6000-c.o"
-       cxx_target_objs="${cxx_target_objs} rs6000-c.o"
-       tmake_file="rs6000/t-rs6000 ${tmake_file}"
-       ;;
-sparc*-*-*)
-       case ".$with_cpu" in
-               .)
-                       target_cpu_default2=TARGET_CPU_"`echo $machine | sed 's/-.*$//'`"
-                       ;;
-               .supersparc | .hypersparc | .ultrasparc | .v7 | .v8 | .v9)
-                       target_cpu_default2="TARGET_CPU_$with_cpu"
-                       ;;
-               *)
-                       if test x$pass2done = xyes
+               mips*-*-*)
+                       if test x$gas = xyes
                        then
-                               echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
-                               exit 1
+                               target_cpu_default2="MASK_GAS"
                        fi
                        ;;
-       esac
-       ;;
-v850*-*-*)
-       case "x$with_cpu" in
+               esac
+               case $machine in
+                       mips*el-*-*)
+                               tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
+                               ;;
+               esac
+               case $tm_file in
+                       *mips/elf.h* | *mips/elf64.h*)
+                               tm_defines="OBJECT_FORMAT_ELF $tm_defines"
+                               ;;
+               esac
+               if test "x$enable_gofast" = xyes
+               then
+                       tm_defines="INIT_SUBTARGET_OPTABS=INIT_GOFAST_OPTABS $tm_defines"
+                       tm_file="gofast.h $tm_file"
+                       tmake_file="mips/t-gofast $tmake_file"
+               else
+                       tmake_file="mips/t-mips $tmake_file"
+               fi
+               ;;
+
+       powerpc*-*-* | rs6000-*-*)
+               if test x$enable_altivec = xyes
+               then
+                       tm_file="$tm_file rs6000/altivec-defs.h"
+               fi
+               # FIXME: The PowerPC port uses the value set at compile time,
+               # although it's only cosmetic.
+               if test "x$with_cpu" != x
+               then
+                       target_cpu_default2="\\\"$with_cpu\\\""
+               fi
+               out_file=rs6000/rs6000.c
+               c_target_objs="${c_target_objs} rs6000-c.o"
+               cxx_target_objs="${cxx_target_objs} rs6000-c.o"
+               tmake_file="rs6000/t-rs6000 ${tmake_file}"
+               ;;
+
+       sparc*-*-*)
+               # Some standard aliases.
+               case x$with_cpu in
+               xsparc)
+                       with_cpu=v7
+                       ;;
+               xsparc86x)
+                       with_cpu=sparclite86x
+                       ;;
+               xsparcv9 | xsparc64)
+                       with_cpu=v9
+                       ;;
+               esac
+
+               # The Sparc port checks this value at compile-time.
+               target_cpu_default2="TARGET_CPU_$with_cpu"
+               ;;
+       v850*-*-*)
+               # FIXME: The v850 is "special" in that it does not support
+               # runtime CPU selection, only --with-cpu.
+               case "x$with_cpu" in
                x)
                        ;;
                xv850e)
                        target_cpu_default2="TARGET_CPU_$with_cpu"
                        ;;
-               *)
-                       if test x$pass2done = xyes
-                       then
-                               echo "Unknown cpu used with --with-cpu=$with_cpu" 1>&2
-                               exit 1
-                       fi
-                       ;;
+               esac
+               ;;
        esac
-       ;;
-esac
 
-if test "$target_cpu_default2" != ""
-then
-       if test "$target_cpu_default" != ""
+       t=
+       all_defaults="abi cpu arch tune schedule float mode"
+       for option in $all_defaults
+       do
+               eval "val=\$with_$option"
+               if test -n "$val"; then
+                       case " $supported_defaults " in
+                       *" $option "*)
+                               ;;
+                       *)
+                               echo "This target does not support --with-$option." 2>&1
+                               exit 1
+                               ;;
+                       esac
+
+                       if test "x$t" = x
+                       then
+                               t="{ \"$option\", \"$val\" }"
+                       else
+                               t="${t}, { \"$option\", \"$val\" }"
+                       fi
+               fi
+       done
+       if test "x$t" = x
        then
-               target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
+               configure_default_options="{ { NULL, NULL} }"
        else
-               target_cpu_default=$target_cpu_default2
+               configure_default_options="{ ${t} }"
+       fi
+
+       if test "$target_cpu_default2" != ""
+       then
+               if test "$target_cpu_default" != ""
+               then
+                       target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
+               else
+                       target_cpu_default=$target_cpu_default2
+               fi
        fi
 fi
 
@@ -2407,7 +2702,6 @@ else
                fi
                host_xm_defines=$xm_defines
                host_xmake_file="$xmake_file"
-               host_truncate_target=$truncate_target
                host_extra_gcc_objs=$extra_gcc_objs
                host_extra_objs=$extra_host_objs
                host_exeext=$exeext