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