config.gcc revision 1.37
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} dbxelf.h elfos.h freebsd-spec.h"
2450	tm_file="${tm_file} netbsd.h netbsd-elf.h"
2451	case ${target} in
2452	  powerpc64*)
2453	    tm_file="rs6000/biarch64.h ${tm_file} rs6000/sysv4.h rs6000/default64.h rs6000/netbsd64.h"
2454	    tmake_file="${tmake_file} rs6000/t-netbsd64"
2455	    ;;
2456	  *)
2457	    tm_file="${tm_file} rs6000/sysv4.h rs6000/netbsd.h"
2458	    tmake_file="${tmake_file} rs6000/t-netbsd"
2459	    ;;
2460	esac
2461	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2462	if test x${enable_secureplt} != xno; then
2463	  tm_file="rs6000/secureplt.h ${tm_file}"
2464	fi
2465	extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
2466	;;
2467powerpc-*-eabispe*)
2468	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"
2469	extra_options="${extra_options} rs6000/sysv4.opt"
2470	tmake_file="rs6000/t-spe rs6000/t-ppccomm"
2471	use_gcc_stdint=wrap
2472	;;
2473powerpc-*-eabisimaltivec*)
2474	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"
2475	extra_options="${extra_options} rs6000/sysv4.opt"
2476	tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
2477	use_gcc_stdint=wrap
2478	;;
2479powerpc-*-eabisim*)
2480	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"
2481	extra_options="${extra_options} rs6000/sysv4.opt"
2482	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2483	use_gcc_stdint=wrap
2484	;;
2485powerpc-*-elf*)
2486	tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h"
2487	extra_options="${extra_options} rs6000/sysv4.opt"
2488	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2489	;;
2490powerpc-*-eabialtivec*)
2491	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"
2492	extra_options="${extra_options} rs6000/sysv4.opt"
2493	tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
2494	use_gcc_stdint=wrap
2495	;;
2496powerpc-xilinx-eabi*)
2497	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"
2498	extra_options="${extra_options} rs6000/sysv4.opt rs6000/xilinx.opt"
2499	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm rs6000/t-xilinx"
2500	use_gcc_stdint=wrap
2501	;;
2502powerpc-*-eabi*)
2503	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"
2504	extra_options="${extra_options} rs6000/sysv4.opt"
2505	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2506	use_gcc_stdint=wrap
2507	;;
2508powerpc-*-rtems*)
2509	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"
2510	extra_options="${extra_options} rs6000/sysv4.opt"
2511	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
2512	;;
2513powerpc*-*-linux*)
2514	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
2515	extra_options="${extra_options} rs6000/sysv4.opt"
2516	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
2517	extra_objs="$extra_objs rs6000-linux.o"
2518	case ${target} in
2519	    powerpc*le-*-*)
2520		tm_file="${tm_file} rs6000/sysv4le.h" ;;
2521	esac
2522	case ${target}:${with_cpu} in
2523	    powerpc64*: | powerpc64*:native) cpu_is_64bit=yes ;;
2524	esac
2525	maybe_biarch=${cpu_is_64bit}
2526	case ${enable_targets} in
2527	    *powerpc64*) maybe_biarch=yes ;;
2528	    all) maybe_biarch=yes ;;
2529	esac
2530	case ${target} in
2531	    powerpc64*-*-linux*spe* | powerpc64*-*-linux*paired*)
2532		echo "*** Configuration ${target} not supported" 1>&2
2533		exit 1
2534		;;
2535	    powerpc*-*-linux*spe* | powerpc*-*-linux*paired*)
2536		maybe_biarch=
2537		;;
2538	esac
2539	case ${target}:${enable_targets}:${maybe_biarch} in
2540	    powerpc64-* | powerpc-*:*:yes | *:*powerpc64-*:yes | *:all:yes \
2541	    | powerpc64le*:*powerpcle* | powerpc64le*:*powerpc-* \
2542	    | powerpcle-*:*powerpc64le*:yes)
2543		if test x$cpu_is_64bit = xyes; then
2544		    tm_file="${tm_file} rs6000/default64.h"
2545		fi
2546		tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h glibc-stdint.h"
2547		tmake_file="$tmake_file rs6000/t-linux64"
2548		case ${target} in
2549		    powerpc*le-*-*)
2550			tmake_file="$tmake_file rs6000/t-linux64le"
2551			case ${enable_targets} in
2552			    all | *powerpc64-* | *powerpc-*)
2553				tmake_file="$tmake_file rs6000/t-linux64lebe" ;;
2554			esac ;;
2555		    *)
2556			case ${enable_targets} in
2557			    all | *powerpc64le-* | *powerpcle-*)
2558				tmake_file="$tmake_file rs6000/t-linux64bele" ;;
2559			esac ;;
2560		esac
2561		extra_options="${extra_options} rs6000/linux64.opt"
2562		;;
2563	    powerpc64*)
2564		tm_file="${tm_file} rs6000/default64.h rs6000/linux64.h glibc-stdint.h"
2565		extra_options="${extra_options} rs6000/linux64.opt"
2566		tmake_file="${tmake_file} rs6000/t-linux"
2567		;;
2568	    *)
2569		tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
2570		tmake_file="${tmake_file} rs6000/t-ppcos rs6000/t-linux"
2571		;;
2572	esac
2573	case ${target} in
2574	    powerpc*-*-linux*ppc476*)
2575		tm_file="${tm_file} rs6000/476.h"
2576		extra_options="${extra_options} rs6000/476.opt" ;;
2577	    powerpc*-*-linux*altivec*)
2578		tm_file="${tm_file} rs6000/linuxaltivec.h" ;;
2579	    powerpc*-*-linux*spe*)
2580		tm_file="${tm_file} rs6000/linuxspe.h rs6000/e500.h" ;;
2581	    powerpc*-*-linux*paired*)
2582		tm_file="${tm_file} rs6000/750cl.h" ;;
2583	esac
2584	if test x${enable_secureplt} = xyes; then
2585		tm_file="rs6000/secureplt.h ${tm_file}"
2586	fi
2587	;;
2588powerpc-wrs-vxworks|powerpc-wrs-vxworksae|powerpc-wrs-vxworksmils)
2589	tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"
2590	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
2591	extra_options="${extra_options} rs6000/sysv4.opt"
2592	extra_headers=ppc-asm.h
2593	case ${target} in
2594          *-vxworksmils*)
2595            tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/e500.h rs6000/vxworksmils.h"
2596            tmake_file="${tmake_file} rs6000/t-vxworksmils"
2597            ;;
2598	  *-vxworksae*)
2599	    tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/e500.h rs6000/vxworksae.h"
2600	    tmake_file="${tmake_file} rs6000/t-vxworksae"
2601	    ;;
2602	  *-vxworks*)
2603	    tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h rs6000/e500.h"
2604	    ;;
2605	esac
2606	;;
2607powerpc-*-lynxos*)
2608	xm_defines=POSIX
2609	tm_file="${tm_file} dbxelf.h elfos.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
2610	tmake_file="t-lynx rs6000/t-lynx"
2611	extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
2612	thread_file=lynx
2613	gnu_ld=yes
2614	gas=yes
2615	;;
2616powerpcle-*-elf*)
2617	tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h"
2618	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2619	extra_options="${extra_options} rs6000/sysv4.opt"
2620	;;
2621powerpcle-*-eabisim*)
2622	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"
2623	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2624	extra_options="${extra_options} rs6000/sysv4.opt"
2625	use_gcc_stdint=wrap
2626	;;
2627powerpcle-*-eabi*)
2628	tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/e500.h"
2629	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2630	extra_options="${extra_options} rs6000/sysv4.opt"
2631	use_gcc_stdint=wrap
2632	;;
2633riscv*-*-linux*)				# Linux RISC-V
2634	tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h riscv/linux64.h"
2635	tmake_file="${tmake_file} riscv/t-linux64"
2636	gnu_ld=yes
2637	gas=yes
2638	gcc_cv_initfini_array=yes
2639	;;
2640riscv*-*-elf*)				# Linux RISC-V
2641	tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h"
2642	tmake_file="${tmake_file} riscv/t-elf"
2643	gnu_ld=yes
2644	gas=yes
2645	gcc_cv_initfini_array=yes
2646	;;
2647riscv*-*-netbsd*)				# NetBSD RISC-V
2648	tm_file="elfos.h ${tm_file} netbsd.h netbsd-elf.h riscv/netbsd.h"
2649	case ${target} in
2650	  riscv32*) tm_defines="${tm_defines} TARGET_64BIT_DEFAULT=0" ;;
2651	  *) tmake_file="${tmake_file} riscv/t-netbsd64" ;;
2652	esac
2653	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2654	gnu_ld=yes
2655	gas=yes
2656	gcc_cv_initfini_array=yes
2657	;;
2658rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
2659	tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h rs6000/aix-stdint.h"
2660	tmake_file="rs6000/t-aix43 t-slibgcc"
2661	extra_options="${extra_options} rs6000/aix64.opt"
2662	use_collect2=yes
2663	thread_file='aix'
2664	use_gcc_stdint=provide
2665	extra_headers=
2666	;;
2667rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
2668	tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h rs6000/aix-stdint.h"
2669	extra_options="${extra_options} rs6000/aix64.opt"
2670	tmake_file="rs6000/t-aix43 t-slibgcc"
2671	use_collect2=yes
2672	thread_file='aix'
2673	use_gcc_stdint=wrap
2674	extra_headers=
2675	;;
2676rs6000-ibm-aix5.2.* | powerpc-ibm-aix5.2.*)
2677	tm_file="${tm_file} rs6000/aix.h rs6000/aix52.h rs6000/xcoff.h rs6000/aix-stdint.h"
2678	tmake_file="rs6000/t-aix52 t-slibgcc"
2679	extra_options="${extra_options} rs6000/aix64.opt"
2680	use_collect2=yes
2681	thread_file='aix'
2682	use_gcc_stdint=wrap
2683	extra_headers=
2684	;;
2685rs6000-ibm-aix5.3.* | powerpc-ibm-aix5.3.*)
2686	tm_file="${tm_file} rs6000/aix.h rs6000/aix53.h rs6000/xcoff.h rs6000/aix-stdint.h"
2687	tmake_file="rs6000/t-aix52 t-slibgcc"
2688	extra_options="${extra_options} rs6000/aix64.opt"
2689	use_collect2=yes
2690	thread_file='aix'
2691	use_gcc_stdint=wrap
2692	extra_headers=altivec.h
2693	;;
2694rs6000-ibm-aix[6789].* | powerpc-ibm-aix[6789].*)
2695	tm_file="${tm_file} rs6000/aix.h rs6000/aix61.h rs6000/xcoff.h rs6000/aix-stdint.h"
2696	tmake_file="rs6000/t-aix52 t-slibgcc"
2697	extra_options="${extra_options} rs6000/aix64.opt"
2698	use_collect2=yes
2699	thread_file='aix'
2700	use_gcc_stdint=wrap
2701	extra_headers=altivec.h
2702	;;
2703rl78-*-elf*)
2704	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2705	target_has_targetm_common=no
2706	c_target_objs="rl78-c.o"
2707	cxx_target_objs="rl78-c.o"
2708	tmake_file="${tmake_file} rl78/t-rl78"
2709	;;
2710rx-*-elf*)
2711	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2712	tmake_file="${tmake_file} rx/t-rx"
2713	;;
2714s390-*-linux*)
2715	default_gnu_indirect_function=yes
2716	tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
2717	c_target_objs="${c_target_objs} s390-c.o"
2718	cxx_target_objs="${cxx_target_objs} s390-c.o"
2719	if test x$enable_targets = xall; then
2720		tmake_file="${tmake_file} s390/t-linux64"
2721	fi
2722	tmake_file="${tmake_file} s390/t-s390"
2723	;;
2724s390x-*-linux*)
2725	default_gnu_indirect_function=yes
2726	tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
2727	tm_p_file="linux-protos.h s390/s390-protos.h"
2728	c_target_objs="${c_target_objs} s390-c.o"
2729	cxx_target_objs="${cxx_target_objs} s390-c.o"
2730	md_file=s390/s390.md
2731	extra_modes=s390/s390-modes.def
2732	out_file=s390/s390.c
2733	tmake_file="${tmake_file} s390/t-linux64 s390/t-s390"
2734	;;
2735s390x-ibm-tpf*)
2736	tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h s390/tpf.h"
2737	tm_p_file=s390/s390-protos.h
2738	c_target_objs="${c_target_objs} s390-c.o"
2739	cxx_target_objs="${cxx_target_objs} s390-c.o"
2740	md_file=s390/s390.md
2741	extra_modes=s390/s390-modes.def
2742	out_file=s390/s390.c
2743	thread_file='tpf'
2744	extra_options="${extra_options} s390/tpf.opt"
2745	tmake_file="${tmake_file} s390/t-s390"
2746	;;
2747sh-*-elf* | sh[12346l]*-*-elf* | \
2748  sh-*-linux* | sh[2346lbe]*-*-linux* | \
2749  sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
2750  sh64-*-netbsd* | sh64l*-*-netbsd*)
2751	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
2752	if test x${with_endian} = x; then
2753		case ${target} in
2754		sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
2755		shbe-*-* | sheb-*-*)		   with_endian=big,little ;;
2756		sh[1234]l* | sh[34]*-*-linux*)	   with_endian=little ;;
2757		shl* | sh64l* | sh*-*-linux* | \
2758		  sh5l* | sh-superh-elf)	   with_endian=little,big ;;
2759		sh[1234]*-*-*)			   with_endian=big ;;
2760		*)				   with_endian=big,little ;;
2761		esac
2762	fi
2763	# TM_ENDIAN_CONFIG is used by t-sh to determine multilibs.
2764	#  First word : the default endian.
2765	#  Second word: the secondary endian (optional).
2766	case ${with_endian} in
2767	big)		TM_ENDIAN_CONFIG=mb ;;
2768	little)		TM_ENDIAN_CONFIG=ml ;;
2769	big,little)	TM_ENDIAN_CONFIG="mb ml" ;;
2770	little,big)	TM_ENDIAN_CONFIG="ml mb" ;;
2771	*)	echo "with_endian=${with_endian} not supported."; exit 1 ;;
2772	esac
2773	case ${with_endian} in
2774	little*)	tm_file="sh/little.h ${tm_file}" ;;
2775	esac
2776	tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h"
2777	case ${target} in
2778	sh*-*-linux*)	tmake_file="${tmake_file} sh/t-linux"
2779			tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
2780	sh*-*-netbsd*)
2781			tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
2782			extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2783
2784			;;
2785	sh*-superh-elf)	if test x$with_libgloss != xno; then
2786                                with_libgloss=yes
2787                                tm_file="${tm_file} sh/newlib.h"
2788                        fi
2789			tm_file="${tm_file} sh/embed-elf.h"
2790			tm_file="${tm_file} sh/superh.h"
2791			extra_options="${extra_options} sh/superh.opt" ;;
2792	*)		if test x$with_newlib = xyes \
2793			   && test x$with_libgloss = xyes; then
2794				tm_file="${tm_file} sh/newlib.h"
2795			fi
2796			tm_file="${tm_file} sh/embed-elf.h" ;;
2797	esac
2798	case ${target} in
2799	sh5*-*-netbsd*)
2800		# SHmedia, 32-bit ABI
2801		tmake_file="${tmake_file} sh/t-sh64"
2802		;;
2803	sh64*-netbsd*)
2804		# SHmedia, 64-bit ABI
2805		tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd-sh5-64"
2806		;;
2807	*-*-netbsd*)
2808                tmake_file="${tmake_file} sh/t-netbsd"
2809		;;
2810	sh64*-*-linux*)
2811		tmake_file="${tmake_file} sh/t-sh64"
2812		tm_file="${tm_file} sh/sh64.h"
2813		extra_headers="shmedia.h ushmedia.h sshmedia.h"
2814		;;
2815	sh64*)
2816		tmake_file="${tmake_file} sh/t-sh64"
2817		tm_file="${tm_file} sh/sh64.h"
2818		if test x$with_newlib = xyes; then
2819			tm_file="${tm_file} newlib-stdint.h"
2820		fi
2821		extra_headers="shmedia.h ushmedia.h sshmedia.h"
2822		;;
2823	*-*-elf*)
2824		tm_file="${tm_file} newlib-stdint.h"
2825		;;
2826	esac
2827	# sed el/eb endian suffixes away to avoid confusion with sh[23]e
2828	case `echo ${target} | sed 's/e[lb]-/-/'` in
2829	sh64*-*-netbsd*)	sh_cpu_target=sh5-64media ;;
2830	sh64* | sh5*-*-netbsd*)	sh_cpu_target=sh5-32media ;;
2831	sh4a_single_only*)	sh_cpu_target=sh4a-single-only ;;
2832	sh4a_single*)		sh_cpu_target=sh4a-single ;;
2833	sh4a_nofpu*)		sh_cpu_target=sh4a-nofpu ;;
2834	sh4al)			sh_cpu_target=sh4al ;;
2835	sh4a*)			sh_cpu_target=sh4a ;;
2836	sh4_single_only*)	sh_cpu_target=sh4-single-only ;;
2837	sh4_single*)		sh_cpu_target=sh4-single ;;
2838	sh4_nofpu*)		sh_cpu_target=sh4-nofpu ;;
2839	sh4* | sh-superh-*)	sh_cpu_target=sh4 ;;
2840	sh3e*)			sh_cpu_target=sh3e ;;
2841	sh*-*-netbsd* | sh3*)	sh_cpu_target=sh3 ;;
2842	sh2a_single_only*)	sh_cpu_target=sh2a-single-only ;;
2843	sh2a_single*)		sh_cpu_target=sh2a-single ;;
2844	sh2a_nofpu*)		sh_cpu_target=sh2a-nofpu ;;
2845	sh2a*)			sh_cpu_target=sh2a ;;
2846	sh2e*)			sh_cpu_target=sh2e ;;
2847	sh2*)			sh_cpu_target=sh2 ;;
2848	*)			sh_cpu_target=sh1 ;;
2849	esac
2850	# did the user say --without-fp ?
2851	if test x$with_fp = xno; then
2852		case ${sh_cpu_target} in
2853		sh5-*media)	sh_cpu_target=${sh_cpu_target}-nofpu ;;
2854		sh4al | sh1)	;;
2855		sh4a* )		sh_cpu_target=sh4a-nofpu ;;
2856		sh4*)		sh_cpu_target=sh4-nofpu ;;
2857		sh3*)		sh_cpu_target=sh3 ;;
2858		sh2a*)		sh_cpu_target=sh2a-nofpu ;;
2859		sh2*)		sh_cpu_target=sh2 ;;
2860		*)	echo --without-fp not available for $target: ignored
2861		esac
2862		tm_defines="$tm_defines STRICT_NOFPU=1"
2863	fi
2864	sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr A-Z_ a-z-`"
2865	case $sh_cpu_default in
2866	sh5-64media-nofpu | sh5-64media | \
2867	  sh5-32media-nofpu | sh5-32media | sh5-compact-nofpu | sh5-compact | \
2868	  sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
2869	  sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
2870	  sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
2871	  sh3e | sh3 | sh2e | sh2 | sh1) ;;
2872	"")	sh_cpu_default=${sh_cpu_target} ;;
2873	*)	echo "with_cpu=$with_cpu not supported"; exit 1 ;;
2874	esac
2875	sh_multilibs=${with_multilib_list}
2876	if test "$sh_multilibs" = "default" ; then
2877		case ${target} in
2878		sh64-superh-linux* | \
2879		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
2880		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
2881		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
2882		sh*-*-linux*)	sh_multilibs=m1,m2,m2a,m3e,m4 ;;
2883		sh*-*-netbsd*)	sh_multilibs=m3,m3e,m4 ;;
2884		*) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
2885		esac
2886		if test x$with_fp = xno; then
2887			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`"
2888		fi
2889	fi
2890	target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
2891	tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
2892	tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
2893	sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^[Ss][Hh]/m/' -e 's/ [Ss][Hh]/ m/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
2894	for sh_multilib in ${sh_multilibs}; do
2895		case ${sh_multilib} in
2896		m1 | m2 | m2e | m3 | m3e | \
2897		m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
2898		m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
2899		m2a | m2a-single | m2a-single-only | m2a-nofpu | \
2900		m5-64media | m5-64media-nofpu | \
2901		m5-32media | m5-32media-nofpu | \
2902		m5-compact | m5-compact-nofpu)
2903			# TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
2904			# It is passed to MULTIILIB_OPTIONS verbatim.
2905			TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
2906			tm_defines="$tm_defines SUPPORT_`echo $sh_multilib | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
2907			;;
2908		\!*)	# TM_MULTILIB_EXCEPTIONS_CONFIG is used by t-sh
2909			# It is passed the MULTILIB_EXCEPTIONS verbatim.
2910			TM_MULTILIB_EXCEPTIONS_CONFIG="${TM_MULTILIB_EXCEPTIONS_CONFIG} `echo $sh_multilib | sed 's/^!//'`" ;;
2911		*)
2912			echo "with_multilib_list=${sh_multilib} not supported."
2913			exit 1
2914			;;
2915		esac
2916	done
2917	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
2918	if test x${enable_incomplete_targets} = xyes ; then
2919		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"
2920	fi
2921	tm_file="$tm_file ./sysroot-suffix.h"
2922	tmake_file="$tmake_file t-sysroot-suffix"
2923	;;
2924sh-*-rtems*)
2925	tmake_file="${tmake_file} sh/t-sh sh/t-rtems"
2926	tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
2927	;;
2928sh-wrs-vxworks)
2929	tmake_file="$tmake_file sh/t-sh sh/t-vxworks"
2930	tm_file="${tm_file} elfos.h sh/elf.h sh/embed-elf.h vx-common.h vxworks.h sh/vxworks.h"
2931	;;
2932sparc-*-elf*)
2933	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
2934	case ${target} in
2935	    *-leon-*)
2936		tmake_file="sparc/t-sparc sparc/t-leon"
2937		;;
2938	    *-leon[3-9]*)
2939		tmake_file="sparc/t-sparc sparc/t-leon3"
2940		;;
2941	    *)
2942		tmake_file="sparc/t-sparc sparc/t-elf"
2943		;;
2944	esac
2945	;;
2946sparc-*-rtems*)
2947	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
2948	tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems"
2949	;;
2950sparc-*-linux*)
2951	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
2952	extra_options="${extra_options} sparc/long-double-switch.opt"
2953	case ${target} in
2954	    *-leon-*)
2955		tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon"
2956		;;
2957	    *-leon[3-9]*)
2958		tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon3"
2959		;;
2960	    *)
2961		tmake_file="${tmake_file} sparc/t-sparc"
2962		;;
2963	esac
2964	if test x$enable_targets = xall; then
2965		tm_file="sparc/biarch64.h ${tm_file} sparc/linux64.h"
2966		tmake_file="${tmake_file} sparc/t-linux64"
2967	else
2968		tm_file="${tm_file} sparc/linux.h"
2969		tmake_file="${tmake_file} sparc/t-linux"
2970	fi
2971	;;
2972sparc-*-netbsdelf*)
2973	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
2974	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2975	extra_options="${extra_options} sparc/long-double-switch.opt"
2976	tmake_file="${tmake_file} sparc/t-sparc"
2977	;;
2978sparc*-*-solaris2*)
2979	tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sparc/tso.h"
2980	case ${target} in
2981	    sparc64-*-* | sparcv9-*-*)
2982		tm_file="sparc/default-64.h ${tm_file}"
2983		;;
2984	    *)
2985		test x$with_cpu != x || with_cpu=v9
2986		;;
2987	esac
2988	tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2"
2989	;;
2990sparc-wrs-vxworks)
2991	tm_file="${tm_file} elfos.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
2992	tmake_file="${tmake_file} sparc/t-sparc sparc/t-vxworks"
2993	;;
2994sparc64-*-elf*)
2995	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h"
2996	extra_options="${extra_options}"
2997	tmake_file="${tmake_file} sparc/t-sparc"
2998	;;
2999sparc64-*-rtems*)
3000	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
3001	extra_options="${extra_options}"
3002	tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64"
3003	;;
3004sparc64-*-linux*)
3005	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"
3006	extra_options="${extra_options} sparc/long-double-switch.opt"
3007	tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
3008	;;
3009sparc64-*-freebsd*|ultrasparc-*-freebsd*)
3010	tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
3011	extra_options="${extra_options} sparc/long-double-switch.opt"
3012	case "x$with_cpu" in
3013		xultrasparc) ;;
3014		x) with_cpu=ultrasparc ;;
3015		*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
3016	esac
3017	tmake_file="${tmake_file} sparc/t-sparc"
3018	;;
3019sparc64-*-netbsd*)
3020	tm_file="sparc/biarch64.h ${tm_file}"
3021	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
3022	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3023	extra_options="${extra_options} sparc/long-double-switch.opt"
3024	tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
3025	with_cpu=ultrasparc
3026	;;
3027sparc64-*-openbsd*)
3028	tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
3029	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
3030	extra_options="${extra_options} openbsd.opt"
3031	extra_options="${extra_options}"
3032	gas=yes gnu_ld=yes
3033	with_cpu=ultrasparc
3034	tmake_file="${tmake_file} sparc/t-sparc"
3035	;;
3036spu-*-elf*)
3037	tm_file="dbxelf.h elfos.h spu/spu-elf.h spu/spu.h newlib-stdint.h"
3038	tmake_file="spu/t-spu-elf"
3039        native_system_header_dir=/include
3040	extra_headers="spu_intrinsics.h spu_internals.h vmx2spu.h spu_mfcio.h vec_types.h spu_cache.h"
3041	extra_modes=spu/spu-modes.def
3042	c_target_objs="${c_target_objs} spu-c.o"
3043	cxx_target_objs="${cxx_target_objs} spu-c.o"
3044	;;
3045tic6x-*-elf)
3046	tm_file="elfos.h ${tm_file} c6x/elf-common.h c6x/elf.h"
3047	tm_file="${tm_file} dbxelf.h tm-dwarf2.h newlib-stdint.h"
3048	tmake_file="c6x/t-c6x c6x/t-c6x-elf"
3049	use_collect2=no
3050	;;
3051tic6x-*-uclinux)
3052	tm_file="elfos.h ${tm_file} gnu-user.h linux.h c6x/elf-common.h c6x/uclinux-elf.h"
3053	tm_file="${tm_file} dbxelf.h tm-dwarf2.h glibc-stdint.h"
3054	tm_file="${tm_file} ./sysroot-suffix.h"
3055	tmake_file="t-sysroot-suffix t-slibgcc"
3056	tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
3057	use_collect2=no
3058	;;
3059tilegx*-*-linux*)
3060	tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilegx/linux.h ${tm_file}"
3061        tmake_file="${tmake_file} tilegx/t-tilegx"
3062	extra_objs="${extra_objs} mul-tables.o"
3063	c_target_objs="${c_target_objs} tilegx-c.o"
3064	cxx_target_objs="${cxx_target_objs} tilegx-c.o"
3065	extra_headers="feedback.h"
3066	case $target in
3067	tilegxbe-*)
3068		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
3069 		;;
3070	esac
3071	;;
3072tilepro*-*-linux*)
3073	tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilepro/linux.h ${tm_file}"
3074        tmake_file="${tmake_file} tilepro/t-tilepro"
3075	extra_objs="${extra_objs} mul-tables.o"
3076	c_target_objs="${c_target_objs} tilepro-c.o"
3077	cxx_target_objs="${cxx_target_objs} tilepro-c.o"
3078	extra_headers="feedback.h"
3079	;;
3080v850-*-rtems*)
3081	target_cpu_default="TARGET_CPU_generic"
3082	tm_file="dbxelf.h elfos.h v850/v850.h"
3083	tm_file="${tm_file} rtems.h v850/rtems.h newlib-stdint.h"
3084	tmake_file="${tmake_file} v850/t-v850"
3085	tmake_file="${tmake_file} v850/t-rtems"
3086	use_collect2=no
3087	c_target_objs="v850-c.o"
3088	cxx_target_objs="v850-c.o"
3089	;;
3090v850*-*-*)
3091	case ${target} in
3092	v850e3v5-*-*)
3093		target_cpu_default="TARGET_CPU_v850e3v5"
3094		;;
3095	v850e2v3-*-*)
3096		target_cpu_default="TARGET_CPU_v850e2v3"
3097		;;
3098	v850e2-*-*)
3099		target_cpu_default="TARGET_CPU_v850e2"
3100		;;
3101	v850e1-*-* | v850es-*-*)
3102		target_cpu_default="TARGET_CPU_v850e1"
3103		;;
3104	v850e-*-*)
3105		target_cpu_default="TARGET_CPU_v850e"
3106		;;
3107	v850-*-*)
3108		target_cpu_default="TARGET_CPU_generic"
3109		;;
3110	esac
3111	tm_file="dbxelf.h elfos.h newlib-stdint.h v850/v850.h"
3112	if test x$stabs = xyes
3113	then
3114		tm_file="${tm_file} dbx.h"
3115	fi
3116	use_collect2=no
3117	c_target_objs="v850-c.o"
3118	cxx_target_objs="v850-c.o"
3119	use_gcc_stdint=wrap
3120	;;
3121vax-*-linux*)
3122	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
3123	extra_options="${extra_options} vax/elf.opt"
3124	;;
3125vax-*-netbsdelf*)
3126	tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
3127	tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
3128	extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
3129	;;
3130vax-*-openbsd*)
3131	tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-pthread.h vax/openbsd.h"
3132	extra_options="${extra_options} openbsd.opt"
3133	use_collect2=yes
3134	;;
3135visium-*-elf*)
3136	tm_file="dbxelf.h elfos.h ${tm_file} visium/elf.h newlib-stdint.h"
3137	tmake_file="visium/t-visium visium/t-crtstuff"
3138	;;
3139xstormy16-*-elf)
3140	# For historical reasons, the target files omit the 'x'.
3141	tm_file="dbxelf.h elfos.h newlib-stdint.h stormy16/stormy16.h"
3142	tm_p_file=stormy16/stormy16-protos.h
3143	md_file=stormy16/stormy16.md
3144	out_file=stormy16/stormy16.c
3145	extra_options=stormy16/stormy16.opt
3146	tmake_file="stormy16/t-stormy16"
3147	;;
3148xtensa*-*-elf*)
3149	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h"
3150	extra_options="${extra_options} xtensa/elf.opt"
3151	;;
3152xtensa*-*-linux*)
3153	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
3154	tmake_file="${tmake_file} xtensa/t-xtensa"
3155	;;
3156am33_2.0-*-linux*)
3157	tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
3158	gas=yes gnu_ld=yes
3159	use_collect2=no
3160	;;
3161m32c-*-rtems*)
3162	tm_file="dbxelf.h elfos.h ${tm_file} m32c/rtems.h rtems.h newlib-stdint.h"
3163	c_target_objs="m32c-pragma.o"
3164	cxx_target_objs="m32c-pragma.o"
3165 	;;
3166m32c-*-elf*)
3167	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
3168	c_target_objs="m32c-pragma.o"
3169	cxx_target_objs="m32c-pragma.o"
3170 	;;
3171*)
3172	echo "*** Configuration ${target} not supported" 1>&2
3173	exit 1
3174	;;
3175esac
3176
3177case ${target} in
3178i[34567]86-*-linux* | x86_64-*-linux*)
3179	tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386"
3180	;;
3181i[34567]86-*-* | x86_64-*-*)
3182	tmake_file="${tmake_file} i386/t-gmm_malloc i386/t-i386"
3183	;;
3184powerpc*-*-* | rs6000-*-*)
3185	tm_file="${tm_file} rs6000/option-defaults.h"
3186esac
3187
3188# Build mkoffload tool
3189case ${target} in
3190*-intelmic-* | *-intelmicemul-*)
3191	tmake_file="${tmake_file} i386/t-intelmic"
3192	tm_file="${tm_file} i386/intelmic-offload.h"
3193	;;
3194esac
3195
3196if [ "$target_has_targetcm" = "no" ]; then
3197  c_target_objs="$c_target_objs default-c.o"
3198  cxx_target_objs="$cxx_target_objs default-c.o"
3199fi
3200
3201if [ "$common_out_file" = "" ]; then
3202  if [ "$target_has_targetm_common" = "yes" ]; then
3203    common_out_file="$cpu_type/$cpu_type-common.c"
3204  else
3205    common_out_file="default-common.c"
3206  fi
3207fi
3208
3209# Support for --with-cpu and related options (and a few unrelated options,
3210# too).
3211case ${with_cpu} in
3212  yes | no)
3213    echo "--with-cpu must be passed a value" 1>&2
3214    exit 1
3215    ;;
3216esac
3217
3218# Set arch and cpu from ${target} and ${target_noncanonical}.  Set cpu
3219# to generic if there is no processor scheduler model for the target.
3220arch=
3221cpu=
3222arch_without_sse2=no
3223arch_without_64bit=no
3224case ${target} in
3225  i386-*-freebsd*)
3226    if test $fbsd_major -ge 6; then
3227      arch=i486
3228    else
3229      arch=i386
3230    fi
3231    cpu=generic
3232    arch_without_sse2=yes
3233    arch_without_64bit=yes
3234    ;;
3235  i386-*-*)
3236    arch=i386
3237    cpu=i386
3238    arch_without_sse2=yes
3239    arch_without_64bit=yes
3240    ;;
3241  i486-*-*)
3242    arch=i486
3243    cpu=i486
3244    arch_without_sse2=yes
3245    arch_without_64bit=yes
3246    ;;
3247  i586-*-*)
3248    arch_without_sse2=yes
3249    arch_without_64bit=yes
3250    case ${target_noncanonical} in
3251      k6_2-*)
3252	arch=k6-2
3253	cpu=k6-2
3254	;;
3255      k6_3-*)
3256	arch=k6-3
3257	cpu=k6-3
3258	;;
3259      k6-*)
3260	arch=k6
3261	cpu=k6
3262	;;
3263      pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
3264	arch=pentium-mmx
3265	cpu=pentium-mmx
3266	;;
3267      *)
3268	arch=pentium
3269	cpu=pentium
3270	;;
3271    esac
3272    ;;
3273  i686-*-* | i786-*-*)
3274    case ${target_noncanonical} in
3275      bdver4-*)
3276        arch=bdver4
3277        cpu=bdver4
3278        ;;
3279      bdver3-*)
3280        arch=bdver3
3281        cpu=bdver3
3282        ;;
3283      bdver2-*)
3284        arch=bdver2
3285        cpu=bdver2
3286        ;;
3287      bdver1-*)
3288	arch=bdver1
3289	cpu=bdver1
3290	;;
3291      btver1-*)
3292	arch=btver1
3293	cpu=btver1
3294	;;
3295      btver2-*)
3296	arch=btver2
3297	cpu=btver2
3298	;;
3299      amdfam10-*|barcelona-*)
3300	arch=amdfam10
3301	cpu=amdfam10
3302	;;
3303      k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3304	arch=k8-sse3
3305	cpu=k8-sse3
3306	;;
3307      k8-*|opteron-*|athlon64-*|athlon_fx-*)
3308	arch=k8
3309	cpu=k8
3310	;;
3311      athlon_xp-*|athlon_mp-*|athlon_4-*)
3312	arch=athlon-4
3313	cpu=athlon-4
3314	arch_without_sse2=yes
3315	arch_without_64bit=yes
3316	;;
3317      athlon_tbird-*|athlon-*)
3318	arch=athlon
3319	cpu=athlon
3320	arch_without_sse2=yes
3321	;;
3322      geode-*)
3323	arch=geode
3324	cpu=geode
3325	arch_without_sse2=yes
3326	;;
3327      pentium2-*)
3328	arch=pentium2
3329	cpu=pentium2
3330	arch_without_sse2=yes
3331	;;
3332      pentium3-*|pentium3m-*)
3333	arch=pentium3
3334	cpu=pentium3
3335	arch_without_sse2=yes
3336	;;
3337      pentium4-*|pentium4m-*)
3338	arch=pentium4
3339	cpu=pentium4
3340	;;
3341      prescott-*)
3342	arch=prescott
3343	cpu=prescott
3344	;;
3345      nocona-*)
3346	arch=nocona
3347	cpu=nocona
3348	;;
3349      atom-*)
3350	arch=atom
3351	cpu=atom
3352	;;
3353      slm-*)
3354	arch=slm
3355	cpu=slm
3356	;;
3357      core2-*)
3358	arch=core2
3359	cpu=core2
3360	;;
3361      corei7-*)
3362	arch=corei7
3363	cpu=corei7
3364	;;
3365      corei7_avx-*)
3366	arch=corei7-avx
3367	cpu=corei7-avx
3368	;;
3369      pentium_m-*)
3370	arch=pentium-m
3371	cpu=pentium-m
3372	;;
3373      pentiumpro-*)
3374	arch=pentiumpro
3375	cpu=pentiumpro
3376	arch_without_sse2=yes
3377	;;
3378      *)
3379	arch=pentiumpro
3380	cpu=generic
3381	arch_without_sse2=yes
3382	arch_without_64bit=yes
3383	;;
3384    esac
3385    ;;
3386  x86_64-*-*)
3387    case ${target_noncanonical} in
3388      bdver4-*)
3389        arch=bdver4
3390        cpu=bdver4
3391        ;;
3392      bdver3-*)
3393        arch=bdver3
3394        cpu=bdver3
3395        ;;
3396      bdver2-*)
3397        arch=bdver2
3398        cpu=bdver2
3399        ;;
3400      bdver1-*)
3401	arch=bdver1
3402	cpu=bdver1
3403	;;
3404      btver1-*)
3405	arch=btver1
3406	cpu=btver1
3407	;;
3408      btver2-*)
3409	arch=btver2
3410	cpu=btver2
3411	;;
3412      amdfam10-*|barcelona-*)
3413	arch=amdfam10
3414	cpu=amdfam10
3415	;;
3416      k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3417	arch=k8-sse3
3418	cpu=k8-sse3
3419	;;
3420      k8-*|opteron-*|athlon_64-*)
3421	arch=k8
3422	cpu=k8
3423	;;
3424      nocona-*)
3425	arch=nocona
3426	cpu=nocona
3427	;;
3428      atom-*)
3429	arch=atom
3430	cpu=atom
3431	;;
3432      slm-*)
3433	arch=slm
3434	cpu=slm
3435	;;
3436      core2-*)
3437	arch=core2
3438	cpu=core2
3439	;;
3440      corei7-*)
3441	arch=corei7
3442	cpu=corei7
3443	;;
3444      *)
3445	arch=x86-64
3446	cpu=generic
3447	;;
3448    esac
3449    ;;
3450esac
3451
3452# If there is no $with_cpu option, try to infer one from ${target}.
3453# This block sets nothing except for with_cpu.
3454if test x$with_cpu = x ; then
3455  case ${target} in
3456    i[34567]86-*-*|x86_64-*-*)
3457      with_cpu=$cpu
3458      ;;
3459    alphaev6[78]*-*-*)
3460      with_cpu=ev67
3461      ;;
3462    alphaev6*-*-*)
3463      with_cpu=ev6
3464      ;;
3465    alphapca56*-*-*)
3466      with_cpu=pca56
3467      ;;
3468    alphaev56*-*-*)
3469      with_cpu=ev56
3470      ;;
3471    alphaev5*-*-*)
3472      with_cpu=ev5
3473      ;;
3474    frv-*-*linux* | frv400-*-*linux*)
3475      with_cpu=fr400
3476      ;;
3477    frv550-*-*linux*)
3478      with_cpu=fr550
3479      ;;
3480    m5200-*-*|m5407-*-*)
3481      with_cpu=${default_cf_cpu}
3482      ;;
3483    m68k*-*-*)
3484      case "$with_arch" in
3485	"cf")
3486	  with_cpu=${default_cf_cpu}
3487	  ;;
3488	"" | "m68k")
3489	  with_cpu=m${default_m68k_cpu}
3490	  ;;
3491      esac
3492      ;;
3493    powerpc*-*-*spe*)
3494      if test x$enable_e500_double = xyes; then
3495         with_cpu=8548
3496      else
3497         with_cpu=8540
3498      fi       
3499      ;;
3500    sparc*-*-*)
3501      case ${target} in
3502	*-leon-*)
3503	  with_cpu=leon
3504	  ;;
3505	*-leon[3-9]*)
3506	  with_cpu=leon3
3507	  ;;
3508	*-leon[3-9]v7*)
3509	  with_cpu=leon3v7
3510	  ;;
3511	*)
3512	  with_cpu="`echo ${target} | sed 's/-.*$//'`"
3513	  ;;
3514      esac
3515      ;;
3516  esac
3517
3518  # Avoid overriding --with-cpu-32 and --with-cpu-64 values.
3519  case ${target} in
3520    i[34567]86-*-*|x86_64-*-*)
3521      if test x$with_cpu_32 != x || test x$with_cpu_64 != x; then
3522	if test x$with_cpu_32 = x; then
3523	  with_cpu_32=$with_cpu
3524	fi
3525	if test x$with_cpu_64 = x; then
3526	  with_cpu_64=$with_cpu
3527	fi
3528        with_cpu=
3529      fi
3530      ;;
3531  esac
3532fi
3533
3534# Support for --with-arch and related options (and a few unrelated options,
3535# too).
3536case ${with_arch} in
3537  yes | no)
3538    echo "--with-arch must be passed a value" 1>&2
3539    exit 1
3540    ;;
3541esac
3542
3543# If there is no $with_arch option, try to infer one from ${target}.
3544# This block sets nothing except for with_arch.
3545if test x$with_arch = x ; then
3546  case ${target} in
3547    i[34567]86-*-darwin*|x86_64-*-darwin*)
3548      # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
3549      # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
3550      ;;
3551    i[34567]86-*-*)
3552      # --with-fpmath sets the default ISA to SSE2, which is the same
3553      # ISA supported by Pentium 4.
3554      if test x$with_fpmath = x || test $arch_without_sse2 = no; then
3555	with_arch=$arch
3556      else
3557	with_arch=pentium4
3558      fi
3559      ;;
3560    x86_64-*-*)
3561      with_arch=$arch
3562      ;;
3563    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
3564      with_arch=r5900
3565      ;;
3566    mips*-*-vxworks)
3567      with_arch=mips2
3568      ;;
3569  esac
3570
3571  # Avoid overriding --with-arch-32 and --with-arch-64 values.
3572  case ${target} in
3573    i[34567]86-*-darwin*|x86_64-*-darwin*)
3574      # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
3575      # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
3576      ;;
3577    i[34567]86-*-*|x86_64-*-*)
3578      if test x$with_arch_32 != x || test x$with_arch_64 != x; then
3579	if test x$with_arch_32 = x; then
3580	  with_arch_32=$with_arch
3581	fi
3582	if test x$with_arch_64 = x; then
3583	  if test $arch_without_64bit = yes; then
3584	    # Set the default 64bit arch to x86-64 if the default arch
3585	    # doesn't support 64bit.
3586	    with_arch_64=x86-64
3587	  else
3588	    with_arch_64=$with_arch
3589	  fi
3590	fi
3591	with_arch=
3592      elif test $arch_without_64bit$need_64bit_isa = yesyes; then
3593	# Set the default 64bit arch to x86-64 if the default arch
3594	# doesn't support 64bit and we need 64bit ISA.
3595	with_arch_32=$with_arch
3596	with_arch_64=x86-64
3597	with_arch=
3598      fi
3599      ;;
3600  esac
3601fi
3602
3603# Infer a default setting for --with-float.
3604if test x$with_float = x; then
3605  case ${target} in
3606    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
3607      # The R5900 doesn't support 64-bit float.  32-bit float doesn't
3608      # comply with IEEE 754.
3609      with_float=soft
3610      ;;
3611  esac
3612fi
3613
3614# Infer a default setting for --with-fpu.
3615if test x$with_fpu = x; then
3616  case ${target} in
3617    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
3618      # The R5900 FPU only supports single precision.
3619      with_fpu=single
3620      ;;
3621  esac
3622fi
3623
3624# Support --with-fpmath.
3625if test x$with_fpmath != x; then
3626  case ${target} in
3627    i[34567]86-*-* | x86_64-*-*)
3628      case ${with_fpmath} in
3629      avx)
3630	tm_file="${tm_file} i386/avxmath.h"
3631	;;
3632      sse)
3633	tm_file="${tm_file} i386/ssemath.h"
3634	;;
3635      *)
3636	echo "Invalid --with-fpmath=$with_fpmath" 1>&2
3637	exit 1
3638	;;
3639      esac
3640      ;;
3641    *)
3642      echo "--with-fpmath isn't supported for $target." 1>&2
3643      exit 1
3644      ;;
3645  esac
3646fi
3647
3648# Similarly for --with-schedule.
3649if test x$with_schedule = x; then
3650	case ${target} in
3651	hppa1*)
3652		# Override default PA8000 scheduling model.
3653		with_schedule=7100LC
3654		;;
3655	esac
3656fi
3657
3658# Infer a default setting for --with-llsc.
3659if test x$with_llsc = x; then
3660  case ${target} in
3661    mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
3662      # The R5900 doesn't support LL(D) and SC(D).
3663      with_llsc=no
3664      ;;
3665    mips*-*-linux*)
3666      # The kernel emulates LL and SC where necessary.
3667      with_llsc=yes
3668      ;;
3669  esac
3670fi
3671
3672# Validate and mark as valid any --with options supported
3673# by this target.  In order to use a particular --with option
3674# you must list it in supported_defaults; validating the value
3675# is optional.  This case statement should set nothing besides
3676# supported_defaults.
3677
3678supported_defaults=
3679case "${target}" in
3680	aarch64*-*-*)
3681		supported_defaults="abi cpu arch"
3682		for which in cpu arch; do
3683
3684			eval "val=\$with_$which"
3685			base_val=`echo $val | sed -e 's/\+.*//'`
3686			ext_val=`echo $val | sed -e 's/[a-z0-9\-]\+//'`
3687
3688			if [ $which = arch ]; then
3689			  def=aarch64-arches.def
3690			  pattern=AARCH64_ARCH
3691			else
3692			  def=aarch64-cores.def
3693			  pattern=AARCH64_CORE
3694			fi
3695
3696			ext_mask=AARCH64_CPU_DEFAULT_FLAGS
3697
3698			# Find the base CPU or ARCH id in aarch64-cores.def or
3699			# aarch64-arches.def
3700			if [ x"$base_val" = x ] \
3701			    || grep "^$pattern(\"$base_val\"," \
3702				    ${srcdir}/config/aarch64/$def \
3703				    > /dev/null; then
3704
3705			  if [ $which = arch ]; then
3706				base_id=`grep "^$pattern(\"$base_val\"," \
3707				  ${srcdir}/config/aarch64/$def | \
3708				  sed -e 's/^[^,]*,[ 	]*//' | \
3709				  sed -e 's/,.*$//'`
3710				# Extract the architecture flags from aarch64-arches.def
3711				ext_mask=`grep "^$pattern(\"$base_val\"," \
3712				   ${srcdir}/config/aarch64/$def | \
3713				   sed -e 's/)$//' | \
3714				   sed -e 's/^.*,//'`
3715			  else
3716				base_id=`grep "^$pattern(\"$base_val\"," \
3717				  ${srcdir}/config/aarch64/$def | \
3718				  sed -e 's/^[^,]*,[ 	]*//' | \
3719				  sed -e 's/,.*$//'`
3720			  fi
3721
3722			  while [ x"$ext_val" != x ]
3723			  do
3724				ext_val=`echo $ext_val | sed -e 's/\+//'`
3725				ext=`echo $ext_val | sed -e 's/\+.*//'`
3726				base_ext=`echo $ext | sed -e 's/^no//'`
3727
3728				if [ x"$base_ext" = x ] \
3729				    || grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3730				    ${srcdir}/config/aarch64/aarch64-option-extensions.def \
3731				    > /dev/null; then
3732
3733				  ext_on=`grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3734					${srcdir}/config/aarch64/aarch64-option-extensions.def | \
3735					sed -e 's/^[^,]*,[ 	]*//' | \
3736					sed -e 's/,.*$//'`
3737				  ext_off=`grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3738					${srcdir}/config/aarch64/aarch64-option-extensions.def | \
3739					sed -e 's/^[^,]*,[ 	]*[^,]*,[ 	]*//' | \
3740					sed -e 's/,.*$//' | \
3741					sed -e 's/).*$//'`
3742
3743				  if [ $ext = $base_ext ]; then
3744					# Adding extension
3745					ext_mask="("$ext_mask") | ("$ext_on")"
3746				  else
3747					# Removing extension
3748					ext_mask="("$ext_mask") & ~("$ext_off")"
3749				  fi
3750
3751				  true
3752				else
3753				  echo "Unknown extension used in --with-$which=$val" 1>&2
3754				  exit 1
3755				fi
3756				ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'`
3757			  done
3758
3759			  ext_mask="(("$ext_mask") << 6)"
3760			  if [ x"$base_id" != x ]; then
3761				target_cpu_cname="TARGET_CPU_$base_id | $ext_mask"
3762			  fi
3763			  true
3764			else
3765			  echo "Unknown $which used in --with-$which=$val" 1>&2
3766			  exit 1
3767			fi
3768		done
3769		;;
3770
3771	alpha*-*-*)
3772		supported_defaults="cpu tune"
3773		for which in cpu tune; do
3774			eval "val=\$with_$which"
3775			case "$val" in
3776			"" \
3777			| ev4 | ev45 | 21064 | ev5 | 21164 | ev56 | 21164a \
3778			| pca56 | 21164PC | 21164pc | ev6 | 21264 | ev67 \
3779			| 21264a)
3780				;;
3781			*)
3782				echo "Unknown CPU used in --with-$which=$val" 1>&2
3783				exit 1
3784				;;
3785			esac
3786		done
3787		;;
3788
3789	arc*-*-*) # was:	arc*-*-linux-uclibc)
3790		supported_defaults="cpu"
3791		case $with_cpu in
3792		  arc600|arc601|arc700)
3793			;;
3794		  *) echo "Unknown cpu type"
3795			exit 1
3796			;;
3797		esac
3798		;;
3799
3800	arm*-*-*)
3801		supported_defaults="arch cpu float tune fpu abi mode tls"
3802		for which in cpu tune; do
3803			# See if it matches any of the entries in arm-cores.def
3804			eval "val=\$with_$which"
3805			if [ x"$val" = x ] \
3806			    || grep "^ARM_CORE(\"$val\"," \
3807				    ${srcdir}/config/arm/arm-cores.def \
3808				    > /dev/null; then
3809			  # Ok
3810			  new_val=`grep "^ARM_CORE(\"$val\"," \
3811				${srcdir}/config/arm/arm-cores.def | \
3812				sed -e 's/^[^,]*,[ 	]*//' | \
3813				sed -e 's/,.*$//'`
3814			  eval "target_${which}_cname=$new_val"
3815			echo "For $val real value is $new_val"
3816			  true
3817			else
3818			  echo "Unknown CPU used in --with-$which=$val" 1>&2
3819			  exit 1
3820			fi
3821		done
3822
3823		# See if it matches any of the entries in arm-arches.def
3824		if [ x"$with_arch" = x ] \
3825		    || grep "^ARM_ARCH(\"$with_arch\"," \
3826			    ${srcdir}/config/arm/arm-arches.def \
3827			    > /dev/null; then
3828		  # OK
3829		  true
3830		else
3831		  echo "Unknown arch used in --with-arch=$with_arch" 1>&2
3832		  exit 1
3833		fi
3834
3835		case "$with_float" in
3836		"" \
3837		| soft | hard | softfp)
3838			# OK
3839			;;
3840		*)
3841			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
3842			exit 1
3843			;;
3844		esac
3845
3846		# see if it matches any of the entries in arm-fpus.def
3847		if [ x"$with_fpu" = x ] \
3848		    || grep "^ARM_FPU(\"$with_fpu\"," \
3849			    ${srcdir}/config/arm/arm-fpus.def \
3850			    > /dev/null; then
3851		  # OK
3852		  true
3853		else
3854		  echo "Unknown fpu used in --with-fpu=$with_fpu" 1>&2
3855		  exit 1
3856		fi
3857
3858		case "$with_abi" in
3859		"" \
3860		| apcs-gnu | atpcs | aapcs | iwmmxt | aapcs-linux )
3861			#OK
3862			;;
3863		*)
3864			echo "Unknown ABI used in --with-abi=$with_abi"
3865			exit 1
3866			;;
3867		esac
3868
3869		case "$with_mode" in
3870		"" \
3871		| arm | thumb )
3872			#OK
3873			;;
3874		*)
3875			echo "Unknown mode used in --with-mode=$with_mode"
3876			exit 1
3877			;;
3878		esac
3879
3880		case "$with_tls" in
3881		"" \
3882		| gnu | gnu2)
3883			# OK
3884			;;
3885		*)
3886			echo "Unknown TLS method used in --with-tls=$with_tls" 1>&2
3887			exit 1
3888			;;
3889		esac
3890
3891		if test "x$with_arch" != x && test "x$with_cpu" != x; then
3892			echo "Switch \"--with-arch\" may not be used with switch \"--with-cpu\""  1>&2
3893			exit 1
3894		fi
3895
3896		if test "x$with_cpu" != x && test "x$with_tune" != x; then
3897			echo "Switch \"--with-tune\" may not be used with switch \"--with-cpu\""  1>&2
3898			exit 1
3899		fi
3900
3901		# Add extra multilibs
3902		if test "x$with_multilib_list" != x; then
3903			arm_multilibs=`echo $with_multilib_list | sed -e 's/,/ /g'`
3904			for arm_multilib in ${arm_multilibs}; do
3905				case ${arm_multilib} in
3906				aprofile)
3907				# Note that arm/t-aprofile is a
3908				# stand-alone make file fragment to be
3909				# used only with itself.  We do not
3910				# specifically use the
3911				# TM_MULTILIB_OPTION framework because
3912				# this shorthand is more
3913				# pragmatic. Additionally it is only
3914				# designed to work without any
3915				# with-cpu, with-arch with-mode
3916				# with-fpu or with-float options.
3917					if test "x$with_arch" != x \
3918					    || test "x$with_cpu" != x \
3919					    || test "x$with_float" != x \
3920					    || test "x$with_fpu" != x \
3921					    || test "x$with_mode" != x ; then
3922					    echo "Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=aprofile" 1>&2
3923					    exit 1
3924					fi
3925					tmake_file="${tmake_file} arm/t-aprofile"
3926					break
3927					;;
3928				default)
3929					;;
3930				*)
3931					echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2
3932					exit 1
3933					;;
3934				esac
3935			done
3936		fi
3937		;;
3938
3939	fr*-*-*linux*)
3940		supported_defaults=cpu
3941		case "$with_cpu" in
3942		fr400) ;;
3943		fr550) ;;
3944		*)
3945			echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
3946			exit 1
3947			;;
3948		esac
3949		;;
3950
3951	fido-*-* | m68k*-*-* | m5200-*-* | m5407-*-*)
3952		supported_defaults="arch cpu"
3953		case "$with_arch" in
3954		"" | "m68k"| "cf")
3955			m68k_arch_family="$with_arch"
3956			;;
3957		*)
3958			echo "Invalid --with-arch=$with_arch" 1>&2
3959			exit 1
3960			;;
3961		esac
3962
3963		# We always have a $with_cpu setting here.
3964		case "$with_cpu" in
3965		"m68000" | "m68010" | "m68020" | "m68030" | "m68040" | "m68060")
3966			m68k_cpu_ident=$with_cpu
3967			;;
3968		"m68020-40")
3969			m68k_cpu_ident=m68020
3970			tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_40"
3971			;;
3972		"m68020-60")
3973			m68k_cpu_ident=m68020
3974			tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_60"
3975			;;
3976		*)
3977			# We need the C identifier rather than the string.
3978			m68k_cpu_ident=`awk -v arg="\"$with_cpu\"" \
3979			   'BEGIN { FS="[ \t]*[,()][ \t]*" }; \
3980			    $1 == "M68K_DEVICE" && $2 == arg { print $3 }' \
3981				 ${srcdir}/config/m68k/m68k-devices.def`
3982			if [ x"$m68k_cpu_ident" = x ] ; then
3983				echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2
3984				exit 1
3985			fi
3986			with_cpu="mcpu=$with_cpu"
3987			;;
3988		esac
3989		;;
3990
3991	hppa*-*-*)
3992		supported_defaults="arch schedule"
3993
3994		case "$with_arch" in
3995		"" | 1.0 | 1.1 | 2.0)
3996			# OK
3997			;;
3998		*)
3999			echo "Unknown architecture used in --with-arch=$with_arch" 1>&2
4000			exit 1
4001			;;
4002		esac
4003
4004		case "$with_schedule" in
4005		"" | 700 | 7100 | 7100LC | 7200 | 7300 | 8000)
4006			# OK
4007			;;
4008		*)
4009			echo "Unknown processor used in --with-schedule=$with_schedule." 1>&2
4010			exit 1
4011			;;
4012		esac
4013		;;
4014
4015	i[34567]86-*-* | x86_64-*-*)
4016		supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
4017		for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do
4018			eval "val=\$with_$which"
4019			case " $x86_archs " in
4020			*" ${val} "*)
4021				case "${target}" in
4022				  x86_64-*-*)
4023				      case "x$which" in
4024					*_32)
4025						;;
4026					*)
4027						echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
4028						exit 1
4029						;;
4030				      esac
4031				      ;;
4032				esac
4033				# OK
4034				;;
4035			*)
4036				if test x${val} != x; then
4037					case " $x86_64_archs " in
4038					*" ${val} "*)
4039						# OK
4040						;;
4041					*)
4042						# Allow $x86_cpus --with-cpu=/--with-tune=
4043						case "x$which" in
4044						xcpu*|xtune*)
4045							case " $x86_cpus " in
4046							*" ${val} "*)
4047								# OK
4048								;;
4049							*)
4050								echo "Unknown CPU given in --with-$which=$val." 1>&2
4051								exit 1
4052								;;
4053							esac
4054							;;
4055						*)
4056							echo "Unknown CPU given in --with-$which=$val." 1>&2
4057							exit 1
4058							;;
4059						esac
4060					;;
4061					esac
4062				fi
4063				;;
4064			esac
4065		done
4066		;;
4067
4068	mips*-*-*)
4069		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"
4070
4071		case ${with_float} in
4072		"" | soft | hard)
4073			# OK
4074			;;
4075		*)
4076			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4077			exit 1
4078			;;
4079		esac
4080
4081		case ${with_fpu} in
4082		"" | single | double)
4083			# OK
4084			;;
4085		*)
4086			echo "Unknown fpu type used in --with-fpu=$with_fpu" 1>&2
4087			exit 1
4088			;;
4089		esac
4090
4091		case ${with_nan} in
4092		"" | 2008 | legacy)
4093			# OK
4094			;;
4095		*)
4096			echo "Unknown NaN encoding used in --with-nan=$with_nan" 1>&2
4097			exit 1
4098			;;
4099		esac
4100
4101		case ${with_fp_32} in
4102		"" | 32 | xx | 64)
4103			# OK
4104			;;
4105		*)
4106			echo "Unknown FP mode used in --with-fp-32=$with_fp_32" 1>&2
4107			exit 1
4108			;;
4109		esac
4110
4111		case ${with_odd_spreg_32} in
4112		yes)
4113			with_odd_spreg_32="odd-spreg"
4114			;;
4115		no)
4116			with_odd_spreg_32="no-odd-spreg"
4117			;;
4118		"")
4119			# OK
4120			;;
4121		*)
4122			echo "Unknown odd-spreg-32 type used in --with-odd-spreg-32=$with_odd_spreg_32" 1>&2
4123			exit 1
4124			;;
4125		esac
4126
4127		case ${with_abi} in
4128		"" | 32 | o64 | n32 | 64 | eabi)
4129			# OK
4130			;;
4131		*)
4132			echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
4133			exit 1
4134			;;
4135		esac
4136
4137		case ${with_divide} in
4138		"" | breaks | traps)
4139			# OK
4140			;;
4141		*)
4142			echo "Unknown division check type use in --with-divide=$with_divide" 1>&2
4143			exit 1
4144			;;
4145		esac
4146
4147		case ${with_llsc} in
4148		yes)
4149			with_llsc=llsc
4150			;;
4151		no)
4152			with_llsc="no-llsc"
4153			;;
4154		"")
4155			# OK
4156			;;
4157		*)
4158			echo "Unknown llsc type used in --with-llsc" 1>&2
4159			exit 1
4160			;;
4161		esac
4162
4163		case ${with_mips_plt} in
4164		yes)
4165			with_mips_plt=plt
4166			;;
4167		no)
4168			with_mips_plt=no-plt
4169			;;
4170		"")
4171			;;
4172		*)
4173			echo "Unknown --with-mips-plt argument: $with_mips_plt" 1>&2
4174			exit 1
4175			;;
4176		esac
4177
4178		case ${with_synci} in
4179		yes)
4180			with_synci=synci
4181			;;
4182		no)
4183			with_synci=no-synci
4184			;;
4185		"")
4186			;;
4187		*)
4188			echo "Unknown synci type used in --with-synci" 1>&2
4189			exit 1
4190			;;
4191		esac
4192		;;
4193
4194	nds32*-*-*)
4195		supported_defaults="arch nds32_lib"
4196
4197		# process --with-arch
4198		case "${with_arch}" in
4199		"" | v2 | v3 | v3m)
4200			# OK
4201			;;
4202		*)
4203			echo "Cannot accept --with-arch=$with_arch, available values are: v2 v3 v3m" 1>&2
4204			exit 1
4205			;;
4206		esac
4207
4208		# process --with-nds32-lib
4209		case "${with_nds32_lib}" in
4210		"")
4211			# the default library is newlib
4212			with_nds32_lib=newlib
4213			;;
4214		newlib)
4215			# OK
4216			;;
4217		mculib)
4218			# OK
4219			;;
4220		*)
4221			echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib" 1>&2
4222			exit 1
4223			;;
4224		esac
4225		;;
4226
4227	powerpc*-*-* | rs6000-*-*)
4228		supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64"
4229
4230		for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
4231			eval "val=\$with_$which"
4232			case ${val} in
4233			default32 | default64)
4234				case $which in
4235				cpu | tune)
4236					;;
4237				*)
4238					echo "$val only valid for --with-cpu and --with-tune." 1>&2
4239					exit 1
4240					;;
4241				esac
4242				with_which="with_$which"
4243				eval $with_which=
4244				;;
4245			405cr)
4246				tm_defines="${tm_defines} CONFIG_PPC405CR"
4247				eval "with_$which=405"
4248				;;
4249			"" | common | native \
4250			| power | power[2345678] | power6x | powerpc | powerpc64 \
4251			| rios | rios1 | rios2 | rsc | rsc1 | rs64a \
4252			| 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
4253			| 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
4254			| 604 | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
4255			| a2 | e300c[23] | 854[08] | e500mc | e500mc64 | e5500 | e6500 \
4256			| titan | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
4257				# OK
4258				;;
4259			*)
4260				echo "Unknown cpu used in --with-$which=$val." 1>&2
4261				exit 1
4262				;;
4263			esac
4264		done
4265
4266		case "$with_abi" in
4267		"" | elfv1 | elfv2 )
4268			#OK
4269			;;
4270		*)
4271			echo "Unknown ABI used in --with-abi=$with_abi"
4272			exit 1
4273			;;
4274		esac
4275		;;
4276
4277	riscv*-*-*)
4278		supported_defaults="abi arch arch_32 arch_64 float tune tune_32 tune_64"
4279
4280		case ${with_float} in
4281		"" | soft | hard)
4282			# OK
4283			;;
4284		*)
4285			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4286			exit 1
4287			;;
4288		esac
4289
4290		case ${with_abi} in
4291		"" | 32 | 64)
4292			# OK
4293			;;
4294		*)
4295			echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
4296			exit 1
4297			;;
4298		esac
4299		;;
4300
4301	s390*-*-*)
4302		supported_defaults="arch mode tune"
4303
4304		for which in arch tune; do
4305			eval "val=\$with_$which"
4306			case ${val} in
4307			"" | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13)
4308				# OK
4309				;;
4310			*)
4311				echo "Unknown cpu used in --with-$which=$val." 1>&2
4312				exit 1
4313				;;
4314			esac
4315		done
4316
4317		case ${with_mode} in
4318		"" | esa | zarch)
4319			# OK
4320			;;
4321		*)
4322			echo "Unknown architecture mode used in --with-mode=$with_mode." 1>&2
4323			exit 1
4324			;;
4325		esac
4326		;;
4327
4328	sh[123456ble]-*-* | sh-*-*)
4329		supported_defaults="cpu"
4330		case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in
4331		"" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
4332			# OK
4333			;;
4334		m2a | m2a-single | m2a-single-only | m2a-nofpu)
4335			;;
4336		m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
4337		        ;;
4338		*)
4339			echo "Unknown CPU used in --with-cpu=$with_cpu, known values:"  1>&2
4340			echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
4341			echo "m4a m4a-single m4a-single-only m4a-nofpu m4al" 1>&2
4342			echo "m2a m2a-single m2a-single-only m2a-nofpu" 1>&2
4343			exit 1
4344			;;
4345		esac
4346		;;
4347	sparc*-*-*)
4348		supported_defaults="cpu float tune"
4349
4350		for which in cpu tune; do
4351			eval "val=\$with_$which"
4352			case ${val} in
4353			"" | sparc | sparcv9 | sparc64 \
4354			| v7 | cypress \
4355			| v8 | supersparc | hypersparc | leon | leon3 | leon3v7 \
4356			| sparclite | f930 | f934 | sparclite86x \
4357			| sparclet | tsc701 \
4358			| v9 | ultrasparc | ultrasparc3 | niagara | niagara2 \
4359			| niagara3 | niagara4)
4360				# OK
4361				;;
4362			*)
4363				echo "Unknown cpu used in --with-$which=$val" 1>&2
4364				exit 1
4365				;;
4366			esac
4367		done
4368
4369		case ${with_float} in
4370		"" | soft | hard)
4371			# OK
4372			;;
4373		*)
4374			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
4375			exit 1
4376			;;
4377		esac
4378		;;
4379
4380	spu-*-*)
4381		supported_defaults="arch tune"
4382
4383		for which in arch tune; do
4384			eval "val=\$with_$which"
4385			case ${val} in
4386			"" | cell | celledp)
4387				# OK
4388				;;
4389			*)
4390				echo "Unknown cpu used in --with-$which=$val." 1>&2
4391				exit 1
4392				;;
4393			esac
4394		done
4395		;;
4396
4397	tic6x-*-*)
4398		supported_defaults="arch"
4399
4400		case ${with_arch} in
4401		"" | c62x | c64x | c64x+ | c67x | c67x+ | c674x)
4402			# OK
4403			;;
4404		*)
4405			echo "Unknown arch used in --with-arch=$with_arch." 1>&2
4406			exit 1
4407			;;
4408		esac
4409		;;
4410
4411	v850*-*-*)
4412		supported_defaults=cpu
4413		case ${with_cpu} in
4414		"" | v850e | v850e1 | v850e2 | v850es | v850e2v3 | v850e3v5)
4415			# OK
4416			;;
4417		*)
4418			echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4419			exit 1
4420			;;
4421		esac
4422		;;
4423esac
4424
4425# Set some miscellaneous flags for particular targets.
4426target_cpu_default2=
4427case ${target} in
4428	aarch64*-*-*)
4429		if test x"$target_cpu_cname" != x
4430		then
4431			target_cpu_default2=$target_cpu_cname
4432		fi
4433		;;
4434
4435	arm*-*-*)
4436		if test x$target_cpu_cname = x
4437		then
4438			target_cpu_default2=TARGET_CPU_generic
4439		else
4440			target_cpu_default2=TARGET_CPU_$target_cpu_cname
4441		fi
4442		;;
4443
4444	hppa*-*-*)
4445		if test x$gas = xyes
4446		then
4447			target_cpu_default2="MASK_GAS"
4448		fi
4449		;;
4450
4451	fido*-*-* | m68k*-*-*)
4452		target_cpu_default2=$m68k_cpu_ident
4453		tmake_file="m68k/t-opts $tmake_file"
4454		if [ x"$m68k_arch_family" != x ]; then
4455		        tmake_file="m68k/t-$m68k_arch_family $tmake_file"
4456		fi
4457		;;
4458
4459	i[34567]86-*-darwin* | x86_64-*-darwin*)
4460		;;
4461	i[34567]86-*-linux* | x86_64-*-linux*)
4462		tmake_file="$tmake_file i386/t-linux"
4463		;;
4464	i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
4465		tmake_file="$tmake_file i386/t-kfreebsd"
4466		;;
4467	i[34567]86-*-gnu*)
4468		tmake_file="$tmake_file i386/t-gnu"
4469		;;
4470	i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
4471		;;
4472	i[34567]86-*-cygwin* | x86_64-*-cygwin*)
4473		;;
4474	i[34567]86-*-mingw* | x86_64-*-mingw*)
4475		;;
4476	i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
4477		;;
4478	i[34567]86-*-freebsd* | x86_64-*-freebsd*)
4479		;;
4480	ia64*-*-linux*)
4481		;;
4482
4483	mips*-*-*)
4484		if test x$gnu_ld = xyes
4485		then
4486			target_cpu_default2="MASK_SPLIT_ADDRESSES"
4487		fi
4488		case ${target} in
4489			mips*el-*-*)
4490				tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
4491				;;
4492		esac
4493		if test x$with_arch != x; then
4494			default_mips_arch=$with_arch
4495		fi
4496		if test x$with_abi != x; then
4497			default_mips_abi=$with_abi
4498		fi
4499		case ${default_mips_arch} in
4500		    mips1)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=1" ;;
4501		    mips2)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=2" ;;
4502		    mips3)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=3" ;;
4503		    mips4)    tm_defines="$tm_defines MIPS_ISA_DEFAULT=4" ;;
4504		    mips32)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=32" ;;
4505		    mips32r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=33" ;;
4506		    mips32r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=37" ;;
4507		    mips64)   tm_defines="$tm_defines MIPS_ISA_DEFAULT=64" ;;
4508		    mips64r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=65" ;;
4509		    mips64r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=69" ;;
4510		esac
4511		case ${default_mips_abi} in
4512		    32)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_32" ;;
4513		    o64)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_O64" ;;
4514		    n32)  tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_N32" ;;
4515		    64)   tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_64" ;;
4516		    eabi) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_EABI" ;;
4517		esac
4518		tmake_file="mips/t-mips $tmake_file"
4519		;;
4520
4521	powerpc*-*-* | rs6000-*-*)
4522		# FIXME: The PowerPC port uses the value set at compile time,
4523		# although it's only cosmetic.
4524		if test "x$with_cpu" != x
4525		then
4526			target_cpu_default2="\\\"$with_cpu\\\""
4527		fi
4528		out_file=rs6000/rs6000.c
4529		c_target_objs="${c_target_objs} rs6000-c.o"
4530		cxx_target_objs="${cxx_target_objs} rs6000-c.o"
4531		tmake_file="rs6000/t-rs6000 ${tmake_file}"
4532		;;
4533
4534	sh[123456ble]*-*-* | sh-*-*)
4535		c_target_objs="${c_target_objs} sh-c.o"
4536		cxx_target_objs="${cxx_target_objs} sh-c.o"
4537		;;
4538
4539	sparc*-*-*)
4540		# Some standard aliases.
4541		case x$with_cpu in
4542		xsparc)
4543			with_cpu=v7
4544			;;
4545		xsparcv9 | xsparc64)
4546			with_cpu=v9
4547			;;
4548		esac
4549
4550		if test x$with_tune = x ; then
4551		      case ${target} in
4552		      *-leon-*)
4553			  with_tune=leon
4554			  ;;
4555		      *-leon[3-9]*)
4556			  with_tune=leon3
4557			  ;;
4558		      esac
4559		fi
4560
4561		# The SPARC port checks this value at compile-time.
4562		target_cpu_default2="TARGET_CPU_$with_cpu"
4563		;;
4564
4565	v850*-*-*)
4566		case "x$with_cpu" in
4567		x)
4568			;;
4569		xv850e | xv850e1 | xv850e2 | xv850e2v3 | xv850e3v5)
4570			target_cpu_default2="TARGET_CPU_$with_cpu"
4571			;;
4572		xv850es)
4573			target_cpu_default2="TARGET_CPU_v850e1"
4574			;;
4575		esac
4576		;;
4577esac
4578
4579t=
4580all_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"
4581for option in $all_defaults
4582do
4583	eval "val=\$with_"`echo $option | sed s/-/_/g`
4584	if test -n "$val"; then
4585		case " $supported_defaults " in
4586		*" $option "*)
4587			;;
4588		*)
4589			echo "This target does not support --with-$option." 2>&1
4590			echo "Valid --with options are: $supported_defaults" 2>&1
4591			exit 1
4592			;;
4593		esac
4594
4595		if test "x$t" = x
4596		then
4597			t="{ \"$option\", \"$val\" }"
4598		else
4599			t="${t}, { \"$option\", \"$val\" }"
4600		fi
4601	fi
4602done
4603
4604if test "x$t" = x
4605then
4606	configure_default_options="{ { NULL, NULL} }"
4607else
4608	configure_default_options="{ ${t} }"
4609fi
4610
4611if test "$target_cpu_default2" != ""
4612then
4613	if test "$target_cpu_default" != ""
4614	then
4615		target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
4616	else
4617		target_cpu_default=$target_cpu_default2
4618	fi
4619fi
4620
4621case ${target} in
4622i[34567]86-*-* | x86_64-*-*)
4623	if test x$enable_as_accelerator = xyes; then
4624		extra_programs="mkoffload\$(exeext)"
4625	fi
4626	;;
4627esac
4628