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