config.gcc revision 1.66
1# GCC target-specific configuration file.
2# Copyright (C) 1997-2020 Free Software Foundation, Inc.
3
4#This file is part of GCC.
5
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.
10
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.
15
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/>.
19
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.
25
26# When you change the cases in the OS or target switches, consider
27# updating ../libgcc/config.host also.
28
29# This file switches on the shell variable ${target}, and also uses the
30# following shell variables:
31#
32#  with_*		Various variables as set by configure.
33#
34#  enable_threads	Either the name, yes or no depending on whether
35#			threads support was requested.
36#
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.
46#
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.
56#
57#  gas_flag		Either yes or no depending on whether GNU as was
58#			requested.
59#
60#  gnu_ld_flag		Either yes or no depending on whether GNU ld was
61#			requested.
62
63# This file sets the following shell variables for use by the
64# autoconf-generated configure script:
65#
66#  cpu_type		The name of the cpu, if different from the first
67#			chunk of the canonical target name.
68#
69#  tm_defines		List of target macros to define for all compilations.
70#
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}.
81#
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.
85#
86#  tm_p_file		Location of file with declarations for functions
87#			in $out_file.
88#
89#  tm_d_file		A list of headers with definitions of target hook
90#			macros for the D compiler.
91#
92#  out_file		The name of the machine description C support
93#			file, if different from "$cpu_type/$cpu_type.c".
94#
95#  common_out_file	The name of the source file for code shared between
96#			the compiler proper and the driver.
97#
98#  md_file		The name of the machine-description file, if
99#			different from "$cpu_type/$cpu_type.md".
100#
101#  tmake_file		A list of machine-description-specific
102#			makefile-fragments, if different from
103#			"$cpu_type/t-$cpu_type".
104#
105#  extra_modes          The name of the file containing a list of extra
106#                       machine modes, if necessary and different from
107#                       "$cpu_type/$cpu_type-modes.def".
108#
109#  extra_objs		List of extra objects that should be linked into
110#			the compiler proper (cc1, cc1obj, cc1plus)
111#			depending on target.
112#
113#  extra_gcc_objs	List of extra objects that should be linked into
114#			the compiler driver (gcc) depending on target.
115#
116#  extra_headers	List of used header files from the directory
117#			config/${cpu_type}.
118#
119#  user_headers_inc_next_pre
120#			List of header file names of internal gcc header
121#			files, which should be prefixed by an include_next.
122#  user_headers_inc_next_post
123#			List of header file names of internal gcc header
124#			files, which should be postfixed by an include_next.
125#  use_gcc_tgmath	If set, add tgmath.h to the list of used header
126#			files.
127#
128#  use_gcc_stdint	If "wrap", install a version of stdint.h that
129#			wraps the system's copy for hosted compilations;
130#			if "provide", provide a version of systems without
131#			such a system header; otherwise "none", do not
132#			provide such a header at all.
133#
134#  extra_programs	List of extra executables compiled for this target
135#			machine, used when linking.
136#
137#  extra_options	List of target-dependent .opt files.
138#
139#  c_target_objs	List of extra target-dependent objects that be
140#			linked into the C compiler only.
141#
142#  cxx_target_objs	List of extra target-dependent objects that be
143#			linked into the C++ compiler only.
144#
145#  d_target_objs	List of extra target-dependent objects that be
146#			linked into the D compiler only.
147#
148#  fortran_target_objs	List of extra target-dependent objects that be
149#			linked into the fortran compiler only.
150#
151#  target_gtfiles       List of extra source files with type information.
152#
153#  xm_defines		List of macros to define when compiling for the
154#			target machine.
155#
156#  xm_file		List of files to include when compiling for the
157#			target machine.
158#
159#  use_collect2		Set to yes or no, depending on whether collect2
160#			will be used.
161#
162#  target_cpu_default	Set to override the default target model.
163#
164#  gdb_needs_out_file_path
165#			Set to yes if gdb needs a dir command with
166#			`dirname $out_file`.
167#
168#  thread_file		Set to control which thread package to use.
169#
170#  gas			Set to yes or no depending on whether the target
171#			system normally uses GNU as.
172#
173#  configure_default_options
174#			Set to an initializer for configure_default_options
175#			in configargs.h, based on --with-cpu et cetera.
176#
177#  native_system_header_dir
178#			Where system header files are found for this
179#			target.  This defaults to /usr/include.  If
180#			the --with-sysroot configure option or the
181#			--sysroot command line option is used this
182#			will be relative to the sysroot.
183# target_type_format_char 
184# 			The default character to be used for formatting
185#			the attribute in a
186#			.type symbol_name, ${t_t_f_c}<property>
187#			directive.
188
189# The following variables are used in each case-construct to build up the
190# outgoing variables:
191#
192#  gnu_ld		Set to yes or no depending on whether the target
193#			system normally uses GNU ld.
194#
195#  target_has_targetcm	Set to yes or no depending on whether the target
196#			has its own definition of targetcm.
197#
198#  target_has_targetm_common	Set to yes or no depending on whether the
199#			target has its own definition of targetm_common.
200#
201#  target_has_targetdm	Set to yes or no depending on whether the target
202#			has its own definition of targetdm.
203
204out_file=
205common_out_file=
206tmake_file=
207extra_headers=
208user_headers_inc_next_pre=
209user_headers_inc_next_post=
210use_gcc_tgmath=yes
211use_gcc_stdint=none
212extra_programs=
213extra_objs=
214extra_gcc_objs=
215extra_options=
216c_target_objs=
217cxx_target_objs=
218d_target_objs=
219fortran_target_objs=
220target_has_targetcm=no
221target_has_targetm_common=yes
222target_has_targetdm=no
223tm_defines=
224xm_defines=
225# Set this to force installation and use of collect2.
226use_collect2=
227# Set this to override the default target model.
228target_cpu_default=
229# Set this if gdb needs a dir command with `dirname $out_file`
230gdb_needs_out_file_path=
231# Set this to control which thread package will be used.
232thread_file=
233# Reinitialize these from the flag values every loop pass, since some
234# configure entries modify them.
235gas="$gas_flag"
236gnu_ld="$gnu_ld_flag"
237default_use_cxa_atexit=no
238default_gnu_indirect_function=no
239target_gtfiles=
240need_64bit_isa=
241native_system_header_dir=/usr/include
242target_type_format_char='@'
243
244# Don't carry these over build->host->target.  Please.
245xm_file=
246md_file=
247
248# Obsolete configurations.
249case ${target} in
250  tile*-*-*				\
251 | crisv32-*-*				\
252 | cris-*-linux*			\
253 )
254    if test "x$enable_obsolete" != xyes; then
255      echo "*** Configuration ${target} is obsolete." >&2
256      echo "*** Specify --enable-obsolete to build it anyway." >&2
257      echo "*** Support will be REMOVED in the next major release of GCC," >&2
258      echo "*** unless a maintainer comes forward." >&2
259      exit 1
260    fi;;
261esac
262
263# Unsupported targets list.  Do not put an entry in this list unless
264# it would otherwise be caught by a more permissive pattern.  The list
265# should be in alphabetical order.
266case ${target} in
267 # Avoid special cases that are not obsolete
268   arm*-*-*eabi*			\
269 )
270	;;
271   arm*-wince-pe*			\
272 | arm*-*-ecos-elf			\
273 | arm*-*-elf				\
274 | arm*-*-linux*			\
275 | arm*-*-uclinux*			\
276 | i[34567]86-go32-*			\
277 | i[34567]86-*-go32*			\
278 | m68k-*-uclinuxoldabi*		\
279 | mips64orion*-*-rtems*		\
280 | pdp11-*-bsd				\
281 | powerpc*-*-linux*paired*		\
282 | powerpc*-*-*spe*			\
283 | sparc-hal-solaris2*			\
284 | spu*-*-*				\
285 | thumb-*-*				\
286 | *-*-freebsd[12] | *-*-freebsd[1234].* \
287 | *-*-freebsd*aout*			\
288 | *-*-linux*aout*			\
289 | *-*-linux*coff*			\
290 | *-*-linux*libc1*			\
291 | *-*-linux*oldld*			\
292 | *-*-rtemsaout*			\
293 | *-*-rtemscoff*			\
294 | *-*-solaris2				\
295 | *-*-solaris2.[0-9]			\
296 | *-*-solaris2.[0-9].*			\
297 | *-*-solaris2.10*			\
298 | *-*-sysv*				\
299 | vax-*-vms*				\
300 )
301	echo "*** Configuration ${target} not supported" 1>&2
302	exit 1
303	;;
304esac
305
306# Set default cpu_type, tm_file, tm_p_file and xm_file so it can be
307# updated in each machine entry.  Also set default extra_headers for some
308# machines.
309tm_p_file=
310cpu_type=`echo ${target} | sed 's/-.*$//'`
311cpu_is_64bit=
312case ${target} in
313m32c*-*-*)
314        cpu_type=m32c
315	tmake_file=m32c/t-m32c
316	target_has_targetm_common=no
317        ;;
318aarch64*-*-*)
319	cpu_type=aarch64
320	extra_headers="arm_fp16.h arm_neon.h arm_bf16.h arm_acle.h arm_sve.h"
321	c_target_objs="aarch64-c.o"
322	cxx_target_objs="aarch64-c.o"
323	d_target_objs="aarch64-d.o"
324	extra_objs="aarch64-builtins.o aarch-common.o aarch64-sve-builtins.o aarch64-sve-builtins-shapes.o aarch64-sve-builtins-base.o aarch64-sve-builtins-sve2.o cortex-a57-fma-steering.o aarch64-speculation.o falkor-tag-collision-avoidance.o aarch64-bti-insert.o"
325	target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.c \$(srcdir)/config/aarch64/aarch64-sve-builtins.h \$(srcdir)/config/aarch64/aarch64-sve-builtins.cc"
326	target_has_targetm_common=yes
327	;;
328alpha*-*-*)
329	cpu_type=alpha
330	extra_options="${extra_options} g.opt"
331	;;
332amdgcn*)
333	cpu_type=gcn
334	use_gcc_stdint=wrap
335	;;
336am33_2.0-*-linux*)
337	cpu_type=mn10300
338	;;
339arc*-*-*)
340	cpu_type=arc
341	c_target_objs="arc-c.o"
342	cxx_target_objs="arc-c.o"
343	extra_options="${extra_options} arc/arc-tables.opt g.opt"
344	extra_headers="arc-simd.h"
345	;;
346arm*-*-*)
347	cpu_type=arm
348	extra_objs="arm-builtins.o aarch-common.o"
349	extra_headers="mmintrin.h arm_neon.h arm_acle.h arm_fp16.h arm_cmse.h arm_bf16.h arm_mve_types.h arm_mve.h arm_cde.h"
350	target_type_format_char='%'
351	c_target_objs="arm-c.o"
352	cxx_target_objs="arm-c.o"
353	d_target_objs="arm-d.o"
354	extra_options="${extra_options} arm/arm-tables.opt"
355	target_gtfiles="\$(srcdir)/config/arm/arm-builtins.c"
356	;;
357avr-*-*)
358	cpu_type=avr
359	c_target_objs="avr-c.o"
360	cxx_target_objs="avr-c.o"
361	;;
362bfin*-*)
363	cpu_type=bfin
364	;;
365bpf-*-*)
366	cpu_type=bpf
367	;;
368crisv32-*)
369	cpu_type=cris
370	;;
371frv*)	cpu_type=frv
372	extra_options="${extra_options} g.opt"
373	;;
374ft32*)	cpu_type=ft32
375	target_has_targetm_common=no
376	;;
377moxie*)	cpu_type=moxie
378	target_has_targetm_common=no
379	;;
380fido-*-*)
381	cpu_type=m68k
382	extra_headers=math-68881.h
383	extra_options="${extra_options} m68k/m68k-tables.opt"
384        ;;
385i[34567]86-*-*)
386	cpu_type=i386
387	c_target_objs="i386-c.o"
388	cxx_target_objs="i386-c.o"
389	d_target_objs="i386-d.o"
390	extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o i386-options.o i386-builtins.o i386-expand.o i386-features.o"
391	target_gtfiles="\$(srcdir)/config/i386/i386-builtins.c \$(srcdir)/config/i386/i386-expand.c \$(srcdir)/config/i386/i386-options.c"
392	extra_options="${extra_options} fused-madd.opt"
393	extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
394		       pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
395		       nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
396		       immintrin.h x86intrin.h avxintrin.h xopintrin.h
397		       ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
398		       lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
399		       avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
400		       rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
401		       adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
402		       avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
403		       shaintrin.h clflushoptintrin.h xsavecintrin.h
404		       xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
405		       avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
406		       avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
407		       avx512vbmivlintrin.h avx5124fmapsintrin.h avx5124vnniwintrin.h
408		       avx512vpopcntdqintrin.h clwbintrin.h mwaitxintrin.h
409		       clzerointrin.h pkuintrin.h sgxintrin.h cetintrin.h
410		       gfniintrin.h cet.h avx512vbmi2intrin.h
411		       avx512vbmi2vlintrin.h avx512vnniintrin.h
412		       avx512vnnivlintrin.h vaesintrin.h vpclmulqdqintrin.h
413		       avx512vpopcntdqvlintrin.h avx512bitalgintrin.h
414		       pconfigintrin.h wbnoinvdintrin.h movdirintrin.h
415		       waitpkgintrin.h cldemoteintrin.h avx512bf16vlintrin.h avx512bf16intrin.h
416		       enqcmdintrin.h avx512vp2intersectintrin.h avx512vp2intersectvlintrin.h"
417	;;
418x86_64-*-*)
419	cpu_type=i386
420	c_target_objs="i386-c.o"
421	cxx_target_objs="i386-c.o"
422	d_target_objs="i386-d.o"
423	extra_options="${extra_options} fused-madd.opt"
424	extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o i386-options.o i386-builtins.o i386-expand.o i386-features.o"
425	target_gtfiles="\$(srcdir)/config/i386/i386-builtins.c \$(srcdir)/config/i386/i386-expand.c \$(srcdir)/config/i386/i386-options.c"
426	extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
427		       pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
428		       nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
429		       immintrin.h x86intrin.h avxintrin.h xopintrin.h
430		       ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
431		       lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
432		       avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
433		       rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
434		       adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
435		       avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
436		       shaintrin.h clflushoptintrin.h xsavecintrin.h
437		       xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
438		       avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
439		       avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
440		       avx512vbmivlintrin.h avx5124fmapsintrin.h avx5124vnniwintrin.h
441		       avx512vpopcntdqintrin.h clwbintrin.h mwaitxintrin.h
442		       clzerointrin.h pkuintrin.h sgxintrin.h cetintrin.h
443		       gfniintrin.h cet.h avx512vbmi2intrin.h
444		       avx512vbmi2vlintrin.h avx512vnniintrin.h
445		       avx512vnnivlintrin.h vaesintrin.h vpclmulqdqintrin.h
446		       avx512vpopcntdqvlintrin.h avx512bitalgintrin.h
447		       pconfigintrin.h wbnoinvdintrin.h movdirintrin.h
448		       waitpkgintrin.h cldemoteintrin.h avx512bf16vlintrin.h avx512bf16intrin.h
449		       enqcmdintrin.h avx512vp2intersectintrin.h avx512vp2intersectvlintrin.h"
450	;;
451ia64-*-*)
452	extra_headers=ia64intrin.h
453	extra_options="${extra_options} g.opt fused-madd.opt"
454	;;
455hppa*-*-*)
456	cpu_type=pa
457	;;
458lm32*)
459	extra_options="${extra_options} g.opt"
460	;;
461m32r*-*-*)
462        cpu_type=m32r
463	extra_options="${extra_options} g.opt"
464        ;;
465m5200-*-*|m5407-*-*)
466	cpu_type=m68k
467	extra_headers=math-68881.h
468	extra_options="${extra_options} m68k/m68k-tables.opt"
469	;;
470m680[012]0-*-*)
471	cpu_type=m68k
472	extra_headers=math-68881.h
473	extra_options="${extra_options} m68k/m68k-tables.opt"
474	;;
475m68k-*-*)
476	extra_headers=math-68881.h
477	extra_options="${extra_options} m68k/m68k-tables.opt"
478	;;
479microblaze*-*-*)
480        cpu_type=microblaze
481	extra_options="${extra_options} g.opt"
482        ;;
483mips*-*-*)
484	cpu_type=mips
485	d_target_objs="mips-d.o"
486	extra_headers="loongson.h loongson-mmiintrin.h msa.h"
487	extra_objs="frame-header-opt.o"
488	extra_options="${extra_options} g.opt fused-madd.opt mips/mips-tables.opt"
489	;;
490nds32*)
491	cpu_type=nds32
492	extra_headers="nds32_intrinsic.h nds32_isr.h nds32_init.inc"
493	case ${target} in
494	  nds32*-*-linux*)
495	    extra_options="${extra_options} nds32/nds32-linux.opt"
496	    ;;
497	  nds32*-*-elf*)
498	    extra_options="${extra_options} nds32/nds32-elf.opt"
499	    ;;
500	  *)
501	    ;;
502	esac
503	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 nds32-relax-opt.o nds32-utils.o"
504	;;
505nios2-*-*)
506	cpu_type=nios2
507	extra_options="${extra_options} g.opt"
508	;;
509nvptx-*-*)
510	cpu_type=nvptx
511	;;
512or1k*-*-*)
513	cpu_type=or1k
514	;;
515powerpc*-*-*)
516	cpu_type=rs6000
517	extra_objs="rs6000-string.o rs6000-p8swap.o rs6000-logue.o rs6000-call.o"
518	extra_headers="ppc-asm.h altivec.h htmintrin.h htmxlintrin.h"
519	extra_headers="${extra_headers} bmi2intrin.h bmiintrin.h"
520	extra_headers="${extra_headers} xmmintrin.h mm_malloc.h emmintrin.h"
521	extra_headers="${extra_headers} mmintrin.h x86intrin.h"
522	extra_headers="${extra_headers} pmmintrin.h tmmintrin.h smmintrin.h"
523	extra_headers="${extra_headers} ppu_intrinsics.h spu2vmx.h vec_types.h si2vmx.h"
524	extra_headers="${extra_headers} amo.h"
525	case x$with_cpu in
526	    xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456789]|xpower10|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
527		cpu_is_64bit=yes
528		;;
529	esac
530	extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
531	target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-logue.c \$(srcdir)/config/rs6000/rs6000-call.c"
532	;;
533pru-*-*)
534	cpu_type=pru
535	;;
536riscv*)
537	cpu_type=riscv
538	extra_objs="riscv-builtins.o riscv-c.o riscv-sr.o"
539	d_target_objs="riscv-d.o"
540	;;
541rs6000*-*-*)
542	extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
543	extra_objs="rs6000-string.o rs6000-p8swap.o rs6000-logue.o rs6000-call.o"
544	target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-logue.c \$(srcdir)/config/rs6000/rs6000-call.c"
545	;;
546sparc*-*-*)
547	cpu_type=sparc
548	c_target_objs="sparc-c.o"
549	cxx_target_objs="sparc-c.o"
550	d_target_objs="sparc-d.o"
551	extra_headers="visintrin.h"
552	;;
553s390*-*-*)
554	cpu_type=s390
555	d_target_objs="s390-d.o"
556	extra_options="${extra_options} fused-madd.opt"
557	extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
558	;;
559# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
560sh[123456789lbe]*-*-* | sh-*-*)
561	cpu_type=sh
562	extra_options="${extra_options} fused-madd.opt"
563	extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
564	;;
565v850*-*-*)
566	cpu_type=v850
567	;;
568tic6x-*-*)
569	cpu_type=c6x
570	extra_headers="c6x_intrinsics.h"
571	extra_options="${extra_options} c6x/c6x-tables.opt"
572	;;
573xtensa*-*-*)
574	extra_options="${extra_options} fused-madd.opt"
575	;;
576tilegx*-*-*)
577	cpu_type=tilegx
578	;;
579tilepro*-*-*)
580	cpu_type=tilepro
581	;;
582esac
583
584tm_file=${cpu_type}/${cpu_type}.h
585tm_d_file=${cpu_type}/${cpu_type}.h
586if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
587then
588	tm_p_file=${cpu_type}/${cpu_type}-protos.h
589	tm_d_file="${tm_d_file} ${cpu_type}/${cpu_type}-protos.h"
590fi
591
592extra_modes=
593if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
594then
595	extra_modes=${cpu_type}/${cpu_type}-modes.def
596fi
597if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt
598then
599	extra_options="${extra_options} ${cpu_type}/${cpu_type}.opt"
600fi
601
602case ${target} in
603aarch64*-*-*)
604	tm_p_file="${tm_p_file} arm/aarch-common-protos.h"
605	case ${with_abi} in
606	"")
607		if test "x$with_multilib_list" = xilp32; then
608			tm_file="aarch64/biarchilp32.h ${tm_file}"
609		else
610			tm_file="aarch64/biarchlp64.h ${tm_file}"
611		fi
612		;;
613	ilp32)
614		tm_file="aarch64/biarchilp32.h ${tm_file}"
615		;;
616	lp64)
617		tm_file="aarch64/biarchlp64.h ${tm_file}"
618		;;
619	*)
620		echo "Unknown ABI used in --with-abi=$with_abi"
621		exit 1
622	esac
623	;;
624i[34567]86-*-*)
625	if test "x$with_abi" != x; then
626		echo "This target does not support --with-abi."
627		exit 1
628	fi
629	;;
630x86_64-*-*)
631	case ${with_abi} in
632	"")
633		if test "x$with_multilib_list" = xmx32; then
634			tm_file="i386/biarchx32.h ${tm_file}"
635		else
636			tm_file="i386/biarch64.h ${tm_file}"
637		fi
638		;;
639	64 | m64)
640		tm_file="i386/biarch64.h ${tm_file}"
641		;;
642	x32 | mx32)
643		tm_file="i386/biarchx32.h ${tm_file}"
644		;;
645	*)
646		echo "Unknown ABI used in --with-abi=$with_abi"
647		exit 1
648	esac
649	;;
650arm*-*-*)
651	tm_p_file="arm/arm-flags.h ${tm_p_file} arm/aarch-common-protos.h"
652	;;
653esac
654
655# On a.out targets, we need to use collect2.
656case ${target} in
657*-*-*aout*)
658	use_collect2=yes
659	;;
660esac
661
662# Common C libraries.
663tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
664
665# 32-bit x86 processors supported by --with-arch=.  Each processor
666# MUST be separated by exactly one space.
667x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \
668athlon-xp k6 k6-2 k6-3 geode c3 c3-2 winchip-c6 winchip2 i386 i486 \
669i586 i686 pentium pentium-m pentium-mmx pentium2 pentium3 pentium3m \
670pentium4 pentium4m pentiumpro prescott lakemont"
671
672# 64-bit x86 processors supported by --with-arch=.  Each processor
673# MUST be separated by exactly one space.
674x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \
675bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 k8 k8-sse3 opteron \
676opteron-sse3 nocona core2 corei7 corei7-avx core-avx-i core-avx2 atom \
677slm nehalem westmere sandybridge ivybridge haswell broadwell bonnell \
678silvermont knl knm skylake-avx512 cannonlake icelake-client icelake-server \
679skylake goldmont goldmont-plus tremont cascadelake tigerlake cooperlake x86-64 \
680native"
681
682# Additional x86 processors supported by --with-cpu=.  Each processor
683# MUST be separated by exactly one space.
684x86_cpus="generic intel"
685
686# Common parts for widely ported systems.
687case ${target} in
688*-*-darwin*)
689  tmake_file="t-darwin "
690  tm_file="${tm_file} darwin.h"
691  darwin_os=`echo ${target} | sed 's/.*darwin\([0-9.]*\).*$/\1/'`
692  darwin_maj=`expr "$darwin_os" : '\([0-9]*\).*'`
693  macos_min=`expr "$darwin_os" : '[0-9]*\.\([0-9]*\).*'`
694  macos_maj=10
695  if test x"${macos_min}" = x; then
696    macos_min=0
697  fi
698  def_ld64=85.2
699  case ${target} in
700      # Darwin 4 to 19 correspond to macOS 10.0 to 10.15
701      *-*-darwin[4-9]* | *-*-darwin1[0-9]*)
702        macos_min=`expr $darwin_maj - 4`
703        ;;
704      *-*-darwin20*)
705        # Darwin 20 corresponds to macOS 11.
706        macos_maj=11
707        def_ld64=609.0
708        ;;
709      *-*-darwin)
710        case ${cpu_type} in
711          aarch64) macos_maj=11 ;;
712          x86_64) macos_min=6 ;;
713          *)  macos_min=5 ;;
714          esac
715          case ${host} in
716            *-*-darwin*) tm_defines="$tm_defines DARWIN_USE_KERNEL_VERS" ;;
717            *)
718              # If configuring a cross-compiler then we will have set some
719              #��default above, but it is probably not what was intended.
720              echo "Warning: Using ${target} is only suitable for Darwin hosts" 1>&2
721              echo "configure with an explicit target version" 1>&2
722              ;;
723          esac
724        ;;
725      *)
726        echo "Error: configuring for an unreleased macOS version ${target}" 1>&2
727        exit 1
728        ;;
729  esac
730  tm_defines="$tm_defines DEF_MIN_OSX_VERSION=\\\"${macos_maj}.${macos_min}\\\""
731  tm_defines="$tm_defines DEF_LD64=\\\"${def_ld64}\\\""
732  tm_file="${tm_file} ${cpu_type}/darwin.h"
733  tm_p_file="${tm_p_file} darwin-protos.h"
734  target_gtfiles="$target_gtfiles \$(srcdir)/config/darwin.c"
735  extra_options="${extra_options} darwin.opt"
736  c_target_objs="${c_target_objs} darwin-c.o"
737  cxx_target_objs="${cxx_target_objs} darwin-c.o"
738  fortran_target_objs="darwin-f.o"
739  target_has_targetcm=yes
740  extra_objs="${extra_objs} darwin.o"
741  extra_gcc_objs="darwin-driver.o"
742  default_use_cxa_atexit=yes
743  use_gcc_stdint=wrap
744  case ${enable_threads} in
745    "" | yes | posix) thread_file='posix' ;;
746  esac
747  ;;
748*-*-dragonfly*)
749  gas=yes
750  gnu_ld=yes
751  tmake_file="t-slibgcc"
752  case ${enable_threads} in
753    "" | yes | posix)
754      thread_file='posix'
755      ;;
756    no | single)
757      # Let these non-posix thread selections fall through if requested
758      ;;
759    *)
760      echo 'Unknown thread configuration for DragonFly BSD'
761      exit 1
762      ;;
763  esac
764  extra_options="$extra_options rpath.opt dragonfly.opt"
765  default_use_cxa_atexit=yes
766  use_gcc_stdint=wrap
767  ;;
768*-*-freebsd*)
769  # This is the generic ELF configuration of FreeBSD.  Later
770  # machine-specific sections may refine and add to this
771  # configuration.
772  #
773  # Due to tm_file entry ordering issues that vary between cpu
774  # architectures, we only define fbsd_tm_file to allow the
775  # machine-specific section to dictate the final order of all
776  # entries of tm_file with the minor exception that components
777  # of the tm_file set here will always be of the form:
778  #
779  # freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd-spec.h freebsd.h
780  #
781  # The machine-specific section should not tamper with this
782  # ordering but may order all other entries of tm_file as it
783  # pleases around the provided core setting.
784  gas=yes
785  gnu_ld=yes
786  fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
787  if test "$fbsd_major" = ""; then
788    echo "Specify the major version number of the targeted FreeBSD release"
789    echo "like this: --target=amd64-unknown-freebsd10.1"
790    exit 1
791  fi
792  tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
793  tmake_file="t-slibgcc"
794  case ${enable_threads} in
795    no)
796      fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h"
797      ;;
798    "" | yes | posix)
799      thread_file='posix'
800      ;;
801    *)
802      echo 'Unknown thread configuration for FreeBSD'
803      exit 1
804      ;;
805  esac
806  fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h freebsd-stdint.h"
807  extra_options="$extra_options rpath.opt freebsd.opt"
808  case ${target} in
809    *-*-freebsd[345].*)
810      :;;
811    *)
812      default_use_cxa_atexit=yes;;
813  esac
814  use_gcc_stdint=wrap
815  ;;
816*-*-fuchsia*)
817  native_system_header_dir=/include
818  ;;
819*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
820  extra_options="$extra_options gnu-user.opt"
821  gas=yes
822  gnu_ld=yes
823  case ${enable_threads} in
824    "" | yes | posix) thread_file='posix' ;;
825  esac
826  tmake_file="t-slibgcc"
827  case $target in
828    *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
829      :;;
830    *-*-gnu*)
831      native_system_header_dir=/include
832      ;;
833  esac
834  # Linux C libraries selection switch: glibc / uclibc / bionic.
835  # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
836  case $target in
837    *linux*)
838      tm_p_file="${tm_p_file} linux-protos.h"
839      tmake_file="${tmake_file} t-linux"
840      extra_objs="${extra_objs} linux.o"
841      extra_options="${extra_options} linux.opt"
842      ;;
843  esac
844  case $target in
845    *-*-*android*)
846      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
847      ;;
848    *-*-*uclibc* | *-*-uclinuxfdpiceabi)
849      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
850      ;;
851    *-*-*musl*)
852      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
853      ;;
854    *)
855      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
856      ;;
857  esac
858  # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit
859  # is provided.
860  default_use_cxa_atexit=yes
861  use_gcc_tgmath=no
862  use_gcc_stdint=wrap
863  # Enable compilation for Android by default for *android* targets.
864  case $target in
865    *-*-*android*)
866      tm_defines="$tm_defines ANDROID_DEFAULT=1"
867      ;;
868    *)
869      tm_defines="$tm_defines ANDROID_DEFAULT=0"
870      ;;
871  esac
872  c_target_objs="${c_target_objs} glibc-c.o"
873  cxx_target_objs="${cxx_target_objs} glibc-c.o"
874  d_target_objs="${d_target_objs} glibc-d.o"
875  tmake_file="${tmake_file} t-glibc"
876  target_has_targetcm=yes
877  target_has_targetdm=yes
878  ;;
879*-*-netbsd*)
880  tm_p_file="${tm_p_file} netbsd-protos.h"
881  tmake_file="t-netbsd t-slibgcc"
882  extra_objs="${extra_objs} netbsd.o"
883  d_target_objs="${d_target_objs} netbsd-d.o"
884  gas=yes
885  gnu_ld=yes
886  use_gcc_stdint=wrap
887  case ${enable_threads} in
888    "" | yes | posix) thread_file='posix' ;;
889  esac
890  case ${target} in
891    arm*-* | i[34567]86-* | powerpc*-* | sparc*-* | x86_64-*)
892      default_gnu_indirect_function=yes
893      ;;
894  esac
895  nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
896  default_use_cxa_atexit=yes
897  target_has_targetdm=yes
898  case ${target} in
899    arm*-* | i[34567]86-* | powerpc*-* | sparc*-* | x86_64-*)
900      default_gnu_indirect_function=yes
901      ;;
902  esac
903  ;;
904*-*-openbsd*)
905  tmake_file="t-openbsd"
906  case ${enable_threads} in
907    yes)
908      thread_file='posix'
909      ;;
910  esac
911  case ${target} in
912    *-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
913      default_use_cxa_atexit=yes
914      ;;
915  esac
916  ;;
917*-*-phoenix*)
918  gas=yes
919  gnu_ld=yes
920  default_use_cxa_atexit=yes
921  ;;
922*-*-rtems*)
923  case ${enable_threads} in
924    "" | yes | rtems) thread_file='rtems' ;;
925    posix) thread_file='posix' ;;
926    no) ;;
927    *)
928      echo 'Unknown thread configuration for RTEMS'
929      exit 1
930      ;;
931  esac
932  tmake_file="${tmake_file} t-rtems"
933  extra_options="${extra_options} rtems.opt"
934  default_use_cxa_atexit=yes
935  use_gcc_stdint=wrap
936  ;;
937*-*-uclinux*)
938  extra_options="$extra_options gnu-user.opt"
939  use_gcc_stdint=wrap
940  case ${enable_threads} in
941    "" | yes | posix) thread_file='posix' ;;
942  esac
943  tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
944  ;;
945*-*-rdos*)
946  use_gcc_stdint=wrap
947  ;;
948*-*-solaris2*)
949  # i?86-*-solaris2* needs to insert headers between cpu default and
950  # Solaris 2 specific ones.
951  sol2_tm_file_head="dbxelf.h elfos.h ${cpu_type}/sysv4.h"
952  sol2_tm_file_tail="${cpu_type}/sol2.h sol2.h"
953  sol2_tm_file="${sol2_tm_file_head} ${sol2_tm_file_tail}"
954  case ${target} in
955    *-*-solaris2.1[1-9]*)
956      # __cxa_atexit was introduced in Solaris 11.4.
957      default_use_cxa_atexit=yes
958      ;;
959  esac
960  use_gcc_stdint=wrap
961  if test x$gnu_ld = xyes; then
962    tm_file="usegld.h ${tm_file}"
963  fi
964  if test x$gas = xyes; then
965    tm_file="usegas.h ${tm_file}"
966  fi
967  tm_p_file="${tm_p_file} sol2-protos.h"
968  tmake_file="${tmake_file} t-sol2 t-slibgcc"
969  c_target_objs="${c_target_objs} sol2-c.o"
970  cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o"
971  d_target_objs="${d_target_objs} sol2-d.o"
972  extra_objs="${extra_objs} sol2.o sol2-stubs.o"
973  extra_options="${extra_options} sol2.opt"
974  case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
975    "":yes:* | yes:yes:* )
976      thread_file=posix
977      ;;
978  esac
979  target_has_targetdm=yes
980  ;;
981*-*-*vms*)
982  extra_options="${extra_options} vms/vms.opt"
983  xmake_file=vms/x-vms
984  tmake_file="vms/t-vms t-slibgcc"
985  extra_objs="vms.o"
986  target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.c"
987  tm_p_file="${tm_p_file} vms/vms-protos.h"
988  xm_file="vms/xm-vms.h"
989  c_target_objs="vms-c.o"
990  cxx_target_objs="vms-c.o"
991  fortran_target_objs="vms-f.o"
992  use_gcc_stdint=provide
993  tm_file="${tm_file} vms/vms-stdint.h"
994  if test x$gnu_ld != xyes; then
995    # Build wrappers for native case.
996    extra_programs="ld\$(exeext) ar\$(exeext)"
997    tmake_file="$tmake_file vms/t-vmsnative"
998  fi
999  ;;
1000*-*-vxworks*)
1001  tmake_file=t-vxworks
1002  xm_defines=POSIX
1003
1004  extra_options="${extra_options} vxworks.opt"
1005  extra_objs="$extra_objs vxworks.o"
1006
1007  c_target_objs="${c_target_objs} vxworks-c.o"
1008  cxx_target_objs="${cxx_target_objs} vxworks-c.o"
1009  extra_headers="${extra_headers} ../vxworks/vxworks-predef.h"
1010  target_has_targetcm="yes"
1011
1012  # This private header exposes a consistent interface for checks on
1013  # the VxWorks version our runtime header files need to perform, based on
1014  # what the system headers adverstise:
1015
1016  extra_headers="${extra_headers} ../vxworks/_vxworks-versions.h"
1017
1018  # Starting from VxWorks 7, the system comes with a Dinkumware
1019  # environment which requires the inclusion of "yvals.h" before other
1020  # system headers.  We provide wrapped versions of a few headers to
1021  # accomodate such constraints:
1022
1023  extra_headers="${extra_headers} ../vxworks/_yvals.h"
1024  extra_headers="${extra_headers} ../vxworks/_yvals-wrapper.h"
1025
1026  extra_headers="${extra_headers} ../vxworks/math.h ../vxworks/complex.h"
1027  extra_headers="${extra_headers} ../vxworks/inttypes.h ../vxworks/setjmp.h"
1028
1029  # We provide stdint.h ...
1030
1031  tm_file="${tm_file} vxworks-stdint.h"
1032
1033  # .. only through the yvals conditional wrapping mentioned above
1034  # to abide by the VxWorks 7 expectations.  The final copy is performed
1035  # explicitly by a t-vxworks Makefile rule.
1036
1037  use_gcc_stdint=none
1038  extra_headers="${extra_headers} ../../ginclude/stdint-gcc.h"
1039
1040  case ${enable_threads} in
1041    no) ;;
1042    "" | yes | vxworks) thread_file='vxworks' ;;
1043    *) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
1044  esac
1045
1046  # A few common macro definitions conveying general characteristics
1047  # of the configuration at hand. Note that by VxWorks 7, we mean the
1048  # the SR6xx major update or beyond in vendor parlance:
1049
1050  case $target in
1051    *-*-vxworks7*)
1052      tm_defines="$tm_defines TARGET_VXWORKS7=1"
1053      ;;
1054  esac
1055  case $target in
1056    *64-*-vxworks*)
1057      tm_defines="$tm_defines TARGET_VXWORKS64=1"
1058      ;;
1059  esac
1060
1061  # Then a few build configuration controls for VxWorks 7, which
1062  # has specificities on top of which we aim to provide more complete
1063  # C++ support:
1064
1065  case $target in
1066    *-*-vxworks7*)
1067      # VxWorks 7 always has init/fini_array support and it is simpler to
1068      # just leverage this, sticking to what the system toolchain does:
1069      gcc_cv_initfini_array=yes
1070      ;;
1071  esac
1072  ;;
1073*-*-elf|arc*-*-elf*)
1074  # Assume that newlib is being used and so __cxa_atexit is provided.
1075  default_use_cxa_atexit=yes
1076  use_gcc_stdint=wrap
1077  ;;
1078esac
1079
1080case ${target} in
1081aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
1082	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
1083	tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h"
1084	tmake_file="${tmake_file} aarch64/t-aarch64"
1085	case $target in
1086	aarch64-*-elf*)
1087		use_gcc_stdint=wrap
1088		;;
1089        aarch64-*-fuchsia*)
1090                tm_file="${tm_file} fuchsia.h"
1091                ;;
1092	aarch64-*-rtems*)
1093	  	tm_file="${tm_file} rtems.h aarch64/rtems.h"
1094		;;
1095	esac
1096	case $target in
1097	aarch64_be-*)
1098		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1099		;;
1100	esac
1101	aarch64_multilibs="${with_multilib_list}"
1102	if test "$aarch64_multilibs" = "default"; then
1103		aarch64_multilibs="lp64,ilp32"
1104	fi
1105	aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
1106	for aarch64_multilib in ${aarch64_multilibs}; do
1107		case ${aarch64_multilib} in
1108		ilp32 | lp64 )
1109			TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
1110			;;
1111		*)
1112			echo "--with-multilib-list=${aarch64_multilib} not supported."
1113			exit 1
1114		esac
1115	done
1116	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
1117	;;
1118aarch64*-*-freebsd*)
1119	tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file}"
1120	tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-freebsd.h"
1121	tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
1122	tm_defines="${tm_defines}  TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
1123	;;
1124aarch64*-*-netbsd*)
1125	tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file}"
1126	tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-netbsd.h"
1127	tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd"
1128	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1129	case $target in
1130	aarch64_be-*)
1131		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1132		;;
1133	esac
1134	;;
1135aarch64*-*-linux*)
1136	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
1137	tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-linux.h"
1138	tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
1139	tm_defines="${tm_defines}  TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
1140	case $target in
1141	aarch64_be-*)
1142		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1143		;;
1144	esac
1145	aarch64_multilibs="${with_multilib_list}"
1146	if test "$aarch64_multilibs" = "default"; then
1147		# TODO: turn on ILP32 multilib build after its support is mature.
1148		# aarch64_multilibs="lp64,ilp32"
1149		aarch64_multilibs="lp64"
1150	fi
1151	aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
1152	for aarch64_multilib in ${aarch64_multilibs}; do
1153		case ${aarch64_multilib} in
1154		ilp32 | lp64 )
1155			TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
1156			;;
1157		*)
1158			echo "--with-multilib-list=${aarch64_multilib} not supported."
1159			exit 1
1160		esac
1161	done
1162	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
1163	;;
1164aarch64*-wrs-vxworks*)
1165        tm_file="${tm_file} elfos.h aarch64/aarch64-elf.h"
1166        tm_file="${tm_file} vx-common.h vxworks.h aarch64/aarch64-vxworks.h"
1167        tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-vxworks"
1168        ;;
1169alpha*-*-linux*)
1170	tm_file="elfos.h ${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
1171	tmake_file="${tmake_file} alpha/t-linux alpha/t-alpha"
1172	extra_options="${extra_options} alpha/elf.opt"
1173	;;
1174alpha*-*-netbsd*)
1175	tm_file="elfos.h ${tm_file} ${nbsd_tm_file} alpha/elf.h alpha/netbsd.h"
1176	tmake_file="${tmake_file} alpha/t-alpha"
1177	extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
1178		       alpha/elf.opt"
1179	;;
1180alpha*-*-openbsd*)
1181	tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
1182	tm_file="elfos.h alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
1183	tmake_file="${tmake_file} alpha/t-alpha"
1184	extra_options="${extra_options} openbsd.opt alpha/elf.opt"
1185	# default x-alpha is only appropriate for dec-osf.
1186	;;
1187alpha*-dec-*vms*)
1188	tm_file="${tm_file} vms/vms.h alpha/vms.h"
1189	tmake_file="${tmake_file} alpha/t-vms alpha/t-alpha"
1190	;;
1191arc*-*-elf*)
1192	tm_file="arc/arc-arch.h dbxelf.h elfos.h newlib-stdint.h arc/elf.h ${tm_file}"
1193	tmake_file="arc/t-multilib arc/t-arc"
1194	extra_gcc_objs="driver-arc.o"
1195	if test "x$with_cpu" != x; then
1196		tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
1197	fi
1198	if test x${with_endian} = x; then
1199		case ${target} in
1200		arc*be-*-* | arc*eb-*-*)	with_endian=big ;;
1201		*)				with_endian=little ;;
1202		esac
1203	fi
1204	case ${with_endian} in
1205	big|little)		;;
1206	*)	echo "with_endian=${with_endian} not supported."; exit 1 ;;
1207	esac
1208	case ${with_endian} in
1209	big*)	tm_file="arc/big.h ${tm_file}"
1210	esac
1211	;;
1212arc*-*-linux*)
1213	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}"
1214	tmake_file="${tmake_file} arc/t-multilib-linux arc/t-arc"
1215	extra_gcc_objs="driver-arc.o"
1216	if test "x$with_cpu" != x; then
1217		tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
1218	fi
1219	if test x${with_endian} = x; then
1220		case ${target} in
1221		arc*be-*-* | arc*eb-*-*)	with_endian=big ;;
1222		*)				with_endian=little ;;
1223		esac
1224	fi
1225	case ${with_endian} in
1226	big|little)		;;
1227	*)	echo "with_endian=${with_endian} not supported."; exit 1 ;;
1228	esac
1229	case ${with_endian} in
1230	big*)	tm_file="arc/big.h ${tm_file}"
1231	esac
1232	# Force .init_array support.  The configure script cannot always
1233	# automatically detect that GAS supports it, yet we require it.
1234	gcc_cv_initfini_array=yes
1235	;;
1236arm-wrs-vxworks7*)
1237	# We only support VxWorks 7 now on ARM, post SR600.  Pre SR600
1238	# VxWorks 7 was transitory and major versions prior to 7 were based
1239	# on long deprecated ABI, not supported at all any more regardless
1240	# of VxWorks.
1241	extra_options="${extra_options} arm/vxworks.opt"
1242	tmake_file="${tmake_file} arm/t-arm arm/t-vxworks arm/t-bpabi"
1243	tm_file="elfos.h arm/elf.h arm/bpabi.h arm/aout.h ${tm_file}"
1244	tm_file="${tm_file} vx-common.h vxworks.h arm/vxworks.h"
1245	target_cpu_cname="generic-armv7-a"
1246	need_64bit_hwint=yes
1247	;;
1248arm*-*-freebsd*)                # ARM FreeBSD EABI
1249	tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h"
1250	case $target in
1251	arm*b-*-freebsd*)
1252	    tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1253	    ;;
1254	esac
1255	tmake_file="${tmake_file} arm/t-arm arm/t-bpabi"
1256	tm_file="${tm_file} arm/bpabi.h arm/freebsd.h arm/aout.h arm/arm.h"
1257	case $target in
1258	armv6*-*-freebsd*)
1259	    target_cpu_cname="arm1176jzf-s"
1260            if test $fbsd_major -ge 11; then
1261               tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
1262            fi
1263	    ;;
1264	armv7*-*-freebsd*)
1265	    target_cpu_cname="generic-armv7-a"
1266	    tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
1267	    ;;
1268	*)
1269	    target_cpu_cname="arm9"
1270	    ;;
1271	esac
1272	with_tls=${with_tls:-gnu}
1273	;;
1274arm*-*-netbsdelf*)
1275	tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
1276	tmake_file="${tmake_file} arm/t-arm"
1277	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1278	case ${target} in
1279	arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;
1280	esac
1281	case ${target} in
1282	arm*-*-netbsdelf-*eabi*)
1283	    tm_file="${tm_file} arm/bpabi.h arm/netbsd-eabi.h"
1284	    # GCC 7 vs NetBSD/eabi -> avoid arm unwinder
1285	    #tmake_file="$tmake_file arm/t-bpabi"
1286	    tmake_file="$tmake_file arm/t-netbsdeabi"
1287	    # The EABI requires the use of __cxa_atexit.
1288	    default_use_cxa_atexit=yes
1289	    ;;
1290	*)
1291	    tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
1292	    #tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
1293	    tmake_file="$tmake_file arm/t-netbsd"
1294	    ;;
1295	esac
1296	tm_file="${tm_file} arm/aout.h arm/arm.h"
1297	case ${target} in
1298	arm*-*-netbsdelf-*eabihf*)
1299	    tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
1300	    ;;
1301	esac
1302	case ${target} in
1303	armv4*) with_cpu=${with_cpu:-strongarm};;
1304	armv6*) with_cpu=${with_cpu:-arm1176jzf-s};;
1305	armv7*) with_cpu=${with_cpu:-cortex-a8};;
1306	arm*eabihf*) with_cpu=${with_cpu:-arm10e};;
1307	arm*) with_cpu=${with_cpu:-arm9e};;
1308	esac
1309	target_cpu_cname="$with_cpu"
1310	;;
1311arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
1312	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"
1313	extra_options="${extra_options} linux-android.opt"
1314	case $target in
1315	arm*b-*-linux*)
1316	    tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1317	    ;;
1318	esac
1319	tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
1320	tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h"
1321	case $target in
1322	arm*-*-uclinuxfdpiceabi)
1323	    tm_file="$tm_file arm/uclinuxfdpiceabi.h"
1324	    ;;
1325	esac
1326	# Generation of floating-point instructions requires at least ARMv5te.
1327	if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then
1328	    target_cpu_cname="arm10e"
1329	else
1330	    target_cpu_cname="arm10tdmi"
1331	fi
1332	# Define multilib configuration for arm-linux-androideabi.
1333	case ${target} in
1334	*-androideabi)
1335	    tmake_file="$tmake_file arm/t-linux-androideabi"
1336	    ;;
1337	esac
1338	# The EABI requires the use of __cxa_atexit.
1339	default_use_cxa_atexit=yes
1340	with_tls=${with_tls:-gnu}
1341	;;
1342arm*-*-uclinux*eabi*)		# ARM ucLinux
1343	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
1344	tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi"
1345	tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h arm/aout.h arm/arm.h"
1346	target_cpu_cname="arm7tdmi"
1347	# The EABI requires the use of __cxa_atexit.
1348	default_use_cxa_atexit=yes
1349	;;
1350arm*-*-phoenix*)
1351	tm_file="elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
1352	tm_file="${tm_file} newlib-stdint.h phoenix.h"
1353	tm_file="${tm_file} arm/aout.h arm/arm.h"
1354	tmake_file="${tmake_file} arm/t-arm arm/t-bpabi arm/t-phoenix"
1355	target_cpu_cname="arm7tdmi"
1356	;;
1357arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*)
1358	case ${target} in
1359	arm*eb-*-eabi*)
1360	  tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1361	esac
1362	default_use_cxa_atexit=yes
1363	tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
1364	tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf"
1365	target_cpu_cname="arm7tdmi"
1366	case ${target} in
1367	arm*-*-eabi*)
1368	  tm_file="$tm_file newlib-stdint.h"
1369	  tmake_file="${tmake_file} arm/t-bpabi"
1370	  use_gcc_stdint=wrap
1371	  ;;
1372	arm*-*-fuchsia*)
1373	  tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
1374	  tmake_file="${tmake_file} arm/t-bpabi arm/t-fuchsia"
1375	  target_cpu_cname="generic-armv7-a"
1376	  ;;
1377	arm*-*-rtems*)
1378	  tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h"
1379	  tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems"
1380	  ;;
1381	arm*-*-symbianelf*)
1382	  tm_file="${tm_file} arm/symbian.h"
1383	  # We do not include t-bpabi for Symbian OS because the system
1384	  # provides its own implementation of the BPABI functions.
1385	  tmake_file="${tmake_file} arm/t-symbian"
1386	  target_cpu_cname="arm10tdmi"
1387	  ;;
1388	esac
1389	tm_file="${tm_file} arm/aout.h arm/arm.h"
1390	;;
1391avr-*-*)
1392	tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h avr/specs.h dbxelf.h avr/avr-stdint.h"
1393	if test x${with_avrlibc} != xno; then
1394	    tm_file="${tm_file} ${cpu_type}/avrlibc.h"
1395	    tm_defines="${tm_defines} WITH_AVRLIBC"
1396	fi
1397	# Work out avr_double_comparison which is 2 or 3 and is used in
1398	# target hook FLOAT_LIB_COMPARE_RETURNS_BOOL to determine whether
1399	# DFmode comparisons return 3-state or 2-state results.
1400	case y${with_double_comparison} in
1401	    y | ytristate)
1402		avr_double_comparison=3
1403		;;
1404	    ybool | ylibf7)
1405		avr_double_comparison=2
1406		;;
1407	    *)
1408		echo "Error: --with-double-comparison= can only be used with: 'tristate', 'bool', 'libf7'" 1>&2
1409		exit 1
1410		;;
1411	esac
1412	case "y${with_libf7}" in
1413	    yno)
1414		# avr_double_comparison as set above.
1415		;;
1416	    ylibgcc)
1417		avr_double_comparison=2
1418		tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1419		;;
1420	    y | yyes | ymath-symbols)
1421		avr_double_comparison=2
1422		tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1423		tm_defines="${tm_defines} WITH_LIBF7_MATH"
1424		tm_defines="${tm_defines} WITH_LIBF7_MATH_SYMBOLS"
1425		;;
1426	    ymath)
1427		avr_double_comparison=2
1428		tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1429		tm_defines="${tm_defines} WITH_LIBF7_MATH"
1430		;;
1431	    *)
1432		echo "Error: --with-libf7=${with_libf7} but can only be used with: 'libgcc', 'math', 'math-symbols', 'yes', 'no'" 1>&2
1433		exit 1
1434		;;
1435	esac
1436	tm_defines="${tm_defines} WITH_DOUBLE_COMPARISON=${avr_double_comparison}"
1437	case y${with_double} in
1438	    y32)
1439		avr_double=32
1440		tm_defines="${tm_defines} HAVE_DOUBLE32"
1441		;;
1442	    y64)
1443		avr_double=64
1444		tm_defines="${tm_defines} HAVE_DOUBLE64"
1445		;;
1446	    y64,32)
1447		avr_double=64
1448		avr_double_multilib=1
1449		tm_defines="${tm_defines} HAVE_DOUBLE32"
1450		tm_defines="${tm_defines} HAVE_DOUBLE64"
1451		tm_defines="${tm_defines} HAVE_DOUBLE_MULTILIB"
1452		;;
1453	    y | y32,64)
1454		avr_double=32
1455		avr_double_multilib=1
1456		tm_defines="${tm_defines} HAVE_DOUBLE32"
1457		tm_defines="${tm_defines} HAVE_DOUBLE64"
1458		tm_defines="${tm_defines} HAVE_DOUBLE_MULTILIB"
1459		;;
1460	    *)
1461		echo "Error: --with-double= can only be used with: '32', '32,64', '64,32', '64'" 1>&2
1462		exit 1
1463		;;
1464	esac
1465	case y${with_long_double} in
1466	    y32)
1467		avr_long_double=32
1468		tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1469		;;
1470	    y64)
1471		avr_long_double=64
1472		tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1473		;;
1474	    y | y64,32)
1475		avr_long_double=64
1476		avr_long_double_multilib=1
1477		tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1478		tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1479		tm_defines="${tm_defines} HAVE_LONG_DOUBLE_MULTILIB"
1480		;;
1481	    y32,64)
1482		avr_long_double=32
1483		avr_long_double_multilib=1
1484		tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1485		tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1486		tm_defines="${tm_defines} HAVE_LONG_DOUBLE_MULTILIB"
1487		;;
1488	    ydouble)
1489		avr_long_double=${avr_double}
1490		tm_defines="${tm_defines} HAVE_LONG_DOUBLE_IS_DOUBLE"
1491		if test y${avr_double_multilib} = y1; then
1492		    tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1493		    tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1494		else
1495		    tm_defines="${tm_defines} HAVE_LONG_DOUBLE${avr_long_double}"
1496		fi
1497		;;
1498	    *)
1499		echo "Error: --with-long_double= can only be used with: '32', '32,64', '64,32', '64', 'double'" 1>&2
1500		exit 1
1501		;;
1502	esac
1503	if test ${avr_long_double}x${avr_long_double_multilib}y${avr_double_multilib}z = 32xy1z; then
1504	    if test y${with_long_double} != ydouble; then
1505		echo "Error: --with-double=${with_double} requests a multilib for double, but long double is always 32 bits wide due to --with-long-double=${with_long_double}" 1>&2
1506		exit 1
1507	    fi
1508	fi
1509	if test ${avr_double}x${avr_long_double_multilib}y${avr_double_multilib}z = 64x1yz; then
1510	    echo "Error: --with-long-double=${with_long_double} requests a multilib for long double, but double is always 64 bits wide due to --with-double=64" 1>&2
1511	    exit 1
1512	fi
1513	if test y${avr_double}${avr_long_double} = y6432; then
1514	    echo "Error: double default of 64 bits from --with-double=${with_double} conflicts with default of 32 bits for long double from --with-long-double=${with_long_double}" 1>&2
1515	    exit 1
1516	fi
1517	tm_defines="${tm_defines} WITH_DOUBLE${avr_double}"
1518	tm_defines="${tm_defines} WITH_LONG_DOUBLE${avr_long_double}"
1519	tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
1520	use_gcc_stdint=wrap
1521	extra_gcc_objs="driver-avr.o avr-devices.o"
1522	extra_objs="avr-devices.o avr-log.o"
1523	;;
1524bfin*-elf*)
1525	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
1526	tmake_file=bfin/t-bfin-elf
1527	use_collect2=no
1528	;;
1529bfin*-uclinux*)
1530	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/uclinux.h"
1531	tmake_file=bfin/t-bfin-uclinux
1532	use_collect2=no
1533	;;
1534bfin*-linux-uclibc*)
1535	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"
1536	tmake_file="${tmake_file} bfin/t-bfin-linux"
1537	use_collect2=no
1538	;;
1539bfin*-rtems*)
1540	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h newlib-stdint.h"
1541	tmake_file="${tmake_file} bfin/t-rtems"
1542	;;
1543bfin*-*)
1544	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
1545	use_collect2=no
1546	use_gcc_stdint=wrap
1547	;;
1548bpf-*-*)
1549        tm_file="elfos.h ${tm_file}"
1550        tmake_file="${tmake_file} bpf/t-bpf"
1551        use_collect2=no
1552        extra_headers="bpf-helpers.h"
1553        use_gcc_stdint=provide
1554        ;;
1555cr16-*-elf)
1556        tm_file="elfos.h ${tm_file} newlib-stdint.h"
1557        tmake_file="${tmake_file} cr16/t-cr16 "
1558        use_collect2=no
1559        ;;
1560crisv32-*-elf | crisv32-*-none)
1561	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1562	tmake_file="cris/t-cris"
1563	target_cpu_default=32
1564	gas=yes
1565	extra_options="${extra_options} cris/elf.opt"
1566	use_gcc_stdint=wrap
1567	;;
1568cris-*-elf | cris-*-none)
1569	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1570	tmake_file="cris/t-cris cris/t-elfmulti"
1571	gas=yes
1572	extra_options="${extra_options} cris/elf.opt"
1573	use_gcc_stdint=wrap
1574	;;
1575crisv32-*-linux* | cris-*-linux*)
1576	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h cris/linux.h"
1577	tmake_file="${tmake_file} cris/t-cris cris/t-linux"
1578	extra_options="${extra_options} cris/linux.opt"
1579	case $target in
1580	  cris-*-*)
1581		target_cpu_default=10
1582		;;
1583	  crisv32-*-*)
1584		target_cpu_default=32
1585		;;
1586	esac
1587	;;
1588csky-*-*)
1589	if test x${with_endian} != x; then
1590	    case ${with_endian} in
1591		big|little)		;;
1592		*)
1593		    echo "with_endian=${with_endian} not supported."
1594		    exit 1
1595		    ;;
1596	    esac
1597	fi
1598	if test x${with_float} != x; then
1599	    case ${with_float} in
1600		soft | hard) ;;
1601		*) echo
1602		    "Unknown floating point type used in --with-float=$with_float"
1603		    exit 1
1604		    ;;
1605	    esac
1606	fi
1607	tm_file="csky/csky.h"
1608	md_file="csky/csky.md"
1609	out_file="csky/csky.c"
1610	tm_p_file="${tm_p_file} csky/csky-protos.h"
1611	extra_options="${extra_options} csky/csky_tables.opt"
1612
1613	if test x${enable_tpf_debug} = xyes; then
1614	    tm_defines="${tm_defines} ENABLE_TPF_DEBUG"
1615	fi
1616
1617	case ${target} in
1618	    csky-*-elf*)
1619		tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} csky/csky-elf.h"
1620		tmake_file="csky/t-csky csky/t-csky-elf"
1621		default_use_cxa_atexit=no
1622		;;
1623	    csky-*-linux*)
1624		tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} csky/csky-linux-elf.h"
1625		tmake_file="${tmake_file} csky/t-csky csky/t-csky-linux"
1626
1627		if test "x${enable_multilib}" = xyes ; then
1628		    tm_file="$tm_file ./sysroot-suffix.h"
1629		    tmake_file="${tmake_file} csky/t-sysroot-suffix"
1630		fi
1631
1632		case ${target} in
1633		    csky-*-linux-gnu*)
1634			tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
1635			# Force .init_array support.  The configure script cannot always
1636			# automatically detect that GAS supports it, yet we require it.
1637			gcc_cv_initfini_array=yes
1638			;;
1639		    csky-*-linux-uclibc*)
1640			tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
1641			default_use_cxa_atexit=no
1642			;;
1643		    *)
1644			echo "Unknown target $target"
1645			exit 1
1646			;;
1647		esac
1648		;;
1649	    *)
1650		echo "Unknown target $target"
1651		exit 1
1652		;;
1653	esac
1654	;;
1655epiphany-*-elf | epiphany-*-rtems*)
1656	tm_file="${tm_file} dbxelf.h elfos.h"
1657	tmake_file="${tmake_file} epiphany/t-epiphany"
1658	case ${target} in
1659	epiphany-*-rtems*)
1660	  tm_file="${tm_file} rtems.h epiphany/rtems.h newlib-stdint.h"
1661	  ;;
1662	*)
1663	  tm_file="${tm_file} newlib-stdint.h"
1664	  ;;
1665	esac
1666	extra_options="${extra_options} fused-madd.opt"
1667	extra_objs="${extra_objs} mode-switch-use.o resolve-sw-modes.o"
1668	tm_defines="${tm_defines} EPIPHANY_STACK_OFFSET=${with_stack_offset:-8}"
1669	extra_headers="epiphany_intrinsics.h"
1670	;;
1671fr30-*-elf)
1672	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1673	;;
1674frv-*-elf)
1675	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1676	tmake_file=frv/t-frv
1677	;;
1678frv-*-*linux*)
1679	tm_file="dbxelf.h elfos.h ${tm_file} \
1680	         gnu-user.h linux.h glibc-stdint.h frv/linux.h"
1681	tmake_file="${tmake_file} frv/t-frv frv/t-linux"
1682	;;
1683ft32-*-elf)
1684	gas=yes
1685	gnu_ld=yes
1686	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1687	tmake_file="${tmake_file} ft32/t-ft32"
1688	;;
1689amdgcn-*-amdhsa)
1690	tm_file="elfos.h gcn/gcn-hsa.h gcn/gcn.h newlib-stdint.h"
1691	tmake_file="gcn/t-gcn-hsa"
1692	native_system_header_dir=/include
1693	extra_modes=gcn/gcn-modes.def
1694	extra_objs="${extra_objs} gcn-tree.o"
1695	extra_gcc_objs="driver-gcn.o"
1696	case "$host" in
1697	x86_64*-*-linux-gnu )
1698		if test "$ac_cv_search_dlopen" != no; then
1699			extra_programs="${extra_programs} gcn-run\$(exeext)"
1700		fi
1701		;;
1702	esac
1703	if test x$enable_as_accelerator = xyes; then
1704		extra_programs="${extra_programs} mkoffload\$(exeext)"
1705		tm_file="${tm_file} gcn/offload.h"
1706	fi
1707	# Force .init_array support.
1708	gcc_cv_initfini_array=yes
1709	thread_file=gcn
1710	;;
1711moxie-*-elf)
1712	gas=yes
1713	gnu_ld=yes
1714	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1715	tmake_file="${tmake_file} moxie/t-moxie"
1716	;;
1717moxie-*-uclinux*)
1718	gas=yes
1719	gnu_ld=yes
1720	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
1721	tmake_file="${tmake_file} moxie/t-moxie"
1722	;;
1723moxie-*-rtems*)
1724	tmake_file="${tmake_file} moxie/t-moxie"
1725	tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
1726	;;
1727moxie-*-moxiebox*)
1728	gas=yes
1729	gnu_ld=yes
1730	tm_file="${tm_file} dbxelf.h elfos.h moxie/moxiebox.h newlib-stdint.h"
1731	tmake_file="${tmake_file} moxie/t-moxiebox"
1732	;;
1733h8300-*-elf*)
1734	tmake_file="h8300/t-h8300"
1735	tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
1736	;;
1737h8300-*-linux*)
1738	tmake_file="${tmake_file} h8300/t-h8300 h8300/t-linux"
1739	tm_file="h8300/h8300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h h8300/linux.h"
1740	;;
1741hppa*64*-*-linux*)
1742	target_cpu_default="MASK_PA_11|MASK_PA_20"
1743	tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
1744		 glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
1745		 pa/pa64-linux.h"
1746	tmake_file="${tmake_file} pa/t-pa pa/t-linux"
1747	d_target_objs="${d_target_objs} pa-d.o"
1748	gas=yes gnu_ld=yes
1749	;;
1750hppa*-*-linux*)
1751	target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS|MASK_CALLER_COPIES"
1752	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h pa/pa-linux.h \
1753		 pa/pa32-regs.h pa/pa32-linux.h"
1754	tmake_file="${tmake_file} pa/t-pa pa/t-linux"
1755	d_target_objs="${d_target_objs} pa-d.o"
1756	;;
1757hppa*-*-openbsd*)
1758	target_cpu_default="MASK_PA_11"
1759	tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-stdint.h openbsd-libpthread.h \
1760		 pa/pa-openbsd.h pa/pa32-regs.h pa/pa32-openbsd.h"
1761	extra_options="${extra_options} openbsd.opt"
1762	tmake_file="pa/t-pa"
1763	d_target_objs="${d_target_objs} pa-d.o"
1764	gas=yes
1765	gnu_ld=yes
1766	;;
1767hppa*-*-netbsd*)
1768	target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
1769	tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} \
1770		 pa/pa-netbsd.h pa/pa32-regs.h pa/pa32-netbsd.h"
1771	tmake_file="${tmake_file}"
1772	tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
1773	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1774	;;
1775hppa[12]*-*-hpux10*)
1776	case ${target} in
1777	hppa1.1-*-* | hppa2*-*-*)
1778		target_cpu_default="MASK_PA_11"
1779		;;
1780	esac
1781	tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
1782		 pa/pa-hpux.h pa/pa-hpux10.h"
1783	extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux10.opt"
1784	case ${target} in
1785	*-*-hpux10.[1-9]*)
1786		tm_file="${tm_file} pa/pa-hpux1010.h"
1787		extra_options="${extra_options} pa/pa-hpux1010.opt"
1788		;;
1789	esac
1790	use_gcc_stdint=provide
1791	tm_file="${tm_file} hpux-stdint.h"
1792	tmake_file="pa/t-pa t-slibgcc"
1793	d_target_objs="${d_target_objs} pa-d.o"
1794	case ${enable_threads} in
1795	  "")
1796	    if test x$have_pthread_h = xyes ; then
1797	      tmake_file="${tmake_file} pa/t-dce-thr"
1798	    fi
1799	    ;;
1800	  yes | dce)
1801	    tmake_file="${tmake_file} pa/t-dce-thr"
1802	    ;;
1803	esac
1804	use_collect2=yes
1805	gas=yes
1806	if test "x$with_dwarf2" != x; then
1807		echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
1808		dwarf2=no
1809	fi
1810	;;
1811hppa*64*-*-hpux11*)
1812	target_cpu_default="MASK_PA_11|MASK_PA_20"
1813	if test x$gnu_ld = xyes
1814	then
1815		target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
1816	fi
1817	tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \
1818		 pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \
1819		 pa/pa-hpux11.h"
1820	case ${target} in
1821	*-*-hpux11.[12]*)
1822		tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h"
1823		extra_options="${extra_options} pa/pa-hpux1111.opt"
1824		;;
1825	*-*-hpux11.[3-9]*)
1826		tm_file="${tm_file} pa/pa-hpux1131.h pa/pa-64.h pa/pa64-hpux.h"
1827		extra_options="${extra_options} pa/pa-hpux1131.opt"
1828		;;
1829	*)
1830		tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h"
1831		;;
1832	esac
1833	extra_options="${extra_options} pa/pa-hpux.opt \
1834		       pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
1835	tmake_file="pa/t-pa t-slibgcc"
1836	d_target_objs="${d_target_objs} pa-d.o"
1837	case x${enable_threads} in
1838	x | xyes | xposix )
1839		thread_file=posix
1840		;;
1841	esac
1842	gas=yes
1843	case ${target} in
1844	  *-*-hpux11.[01]*)
1845		use_gcc_stdint=provide
1846		tm_file="${tm_file} hpux-stdint.h"
1847		;;
1848	  *-*-hpux11.[23]*)
1849		use_gcc_stdint=wrap
1850		tm_file="${tm_file} hpux-stdint.h"
1851		;;
1852	esac
1853	;;
1854hppa[12]*-*-hpux11*)
1855	case ${target} in
1856	hppa1.1-*-* | hppa2*-*-*)
1857		target_cpu_default="MASK_PA_11"
1858		;;
1859	esac
1860	tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
1861		 pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h"
1862	extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt \
1863		       hpux11.opt"
1864	case ${target} in
1865	*-*-hpux11.[12]*)
1866		tm_file="${tm_file} pa/pa-hpux1111.h"
1867		extra_options="${extra_options} pa/pa-hpux1111.opt"
1868		;;
1869	*-*-hpux11.[3-9]*)
1870		tm_file="${tm_file} pa/pa-hpux1131.h"
1871		extra_options="${extra_options} pa/pa-hpux1131.opt"
1872		;;
1873	esac
1874	tmake_file="pa/t-pa t-slibgcc"
1875	d_target_objs="${d_target_objs} pa-d.o"
1876	case x${enable_threads} in
1877	x | xyes | xposix )
1878		thread_file=posix
1879		;;
1880	esac
1881	use_collect2=yes
1882	gas=yes
1883	case ${target} in
1884	  *-*-hpux11.[01]*)
1885		use_gcc_stdint=provide
1886		tm_file="${tm_file} hpux-stdint.h"
1887		;;
1888	  *-*-hpux11.[23]*)
1889		use_gcc_stdint=wrap
1890		tm_file="${tm_file} hpux-stdint.h"
1891		;;
1892	esac
1893	if test "x$with_dwarf2" != x; then
1894		echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
1895		dwarf2=no
1896	fi
1897	;;
1898i[34567]86-*-darwin1[89]*)
1899	echo "Error: 32bit target is not supported after Darwin17" 1>&2
1900	;;
1901i[34567]86-*-darwin*)
1902	need_64bit_isa=yes
1903	# Baseline choice for a machine that allows m64 support.
1904	with_cpu=${with_cpu:-core2}
1905	tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
1906	tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
1907	;;
1908x86_64-*-darwin1[89]* | x86_64-*-darwin2[01]*)
1909	# Only 64b from now
1910	with_cpu=${with_cpu:-core2}
1911	tmake_file="${tmake_file} t-slibgcc"
1912	;;
1913x86_64-*-darwin*)
1914	with_cpu=${with_cpu:-core2}
1915	tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
1916	tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
1917	;;
1918i[34567]86-*-elfiamcu)
1919	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
1920	;;
1921i[34567]86-*-elf*)
1922	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
1923	;;
1924x86_64-*-elf*)
1925	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
1926	;;
1927x86_64-*-rtems*)
1928	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 rtems.h"
1929	;;
1930i[34567]86-*-rdos*)
1931    tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/rdos.h"
1932    ;;
1933x86_64-*-rdos*)
1934    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"
1935    tmake_file="i386/t-i386elf t-svr4"
1936    ;;
1937i[34567]86-*-dragonfly*)
1938	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
1939	tmake_file="${tmake_file} i386/t-crtstuff"
1940	;;
1941x86_64-*-dragonfly*)
1942	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"
1943	tmake_file="${tmake_file} i386/t-crtstuff"
1944	;;
1945i[34567]86-*-freebsd*)
1946	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
1947	;;
1948x86_64-*-freebsd*)
1949	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"
1950	;;
1951i[34567]86-*-netbsdelf*)
1952	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
1953	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1954	;;
1955x86_64-*-netbsd*)
1956	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h"
1957	tmake_file="${tmake_file} i386/t-netbsd64"
1958	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1959	;;
1960i[34567]86-*-openbsd*)
1961	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
1962	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
1963	extra_options="${extra_options} openbsd.opt"
1964	gas=yes
1965	gnu_ld=yes
1966	;;
1967x86_64-*-openbsd*)
1968	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
1969	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/x86-64.h i386/openbsdelf.h"
1970	extra_options="${extra_options} openbsd.opt"
1971	gas=yes
1972	gnu_ld=yes
1973	;;
1974i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
1975			# Intel 80386's running GNU/*
1976			# with ELF format using glibc 2
1977	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h"
1978	case ${target} in
1979	i[34567]86-*-linux*)
1980		tm_file="${tm_file} linux.h linux-android.h"
1981		extra_options="${extra_options} linux-android.opt"
1982		if test x$enable_targets = xall; then
1983			tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux-common.h i386/linux64.h"
1984			tm_defines="${tm_defines} TARGET_BI_ARCH=1"
1985			tmake_file="${tmake_file} i386/t-linux64"
1986			x86_multilibs="${with_multilib_list}"
1987			if test "$x86_multilibs" = "default"; then
1988				x86_multilibs="m64,m32"
1989			fi
1990			x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
1991			for x86_multilib in ${x86_multilibs}; do
1992				case ${x86_multilib} in
1993				m32 | m64 | mx32)
1994					TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
1995					;;
1996				*)
1997					echo "--with-multilib-list=${x86_with_multilib} not supported."
1998					exit 1
1999				esac
2000			done
2001			TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
2002			need_64bit_isa=yes
2003			if test x$with_cpu = x; then
2004				if test x$with_cpu_64 = x; then
2005					with_cpu_64=generic
2006				fi
2007			else
2008				case " $x86_cpus $x86_archs $x86_64_archs " in
2009				*" $with_cpu "*)
2010					;;
2011				*)
2012					echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
2013					echo "$x86_cpus $x86_archs $x86_64_archs " 1>&2
2014					exit 1
2015					;;
2016				esac
2017			fi
2018		else
2019			tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux-common.h i386/linux.h"
2020		fi
2021		;;
2022	i[34567]86-*-kfreebsd*-gnu)
2023		tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kfreebsd-gnu.h i386/kfreebsd-gnu.h"
2024		;;
2025	i[34567]86-*-kopensolaris*-gnu)
2026		tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h"
2027		;;
2028	i[34567]86-*-gnu*)
2029		tm_file="$tm_file i386/gnu-user-common.h i386/gnu-user.h gnu.h i386/gnu.h"
2030		;;
2031	esac
2032	;;
2033x86_64-*-linux* | x86_64-*-kfreebsd*-gnu)
2034	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
2035		 i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h"
2036	case ${target} in
2037	x86_64-*-linux*)
2038		tm_file="${tm_file} linux.h linux-android.h i386/linux-common.h i386/linux64.h"
2039		extra_options="${extra_options} linux-android.opt"
2040	  	;;
2041	x86_64-*-kfreebsd*-gnu)
2042		tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu64.h"
2043		;;
2044	esac
2045	tmake_file="${tmake_file} i386/t-linux64"
2046	x86_multilibs="${with_multilib_list}"
2047	if test "$x86_multilibs" = "default"; then
2048		case ${with_abi} in
2049		x32 | mx32)
2050			x86_multilibs="mx32"
2051			;;
2052		*)
2053			x86_multilibs="m64,m32"
2054			;;
2055		esac
2056	fi
2057	x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
2058	for x86_multilib in ${x86_multilibs}; do
2059		case ${x86_multilib} in
2060		m32 | m64 | mx32)
2061			TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
2062			;;
2063		*)
2064			echo "--with-multilib-list=${x86_with_multilib} not supported."
2065			exit 1
2066		esac
2067	done
2068	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
2069	;;
2070i[34567]86-pc-msdosdjgpp*)
2071	xm_file=i386/xm-djgpp.h
2072	tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
2073	native_system_header_dir=/dev/env/DJDIR/include
2074	extra_options="${extra_options} i386/djgpp.opt"
2075	gnu_ld=yes
2076	gas=yes
2077	use_gcc_stdint=wrap
2078	;;
2079i[34567]86-*-lynxos*)
2080	xm_defines=POSIX
2081	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h"
2082	tmake_file="${tmake_file} t-lynx"
2083	extra_options="${extra_options} lynx.opt"
2084	thread_file=lynx
2085	gnu_ld=yes
2086	gas=yes
2087	;;
2088i[34567]86-*-nto-qnx*)
2089	tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
2090	extra_options="${extra_options} i386/nto.opt"
2091	gnu_ld=yes
2092	gas=yes
2093	;;
2094i[34567]86-*-rtems*)
2095	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"
2096	tmake_file="${tmake_file} i386/t-rtems"
2097	;;
2098i[34567]86-*-solaris2* | x86_64-*-solaris2*)
2099	# Set default arch_32 to pentium4, tune_32 to generic like the other
2100	# i386 targets, although config.guess defaults to i386-pc-solaris2*.
2101	with_arch_32=${with_arch_32:-pentium4}
2102	with_tune_32=${with_tune_32:-generic}
2103	tm_file="${tm_file} i386/unix.h i386/att.h ${sol2_tm_file_head} i386/x86-64.h ${sol2_tm_file_tail}"
2104	tm_defines="${tm_defines} TARGET_BI_ARCH=1"
2105	tmake_file="$tmake_file i386/t-sol2"
2106	need_64bit_isa=yes
2107	if test x$with_cpu = x; then
2108		if test x$with_cpu_64 = x; then
2109			with_cpu_64=generic
2110		fi
2111	else
2112		case " $x86_cpus $x86_archs $x86_64_archs " in
2113		*" $with_cpu "*)
2114			;;
2115		*)
2116			echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
2117			echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
2118			exit 1
2119			;;
2120		esac
2121	fi
2122	;;
2123i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae|i[4567]86-wrs-vxworks7|x86_64-wrs-vxworks7)
2124	tm_file="${tm_file} i386/unix.h i386/att.h elfos.h"
2125	case ${target} in
2126	  x86_64-*)
2127	    need_64bit_isa=yes
2128	    tm_file="${tm_file} i386/x86-64.h"
2129	    ;;
2130	esac
2131	tm_file="${tm_file} vx-common.h"
2132	case ${target} in
2133	  *-vxworksae*)
2134	    tm_file="${tm_file} vxworksae.h i386/vxworks.h i386/vxworksae.h"
2135	    tmake_file="${tmake_file} i386/t-vxworks i386/t-vxworksae"
2136	    ;;
2137	  *)
2138	    tm_file="${tm_file} vxworks.h i386/vxworks.h"
2139	    tmake_file="${tmake_file} i386/t-vxworks"
2140	    ;;
2141	esac
2142	;;
2143i[34567]86-*-cygwin*)
2144	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"
2145	xm_file=i386/xm-cygwin.h
2146	tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
2147	target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.c"
2148	extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
2149	extra_objs="${extra_objs} winnt.o winnt-stubs.o"
2150	c_target_objs="${c_target_objs} msformat-c.o"
2151	cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
2152	if test x$enable_threads = xyes; then
2153		thread_file='posix'
2154	fi
2155	default_use_cxa_atexit=yes
2156	use_gcc_stdint=wrap
2157	;;
2158x86_64-*-cygwin*)
2159	need_64bit_isa=yes
2160	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"
2161	xm_file=i386/xm-cygwin.h
2162	tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64"
2163	target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.c"
2164	extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
2165	extra_objs="${extra_objs} winnt.o winnt-stubs.o"
2166	c_target_objs="${c_target_objs} msformat-c.o"
2167	cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
2168	if test x$enable_threads = xyes; then
2169		thread_file='posix'
2170	fi
2171	default_use_cxa_atexit=yes
2172	use_gcc_stdint=wrap
2173	tm_defines="${tm_defines} TARGET_CYGWIN64=1"
2174	;;
2175i[34567]86-*-mingw* | x86_64-*-mingw*)
2176	tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h"
2177	xm_file=i386/xm-mingw32.h
2178	c_target_objs="${c_target_objs} winnt-c.o"
2179	cxx_target_objs="${cxx_target_objs} winnt-c.o"
2180	target_has_targetcm="yes"
2181	case ${target} in
2182		x86_64-*-* | *-w64-*)
2183			need_64bit_isa=yes
2184			;;
2185		*)
2186			;;
2187	esac
2188	if test x$enable_threads = xposix ; then
2189		tm_file="${tm_file} i386/mingw-pthread.h"
2190	fi
2191	tm_file="${tm_file} i386/mingw32.h"
2192	# This makes the logic if mingw's or the w64 feature set has to be used
2193	case ${target} in
2194		*-w64-*)
2195			user_headers_inc_next_post="${user_headers_inc_next_post} float.h"
2196			user_headers_inc_next_pre="${user_headers_inc_next_pre} stddef.h stdarg.h"
2197			tm_file="${tm_file} i386/mingw-w64.h"
2198			if test x$enable_targets = xall; then
2199				tm_defines="${tm_defines} TARGET_BI_ARCH=1"
2200				if test x$with_cpu = x; then
2201					if test x$with_cpu_64 = x; then
2202						with_cpu_64=generic
2203					fi
2204				else
2205					case " $x86_cpus $x86_archs $x86_64_archs " in
2206					*" $with_cpu "*)
2207						;;
2208					*)
2209						echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
2210						echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
2211						exit 1
2212						;;
2213					esac
2214				fi
2215			fi
2216			;;
2217		*)
2218			;;
2219	esac
2220	tm_file="${tm_file} i386/mingw-stdint.h"
2221	tmake_file="${tmake_file} t-winnt i386/t-cygming t-slibgcc"
2222        case ${target} in
2223               x86_64-w64-*)
2224               		tmake_file="${tmake_file} i386/t-mingw-w64"
2225			;;
2226	       i[34567]86-w64-*)
2227			tmake_file="${tmake_file} i386/t-mingw-w32"
2228			;;
2229	esac
2230        native_system_header_dir=/mingw/include
2231	target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.c"
2232	extra_options="${extra_options} i386/cygming.opt i386/mingw.opt"
2233	case ${target} in
2234		*-w64-*)
2235			extra_options="${extra_options} i386/mingw-w64.opt"
2236			;;
2237		*)
2238			;;
2239	esac
2240	extra_objs="${extra_objs} winnt.o winnt-stubs.o"
2241	c_target_objs="${c_target_objs} msformat-c.o"
2242	cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
2243	gas=yes
2244	gnu_ld=yes
2245	default_use_cxa_atexit=yes
2246	use_gcc_stdint=wrap
2247	case ${enable_threads} in
2248	  "" | yes | win32)
2249	    thread_file='win32'
2250	    ;;
2251	  posix)
2252	    thread_file='posix'
2253	    ;;
2254	esac
2255	case ${target} in
2256 		*mingw32crt*)
2257 			tm_file="${tm_file} i386/crtdll.h"
2258 			;;
2259		*mingw32msv* | *mingw*)
2260			;;
2261	esac
2262	;;
2263x86_64-*-fuchsia*)
2264	tmake_file="${tmake_file} i386/t-x86_64-elf"
2265	tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h fuchsia.h"
2266	;;
2267ia64*-*-elf*)
2268	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h ia64/sysv4.h ia64/elf.h"
2269	tmake_file="ia64/t-ia64"
2270	target_cpu_default="0"
2271	if test x$gas = xyes
2272	then
2273		target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
2274	fi
2275	if test x$gnu_ld = xyes
2276	then
2277		target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
2278	fi
2279	;;
2280ia64*-*-netbsd*)
2281	tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} ia64/sysv4.h ia64/netbsd.h"
2282	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
2283	tmake_file="${tmake_file} ia64/t-ia64"
2284	if test x$with_system_libunwind != xyes ; then
2285		tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
2286	fi
2287	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
2288	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2289	;;
2290ia64*-*-freebsd*)
2291	tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
2292	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
2293	tmake_file="${tmake_file} ia64/t-ia64"
2294	;;
2295ia64*-*-linux*)
2296	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
2297	tmake_file="${tmake_file} ia64/t-ia64 ia64/t-linux t-libunwind"
2298	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
2299	;;
2300ia64*-*-hpux*)
2301	tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/hpux.h"
2302	tmake_file="ia64/t-ia64 ia64/t-hpux t-slibgcc"
2303	target_cpu_default="MASK_GNU_AS"
2304	case x$enable_threads in
2305	x | xyes | xposix )
2306		thread_file=posix
2307		;;
2308	esac
2309	use_collect2=no
2310	c_target_objs="ia64-c.o"
2311	cxx_target_objs="ia64-c.o"
2312	extra_options="${extra_options} ia64/ilp32.opt hpux11.opt"
2313	use_gcc_stdint=wrap
2314	tm_file="${tm_file} hpux-stdint.h"
2315	case ${target} in
2316	*-*-hpux11.3*)
2317		tm_file="${tm_file} ia64/hpux-unix2003.h"
2318		;;
2319	esac
2320	;;
2321ia64-hp-*vms*)
2322	tm_file="${tm_file} elfos.h ia64/sysv4.h vms/vms.h ia64/vms.h"
2323	tmake_file="${tmake_file} ia64/t-ia64"
2324	target_cpu_default="0"
2325	if test x$gas = xyes
2326	then
2327		target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
2328	fi
2329	extra_options="${extra_options} ia64/vms.opt"
2330	;;
2331iq2000*-*-elf*)
2332        tm_file="elfos.h newlib-stdint.h iq2000/iq2000.h"
2333        out_file=iq2000/iq2000.c
2334        md_file=iq2000/iq2000.md
2335        ;;
2336lm32-*-elf*)
2337        tm_file="dbxelf.h elfos.h ${tm_file} newlib-stdint.h"
2338	tmake_file="${tmake_file} lm32/t-lm32"
2339        ;;
2340lm32-*-rtems*)
2341	tm_file="dbxelf.h elfos.h ${tm_file} lm32/rtems.h rtems.h newlib-stdint.h"
2342	tmake_file="${tmake_file} lm32/t-lm32"
2343	tmake_file="${tmake_file} lm32/t-rtems"
2344         ;;
2345lm32-*-uclinux*)
2346        tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h lm32/uclinux-elf.h"
2347	tmake_file="${tmake_file} lm32/t-lm32"
2348        ;;
2349m32r-*-elf*)
2350	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2351 	;;
2352m32rle-*-elf*)
2353	tm_file="dbxelf.h elfos.h newlib-stdint.h m32r/little.h ${tm_file}"
2354	;;
2355m32r-*-linux*)
2356	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} m32r/linux.h"
2357	tmake_file="${tmake_file} m32r/t-linux t-slibgcc"
2358	gnu_ld=yes
2359	if test x$enable_threads = xyes; then
2360		thread_file='posix'
2361	fi
2362 	;;
2363m32rle-*-linux*)
2364	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m32r/little.h ${tm_file} m32r/linux.h"
2365	tmake_file="${tmake_file} m32r/t-linux t-slibgcc"
2366	gnu_ld=yes
2367	if test x$enable_threads = xyes; then
2368		thread_file='posix'
2369	fi
2370	;;
2371m68k-*-elf* | fido-*-elf*)
2372	case ${target} in
2373	fido-*-elf*)
2374		# Check that $with_cpu makes sense.
2375		case $with_cpu in
2376		"" | "fidoa")
2377			;;
2378		*)
2379			echo "Cannot accept --with-cpu=$with_cpu"
2380			exit 1
2381			;;
2382		esac
2383		with_cpu=fidoa
2384		;;
2385	*)
2386		default_m68k_cpu=68020
2387		default_cf_cpu=5206
2388		;;
2389	esac
2390	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"
2391	tm_defines="${tm_defines} MOTOROLA=1"
2392	tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
2393	# Add multilibs for targets other than fido.
2394	case ${target} in
2395	fido-*-elf*)
2396		;;
2397	*)
2398		tmake_file="$tmake_file m68k/t-mlibs"
2399		;;
2400	esac
2401	;;
2402m68010-*-netbsdelf* | m68k-*-netbsdelf* | m5407-*-netbsdelf*)
2403	default_m68k_cpu=68020
2404	case ${target} in
2405	m5407*)
2406		with_arch=${with_arch:-cf}
2407		target_cpu_default="mcf5475"
2408#	        target="`echo ${target} | sed 's/m68kcf/m68k/'`"
2409		;;
2410	m68010*)
2411		target_cpu_default="m68010"
2412		tmake_file="${tmake_file} m68k/t-m68kelf m68k/t-m68010-netbsd"
2413		default_m68k_cpu=68010
2414		tmake_file="${tmake_file} m68k/t-floatlib"
2415		;;
2416	*)
2417		with_arch=${with_arch:-m68k}
2418		tmake_file="${tmake_file} m68k/t-floatlib"
2419		;;
2420	esac
2421	default_cf_cpu=5475
2422	tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} m68k/netbsd-elf.h"
2423	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2424	tm_defines="${tm_defines} MOTOROLA=1 CHAR_FAST8=1 SHORT_FAST16=1"
2425	;;
2426m68k*-*-openbsd*)
2427	default_m68k_cpu=68020
2428	default_cf_cpu=5475
2429	# needed to unconfuse gdb
2430	tm_defines="${tm_defines} OBSD_OLD_GAS"
2431	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h m68k/openbsd.h"
2432	extra_options="${extra_options} openbsd.opt"
2433	tmake_file="t-openbsd m68k/t-openbsd"
2434	# we need collect2 until our bug is fixed...
2435	use_collect2=yes
2436	;;
2437m68k-*-uclinux*)		# Motorola m68k/ColdFire running uClinux
2438				# with uClibc, using the new GNU/Linux-style
2439				# ABI.
2440	default_m68k_cpu=68020
2441	default_cf_cpu=5206
2442	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"
2443	extra_options="${extra_options} m68k/uclinux.opt"
2444 	tm_defines="${tm_defines} MOTOROLA=1"
2445	tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
2446	;;
2447m68k-*-linux*)			# Motorola m68k's running GNU/Linux
2448				# with ELF format using glibc 2
2449				# aka the GNU/Linux C library 6.
2450	default_m68k_cpu=68020
2451	default_cf_cpu=5475
2452	with_arch=${with_arch:-m68k}
2453	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h ./sysroot-suffix.h"
2454	extra_options="${extra_options} m68k/ieee.opt"
2455	tm_defines="${tm_defines} MOTOROLA=1"
2456	tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs"
2457	;;
2458m68k-*-rtems*)
2459	default_m68k_cpu=68020
2460	default_cf_cpu=5206
2461	tmake_file="${tmake_file} m68k/t-floatlib m68k/t-m68kbare m68k/t-crtstuff m68k/t-rtems m68k/t-mlibs"
2462	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"
2463	tm_defines="${tm_defines} MOTOROLA=1"
2464	;;
2465mcore-*-elf)
2466	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
2467	tmake_file=mcore/t-mcore
2468	inhibit_libc=true
2469	;;
2470microblaze*-linux*)
2471	case $target in
2472		microblazeel-*)
2473			tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2474			;;
2475		microblaze-*)
2476			tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2477			;;
2478	esac
2479	tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
2480	tm_file="${tm_file} glibc-stdint.h"
2481	c_target_objs="${c_target_objs} microblaze-c.o"
2482	cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2483	tmake_file="${tmake_file} microblaze/t-microblaze"
2484	tmake_file="${tmake_file} microblaze/t-microblaze-linux"
2485	;;
2486microblaze*-*-rtems*)
2487	case $target in
2488		microblazeel-*)
2489			tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2490			;;
2491		microblaze-*)
2492			tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2493			;;
2494	esac
2495	tm_file="${tm_file} dbxelf.h"
2496	tm_file="${tm_file} microblaze/rtems.h rtems.h newlib-stdint.h"
2497	c_target_objs="${c_target_objs} microblaze-c.o"
2498	cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2499	tmake_file="${tmake_file} microblaze/t-microblaze"
2500	tmake_file="${tmake_file} microblaze/t-rtems"
2501        ;;
2502microblaze*-*-elf)
2503	case $target in
2504		microblazeel-*)
2505			tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2506			;;
2507		microblaze-*)
2508			tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2509			;;
2510	esac
2511	tm_file="${tm_file} dbxelf.h newlib-stdint.h"
2512	c_target_objs="${c_target_objs} microblaze-c.o"
2513	cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2514	tmake_file="${tmake_file} microblaze/t-microblaze"
2515        ;;
2516riscv*-*-linux*)
2517	tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h"
2518	case "x${enable_multilib}" in
2519	xno) ;;
2520	xyes) tmake_file="${tmake_file} riscv/t-linux-multilib" ;;
2521	*) echo "Unknown value for enable_multilib"; exit 1
2522	esac
2523	tmake_file="${tmake_file} riscv/t-riscv riscv/t-linux"
2524	gnu_ld=yes
2525	gas=yes
2526	# Force .init_array support.  The configure script cannot always
2527	# automatically detect that GAS supports it, yet we require it.
2528	gcc_cv_initfini_array=yes
2529	;;
2530riscv*-*-elf* | riscv*-*-rtems*)
2531	tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h"
2532	case ${target} in
2533	*-*-rtems*)
2534	  tm_file="${tm_file} rtems.h riscv/rtems.h"
2535	  tmake_file="${tmake_file} riscv/t-rtems"
2536	  ;;
2537	*)
2538	  case "x${enable_multilib}" in
2539	  xno) ;;
2540	  xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
2541	  *) echo "Unknown value for enable_multilib"; exit 1
2542	  esac
2543	esac
2544	tmake_file="${tmake_file} riscv/t-riscv"
2545	gnu_ld=yes
2546	gas=yes
2547	# Force .init_array support.  The configure script cannot always
2548	# automatically detect that GAS supports it, yet we require it.
2549	gcc_cv_initfini_array=yes
2550	;;
2551riscv*-*-freebsd*)
2552	tm_file="${tm_file} elfos.h ${fbsd_tm_file} riscv/freebsd.h"
2553	tmake_file="${tmake_file} riscv/t-riscv"
2554	gnu_ld=yes
2555	gas=yes
2556	# Force .init_array support.  The configure script cannot always
2557	# automatically detect that GAS supports it, yet we require it.
2558	gcc_cv_initfini_array=yes
2559	;;
2560riscv*-*-netbsd*)			# NetBSD RISC-V
2561	tm_file="elfos.h ${tm_file} ${nbsd_tm_file} riscv/netbsd.h"
2562	tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
2563	case ${target} in
2564	  riscv32*) tm_defines="${tm_defines} TARGET_64BIT_DEFAULT=0" ;;
2565	  *) tmake_file="${tmake_file} riscv/t-netbsd64" ;;
2566	esac
2567	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2568	tmake_file="${tmake_file} riscv/t-riscv"
2569	gnu_ld=yes
2570	gas=yes
2571	gcc_cv_initfini_array=yes
2572	;;
2573mips64*-*-netbsd*)			# NetBSD/mips64, either endian.
2574	target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_SOFT_FLOAT_ABI"
2575	tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h mips/netbsd64.h"
2576	tmake_file="${tmake_file} mips/t-netbsd64"
2577	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
2578	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2579	;;
2580mips*-*-netbsd*)			# NetBSD/mips, either endian.
2581	target_cpu_default="MASK_ABICALLS"
2582	tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h"
2583	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2584	;;
2585mips*-img-linux*)
2586	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"
2587	extra_options="${extra_options} linux-android.opt"
2588	tmake_file="${tmake_file} mips/t-img-linux"
2589	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
2590	with_arch_32="mips32r6"
2591	with_arch_64="mips64r6"
2592	gnu_ld=yes
2593	gas=yes
2594	;;
2595mips*-mti-linux*)
2596	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"
2597	extra_options="${extra_options} linux-android.opt"
2598	tmake_file="${tmake_file} mips/t-mti-linux"
2599	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
2600	with_arch_32="mips32r2"
2601	with_arch_64="mips64r2"
2602	gnu_ld=yes
2603	gas=yes
2604	;;
2605mips*-*-linux*)				# Linux MIPS, either endian.
2606	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"
2607	extra_options="${extra_options} linux-android.opt"
2608	case ${target} in
2609		mipsisa32r6*)
2610			default_mips_arch=mips32r6
2611			;;
2612		mipsisa32r2*)
2613			default_mips_arch=mips32r2
2614			;;
2615		mipsisa32*)
2616			default_mips_arch=mips32
2617			;;
2618		mips64el-st-linux-gnu)
2619			default_mips_abi=n32
2620			tm_file="${tm_file} mips/st.h"
2621			tmake_file="${tmake_file} mips/t-st"
2622			enable_mips_multilibs="yes"
2623			;;
2624		mips64octeon*-*-linux*)
2625			default_mips_abi=n32
2626			tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
2627			target_cpu_default=MASK_SOFT_FLOAT_ABI
2628			enable_mips_multilibs="yes"
2629			;;
2630		mipsisa64r6*-*-linux*)
2631			default_mips_abi=n32
2632			default_mips_arch=mips64r6
2633			enable_mips_multilibs="yes"
2634			;;
2635		mipsisa64r2*-*-linux*)
2636			default_mips_abi=n32
2637			default_mips_arch=mips64r2
2638			enable_mips_multilibs="yes"
2639			;;
2640		mips64*-*-linux* | mipsisa64*-*-linux*)
2641			default_mips_abi=n32
2642			enable_mips_multilibs="yes"
2643			;;
2644	esac
2645	if test x$enable_targets = xall; then
2646		enable_mips_multilibs="yes"
2647	fi
2648	if test x$enable_mips_multilibs = xyes; then
2649		tmake_file="${tmake_file} mips/t-linux64"
2650	fi
2651	;;
2652mips*-mti-elf*)
2653	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
2654	tmake_file="mips/t-mti-elf"
2655	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
2656	with_arch_32="mips32r2"
2657	with_arch_64="mips64r2"
2658	;;
2659mips*-img-elf*)
2660	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
2661	tmake_file="mips/t-img-elf"
2662	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
2663	with_arch_32="mips32r6"
2664	with_arch_64="mips64r6"
2665	;;
2666mips*-sde-elf*)
2667	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h"
2668	tmake_file="mips/t-sde"
2669	extra_options="${extra_options} mips/sde.opt"
2670	case "${with_newlib}" in
2671	  yes)
2672	    # newlib / libgloss.
2673	    ;;
2674	  *)
2675	    # MIPS toolkit libraries.
2676	    tm_file="$tm_file mips/sdemtk.h"
2677	    tmake_file="$tmake_file mips/t-sdemtk"
2678	    case ${enable_threads} in
2679	      "" | yes | mipssde)
2680		thread_file='mipssde'
2681		;;
2682	    esac
2683	    ;;
2684	esac
2685	case ${target} in
2686	  mipsisa32r6*)
2687	    tm_defines="MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
2688	    ;;
2689	  mipsisa32r2*)
2690	    tm_defines="MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
2691	    ;;
2692	  mipsisa32*)
2693	    tm_defines="MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_32"
2694	    ;;
2695	  mipsisa64r6*)
2696	    tm_defines="MIPS_ISA_DEFAULT=69 MIPS_ABI_DEFAULT=ABI_N32"
2697	    ;;
2698	  mipsisa64r2*)
2699	    tm_defines="MIPS_ISA_DEFAULT=65 MIPS_ABI_DEFAULT=ABI_N32"
2700	    ;;
2701	  mipsisa64*)
2702	    tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_N32"
2703	    ;;
2704	esac
2705	;;
2706mipsisa32-*-elf* | mipsisa32el-*-elf* | \
2707mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
2708mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \
2709mipsisa64-*-elf* | mipsisa64el-*-elf* | \
2710mipsisa64r2-*-elf* | mipsisa64r2el-*-elf* | \
2711mipsisa64r6-*-elf* | mipsisa64r6el-*-elf*)
2712	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2713	tmake_file="mips/t-isa3264"
2714	case ${target} in
2715	  mipsisa32r6*)
2716	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37"
2717	    ;;
2718	  mipsisa32r2*)
2719	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
2720	    ;;
2721	  mipsisa32*)
2722	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
2723	    ;;
2724	  mipsisa64r6*)
2725	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=69"
2726	    ;;
2727	  mipsisa64r2*)
2728	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
2729	    ;;
2730	  mipsisa64*)
2731	    tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64"
2732	    ;;
2733	esac
2734	case ${target} in
2735	  mipsisa32*-*-elfoabi*)
2736	    tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32"
2737	    tm_file="${tm_file} mips/elfoabi.h"
2738	    ;;
2739	  mipsisa64*-*-elfoabi*)
2740	    tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_O64"
2741	    tm_file="${tm_file} mips/elfoabi.h"
2742	    ;;
2743	  *-*-elf*)
2744	    tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI"
2745	    ;;
2746	esac
2747	;;
2748mipsisa64sr71k-*-elf*)
2749        tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2750        tmake_file=mips/t-sr71k
2751	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI"
2752        ;;
2753mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
2754	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2755	tmake_file="mips/t-elf mips/t-sb1"
2756	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
2757	;;
2758mips-*-elf* | mipsel-*-elf* | mipsr5900-*-elf* | mipsr5900el-*-elf*)
2759	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2760	tmake_file="mips/t-elf"
2761	;;
2762mips64r5900-*-elf* | mips64r5900el-*-elf*)
2763	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h"
2764	tmake_file="mips/t-elf"
2765	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
2766	;;
2767mips64-*-elf* | mips64el-*-elf*)
2768	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
2769	tmake_file="mips/t-elf"
2770	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
2771	;;
2772mips64vr-*-elf* | mips64vrel-*-elf*)
2773        tm_file="elfos.h newlib-stdint.h ${tm_file} mips/vr.h mips/elf.h"
2774        tmake_file=mips/t-vr
2775	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI"
2776        ;;
2777mips64orion-*-elf* | mips64orionel-*-elf*)
2778	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elforion.h mips/elf.h"
2779	tmake_file="mips/t-elf"
2780	tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
2781	;;
2782mips*-*-rtems*)
2783	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
2784	tmake_file="${tmake_file} mips/t-elf mips/t-rtems"
2785	;;
2786mips-wrs-vxworks)
2787	tm_file="elfos.h ${tm_file} mips/elf.h vx-common.h vxworks.h mips/vxworks.h"
2788	tmake_file="${tmake_file} mips/t-vxworks"
2789	;;
2790mipstx39-*-elf* | mipstx39el-*-elf*)
2791	tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h"
2792	tmake_file="mips/t-r3900"
2793	;;
2794mmix-knuth-mmixware)
2795	tm_file="${tm_file} newlib-stdint.h"
2796	use_gcc_stdint=wrap
2797	;;
2798mn10300-*-*)
2799	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2800	if test x$stabs = xyes
2801	then
2802		tm_file="${tm_file} dbx.h"
2803	fi
2804	use_collect2=no
2805	use_gcc_stdint=wrap
2806	;;
2807msp430-*-*)
2808	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2809	c_target_objs="msp430-c.o"
2810	cxx_target_objs="msp430-c.o"
2811	tmake_file="${tmake_file} msp430/t-msp430"
2812	extra_objs="${extra_objs} msp430-devices.o"
2813	extra_gcc_objs="driver-msp430.o msp430-devices.o"
2814	# Enable .init_array unless it has been explicitly disabled.
2815	# The MSP430 EABI mandates the use of .init_array, and the Newlib CRT
2816	# code since mid-2019 expects it.
2817	if test x${disable_initfini_array} != xyes; then
2818		gcc_cv_initfini_array=yes
2819	fi
2820	case ${target} in
2821	  msp430-*-elfbare)
2822	    # __cxa_atexit increases code size, and we don't need to support
2823	    # dynamic shared objects on MSP430, so regular Newlib atexit is a
2824	    # fine replacement as it also supports registration of more than 32
2825	    # functions.
2826	    default_use_cxa_atexit=no
2827	    # This target does not match the generic *-*-elf case above which
2828	    # sets use_gcc_stdint=wrap, so explicitly set it here.
2829	    use_gcc_stdint=wrap
2830	    ;;
2831	esac
2832	;;
2833nds32*-*-*)
2834	target_cpu_default="0"
2835	tm_defines="${tm_defines}"
2836	case ${target} in
2837	  nds32le*-*-*)
2838	    ;;
2839	  nds32be-*-*)
2840	    target_cpu_default="${target_cpu_default}|MASK_BIG_ENDIAN"
2841	    tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
2842	    ;;
2843	esac
2844	case ${target} in
2845	  nds32*-*-elf*)
2846	    tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} nds32/elf.h nds32/nds32_intrinsic.h"
2847	    tmake_file="nds32/t-nds32 nds32/t-elf"
2848	    ;;
2849	  nds32*-*-linux*)
2850	    tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h nds32/linux.h nds32/nds32_intrinsic.h"
2851	    tmake_file="${tmake_file} nds32/t-nds32 nds32/t-linux"
2852	    gcc_cv_initfini_array=yes
2853	    ;;
2854	esac
2855
2856	# Handle --enable-default-relax setting.
2857	if test x${enable_default_relax} = xyes; then
2858		tm_defines="${tm_defines} TARGET_DEFAULT_RELAX=1"
2859	fi
2860	# Handle --with-ext-dsp
2861	if test x${with_ext_dsp} = xyes; then
2862		tm_defines="${tm_defines} TARGET_DEFAULT_EXT_DSP=1"
2863	fi
2864	;;
2865nios2-*-*)
2866	tm_file="elfos.h ${tm_file}"
2867        tmake_file="${tmake_file} nios2/t-nios2"
2868        case ${target} in
2869        nios2-*-linux*)
2870                tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h nios2/linux.h "
2871                ;;
2872	nios2-*-elf*)
2873		tm_file="${tm_file} newlib-stdint.h nios2/elf.h"
2874		extra_options="${extra_options} nios2/elf.opt"
2875		;;
2876	nios2-*-rtems*)
2877		tm_file="${tm_file} newlib-stdint.h nios2/rtems.h rtems.h"
2878		tmake_file="${tmake_file} t-rtems nios2/t-rtems"
2879		;;
2880        esac
2881	;;
2882nvptx-*)
2883	tm_file="${tm_file} newlib-stdint.h"
2884	use_gcc_stdint=wrap
2885	tmake_file="nvptx/t-nvptx"
2886	if test x$enable_as_accelerator = xyes; then
2887		extra_programs="${extra_programs} mkoffload\$(exeext)"
2888		tm_file="${tm_file} nvptx/offload.h"
2889	fi
2890	;;
2891or1k*-*-*)
2892	tm_file="elfos.h ${tm_file}"
2893	tmake_file="${tmake_file} or1k/t-or1k"
2894	# Force .init_array support.  The configure script cannot always
2895	# automatically detect that GAS supports it, yet we require it.
2896	gcc_cv_initfini_array=yes
2897
2898	# Handle --with-multilib-list=...
2899	or1k_multilibs="${with_multilib_list}"
2900	if test "$or1k_multilibs" = "default"; then
2901		or1k_multilibs="mcmov,msoft-mul,msoft-div"
2902	fi
2903	or1k_multilibs=`echo $or1k_multilibs | sed -e 's/,/ /g'`
2904	for or1k_multilib in ${or1k_multilibs}; do
2905		case ${or1k_multilib} in
2906		mcmov | msext | msfimm | \
2907		mror | mrori | \
2908		mhard-float | mdouble-float | munordered-float | msoft-float | \
2909		mhard-div | mhard-mul | \
2910		msoft-div | msoft-mul )
2911			TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${or1k_multilib}"
2912			;;
2913		*)
2914			echo "--with-multilib-list=${with_multilib_list} not supported."
2915			exit 1
2916		esac
2917	done
2918	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
2919
2920	case ${target} in
2921	or1k*-*-linux*)
2922		tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h"
2923		tm_file="${tm_file} or1k/linux.h"
2924		;;
2925	or1k*-*-elf*)
2926		tm_file="${tm_file} newlib-stdint.h or1k/elf.h"
2927		extra_options="${extra_options} or1k/elf.opt"
2928		;;
2929	or1k*-*-rtems*)
2930		tm_file="${tm_file} newlib-stdint.h or1k/rtems.h rtems.h"
2931		tmake_file="${tmake_file} or1k/t-rtems"
2932		;;
2933	esac
2934	;;
2935pdp11-*-*)
2936	tm_file="${tm_file} newlib-stdint.h"
2937	use_gcc_stdint=wrap
2938	;;
2939# port not yet contributed
2940#powerpc-*-openbsd*)
2941#	tmake_file="${tmake_file} rs6000/t-fprules"
2942#	extra_headers=
2943#	;;
2944powerpc-*-darwin*)
2945	extra_options="${extra_options} ${cpu_type}/darwin.opt"
2946	case ${target} in
2947	  *-darwin1[0-9]* | *-darwin9*)
2948	    tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
2949	    tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
2950	    ;;
2951	  *-darwin8*)
2952	    tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
2953	    tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
2954	    ;;
2955	  *-darwin7*)
2956	    tm_file="${tm_file} ${cpu_type}/darwin7.h"
2957	    ;;
2958	  *-darwin[456]*)
2959	    # Earlier - ingle arch, with 32b only
2960	    # OS X 10.0, the first edition is Darwin4
2961	    ;;
2962	esac
2963	tmake_file="${tmake_file} t-slibgcc"
2964	;;
2965powerpc64-*-darwin*)
2966	extra_options="${extra_options} ${cpu_type}/darwin.opt"
2967	tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
2968	tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
2969	;;
2970powerpc*-*-freebsd*)
2971	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${fbsd_tm_file} rs6000/sysv4.h"
2972	extra_options="${extra_options} rs6000/sysv4.opt"
2973	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
2974	case ${target} in
2975	    powerpc*le-*-*)
2976		tm_file="${tm_file} rs6000/sysv4le.h" ;;
2977	esac
2978	case ${target} in
2979	     powerpc64*)
2980	    	tm_file="${tm_file} rs6000/default64.h rs6000/freebsd64.h"
2981		tmake_file="${tmake_file} rs6000/t-freebsd64"
2982		extra_options="${extra_options} rs6000/linux64.opt"
2983		if test $fbsd_major -ge 13; then
2984		    tm_defines="${tm_defines} TARGET_FREEBSD32_SECURE_PLT=1"
2985		fi
2986		;;
2987	     *)
2988		if test $fbsd_major -ge 13; then
2989		    tm_file="rs6000/secureplt.h ${tm_file}"
2990		fi
2991	        tm_file="${tm_file} rs6000/freebsd.h"
2992		;;
2993	esac
2994	;;
2995powerpc*-*-netbsd*)
2996	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${nbsd_tm_file} freebsd-spec.h"
2997	case ${target} in
2998	    powerpc64*)
2999		tm_file="rs6000/biarch64.h ${tm_file}"
3000		tm_file="${tm_file} rs6000/sysv4.h rs6000/default64.h rs6000/netbsd64.h"
3001		tmake_file="${tmake_file} rs6000/t-netbsd64"
3002		;;
3003	    *)
3004		tm_file="${tm_file} rs6000/sysv4.h rs6000/netbsd.h"
3005		tmake_file="${tmake_file} rs6000/t-netbsd"
3006		;;
3007	esac
3008	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3009	extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
3010	if test x${enable_secureplt} != xno; then
3011	    tm_file="rs6000/secureplt.h ${tm_file}"
3012	fi
3013	;;
3014powerpc-*-eabisimaltivec*)
3015	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h"
3016	extra_options="${extra_options} rs6000/sysv4.opt"
3017	tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
3018	use_gcc_stdint=wrap
3019	;;
3020powerpc-*-eabisim*)
3021	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
3022	extra_options="${extra_options} rs6000/sysv4.opt"
3023	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3024	use_gcc_stdint=wrap
3025	;;
3026powerpc-*-elf*)
3027	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h"
3028	extra_options="${extra_options} rs6000/sysv4.opt"
3029	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3030	;;
3031powerpc-*-eabialtivec*)
3032	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabialtivec.h"
3033	extra_options="${extra_options} rs6000/sysv4.opt"
3034	tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
3035	use_gcc_stdint=wrap
3036	;;
3037powerpc-*-eabi*)
3038	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h"
3039	extra_options="${extra_options} rs6000/sysv4.opt"
3040	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3041	use_gcc_stdint=wrap
3042	;;
3043powerpc-*-rtems*)
3044	tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/rtems.h rtems.h"
3045	extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
3046	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
3047	;;
3048powerpc*-*-linux*)
3049	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h freebsd-spec.h rs6000/sysv4.h"
3050	extra_options="${extra_options} rs6000/sysv4.opt"
3051	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
3052	extra_objs="$extra_objs rs6000-linux.o"
3053	case ${target} in
3054	    powerpc*le-*-*)
3055		tm_file="${tm_file} rs6000/sysv4le.h" ;;
3056	esac
3057	case ${target}:${with_cpu} in
3058	    powerpc64*: | powerpc64*:native) cpu_is_64bit=yes ;;
3059	esac
3060	maybe_biarch=${cpu_is_64bit}
3061	case ${enable_targets} in
3062	    *powerpc64*) maybe_biarch=yes ;;
3063	    all) maybe_biarch=yes ;;
3064	esac
3065	case ${target}:${enable_targets}:${maybe_biarch} in
3066	    powerpc64-* | powerpc-*:*:yes | *:*powerpc64-*:yes | *:all:yes \
3067	    | powerpc64le*:*powerpcle* | powerpc64le*:*powerpc-* \
3068	    | powerpcle-*:*powerpc64le*:yes)
3069		if test x$cpu_is_64bit = xyes; then
3070		    tm_file="${tm_file} rs6000/default64.h"
3071		fi
3072		tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h glibc-stdint.h"
3073		tmake_file="$tmake_file rs6000/t-linux64"
3074		case ${target} in
3075		    powerpc*le-*-*)
3076			tmake_file="$tmake_file rs6000/t-linux64le"
3077			case ${enable_targets} in
3078			    all | *powerpc64-* | *powerpc-*)
3079				tmake_file="$tmake_file rs6000/t-linux64lebe" ;;
3080			esac ;;
3081		    *)
3082			case ${enable_targets} in
3083			    all | *powerpc64le-* | *powerpcle-*)
3084				tmake_file="$tmake_file rs6000/t-linux64bele" ;;
3085			esac ;;
3086		esac
3087		extra_options="${extra_options} rs6000/linux64.opt"
3088		;;
3089	    powerpc64*)
3090		tm_file="${tm_file} rs6000/default64.h rs6000/linux64.h glibc-stdint.h"
3091		extra_options="${extra_options} rs6000/linux64.opt"
3092		tmake_file="${tmake_file} rs6000/t-linux"
3093		;;
3094	    *)
3095		tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
3096		tmake_file="${tmake_file} rs6000/t-ppcos rs6000/t-linux"
3097		;;
3098	esac
3099	case ${target} in
3100	    powerpc*-*-linux*ppc476*)
3101		tm_file="${tm_file} rs6000/476.h"
3102		extra_options="${extra_options} rs6000/476.opt" ;;
3103	    powerpc*-*-linux*altivec*)
3104		tm_file="${tm_file} rs6000/linuxaltivec.h" ;;
3105	esac
3106	case ${target} in
3107	    *-linux*-musl*)
3108		enable_secureplt=yes ;;
3109	esac
3110	if test x${enable_secureplt} = xyes; then
3111		tm_file="rs6000/secureplt.h ${tm_file}"
3112	fi
3113	;;
3114powerpc-wrs-vxworks*)
3115	tm_file="${tm_file} elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
3116	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
3117	extra_options="${extra_options} rs6000/sysv4.opt"
3118	extra_headers="${extra_headers} ppc-asm.h"
3119	case ${target} in
3120          *-vxworksmils*)
3121            tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksmils.h"
3122            tmake_file="${tmake_file} rs6000/t-vxworksmils"
3123            ;;
3124	  *-vxworksae*)
3125	    tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksae.h"
3126	    tmake_file="${tmake_file} rs6000/t-vxworksae"
3127	    ;;
3128	  *-vxworks*)
3129	    tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h"
3130	    ;;
3131	esac
3132	;;
3133powerpc-*-lynxos*)
3134	xm_defines=POSIX
3135	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
3136	tmake_file="t-lynx rs6000/t-lynx"
3137	extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
3138	thread_file=lynx
3139	gnu_ld=yes
3140	gas=yes
3141	;;
3142powerpcle-*-elf*)
3143	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h"
3144	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3145	extra_options="${extra_options} rs6000/sysv4.opt"
3146	;;
3147powerpcle-*-eabisim*)
3148	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
3149	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3150	extra_options="${extra_options} rs6000/sysv4.opt"
3151	use_gcc_stdint=wrap
3152	;;
3153powerpcle-*-eabi*)
3154	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
3155	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
3156	extra_options="${extra_options} rs6000/sysv4.opt"
3157	use_gcc_stdint=wrap
3158	;;
3159pru*-*-*)
3160	tm_file="elfos.h newlib-stdint.h ${tm_file}"
3161	tmake_file="${tmake_file} pru/t-pru"
3162	extra_objs="pru-pragma.o pru-passes.o"
3163	use_gcc_stdint=wrap
3164	;;
3165rs6000-ibm-aix6.* | powerpc-ibm-aix6.*)
3166	tm_file="${tm_file} rs6000/aix.h rs6000/aix61.h rs6000/xcoff.h rs6000/aix-stdint.h"
3167	tmake_file="rs6000/t-aix52 t-slibgcc"
3168	extra_options="${extra_options} rs6000/aix64.opt"
3169	use_collect2=yes
3170	thread_file='aix'
3171	use_gcc_stdint=wrap
3172	default_use_cxa_atexit=yes
3173	;;
3174rs6000-ibm-aix7.1.* | powerpc-ibm-aix7.1.*)
3175	tm_file="${tm_file} rs6000/aix.h rs6000/aix71.h rs6000/xcoff.h rs6000/aix-stdint.h"
3176	tmake_file="rs6000/t-aix52 t-slibgcc"
3177	extra_options="${extra_options} rs6000/aix64.opt"
3178	use_collect2=yes
3179	thread_file='aix'
3180	use_gcc_stdint=wrap
3181	default_use_cxa_atexit=yes
3182	;;
3183rs6000-ibm-aix[789].* | powerpc-ibm-aix[789].*)
3184	tm_file="${tm_file} rs6000/aix.h rs6000/aix72.h rs6000/xcoff.h rs6000/aix-stdint.h"
3185	tmake_file="rs6000/t-aix52 t-slibgcc"
3186	extra_options="${extra_options} rs6000/aix64.opt"
3187	use_collect2=yes
3188	thread_file='aix'
3189	use_gcc_stdint=wrap
3190	default_use_cxa_atexit=yes
3191	;;
3192rl78-*-elf*)
3193	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
3194	target_has_targetm_common=no
3195	c_target_objs="rl78-c.o"
3196	cxx_target_objs="rl78-c.o"
3197	tmake_file="${tmake_file} rl78/t-rl78"
3198	;;
3199rx-*-elf*)
3200	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
3201	tmake_file="${tmake_file} rx/t-rx"
3202	extra_options="${extra_options} rx/elf.opt"
3203	;;
3204rx-*-linux*)
3205	tm_file="elfos.h linux.h glibc-stdint.h rx/linux.h ../../libgcc/config/rx/rx-abi.h"
3206	tmake_file="${tmake_file} rx/t-linux"
3207	;;
3208s390-*-linux*)
3209	tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
3210	c_target_objs="${c_target_objs} s390-c.o"
3211	cxx_target_objs="${cxx_target_objs} s390-c.o"
3212	if test x$enable_targets = xall; then
3213		tmake_file="${tmake_file} s390/t-linux64"
3214	fi
3215	tmake_file="${tmake_file} s390/t-s390"
3216	;;
3217s390x-*-linux*)
3218	tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
3219	tm_p_file="linux-protos.h s390/s390-protos.h"
3220	c_target_objs="${c_target_objs} s390-c.o"
3221	cxx_target_objs="${cxx_target_objs} s390-c.o"
3222	md_file=s390/s390.md
3223	extra_modes=s390/s390-modes.def
3224	out_file=s390/s390.c
3225	tmake_file="${tmake_file} s390/t-linux64 s390/t-s390"
3226	;;
3227s390x-ibm-tpf*)
3228	tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h glibc-stdint.h s390/tpf.h"
3229	tm_p_file=s390/s390-protos.h
3230	c_target_objs="${c_target_objs} s390-c.o"
3231	cxx_target_objs="${cxx_target_objs} s390-c.o"
3232	md_file=s390/s390.md
3233	extra_modes=s390/s390-modes.def
3234	out_file=s390/s390.c
3235	thread_file='tpf'
3236	extra_options="${extra_options} s390/tpf.opt"
3237	tmake_file="${tmake_file} s390/t-s390"
3238	;;
3239sh-*-elf* | sh[12346l]*-*-elf* | \
3240  sh-*-linux* | sh[2346lbe]*-*-linux* | \
3241  sh-*-netbsdelf* | shl*-*-netbsdelf*)
3242	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
3243	if test x${with_endian} = x; then
3244		case ${target} in
3245		sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
3246		shbe-*-* | sheb-*-*)		   with_endian=big,little ;;
3247		sh[1234]l* | sh[34]*-*-linux*)	   with_endian=little ;;
3248		shl* | sh*-*-linux* | \
3249		  sh-superh-elf)		   with_endian=little,big ;;
3250		sh[1234]*-*-*)			   with_endian=big ;;
3251		*)				   with_endian=big,little ;;
3252		esac
3253	fi
3254	# TM_ENDIAN_CONFIG is used by t-sh to determine multilibs.
3255	#  First word : the default endian.
3256	#  Second word: the secondary endian (optional).
3257	case ${with_endian} in
3258	big)		TM_ENDIAN_CONFIG=mb ;;
3259	little)		TM_ENDIAN_CONFIG=ml ;;
3260	big,little)	TM_ENDIAN_CONFIG="mb ml" ;;
3261	little,big)	TM_ENDIAN_CONFIG="ml mb" ;;
3262	*)	echo "with_endian=${with_endian} not supported."; exit 1 ;;
3263	esac
3264	case ${with_endian} in
3265	little*)	tm_file="sh/little.h ${tm_file}" ;;
3266	esac
3267	tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h"
3268	case ${target} in
3269	sh*-*-linux*)	tmake_file="${tmake_file} sh/t-linux"
3270			if test x$enable_fdpic = xyes; then
3271				tm_defines="$tm_defines FDPIC_DEFAULT=1"
3272			fi
3273			tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
3274	sh*-*-netbsd*)
3275			tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
3276			extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3277
3278			;;
3279	sh*-superh-elf)	if test x$with_libgloss != xno; then
3280                                with_libgloss=yes
3281                                tm_file="${tm_file} sh/newlib.h"
3282                        fi
3283			tm_file="${tm_file} sh/embed-elf.h"
3284			tm_file="${tm_file} sh/superh.h"
3285			extra_options="${extra_options} sh/superh.opt" ;;
3286	*)		if test x$with_newlib = xyes \
3287			   && test x$with_libgloss = xyes; then
3288				tm_file="${tm_file} sh/newlib.h"
3289			fi
3290			tm_file="${tm_file} sh/embed-elf.h" ;;
3291	esac
3292	case ${target} in
3293	*-*-netbsd)
3294		;;
3295	*-*-elf*)
3296		tm_file="${tm_file} newlib-stdint.h"
3297		;;
3298	esac
3299	# sed el/eb endian suffixes away to avoid confusion with sh[23]e
3300	case `echo ${target} | sed 's/e[lb]-/-/'` in
3301	sh4a_single_only*)	sh_cpu_target=sh4a-single-only ;;
3302	sh4a_single*)		sh_cpu_target=sh4a-single ;;
3303	sh4a_nofpu*)		sh_cpu_target=sh4a-nofpu ;;
3304	sh4al)			sh_cpu_target=sh4al ;;
3305	sh4a*)			sh_cpu_target=sh4a ;;
3306	sh4_single_only*)	sh_cpu_target=sh4-single-only ;;
3307	sh4_single*)		sh_cpu_target=sh4-single ;;
3308	sh4_nofpu*)		sh_cpu_target=sh4-nofpu ;;
3309	sh4* | sh-superh-*)	sh_cpu_target=sh4 ;;
3310	sh3e*)			sh_cpu_target=sh3e ;;
3311	sh*-*-netbsd* | sh3*)	sh_cpu_target=sh3 ;;
3312	sh2a_single_only*)	sh_cpu_target=sh2a-single-only ;;
3313	sh2a_single*)		sh_cpu_target=sh2a-single ;;
3314	sh2a_nofpu*)		sh_cpu_target=sh2a-nofpu ;;
3315	sh2a*)			sh_cpu_target=sh2a ;;
3316	sh2e*)			sh_cpu_target=sh2e ;;
3317	sh2*)			sh_cpu_target=sh2 ;;
3318	*)			sh_cpu_target=sh1 ;;
3319	esac
3320	# did the user say --without-fp ?
3321	if test x$with_fp = xno; then
3322		case ${sh_cpu_target} in
3323		sh4al | sh1)	;;
3324		sh4a* )		sh_cpu_target=sh4a-nofpu ;;
3325		sh4*)		sh_cpu_target=sh4-nofpu ;;
3326		sh3*)		sh_cpu_target=sh3 ;;
3327		sh2a*)		sh_cpu_target=sh2a-nofpu ;;
3328		sh2*)		sh_cpu_target=sh2 ;;
3329		*)	echo --without-fp not available for $target: ignored
3330		esac
3331		tm_defines="$tm_defines STRICT_NOFPU=1"
3332	fi
3333	sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr A-Z_ a-z-`"
3334	case $sh_cpu_default in
3335	  sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
3336	  sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
3337	  sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
3338	  sh3e | sh3 | sh2e | sh2 | sh1) ;;
3339	"")	sh_cpu_default=${sh_cpu_target} ;;
3340	*)	echo "with_cpu=$with_cpu not supported"; exit 1 ;;
3341	esac
3342	sh_multilibs=${with_multilib_list}
3343	if test "$sh_multilibs" = "default" ; then
3344		case ${target} in
3345		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
3346		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
3347		sh*-*-linux*)	sh_multilibs=m1,m2,m2a,m3e,m4 ;;
3348		sh*-*-netbsd*)	sh_multilibs=m3,m3e,m4 ;;
3349		*) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
3350		esac
3351		if test x$with_fp = xno; then
3352			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`"
3353		fi
3354	fi
3355	target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
3356	tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
3357	tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
3358	sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^[Ss][Hh]/m/' -e 's/ [Ss][Hh]/ m/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
3359	for sh_multilib in ${sh_multilibs}; do
3360		case ${sh_multilib} in
3361		m1 | m2 | m2e | m3 | m3e | \
3362		m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
3363		m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
3364		m2a | m2a-single | m2a-single-only | m2a-nofpu)
3365			# TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
3366			# It is passed to MULTIILIB_OPTIONS verbatim.
3367			TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
3368			tm_defines="$tm_defines SUPPORT_`echo $sh_multilib | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
3369			;;
3370		\!*)	# TM_MULTILIB_EXCEPTIONS_CONFIG is used by t-sh
3371			# It is passed the MULTILIB_EXCEPTIONS verbatim.
3372			TM_MULTILIB_EXCEPTIONS_CONFIG="${TM_MULTILIB_EXCEPTIONS_CONFIG} `echo $sh_multilib | sed 's/^!//'`" ;;
3373		*)
3374			echo "with_multilib_list=${sh_multilib} not supported."
3375			exit 1
3376			;;
3377		esac
3378	done
3379	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
3380	if test x${enable_incomplete_targets} = xyes ; then
3381		tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1"
3382	fi
3383	tm_file="$tm_file ./sysroot-suffix.h"
3384	tmake_file="$tmake_file t-sysroot-suffix"
3385	;;
3386sh-*-rtems*)
3387	tmake_file="${tmake_file} sh/t-sh sh/t-rtems"
3388	tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
3389	;;
3390sh-wrs-vxworks)
3391	tmake_file="$tmake_file sh/t-sh sh/t-vxworks"
3392	tm_file="${tm_file} elfos.h sh/elf.h sh/embed-elf.h vx-common.h vxworks.h sh/vxworks.h"
3393	;;
3394sparc-*-elf*)
3395	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
3396	case ${target} in
3397	    *-leon-*)
3398		tmake_file="sparc/t-sparc sparc/t-leon"
3399		;;
3400	    *-leon[3-9]*)
3401		tmake_file="sparc/t-sparc sparc/t-leon3"
3402		;;
3403	    *)
3404		tmake_file="sparc/t-sparc sparc/t-elf"
3405		;;
3406	esac
3407	;;
3408sparc-*-rtems*)
3409	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
3410	tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems"
3411	;;
3412sparc-*-linux*)
3413	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
3414	extra_options="${extra_options} sparc/long-double-switch.opt"
3415	case ${target} in
3416	    *-leon-*)
3417		tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon"
3418		;;
3419	    *-leon[3-9]*)
3420		tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon3"
3421		;;
3422	    *)
3423		tmake_file="${tmake_file} sparc/t-sparc"
3424		;;
3425	esac
3426	if test x$enable_targets = xall; then
3427		tm_file="sparc/biarch64.h ${tm_file} sparc/linux64.h"
3428		tmake_file="${tmake_file} sparc/t-linux64"
3429	else
3430		tm_file="${tm_file} sparc/linux.h"
3431		tmake_file="${tmake_file} sparc/t-linux"
3432	fi
3433	;;
3434sparc-*-netbsdelf*)
3435	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
3436	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3437	extra_options="${extra_options} sparc/long-double-switch.opt"
3438	tmake_file="${tmake_file} sparc/t-sparc"
3439	;;
3440sparc*-*-solaris2*)
3441	tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sparc/tso.h"
3442	case ${target} in
3443	    sparc64-*-* | sparcv9-*-*)
3444		tm_file="sparc/default64.h ${tm_file}"
3445		;;
3446	    *)
3447		test x$with_cpu != x || with_cpu=v9
3448		;;
3449	esac
3450	tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2"
3451	;;
3452sparc-wrs-vxworks)
3453	tm_file="${tm_file} elfos.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
3454	tmake_file="${tmake_file} sparc/t-sparc sparc/t-vxworks"
3455	;;
3456sparc64-*-elf*)
3457	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h"
3458	extra_options="${extra_options}"
3459	tmake_file="${tmake_file} sparc/t-sparc"
3460	;;
3461sparc64-*-rtems*)
3462	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
3463	extra_options="${extra_options}"
3464	tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64"
3465	;;
3466sparc64-*-linux*)
3467	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"
3468	extra_options="${extra_options} sparc/long-double-switch.opt"
3469	tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
3470	;;
3471sparc64-*-freebsd*|ultrasparc-*-freebsd*)
3472	tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
3473	extra_options="${extra_options} sparc/long-double-switch.opt"
3474	case "x$with_cpu" in
3475		xultrasparc) ;;
3476		x) with_cpu=ultrasparc ;;
3477		*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
3478	esac
3479	tmake_file="${tmake_file} sparc/t-sparc"
3480	;;
3481sparc64-*-netbsd*)
3482	tm_file="sparc/biarch64.h ${tm_file}"
3483	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
3484	tm_file="${tm_file} sparc/default64.h"
3485	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3486	extra_options="${extra_options} sparc/long-double-switch.opt"
3487	tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
3488	with_cpu=ultrasparc
3489	;;
3490sparc64-*-openbsd*)
3491	tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
3492	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
3493	extra_options="${extra_options} openbsd.opt"
3494	extra_options="${extra_options}"
3495	gas=yes gnu_ld=yes
3496	with_cpu=ultrasparc
3497	tmake_file="${tmake_file} sparc/t-sparc"
3498	;;
3499tic6x-*-elf)
3500	tm_file="elfos.h ${tm_file} c6x/elf-common.h c6x/elf.h"
3501	tm_file="${tm_file} dbxelf.h tm-dwarf2.h newlib-stdint.h"
3502	tmake_file="c6x/t-c6x c6x/t-c6x-elf"
3503	use_collect2=no
3504	;;
3505tic6x-*-uclinux)
3506	tm_file="elfos.h ${tm_file} gnu-user.h linux.h c6x/elf-common.h c6x/uclinux-elf.h"
3507	tm_file="${tm_file} dbxelf.h tm-dwarf2.h glibc-stdint.h"
3508	tm_file="${tm_file} ./sysroot-suffix.h"
3509	tmake_file="t-sysroot-suffix t-slibgcc"
3510	tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
3511	use_collect2=no
3512	;;
3513tilegx*-*-linux*)
3514	tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilegx/linux.h ${tm_file}"
3515        tmake_file="${tmake_file} tilegx/t-tilegx"
3516	extra_objs="${extra_objs} mul-tables.o"
3517	c_target_objs="${c_target_objs} tilegx-c.o"
3518	cxx_target_objs="${cxx_target_objs} tilegx-c.o"
3519	extra_headers="feedback.h"
3520	case $target in
3521	tilegxbe-*)
3522		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
3523 		;;
3524	esac
3525	;;
3526tilepro*-*-linux*)
3527	tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilepro/linux.h ${tm_file}"
3528        tmake_file="${tmake_file} tilepro/t-tilepro"
3529	extra_objs="${extra_objs} mul-tables.o"
3530	c_target_objs="${c_target_objs} tilepro-c.o"
3531	cxx_target_objs="${cxx_target_objs} tilepro-c.o"
3532	extra_headers="feedback.h"
3533	;;
3534v850-*-rtems*)
3535	target_cpu_default="TARGET_CPU_generic"
3536	tm_file="dbxelf.h elfos.h v850/v850.h"
3537	tm_file="${tm_file} rtems.h v850/rtems.h newlib-stdint.h"
3538	tmake_file="${tmake_file} v850/t-v850"
3539	tmake_file="${tmake_file} v850/t-rtems"
3540	use_collect2=no
3541	c_target_objs="v850-c.o"
3542	cxx_target_objs="v850-c.o"
3543	;;
3544v850*-*-*)
3545	case ${target} in
3546	v850e3v5-*-*)
3547		target_cpu_default="TARGET_CPU_v850e3v5"
3548		;;
3549	v850e2v3-*-*)
3550		target_cpu_default="TARGET_CPU_v850e2v3"
3551		;;
3552	v850e2-*-*)
3553		target_cpu_default="TARGET_CPU_v850e2"
3554		;;
3555	v850e1-*-* | v850es-*-*)
3556		target_cpu_default="TARGET_CPU_v850e1"
3557		;;
3558	v850e-*-*)
3559		target_cpu_default="TARGET_CPU_v850e"
3560		;;
3561	v850-*-*)
3562		target_cpu_default="TARGET_CPU_generic"
3563		;;
3564	esac
3565	tm_file="dbxelf.h elfos.h newlib-stdint.h v850/v850.h"
3566	if test x$stabs = xyes
3567	then
3568		tm_file="${tm_file} dbx.h"
3569	fi
3570	use_collect2=no
3571	c_target_objs="v850-c.o"
3572	cxx_target_objs="v850-c.o"
3573	use_gcc_stdint=wrap
3574	;;
3575vax-*-linux*)
3576	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
3577	extra_options="${extra_options} vax/elf.opt"
3578	;;
3579vax-*-netbsdelf*)
3580	tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
3581	extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
3582	tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
3583	;;
3584vax-*-openbsd*)
3585	tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-libpthread.h vax/openbsd.h"
3586	extra_options="${extra_options} openbsd.opt"
3587	use_collect2=yes
3588	;;
3589visium-*-elf*)
3590	tm_file="dbxelf.h elfos.h ${tm_file} visium/elf.h newlib-stdint.h"
3591	tmake_file="visium/t-visium visium/t-crtstuff"
3592	;;
3593xstormy16-*-elf)
3594	# For historical reasons, the target files omit the 'x'.
3595	tm_file="dbxelf.h elfos.h newlib-stdint.h stormy16/stormy16.h"
3596	tm_p_file=stormy16/stormy16-protos.h
3597	tm_d_file="elfos.h stormy16/stormy16.h"
3598	md_file=stormy16/stormy16.md
3599	out_file=stormy16/stormy16.c
3600	extra_options=stormy16/stormy16.opt
3601	tmake_file="stormy16/t-stormy16"
3602	;;
3603xtensa*-*-elf*)
3604	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h"
3605	extra_options="${extra_options} xtensa/elf.opt"
3606	;;
3607xtensa*-*-linux*)
3608	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
3609	tmake_file="${tmake_file} xtensa/t-xtensa"
3610	;;
3611xtensa*-*-uclinux*)
3612	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
3613	tmake_file="${tmake_file} xtensa/t-xtensa"
3614	extra_options="${extra_options} xtensa/uclinux.opt"
3615	;;
3616am33_2.0-*-linux*)
3617	tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
3618	gas=yes gnu_ld=yes
3619	use_collect2=no
3620	;;
3621m32c-*-rtems*)
3622	tm_file="dbxelf.h elfos.h ${tm_file} m32c/rtems.h rtems.h newlib-stdint.h"
3623	c_target_objs="m32c-pragma.o"
3624	cxx_target_objs="m32c-pragma.o"
3625 	;;
3626m32c-*-elf*)
3627	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
3628	c_target_objs="m32c-pragma.o"
3629	cxx_target_objs="m32c-pragma.o"
3630 	;;
3631*)
3632	echo "*** Configuration ${target} not supported" 1>&2
3633	exit 1
3634	;;
3635esac
3636
3637case ${target} in
3638i[34567]86-*-linux* | x86_64-*-linux*)
3639	tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386"
3640	;;
3641i[34567]86-*-* | x86_64-*-*)
3642	tmake_file="${tmake_file} i386/t-gmm_malloc i386/t-i386"
3643	;;
3644powerpc*-*-* | rs6000-*-*)
3645	tm_file="${tm_file} ${cpu_type}/option-defaults.h"
3646esac
3647
3648# non-glibc systems
3649case ${target} in
3650*-linux-musl*)
3651	tmake_file="${tmake_file} t-musl"
3652	;;
3653*-linux-uclibc*)
3654	tmake_file="${tmake_file} t-uclibc"
3655	;;
3656esac
3657
3658# Assume the existence of indirect function support and allow the use of the
3659# resolver attribute.
3660case ${target} in
3661*-*-linux*android*|*-*-linux*uclibc*|*-*-linux*musl*)
3662        ;;
3663*-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
3664        ;;
3665*-*-linux* | *-*-gnu*)
3666	case ${target} in
3667	aarch64*-* | arm*-* | i[34567]86-* | powerpc*-* | s390*-* | sparc*-* | x86_64-*)
3668		default_gnu_indirect_function=yes
3669		;;
3670	esac
3671	;;
3672esac
3673
3674# Build mkoffload tool
3675case ${target} in
3676*-intelmic-* | *-intelmicemul-*)
3677	tmake_file="${tmake_file} i386/t-intelmic"
3678	tm_file="${tm_file} i386/intelmic-offload.h"
3679	;;
3680esac
3681
3682if [ "$target_has_targetcm" = "no" ]; then
3683  c_target_objs="$c_target_objs default-c.o"
3684  cxx_target_objs="$cxx_target_objs default-c.o"
3685fi
3686
3687if [ "$common_out_file" = "" ]; then
3688  if [ "$target_has_targetm_common" = "yes" ]; then
3689    common_out_file="$cpu_type/$cpu_type-common.c"
3690  else
3691    common_out_file="default-common.c"
3692  fi
3693fi
3694
3695if [ "$target_has_targetdm" = "no" ]; then
3696  d_target_objs="$d_target_objs default-d.o"
3697fi
3698
3699# Support for --with-cpu and related options (and a few unrelated options,
3700# too).
3701case ${with_cpu} in
3702  yes | no)
3703    echo "--with-cpu must be passed a value" 1>&2
3704    exit 1
3705    ;;
3706esac
3707
3708# Set arch and cpu from ${target} and ${target_noncanonical}.  Set cpu
3709# to generic if there is no processor scheduler model for the target.
3710arch=
3711cpu=
3712arch_without_sse2=no
3713arch_without_64bit=no
3714case ${target} in
3715  i386-*-freebsd*)
3716    if test $fbsd_major -ge 6; then
3717      arch=i486
3718    else
3719      arch=i386
3720    fi
3721    cpu=generic
3722    arch_without_sse2=yes
3723    arch_without_64bit=yes
3724    ;;
3725  i386-*-netbsd*)
3726    arch=i486
3727    cpu=generic
3728    arch_without_sse2=yes
3729    arch_without_64bit=yes
3730    ;;
3731  i386-*-*)
3732    arch=i386
3733    cpu=i386
3734    arch_without_sse2=yes
3735    arch_without_64bit=yes
3736    ;;
3737  i486-*-*)
3738    arch=i486
3739    cpu=i486
3740    arch_without_sse2=yes
3741    arch_without_64bit=yes
3742    ;;
3743  i586-*-*)
3744    arch_without_sse2=yes
3745    arch_without_64bit=yes
3746    case ${target_noncanonical} in
3747      k6_2-*)
3748	arch=k6-2
3749	cpu=k6-2
3750	;;
3751      k6_3-*)
3752	arch=k6-3
3753	cpu=k6-3
3754	;;
3755      k6-*)
3756	arch=k6
3757	cpu=k6
3758	;;
3759      pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
3760	arch=pentium-mmx
3761	cpu=pentium-mmx
3762	;;
3763      *)
3764	arch=pentium
3765	cpu=pentium
3766	;;
3767    esac
3768    ;;
3769  i686-*-* | i786-*-*)
3770    case ${target_noncanonical} in
3771      znver1-*)
3772	arch=znver1
3773	cpu=znver1
3774	;;
3775      znver2-*)
3776	arch=znver2
3777	cpu=znver2
3778	;;
3779      znver3-*)
3780	arch=znver3
3781	cpu=znver3
3782	;;
3783      bdver4-*)
3784        arch=bdver4
3785        cpu=bdver4
3786        ;;
3787      bdver3-*)
3788        arch=bdver3
3789        cpu=bdver3
3790        ;;
3791      bdver2-*)
3792        arch=bdver2
3793        cpu=bdver2
3794        ;;
3795      bdver1-*)
3796	arch=bdver1
3797	cpu=bdver1
3798	;;
3799      btver1-*)
3800	arch=btver1
3801	cpu=btver1
3802	;;
3803      btver2-*)
3804	arch=btver2
3805	cpu=btver2
3806	;;
3807      amdfam10-*|barcelona-*)
3808	arch=amdfam10
3809	cpu=amdfam10
3810	;;
3811      k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3812	arch=k8-sse3
3813	cpu=k8-sse3
3814	;;
3815      k8-*|opteron-*|athlon64-*|athlon_fx-*)
3816	arch=k8
3817	cpu=k8
3818	;;
3819      athlon_xp-*|athlon_mp-*|athlon_4-*)
3820	arch=athlon-4
3821	cpu=athlon-4
3822	arch_without_sse2=yes
3823	arch_without_64bit=yes
3824	;;
3825      athlon_tbird-*|athlon-*)
3826	arch=athlon
3827	cpu=athlon
3828	arch_without_sse2=yes
3829	;;
3830      geode-*)
3831	arch=geode
3832	cpu=geode
3833	arch_without_sse2=yes
3834	;;
3835      pentium2-*)
3836	arch=pentium2
3837	cpu=pentium2
3838	arch_without_sse2=yes
3839	;;
3840      pentium3-*|pentium3m-*)
3841	arch=pentium3
3842	cpu=pentium3
3843	arch_without_sse2=yes
3844	;;
3845      pentium4-*|pentium4m-*)
3846	arch=pentium4
3847	cpu=pentium4
3848	;;
3849      prescott-*)
3850	arch=prescott
3851	cpu=prescott
3852	;;
3853      nocona-*)
3854	arch=nocona
3855	cpu=nocona
3856	;;
3857      atom-*)
3858	arch=atom
3859	cpu=atom
3860	;;
3861      slm-*)
3862	arch=slm
3863	cpu=slm
3864	;;
3865      core2-*)
3866	arch=core2
3867	cpu=core2
3868	;;
3869      corei7-*)
3870	arch=corei7
3871	cpu=corei7
3872	;;
3873      corei7_avx-*)
3874	arch=corei7-avx
3875	cpu=corei7-avx
3876	;;
3877      pentium_m-*)
3878	arch=pentium-m
3879	cpu=pentium-m
3880	;;
3881      pentiumpro-*)
3882	arch=pentiumpro
3883	cpu=pentiumpro
3884	arch_without_sse2=yes
3885	;;
3886      *)
3887	arch=pentiumpro
3888	cpu=generic
3889	arch_without_sse2=yes
3890	arch_without_64bit=yes
3891	;;
3892    esac
3893    ;;
3894  x86_64-*-*)
3895    case ${target_noncanonical} in
3896      znver1-*)
3897	arch=znver1
3898	cpu=znver1
3899	;;
3900      znver2-*)
3901	arch=znver2
3902	cpu=znver2
3903	;;
3904      znver3-*)
3905	arch=znver3
3906	cpu=znver3
3907	;;
3908      bdver4-*)
3909        arch=bdver4
3910        cpu=bdver4
3911        ;;
3912      bdver3-*)
3913        arch=bdver3
3914        cpu=bdver3
3915        ;;
3916      bdver2-*)
3917        arch=bdver2
3918        cpu=bdver2
3919        ;;
3920      bdver1-*)
3921	arch=bdver1
3922	cpu=bdver1
3923	;;
3924      btver1-*)
3925	arch=btver1
3926	cpu=btver1
3927	;;
3928      btver2-*)
3929	arch=btver2
3930	cpu=btver2
3931	;;
3932      amdfam10-*|barcelona-*)
3933	arch=amdfam10
3934	cpu=amdfam10
3935	;;
3936      k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3937	arch=k8-sse3
3938	cpu=k8-sse3
3939	;;
3940      k8-*|opteron-*|athlon_64-*)
3941	arch=k8
3942	cpu=k8
3943	;;
3944      nocona-*)
3945	arch=nocona
3946	cpu=nocona
3947	;;
3948      atom-*)
3949	arch=atom
3950	cpu=atom
3951	;;
3952      slm-*)
3953	arch=slm
3954	cpu=slm
3955	;;
3956      core2-*)
3957	arch=core2
3958	cpu=core2
3959	;;
3960      corei7-*)
3961	arch=corei7
3962	cpu=corei7
3963	;;
3964      *)
3965	arch=x86-64
3966	cpu=generic
3967	;;
3968    esac
3969    ;;
3970esac
3971
3972# If there is no $with_cpu option, try to infer one from ${target}.
3973# This block sets nothing except for with_cpu.
3974if test x$with_cpu = x ; then
3975  case ${target} in
3976    i[34567]86-*-elfiamcu)
3977      with_cpu=lakemont
3978      ;;
3979    i[34567]86-*-*|x86_64-*-*)
3980      with_cpu=$cpu
3981      ;;
3982    alphaev6[78]*-*-*)
3983      with_cpu=ev67
3984      ;;
3985    alphaev6*-*-*)
3986      with_cpu=ev6
3987      ;;
3988    alphapca56*-*-*)
3989      with_cpu=pca56
3990      ;;
3991    alphaev56*-*-*)
3992      with_cpu=ev56
3993      ;;
3994    alphaev5*-*-*)
3995      with_cpu=ev5
3996      ;;
3997    frv-*-*linux* | frv400-*-*linux*)
3998      with_cpu=fr400
3999      ;;
4000    frv550-*-*linux*)
4001      with_cpu=fr550
4002      ;;
4003    m5200-*-*|m5407-*-*)
4004      with_cpu=${default_cf_cpu}
4005      ;;
4006    m68k*-*-*)
4007      case "$with_arch" in
4008	"cf")
4009	  with_cpu=${default_cf_cpu}
4010	  ;;
4011	"" | "m68k")
4012	  with_cpu=m${default_m68k_cpu}
4013	  ;;
4014      esac
4015      ;;
4016    sparc*-*-*)
4017      case ${target} in
4018	*-leon-*)
4019	  with_cpu=leon
4020	  ;;
4021	*-leon[3-9]*)
4022	  with_cpu=leon3
4023	  ;;
4024	*-leon[3-9]v7*)
4025	  with_cpu=leon3v7
4026	  ;;
4027	*)
4028	  with_cpu="`echo ${target} | sed 's/-.*$//'`"
4029	  ;;
4030      esac
4031      ;;
4032    visium-*-*)
4033      with_cpu=gr5
4034      ;;
4035  esac
4036
4037  # Avoid overriding --with-cpu-32 and --with-cpu-64 values.
4038  case ${target} in
4039    i[34567]86-*-*|x86_64-*-*)
4040      if test x$with_cpu_32 != x || test x$with_cpu_64 != x; then
4041	if test x$with_cpu_32 = x; then
4042	  with_cpu_32=$with_cpu
4043	fi
4044	if test x$with_cpu_64 = x; then
4045	  with_cpu_64=$with_cpu
4046	fi
4047        with_cpu=
4048      fi
4049      ;;
4050  esac
4051fi
4052
4053# Support for --with-arch and related options (and a few unrelated options,
4054# too).
4055case ${with_arch} in
4056  yes | no)
4057    echo "--with-arch must be passed a value" 1>&2
4058    exit 1
4059    ;;
4060esac
4061
4062# If there is no $with_arch option, try to infer one from ${target}.
4063# This block sets nothing except for with_arch.
4064if test x$with_arch = x ; then
4065  case ${target} in
4066    i[34567]86-*-darwin*|x86_64-*-darwin*)
4067      # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
4068      # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
4069      ;;
4070    i[34567]86-*-elfiamcu)
4071      with_arch=lakemont
4072      ;;
4073    i[34567]86-*-*)
4074      # --with-fpmath sets the default ISA to SSE2, which is the same
4075      # ISA supported by Pentium 4.
4076      if test x$with_fpmath = x || test $arch_without_sse2 = no; then
4077	with_arch=$arch
4078      else
4079	with_arch=pentium4
4080      fi
4081      ;;
4082    x86_64-*-*)
4083      with_arch=$arch
4084      ;;
4085    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4086      with_arch=r5900
4087      ;;
4088    mips*-*-vxworks)
4089      with_arch=mips2
4090      ;;
4091  esac
4092
4093  # Avoid overriding --with-arch-32 and --with-arch-64 values.
4094  case ${target} in
4095    i[34567]86-*-darwin*|x86_64-*-darwin*)
4096      # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
4097      # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
4098      ;;
4099    i[34567]86-*-*|x86_64-*-*)
4100      if test x$with_arch_32 != x || test x$with_arch_64 != x; then
4101	if test x$with_arch_32 = x; then
4102	  with_arch_32=$with_arch
4103	fi
4104	if test x$with_arch_64 = x; then
4105	  if test $arch_without_64bit = yes; then
4106	    # Set the default 64bit arch to x86-64 if the default arch
4107	    # doesn't support 64bit.
4108	    with_arch_64=x86-64
4109	  else
4110	    with_arch_64=$with_arch
4111	  fi
4112	fi
4113	with_arch=
4114      elif test $arch_without_64bit$need_64bit_isa = yesyes; then
4115	# Set the default 64bit arch to x86-64 if the default arch
4116	# doesn't support 64bit and we need 64bit ISA.
4117	with_arch_32=$with_arch
4118	with_arch_64=x86-64
4119	with_arch=
4120      fi
4121      ;;
4122  esac
4123fi
4124
4125# Infer a default setting for --with-float.
4126if test x$with_float = x; then
4127  case ${target} in
4128    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4129      # The R5900 doesn't support 64-bit float.  32-bit float doesn't
4130      # comply with IEEE 754.
4131      with_float=soft
4132      ;;
4133  esac
4134fi
4135
4136# Infer a default setting for --with-fpu.
4137if test x$with_fpu = x; then
4138  case ${target} in
4139    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4140      # The R5900 FPU only supports single precision.
4141      with_fpu=single
4142      ;;
4143  esac
4144fi
4145
4146# Support --with-fpmath.
4147if test x$with_fpmath != x; then
4148  case ${target} in
4149    i[34567]86-*-* | x86_64-*-*)
4150      case ${with_fpmath} in
4151      avx)
4152	tm_file="${tm_file} i386/avxmath.h"
4153	;;
4154      sse)
4155	tm_file="${tm_file} i386/ssemath.h"
4156	;;
4157      *)
4158	echo "Invalid --with-fpmath=$with_fpmath" 1>&2
4159	exit 1
4160	;;
4161      esac
4162      ;;
4163    *)
4164      echo "--with-fpmath isn't supported for $target." 1>&2
4165      exit 1
4166      ;;
4167  esac
4168fi
4169
4170# Similarly for --with-schedule.
4171if test x$with_schedule = x; then
4172	case ${target} in
4173	hppa1*)
4174		# Override default PA8000 scheduling model.
4175		with_schedule=7100LC
4176		;;
4177	esac
4178fi
4179
4180# Infer a default setting for --with-llsc.
4181if test x$with_llsc = x; then
4182  case ${target} in
4183    mips*-*-linux*)
4184      # The kernel emulates LL and SC where necessary.
4185      with_llsc=yes
4186      ;;
4187    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4188      # The R5900 doesn't support LL(D) and SC(D).
4189      with_llsc=no
4190      ;;
4191  esac
4192fi
4193
4194# Validate and mark as valid any --with options supported
4195# by this target.  In order to use a particular --with option
4196# you must list it in supported_defaults; validating the value
4197# is optional.  This case statement should set nothing besides
4198# supported_defaults.
4199
4200supported_defaults=
4201case "${target}" in
4202	aarch64*-*-*)
4203		supported_defaults="abi cpu cpu_64 arch arch_64 tune tune_64"
4204		if test x$with_cpu_64 != x && test x$with_cpu = x; then
4205			with_cpu=$with_cpu_64
4206		fi
4207		if test x$with_arch_64 != x && test x$with_arch = x; then
4208			with_arch=$with_arch_64
4209		fi
4210		if test x$with_tune_64 != x && test x$with_tune = x; then
4211			with_tune=$with_tune_64
4212		fi
4213		for which in cpu arch tune; do
4214			eval "val=\$with_$which"
4215			base_val=`echo $val | sed -e 's/\+.*//'`
4216			ext_val=`echo $val | sed -e 's/[a-z0-9.-]\+//'`
4217
4218			if [ $which = arch ]; then
4219			  def=aarch64-arches.def
4220			  pattern=AARCH64_ARCH
4221			else
4222			  def=aarch64-cores.def
4223			  pattern=AARCH64_CORE
4224			fi
4225
4226			ext_mask=AARCH64_CPU_DEFAULT_FLAGS
4227
4228			# Find the base CPU or ARCH id in aarch64-cores.def or
4229			# aarch64-arches.def
4230			if [ x"$base_val" = x ] \
4231			    || grep "^$pattern(\"$base_val\"," \
4232				    ${srcdir}/config/aarch64/$def \
4233				    > /dev/null; then
4234
4235			  if [ $which = arch ]; then
4236				base_id=`grep "^$pattern(\"$base_val\"," \
4237				  ${srcdir}/config/aarch64/$def | \
4238				  sed -e 's/^[^,]*,[ 	]*//' | \
4239				  sed -e 's/,.*$//'`
4240				# Extract the architecture flags from aarch64-arches.def
4241				ext_mask=`grep "^$pattern(\"$base_val\"," \
4242				   ${srcdir}/config/aarch64/$def | \
4243				   sed -e 's/)$//' | \
4244				   sed -e 's/^.*,//'`
4245			  else
4246				base_id=`grep "^$pattern(\"$base_val\"," \
4247				  ${srcdir}/config/aarch64/$def | \
4248				  sed -e 's/^[^,]*,[ 	]*//' | \
4249				  sed -e 's/,.*$//'`
4250			  fi
4251
4252			  # Disallow extensions in --with-tune=cortex-a53+crc.
4253			  if [ $which = tune ] && [ x"$ext_val" != x ]; then
4254			    echo "Architecture extensions not supported in --with-$which=$val" 1>&2
4255			    exit 1
4256			  fi
4257
4258			  # Use the pre-processor to strip flatten the options.
4259			  # This makes the format less rigid than if we use
4260			  # grep and sed directly here.
4261			  opt_macro="AARCH64_OPT_EXTENSION(A, B, C, D, E, F)=A, B, C, D, E, F"
4262			  options_parsed="`$ac_cv_prog_CPP -D"$opt_macro" -x c \
4263				${srcdir}/config/aarch64/aarch64-option-extensions.def`"
4264
4265			  # Match one element inside AARCH64_OPT_EXTENSION, we
4266			  # consume anything that's not a ,.
4267			  elem="[ 	]*\([^,]\+\)[ 	]*"
4268
4269			  # Repeat the pattern for the number of entries in the
4270			  # AARCH64_OPT_EXTENSION, currently 6 times.
4271			  sed_patt="^$elem,$elem,$elem,$elem,$elem,$elem"
4272
4273			  while [ x"$ext_val" != x ]
4274			  do
4275				ext_val=`echo $ext_val | sed -e 's/\+//'`
4276				ext=`echo $ext_val | sed -e 's/\+.*//'`
4277				base_ext=`echo $ext | sed -e 's/^no//'`
4278				opt_line=`echo -e "$options_parsed" | \
4279					grep "^\"$base_ext\""`
4280
4281				if [ x"$base_ext" = x ] \
4282				    || [[ -n $opt_line ]]; then
4283
4284				  # These regexp extract the elements based on
4285				  # their group match index in the regexp.
4286				  ext_canon=`echo -e "$opt_line" | \
4287					sed -e "s/$sed_patt/\2/"`
4288				  ext_on=`echo -e "$opt_line" | \
4289					sed -e "s/$sed_patt/\3/"`
4290				  ext_off=`echo -e "$opt_line" | \
4291					sed -e "s/$sed_patt/\4/"`
4292
4293				  if [ $ext = $base_ext ]; then
4294					# Adding extension
4295					ext_mask="("$ext_mask") | ("$ext_on" | "$ext_canon")"
4296				  else
4297					# Removing extension
4298					ext_mask="("$ext_mask") & ~("$ext_off" | "$ext_canon")"
4299				  fi
4300
4301				  true
4302				else
4303				  echo "Unknown extension used in --with-$which=$val" 1>&2
4304				  exit 1
4305				fi
4306				ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'`
4307			  done
4308
4309			  ext_mask="(("$ext_mask") << 6)"
4310			  if [ x"$base_id" != x ]; then
4311				target_cpu_cname="TARGET_CPU_$base_id | $ext_mask"
4312			  fi
4313			  true
4314			else
4315			  # Allow --with-$which=native.
4316			  if [ "$val" = native ]; then
4317			    true
4318			  else
4319			    echo "Unknown $which used in --with-$which=$val" 1>&2
4320			    exit 1
4321			  fi
4322			fi
4323		done
4324		;;
4325
4326	alpha*-*-*)
4327		supported_defaults="cpu tune"
4328		for which in cpu tune; do
4329			eval "val=\$with_$which"
4330			case "$val" in
4331			"" \
4332			| ev4 | ev45 | 21064 | ev5 | 21164 | ev56 | 21164a \
4333			| pca56 | 21164PC | 21164pc | ev6 | 21264 | ev67 \
4334			| 21264a)
4335				;;
4336			*)
4337				echo "Unknown CPU used in --with-$which=$val" 1>&2
4338				exit 1
4339				;;
4340			esac
4341		done
4342		;;
4343
4344	arc*-*-*)
4345		supported_defaults="cpu"
4346
4347		if [ x"$with_cpu" = x ] \
4348		    || grep "^ARC_CPU ($with_cpu," \
4349		       ${srcdir}/config/arc/arc-cpus.def \
4350		       > /dev/null; then
4351		 # Ok
4352		 true
4353		else
4354		 echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4355		 exit 1
4356		fi
4357		;;
4358
4359    csky-*-*)
4360	supported_defaults="cpu endian float"
4361	;;
4362
4363	arm*-*-*)
4364		supported_defaults="arch cpu float tune fpu abi mode tls"
4365		for which in cpu tune arch; do
4366			# See if it matches a supported value
4367			eval "val=\$with_$which"
4368			if [ x"$val" != x ]; then
4369			  cpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
4370				-v cmd="chk$which $val" \
4371				${srcdir}/config/arm/arm-cpus.in`
4372			  if [ "$cpu" = "error" ]; then
4373			    echo "Unknown target in --with-$which=$val" 1>&2
4374			    exit 1
4375			  else
4376			    new_val=$cpu
4377			    eval "target_${which}_cname=$new_val"
4378			    echo "For $val real value is $new_val"
4379			  fi
4380			fi
4381		done
4382
4383		case "$with_float" in
4384		"" \
4385		| soft | hard | softfp)
4386			# OK
4387			;;
4388		*)
4389			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4390			exit 1
4391			;;
4392		esac
4393
4394		# see if --with-fpu matches any of the supported FPUs
4395		if [ x"$with_fpu" != x ] ; then
4396		  val=$with_fpu
4397		  fpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
4398			-v cmd="chkfpu $val" \
4399			${srcdir}/config/arm/arm-cpus.in`
4400		  if [ "$fpu" = "error" ]
4401		  then
4402		    echo "Unknown target in --with-fpu=$val" 1>&2
4403		    exit 1
4404		  fi
4405		fi
4406
4407		case "$with_abi" in
4408		"" \
4409		| apcs-gnu | atpcs | aapcs | iwmmxt | aapcs-linux )
4410			#OK
4411			;;
4412		*)
4413			echo "Unknown ABI used in --with-abi=$with_abi"
4414			exit 1
4415			;;
4416		esac
4417
4418		case "$with_mode" in
4419		"" \
4420		| arm | thumb )
4421			#OK
4422			;;
4423		*)
4424			echo "Unknown mode used in --with-mode=$with_mode"
4425			exit 1
4426			;;
4427		esac
4428
4429		case "$with_tls" in
4430		"" \
4431		| gnu | gnu2)
4432			# OK
4433			;;
4434		*)
4435			echo "Unknown TLS method used in --with-tls=$with_tls" 1>&2
4436			exit 1
4437			;;
4438		esac
4439
4440		if test "x$with_arch" != x && test "x$with_cpu" != x; then
4441			echo "Switch \"--with-arch\" may not be used with switch \"--with-cpu\""  1>&2
4442			exit 1
4443		fi
4444
4445		if test "x$with_cpu" != x && test "x$with_tune" != x; then
4446			echo "Switch \"--with-tune\" may not be used with switch \"--with-cpu\""  1>&2
4447			exit 1
4448		fi
4449
4450		# Add extra multilibs
4451		if test "x$with_multilib_list" != x; then
4452			ml=
4453			arm_multilibs=`echo $with_multilib_list | sed -e 's/,/ /g'`
4454			if test "x${arm_multilibs}" != xdefault ; then
4455				for arm_multilib in ${arm_multilibs}; do
4456					case ${arm_multilib} in
4457					aprofile|rmprofile)
4458						tmake_profile_file="arm/t-multilib"
4459						;;
4460					@*)
4461						ml=`echo "X$arm_multilib" | sed '1s,^X@,,'`
4462						if test -f "${srcdir}/config/arm/${ml}"; then
4463							tmake_file="${tmake_file} arm/${ml}"
4464						else
4465							echo "Error: ${ml} does not exist in ${srcdir}/config/arm" >&2
4466							exit 1
4467						fi
4468						;;
4469					*)
4470						echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2
4471						exit 1
4472						;;
4473					esac
4474				done
4475			fi
4476
4477			if test "x${tmake_profile_file}" != x ; then
4478				# arm/t-aprofile and arm/t-rmprofile are only
4479				# designed to work without any with-cpu,
4480				# with-arch, with-mode, with-fpu or with-float
4481				# options.
4482				if test "x$with_arch" != x \
4483				    || test "x$with_cpu" != x \
4484				    || test "x$with_float" != x \
4485				    || test "x$with_fpu" != x \
4486				    || test "x$with_mode" != x ; then
4487				    echo "Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=${with_multilib_list}" 1>&2
4488				    exit 1
4489				elif test "x$ml" != x ; then
4490				    echo "Error: You cannot use builtin multilib profiles along with custom ones" 1>&2
4491				    exit 1
4492				fi
4493				# But pass the default value for float-abi
4494				# through to the multilib selector
4495				with_float="soft"
4496				tmake_file="${tmake_file} ${tmake_profile_file}"
4497				TM_MULTILIB_CONFIG="$with_multilib_list"
4498			fi
4499		fi
4500		target_cpu_cname=${target_cpu_cname:-arm7tdmi}
4501		with_cpu=${with_cpu:-$target_cpu_cname}
4502		;;
4503
4504	fr*-*-*linux*)
4505		supported_defaults=cpu
4506		case "$with_cpu" in
4507		fr400) ;;
4508		fr550) ;;
4509		*)
4510			echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4511			exit 1
4512			;;
4513		esac
4514		;;
4515
4516	fido-*-* | m68k*-*-* | m5200-*-* | m5407-*-*)
4517		supported_defaults="arch cpu"
4518		case "$with_arch" in
4519		"" | "m68k"| "cf")
4520			m68k_arch_family="$with_arch"
4521			;;
4522		*)
4523			echo "Invalid --with-arch=$with_arch" 1>&2
4524			exit 1
4525			;;
4526		esac
4527
4528		# We always have a $with_cpu setting here.
4529		case "$with_cpu" in
4530		"m68000" | "m68010" | "m68020" | "m68030" | "m68040" | "m68060")
4531			m68k_cpu_ident=$with_cpu
4532			;;
4533		"m68020-40")
4534			m68k_cpu_ident=m68020
4535			tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_40"
4536			;;
4537		"m68020-60")
4538			m68k_cpu_ident=m68020
4539			tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_60"
4540			;;
4541		*)
4542			# We need the C identifier rather than the string.
4543			m68k_cpu_ident=`awk -v arg="\"$with_cpu\"" \
4544			   'BEGIN { FS="[ \t]*[,()][ \t]*" }; \
4545			    $1 == "M68K_DEVICE" && $2 == arg { print $3 }' \
4546				 ${srcdir}/config/m68k/m68k-devices.def`
4547			if [ x"$m68k_cpu_ident" = x ] ; then
4548				echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2
4549				exit 1
4550			fi
4551			with_cpu="mcpu=$with_cpu"
4552			;;
4553		esac
4554		;;
4555
4556	amdgcn-*-*)
4557		supported_defaults="arch tune"
4558
4559		for which in arch tune; do
4560			eval "val=\$with_$which"
4561			case ${val} in
4562			"" | fiji | gfx900 | gfx906 )
4563				# OK
4564				;;
4565			*)
4566				echo "Unknown cpu used in --with-$which=$val." 1>&2
4567				exit 1
4568				;;
4569			esac
4570		done
4571		[ "x$with_arch" = x ] && with_arch=fiji
4572		;;
4573
4574	hppa*-*-*)
4575		supported_defaults="arch schedule"
4576
4577		case "$with_arch" in
4578		"" | 1.0 | 1.1 | 2.0)
4579			# OK
4580			;;
4581		*)
4582			echo "Unknown architecture used in --with-arch=$with_arch" 1>&2
4583			exit 1
4584			;;
4585		esac
4586
4587		case "$with_schedule" in
4588		"" | 700 | 7100 | 7100LC | 7200 | 7300 | 8000)
4589			# OK
4590			;;
4591		*)
4592			echo "Unknown processor used in --with-schedule=$with_schedule." 1>&2
4593			exit 1
4594			;;
4595		esac
4596		;;
4597
4598	i[34567]86-*-* | x86_64-*-*)
4599		supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
4600		for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do
4601			eval "val=\$with_$which"
4602			case " $x86_archs " in
4603			*" ${val} "*)
4604				case "${target}" in
4605				  x86_64-*-*)
4606				      case "x$which" in
4607					*_32)
4608						;;
4609					*)
4610						echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
4611						exit 1
4612						;;
4613				      esac
4614				      ;;
4615				esac
4616				# OK
4617				;;
4618			*)
4619				if test x${val} != x; then
4620					case " $x86_64_archs " in
4621					*" ${val} "*)
4622						# OK
4623						;;
4624					*)
4625						# Allow $x86_cpus --with-cpu=/--with-tune=
4626						case "x$which" in
4627						xcpu*|xtune*)
4628							case " $x86_cpus " in
4629							*" ${val} "*)
4630								# OK
4631								;;
4632							*)
4633								echo "Unknown CPU given in --with-$which=$val." 1>&2
4634								exit 1
4635								;;
4636							esac
4637							;;
4638						*)
4639							echo "Unknown CPU given in --with-$which=$val." 1>&2
4640							exit 1
4641							;;
4642						esac
4643					;;
4644					esac
4645				fi
4646				;;
4647			esac
4648		done
4649		;;
4650
4651	riscv*-*-*)
4652		supported_defaults="abi arch tune riscv_attribute"
4653
4654		case "${target}" in
4655		riscv-* | riscv32*) xlen=32 ;;
4656		riscv64*) xlen=64 ;;
4657		*) echo "Unsupported RISC-V target ${target}" 1>&2; exit 1 ;;
4658		esac
4659
4660		case "${with_riscv_attribute}" in
4661		yes)
4662			tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=1"
4663			;;
4664		no)
4665			tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=0"
4666			;;
4667		""|default)
4668			case "${target}" in
4669			riscv*-*-elf*)
4670				tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=1"
4671				;;
4672			*)
4673				tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=0"
4674				;;
4675			esac
4676			;;
4677		*)
4678			echo "--with-riscv-attribute=${with_riscv_attribute} is not supported.  The argument must begin with yes, no or default." 1>&2
4679			exit 1
4680			;;
4681		esac
4682
4683
4684		# Infer arch from --with-arch, --target, and --with-abi.
4685		case "${with_arch}" in
4686		rv32e* | rv32i* | rv32g* | rv64i* | rv64g*)
4687			# OK.
4688			;;
4689		"")
4690			# Infer XLEN, but otherwise assume GC.
4691			case "${with_abi}" in
4692			ilp32e) with_arch="rv32e" ;;
4693			ilp32 | ilp32f | ilp32d) with_arch="rv32gc" ;;
4694			lp64 | lp64f | lp64d) with_arch="rv64gc" ;;
4695			*) with_arch="rv${xlen}gc" ;;
4696			esac
4697			;;
4698		*)
4699			echo "--with-arch=${with_arch} is not supported.  The argument must begin with rv32e, rv32i, rv32g, rv64i, or rv64g." 1>&2
4700			exit 1
4701			;;
4702		esac
4703
4704		# Make sure --with-abi is valid.  If it was not specified,
4705		# pick a default based on the ISA, preferring soft-float
4706		# unless the D extension is present.
4707		case "${with_abi}" in
4708		ilp32 | ilp32e | ilp32f | ilp32d | lp64 | lp64f | lp64d)
4709			;;
4710		"")
4711			case "${with_arch}" in
4712			rv32*d* | rv32g*) with_abi=ilp32d ;;
4713			rv32e*) with_abi=ilp32e ;;
4714			rv32*) with_abi=ilp32 ;;
4715			rv64*d* | rv64g*) with_abi=lp64d ;;
4716			rv64*) with_abi=lp64 ;;
4717			esac
4718			;;
4719		*)
4720			echo "--with-abi=${with_abi} is not supported" 1>&2
4721			exit 1
4722			;;
4723		esac
4724
4725		# Make sure ABI and ISA are compatible.
4726		case "${with_abi},${with_arch}" in
4727		ilp32,rv32* | ilp32e,rv32e* \
4728		| ilp32f,rv32*f* | ilp32f,rv32g* \
4729		| ilp32d,rv32*d* | ilp32d,rv32g* \
4730		| lp64,rv64* \
4731		| lp64f,rv64*f* | lp64f,rv64g* \
4732		| lp64d,rv64*d* | lp64d,rv64g*)
4733			;;
4734		*)
4735			echo "--with-abi=${with_abi} is not supported for ISA ${with_arch}" 1>&2
4736			exit 1
4737			;;
4738		esac
4739
4740		# Handle --with-multilib-list.
4741		if test "x${with_multilib_list}" != xdefault; then
4742			tm_file="${tm_file} riscv/withmultilib.h"
4743			tmake_file="${tmake_file} riscv/t-withmultilib"
4744
4745			case ${with_multilib_list} in
4746			ilp32 | ilp32f | ilp32d \
4747			| lp64 | lp64f | lp64d )
4748				TM_MULTILIB_CONFIG="${with_arch},${with_multilib_list}"
4749				;;
4750			*)
4751				echo "--with-multilib-list=${with_multilib_list} not supported."
4752				exit 1
4753			esac
4754
4755			# Define macros to select the default multilib.
4756			case ${with_arch} in
4757			rv32gc)
4758				tm_defines="${tm_defines} TARGET_MLIB_ARCH=1"
4759				;;
4760			rv64gc)
4761				tm_defines="${tm_defines} TARGET_MLIB_ARCH=2"
4762				;;
4763			*)
4764				echo "unsupported --with-arch for --with-multilib-list"
4765				exit 1
4766			esac
4767			case ${with_abi} in
4768			ilp32)
4769				tm_defines="${tm_defines} TARGET_MLIB_ABI=1"
4770				;;
4771			ilp32f)
4772				tm_defines="${tm_defines} TARGET_MLIB_ABI=2"
4773				;;
4774			ilp32d)
4775				tm_defines="${tm_defines} TARGET_MLIB_ABI=3"
4776				;;
4777			lp64)
4778				tm_defines="${tm_defines} TARGET_MLIB_ABI=4"
4779				;;
4780			lp64f)
4781				tm_defines="${tm_defines} TARGET_MLIB_ABI=5"
4782				;;
4783			lp64d)
4784				tm_defines="${tm_defines} TARGET_MLIB_ABI=6"
4785				;;
4786			*)
4787				echo "unsupported --with-abi for --with-multilib"
4788				exit 1
4789			esac
4790		fi
4791		;;
4792
4793	mips*-*-*)
4794		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"
4795
4796		case ${with_float} in
4797		"" | soft | hard)
4798			# OK
4799			;;
4800		*)
4801			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4802			exit 1
4803			;;
4804		esac
4805
4806		case ${with_fpu} in
4807		"" | single | double)
4808			# OK
4809			;;
4810		*)
4811			echo "Unknown fpu type used in --with-fpu=$with_fpu" 1>&2
4812			exit 1
4813			;;
4814		esac
4815
4816		case ${with_nan} in
4817		"" | 2008 | legacy)
4818			# OK
4819			;;
4820		*)
4821			echo "Unknown NaN encoding used in --with-nan=$with_nan" 1>&2
4822			exit 1
4823			;;
4824		esac
4825
4826		case ${with_fp_32} in
4827		"" | 32 | xx | 64)
4828			# OK
4829			;;
4830		*)
4831			echo "Unknown FP mode used in --with-fp-32=$with_fp_32" 1>&2
4832			exit 1
4833			;;
4834		esac
4835
4836		case ${with_odd_spreg_32} in
4837		yes)
4838			with_odd_spreg_32="odd-spreg"
4839			;;
4840		no)
4841			with_odd_spreg_32="no-odd-spreg"
4842			;;
4843		"")
4844			# OK
4845			;;
4846		*)
4847			echo "Unknown odd-spreg-32 type used in --with-odd-spreg-32=$with_odd_spreg_32" 1>&2
4848			exit 1
4849			;;
4850		esac
4851
4852		case ${with_abi} in
4853		"" | 32 | o64 | n32 | 64 | eabi)
4854			# OK
4855			;;
4856		*)
4857			echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
4858			exit 1
4859			;;
4860		esac
4861
4862		case ${with_divide} in
4863		"" | breaks | traps)
4864			# OK
4865			;;
4866		*)
4867			echo "Unknown division check type use in --with-divide=$with_divide" 1>&2
4868			exit 1
4869			;;
4870		esac
4871
4872		case ${with_llsc} in
4873		yes)
4874			with_llsc=llsc
4875			;;
4876		no)
4877			with_llsc="no-llsc"
4878			;;
4879		"")
4880			# OK
4881			;;
4882		*)
4883			echo "Unknown llsc type used in --with-llsc" 1>&2
4884			exit 1
4885			;;
4886		esac
4887
4888		case ${with_mips_plt} in
4889		yes)
4890			with_mips_plt=plt
4891			;;
4892		no)
4893			with_mips_plt=no-plt
4894			;;
4895		"")
4896			;;
4897		*)
4898			echo "Unknown --with-mips-plt argument: $with_mips_plt" 1>&2
4899			exit 1
4900			;;
4901		esac
4902
4903		case ${with_synci} in
4904		yes)
4905			with_synci=synci
4906			;;
4907		no)
4908			with_synci=no-synci
4909			;;
4910		"")
4911			;;
4912		*)
4913			echo "Unknown synci type used in --with-synci" 1>&2
4914			exit 1
4915			;;
4916		esac
4917
4918		case ${with_lxc1_sxc1} in
4919		yes)
4920			with_lxc1_sxc1=lxc1-sxc1
4921			;;
4922		no)
4923			with_lxc1_sxc1=no-lxc1-sxc1
4924			;;
4925		"")
4926			;;
4927		*)
4928			echo "Unknown lxc1-sxc1 type used in --with-lxc1-sxc1" 1>&2
4929			exit 1
4930			;;
4931		esac
4932
4933		case ${with_madd4} in
4934		yes)
4935			with_madd4=madd4
4936			;;
4937		no)
4938			with_madd4=no-madd4
4939			;;
4940		"")
4941			;;
4942		*)
4943			echo "Unknown madd4 type used in --with-madd4" 1>&2
4944			exit 1
4945			;;
4946		esac
4947		;;
4948
4949	nds32*-*-*)
4950		supported_defaults="arch cpu nds32_lib float fpu_config"
4951
4952		# process --with-arch
4953		case "${with_arch}" in
4954		"" | v3 )
4955			tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=0"
4956			;;
4957		v2 | v2j | v3m)
4958			# OK
4959			tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=0"
4960			;;
4961		v3f)
4962			tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=1"
4963			;;
4964		v3s)
4965			tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=2"
4966
4967			;;
4968		*)
4969			echo "Cannot accept --with-arch=$with_arch, available values are: v2 v2j v3 v3m v3f v3s" 1>&2
4970			exit 1
4971			;;
4972		esac
4973
4974		case "${with_cpu}" in
4975		"")
4976			with_cpu=n9
4977			;;
4978		n6 | n7 |n8 | e8 | s8 | n9 | n10 | d10 | n12 | n13 | n15)
4979			# OK
4980			;;
4981		*)
4982			echo "Cannot accept --with-cpu=$with_cpu, available values are: n6 n7 n8 e8 s8 n9 n10 d10 n12 n13 n15" 1>&2
4983			exit 1
4984			;;
4985		esac
4986
4987		# process --with-nds32-lib
4988		case "${with_nds32_lib}" in
4989		"")
4990			case ${target} in
4991			*-*-*uclibc*)
4992				with_nds32_lib=ulibc
4993				;;
4994			*-*-linux*)
4995				with_nds32_lib=glibc
4996				;;
4997			*)
4998				with_nds32_lib=newlib
4999				tm_defines="${tm_defines} TARGET_DEFAULT_CTOR_DTOR=1"
5000				;;
5001			esac
5002			;;
5003		newlib)
5004			# OK
5005			tm_defines="${tm_defines} TARGET_DEFAULT_CTOR_DTOR=1"
5006			;;
5007		mculib)
5008			# OK
5009			# for the arch=v3f or arch=v3s under mculib toolchain,
5010			# we would like to set -fno-math-errno as default
5011			case "${with_arch}" in
5012			v3f | v3s)
5013				tm_defines="${tm_defines} TARGET_DEFAULT_NO_MATH_ERRNO=1"
5014				;;
5015			esac
5016			;;
5017		glibc | uclibc)
5018			# OK
5019			;;
5020		*)
5021			echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib glibc uclibc" 1>&2
5022			exit 1
5023			;;
5024		esac
5025
5026		# process --with-float
5027		case "${with_float}" in
5028		"" | soft | hard)
5029			# OK
5030			;;
5031		*)
5032			echo "Cannot accept --with-float=$with_float, available values are: soft hard" 1>&2
5033			exit 1
5034			;;
5035		esac
5036
5037		# process --with-config-fpu
5038		case "${with_config_fpu}" in
5039		"" | 0 | 1 | 2 | 3)
5040			# OK
5041			;;
5042		*)
5043			echo "Cannot accept --with-config-fpu=$with_config_fpu, available values from 0 to 7" 1>&2
5044			exit 1
5045			;;
5046		esac
5047
5048
5049		;;
5050	nios2*-*-*)
5051		supported_defaults="arch"
5052			case "$with_arch" in
5053			"" | r1 | r2)
5054				# OK
5055				;;
5056			*)
5057				echo "Unknown arch used in --with-arch=$with_arch" 1>&2
5058				exit 1
5059				;;
5060			esac
5061		;;
5062
5063	powerpc*-*-* | rs6000-*-*)
5064		supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64 advance_toolchain"
5065
5066		for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
5067			eval "val=\$with_$which"
5068			case ${val} in
5069			default32 | default64)
5070				case $which in
5071				cpu | tune)
5072					;;
5073				*)
5074					echo "$val only valid for --with-cpu and --with-tune." 1>&2
5075					exit 1
5076					;;
5077				esac
5078				with_which="with_$which"
5079				eval $with_which=
5080				;;
5081			405cr)
5082				tm_defines="${tm_defines} CONFIG_PPC405CR"
5083				eval "with_$which=405"
5084				;;
5085			"" | common | native \
5086			| power[3456789] | power10 | power5+ | power6x \
5087			| powerpc | powerpc64 | powerpc64le \
5088			| rs64 \
5089			| 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
5090			| 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
5091			| 604 | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
5092			| a2 | e300c[23] | 854[08] | e500mc | e500mc64 | e5500 | e6500 \
5093			| titan | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
5094				# OK
5095				;;
5096			*)
5097				echo "Unknown cpu used in --with-$which=$val." 1>&2
5098				exit 1
5099				;;
5100			esac
5101		done
5102
5103		case "$with_abi" in
5104		"" | elfv1 | elfv2 )
5105			#OK
5106			;;
5107		*)
5108			echo "Unknown ABI used in --with-abi=$with_abi"
5109			exit 1
5110			;;
5111		esac
5112
5113		if test "x$with_advance_toolchain" != x; then
5114		    if test -d "/opt/$with_advance_toolchain/." -a \
5115			-d "/opt/$with_advance_toolchain/bin/." -a \
5116			-d "/opt/$with_advance_toolchain/include/."; then
5117
5118			tm_file="$tm_file ./advance-toolchain.h"
5119			(at="/opt/$with_advance_toolchain"
5120			 echo "/* Use Advance Toolchain $at */"
5121			 echo
5122			 echo "#undef  LINK_OS_EXTRA_SPEC32"
5123			 echo "#define LINK_OS_EXTRA_SPEC32" \
5124			      "\"%(link_os_new_dtags)" \
5125			      "-rpath $prefix/lib -rpath $at/lib\""
5126			 echo
5127			 echo "#undef  LINK_OS_EXTRA_SPEC64"
5128			 echo "#define LINK_OS_EXTRA_SPEC64" \
5129			      "\"%(link_os_new_dtags)" \
5130			      "-rpath $prefix/lib64 -rpath $at/lib64\""
5131			 echo
5132			 echo "#undef  LINK_OS_NEW_DTAGS_SPEC"
5133			 echo "#define LINK_OS_NEW_DTAGS_SPEC" \
5134			      "\"--enable-new-dtags\""
5135			 echo
5136			 echo "#undef  DYNAMIC_LINKER_PREFIX"
5137			 echo "#define DYNAMIC_LINKER_PREFIX \"$at\""
5138			 echo
5139			 echo "#undef  MD_EXEC_PREFIX"
5140			 echo "#define MD_EXEC_PREFIX \"$at/bin/\""
5141			 echo
5142			 echo "#undef  MD_STARTFILE_PREFIX"
5143			 echo "#define MD_STARTFILE_PREFIX \"$prefix/lib/\""
5144			 echo
5145			 echo "#undef  MD_STARTFILE_PREFIX_1"
5146			 echo "#define MD_STARTFILE_PREFIX_1 \"$at/lib/\"") \
5147			    > advance-toolchain.h
5148		    else
5149			echo "Unknown advance-toolchain $with_advance_toolchain"
5150			exit 1
5151		    fi
5152		fi
5153
5154		# Set up the default long double format if the user changed it.
5155		if test x$with_long_double_format = xieee; then
5156		    tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=1"
5157
5158		elif test x$with_long_double_format = xibm; then
5159		    tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=0"
5160		fi
5161		;;
5162
5163	s390*-*-*)
5164		supported_defaults="arch mode tune"
5165
5166		for which in arch tune; do
5167			eval "val=\$with_$which"
5168			case ${val} in
5169			"" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | z15 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 )
5170				# OK
5171				;;
5172			*)
5173				echo "Unknown cpu used in --with-$which=$val." 1>&2
5174				exit 1
5175				;;
5176			esac
5177		done
5178
5179		case ${with_mode} in
5180		"" | esa | zarch)
5181			# OK
5182			;;
5183		*)
5184			echo "Unknown architecture mode used in --with-mode=$with_mode." 1>&2
5185			exit 1
5186			;;
5187		esac
5188		;;
5189
5190	sh[123456ble]*-*-* | sh-*-*)
5191		supported_defaults="cpu"
5192		case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in
5193		"" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
5194			# OK
5195			;;
5196		m2a | m2a-single | m2a-single-only | m2a-nofpu)
5197			;;
5198		m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
5199		        ;;
5200		*)
5201			echo "Unknown CPU used in --with-cpu=$with_cpu, known values:"  1>&2
5202			echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
5203			echo "m4a m4a-single m4a-single-only m4a-nofpu m4al" 1>&2
5204			echo "m2a m2a-single m2a-single-only m2a-nofpu" 1>&2
5205			exit 1
5206			;;
5207		esac
5208		;;
5209	sparc*-*-*)
5210		supported_defaults="cpu cpu_32 cpu_64 float tune tune_32 tune_64"
5211
5212		for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
5213			eval "val=\$with_$which"
5214			case ${val} in
5215			"" | sparc | sparcv9 | sparc64 \
5216			| v7 | cypress \
5217			| v8 | supersparc | hypersparc | leon | leon3 | leon3v7 \
5218			| sparclite | f930 | f934 | sparclite86x \
5219			| sparclet | tsc701 \
5220			| v9 | ultrasparc | ultrasparc3 | niagara | niagara2 \
5221			| niagara3 | niagara4 | niagara7 | m8)
5222				# OK
5223				;;
5224			*)
5225				echo "Unknown cpu used in --with-$which=$val" 1>&2
5226				exit 1
5227				;;
5228			esac
5229		done
5230
5231		case ${with_float} in
5232		"" | soft | hard)
5233			# OK
5234			;;
5235		*)
5236			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
5237			exit 1
5238			;;
5239		esac
5240		;;
5241
5242	tic6x-*-*)
5243		supported_defaults="arch"
5244
5245		case ${with_arch} in
5246		"" | c62x | c64x | c64x+ | c67x | c67x+ | c674x)
5247			# OK
5248			;;
5249		*)
5250			echo "Unknown arch used in --with-arch=$with_arch." 1>&2
5251			exit 1
5252			;;
5253		esac
5254		;;
5255
5256	v850*-*-*)
5257		supported_defaults=cpu
5258		case ${with_cpu} in
5259		"" | v850e | v850e1 | v850e2 | v850es | v850e2v3 | v850e3v5)
5260			# OK
5261			;;
5262		*)
5263			echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
5264			exit 1
5265			;;
5266		esac
5267		;;
5268	visium-*-*)
5269		supported_defaults="cpu"
5270		case $with_cpu in
5271		  "" | gr5 | gr6)
5272			;;
5273		  *)    echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
5274			exit 1
5275			;;
5276		esac
5277		;;
5278esac
5279
5280# Targets for which there is at least one VxWorks port should include
5281# vxworks-dummy.h to allow safe references to various TARGET_VXWORKS kinds
5282# of markers from other files in the port, including the vxworks*.h files to
5283# distinguish VxWorks variants such as VxWorks 7 or 64).
5284
5285case ${target} in
5286arm*-*-* | i[34567]86-*-* | mips*-*-* | powerpc*-*-* | sh*-*-* \
5287| sparc*-*-* | x86_64-*-*)
5288	tm_file="vxworks-dummy.h ${tm_file}"
5289	;;
5290esac
5291
5292# Set some miscellaneous flags for particular targets.
5293target_cpu_default2=
5294case ${target} in
5295	aarch64*-*-*)
5296		if test x"$target_cpu_cname" != x
5297		then
5298			target_cpu_default2=$target_cpu_cname
5299		fi
5300		;;
5301
5302	arm*-*-*)
5303		if test x$with_cpu = x
5304		then
5305			echo "Don't know the target cpu" 1>&2
5306			exit 1
5307		else
5308			target_cpu_default2="\\\"$with_cpu\\\""
5309		fi
5310		;;
5311
5312	hppa*-*-*)
5313		if test x$gas = xyes
5314		then
5315			target_cpu_default2="MASK_GAS"
5316		fi
5317		;;
5318
5319	fido*-*-* | m68k*-*-*)
5320		target_cpu_default2=$m68k_cpu_ident
5321		tmake_file="m68k/t-opts $tmake_file"
5322		if [ x"$m68k_arch_family" != x ]; then
5323		        tmake_file="m68k/t-$m68k_arch_family $tmake_file"
5324		fi
5325		;;
5326
5327	i[34567]86-*-darwin* | x86_64-*-darwin*)
5328		;;
5329	i[34567]86-*-linux* | x86_64-*-linux*)
5330		extra_objs="${extra_objs} cet.o"
5331		tmake_file="$tmake_file i386/t-linux i386/t-cet"
5332		;;
5333	i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
5334		tmake_file="$tmake_file i386/t-kfreebsd"
5335		;;
5336	i[34567]86-*-gnu*)
5337		tmake_file="$tmake_file i386/t-gnu"
5338		;;
5339	i[34567]86-*-msdosdjgpp*)
5340		tmake_file="${tmake_file} i386/t-djgpp"
5341		;;
5342	i[34567]86-*-solaris2* | x86_64-*-solaris2*)
5343		;;
5344	i[34567]86-*-cygwin* | x86_64-*-cygwin*)
5345		;;
5346	i[34567]86-*-mingw* | x86_64-*-mingw*)
5347		;;
5348	i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
5349		;;
5350	i[34567]86-*-freebsd*)
5351		;;
5352	x86_64-*-freebsd*)
5353		tmake_file="${tmake_file} i386/t-freebsd64"
5354		;;
5355	ia64*-*-linux*)
5356		;;
5357
5358	mips*-*-*)
5359		if test x$gnu_ld = xyes
5360		then
5361			target_cpu_default2="MASK_SPLIT_ADDRESSES"
5362		fi
5363		case ${target} in
5364			mips*el-*-*)
5365				tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
5366				;;
5367		esac
5368		if test x$with_arch != x; then
5369			default_mips_arch=$with_arch
5370		fi
5371		if test x$with_abi != x; then
5372			default_mips_abi=$with_abi
5373		fi
5374		case ${default_mips_arch} in
5375		    mips1)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=1" ;;
5376		    mips2)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=2" ;;
5377		    mips3)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=3" ;;
5378		    mips4)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=4" ;;
5379		    mips32)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=32" ;;
5380		    mips32r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=33" ;;
5381		    mips32r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=37" ;;
5382		    mips64)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=64" ;;
5383		    mips64r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=65" ;;
5384		    mips64r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=69" ;;
5385		esac
5386		case ${default_mips_abi} in
5387		    32)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_32" ;;
5388		    o64)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_O64" ;;
5389		    n32)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_N32" ;;
5390		    64)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_64" ;;
5391		    eabi) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_EABI" ;;
5392		esac
5393		tmake_file="mips/t-mips $tmake_file"
5394		;;
5395
5396	powerpc*-*-* | rs6000-*-*)
5397		# FIXME: The PowerPC port uses the value set at compile time,
5398		# although it's only cosmetic.
5399		if test "x$with_cpu" != x
5400		then
5401			target_cpu_default2="\\\"$with_cpu\\\""
5402		fi
5403		out_file="${cpu_type}/${cpu_type}.c"
5404		c_target_objs="${c_target_objs} ${cpu_type}-c.o"
5405		cxx_target_objs="${cxx_target_objs} ${cpu_type}-c.o"
5406		d_target_objs="${d_target_objs} ${cpu_type}-d.o"
5407		tmake_file="${cpu_type}/t-${cpu_type} ${tmake_file}"
5408		;;
5409
5410	sh[123456ble]*-*-* | sh-*-*)
5411		c_target_objs="${c_target_objs} sh-c.o"
5412		cxx_target_objs="${cxx_target_objs} sh-c.o"
5413		;;
5414
5415	sparc*-*-*)
5416		# Some standard aliases.
5417		case x$with_cpu in
5418		xsparc)
5419			with_cpu=v7
5420			;;
5421		xsparcv9 | xsparc64)
5422			with_cpu=v9
5423			;;
5424		esac
5425
5426		if test x$with_tune = x ; then
5427		      case ${target} in
5428		      *-leon-*)
5429			  with_tune=leon
5430			  ;;
5431		      *-leon[3-9]*)
5432			  with_tune=leon3
5433			  ;;
5434		      esac
5435		fi
5436
5437		# The SPARC port checks this value at compile-time.
5438		target_cpu_default2="TARGET_CPU_$with_cpu"
5439		;;
5440
5441	v850*-*-*)
5442		case "x$with_cpu" in
5443		x)
5444			;;
5445		xv850e | xv850e1 | xv850e2 | xv850e2v3 | xv850e3v5)
5446			target_cpu_default2="TARGET_CPU_$with_cpu"
5447			;;
5448		xv850es)
5449			target_cpu_default2="TARGET_CPU_v850e1"
5450			;;
5451		esac
5452		;;
5453	visium-*-*)
5454		target_cpu_default2="TARGET_CPU_$with_cpu"
5455		;;
5456esac
5457
5458t=
5459all_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"
5460for option in $all_defaults
5461do
5462	eval "val=\$with_"`echo $option | sed s/-/_/g`
5463	if test -n "$val"; then
5464		case " $supported_defaults " in
5465		*" $option "*)
5466			;;
5467		*)
5468			echo "This target does not support --with-$option." 2>&1
5469			echo "Valid --with options are: $supported_defaults" 2>&1
5470			exit 1
5471			;;
5472		esac
5473
5474		if test "x$t" = x
5475		then
5476			t="{ \"$option\", \"$val\" }"
5477		else
5478			t="${t}, { \"$option\", \"$val\" }"
5479		fi
5480	fi
5481done
5482
5483if test "x$t" = x
5484then
5485	configure_default_options="{ { NULL, NULL} }"
5486else
5487	configure_default_options="{ ${t} }"
5488fi
5489
5490if test "$target_cpu_default2" != ""
5491then
5492	if test "$target_cpu_default" != ""
5493	then
5494		target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
5495	else
5496		target_cpu_default=$target_cpu_default2
5497	fi
5498fi
5499
5500case ${target} in
5501i[34567]86-*-* | x86_64-*-*)
5502	if test x$enable_as_accelerator = xyes; then
5503		extra_programs="mkoffload\$(exeext)"
5504	fi
5505	;;
5506esac
5507