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