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