OSDN Git Service

PR c/13519
[pf3gnuchains/gcc-fork.git] / gcc / config.gcc
index 189ff02..8bf7d0e 100644 (file)
@@ -30,7 +30,7 @@
 #
 #  with_*              Various variables as set by configure.
 #
-#  enable_threads_flag Either the name, yes or no depending on whether
+#  enable_threads      Either the name, yes or no depending on whether
 #                      threads support was requested.
 #
 #  default_use_cxa_atexit
@@ -167,7 +167,6 @@ thread_file=
 # configure entries modify them.
 gas="$gas_flag"
 gnu_ld="$gnu_ld_flag"
-enable_threads=$enable_threads_flag
 default_use_cxa_atexit=no
 target_gtfiles=
 need_64bit_hwint=
@@ -332,6 +331,10 @@ esac
 # Common parts for widely ported systems.
 case ${target} in
 *-*-darwin*)
+  case ${target} in
+    *-darwin[0-6]*) ;;
+    *) tm_file="${tm_file} darwin7.h" ;;
+  esac
   tm_file="${tm_file} darwin.h"
   tm_p_file="${tm_p_file} darwin-protos.h"
   tmake_file="t-darwin t-slibgcc-darwin"
@@ -790,13 +793,15 @@ hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
        target_cpu_default="(MASK_PA_11 | MASK_BIG_SWITCH)"
        tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
        tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
-       if test x$enable_threads = x; then
-           enable_threads=$have_pthread_h
-       fi
-       case x${enable_threads} in
-       xyes | xdce)
-               tmake_file="${tmake_file} pa/t-dce-thr"
-               ;;
+       case ${enable_threads} in
+         "")
+           if test x$have_pthread_h = xyes ; then
+             tmake_file="${tmake_file} pa/t-dce-thr"
+           fi
+           ;;
+         yes | dce)
+           tmake_file="${tmake_file} pa/t-dce-thr"
+           ;;
        esac
        use_collect2=yes
        use_fixproto=yes
@@ -804,13 +809,15 @@ hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
 hppa1.0-*-hpux10*)
        tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
        tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
-       if test x$enable_threads = x; then
-           enable_threads=$have_pthread_h
-       fi
-       case x${enable_threads} in
-       xyes | xdce)
-               tmake_file="${tmake_file} pa/t-dce-thr"
-               ;;
+       case ${enable_threads} in
+         "")
+           if test x$have_pthread_h = xyes ; then
+             tmake_file="${tmake_file} pa/t-dce-thr"
+           fi
+           ;;
+         yes | dce)
+           tmake_file="${tmake_file} pa/t-dce-thr"
+           ;;
        esac
        use_collect2=yes
        use_fixproto=yes
@@ -984,20 +991,17 @@ i[34567]86-*-solaris2*)
        else
                tmake_file="$tmake_file t-slibgcc-sld"
        fi
+       case ${target} in
+       *-*-solaris2.[789] | *-*-solaris2.1[0-9])
+               tm_file="$tm_file tm-dwarf2.h"
+               ;;
+       esac
        extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
-       if test x${enable_threads} = x; then
-           enable_threads=$have_pthread_h
-           if test x${enable_threads} = x; then
-               enable_threads=$have_thread_h
-           fi
-       fi
-       if test x${enable_threads} = xyes; then
-           if test x${have_pthread_h} = xyes; then
-               thread_file='posix'
-           else
-               thread_file='solaris'
-           fi
-       fi
+       case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
+         no:*:*) ;;
+         *:yes:* ) thread_file=posix ;;
+         yes:*:* | *:*:yes ) thread_file=solaris ;;
+       esac
        ;;
 i[34567]86-*-sysv5*)           # Intel x86 on System V Release 5
        tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/sysv4.h i386/sysv5.h"
@@ -1031,6 +1035,7 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
        tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h"
        xm_file=i386/xm-cygwin.h
        tmake_file="i386/t-cygwin i386/t-cygming"
+       target_gtfiles="\$(srcdir)/config/i386/winnt.c"
        extra_objs=winnt.o
        c_target_objs=cygwin2.o
        cxx_target_objs=cygwin2.o
@@ -1043,6 +1048,7 @@ i[34567]86-*-mingw32*)
        tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h"
        xm_file=i386/xm-mingw32.h
        tmake_file="i386/t-cygming i386/t-mingw32"
+       target_gtfiles="\$(srcdir)/config/i386/winnt.c"
        extra_objs=winnt.o
        if test x$enable_threads = xyes; then
                thread_file='win32'
@@ -1059,6 +1065,7 @@ i[34567]86-*-uwin*)
        tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygwin.h i386/uwin.h"
        tmake_file="i386/t-cygwin i386/t-uwin"
        extra_objs=winnt.o
+       target_gtfiles="\$(srcdir)/config/i386/winnt.c"
        if test x$enable_threads = xyes; then
                thread_file='win32'
        fi
@@ -1068,6 +1075,7 @@ i[34567]86-*-interix3*)
        tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/i386-interix.h i386/i386-interix3.h interix.h interix3.h"
        tmake_file="i386/t-interix"
        extra_objs=winnt.o
