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