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