+       target_gtfiles="\$(srcdir)/config/i386/winnt.c"
        if test x$enable_threads = xyes ; then
                thread_file='posix'
        fi
@@ -1414,7 +1422,6 @@ mips64-*-elf* | mips64el-*-elf*)
        ;;
 mips64vr-*-elf* | mips64vrel-*-elf*)
         tm_file="mips/vr.h ${tm_file} mips/elf64.h"
-        tm_defines="MIPS_ABI_DEFAULT=ABI_O64 MIPS_MARCH_CONTROLS_SOFT_FLOAT=1"
         tmake_file=mips/t-vr
        use_fixproto=yes
         ;;
@@ -1706,14 +1713,14 @@ sh-*-elf* | sh[2346l]*-*-elf* | sh*-*-kaos*)
        esac
        use_fixproto=yes
        ;;
-sh-*-rtemself*)
-       tmake_file="sh/t-sh sh/t-elf t-rtems"
-       tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h"
-       ;;
-sh-*-rtems*)
+sh-*-rtemscoff*)
        tmake_file="sh/t-sh t-rtems"
        tm_file="${tm_file} dbxcoff.h sh/coff.h sh/rtems.h rtems.h"
        ;;
+sh-*-rtems*)
+       tmake_file="sh/t-sh sh/t-elf t-rtems"
+       tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h"
+       ;;
 sh-*-linux* | sh[2346lbe]*-*-linux*)
        tmake_file="sh/t-sh sh/t-elf ${tmake_file}"
        case ${target} in
@@ -1785,10 +1792,6 @@ sh-*-*)
        tm_file="${tm_file} dbxcoff.h sh/coff.h"
        use_fixproto=yes
        ;;
-sparc-tti-*)
-       tm_file="${tm_file} sparc/pbd.h"
-       use_fixproto=yes
-       ;;
 sparc-*-netbsdelf*)
        tm_file="${tm_file} elfos.h svr4.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
        ;;
@@ -1821,7 +1824,7 @@ sparc-*-rtems*)
        extra_parts="crti.o crtn.o crtbegin.o crtend.o"
        ;;
 sparc64-*-solaris2* | sparcv9-*-solaris2*)
-       tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h"
+       tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sol2-64.h sparc/sol2-bi.h tm-dwarf2.h"
        if test x$gnu_ld = xyes; then
                tm_file="${tm_file} sparc/sol2-gld.h sparc/sol2-gld-bi.h"
        fi
@@ -1835,19 +1838,11 @@ sparc64-*-solaris2* | sparcv9-*-solaris2*)
                tmake_file="$tmake_file t-slibgcc-sld"
        fi
        extra_parts="crt1.o crti.o crtn.o gcrt1.o crtbegin.o crtend.o"
-       if test x${enable_threads} = x ; then
-           enable_threads=$have_pthread_h
-           if test x${enable_threads} = x ; then
-               enable_threads=$have_thread_h
-           fi
-       fi
-       if test x${enable_threads} = xyes ; then
-           if test x${have_pthread_h} = xyes ; then
-               thread_file='posix'
-           else
-               thread_file='solaris'
-           fi
-       fi
+       case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
+         no:*:*) ;;
+         *:yes:* ) thread_file=posix ;;
+         yes:*:* | *:*:yes ) thread_file=solaris ;;
+       esac
        need_64bit_hwint=yes
        ;;
 sparc-*-solaris2*)
@@ -1868,7 +1863,7 @@ sparc-*-solaris2*)
                fi
                ;;
        *-*-solaris2.[789] | *-*-solaris2.1[0-9])
-               tm_file="sparc/biarch64.h ${tm_file} sparc/sol2-bi.h"
+               tm_file="sparc/biarch64.h ${tm_file} sparc/sol2-bi.h tm-dwarf2.h"
                if test x$gnu_ld = xyes; then
                        tm_file="${tm_file} sparc/sol2-gld-bi.h"
                fi
@@ -1880,19 +1875,11 @@ sparc-*-solaris2*)
                ;;
        esac
        extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
-       if test x${enable_threads} = x; then
-           enable_threads=$have_pthread_h
-           if test x${enable_threads} = x; then
-               enable_threads=$have_thread_h
-           fi
-       fi
-       if test x${enable_threads} = xyes; then
-           if test x${have_pthread_h} = xyes; then
-               thread_file='posix'
-           else
-               thread_file='solaris'
-           fi
-       fi
+       case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
+         no:*:*) ;;
+         *:yes:* ) thread_file=posix ;;
+         yes:*:* | *:*:yes ) thread_file=solaris ;;
+       esac
        ;;
 sparc-*-sysv4*)
        tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sysv4-only.h"
@@ -2190,6 +2177,15 @@ if test x$with_cpu = x ; then
   esac
 fi
 
+# Similarly for --with-float
+if test x$with_float = x; then
+       case ${target} in
+       ep9312-*-*)
+               with_float=hard
+               ;;
+       esac
+fi
+
        # Similarly for --with-schedule.
        if test x$with_schedule = x; then
                case ${target} in
