config.gcc revision 1.25
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"
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	tm_file="${tm_file} rs6000/sysv4.h"
2131	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2132	if test x${enable_secureplt} != xno; then
2133	  tm_file="rs6000/secureplt.h ${tm_file}"
2134	fi
2135	extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
2136	;;
2137powerpc-*-eabispe*)
2138	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"
2139	extra_options="${extra_options} rs6000/sysv4.opt"
2140	tmake_file="rs6000/t-spe rs6000/t-ppccomm"
2141	use_gcc_stdint=wrap
2142	;;
2143powerpc-*-eabisimaltivec*)
2144	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"
2145	extra_options="${extra_options} rs6000/sysv4.opt"
2146	tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
2147	use_gcc_stdint=wrap
2148	;;
2149powerpc-*-eabisim*)
2150	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"
2151	extra_options="${extra_options} rs6000/sysv4.opt"
2152	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2153	use_gcc_stdint=wrap
2154	;;
2155powerpc-*-elf*)
2156	tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h"
2157	extra_options="${extra_options} rs6000/sysv4.opt"
2158	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2159	;;
2160powerpc-*-eabialtivec*)
2161	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"
2162	extra_options="${extra_options} rs6000/sysv4.opt"
2163	tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
2164	use_gcc_stdint=wrap
2165	;;
2166powerpc-xilinx-eabi*)
2167	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"
2168	extra_options="${extra_options} rs6000/sysv4.opt rs6000/xilinx.opt"
2169	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm rs6000/t-xilinx"
2170	use_gcc_stdint=wrap
2171	;;
2172powerpc-*-eabi*)
2173	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"
2174	extra_options="${extra_options} rs6000/sysv4.opt"
2175	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2176	use_gcc_stdint=wrap
2177	;;
2178powerpc-*-rtems*)
2179	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"
2180	extra_options="${extra_options} rs6000/sysv4.opt"
2181	tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
2182	;;
2183powerpc*-*-linux*)
2184	tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
2185	extra_options="${extra_options} rs6000/sysv4.opt"
2186	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
2187	case ${target} in
2188	    powerpc*le-*-*)
2189		tm_file="${tm_file} rs6000/sysv4le.h" ;;
2190	esac
2191	maybe_biarch=yes
2192	case ${target} in
2193	    powerpc64*-*-linux*spe* | powerpc64*-*-linux*paired*)
2194	    	echo "*** Configuration ${target} not supported" 1>&2
2195		exit 1
2196		;;
2197	    powerpc*-*-linux*spe* | powerpc*-*-linux*paired*)
2198		maybe_biarch=
2199		;;
2200	    powerpc64*-*-linux*)
2201	    	test x$with_cpu != x || cpu_is_64bit=yes
2202		maybe_biarch=always
2203		;;
2204	esac
2205	case ${maybe_biarch}:${enable_targets}:${cpu_is_64bit} in
2206	    always:* | yes:*powerpc64* | yes:all:* | yes:*:yes)
2207		if test x$cpu_is_64bit = xyes; then
2208		    tm_file="${tm_file} rs6000/default64.h"
2209		fi
2210		tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h glibc-stdint.h"
2211		tmake_file="$tmake_file rs6000/t-linux64"
2212		case ${target} in
2213		    powerpc*le-*-*)
2214			tmake_file="$tmake_file rs6000/t-linux64le"
2215			case ${enable_targets} in
2216			    all | *powerpc64-* | *powerpc-*)
2217				tmake_file="$tmake_file rs6000/t-linux64lebe" ;;
2218			esac ;;
2219		    *)
2220			case ${enable_targets} in
2221			    all | *powerpc64le-* | *powerpcle-*)
2222				tmake_file="$tmake_file rs6000/t-linux64bele" ;;
2223			esac ;;
2224		esac
2225		extra_options="${extra_options} rs6000/linux64.opt"
2226		;;
2227	    *)
2228		tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
2229		tmake_file="$tmake_file rs6000/t-linux"
2230		;;
2231	esac
2232	case ${target} in
2233	    powerpc*-*-linux*ppc476*)
2234		tm_file="${tm_file} rs6000/476.h"
2235		extra_options="${extra_options} rs6000/476.opt" ;;
2236	    powerpc*-*-linux*altivec*)
2237		tm_file="${tm_file} rs6000/linuxaltivec.h" ;;
2238	    powerpc*-*-linux*spe*)
2239		tm_file="${tm_file} rs6000/linuxspe.h rs6000/e500.h" ;;
2240	    powerpc*-*-linux*paired*)
2241		tm_file="${tm_file} rs6000/750cl.h" ;;
2242	esac
2243	if test x${enable_secureplt} = xyes; then
2244		tm_file="rs6000/secureplt.h ${tm_file}"
2245	fi
2246	;;
2247powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
2248	tm_file="${tm_file} elfos.h freebsd-spec.h rs6000/sysv4.h"
2249	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
2250	extra_options="${extra_options} rs6000/sysv4.opt"
2251	extra_headers=ppc-asm.h
2252	case ${target} in
2253	  *-vxworksae*)
2254	    tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/e500.h"
2255	    tmake_file="${tmake_file} rs6000/t-vxworksae"
2256	    ;;
2257	  *-vxworks*)
2258	    tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h rs6000/e500.h"
2259	    ;;
2260	esac
2261	;;
2262powerpc-*-lynxos*)
2263	xm_defines=POSIX
2264	tm_file="${tm_file} dbxelf.h elfos.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
2265	tmake_file="t-lynx rs6000/t-lynx"
2266	extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
2267	thread_file=lynx
2268	gnu_ld=yes
2269	gas=yes
2270	;;
2271powerpcle-*-elf*)
2272	tm_file="${tm_file} dbxelf.h elfos.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h"
2273	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2274	extra_options="${extra_options} rs6000/sysv4.opt"
2275	;;
2276powerpcle-*-eabisim*)
2277	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"
2278	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2279	extra_options="${extra_options} rs6000/sysv4.opt"
2280	use_gcc_stdint=wrap
2281	;;
2282powerpcle-*-eabi*)
2283	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"
2284	tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
2285	extra_options="${extra_options} rs6000/sysv4.opt"
2286	use_gcc_stdint=wrap
2287	;;
2288rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
2289	tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h rs6000/aix-stdint.h"
2290	tmake_file="rs6000/t-aix43 t-slibgcc"
2291	extra_options="${extra_options} rs6000/aix64.opt"
2292	use_collect2=yes
2293	thread_file='aix'
2294	use_gcc_stdint=provide
2295	extra_headers=
2296	;;
2297rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*)
2298	tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h rs6000/aix-stdint.h"
2299	extra_options="${extra_options} rs6000/aix64.opt"
2300	tmake_file="rs6000/t-aix43 t-slibgcc"
2301	use_collect2=yes
2302	thread_file='aix'
2303	use_gcc_stdint=wrap
2304	extra_headers=
2305	;;
2306rs6000-ibm-aix5.2.* | powerpc-ibm-aix5.2.*)
2307	tm_file="${tm_file} rs6000/aix.h rs6000/aix52.h rs6000/xcoff.h rs6000/aix-stdint.h"
2308	tmake_file="rs6000/t-aix52 t-slibgcc"
2309	extra_options="${extra_options} rs6000/aix64.opt"
2310	use_collect2=yes
2311	thread_file='aix'
2312	use_gcc_stdint=wrap
2313	extra_headers=
2314	;;
2315rs6000-ibm-aix5.3.* | powerpc-ibm-aix5.3.*)
2316	tm_file="${tm_file} rs6000/aix.h rs6000/aix53.h rs6000/xcoff.h rs6000/aix-stdint.h"
2317	tmake_file="rs6000/t-aix52 t-slibgcc"
2318	extra_options="${extra_options} rs6000/aix64.opt"
2319	use_collect2=yes
2320	thread_file='aix'
2321	use_gcc_stdint=wrap
2322	extra_headers=altivec.h
2323	;;
2324rs6000-ibm-aix[6789].* | powerpc-ibm-aix[6789].*)
2325	tm_file="${tm_file} rs6000/aix.h rs6000/aix61.h rs6000/xcoff.h rs6000/aix-stdint.h"
2326	tmake_file="rs6000/t-aix52 t-slibgcc"
2327	extra_options="${extra_options} rs6000/aix64.opt"
2328	use_collect2=yes
2329	thread_file='aix'
2330	use_gcc_stdint=wrap
2331	extra_headers=altivec.h
2332	;;
2333rl78-*-elf*)
2334	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2335	target_has_targetm_common=no
2336	c_target_objs="rl78-c.o"
2337	cxx_target_objs="rl78-c.o"
2338	tmake_file="${tmake_file} rl78/t-rl78"
2339	;;
2340rx-*-elf*)
2341	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2342	tmake_file="${tmake_file} rx/t-rx"
2343	;;
2344s390-*-linux*)
2345	default_gnu_indirect_function=yes
2346	tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
2347	if test x$enable_targets = xall; then
2348		tmake_file="${tmake_file} s390/t-linux64"
2349	fi
2350	;;
2351s390x-*-linux*)
2352	default_gnu_indirect_function=yes
2353	tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
2354	tm_p_file=s390/s390-protos.h
2355	md_file=s390/s390.md
2356	extra_modes=s390/s390-modes.def
2357	out_file=s390/s390.c
2358	tmake_file="${tmake_file} s390/t-linux64"
2359	;;
2360s390x-ibm-tpf*)
2361        tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h s390/tpf.h"
2362        tm_p_file=s390/s390-protos.h
2363        md_file=s390/s390.md
2364        extra_modes=s390/s390-modes.def
2365        out_file=s390/s390.c
2366        thread_file='tpf'
2367	extra_options="${extra_options} s390/tpf.opt"
2368	;;
2369score-*-elf)
2370	gas=yes
2371	gnu_ld=yes
2372        tm_file="dbxelf.h elfos.h score/elf.h score/score.h newlib-stdint.h"
2373        ;;
2374sh-*-elf* | sh[12346l]*-*-elf* | \
2375  sh-*-linux* | sh[2346lbe]*-*-linux* | \
2376  sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
2377  sh64-*-netbsd* | sh64l*-*-netbsd*)
2378	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
2379	if test x${with_endian} = x; then
2380		case ${target} in
2381		sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
2382		shbe-*-* | sheb-*-*)		   with_endian=big,little ;;
2383		sh[1234]l* | sh[34]*-*-linux*)	   with_endian=little ;;
2384		shl* | sh64l* | sh*-*-linux* | \
2385		  sh5l* | sh-superh-elf)	   with_endian=little,big ;;
2386		sh[1234]*-*-*)			   with_endian=big ;;
2387		*)				   with_endian=big,little ;;
2388		esac
2389	fi
2390	# TM_ENDIAN_CONFIG is used by t-sh to determine multilibs.
2391	#  First word : the default endian.
2392	#  Second word: the secondary endian (optional).
2393	case ${with_endian} in
2394	big)		TM_ENDIAN_CONFIG=mb ;;
2395	little)		TM_ENDIAN_CONFIG=ml ;;
2396	big,little)	TM_ENDIAN_CONFIG="mb ml" ;;
2397	little,big)	TM_ENDIAN_CONFIG="ml mb" ;;
2398	*)	echo "with_endian=${with_endian} not supported."; exit 1 ;;
2399	esac
2400	case ${with_endian} in
2401	little*)	tm_file="sh/little.h ${tm_file}" ;;
2402	esac
2403	tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h"
2404	case ${target} in
2405	sh*-*-linux*)	tmake_file="${tmake_file} sh/t-linux"
2406			tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
2407	sh*-*-netbsd*)
2408			tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
2409			extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2410
2411			;;
2412	sh*-superh-elf)	if test x$with_libgloss != xno; then
2413                                with_libgloss=yes
2414                                tm_file="${tm_file} sh/newlib.h"
2415                        fi
2416			tm_file="${tm_file} sh/embed-elf.h"
2417			tm_file="${tm_file} sh/superh.h"
2418			extra_options="${extra_options} sh/superh.opt" ;;
2419	*)		if test x$with_newlib = xyes \
2420			   && test x$with_libgloss = xyes; then
2421				tm_file="${tm_file} sh/newlib.h"
2422			fi
2423			tm_file="${tm_file} sh/embed-elf.h" ;;
2424	esac
2425	case ${target} in
2426	sh5*-*-netbsd*)
2427		# SHmedia, 32-bit ABI
2428		tmake_file="${tmake_file} sh/t-sh64"
2429		;;
2430	sh64*-netbsd*)
2431		# SHmedia, 64-bit ABI
2432		tmake_file="${tmake_file} sh/t-sh64 sh/t-netbsd-sh5-64"
2433		;;
2434	*-*-netbsd*)
2435                tmake_file="${tmake_file} sh/t-netbsd"
2436		;;
2437	sh64*-*-linux*)
2438		tmake_file="${tmake_file} sh/t-sh64"
2439		tm_file="${tm_file} sh/sh64.h"
2440		extra_headers="shmedia.h ushmedia.h sshmedia.h"
2441		;;
2442	sh64*)
2443		tmake_file="${tmake_file} sh/t-sh64"
2444		tm_file="${tm_file} sh/sh64.h"
2445		if test x$with_newlib = xyes; then
2446			tm_file="${tm_file} newlib-stdint.h"
2447		fi
2448		extra_headers="shmedia.h ushmedia.h sshmedia.h"
2449		;;
2450	*-*-elf*)
2451		tm_file="${tm_file} newlib-stdint.h"
2452		;;
2453	esac
2454	# sed el/eb endian suffixes away to avoid confusion with sh[23]e
2455	case `echo ${target} | sed 's/e[lb]-/-/'` in
2456	sh64*-*-netbsd*)	sh_cpu_target=sh5-64media ;;
2457	sh64* | sh5*-*-netbsd*)	sh_cpu_target=sh5-32media ;;
2458	sh4a_single_only*)	sh_cpu_target=sh4a-single-only ;;
2459	sh4a_single*)		sh_cpu_target=sh4a-single ;;
2460	sh4a_nofpu*)		sh_cpu_target=sh4a-nofpu ;;
2461	sh4al)			sh_cpu_target=sh4al ;;
2462	sh4a*)			sh_cpu_target=sh4a ;;
2463	sh4_single_only*)	sh_cpu_target=sh4-single-only ;;
2464	sh4_single*)		sh_cpu_target=sh4-single ;;
2465	sh4_nofpu*)		sh_cpu_target=sh4-nofpu ;;
2466	sh4* | sh-superh-*)	sh_cpu_target=sh4 ;;
2467	sh3e*)			sh_cpu_target=sh3e ;;
2468	sh*-*-netbsd* | sh3*)	sh_cpu_target=sh3 ;;
2469	sh2a_single_only*)	sh_cpu_target=sh2a-single-only ;;
2470	sh2a_single*)		sh_cpu_target=sh2a-single ;;
2471	sh2a_nofpu*)		sh_cpu_target=sh2a-nofpu ;;
2472	sh2a*)			sh_cpu_target=sh2a ;;
2473	sh2e*)			sh_cpu_target=sh2e ;;
2474	sh2*)			sh_cpu_target=sh2 ;;
2475	*)			sh_cpu_target=sh1 ;;
2476	esac
2477	# did the user say --without-fp ?
2478	if test x$with_fp = xno; then
2479		case ${sh_cpu_target} in
2480		sh5-*media)	sh_cpu_target=${sh_cpu_target}-nofpu ;;
2481		sh4al | sh1)	;;
2482		sh4a* )		sh_cpu_target=sh4a-nofpu ;;
2483		sh4*)		sh_cpu_target=sh4-nofpu ;;
2484		sh3*)		sh_cpu_target=sh3 ;;
2485		sh2a*)		sh_cpu_target=sh2a-nofpu ;;
2486		sh2*)		sh_cpu_target=sh2 ;;
2487		*)	echo --without-fp not available for $target: ignored
2488		esac
2489		tm_defines="$tm_defines STRICT_NOFPU=1"
2490	fi
2491	sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr A-Z_ a-z-`"
2492	case $sh_cpu_default in
2493	sh5-64media-nofpu | sh5-64media | \
2494	  sh5-32media-nofpu | sh5-32media | sh5-compact-nofpu | sh5-compact | \
2495	  sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
2496	  sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
2497	  sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
2498	  sh3e | sh3 | sh2e | sh2 | sh1) ;;
2499	"")	sh_cpu_default=${sh_cpu_target} ;;
2500	*)	echo "with_cpu=$with_cpu not supported"; exit 1 ;;
2501	esac
2502	sh_multilibs=${with_multilib_list}
2503	if test "$sh_multilibs" = "default" ; then
2504		case ${target} in
2505		sh64-superh-linux* | \
2506		sh[1234]*)	sh_multilibs=${sh_cpu_target} ;;
2507		sh64* | sh5*)	sh_multilibs=m5-32media,m5-32media-nofpu,m5-compact,m5-compact-nofpu,m5-64media,m5-64media-nofpu ;;
2508		sh-superh-*)	sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
2509		sh*-*-linux*)	sh_multilibs=m1,m2,m2a,m3e,m4 ;;
2510		sh*-*-netbsd*)	sh_multilibs=m3,m3e,m4 ;;
2511		*) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
2512		esac
2513		if test x$with_fp = xno; then
2514			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`"
2515		fi
2516	fi
2517	target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
2518	tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
2519	tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
2520	sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^[Ss][Hh]/m/' -e 's/ [Ss][Hh]/ m/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
2521	for sh_multilib in ${sh_multilibs}; do
2522		case ${sh_multilib} in
2523		m1 | m2 | m2e | m3 | m3e | \
2524		m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
2525		m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
2526		m2a | m2a-single | m2a-single-only | m2a-nofpu | \
2527		m5-64media | m5-64media-nofpu | \
2528		m5-32media | m5-32media-nofpu | \
2529		m5-compact | m5-compact-nofpu)
2530			# TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
2531			# It is passed to MULTIILIB_OPTIONS verbatim.
2532			TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
2533			tm_defines="$tm_defines SUPPORT_`echo $sh_multilib | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
2534			;;
2535		\!*)	# TM_MULTILIB_EXCEPTIONS_CONFIG is used by t-sh
2536			# It is passed the MULTILIB_EXCEPTIONS verbatim.
2537			TM_MULTILIB_EXCEPTIONS_CONFIG="${TM_MULTILIB_EXCEPTIONS_CONFIG} `echo $sh_multilib | sed 's/^!//'`" ;;
2538		*)
2539			echo "with_multilib_list=${sh_multilib} not supported."
2540			exit 1
2541			;;
2542		esac
2543	done
2544	TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
2545	if test x${enable_incomplete_targets} = xyes ; then
2546		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"
2547	fi
2548	tm_file="$tm_file ./sysroot-suffix.h"
2549	tmake_file="$tmake_file t-sysroot-suffix"
2550	;;
2551sh-*-rtems*)
2552	tmake_file="sh/t-sh t-rtems sh/t-rtems"
2553	tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
2554	;;
2555sh-wrs-vxworks)
2556	tmake_file="$tmake_file sh/t-sh sh/t-vxworks"
2557	tm_file="${tm_file} elfos.h sh/elf.h sh/embed-elf.h vx-common.h vxworks.h sh/vxworks.h"
2558	;;
2559sparc-*-elf*)
2560	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
2561	case ${target} in
2562	    *-leon-*)
2563		tmake_file="sparc/t-sparc sparc/t-leon"
2564		;;
2565	    *-leon[3-9]*)
2566		tmake_file="sparc/t-sparc sparc/t-leon3"
2567		;;
2568	    *)
2569		tmake_file="sparc/t-sparc sparc/t-elf"
2570		;;
2571	esac
2572	;;
2573sparc-*-rtems*)
2574	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
2575	tmake_file="sparc/t-sparc sparc/t-elf sparc/t-rtems t-rtems"
2576	;;
2577sparc-*-linux*)
2578	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
2579	extra_options="${extra_options} sparc/long-double-switch.opt"
2580	case ${target} in
2581	    *-leon-*)
2582		tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon"
2583		;;
2584	    *-leon[3-9]*)
2585		tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon3"
2586		;;
2587	    *)
2588		tmake_file="${tmake_file} sparc/t-sparc"
2589		;;
2590	esac
2591	if test x$enable_targets = xall; then
2592		tm_file="sparc/biarch64.h ${tm_file} sparc/linux64.h"
2593		tmake_file="${tmake_file} sparc/t-linux64"
2594	else
2595		tm_file="${tm_file} sparc/linux.h"
2596		tmake_file="${tmake_file} sparc/t-linux"
2597	fi
2598	;;
2599sparc-*-netbsdelf*)
2600	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
2601	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2602	extra_options="${extra_options} sparc/long-double-switch.opt"
2603	tmake_file="${tmake_file} sparc/t-sparc"
2604	;;
2605sparc*-*-solaris2*)
2606	tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sol2-bi.h sparc/tso.h"
2607	case ${target} in
2608	    sparc64-*-* | sparcv9-*-*)
2609		tm_file="sparc/default-64.h ${tm_file}"
2610		;;
2611	    *)
2612		test x$with_cpu != x || with_cpu=v9
2613		;;
2614	esac
2615	tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2-64"
2616	;;
2617sparc-wrs-vxworks)
2618	tm_file="${tm_file} elfos.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
2619	tmake_file="${tmake_file} sparc/t-sparc sparc/t-vxworks"
2620	;;
2621sparc64-*-elf*)
2622	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h"
2623	extra_options="${extra_options}"
2624	tmake_file="${tmake_file} sparc/t-sparc"
2625	;;
2626sparc64-*-rtems*)
2627	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
2628	extra_options="${extra_options}"
2629	tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64 t-rtems"
2630	;;
2631sparc64-*-linux*)
2632	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"
2633	extra_options="${extra_options} sparc/long-double-switch.opt"
2634	tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
2635	;;
2636sparc64-*-freebsd*|ultrasparc-*-freebsd*)
2637	tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
2638	extra_options="${extra_options} sparc/long-double-switch.opt"
2639	case "x$with_cpu" in
2640		xultrasparc) ;;
2641		x) with_cpu=ultrasparc ;;
2642		*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
2643	esac
2644	tmake_file="${tmake_file} sparc/t-sparc"
2645	;;
2646sparc64-*-netbsd*)
2647	tm_file="sparc/biarch64.h ${tm_file}"
2648	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
2649	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
2650	extra_options="${extra_options} sparc/long-double-switch.opt"
2651	tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
2652	with_cpu=ultrasparc
2653	;;
2654sparc64-*-openbsd*)
2655	tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
2656	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
2657	extra_options="${extra_options} openbsd.opt"
2658	extra_options="${extra_options}"
2659	gas=yes gnu_ld=yes
2660	with_cpu=ultrasparc
2661	tmake_file="${tmake_file} sparc/t-sparc"
2662	;;
2663spu-*-elf*)
2664	tm_file="dbxelf.h elfos.h spu/spu-elf.h spu/spu.h newlib-stdint.h"
2665	tmake_file="spu/t-spu-elf"
2666        native_system_header_dir=/include
2667	extra_headers="spu_intrinsics.h spu_internals.h vmx2spu.h spu_mfcio.h vec_types.h spu_cache.h"
2668	extra_modes=spu/spu-modes.def
2669	c_target_objs="${c_target_objs} spu-c.o"
2670	cxx_target_objs="${cxx_target_objs} spu-c.o"
2671	;;
2672tic6x-*-elf)
2673	tm_file="elfos.h ${tm_file} c6x/elf-common.h c6x/elf.h"
2674	tm_file="${tm_file} dbxelf.h tm-dwarf2.h newlib-stdint.h"
2675	tmake_file="c6x/t-c6x c6x/t-c6x-elf"
2676	use_collect2=no
2677	;;
2678tic6x-*-uclinux)
2679	tm_file="elfos.h ${tm_file} gnu-user.h linux.h c6x/elf-common.h c6x/uclinux-elf.h"
2680	tm_file="${tm_file} dbxelf.h tm-dwarf2.h glibc-stdint.h"
2681	tm_file="${tm_file} ./sysroot-suffix.h"
2682	tmake_file="t-sysroot-suffix t-slibgcc"
2683	tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
2684	use_collect2=no
2685	;;
2686tilegx-*-linux*)
2687	tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilegx/linux.h ${tm_file}"
2688        tmake_file="${tmake_file} tilegx/t-tilegx"
2689	extra_objs="mul-tables.o"
2690	c_target_objs="${c_target_objs} tilegx-c.o"
2691	cxx_target_objs="${cxx_target_objs} tilegx-c.o"
2692	extra_headers="feedback.h"
2693	;;
2694tilepro-*-linux*)
2695	tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilepro/linux.h ${tm_file}"
2696        tmake_file="${tmake_file} tilepro/t-tilepro"
2697	extra_objs="mul-tables.o"
2698	c_target_objs="${c_target_objs} tilepro-c.o"
2699	cxx_target_objs="${cxx_target_objs} tilepro-c.o"
2700	extra_headers="feedback.h"
2701	;;
2702v850-*-rtems*)
2703	target_cpu_default="TARGET_CPU_generic"
2704	tm_file="dbxelf.h elfos.h v850/v850.h"
2705	tm_file="${tm_file} rtems.h v850/rtems.h newlib-stdint.h"
2706	tmake_file="${tmake_file} v850/t-v850"
2707	tmake_file="${tmake_file} t-rtems v850/t-rtems"
2708	use_collect2=no
2709	c_target_objs="v850-c.o"
2710	cxx_target_objs="v850-c.o"
2711	;;
2712v850*-*-*)
2713	case ${target} in
2714	v850e3v5-*-*)
2715		target_cpu_default="TARGET_CPU_v850e3v5"
2716		;;
2717	v850e2v3-*-*)
2718		target_cpu_default="TARGET_CPU_v850e2v3"
2719		;;
2720	v850e2-*-*)
2721		target_cpu_default="TARGET_CPU_v850e2"
2722		;;
2723	v850e1-*-* | v850es-*-*)
2724		target_cpu_default="TARGET_CPU_v850e1"
2725		;;
2726	v850e-*-*)
2727		target_cpu_default="TARGET_CPU_v850e"
2728		;;
2729	v850-*-*)
2730		target_cpu_default="TARGET_CPU_generic"
2731		;;
2732	esac
2733	tm_file="dbxelf.h elfos.h newlib-stdint.h v850/v850.h"
2734	if test x$stabs = xyes
2735	then
2736		tm_file="${tm_file} dbx.h"
2737	fi
2738	use_collect2=no
2739	c_target_objs="v850-c.o"
2740	cxx_target_objs="v850-c.o"
2741	use_gcc_stdint=wrap
2742	;;
2743vax-*-linux*)
2744	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
2745	extra_options="${extra_options} vax/elf.opt"
2746	;;
2747vax-*-netbsdelf*)
2748	tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
2749	extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
2750	;;
2751vax-*-openbsd*)
2752	tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-pthread.h vax/openbsd.h"
2753	extra_options="${extra_options} openbsd.opt"
2754	use_collect2=yes
2755	;;
2756xstormy16-*-elf)
2757	# For historical reasons, the target files omit the 'x'.
2758	tm_file="dbxelf.h elfos.h newlib-stdint.h stormy16/stormy16.h"
2759	tm_p_file=stormy16/stormy16-protos.h
2760	md_file=stormy16/stormy16.md
2761	out_file=stormy16/stormy16.c
2762	extra_options=stormy16/stormy16.opt
2763	tmake_file="stormy16/t-stormy16"
2764	;;
2765xtensa*-*-elf*)
2766	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h"
2767	extra_options="${extra_options} xtensa/elf.opt"
2768	;;
2769xtensa*-*-linux*)
2770	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
2771	tmake_file="${tmake_file} xtensa/t-xtensa"
2772	;;
2773am33_2.0-*-linux*)
2774	tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
2775	gas=yes gnu_ld=yes
2776	use_collect2=no
2777	;;
2778m32c-*-rtems*)
2779	tm_file="dbxelf.h elfos.h ${tm_file} m32c/rtems.h rtems.h newlib-stdint.h"
2780	tmake_file="${tmake_file} t-rtems"
2781	c_target_objs="m32c-pragma.o"
2782	cxx_target_objs="m32c-pragma.o"
2783 	;;
2784m32c-*-elf*)
2785	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2786	c_target_objs="m32c-pragma.o"
2787	cxx_target_objs="m32c-pragma.o"
2788 	;;
2789*)
2790	echo "*** Configuration ${target} not supported" 1>&2
2791	exit 1
2792	;;
2793esac
2794
2795case ${target} in
2796i[34567]86-*-linux* | x86_64-*-linux*)
2797	tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386"
2798	;;
2799i[34567]86-*-* | x86_64-*-*)
2800	tmake_file="${tmake_file} i386/t-gmm_malloc i386/t-i386"
2801	;;
2802powerpc*-*-* | rs6000-*-*)
2803	tm_file="${tm_file} rs6000/option-defaults.h"
2804esac
2805
2806if [ "$target_has_targetcm" = "no" ]; then
2807  c_target_objs="$c_target_objs default-c.o"
2808  cxx_target_objs="$cxx_target_objs default-c.o"
2809fi
2810
2811if [ "$common_out_file" = "" ]; then
2812  if [ "$target_has_targetm_common" = "yes" ]; then
2813    common_out_file="$cpu_type/$cpu_type-common.c"
2814  else
2815    common_out_file="default-common.c"
2816  fi
2817fi
2818
2819# Support for --with-cpu and related options (and a few unrelated options,
2820# too).
2821case ${with_cpu} in
2822  yes | no)
2823    echo "--with-cpu must be passed a value" 1>&2
2824    exit 1
2825    ;;
2826esac
2827
2828# Set arch and cpu from ${target} and ${target_noncanonical}.  Set cpu
2829# to generic if there is no processor scheduler model for the target.
2830arch=
2831cpu=
2832arch_without_sse2=no
2833arch_without_64bit=no
2834case ${target} in
2835  i386-*-freebsd*)
2836    if test $fbsd_major -ge 6; then
2837      arch=i486
2838    else
2839      arch=i386
2840    fi
2841    cpu=generic
2842    arch_without_sse2=yes
2843    arch_without_64bit=yes
2844    ;;
2845  i386-*-*)
2846    arch=i386
2847    cpu=i386
2848    arch_without_sse2=yes
2849    arch_without_64bit=yes
2850    ;;
2851  i486-*-*)
2852    arch=i486
2853    cpu=i486
2854    arch_without_sse2=yes
2855    arch_without_64bit=yes
2856    ;;
2857  i586-*-*)
2858    arch_without_sse2=yes
2859    arch_without_64bit=yes
2860    case ${target_noncanonical} in
2861      k6_2-*)
2862	arch=k6-2
2863	cpu=k6-2
2864	;;
2865      k6_3-*)
2866	arch=k6-3
2867	cpu=k6-3
2868	;;
2869      k6-*)
2870	arch=k6
2871	cpu=k6
2872	;;
2873      pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
2874	arch=pentium-mmx
2875	cpu=pentium-mmx
2876	;;
2877      *)
2878	arch=pentium
2879	cpu=pentium
2880	;;
2881    esac
2882    ;;
2883  i686-*-* | i786-*-*)
2884    case ${target_noncanonical} in
2885      bdver3-*)
2886        arch=bdver3
2887        cpu=bdver3
2888        ;;
2889      bdver2-*)
2890        arch=bdver2
2891        cpu=bdver2
2892        ;;
2893      bdver1-*)
2894	arch=bdver1
2895	cpu=bdver1
2896	;;
2897      btver1-*)
2898	arch=btver1
2899	cpu=btver1
2900	;;
2901      btver2-*)
2902	arch=btver2
2903	cpu=btver2
2904	;;
2905      amdfam10-*|barcelona-*)
2906	arch=amdfam10
2907	cpu=amdfam10
2908	;;
2909      k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
2910	arch=k8-sse3
2911	cpu=k8-sse3
2912	;;
2913      k8-*|opteron-*|athlon64-*|athlon_fx-*)
2914	arch=k8
2915	cpu=k8
2916	;;
2917      athlon_xp-*|athlon_mp-*|athlon_4-*)
2918	arch=athlon-4
2919	cpu=athlon-4
2920	arch_without_sse2=yes
2921	arch_without_64bit=yes
2922	;;
2923      athlon_tbird-*|athlon-*)
2924	arch=athlon
2925	cpu=athlon
2926	arch_without_sse2=yes
2927	;;
2928      geode-*)
2929	arch=geode
2930	cpu=geode
2931	arch_without_sse2=yes
2932	;;
2933      pentium2-*)
2934	arch=pentium2
2935	cpu=pentium2
2936	arch_without_sse2=yes
2937	;;
2938      pentium3-*|pentium3m-*)
2939	arch=pentium3
2940	cpu=pentium3
2941	arch_without_sse2=yes
2942	;;
2943      pentium4-*|pentium4m-*)
2944	arch=pentium4
2945	cpu=pentium4
2946	;;
2947      prescott-*)
2948	arch=prescott
2949	cpu=prescott
2950	;;
2951      nocona-*)
2952	arch=nocona
2953	cpu=nocona
2954	;;
2955      atom-*)
2956	arch=atom
2957	cpu=atom
2958	;;
2959      core2-*)
2960	arch=core2
2961	cpu=core2
2962	;;
2963      corei7-*)
2964	arch=corei7
2965	cpu=corei7
2966	;;
2967      corei7_avx-*)
2968	arch=corei7-avx
2969	cpu=corei7-avx
2970	;;
2971      pentium_m-*)
2972	arch=pentium-m
2973	cpu=pentium-m
2974	;;
2975      pentiumpro-*)
2976	arch=pentiumpro
2977	cpu=pentiumpro
2978	arch_without_sse2=yes
2979	;;
2980      *)
2981	arch=pentiumpro
2982	cpu=generic
2983	arch_without_sse2=yes
2984	arch_without_64bit=yes
2985	;;
2986    esac
2987    ;;
2988  x86_64-*-*)
2989    case ${target_noncanonical} in
2990      bdver3-*)
2991        arch=bdver3
2992        cpu=bdver3
2993        ;;
2994      bdver2-*)
2995        arch=bdver2
2996        cpu=bdver2
2997        ;;
2998      bdver1-*)
2999	arch=bdver1
3000	cpu=bdver1
3001	;;
3002      btver1-*)
3003	arch=btver1
3004	cpu=btver1
3005	;;
3006      btver2-*)
3007	arch=btver2
3008	cpu=btver2
3009	;;
3010      amdfam10-*|barcelona-*)
3011	arch=amdfam10
3012	cpu=amdfam10
3013	;;
3014      k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3015	arch=k8-sse3
3016	cpu=k8-sse3
3017	;;
3018      k8-*|opteron-*|athlon_64-*)
3019	arch=k8
3020	cpu=k8
3021	;;
3022      nocona-*)
3023	arch=nocona
3024	cpu=nocona
3025	;;
3026      atom-*)
3027	arch=atom
3028	cpu=atom
3029	;;
3030      core2-*)
3031	arch=core2
3032	cpu=core2
3033	;;
3034      corei7-*)
3035	arch=corei7
3036	cpu=corei7
3037	;;
3038      *)
3039	arch=x86-64
3040	cpu=generic
3041	;;
3042    esac
3043    ;;
3044esac
3045
3046# If there is no $with_cpu option, try to infer one from ${target}.
3047# This block sets nothing except for with_cpu.
3048if test x$with_cpu = x ; then
3049  case ${target} in
3050    i[34567]86-*-*|x86_64-*-*)
3051      with_cpu=$cpu
3052      ;;
3053    alphaev6[78]*-*-*)
3054      with_cpu=ev67
3055      ;;
3056    alphaev6*-*-*)
3057      with_cpu=ev6
3058      ;;
3059    alphapca56*-*-*)
3060      with_cpu=pca56
3061      ;;
3062    alphaev56*-*-*)
3063      with_cpu=ev56
3064      ;;
3065    alphaev5*-*-*)
3066      with_cpu=ev5
3067      ;;
3068    frv-*-*linux* | frv400-*-*linux*)
3069      with_cpu=fr400
3070      ;;
3071    frv550-*-*linux*)
3072      with_cpu=fr550
3073      ;;
3074    m5200-*-*|m5407-*-*)
3075      with_cpu=${default_cf_cpu}
3076      ;;
3077    m68k*-*-*)
3078      case "$with_arch" in
3079	"cf")
3080	  with_cpu=${default_cf_cpu}
3081	  ;;
3082	"" | "m68k")
3083	  with_cpu=m${default_m68k_cpu}
3084	  ;;
3085      esac
3086      ;;
3087    mips*-*-vxworks)
3088      with_arch=mips2
3089      ;;
3090    powerpc*-*-*spe*)
3091      if test x$enable_e500_double = xyes; then
3092         with_cpu=8548
3093      else
3094         with_cpu=8540
3095      fi       
3096      ;;
3097    sparc*-*-*)
3098      case ${target} in
3099	*-leon-*)
3100	  with_cpu=leon
3101	  ;;
3102	*-leon[3-9]*)
3103	  with_cpu=leon3
3104	  ;;
3105	*)
3106	  with_cpu="`echo ${target} | sed 's/-.*$//'`"
3107	  ;;
3108      esac
3109      ;;
3110  esac
3111
3112  # Avoid overriding --with-cpu-32 and --with-cpu-64 values.
3113  case ${target} in
3114    i[34567]86-*-*|x86_64-*-*)
3115      if test x$with_cpu_32 != x || test x$with_cpu_64 != x; then
3116	if test x$with_cpu_32 = x; then
3117	  with_cpu_32=$with_cpu
3118	fi
3119	if test x$with_cpu_64 = x; then
3120	  with_cpu_64=$with_cpu
3121	fi
3122        with_cpu=
3123      fi
3124      ;;
3125  esac
3126fi
3127
3128# Support for --with-arch and related options (and a few unrelated options,
3129# too).
3130case ${with_arch} in
3131  yes | no)
3132    echo "--with-arch must be passed a value" 1>&2
3133    exit 1
3134    ;;
3135esac
3136
3137# If there is no $with_arch option, try to infer one from ${target}.
3138# This block sets nothing except for with_arch.
3139if test x$with_arch = x ; then
3140  case ${target} in
3141    i[34567]86-*-darwin*|x86_64-*-darwin*)
3142      # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
3143      # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
3144      ;;
3145    i[34567]86-*-*)
3146      # --with-fpmath sets the default ISA to SSE2, which is the same
3147      # ISA supported by Pentium 4.
3148      if test x$with_fpmath = x || test $arch_without_sse2 = no; then
3149	with_arch=$arch
3150      else
3151	with_arch=pentium4
3152      fi
3153      ;;
3154    x86_64-*-*)
3155      with_arch=$arch
3156      ;;
3157  esac
3158
3159  # Avoid overriding --with-arch-32 and --with-arch-64 values.
3160  case ${target} in
3161    i[34567]86-*-darwin*|x86_64-*-darwin*)
3162      # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
3163      # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
3164      ;;
3165    i[34567]86-*-*|x86_64-*-*)
3166      if test x$with_arch_32 != x || test x$with_arch_64 != x; then
3167	if test x$with_arch_32 = x; then
3168	  with_arch_32=$with_arch
3169	fi
3170	if test x$with_arch_64 = x; then
3171	  if test $arch_without_64bit = yes; then
3172	    # Set the default 64bit arch to x86-64 if the default arch
3173	    # doesn't support 64bit.
3174	    with_arch_64=x86-64
3175	  else
3176	    with_arch_64=$with_arch
3177	  fi
3178	fi
3179	with_arch=
3180      elif test $arch_without_64bit$need_64bit_isa = yesyes; then
3181	# Set the default 64bit arch to x86-64 if the default arch
3182	# doesn't support 64bit and we need 64bit ISA.
3183	with_arch_32=$with_arch
3184	with_arch_64=x86-64
3185	with_arch=
3186      fi
3187      ;;
3188  esac
3189fi
3190
3191# Support --with-fpmath.
3192if test x$with_fpmath != x; then
3193  case ${target} in
3194    i[34567]86-*-* | x86_64-*-*)
3195      case ${with_fpmath} in
3196      avx)
3197	tm_file="${tm_file} i386/avxmath.h"
3198	;;
3199      sse)
3200	tm_file="${tm_file} i386/ssemath.h"
3201	;;
3202      *)
3203	echo "Invalid --with-fpmath=$with_fpmath" 1>&2
3204	exit 1
3205	;;
3206      esac
3207      ;;
3208    *)
3209      echo "--with-fpmath isn't supported for $target." 1>&2
3210      exit 1
3211      ;;
3212  esac
3213fi
3214
3215# Similarly for --with-schedule.
3216if test x$with_schedule = x; then
3217	case ${target} in
3218	hppa1*)
3219		# Override default PA8000 scheduling model.
3220		with_schedule=7100LC
3221		;;
3222	esac
3223fi
3224
3225# Validate and mark as valid any --with options supported
3226# by this target.  In order to use a particular --with option
3227# you must list it in supported_defaults; validating the value
3228# is optional.  This case statement should set nothing besides
3229# supported_defaults.
3230
3231supported_defaults=
3232case "${target}" in
3233	aarch64*-*-*)
3234		supported_defaults="cpu arch"
3235		for which in cpu arch; do
3236
3237			eval "val=\$with_$which"
3238			base_val=`echo $val | sed -e 's/\+.*//'`
3239			ext_val=`echo $val | sed -e 's/[a-z0-9\-]\+//'`
3240
3241			if [ $which = arch ]; then
3242			  def=aarch64-arches.def
3243			  pattern=AARCH64_ARCH
3244			else
3245			  def=aarch64-cores.def
3246			  pattern=AARCH64_CORE
3247			fi
3248
3249			ext_mask=AARCH64_CPU_DEFAULT_FLAGS
3250
3251			# Find the base CPU or ARCH id in aarch64-cores.def or
3252			# aarch64-arches.def
3253			if [ x"$base_val" = x ] \
3254			    || grep "^$pattern(\"$base_val\"," \
3255				    ${srcdir}/config/aarch64/$def \
3256				    > /dev/null; then
3257
3258			  if [ $which = arch ]; then
3259				base_id=`grep "^$pattern(\"$base_val\"," \
3260				  ${srcdir}/config/aarch64/$def | \
3261				  sed -e 's/^[^,]*,[ 	]*//' | \
3262				  sed -e 's/,.*$//'`
3263				# Extract the architecture flags from aarch64-arches.def
3264				ext_mask=`grep "^$pattern(\"$base_val\"," \
3265				   ${srcdir}/config/aarch64/$def | \
3266				   sed -e 's/)$//' | \
3267				   sed -e 's/^.*,//'`
3268			  else
3269				base_id=`grep "^$pattern(\"$base_val\"," \
3270				  ${srcdir}/config/aarch64/$def | \
3271				  sed -e 's/^[^,]*,[ 	]*//' | \
3272				  sed -e 's/,.*$//'`
3273			  fi
3274
3275			  while [ x"$ext_val" != x ]
3276			  do
3277				ext_val=`echo $ext_val | sed -e 's/\+//'`
3278				ext=`echo $ext_val | sed -e 's/\+.*//'`
3279				base_ext=`echo $ext | sed -e 's/^no//'`
3280
3281				if [ x"$base_ext" = x ] \
3282				    || grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3283				    ${srcdir}/config/aarch64/aarch64-option-extensions.def \
3284				    > /dev/null; then
3285
3286				  ext_on=`grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3287					${srcdir}/config/aarch64/aarch64-option-extensions.def | \
3288					sed -e 's/^[^,]*,[ 	]*//' | \
3289					sed -e 's/,.*$//'`
3290				  ext_off=`grep "^AARCH64_OPT_EXTENSION(\"$base_ext\"," \
3291					${srcdir}/config/aarch64/aarch64-option-extensions.def | \
3292					sed -e 's/^[^,]*,[ 	]*[^,]*,[ 	]*//' | \
3293					sed -e 's/,.*$//' | \
3294					sed -e 's/).*$//'`
3295
3296				  if [ $ext = $base_ext ]; then
3297					# Adding extension
3298					ext_mask="("$ext_mask") | ("$ext_on")"
3299				  else
3300					# Removing extension
3301					ext_mask="("$ext_mask") & ~("$ext_off")"
3302				  fi
3303
3304				  true
3305				else
3306				  echo "Unknown extension used in --with-$which=$val" 1>&2
3307				  exit 1
3308				fi
3309				ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'`
3310			  done
3311
3312			  ext_mask="(("$ext_mask") << 6)"
3313			  if [ x"$base_id" != x ]; then
3314				target_cpu_cname="TARGET_CPU_$base_id | $ext_mask"
3315			  fi
3316			  true
3317			else
3318			  echo "Unknown $which used in --with-$which=$val" 1>&2
3319			  exit 1
3320			fi
3321		done
3322		;;
3323
3324	alpha*-*-*)
3325		supported_defaults="cpu tune"
3326		for which in cpu tune; do
3327			eval "val=\$with_$which"
3328			case "$val" in
3329			"" \
3330			| ev4 | ev45 | 21064 | ev5 | 21164 | ev56 | 21164a \
3331			| pca56 | 21164PC | 21164pc | ev6 | 21264 | ev67 \
3332			| 21264a)
3333				;;
3334			*)
3335				echo "Unknown CPU used in --with-$which=$val" 1>&2
3336				exit 1
3337				;;
3338			esac
3339		done
3340		;;
3341
3342	arm*-*-*)
3343		supported_defaults="arch cpu float tune fpu abi mode tls"
3344		for which in cpu tune; do
3345			# See if it matches any of the entries in arm-cores.def
3346			eval "val=\$with_$which"
3347			if [ x"$val" = x ] \
3348			    || grep "^ARM_CORE(\"$val\"," \
3349				    ${srcdir}/config/arm/arm-cores.def \
3350				    > /dev/null; then
3351			  # Ok
3352			  new_val=`grep "^ARM_CORE(\"$val\"," \
3353				${srcdir}/config/arm/arm-cores.def | \
3354				sed -e 's/^[^,]*,[ 	]*//' | \
3355				sed -e 's/,.*$//'`
3356			  eval "target_${which}_cname=$new_val"
3357			echo "For $val real value is $new_val"
3358			  true
3359			else
3360			  echo "Unknown CPU used in --with-$which=$val" 1>&2
3361			  exit 1
3362			fi
3363		done
3364
3365		case "$with_arch" in
3366		"" \
3367		| armv[23456] | armv2a | armv3m | armv4t | armv5t \
3368		| armv5te | armv6j |armv6k | armv6z | armv6zk | armv6-m \
3369		| armv7 | armv7-a | armv7-r | armv7-m | armv8-a \
3370		| iwmmxt | ep9312)
3371			# OK
3372			;;
3373		*)
3374			echo "Unknown arch used in --with-arch=$with_arch" 1>&2
3375			exit 1
3376			;;
3377		esac
3378
3379		case "$with_float" in
3380		"" \
3381		| soft | hard | softfp)
3382			# OK
3383			;;
3384		*)
3385			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
3386			exit 1
3387			;;
3388		esac
3389
3390		case "$with_fpu" in
3391		"" \
3392		| vfp | vfp3 | vfpv3 \
3393		| vfpv3-fp16 | vfpv3-d16 | vfpv3-d16-fp16 | vfpv3xd \
3394		| vfpv3xd-fp16 | neon | neon-fp16 | vfpv4 | vfpv4-d16 \
3395		| fpv4-sp-d16 | neon-vfpv4 | fp-arm-v8 | neon-fp-armv8 \
3396                | crypto-neon-fp-armv8)
3397			# OK
3398			;;
3399		*)
3400			echo "Unknown fpu used in --with-fpu=$with_fpu" 2>&1
3401			exit 1
3402			;;
3403		esac
3404
3405		case "$with_abi" in
3406		"" \
3407		| apcs-gnu | atpcs | aapcs | iwmmxt | aapcs-linux )
3408			#OK
3409			;;
3410		*)
3411			echo "Unknown ABI used in --with-abi=$with_abi"
3412			exit 1
3413			;;
3414		esac
3415
3416		case "$with_mode" in
3417		"" \
3418		| arm | thumb )
3419			#OK
3420			;;
3421		*)
3422			echo "Unknown mode used in --with-mode=$with_mode"
3423			exit 1
3424			;;
3425		esac
3426
3427		case "$with_tls" in
3428		"" \
3429		| gnu | gnu2)
3430			# OK
3431			;;
3432		*)
3433			echo "Unknown TLS method used in --with-tls=$with_tls" 1>&2
3434			exit 1
3435			;;
3436		esac
3437
3438		if test "x$with_arch" != x && test "x$with_cpu" != x; then
3439			echo "Warning: --with-arch overrides --with-cpu=$with_cpu" 1>&2
3440		fi
3441		;;
3442
3443	fr*-*-*linux*)
3444		supported_defaults=cpu
3445		case "$with_cpu" in
3446		fr400) ;;
3447		fr550) ;;
3448		*)
3449			echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
3450			exit 1
3451			;;
3452		esac
3453		;;
3454
3455	fido-*-* | m68k*-*-* | m5200-*-* | m5407-*-*)
3456		supported_defaults="arch cpu"
3457		case "$with_arch" in
3458		"" | "m68k"| "cf")
3459			m68k_arch_family="$with_arch"
3460			;;
3461		*)
3462			echo "Invalid --with-arch=$with_arch" 1>&2
3463			exit 1
3464			;;
3465		esac
3466
3467		# We always have a $with_cpu setting here.
3468		case "$with_cpu" in
3469		"m68000" | "m68010" | "m68020" | "m68030" | "m68040" | "m68060")
3470			m68k_cpu_ident=$with_cpu
3471			;;
3472		"m68020-40")
3473			m68k_cpu_ident=m68020
3474			tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_40"
3475			;;
3476		"m68020-60")
3477			m68k_cpu_ident=m68020
3478			tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_60"
3479			;;
3480		*)
3481			# We need the C identifier rather than the string.
3482			m68k_cpu_ident=`awk -v arg="\"$with_cpu\"" \
3483			   'BEGIN { FS="[ \t]*[,()][ \t]*" }; \
3484			    $1 == "M68K_DEVICE" && $2 == arg { print $3 }' \
3485				 ${srcdir}/config/m68k/m68k-devices.def`
3486			if [ x"$m68k_cpu_ident" = x ] ; then
3487				echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2
3488				exit 1
3489			fi
3490			with_cpu="mcpu=$with_cpu"
3491			;;
3492		esac
3493		;;
3494
3495	hppa*-*-*)
3496		supported_defaults="arch schedule"
3497
3498		case "$with_arch" in
3499		"" | 1.0 | 1.1 | 2.0)
3500			# OK
3501			;;
3502		*)
3503			echo "Unknown architecture used in --with-arch=$with_arch" 1>&2
3504			exit 1
3505			;;
3506		esac
3507
3508		case "$with_schedule" in
3509		"" | 700 | 7100 | 7100LC | 7200 | 7300 | 8000)
3510			# OK
3511			;;
3512		*)
3513			echo "Unknown processor used in --with-schedule=$with_schedule." 1>&2
3514			exit 1
3515			;;
3516		esac
3517		;;
3518
3519	i[34567]86-*-* | x86_64-*-*)
3520		supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
3521		for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do
3522			eval "val=\$with_$which"
3523			case ${val} in
3524			i386 | i486 \
3525			| i586 | pentium | pentium-mmx | winchip-c6 | winchip2 \
3526			| c3 | c3-2 | i686 | pentiumpro | pentium2 | pentium3 \
3527			| pentium4 | k6 | k6-2 | k6-3 | athlon | athlon-tbird \
3528			| athlon-4 | athlon-xp | athlon-mp | geode \
3529			| prescott | pentium-m | pentium4m | pentium3m)
3530				case "${target}" in
3531				  x86_64-*-*)
3532				      case "x$which" in
3533					*_32)
3534						;;
3535					*)
3536						echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
3537						exit 1
3538						;;
3539				      esac
3540				      ;;
3541				esac
3542				# OK
3543				;;
3544			"" | x86-64 | generic | native \
3545			| k8 | k8-sse3 | athlon64 | athlon64-sse3 | opteron \
3546			| opteron-sse3 | athlon-fx | bdver3 | bdver2 | bdver1 | btver2 \
3547			| btver1 | amdfam10 | barcelona | nocona | core2 | corei7 \
3548			| corei7-avx | core-avx-i | core-avx2 | atom)
3549				# OK
3550				;;
3551			*)
3552				echo "Unknown CPU given in --with-$which=$val." 1>&2
3553				exit 1
3554				;;
3555			esac
3556		done
3557		;;
3558
3559	mips*-*-*)
3560		supported_defaults="abi arch arch_32 arch_64 float tune tune_32 tune_64 divide llsc mips-plt synci"
3561
3562		case ${with_float} in
3563		"" | soft | hard)
3564			# OK
3565			;;
3566		*)
3567			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
3568			exit 1
3569			;;
3570		esac
3571
3572		case ${with_abi} in
3573		"" | 32 | o64 | n32 | 64 | eabi)
3574			# OK
3575			;;
3576		*)
3577			echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
3578			exit 1
3579			;;
3580		esac
3581
3582		case ${with_divide} in
3583		"" | breaks | traps)
3584			# OK
3585			;;
3586		*)
3587			echo "Unknown division check type use in --with-divide=$with_divide" 1>&2
3588			exit 1
3589			;;
3590		esac
3591
3592		case ${with_llsc} in
3593		yes)
3594			with_llsc=llsc
3595			;;
3596		no)
3597			with_llsc="no-llsc"
3598			;;
3599		"")
3600			# OK
3601			;;
3602		*)
3603			echo "Unknown llsc type used in --with-llsc" 1>&2
3604			exit 1
3605			;;
3606		esac
3607
3608		case ${with_mips_plt} in
3609		yes)
3610			with_mips_plt=plt
3611			;;
3612		no)
3613			with_mips_plt=no-plt
3614			;;
3615		"")
3616			;;
3617		*)
3618			echo "Unknown --with-mips-plt argument: $with_mips_plt" 1>&2
3619			exit 1
3620			;;
3621		esac
3622
3623		case ${with_synci} in
3624		yes)
3625			with_synci=synci
3626			;;
3627		no)
3628			with_synci=no-synci
3629			;;
3630		"")
3631			;;
3632		*)
3633			echo "Unknown synci type used in --with-synci" 1>&2
3634			exit 1
3635			;;
3636		esac
3637		;;
3638
3639	powerpc*-*-* | rs6000-*-*)
3640		supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64"
3641
3642		for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
3643			eval "val=\$with_$which"
3644			case ${val} in
3645			default32 | default64)
3646				case $which in
3647				cpu | tune)
3648					;;
3649				*)
3650					echo "$val only valid for --with-cpu and --with-tune." 1>&2
3651					exit 1
3652					;;
3653				esac
3654				with_which="with_$which"
3655				eval $with_which=
3656				;;
3657			405cr)
3658				tm_defines="${tm_defines} CONFIG_PPC405CR"
3659				eval "with_$which=405"
3660				;;
3661			"" | common \
3662			| power | power[2345678] | power6x | powerpc | powerpc64 \
3663			| rios | rios1 | rios2 | rsc | rsc1 | rs64a \
3664			| 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
3665			| 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
3666			| 604 | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
3667			| a2 | e300c[23] | 854[08] | e500mc | e500mc64 | e5500 | e6500 \
3668			| titan | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
3669				# OK
3670				;;
3671			*)
3672				echo "Unknown cpu used in --with-$which=$val." 1>&2
3673				exit 1
3674				;;
3675			esac
3676		done
3677
3678		case "$with_abi" in
3679		"" | elfv1 | elfv2 )
3680			#OK
3681			;;
3682		*)
3683			echo "Unknown ABI used in --with-abi=$with_abi"
3684			exit 1
3685			;;
3686		esac
3687		;;
3688
3689	s390*-*-*)
3690		supported_defaults="arch mode tune"
3691
3692		for which in arch tune; do
3693			eval "val=\$with_$which"
3694			case ${val} in
3695			"" | g5 | g6 | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12)
3696				# OK
3697				;;
3698			*)
3699				echo "Unknown cpu used in --with-$which=$val." 1>&2
3700				exit 1
3701				;;
3702			esac
3703		done
3704
3705		case ${with_mode} in
3706		"" | esa | zarch)
3707			# OK
3708			;;
3709		*)
3710			echo "Unknown architecture mode used in --with-mode=$with_mode." 1>&2
3711			exit 1
3712			;;
3713		esac
3714		;;
3715
3716	sh[123456ble]-*-* | sh-*-*)
3717		supported_defaults="cpu"
3718		case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in
3719		"" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
3720			# OK
3721			;;
3722		m2a | m2a-single | m2a-single-only | m2a-nofpu)
3723			;;
3724		m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
3725		        ;;
3726		*)
3727			echo "Unknown CPU used in --with-cpu=$with_cpu, known values:"  1>&2
3728			echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
3729			echo "m4a m4a-single m4a-single-only m4a-nofpu m4al" 1>&2
3730			echo "m2a m2a-single m2a-single-only m2a-nofpu" 1>&2
3731			exit 1
3732			;;
3733		esac
3734		;;
3735	sparc*-*-*)
3736		supported_defaults="cpu float tune"
3737
3738		for which in cpu tune; do
3739			eval "val=\$with_$which"
3740			case ${val} in
3741			"" | sparc | sparcv9 | sparc64 \
3742			| v7 | cypress \
3743			| v8 | supersparc | hypersparc | leon | leon3 \
3744			| sparclite | f930 | f934 | sparclite86x \
3745			| sparclet | tsc701 \
3746			| v9 | ultrasparc | ultrasparc3 | niagara | niagara2 \
3747			| niagara3 | niagara4)
3748				# OK
3749				;;
3750			*)
3751				echo "Unknown cpu used in --with-$which=$val" 1>&2
3752				exit 1
3753				;;
3754			esac
3755		done
3756
3757		case ${with_float} in
3758		"" | soft | hard)
3759			# OK
3760			;;
3761		*)
3762			echo "Unknown floating point type used in --with-float=$with_float" 1>&2
3763			exit 1
3764			;;
3765		esac
3766		;;
3767
3768	spu-*-*)
3769		supported_defaults="arch tune"
3770
3771		for which in arch tune; do
3772			eval "val=\$with_$which"
3773			case ${val} in
3774			"" | cell | celledp)
3775				# OK
3776				;;
3777			*)
3778				echo "Unknown cpu used in --with-$which=$val." 1>&2
3779				exit 1
3780				;;
3781			esac
3782		done
3783		;;
3784
3785	tic6x-*-*)
3786		supported_defaults="arch"
3787
3788		case ${with_arch} in
3789		"" | c62x | c64x | c64x+ | c67x | c67x+ | c674x)
3790			# OK
3791			;;
3792		*)
3793			echo "Unknown arch used in --with-arch=$with_arch." 1>&2
3794			exit 1
3795			;;
3796		esac
3797		;;
3798
3799	v850*-*-*)
3800		supported_defaults=cpu
3801		case ${with_cpu} in
3802		"" | v850e | v850e1 | v850e2 | v850es | v850e2v3 | v850e3v5)
3803			# OK
3804			;;
3805		*)
3806			echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
3807			exit 1
3808			;;
3809		esac
3810		;;
3811esac
3812
3813# Set some miscellaneous flags for particular targets.
3814target_cpu_default2=
3815case ${target} in
3816	aarch64*-*-*)
3817		if test x"$target_cpu_cname" != x
3818		then
3819			target_cpu_default2=$target_cpu_cname
3820		fi
3821		;;
3822
3823	arm*-*-*)
3824		if test x$target_cpu_cname = x
3825		then
3826			target_cpu_default2=TARGET_CPU_generic
3827		else
3828			target_cpu_default2=TARGET_CPU_$target_cpu_cname
3829		fi
3830		;;
3831
3832	hppa*-*-*)
3833		target_cpu_default2="MASK_BIG_SWITCH"
3834		if test x$gas = xyes
3835		then
3836			target_cpu_default2="${target_cpu_default2}|MASK_GAS|MASK_JUMP_IN_DELAY"
3837		fi
3838		;;
3839
3840	fido*-*-* | m68k*-*-*)
3841		target_cpu_default2=$m68k_cpu_ident
3842		tmake_file="m68k/t-opts $tmake_file"
3843		if [ x"$m68k_arch_family" != x ]; then
3844		        tmake_file="m68k/t-$m68k_arch_family $tmake_file"
3845		fi
3846		;;
3847
3848	i[34567]86-*-darwin* | x86_64-*-darwin*)
3849		;;
3850	i[34567]86-*-linux* | x86_64-*-linux*)
3851		tmake_file="$tmake_file i386/t-linux"
3852		;;
3853	i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
3854		tmake_file="$tmake_file i386/t-kfreebsd"
3855		;;
3856	i[34567]86-*-gnu*)
3857		tmake_file="$tmake_file i386/t-gnu"
3858		;;
3859	i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
3860		;;
3861	i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw*)
3862		;;
3863	i[34567]86-*-freebsd* | x86_64-*-freebsd*)
3864		;;
3865	ia64*-*-linux*)
3866		;;
3867
3868	mips*-*-*)
3869		if test x$gnu_ld = xyes
3870		then
3871			target_cpu_default2="MASK_SPLIT_ADDRESSES"
3872		fi
3873		case ${target} in
3874			mips*el-*-*)
3875				tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
3876				;;
3877		esac
3878		tmake_file="mips/t-mips $tmake_file"
3879		;;
3880
3881	powerpc*-*-* | rs6000-*-*)
3882		# FIXME: The PowerPC port uses the value set at compile time,
3883		# although it's only cosmetic.
3884		if test "x$with_cpu" != x
3885		then
3886			target_cpu_default2="\\\"$with_cpu\\\""
3887		fi
3888		out_file=rs6000/rs6000.c
3889		c_target_objs="${c_target_objs} rs6000-c.o"
3890		cxx_target_objs="${cxx_target_objs} rs6000-c.o"
3891		tmake_file="rs6000/t-rs6000 ${tmake_file}"
3892		;;
3893
3894	sh[123456ble]*-*-* | sh-*-*)
3895		c_target_objs="${c_target_objs} sh-c.o"
3896		cxx_target_objs="${cxx_target_objs} sh-c.o"
3897		;;
3898
3899	sparc*-*-*)
3900		# Some standard aliases.
3901		case x$with_cpu in
3902		xsparc)
3903			with_cpu=v7
3904			;;
3905		xsparcv9 | xsparc64)
3906			with_cpu=v9
3907			;;
3908		esac
3909
3910		if test x$with_tune = x ; then
3911		      case ${target} in
3912		      *-leon-*)
3913			  with_tune=leon
3914			  ;;
3915		      *-leon[3-9]*)
3916			  with_tune=leon3
3917			  ;;
3918		      esac
3919		fi
3920
3921		# The SPARC port checks this value at compile-time.
3922		target_cpu_default2="TARGET_CPU_$with_cpu"
3923		;;
3924
3925	v850*-*-*)
3926		case "x$with_cpu" in
3927		x)
3928			;;
3929		xv850e | xv850e1 | xv850e2 | xv850e2v3 | xv850e3v5)
3930			target_cpu_default2="TARGET_CPU_$with_cpu"
3931			;;
3932		xv850es)
3933			target_cpu_default2="TARGET_CPU_v850e1"
3934			;;
3935		esac
3936		;;
3937esac
3938
3939t=
3940all_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"
3941for option in $all_defaults
3942do
3943	eval "val=\$with_"`echo $option | sed s/-/_/g`
3944	if test -n "$val"; then
3945		case " $supported_defaults " in
3946		*" $option "*)
3947			;;
3948		*)
3949			echo "This target does not support --with-$option." 2>&1
3950			echo "Valid --with options are: $supported_defaults" 2>&1
3951			exit 1
3952			;;
3953		esac
3954
3955		if test "x$t" = x
3956		then
3957			t="{ \"$option\", \"$val\" }"
3958		else
3959			t="${t}, { \"$option\", \"$val\" }"
3960		fi
3961	fi
3962done
3963
3964if test "x$t" = x
3965then
3966	configure_default_options="{ { NULL, NULL} }"
3967else
3968	configure_default_options="{ ${t} }"
3969fi
3970
3971if test "$target_cpu_default2" != ""
3972then
3973	if test "$target_cpu_default" != ""
3974	then
3975		target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
3976	else
3977		target_cpu_default=$target_cpu_default2
3978	fi
3979fi
3980