* builtins.def (BUILT_IN_SETJMP): Revert latest change.
[official-gcc.git] / gcc / config.gcc
blob91a55e89d0469bee28d7e6b9a7d394852de29581
1 # GCC target-specific configuration file.
2 # Copyright (C) 1997-2017 Free Software Foundation, Inc.
4 #This file is part of GCC.
6 #GCC is free software; you can redistribute it and/or modify it under
7 #the terms of the GNU General Public License as published by the Free
8 #Software Foundation; either version 3, or (at your option) any later
9 #version.
11 #GCC is distributed in the hope that it will be useful, but WITHOUT
12 #ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 #FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 #for more details.
16 #You should have received a copy of the GNU General Public License
17 #along with GCC; see the file COPYING3.  If not see
18 #<http://www.gnu.org/licenses/>.
20 # This is the GCC target-specific configuration file
21 # where a configuration type is mapped to different system-specific
22 # definitions and files.  This is invoked by the autoconf-generated
23 # configure script.  Putting it in a separate shell file lets us skip
24 # running autoconf when modifying target-specific information.
26 # When you change the cases in the OS or target switches, consider
27 # updating ../libgcc/config.host also.
29 # This file switches on the shell variable ${target}, and also uses the
30 # following shell variables:
32 #  with_*               Various variables as set by configure.
34 #  enable_threads       Either the name, yes or no depending on whether
35 #                       threads support was requested.
37 #  default_use_cxa_atexit
38 #                         The default value for the $enable___cxa_atexit
39 #                       variable.  enable___cxa_atexit needs to be set to
40 #                       "yes" for the correct operation of C++ destructors
41 #                       but it relies upon the presence of a non-standard C
42 #                       library function called __cxa_atexit.
43 #                         Since not all C libraries provide __cxa_atexit the
44 #                       default value of $default_use_cxa_atexit is set to
45 #                       "no" except for targets which are known to be OK.
47 #  default_gnu_indirect_function
48 #                       The default value for the $enable_gnu_indirect_function
49 #                       variable.  enable_gnu_indirect_function relies
50 #                       upon the presence of a non-standard gnu ifunc support
51 #                       in the assembler, linker and dynamic linker.
52 #                       Since not all libraries provide the dynamic linking
53 #                       support, the default value of
54 #                       $default_gnu_indirect_function is set to
55 #                       "no" except for targets which are known to be OK.
57 #  gas_flag             Either yes or no depending on whether GNU as was
58 #                       requested.
60 #  gnu_ld_flag          Either yes or no depending on whether GNU ld was
61 #                       requested.
63 # This file sets the following shell variables for use by the
64 # autoconf-generated configure script:
66 #  cpu_type             The name of the cpu, if different from the first
67 #                       chunk of the canonical target name.
69 #  tm_defines           List of target macros to define for all compilations.
71 #  tm_file              A list of target macro files, if different from
72 #                       "$cpu_type/$cpu_type.h". Usually it's constructed
73 #                       per target in a way like this:
74 #                       tm_file="${tm_file} dbxelf.h elfos.h ${cpu_type.h}/elf.h"
75 #                       Note that the preferred order is:
76 #                       - specific target header "${cpu_type}/${cpu_type.h}"
77 #                       - generic headers like dbxelf.h elfos.h, etc.
78 #                       - specializing target headers like ${cpu_type.h}/elf.h
79 #                       This helps to keep OS specific stuff out of the CPU
80 #                       defining header ${cpu_type}/${cpu_type.h}.
82 #                       It is possible to include automatically-generated
83 #                       build-directory files by prefixing them with "./".
84 #                       All other files should relative to $srcdir/config.
86 #  tm_p_file            Location of file with declarations for functions
87 #                       in $out_file.
89 #  out_file             The name of the machine description C support
90 #                       file, if different from "$cpu_type/$cpu_type.c".
92 #  common_out_file      The name of the source file for code shared between
93 #                       the compiler proper and the driver.
95 #  md_file              The name of the machine-description file, if
96 #                       different from "$cpu_type/$cpu_type.md".
98 #  tmake_file           A list of machine-description-specific
99 #                       makefile-fragments, if different from
100 #                       "$cpu_type/t-$cpu_type".
102 #  extra_modes          The name of the file containing a list of extra
103 #                       machine modes, if necessary and different from
104 #                       "$cpu_type/$cpu_type-modes.def".
106 #  extra_objs           List of extra objects that should be linked into
107 #                       the compiler proper (cc1, cc1obj, cc1plus)
108 #                       depending on target.
110 #  extra_gcc_objs       List of extra objects that should be linked into
111 #                       the compiler driver (gcc) depending on target.
113 #  extra_headers        List of used header files from the directory
114 #                       config/${cpu_type}.
116 #  user_headers_inc_next_pre
117 #                       List of header file names of internal gcc header
118 #                       files, which should be prefixed by an include_next.
119 #  user_headers_inc_next_post
120 #                       List of header file names of internal gcc header
121 #                       files, which should be postfixed by an include_next.
122 #  use_gcc_tgmath       If set, add tgmath.h to the list of used header
123 #                       files.
125 #  use_gcc_stdint       If "wrap", install a version of stdint.h that
126 #                       wraps the system's copy for hosted compilations;
127 #                       if "provide", provide a version of systems without
128 #                       such a system header; otherwise "none", do not
129 #                       provide such a header at all.
131 #  extra_programs       List of extra executables compiled for this target
132 #                       machine, used when linking.
134 #  extra_options        List of target-dependent .opt files.
136 #  c_target_objs        List of extra target-dependent objects that be
137 #                       linked into the C compiler only.
139 #  cxx_target_objs      List of extra target-dependent objects that be
140 #                       linked into the C++ compiler only.
142 #  fortran_target_objs  List of extra target-dependent objects that be
143 #                       linked into the fortran compiler only.
145 #  target_gtfiles       List of extra source files with type information.
147 #  xm_defines           List of macros to define when compiling for the
148 #                       target machine.
150 #  xm_file              List of files to include when compiling for the
151 #                       target machine.
153 #  use_collect2         Set to yes or no, depending on whether collect2
154 #                       will be used.
156 #  target_cpu_default   Set to override the default target model.
158 #  gdb_needs_out_file_path
159 #                       Set to yes if gdb needs a dir command with
160 #                       `dirname $out_file`.
162 #  thread_file          Set to control which thread package to use.
164 #  gas                  Set to yes or no depending on whether the target
165 #                       system normally uses GNU as.
167 #  configure_default_options
168 #                       Set to an initializer for configure_default_options
169 #                       in configargs.h, based on --with-cpu et cetera.
171 #  native_system_header_dir
172 #                       Where system header files are found for this
173 #                       target.  This defaults to /usr/include.  If
174 #                       the --with-sysroot configure option or the
175 #                       --sysroot command line option is used this
176 #                       will be relative to the sysroot.
177 # target_type_format_char 
178 #                       The default character to be used for formatting
179 #                       the attribute in a
180 #                       .type symbol_name, ${t_t_f_c}<property>
181 #                       directive.
183 # The following variables are used in each case-construct to build up the
184 # outgoing variables:
186 #  gnu_ld               Set to yes or no depending on whether the target
187 #                       system normally uses GNU ld.
189 #  target_has_targetcm  Set to yes or no depending on whether the target
190 #                       has its own definition of targetcm.
192 #  target_has_targetm_common    Set to yes or no depending on whether the
193 #                       target has its own definition of targetm_common.
195 out_file=
196 common_out_file=
197 tmake_file=
198 extra_headers=
199 user_headers_inc_next_pre=
200 user_headers_inc_next_post=
201 use_gcc_tgmath=yes
202 use_gcc_stdint=none
203 extra_programs=
204 extra_objs=
205 extra_gcc_objs=
206 extra_options=
207 c_target_objs=
208 cxx_target_objs=
209 fortran_target_objs=
210 target_has_targetcm=no
211 target_has_targetm_common=yes
212 tm_defines=
213 xm_defines=
214 # Set this to force installation and use of collect2.
215 use_collect2=
216 # Set this to override the default target model.
217 target_cpu_default=
218 # Set this if gdb needs a dir command with `dirname $out_file`
219 gdb_needs_out_file_path=
220 # Set this to control which thread package will be used.
221 thread_file=
222 # Reinitialize these from the flag values every loop pass, since some
223 # configure entries modify them.
224 gas="$gas_flag"
225 gnu_ld="$gnu_ld_flag"
226 default_use_cxa_atexit=no
227 default_gnu_indirect_function=no
228 target_gtfiles=
229 need_64bit_isa=
230 native_system_header_dir=/usr/include
231 target_type_format_char='@'
233 # Don't carry these over build->host->target.  Please.
234 xm_file=
235 md_file=
237 # Obsolete configurations.
238 case ${target} in
239  nothing                                \
241     if test "x$enable_obsolete" != xyes; then
242       echo "*** Configuration ${target} is obsolete." >&2
243       echo "*** Specify --enable-obsolete to build it anyway." >&2
244       echo "*** Support will be REMOVED in the next major release of GCC," >&2
245       echo "*** unless a maintainer comes forward." >&2
246       exit 1
247     fi;;
248 esac
250 # Unsupported targets list.  Do not put an entry in this list unless
251 # it would otherwise be caught by a more permissive pattern.  The list
252 # should be in alphabetical order.
253 case ${target} in
254  # Avoid special cases that are not obsolete
255    arm*-*-*eabi*                        \
257         ;;
258    arm*-wince-pe*                       \
259  | arm*-*-ecos-elf                      \
260  | arm*-*-elf                           \
261  | arm*-*-linux*                        \
262  | arm*-*-uclinux*                      \
263  | i[34567]86-go32-*                    \
264  | i[34567]86-*-go32*                   \
265  | m68k-*-uclinuxoldabi*                \
266  | mips64orion*-*-rtems*                \
267  | pdp11-*-bsd                          \
268  | sparc-hal-solaris2*                  \
269  | thumb-*-*                            \
270  | *-*-freebsd[12] | *-*-freebsd[12].*  \
271  | *-*-freebsd*aout*                    \
272  | *-*-linux*aout*                      \
273  | *-*-linux*coff*                      \
274  | *-*-linux*libc1*                     \
275  | *-*-linux*oldld*                     \
276  | *-*-rtemsaout*                       \
277  | *-*-rtemscoff*                       \
278  | *-*-solaris2                         \
279  | *-*-solaris2.[0-9]                   \
280  | *-*-solaris2.[0-9].*                 \
281  | *-*-sysv*                            \
282  | vax-*-vms*                           \
284         echo "*** Configuration ${target} not supported" 1>&2
285         exit 1
286         ;;
287 esac
289 # Set default cpu_type, tm_file, tm_p_file and xm_file so it can be
290 # updated in each machine entry.  Also set default extra_headers for some
291 # machines.
292 tm_p_file=
293 cpu_type=`echo ${target} | sed 's/-.*$//'`
294 cpu_is_64bit=
295 case ${target} in
296 m32c*-*-*)
297         cpu_type=m32c
298         tmake_file=m32c/t-m32c
299         target_has_targetm_common=no
300         ;;
301 aarch64*-*-*)
302         cpu_type=aarch64
303         extra_headers="arm_fp16.h arm_neon.h arm_acle.h"
304         c_target_objs="aarch64-c.o"
305         cxx_target_objs="aarch64-c.o"
306         extra_objs="aarch64-builtins.o aarch-common.o cortex-a57-fma-steering.o"
307         target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.c"
308         target_has_targetm_common=yes
309         ;;
310 alpha*-*-*)
311         cpu_type=alpha
312         extra_options="${extra_options} g.opt"
313         ;;
314 am33_2.0-*-linux*)
315         cpu_type=mn10300
316         ;;
317 arc*-*-*)
318         cpu_type=arc
319         c_target_objs="arc-c.o"
320         cxx_target_objs="arc-c.o"
321         extra_options="${extra_options} arc/arc-tables.opt g.opt"
322         extra_headers="arc-simd.h"
323         ;;
324 arm*-*-*)
325         cpu_type=arm
326         extra_objs="arm-builtins.o aarch-common.o"
327         extra_headers="mmintrin.h arm_neon.h arm_acle.h arm_fp16.h arm_cmse.h"
328         target_type_format_char='%'
329         c_target_objs="arm-c.o"
330         cxx_target_objs="arm-c.o"
331         extra_options="${extra_options} arm/arm-tables.opt"
332         target_gtfiles="\$(srcdir)/config/arm/arm-builtins.c"
333         ;;
334 avr-*-*)
335         cpu_type=avr
336         c_target_objs="avr-c.o"
337         cxx_target_objs="avr-c.o"
338         ;;
339 bfin*-*)
340         cpu_type=bfin
341         ;;
342 crisv32-*)
343         cpu_type=cris
344         ;;
345 frv*)   cpu_type=frv
346         extra_options="${extra_options} g.opt"
347         ;;
348 ft32*)  cpu_type=ft32
349         target_has_targetm_common=no
350         ;;
351 moxie*) cpu_type=moxie
352         target_has_targetm_common=no
353         ;;
354 fido-*-*)
355         cpu_type=m68k
356         extra_headers=math-68881.h
357         extra_options="${extra_options} m68k/m68k-tables.opt"
358         ;;
359 i[34567]86-*-*)
360         cpu_type=i386
361         c_target_objs="i386-c.o"
362         cxx_target_objs="i386-c.o"
363         extra_options="${extra_options} fused-madd.opt"
364         extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
365                        pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
366                        nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
367                        immintrin.h x86intrin.h avxintrin.h xopintrin.h
368                        ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
369                        lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
370                        avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
371                        rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
372                        adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
373                        avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
374                        shaintrin.h clflushoptintrin.h xsavecintrin.h
375                        xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
376                        avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
377                        avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
378                        avx512vbmivlintrin.h avx5124fmapsintrin.h avx5124vnniwintrin.h
379                        avx512vpopcntdqintrin.h clwbintrin.h mwaitxintrin.h
380                        clzerointrin.h pkuintrin.h sgxintrin.h"
381         ;;
382 x86_64-*-*)
383         cpu_type=i386
384         c_target_objs="i386-c.o"
385         cxx_target_objs="i386-c.o"
386         extra_options="${extra_options} fused-madd.opt"
387         extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
388                        pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
389                        nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
390                        immintrin.h x86intrin.h avxintrin.h xopintrin.h
391                        ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
392                        lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h
393                        avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
394                        rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
395                        adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
396                        avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
397                        shaintrin.h clflushoptintrin.h xsavecintrin.h
398                        xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
399                        avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
400                        avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
401                        avx512vbmivlintrin.h avx5124fmapsintrin.h avx5124vnniwintrin.h
402                        avx512vpopcntdqintrin.h clwbintrin.h mwaitxintrin.h
403                        clzerointrin.h pkuintrin.h sgxintrin.h"
404         ;;
405 ia64-*-*)
406         extra_headers=ia64intrin.h
407         extra_options="${extra_options} g.opt fused-madd.opt"
408         ;;
409 hppa*-*-*)
410         cpu_type=pa
411         ;;
412 lm32*)
413         extra_options="${extra_options} g.opt"
414         ;;
415 m32r*-*-*)
416         cpu_type=m32r
417         extra_options="${extra_options} g.opt"
418         ;;
419 m68k-*-*)
420         extra_headers=math-68881.h
421         extra_options="${extra_options} m68k/m68k-tables.opt"
422         ;;
423 microblaze*-*-*)
424         cpu_type=microblaze
425         extra_options="${extra_options} g.opt"
426         ;;
427 mips*-*-*)
428         cpu_type=mips
429         extra_headers="loongson.h msa.h"
430         extra_objs="frame-header-opt.o"
431         extra_options="${extra_options} g.opt fused-madd.opt mips/mips-tables.opt"
432         ;;
433 nds32*)
434         cpu_type=nds32
435         extra_headers="nds32_intrinsic.h"
436         extra_objs="nds32-cost.o nds32-intrinsic.o nds32-isr.o nds32-md-auxiliary.o nds32-pipelines-auxiliary.o nds32-predicates.o nds32-memory-manipulation.o nds32-fp-as-gp.o"
437         ;;
438 nios2-*-*)
439         cpu_type=nios2
440         extra_options="${extra_options} g.opt"
441         ;;
442 nvptx-*-*)
443         cpu_type=nvptx
444         ;;
445 powerpc*-*-*spe*)
446         cpu_type=powerpcspe
447         extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h"
448         case x$with_cpu in
449             xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456789]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
450                 cpu_is_64bit=yes
451                 ;;
452         esac
453         extra_options="${extra_options} g.opt fused-madd.opt powerpcspe/powerpcspe-tables.opt"
454         ;;
455 powerpc*-*-*)
456         cpu_type=rs6000
457         extra_objs="rs6000-string.o rs6000-p8swap.o"
458         extra_headers="ppc-asm.h altivec.h htmintrin.h htmxlintrin.h"
459         extra_headers="${extra_headers} bmi2intrin.h bmiintrin.h"
460         extra_headers="${extra_headers} xmmintrin.h mm_malloc.h"
461         extra_headers="${extra_headers} mmintrin.h x86intrin.h"
462         extra_headers="${extra_headers} ppu_intrinsics.h spu2vmx.h vec_types.h si2vmx.h"
463         extra_headers="${extra_headers} paired.h"
464         case x$with_cpu in
465             xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456789]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
466                 cpu_is_64bit=yes
467                 ;;
468         esac
469         extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
470         ;;
471 riscv*)
472         cpu_type=riscv
473         extra_objs="riscv-builtins.o riscv-c.o"
474         ;;
475 rs6000*-*-*)
476         extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
477         extra_objs="rs6000-string.o rs6000-p8swap.o"
478         ;;
479 sparc*-*-*)
480         cpu_type=sparc
481         c_target_objs="sparc-c.o"
482         cxx_target_objs="sparc-c.o"
483         extra_headers="visintrin.h"
484         ;;
485 spu*-*-*)
486         cpu_type=spu
487         ;;
488 s390*-*-*)
489         cpu_type=s390
490         extra_options="${extra_options} fused-madd.opt"
491         extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
492         ;;
493 # Note the 'l'; we need to be able to match e.g. "shle" or "shl".
494 sh[123456789lbe]*-*-* | sh-*-*)
495         cpu_type=sh
496         extra_options="${extra_options} fused-madd.opt"
497         extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
498         ;;
499 v850*-*-*)
500         cpu_type=v850
501         ;;
502 tic6x-*-*)
503         cpu_type=c6x
504         extra_headers="c6x_intrinsics.h"
505         extra_options="${extra_options} c6x/c6x-tables.opt"
506         ;;
507 xtensa*-*-*)
508         extra_options="${extra_options} fused-madd.opt"
509         ;;
510 tilegx*-*-*)
511         cpu_type=tilegx
512         ;;
513 tilepro*-*-*)
514         cpu_type=tilepro
515         ;;
516 esac
518 tm_file=${cpu_type}/${cpu_type}.h
519 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
520 then
521         tm_p_file=${cpu_type}/${cpu_type}-protos.h
523 extra_modes=
524 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
525 then
526         extra_modes=${cpu_type}/${cpu_type}-modes.def
528 if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt
529 then
530         extra_options="${extra_options} ${cpu_type}/${cpu_type}.opt"
533 case ${target} in
534 aarch64*-*-*)
535         tm_p_file="${tm_p_file} arm/aarch-common-protos.h"
536         case ${with_abi} in
537         "")
538                 if test "x$with_multilib_list" = xilp32; then
539                         tm_file="aarch64/biarchilp32.h ${tm_file}"
540                 else
541                         tm_file="aarch64/biarchlp64.h ${tm_file}"
542                 fi
543                 ;;
544         ilp32)
545                 tm_file="aarch64/biarchilp32.h ${tm_file}"
546                 ;;
547         lp64)
548                 tm_file="aarch64/biarchlp64.h ${tm_file}"
549                 ;;
550         *)
551                 echo "Unknown ABI used in --with-abi=$with_abi"
552                 exit 1
553         esac
554         ;;
555 i[34567]86-*-*)
556         if test "x$with_abi" != x; then
557                 echo "This target does not support --with-abi."
558                 exit 1
559         fi
560         if test "x$enable_cld" = xyes; then
561                 tm_defines="${tm_defines} USE_IX86_CLD=1"
562         fi
563         if test "x$enable_frame_pointer" = xyes; then
564                 tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
565         fi
566         tm_file="vxworks-dummy.h ${tm_file}"
567         ;;
568 x86_64-*-*)
569         case ${with_abi} in
570         "")
571                 if test "x$with_multilib_list" = xmx32; then
572                         tm_file="i386/biarchx32.h ${tm_file}"
573                 else
574                         tm_file="i386/biarch64.h ${tm_file}"
575                 fi
576                 ;;
577         64 | m64)
578                 tm_file="i386/biarch64.h ${tm_file}"
579                 ;;
580         x32 | mx32)
581                 tm_file="i386/biarchx32.h ${tm_file}"
582                 ;;
583         *)
584                 echo "Unknown ABI used in --with-abi=$with_abi"
585                 exit 1
586         esac
587         if test "x$enable_cld" = xyes; then
588                 tm_defines="${tm_defines} USE_IX86_CLD=1"
589         fi
590         if test "x$enable_frame_pointer" = xyes; then
591                 tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1"
592         fi
593         tm_file="vxworks-dummy.h ${tm_file}"
594         ;;
595 arm*-*-*)
596         tm_p_file="arm/arm-flags.h ${tm_p_file} arm/aarch-common-protos.h"
597         tm_file="vxworks-dummy.h ${tm_file}"
598         ;;
599 mips*-*-* | sh*-*-* | sparc*-*-*)
600         tm_file="vxworks-dummy.h ${tm_file}"
601         ;;
602 esac
604 # On a.out targets, we need to use collect2.
605 case ${target} in
606 *-*-*aout*)
607         use_collect2=yes
608         ;;
609 esac
611 # Common C libraries.
612 tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
614 # 32-bit x86 processors supported by --with-arch=.  Each processor
615 # MUST be separated by exactly one space.
616 x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \
617 athlon-xp k6 k6-2 k6-3 geode c3 c3-2 winchip-c6 winchip2 i386 i486 \
618 i586 i686 pentium pentium-m pentium-mmx pentium2 pentium3 pentium3m \
619 pentium4 pentium4m pentiumpro prescott lakemont"
621 # 64-bit x86 processors supported by --with-arch=.  Each processor
622 # MUST be separated by exactly one space.
623 x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \
624 bdver3 bdver4 znver1 btver1 btver2 k8 k8-sse3 opteron opteron-sse3 nocona \
625 core2 corei7 corei7-avx core-avx-i core-avx2 atom slm nehalem westmere \
626 sandybridge ivybridge haswell broadwell bonnell silvermont knl knm \
627 skylake-avx512 x86-64 native"
629 # Additional x86 processors supported by --with-cpu=.  Each processor
630 # MUST be separated by exactly one space.
631 x86_cpus="generic intel"
633 # Common parts for widely ported systems.
634 case ${target} in
635 *-*-darwin*)
636   tmake_file="t-darwin ${cpu_type}/t-darwin"
637   tm_file="${tm_file} darwin.h"
638   case ${target} in
639   *-*-darwin9*)
640     tm_file="${tm_file} darwin9.h"
641     ;;
642   *-*-darwin[1][01]*)
643     tm_file="${tm_file} darwin9.h darwin10.h"
644     ;;
645   *-*-darwin[1][2-9]* | *-*-darwin[2][0-9]*)
646     tm_file="${tm_file} darwin9.h darwin10.h darwin12.h"
647     ;;
648   esac
649   tm_file="${tm_file} ${cpu_type}/darwin.h"
650   tm_p_file="${tm_p_file} darwin-protos.h"
651   target_gtfiles="\$(srcdir)/config/darwin.c"
652   extra_options="${extra_options} darwin.opt"
653   c_target_objs="${c_target_objs} darwin-c.o"
654   cxx_target_objs="${cxx_target_objs} darwin-c.o"
655   fortran_target_objs="darwin-f.o"
656   target_has_targetcm=yes
657   extra_objs="${extra_objs} darwin.o"
658   extra_gcc_objs="darwin-driver.o"
659   default_use_cxa_atexit=yes
660   use_gcc_stdint=wrap
661   case ${enable_threads} in
662     "" | yes | posix) thread_file='posix' ;;
663   esac
664   ;;
665 *-*-dragonfly*)
666   gas=yes
667   gnu_ld=yes
668   tmake_file="t-slibgcc"
669   case ${enable_threads} in
670     "" | yes | posix)
671       thread_file='posix'
672       ;;
673     no | single)
674       # Let these non-posix thread selections fall through if requested
675       ;;
676     *)
677       echo 'Unknown thread configuration for DragonFly BSD'
678       exit 1
679       ;;
680   esac
681   extra_options="$extra_options rpath.opt dragonfly.opt"
682   default_use_cxa_atexit=yes
683   use_gcc_stdint=wrap
684   ;;
685 *-*-freebsd*)
686   # This is the generic ELF configuration of FreeBSD.  Later
687   # machine-specific sections may refine and add to this
688   # configuration.
689   #
690   # Due to tm_file entry ordering issues that vary between cpu
691   # architectures, we only define fbsd_tm_file to allow the
692   # machine-specific section to dictate the final order of all
693   # entries of tm_file with the minor exception that components
694   # of the tm_file set here will always be of the form:
695   #
696   # freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd-spec.h freebsd.h
697   #
698   # The machine-specific section should not tamper with this
699   # ordering but may order all other entries of tm_file as it
700   # pleases around the provided core setting.
701   gas=yes
702   gnu_ld=yes
703   fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
704   if test "$fbsd_major" = ""; then
705     echo "Specify the major version number of the targeted FreeBSD release"
706     echo "like this: --target=amd64-unknown-freebsd10.1"
707     exit 1
708   fi
709   tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
710   tmake_file="t-slibgcc"
711   case ${enable_threads} in
712     no)
713       fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h"
714       ;;
715     "" | yes | posix)
716       thread_file='posix'
717       ;;
718     *)
719       echo 'Unknown thread configuration for FreeBSD'
720       exit 1
721       ;;
722   esac
723   fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h freebsd-stdint.h"
724   extra_options="$extra_options rpath.opt freebsd.opt"
725   case ${target} in
726     *-*-freebsd[345].*)
727       :;;
728     *)
729       default_use_cxa_atexit=yes;;
730   esac
731   use_gcc_stdint=wrap
732   ;;
733 *-*-fuchsia*)
734   native_system_header_dir=/include
735   ;;
736 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
737   extra_options="$extra_options gnu-user.opt"
738   gas=yes
739   gnu_ld=yes
740   case ${enable_threads} in
741     "" | yes | posix) thread_file='posix' ;;
742   esac
743   tmake_file="t-slibgcc"
744   case $target in
745     *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
746       :;;
747     *-*-gnu*)
748       native_system_header_dir=/include
749       ;;
750   esac
751   # Linux C libraries selection switch: glibc / uclibc / bionic.
752   # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
753   case $target in
754     *linux*)
755       tm_p_file="${tm_p_file} linux-protos.h"
756       tmake_file="${tmake_file} t-linux"
757       extra_objs="${extra_objs} linux.o"
758       extra_options="${extra_options} linux.opt"
759       ;;
760   esac
761   case $target in
762     *-*-*android*)
763       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
764       ;;
765     *-*-*uclibc*)
766       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
767       ;;
768     *-*-*musl*)
769       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
770       ;;
771     *)
772       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
773       ;;
774   esac
775   # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit
776   # is provided.
777   default_use_cxa_atexit=yes
778   use_gcc_tgmath=no
779   use_gcc_stdint=wrap
780   # Enable compilation for Android by default for *android* targets.
781   case $target in
782     *-*-*android*)
783       tm_defines="$tm_defines ANDROID_DEFAULT=1"
784       ;;
785     *)
786       tm_defines="$tm_defines ANDROID_DEFAULT=0"
787       ;;
788   esac
789   c_target_objs="${c_target_objs} glibc-c.o"
790   cxx_target_objs="${cxx_target_objs} glibc-c.o"
791   tmake_file="${tmake_file} t-glibc"
792   target_has_targetcm=yes
793   ;;
794 *-*-netbsd*)
795   tm_p_file="${tm_p_file} netbsd-protos.h"
796   tmake_file="t-netbsd t-slibgcc"
797   extra_objs="${extra_objs} netbsd.o"
798   gas=yes
799   gnu_ld=yes
800   use_gcc_stdint=wrap
801   case ${enable_threads} in
802     "" | yes | posix) thread_file='posix' ;;
803   esac
804   nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
805   default_use_cxa_atexit=yes
806   ;;
807 *-*-openbsd*)
808   tmake_file="t-openbsd"
809   case ${enable_threads} in
810     yes)
811       thread_file='posix'
812       ;;
813   esac
814   case ${target} in
815     *-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
816       default_use_cxa_atexit=yes
817       ;;
818   esac
819   ;;
820 *-*-phoenix*)
821   gas=yes
822   gnu_ld=yes
823   default_use_cxa_atexit=yes
824   ;;
825 *-*-rtems*)
826   case ${enable_threads} in
827     "" | yes | rtems) thread_file='rtems' ;;
828     posix) thread_file='posix' ;;
829     no) ;;
830     *)
831       echo 'Unknown thread configuration for RTEMS'
832       exit 1
833       ;;
834   esac
835   tmake_file="${tmake_file} t-rtems"
836   extra_options="${extra_options} rtems.opt"
837   default_use_cxa_atexit=yes
838   use_gcc_stdint=wrap
839   ;;
840 *-*-uclinux*)
841   extra_options="$extra_options gnu-user.opt"
842   use_gcc_stdint=wrap
843   case ${enable_threads} in
844     "" | yes | posix) thread_file='posix' ;;
845   esac
846   tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
847   ;;
848 *-*-rdos*)
849   use_gcc_stdint=wrap
850   ;;
851 *-*-solaris2*)
852   # i?86-*-solaris2* needs to insert headers between cpu default and
853   # Solaris 2 specific ones.
854   sol2_tm_file_head="dbxelf.h elfos.h ${cpu_type}/sysv4.h"
855   sol2_tm_file_tail="${cpu_type}/sol2.h sol2.h"
856   sol2_tm_file="${sol2_tm_file_head} ${sol2_tm_file_tail}"
857   case ${target} in
858     *-*-solaris2.1[2-9]*)
859       # __cxa_atexit was introduced in Solaris 12.
860       default_use_cxa_atexit=yes
861       ;;
862   esac
863   use_gcc_stdint=wrap
864   if test x$gnu_ld = xyes; then
865     tm_file="usegld.h ${tm_file}"
866   fi
867   if test x$gas = xyes; then
868     tm_file="usegas.h ${tm_file}"
869   fi
870   tm_p_file="${tm_p_file} sol2-protos.h"
871   tmake_file="${tmake_file} t-sol2 t-slibgcc"
872   c_target_objs="${c_target_objs} sol2-c.o"
873   cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o"
874   extra_objs="sol2.o sol2-stubs.o"
875   extra_options="${extra_options} sol2.opt"
876   case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
877     "":yes:* | yes:yes:* )
878       thread_file=posix
879       ;;
880   esac
881   ;;
882 *-*-*vms*)
883   extra_options="${extra_options} vms/vms.opt"
884   xmake_file=vms/x-vms
885   tmake_file="vms/t-vms t-slibgcc"
886   extra_objs="vms.o"
887   target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.c"
888   tm_p_file="${tm_p_file} vms/vms-protos.h"
889   xm_file="vms/xm-vms.h"
890   c_target_objs="vms-c.o"
891   cxx_target_objs="vms-c.o"
892   fortran_target_objs="vms-f.o"
893   use_gcc_stdint=provide
894   tm_file="${tm_file} vms/vms-stdint.h"
895   if test x$gnu_ld != xyes; then
896     # Build wrappers for native case.
897     extra_programs="ld\$(exeext) ar\$(exeext)"
898     tmake_file="$tmake_file vms/t-vmsnative"
899   fi
900   ;;
901 *-*-vxworks*)
902   tmake_file=t-vxworks
903   xm_defines=POSIX
904   extra_options="${extra_options} vxworks.opt"
905   extra_objs="$extra_objs vxworks.o"
906   use_gcc_stdint=provide
907   tm_file="${tm_file} vxworks-stdint.h"
908   case ${enable_threads} in
909     no) ;;
910     "" | yes | vxworks) thread_file='vxworks' ;;
911     *) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
912   esac
913   case $target in
914     *-*-vxworks7*)
915       tm_defines="$tm_defines TARGET_VXWORKS7=1"
916       ;;
917   esac
918   ;;
919 *-*-elf|arc*-*-elf*)
920   # Assume that newlib is being used and so __cxa_atexit is provided.
921   default_use_cxa_atexit=yes
922   use_gcc_stdint=wrap
923   ;;
924 esac
926 case ${target} in
927 aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
928         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
929         tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-elf-raw.h"
930         tmake_file="${tmake_file} aarch64/t-aarch64"
931         case $target in
932         aarch64-*-elf*)
933                 use_gcc_stdint=wrap
934                 ;;
935         aarch64-*-fuchsia*)
936                 tm_file="${tm_file} fuchsia.h"
937                 ;;
938         aarch64-*-rtems*)
939                 tm_file="${tm_file} rtems.h aarch64/rtems.h"
940                 ;;
941         esac
942         case $target in
943         aarch64_be-*)
944                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
945                 ;;
946         esac
947         aarch64_multilibs="${with_multilib_list}"
948         if test "$aarch64_multilibs" = "default"; then
949                 aarch64_multilibs="lp64,ilp32"
950         fi
951         aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
952         for aarch64_multilib in ${aarch64_multilibs}; do
953                 case ${aarch64_multilib} in
954                 ilp32 | lp64 )
955                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
956                         ;;
957                 *)
958                         echo "--with-multilib-list=${aarch64_multilib} not supported."
959                         exit 1
960                 esac
961         done
962         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
963         ;;
964 aarch64*-*-freebsd*)
965         tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file}"
966         tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-freebsd.h"
967         tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
968         ;;
969 aarch64*-*-linux*)
970         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
971         tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-linux.h"
972         tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
973         case $target in
974         aarch64_be-*)
975                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
976                 ;;
977         esac
978         aarch64_multilibs="${with_multilib_list}"
979         if test "$aarch64_multilibs" = "default"; then
980                 # TODO: turn on ILP32 multilib build after its support is mature.
981                 # aarch64_multilibs="lp64,ilp32"
982                 aarch64_multilibs="lp64"
983         fi
984         aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
985         for aarch64_multilib in ${aarch64_multilibs}; do
986                 case ${aarch64_multilib} in
987                 ilp32 | lp64 )
988                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
989                         ;;
990                 *)
991                         echo "--with-multilib-list=${aarch64_multilib} not supported."
992                         exit 1
993                 esac
994         done
995         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
996         ;;
997 alpha*-*-linux*)
998         tm_file="elfos.h ${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
999         tmake_file="${tmake_file} alpha/t-linux alpha/t-alpha"
1000         extra_options="${extra_options} alpha/elf.opt"
1001         ;;
1002 alpha*-*-freebsd*)
1003         tm_file="elfos.h ${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
1004         tmake_file="${tmake_file} alpha/t-alpha"
1005         extra_options="${extra_options} alpha/elf.opt"
1006         ;;
1007 alpha*-*-netbsd*)
1008         tm_file="elfos.h ${tm_file} ${nbsd_tm_file} alpha/elf.h alpha/netbsd.h"
1009         tmake_file="${tmake_file} alpha/t-alpha"
1010         extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
1011                        alpha/elf.opt"
1012         ;;
1013 alpha*-*-openbsd*)
1014         tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
1015         tm_file="elfos.h alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
1016         tmake_file="${tmake_file} alpha/t-alpha"
1017         extra_options="${extra_options} openbsd.opt alpha/elf.opt"
1018         # default x-alpha is only appropriate for dec-osf.
1019         ;;
1020 alpha*-dec-*vms*)
1021         tm_file="${tm_file} vms/vms.h alpha/vms.h"
1022         tmake_file="${tmake_file} alpha/t-vms alpha/t-alpha"
1023         ;;
1024 arc*-*-elf*)
1025         tm_file="arc/arc-arch.h dbxelf.h elfos.h newlib-stdint.h arc/elf.h ${tm_file}"
1026         tmake_file="arc/t-multilib arc/t-arc"
1027         extra_gcc_objs="driver-arc.o"
1028         if test "x$with_cpu" != x; then
1029                 tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
1030         fi
1031         if test x${with_endian} = x; then
1032                 case ${target} in
1033                 arc*be-*-* | arc*eb-*-*)        with_endian=big ;;
1034                 *)                              with_endian=little ;;
1035                 esac
1036         fi
1037         case ${with_endian} in
1038         big|little)             ;;
1039         *)      echo "with_endian=${with_endian} not supported."; exit 1 ;;
1040         esac
1041         case ${with_endian} in
1042         big*)   tm_file="arc/big.h ${tm_file}"
1043         esac
1044         ;;
1045 arc*-*-linux*)
1046         tm_file="arc/arc-arch.h dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arc/linux.h ${tm_file}"
1047         tmake_file="${tmake_file} arc/t-arc"
1048         extra_gcc_objs="driver-arc.o"
1049         if test "x$with_cpu" != x; then
1050                 tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
1051         fi
1052         if test x${with_endian} = x; then
1053                 case ${target} in
1054                 arc*be-*-* | arc*eb-*-*)        with_endian=big ;;
1055                 *)                              with_endian=little ;;
1056                 esac
1057         fi
1058         case ${with_endian} in
1059         big|little)             ;;
1060         *)      echo "with_endian=${with_endian} not supported."; exit 1 ;;
1061         esac
1062         case ${with_endian} in
1063         big*)   tm_file="arc/big.h ${tm_file}"
1064         esac
1065         ;;
1066 arm-wrs-vxworks|arm-wrs-vxworks7)
1067         extra_options="${extra_options} arm/vxworks.opt"
1068         tmake_file="${tmake_file} arm/t-arm arm/t-vxworks"
1069         case $target in
1070         *-vxworks7)
1071             # VxWorks7 on ARM adheres to the ARM Base Platform ABI
1072             tmake_file="${tmake_file} arm/t-bpabi"
1073             tm_file="arm/bpabi.h ${tm_file}"
1074             # The BPABI long long divmod functions return a 128-bit value in
1075             # registers r0-r3.
1076             need_64bit_hwint=yes
1077             default_use_cxa_atexit=yes
1078             ;;
1079         *)  ;;
1080         esac
1081         tm_file="elfos.h arm/elf.h arm/aout.h ${tm_file} vx-common.h vxworks.h arm/vxworks.h"
1082         target_cpu_cname="arm8"
1083         ;;
1084 arm*-*-freebsd*)                # ARM FreeBSD EABI
1085         tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h"
1086         case $target in
1087         arm*b-*-freebsd*)
1088             tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1089             ;;
1090         esac
1091         tmake_file="${tmake_file} arm/t-arm arm/t-bpabi"
1092         tm_file="${tm_file} arm/bpabi.h arm/freebsd.h arm/aout.h arm/arm.h"
1093         case $target in
1094         armv6*-*-freebsd*)
1095             target_cpu_cname="arm1176jzf-s"
1096             tm_defines="${tm_defines} TARGET_FREEBSD_ARMv6=1"
1097             if test $fbsd_major -ge 11; then
1098                tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
1099             fi
1100             ;;
1101         *)
1102             target_cpu_cname="arm9"
1103             ;;
1104         esac
1105         with_tls=${with_tls:-gnu}
1106         ;;
1107 arm*-*-netbsdelf*)
1108         tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
1109         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1110         tmake_file="${tmake_file} arm/t-arm"
1111         target_cpu_cname="arm6"
1112         ;;
1113 arm*-*-linux-*)                 # ARM GNU/Linux with ELF
1114         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
1115         extra_options="${extra_options} linux-android.opt"
1116         case $target in
1117         arm*b-*-linux*)
1118             tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1119             ;;
1120         esac
1121         tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
1122         tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h vxworks-dummy.h arm/arm.h"
1123         target_cpu_cname="arm10tdmi"
1124         # Define multilib configuration for arm-linux-androideabi.
1125         case ${target} in
1126         *-androideabi)
1127             tmake_file="$tmake_file arm/t-linux-androideabi"
1128             ;;
1129         esac
1130         # The EABI requires the use of __cxa_atexit.
1131         default_use_cxa_atexit=yes
1132         with_tls=${with_tls:-gnu}
1133         ;;
1134 arm*-*-uclinux*eabi*)           # ARM ucLinux
1135         tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
1136         tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi"
1137         tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h arm/aout.h vxworks-dummy.h arm/arm.h"
1138         target_cpu_cname="arm7tdmi"
1139         # The EABI requires the use of __cxa_atexit.
1140         default_use_cxa_atexit=yes
1141         ;;
1142 arm*-*-phoenix*)
1143         tm_file="elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
1144         tm_file="${tm_file} newlib-stdint.h phoenix.h"
1145         tm_file="${tm_file} arm/aout.h arm/arm.h"
1146         tmake_file="${tmake_file} arm/t-arm arm/t-bpabi arm/t-phoenix"
1147         target_cpu_cname="arm7tdmi"
1148         ;;
1149 arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*)
1150         case ${target} in
1151         arm*eb-*-eabi*)
1152           tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1153         esac
1154         default_use_cxa_atexit=yes
1155         tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
1156         tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf"
1157         target_cpu_cname="arm7tdmi"
1158         case ${target} in
1159         arm*-*-eabi*)
1160           tm_file="$tm_file newlib-stdint.h"
1161           tmake_file="${tmake_file} arm/t-bpabi"
1162           use_gcc_stdint=wrap
1163           ;;
1164         arm*-*-fuchsia*)
1165           tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
1166           tmake_file="${tmake_file} arm/t-bpabi arm/t-fuchsia"
1167           target_cpu_cname="generic-armv7-a"
1168           ;;
1169         arm*-*-rtems*)
1170           tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h"
1171           tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems"
1172           ;;
1173         arm*-*-symbianelf*)
1174           tm_file="${tm_file} arm/symbian.h"
1175           # We do not include t-bpabi for Symbian OS because the system
1176           # provides its own implementation of the BPABI functions.
1177           tmake_file="${tmake_file} arm/t-symbian"
1178           target_cpu_cname="arm10tdmi"
1179           ;;
1180         esac
1181         tm_file="${tm_file} arm/aout.h vxworks-dummy.h arm/arm.h"
1182         ;;
1183 avr-*-*)
1184         tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h avr/specs.h dbxelf.h avr/avr-stdint.h"
1185         if test x${with_avrlibc} != xno; then
1186             tm_file="${tm_file} ${cpu_type}/avrlibc.h"
1187             tm_defines="${tm_defines} WITH_AVRLIBC"
1188         fi
1189         tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
1190         use_gcc_stdint=wrap
1191         extra_gcc_objs="driver-avr.o avr-devices.o"
1192         extra_objs="avr-devices.o avr-log.o"
1193         ;;
1194 bfin*-elf*)
1195         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
1196         tmake_file=bfin/t-bfin-elf
1197         use_collect2=no
1198         ;;
1199 bfin*-uclinux*)
1200         tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/uclinux.h"
1201         tmake_file=bfin/t-bfin-uclinux
1202         use_collect2=no
1203         ;;
1204 bfin*-linux-uclibc*)
1205         tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
1206         tmake_file="${tmake_file} bfin/t-bfin-linux"
1207         use_collect2=no
1208         ;;
1209 bfin*-rtems*)
1210         tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h newlib-stdint.h"
1211         tmake_file="${tmake_file} bfin/t-rtems"
1212         ;;
1213 bfin*-*)
1214         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
1215         use_collect2=no
1216         use_gcc_stdint=wrap
1217         ;;
1218 cr16-*-elf)
1219         tm_file="elfos.h ${tm_file} newlib-stdint.h"
1220         tmake_file="${tmake_file} cr16/t-cr16 "
1221         use_collect2=no
1222         ;;
1223 crisv32-*-elf | crisv32-*-none)
1224         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1225         tmake_file="cris/t-cris"
1226         target_cpu_default=32
1227         gas=yes
1228         extra_options="${extra_options} cris/elf.opt"
1229         use_gcc_stdint=wrap
1230         ;;
1231 cris-*-elf | cris-*-none)
1232         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1233         tmake_file="cris/t-cris cris/t-elfmulti"
1234         gas=yes
1235         extra_options="${extra_options} cris/elf.opt"
1236         use_gcc_stdint=wrap
1237         ;;
1238 crisv32-*-linux* | cris-*-linux*)
1239         tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h cris/linux.h"
1240         tmake_file="${tmake_file} cris/t-cris cris/t-linux"
1241         extra_options="${extra_options} cris/linux.opt"
1242         case $target in
1243           cris-*-*)
1244                 target_cpu_default=10
1245                 ;;
1246           crisv32-*-*)
1247                 target_cpu_default=32
1248                 ;;
1249         esac
1250         ;;
1251 epiphany-*-elf )
1252         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1253         tmake_file="epiphany/t-epiphany"
1254         extra_options="${extra_options} fused-madd.opt"
1255         extra_objs="$extra_objs mode-switch-use.o resolve-sw-modes.o"
1256         tm_defines="${tm_defines} EPIPHANY_STACK_OFFSET=${with_stack_offset:-8}"
1257         extra_headers="epiphany_intrinsics.h"
1258         ;;
1259 fr30-*-elf)
1260         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1261         ;;
1262 frv-*-elf)
1263         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1264         tmake_file=frv/t-frv
1265         ;;
1266 frv-*-*linux*)
1267         tm_file="dbxelf.h elfos.h ${tm_file} \
1268                  gnu-user.h linux.h glibc-stdint.h frv/linux.h"
1269         tmake_file="${tmake_file} frv/t-frv frv/t-linux"
1270         ;;
1271 ft32-*-elf)
1272         gas=yes
1273         gnu_ld=yes
1274         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1275         tmake_file="${tmake_file} ft32/t-ft32"
1276         ;;
1277 moxie-*-elf)
1278         gas=yes
1279         gnu_ld=yes
1280         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1281         tmake_file="${tmake_file} moxie/t-moxie"
1282         ;;
1283 moxie-*-uclinux*)
1284         gas=yes
1285         gnu_ld=yes
1286         tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
1287         tmake_file="${tmake_file} moxie/t-moxie"
1288         ;;
1289 moxie-*-rtems*)
1290         tmake_file="${tmake_file} moxie/t-moxie"
1291         tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
1292         ;;
1293 moxie-*-moxiebox*)
1294         gas=yes
1295         gnu_ld=yes
1296         tm_file="${tm_file} dbxelf.h elfos.h moxie/moxiebox.h newlib-stdint.h"
1297         tmake_file="${tmake_file} moxie/t-moxiebox"
1298         ;;
1299 h8300-*-elf*)
1300         tmake_file="h8300/t-h8300"
1301         tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
1302         ;;
1303 h8300-*-linux*)
1304         tmake_file="${tmake_file} h8300/t-h8300 h8300/t-linux"
1305         tm_file="h8300/h8300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h h8300/linux.h"
1306         ;;
1307 hppa*64*-*-linux*)
1308         target_cpu_default="MASK_PA_11|MASK_PA_20"
1309         tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
1310                  glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
1311                  pa/pa64-linux.h"
1312         gas=yes gnu_ld=yes
1313         ;;
1314 hppa*-*-linux*)
1315         target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
1316         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h pa/pa-linux.h \
1317                  pa/pa32-regs.h pa/pa32-linux.h"
1318         tmake_file="${tmake_file} pa/t-linux"
1319         ;;
1320 hppa*-*-openbsd*)
1321         target_cpu_default="MASK_PA_11"
1322         tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-stdint.h openbsd-libpthread.h \
1323                  pa/pa-openbsd.h pa/pa32-regs.h pa/pa32-openbsd.h"
1324         extra_options="${extra_options} openbsd.opt"
1325         gas=yes
1326         gnu_ld=yes
1327         ;;
1328 hppa[12]*-*-hpux10*)
1329         case ${target} in
1330         hppa1.1-*-* | hppa2*-*-*)
1331                 target_cpu_default="MASK_PA_11"
1332                 ;;
1333         esac
1334         tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
1335                  pa/pa-hpux.h pa/pa-hpux10.h"
1336         extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux10.opt"
1337         case ${target} in
1338         *-*-hpux10.[1-9]*)
1339                 tm_file="${tm_file} pa/pa-hpux1010.h"
1340                 extra_options="${extra_options} pa/pa-hpux1010.opt"
1341                 ;;
1342         esac
1343         use_gcc_stdint=provide
1344         tm_file="${tm_file} hpux-stdint.h"
1345         tmake_file="t-slibgcc"
1346         case ${enable_threads} in
1347           "")
1348             if test x$have_pthread_h = xyes ; then
1349               tmake_file="${tmake_file} pa/t-dce-thr"
1350             fi
1351             ;;
1352           yes | dce)
1353             tmake_file="${tmake_file} pa/t-dce-thr"
1354             ;;
1355         esac
1356         use_collect2=yes
1357         gas=yes
1358         if test "x$with_dwarf2" != x; then
1359                 echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
1360                 dwarf2=no
1361         fi
1362         ;;
1363 hppa*64*-*-hpux11*)
1364         target_cpu_default="MASK_PA_11|MASK_PA_20"
1365         if test x$gnu_ld = xyes
1366         then
1367                 target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
1368         fi
1369         tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \
1370                  pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \
1371                  pa/pa-hpux11.h"
1372         case ${target} in
1373         *-*-hpux11.[12]*)
1374                 tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h"
1375                 extra_options="${extra_options} pa/pa-hpux1111.opt"
1376                 ;;
1377         *-*-hpux11.[3-9]*)
1378                 tm_file="${tm_file} pa/pa-hpux1131.h pa/pa-64.h pa/pa64-hpux.h"
1379                 extra_options="${extra_options} pa/pa-hpux1131.opt"
1380                 ;;
1381         *)
1382                 tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h"
1383                 ;;
1384         esac
1385         extra_options="${extra_options} pa/pa-hpux.opt \
1386                        pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
1387         tmake_file="t-slibgcc"
1388         case x${enable_threads} in
1389         x | xyes | xposix )
1390                 thread_file=posix
1391                 ;;
1392         esac
1393         gas=yes
1394         case ${target} in
1395           *-*-hpux11.[01]*)
1396                 use_gcc_stdint=provide
1397                 tm_file="${tm_file} hpux-stdint.h"
1398                 ;;
1399           *-*-hpux11.[23]*)
1400                 use_gcc_stdint=wrap
1401                 tm_file="${tm_file} hpux-stdint.h"
1402                 ;;
1403         esac
1404         ;;
1405 hppa[12]*-*-hpux11*)
1406         case ${target} in
1407         hppa1.1-*-* | hppa2*-*-*)
1408                 target_cpu_default="MASK_PA_11"
1409                 ;;
1410         esac
1411         tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
1412                  pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h"
1413         extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt \
1414                        hpux11.opt"
1415         case ${target} in
1416         *-*-hpux11.[12]*)
1417                 tm_file="${tm_file} pa/pa-hpux1111.h"
1418                 extra_options="${extra_options} pa/pa-hpux1111.opt"
1419                 ;;
1420         *-*-hpux11.[3-9]*)
1421                 tm_file="${tm_file} pa/pa-hpux1131.h"
1422                 extra_options="${extra_options} pa/pa-hpux1131.opt"
1423                 ;;
1424         esac
1425         tmake_file="t-slibgcc"
1426         case x${enable_threads} in
1427         x | xyes | xposix )
1428                 thread_file=posix
1429                 ;;
1430         esac
1431         use_collect2=yes
1432         gas=yes
1433         case ${target} in
1434           *-*-hpux11.[01]*)
1435                 use_gcc_stdint=provide
1436                 tm_file="${tm_file} hpux-stdint.h"
1437                 ;;
1438           *-*-hpux11.[23]*)
1439                 use_gcc_stdint=wrap
1440                 tm_file="${tm_file} hpux-stdint.h"
1441                 ;;
1442         esac
1443         if test "x$with_dwarf2" != x; then
1444                 echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
1445                 dwarf2=no
1446         fi
1447         ;;
1448 i[34567]86-*-darwin*)
1449         need_64bit_isa=yes
1450         # Baseline choice for a machine that allows m64 support.
1451         with_cpu=${with_cpu:-core2}
1452         tmake_file="${tmake_file} t-slibgcc"
1453         ;;
1454 x86_64-*-darwin*)
1455         with_cpu=${with_cpu:-core2}
1456         tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
1457         tm_file="${tm_file} ${cpu_type}/darwin64.h"
1458         ;;
1459 i[34567]86-*-elfiamcu)
1460         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
1461         ;;
1462 i[34567]86-*-elf*)
1463         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
1464         ;;
1465 x86_64-*-elf*)
1466         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
1467         ;;
1468 x86_64-*-rtems*)
1469         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rtemself.h"
1470         ;;
1471 i[34567]86-*-rdos*)
1472     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/rdos.h"
1473     ;;
1474 x86_64-*-rdos*)
1475     tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h i386/rdos.h i386/rdos64.h"
1476     tmake_file="i386/t-i386elf t-svr4"
1477     ;;
1478 i[34567]86-*-dragonfly*)
1479         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
1480         tmake_file="${tmake_file} i386/t-crtstuff"
1481         ;;
1482 x86_64-*-dragonfly*)
1483         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h"
1484         tmake_file="${tmake_file} i386/t-crtstuff"
1485         ;;
1486 i[34567]86-*-freebsd*)
1487         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
1488         ;;
1489 x86_64-*-freebsd*)
1490         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
1491         ;;
1492 i[34567]86-*-netbsdelf*)
1493         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
1494         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1495         ;;
1496 x86_64-*-netbsd*)
1497         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h"
1498         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1499         ;;
1500 i[34567]86-*-openbsd*)
1501         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
1502         tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
1503         extra_options="${extra_options} openbsd.opt"
1504         gas=yes
1505         gnu_ld=yes
1506         ;;
1507 x86_64-*-openbsd*)
1508         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
1509         tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/x86-64.h i386/openbsdelf.h"
1510         extra_options="${extra_options} openbsd.opt"
1511         gas=yes
1512         gnu_ld=yes
1513         ;;
1514 i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
1515                         # Intel 80386's running GNU/*
1516                         # with ELF format using glibc 2
1517         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h"
1518         case ${target} in
1519         i[34567]86-*-linux*)
1520                 tm_file="${tm_file} linux.h linux-android.h"
1521                 extra_options="${extra_options} linux-android.opt"
1522                 if test x$enable_targets = xall; then
1523                         tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux-common.h i386/linux64.h"
1524                         tm_defines="${tm_defines} TARGET_BI_ARCH=1"
1525                         tmake_file="${tmake_file} i386/t-linux64"
1526                         x86_multilibs="${with_multilib_list}"
1527                         if test "$x86_multilibs" = "default"; then
1528                                 x86_multilibs="m64,m32"
1529                         fi
1530                         x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
1531                         for x86_multilib in ${x86_multilibs}; do
1532                                 case ${x86_multilib} in
1533                                 m32 | m64 | mx32)
1534                                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
1535                                         ;;
1536                                 *)
1537                                         echo "--with-multilib-list=${x86_with_multilib} not supported."
1538                                         exit 1
1539                                 esac
1540                         done
1541                         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
1542                         need_64bit_isa=yes
1543                         if test x$with_cpu = x; then
1544                                 if test x$with_cpu_64 = x; then
1545                                         with_cpu_64=generic
1546                                 fi
1547                         else
1548                                 case " $x86_cpus $x86_archs $x86_64_archs " in
1549                                 *" $with_cpu "*)
1550                                         ;;
1551                                 *)
1552                                         echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
1553                                         echo "$x86_cpus $x86_archs $x86_64_archs " 1>&2
1554                                         exit 1
1555                                         ;;
1556                                 esac
1557                         fi
1558                 else
1559                         tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux-common.h i386/linux.h"
1560                 fi
1561                 ;;
1562         i[34567]86-*-kfreebsd*-gnu)
1563                 tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kfreebsd-gnu.h i386/kfreebsd-gnu.h"
1564                 ;;
1565         i[34567]86-*-kopensolaris*-gnu)
1566                 tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h"
1567                 ;;
1568         i[34567]86-*-gnu*)
1569                 tm_file="$tm_file i386/gnu-user-common.h i386/gnu-user.h gnu.h i386/gnu.h"
1570                 ;;
1571         esac
1572         ;;
1573 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu)
1574         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
1575                  i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h"
1576         case ${target} in
1577         x86_64-*-linux*)
1578                 tm_file="${tm_file} linux.h linux-android.h i386/linux-common.h i386/linux64.h"
1579                 extra_options="${extra_options} linux-android.opt"
1580                 ;;
1581         x86_64-*-kfreebsd*-gnu)
1582                 tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu64.h"
1583                 ;;
1584         esac
1585         tmake_file="${tmake_file} i386/t-linux64"
1586         x86_multilibs="${with_multilib_list}"
1587         if test "$x86_multilibs" = "default"; then
1588                 case ${with_abi} in
1589                 x32 | mx32)
1590                         x86_multilibs="mx32"
1591                         ;;
1592                 *)
1593                         x86_multilibs="m64,m32"
1594                         ;;
1595                 esac
1596         fi
1597         x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
1598         for x86_multilib in ${x86_multilibs}; do
1599                 case ${x86_multilib} in
1600                 m32 | m64 | mx32)
1601                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
1602                         ;;
1603                 *)
1604                         echo "--with-multilib-list=${x86_with_multilib} not supported."
1605                         exit 1
1606                 esac
1607         done
1608         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
1609         ;;
1610 i[34567]86-pc-msdosdjgpp*)
1611         xm_file=i386/xm-djgpp.h
1612         tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
1613         native_system_header_dir=/dev/env/DJDIR/include
1614         extra_options="${extra_options} i386/djgpp.opt"
1615         gnu_ld=yes
1616         gas=yes
1617         use_gcc_stdint=wrap
1618         ;;
1619 i[34567]86-*-lynxos*)
1620         xm_defines=POSIX
1621         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h"
1622         tmake_file="${tmake_file} t-lynx"
1623         extra_options="${extra_options} lynx.opt"
1624         thread_file=lynx
1625         gnu_ld=yes
1626         gas=yes
1627         ;;
1628 i[34567]86-*-nto-qnx*)
1629         tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
1630         extra_options="${extra_options} i386/nto.opt"
1631         gnu_ld=yes
1632         gas=yes
1633         ;;
1634 i[34567]86-*-rtems*)
1635         tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h i386/rtemself.h rtems.h newlib-stdint.h"
1636         tmake_file="${tmake_file} i386/t-rtems"
1637         ;;
1638 i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
1639         # Set default arch_32 to pentium4, tune_32 to generic like the other
1640         # i386 targets, although config.guess defaults to i386-pc-solaris2*.
1641         with_arch_32=${with_arch_32:-pentium4}
1642         with_tune_32=${with_tune_32:-generic}
1643         tm_file="${tm_file} i386/unix.h i386/att.h ${sol2_tm_file_head} i386/x86-64.h ${sol2_tm_file_tail}"
1644         tm_defines="${tm_defines} TARGET_BI_ARCH=1"
1645         tmake_file="$tmake_file i386/t-sol2"
1646         need_64bit_isa=yes
1647         if test x$with_cpu = x; then
1648                 if test x$with_cpu_64 = x; then
1649                         with_cpu_64=generic
1650                 fi
1651         else
1652                 case " $x86_cpus $x86_archs $x86_64_archs " in
1653                 *" $with_cpu "*)
1654                         ;;
1655                 *)
1656                         echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
1657                         echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
1658                         exit 1
1659                         ;;
1660                 esac
1661         fi
1662         ;;
1663 i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae|i[4567]86-wrs-vxworks7|x86_64-wrs-vxworks7)
1664         tm_file="${tm_file} i386/unix.h i386/att.h elfos.h"
1665         case ${target} in
1666           x86_64-*)
1667             need_64bit_isa=yes
1668             tm_file="${tm_file} i386/x86-64.h"
1669             ;;
1670         esac
1671         tm_file="${tm_file} vx-common.h"
1672         case ${target} in
1673           *-vxworksae*)
1674             tm_file="${tm_file} vxworksae.h i386/vxworks.h i386/vxworksae.h"
1675             tmake_file="${tmake_file} i386/t-vxworks i386/t-vxworksae"
1676             ;;
1677           *)
1678             tm_file="${tm_file} vxworks.h i386/vxworks.h"
1679             tmake_file="${tmake_file} i386/t-vxworks"
1680             ;;
1681         esac
1682         ;;
1683 i[34567]86-*-cygwin*)
1684         tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h i386/cygwin-stdint.h"
1685         xm_file=i386/xm-cygwin.h
1686         tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
1687         target_gtfiles="\$(srcdir)/config/i386/winnt.c"
1688         extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
1689         extra_objs="winnt.o winnt-stubs.o"
1690         c_target_objs="${c_target_objs} msformat-c.o"
1691         cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
1692         if test x$enable_threads = xyes; then
1693                 thread_file='posix'
1694         fi
1695         default_use_cxa_atexit=yes
1696         use_gcc_stdint=wrap
1697         ;;
1698 x86_64-*-cygwin*)
1699         need_64bit_isa=yes
1700         tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h i386/cygwin-w64.h i386/cygwin-stdint.h"
1701         xm_file=i386/xm-cygwin.h
1702         tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64"
1703         target_gtfiles="\$(srcdir)/config/i386/winnt.c"
1704         extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
1705         extra_objs="winnt.o winnt-stubs.o"
1706         c_target_objs="${c_target_objs} msformat-c.o"
1707         cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
1708         if test x$enable_threads = xyes; then
1709                 thread_file='posix'
1710         fi
1711         default_use_cxa_atexit=yes
1712         use_gcc_stdint=wrap
1713         tm_defines="${tm_defines} TARGET_CYGWIN64=1"
1714         ;;
1715 i[34567]86-*-mingw* | x86_64-*-mingw*)
1716         tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h"
1717         xm_file=i386/xm-mingw32.h
1718         c_target_objs="${c_target_objs} winnt-c.o"
1719         cxx_target_objs="${cxx_target_objs} winnt-c.o"
1720         target_has_targetcm="yes"
1721         case ${target} in
1722                 x86_64-*-* | *-w64-*)
1723                         need_64bit_isa=yes
1724                         ;;
1725                 *)
1726                         ;;
1727         esac
1728         if test x$enable_threads = xposix ; then
1729                 tm_file="${tm_file} i386/mingw-pthread.h"
1730         fi
1731         tm_file="${tm_file} i386/mingw32.h"
1732         # This makes the logic if mingw's or the w64 feature set has to be used
1733         case ${target} in
1734                 *-w64-*)
1735                         user_headers_inc_next_post="${user_headers_inc_next_post} float.h"
1736                         user_headers_inc_next_pre="${user_headers_inc_next_pre} stddef.h stdarg.h"
1737                         tm_file="${tm_file} i386/mingw-w64.h"
1738                         if test x$enable_targets = xall; then
1739                                 tm_defines="${tm_defines} TARGET_BI_ARCH=1"
1740                                 if test x$with_cpu = x; then
1741                                         if test x$with_cpu_64 = x; then
1742                                                 with_cpu_64=generic
1743                                         fi
1744                                 else
1745                                         case " $x86_cpus $x86_archs $x86_64_archs " in
1746                                         *" $with_cpu "*)
1747                                                 ;;
1748                                         *)
1749                                                 echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
1750                                                 echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
1751                                                 exit 1
1752                                                 ;;
1753                                         esac
1754                                 fi
1755                         fi
1756                         ;;
1757                 *)
1758                         ;;
1759         esac
1760         tm_file="${tm_file} i386/mingw-stdint.h"
1761         tmake_file="${tmake_file} t-winnt i386/t-cygming t-slibgcc"
1762         case ${target} in
1763                x86_64-w64-*)
1764                         tmake_file="${tmake_file} i386/t-mingw-w64"
1765                         ;;
1766                i[34567]86-w64-*)
1767                         tmake_file="${tmake_file} i386/t-mingw-w32"
1768                         ;;
1769         esac
1770         native_system_header_dir=/mingw/include
1771         target_gtfiles="\$(srcdir)/config/i386/winnt.c"
1772         extra_options="${extra_options} i386/cygming.opt i386/mingw.opt"
1773         case ${target} in
1774                 *-w64-*)
1775                         extra_options="${extra_options} i386/mingw-w64.opt"
1776                         ;;
1777                 *)
1778                         ;;
1779         esac
1780         extra_objs="winnt.o winnt-stubs.o"
1781         c_target_objs="${c_target_objs} msformat-c.o"
1782         cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
1783         gas=yes
1784         gnu_ld=yes
1785         default_use_cxa_atexit=yes
1786         use_gcc_stdint=wrap
1787         case ${enable_threads} in
1788           "" | yes | win32)
1789             thread_file='win32'
1790             ;;
1791           posix)
1792             thread_file='posix'
1793             ;;
1794         esac
1795         case ${target} in
1796                 *mingw32crt*)
1797                         tm_file="${tm_file} i386/crtdll.h"
1798                         ;;
1799                 *mingw32msv* | *mingw*)
1800                         ;;
1801         esac
1802         ;;
1803 x86_64-*-fuchsia*)
1804         tmake_file="${tmake_file} i386/t-x86_64-elf"
1805         tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h fuchsia.h"
1806         ;;
1807 ia64*-*-elf*)
1808         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h ia64/sysv4.h ia64/elf.h"
1809         tmake_file="ia64/t-ia64"
1810         target_cpu_default="0"
1811         if test x$gas = xyes
1812         then
1813                 target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
1814         fi
1815         if test x$gnu_ld = xyes
1816         then
1817                 target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
1818         fi
1819         ;;
1820 ia64*-*-freebsd*)
1821         tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
1822         target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
1823         tmake_file="${tmake_file} ia64/t-ia64"
1824         ;;
1825 ia64*-*-linux*)
1826         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
1827         tmake_file="${tmake_file} ia64/t-ia64 ia64/t-linux t-libunwind"
1828         target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
1829         ;;
1830 ia64*-*-hpux*)
1831         tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/hpux.h"
1832         tmake_file="ia64/t-ia64 ia64/t-hpux t-slibgcc"
1833         target_cpu_default="MASK_GNU_AS"
1834         case x$enable_threads in
1835         x | xyes | xposix )
1836                 thread_file=posix
1837                 ;;
1838         esac
1839         use_collect2=no
1840         c_target_objs="ia64-c.o"
1841         cxx_target_objs="ia64-c.o"
1842         extra_options="${extra_options} ia64/ilp32.opt hpux11.opt"
1843         use_gcc_stdint=wrap
1844         tm_file="${tm_file} hpux-stdint.h"
1845         case ${target} in
1846         *-*-hpux11.3*)
1847                 tm_file="${tm_file} ia64/hpux-unix2003.h"
1848                 ;;
1849         esac
1850         ;;
1851 ia64-hp-*vms*)
1852         tm_file="${tm_file} elfos.h ia64/sysv4.h vms/vms.h ia64/vms.h"
1853         tmake_file="${tmake_file} ia64/t-ia64"
1854         target_cpu_default="0"
1855         if test x$gas = xyes
1856         then
1857                 target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
1858         fi
1859         extra_options="${extra_options} ia64/vms.opt"
1860         ;;
1861 iq2000*-*-elf*)
1862         tm_file="elfos.h newlib-stdint.h iq2000/iq2000.h"
1863         out_file=iq2000/iq2000.c
1864         md_file=iq2000/iq2000.md
1865         ;;
1866 lm32-*-elf*)
1867         tm_file="dbxelf.h elfos.h ${tm_file} newlib-stdint.h"
1868         tmake_file="${tmake_file} lm32/t-lm32"
1869         ;;
1870 lm32-*-rtems*)
1871         tm_file="dbxelf.h elfos.h ${tm_file} lm32/rtems.h rtems.h newlib-stdint.h"
1872         tmake_file="${tmake_file} lm32/t-lm32"
1873         tmake_file="${tmake_file} lm32/t-rtems"
1874          ;;
1875 lm32-*-uclinux*)
1876         tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h lm32/uclinux-elf.h"
1877         tmake_file="${tmake_file} lm32/t-lm32"
1878         ;;
1879 m32r-*-elf*)
1880         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1881         ;;
1882 m32rle-*-elf*)
1883         tm_file="dbxelf.h elfos.h newlib-stdint.h m32r/little.h ${tm_file}"
1884         ;;
1885 m32r-*-linux*)
1886         tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} m32r/linux.h"
1887         tmake_file="${tmake_file} m32r/t-linux t-slibgcc"
1888         gnu_ld=yes
1889         if test x$enable_threads = xyes; then
1890                 thread_file='posix'
1891         fi
1892         ;;
1893 m32rle-*-linux*)
1894         tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m32r/little.h ${tm_file} m32r/linux.h"
1895         tmake_file="${tmake_file} m32r/t-linux t-slibgcc"
1896         gnu_ld=yes
1897         if test x$enable_threads = xyes; then
1898                 thread_file='posix'
1899         fi
1900         ;;
1901 m68k-*-elf* | fido-*-elf*)
1902         case ${target} in
1903         fido-*-elf*)
1904                 # Check that $with_cpu makes sense.
1905                 case $with_cpu in
1906                 "" | "fidoa")
1907                         ;;
1908                 *)
1909                         echo "Cannot accept --with-cpu=$with_cpu"
1910                         exit 1
1911                         ;;
1912                 esac
1913                 with_cpu=fidoa
1914                 ;;
1915         *)
1916                 default_m68k_cpu=68020
1917                 default_cf_cpu=5206
1918                 ;;
1919         esac
1920         tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h newlib-stdint.h m68k/m68kemb.h m68k/m68020-elf.h"
1921         tm_defines="${tm_defines} MOTOROLA=1"
1922         tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
1923         # Add multilibs for targets other than fido.
1924         case ${target} in
1925         fido-*-elf*)
1926                 ;;
1927         *)
1928                 tmake_file="$tmake_file m68k/t-mlibs"
1929                 ;;
1930         esac
1931         ;;
1932 m68k*-*-netbsdelf*)
1933         default_m68k_cpu=68020
1934         default_cf_cpu=5475
1935         tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} m68k/netbsd-elf.h"
1936         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1937         tm_defines="${tm_defines} MOTOROLA=1 CHAR_FAST8=1 SHORT_FAST16=1"
1938         ;;
1939 m68k*-*-openbsd*)
1940         default_m68k_cpu=68020
1941         default_cf_cpu=5475
1942         # needed to unconfuse gdb
1943         tm_defines="${tm_defines} OBSD_OLD_GAS"
1944         tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h m68k/openbsd.h"
1945         extra_options="${extra_options} openbsd.opt"
1946         tmake_file="t-openbsd m68k/t-openbsd"
1947         # we need collect2 until our bug is fixed...
1948         use_collect2=yes
1949         ;;
1950 m68k-*-uclinux*)                # Motorola m68k/ColdFire running uClinux
1951                                 # with uClibc, using the new GNU/Linux-style
1952                                 # ABI.
1953         default_m68k_cpu=68020
1954         default_cf_cpu=5206
1955         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
1956         extra_options="${extra_options} m68k/uclinux.opt"
1957         tm_defines="${tm_defines} MOTOROLA=1"
1958         tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
1959         ;;
1960 m68k-*-linux*)                  # Motorola m68k's running GNU/Linux
1961                                 # with ELF format using glibc 2
1962                                 # aka the GNU/Linux C library 6.
1963         default_m68k_cpu=68020
1964         default_cf_cpu=5475
1965         with_arch=${with_arch:-m68k}
1966         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h ./sysroot-suffix.h"
1967         extra_options="${extra_options} m68k/ieee.opt"
1968         tm_defines="${tm_defines} MOTOROLA=1"
1969         tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs"
1970         ;;
1971 m68k-*-rtems*)
1972         default_m68k_cpu=68020
1973         default_cf_cpu=5206
1974         tmake_file="${tmake_file} m68k/t-floatlib m68k/t-m68kbare m68k/t-crtstuff m68k/t-rtems m68k/t-mlibs"
1975         tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h"
1976         tm_defines="${tm_defines} MOTOROLA=1"
1977         ;;
1978 mcore-*-elf)
1979         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
1980         tmake_file=mcore/t-mcore
1981         inhibit_libc=true
1982         ;;
1983 microblaze*-linux*)
1984         case $target in
1985                 microblazeel-*)
1986                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
1987                         ;;
1988                 microblaze-*)
1989                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
1990                         ;;
1991         esac
1992         tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
1993         tm_file="${tm_file} glibc-stdint.h"
1994         c_target_objs="${c_target_objs} microblaze-c.o"
1995         cxx_target_objs="${cxx_target_objs} microblaze-c.o"
1996         tmake_file="${tmake_file} microblaze/t-microblaze"
1997         tmake_file="${tmake_file} microblaze/t-microblaze-linux"
1998         ;;
1999 microblaze*-*-rtems*)
2000         case $target in
2001                 microblazeel-*)
2002                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2003                         ;;
2004                 microblaze-*)
2005                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2006                         ;;
2007         esac
2008         tm_file="${tm_file} dbxelf.h"
2009         tm_file="${tm_file} microblaze/rtems.h rtems.h newlib-stdint.h"
2010         c_target_objs="${c_target_objs} microblaze-c.o"
2011         cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2012         tmake_file="${tmake_file} microblaze/t-microblaze"
2013         tmake_file="${tmake_file} microblaze/t-rtems"
2014         ;;
2015 microblaze*-*-elf)
2016         case $target in
2017                 microblazeel-*)
2018                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2019                         ;;
2020                 microblaze-*)
2021                         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2022                         ;;
2023         esac
2024         tm_file="${tm_file} dbxelf.h newlib-stdint.h"
2025         c_target_objs="${c_target_objs} microblaze-c.o"
2026         cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2027         tmake_file="${tmake_file} microblaze/t-microblaze"
2028         ;;
2029 riscv*-*-linux*)
2030         tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h"
2031         case "x${enable_multilib}" in
2032         xno) ;;
2033         xyes) tmake_file="${tmake_file} riscv/t-linux-multilib" ;;
2034         *) echo "Unknown value for enable_multilib"; exit 1
2035         esac
2036         tmake_file="${tmake_file} riscv/t-riscv riscv/t-linux"
2037         gnu_ld=yes
2038         gas=yes
2039         # Force .init_array support.  The configure script cannot always
2040         # automatically detect that GAS supports it, yet we require it.
2041         gcc_cv_initfini_array=yes
2042         ;;
2043 riscv*-*-elf* | riscv*-*-rtems*)
2044         tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h"
2045         case "x${enable_multilib}" in
2046         xno) ;;
2047         xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
2048         *) echo "Unknown value for enable_multilib"; exit 1
2049         esac
2050         tmake_file="${tmake_file} riscv/t-riscv"
2051         gnu_ld=yes
2052         gas=yes
2053         # Force .init_array support.  The configure script cannot always
2054         # automatically detect that GAS supports it, yet we require it.
2055         gcc_cv_initfini_array=yes
2056         case ${target} in
2057         riscv*-*-rtems*)
2058           tm_file="${tm_file} rtems.h riscv/rtems.h"
2059           ;;
2060         esac
2061         ;;
2062 mips*-*-netbsd*)                        # NetBSD/mips, either endian.
2063         target_cpu_default="MASK_ABICALLS"
2064         tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h"
2065         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2066         ;;
2067 mips*-img-linux*)
2068         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
2069         extra_options="${extra_options} linux-android.opt"
2070         tmake_file="${tmake_file} mips/t-img-linux"
2071         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
2072         with_arch_32="mips32r6"
2073         with_arch_64="mips64r6"
2074         gnu_ld=yes
2075         gas=yes
2076         ;;
2077 mips*-mti-linux*)
2078         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
2079         extra_options="${extra_options} linux-android.opt"
2080         tmake_file="${tmake_file} mips/t-mti-linux"
2081         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
2082         with_arch_32="mips32r2"
2083         with_arch_64="mips64r2"
2084         gnu_ld=yes
2085         gas=yes
2086         ;;
2087 mips*-*-linux*)                         # Linux MIPS, either endian.
2088         tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
2089         extra_options="${extra_options} linux-android.opt"
2090         case ${target} in
2091                 mipsisa32r6*)
2092                         default_mips_arch=mips32r6
2093                         ;;
2094                 mipsisa32r2*)
2095                         default_mips_arch=mips32r2
2096                         ;;
2097                 mipsisa32*)
2098                         default_mips_arch=mips32
2099                         ;;
2100                 mips64el-st-linux-gnu)
2101                         default_mips_abi=n32
2102                         tm_file="${tm_file} mips/st.h"
2103                         tmake_file="${tmake_file} mips/t-st"
2104                         enable_mips_multilibs="yes"
2105                         ;;
2106                 mips64octeon*-*-linux*)
2107                         default_mips_abi=n32
2108                         tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
2109                         target_cpu_default=MASK_SOFT_FLOAT_ABI
2110                         enable_mips_multilibs="yes"
2111                         ;;
2112                 mipsisa64r6*-*-linux*)
2113                         default_mips_abi=n32
2114                         default_mips_arch=mips64r6
2115                         enable_mips_multilibs="yes"
2116                         ;;
2117                 mipsisa64r2*-*-linux*)
2118                         default_mips_abi=n32
2119                         default_mips_arch=mips64r2
2120                         enable_mips_multilibs="yes"
2121                         ;;
2122                 mips64*-*-linux* | mipsisa64*-*-linux*)
2123                         default_mips_abi=n32
2124                         enable_mips_multilibs="yes"
2125                         ;;
2126         esac
2127         if test x$enable_targets = xall; then
2128                 enable_mips_multilibs="yes"
2129         fi
2130         if test x$enable_mips_multilibs = xyes; then
2131                 tmake_file="${tmake_file} mips/t-linux64"
2132         fi
2133         ;;
2134 mips*-mti-elf*)
2135         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
2136         tmake_file="mips/t-mti-elf"
2137         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
2138         with_arch_32="mips32r2"
2139         with_arch_64="mips64r2"
2140         ;;
2141 mips*-img-elf*)
2142         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
2143         tmake_file="mips/t-img-elf"
2144         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
2145         with_arch_32="mips32r6"
2146         with_arch_64="mips64r6"
2147         ;;
2148 mips*-sde-elf*)
2149         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h"
2150         tmake_file="mips/t-sde"
2151         extra_options="${extra_options} mips/sde.opt"
2152         case "${with_newlib}" in
2153           yes)
2154             # newlib / libgloss.
2155             ;;
2156           *)
2157             # MIPS toolkit libraries.
2158             tm_file="$tm_file mips/sdemtk.h"
2159             tmake_file="$tmake_file mips/t-sdemtk"
2160             case ${enable_threads} in
2161               "" | yes | mipssde)
2162                 thread_file='mipssde'
2163                 ;;
2164             esac
2165             ;;
2166         esac
2167         case ${target} in
2168           mipsisa32r6*)
2169             tm_defines="MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
2170             ;;
2171           mipsisa32r2*)
2172             tm_defines="MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
2173             ;;
2174           mipsisa32*)
2175             tm_defines="MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_32"
2176             ;;
2177           mipsisa64r6*)
2178             tm_defines="MIPS_ISA_DEFAULT=69 MIPS_ABI_DEFAULT=ABI_N32"
2179             ;;
2180           mipsisa64r2*)
2181             tm_defines="MIPS_ISA_DEFAULT=65 MIPS_ABI_DEFAULT=ABI_N32"
2182             ;;
2183           mipsisa64*)
2184             tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_N32"
2185             ;;
2186         esac
2187         ;;
2188 mipsisa32-*-elf* | mipsisa32el-*-elf* | \
2189 mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
2190 mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \
2191 mipsisa64-*-elf* | mipsisa64el-*-elf* | \
2192 mipsisa64r2-*-elf* | mipsisa64r2el-*-elf* | \
2193 mipsisa64r6-*-elf* | mipsisa64r6el-*-elf*)
2194         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2195         tmake_file="mips/t-isa3264"
2196         case ${target} in
2197           mipsisa32r6*)
2198             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37"
2199             ;;
2200           mipsisa32r2*)
2201             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
2202             ;;
2203           mipsisa32*)
2204             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
2205             ;;
2206           mipsisa64r6*)
2207             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=69"
2208             ;;
2209           mipsisa64r2*)
2210             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
2211             ;;
2212           mipsisa64*)
2213             tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64"
2214             ;;
2215         esac
2216         case ${target} in
2217           mipsisa32*-*-elfoabi*)
2218             tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32"
2219             tm_file="${tm_file} mips/elfoabi.h"
2220             ;;
2221           mipsisa64*-*-elfoabi*)
2222             tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_O64"
2223             tm_file="${tm_file} mips/elfoabi.h"
2224             ;;
2225           *-*-elf*)
2226             tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI"
2227             ;;
2228         esac
2229         ;;
2230 mipsisa64sr71k-*-elf*)
2231         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2232         tmake_file=mips/t-sr71k
2233         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI"
2234         ;;
2235 mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
2236         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2237         tmake_file="mips/t-elf mips/t-sb1"
2238         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
2239         ;;
2240 mips-*-elf* | mipsel-*-elf* | mipsr5900-*-elf* | mipsr5900el-*-elf*)
2241         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2242         tmake_file="mips/t-elf"
2243         ;;
2244 mips64r5900-*-elf* | mips64r5900el-*-elf*)
2245         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h"
2246         tmake_file="mips/t-elf"
2247         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
2248         ;;
2249 mips64-*-elf* | mips64el-*-elf*)
2250         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2251         tmake_file="mips/t-elf"
2252         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
2253         ;;
2254 mips64vr-*-elf* | mips64vrel-*-elf*)
2255         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/vr.h mips/elf.h"
2256         tmake_file=mips/t-vr
2257         tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI"
2258         ;;
2259 mips64orion-*-elf* | mips64orionel-*-elf*)
2260         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elforion.h mips/elf.h"
2261         tmake_file="mips/t-elf"
2262         tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
2263         ;;
2264 mips*-*-rtems*)
2265         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
2266         tmake_file="${tmake_file} mips/t-elf mips/t-rtems"
2267         ;;
2268 mips-wrs-vxworks)
2269         tm_file="elfos.h ${tm_file} mips/elf.h vx-common.h vxworks.h mips/vxworks.h"
2270         tmake_file="${tmake_file} mips/t-vxworks"
2271         ;;
2272 mipstx39-*-elf* | mipstx39el-*-elf*)
2273         tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h"
2274         tmake_file="mips/t-r3900"
2275         ;;
2276 mmix-knuth-mmixware)
2277         tm_file="${tm_file} newlib-stdint.h"
2278         use_gcc_stdint=wrap
2279         ;;
2280 mn10300-*-*)
2281         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2282         if test x$stabs = xyes
2283         then
2284                 tm_file="${tm_file} dbx.h"
2285         fi
2286         use_collect2=no
2287         use_gcc_stdint=wrap
2288         ;;
2289 msp430*-*-*)
2290         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2291         c_target_objs="msp430-c.o"
2292         cxx_target_objs="msp430-c.o"
2293         tmake_file="${tmake_file} msp430/t-msp430"
2294         extra_gcc_objs="driver-msp430.o"
2295         ;;
2296 nds32le-*-*)
2297         target_cpu_default="0"
2298         tm_defines="${tm_defines}"
2299         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2300         tmake_file="nds32/t-nds32 nds32/t-mlibs"
2301         ;;
2302 nds32be-*-*)
2303         target_cpu_default="0|MASK_BIG_ENDIAN"
2304         tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
2305         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2306         tmake_file="nds32/t-nds32 nds32/t-mlibs"
2307         ;;
2308 nios2-*-*)
2309         tm_file="elfos.h ${tm_file}"
2310         tmake_file="${tmake_file} nios2/t-nios2"
2311         case ${target} in
2312         nios2-*-linux*)
2313                 tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h nios2/linux.h "
2314                 ;;
2315         nios2-*-elf*)
2316                 tm_file="${tm_file} newlib-stdint.h nios2/elf.h"
2317                 extra_options="${extra_options} nios2/elf.opt"
2318                 ;;
2319         nios2-*-rtems*)
2320                 tm_file="${tm_file} newlib-stdint.h nios2/rtems.h rtems.h"
2321                 tmake_file="${tmake_file} t-rtems nios2/t-rtems"
2322                 ;;
2323         esac
2324         ;;
2325 nvptx-*)
2326         tm_file="${tm_file} newlib-stdint.h"
2327         tmake_file="nvptx/t-nvptx"
2328         if test x$enable_as_accelerator = xyes; then
2329                 extra_programs="${extra_programs} mkoffload\$(exeext)"
2330                 tm_file="${tm_file} nvptx/offload.h"
2331         fi
2332         ;;
2333 pdp11-*-*)
2334         tm_file="${tm_file} newlib-stdint.h"
2335         use_gcc_stdint=wrap
2336         ;;
2337 # port not yet contributed
2338 #powerpc-*-openbsd*)
2339 #       tmake_file="${tmake_file} rs6000/t-fprules"
2340 #       extra_headers=
2341 #       ;;
2342 powerpc-*-darwin*)
2343         extra_options="${extra_options} rs6000/darwin.opt"
2344         case ${target} in
2345           *-darwin1[0-9]* | *-darwin[8-9]*)
2346             tmake_file="${tmake_file} rs6000/t-darwin8"
2347             tm_file="${tm_file} rs6000/darwin8.h"
2348             ;;
2349           *-darwin7*)
2350             tm_file="${tm_file} rs6000/darwin7.h"
2351             ;;
2352           *-darwin[0-6]*)
2353             ;;
2354         esac
2355         tmake_file="${tmake_file} t-slibgcc"
2356         extra_headers=altivec.h
2357         ;;
2358 powerpc64-*-darwin*)
2359         extra_options="${extra_options} ${cpu_type}/darwin.opt"
2360         tmake_file="${tmake_file} ${cpu_type}/t-darwin64 t-slibgcc"
2361         tm_file="${tm_file} ${cpu_type}/darwin8.h ${cpu_type}/darwin64.h"
2362         extra_headers=altivec.h
2363         ;;
2364 powerpc*-*-freebsd*)
2365         tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h"
2366         extra_options="${extra_options} rs6000/sysv4.opt"
2367         tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
2368         case ${target} in
2369              powerpc64*)
2370                 tm_file="${tm_file} rs6000/default64.h rs6000/freebsd64.h"
2371                 tmake_file="${tmake_file} rs6000/t-freebsd64"
2372                 extra_options="${extra_options} rs6000/linux64.opt"
2373                 ;;
2374              *)
2375                 tm_file="${tm_file} rs6000/freebsd.h"
2376                 ;;
2377         esac
2378         ;;
2379 powerpc-*-netbsd*)
2380         tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
2381         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2382         tmake_file="${tmake_file} rs6000/t-netbsd"
2383         extra_options="${extra_options} rs6000/sysv4.opt"
2384         ;;
2385 powerpc-*-eabispe*)
2386         tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h ${cpu_type}/sysv4.h ${cpu_type}/eabi.h ${cpu_type}/e500.h ${cpu_type}/eabispe.h"
2387         extra_options="${extra_options} ${cpu_type}/sysv4.opt"
2388         tmake_file="${cpu_type}/t-spe ${cpu_type}/t-ppccomm"
2389         use_gcc_stdint=wrap
2390         ;;
2391 powerpc-*-eabisimaltivec*)
2392         tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h"
2393         extra_options="${extra_options} rs6000/sysv4.opt"
2394         tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
2395         use_gcc_stdint=wrap
2396         ;;
2397 powerpc-*-eabisim*)
2398         tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
2399         extra_options="${extra_options} rs6000/sysv4.opt"
2400         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2401         use_gcc_stdint=wrap
2402         ;;
2403 powerpc-*-elf*)
2404         tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h"
2405         extra_options="${extra_options} rs6000/sysv4.opt"
2406         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2407         ;;
2408 powerpc-*-eabialtivec*)
2409         tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabialtivec.h"
2410         extra_options="${extra_options} rs6000/sysv4.opt"
2411         tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
2412         use_gcc_stdint=wrap
2413         ;;
2414 powerpc-xilinx-eabi*)
2415         tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/singlefp.h rs6000/xfpu.h rs6000/xilinx.h"
2416         extra_options="${extra_options} rs6000/sysv4.opt rs6000/xilinx.opt"
2417         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm rs6000/t-xilinx"
2418         use_gcc_stdint=wrap
2419         ;;
2420 powerpc-*-eabi*)
2421         tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h"
2422         extra_options="${extra_options} rs6000/sysv4.opt"
2423         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2424         use_gcc_stdint=wrap
2425         ;;
2426 powerpc-*-rtems*spe*)
2427         tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h powerpcspe/sysv4.h powerpcspe/eabi.h powerpcspe/e500.h powerpcspe/rtems.h rtems.h"
2428         extra_options="${extra_options} powerpcspe/sysv4.opt"
2429         tmake_file="${tmake_file} powerpcspe/t-fprules powerpcspe/t-rtems powerpcspe/t-ppccomm"
2430         ;;
2431 powerpc-*-rtems*)
2432         tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/rtems.h rtems.h"
2433         extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
2434         tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
2435         ;;
2436 powerpc*-*-linux*spe*)
2437         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h powerpcspe/sysv4.h"
2438         extra_options="${extra_options} powerpcspe/sysv4.opt"
2439         tmake_file="${tmake_file} powerpcspe/t-fprules powerpcspe/t-ppccomm"
2440         extra_objs="$extra_objs powerpcspe-linux.o"
2441         maybe_biarch=
2442         tm_file="${tm_file} powerpcspe/linux.h glibc-stdint.h"
2443         tmake_file="${tmake_file} powerpcspe/t-ppcos powerpcspe/t-linux"
2444         tm_file="${tm_file} powerpcspe/linuxspe.h powerpcspe/e500.h"
2445         ;;
2446 powerpc*-*-linux*)
2447         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
2448         extra_options="${extra_options} rs6000/sysv4.opt"
2449         tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
2450         extra_objs="$extra_objs rs6000-linux.o"
2451         case ${target} in
2452             powerpc*le-*-*)
2453                 tm_file="${tm_file} rs6000/sysv4le.h" ;;
2454         esac
2455         case ${target}:${with_cpu} in
2456             powerpc64*: | powerpc64*:native) cpu_is_64bit=yes ;;
2457         esac
2458         maybe_biarch=${cpu_is_64bit}
2459         case ${enable_targets} in
2460             *powerpc64*) maybe_biarch=yes ;;
2461             all) maybe_biarch=yes ;;
2462         esac
2463         case ${target} in
2464             powerpc64*-*-linux*spe* | powerpc64*-*-linux*paired*)
2465                 echo "*** Configuration ${target} not supported" 1>&2
2466                 exit 1
2467                 ;;
2468             powerpc*-*-linux*spe* | powerpc*-*-linux*paired*)
2469                 maybe_biarch=
2470                 ;;
2471         esac
2472         case ${target}:${enable_targets}:${maybe_biarch} in
2473             powerpc64-* | powerpc-*:*:yes | *:*powerpc64-*:yes | *:all:yes \
2474             | powerpc64le*:*powerpcle* | powerpc64le*:*powerpc-* \
2475             | powerpcle-*:*powerpc64le*:yes)
2476                 if test x$cpu_is_64bit = xyes; then
2477                     tm_file="${tm_file} rs6000/default64.h"
2478                 fi
2479                 tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h glibc-stdint.h"
2480                 tmake_file="$tmake_file rs6000/t-linux64"
2481                 case ${target} in
2482                     powerpc*le-*-*)
2483                         tmake_file="$tmake_file rs6000/t-linux64le"
2484                         case ${enable_targets} in
2485                             all | *powerpc64-* | *powerpc-*)
2486                                 tmake_file="$tmake_file rs6000/t-linux64lebe" ;;
2487                         esac ;;
2488                     *)
2489                         case ${enable_targets} in
2490                             all | *powerpc64le-* | *powerpcle-*)
2491                                 tmake_file="$tmake_file rs6000/t-linux64bele" ;;
2492                         esac ;;
2493                 esac
2494                 extra_options="${extra_options} rs6000/linux64.opt"
2495                 ;;
2496             powerpc64*)
2497                 tm_file="${tm_file} rs6000/default64.h rs6000/linux64.h glibc-stdint.h"
2498                 extra_options="${extra_options} rs6000/linux64.opt"
2499                 tmake_file="${tmake_file} rs6000/t-linux"
2500                 ;;
2501             *)
2502                 tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
2503                 tmake_file="${tmake_file} rs6000/t-ppcos rs6000/t-linux"
2504                 ;;
2505         esac
2506         case ${target} in
2507             powerpc*-*-linux*ppc476*)
2508                 tm_file="${tm_file} rs6000/476.h"
2509                 extra_options="${extra_options} rs6000/476.opt" ;;
2510             powerpc*-*-linux*altivec*)
2511                 tm_file="${tm_file} rs6000/linuxaltivec.h" ;;
2512             powerpc*-*-linux*spe*)
2513                 tm_file="${tm_file} ${cpu_type}/linuxspe.h ${cpu_type}/e500.h" ;;
2514             powerpc*-*-linux*paired*)
2515                 tm_file="${tm_file} rs6000/750cl.h" ;;
2516         esac
2517         case ${target} in
2518             *-linux*-musl*)
2519                 enable_secureplt=yes ;;
2520         esac
2521         if test x${enable_secureplt} = xyes; then
2522                 tm_file="rs6000/secureplt.h ${tm_file}"
2523         fi
2524         ;;
2525 powerpc-wrs-vxworks*spe)
2526         tm_file="${tm_file} elfos.h freebsd-spec.h powerpcspe/sysv4.h"
2527         tmake_file="${tmake_file} powerpcspe/t-fprules powerpcspe/t-ppccomm powerpcspe/t-vxworks"
2528         extra_options="${extra_options} powerpcspe/sysv4.opt"
2529         extra_headers=ppc-asm.h
2530         tm_file="${tm_file} vx-common.h vxworks.h powerpcspe/vxworks.h powerpcspe/e500.h"
2531         ;;
2532 powerpc-wrs-vxworks*)
2533         tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"
2534         tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
2535         extra_options="${extra_options} rs6000/sysv4.opt"
2536         extra_headers=ppc-asm.h
2537         case ${target} in
2538           *-vxworksmils*)
2539             tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksmils.h"
2540             tmake_file="${tmake_file} rs6000/t-vxworksmils"
2541             ;;
2542           *-vxworksae*)
2543             tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksae.h"
2544             tmake_file="${tmake_file} rs6000/t-vxworksae"
2545             ;;
2546           *-vxworks*)
2547             tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h"
2548             ;;
2549         esac
2550         ;;
2551 powerpc-*-lynxos*)
2552         xm_defines=POSIX
2553         tm_file="${tm_file} dbxelf.h elfos.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
2554         tmake_file="t-lynx rs6000/t-lynx"
2555         extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
2556         thread_file=lynx
2557         gnu_ld=yes
2558         gas=yes
2559         ;;
2560 powerpcle-*-elf*)
2561         tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h"
2562         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2563         extra_options="${extra_options} rs6000/sysv4.opt"
2564         ;;
2565 powerpcle-*-eabisim*)
2566         tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
2567         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2568         extra_options="${extra_options} rs6000/sysv4.opt"
2569         use_gcc_stdint=wrap
2570         ;;
2571 powerpcle-*-eabi*)
2572         tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
2573         tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2574         extra_options="${extra_options} rs6000/sysv4.opt"
2575         use_gcc_stdint=wrap
2576         ;;
2577 rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
2578         tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h rs6000/aix-stdint.h"
2579         tmake_file="rs6000/t-aix43 t-slibgcc"
2580         extra_options="${extra_options} rs6000/aix64.opt"
2581         use_collect2=yes
2582         thread_file='aix'
2583         use_gcc_stdint=provide
2584         extra_headers=
2585         ;;
2586 rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
2587         tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h rs6000/aix-stdint.h"
2588         extra_options="${extra_options} rs6000/aix64.opt"
2589         tmake_file="rs6000/t-aix43 t-slibgcc"
2590         use_collect2=yes
2591         thread_file='aix'
2592         use_gcc_stdint=wrap
2593         extra_headers=
2594         ;;
2595 rs6000-ibm-aix5.2.* | powerpc-ibm-aix5.2.*)
2596         tm_file="${tm_file} rs6000/aix.h rs6000/aix52.h rs6000/xcoff.h rs6000/aix-stdint.h"
2597         tmake_file="rs6000/t-aix52 t-slibgcc"
2598         extra_options="${extra_options} rs6000/aix64.opt"
2599         use_collect2=yes
2600         thread_file='aix'
2601         use_gcc_stdint=wrap
2602         extra_headers=
2603         ;;
2604 rs6000-ibm-aix5.3.* | powerpc-ibm-aix5.3.*)
2605         tm_file="${tm_file} rs6000/aix.h rs6000/aix53.h rs6000/xcoff.h rs6000/aix-stdint.h"
2606         tmake_file="rs6000/t-aix52 t-slibgcc"
2607         extra_options="${extra_options} rs6000/aix64.opt"
2608         use_collect2=yes
2609         thread_file='aix'
2610         use_gcc_stdint=wrap
2611         extra_headers=altivec.h
2612         ;;
2613 rs6000-ibm-aix6.* | powerpc-ibm-aix6.*)
2614         tm_file="${tm_file} rs6000/aix.h rs6000/aix61.h rs6000/xcoff.h rs6000/aix-stdint.h"
2615         tmake_file="rs6000/t-aix52 t-slibgcc"
2616         extra_options="${extra_options} rs6000/aix64.opt"
2617         use_collect2=yes
2618         thread_file='aix'
2619         use_gcc_stdint=wrap
2620         extra_headers=altivec.h
2621         default_use_cxa_atexit=yes
2622         ;;
2623 rs6000-ibm-aix[789].* | powerpc-ibm-aix[789].*)
2624         tm_file="${tm_file} rs6000/aix.h rs6000/aix71.h rs6000/xcoff.h rs6000/aix-stdint.h"
2625         tmake_file="rs6000/t-aix52 t-slibgcc"
2626         extra_options="${extra_options} rs6000/aix64.opt"
2627         use_collect2=yes
2628         thread_file='aix'
2629         use_gcc_stdint=wrap
2630         extra_headers=altivec.h
2631         default_use_cxa_atexit=yes
2632         ;;
2633 rl78-*-elf*)
2634         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2635         target_has_targetm_common=no
2636         c_target_objs="rl78-c.o"
2637         cxx_target_objs="rl78-c.o"
2638         tmake_file="${tmake_file} rl78/t-rl78"
2639         ;;
2640 rx-*-elf*)
2641         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2642         tmake_file="${tmake_file} rx/t-rx"
2643         ;;
2644 s390-*-linux*)
2645         tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
2646         c_target_objs="${c_target_objs} s390-c.o"
2647         cxx_target_objs="${cxx_target_objs} s390-c.o"
2648         if test x$enable_targets = xall; then
2649                 tmake_file="${tmake_file} s390/t-linux64"
2650         fi
2651         tmake_file="${tmake_file} s390/t-s390"
2652         ;;
2653 s390x-*-linux*)
2654         tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
2655         tm_p_file="linux-protos.h s390/s390-protos.h"
2656         c_target_objs="${c_target_objs} s390-c.o"
2657         cxx_target_objs="${cxx_target_objs} s390-c.o"
2658         md_file=s390/s390.md
2659         extra_modes=s390/s390-modes.def
2660         out_file=s390/s390.c
2661         tmake_file="${tmake_file} s390/t-linux64 s390/t-s390"
2662         ;;
2663 s390x-ibm-tpf*)
2664         tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h s390/tpf.h"
2665         tm_p_file=s390/s390-protos.h
2666         c_target_objs="${c_target_objs} s390-c.o"
2667         cxx_target_objs="${cxx_target_objs} s390-c.o"
2668         md_file=s390/s390.md
2669         extra_modes=s390/s390-modes.def
2670         out_file=s390/s390.c
2671         thread_file='tpf'
2672         extra_options="${extra_options} s390/tpf.opt"
2673         tmake_file="${tmake_file} s390/t-s390"
2674         ;;
2675 sh-*-elf* | sh[12346l]*-*-elf* | \
2676   sh-*-linux* | sh[2346lbe]*-*-linux* | \
2677   sh-*-netbsdelf* | shl*-*-netbsdelf*)
2678         tmake_file="${tmake_file} sh/t-sh sh/t-elf"
2679         if test x${with_endian} = x; then
2680                 case ${target} in
2681                 sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
2682                 shbe-*-* | sheb-*-*)               with_endian=big,little ;;
2683                 sh[1234]l* | sh[34]*-*-linux*)     with_endian=little ;;
2684                 shl* | sh*-*-linux* | \
2685                   sh-superh-elf)                   with_endian=little,big ;;
2686                 sh[1234]*-*-*)                     with_endian=big ;;
2687                 *)                                 with_endian=big,little ;;
2688                 esac
2689         fi
2690         # TM_ENDIAN_CONFIG is used by t-sh to determine multilibs.
2691         #  First word : the default endian.
2692         #  Second word: the secondary endian (optional).
2693         case ${with_endian} in
2694         big)            TM_ENDIAN_CONFIG=mb ;;
2695         little)         TM_ENDIAN_CONFIG=ml ;;
2696         big,little)     TM_ENDIAN_CONFIG="mb ml" ;;
2697         little,big)     TM_ENDIAN_CONFIG="ml mb" ;;
2698         *)      echo "with_endian=${with_endian} not supported."; exit 1 ;;
2699         esac
2700         case ${with_endian} in
2701         little*)        tm_file="sh/little.h ${tm_file}" ;;
2702         esac
2703         tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h"
2704         case ${target} in
2705         sh*-*-linux*)   tmake_file="${tmake_file} sh/t-linux"
2706                         if test x$enable_fdpic = xyes; then
2707                                 tm_defines="$tm_defines FDPIC_DEFAULT=1"
2708                         fi
2709                         tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
2710         sh*-*-netbsd*)
2711                         tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
2712                         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2714                         ;;
2715         sh*-superh-elf) if test x$with_libgloss != xno; then
2716                                 with_libgloss=yes
2717                                 tm_file="${tm_file} sh/newlib.h"
2718                         fi
2719                         tm_file="${tm_file} sh/embed-elf.h"
2720                         tm_file="${tm_file} sh/superh.h"
2721                         extra_options="${extra_options} sh/superh.opt" ;;
2722         *)              if test x$with_newlib = xyes \
2723                            && test x$with_libgloss = xyes; then
2724                                 tm_file="${tm_file} sh/newlib.h"
2725                         fi
2726                         tm_file="${tm_file} sh/embed-elf.h" ;;
2727         esac
2728         case ${target} in
2729         *-*-netbsd)
2730                 ;;
2731         *-*-elf*)
2732                 tm_file="${tm_file} newlib-stdint.h"
2733                 ;;
2734         esac
2735         # sed el/eb endian suffixes away to avoid confusion with sh[23]e
2736         case `echo ${target} | sed 's/e[lb]-/-/'` in
2737         sh4a_single_only*)      sh_cpu_target=sh4a-single-only ;;
2738         sh4a_single*)           sh_cpu_target=sh4a-single ;;
2739         sh4a_nofpu*)            sh_cpu_target=sh4a-nofpu ;;
2740         sh4al)                  sh_cpu_target=sh4al ;;
2741         sh4a*)                  sh_cpu_target=sh4a ;;
2742         sh4_single_only*)       sh_cpu_target=sh4-single-only ;;
2743         sh4_single*)            sh_cpu_target=sh4-single ;;
2744         sh4_nofpu*)             sh_cpu_target=sh4-nofpu ;;
2745         sh4* | sh-superh-*)     sh_cpu_target=sh4 ;;
2746         sh3e*)                  sh_cpu_target=sh3e ;;
2747         sh*-*-netbsd* | sh3*)   sh_cpu_target=sh3 ;;
2748         sh2a_single_only*)      sh_cpu_target=sh2a-single-only ;;
2749         sh2a_single*)           sh_cpu_target=sh2a-single ;;
2750         sh2a_nofpu*)            sh_cpu_target=sh2a-nofpu ;;
2751         sh2a*)                  sh_cpu_target=sh2a ;;
2752         sh2e*)                  sh_cpu_target=sh2e ;;
2753         sh2*)                   sh_cpu_target=sh2 ;;
2754         *)                      sh_cpu_target=sh1 ;;
2755         esac
2756         # did the user say --without-fp ?
2757         if test x$with_fp = xno; then
2758                 case ${sh_cpu_target} in
2759                 sh4al | sh1)    ;;
2760                 sh4a* )         sh_cpu_target=sh4a-nofpu ;;
2761                 sh4*)           sh_cpu_target=sh4-nofpu ;;
2762                 sh3*)           sh_cpu_target=sh3 ;;
2763                 sh2a*)          sh_cpu_target=sh2a-nofpu ;;
2764                 sh2*)           sh_cpu_target=sh2 ;;
2765                 *)      echo --without-fp not available for $target: ignored
2766                 esac
2767                 tm_defines="$tm_defines STRICT_NOFPU=1"
2768         fi
2769         sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr A-Z_ a-z-`"
2770         case $sh_cpu_default in
2771           sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
2772           sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
2773           sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
2774           sh3e | sh3 | sh2e | sh2 | sh1) ;;
2775         "")     sh_cpu_default=${sh_cpu_target} ;;
2776         *)      echo "with_cpu=$with_cpu not supported"; exit 1 ;;
2777         esac
2778         sh_multilibs=${with_multilib_list}
2779         if test "$sh_multilibs" = "default" ; then
2780                 case ${target} in
2781                 sh[1234]*)      sh_multilibs=${sh_cpu_target} ;;
2782                 sh-superh-*)    sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
2783                 sh*-*-linux*)   sh_multilibs=m1,m2,m2a,m3e,m4 ;;
2784                 sh*-*-netbsd*)  sh_multilibs=m3,m3e,m4 ;;
2785                 *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
2786                 esac
2787                 if test x$with_fp = xno; then
2788                         sh_multilibs="`echo $sh_multilibs|sed -e s/m4/sh4-nofpu/ -e s/,m4-[^,]*//g -e s/,m[23]e// -e s/m2a,m2a-single/m2a-nofpu/ -e s/m5-..m....,//g`"
2789                 fi
2790         fi
2791         target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
2792         tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
2793         tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
2794         sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^[Ss][Hh]/m/' -e 's/ [Ss][Hh]/ m/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
2795         for sh_multilib in ${sh_multilibs}; do
2796                 case ${sh_multilib} in
2797                 m1 | m2 | m2e | m3 | m3e | \
2798                 m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
2799                 m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
2800                 m2a | m2a-single | m2a-single-only | m2a-nofpu)
2801                         # TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
2802                         # It is passed to MULTIILIB_OPTIONS verbatim.
2803                         TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
2804                         tm_defines="$tm_defines SUPPORT_`echo $sh_multilib | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
2805                         ;;
2806                 \!*)    # TM_MULTILIB_EXCEPTIONS_CONFIG is used by t-sh
2807                         # It is passed the MULTILIB_EXCEPTIONS verbatim.
2808                         TM_MULTILIB_EXCEPTIONS_CONFIG="${TM_MULTILIB_EXCEPTIONS_CONFIG} `echo $sh_multilib | sed 's/^!//'`" ;;
2809                 *)
2810                         echo "with_multilib_list=${sh_multilib} not supported."
2811                         exit 1
2812                         ;;
2813                 esac
2814         done
2815         TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
2816         if test x${enable_incomplete_targets} = xyes ; then
2817                 tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1"
2818         fi
2819         tm_file="$tm_file ./sysroot-suffix.h"
2820         tmake_file="$tmake_file t-sysroot-suffix"
2821         ;;
2822 sh-*-rtems*)
2823         tmake_file="${tmake_file} sh/t-sh sh/t-rtems"
2824         tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
2825         ;;
2826 sh-wrs-vxworks)
2827         tmake_file="$tmake_file sh/t-sh sh/t-vxworks"
2828         tm_file="${tm_file} elfos.h sh/elf.h sh/embed-elf.h vx-common.h vxworks.h sh/vxworks.h"
2829         ;;
2830 sparc-*-elf*)
2831         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
2832         case ${target} in
2833             *-leon-*)
2834                 tmake_file="sparc/t-sparc sparc/t-leon"
2835                 ;;
2836             *-leon[3-9]*)
2837                 tmake_file="sparc/t-sparc sparc/t-leon3"
2838                 ;;
2839             *)
2840                 tmake_file="sparc/t-sparc sparc/t-elf"
2841                 ;;
2842         esac
2843         ;;
2844 sparc-*-rtems*)
2845         tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
2846         tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems"
2847         ;;
2848 sparc-*-linux*)
2849         tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
2850         extra_options="${extra_options} sparc/long-double-switch.opt"
2851         case ${target} in
2852             *-leon-*)
2853                 tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon"
2854                 ;;
2855             *-leon[3-9]*)
2856                 tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon3"
2857                 ;;
2858             *)
2859                 tmake_file="${tmake_file} sparc/t-sparc"
2860                 ;;
2861         esac
2862         if test x$enable_targets = xall; then
2863                 tm_file="sparc/biarch64.h ${tm_file} sparc/linux64.h"
2864                 tmake_file="${tmake_file} sparc/t-linux64"
2865         else
2866                 tm_file="${tm_file} sparc/linux.h"
2867                 tmake_file="${tmake_file} sparc/t-linux"
2868         fi
2869         ;;
2870 sparc-*-netbsdelf*)
2871         tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
2872         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2873         extra_options="${extra_options} sparc/long-double-switch.opt"
2874         tmake_file="${tmake_file} sparc/t-sparc"
2875         ;;
2876 sparc*-*-solaris2*)
2877         tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sparc/tso.h"
2878         case ${target} in
2879             sparc64-*-* | sparcv9-*-*)
2880                 tm_file="sparc/default64.h ${tm_file}"
2881                 ;;
2882             *)
2883                 test x$with_cpu != x || with_cpu=v9
2884                 ;;
2885         esac
2886         tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2"
2887         ;;
2888 sparc-wrs-vxworks)
2889         tm_file="${tm_file} elfos.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
2890         tmake_file="${tmake_file} sparc/t-sparc sparc/t-vxworks"
2891         ;;
2892 sparc64-*-elf*)
2893         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h"
2894         extra_options="${extra_options}"
2895         tmake_file="${tmake_file} sparc/t-sparc"
2896         ;;
2897 sparc64-*-rtems*)
2898         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
2899         extra_options="${extra_options}"
2900         tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64"
2901         ;;
2902 sparc64-*-linux*)
2903         tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h"
2904         extra_options="${extra_options} sparc/long-double-switch.opt"
2905         tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
2906         ;;
2907 sparc64-*-freebsd*|ultrasparc-*-freebsd*)
2908         tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
2909         extra_options="${extra_options} sparc/long-double-switch.opt"
2910         case "x$with_cpu" in
2911                 xultrasparc) ;;
2912                 x) with_cpu=ultrasparc ;;
2913                 *) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
2914         esac
2915         tmake_file="${tmake_file} sparc/t-sparc"
2916         ;;
2917 sparc64-*-netbsd*)
2918         tm_file="sparc/biarch64.h ${tm_file}"
2919         tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
2920         extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2921         extra_options="${extra_options} sparc/long-double-switch.opt"
2922         tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
2923         ;;
2924 sparc64-*-openbsd*)
2925         tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
2926         tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
2927         extra_options="${extra_options} openbsd.opt"
2928         extra_options="${extra_options}"
2929         gas=yes gnu_ld=yes
2930         with_cpu=ultrasparc
2931         tmake_file="${tmake_file} sparc/t-sparc"
2932         ;;
2933 spu-*-elf*)
2934         tm_file="dbxelf.h elfos.h spu/spu-elf.h spu/spu.h newlib-stdint.h"
2935         tmake_file="spu/t-spu-elf"
2936         native_system_header_dir=/include
2937         extra_headers="spu_intrinsics.h spu_internals.h vmx2spu.h spu_mfcio.h vec_types.h spu_cache.h"
2938         extra_modes=spu/spu-modes.def
2939         c_target_objs="${c_target_objs} spu-c.o"
2940         cxx_target_objs="${cxx_target_objs} spu-c.o"
2941         ;;
2942 tic6x-*-elf)
2943         tm_file="elfos.h ${tm_file} c6x/elf-common.h c6x/elf.h"
2944         tm_file="${tm_file} dbxelf.h tm-dwarf2.h newlib-stdint.h"
2945         tmake_file="c6x/t-c6x c6x/t-c6x-elf"
2946         use_collect2=no
2947         ;;
2948 tic6x-*-uclinux)
2949         tm_file="elfos.h ${tm_file} gnu-user.h linux.h c6x/elf-common.h c6x/uclinux-elf.h"
2950         tm_file="${tm_file} dbxelf.h tm-dwarf2.h glibc-stdint.h"
2951         tm_file="${tm_file} ./sysroot-suffix.h"
2952         tmake_file="t-sysroot-suffix t-slibgcc"
2953         tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
2954         use_collect2=no
2955         ;;
2956 tilegx*-*-linux*)
2957         tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilegx/linux.h ${tm_file}"
2958         tmake_file="${tmake_file} tilegx/t-tilegx"
2959         extra_objs="${extra_objs} mul-tables.o"
2960         c_target_objs="${c_target_objs} tilegx-c.o"
2961         cxx_target_objs="${cxx_target_objs} tilegx-c.o"
2962         extra_headers="feedback.h"
2963         case $target in
2964         tilegxbe-*)
2965                 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
2966                 ;;
2967         esac
2968         ;;
2969 tilepro*-*-linux*)
2970         tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilepro/linux.h ${tm_file}"
2971         tmake_file="${tmake_file} tilepro/t-tilepro"
2972         extra_objs="${extra_objs} mul-tables.o"
2973         c_target_objs="${c_target_objs} tilepro-c.o"
2974         cxx_target_objs="${cxx_target_objs} tilepro-c.o"
2975         extra_headers="feedback.h"
2976         ;;
2977 v850-*-rtems*)
2978         target_cpu_default="TARGET_CPU_generic"
2979         tm_file="dbxelf.h elfos.h v850/v850.h"
2980         tm_file="${tm_file} rtems.h v850/rtems.h newlib-stdint.h"
2981         tmake_file="${tmake_file} v850/t-v850"
2982         tmake_file="${tmake_file} v850/t-rtems"
2983         use_collect2=no
2984         c_target_objs="v850-c.o"
2985         cxx_target_objs="v850-c.o"
2986         ;;
2987 v850*-*-*)
2988         case ${target} in
2989         v850e3v5-*-*)
2990                 target_cpu_default="TARGET_CPU_v850e3v5"
2991                 ;;
2992         v850e2v3-*-*)
2993                 target_cpu_default="TARGET_CPU_v850e2v3"
2994                 ;;
2995         v850e2-*-*)
2996                 target_cpu_default="TARGET_CPU_v850e2"
2997                 ;;
2998         v850e1-*-* | v850es-*-*)
2999                 target_cpu_default="TARGET_CPU_v850e1"
3000                 ;;
3001         v850e-*-*)
3002                 target_cpu_default="TARGET_CPU_v850e"
3003                 ;;
3004         v850-*-*)
3005                 target_cpu_default="TARGET_CPU_generic"
3006                 ;;
3007         esac
3008         tm_file="dbxelf.h elfos.h newlib-stdint.h v850/v850.h"
3009         if test x$stabs = xyes
3010         then
3011                 tm_file="${tm_file} dbx.h"
3012         fi
3013         use_collect2=no
3014         c_target_objs="v850-c.o"
3015         cxx_target_objs="v850-c.o"
3016         use_gcc_stdint=wrap
3017         ;;
3018 vax-*-linux*)
3019         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
3020         extra_options="${extra_options} vax/elf.opt"
3021         ;;
3022 vax-*-netbsdelf*)
3023         tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
3024         extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
3025         tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
3026         ;;
3027 vax-*-openbsd*)
3028         tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-libpthread.h vax/openbsd.h"
3029         extra_options="${extra_options} openbsd.opt"
3030         use_collect2=yes
3031         ;;
3032 visium-*-elf*)
3033         tm_file="dbxelf.h elfos.h ${tm_file} visium/elf.h newlib-stdint.h"
3034         tmake_file="visium/t-visium visium/t-crtstuff"
3035         ;;
3036 xstormy16-*-elf)
3037         # For historical reasons, the target files omit the 'x'.
3038         tm_file="dbxelf.h elfos.h newlib-stdint.h stormy16/stormy16.h"
3039         tm_p_file=stormy16/stormy16-protos.h
3040         md_file=stormy16/stormy16.md
3041         out_file=stormy16/stormy16.c
3042         extra_options=stormy16/stormy16.opt
3043         tmake_file="stormy16/t-stormy16"
3044         ;;
3045 xtensa*-*-elf*)
3046         tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h"
3047         extra_options="${extra_options} xtensa/elf.opt"
3048         ;;
3049 xtensa*-*-linux*)
3050         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
3051         tmake_file="${tmake_file} xtensa/t-xtensa"
3052         ;;
3053 xtensa*-*-uclinux*)
3054         tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
3055         tmake_file="${tmake_file} xtensa/t-xtensa"
3056         extra_options="${extra_options} xtensa/uclinux.opt"
3057         ;;
3058 am33_2.0-*-linux*)
3059         tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
3060         gas=yes gnu_ld=yes
3061         use_collect2=no
3062         ;;
3063 m32c-*-rtems*)
3064         tm_file="dbxelf.h elfos.h ${tm_file} m32c/rtems.h rtems.h newlib-stdint.h"
3065         c_target_objs="m32c-pragma.o"
3066         cxx_target_objs="m32c-pragma.o"
3067         ;;
3068 m32c-*-elf*)
3069         tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
3070         c_target_objs="m32c-pragma.o"
3071         cxx_target_objs="m32c-pragma.o"
3072         ;;
3074         echo "*** Configuration ${target} not supported" 1>&2
3075         exit 1
3076         ;;
3077 esac
3079 case ${target} in
3080 i[34567]86-*-linux* | x86_64-*-linux*)
3081         tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386"
3082         ;;
3083 i[34567]86-*-* | x86_64-*-*)
3084         tmake_file="${tmake_file} i386/t-gmm_malloc i386/t-i386"
3085         ;;
3086 powerpc*-*-* | rs6000-*-*)
3087         tm_file="${tm_file} ${cpu_type}/option-defaults.h"
3088 esac
3090 # non-glibc systems
3091 case ${target} in
3092 *-linux-musl*)
3093         tmake_file="${tmake_file} t-musl"
3094         ;;
3095 *-linux-uclibc*)
3096         tmake_file="${tmake_file} t-uclibc"
3097         ;;
3098 esac
3100 # Assume the existence of indirect function support and allow the use of the
3101 # resolver attribute.
3102 case ${target} in
3103 *-*-linux*android*|*-*-linux*uclibc*|*-*-linux*musl*)
3104         ;;
3105 *-*-linux*)
3106         case ${target} in
3107         aarch64*-* | i[34567]86-* | powerpc*-* | s390*-* | sparc*-* | x86_64-*)
3108                 default_gnu_indirect_function=yes
3109                 ;;
3110         esac
3111         ;;
3112 esac
3114 # Build mkoffload tool
3115 case ${target} in
3116 *-intelmic-* | *-intelmicemul-*)
3117         tmake_file="${tmake_file} i386/t-intelmic"
3118         tm_file="${tm_file} i386/intelmic-offload.h"
3119         ;;
3120 esac
3122 if [ "$target_has_targetcm" = "no" ]; then
3123   c_target_objs="$c_target_objs default-c.o"
3124   cxx_target_objs="$cxx_target_objs default-c.o"
3127 if [ "$common_out_file" = "" ]; then
3128   if [ "$target_has_targetm_common" = "yes" ]; then
3129     common_out_file="$cpu_type/$cpu_type-common.c"
3130   else
3131     common_out_file="default-common.c"
3132   fi
3135 # Support for --with-cpu and related options (and a few unrelated options,
3136 # too).
3137 case ${with_cpu} in
3138   yes | no)
3139     echo "--with-cpu must be passed a value" 1>&2
3140     exit 1
3141     ;;
3142 esac
3144 # Set arch and cpu from ${target} and ${target_noncanonical}.  Set cpu
3145 # to generic if there is no processor scheduler model for the target.
3146 arch=
3147 cpu=
3148 arch_without_sse2=no
3149 arch_without_64bit=no
3150 case ${target} in
3151   i386-*-freebsd*)
3152     if test $fbsd_major -ge 6; then
3153       arch=i486
3154     else
3155       arch=i386
3156     fi
3157     cpu=generic
3158     arch_without_sse2=yes
3159     arch_without_64bit=yes
3160     ;;
3161   i386-*-netbsd*)
3162     arch=i486
3163     cpu=generic
3164     arch_without_sse2=yes
3165     arch_without_64bit=yes
3166     ;;
3167   i386-*-*)
3168     arch=i386
3169     cpu=i386
3170     arch_without_sse2=yes
3171     arch_without_64bit=yes
3172     ;;
3173   i486-*-*)
3174     arch=i486
3175     cpu=i486
3176     arch_without_sse2=yes
3177     arch_without_64bit=yes
3178     ;;
3179   i586-*-*)
3180     arch_without_sse2=yes
3181     arch_without_64bit=yes
3182     case ${target_noncanonical} in
3183       k6_2-*)
3184         arch=k6-2
3185         cpu=k6-2
3186         ;;
3187       k6_3-*)
3188         arch=k6-3
3189         cpu=k6-3
3190         ;;
3191       k6-*)
3192         arch=k6
3193         cpu=k6
3194         ;;
3195       pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
3196         arch=pentium-mmx
3197         cpu=pentium-mmx
3198         ;;
3199       *)
3200         arch=pentium
3201         cpu=pentium
3202         ;;
3203     esac
3204     ;;
3205   i686-*-* | i786-*-*)
3206     case ${target_noncanonical} in
3207       znver1-*)
3208         arch=znver1
3209         cpu=znver1
3210         ;;
3211       bdver4-*)
3212         arch=bdver4
3213         cpu=bdver4
3214         ;;
3215       bdver3-*)
3216         arch=bdver3
3217         cpu=bdver3
3218         ;;
3219       bdver2-*)
3220         arch=bdver2
3221         cpu=bdver2
3222         ;;
3223       bdver1-*)
3224         arch=bdver1
3225         cpu=bdver1
3226         ;;
3227       btver1-*)
3228         arch=btver1
3229         cpu=btver1
3230         ;;
3231       btver2-*)
3232         arch=btver2
3233         cpu=btver2
3234         ;;
3235       amdfam10-*|barcelona-*)
3236         arch=amdfam10
3237         cpu=amdfam10
3238         ;;
3239       k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3240         arch=k8-sse3
3241         cpu=k8-sse3
3242         ;;
3243       k8-*|opteron-*|athlon64-*|athlon_fx-*)
3244         arch=k8
3245         cpu=k8
3246         ;;
3247       athlon_xp-*|athlon_mp-*|athlon_4-*)
3248         arch=athlon-4
3249         cpu=athlon-4
3250         arch_without_sse2=yes
3251         arch_without_64bit=yes
3252         ;;
3253       athlon_tbird-*|athlon-*)
3254         arch=athlon
3255         cpu=athlon
3256         arch_without_sse2=yes
3257         ;;
3258       geode-*)
3259         arch=geode
3260         cpu=geode
3261         arch_without_sse2=yes
3262         ;;
3263       pentium2-*)
3264         arch=pentium2
3265         cpu=pentium2
3266         arch_without_sse2=yes
3267         ;;
3268       pentium3-*|pentium3m-*)
3269         arch=pentium3
3270         cpu=pentium3
3271         arch_without_sse2=yes
3272         ;;
3273       pentium4-*|pentium4m-*)
3274         arch=pentium4
3275         cpu=pentium4
3276         ;;
3277       prescott-*)
3278         arch=prescott
3279         cpu=prescott
3280         ;;
3281       nocona-*)
3282         arch=nocona
3283         cpu=nocona
3284         ;;
3285       atom-*)
3286         arch=atom
3287         cpu=atom
3288         ;;
3289       slm-*)
3290         arch=slm
3291         cpu=slm
3292         ;;
3293       core2-*)
3294         arch=core2
3295         cpu=core2
3296         ;;
3297       corei7-*)
3298         arch=corei7
3299         cpu=corei7
3300         ;;
3301       corei7_avx-*)
3302         arch=corei7-avx
3303         cpu=corei7-avx
3304         ;;
3305       pentium_m-*)
3306         arch=pentium-m
3307         cpu=pentium-m
3308         ;;
3309       pentiumpro-*)
3310         arch=pentiumpro
3311         cpu=pentiumpro
3312         arch_without_sse2=yes
3313         ;;
3314       *)
3315         arch=pentiumpro
3316         cpu=generic
3317         arch_without_sse2=yes
3318         arch_without_64bit=yes
3319         ;;
3320     esac
3321     ;;
3322   x86_64-*-*)
3323     case ${target_noncanonical} in
3324       znver1-*)
3325         arch=znver1
3326         cpu=znver1
3327         ;;
3328       bdver4-*)
3329         arch=bdver4
3330         cpu=bdver4
3331         ;;
3332       bdver3-*)
3333         arch=bdver3
3334         cpu=bdver3
3335         ;;
3336       bdver2-*)
3337         arch=bdver2
3338         cpu=bdver2
3339         ;;
3340       bdver1-*)
3341         arch=bdver1
3342         cpu=bdver1
3343         ;;
3344       btver1-*)
3345         arch=btver1
3346         cpu=btver1
3347         ;;
3348       btver2-*)
3349         arch=btver2
3350         cpu=btver2
3351         ;;
3352       amdfam10-*|barcelona-*)
3353         arch=amdfam10
3354         cpu=amdfam10
3355         ;;
3356       k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3357         arch=k8-sse3
3358         cpu=k8-sse3
3359         ;;
3360       k8-*|opteron-*|athlon_64-*)
3361         arch=k8
3362         cpu=k8
3363         ;;
3364       nocona-*)
3365         arch=nocona
3366         cpu=nocona
3367         ;;
3368       atom-*)
3369         arch=atom
3370         cpu=atom
3371         ;;
3372       slm-*)
3373         arch=slm
3374         cpu=slm
3375         ;;
3376       core2-*)
3377         arch=core2
3378         cpu=core2
3379         ;;
3380       corei7-*)
3381         arch=corei7
3382         cpu=corei7
3383         ;;
3384       *)
3385         arch=x86-64
3386         cpu=generic
3387         ;;
3388     esac
3389     ;;
3390 esac
3392 # If there is no $with_cpu option, try to infer one from ${target}.
3393 # This block sets nothing except for with_cpu.
3394 if test x$with_cpu = x ; then
3395   case ${target} in
3396     i[34567]86-*-elfiamcu)
3397       with_cpu=lakemont
3398       ;;
3399     i[34567]86-*-*|x86_64-*-*)
3400       with_cpu=$cpu
3401       ;;
3402     alphaev6[78]*-*-*)
3403       with_cpu=ev67
3404       ;;
3405     alphaev6*-*-*)
3406       with_cpu=ev6
3407       ;;
3408     alphapca56*-*-*)
3409       with_cpu=pca56
3410       ;;
3411     alphaev56*-*-*)
3412       with_cpu=ev56
3413       ;;
3414     alphaev5*-*-*)
3415       with_cpu=ev5
3416       ;;
3417     frv-*-*linux* | frv400-*-*linux*)
3418       with_cpu=fr400
3419       ;;
3420     frv550-*-*linux*)
3421       with_cpu=fr550
3422       ;;
3423     m68k*-*-*)
3424       case "$with_arch" in
3425         "cf")
3426           with_cpu=${default_cf_cpu}
3427           ;;
3428         "" | "m68k")
3429           with_cpu=m${default_m68k_cpu}
3430           ;;
3431       esac
3432       ;;
3433     powerpc*-*-*spe*)
3434       if test x$enable_e500_double = xyes; then
3435          with_cpu=8548
3436       else
3437          with_cpu=8540
3438       fi       
3439       ;;
3440     sparc*-*-*)
3441       case ${target} in
3442         *-leon-*)
3443           with_cpu=leon
3444           ;;
3445         *-leon[3-9]*)
3446           with_cpu=leon3
3447           ;;
3448         *-leon[3-9]v7*)
3449           with_cpu=leon3v7
3450           ;;
3451         *)
3452           with_cpu="`echo ${target} | sed 's/-.*$//'`"
3453           ;;
3454       esac
3455       ;;
3456     visium-*-*)
3457       with_cpu=gr5
3458       ;;
3459   esac
3461   # Avoid overriding --with-cpu-32 and --with-cpu-64 values.
3462   case ${target} in
3463     i[34567]86-*-*|x86_64-*-*)
3464       if test x$with_cpu_32 != x || test x$with_cpu_64 != x; then
3465         if test x$with_cpu_32 = x; then
3466           with_cpu_32=$with_cpu
3467         fi
3468         if test x$with_cpu_64 = x; then
3469           with_cpu_64=$with_cpu
3470         fi
3471         with_cpu=
3472       fi
3473       ;;
3474   esac
3477 # Support for --with-arch and related options (and a few unrelated options,
3478 # too).
3479 case ${with_arch} in
3480   yes | no)
3481     echo "--with-arch must be passed a value" 1>&2
3482     exit 1
3483     ;;
3484 esac
3486 # If there is no $with_arch option, try to infer one from ${target}.
3487 # This block sets nothing except for with_arch.
3488 if test x$with_arch = x ; then
3489   case ${target} in
3490     i[34567]86-*-darwin*|x86_64-*-darwin*)
3491       # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
3492       # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
3493       ;;
3494     i[34567]86-*-elfiamcu)
3495       with_arch=lakemont
3496       ;;
3497     i[34567]86-*-*)
3498       # --with-fpmath sets the default ISA to SSE2, which is the same
3499       # ISA supported by Pentium 4.
3500       if test x$with_fpmath = x || test $arch_without_sse2 = no; then
3501         with_arch=$arch
3502       else
3503         with_arch=pentium4
3504       fi
3505       ;;
3506     x86_64-*-*)
3507       with_arch=$arch
3508       ;;
3509     mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
3510       with_arch=r5900
3511       ;;
3512     mips*-*-vxworks)
3513       with_arch=mips2
3514       ;;
3515   esac
3517   # Avoid overriding --with-arch-32 and --with-arch-64 values.
3518   case ${target} in
3519     i[34567]86-*-darwin*|x86_64-*-darwin*)
3520       # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
3521       # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
3522       ;;
3523     i[34567]86-*-*|x86_64-*-*)
3524       if test x$with_arch_32 != x || test x$with_arch_64 != x; then
3525         if test x$with_arch_32 = x; then
3526           with_arch_32=$with_arch
3527         fi
3528         if test x$with_arch_64 = x; then
3529           if test $arch_without_64bit = yes; then
3530             # Set the default 64bit arch to x86-64 if the default arch
3531             # doesn't support 64bit.
3532             with_arch_64=x86-64
3533           else
3534             with_arch_64=$with_arch
3535           fi
3536         fi
3537         with_arch=
3538       elif test $arch_without_64bit$need_64bit_isa = yesyes; then
3539         # Set the default 64bit arch to x86-64 if the default arch
3540         # doesn't support 64bit and we need 64bit ISA.
3541         with_arch_32=$with_arch
3542         with_arch_64=x86-64
3543         with_arch=
3544       fi
3545       ;;
3546   esac
3549 # Infer a default setting for --with-float.
3550 if test x$with_float = x; then
3551   case ${target} in
3552     mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
3553       # The R5900 doesn't support 64-bit float.  32-bit float doesn't
3554       # comply with IEEE 754.
3555       with_float=soft
3556       ;;
3557   esac
3560 # Infer a default setting for --with-fpu.
3561 if test x$with_fpu = x; then
3562   case ${target} in
3563     mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
3564       # The R5900 FPU only supports single precision.
3565       with_fpu=single
3566       ;;
3567   esac
3570 # Support --with-fpmath.
3571 if test x$with_fpmath != x; then
3572   case ${target} in
3573     i[34567]86-*-* | x86_64-*-*)
3574       case ${with_fpmath} in
3575       avx)
3576         tm_file="${tm_file} i386/avxmath.h"
3577         ;;
3578       sse)
3579         tm_file="${tm_file} i386/ssemath.h"
3580         ;;
3581       *)
3582         echo "Invalid --with-fpmath=$with_fpmath" 1>&2
3583         exit 1
3584         ;;
3585       esac
3586       ;;
3587     *)
3588       echo "--with-fpmath isn't supported for $target." 1>&2
3589       exit 1
3590       ;;
3591   esac
3594 # Similarly for --with-schedule.
3595 if test x$with_schedule = x; then
3596         case ${target} in
3597         hppa1*)
3598                 # Override default PA8000 scheduling model.
3599                 with_schedule=7100LC
3600                 ;;
3601         esac
3604 # Infer a default setting for --with-llsc.
3605 if test x$with_llsc = x; then
3606   case ${target} in
3607     mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
3608       # The R5900 doesn't support LL(D) and SC(D).
3609       with_llsc=no
3610       ;;
3611     mips*-*-linux*)
3612       # The kernel emulates LL and SC where necessary.
3613       with_llsc=yes
3614       ;;
3615   esac
3618 # Validate and mark as valid any --with options supported
3619 # by this target.  In order to use a particular --with option
3620 # you must list it in supported_defaults; validating the value
3621 # is optional.  This case statement should set nothing besides
3622 # supported_defaults.
3624 supported_defaults=
3625 case "${target}" in
3626         aarch64*-*-*)
3627                 supported_defaults="abi cpu arch"
3628                 for which in cpu arch; do
3630                         eval "val=\$with_$which"
3631                         base_val=`echo $val | sed -e 's/\+.*//'`
3632                         ext_val=`echo $val | sed -e 's/[a-z0-9.-]\+//'`
3634                         if [ $which = arch ]; then
3635                           def=aarch64-arches.def
3636                           pattern=AARCH64_ARCH
3637                         else
3638                           def=aarch64-cores.def
3639                           pattern=AARCH64_CORE
3640                         fi
3642                         ext_mask=AARCH64_CPU_DEFAULT_FLAGS
3644                         # Find the base CPU or ARCH id in aarch64-cores.def or
3645                         # aarch64-arches.def
3646                         if [ x"$base_val" = x ] \
3647                             || grep "^$pattern(\"$base_val\"," \
3648                                     ${srcdir}/config/aarch64/$def \
3649                                     > /dev/null; then
3651                           if [ $which = arch ]; then
3652                                 base_id=`grep "^$pattern(\"$base_val\"," \
3653                                   ${srcdir}/config/aarch64/$def | \
3654                                   sed -e 's/^[^,]*,[    ]*//' | \
3655                                   sed -e 's/,.*$//'`
3656                                 # Extract the architecture flags from aarch64-arches.def
3657                                 ext_mask=`grep "^$pattern(\"$base_val\"," \
3658                                    ${srcdir}/config/aarch64/$def | \
3659                                    sed -e 's/)$//' | \
3660                                    sed -e 's/^.*,//'`
3661                           else
3662                                 base_id=`grep "^$pattern(\"$base_val\"," \
3663                                   ${srcdir}/config/aarch64/$def | \
3664                                   sed -e 's/^[^,]*,[    ]*//' | \
3665                                   sed -e 's/,.*$//'`
3666                           fi
3668                           while [ x"$ext_val" != x ]
3669                           do
3670                                 ext_val=`echo $ext_val | sed -e 's/\+//'`
3671                                 ext=`echo $ext_val | sed -e 's/\+.*//'`
3672                                 base_ext=`echo $ext | sed -e 's/^no//'`
3674                                 if [ x"$base_ext" = x ] \
3675                                     || grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3676                                     ${srcdir}/config/aarch64/aarch64-option-extensions.def \
3677                                     > /dev/null; then
3679                                   ext_canon=`grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3680                                         ${srcdir}/config/aarch64/aarch64-option-extensions.def | \
3681                                         sed -e 's/^[^,]*,[      ]*//' | \
3682                                         sed -e 's/,.*$//'`
3683                                   ext_on=`grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3684                                         ${srcdir}/config/aarch64/aarch64-option-extensions.def | \
3685                                         sed -e 's/^[^,]*,[      ]*[^,]*,[       ]*//' | \
3686                                         sed -e 's/,.*$//' | \
3687                                         sed -e 's/).*$//'`
3688                                   ext_off=`grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3689                                         ${srcdir}/config/aarch64/aarch64-option-extensions.def | \
3690                                         sed -e 's/^[^,]*,[      ]*[^,]*,[       ]*[^,]*,[       ]*//' | \
3691                                         sed -e 's/,.*$//' | \
3692                                         sed -e 's/).*$//'`
3695                                   if [ $ext = $base_ext ]; then
3696                                         # Adding extension
3697                                         ext_mask="("$ext_mask") | ("$ext_on" | "$ext_canon")"
3698                                   else
3699                                         # Removing extension
3700                                         ext_mask="("$ext_mask") & ~("$ext_off" | "$ext_canon")"
3701                                   fi
3703                                   true
3704                                 else
3705                                   echo "Unknown extension used in --with-$which=$val" 1>&2
3706                                   exit 1
3707                                 fi
3708                                 ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'`
3709                           done
3711                           ext_mask="(("$ext_mask") << 6)"
3712                           if [ x"$base_id" != x ]; then
3713                                 target_cpu_cname="TARGET_CPU_$base_id | $ext_mask"
3714                           fi
3715                           true
3716                         else
3717                           echo "Unknown $which used in --with-$which=$val" 1>&2
3718                           exit 1
3719                         fi
3720                 done
3721                 ;;
3723         alpha*-*-*)
3724                 supported_defaults="cpu tune"
3725                 for which in cpu tune; do
3726                         eval "val=\$with_$which"
3727                         case "$val" in
3728                         "" \
3729                         | ev4 | ev45 | 21064 | ev5 | 21164 | ev56 | 21164a \
3730                         | pca56 | 21164PC | 21164pc | ev6 | 21264 | ev67 \
3731                         | 21264a)
3732                                 ;;
3733                         *)
3734                                 echo "Unknown CPU used in --with-$which=$val" 1>&2
3735                                 exit 1
3736                                 ;;
3737                         esac
3738                 done
3739                 ;;
3741         arc*-*-*)
3742                 supported_defaults="cpu"
3744                 if [ x"$with_cpu" = x ] \
3745                     || grep "^ARC_CPU ($with_cpu," \
3746                        ${srcdir}/config/arc/arc-cpus.def \
3747                        > /dev/null; then
3748                  # Ok
3749                  true
3750                 else
3751                  echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
3752                  exit 1
3753                 fi
3754                 ;;
3756         arm*-*-*)
3757                 supported_defaults="arch cpu float tune fpu abi mode tls"
3758                 for which in cpu tune arch; do
3759                         # See if it matches a supported value
3760                         eval "val=\$with_$which"
3761                         if [ x"$val" != x ]; then
3762                           cpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
3763                                 -v cmd="chk$which $val" \
3764                                 ${srcdir}/config/arm/arm-cpus.in`
3765                           if [ "$cpu" = "error" ]; then
3766                             echo "Unknown target in --with-$which=$val" 1>&2
3767                             exit 1
3768                           else
3769                             new_val=$cpu
3770                             eval "target_${which}_cname=$new_val"
3771                             echo "For $val real value is $new_val"
3772                           fi
3773                         fi
3774                 done
3776                 case "$with_float" in
3777                 "" \
3778                 | soft | hard | softfp)
3779                         # OK
3780                         ;;
3781                 *)
3782                         echo "Unknown floating point type used in --with-float=$with_float" 1>&2
3783                         exit 1
3784                         ;;
3785                 esac
3787                 # see if --with-fpu matches any of the supported FPUs
3788                 if [ x"$with_fpu" != x ] ; then
3789                   fpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
3790                         -v cmd="chkfpu $with_fpu" \
3791                         ${srcdir}/config/arm/arm-cpus.in`
3792                   if [ "$fpu" = "error"]
3793                   then
3794                     echo "Unknown target in --with-$which=$val" 1>&2
3795                     exit 1
3796                   fi
3797                 fi
3799                 case "$with_abi" in
3800                 "" \
3801                 | apcs-gnu | atpcs | aapcs | iwmmxt | aapcs-linux )
3802                         #OK
3803                         ;;
3804                 *)
3805                         echo "Unknown ABI used in --with-abi=$with_abi"
3806                         exit 1
3807                         ;;
3808                 esac
3810                 case "$with_mode" in
3811                 "" \
3812                 | arm | thumb )
3813                         #OK
3814                         ;;
3815                 *)
3816                         echo "Unknown mode used in --with-mode=$with_mode"
3817                         exit 1
3818                         ;;
3819                 esac
3821                 case "$with_tls" in
3822                 "" \
3823                 | gnu | gnu2)
3824                         # OK
3825                         ;;
3826                 *)
3827                         echo "Unknown TLS method used in --with-tls=$with_tls" 1>&2
3828                         exit 1
3829                         ;;
3830                 esac
3832                 if test "x$with_arch" != x && test "x$with_cpu" != x; then
3833                         echo "Switch \"--with-arch\" may not be used with switch \"--with-cpu\""  1>&2
3834                         exit 1
3835                 fi
3837                 if test "x$with_cpu" != x && test "x$with_tune" != x; then
3838                         echo "Switch \"--with-tune\" may not be used with switch \"--with-cpu\""  1>&2
3839                         exit 1
3840                 fi
3842                 # Add extra multilibs
3843                 if test "x$with_multilib_list" != x; then
3844                         arm_multilibs=`echo $with_multilib_list | sed -e 's/,/ /g'`
3845                         if test "x${arm_multilibs}" != xdefault ; then
3846                                 for arm_multilib in ${arm_multilibs}; do
3847                                         case ${arm_multilib} in
3848                                         aprofile|rmprofile)
3849                                                 tmake_profile_file="arm/t-multilib"
3850                                                 ;;
3851                                         *)
3852                                                 echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2
3853                                                 exit 1
3854                                                 ;;
3855                                         esac
3856                                 done
3857                         fi
3859                         if test "x${tmake_profile_file}" != x ; then
3860                                 # arm/t-aprofile and arm/t-rmprofile are only
3861                                 # designed to work without any with-cpu,
3862                                 # with-arch, with-mode, with-fpu or with-float
3863                                 # options.
3864                                 if test "x$with_arch" != x \
3865                                     || test "x$with_cpu" != x \
3866                                     || test "x$with_float" != x \
3867                                     || test "x$with_fpu" != x \
3868                                     || test "x$with_mode" != x ; then
3869                                     echo "Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=${with_multilib_list}" 1>&2
3870                                     exit 1
3871                                 fi
3872                                 # But pass the default value for float-abi
3873                                 # through to the multilib selector
3874                                 with_float="soft"
3875                                 tmake_file="${tmake_file} ${tmake_profile_file}"
3876                                 TM_MULTILIB_CONFIG="$with_multilib_list"
3877                         fi
3878                 fi
3879                 target_cpu_cname=${target_cpu_cname:-arm6}
3880                 with_cpu=${with_cpu:-$target_cpu_cname}
3881                 ;;
3883         fr*-*-*linux*)
3884                 supported_defaults=cpu
3885                 case "$with_cpu" in
3886                 fr400) ;;
3887                 fr550) ;;
3888                 *)
3889                         echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
3890                         exit 1
3891                         ;;
3892                 esac
3893                 ;;
3895         fido-*-* | m68k*-*-*)
3896                 supported_defaults="arch cpu"
3897                 case "$with_arch" in
3898                 "" | "m68k"| "cf")
3899                         m68k_arch_family="$with_arch"
3900                         ;;
3901                 *)
3902                         echo "Invalid --with-arch=$with_arch" 1>&2
3903                         exit 1
3904                         ;;
3905                 esac
3907                 # We always have a $with_cpu setting here.
3908                 case "$with_cpu" in
3909                 "m68000" | "m68010" | "m68020" | "m68030" | "m68040" | "m68060")
3910                         m68k_cpu_ident=$with_cpu
3911                         ;;
3912                 "m68020-40")
3913                         m68k_cpu_ident=m68020
3914                         tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_40"
3915                         ;;
3916                 "m68020-60")
3917                         m68k_cpu_ident=m68020
3918                         tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_60"
3919                         ;;
3920                 *)
3921                         # We need the C identifier rather than the string.
3922                         m68k_cpu_ident=`awk -v arg="\"$with_cpu\"" \
3923                            'BEGIN { FS="[ \t]*[,()][ \t]*" }; \
3924                             $1 == "M68K_DEVICE" && $2 == arg { print $3 }' \
3925                                  ${srcdir}/config/m68k/m68k-devices.def`
3926                         if [ x"$m68k_cpu_ident" = x ] ; then
3927                                 echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2
3928                                 exit 1
3929                         fi
3930                         with_cpu="mcpu=$with_cpu"
3931                         ;;
3932                 esac
3933                 ;;
3935         hppa*-*-*)
3936                 supported_defaults="arch schedule"
3938                 case "$with_arch" in
3939                 "" | 1.0 | 1.1 | 2.0)
3940                         # OK
3941                         ;;
3942                 *)
3943                         echo "Unknown architecture used in --with-arch=$with_arch" 1>&2
3944                         exit 1
3945                         ;;
3946                 esac
3948                 case "$with_schedule" in
3949                 "" | 700 | 7100 | 7100LC | 7200 | 7300 | 8000)
3950                         # OK
3951                         ;;
3952                 *)
3953                         echo "Unknown processor used in --with-schedule=$with_schedule." 1>&2
3954                         exit 1
3955                         ;;
3956                 esac
3957                 ;;
3959         i[34567]86-*-* | x86_64-*-*)
3960                 supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
3961                 for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do
3962                         eval "val=\$with_$which"
3963                         case " $x86_archs " in
3964                         *" ${val} "*)
3965                                 case "${target}" in
3966                                   x86_64-*-*)
3967                                       case "x$which" in
3968                                         *_32)
3969                                                 ;;
3970                                         *)
3971                                                 echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
3972                                                 exit 1
3973                                                 ;;
3974                                       esac
3975                                       ;;
3976                                 esac
3977                                 # OK
3978                                 ;;
3979                         *)
3980                                 if test x${val} != x; then
3981                                         case " $x86_64_archs " in
3982                                         *" ${val} "*)
3983                                                 # OK
3984                                                 ;;
3985                                         *)
3986                                                 # Allow $x86_cpus --with-cpu=/--with-tune=
3987                                                 case "x$which" in
3988                                                 xcpu*|xtune*)
3989                                                         case " $x86_cpus " in
3990                                                         *" ${val} "*)
3991                                                                 # OK
3992                                                                 ;;
3993                                                         *)
3994                                                                 echo "Unknown CPU given in --with-$which=$val." 1>&2
3995                                                                 exit 1
3996                                                                 ;;
3997                                                         esac
3998                                                         ;;
3999                                                 *)
4000                                                         echo "Unknown CPU given in --with-$which=$val." 1>&2
4001                                                         exit 1
4002                                                         ;;
4003                                                 esac
4004                                         ;;
4005                                         esac
4006                                 fi
4007                                 ;;
4008                         esac
4009                 done
4010                 ;;
4012         riscv*-*-*)
4013                 supported_defaults="abi arch tune"
4015                 case "${target}" in
4016                 riscv32*) xlen=32 ;;
4017                 riscv64*) xlen=64 ;;
4018                 *) echo "Unsupported RISC-V target ${target}" 1>&2; exit 1 ;;
4019                 esac
4021                 # Infer arch from --with-arch, --target, and --with-abi.
4022                 case "${with_arch}" in
4023                 rv32i* | rv32g* | rv64i* | rv64g*)
4024                         # OK.
4025                         ;;
4026                 "")
4027                         # Infer XLEN, but otherwise assume GC.
4028                         case "${with_abi}" in
4029                         ilp32 | ilp32f | ilp32d) with_arch="rv32gc" ;;
4030                         lp64 | lp64f | lp64d) with_arch="rv64gc" ;;
4031                         *) with_arch="rv${xlen}gc" ;;
4032                         esac
4033                         ;;
4034                 *)
4035                         echo "--with-arch=${with_arch} is not supported.  The argument must begin with rv32i, rv32g, rv64i, or rv64g." 1>&2
4036                         exit 1
4037                         ;;
4038                 esac
4040                 # Make sure --with-abi is valid.  If it was not specified,
4041                 # pick a default based on the ISA, preferring soft-float
4042                 # unless the D extension is present.
4043                 case "${with_abi}" in
4044                 ilp32 | ilp32f | ilp32d | lp64 | lp64f | lp64d)
4045                         ;;
4046                 "")
4047                         case "${with_arch}" in
4048                         rv32*d* | rv32g*) with_abi=ilp32d ;;
4049                         rv32*) with_abi=ilp32 ;;
4050                         rv64*d* | rv64g*) with_abi=lp64d ;;
4051                         rv64*) with_abi=lp64 ;;
4052                         esac
4053                         ;;
4054                 *)
4055                         echo "--with-abi=${with_abi} is not supported" 1>&2
4056                         exit 1
4057                         ;;
4058                 esac
4060                 # Make sure ABI and ISA are compatible.
4061                 case "${with_abi},${with_arch}" in
4062                 ilp32,rv32* \
4063                 | ilp32f,rv32*f* | ilp32f,rv32g* \
4064                 | ilp32d,rv32*d* | ilp32d,rv32g* \
4065                 | lp64,rv64* \
4066                 | lp64f,rv64*f* | lp64f,rv64g* \
4067                 | lp64d,rv64*d* | lp64d,rv64g*)
4068                         ;;
4069                 *)
4070                         echo "--with-abi=${with_abi} is not supported for ISA ${with_arch}" 1>&2
4071                         exit 1
4072                         ;;
4073                 esac
4074                 ;;
4076         mips*-*-*)
4077                 supported_defaults="abi arch arch_32 arch_64 float fpu nan fp_32 odd_spreg_32 tune tune_32 tune_64 divide llsc mips-plt synci lxc1-sxc1 madd4"
4079                 case ${with_float} in
4080                 "" | soft | hard)
4081                         # OK
4082                         ;;
4083                 *)
4084                         echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4085                         exit 1
4086                         ;;
4087                 esac
4089                 case ${with_fpu} in
4090                 "" | single | double)
4091                         # OK
4092                         ;;
4093                 *)
4094                         echo "Unknown fpu type used in --with-fpu=$with_fpu" 1>&2
4095                         exit 1
4096                         ;;
4097                 esac
4099                 case ${with_nan} in
4100                 "" | 2008 | legacy)
4101                         # OK
4102                         ;;
4103                 *)
4104                         echo "Unknown NaN encoding used in --with-nan=$with_nan" 1>&2
4105                         exit 1
4106                         ;;
4107                 esac
4109                 case ${with_fp_32} in
4110                 "" | 32 | xx | 64)
4111                         # OK
4112                         ;;
4113                 *)
4114                         echo "Unknown FP mode used in --with-fp-32=$with_fp_32" 1>&2
4115                         exit 1
4116                         ;;
4117                 esac
4119                 case ${with_odd_spreg_32} in
4120                 yes)
4121                         with_odd_spreg_32="odd-spreg"
4122                         ;;
4123                 no)
4124                         with_odd_spreg_32="no-odd-spreg"
4125                         ;;
4126                 "")
4127                         # OK
4128                         ;;
4129                 *)
4130                         echo "Unknown odd-spreg-32 type used in --with-odd-spreg-32=$with_odd_spreg_32" 1>&2
4131                         exit 1
4132                         ;;
4133                 esac
4135                 case ${with_abi} in
4136                 "" | 32 | o64 | n32 | 64 | eabi)
4137                         # OK
4138                         ;;
4139                 *)
4140                         echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
4141                         exit 1
4142                         ;;
4143                 esac
4145                 case ${with_divide} in
4146                 "" | breaks | traps)
4147                         # OK
4148                         ;;
4149                 *)
4150                         echo "Unknown division check type use in --with-divide=$with_divide" 1>&2
4151                         exit 1
4152                         ;;
4153                 esac
4155                 case ${with_llsc} in
4156                 yes)
4157                         with_llsc=llsc
4158                         ;;
4159                 no)
4160                         with_llsc="no-llsc"
4161                         ;;
4162                 "")
4163                         # OK
4164                         ;;
4165                 *)
4166                         echo "Unknown llsc type used in --with-llsc" 1>&2
4167                         exit 1
4168                         ;;
4169                 esac
4171                 case ${with_mips_plt} in
4172                 yes)
4173                         with_mips_plt=plt
4174                         ;;
4175                 no)
4176                         with_mips_plt=no-plt
4177                         ;;
4178                 "")
4179                         ;;
4180                 *)
4181                         echo "Unknown --with-mips-plt argument: $with_mips_plt" 1>&2
4182                         exit 1
4183                         ;;
4184                 esac
4186                 case ${with_synci} in
4187                 yes)
4188                         with_synci=synci
4189                         ;;
4190                 no)
4191                         with_synci=no-synci
4192                         ;;
4193                 "")
4194                         ;;
4195                 *)
4196                         echo "Unknown synci type used in --with-synci" 1>&2
4197                         exit 1
4198                         ;;
4199                 esac
4201                 case ${with_lxc1_sxc1} in
4202                 yes)
4203                         with_lxc1_sxc1=lxc1-sxc1
4204                         ;;
4205                 no)
4206                         with_lxc1_sxc1=no-lxc1-sxc1
4207                         ;;
4208                 "")
4209                         ;;
4210                 *)
4211                         echo "Unknown lxc1-sxc1 type used in --with-lxc1-sxc1" 1>&2
4212                         exit 1
4213                         ;;
4214                 esac
4216                 case ${with_madd4} in
4217                 yes)
4218                         with_madd4=madd4
4219                         ;;
4220                 no)
4221                         with_madd4=no-madd4
4222                         ;;
4223                 "")
4224                         ;;
4225                 *)
4226                         echo "Unknown madd4 type used in --with-madd4" 1>&2
4227                         exit 1
4228                         ;;
4229                 esac
4230                 ;;
4232         nds32*-*-*)
4233                 supported_defaults="arch nds32_lib"
4235                 # process --with-arch
4236                 case "${with_arch}" in
4237                 "" | v2 | v3 | v3m)
4238                         # OK
4239                         ;;
4240                 *)
4241                         echo "Cannot accept --with-arch=$with_arch, available values are: v2 v3 v3m" 1>&2
4242                         exit 1
4243                         ;;
4244                 esac
4246                 # process --with-nds32-lib
4247                 case "${with_nds32_lib}" in
4248                 "")
4249                         # the default library is newlib
4250                         with_nds32_lib=newlib
4251                         ;;
4252                 newlib)
4253                         # OK
4254                         ;;
4255                 mculib)
4256                         # OK
4257                         ;;
4258                 *)
4259                         echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib" 1>&2
4260                         exit 1
4261                         ;;
4262                 esac
4263                 ;;
4265         nios2*-*-*)
4266                 supported_defaults="arch"
4267                         case "$with_arch" in
4268                         "" | r1 | r2)
4269                                 # OK
4270                                 ;;
4271                         *)
4272                                 echo "Unknown arch used in --with-arch=$with_arch" 1>&2
4273                                 exit 1
4274                                 ;;
4275                         esac
4276                 ;;
4278         powerpc*-*-* | rs6000-*-*)
4279                 supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64 advance_toolchain"
4281                 for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
4282                         eval "val=\$with_$which"
4283                         case ${val} in
4284                         default32 | default64)
4285                                 case $which in
4286                                 cpu | tune)
4287                                         ;;
4288                                 *)
4289                                         echo "$val only valid for --with-cpu and --with-tune." 1>&2
4290                                         exit 1
4291                                         ;;
4292                                 esac
4293                                 with_which="with_$which"
4294                                 eval $with_which=
4295                                 ;;
4296                         405cr)
4297                                 tm_defines="${tm_defines} CONFIG_PPC405CR"
4298                                 eval "with_$which=405"
4299                                 ;;
4300                         "" | common | native \
4301                         | power[3456789] | power5+ | power6x \
4302                         | powerpc | powerpc64 | powerpc64le \
4303                         | rs64 \
4304                         | 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
4305                         | 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
4306                         | 604 | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
4307                         | a2 | e300c[23] | 854[08] | e500mc | e500mc64 | e5500 | e6500 \
4308                         | titan | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
4309                                 # OK
4310                                 ;;
4311                         *)
4312                                 echo "Unknown cpu used in --with-$which=$val." 1>&2
4313                                 exit 1
4314                                 ;;
4315                         esac
4316                 done
4318                 case "$with_abi" in
4319                 "" | elfv1 | elfv2 )
4320                         #OK
4321                         ;;
4322                 *)
4323                         echo "Unknown ABI used in --with-abi=$with_abi"
4324                         exit 1
4325                         ;;
4326                 esac
4328                 if test "x$with_advance_toolchain" != x; then
4329                     if test -d "/opt/$with_advance_toolchain/." -a \
4330                         -d "/opt/$with_advance_toolchain/bin/." -a \
4331                         -d "/opt/$with_advance_toolchain/include/."; then
4333                         tm_file="$tm_file ./advance-toolchain.h"
4334                         (at="/opt/$with_advance_toolchain"
4335                          echo "/* Use Advance Toolchain $at */"
4336                          echo
4337                          echo "#undef  LINK_OS_EXTRA_SPEC32"
4338                          echo "#define LINK_OS_EXTRA_SPEC32" \
4339                               "\"%(link_os_new_dtags)" \
4340                               "-rpath $prefix/lib -rpath $at/lib" \
4341                               "-L $prefix/lib -L $at/lib\""
4342                          echo
4343                          echo "#undef  LINK_OS_EXTRA_SPEC64"
4344                          echo "#define LINK_OS_EXTRA_SPEC64" \
4345                               "\"%(link_os_new_dtags)" \
4346                               "-rpath $prefix/lib64 -rpath $at/lib64" \
4347                               "-L $prefix/lib64 -L $at/lib64\""
4348                          echo
4349                          echo "#undef  LINK_OS_NEW_DTAGS_SPEC"
4350                          echo "#define LINK_OS_NEW_DTAGS_SPEC" \
4351                               "\"--enable-new-dtags\""
4352                          echo
4353                          echo "#undef  DYNAMIC_LINKER_PREFIX"
4354                          echo "#define DYNAMIC_LINKER_PREFIX \"$at\""
4355                          echo
4356                          echo "#undef  MD_EXEC_PREFIX"
4357                          echo "#define MD_EXEC_PREFIX \"$at/bin/\""
4358                          echo
4359                          echo "#undef  MD_STARTFILE_PREFIX"
4360                          echo "#define MD_STARTFILE_PREFIX \"$at/lib/\"") \
4361                             > advance-toolchain.h
4362                     else
4363                         echo "Unknown advance-toolchain $with_advance_toolchain"
4364                         exit 1
4365                     fi
4366                 fi
4367                 ;;
4369         s390*-*-*)
4370                 supported_defaults="arch mode tune"
4372                 for which in arch tune; do
4373                         eval "val=\$with_$which"
4374                         case ${val} in
4375                         "" | native | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | arch3 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12)
4376                                 # OK
4377                                 ;;
4378                         *)
4379                                 echo "Unknown cpu used in --with-$which=$val." 1>&2
4380                                 exit 1
4381                                 ;;
4382                         esac
4383                 done
4385                 case ${with_mode} in
4386                 "" | esa | zarch)
4387                         # OK
4388                         ;;
4389                 *)
4390                         echo "Unknown architecture mode used in --with-mode=$with_mode." 1>&2
4391                         exit 1
4392                         ;;
4393                 esac
4394                 ;;
4396         sh[123456ble]*-*-* | sh-*-*)
4397                 supported_defaults="cpu"
4398                 case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in
4399                 "" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
4400                         # OK
4401                         ;;
4402                 m2a | m2a-single | m2a-single-only | m2a-nofpu)
4403                         ;;
4404                 m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
4405                         ;;
4406                 *)
4407                         echo "Unknown CPU used in --with-cpu=$with_cpu, known values:"  1>&2
4408                         echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
4409                         echo "m4a m4a-single m4a-single-only m4a-nofpu m4al" 1>&2
4410                         echo "m2a m2a-single m2a-single-only m2a-nofpu" 1>&2
4411                         exit 1
4412                         ;;
4413                 esac
4414                 ;;
4415         sparc*-*-*)
4416                 supported_defaults="cpu cpu_32 cpu_64 float tune tune_32 tune_64"
4418                 for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
4419                         eval "val=\$with_$which"
4420                         case ${val} in
4421                         "" | sparc | sparcv9 | sparc64 \
4422                         | v7 | cypress \
4423                         | v8 | supersparc | hypersparc | leon | leon3 | leon3v7 \
4424                         | sparclite | f930 | f934 | sparclite86x \
4425                         | sparclet | tsc701 \
4426                         | v9 | ultrasparc | ultrasparc3 | niagara | niagara2 \
4427                         | niagara3 | niagara4 | niagara7 | m8)
4428                                 # OK
4429                                 ;;
4430                         *)
4431                                 echo "Unknown cpu used in --with-$which=$val" 1>&2
4432                                 exit 1
4433                                 ;;
4434                         esac
4435                 done
4437                 case ${with_float} in
4438                 "" | soft | hard)
4439                         # OK
4440                         ;;
4441                 *)
4442                         echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4443                         exit 1
4444                         ;;
4445                 esac
4446                 ;;
4448         spu-*-*)
4449                 supported_defaults="arch tune"
4451                 for which in arch tune; do
4452                         eval "val=\$with_$which"
4453                         case ${val} in
4454                         "" | cell | celledp)
4455                                 # OK
4456                                 ;;
4457                         *)
4458                                 echo "Unknown cpu used in --with-$which=$val." 1>&2
4459                                 exit 1
4460                                 ;;
4461                         esac
4462                 done
4463                 ;;
4465         tic6x-*-*)
4466                 supported_defaults="arch"
4468                 case ${with_arch} in
4469                 "" | c62x | c64x | c64x+ | c67x | c67x+ | c674x)
4470                         # OK
4471                         ;;
4472                 *)
4473                         echo "Unknown arch used in --with-arch=$with_arch." 1>&2
4474                         exit 1
4475                         ;;
4476                 esac
4477                 ;;
4479         v850*-*-*)
4480                 supported_defaults=cpu
4481                 case ${with_cpu} in
4482                 "" | v850e | v850e1 | v850e2 | v850es | v850e2v3 | v850e3v5)
4483                         # OK
4484                         ;;
4485                 *)
4486                         echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4487                         exit 1
4488                         ;;
4489                 esac
4490                 ;;
4491         visium-*-*)
4492                 supported_defaults="cpu"
4493                 case $with_cpu in
4494                   "" | gr5 | gr6)
4495                         ;;
4496                   *)    echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4497                         exit 1
4498                         ;;
4499                 esac
4500                 ;;
4501 esac
4503 # Set some miscellaneous flags for particular targets.
4504 target_cpu_default2=
4505 case ${target} in
4506         aarch64*-*-*)
4507                 if test x"$target_cpu_cname" != x
4508                 then
4509                         target_cpu_default2=$target_cpu_cname
4510                 fi
4511                 ;;
4513         arm*-*-*)
4514                 if test x$with_cpu = x
4515                 then
4516                         echo "Don't know the target cpu" 1>&2
4517                         exit 1
4518                 else
4519                         target_cpu_default2="\\\"$with_cpu\\\""
4520                 fi
4521                 ;;
4523         hppa*-*-*)
4524                 if test x$gas = xyes
4525                 then
4526                         target_cpu_default2="MASK_GAS"
4527                 fi
4528                 ;;
4530         fido*-*-* | m68k*-*-*)
4531                 target_cpu_default2=$m68k_cpu_ident
4532                 tmake_file="m68k/t-opts $tmake_file"
4533                 if [ x"$m68k_arch_family" != x ]; then
4534                         tmake_file="m68k/t-$m68k_arch_family $tmake_file"
4535                 fi
4536                 ;;
4538         i[34567]86-*-darwin* | x86_64-*-darwin*)
4539                 ;;
4540         i[34567]86-*-linux* | x86_64-*-linux*)
4541                 tmake_file="$tmake_file i386/t-linux"
4542                 ;;
4543         i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
4544                 tmake_file="$tmake_file i386/t-kfreebsd"
4545                 ;;
4546         i[34567]86-*-gnu*)
4547                 tmake_file="$tmake_file i386/t-gnu"
4548                 ;;
4549         i[34567]86-*-msdosdjgpp*)
4550                 tmake_file="${tmake_file} i386/t-djgpp"
4551                 ;;
4552         i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
4553                 ;;
4554         i[34567]86-*-cygwin* | x86_64-*-cygwin*)
4555                 ;;
4556         i[34567]86-*-mingw* | x86_64-*-mingw*)
4557                 ;;
4558         i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
4559                 ;;
4560         i[34567]86-*-freebsd* | x86_64-*-freebsd*)
4561                 ;;
4562         ia64*-*-linux*)
4563                 ;;
4565         mips*-*-*)
4566                 if test x$gnu_ld = xyes
4567                 then
4568                         target_cpu_default2="MASK_SPLIT_ADDRESSES"
4569                 fi
4570                 case ${target} in
4571                         mips*el-*-*)
4572                                 tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
4573                                 ;;
4574                 esac
4575                 if test x$with_arch != x; then
4576                         default_mips_arch=$with_arch
4577                 fi
4578                 if test x$with_abi != x; then
4579                         default_mips_abi=$with_abi
4580                 fi
4581                 case ${default_mips_arch} in
4582                     mips1)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=1" ;;
4583                     mips2)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=2" ;;
4584                     mips3)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=3" ;;
4585                     mips4)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=4" ;;
4586                     mips32)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=32" ;;
4587                     mips32r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=33" ;;
4588                     mips32r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=37" ;;
4589                     mips64)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=64" ;;
4590                     mips64r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=65" ;;
4591                     mips64r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=69" ;;
4592                 esac
4593                 case ${default_mips_abi} in
4594                     32)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_32" ;;
4595                     o64)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_O64" ;;
4596                     n32)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_N32" ;;
4597                     64)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_64" ;;
4598                     eabi) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_EABI" ;;
4599                 esac
4600                 tmake_file="mips/t-mips $tmake_file"
4601                 ;;
4603         powerpc*-*-* | rs6000-*-*)
4604                 # FIXME: The PowerPC port uses the value set at compile time,
4605                 # although it's only cosmetic.
4606                 if test "x$with_cpu" != x
4607                 then
4608                         target_cpu_default2="\\\"$with_cpu\\\""
4609                 fi
4610                 out_file="${cpu_type}/${cpu_type}.c"
4611                 c_target_objs="${c_target_objs} ${cpu_type}-c.o"
4612                 cxx_target_objs="${cxx_target_objs} ${cpu_type}-c.o"
4613                 tmake_file="${cpu_type}/t-${cpu_type} ${tmake_file}"
4614                 ;;
4616         sh[123456ble]*-*-* | sh-*-*)
4617                 c_target_objs="${c_target_objs} sh-c.o"
4618                 cxx_target_objs="${cxx_target_objs} sh-c.o"
4619                 ;;
4621         sparc*-*-*)
4622                 # Some standard aliases.
4623                 case x$with_cpu in
4624                 xsparc)
4625                         with_cpu=v7
4626                         ;;
4627                 xsparcv9 | xsparc64)
4628                         with_cpu=v9
4629                         ;;
4630                 esac
4632                 if test x$with_tune = x ; then
4633                       case ${target} in
4634                       *-leon-*)
4635                           with_tune=leon
4636                           ;;
4637                       *-leon[3-9]*)
4638                           with_tune=leon3
4639                           ;;
4640                       esac
4641                 fi
4643                 # The SPARC port checks this value at compile-time.
4644                 target_cpu_default2="TARGET_CPU_$with_cpu"
4645                 ;;
4647         v850*-*-*)
4648                 case "x$with_cpu" in
4649                 x)
4650                         ;;
4651                 xv850e | xv850e1 | xv850e2 | xv850e2v3 | xv850e3v5)
4652                         target_cpu_default2="TARGET_CPU_$with_cpu"
4653                         ;;
4654                 xv850es)
4655                         target_cpu_default2="TARGET_CPU_v850e1"
4656                         ;;
4657                 esac
4658                 ;;
4659         visium-*-*)
4660                 target_cpu_default2="TARGET_CPU_$with_cpu"
4661                 ;;
4662 esac
4665 all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan fp_32 odd_spreg_32 divide llsc mips-plt synci tls lxc1-sxc1 madd4"
4666 for option in $all_defaults
4668         eval "val=\$with_"`echo $option | sed s/-/_/g`
4669         if test -n "$val"; then
4670                 case " $supported_defaults " in
4671                 *" $option "*)
4672                         ;;
4673                 *)
4674                         echo "This target does not support --with-$option." 2>&1
4675                         echo "Valid --with options are: $supported_defaults" 2>&1
4676                         exit 1
4677                         ;;
4678                 esac
4680                 if test "x$t" = x
4681                 then
4682                         t="{ \"$option\", \"$val\" }"
4683                 else
4684                         t="${t}, { \"$option\", \"$val\" }"
4685                 fi
4686         fi
4687 done
4689 if test "x$t" = x
4690 then
4691         configure_default_options="{ { NULL, NULL} }"
4692 else
4693         configure_default_options="{ ${t} }"
4696 if test "$target_cpu_default2" != ""
4697 then
4698         if test "$target_cpu_default" != ""
4699         then
4700                 target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
4701         else
4702                 target_cpu_default=$target_cpu_default2
4703         fi
4706 case ${target} in
4707 i[34567]86-*-* | x86_64-*-*)
4708         if test x$enable_as_accelerator = xyes; then
4709                 extra_programs="mkoffload\$(exeext)"
4710         fi
4711         ;;
4712 esac