@@ -2227,35 +2223,26 @@ fi
                ;;
 
        arm*-*-*)
-               supported_defaults="arch cpu float tune fpu"
+               supported_defaults="arch cpu float tune fpu abi"
                for which in cpu tune; do
+                       # See if it matches any of the entries in arm-cores.def
                        eval "val=\$with_$which"
-                       case "$val" in
-                       "" \
-                       | arm[236789] | arm250 | arm[67][01]0 \
-                       | arm60 | arm620 | arm7d | arm7di \
-                       | arm7m | arm7dm | arm7dmi | arm[79]tdmi \
-                       | arm70 | arm700i | arm710t | arm720 \
-                       | arm720t | arm740t | arm710c | arm920 \
-                       | arm920t | arm926ejs | arm940t | arm9e | arm10tdmi \
-                       | arm7100 | arm7500 | arm7500fe | arm810 \
-                       | arm1026ejs | arm1020t | arm1136js | arm1136jfs \
-                       | xscale | iwmmxt \
-                       | ep9312 \
-                       | strongarm | strongarm110 | strongarm11[01]0)
-                               # OK
-                               ;;
-                       *)
-                               echo "Unknown CPU used in --with-$which=$val" 1>&2
-                               exit 1
-                               ;;
-                       esac
+                       if [ x"$val" = x ] \
+                           || grep "^ARM_CORE($val," \
+                                   ${srcdir}/config/arm/arm-cores.def \
+                                   > /dev/null; then
+                         # Ok
+                         true
+                       else
+                         echo "Unknown CPU used in --with-$which=$val" 1>&2
+                         exit 1
+                       fi
                done
 
                case "$with_arch" in
                "" \
                | armv[23456] | armv2a | armv3m | armv4t | armv5t \
-               | armv5te | armv6j | ep9312)
+               | armv5te | armv6j | iwmmxt | ep9312)
                        # OK
                        ;;
                *)
@@ -2281,13 +2268,24 @@ fi
                        # OK
                        ;;
                *)
-                       echo "Unknown fpu used in --with-fpu=$fpu" 2>&1
+                       echo "Unknown fpu used in --with-fpu=$with_fpu" 2>&1
+                       exit 1
+                       ;;
+               esac
+
+               case "$with_abi" in
+               "" \
+               | apcs-gnu | atpcs | aapcs | iwmmxt )
+                       #OK
+                       ;;
+               *)
+                       echo "Unknown ABI used in --with-abi=$with_abi"
                        exit 1
                        ;;
                esac
 
                if test "x$with_arch" != x && test "x$with_cpu" != x; then
-                       echo "Warning: --with-arch overrides --with-cpu" 1>&2
+                       echo "Warning: --with-arch overrides --with-cpu=$with_cpu" 1>&2
                fi
                ;;
 
@@ -2302,6 +2300,20 @@ fi
                esac
                ;;
 
+       m68k*-linux*)
+               supported_defaults="cpu"
+               case "$with_cpu" in
+               "" | "m68020" | "m68030" | "m68040" | "m68060" | "m68020-40" | "m68020-60")
+                       # OK
+                       ;;
+               *)
+                       echo "Unknown CPU used in --with-cpu=$with_cpu, known values:"  1>&2
+                       echo "m68020 m68030 m68040 m68060 m68020-40 m68020-60" 1>&2
+                       exit 1
+                       ;;
+               esac
+               ;;
+
        hppa*-*-* | parisc*-*-*)
                supported_defaults="arch schedule"
 
@@ -2494,6 +2506,37 @@ fi
                esac
                ;;
 
+       m68k*-linux*)
+               case "x$with_cpu" in
+               x)
+                       # The most generic
+                       target_cpu_default2="(MASK_68020|MASK_68881|MASK_BITFIELD)"
+                       ;;
+               xm68020)
+                       target_cpu_default2="(MASK_68020|MASK_68881|MASK_BITFIELD)"
+                       ;;
+               xm68030)
+                       target_cpu_default2="(MASK_68030|MASK_68020|MASK_68881|MASK_BITFIELD)"
+                       ;;
+               xm68040)
+                       target_cpu_default2="(MASK_68040|MASK_68040_ONLY|MASK_68020|MASK_68881|MASK_BITFIELD)"
+                       ;;
+               xm68060)
+                       target_cpu_default2="(MASK_68060|MASK_68040_ONLY|MASK_68020|MASK_68881|MASK_BITFIELD)"
+                       ;;
+               xm68020-40)
+                       target_cpu_default2="(MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040)"
+                       ;;
+               xm68020-60)
+                       target_cpu_default2="(MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040|MASK_68060)"
+                       ;;
+               *)
+                       echo "Unknown CPU used in --with-cpu=$with_cpu"  1>&2
+                       exit 1
+                       ;;
+               esac
+               ;;
+
        hppa*-*-* | parisc*-*-*)
                if test x$gas = xyes
                then
@@ -2541,10 +2584,6 @@ 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