]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config.gcc
phiopt: Fix up conditional_replacement [PR99305]
[thirdparty/gcc.git] / gcc / config.gcc
CommitLineData
a89ea0df 1# GCC target-specific configuration file.
99dee823 2# Copyright (C) 1997-2021 Free Software Foundation, Inc.
61ed06c3 3
1322177d 4#This file is part of GCC.
61ed06c3 5
1322177d
LB
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
9dcd6f09 8#Software Foundation; either version 3, or (at your option) any later
1322177d 9#version.
61ed06c3 10
1322177d
LB
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.
61ed06c3
HPN
15
16#You should have received a copy of the GNU General Public License
9dcd6f09
NC
17#along with GCC; see the file COPYING3. If not see
18#<http://www.gnu.org/licenses/>.
61ed06c3 19
a89ea0df
NN
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.
61ed06c3 25
fa958513
DJ
26# When you change the cases in the OS or target switches, consider
27# updating ../libgcc/config.host also.
28
b01bc573 29# This file switches on the shell variable ${target}, and also uses the
61ed06c3
HPN
30# following shell variables:
31#
32# with_* Various variables as set by configure.
33#
615be2cf 34# enable_threads Either the name, yes or no depending on whether
61ed06c3
HPN
35# threads support was requested.
36#
2121a768 37# default_use_cxa_atexit
c5dde55b
NC
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.
2121a768 46#
f6c5fbfd
NS
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#
61ed06c3
HPN
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#
b01bc573
NN
66# cpu_type The name of the cpu, if different from the first
67# chunk of the canonical target name.
61ed06c3 68#
d5355cb2
JDA
69# tm_defines List of target macros to define for all compilations.
70#
61ed06c3 71# tm_file A list of target macro files, if different from
32fb7c9d
FS
72# "$cpu_type/$cpu_type.h". Usually it's constructed
73# per target in a way like this:
57809813 74# tm_file="${tm_file} dbxelf.h elfos.h ${cpu_type.h}/elf.h"
32fb7c9d
FS
75# Note that the preferred order is:
76# - specific target header "${cpu_type}/${cpu_type.h}"
a4a4b1d3 77# - generic headers like dbxelf.h elfos.h, etc.
32fb7c9d
FS
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}.
61ed06c3 81#
9c63c208
SL
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#
61ed06c3
HPN
86# tm_p_file Location of file with declarations for functions
87# in $out_file.
88#
b4c522fa
IB
89# tm_d_file A list of headers with definitions of target hook
90# macros for the D compiler.
91#
61ed06c3
HPN
92# out_file The name of the machine description C support
93# file, if different from "$cpu_type/$cpu_type.c".
94#
c49a6962
JM
95# common_out_file The name of the source file for code shared between
96# the compiler proper and the driver.
97#
61ed06c3
HPN
98# md_file The name of the machine-description file, if
99# different from "$cpu_type/$cpu_type.md".
100#
101# tmake_file A list of machine-description-specific
102# makefile-fragments, if different from
103# "$cpu_type/t-$cpu_type".
104#
1c0ca89d
ZW
105# extra_modes The name of the file containing a list of extra
106# machine modes, if necessary and different from
107# "$cpu_type/$cpu_type-modes.def".
108#
61ed06c3
HPN
109# extra_objs List of extra objects that should be linked into
110# the compiler proper (cc1, cc1obj, cc1plus)
111# depending on target.
112#
30500d84
KC
113# extra_gcc_objs List of extra objects that should be linked into
114# the compiler driver (gcc) depending on target.
115#
61ed06c3 116# extra_headers List of used header files from the directory
817e13c4 117# config/${cpu_type}.
61ed06c3 118#
9b91e436
KT
119# user_headers_inc_next_pre
120# List of header file names of internal gcc header
121# files, which should be prefixed by an include_next.
122# user_headers_inc_next_post
123# List of header file names of internal gcc header
124# files, which should be postfixed by an include_next.
1617e5ee
GK
125# use_gcc_tgmath If set, add tgmath.h to the list of used header
126# files.
127#
207bf79d
JM
128# use_gcc_stdint If "wrap", install a version of stdint.h that
129# wraps the system's copy for hosted compilations;
130# if "provide", provide a version of systems without
131# such a system header; otherwise "none", do not
132# provide such a header at all.
133#
d82c57a8
RO
134# extra_programs List of extra executables compiled for this target
135# machine, used when linking.
61ed06c3 136#
75685792
RS
137# extra_options List of target-dependent .opt files.
138#
ff7cc307 139# c_target_objs List of extra target-dependent objects that be
aac69a49 140# linked into the C compiler only.
0e5a4ad8 141#
ff7cc307 142# cxx_target_objs List of extra target-dependent objects that be
aac69a49 143# linked into the C++ compiler only.
0e5a4ad8 144#
b4c522fa
IB
145# d_target_objs List of extra target-dependent objects that be
146# linked into the D compiler only.
147#
c776a6d0
DF
148# fortran_target_objs List of extra target-dependent objects that be
149# linked into the fortran compiler only.
150#
ef69da62
SS
151# target_gtfiles List of extra source files with type information.
152#
61ed06c3
HPN
153# xm_defines List of macros to define when compiling for the
154# target machine.
155#
156# xm_file List of files to include when compiling for the
157# target machine.
158#
159# use_collect2 Set to yes or no, depending on whether collect2
160# will be used.
161#
162# target_cpu_default Set to override the default target model.
163#
61ed06c3
HPN
164# gdb_needs_out_file_path
165# Set to yes if gdb needs a dir command with
166# `dirname $out_file`.
167#
61ed06c3
HPN
168# thread_file Set to control which thread package to use.
169#
170# gas Set to yes or no depending on whether the target
171# system normally uses GNU as.
4977bab6 172#
7816bea0
DJ
173# configure_default_options
174# Set to an initializer for configure_default_options
175# in configargs.h, based on --with-cpu et cetera.
08b2bad2
SB
176#
177# native_system_header_dir
178# Where system header files are found for this
179# target. This defaults to /usr/include. If
180# the --with-sysroot configure option or the
181# --sysroot command line option is used this
182# will be relative to the sysroot.
5ab22850
RR
183# target_type_format_char
184# The default character to be used for formatting
185# the attribute in a
186# .type symbol_name, ${t_t_f_c}<property>
187# directive.
61ed06c3
HPN
188
189# The following variables are used in each case-construct to build up the
190# outgoing variables:
191#
61ed06c3
HPN
192# gnu_ld Set to yes or no depending on whether the target
193# system normally uses GNU ld.
acce4e77
JM
194#
195# target_has_targetcm Set to yes or no depending on whether the target
196# has its own definition of targetcm.
c49a6962
JM
197#
198# target_has_targetm_common Set to yes or no depending on whether the
199# target has its own definition of targetm_common.
b4c522fa
IB
200#
201# target_has_targetdm Set to yes or no depending on whether the target
202# has its own definition of targetdm.
61ed06c3
HPN
203
204out_file=
c49a6962 205common_out_file=
61ed06c3
HPN
206tmake_file=
207extra_headers=
9b91e436
KT
208user_headers_inc_next_pre=
209user_headers_inc_next_post=
1617e5ee 210use_gcc_tgmath=yes
207bf79d 211use_gcc_stdint=none
61ed06c3
HPN
212extra_programs=
213extra_objs=
61ed06c3 214extra_gcc_objs=
75685792 215extra_options=
aac69a49
NC
216c_target_objs=
217cxx_target_objs=
b4c522fa 218d_target_objs=
c776a6d0 219fortran_target_objs=
acce4e77 220target_has_targetcm=no
677f3fa8 221target_has_targetm_common=yes
b4c522fa 222target_has_targetdm=no
d5355cb2 223tm_defines=
61ed06c3 224xm_defines=
61ed06c3
HPN
225# Set this to force installation and use of collect2.
226use_collect2=
227# Set this to override the default target model.
228target_cpu_default=
61ed06c3
HPN
229# Set this if gdb needs a dir command with `dirname $out_file`
230gdb_needs_out_file_path=
61ed06c3
HPN
231# Set this to control which thread package will be used.
232thread_file=
233# Reinitialize these from the flag values every loop pass, since some
234# configure entries modify them.
235gas="$gas_flag"
236gnu_ld="$gnu_ld_flag"
2121a768 237default_use_cxa_atexit=no
f6c5fbfd 238default_gnu_indirect_function=no
6ab185d6 239target_gtfiles=
c6b9174f 240need_64bit_isa=
08b2bad2 241native_system_header_dir=/usr/include
5ab22850 242target_type_format_char='@'
61ed06c3 243
6a38414a
NN
244# Don't carry these over build->host->target. Please.
245xm_file=
246md_file=
247
9340544b 248# Obsolete configurations.
32243d46 249case ${target} in
2f2aeda9 250 tile*-*-* \
32243d46
JM
251 )
252 if test "x$enable_obsolete" != xyes; then
253 echo "*** Configuration ${target} is obsolete." >&2
254 echo "*** Specify --enable-obsolete to build it anyway." >&2
255 echo "*** Support will be REMOVED in the next major release of GCC," >&2
256 echo "*** unless a maintainer comes forward." >&2
257 exit 1
258 fi;;
259esac
9340544b 260
7c942e17
ZW
261# Unsupported targets list. Do not put an entry in this list unless
262# it would otherwise be caught by a more permissive pattern. The list
263# should be in alphabetical order.
b01bc573 264case ${target} in
c4cc7bc1
RE
265 # Avoid special cases that are not obsolete
266 arm*-*-*eabi* \
267 )
268 ;;
269 arm*-wince-pe* \
270 | arm*-*-ecos-elf \
271 | arm*-*-elf \
c4cc7bc1 272 | arm*-*-linux* \
c4cc7bc1 273 | arm*-*-uclinux* \
2b36e4dc
HPN
274 | cris-*-linux* \
275 | crisv32-*-* \
c4cc7bc1 276 | i[34567]86-go32-* \
7c942e17 277 | i[34567]86-*-go32* \
ebb9f8b0 278 | m68k-*-uclinuxoldabi* \
7c942e17 279 | mips64orion*-*-rtems* \
52c0e446 280 | pdp11-*-bsd \
d8905777 281 | powerpc*-*-linux*paired* \
23d3e2d5 282 | powerpc*-*-*spe* \
7c942e17 283 | sparc-hal-solaris2* \
2f2aeda9 284 | spu*-*-* \
7c942e17 285 | thumb-*-* \
1eae4574 286 | *-*-freebsd[12] | *-*-freebsd[1234].* \
0db8fa89 287 | *-*-freebsd*aout* \
cd985f66 288 | *-*-linux*aout* \
7c942e17 289 | *-*-linux*coff* \
cd985f66 290 | *-*-linux*libc1* \
7c942e17
ZW
291 | *-*-linux*oldld* \
292 | *-*-rtemsaout* \
293 | *-*-rtemscoff* \
1500b428 294 | *-*-solaris2 \
d9f069ab
RO
295 | *-*-solaris2.[0-9] \
296 | *-*-solaris2.[0-9].* \
ccd1242e 297 | *-*-solaris2.10* \
7888f266 298 | *-*-sysv* \
9ab346a1 299 | vax-*-vms* \
7c942e17 300 )
b01bc573 301 echo "*** Configuration ${target} not supported" 1>&2
7c942e17
ZW
302 exit 1
303 ;;
304esac
305
61ed06c3 306# Set default cpu_type, tm_file, tm_p_file and xm_file so it can be
ba1e6c0b
JM
307# updated in each machine entry. Also set default extra_headers for some
308# machines.
61ed06c3 309tm_p_file=
b01bc573 310cpu_type=`echo ${target} | sed 's/-.*$//'`
a8e04fe6 311cpu_is_64bit=
b01bc573 312case ${target} in
38b2d076
DD
313m32c*-*-*)
314 cpu_type=m32c
315 tmake_file=m32c/t-m32c
41dfca87 316 target_has_targetm_common=no
38b2d076 317 ;;
24034425
IB
318aarch64*-*-*)
319 cpu_type=aarch64
abbe1ed2 320 extra_headers="arm_fp16.h arm_neon.h arm_bf16.h arm_acle.h arm_sve.h"
e4ea20c8
KT
321 c_target_objs="aarch64-c.o"
322 cxx_target_objs="aarch64-c.o"
b4c522fa 323 d_target_objs="aarch64-d.o"
5a783f42 324 extra_objs="aarch64-builtins.o aarch-common.o aarch64-sve-builtins.o aarch64-sve-builtins-shapes.o aarch64-sve-builtins-base.o aarch64-sve-builtins-sve2.o cortex-a57-fma-steering.o aarch64-speculation.o falkor-tag-collision-avoidance.o aarch64-bti-insert.o aarch64-cc-fusion.o"
624d0f07 325 target_gtfiles="\$(srcdir)/config/aarch64/aarch64-builtins.c \$(srcdir)/config/aarch64/aarch64-sve-builtins.h \$(srcdir)/config/aarch64/aarch64-sve-builtins.cc"
24034425
IB
326 target_has_targetm_common=yes
327 ;;
61ed06c3
HPN
328alpha*-*-*)
329 cpu_type=alpha
34251c0e 330 extra_options="${extra_options} g.opt"
61ed06c3 331 ;;
7431c1a1
AS
332amdgcn*)
333 cpu_type=gcn
334 use_gcc_stdint=wrap
335 ;;
2beef00e
AO
336am33_2.0-*-linux*)
337 cpu_type=mn10300
338 ;;
53426f6c
JR
339arc*-*-*)
340 cpu_type=arc
cf07c3de
CZ
341 c_target_objs="arc-c.o"
342 cxx_target_objs="arc-c.o"
9f532472 343 extra_options="${extra_options} arc/arc-tables.opt g.opt"
fad92291 344 extra_headers="arc-simd.h"
53426f6c 345 ;;
150b72ed
DJ
346arm*-*-*)
347 cpu_type=arm
33857df2 348 extra_objs="arm-builtins.o aarch-common.o"
78bf9163 349 extra_headers="mmintrin.h arm_neon.h arm_acle.h arm_fp16.h arm_cmse.h arm_bf16.h arm_mve_types.h arm_mve.h arm_cde.h"
5ab22850 350 target_type_format_char='%'
b76c3c4b
PB
351 c_target_objs="arm-c.o"
352 cxx_target_objs="arm-c.o"
b4c522fa 353 d_target_objs="arm-d.o"
ad7be009 354 extra_options="${extra_options} arm/arm-tables.opt"
33857df2 355 target_gtfiles="\$(srcdir)/config/arm/arm-builtins.c"
150b72ed 356 ;;
17fad361
AH
357avr-*-*)
358 cpu_type=avr
359 c_target_objs="avr-c.o"
360 cxx_target_objs="avr-c.o"
361 ;;
0d4a78eb
BS
362bfin*-*)
363 cpu_type=bfin
364 ;;
91dfef96
JM
365bpf-*-*)
366 cpu_type=bpf
367 ;;
faf9ab98 368frv*) cpu_type=frv
34251c0e 369 extra_options="${extra_options} g.opt"
faf9ab98 370 ;;
fef939d6
JB
371ft32*) cpu_type=ft32
372 target_has_targetm_common=no
373 ;;
cceb575c 374moxie*) cpu_type=moxie
677f3fa8 375 target_has_targetm_common=no
cceb575c 376 ;;
7d33c31d
KH
377fido-*-*)
378 cpu_type=m68k
379 extra_headers=math-68881.h
47c94d21 380 extra_options="${extra_options} m68k/m68k-tables.opt"
7d33c31d 381 ;;
61ed06c3
HPN
382i[34567]86-*-*)
383 cpu_type=i386
ab442df7
MM
384 c_target_objs="i386-c.o"
385 cxx_target_objs="i386-c.o"
b4c522fa 386 d_target_objs="i386-d.o"
2bf6d935 387 extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o i386-options.o i386-builtins.o i386-expand.o i386-features.o"
7c0b7150 388 target_gtfiles="\$(srcdir)/config/i386/i386-builtins.c \$(srcdir)/config/i386/i386-expand.c \$(srcdir)/config/i386/i386-options.c"
d48e78d6 389 extra_options="${extra_options} fused-madd.opt"
b3172cab 390 extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
3b8dd071 391 pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
cbf2e4d4 392 nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
43a8b705 393 immintrin.h x86intrin.h avxintrin.h xopintrin.h
7fccdfcf 394 ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
82feeb8d 395 lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
756c5857
AI
396 avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
397 rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
398 adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
c1618f82 399 avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
9cdea277 400 shaintrin.h clflushoptintrin.h xsavecintrin.h
936c0fe4 401 xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
4190ea38 402 avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
3dcc8af5 403 avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
5fbb13a7 404 avx512vbmivlintrin.h avx5124fmapsintrin.h avx5124vnniwintrin.h
79fc8ffe 405 avx512vpopcntdqintrin.h clwbintrin.h mwaitxintrin.h
9d54607a 406 clzerointrin.h pkuintrin.h sgxintrin.h cetintrin.h
489154e7 407 gfniintrin.h cet.h avx512vbmi2intrin.h
69ddc3e5 408 avx512vbmi2vlintrin.h avx512vnniintrin.h
2abaf67e 409 avx512vnnivlintrin.h vaesintrin.h vpclmulqdqintrin.h
13b93d4b 410 avx512vpopcntdqvlintrin.h avx512bitalgintrin.h
55f31ed1 411 pconfigintrin.h wbnoinvdintrin.h movdirintrin.h
366386c7 412 waitpkgintrin.h cldemoteintrin.h avx512bf16vlintrin.h
413 avx512bf16intrin.h enqcmdintrin.h serializeintrin.h
1e47cb35 414 avx512vp2intersectintrin.h avx512vp2intersectvlintrin.h
5c609842 415 tsxldtrkintrin.h amxtileintrin.h amxint8intrin.h
83927c63 416 amxbf16intrin.h x86gprintrin.h uintrintrin.h
ca813880 417 hresetintrin.h keylockerintrin.h avxvnniintrin.h"
61ed06c3 418 ;;
14f73b5a
JH
419x86_64-*-*)
420 cpu_type=i386
ab442df7
MM
421 c_target_objs="i386-c.o"
422 cxx_target_objs="i386-c.o"
b4c522fa 423 d_target_objs="i386-d.o"
d48e78d6 424 extra_options="${extra_options} fused-madd.opt"
2bf6d935 425 extra_objs="x86-tune-sched.o x86-tune-sched-bd.o x86-tune-sched-atom.o x86-tune-sched-core.o i386-options.o i386-builtins.o i386-expand.o i386-features.o"
7c0b7150 426 target_gtfiles="\$(srcdir)/config/i386/i386-builtins.c \$(srcdir)/config/i386/i386-expand.c \$(srcdir)/config/i386/i386-options.c"
b3172cab 427 extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
3b8dd071 428 pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
cbf2e4d4 429 nmmintrin.h bmmintrin.h fma4intrin.h wmmintrin.h
43a8b705 430 immintrin.h x86intrin.h avxintrin.h xopintrin.h
7fccdfcf 431 ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
2abaf67e 432 lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
756c5857
AI
433 avx2intrin.h avx512fintrin.h fmaintrin.h f16cintrin.h
434 rtmintrin.h xtestintrin.h rdseedintrin.h prfchwintrin.h
435 adxintrin.h fxsrintrin.h xsaveintrin.h xsaveoptintrin.h
c1618f82 436 avx512cdintrin.h avx512erintrin.h avx512pfintrin.h
9cdea277 437 shaintrin.h clflushoptintrin.h xsavecintrin.h
936c0fe4 438 xsavesintrin.h avx512dqintrin.h avx512bwintrin.h
4190ea38 439 avx512vlintrin.h avx512vlbwintrin.h avx512vldqintrin.h
3dcc8af5 440 avx512ifmaintrin.h avx512ifmavlintrin.h avx512vbmiintrin.h
5fbb13a7 441 avx512vbmivlintrin.h avx5124fmapsintrin.h avx5124vnniwintrin.h
79fc8ffe 442 avx512vpopcntdqintrin.h clwbintrin.h mwaitxintrin.h
9d54607a 443 clzerointrin.h pkuintrin.h sgxintrin.h cetintrin.h
489154e7 444 gfniintrin.h cet.h avx512vbmi2intrin.h
69ddc3e5 445 avx512vbmi2vlintrin.h avx512vnniintrin.h
2abaf67e 446 avx512vnnivlintrin.h vaesintrin.h vpclmulqdqintrin.h
13b93d4b 447 avx512vpopcntdqvlintrin.h avx512bitalgintrin.h
55f31ed1 448 pconfigintrin.h wbnoinvdintrin.h movdirintrin.h
366386c7 449 waitpkgintrin.h cldemoteintrin.h avx512bf16vlintrin.h
450 avx512bf16intrin.h enqcmdintrin.h serializeintrin.h
1e47cb35 451 avx512vp2intersectintrin.h avx512vp2intersectvlintrin.h
5c609842 452 tsxldtrkintrin.h amxtileintrin.h amxint8intrin.h
83927c63 453 amxbf16intrin.h x86gprintrin.h uintrintrin.h
ca813880 454 hresetintrin.h keylockerintrin.h avxvnniintrin.h"
14f73b5a 455 ;;
817e13c4
JM
456ia64-*-*)
457 extra_headers=ia64intrin.h
f19f1e5e 458 extra_options="${extra_options} g.opt fused-madd.opt"
817e13c4 459 ;;
cd985f66 460hppa*-*-*)
61ed06c3
HPN
461 cpu_type=pa
462 ;;
34251c0e
JM
463lm32*)
464 extra_options="${extra_options} g.opt"
465 ;;
ad126521
KI
466m32r*-*-*)
467 cpu_type=m32r
34251c0e 468 extra_options="${extra_options} g.opt"
ad126521 469 ;;
ba1e6c0b
JM
470m68k-*-*)
471 extra_headers=math-68881.h
47c94d21 472 extra_options="${extra_options} m68k/m68k-tables.opt"
61ed06c3 473 ;;
80920132
ME
474microblaze*-*-*)
475 cpu_type=microblaze
476 extra_options="${extra_options} g.opt"
477 ;;
61ed06c3
HPN
478mips*-*-*)
479 cpu_type=mips
b4c522fa 480 d_target_objs="mips-d.o"
8ae8bad7 481 extra_headers="loongson.h loongson-mmiintrin.h msa.h"
d41c8b4c 482 extra_objs="frame-header-opt.o"
e5aac417 483 extra_options="${extra_options} g.opt fused-madd.opt mips/mips-tables.opt"
61ed06c3 484 ;;
9304f876
CJW
485nds32*)
486 cpu_type=nds32
a4931745 487 extra_headers="nds32_intrinsic.h nds32_isr.h nds32_init.inc"
cf3cd43d
CJW
488 case ${target} in
489 nds32*-*-linux*)
490 extra_options="${extra_options} nds32/nds32-linux.opt"
491 ;;
492 nds32*-*-elf*)
493 extra_options="${extra_options} nds32/nds32-elf.opt"
494 ;;
495 *)
496 ;;
497 esac
b99353a2 498 extra_objs="nds32-cost.o nds32-intrinsic.o nds32-isr.o nds32-md-auxiliary.o nds32-pipelines-auxiliary.o nds32-predicates.o nds32-memory-manipulation.o nds32-fp-as-gp.o nds32-relax-opt.o nds32-utils.o"
9304f876 499 ;;
e430824f
CLT
500nios2-*-*)
501 cpu_type=nios2
502 extra_options="${extra_options} g.opt"
00020dda 503 ;;
738f2522
BS
504nvptx-*-*)
505 cpu_type=nvptx
506 ;;
3965b35f
SH
507or1k*-*-*)
508 cpu_type=or1k
509 ;;
61ed06c3
HPN
510powerpc*-*-*)
511 cpu_type=rs6000
b8d85f56
AS
512 extra_objs="rs6000-string.o rs6000-p8swap.o rs6000-logue.o"
513 extra_objs="${extra_objs} rs6000-call.o rs6000-pcrel-opt.o"
b76f1550 514 extra_headers="ppc-asm.h altivec.h htmintrin.h htmxlintrin.h"
a85492f3 515 extra_headers="${extra_headers} bmi2intrin.h bmiintrin.h"
09359ea3 516 extra_headers="${extra_headers} xmmintrin.h mm_malloc.h emmintrin.h"
a85492f3 517 extra_headers="${extra_headers} mmintrin.h x86intrin.h"
98e07d5c 518 extra_headers="${extra_headers} pmmintrin.h tmmintrin.h smmintrin.h"
b76f1550 519 extra_headers="${extra_headers} ppu_intrinsics.h spu2vmx.h vec_types.h si2vmx.h"
a1df6521 520 extra_headers="${extra_headers} amo.h"
a8e04fe6 521 case x$with_cpu in
71237df0 522 xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[3456789]|xpower10|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500)
a8e04fe6
AM
523 cpu_is_64bit=yes
524 ;;
525 esac
f10d3ac9 526 extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
1acf0246 527 target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-logue.c \$(srcdir)/config/rs6000/rs6000-call.c"
b8d85f56 528 target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-pcrel-opt.c"
4977bab6 529 ;;
8d2af3a2
DD
530pru-*-*)
531 cpu_type=pru
532 ;;
09cae750
PD
533riscv*)
534 cpu_type=riscv
de6320a8 535 extra_objs="riscv-builtins.o riscv-c.o riscv-sr.o riscv-shorten-memrefs.o"
b4c522fa 536 d_target_objs="riscv-d.o"
09cae750 537 ;;
4977bab6 538rs6000*-*-*)
f10d3ac9 539 extra_options="${extra_options} g.opt fused-madd.opt rs6000/rs6000-tables.opt"
b8d85f56
AS
540 extra_objs="rs6000-string.o rs6000-p8swap.o rs6000-logue.o"
541 extra_objs="${extra_objs} rs6000-call.o rs6000-pcrel-opt.o"
1acf0246 542 target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-logue.c \$(srcdir)/config/rs6000/rs6000-call.c"
b8d85f56 543 target_gtfiles="$target_gtfiles \$(srcdir)/config/rs6000/rs6000-pcrel-opt.c"
4977bab6 544 ;;
61ed06c3
HPN
545sparc*-*-*)
546 cpu_type=sparc
8d12174d
DM
547 c_target_objs="sparc-c.o"
548 cxx_target_objs="sparc-c.o"
b4c522fa 549 d_target_objs="sparc-d.o"
e7f799ce 550 extra_headers="visintrin.h"
61ed06c3 551 ;;
4977bab6 552s390*-*-*)
6cecb0aa 553 cpu_type=s390
b4c522fa 554 d_target_objs="s390-d.o"
d7ecb504 555 extra_options="${extra_options} fused-madd.opt"
3af82a61 556 extra_headers="s390intrin.h htmintrin.h htmxlintrin.h vecintrin.h"
4977bab6 557 ;;
b4eb03fe 558# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
a1fcb9a1 559sh[123456789lbe]*-*-* | sh-*-*)
fa5322fa 560 cpu_type=sh
159b4b2f 561 extra_options="${extra_options} fused-madd.opt"
ac973375 562 extra_objs="${extra_objs} sh_treg_combine.o sh-mem.o sh_optimize_sett_clrt.o"
fa5322fa 563 ;;
fd4df33d
NC
564v850*-*-*)
565 cpu_type=v850
566 ;;
bcead286
BS
567tic6x-*-*)
568 cpu_type=c6x
569 extra_headers="c6x_intrinsics.h"
570 extra_options="${extra_options} c6x/c6x-tables.opt"
571 ;;
47c21725
RH
572xtensa*-*-*)
573 extra_options="${extra_options} fused-madd.opt"
574 ;;
dd552284
WL
575tilegx*-*-*)
576 cpu_type=tilegx
dd552284 577 ;;
341c653c 578tilepro*-*-*)
dd552284 579 cpu_type=tilepro
dd552284 580 ;;
61ed06c3
HPN
581esac
582
583tm_file=${cpu_type}/${cpu_type}.h
b4c522fa 584tm_d_file=${cpu_type}/${cpu_type}.h
b6d7afec 585if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-protos.h
61ed06c3 586then
b6d7afec 587 tm_p_file=${cpu_type}/${cpu_type}-protos.h
b4c522fa 588 tm_d_file="${tm_d_file} ${cpu_type}/${cpu_type}-protos.h"
b6d7afec 589fi
b4c522fa 590
1c0ca89d
ZW
591extra_modes=
592if test -f ${srcdir}/config/${cpu_type}/${cpu_type}-modes.def
593then
594 extra_modes=${cpu_type}/${cpu_type}-modes.def
595fi
75685792
RS
596if test -f ${srcdir}/config/${cpu_type}/${cpu_type}.opt
597then
598 extra_options="${extra_options} ${cpu_type}/${cpu_type}.opt"
599fi
e564e618 600
b01bc573 601case ${target} in
17a819cb 602aarch64*-*-*)
c451f4d6 603 tm_p_file="${tm_p_file} arm/aarch-common-protos.h"
17a819cb
YZ
604 case ${with_abi} in
605 "")
606 if test "x$with_multilib_list" = xilp32; then
607 tm_file="aarch64/biarchilp32.h ${tm_file}"
608 else
609 tm_file="aarch64/biarchlp64.h ${tm_file}"
610 fi
611 ;;
612 ilp32)
613 tm_file="aarch64/biarchilp32.h ${tm_file}"
614 ;;
615 lp64)
616 tm_file="aarch64/biarchlp64.h ${tm_file}"
617 ;;
618 *)
619 echo "Unknown ABI used in --with-abi=$with_abi"
620 exit 1
621 esac
622 ;;
922e3e33 623i[34567]86-*-*)
0465e49e
L
624 if test "x$with_abi" != x; then
625 echo "This target does not support --with-abi."
626 exit 1
627 fi
922e3e33 628 ;;
e564e618 629x86_64-*-*)
0465e49e
L
630 case ${with_abi} in
631 "")
632 if test "x$with_multilib_list" = xmx32; then
633 tm_file="i386/biarchx32.h ${tm_file}"
634 else
635 tm_file="i386/biarch64.h ${tm_file}"
636 fi
637 ;;
638 64 | m64)
639 tm_file="i386/biarch64.h ${tm_file}"
640 ;;
641 x32 | mx32)
642 tm_file="i386/biarchx32.h ${tm_file}"
643 ;;
644 *)
645 echo "Unknown ABI used in --with-abi=$with_abi"
646 exit 1
647 esac
e564e618 648 ;;
c3f35647 649arm*-*-*)
bdb0828f 650 tm_p_file="arm/arm-flags.h ${tm_p_file} arm/aarch-common-protos.h"
1bfa5973 651 ;;
e564e618
DB
652esac
653
61ed06c3 654# On a.out targets, we need to use collect2.
b01bc573 655case ${target} in
61ed06c3
HPN
656*-*-*aout*)
657 use_collect2=yes
658 ;;
0e5a4ad8 659esac
61ed06c3 660
2c8f43e6 661# Common C libraries.
755658a5 662tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
2c8f43e6 663
646bdeab
L
664# 32-bit x86 processors supported by --with-arch=. Each processor
665# MUST be separated by exactly one space.
666x86_archs="athlon athlon-4 athlon-fx athlon-mp athlon-tbird \
667athlon-xp k6 k6-2 k6-3 geode c3 c3-2 winchip-c6 winchip2 i386 i486 \
668i586 i686 pentium pentium-m pentium-mmx pentium2 pentium3 pentium3m \
552ed3ea
JJ
669pentium4 pentium4m pentiumpro prescott lakemont samuel-2 nehemiah \
670c7 esther"
646bdeab
L
671
672# 64-bit x86 processors supported by --with-arch=. Each processor
673# MUST be separated by exactly one space.
674x86_64_archs="amdfam10 athlon64 athlon64-sse3 barcelona bdver1 bdver2 \
3e2ae3ee 675bdver3 bdver4 znver1 znver2 znver3 btver1 btver2 k8 k8-sse3 opteron \
2901f42f
VK
676opteron-sse3 nocona core2 corei7 corei7-avx core-avx-i core-avx2 atom \
677slm nehalem westmere sandybridge ivybridge haswell broadwell bonnell \
678silvermont knl knm skylake-avx512 cannonlake icelake-client icelake-server \
ba9c87d3 679skylake goldmont goldmont-plus tremont cascadelake tigerlake cooperlake \
552ed3ea
JJ
680sapphirerapids alderlake eden-x2 nano nano-1000 nano-2000 nano-3000 \
681nano-x2 eden-x4 nano-x4 x86-64 x86-64-v2 x86-64-v3 x86-64-v4 native"
646bdeab
L
682
683# Additional x86 processors supported by --with-cpu=. Each processor
684# MUST be separated by exactly one space.
685x86_cpus="generic intel"
686
4977bab6 687# Common parts for widely ported systems.
b01bc573 688case ${target} in
4d6d5bb2 689*-*-darwin*)
c2ff7104 690 tmake_file="t-darwin "
80c85ca2 691 tm_file="${tm_file} darwin.h"
4a04f09d
IS
692 darwin_os=`echo ${target} | sed 's/.*darwin\([0-9.]*\).*$/\1/'`
693 darwin_maj=`expr "$darwin_os" : '\([0-9]*\).*'`
694 macos_min=`expr "$darwin_os" : '[0-9]*\.\([0-9]*\).*'`
695 macos_maj=10
696 if test x"${macos_min}" = x; then
697 macos_min=0
698 fi
699 def_ld64=85.2
80c85ca2 700 case ${target} in
4a04f09d
IS
701 # Darwin 4 to 19 correspond to macOS 10.0 to 10.15
702 *-*-darwin[4-9]* | *-*-darwin1[0-9]*)
703 macos_min=`expr $darwin_maj - 4`
704 ;;
705 *-*-darwin20*)
706 # Darwin 20 corresponds to macOS 11.
707 macos_maj=11
708 def_ld64=609.0
709 ;;
710 *-*-darwin)
711 case ${cpu_type} in
712 aarch64) macos_maj=11 ;;
713 x86_64) macos_min=6 ;;
714 *) macos_min=5 ;;
715 esac
716 case ${host} in
717 *-*-darwin*) tm_defines="$tm_defines DARWIN_USE_KERNEL_VERS" ;;
718 *)
719 # If configuring a cross-compiler then we will have set some
720 # default above, but it is probably not what was intended.
721 echo "Warning: Using ${target} is only suitable for Darwin hosts" 1>&2
722 echo "configure with an explicit target version" 1>&2
723 ;;
724 esac
725 ;;
726 *)
727 echo "Error: configuring for an unreleased macOS version ${target}" 1>&2
728 exit 1
729 ;;
80c85ca2 730 esac
4a04f09d
IS
731 tm_defines="$tm_defines DEF_MIN_OSX_VERSION=\\\"${macos_maj}.${macos_min}\\\""
732 tm_defines="$tm_defines DEF_LD64=\\\"${def_ld64}\\\""
80c85ca2 733 tm_file="${tm_file} ${cpu_type}/darwin.h"
4d6d5bb2 734 tm_p_file="${tm_p_file} darwin-protos.h"
7c0b7150 735 target_gtfiles="$target_gtfiles \$(srcdir)/config/darwin.c"
6ac49599 736 extra_options="${extra_options} darwin.opt"
ab442df7
MM
737 c_target_objs="${c_target_objs} darwin-c.o"
738 cxx_target_objs="${cxx_target_objs} darwin-c.o"
4dce3b05 739 d_target_objs="${d_target_objs} darwin-d.o"
c776a6d0 740 fortran_target_objs="darwin-f.o"
acce4e77 741 target_has_targetcm=yes
4dce3b05 742 target_has_targetdm=yes
c73200ca 743 extra_objs="${extra_objs} darwin.o"
e46b55d0 744 extra_gcc_objs="darwin-driver.o"
747b9f55 745 default_use_cxa_atexit=yes
428ddbf0 746 use_gcc_stdint=wrap
4d6d5bb2
NN
747 case ${enable_threads} in
748 "" | yes | posix) thread_file='posix' ;;
749 esac
750 ;;
dbed5a9b
JM
751*-*-dragonfly*)
752 gas=yes
753 gnu_ld=yes
754 tmake_file="t-slibgcc"
755 case ${enable_threads} in
756 "" | yes | posix)
757 thread_file='posix'
758 ;;
759 no | single)
760 # Let these non-posix thread selections fall through if requested
761 ;;
762 *)
763 echo 'Unknown thread configuration for DragonFly BSD'
764 exit 1
765 ;;
766 esac
767 extra_options="$extra_options rpath.opt dragonfly.opt"
768 default_use_cxa_atexit=yes
769 use_gcc_stdint=wrap
fa9091ad
IB
770 d_target_objs="${d_target_objs} dragonfly-d.o"
771 tmake_file="${tmake_file} t-dragonfly"
772 target_has_targetdm=yes
dbed5a9b 773 ;;
4d6d5bb2
NN
774*-*-freebsd*)
775 # This is the generic ELF configuration of FreeBSD. Later
776 # machine-specific sections may refine and add to this
777 # configuration.
778 #
779 # Due to tm_file entry ordering issues that vary between cpu
780 # architectures, we only define fbsd_tm_file to allow the
781 # machine-specific section to dictate the final order of all
782 # entries of tm_file with the minor exception that components
783 # of the tm_file set here will always be of the form:
784 #
785 # freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd-spec.h freebsd.h
786 #
787 # The machine-specific section should not tamper with this
788 # ordering but may order all other entries of tm_file as it
789 # pleases around the provided core setting.
790 gas=yes
791 gnu_ld=yes
b2449d40 792 fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
faabf788
AT
793 if test "$fbsd_major" = ""; then
794 echo "Specify the major version number of the targeted FreeBSD release"
795 echo "like this: --target=amd64-unknown-freebsd10.1"
796 exit 1
797 fi
b2449d40 798 tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
f9989b51 799 tmake_file="t-slibgcc"
4d6d5bb2
NN
800 case ${enable_threads} in
801 no)
802 fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h"
803 ;;
769e49eb 804 "" | yes | posix)
4d6d5bb2 805 thread_file='posix'
4d6d5bb2 806 ;;
f7288899 807 *)
4d6d5bb2
NN
808 echo 'Unknown thread configuration for FreeBSD'
809 exit 1
810 ;;
811 esac
5ac69a80 812 fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h freebsd-stdint.h"
baf3ead6 813 extra_options="$extra_options rpath.opt freebsd.opt"
8a47c6c4
LR
814 case ${target} in
815 *-*-freebsd[345].*)
816 :;;
817 *)
818 default_use_cxa_atexit=yes;;
819 esac
5ac69a80 820 use_gcc_stdint=wrap
e855b30c
IB
821 d_target_objs="${d_target_objs} freebsd-d.o"
822 tmake_file="${tmake_file} t-freebsd"
823 target_has_targetdm=yes
4d6d5bb2 824 ;;
491b3c5f
JC
825*-*-fuchsia*)
826 native_system_header_dir=/include
827 ;;
b1e21e5a 828*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu | *-*-uclinuxfdpiceabi)
b8e7038e 829 extra_options="$extra_options gnu-user.opt"
e3029773
NN
830 gas=yes
831 gnu_ld=yes
832 case ${enable_threads} in
833 "" | yes | posix) thread_file='posix' ;;
834 esac
f9989b51 835 tmake_file="t-slibgcc"
3328a3b7 836 case $target in
8466af06 837 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
3328a3b7
TS
838 :;;
839 *-*-gnu*)
08b2bad2
SB
840 native_system_header_dir=/include
841 ;;
3328a3b7 842 esac
5fa747a7 843 # Linux C libraries selection switch: glibc / uclibc / bionic.
74c70253 844 # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD.
3328a3b7
TS
845 case $target in
846 *linux*)
5fa747a7
MK
847 tm_p_file="${tm_p_file} linux-protos.h"
848 tmake_file="${tmake_file} t-linux"
849 extra_objs="${extra_objs} linux.o"
850 extra_options="${extra_options} linux.opt"
851 ;;
3328a3b7 852 esac
74c70253
MK
853 case $target in
854 *-*-*android*)
855 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
856 ;;
b1e21e5a 857 *-*-*uclibc* | *-*-uclinuxfdpiceabi)
74c70253 858 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
7bd85ce0 859 ;;
755658a5
GR
860 *-*-*musl*)
861 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
862 ;;
7bd85ce0 863 *)
74c70253 864 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
464aea98
JM
865 ;;
866 esac
74c70253
MK
867 # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit
868 # is provided.
c5dde55b 869 default_use_cxa_atexit=yes
1617e5ee 870 use_gcc_tgmath=no
207bf79d 871 use_gcc_stdint=wrap
51b9db92
MK
872 # Enable compilation for Android by default for *android* targets.
873 case $target in
874 *-*-*android*)
875 tm_defines="$tm_defines ANDROID_DEFAULT=1"
876 ;;
877 *)
878 tm_defines="$tm_defines ANDROID_DEFAULT=0"
879 ;;
880 esac
1efcb8c6
JM
881 c_target_objs="${c_target_objs} glibc-c.o"
882 cxx_target_objs="${cxx_target_objs} glibc-c.o"
b4c522fa 883 d_target_objs="${d_target_objs} glibc-d.o"
1efcb8c6
JM
884 tmake_file="${tmake_file} t-glibc"
885 target_has_targetcm=yes
b4c522fa 886 target_has_targetdm=yes
e3029773 887 ;;
f982f805 888*-*-netbsd*)
b460e64d
KW
889 tm_p_file="${tm_p_file} netbsd-protos.h"
890 tmake_file="t-netbsd t-slibgcc"
891 extra_objs="${extra_objs} netbsd.o"
2f2b8e40 892 d_target_objs="${d_target_objs} netbsd-d.o"
e3029773
NN
893 gas=yes
894 gnu_ld=yes
0333b8d0 895 use_gcc_stdint=wrap
e3029773 896 case ${enable_threads} in
b48cd47e 897 "" | yes | posix) thread_file='posix' ;;
e3029773 898 esac
dfe2677b 899 nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
b74103ef 900 default_use_cxa_atexit=yes
2f2b8e40 901 target_has_targetdm=yes
856f73d1
MR
902 case ${target} in
903 arm*-* | i[34567]86-* | powerpc*-* | sparc*-* | x86_64-*)
904 default_gnu_indirect_function=yes
905 ;;
906 esac
e3029773 907 ;;
4d6d5bb2 908*-*-openbsd*)
f9989b51 909 tmake_file="t-openbsd"
e3029773 910 case ${enable_threads} in
4d6d5bb2 911 yes)
e3029773 912 thread_file='posix'
e3029773
NN
913 ;;
914 esac
af9e6b74
MK
915 case ${target} in
916 *-*-openbsd4.[3-9]|*-*-openbsd[5-9]*)
917 default_use_cxa_atexit=yes
918 ;;
919 esac
e3029773 920 ;;
bfdd80d4
JS
921*-*-phoenix*)
922 gas=yes
923 gnu_ld=yes
924 default_use_cxa_atexit=yes
925 ;;
8179b3c8
NN
926*-*-rtems*)
927 case ${enable_threads} in
776c9a0d
SH
928 "" | yes | rtems) thread_file='rtems' ;;
929 posix) thread_file='posix' ;;
930 no) ;;
931 *)
932 echo 'Unknown thread configuration for RTEMS'
933 exit 1
934 ;;
8179b3c8 935 esac
aefe4056 936 tmake_file="${tmake_file} t-rtems"
cd33a412 937 extra_options="${extra_options} rtems.opt"
228c1313 938 default_use_cxa_atexit=yes
207bf79d
JM
939 use_gcc_stdint=wrap
940 ;;
941*-*-uclinux*)
b8e7038e 942 extra_options="$extra_options gnu-user.opt"
207bf79d 943 use_gcc_stdint=wrap
09955a32
WB
944 case ${enable_threads} in
945 "" | yes | posix) thread_file='posix' ;;
946 esac
b5a54c03 947 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC"
8179b3c8 948 ;;
5a579c3b
LE
949*-*-rdos*)
950 use_gcc_stdint=wrap
951 ;;
c28aa982 952*-*-solaris2*)
7ecfa34f
RO
953 # i?86-*-solaris2* needs to insert headers between cpu default and
954 # Solaris 2 specific ones.
2cf03b11
RO
955 sol2_tm_file_head="dbxelf.h elfos.h ${cpu_type}/sysv4.h"
956 sol2_tm_file_tail="${cpu_type}/sol2.h sol2.h"
957 sol2_tm_file="${sol2_tm_file_head} ${sol2_tm_file_tail}"
29424c7b 958 case ${target} in
f021f1d3
RO
959 *-*-solaris2.1[1-9]*)
960 # __cxa_atexit was introduced in Solaris 11.4.
29424c7b
RO
961 default_use_cxa_atexit=yes
962 ;;
963 esac
d9f069ab 964 use_gcc_stdint=wrap
7ecfa34f
RO
965 if test x$gnu_ld = xyes; then
966 tm_file="usegld.h ${tm_file}"
967 fi
968 if test x$gas = xyes; then
969 tm_file="usegas.h ${tm_file}"
970 fi
971 tm_p_file="${tm_p_file} sol2-protos.h"
b040f2be 972 tmake_file="${tmake_file} t-sol2 t-slibgcc"
7ecfa34f 973 c_target_objs="${c_target_objs} sol2-c.o"
5b880ea6 974 cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o"
cdb3f2f4 975 d_target_objs="${d_target_objs} sol2-d.o"
41f59cda 976 extra_objs="${extra_objs} sol2.o sol2-stubs.o"
c28aa982 977 extra_options="${extra_options} sol2.opt"
7ecfa34f
RO
978 case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
979 "":yes:* | yes:yes:* )
980 thread_file=posix
981 ;;
982 esac
cdb3f2f4 983 target_has_targetdm=yes
c28aa982 984 ;;
18a24fed
TG
985*-*-*vms*)
986 extra_options="${extra_options} vms/vms.opt"
987 xmake_file=vms/x-vms
b040f2be 988 tmake_file="vms/t-vms t-slibgcc"
db8b22ef
TG
989 extra_objs="vms.o"
990 target_gtfiles="$target_gtfiles \$(srcdir)/config/vms/vms.c"
991 tm_p_file="${tm_p_file} vms/vms-protos.h"
d8aba32a 992 xm_file="vms/xm-vms.h"
c750e768
TG
993 c_target_objs="vms-c.o"
994 cxx_target_objs="vms-c.o"
c531f06a 995 fortran_target_objs="vms-f.o"
20bfad56
TG
996 use_gcc_stdint=provide
997 tm_file="${tm_file} vms/vms-stdint.h"
18a24fed
TG
998 if test x$gnu_ld != xyes; then
999 # Build wrappers for native case.
1000 extra_programs="ld\$(exeext) ar\$(exeext)"
1001 tmake_file="$tmake_file vms/t-vmsnative"
1002 fi
1003 ;;
4977bab6 1004*-*-vxworks*)
e3029773 1005 tmake_file=t-vxworks
2eab15c9 1006 xm_defines=POSIX
41c1b913 1007
2eab15c9 1008 extra_options="${extra_options} vxworks.opt"
6994430a 1009 extra_objs="$extra_objs vxworks.o"
41c1b913 1010
b3405ddc
JB
1011 c_target_objs="${c_target_objs} vxworks-c.o"
1012 cxx_target_objs="${cxx_target_objs} vxworks-c.o"
1013 extra_headers="${extra_headers} ../vxworks/vxworks-predef.h"
1014 target_has_targetcm="yes"
41c1b913 1015
abb6c3ee
OH
1016 # This private header exposes a consistent interface for checks on
1017 # the VxWorks version our runtime header files need to perform, based on
1018 # what the system headers adverstise:
1019
1020 extra_headers="${extra_headers} ../vxworks/_vxworks-versions.h"
1021
41c1b913
OH
1022 # Starting from VxWorks 7, the system comes with a Dinkumware
1023 # environment which requires the inclusion of "yvals.h" before other
1024 # system headers. We provide wrapped versions of a few headers to
1025 # accomodate such constraints:
1026
1027 extra_headers="${extra_headers} ../vxworks/_yvals.h"
1028 extra_headers="${extra_headers} ../vxworks/_yvals-wrapper.h"
1029
1030 extra_headers="${extra_headers} ../vxworks/math.h ../vxworks/complex.h"
1031 extra_headers="${extra_headers} ../vxworks/inttypes.h ../vxworks/setjmp.h"
1032
bbbc0595
OH
1033 # We provide stdint.h ...
1034
1035 tm_file="${tm_file} vxworks-stdint.h"
1036
1037 # .. only through the yvals conditional wrapping mentioned above
1038 # to abide by the VxWorks 7 expectations. The final copy is performed
1039 # explicitly by a t-vxworks Makefile rule.
1040
1041 use_gcc_stdint=none
1042 extra_headers="${extra_headers} ../../ginclude/stdint-gcc.h"
1043
55047c9d
PE
1044 case ${enable_threads} in
1045 no) ;;
1046 "" | yes | vxworks) thread_file='vxworks' ;;
1047 *) echo 'Unknown thread configuration for VxWorks'; exit 1 ;;
1048 esac
ebcdba9c
PB
1049
1050 # A few common macro definitions conveying general characteristics
1051 # of the configuration at hand. Note that by VxWorks 7, we mean the
1052 # the SR6xx major update or beyond in vendor parlance:
1053
b269e899
JL
1054 case $target in
1055 *-*-vxworks7*)
1056 tm_defines="$tm_defines TARGET_VXWORKS7=1"
1057 ;;
1058 esac
caa62834
OH
1059 case $target in
1060 *64-*-vxworks*)
1061 tm_defines="$tm_defines TARGET_VXWORKS64=1"
1062 ;;
1063 esac
ebcdba9c
PB
1064
1065 # Then a few build configuration controls for VxWorks 7, which
1066 # has specificities on top of which we aim to provide more complete
1067 # C++ support:
1068
1069 case $target in
1070 *-*-vxworks7*)
1071 # VxWorks 7 always has init/fini_array support and it is simpler to
1072 # just leverage this, sticking to what the system toolchain does:
1073 gcc_cv_initfini_array=yes
1074 ;;
1075 esac
e3029773 1076 ;;
53426f6c 1077*-*-elf|arc*-*-elf*)
c5dde55b
NC
1078 # Assume that newlib is being used and so __cxa_atexit is provided.
1079 default_use_cxa_atexit=yes
207bf79d 1080 use_gcc_stdint=wrap
c5dde55b 1081 ;;
61ed06c3
HPN
1082esac
1083
b01bc573 1084case ${target} in
491b3c5f 1085aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
24034425 1086 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h"
91bed1a1 1087 tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-elf-raw.h"
24034425 1088 tmake_file="${tmake_file} aarch64/t-aarch64"
11779999
JS
1089 case $target in
1090 aarch64-*-elf*)
1091 use_gcc_stdint=wrap
1092 ;;
491b3c5f
JC
1093 aarch64-*-fuchsia*)
1094 tm_file="${tm_file} fuchsia.h"
1095 ;;
11779999
JS
1096 aarch64-*-rtems*)
1097 tm_file="${tm_file} rtems.h aarch64/rtems.h"
1098 ;;
1099 esac
24034425
IB
1100 case $target in
1101 aarch64_be-*)
1102 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1103 ;;
1104 esac
17a819cb
YZ
1105 aarch64_multilibs="${with_multilib_list}"
1106 if test "$aarch64_multilibs" = "default"; then
1107 aarch64_multilibs="lp64,ilp32"
1108 fi
1109 aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
1110 for aarch64_multilib in ${aarch64_multilibs}; do
1111 case ${aarch64_multilib} in
1112 ilp32 | lp64 )
1113 TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
1114 ;;
1115 *)
1116 echo "--with-multilib-list=${aarch64_multilib} not supported."
1117 exit 1
1118 esac
1119 done
1120 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
24034425 1121 ;;
b20e7532
AT
1122aarch64*-*-freebsd*)
1123 tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file}"
91bed1a1 1124 tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-freebsd.h"
b20e7532 1125 tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-freebsd"
5b0acc31 1126 tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
b20e7532 1127 ;;
f32f7585
MG
1128aarch64*-*-netbsd*)
1129 tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file}"
91bed1a1 1130 tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-netbsd.h"
f32f7585
MG
1131 tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-netbsd"
1132 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1133 ;;
24034425
IB
1134aarch64*-*-linux*)
1135 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
91bed1a1 1136 tm_file="${tm_file} aarch64/aarch64-elf.h aarch64/aarch64-errata.h aarch64/aarch64-linux.h"
24034425 1137 tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-linux"
b39036d2 1138 tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1"
24034425
IB
1139 case $target in
1140 aarch64_be-*)
1141 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1142 ;;
1143 esac
17a819cb
YZ
1144 aarch64_multilibs="${with_multilib_list}"
1145 if test "$aarch64_multilibs" = "default"; then
1146 # TODO: turn on ILP32 multilib build after its support is mature.
1147 # aarch64_multilibs="lp64,ilp32"
1148 aarch64_multilibs="lp64"
1149 fi
1150 aarch64_multilibs=`echo $aarch64_multilibs | sed -e 's/,/ /g'`
1151 for aarch64_multilib in ${aarch64_multilibs}; do
1152 case ${aarch64_multilib} in
1153 ilp32 | lp64 )
1154 TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${aarch64_multilib}"
1155 ;;
1156 *)
1157 echo "--with-multilib-list=${aarch64_multilib} not supported."
1158 exit 1
1159 esac
1160 done
1161 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
24034425 1162 ;;
3004f893
DR
1163aarch64*-wrs-vxworks*)
1164 tm_file="${tm_file} elfos.h aarch64/aarch64-elf.h"
1165 tm_file="${tm_file} vx-common.h vxworks.h aarch64/aarch64-vxworks.h"
1166 tmake_file="${tmake_file} aarch64/t-aarch64 aarch64/t-aarch64-vxworks"
1167 ;;
61ed06c3 1168alpha*-*-linux*)
8f27fc6b 1169 tm_file="elfos.h ${tm_file} alpha/elf.h alpha/linux.h alpha/linux-elf.h glibc-stdint.h"
a32fc216 1170 tmake_file="${tmake_file} alpha/t-linux alpha/t-alpha"
183c38a4 1171 extra_options="${extra_options} alpha/elf.opt"
61ed06c3 1172 ;;
61ed06c3 1173alpha*-*-netbsd*)
dfe2677b 1174 tm_file="elfos.h ${tm_file} ${nbsd_tm_file} alpha/elf.h alpha/netbsd.h"
a32fc216 1175 tmake_file="${tmake_file} alpha/t-alpha"
183c38a4
JM
1176 extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
1177 alpha/elf.opt"
61ed06c3 1178 ;;
61ed06c3 1179alpha*-*-openbsd*)
aa58f943 1180 tm_defines="${tm_defines} OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_FUNCTION_SIZE OBSD_HAS_DECLARE_OBJECT"
8f27fc6b 1181 tm_file="elfos.h alpha/alpha.h alpha/elf.h openbsd.h openbsd-stdint.h alpha/openbsd.h openbsd-libpthread.h"
a32fc216 1182 tmake_file="${tmake_file} alpha/t-alpha"
183c38a4 1183 extra_options="${extra_options} openbsd.opt alpha/elf.opt"
61ed06c3 1184 # default x-alpha is only appropriate for dec-osf.
61ed06c3 1185 ;;
ef057c45 1186alpha*-dec-*vms*)
ba89fcb6 1187 tm_file="${tm_file} vms/vms.h alpha/vms.h"
a32fc216 1188 tmake_file="${tmake_file} alpha/t-vms alpha/t-alpha"
61ed06c3 1189 ;;
53426f6c 1190arc*-*-elf*)
fad92291 1191 tm_file="arc/arc-arch.h dbxelf.h elfos.h newlib-stdint.h arc/elf.h ${tm_file}"
f9ccf899
CZ
1192 tmake_file="arc/t-multilib arc/t-arc"
1193 extra_gcc_objs="driver-arc.o"
1194 if test "x$with_cpu" != x; then
1195 tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
1196 fi
53426f6c
JR
1197 if test x${with_endian} = x; then
1198 case ${target} in
1199 arc*be-*-* | arc*eb-*-*) with_endian=big ;;
1200 *) with_endian=little ;;
1201 esac
1202 fi
1203 case ${with_endian} in
1204 big|little) ;;
1205 *) echo "with_endian=${with_endian} not supported."; exit 1 ;;
1206 esac
1207 case ${with_endian} in
fad92291 1208 big*) tm_file="arc/big.h ${tm_file}"
53426f6c
JR
1209 esac
1210 ;;
b1938888 1211arc*-*-linux*)
fad92291 1212 tm_file="arc/arc-arch.h dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arc/linux.h ${tm_file}"
825f9d0b 1213 tmake_file="${tmake_file} arc/t-multilib-linux arc/t-arc"
f9ccf899
CZ
1214 extra_gcc_objs="driver-arc.o"
1215 if test "x$with_cpu" != x; then
1216 tm_defines="${tm_defines} TARGET_CPU_BUILD=PROCESSOR_$with_cpu"
1217 fi
53426f6c
JR
1218 if test x${with_endian} = x; then
1219 case ${target} in
1220 arc*be-*-* | arc*eb-*-*) with_endian=big ;;
1221 *) with_endian=little ;;
1222 esac
1223 fi
1224 case ${with_endian} in
1225 big|little) ;;
1226 *) echo "with_endian=${with_endian} not supported."; exit 1 ;;
1227 esac
1228 case ${with_endian} in
fad92291 1229 big*) tm_file="arc/big.h ${tm_file}"
53426f6c 1230 esac
fac31afe
VG
1231 # Force .init_array support. The configure script cannot always
1232 # automatically detect that GAS supports it, yet we require it.
1233 gcc_cv_initfini_array=yes
1234 ;;
27204060
JL
1235arm-wrs-vxworks7*)
1236 # We only support VxWorks 7 now on ARM, post SR600. Pre SR600
1237 # VxWorks 7 was transitory and major versions prior to 7 were based
1238 # on long deprecated ABI, not supported at all any more regardless
1239 # of VxWorks.
59793c51 1240 extra_options="${extra_options} arm/vxworks.opt"
27204060
JL
1241 tmake_file="${tmake_file} arm/t-arm arm/t-vxworks arm/t-bpabi"
1242 tm_file="elfos.h arm/elf.h arm/bpabi.h arm/aout.h ${tm_file}"
1243 tm_file="${tm_file} vx-common.h vxworks.h arm/vxworks.h"
86b14bb1 1244 target_cpu_cname="generic-armv7-a"
27204060 1245 need_64bit_hwint=yes
55047c9d 1246 ;;
82a19768
AT
1247arm*-*-freebsd*) # ARM FreeBSD EABI
1248 tm_file="dbxelf.h elfos.h ${fbsd_tm_file} arm/elf.h"
1249 case $target in
1250 arm*b-*-freebsd*)
1251 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1252 ;;
1253 esac
1254 tmake_file="${tmake_file} arm/t-arm arm/t-bpabi"
1255 tm_file="${tm_file} arm/bpabi.h arm/freebsd.h arm/aout.h arm/arm.h"
1256 case $target in
1257 armv6*-*-freebsd*)
b5e204dc 1258 target_cpu_cname="arm1176jzf-s"
c8743fc5
AT
1259 if test $fbsd_major -ge 11; then
1260 tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
1261 fi
82a19768 1262 ;;
eb484969
AT
1263 armv7*-*-freebsd*)
1264 target_cpu_cname="generic-armv7-a"
1265 tm_defines="${tm_defines} TARGET_FREEBSD_ARM_HARD_FLOAT=1"
1266 ;;
d3d3f1af
RE
1267 *)
1268 target_cpu_cname="arm9"
1269 ;;
82a19768
AT
1270 esac
1271 with_tls=${with_tls:-gnu}
1272 ;;
69474c3c 1273arm*-*-netbsdelf*)
7a433140 1274 target_cpu_cname="strongarm"
b27c1082
MT
1275 tmake_file="${tmake_file} arm/t-arm"
1276 tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h"
1277 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1278 case ${target} in
1279 arm*eb-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;;
1280 esac
1281 case ${target} in
1282 arm*-*-netbsdelf-*eabi*)
1283 tm_file="$tm_file arm/bpabi.h arm/netbsd-elf.h arm/netbsd-eabi.h"
1284 tmake_file="$tmake_file arm/t-bpabi arm/t-netbsdeabi"
1285 ;;
1286 *)
1287 tm_file="$tm_file arm/netbsd-elf.h"
1288 tmake_file="$tmake_file arm/t-netbsd"
1289 ;;
1290 esac
1291 tm_file="${tm_file} arm/aout.h arm/arm.h"
1292 case ${target} in
1293 arm*-*-netbsdelf-*eabihf*)
1294 # Hard-float requires at least Arm v5te
1295 target_cpu_cname="arm10e"
1296 tm_defines="${tm_defines} TARGET_DEFAULT_FLOAT_ABI=ARM_FLOAT_ABI_HARD"
1297 ;;
1298 esac
1299 case ${target} in
1300 armv6*) target_cpu_cname="arm1176jzf-s";;
1301 armv7*) target_cpu_cname="generic-armv7-a";;
1302 esac
69474c3c 1303 ;;
b1e21e5a 1304arm*-*-linux-* | arm*-*-uclinuxfdpiceabi)
8e38461c 1305 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"
5fa747a7 1306 extra_options="${extra_options} linux-android.opt"
d3a9662c 1307 case $target in
e3ed9d60 1308 arm*b-*-linux*)
c4cc7bc1
RE
1309 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1310 ;;
d3a9662c 1311 esac
f423a9e4 1312 tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
52e18cdf 1313 tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h"
45d53c67
CL
1314 case $target in
1315 arm*-*-uclinuxfdpiceabi)
1316 tm_file="$tm_file arm/uclinuxfdpiceabi.h"
1317 ;;
1318 esac
87fd6bde
RE
1319 # Generation of floating-point instructions requires at least ARMv5te.
1320 if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then
1321 target_cpu_cname="arm10e"
1322 else
1323 target_cpu_cname="arm10tdmi"
1324 fi
c4cc7bc1 1325 # Define multilib configuration for arm-linux-androideabi.
077fc835 1326 case ${target} in
c4cc7bc1
RE
1327 *-androideabi)
1328 tmake_file="$tmake_file arm/t-linux-androideabi"
077fc835
KH
1329 ;;
1330 esac
c4cc7bc1
RE
1331 # The EABI requires the use of __cxa_atexit.
1332 default_use_cxa_atexit=yes
7cf13d1f 1333 with_tls=${with_tls:-gnu}
61ed06c3 1334 ;;
c4cc7bc1 1335arm*-*-uclinux*eabi*) # ARM ucLinux
207bf79d 1336 tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h glibc-stdint.h"
aefe4056 1337 tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi"
52e18cdf 1338 tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h arm/aout.h arm/arm.h"
d3d3f1af 1339 target_cpu_cname="arm7tdmi"
c4cc7bc1
RE
1340 # The EABI requires the use of __cxa_atexit.
1341 default_use_cxa_atexit=yes
0e5a4ad8 1342 ;;
bfdd80d4
JS
1343arm*-*-phoenix*)
1344 tm_file="elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
1345 tm_file="${tm_file} newlib-stdint.h phoenix.h"
1346 tm_file="${tm_file} arm/aout.h arm/arm.h"
1347 tmake_file="${tmake_file} arm/t-arm arm/t-bpabi arm/t-phoenix"
d3d3f1af 1348 target_cpu_cname="arm7tdmi"
bfdd80d4 1349 ;;
491b3c5f 1350arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems* | arm*-*-fuchsia*)
ac8d93a7
SL
1351 case ${target} in
1352 arm*eb-*-eabi*)
1353 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
1354 esac
e6fc6c9b 1355 default_use_cxa_atexit=yes
b3f8d95d 1356 tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h"
aefe4056 1357 tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf"
d3d3f1af 1358 target_cpu_cname="arm7tdmi"
b3f8d95d 1359 case ${target} in
f9a02408 1360 arm*-*-eabi*)
51b9db92 1361 tm_file="$tm_file newlib-stdint.h"
e04d8a63 1362 tmake_file="${tmake_file} arm/t-bpabi"
207bf79d 1363 use_gcc_stdint=wrap
f9a02408 1364 ;;
491b3c5f
JC
1365 arm*-*-fuchsia*)
1366 tm_file="${tm_file} fuchsia.h arm/fuchsia-elf.h glibc-stdint.h"
be5c4e06 1367 tmake_file="${tmake_file} arm/t-bpabi arm/t-fuchsia"
bf35d17a 1368 target_cpu_cname="generic-armv7-a"
491b3c5f 1369 ;;
05242957 1370 arm*-*-rtems*)
5be0a29b
SH
1371 tm_file="${tm_file} rtems.h arm/rtems.h newlib-stdint.h"
1372 tmake_file="${tmake_file} arm/t-bpabi arm/t-rtems"
e36c5271 1373 ;;
b3f8d95d
MM
1374 arm*-*-symbianelf*)
1375 tm_file="${tm_file} arm/symbian.h"
f9a02408
MM
1376 # We do not include t-bpabi for Symbian OS because the system
1377 # provides its own implementation of the BPABI functions.
c0354bf4 1378 tmake_file="${tmake_file} arm/t-symbian"
d3d3f1af 1379 target_cpu_cname="arm10tdmi"
b3f8d95d
MM
1380 ;;
1381 esac
52e18cdf 1382 tm_file="${tm_file} arm/aout.h arm/arm.h"
336bd6ac 1383 ;;
61ed06c3 1384avr-*-*)
4a2caf6c 1385 tm_file="elfos.h avr/elf.h avr/avr-arch.h avr/avr.h avr/specs.h dbxelf.h avr/avr-stdint.h"
b588ae30
GJL
1386 if test x${with_avrlibc} != xno; then
1387 tm_file="${tm_file} ${cpu_type}/avrlibc.h"
1388 tm_defines="${tm_defines} WITH_AVRLIBC"
1389 fi
f30dd607
GJL
1390 # Work out avr_double_comparison which is 2 or 3 and is used in
1391 # target hook FLOAT_LIB_COMPARE_RETURNS_BOOL to determine whether
1392 # DFmode comparisons return 3-state or 2-state results.
1393 case y${with_double_comparison} in
1394 y | ytristate)
1395 avr_double_comparison=3
1396 ;;
1397 ybool | ylibf7)
1398 avr_double_comparison=2
1399 ;;
1400 *)
1401 echo "Error: --with-double-comparison= can only be used with: 'tristate', 'bool', 'libf7'" 1>&2
1402 exit 1
1403 ;;
1404 esac
1405 case "y${with_libf7}" in
1406 yno)
1407 # avr_double_comparison as set above.
1408 ;;
1409 ylibgcc)
1410 avr_double_comparison=2
1411 tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1412 ;;
1413 y | yyes | ymath-symbols)
1414 avr_double_comparison=2
1415 tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1416 tm_defines="${tm_defines} WITH_LIBF7_MATH"
1417 tm_defines="${tm_defines} WITH_LIBF7_MATH_SYMBOLS"
1418 ;;
1419 ymath)
1420 avr_double_comparison=2
1421 tm_defines="${tm_defines} WITH_LIBF7_LIBGCC"
1422 tm_defines="${tm_defines} WITH_LIBF7_MATH"
1423 ;;
1424 *)
1425 echo "Error: --with-libf7=${with_libf7} but can only be used with: 'libgcc', 'math', 'math-symbols', 'yes', 'no'" 1>&2
1426 exit 1
1427 ;;
1428 esac
1429 tm_defines="${tm_defines} WITH_DOUBLE_COMPARISON=${avr_double_comparison}"
29f3def3 1430 case y${with_double} in
f30dd607 1431 y32)
29f3def3
GJL
1432 avr_double=32
1433 tm_defines="${tm_defines} HAVE_DOUBLE32"
1434 ;;
1435 y64)
1436 avr_double=64
1437 tm_defines="${tm_defines} HAVE_DOUBLE64"
1438 ;;
1439 y64,32)
1440 avr_double=64
1441 avr_double_multilib=1
1442 tm_defines="${tm_defines} HAVE_DOUBLE32"
1443 tm_defines="${tm_defines} HAVE_DOUBLE64"
1444 tm_defines="${tm_defines} HAVE_DOUBLE_MULTILIB"
1445 ;;
f30dd607 1446 y | y32,64)
29f3def3
GJL
1447 avr_double=32
1448 avr_double_multilib=1
1449 tm_defines="${tm_defines} HAVE_DOUBLE32"
1450 tm_defines="${tm_defines} HAVE_DOUBLE64"
1451 tm_defines="${tm_defines} HAVE_DOUBLE_MULTILIB"
1452 ;;
1453 *)
1454 echo "Error: --with-double= can only be used with: '32', '32,64', '64,32', '64'" 1>&2
1455 exit 1
1456 ;;
1457 esac
1458 case y${with_long_double} in
f30dd607 1459 y32)
29f3def3
GJL
1460 avr_long_double=32
1461 tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1462 ;;
1463 y64)
1464 avr_long_double=64
1465 tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1466 ;;
f30dd607 1467 y | y64,32)
29f3def3
GJL
1468 avr_long_double=64
1469 avr_long_double_multilib=1
1470 tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1471 tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1472 tm_defines="${tm_defines} HAVE_LONG_DOUBLE_MULTILIB"
1473 ;;
1474 y32,64)
1475 avr_long_double=32
1476 avr_long_double_multilib=1
1477 tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1478 tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1479 tm_defines="${tm_defines} HAVE_LONG_DOUBLE_MULTILIB"
1480 ;;
1481 ydouble)
1482 avr_long_double=${avr_double}
1483 tm_defines="${tm_defines} HAVE_LONG_DOUBLE_IS_DOUBLE"
1484 if test y${avr_double_multilib} = y1; then
1485 tm_defines="${tm_defines} HAVE_LONG_DOUBLE32"
1486 tm_defines="${tm_defines} HAVE_LONG_DOUBLE64"
1487 else
1488 tm_defines="${tm_defines} HAVE_LONG_DOUBLE${avr_long_double}"
1489 fi
1490 ;;
1491 *)
1492 echo "Error: --with-long_double= can only be used with: '32', '32,64', '64,32', '64', 'double'" 1>&2
1493 exit 1
1494 ;;
1495 esac
1496 if test ${avr_long_double}x${avr_long_double_multilib}y${avr_double_multilib}z = 32xy1z; then
1497 if test y${with_long_double} != ydouble; then
1498 echo "Error: --with-double=${with_double} requests a multilib for double, but long double is always 32 bits wide due to --with-long-double=${with_long_double}" 1>&2
1499 exit 1
1500 fi
1501 fi
1502 if test ${avr_double}x${avr_long_double_multilib}y${avr_double_multilib}z = 64x1yz; then
1503 echo "Error: --with-long-double=${with_long_double} requests a multilib for long double, but double is always 64 bits wide due to --with-double=64" 1>&2
1504 exit 1
1505 fi
1506 if test y${avr_double}${avr_long_double} = y6432; then
1507 echo "Error: double default of 64 bits from --with-double=${with_double} conflicts with default of 32 bits for long double from --with-long-double=${with_long_double}" 1>&2
1508 exit 1
1509 fi
1510 tm_defines="${tm_defines} WITH_DOUBLE${avr_double}"
1511 tm_defines="${tm_defines} WITH_LONG_DOUBLE${avr_long_double}"
4de80584 1512 tmake_file="${tmake_file} avr/t-avr avr/t-multilib"
207bf79d 1513 use_gcc_stdint=wrap
4a2caf6c 1514 extra_gcc_objs="driver-avr.o avr-devices.o"
6c7dfafe 1515 extra_objs="avr-devices.o avr-log.o"
61ed06c3 1516 ;;
0d4a78eb 1517bfin*-elf*)
207bf79d 1518 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
6bad46f7
JZ
1519 tmake_file=bfin/t-bfin-elf
1520 use_collect2=no
1521 ;;
1f4174d4 1522bfin*-uclinux*)
8e38461c 1523 tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/uclinux.h"
6bad46f7 1524 tmake_file=bfin/t-bfin-uclinux
6bad46f7
JZ
1525 use_collect2=no
1526 ;;
344189f9 1527bfin*-linux-uclibc*)
8e38461c 1528 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"
e08cf345 1529 tmake_file="${tmake_file} bfin/t-bfin-linux"
6bad46f7
JZ
1530 use_collect2=no
1531 ;;
152167d5 1532bfin*-rtems*)
1ddc8057 1533 tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h bfin/rtems.h rtems.h newlib-stdint.h"
aefe4056 1534 tmake_file="${tmake_file} bfin/t-rtems"
6bad46f7 1535 ;;
0d4a78eb 1536bfin*-*)
207bf79d 1537 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h bfin/elf.h"
6bad46f7 1538 use_collect2=no
207bf79d 1539 use_gcc_stdint=wrap
6bad46f7 1540 ;;
91dfef96 1541bpf-*-*)
c9d44022 1542 tm_file="elfos.h ${tm_file}"
91dfef96
JM
1543 tmake_file="${tmake_file} bpf/t-bpf"
1544 use_collect2=no
1545 extra_headers="bpf-helpers.h"
1546 use_gcc_stdint=provide
1547 ;;
b25364a0 1548cr16-*-elf)
db48a9e3 1549 tm_file="elfos.h ${tm_file} newlib-stdint.h"
b25364a0
S
1550 tmake_file="${tmake_file} cr16/t-cr16 "
1551 use_collect2=no
1552 ;;
0b85d816 1553cris-*-elf | cris-*-none)
207bf79d 1554 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
0b85d816
HPN
1555 tmake_file="cris/t-cris cris/t-elfmulti"
1556 gas=yes
2a186d97 1557 extra_options="${extra_options} cris/elf.opt"
207bf79d 1558 use_gcc_stdint=wrap
0b85d816 1559 ;;
56856b58
J
1560csky-*-*)
1561 if test x${with_endian} != x; then
1562 case ${with_endian} in
1563 big|little) ;;
1564 *)
1565 echo "with_endian=${with_endian} not supported."
1566 exit 1
1567 ;;
1568 esac
1569 fi
1570 if test x${with_float} != x; then
1571 case ${with_float} in
1572 soft | hard) ;;
1573 *) echo
1574 "Unknown floating point type used in --with-float=$with_float"
1575 exit 1
1576 ;;
1577 esac
1578 fi
1579 tm_file="csky/csky.h"
1580 md_file="csky/csky.md"
1581 out_file="csky/csky.c"
1582 tm_p_file="${tm_p_file} csky/csky-protos.h"
1583 extra_options="${extra_options} csky/csky_tables.opt"
1584
1585 if test x${enable_tpf_debug} = xyes; then
1586 tm_defines="${tm_defines} ENABLE_TPF_DEBUG"
1587 fi
1588
1589 case ${target} in
1590 csky-*-elf*)
1591 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} csky/csky-elf.h"
1592 tmake_file="csky/t-csky csky/t-csky-elf"
1593 default_use_cxa_atexit=no
f8ede887 1594 use_gcc_stdint=wrap
56856b58
J
1595 ;;
1596 csky-*-linux*)
1597 tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} csky/csky-linux-elf.h"
1598 tmake_file="${tmake_file} csky/t-csky csky/t-csky-linux"
1599
1600 if test "x${enable_multilib}" = xyes ; then
1601 tm_file="$tm_file ./sysroot-suffix.h"
1602 tmake_file="${tmake_file} csky/t-sysroot-suffix"
1603 fi
1604
1605 case ${target} in
1606 csky-*-linux-gnu*)
1607 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
be3399c5
XQ
1608 # Force .init_array support. The configure script cannot always
1609 # automatically detect that GAS supports it, yet we require it.
1610 gcc_cv_initfini_array=yes
56856b58
J
1611 ;;
1612 csky-*-linux-uclibc*)
1613 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
1614 default_use_cxa_atexit=no
1615 ;;
1616 *)
1617 echo "Unknown target $target"
1618 exit 1
1619 ;;
1620 esac
1621 ;;
1622 *)
1623 echo "Unknown target $target"
1624 exit 1
1625 ;;
1626 esac
1627 ;;
64b371b1
SH
1628epiphany-*-elf | epiphany-*-rtems*)
1629 tm_file="${tm_file} dbxelf.h elfos.h"
1630 tmake_file="${tmake_file} epiphany/t-epiphany"
1631 case ${target} in
1632 epiphany-*-rtems*)
1633 tm_file="${tm_file} rtems.h epiphany/rtems.h newlib-stdint.h"
1634 ;;
1635 *)
1636 tm_file="${tm_file} newlib-stdint.h"
1637 ;;
1638 esac
feeeff5c 1639 extra_options="${extra_options} fused-madd.opt"
64b371b1 1640 extra_objs="${extra_objs} mode-switch-use.o resolve-sw-modes.o"
feeeff5c
JR
1641 tm_defines="${tm_defines} EPIPHANY_STACK_OFFSET=${with_stack_offset:-8}"
1642 extra_headers="epiphany_intrinsics.h"
1643 ;;
61ed06c3 1644fr30-*-elf)
35766c1d 1645 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
61ed06c3 1646 ;;
36a05131 1647frv-*-elf)
a3724010 1648 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
36a05131
BS
1649 tmake_file=frv/t-frv
1650 ;;
34208acf 1651frv-*-*linux*)
a3724010 1652 tm_file="dbxelf.h elfos.h ${tm_file} \
8e38461c 1653 gnu-user.h linux.h glibc-stdint.h frv/linux.h"
65d151a7 1654 tmake_file="${tmake_file} frv/t-frv frv/t-linux"
34208acf 1655 ;;
fef939d6
JB
1656ft32-*-elf)
1657 gas=yes
1658 gnu_ld=yes
1659 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
1660 tmake_file="${tmake_file} ft32/t-ft32"
1661 ;;
7431c1a1
AS
1662amdgcn-*-amdhsa)
1663 tm_file="elfos.h gcn/gcn-hsa.h gcn/gcn.h newlib-stdint.h"
1664 tmake_file="gcn/t-gcn-hsa"
1665 native_system_header_dir=/include
1666 extra_modes=gcn/gcn-modes.def
1667 extra_objs="${extra_objs} gcn-tree.o"
1668 extra_gcc_objs="driver-gcn.o"
1669 case "$host" in
1670 x86_64*-*-linux-gnu )
1671 if test "$ac_cv_search_dlopen" != no; then
1672 extra_programs="${extra_programs} gcn-run\$(exeext)"
1673 fi
1674 ;;
1675 esac
1676 if test x$enable_as_accelerator = xyes; then
1677 extra_programs="${extra_programs} mkoffload\$(exeext)"
1678 tm_file="${tm_file} gcn/offload.h"
1679 fi
7039cebf
KCY
1680 # Force .init_array support.
1681 gcc_cv_initfini_array=yes
76d46331 1682 thread_file=gcn
7431c1a1 1683 ;;
cceb575c
AG
1684moxie-*-elf)
1685 gas=yes
1686 gnu_ld=yes
804a304d 1687 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
aca0b0b3 1688 tmake_file="${tmake_file} moxie/t-moxie"
cceb575c 1689 ;;
23865616
AG
1690moxie-*-uclinux*)
1691 gas=yes
1692 gnu_ld=yes
8e38461c 1693 tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
aca0b0b3 1694 tmake_file="${tmake_file} moxie/t-moxie"
23865616 1695 ;;
1242723c 1696moxie-*-rtems*)
aefe4056 1697 tmake_file="${tmake_file} moxie/t-moxie"
1242723c
AG
1698 tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
1699 ;;
17522262
AG
1700moxie-*-moxiebox*)
1701 gas=yes
1702 gnu_ld=yes
1703 tm_file="${tm_file} dbxelf.h elfos.h moxie/moxiebox.h newlib-stdint.h"
1704 tmake_file="${tmake_file} moxie/t-moxiebox"
1705 ;;
9f5b774b 1706h8300-*-elf*)
5f73c6cc 1707 tmake_file="h8300/t-h8300"
207bf79d 1708 tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
9f5b774b 1709 ;;
2f6bd6eb
YS
1710h8300-*-linux*)
1711 tmake_file="${tmake_file} h8300/t-h8300 h8300/t-linux"
1712 tm_file="h8300/h8300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h h8300/linux.h"
1713 ;;
cd985f66 1714hppa*64*-*-linux*)
d711cf67 1715 target_cpu_default="MASK_PA_11|MASK_PA_20"
8e38461c 1716 tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
207bf79d
JM
1717 glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
1718 pa/pa64-linux.h"
40b1bb9f
JDA
1719 tmake_file="${tmake_file} pa/t-pa pa/t-linux"
1720 d_target_objs="${d_target_objs} pa-d.o"
c21a2372
AM
1721 gas=yes gnu_ld=yes
1722 ;;
cd985f66 1723hppa*-*-linux*)
dbc4d77c 1724 target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS|MASK_CALLER_COPIES"
8e38461c 1725 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h pa/pa-linux.h \
c21a2372 1726 pa/pa32-regs.h pa/pa32-linux.h"
b8559e81
JDA
1727 tmake_file="${tmake_file} pa/t-pa pa/t-linux"
1728 d_target_objs="${d_target_objs} pa-d.o"
61ed06c3 1729 ;;
17f293b0
MK
1730hppa*-*-openbsd*)
1731 target_cpu_default="MASK_PA_11"
1732 tm_file="${tm_file} dbxelf.h elfos.h openbsd.h openbsd-stdint.h openbsd-libpthread.h \
1733 pa/pa-openbsd.h pa/pa32-regs.h pa/pa32-openbsd.h"
17f293b0 1734 extra_options="${extra_options} openbsd.opt"
40b1bb9f
JDA
1735 tmake_file="pa/t-pa"
1736 d_target_objs="${d_target_objs} pa-d.o"
17f293b0
MK
1737 gas=yes
1738 gnu_ld=yes
1739 ;;
428642b1
MT
1740hppa*-*-netbsd*)
1741 target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
1742 tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} \
1743 pa/pa-netbsd.h pa/pa32-regs.h pa/pa32-netbsd.h"
1744 tmake_file="${tmake_file}"
1745 tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
1746 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
1747 ;;
d711cf67
JDA
1748hppa[12]*-*-hpux10*)
1749 case ${target} in
1750 hppa1.1-*-* | hppa2*-*-*)
1751 target_cpu_default="MASK_PA_11"
1752 ;;
1753 esac
1754 tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
1755 pa/pa-hpux.h pa/pa-hpux10.h"
b24d1acf 1756 extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux10.opt"
d711cf67
JDA
1757 case ${target} in
1758 *-*-hpux10.[1-9]*)
1759 tm_file="${tm_file} pa/pa-hpux1010.h"
66617831 1760 extra_options="${extra_options} pa/pa-hpux1010.opt"
d711cf67 1761 ;;
61ed06c3 1762 esac
be3e4ef6
JDA
1763 use_gcc_stdint=provide
1764 tm_file="${tm_file} hpux-stdint.h"
40b1bb9f
JDA
1765 tmake_file="pa/t-pa t-slibgcc"
1766 d_target_objs="${d_target_objs} pa-d.o"
615be2cf
NN
1767 case ${enable_threads} in
1768 "")
1769 if test x$have_pthread_h = xyes ; then
1770 tmake_file="${tmake_file} pa/t-dce-thr"
1771 fi
1772 ;;
1773 yes | dce)
1774 tmake_file="${tmake_file} pa/t-dce-thr"
1775 ;;
61ed06c3 1776 esac
61ed06c3 1777 use_collect2=yes
543b6009 1778 gas=yes
a65264ae 1779 if test "x$with_dwarf2" != x; then
5cdb5d59 1780 echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
a65264ae
JDA
1781 dwarf2=no
1782 fi
61ed06c3
HPN
1783 ;;
1784hppa*64*-*-hpux11*)
d711cf67 1785 target_cpu_default="MASK_PA_11|MASK_PA_20"
7b79fe71
JDA
1786 if test x$gnu_ld = xyes
1787 then
d711cf67 1788 target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
7b79fe71 1789 fi
543b6009
SE
1790 tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \
1791 pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \
1792 pa/pa-hpux11.h"
d711cf67 1793 case ${target} in
fc4538e4 1794 *-*-hpux11.[12]*)
d711cf67 1795 tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h"
66617831 1796 extra_options="${extra_options} pa/pa-hpux1111.opt"
d711cf67 1797 ;;
fc4538e4
SE
1798 *-*-hpux11.[3-9]*)
1799 tm_file="${tm_file} pa/pa-hpux1131.h pa/pa-64.h pa/pa64-hpux.h"
1800 extra_options="${extra_options} pa/pa-hpux1131.opt"
1801 ;;
d711cf67
JDA
1802 *)
1803 tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h"
1804 ;;
1805 esac
66617831 1806 extra_options="${extra_options} pa/pa-hpux.opt \
e543b94c 1807 pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
40b1bb9f
JDA
1808 tmake_file="pa/t-pa t-slibgcc"
1809 d_target_objs="${d_target_objs} pa-d.o"
7e2055ec 1810 case x${enable_threads} in
27ca3a61 1811 x | xyes | xposix )
f7288899 1812 thread_file=posix
7e2055ec
ZW
1813 ;;
1814 esac
543b6009 1815 gas=yes
9a17c91d
SE
1816 case ${target} in
1817 *-*-hpux11.[01]*)
1818 use_gcc_stdint=provide
1819 tm_file="${tm_file} hpux-stdint.h"
1820 ;;
1821 *-*-hpux11.[23]*)
1822 use_gcc_stdint=wrap
1823 tm_file="${tm_file} hpux-stdint.h"
1824 ;;
1825 esac
61ed06c3 1826 ;;
d711cf67
JDA
1827hppa[12]*-*-hpux11*)
1828 case ${target} in
1829 hppa1.1-*-* | hppa2*-*-*)
1830 target_cpu_default="MASK_PA_11"
1831 ;;
1832 esac
1833 tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
66617831 1834 pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h"
e543b94c
JM
1835 extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt \
1836 hpux11.opt"
d711cf67 1837 case ${target} in
fc4538e4 1838 *-*-hpux11.[12]*)
d711cf67 1839 tm_file="${tm_file} pa/pa-hpux1111.h"
66617831 1840 extra_options="${extra_options} pa/pa-hpux1111.opt"
7e2055ec 1841 ;;
fc4538e4
SE
1842 *-*-hpux11.[3-9]*)
1843 tm_file="${tm_file} pa/pa-hpux1131.h"
1844 extra_options="${extra_options} pa/pa-hpux1131.opt"
1845 ;;
7e2055ec 1846 esac
40b1bb9f
JDA
1847 tmake_file="pa/t-pa t-slibgcc"
1848 d_target_objs="${d_target_objs} pa-d.o"
7e2055ec 1849 case x${enable_threads} in
27ca3a61 1850 x | xyes | xposix )
f7288899 1851 thread_file=posix
7e2055ec
ZW
1852 ;;
1853 esac
61ed06c3 1854 use_collect2=yes
543b6009 1855 gas=yes
9a17c91d
SE
1856 case ${target} in
1857 *-*-hpux11.[01]*)
1858 use_gcc_stdint=provide
1859 tm_file="${tm_file} hpux-stdint.h"
1860 ;;
1861 *-*-hpux11.[23]*)
1862 use_gcc_stdint=wrap
1863 tm_file="${tm_file} hpux-stdint.h"
1864 ;;
1865 esac
a65264ae 1866 if test "x$with_dwarf2" != x; then
5cdb5d59 1867 echo "Warning: dwarf2 debug format is not supported for this target, --with-dwarf2 ignored" 1>&2
a65264ae
JDA
1868 dwarf2=no
1869 fi
61ed06c3 1870 ;;
c2ff7104
IS
1871i[34567]86-*-darwin1[89]*)
1872 echo "Error: 32bit target is not supported after Darwin17" 1>&2
1873 ;;
b069de3b 1874i[34567]86-*-darwin*)
c6b9174f 1875 need_64bit_isa=yes
c0aefbbe
IS
1876 # Baseline choice for a machine that allows m64 support.
1877 with_cpu=${with_cpu:-core2}
c2ff7104
IS
1878 tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch t-slibgcc"
1879 tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
1880 ;;
1881x86_64-*-darwin1[89]* | x86_64-*-darwin2[01]*)
1882 # Only 64b from now
1883 with_cpu=${with_cpu:-core2}
b040f2be 1884 tmake_file="${tmake_file} t-slibgcc"
b069de3b 1885 ;;
9519e677 1886x86_64-*-darwin*)
c0aefbbe 1887 with_cpu=${with_cpu:-core2}
c2ff7104
IS
1888 tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
1889 tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
9519e677 1890 ;;
d9063947
L
1891i[34567]86-*-elfiamcu)
1892 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/iamcu.h"
1893 ;;
61ed06c3 1894i[34567]86-*-elf*)
207bf79d 1895 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
a10dc289
HK
1896 ;;
1897x86_64-*-elf*)
207bf79d 1898 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
61ed06c3 1899 ;;
d6944908 1900x86_64-*-rtems*)
6fa08cbe 1901 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/rtemself.h rtems.h"
d6944908 1902 ;;
5a579c3b
LE
1903i[34567]86-*-rdos*)
1904 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/rdos.h"
1905 ;;
1906x86_64-*-rdos*)
1907 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"
1908 tmake_file="i386/t-i386elf t-svr4"
1909 ;;
dbed5a9b
JM
1910i[34567]86-*-dragonfly*)
1911 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/dragonfly.h"
1912 tmake_file="${tmake_file} i386/t-crtstuff"
1913 ;;
1914x86_64-*-dragonfly*)
1915 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h dragonfly.h dragonfly-stdint.h i386/x86-64.h i386/dragonfly.h"
1916 tmake_file="${tmake_file} i386/t-crtstuff"
1917 ;;
61ed06c3 1918i[34567]86-*-freebsd*)
39ed301b 1919 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
e564e618
DB
1920 ;;
1921x86_64-*-freebsd*)
39ed301b 1922 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"
61ed06c3 1923 ;;
6ea0279f 1924i[34567]86-*-netbsdelf*)
dfe2677b 1925 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
a4714d14 1926 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
6ea0279f 1927 ;;
7c884404 1928x86_64-*-netbsd*)
dfe2677b 1929 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h"
a4714d14 1930 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
7c884404 1931 ;;
378b66d4 1932i[34567]86-*-openbsd*)
75a3bd9d 1933 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
aa58f943 1934 tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/openbsdelf.h"
5369e2d4 1935 extra_options="${extra_options} openbsd.opt"
378b66d4
ME
1936 gas=yes
1937 gnu_ld=yes
378b66d4 1938 ;;
613061fd
MK
1939x86_64-*-openbsd*)
1940 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h"
1941 tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h i386/x86-64.h i386/openbsdelf.h"
1942 extra_options="${extra_options} openbsd.opt"
1943 gas=yes
1944 gnu_ld=yes
1945 ;;
8466af06 1946i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
cfafe973 1947 # Intel 80386's running GNU/*
61ed06c3 1948 # with ELF format using glibc 2
6c0170ea 1949 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h"
cfafe973 1950 case ${target} in
0f45f0f5 1951 i[34567]86-*-linux*)
5fa747a7
MK
1952 tm_file="${tm_file} linux.h linux-android.h"
1953 extra_options="${extra_options} linux-android.opt"
0f45f0f5 1954 if test x$enable_targets = xall; then
6acc8a3c 1955 tm_file="${tm_file} i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h i386/linux-common.h i386/linux64.h"
0f45f0f5 1956 tm_defines="${tm_defines} TARGET_BI_ARCH=1"
ff473280 1957 tmake_file="${tmake_file} i386/t-linux64"
f0ea7581
L
1958 x86_multilibs="${with_multilib_list}"
1959 if test "$x86_multilibs" = "default"; then
1960 x86_multilibs="m64,m32"
1961 fi
1962 x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
1963 for x86_multilib in ${x86_multilibs}; do
1964 case ${x86_multilib} in
1965 m32 | m64 | mx32)
1966 TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
1967 ;;
1968 *)
1969 echo "--with-multilib-list=${x86_with_multilib} not supported."
1970 exit 1
1971 esac
1972 done
1973 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
c6b9174f 1974 need_64bit_isa=yes
646bdeab 1975 if test x$with_cpu = x; then
8981c15b
JM
1976 if test x$with_cpu_64 = x; then
1977 with_cpu_64=generic
1978 fi
646bdeab
L
1979 else
1980 case " $x86_cpus $x86_archs $x86_64_archs " in
1981 *" $with_cpu "*)
1982 ;;
1983 *)
1984 echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
1985 echo "$x86_cpus $x86_archs $x86_64_archs " 1>&2
1986 exit 1
1987 ;;
1988 esac
1989 fi
0f45f0f5 1990 else
6acc8a3c 1991 tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h i386/linux-common.h i386/linux.h"
0f45f0f5
JM
1992 fi
1993 ;;
63708bf5 1994 i[34567]86-*-kfreebsd*-gnu)
70a69509 1995 tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kfreebsd-gnu.h i386/kfreebsd-gnu.h"
63708bf5
UB
1996 ;;
1997 i[34567]86-*-kopensolaris*-gnu)
70a69509 1998 tm_file="${tm_file} i386/gnu-user-common.h i386/gnu-user.h kopensolaris-gnu.h i386/kopensolaris-gnu.h"
63708bf5
UB
1999 ;;
2000 i[34567]86-*-gnu*)
70a69509 2001 tm_file="$tm_file i386/gnu-user-common.h i386/gnu-user.h gnu.h i386/gnu.h"
63708bf5 2002 ;;
cfafe973 2003 esac
61ed06c3 2004 ;;
8466af06 2005x86_64-*-linux* | x86_64-*-kfreebsd*-gnu)
6c0170ea 2006 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
70a69509 2007 i386/x86-64.h i386/gnu-user-common.h i386/gnu-user64.h"
44379973 2008 case ${target} in
f6c5fbfd 2009 x86_64-*-linux*)
5fa747a7
MK
2010 tm_file="${tm_file} linux.h linux-android.h i386/linux-common.h i386/linux64.h"
2011 extra_options="${extra_options} linux-android.opt"
63708bf5
UB
2012 ;;
2013 x86_64-*-kfreebsd*-gnu)
2014 tm_file="${tm_file} kfreebsd-gnu.h i386/kfreebsd-gnu64.h"
2015 ;;
44379973 2016 esac
5f73c6cc 2017 tmake_file="${tmake_file} i386/t-linux64"
f0ea7581
L
2018 x86_multilibs="${with_multilib_list}"
2019 if test "$x86_multilibs" = "default"; then
9287b168
L
2020 case ${with_abi} in
2021 x32 | mx32)
2022 x86_multilibs="mx32"
2023 ;;
2024 *)
2025 x86_multilibs="m64,m32"
2026 ;;
2027 esac
f0ea7581
L
2028 fi
2029 x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
2030 for x86_multilib in ${x86_multilibs}; do
2031 case ${x86_multilib} in
2032 m32 | m64 | mx32)
2033 TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${x86_multilib}"
2034 ;;
2035 *)
2036 echo "--with-multilib-list=${x86_with_multilib} not supported."
2037 exit 1
2038 esac
2039 done
2040 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
14f73b5a 2041 ;;
61ed06c3
HPN
2042i[34567]86-pc-msdosdjgpp*)
2043 xm_file=i386/xm-djgpp.h
27f98305 2044 tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h i386/djgpp-stdint.h"
08b2bad2 2045 native_system_header_dir=/dev/env/DJDIR/include
6ac49599 2046 extra_options="${extra_options} i386/djgpp.opt"
61ed06c3
HPN
2047 gnu_ld=yes
2048 gas=yes
3e3877f8 2049 use_gcc_stdint=wrap
61ed06c3 2050 ;;
61ed06c3 2051i[34567]86-*-lynxos*)
4f587cb0
AN
2052 xm_defines=POSIX
2053 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h"
5f73c6cc 2054 tmake_file="${tmake_file} t-lynx"
6ac49599 2055 extra_options="${extra_options} lynx.opt"
4f587cb0
AN
2056 thread_file=lynx
2057 gnu_ld=yes
2058 gas=yes
61ed06c3 2059 ;;
f2feed2c 2060i[34567]86-*-nto-qnx*)
7f260570 2061 tm_file="${tm_file} i386/att.h dbxelf.h tm-dwarf2.h elfos.h i386/unix.h i386/nto.h"
fc523387 2062 extra_options="${extra_options} i386/nto.opt"
f2feed2c
GP
2063 gnu_ld=yes
2064 gas=yes
2065 ;;
c7bdf0a6 2066i[34567]86-*-rtems*)
207bf79d 2067 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"
aefe4056 2068 tmake_file="${tmake_file} i386/t-rtems"
61ed06c3 2069 ;;
ccd1242e 2070i[34567]86-*-solaris2* | x86_64-*-solaris2*)
9d151aff
RO
2071 # Set default arch_32 to pentium4, tune_32 to generic like the other
2072 # i386 targets, although config.guess defaults to i386-pc-solaris2*.
d9f069ab 2073 with_arch_32=${with_arch_32:-pentium4}
9af27220 2074 with_tune_32=${with_tune_32:-generic}
2cf03b11 2075 tm_file="${tm_file} i386/unix.h i386/att.h ${sol2_tm_file_head} i386/x86-64.h ${sol2_tm_file_tail}"
d9f069ab 2076 tm_defines="${tm_defines} TARGET_BI_ARCH=1"
2cf03b11 2077 tmake_file="$tmake_file i386/t-sol2"
d9f069ab
RO
2078 need_64bit_isa=yes
2079 if test x$with_cpu = x; then
2080 if test x$with_cpu_64 = x; then
2081 with_cpu_64=generic
646bdeab 2082 fi
d9f069ab
RO
2083 else
2084 case " $x86_cpus $x86_archs $x86_64_archs " in
2085 *" $with_cpu "*)
2086 ;;
2087 *)
2088 echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
2089 echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
2090 exit 1
2091 ;;
2092 esac
2093 fi
61ed06c3 2094 ;;
9a835ba4 2095i[4567]86-wrs-vxworks*|x86_64-wrs-vxworks7*)
50567938
JL
2096 tm_file="${tm_file} i386/unix.h i386/att.h elfos.h"
2097 case ${target} in
2098 x86_64-*)
2099 need_64bit_isa=yes
2100 tm_file="${tm_file} i386/x86-64.h"
2101 ;;
2102 esac
2103 tm_file="${tm_file} vx-common.h"
d442d7d9
PE
2104 case ${target} in
2105 *-vxworksae*)
4ce351de 2106 tm_file="${tm_file} vxworksae.h i386/vxworks.h i386/vxworksae.h"
d442d7d9
PE
2107 tmake_file="${tmake_file} i386/t-vxworks i386/t-vxworksae"
2108 ;;
2109 *)
4ce351de 2110 tm_file="${tm_file} vxworks.h i386/vxworks.h"
d442d7d9
PE
2111 tmake_file="${tmake_file} i386/t-vxworks"
2112 ;;
2113 esac
55047c9d 2114 ;;
ebb9f8b0 2115i[34567]86-*-cygwin*)
bb2aaded 2116 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"
4dc0535b 2117 xm_file=i386/xm-cygwin.h
f9989b51 2118 tmake_file="${tmake_file} i386/t-cygming t-slibgcc"
7c0b7150 2119 target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.c"
301f4402 2120 extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
41f59cda 2121 extra_objs="${extra_objs} winnt.o winnt-stubs.o"
3edeb30d
DK
2122 c_target_objs="${c_target_objs} msformat-c.o"
2123 cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
61ed06c3 2124 if test x$enable_threads = xyes; then
70e5e841 2125 thread_file='posix'
61ed06c3 2126 fi
301f4402 2127 default_use_cxa_atexit=yes
bb2aaded 2128 use_gcc_stdint=wrap
61ed06c3 2129 ;;
b802ae5c
KT
2130x86_64-*-cygwin*)
2131 need_64bit_isa=yes
2132 tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/cygwin.h i386/cygwin-w64.h i386/cygwin-stdint.h"
2133 xm_file=i386/xm-cygwin.h
2134 tmake_file="${tmake_file} i386/t-cygming t-slibgcc i386/t-cygwin-w64"
7c0b7150 2135 target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.c"
301f4402 2136 extra_options="${extra_options} i386/cygming.opt i386/cygwin.opt"
41f59cda 2137 extra_objs="${extra_objs} winnt.o winnt-stubs.o"
b802ae5c
KT
2138 c_target_objs="${c_target_objs} msformat-c.o"
2139 cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
2140 if test x$enable_threads = xyes; then
2141 thread_file='posix'
2142 fi
301f4402 2143 default_use_cxa_atexit=yes
b802ae5c
KT
2144 use_gcc_stdint=wrap
2145 tm_defines="${tm_defines} TARGET_CYGWIN64=1"
2146 ;;
e8930cc1 2147i[34567]86-*-mingw* | x86_64-*-mingw*)
c04bdac0 2148 tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h"
4dc0535b 2149 xm_file=i386/xm-mingw32.h
88b0e79e
JC
2150 c_target_objs="${c_target_objs} winnt-c.o"
2151 cxx_target_objs="${cxx_target_objs} winnt-c.o"
2152 target_has_targetcm="yes"
933608b7
KT
2153 case ${target} in
2154 x86_64-*-* | *-w64-*)
c6b9174f 2155 need_64bit_isa=yes
933608b7
KT
2156 ;;
2157 *)
2158 ;;
2159 esac
c04bdac0
KT
2160 if test x$enable_threads = xposix ; then
2161 tm_file="${tm_file} i386/mingw-pthread.h"
2162 fi
2163 tm_file="${tm_file} i386/mingw32.h"
35091630
KT
2164 # This makes the logic if mingw's or the w64 feature set has to be used
2165 case ${target} in
2166 *-w64-*)
9b91e436
KT
2167 user_headers_inc_next_post="${user_headers_inc_next_post} float.h"
2168 user_headers_inc_next_pre="${user_headers_inc_next_pre} stddef.h stdarg.h"
35091630 2169 tm_file="${tm_file} i386/mingw-w64.h"
933608b7
KT
2170 if test x$enable_targets = xall; then
2171 tm_defines="${tm_defines} TARGET_BI_ARCH=1"
646bdeab 2172 if test x$with_cpu = x; then
933608b7
KT
2173 if test x$with_cpu_64 = x; then
2174 with_cpu_64=generic
2175 fi
646bdeab
L
2176 else
2177 case " $x86_cpus $x86_archs $x86_64_archs " in
2178 *" $with_cpu "*)
2179 ;;
2180 *)
2181 echo "Unsupported CPU used in --with-cpu=$with_cpu, supported values:" 1>&2
2182 echo "$x86_cpus $x86_archs $x86_64_archs" 1>&2
2183 exit 1
2184 ;;
2185 esac
2186 fi
933608b7 2187 fi
35091630
KT
2188 ;;
2189 *)
35091630
KT
2190 ;;
2191 esac
2192 tm_file="${tm_file} i386/mingw-stdint.h"
88b0e79e 2193 tmake_file="${tmake_file} t-winnt i386/t-cygming t-slibgcc"
8370a62a 2194 case ${target} in
917ed773 2195 x86_64-w64-*)
8370a62a
KT
2196 tmake_file="${tmake_file} i386/t-mingw-w64"
2197 ;;
917ed773
KT
2198 i[34567]86-w64-*)
2199 tmake_file="${tmake_file} i386/t-mingw-w32"
2200 ;;
8370a62a 2201 esac
08b2bad2 2202 native_system_header_dir=/mingw/include
7c0b7150 2203 target_gtfiles="$target_gtfiles \$(srcdir)/config/i386/winnt.c"
94564826 2204 extra_options="${extra_options} i386/cygming.opt i386/mingw.opt"
35091630
KT
2205 case ${target} in
2206 *-w64-*)
2207 extra_options="${extra_options} i386/mingw-w64.opt"
2208 ;;
2209 *)
2210 ;;
2211 esac
41f59cda 2212 extra_objs="${extra_objs} winnt.o winnt-stubs.o"
ab442df7
MM
2213 c_target_objs="${c_target_objs} msformat-c.o"
2214 cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"
b993039f
EB
2215 gas=yes
2216 gnu_ld=yes
97388150 2217 default_use_cxa_atexit=yes
7d253f6e 2218 use_gcc_stdint=wrap
50c0d3fd 2219 case ${enable_threads} in
f9989b51
RO
2220 "" | yes | win32)
2221 thread_file='win32'
c04bdac0
KT
2222 ;;
2223 posix)
2224 thread_file='posix'
c04bdac0 2225 ;;
50c0d3fd 2226 esac
e8930cc1
KT
2227 case ${target} in
2228 *mingw32crt*)
2229 tm_file="${tm_file} i386/crtdll.h"
2230 ;;
2231 *mingw32msv* | *mingw*)
09eaf5a5 2232 ;;
61ed06c3
HPN
2233 esac
2234 ;;
491b3c5f
JC
2235x86_64-*-fuchsia*)
2236 tmake_file="${tmake_file} i386/t-x86_64-elf"
2237 tm_file="${tm_file} i386/unix.h i386/att.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h fuchsia.h"
2238 ;;
61ed06c3 2239ia64*-*-elf*)
207bf79d 2240 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h ia64/sysv4.h ia64/elf.h"
61ed06c3
HPN
2241 tmake_file="ia64/t-ia64"
2242 target_cpu_default="0"
2243 if test x$gas = xyes
2244 then
2245 target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
2246 fi
2247 if test x$gnu_ld = xyes
2248 then
2249 target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
2250 fi
61ed06c3 2251 ;;
243a7070 2252ia64*-*-freebsd*)
fee42cc1 2253 tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
243a7070
DB
2254 target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
2255 tmake_file="${tmake_file} ia64/t-ia64"
243a7070 2256 ;;
61ed06c3 2257ia64*-*-linux*)
8e38461c 2258 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
a9011c94 2259 tmake_file="${tmake_file} ia64/t-ia64 ia64/t-linux t-libunwind"
61ed06c3 2260 target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
61ed06c3 2261 ;;
7e5b9908 2262ia64*-*-hpux*)
2337b6b7 2263 tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/hpux.h"
b040f2be 2264 tmake_file="ia64/t-ia64 ia64/t-hpux t-slibgcc"
7e5b9908 2265 target_cpu_default="MASK_GNU_AS"
7e2055ec 2266 case x$enable_threads in
79e8b6c0 2267 x | xyes | xposix )
7e2055ec
ZW
2268 thread_file=posix
2269 ;;
2270 esac
cad61762 2271 use_collect2=no
34c1864f
SE
2272 c_target_objs="ia64-c.o"
2273 cxx_target_objs="ia64-c.o"
e543b94c 2274 extra_options="${extra_options} ia64/ilp32.opt hpux11.opt"
9a17c91d
SE
2275 use_gcc_stdint=wrap
2276 tm_file="${tm_file} hpux-stdint.h"
fc4538e4
SE
2277 case ${target} in
2278 *-*-hpux11.3*)
2279 tm_file="${tm_file} ia64/hpux-unix2003.h"
2280 ;;
2281 esac
7e5b9908 2282 ;;
a9a25daa 2283ia64-hp-*vms*)
d8aba32a
TG
2284 tm_file="${tm_file} elfos.h ia64/sysv4.h vms/vms.h ia64/vms.h"
2285 tmake_file="${tmake_file} ia64/t-ia64"
a9a25daa
DR
2286 target_cpu_default="0"
2287 if test x$gas = xyes
2288 then
2289 target_cpu_default="${target_cpu_default}|MASK_GNU_AS"
2290 fi
18a24fed 2291 extra_options="${extra_options} ia64/vms.opt"
a9a25daa 2292 ;;
6b3d1e47 2293iq2000*-*-elf*)
248a9e94 2294 tm_file="elfos.h newlib-stdint.h iq2000/iq2000.h"
6b3d1e47 2295 out_file=iq2000/iq2000.c
6b3d1e47
SC
2296 md_file=iq2000/iq2000.md
2297 ;;
aa4945c1 2298lm32-*-elf*)
7c9bb341 2299 tm_file="dbxelf.h elfos.h ${tm_file} newlib-stdint.h"
aca0b0b3 2300 tmake_file="${tmake_file} lm32/t-lm32"
aa4945c1 2301 ;;
d7856dc7 2302lm32-*-rtems*)
1ddc8057 2303 tm_file="dbxelf.h elfos.h ${tm_file} lm32/rtems.h rtems.h newlib-stdint.h"
aca0b0b3 2304 tmake_file="${tmake_file} lm32/t-lm32"
4ce7e3a9 2305 tmake_file="${tmake_file} lm32/t-rtems"
d7856dc7 2306 ;;
aa4945c1 2307lm32-*-uclinux*)
8e38461c 2308 tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h lm32/uclinux-elf.h"
aca0b0b3 2309 tmake_file="${tmake_file} lm32/t-lm32"
aa4945c1 2310 ;;
61ed06c3 2311m32r-*-elf*)
cfe5b8ea 2312 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
37ec8b7a 2313 ;;
ad126521 2314m32rle-*-elf*)
cfe5b8ea 2315 tm_file="dbxelf.h elfos.h newlib-stdint.h m32r/little.h ${tm_file}"
ad126521
KI
2316 ;;
2317m32r-*-linux*)
8e38461c 2318 tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} m32r/linux.h"
133b1a8e 2319 tmake_file="${tmake_file} m32r/t-linux t-slibgcc"
ad126521 2320 gnu_ld=yes
ad126521
KI
2321 if test x$enable_threads = xyes; then
2322 thread_file='posix'
2323 fi
2324 ;;
2325m32rle-*-linux*)
8e38461c 2326 tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m32r/little.h ${tm_file} m32r/linux.h"
133b1a8e 2327 tmake_file="${tmake_file} m32r/t-linux t-slibgcc"
ad126521 2328 gnu_ld=yes
ad126521
KI
2329 if test x$enable_threads = xyes; then
2330 thread_file='posix'
2331 fi
2332 ;;
cd985f66 2333m68k-*-elf* | fido-*-elf*)
7d33c31d
KH
2334 case ${target} in
2335 fido-*-elf*)
2336 # Check that $with_cpu makes sense.
2337 case $with_cpu in
2338 "" | "fidoa")
2339 ;;
2340 *)
2341 echo "Cannot accept --with-cpu=$with_cpu"
2342 exit 1
2343 ;;
2344 esac
2345 with_cpu=fidoa
2346 ;;
2347 *)
2348 default_m68k_cpu=68020
2349 default_cf_cpu=5206
2350 ;;
2351 esac
207bf79d 2352 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"
cf909b0d 2353 tm_defines="${tm_defines} MOTOROLA=1"
7d33c31d
KH
2354 tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-m68kelf"
2355 # Add multilibs for targets other than fido.
2356 case ${target} in
2357 fido-*-elf*)
2358 ;;
2359 *)
2360 tmake_file="$tmake_file m68k/t-mlibs"
2361 ;;
2362 esac
61ed06c3 2363 ;;
cd985f66 2364m68k*-*-netbsdelf*)
59fbf3cb 2365 default_m68k_cpu=68020
10e96df4 2366 default_cf_cpu=5475
dfe2677b 2367 tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} m68k/netbsd-elf.h"
a4714d14 2368 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
dfe2677b 2369 tm_defines="${tm_defines} MOTOROLA=1 CHAR_FAST8=1 SHORT_FAST16=1"
2fd95d71 2370 ;;
7ea98c5a 2371m68k*-*-openbsd*)
59fbf3cb 2372 default_m68k_cpu=68020
10e96df4 2373 default_cf_cpu=5475
7ea98c5a 2374 # needed to unconfuse gdb
59fbf3cb 2375 tm_defines="${tm_defines} OBSD_OLD_GAS"
aa58f943 2376 tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h m68k/openbsd.h"
5369e2d4 2377 extra_options="${extra_options} openbsd.opt"
5f73c6cc 2378 tmake_file="t-openbsd m68k/t-openbsd"
7ea98c5a
GN
2379 # we need collect2 until our bug is fixed...
2380 use_collect2=yes
2381 ;;
4529dbf1
RS
2382m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux
2383 # with uClibc, using the new GNU/Linux-style
2384 # ABI.
59fbf3cb 2385 default_m68k_cpu=68020
10e96df4 2386 default_cf_cpu=5206
8e38461c 2387 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"
4254bbfe 2388 extra_options="${extra_options} m68k/uclinux.opt"
b5a54c03 2389 tm_defines="${tm_defines} MOTOROLA=1"
10e96df4 2390 tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
ba591f5a 2391 ;;
5f73c6cc 2392m68k-*-linux*) # Motorola m68k's running GNU/Linux
61ed06c3
HPN
2393 # with ELF format using glibc 2
2394 # aka the GNU/Linux C library 6.
59fbf3cb 2395 default_m68k_cpu=68020
10e96df4 2396 default_cf_cpu=5475
368b55f6 2397 with_arch=${with_arch:-m68k}
8e38461c 2398 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h ./sysroot-suffix.h"
4af06170 2399 extra_options="${extra_options} m68k/ieee.opt"
cf909b0d 2400 tm_defines="${tm_defines} MOTOROLA=1"
368b55f6 2401 tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs"
61ed06c3 2402 ;;
c7bdf0a6 2403m68k-*-rtems*)
59fbf3cb 2404 default_m68k_cpu=68020
10e96df4 2405 default_cf_cpu=5206
aefe4056 2406 tmake_file="${tmake_file} m68k/t-floatlib m68k/t-m68kbare m68k/t-crtstuff m68k/t-rtems m68k/t-mlibs"
207bf79d 2407 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"
cf909b0d 2408 tm_defines="${tm_defines} MOTOROLA=1"
61ed06c3 2409 ;;
61ed06c3 2410mcore-*-elf)
ed38428f 2411 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
61ed06c3 2412 tmake_file=mcore/t-mcore
a929bc28 2413 inhibit_libc=true
61ed06c3 2414 ;;
80920132 2415microblaze*-linux*)
76ef61fb
EI
2416 case $target in
2417 microblazeel-*)
2418 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2419 ;;
2420 microblaze-*)
2421 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2422 ;;
2423 esac
8e38461c 2424 tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
fbf0cf90 2425 tm_file="${tm_file} glibc-stdint.h"
80920132
ME
2426 c_target_objs="${c_target_objs} microblaze-c.o"
2427 cxx_target_objs="${cxx_target_objs} microblaze-c.o"
fbf0cf90 2428 tmake_file="${tmake_file} microblaze/t-microblaze"
76ef61fb 2429 tmake_file="${tmake_file} microblaze/t-microblaze-linux"
80920132 2430 ;;
479f4358 2431microblaze*-*-rtems*)
c6adc8b3
RC
2432 case $target in
2433 microblazeel-*)
2434 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2435 ;;
2436 microblaze-*)
2437 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2438 ;;
2439 esac
479f4358
RC
2440 tm_file="${tm_file} dbxelf.h"
2441 tm_file="${tm_file} microblaze/rtems.h rtems.h newlib-stdint.h"
2442 c_target_objs="${c_target_objs} microblaze-c.o"
2443 cxx_target_objs="${cxx_target_objs} microblaze-c.o"
2444 tmake_file="${tmake_file} microblaze/t-microblaze"
aefe4056 2445 tmake_file="${tmake_file} microblaze/t-rtems"
479f4358 2446 ;;
6f14eef2 2447microblaze*-*-elf)
76ef61fb
EI
2448 case $target in
2449 microblazeel-*)
2450 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0"
2451 ;;
2452 microblaze-*)
2453 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321"
2454 ;;
2455 esac
6f14eef2 2456 tm_file="${tm_file} dbxelf.h newlib-stdint.h"
80920132
ME
2457 c_target_objs="${c_target_objs} microblaze-c.o"
2458 cxx_target_objs="${cxx_target_objs} microblaze-c.o"
6f14eef2 2459 tmake_file="${tmake_file} microblaze/t-microblaze"
80920132 2460 ;;
09cae750
PD
2461riscv*-*-linux*)
2462 tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} riscv/linux.h"
2463 case "x${enable_multilib}" in
2464 xno) ;;
2465 xyes) tmake_file="${tmake_file} riscv/t-linux-multilib" ;;
2466 *) echo "Unknown value for enable_multilib"; exit 1
2467 esac
2468 tmake_file="${tmake_file} riscv/t-riscv riscv/t-linux"
2469 gnu_ld=yes
2470 gas=yes
2471 # Force .init_array support. The configure script cannot always
2472 # automatically detect that GAS supports it, yet we require it.
2473 gcc_cv_initfini_array=yes
2474 ;;
1f9e09b5 2475riscv*-*-elf* | riscv*-*-rtems*)
09cae750 2476 tm_file="elfos.h newlib-stdint.h ${tm_file} riscv/elf.h"
a8ef8061
SH
2477 case ${target} in
2478 *-*-rtems*)
2479 tm_file="${tm_file} rtems.h riscv/rtems.h"
2480 tmake_file="${tmake_file} riscv/t-rtems"
2481 ;;
2482 *)
c1e66912
KC
2483 if test "x${with_multilib_generator}" == xdefault; then
2484 case "x${enable_multilib}" in
2485 xno) ;;
2486 xyes) tmake_file="${tmake_file} riscv/t-elf-multilib" ;;
2487 *) echo "Unknown value for enable_multilib"; exit 1
2488 esac
2489 fi
09cae750
PD
2490 esac
2491 tmake_file="${tmake_file} riscv/t-riscv"
2492 gnu_ld=yes
2493 gas=yes
2494 # Force .init_array support. The configure script cannot always
2495 # automatically detect that GAS supports it, yet we require it.
2496 gcc_cv_initfini_array=yes
2497 ;;
4d47fe5a
RB
2498riscv*-*-freebsd*)
2499 tm_file="${tm_file} elfos.h ${fbsd_tm_file} riscv/freebsd.h"
2500 tmake_file="${tmake_file} riscv/t-riscv"
2501 gnu_ld=yes
2502 gas=yes
2503 # Force .init_array support. The configure script cannot always
2504 # automatically detect that GAS supports it, yet we require it.
2505 gcc_cv_initfini_array=yes
2506 ;;
f982f805 2507mips*-*-netbsd*) # NetBSD/mips, either endian.
5811cb27 2508 target_cpu_default="MASK_ABICALLS"
dfe2677b 2509 tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h"
a4714d14 2510 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
61ed06c3 2511 ;;
58c9330b
MF
2512mips*-img-linux*)
2513 tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
2514 extra_options="${extra_options} linux-android.opt"
2515 tmake_file="${tmake_file} mips/t-img-linux"
2516 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
38e9658c
MF
2517 with_arch_32="mips32r6"
2518 with_arch_64="mips64r6"
58c9330b
MF
2519 gnu_ld=yes
2520 gas=yes
2521 ;;
965c1798 2522mips*-mti-linux*)
9a7451a5 2523 tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h mips/mti-linux.h"
ed9cbf7c 2524 extra_options="${extra_options} linux-android.opt"
965c1798
SE
2525 tmake_file="${tmake_file} mips/t-mti-linux"
2526 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
38e9658c
MF
2527 with_arch_32="mips32r2"
2528 with_arch_64="mips64r2"
965c1798
SE
2529 gnu_ld=yes
2530 gas=yes
965c1798 2531 ;;
77893d0b 2532mips*-*-linux*) # Linux MIPS, either endian.
9a7451a5 2533 tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/linux.h mips/linux-common.h"
ed9cbf7c 2534 extra_options="${extra_options} linux-android.opt"
900e3ae5 2535 case ${target} in
82f84ecb
MF
2536 mipsisa32r6*)
2537 default_mips_arch=mips32r6
2538 ;;
77893d0b 2539 mipsisa32r2*)
8cfebf86 2540 default_mips_arch=mips32r2
77893d0b
SE
2541 ;;
2542 mipsisa32*)
8cfebf86 2543 default_mips_arch=mips32
77893d0b 2544 ;;
900e3ae5 2545 mips64el-st-linux-gnu)
8cfebf86 2546 default_mips_abi=n32
900e3ae5
DJ
2547 tm_file="${tm_file} mips/st.h"
2548 tmake_file="${tmake_file} mips/t-st"
77893d0b 2549 enable_mips_multilibs="yes"
900e3ae5 2550 ;;
d97e6aca 2551 mips64octeon*-*-linux*)
8cfebf86 2552 default_mips_abi=n32
d97e6aca
AN
2553 tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
2554 target_cpu_default=MASK_SOFT_FLOAT_ABI
77893d0b 2555 enable_mips_multilibs="yes"
d97e6aca 2556 ;;
82f84ecb
MF
2557 mipsisa64r6*-*-linux*)
2558 default_mips_abi=n32
2559 default_mips_arch=mips64r6
2560 enable_mips_multilibs="yes"
2561 ;;
f2d6ca50 2562 mipsisa64r2*-*-linux*)
8cfebf86
SE
2563 default_mips_abi=n32
2564 default_mips_arch=mips64r2
77893d0b
SE
2565 enable_mips_multilibs="yes"
2566 ;;
2567 mips64*-*-linux* | mipsisa64*-*-linux*)
8cfebf86 2568 default_mips_abi=n32
77893d0b 2569 enable_mips_multilibs="yes"
f2d6ca50 2570 ;;
900e3ae5 2571 esac
bd5ab709 2572 if test x$enable_targets = xall; then
77893d0b
SE
2573 enable_mips_multilibs="yes"
2574 fi
2575 if test x$enable_mips_multilibs = xyes; then
bd5ab709 2576 tmake_file="${tmake_file} mips/t-linux64"
bd5ab709 2577 fi
61ed06c3 2578 ;;
992bcfac 2579mips*-mti-elf*)
a290fcda 2580 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
992bcfac
SE
2581 tmake_file="mips/t-mti-elf"
2582 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
38e9658c
MF
2583 with_arch_32="mips32r2"
2584 with_arch_64="mips64r2"
992bcfac 2585 ;;
58c9330b
MF
2586mips*-img-elf*)
2587 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h mips/mti-elf.h"
2588 tmake_file="mips/t-img-elf"
2589 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
38e9658c
MF
2590 with_arch_32="mips32r6"
2591 with_arch_64="mips64r6"
58c9330b 2592 ;;
0ea339ea 2593mips*-sde-elf*)
a290fcda 2594 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h mips/sde.h"
45b86625 2595 tmake_file="mips/t-sde"
d1583032 2596 extra_options="${extra_options} mips/sde.opt"
d9dced13
RS
2597 case "${with_newlib}" in
2598 yes)
2599 # newlib / libgloss.
2600 ;;
2601 *)
2602 # MIPS toolkit libraries.
2603 tm_file="$tm_file mips/sdemtk.h"
2604 tmake_file="$tmake_file mips/t-sdemtk"
d9dced13
RS
2605 case ${enable_threads} in
2606 "" | yes | mipssde)
2607 thread_file='mipssde'
2608 ;;
2609 esac
2610 ;;
2611 esac
0ea339ea 2612 case ${target} in
82f84ecb
MF
2613 mipsisa32r6*)
2614 tm_defines="MIPS_ISA_DEFAULT=37 MIPS_ABI_DEFAULT=ABI_32"
2615 ;;
0ea339ea
NS
2616 mipsisa32r2*)
2617 tm_defines="MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_32"
2618 ;;
2619 mipsisa32*)
2620 tm_defines="MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_32"
2621 ;;
82f84ecb
MF
2622 mipsisa64r6*)
2623 tm_defines="MIPS_ISA_DEFAULT=69 MIPS_ABI_DEFAULT=ABI_N32"
2624 ;;
0a4a51c7
AN
2625 mipsisa64r2*)
2626 tm_defines="MIPS_ISA_DEFAULT=65 MIPS_ABI_DEFAULT=ABI_N32"
2627 ;;
0ea339ea
NS
2628 mipsisa64*)
2629 tm_defines="MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_N32"
2630 ;;
2631 esac
2632 ;;
e2c14f5d
RS
2633mipsisa32-*-elf* | mipsisa32el-*-elf* | \
2634mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
82f84ecb 2635mipsisa32r6-*-elf* | mipsisa32r6el-*-elf* | \
0a4a51c7 2636mipsisa64-*-elf* | mipsisa64el-*-elf* | \
82f84ecb
MF
2637mipsisa64r2-*-elf* | mipsisa64r2el-*-elf* | \
2638mipsisa64r6-*-elf* | mipsisa64r6el-*-elf*)
207bf79d 2639 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
45b86625 2640 tmake_file="mips/t-isa3264"
e2c14f5d 2641 case ${target} in
82f84ecb
MF
2642 mipsisa32r6*)
2643 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=37"
2644 ;;
e2c14f5d
RS
2645 mipsisa32r2*)
2646 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33"
2647 ;;
2648 mipsisa32*)
2649 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
2650 ;;
82f84ecb
MF
2651 mipsisa64r6*)
2652 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=69"
2653 ;;
0a4a51c7
AN
2654 mipsisa64r2*)
2655 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
2656 ;;
e2c14f5d
RS
2657 mipsisa64*)
2658 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64"
2659 ;;
2660 esac
2661 case ${target} in
2662 mipsisa32*-*-elfoabi*)
2663 tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32"
2664 tm_file="${tm_file} mips/elfoabi.h"
2665 ;;
2666 mipsisa64*-*-elfoabi*)
2667 tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_O64"
2668 tm_file="${tm_file} mips/elfoabi.h"
2669 ;;
2670 *-*-elf*)
2671 tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI"
2672 ;;
2673 esac
5c44e275 2674 ;;
5ce6f47b 2675mipsisa64sr71k-*-elf*)
207bf79d 2676 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
5ce6f47b 2677 tmake_file=mips/t-sr71k
620b87b3 2678 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sr71000\\\" MIPS_ABI_DEFAULT=ABI_EABI"
5ce6f47b 2679 ;;
3d41dbb0 2680mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
207bf79d 2681 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
45b86625 2682 tmake_file="mips/t-elf mips/t-sb1"
620b87b3 2683 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_CPU_STRING_DEFAULT=\\\"sb1\\\" MIPS_ABI_DEFAULT=ABI_O64"
3d41dbb0 2684 ;;
107eea2c 2685mips-*-elf* | mipsel-*-elf* | mipsr5900-*-elf* | mipsr5900el-*-elf*)
207bf79d 2686 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
45b86625 2687 tmake_file="mips/t-elf"
61ed06c3 2688 ;;
107eea2c 2689mips64r5900-*-elf* | mips64r5900el-*-elf*)
a290fcda 2690 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/n32-elf.h"
107eea2c
JU
2691 tmake_file="mips/t-elf"
2692 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
2693 ;;
74826b0f 2694mips64-*-elf* | mips64el-*-elf*)
207bf79d 2695 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h"
45b86625 2696 tmake_file="mips/t-elf"
620b87b3 2697 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
61ed06c3 2698 ;;
5ce6f47b 2699mips64vr-*-elf* | mips64vrel-*-elf*)
207bf79d 2700 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/vr.h mips/elf.h"
5ce6f47b 2701 tmake_file=mips/t-vr
c4023c19 2702 tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI"
5ce6f47b 2703 ;;
74826b0f 2704mips64orion-*-elf* | mips64orionel-*-elf*)
207bf79d 2705 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elforion.h mips/elf.h"
45b86625 2706 tmake_file="mips/t-elf"
620b87b3 2707 tm_defines="${tm_defines} MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_O64"
61ed06c3 2708 ;;
bc98ef7f 2709mips*-*-rtems*)
207bf79d 2710 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/elf.h mips/rtems.h rtems.h"
aefe4056 2711 tmake_file="${tmake_file} mips/t-elf mips/t-rtems"
61ed06c3 2712 ;;
55047c9d 2713mips-wrs-vxworks)
efa58006 2714 tm_file="elfos.h ${tm_file} mips/elf.h vx-common.h vxworks.h mips/vxworks.h"
55047c9d 2715 tmake_file="${tmake_file} mips/t-vxworks"
55047c9d 2716 ;;
74826b0f 2717mipstx39-*-elf* | mipstx39el-*-elf*)
207bf79d 2718 tm_file="elfos.h newlib-stdint.h ${tm_file} mips/r3900.h mips/elf.h"
45b86625 2719 tmake_file="mips/t-r3900"
61ed06c3 2720 ;;
bcf684c7 2721mmix-knuth-mmixware)
207bf79d 2722 tm_file="${tm_file} newlib-stdint.h"
207bf79d 2723 use_gcc_stdint=wrap
bcf684c7 2724 ;;
61ed06c3 2725mn10300-*-*)
6b9b8b34 2726 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
61ed06c3
HPN
2727 if test x$stabs = xyes
2728 then
2729 tm_file="${tm_file} dbx.h"
2730 fi
2731 use_collect2=no
207bf79d 2732 use_gcc_stdint=wrap
61ed06c3 2733 ;;
e8aa9f55 2734msp430-*-*)
f6a83b4a
DD
2735 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
2736 c_target_objs="msp430-c.o"
2737 cxx_target_objs="msp430-c.o"
f6a83b4a 2738 tmake_file="${tmake_file} msp430/t-msp430"
e37e2bb1
JL
2739 extra_objs="${extra_objs} msp430-devices.o"
2740 extra_gcc_objs="driver-msp430.o msp430-devices.o"
c46d1717 2741 # Enable .init_array unless it has been explicitly disabled.
378a578a
JL
2742 # The MSP430 EABI mandates the use of .init_array, and the Newlib CRT
2743 # code since mid-2019 expects it.
c46d1717
JL
2744 if test x${disable_initfini_array} != xyes; then
2745 gcc_cv_initfini_array=yes
2746 fi
e8aa9f55
JL
2747 case ${target} in
2748 msp430-*-elfbare)
2749 # __cxa_atexit increases code size, and we don't need to support
2750 # dynamic shared objects on MSP430, so regular Newlib atexit is a
2751 # fine replacement as it also supports registration of more than 32
2752 # functions.
2753 default_use_cxa_atexit=no
2754 # This target does not match the generic *-*-elf case above which
2755 # sets use_gcc_stdint=wrap, so explicitly set it here.
2756 use_gcc_stdint=wrap
2757 ;;
2758 esac
f6a83b4a 2759 ;;
cf3cd43d 2760nds32*-*-*)
9304f876
CJW
2761 target_cpu_default="0"
2762 tm_defines="${tm_defines}"
cf3cd43d
CJW
2763 case ${target} in
2764 nds32le*-*-*)
2765 ;;
2766 nds32be-*-*)
2767 target_cpu_default="${target_cpu_default}|MASK_BIG_ENDIAN"
2768 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
2769 ;;
2770 esac
2771 case ${target} in
2772 nds32*-*-elf*)
2773 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} nds32/elf.h nds32/nds32_intrinsic.h"
2774 tmake_file="nds32/t-nds32 nds32/t-elf"
2775 ;;
2776 nds32*-*-linux*)
2777 tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h nds32/linux.h nds32/nds32_intrinsic.h"
2778 tmake_file="${tmake_file} nds32/t-nds32 nds32/t-linux"
3da4a68a 2779 gcc_cv_initfini_array=yes
cf3cd43d
CJW
2780 ;;
2781 esac
7c32ef41 2782
cf3cd43d
CJW
2783 # Handle --enable-default-relax setting.
2784 if test x${enable_default_relax} = xyes; then
2785 tm_defines="${tm_defines} TARGET_DEFAULT_RELAX=1"
2786 fi
7c32ef41
MC
2787 # Handle --with-ext-dsp
2788 if test x${with_ext_dsp} = xyes; then
2789 tm_defines="${tm_defines} TARGET_DEFAULT_EXT_DSP=1"
2790 fi
9304f876 2791 ;;
e430824f
CLT
2792nios2-*-*)
2793 tm_file="elfos.h ${tm_file}"
2794 tmake_file="${tmake_file} nios2/t-nios2"
2795 case ${target} in
2796 nios2-*-linux*)
2797 tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h nios2/linux.h "
2798 ;;
2799 nios2-*-elf*)
2800 tm_file="${tm_file} newlib-stdint.h nios2/elf.h"
2801 extra_options="${extra_options} nios2/elf.opt"
2802 ;;
00020dda
SH
2803 nios2-*-rtems*)
2804 tm_file="${tm_file} newlib-stdint.h nios2/rtems.h rtems.h"
2805 tmake_file="${tmake_file} t-rtems nios2/t-rtems"
2806 ;;
e430824f
CLT
2807 esac
2808 ;;
738f2522
BS
2809nvptx-*)
2810 tm_file="${tm_file} newlib-stdint.h"
52956fbc 2811 use_gcc_stdint=wrap
738f2522 2812 tmake_file="nvptx/t-nvptx"
1f83528e
TS
2813 if test x$enable_as_accelerator = xyes; then
2814 extra_programs="${extra_programs} mkoffload\$(exeext)"
2815 tm_file="${tm_file} nvptx/offload.h"
2816 fi
738f2522 2817 ;;
3965b35f
SH
2818or1k*-*-*)
2819 tm_file="elfos.h ${tm_file}"
2820 tmake_file="${tmake_file} or1k/t-or1k"
2821 # Force .init_array support. The configure script cannot always
2822 # automatically detect that GAS supports it, yet we require it.
2823 gcc_cv_initfini_array=yes
2824
2825 # Handle --with-multilib-list=...
2826 or1k_multilibs="${with_multilib_list}"
2827 if test "$or1k_multilibs" = "default"; then
2828 or1k_multilibs="mcmov,msoft-mul,msoft-div"
2829 fi
2830 or1k_multilibs=`echo $or1k_multilibs | sed -e 's/,/ /g'`
2831 for or1k_multilib in ${or1k_multilibs}; do
2832 case ${or1k_multilib} in
2833 mcmov | msext | msfimm | \
1e2e81c1 2834 mror | mrori | \
44080af9 2835 mhard-float | mdouble-float | munordered-float | msoft-float | \
3965b35f
SH
2836 mhard-div | mhard-mul | \
2837 msoft-div | msoft-mul )
2838 TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG},${or1k_multilib}"
2839 ;;
2840 *)
2841 echo "--with-multilib-list=${with_multilib_list} not supported."
2842 exit 1
2843 esac
2844 done
2845 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's/^,//'`
2846
2847 case ${target} in
2848 or1k*-*-linux*)
2849 tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h"
2850 tm_file="${tm_file} or1k/linux.h"
2851 ;;
2852 or1k*-*-elf*)
2853 tm_file="${tm_file} newlib-stdint.h or1k/elf.h"
2854 extra_options="${extra_options} or1k/elf.opt"
2855 ;;
2856 or1k*-*-rtems*)
2857 tm_file="${tm_file} newlib-stdint.h or1k/rtems.h rtems.h"
2858 tmake_file="${tmake_file} or1k/t-rtems"
2859 ;;
2860 esac
2861 ;;
61ed06c3 2862pdp11-*-*)
207bf79d
JM
2863 tm_file="${tm_file} newlib-stdint.h"
2864 use_gcc_stdint=wrap
61ed06c3 2865 ;;
ca11c37c
ZW
2866# port not yet contributed
2867#powerpc-*-openbsd*)
569dc494 2868# tmake_file="${tmake_file} rs6000/t-fprules"
ca11c37c
ZW
2869# extra_headers=
2870# ;;
18922061 2871powerpc-*-darwin*)
c2ff7104 2872 extra_options="${extra_options} ${cpu_type}/darwin.opt"
f0b81cbc 2873 case ${target} in
c2ff7104
IS
2874 *-darwin1[0-9]* | *-darwin9*)
2875 tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
2876 tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
2877 ;;
2878 *-darwin8*)
2879 tmake_file="${tmake_file} ${cpu_type}/t-darwin32-biarch"
2880 tm_file="${tm_file} ${cpu_type}/darwin32-biarch.h"
2881 tm_file="${tm_file} ${cpu_type}/darwin8.h"
ed5b9f96
GK
2882 ;;
2883 *-darwin7*)
c2ff7104 2884 tm_file="${tm_file} ${cpu_type}/darwin7.h"
ed5b9f96 2885 ;;
c2ff7104
IS
2886 *-darwin[456]*)
2887 # Earlier - ingle arch, with 32b only
2888 # OS X 10.0, the first edition is Darwin4
ed5b9f96 2889 ;;
f0b81cbc 2890 esac
b040f2be 2891 tmake_file="${tmake_file} t-slibgcc"
18922061 2892 ;;
b8ec3cc8 2893powerpc64-*-darwin*)
b8ec3cc8 2894 extra_options="${extra_options} ${cpu_type}/darwin.opt"
c2ff7104
IS
2895 tmake_file="${tmake_file} ${cpu_type}/t-darwin64-biarch t-slibgcc"
2896 tm_file="${tm_file} ${cpu_type}/darwin64-biarch.h"
b8ec3cc8 2897 ;;
a26f86dc 2898powerpc*-*-freebsd*)
62045234 2899 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${fbsd_tm_file} rs6000/sysv4.h"
78f5898b 2900 extra_options="${extra_options} rs6000/sysv4.opt"
a26f86dc 2901 tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
2a418323
PK
2902 case ${target} in
2903 powerpc*le-*-*)
2904 tm_file="${tm_file} rs6000/sysv4le.h" ;;
2905 esac
252a969e 2906 case ${target} in
a26f86dc
AT
2907 powerpc64*)
2908 tm_file="${tm_file} rs6000/default64.h rs6000/freebsd64.h"
2909 tmake_file="${tmake_file} rs6000/t-freebsd64"
2910 extra_options="${extra_options} rs6000/linux64.opt"
15bbad92
AT
2911 if test $fbsd_major -ge 13; then
2912 tm_defines="${tm_defines} TARGET_FREEBSD32_SECURE_PLT=1"
2913 fi
a26f86dc
AT
2914 ;;
2915 *)
15bbad92
AT
2916 if test $fbsd_major -ge 13; then
2917 tm_file="rs6000/secureplt.h ${tm_file}"
2918 fi
a26f86dc
AT
2919 tm_file="${tm_file} rs6000/freebsd.h"
2920 ;;
2921 esac
b91da81f 2922 ;;
edf1b3f3 2923powerpc-*-netbsd*)
62045234 2924 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h ${nbsd_tm_file} freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
a4714d14 2925 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
a4967b8d 2926 tmake_file="${tmake_file} rs6000/t-netbsd"
78f5898b 2927 extra_options="${extra_options} rs6000/sysv4.opt"
edf1b3f3 2928 ;;
cf6ede82 2929powerpc-*-eabisimaltivec*)
62045234 2930 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h"
78f5898b 2931 extra_options="${extra_options} rs6000/sysv4.opt"
569dc494 2932 tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
207bf79d 2933 use_gcc_stdint=wrap
cf6ede82 2934 ;;
61ed06c3 2935powerpc-*-eabisim*)
62045234 2936 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
78f5898b 2937 extra_options="${extra_options} rs6000/sysv4.opt"
569dc494 2938 tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
207bf79d 2939 use_gcc_stdint=wrap
61ed06c3
HPN
2940 ;;
2941powerpc-*-elf*)
62045234 2942 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h"
78f5898b 2943 extra_options="${extra_options} rs6000/sysv4.opt"
569dc494 2944 tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
61ed06c3 2945 ;;
10baca6b 2946powerpc-*-eabialtivec*)
62045234 2947 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabialtivec.h"
78f5898b 2948 extra_options="${extra_options} rs6000/sysv4.opt"
569dc494 2949 tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm"
207bf79d 2950 use_gcc_stdint=wrap
10baca6b 2951 ;;
61ed06c3 2952powerpc-*-eabi*)
62045234 2953 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h"
78f5898b 2954 extra_options="${extra_options} rs6000/sysv4.opt"
569dc494 2955 tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
207bf79d 2956 use_gcc_stdint=wrap
61ed06c3
HPN
2957 ;;
2958powerpc-*-rtems*)
62045234 2959 tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/rtems.h rtems.h"
17691698 2960 extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt"
aefe4056 2961 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
61ed06c3 2962 ;;
b9a7eb5d 2963powerpc*-*-linux*)
426a04b8 2964 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h freebsd-spec.h rs6000/sysv4.h"
78f5898b 2965 extra_options="${extra_options} rs6000/sysv4.opt"
864396ff 2966 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
9193fb05 2967 extra_objs="$extra_objs rs6000-linux.o"
b9a7eb5d
AM
2968 case ${target} in
2969 powerpc*le-*-*)
93ed07e2 2970 tm_file="${tm_file} rs6000/sysv4le.h" ;;
b9a7eb5d 2971 esac
864396ff
AM
2972 case ${target}:${with_cpu} in
2973 powerpc64*: | powerpc64*:native) cpu_is_64bit=yes ;;
2974 esac
2975 maybe_biarch=${cpu_is_64bit}
2976 case ${enable_targets} in
2977 *powerpc64*) maybe_biarch=yes ;;
b9b1573b 2978 all) maybe_biarch=yes ;;
864396ff 2979 esac
864396ff
AM
2980 case ${target}:${enable_targets}:${maybe_biarch} in
2981 powerpc64-* | powerpc-*:*:yes | *:*powerpc64-*:yes | *:all:yes \
2982 | powerpc64le*:*powerpcle* | powerpc64le*:*powerpc-* \
2983 | powerpcle-*:*powerpc64le*:yes)
a8e04fe6
AM
2984 if test x$cpu_is_64bit = xyes; then
2985 tm_file="${tm_file} rs6000/default64.h"
2986 fi
207bf79d 2987 tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h glibc-stdint.h"
a8e04fe6 2988 tmake_file="$tmake_file rs6000/t-linux64"
93ed07e2
AM
2989 case ${target} in
2990 powerpc*le-*-*)
2991 tmake_file="$tmake_file rs6000/t-linux64le"
2992 case ${enable_targets} in
2993 all | *powerpc64-* | *powerpc-*)
2994 tmake_file="$tmake_file rs6000/t-linux64lebe" ;;
2995 esac ;;
2996 *)
2997 case ${enable_targets} in
2998 all | *powerpc64le-* | *powerpcle-*)
2999 tmake_file="$tmake_file rs6000/t-linux64bele" ;;
3000 esac ;;
3001 esac
f75aac9e 3002 extra_options="${extra_options} rs6000/linux64.opt"
a8e04fe6 3003 ;;
864396ff
AM
3004 powerpc64*)
3005 tm_file="${tm_file} rs6000/default64.h rs6000/linux64.h glibc-stdint.h"
3006 extra_options="${extra_options} rs6000/linux64.opt"
3007 tmake_file="${tmake_file} rs6000/t-linux"
3008 ;;
a8e04fe6 3009 *)
207bf79d 3010 tm_file="${tm_file} rs6000/linux.h glibc-stdint.h"
864396ff 3011 tmake_file="${tmake_file} rs6000/t-ppcos rs6000/t-linux"
a8e04fe6
AM
3012 ;;
3013 esac
457d1d00 3014 case ${target} in
be26142a
PB
3015 powerpc*-*-linux*ppc476*)
3016 tm_file="${tm_file} rs6000/476.h"
3017 extra_options="${extra_options} rs6000/476.opt" ;;
457d1d00
AM
3018 powerpc*-*-linux*altivec*)
3019 tm_file="${tm_file} rs6000/linuxaltivec.h" ;;
457d1d00 3020 esac
0d6be0b1
GR
3021 case ${target} in
3022 *-linux*-musl*)
3023 enable_secureplt=yes ;;
3024 esac
7f970b70
AM
3025 if test x${enable_secureplt} = xyes; then
3026 tm_file="rs6000/secureplt.h ${tm_file}"
3027 fi
61ed06c3 3028 ;;
17867980
DR
3029powerpc*-wrs-vxworks7r*)
3030
3031 # Wind River 7 post SR0600 is mostly like Linux so we setup
3032 # our config in a very similar fashion and adjust to a few
3033 # specificities.
3034
3035 # The system compiler is configured with secureplt by default.
3036 tm_file="${tm_file} rs6000/secureplt.h"
3037
3038 tm_file="${tm_file} elfos.h gnu-user.h linux.h freebsd-spec.h"
3039 tm_file="${tm_file} rs6000/sysv4.h rs6000/biarch64.h rs6000/default64.h rs6000/linux64.h"
3040 tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h"
3041
3042 extra_options="${extra_options} rs6000/sysv4.opt linux.opt rs6000/linux64.opt"
3043
3044 tmake_file="${tmake_file} t-linux rs6000/t-linux64 rs6000/t-fprules rs6000/t-ppccomm"
3045 tmake_file="${tmake_file} rs6000/t-vxworks"
3046
3047 tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
3048 extra_objs="$extra_objs linux.o rs6000-linux.o"
3049 ;;
611e7036 3050powerpc-wrs-vxworks*)
62045234 3051 tm_file="${tm_file} elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
569dc494 3052 tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks"
78f5898b 3053 extra_options="${extra_options} rs6000/sysv4.opt"
41c1b913 3054 extra_headers="${extra_headers} ppc-asm.h"
2eab15c9 3055 case ${target} in
3a8fe7c6 3056 *-vxworksmils*)
c725f69c 3057 tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksmils.h"
3a8fe7c6
OH
3058 tmake_file="${tmake_file} rs6000/t-vxworksmils"
3059 ;;
2eab15c9 3060 *-vxworksae*)
c725f69c 3061 tm_file="${tm_file} vx-common.h vxworksae.h rs6000/vxworks.h rs6000/vxworksae.h"
2eab15c9
PE
3062 tmake_file="${tmake_file} rs6000/t-vxworksae"
3063 ;;
3064 *-vxworks*)
c725f69c 3065 tm_file="${tm_file} vx-common.h vxworks.h rs6000/vxworks.h"
2eab15c9
PE
3066 ;;
3067 esac
4977bab6 3068 ;;
4f587cb0
AN
3069powerpc-*-lynxos*)
3070 xm_defines=POSIX
62045234 3071 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
4f587cb0 3072 tmake_file="t-lynx rs6000/t-lynx"
78f5898b 3073 extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
4f587cb0
AN
3074 thread_file=lynx
3075 gnu_ld=yes
3076 gas=yes
3077 ;;
61ed06c3 3078powerpcle-*-elf*)
62045234 3079 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h"
569dc494 3080 tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
78f5898b 3081 extra_options="${extra_options} rs6000/sysv4.opt"
61ed06c3
HPN
3082 ;;
3083powerpcle-*-eabisim*)
62045234 3084 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
569dc494 3085 tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
78f5898b 3086 extra_options="${extra_options} rs6000/sysv4.opt"
207bf79d 3087 use_gcc_stdint=wrap
61ed06c3
HPN
3088 ;;
3089powerpcle-*-eabi*)
62045234 3090 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h usegas.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
569dc494 3091 tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
78f5898b 3092 extra_options="${extra_options} rs6000/sysv4.opt"
207bf79d 3093 use_gcc_stdint=wrap
61ed06c3 3094 ;;
8d2af3a2
DD
3095pru*-*-*)
3096 tm_file="elfos.h newlib-stdint.h ${tm_file}"
3097 tmake_file="${tmake_file} pru/t-pru"
3098 extra_objs="pru-pragma.o pru-passes.o"
3099 use_gcc_stdint=wrap
3100 ;;
51fbbb92 3101rs6000-ibm-aix6.* | powerpc-ibm-aix6.*)
557cc596 3102 tm_file="${tm_file} rs6000/aix.h rs6000/aix61.h rs6000/xcoff.h rs6000/aix-stdint.h"
b040f2be 3103 tmake_file="rs6000/t-aix52 t-slibgcc"
ba6a1b78
DE
3104 extra_options="${extra_options} rs6000/aix64.opt"
3105 use_collect2=yes
3106 thread_file='aix'
557cc596 3107 use_gcc_stdint=wrap
b9584cb5 3108 default_use_cxa_atexit=yes
51fbbb92 3109 ;;
74fc2a2b 3110rs6000-ibm-aix7.1.* | powerpc-ibm-aix7.1.*)
51fbbb92 3111 tmake_file="rs6000/t-aix52 t-slibgcc"
6643d236
DE
3112 if test x$cpu_is_64bit = xyes; then
3113 tm_file="${tm_file} rs6000/biarch64.h"
3114 tmake_file="rs6000/t-aix64 t-slibgcc"
3115 fi
3116 tm_file="${tm_file} rs6000/aix.h rs6000/aix71.h rs6000/xcoff.h rs6000/aix-stdint.h"
74fc2a2b
DE
3117 extra_options="${extra_options} rs6000/aix64.opt"
3118 use_collect2=yes
3119 thread_file='aix'
3120 use_gcc_stdint=wrap
74fc2a2b
DE
3121 default_use_cxa_atexit=yes
3122 ;;
3123rs6000-ibm-aix[789].* | powerpc-ibm-aix[789].*)
74fc2a2b 3124 tmake_file="rs6000/t-aix52 t-slibgcc"
47ddb895 3125 if test x$cpu_is_64bit = xyes; then
6643d236 3126 tm_file="${tm_file} rs6000/biarch64.h"
47ddb895
DE
3127 tmake_file="rs6000/t-aix64 t-slibgcc"
3128 fi
3129 tm_file="${tm_file} rs6000/aix.h rs6000/aix72.h rs6000/xcoff.h rs6000/aix-stdint.h"
51fbbb92
DE
3130 extra_options="${extra_options} rs6000/aix64.opt"
3131 use_collect2=yes
3132 thread_file='aix'
3133 use_gcc_stdint=wrap
b9584cb5 3134 default_use_cxa_atexit=yes
ba6a1b78 3135 ;;
85b8555e
DD
3136rl78-*-elf*)
3137 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
3138 target_has_targetm_common=no
3139 c_target_objs="rl78-c.o"
3140 cxx_target_objs="rl78-c.o"
3141 tmake_file="${tmake_file} rl78/t-rl78"
3142 ;;
65a324b4 3143rx-*-elf*)
80cf2e08 3144 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
65a324b4 3145 tmake_file="${tmake_file} rx/t-rx"
76aaa9cd
YS
3146 extra_options="${extra_options} rx/elf.opt"
3147 ;;
3148rx-*-linux*)
3149 tm_file="elfos.h linux.h glibc-stdint.h rx/linux.h ../../libgcc/config/rx/rx-abi.h"
3150 tmake_file="${tmake_file} rx/t-linux"
65a324b4 3151 ;;
0e5a4ad8 3152s390-*-linux*)
8e38461c 3153 tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
3af82a61
AK
3154 c_target_objs="${c_target_objs} s390-c.o"
3155 cxx_target_objs="${cxx_target_objs} s390-c.o"
f3054223
AL
3156 if test x$enable_targets = xall; then
3157 tmake_file="${tmake_file} s390/t-linux64"
3158 fi
3af82a61 3159 tmake_file="${tmake_file} s390/t-s390"
9628a767 3160 ;;
0e5a4ad8 3161s390x-*-linux*)
8e38461c 3162 tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
ed9cbf7c 3163 tm_p_file="linux-protos.h s390/s390-protos.h"
3af82a61
AK
3164 c_target_objs="${c_target_objs} s390-c.o"
3165 cxx_target_objs="${cxx_target_objs} s390-c.o"
70eeb10b 3166 md_file=s390/s390.md
1c0ca89d 3167 extra_modes=s390/s390-modes.def
70eeb10b 3168 out_file=s390/s390.c
3af82a61 3169 tmake_file="${tmake_file} s390/t-linux64 s390/t-s390"
9628a767 3170 ;;
24fe22c9 3171s390x-ibm-tpf*)
48c16b28 3172 tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h glibc-stdint.h s390/tpf.h"
3af82a61
AK
3173 tm_p_file=s390/s390-protos.h
3174 c_target_objs="${c_target_objs} s390-c.o"
3175 cxx_target_objs="${cxx_target_objs} s390-c.o"
3176 md_file=s390/s390.md
3177 extra_modes=s390/s390-modes.def
3178 out_file=s390/s390.c
3179 thread_file='tpf'
a8ba31f2 3180 extra_options="${extra_options} s390/tpf.opt"
3af82a61 3181 tmake_file="${tmake_file} s390/t-s390"
24fe22c9 3182 ;;
cd985f66 3183sh-*-elf* | sh[12346l]*-*-elf* | \
93fea8d3 3184 sh-*-linux* | sh[2346lbe]*-*-linux* | \
bc6d9014 3185 sh-*-netbsdelf* | shl*-*-netbsdelf*)
da28a3b9
JR
3186 tmake_file="${tmake_file} sh/t-sh sh/t-elf"
3187 if test x${with_endian} = x; then
3188 case ${target} in
3189 sh[1234]*be-*-* | sh[1234]*eb-*-*) with_endian=big ;;
3190 shbe-*-* | sheb-*-*) with_endian=big,little ;;
3191 sh[1234]l* | sh[34]*-*-linux*) with_endian=little ;;
bc6d9014
OE
3192 shl* | sh*-*-linux* | \
3193 sh-superh-elf) with_endian=little,big ;;
da28a3b9
JR
3194 sh[1234]*-*-*) with_endian=big ;;
3195 *) with_endian=big,little ;;
3196 esac
3197 fi
aca600aa
AS
3198 # TM_ENDIAN_CONFIG is used by t-sh to determine multilibs.
3199 # First word : the default endian.
3200 # Second word: the secondary endian (optional).
da28a3b9 3201 case ${with_endian} in
aca600aa
AS
3202 big) TM_ENDIAN_CONFIG=mb ;;
3203 little) TM_ENDIAN_CONFIG=ml ;;
3204 big,little) TM_ENDIAN_CONFIG="mb ml" ;;
3205 little,big) TM_ENDIAN_CONFIG="ml mb" ;;
da28a3b9
JR
3206 *) echo "with_endian=${with_endian} not supported."; exit 1 ;;
3207 esac
3208 case ${with_endian} in
3209 little*) tm_file="sh/little.h ${tm_file}" ;;
3210 esac
9e08f9e2 3211 tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h"
b01bc573 3212 case ${target} in
da28a3b9 3213 sh*-*-linux*) tmake_file="${tmake_file} sh/t-linux"
1e44e857
DJ
3214 if test x$enable_fdpic = xyes; then
3215 tm_defines="$tm_defines FDPIC_DEFAULT=1"
3216 fi
8e38461c 3217 tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
a4714d14 3218 sh*-*-netbsd*)
dfe2677b 3219 tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
a4714d14
JM
3220 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
3221
3222 ;;
c68e4eed
CB
3223 sh*-superh-elf) if test x$with_libgloss != xno; then
3224 with_libgloss=yes
3225 tm_file="${tm_file} sh/newlib.h"
3226 fi
2d606e03 3227 tm_file="${tm_file} sh/embed-elf.h"
c68e4eed 3228 tm_file="${tm_file} sh/superh.h"
c68e4eed 3229 extra_options="${extra_options} sh/superh.opt" ;;
8c1aaf26
R
3230 *) if test x$with_newlib = xyes \
3231 && test x$with_libgloss = xyes; then
3232 tm_file="${tm_file} sh/newlib.h"
3233 fi
3234 tm_file="${tm_file} sh/embed-elf.h" ;;
da28a3b9
JR
3235 esac
3236 case ${target} in
da28a3b9 3237 *-*-netbsd)
da28a3b9 3238 ;;
207bf79d
JM
3239 *-*-elf*)
3240 tm_file="${tm_file} newlib-stdint.h"
3241 ;;
8bc6e101 3242 esac
da28a3b9
JR
3243 # sed el/eb endian suffixes away to avoid confusion with sh[23]e
3244 case `echo ${target} | sed 's/e[lb]-/-/'` in
312209c6
AO
3245 sh4a_single_only*) sh_cpu_target=sh4a-single-only ;;
3246 sh4a_single*) sh_cpu_target=sh4a-single ;;
3247 sh4a_nofpu*) sh_cpu_target=sh4a-nofpu ;;
3248 sh4al) sh_cpu_target=sh4al ;;
3249 sh4a*) sh_cpu_target=sh4a ;;
da28a3b9
JR
3250 sh4_single_only*) sh_cpu_target=sh4-single-only ;;
3251 sh4_single*) sh_cpu_target=sh4-single ;;
3252 sh4_nofpu*) sh_cpu_target=sh4-nofpu ;;
3253 sh4* | sh-superh-*) sh_cpu_target=sh4 ;;
3254 sh3e*) sh_cpu_target=sh3e ;;
3255 sh*-*-netbsd* | sh3*) sh_cpu_target=sh3 ;;
157371cf
AO
3256 sh2a_single_only*) sh_cpu_target=sh2a-single-only ;;
3257 sh2a_single*) sh_cpu_target=sh2a-single ;;
3258 sh2a_nofpu*) sh_cpu_target=sh2a-nofpu ;;
3259 sh2a*) sh_cpu_target=sh2a ;;
da28a3b9
JR
3260 sh2e*) sh_cpu_target=sh2e ;;
3261 sh2*) sh_cpu_target=sh2 ;;
3262 *) sh_cpu_target=sh1 ;;
8f48afc1 3263 esac
8c1aaf26
R
3264 # did the user say --without-fp ?
3265 if test x$with_fp = xno; then
3266 case ${sh_cpu_target} in
8c1aaf26
R
3267 sh4al | sh1) ;;
3268 sh4a* ) sh_cpu_target=sh4a-nofpu ;;
3269 sh4*) sh_cpu_target=sh4-nofpu ;;
3270 sh3*) sh_cpu_target=sh3 ;;
3271 sh2a*) sh_cpu_target=sh2a-nofpu ;;
3272 sh2*) sh_cpu_target=sh2 ;;
3273 *) echo --without-fp not available for $target: ignored
3274 esac
3275 tm_defines="$tm_defines STRICT_NOFPU=1"
3276 fi
da28a3b9
JR
3277 sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr A-Z_ a-z-`"
3278 case $sh_cpu_default in
157371cf 3279 sh2a-single-only | sh2a-single | sh2a-nofpu | sh2a | \
312209c6 3280 sh4a-single-only | sh4a-single | sh4a-nofpu | sh4a | sh4al | \
27a0ce7d 3281 sh4-single-only | sh4-single | sh4-nofpu | sh4 | sh4-300 | \
bf09b512 3282 sh3e | sh3 | sh2e | sh2 | sh1) ;;
da28a3b9
JR
3283 "") sh_cpu_default=${sh_cpu_target} ;;
3284 *) echo "with_cpu=$with_cpu not supported"; exit 1 ;;
dbf87f32 3285 esac
da28a3b9 3286 sh_multilibs=${with_multilib_list}
aca600aa 3287 if test "$sh_multilibs" = "default" ; then
da28a3b9
JR
3288 case ${target} in
3289 sh[1234]*) sh_multilibs=${sh_cpu_target} ;;
da28a3b9 3290 sh-superh-*) sh_multilibs=m4,m4-single,m4-single-only,m4-nofpu ;;
8f6d1c86 3291 sh*-*-linux*) sh_multilibs=m1,m2,m2a,m3e,m4 ;;
da28a3b9 3292 sh*-*-netbsd*) sh_multilibs=m3,m3e,m4 ;;
157371cf 3293 *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
da28a3b9 3294 esac
8c1aaf26
R
3295 if test x$with_fp = xno; then
3296 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`"
3297 fi
da28a3b9 3298 fi
25e651ca 3299 target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`
da28a3b9 3300 tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
aca600aa 3301 tm_defines="$tm_defines SUPPORT_`echo $sh_cpu_default | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
47e5ff44 3302 sh_multilibs=`echo $sh_multilibs | sed -e 's/,/ /g' -e 's/^[Ss][Hh]/m/' -e 's/ [Ss][Hh]/ m/g' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz-`
da28a3b9
JR
3303 for sh_multilib in ${sh_multilibs}; do
3304 case ${sh_multilib} in
aca600aa
AS
3305 m1 | m2 | m2e | m3 | m3e | \
3306 m4 | m4-single | m4-single-only | m4-nofpu | m4-300 |\
3307 m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al | \
bc6d9014 3308 m2a | m2a-single | m2a-single-only | m2a-nofpu)
aca600aa
AS
3309 # TM_MULTILIB_CONFIG is used by t-sh for the non-endian multilib definition
3310 # It is passed to MULTIILIB_OPTIONS verbatim.
3311 TM_MULTILIB_CONFIG="${TM_MULTILIB_CONFIG}/${sh_multilib}"
3312 tm_defines="$tm_defines SUPPORT_`echo $sh_multilib | sed 's/^m/sh/' | tr abcdefghijklmnopqrstuvwxyz- ABCDEFGHIJKLMNOPQRSTUVWXYZ_`=1"
da28a3b9 3313 ;;
aca600aa
AS
3314 \!*) # TM_MULTILIB_EXCEPTIONS_CONFIG is used by t-sh
3315 # It is passed the MULTILIB_EXCEPTIONS verbatim.
3316 TM_MULTILIB_EXCEPTIONS_CONFIG="${TM_MULTILIB_EXCEPTIONS_CONFIG} `echo $sh_multilib | sed 's/^!//'`" ;;
da28a3b9
JR
3317 *)
3318 echo "with_multilib_list=${sh_multilib} not supported."
3319 exit 1
3320 ;;
3321 esac
3322 done
aca600aa 3323 TM_MULTILIB_CONFIG=`echo $TM_MULTILIB_CONFIG | sed 's:^/::'`
25e651ca 3324 if test x${enable_incomplete_targets} = xyes ; then
bc6d9014 3325 tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1"
da28a3b9 3326 fi
44509946
AS
3327 tm_file="$tm_file ./sysroot-suffix.h"
3328 tmake_file="$tmake_file t-sysroot-suffix"
fa5322fa 3329 ;;
314733e2 3330sh-*-rtems*)
aefe4056 3331 tmake_file="${tmake_file} sh/t-sh sh/t-rtems"
9e08f9e2 3332 tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
314733e2 3333 ;;
55047c9d 3334sh-wrs-vxworks)
5f73c6cc 3335 tmake_file="$tmake_file sh/t-sh sh/t-vxworks"
9e08f9e2 3336 tm_file="${tm_file} elfos.h sh/elf.h sh/embed-elf.h vx-common.h vxworks.h sh/vxworks.h"
55047c9d 3337 ;;
61ed06c3 3338sparc-*-elf*)
ec047df4 3339 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp-elf.h"
07981468
KE
3340 case ${target} in
3341 *-leon-*)
8d12174d 3342 tmake_file="sparc/t-sparc sparc/t-leon"
07981468
KE
3343 ;;
3344 *-leon[3-9]*)
8d12174d 3345 tmake_file="sparc/t-sparc sparc/t-leon3"
07981468
KE
3346 ;;
3347 *)
8d12174d 3348 tmake_file="sparc/t-sparc sparc/t-elf"
07981468
KE
3349 ;;
3350 esac
61ed06c3 3351 ;;
ad234fc7 3352sparc-*-rtems*)
ec047df4 3353 tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h newlib-stdint.h"
9c281312 3354 tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems"
ad234fc7
EB
3355 ;;
3356sparc-*-linux*)
6cc7fb90 3357 tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/tso.h"
fe609b0f 3358 extra_options="${extra_options} sparc/long-double-switch.opt"
07981468
KE
3359 case ${target} in
3360 *-leon-*)
8d12174d 3361 tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon"
07981468
KE
3362 ;;
3363 *-leon[3-9]*)
8d12174d 3364 tmake_file="${tmake_file} sparc/t-sparc sparc/t-leon3"
07981468
KE
3365 ;;
3366 *)
b040f2be 3367 tmake_file="${tmake_file} sparc/t-sparc"
07981468
KE
3368 ;;
3369 esac
5f7ca34b
DM
3370 if test x$enable_targets = xall; then
3371 tm_file="sparc/biarch64.h ${tm_file} sparc/linux64.h"
ccbdd3bc 3372 tmake_file="${tmake_file} sparc/t-linux64"
5f7ca34b
DM
3373 else
3374 tm_file="${tm_file} sparc/linux.h"
d3547cab 3375 tmake_file="${tmake_file} sparc/t-linux"
5f7ca34b 3376 fi
61ed06c3 3377 ;;
ad234fc7 3378sparc-*-netbsdelf*)
dfe2677b 3379 tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
a4714d14 3380 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
ad234fc7 3381 extra_options="${extra_options} sparc/long-double-switch.opt"
8d12174d 3382 tmake_file="${tmake_file} sparc/t-sparc"
3943fe02 3383 ;;
2587aa3b 3384sparc*-*-solaris2*)
2cf03b11 3385 tm_file="sparc/biarch64.h ${tm_file} ${sol2_tm_file} sparc/tso.h"
18167442 3386 case ${target} in
2587aa3b 3387 sparc64-*-* | sparcv9-*-*)
7c7dae65 3388 tm_file="sparc/default64.h ${tm_file}"
207bf79d 3389 ;;
2587aa3b
EB
3390 *)
3391 test x$with_cpu != x || with_cpu=v9
ec23ed60 3392 ;;
18167442 3393 esac
2cf03b11 3394 tmake_file="${tmake_file} sparc/t-sparc sparc/t-sol2"
61ed06c3 3395 ;;
1910440e 3396sparc-wrs-vxworks)
ec047df4 3397 tm_file="${tm_file} elfos.h sparc/sysv4.h vx-common.h vxworks.h sparc/vxworks.h"
8d12174d 3398 tmake_file="${tmake_file} sparc/t-sparc sparc/t-vxworks"
1910440e 3399 ;;
61ed06c3 3400sparc64-*-elf*)
ec047df4 3401 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h"
ae5f5715 3402 extra_options="${extra_options}"
8d12174d 3403 tmake_file="${tmake_file} sparc/t-sparc"
61ed06c3 3404 ;;
ad234fc7 3405sparc64-*-rtems*)
ec047df4 3406 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h sparc/sysv4.h sparc/sp64-elf.h sparc/rtemself.h rtems.h"
ae5f5715 3407 extra_options="${extra_options}"
aefe4056 3408 tmake_file="${tmake_file} sparc/t-sparc sparc/t-rtems-64"
ad234fc7
EB
3409 ;;
3410sparc64-*-linux*)
7c7dae65 3411 tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default64.h sparc/linux64.h sparc/tso.h"
ad234fc7 3412 extra_options="${extra_options} sparc/long-double-switch.opt"
b040f2be 3413 tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
ad234fc7 3414 ;;
c7240cbd
DB
3415sparc64-*-freebsd*|ultrasparc-*-freebsd*)
3416 tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
fe609b0f 3417 extra_options="${extra_options} sparc/long-double-switch.opt"
c7240cbd 3418 case "x$with_cpu" in
e0054185 3419 xultrasparc) ;;
c7240cbd
DB
3420 x) with_cpu=ultrasparc ;;
3421 *) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
3422 esac
8d12174d 3423 tmake_file="${tmake_file} sparc/t-sparc"
c7240cbd 3424 ;;
4cb7482c 3425sparc64-*-netbsd*)
4cb7482c 3426 tm_file="sparc/biarch64.h ${tm_file}"
dfe2677b 3427 tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
a4714d14 3428 extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
fe609b0f 3429 extra_options="${extra_options} sparc/long-double-switch.opt"
8d12174d 3430 tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
4cb7482c 3431 ;;
ad234fc7 3432sparc64-*-openbsd*)
ec047df4 3433 tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/sp64-elf.h"
ad234fc7 3434 tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h sparc/openbsd64.h"
5369e2d4 3435 extra_options="${extra_options} openbsd.opt"
ae5f5715 3436 extra_options="${extra_options}"
ad234fc7
EB
3437 gas=yes gnu_ld=yes
3438 with_cpu=ultrasparc
8d12174d 3439 tmake_file="${tmake_file} sparc/t-sparc"
ad234fc7 3440 ;;
bcead286
BS
3441tic6x-*-elf)
3442 tm_file="elfos.h ${tm_file} c6x/elf-common.h c6x/elf.h"
3443 tm_file="${tm_file} dbxelf.h tm-dwarf2.h newlib-stdint.h"
bcead286 3444 tmake_file="c6x/t-c6x c6x/t-c6x-elf"
bcead286
BS
3445 use_collect2=no
3446 ;;
3447tic6x-*-uclinux)
3448 tm_file="elfos.h ${tm_file} gnu-user.h linux.h c6x/elf-common.h c6x/uclinux-elf.h"
3449 tm_file="${tm_file} dbxelf.h tm-dwarf2.h glibc-stdint.h"
3450 tm_file="${tm_file} ./sysroot-suffix.h"
b040f2be 3451 tmake_file="t-sysroot-suffix t-slibgcc"
bcead286 3452 tmake_file="${tmake_file} c6x/t-c6x c6x/t-c6x-elf c6x/t-c6x-uclinux"
bcead286
BS
3453 use_collect2=no
3454 ;;
341c653c 3455tilegx*-*-linux*)
dd552284
WL
3456 tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilegx/linux.h ${tm_file}"
3457 tmake_file="${tmake_file} tilegx/t-tilegx"
92be22dc 3458 extra_objs="${extra_objs} mul-tables.o"
1efcb8c6
JM
3459 c_target_objs="${c_target_objs} tilegx-c.o"
3460 cxx_target_objs="${cxx_target_objs} tilegx-c.o"
fd199491 3461 extra_headers="feedback.h"
341c653c
WL
3462 case $target in
3463 tilegxbe-*)
3464 tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
3465 ;;
3466 esac
dd552284 3467 ;;
341c653c 3468tilepro*-*-linux*)
dd552284
WL
3469 tm_file="elfos.h gnu-user.h linux.h glibc-stdint.h tilepro/linux.h ${tm_file}"
3470 tmake_file="${tmake_file} tilepro/t-tilepro"
92be22dc 3471 extra_objs="${extra_objs} mul-tables.o"
1efcb8c6
JM
3472 c_target_objs="${c_target_objs} tilepro-c.o"
3473 cxx_target_objs="${cxx_target_objs} tilepro-c.o"
fd199491 3474 extra_headers="feedback.h"
dd552284 3475 ;;
cc5476cb
RC
3476v850-*-rtems*)
3477 target_cpu_default="TARGET_CPU_generic"
3478 tm_file="dbxelf.h elfos.h v850/v850.h"
3479 tm_file="${tm_file} rtems.h v850/rtems.h newlib-stdint.h"
3480 tmake_file="${tmake_file} v850/t-v850"
aefe4056 3481 tmake_file="${tmake_file} v850/t-rtems"
cc5476cb
RC
3482 use_collect2=no
3483 c_target_objs="v850-c.o"
3484 cxx_target_objs="v850-c.o"
3485 ;;
1dcad079
NC
3486v850*-*-*)
3487 case ${target} in
dbdbd982
NC
3488 v850e3v5-*-*)
3489 target_cpu_default="TARGET_CPU_v850e3v5"
3490 ;;
1dcad079
NC
3491 v850e2v3-*-*)
3492 target_cpu_default="TARGET_CPU_v850e2v3"
3493 ;;
3494 v850e2-*-*)
3495 target_cpu_default="TARGET_CPU_v850e2"
3496 ;;
3497 v850e1-*-* | v850es-*-*)
3498 target_cpu_default="TARGET_CPU_v850e1"
3499 ;;
3500 v850e-*-*)
3501 target_cpu_default="TARGET_CPU_v850e"
3502 ;;
3503 v850-*-*)
3504 target_cpu_default="TARGET_CPU_generic"
3505 ;;
3506 esac
fcbf5a00 3507 tm_file="dbxelf.h elfos.h newlib-stdint.h v850/v850.h"
b4378319
NC
3508 if test x$stabs = xyes
3509 then
3510 tm_file="${tm_file} dbx.h"
3511 fi
3512 use_collect2=no
3513 c_target_objs="v850-c.o"
3514 cxx_target_objs="v850-c.o"
207bf79d 3515 use_gcc_stdint=wrap
b4378319 3516 ;;
c4e75102 3517vax-*-linux*)
8e38461c 3518 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
4ad70280 3519 extra_options="${extra_options} vax/elf.opt"
c4e75102 3520 ;;
69474c3c 3521vax-*-netbsdelf*)
dfe2677b 3522 tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
4ad70280 3523 extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
dfe2677b 3524 tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
69474c3c 3525 ;;
61ed06c3 3526vax-*-openbsd*)
a42014a3 3527 tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-libpthread.h vax/openbsd.h"
5369e2d4 3528 extra_options="${extra_options} openbsd.opt"
61ed06c3
HPN
3529 use_collect2=yes
3530 ;;
0969ec7d
EB
3531visium-*-elf*)
3532 tm_file="dbxelf.h elfos.h ${tm_file} visium/elf.h newlib-stdint.h"
3533 tmake_file="visium/t-visium visium/t-crtstuff"
3534 ;;
14d269bb
GK
3535xstormy16-*-elf)
3536 # For historical reasons, the target files omit the 'x'.
5519175f 3537 tm_file="dbxelf.h elfos.h newlib-stdint.h stormy16/stormy16.h"
14d269bb 3538 tm_p_file=stormy16/stormy16-protos.h
64ac3c33 3539 tm_d_file="elfos.h stormy16/stormy16.h"
14d269bb
GK
3540 md_file=stormy16/stormy16.md
3541 out_file=stormy16/stormy16.c
d45d2353 3542 extra_options=stormy16/stormy16.opt
14d269bb 3543 tmake_file="stormy16/t-stormy16"
14d269bb 3544 ;;
6d656178 3545xtensa*-*-elf*)
416ea725 3546 tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h"
4933ae74 3547 extra_options="${extra_options} xtensa/elf.opt"
03984308 3548 ;;
6d656178 3549xtensa*-*-linux*)
8e38461c 3550 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
5f73c6cc 3551 tmake_file="${tmake_file} xtensa/t-xtensa"
03984308 3552 ;;
4a0a9457
MF
3553xtensa*-*-uclinux*)
3554 tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h"
3555 tmake_file="${tmake_file} xtensa/t-xtensa"
3556 extra_options="${extra_options} xtensa/uclinux.opt"
3557 ;;
2beef00e 3558am33_2.0-*-linux*)
8e38461c 3559 tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
2beef00e 3560 gas=yes gnu_ld=yes
2beef00e
AO
3561 use_collect2=no
3562 ;;
7f05b779 3563m32c-*-rtems*)
24b00560 3564 tm_file="dbxelf.h elfos.h ${tm_file} m32c/rtems.h rtems.h newlib-stdint.h"
7f05b779
JS
3565 c_target_objs="m32c-pragma.o"
3566 cxx_target_objs="m32c-pragma.o"
3567 ;;
38b2d076 3568m32c-*-elf*)
24b00560 3569 tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
38b2d076
DD
3570 c_target_objs="m32c-pragma.o"
3571 cxx_target_objs="m32c-pragma.o"
38b2d076 3572 ;;
61ed06c3 3573*)
b01bc573 3574 echo "*** Configuration ${target} not supported" 1>&2
61ed06c3
HPN
3575 exit 1
3576 ;;
3577esac
3578
f6bc51cb 3579case ${target} in
f6bc51cb 3580i[34567]86-*-linux* | x86_64-*-linux*)
ab442df7 3581 tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386"
f6bc51cb
L
3582 ;;
3583i[34567]86-*-* | x86_64-*-*)
ab442df7 3584 tmake_file="${tmake_file} i386/t-gmm_malloc i386/t-i386"
f6bc51cb 3585 ;;
c5f0fe67 3586powerpc*-*-* | rs6000-*-*)
83349046 3587 tm_file="${tm_file} ${cpu_type}/option-defaults.h"
f6bc51cb
L
3588esac
3589
ad669a1a
SN
3590# non-glibc systems
3591case ${target} in
3592*-linux-musl*)
3593 tmake_file="${tmake_file} t-musl"
3594 ;;
3595*-linux-uclibc*)
3596 tmake_file="${tmake_file} t-uclibc"
3597 ;;
3598esac
3599
f25afa93
SE
3600# Assume the existence of indirect function support and allow the use of the
3601# resolver attribute.
3602case ${target} in
3603*-*-linux*android*|*-*-linux*uclibc*|*-*-linux*musl*)
3604 ;;
e9cb89b9
ST
3605*-*-kfreebsd*-gnu | *-*-kopensolaris*-gnu)
3606 ;;
3607*-*-linux* | *-*-gnu*)
f25afa93 3608 case ${target} in
d71031ff 3609 aarch64*-* | arm*-* | i[34567]86-* | powerpc*-* | s390*-* | sparc*-* | x86_64-*)
f25afa93
SE
3610 default_gnu_indirect_function=yes
3611 ;;
3612 esac
3613 ;;
3614esac
3615
87b6c18c
IV
3616# Build mkoffload tool
3617case ${target} in
3618*-intelmic-* | *-intelmicemul-*)
3619 tmake_file="${tmake_file} i386/t-intelmic"
41dbbb37 3620 tm_file="${tm_file} i386/intelmic-offload.h"
87b6c18c
IV
3621 ;;
3622esac
3623
acce4e77
JM
3624if [ "$target_has_targetcm" = "no" ]; then
3625 c_target_objs="$c_target_objs default-c.o"
3626 cxx_target_objs="$cxx_target_objs default-c.o"
3627fi
3628
c49a6962
JM
3629if [ "$common_out_file" = "" ]; then
3630 if [ "$target_has_targetm_common" = "yes" ]; then
3631 common_out_file="$cpu_type/$cpu_type-common.c"
3632 else
3633 common_out_file="default-common.c"
3634 fi
3635fi
3636
b4c522fa
IB
3637if [ "$target_has_targetdm" = "no" ]; then
3638 d_target_objs="$d_target_objs default-d.o"
3639fi
3640
73f09c99 3641# Support for --with-cpu and related options (and a few unrelated options,
a89ea0df 3642# too).
35341073
NN
3643case ${with_cpu} in
3644 yes | no)
3645 echo "--with-cpu must be passed a value" 1>&2
3646 exit 1
3647 ;;
3648esac
83079d89 3649
3fd77630
L
3650# Set arch and cpu from ${target} and ${target_noncanonical}. Set cpu
3651# to generic if there is no processor scheduler model for the target.
3652arch=
3653cpu=
4d16c0dc 3654arch_without_sse2=no
c6b9174f 3655arch_without_64bit=no
3fd77630 3656case ${target} in
1c379b78
TC
3657 i386-*-freebsd*)
3658 if test $fbsd_major -ge 6; then
3659 arch=i486
3660 else
3661 arch=i386
3662 fi
3663 cpu=generic
3664 arch_without_sse2=yes
3665 arch_without_64bit=yes
3666 ;;
8a45a00e
KW
3667 i386-*-netbsd*)
3668 arch=i486
3669 cpu=generic
3670 arch_without_sse2=yes
3671 arch_without_64bit=yes
3672 ;;
3fd77630
L
3673 i386-*-*)
3674 arch=i386
3675 cpu=i386
4d16c0dc 3676 arch_without_sse2=yes
c6b9174f 3677 arch_without_64bit=yes
3fd77630
L
3678 ;;
3679 i486-*-*)
3680 arch=i486
3681 cpu=i486
4d16c0dc 3682 arch_without_sse2=yes
c6b9174f 3683 arch_without_64bit=yes
3fd77630
L
3684 ;;
3685 i586-*-*)
4d16c0dc 3686 arch_without_sse2=yes
c6b9174f 3687 arch_without_64bit=yes
3fd77630
L
3688 case ${target_noncanonical} in
3689 k6_2-*)
3690 arch=k6-2
3691 cpu=k6-2
3692 ;;
3693 k6_3-*)
3694 arch=k6-3
3695 cpu=k6-3
3696 ;;
3697 k6-*)
3698 arch=k6
3699 cpu=k6
3700 ;;
3701 pentium_mmx-*|winchip_c6-*|winchip2-*|c3-*)
3702 arch=pentium-mmx
3703 cpu=pentium-mmx
3704 ;;
3705 *)
3706 arch=pentium
3707 cpu=pentium
3708 ;;
3709 esac
3710 ;;
3711 i686-*-* | i786-*-*)
3712 case ${target_noncanonical} in
9ce29eb0
VK
3713 znver1-*)
3714 arch=znver1
3715 cpu=znver1
3716 ;;
2901f42f
VK
3717 znver2-*)
3718 arch=znver2
3719 cpu=znver2
3720 ;;
3e2ae3ee
VK
3721 znver3-*)
3722 arch=znver3
3723 cpu=znver3
3724 ;;
ed97ad47
GG
3725 bdver4-*)
3726 arch=bdver4
3727 cpu=bdver4
3728 ;;
eb2f2b44
GG
3729 bdver3-*)
3730 arch=bdver3
3731 cpu=bdver3
3732 ;;
4d652a18
HJ
3733 bdver2-*)
3734 arch=bdver2
3735 cpu=bdver2
3736 ;;
1133125e
HJ
3737 bdver1-*)
3738 arch=bdver1
3739 cpu=bdver1
3740 ;;
14b52538
CF
3741 btver1-*)
3742 arch=btver1
3743 cpu=btver1
3744 ;;
e32bfc16
VK
3745 btver2-*)
3746 arch=btver2
3747 cpu=btver2
3748 ;;
3fd77630
L
3749 amdfam10-*|barcelona-*)
3750 arch=amdfam10
3751 cpu=amdfam10
3752 ;;
3753 k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3754 arch=k8-sse3
3755 cpu=k8-sse3
3756 ;;
3757 k8-*|opteron-*|athlon64-*|athlon_fx-*)
3758 arch=k8
3759 cpu=k8
3760 ;;
3761 athlon_xp-*|athlon_mp-*|athlon_4-*)
3762 arch=athlon-4
3763 cpu=athlon-4
4d16c0dc 3764 arch_without_sse2=yes
c6b9174f 3765 arch_without_64bit=yes
3fd77630
L
3766 ;;
3767 athlon_tbird-*|athlon-*)
3768 arch=athlon
3769 cpu=athlon
4d16c0dc 3770 arch_without_sse2=yes
3fd77630
L
3771 ;;
3772 geode-*)
3773 arch=geode
3774 cpu=geode
4d16c0dc 3775 arch_without_sse2=yes
3fd77630
L
3776 ;;
3777 pentium2-*)
3778 arch=pentium2
3779 cpu=pentium2
4d16c0dc 3780 arch_without_sse2=yes
3fd77630
L
3781 ;;
3782 pentium3-*|pentium3m-*)
3783 arch=pentium3
3784 cpu=pentium3
4d16c0dc 3785 arch_without_sse2=yes
3fd77630
L
3786 ;;
3787 pentium4-*|pentium4m-*)
3788 arch=pentium4
3789 cpu=pentium4
3790 ;;
3791 prescott-*)
3792 arch=prescott
3793 cpu=prescott
3794 ;;
3795 nocona-*)
3796 arch=nocona
3797 cpu=nocona
3798 ;;
3799 atom-*)
3800 arch=atom
3801 cpu=atom
3802 ;;
0b871ccf
YR
3803 slm-*)
3804 arch=slm
3805 cpu=slm
3806 ;;
3fd77630
L
3807 core2-*)
3808 arch=core2
3809 cpu=core2
3810 ;;
1dbb04c9
L
3811 corei7-*)
3812 arch=corei7
3813 cpu=corei7
3814 ;;
35758e5b
L
3815 corei7_avx-*)
3816 arch=corei7-avx
3817 cpu=corei7-avx
3818 ;;
3fd77630
L
3819 pentium_m-*)
3820 arch=pentium-m
3821 cpu=pentium-m
3822 ;;
3823 pentiumpro-*)
3824 arch=pentiumpro
3825 cpu=pentiumpro
4d16c0dc 3826 arch_without_sse2=yes
3fd77630
L
3827 ;;
3828 *)
3829 arch=pentiumpro
3830 cpu=generic
4d16c0dc 3831 arch_without_sse2=yes
c6b9174f 3832 arch_without_64bit=yes
3fd77630
L
3833 ;;
3834 esac
3835 ;;
3836 x86_64-*-*)
3837 case ${target_noncanonical} in
9ce29eb0
VK
3838 znver1-*)
3839 arch=znver1
3840 cpu=znver1
3841 ;;
2901f42f
VK
3842 znver2-*)
3843 arch=znver2
3844 cpu=znver2
3845 ;;
3e2ae3ee
VK
3846 znver3-*)
3847 arch=znver3
3848 cpu=znver3
3849 ;;
ed97ad47
GG
3850 bdver4-*)
3851 arch=bdver4
3852 cpu=bdver4
3853 ;;
eb2f2b44
GG
3854 bdver3-*)
3855 arch=bdver3
3856 cpu=bdver3
3857 ;;
4d652a18
HJ
3858 bdver2-*)
3859 arch=bdver2
3860 cpu=bdver2
3861 ;;
1133125e
HJ
3862 bdver1-*)
3863 arch=bdver1
3864 cpu=bdver1
3865 ;;
14b52538
CF
3866 btver1-*)
3867 arch=btver1
3868 cpu=btver1
3869 ;;
e32bfc16
VK
3870 btver2-*)
3871 arch=btver2
3872 cpu=btver2
3873 ;;
3fd77630
L
3874 amdfam10-*|barcelona-*)
3875 arch=amdfam10
3876 cpu=amdfam10
3877 ;;
3878 k8_sse3-*|opteron_sse3-*|athlon64_sse3-*)
3879 arch=k8-sse3
3880 cpu=k8-sse3
3881 ;;
3882 k8-*|opteron-*|athlon_64-*)
3883 arch=k8
3884 cpu=k8
3885 ;;
3886 nocona-*)
3887 arch=nocona
3888 cpu=nocona
3889 ;;
3890 atom-*)
3891 arch=atom
3892 cpu=atom
3893 ;;
0b871ccf
YR
3894 slm-*)
3895 arch=slm
3896 cpu=slm
3897 ;;
3fd77630
L
3898 core2-*)
3899 arch=core2
3900 cpu=core2
3901 ;;
1dbb04c9
L
3902 corei7-*)
3903 arch=corei7
3904 cpu=corei7
3905 ;;
3fd77630
L
3906 *)
3907 arch=x86-64
3908 cpu=generic
3909 ;;
3910 esac
3911 ;;
3912esac
3913
35341073
NN
3914# If there is no $with_cpu option, try to infer one from ${target}.
3915# This block sets nothing except for with_cpu.
3916if test x$with_cpu = x ; then
3917 case ${target} in
a0f4ee6e 3918 i[34567]86-*-elfiamcu)
2d6b2e28 3919 with_cpu=lakemont
a0f4ee6e 3920 ;;
3fd77630
L
3921 i[34567]86-*-*|x86_64-*-*)
3922 with_cpu=$cpu
35341073
NN
3923 ;;
3924 alphaev6[78]*-*-*)
3925 with_cpu=ev67
3926 ;;
3927 alphaev6*-*-*)
3928 with_cpu=ev6
3929 ;;
3930 alphapca56*-*-*)
3931 with_cpu=pca56
3932 ;;
3933 alphaev56*-*-*)
3934 with_cpu=ev56
3935 ;;
3936 alphaev5*-*-*)
3937 with_cpu=ev5
3938 ;;
faf9ab98 3939 frv-*-*linux* | frv400-*-*linux*)
34208acf
AO
3940 with_cpu=fr400
3941 ;;
faf9ab98
AH
3942 frv550-*-*linux*)
3943 with_cpu=fr550
3944 ;;
59fbf3cb 3945 m68k*-*-*)
10e96df4
NS
3946 case "$with_arch" in
3947 "cf")
3948 with_cpu=${default_cf_cpu}
3949 ;;
3950 "" | "m68k")
3951 with_cpu=m${default_m68k_cpu}
3952 ;;
3953 esac
59fbf3cb 3954 ;;
35341073 3955 sparc*-*-*)
1f65ae7a
EB
3956 case ${target} in
3957 *-leon-*)
3958 with_cpu=leon
3959 ;;
3960 *-leon[3-9]*)
3961 with_cpu=leon3
3962 ;;
d81230b5
DH
3963 *-leon[3-9]v7*)
3964 with_cpu=leon3v7
3965 ;;
1f65ae7a
EB
3966 *)
3967 with_cpu="`echo ${target} | sed 's/-.*$//'`"
3968 ;;
3969 esac
35341073 3970 ;;
175650bc
OH
3971 visium-*-*)
3972 with_cpu=gr5
3973 ;;
35341073 3974 esac
8981c15b
JM
3975
3976 # Avoid overriding --with-cpu-32 and --with-cpu-64 values.
3977 case ${target} in
3978 i[34567]86-*-*|x86_64-*-*)
3fd77630
L
3979 if test x$with_cpu_32 != x || test x$with_cpu_64 != x; then
3980 if test x$with_cpu_32 = x; then
3981 with_cpu_32=$with_cpu
3982 fi
3983 if test x$with_cpu_64 = x; then
3984 with_cpu_64=$with_cpu
3985 fi
3986 with_cpu=
3987 fi
3988 ;;
3989 esac
3990fi
3991
3992# Support for --with-arch and related options (and a few unrelated options,
3993# too).
3994case ${with_arch} in
3995 yes | no)
3996 echo "--with-arch must be passed a value" 1>&2
3997 exit 1
3998 ;;
3999esac
4000
4001# If there is no $with_arch option, try to infer one from ${target}.
4002# This block sets nothing except for with_arch.
4003if test x$with_arch = x ; then
4004 case ${target} in
91ad7e13
L
4005 i[34567]86-*-darwin*|x86_64-*-darwin*)
4006 # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
4007 # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
4008 ;;
a0f4ee6e 4009 i[34567]86-*-elfiamcu)
2d6b2e28 4010 with_arch=lakemont
a0f4ee6e 4011 ;;
a3af5e26 4012 i[34567]86-*-*)
4d16c0dc
L
4013 # --with-fpmath sets the default ISA to SSE2, which is the same
4014 # ISA supported by Pentium 4.
4015 if test x$with_fpmath = x || test $arch_without_sse2 = no; then
4016 with_arch=$arch
4017 else
4018 with_arch=pentium4
a3af5e26
L
4019 fi
4020 ;;
4021 x86_64-*-*)
3fd77630
L
4022 with_arch=$arch
4023 ;;
74240413
RS
4024 mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4025 with_arch=r5900
4026 ;;
4027 mips*-*-vxworks)
4028 with_arch=mips2
4029 ;;
3fd77630
L
4030 esac
4031
4032 # Avoid overriding --with-arch-32 and --with-arch-64 values.
4033 case ${target} in
91ad7e13
L
4034 i[34567]86-*-darwin*|x86_64-*-darwin*)
4035 # Default arch is set via TARGET_SUBTARGET32_ISA_DEFAULT
4036 # and TARGET_SUBTARGET64_ISA_DEFAULT in config/i386/darwin.h.
4037 ;;
3fd77630
L
4038 i[34567]86-*-*|x86_64-*-*)
4039 if test x$with_arch_32 != x || test x$with_arch_64 != x; then
4040 if test x$with_arch_32 = x; then
55c4eeaa 4041 with_arch_32=$with_arch
3fd77630
L
4042 fi
4043 if test x$with_arch_64 = x; then
c6b9174f
L
4044 if test $arch_without_64bit = yes; then
4045 # Set the default 64bit arch to x86-64 if the default arch
4046 # doesn't support 64bit.
4047 with_arch_64=x86-64
4048 else
55c4eeaa 4049 with_arch_64=$with_arch
c6b9174f 4050 fi
3fd77630
L
4051 fi
4052 with_arch=
c6b9174f
L
4053 elif test $arch_without_64bit$need_64bit_isa = yesyes; then
4054 # Set the default 64bit arch to x86-64 if the default arch
4055 # doesn't support 64bit and we need 64bit ISA.
55c4eeaa 4056 with_arch_32=$with_arch
c6b9174f
L
4057 with_arch_64=x86-64
4058 with_arch=
8981c15b
JM
4059 fi
4060 ;;
4061 esac
35341073 4062fi
83079d89 4063
74240413
RS
4064# Infer a default setting for --with-float.
4065if test x$with_float = x; then
4066 case ${target} in
4067 mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4068 # The R5900 doesn't support 64-bit float. 32-bit float doesn't
4069 # comply with IEEE 754.
4070 with_float=soft
4071 ;;
4072 esac
4073fi
4074
04dfc6df
JU
4075# Infer a default setting for --with-fpu.
4076if test x$with_fpu = x; then
4077 case ${target} in
4078 mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4079 # The R5900 FPU only supports single precision.
4080 with_fpu=single
4081 ;;
4082 esac
4083fi
4084
a3af5e26
L
4085# Support --with-fpmath.
4086if test x$with_fpmath != x; then
4087 case ${target} in
4088 i[34567]86-*-* | x86_64-*-*)
4089 case ${with_fpmath} in
b71e5eba
UB
4090 avx)
4091 tm_file="${tm_file} i386/avxmath.h"
4092 ;;
a3af5e26
L
4093 sse)
4094 tm_file="${tm_file} i386/ssemath.h"
4095 ;;
4096 *)
4097 echo "Invalid --with-fpmath=$with_fpmath" 1>&2
4098 exit 1
4099 ;;
4100 esac
4101 ;;
4102 *)
4103 echo "--with-fpmath isn't supported for $target." 1>&2
4104 exit 1
4105 ;;
4106 esac
4107fi
4108
fe3e7450
AM
4109# Similarly for --with-schedule.
4110if test x$with_schedule = x; then
4111 case ${target} in
cd985f66 4112 hppa1*)
fe3e7450
AM
4113 # Override default PA8000 scheduling model.
4114 with_schedule=7100LC
4115 ;;
4116 esac
4117fi
83079d89 4118
74240413
RS
4119# Infer a default setting for --with-llsc.
4120if test x$with_llsc = x; then
4121 case ${target} in
74240413
RS
4122 mips*-*-linux*)
4123 # The kernel emulates LL and SC where necessary.
4124 with_llsc=yes
4125 ;;
240ae287
FN
4126 mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
4127 # The R5900 doesn't support LL(D) and SC(D).
4128 with_llsc=no
4129 ;;
74240413
RS
4130 esac
4131fi
4132
fe3e7450
AM
4133# Validate and mark as valid any --with options supported
4134# by this target. In order to use a particular --with option
4135# you must list it in supported_defaults; validating the value
4136# is optional. This case statement should set nothing besides
4137# supported_defaults.
7816bea0 4138
fe3e7450
AM
4139supported_defaults=
4140case "${target}" in
24034425 4141 aarch64*-*-*)
e63ae8c0 4142 supported_defaults="abi cpu cpu_64 arch arch_64 tune tune_64"
61ef34c5
SP
4143 if test x$with_cpu_64 != x && test x$with_cpu = x; then
4144 with_cpu=$with_cpu_64
4145 fi
61ef34c5
SP
4146 if test x$with_arch_64 != x && test x$with_arch = x; then
4147 with_arch=$with_arch_64
4148 fi
61ef34c5
SP
4149 if test x$with_tune_64 != x && test x$with_tune = x; then
4150 with_tune=$with_tune_64
4151 fi
04dedd18 4152 for which in cpu arch tune; do
24034425
IB
4153 eval "val=\$with_$which"
4154 base_val=`echo $val | sed -e 's/\+.*//'`
1140d42f 4155 ext_val=`echo $val | sed -e 's/[a-z0-9.-]\+//'`
24034425
IB
4156
4157 if [ $which = arch ]; then
4158 def=aarch64-arches.def
4159 pattern=AARCH64_ARCH
4160 else
4161 def=aarch64-cores.def
4162 pattern=AARCH64_CORE
4163 fi
4164
4165 ext_mask=AARCH64_CPU_DEFAULT_FLAGS
4166
4167 # Find the base CPU or ARCH id in aarch64-cores.def or
4168 # aarch64-arches.def
4169 if [ x"$base_val" = x ] \
4170 || grep "^$pattern(\"$base_val\"," \
4171 ${srcdir}/config/aarch64/$def \
4172 > /dev/null; then
4173
4174 if [ $which = arch ]; then
4175 base_id=`grep "^$pattern(\"$base_val\"," \
4176 ${srcdir}/config/aarch64/$def | \
4177 sed -e 's/^[^,]*,[ ]*//' | \
4178 sed -e 's/,.*$//'`
a3cd0246
KT
4179 # Extract the architecture flags from aarch64-arches.def
4180 ext_mask=`grep "^$pattern(\"$base_val\"," \
4181 ${srcdir}/config/aarch64/$def | \
4182 sed -e 's/)$//' | \
4183 sed -e 's/^.*,//'`
24034425
IB
4184 else
4185 base_id=`grep "^$pattern(\"$base_val\"," \
4186 ${srcdir}/config/aarch64/$def | \
4187 sed -e 's/^[^,]*,[ ]*//' | \
4188 sed -e 's/,.*$//'`
4189 fi
4190
4dc486b6
WD
4191 # Disallow extensions in --with-tune=cortex-a53+crc.
4192 if [ $which = tune ] && [ x"$ext_val" != x ]; then
4193 echo "Architecture extensions not supported in --with-$which=$val" 1>&2
4194 exit 1
4195 fi
4196
3644cadf
TC
4197 # Use the pre-processor to strip flatten the options.
4198 # This makes the format less rigid than if we use
4199 # grep and sed directly here.
4200 opt_macro="AARCH64_OPT_EXTENSION(A, B, C, D, E, F)=A, B, C, D, E, F"
4201 options_parsed="`$ac_cv_prog_CPP -D"$opt_macro" -x c \
4202 ${srcdir}/config/aarch64/aarch64-option-extensions.def`"
4203
4204 # Match one element inside AARCH64_OPT_EXTENSION, we
4205 # consume anything that's not a ,.
4206 elem="[ ]*\([^,]\+\)[ ]*"
4207
4208 # Repeat the pattern for the number of entries in the
4209 # AARCH64_OPT_EXTENSION, currently 6 times.
4210 sed_patt="^$elem,$elem,$elem,$elem,$elem,$elem"
4211
24034425
IB
4212 while [ x"$ext_val" != x ]
4213 do
4214 ext_val=`echo $ext_val | sed -e 's/\+//'`
4215 ext=`echo $ext_val | sed -e 's/\+.*//'`
4216 base_ext=`echo $ext | sed -e 's/^no//'`
3644cadf
TC
4217 opt_line=`echo -e "$options_parsed" | \
4218 grep "^\"$base_ext\""`
24034425
IB
4219
4220 if [ x"$base_ext" = x ] \
3644cadf
TC
4221 || [[ -n $opt_line ]]; then
4222
4223 # These regexp extract the elements based on
4224 # their group match index in the regexp.
4225 ext_canon=`echo -e "$opt_line" | \
4226 sed -e "s/$sed_patt/\2/"`
4227 ext_on=`echo -e "$opt_line" | \
4228 sed -e "s/$sed_patt/\3/"`
4229 ext_off=`echo -e "$opt_line" | \
4230 sed -e "s/$sed_patt/\4/"`
24034425
IB
4231
4232 if [ $ext = $base_ext ]; then
4233 # Adding extension
04a99ebe 4234 ext_mask="("$ext_mask") | ("$ext_on" | "$ext_canon")"
24034425
IB
4235 else
4236 # Removing extension
04a99ebe 4237 ext_mask="("$ext_mask") & ~("$ext_off" | "$ext_canon")"
24034425
IB
4238 fi
4239
4240 true
4241 else
4242 echo "Unknown extension used in --with-$which=$val" 1>&2
4243 exit 1
4244 fi
4245 ext_val=`echo $ext_val | sed -e 's/[a-z0-9]\+//'`
4246 done
4247
4248 ext_mask="(("$ext_mask") << 6)"
4249 if [ x"$base_id" != x ]; then
4250 target_cpu_cname="TARGET_CPU_$base_id | $ext_mask"
4251 fi
4252 true
4253 else
4dc486b6
WD
4254 # Allow --with-$which=native.
4255 if [ "$val" = native ]; then
4256 true
4257 else
4258 echo "Unknown $which used in --with-$which=$val" 1>&2
4259 exit 1
4260 fi
24034425
IB
4261 fi
4262 done
4263 ;;
4264
83079d89 4265 alpha*-*-*)
7816bea0
DJ
4266 supported_defaults="cpu tune"
4267 for which in cpu tune; do
4268 eval "val=\$with_$which"
b597bfd8
NN
4269 case "$val" in
4270 "" \
4271 | ev4 | ev45 | 21064 | ev5 | 21164 | ev56 | 21164a \
4272 | pca56 | 21164PC | 21164pc | ev6 | 21264 | ev67 \
4273 | 21264a)
7816bea0
DJ
4274 ;;
4275 *)
4276 echo "Unknown CPU used in --with-$which=$val" 1>&2
4277 exit 1
4278 ;;
4279 esac
4280 done
4281 ;;
4282
f9ccf899 4283 arc*-*-*)
53426f6c 4284 supported_defaults="cpu"
f9ccf899
CZ
4285
4286 if [ x"$with_cpu" = x ] \
4287 || grep "^ARC_CPU ($with_cpu," \
4288 ${srcdir}/config/arc/arc-cpus.def \
4289 > /dev/null; then
4290 # Ok
4291 true
4292 else
4293 echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4294 exit 1
4295 fi
53426f6c
JR
4296 ;;
4297
56856b58
J
4298 csky-*-*)
4299 supported_defaults="cpu endian float"
4300 ;;
4301
7816bea0 4302 arm*-*-*)
7cf13d1f 4303 supported_defaults="arch cpu float tune fpu abi mode tls"
a92ffb3e
RE
4304 for which in cpu tune arch; do
4305 # See if it matches a supported value
7816bea0 4306 eval "val=\$with_$which"
a92ffb3e
RE
4307 if [ x"$val" != x ]; then
4308 cpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
4309 -v cmd="chk$which $val" \
4310 ${srcdir}/config/arm/arm-cpus.in`
4311 if [ "$cpu" = "error" ]; then
4312 echo "Unknown target in --with-$which=$val" 1>&2
4313 exit 1
4314 else
4315 new_val=$cpu
4316 eval "target_${which}_cname=$new_val"
4317 echo "For $val real value is $new_val"
d3d3f1af 4318 fi
2682e19f 4319 fi
7816bea0
DJ
4320 done
4321
b597bfd8
NN
4322 case "$with_float" in
4323 "" \
9b66ebb1 4324 | soft | hard | softfp)
83079d89 4325 # OK
73f09c99 4326 ;;
83079d89 4327 *)
7816bea0 4328 echo "Unknown floating point type used in --with-float=$with_float" 1>&2
83079d89 4329 exit 1
73f09c99
DJ
4330 ;;
4331 esac
7816bea0 4332
a92ffb3e
RE
4333 # see if --with-fpu matches any of the supported FPUs
4334 if [ x"$with_fpu" != x ] ; then
170f2d18 4335 val=$with_fpu
a92ffb3e 4336 fpu=`awk -f ${srcdir}/config/arm/parsecpu.awk \
170f2d18 4337 -v cmd="chkfpu $val" \
a92ffb3e 4338 ${srcdir}/config/arm/arm-cpus.in`
170f2d18 4339 if [ "$fpu" = "error" ]
a92ffb3e 4340 then
170f2d18 4341 echo "Unknown target in --with-fpu=$val" 1>&2
a92ffb3e
RE
4342 exit 1
4343 fi
14562eb9 4344 fi
5848830f
PB
4345
4346 case "$with_abi" in
4347 "" \
ebca2d91 4348 | apcs-gnu | atpcs | aapcs | iwmmxt | aapcs-linux )
5848830f
PB
4349 #OK
4350 ;;
4351 *)
4352 echo "Unknown ABI used in --with-abi=$with_abi"
9b66ebb1
PB
4353 exit 1
4354 ;;
4355 esac
4356
3cf94279
PB
4357 case "$with_mode" in
4358 "" \
4359 | arm | thumb )
4360 #OK
4361 ;;
4362 *)
4363 echo "Unknown mode used in --with-mode=$with_mode"
4364 exit 1
4365 ;;
4366 esac
4367
7cf13d1f
NS
4368 case "$with_tls" in
4369 "" \
4370 | gnu | gnu2)
4371 # OK
4372 ;;
4373 *)
4374 echo "Unknown TLS method used in --with-tls=$with_tls" 1>&2
4375 exit 1
4376 ;;
4377 esac
4378
7816bea0 4379 if test "x$with_arch" != x && test "x$with_cpu" != x; then
0cdb761c
JG
4380 echo "Switch \"--with-arch\" may not be used with switch \"--with-cpu\"" 1>&2
4381 exit 1
4382 fi
4383
4384 if test "x$with_cpu" != x && test "x$with_tune" != x; then
4385 echo "Switch \"--with-tune\" may not be used with switch \"--with-cpu\"" 1>&2
4386 exit 1
7816bea0 4387 fi
c9acb877
MGD
4388
4389 # Add extra multilibs
4390 if test "x$with_multilib_list" != x; then
5d6551f5 4391 ml=
c9acb877 4392 arm_multilibs=`echo $with_multilib_list | sed -e 's/,/ /g'`
2f738ca5
TP
4393 if test "x${arm_multilibs}" != xdefault ; then
4394 for arm_multilib in ${arm_multilibs}; do
4395 case ${arm_multilib} in
4396 aprofile|rmprofile)
4397 tmake_profile_file="arm/t-multilib"
4398 ;;
5d6551f5
AO
4399 @*)
4400 ml=`echo "X$arm_multilib" | sed '1s,^X@,,'`
4401 if test -f "${srcdir}/config/arm/${ml}"; then
4402 tmake_file="${tmake_file} arm/${ml}"
4403 else
4404 echo "Error: ${ml} does not exist in ${srcdir}/config/arm" >&2
4405 exit 1
4406 fi
4407 ;;
2f738ca5
TP
4408 *)
4409 echo "Error: --with-multilib-list=${with_multilib_list} not supported." 1>&2
4410 exit 1
4411 ;;
4412 esac
4413 done
c2f46874 4414 fi
ec6be462
TP
4415
4416 if test "x${tmake_profile_file}" != x ; then
3e0201f0
TP
4417 # arm/t-aprofile and arm/t-rmprofile are only
4418 # designed to work without any with-cpu,
4419 # with-arch, with-mode, with-fpu or with-float
4420 # options.
ec6be462
TP
4421 if test "x$with_arch" != x \
4422 || test "x$with_cpu" != x \
4423 || test "x$with_float" != x \
4424 || test "x$with_fpu" != x \
4425 || test "x$with_mode" != x ; then
4426 echo "Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=${with_multilib_list}" 1>&2
4427 exit 1
5d6551f5
AO
4428 elif test "x$ml" != x ; then
4429 echo "Error: You cannot use builtin multilib profiles along with custom ones" 1>&2
4430 exit 1
ec6be462 4431 fi
93aa40fe
RE
4432 # But pass the default value for float-abi
4433 # through to the multilib selector
4434 with_float="soft"
ec6be462 4435 tmake_file="${tmake_file} ${tmake_profile_file}"
c2f46874 4436 TM_MULTILIB_CONFIG="$with_multilib_list"
ec6be462 4437 fi
c9acb877 4438 fi
7a433140 4439 target_cpu_cname=${target_cpu_cname:-arm7tdmi}
a4af8a10 4440 with_cpu=${with_cpu:-$target_cpu_cname}
73f09c99 4441 ;;
73f09c99 4442
34208acf
AO
4443 fr*-*-*linux*)
4444 supported_defaults=cpu
4445 case "$with_cpu" in
4446 fr400) ;;
faf9ab98 4447 fr550) ;;
34208acf
AO
4448 *)
4449 echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
4450 exit 1
4451 ;;
4452 esac
4453 ;;
4454
cd985f66 4455 fido-*-* | m68k*-*-*)
10e96df4
NS
4456 supported_defaults="arch cpu"
4457 case "$with_arch" in
4458 "" | "m68k"| "cf")
4459 m68k_arch_family="$with_arch"
4460 ;;
4461 *)
4462 echo "Invalid --with-arch=$with_arch" 1>&2
4463 exit 1
4464 ;;
4465 esac
59fbf3cb
NS
4466
4467 # We always have a $with_cpu setting here.
3704aae9 4468 case "$with_cpu" in
900ec02d
JB
4469 "m68000" | "m68010" | "m68020" | "m68030" | "m68040" | "m68060")
4470 m68k_cpu_ident=$with_cpu
4471 ;;
4472 "m68020-40")
4473 m68k_cpu_ident=m68020
4474 tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_40"
4475 ;;
4476 "m68020-60")
4477 m68k_cpu_ident=m68020
4478 tm_defines="$tm_defines M68K_DEFAULT_TUNE=u68020_60"
3704aae9
RZ
4479 ;;
4480 *)
900ec02d
JB
4481 # We need the C identifier rather than the string.
4482 m68k_cpu_ident=`awk -v arg="\"$with_cpu\"" \
4483 'BEGIN { FS="[ \t]*[,()][ \t]*" }; \
4484 $1 == "M68K_DEVICE" && $2 == arg { print $3 }' \
4485 ${srcdir}/config/m68k/m68k-devices.def`
4486 if [ x"$m68k_cpu_ident" = x ] ; then
4487 echo "Unknown CPU used in --with-cpu=$with_cpu" 1>&2
4488 exit 1
4489 fi
4490 with_cpu="mcpu=$with_cpu"
3704aae9
RZ
4491 ;;
4492 esac
4493 ;;
4494
7431c1a1
AS
4495 amdgcn-*-*)
4496 supported_defaults="arch tune"
4497
4498 for which in arch tune; do
4499 eval "val=\$with_$which"
4500 case ${val} in
591f869a 4501 "" | fiji | gfx900 | gfx906 )
7431c1a1
AS
4502 # OK
4503 ;;
4504 *)
4505 echo "Unknown cpu used in --with-$which=$val." 1>&2
4506 exit 1
4507 ;;
4508 esac
4509 done
4510 [ "x$with_arch" = x ] && with_arch=fiji
4511 ;;
4512
cd985f66 4513 hppa*-*-*)
7816bea0
DJ
4514 supported_defaults="arch schedule"
4515
b597bfd8
NN
4516 case "$with_arch" in
4517 "" | 1.0 | 1.1 | 2.0)
7816bea0
DJ
4518 # OK
4519 ;;
4520 *)
4521 echo "Unknown architecture used in --with-arch=$with_arch" 1>&2
4522 exit 1
4523 ;;
4524 esac
4525
b597bfd8
NN
4526 case "$with_schedule" in
4527 "" | 700 | 7100 | 7100LC | 7200 | 7300 | 8000)
83079d89
DJ
4528 # OK
4529 ;;
4530 *)
4531 echo "Unknown processor used in --with-schedule=$with_schedule." 1>&2
4532 exit 1
4533 ;;
4534 esac
73f09c99 4535 ;;
73f09c99 4536
83079d89 4537 i[34567]86-*-* | x86_64-*-*)
0465e49e 4538 supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
8981c15b 4539 for which in arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64; do
7816bea0 4540 eval "val=\$with_$which"
646bdeab
L
4541 case " $x86_archs " in
4542 *" ${val} "*)
d326eaf0
JH
4543 case "${target}" in
4544 x86_64-*-*)
8981c15b
JM
4545 case "x$which" in
4546 *_32)
4547 ;;
4548 *)
4549 echo "CPU given in --with-$which=$val doesn't support 64bit mode." 1>&2
4550 exit 1
4551 ;;
4552 esac
d326eaf0
JH
4553 ;;
4554 esac
4555 # OK
4556 ;;
7816bea0 4557 *)
646bdeab
L
4558 if test x${val} != x; then
4559 case " $x86_64_archs " in
4560 *" ${val} "*)
552ed3ea 4561 # Disallow x86-64-v* for --with-cpu=/--with-tune=
552ed3ea 4562 case "x$which$val" in
59482fa1 4563 xcpu*x86-64-v*|xtune*x86-64-v*)
552ed3ea
JJ
4564 echo "Unknown CPU given in --with-$which=$val." 1>&2
4565 exit 1
4566 ;;
4567 *)
4568 ;;
4569 esac
646bdeab
L
4570 # OK
4571 ;;
4572 *)
4573 # Allow $x86_cpus --with-cpu=/--with-tune=
4574 case "x$which" in
4575 xcpu*|xtune*)
4576 case " $x86_cpus " in
4577 *" ${val} "*)
4578 # OK
4579 ;;
4580 *)
4581 echo "Unknown CPU given in --with-$which=$val." 1>&2
4582 exit 1
4583 ;;
4584 esac
4585 ;;
4586 *)
4587 echo "Unknown CPU given in --with-$which=$val." 1>&2
4588 exit 1
4589 ;;
4590 esac
4591 ;;
4592 esac
4593 fi
7816bea0
DJ
4594 ;;
4595 esac
4596 done
4597 ;;
4598
09cae750 4599 riscv*-*-*)
4b815282 4600 supported_defaults="abi arch tune riscv_attribute isa_spec"
09cae750
PD
4601
4602 case "${target}" in
edace3e2 4603 riscv-* | riscv32*) xlen=32 ;;
09cae750
PD
4604 riscv64*) xlen=64 ;;
4605 *) echo "Unsupported RISC-V target ${target}" 1>&2; exit 1 ;;
4606 esac
4607
4b815282
KC
4608 case "${with_isa_spec}" in
4609 ""|default|2.2)
4610 tm_defines="${tm_defines} TARGET_DEFAULT_ISA_SPEC=ISA_SPEC_CLASS_2P2"
4611 ;;
4612 20191213 | 201912)
4613 tm_defines="${tm_defines} TARGET_DEFAULT_ISA_SPEC=ISA_SPEC_CLASS_20191213"
4614 ;;
4615 20190608 | 201906)
4616 tm_defines="${tm_defines} TARGET_DEFAULT_ISA_SPEC=ISA_SPEC_CLASS_20190608"
4617 ;;
4618 *)
4619 echo "--with-isa-spec only accept 2.2, 20191213, 201912, 20190608 or 201906" 1>&2
4620 exit 1
4621 esac
4622
8e966210
KC
4623 case "${with_riscv_attribute}" in
4624 yes)
4625 tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=1"
4626 ;;
4627 no)
4628 tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=0"
4629 ;;
4630 ""|default)
4631 case "${target}" in
4632 riscv*-*-elf*)
4633 tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=1"
4634 ;;
4635 *)
4636 tm_defines="${tm_defines} TARGET_RISCV_ATTRIBUTE=0"
4637 ;;
4638 esac
4639 ;;
4640 *)
4641 echo "--with-riscv-attribute=${with_riscv_attribute} is not supported. The argument must begin with yes, no or default." 1>&2
4642 exit 1
4643 ;;
4644 esac
4645
4646
09cae750
PD
4647 # Infer arch from --with-arch, --target, and --with-abi.
4648 case "${with_arch}" in
09baee1a 4649 rv32e* | rv32i* | rv32g* | rv64i* | rv64g*)
09cae750
PD
4650 # OK.
4651 ;;
4652 "")
4653 # Infer XLEN, but otherwise assume GC.
4654 case "${with_abi}" in
09baee1a 4655 ilp32e) with_arch="rv32e" ;;
09cae750
PD
4656 ilp32 | ilp32f | ilp32d) with_arch="rv32gc" ;;
4657 lp64 | lp64f | lp64d) with_arch="rv64gc" ;;
4658 *) with_arch="rv${xlen}gc" ;;
4659 esac
4660 ;;
4661 *)
09baee1a 4662 echo "--with-arch=${with_arch} is not supported. The argument must begin with rv32e, rv32i, rv32g, rv64i, or rv64g." 1>&2
09cae750
PD
4663 exit 1
4664 ;;
4665 esac
4aaf3371
KC
4666 PYTHON=`which python || which python3 || which python2`
4667 if test "x${PYTHON}" != x; then
4668 with_arch=`${PYTHON} ${srcdir}/config/riscv/arch-canonicalize ${with_arch}`
4669 fi
a5ad5d5c 4670 tm_defines="${tm_defines} TARGET_RISCV_DEFAULT_ARCH=${with_arch}"
09cae750
PD
4671
4672 # Make sure --with-abi is valid. If it was not specified,
4673 # pick a default based on the ISA, preferring soft-float
4674 # unless the D extension is present.
4675 case "${with_abi}" in
09baee1a 4676 ilp32 | ilp32e | ilp32f | ilp32d | lp64 | lp64f | lp64d)
09cae750
PD
4677 ;;
4678 "")
4679 case "${with_arch}" in
4680 rv32*d* | rv32g*) with_abi=ilp32d ;;
09baee1a 4681 rv32e*) with_abi=ilp32e ;;
09cae750
PD
4682 rv32*) with_abi=ilp32 ;;
4683 rv64*d* | rv64g*) with_abi=lp64d ;;
4684 rv64*) with_abi=lp64 ;;
4685 esac
4686 ;;
4687 *)
4688 echo "--with-abi=${with_abi} is not supported" 1>&2
4689 exit 1
4690 ;;
4691 esac
a5ad5d5c 4692 tm_defines="${tm_defines} TARGET_RISCV_DEFAULT_ABI=${with_abi}"
09cae750
PD
4693
4694 # Make sure ABI and ISA are compatible.
4695 case "${with_abi},${with_arch}" in
09baee1a 4696 ilp32,rv32* | ilp32e,rv32e* \
09cae750
PD
4697 | ilp32f,rv32*f* | ilp32f,rv32g* \
4698 | ilp32d,rv32*d* | ilp32d,rv32g* \
4699 | lp64,rv64* \
4700 | lp64f,rv64*f* | lp64f,rv64g* \
4701 | lp64d,rv64*d* | lp64d,rv64g*)
4702 ;;
4703 *)
4704 echo "--with-abi=${with_abi} is not supported for ISA ${with_arch}" 1>&2
4705 exit 1
4706 ;;
4707 esac
c1e66912
KC
4708 # Handle --with-multilib-generator.
4709 if test "x${with_multilib_generator}" != xdefault; then
4710 if test "x${with_multilib_list}" != xdefault; then
4711 echo "--with-multilib-list= can't used with --with-multilib-generator= at same time" 1>&2
4712 exit 1
4713 fi
4714 case "${target}" in
4715 riscv*-*-elf*)
4716 if ${srcdir}/config/riscv/multilib-generator \
4717 `echo ${with_multilib_generator} | sed 's/;/ /g'`\
4718 > t-multilib-config;
4719 then
4720 tmake_file="${tmake_file} riscv/t-withmultilib-generator"
4721 else
4722 echo "invalid option for --with-multilib-generator" 1>&2
4723 exit 1
4724 fi
4725 ;;
4726 *)
4727 echo "--with-multilib-generator= is not supported for ${target}, only supported for riscv*-*-elf*" 1>&2
4728 exit 1
4729 ;;
4730 esac
4731 fi
f2410266
JW
4732
4733 # Handle --with-multilib-list.
4734 if test "x${with_multilib_list}" != xdefault; then
f2410266
JW
4735 tmake_file="${tmake_file} riscv/t-withmultilib"
4736
4737 case ${with_multilib_list} in
4738 ilp32 | ilp32f | ilp32d \
4739 | lp64 | lp64f | lp64d )
4740 TM_MULTILIB_CONFIG="${with_arch},${with_multilib_list}"
4741 ;;
4742 *)
4743 echo "--with-multilib-list=${with_multilib_list} not supported."
4744 exit 1
4745 esac
f2410266 4746 fi
09cae750
PD
4747 ;;
4748
7816bea0 4749 mips*-*-*)
d821744c 4750 supported_defaults="abi arch arch_32 arch_64 float fpu nan fp_32 odd_spreg_32 tune tune_32 tune_64 divide llsc mips-plt synci lxc1-sxc1 madd4"
7816bea0 4751
16aa42c0
NN
4752 case ${with_float} in
4753 "" | soft | hard)
83079d89
DJ
4754 # OK
4755 ;;
4756 *)
7816bea0 4757 echo "Unknown floating point type used in --with-float=$with_float" 1>&2
83079d89
DJ
4758 exit 1
4759 ;;
4760 esac
73f09c99 4761
04dfc6df
JU
4762 case ${with_fpu} in
4763 "" | single | double)
4764 # OK
4765 ;;
4766 *)
4767 echo "Unknown fpu type used in --with-fpu=$with_fpu" 1>&2
4768 exit 1
4769 ;;
4770 esac
4771
ff3f3951
MR
4772 case ${with_nan} in
4773 "" | 2008 | legacy)
4774 # OK
4775 ;;
4776 *)
4777 echo "Unknown NaN encoding used in --with-nan=$with_nan" 1>&2
4778 exit 1
4779 ;;
4780 esac
4781
050af144
MF
4782 case ${with_fp_32} in
4783 "" | 32 | xx | 64)
4784 # OK
4785 ;;
4786 *)
4787 echo "Unknown FP mode used in --with-fp-32=$with_fp_32" 1>&2
4788 exit 1
4789 ;;
4790 esac
4791
4792 case ${with_odd_spreg_32} in
4793 yes)
4794 with_odd_spreg_32="odd-spreg"
4795 ;;
4796 no)
4797 with_odd_spreg_32="no-odd-spreg"
4798 ;;
4799 "")
4800 # OK
4801 ;;
4802 *)
4803 echo "Unknown odd-spreg-32 type used in --with-odd-spreg-32=$with_odd_spreg_32" 1>&2
4804 exit 1
4805 ;;
4806 esac
4807
16aa42c0
NN
4808 case ${with_abi} in
4809 "" | 32 | o64 | n32 | 64 | eabi)
83079d89
DJ
4810 # OK
4811 ;;
4812 *)
7816bea0 4813 echo "Unknown ABI used in --with-abi=$with_abi" 1>&2
83079d89
DJ
4814 exit 1
4815 ;;
4816 esac
9f0df97a
DD
4817
4818 case ${with_divide} in
4819 "" | breaks | traps)
4820 # OK
4821 ;;
4822 *)
4823 echo "Unknown division check type use in --with-divide=$with_divide" 1>&2
4824 exit 1
66471b47
DD
4825 ;;
4826 esac
4827
4828 case ${with_llsc} in
4829 yes)
4830 with_llsc=llsc
4831 ;;
4832 no)
4833 with_llsc="no-llsc"
4834 ;;
4835 "")
4836 # OK
4837 ;;
4838 *)
4839 echo "Unknown llsc type used in --with-llsc" 1>&2
4840 exit 1
4841 ;;
9f0df97a 4842 esac
e21d5757
DJ
4843
4844 case ${with_mips_plt} in
4845 yes)
4846 with_mips_plt=plt
4847 ;;
4848 no)
4849 with_mips_plt=no-plt
4850 ;;
4851 "")
4852 ;;
4853 *)
4854 echo "Unknown --with-mips-plt argument: $with_mips_plt" 1>&2
4855 exit 1
4856 ;;
4857 esac
b96c5923
DD
4858
4859 case ${with_synci} in
4860 yes)
4861 with_synci=synci
4862 ;;
965c1798 4863 no)
b96c5923
DD
4864 with_synci=no-synci
4865 ;;
965c1798
SE
4866 "")
4867 ;;
b96c5923
DD
4868 *)
4869 echo "Unknown synci type used in --with-synci" 1>&2
4870 exit 1
4871 ;;
4872 esac
ab6b44cb
MF
4873
4874 case ${with_lxc1_sxc1} in
4875 yes)
4876 with_lxc1_sxc1=lxc1-sxc1
4877 ;;
4878 no)
4879 with_lxc1_sxc1=no-lxc1-sxc1
4880 ;;
4881 "")
4882 ;;
4883 *)
4884 echo "Unknown lxc1-sxc1 type used in --with-lxc1-sxc1" 1>&2
4885 exit 1
4886 ;;
4887 esac
d821744c
MF
4888
4889 case ${with_madd4} in
4890 yes)
4891 with_madd4=madd4
4892 ;;
4893 no)
4894 with_madd4=no-madd4
4895 ;;
4896 "")
4897 ;;
4898 *)
4899 echo "Unknown madd4 type used in --with-madd4" 1>&2
4900 exit 1
4901 ;;
4902 esac
9304f876
CJW
4903 ;;
4904
4905 nds32*-*-*)
e2286268 4906 supported_defaults="arch cpu nds32_lib float fpu_config"
9304f876
CJW
4907
4908 # process --with-arch
4909 case "${with_arch}" in
e2286268
MC
4910 "" | v3 )
4911 tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=0"
4912 ;;
4913 v2 | v2j | v3m)
9304f876 4914 # OK
e2286268
MC
4915 tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=0"
4916 ;;
4917 v3f)
4918 tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=1"
4919 ;;
4920 v3s)
4921 tm_defines="${tm_defines} TARGET_ARCH_DEFAULT=2"
4922
9304f876
CJW
4923 ;;
4924 *)
e2286268 4925 echo "Cannot accept --with-arch=$with_arch, available values are: v2 v2j v3 v3m v3f v3s" 1>&2
9304f876
CJW
4926 exit 1
4927 ;;
4928 esac
4929
7f3101c0
KC
4930 case "${with_cpu}" in
4931 "")
4932 with_cpu=n9
4933 ;;
628332f8 4934 n6 | n7 |n8 | e8 | s8 | n9 | n10 | d10 | n12 | n13 | n15)
7f3101c0
KC
4935 # OK
4936 ;;
4937 *)
628332f8 4938 echo "Cannot accept --with-cpu=$with_cpu, available values are: n6 n7 n8 e8 s8 n9 n10 d10 n12 n13 n15" 1>&2
7f3101c0
KC
4939 exit 1
4940 ;;
4941 esac
4942
9304f876
CJW
4943 # process --with-nds32-lib
4944 case "${with_nds32_lib}" in
4945 "")
2a484d14
CJW
4946 case ${target} in
4947 *-*-*uclibc*)
4948 with_nds32_lib=ulibc
4949 ;;
4950 *-*-linux*)
4951 with_nds32_lib=glibc
4952 ;;
4953 *)
4954 with_nds32_lib=newlib
4955 tm_defines="${tm_defines} TARGET_DEFAULT_CTOR_DTOR=1"
4956 ;;
4957 esac
9304f876
CJW
4958 ;;
4959 newlib)
4960 # OK
cf3cd43d 4961 tm_defines="${tm_defines} TARGET_DEFAULT_CTOR_DTOR=1"
9304f876
CJW
4962 ;;
4963 mculib)
4964 # OK
cf3cd43d
CJW
4965 # for the arch=v3f or arch=v3s under mculib toolchain,
4966 # we would like to set -fno-math-errno as default
4967 case "${with_arch}" in
4968 v3f | v3s)
4969 tm_defines="${tm_defines} TARGET_DEFAULT_NO_MATH_ERRNO=1"
4970 ;;
4971 esac
4972 ;;
2a484d14 4973 glibc | uclibc)
cf3cd43d 4974 # OK
9304f876
CJW
4975 ;;
4976 *)
cf3cd43d 4977 echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib glibc uclibc" 1>&2
9304f876
CJW
4978 exit 1
4979 ;;
4980 esac
73f09c99 4981
e2286268
MC
4982 # process --with-float
4983 case "${with_float}" in
4984 "" | soft | hard)
4985 # OK
4986 ;;
4987 *)
4988 echo "Cannot accept --with-float=$with_float, available values are: soft hard" 1>&2
4989 exit 1
4990 ;;
4991 esac
4992
4993 # process --with-config-fpu
4994 case "${with_config_fpu}" in
4995 "" | 0 | 1 | 2 | 3)
4996 # OK
4997 ;;
4998 *)
4999 echo "Cannot accept --with-config-fpu=$with_config_fpu, available values from 0 to 7" 1>&2
5000 exit 1
5001 ;;
5002 esac
5003
5004
5005 ;;
77c50d73
SL
5006 nios2*-*-*)
5007 supported_defaults="arch"
5008 case "$with_arch" in
5009 "" | r1 | r2)
5010 # OK
5011 ;;
5012 *)
5013 echo "Unknown arch used in --with-arch=$with_arch" 1>&2
5014 exit 1
5015 ;;
5016 esac
5017 ;;
5018
7816bea0 5019 powerpc*-*-* | rs6000-*-*)
5123acd2 5020 supported_defaults="abi cpu cpu_32 cpu_64 float tune tune_32 tune_64 advance_toolchain"
7816bea0 5021
c5f0fe67 5022 for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
7816bea0 5023 eval "val=\$with_$which"
16aa42c0 5024 case ${val} in
1ab1739c 5025 default32 | default64)
c5f0fe67
JM
5026 case $which in
5027 cpu | tune)
5028 ;;
5029 *)
5030 echo "$val only valid for --with-cpu and --with-tune." 1>&2
5031 exit 1
5032 ;;
5033 esac
1ab1739c
JJ
5034 with_which="with_$which"
5035 eval $with_which=
5036 ;;
b0bfee6e
DE
5037 405cr)
5038 tm_defines="${tm_defines} CONFIG_PPC405CR"
5039 eval "with_$which=405"
5040 ;;
5bd93ff6 5041 "" | common | native \
71237df0 5042 | power[3456789] | power10 | power5+ | power6x \
6fa3b207
SB
5043 | powerpc | powerpc64 | powerpc64le \
5044 | rs64 \
4adf8008 5045 | 401 | 403 | 405 | 405fp | 440 | 440fp | 464 | 464fp \
47f67e51
PB
5046 | 476 | 476fp | 505 | 601 | 602 | 603 | 603e | ec603e \
5047 | 604 | 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
683ed19e
EW
5048 | a2 | e300c[23] | 854[08] | e500mc | e500mc64 | e5500 | e6500 \
5049 | titan | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5 | cell)
7816bea0
DJ
5050 # OK
5051 ;;
5052 *)
5053 echo "Unknown cpu used in --with-$which=$val." 1>&2
5054 exit 1
5055 ;;
5056 esac
5057 done
b54214fe
UW
5058
5059 case "$with_abi" in
5060 "" | elfv1 | elfv2 )
5061 #OK
5062 ;;
5063 *)
5064 echo "Unknown ABI used in --with-abi=$with_abi"
5065 exit 1
5066 ;;
5067 esac
5123acd2
MM
5068
5069 if test "x$with_advance_toolchain" != x; then
5070 if test -d "/opt/$with_advance_toolchain/." -a \
5071 -d "/opt/$with_advance_toolchain/bin/." -a \
5072 -d "/opt/$with_advance_toolchain/include/."; then
5073
5074 tm_file="$tm_file ./advance-toolchain.h"
5075 (at="/opt/$with_advance_toolchain"
5076 echo "/* Use Advance Toolchain $at */"
5077 echo
5123acd2
MM
5078 echo "#undef LINK_OS_EXTRA_SPEC32"
5079 echo "#define LINK_OS_EXTRA_SPEC32" \
5080 "\"%(link_os_new_dtags)" \
17ce4f48 5081 "-rpath $prefix/lib -rpath $at/lib\""
5123acd2
MM
5082 echo
5083 echo "#undef LINK_OS_EXTRA_SPEC64"
5084 echo "#define LINK_OS_EXTRA_SPEC64" \
5085 "\"%(link_os_new_dtags)" \
17ce4f48 5086 "-rpath $prefix/lib64 -rpath $at/lib64\""
5123acd2
MM
5087 echo
5088 echo "#undef LINK_OS_NEW_DTAGS_SPEC"
5089 echo "#define LINK_OS_NEW_DTAGS_SPEC" \
5090 "\"--enable-new-dtags\""
5091 echo
5092 echo "#undef DYNAMIC_LINKER_PREFIX"
5093 echo "#define DYNAMIC_LINKER_PREFIX \"$at\""
5094 echo
5095 echo "#undef MD_EXEC_PREFIX"
5096 echo "#define MD_EXEC_PREFIX \"$at/bin/\""
5097 echo
5098 echo "#undef MD_STARTFILE_PREFIX"
17ce4f48
TMQMF
5099 echo "#define MD_STARTFILE_PREFIX \"$prefix/lib/\""
5100 echo
5101 echo "#undef MD_STARTFILE_PREFIX_1"
5102 echo "#define MD_STARTFILE_PREFIX_1 \"$at/lib/\"") \
5123acd2
MM
5103 > advance-toolchain.h
5104 else
5105 echo "Unknown advance-toolchain $with_advance_toolchain"
5106 exit 1
5107 fi
5108 fi
8c7a27d5
MM
5109
5110 # Set up the default long double format if the user changed it.
5111 if test x$with_long_double_format = xieee; then
5112 tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=1"
5113
5114 elif test x$with_long_double_format = xibm; then
5115 tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=0"
5116 fi
7816bea0
DJ
5117 ;;
5118
f13e0d4e
UW
5119 s390*-*-*)
5120 supported_defaults="arch mode tune"
5121
5122 for which in arch tune; do
5123 eval "val=\$with_$which"
16aa42c0 5124 case ${val} in
796a35b2 5125 "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | z15 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 | arch14 )
f13e0d4e
UW
5126 # OK
5127 ;;
5128 *)
5129 echo "Unknown cpu used in --with-$which=$val." 1>&2
5130 exit 1
5131 ;;
5132 esac
5133 done
5134
16aa42c0
NN
5135 case ${with_mode} in
5136 "" | esa | zarch)
f13e0d4e
UW
5137 # OK
5138 ;;
5139 *)
5140 echo "Unknown architecture mode used in --with-mode=$with_mode." 1>&2
5141 exit 1
5142 ;;
5143 esac
5144 ;;
5145
5ba02681 5146 sh[123456ble]*-*-* | sh-*-*)
da28a3b9 5147 supported_defaults="cpu"
25e651ca 5148 case "`echo $with_cpu | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ_ abcdefghijklmnopqrstuvwxyz- | sed s/sh/m/`" in
da28a3b9
JR
5149 "" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
5150 # OK
5151 ;;
157371cf
AO
5152 m2a | m2a-single | m2a-single-only | m2a-nofpu)
5153 ;;
312209c6
AO
5154 m4a | m4a-single | m4a-single-only | m4a-nofpu | m4al)
5155 ;;
da28a3b9
JR
5156 *)
5157 echo "Unknown CPU used in --with-cpu=$with_cpu, known values:" 1>&2
5158 echo "m1 m2 m2e m3 m3e m4 m4-single m4-single-only m4-nofpu" 1>&2
312209c6 5159 echo "m4a m4a-single m4a-single-only m4a-nofpu m4al" 1>&2
157371cf 5160 echo "m2a m2a-single m2a-single-only m2a-nofpu" 1>&2
da28a3b9
JR
5161 exit 1
5162 ;;
5163 esac
5164 ;;
83079d89 5165 sparc*-*-*)
31177ef2 5166 supported_defaults="cpu cpu_32 cpu_64 float tune tune_32 tune_64"
7816bea0 5167
31177ef2 5168 for which in cpu cpu_32 cpu_64 tune tune_32 tune_64; do
7816bea0 5169 eval "val=\$with_$which"
16aa42c0 5170 case ${val} in
07981468
KE
5171 "" | sparc | sparcv9 | sparc64 \
5172 | v7 | cypress \
d81230b5 5173 | v8 | supersparc | hypersparc | leon | leon3 | leon3v7 \
07981468
KE
5174 | sparclite | f930 | f934 | sparclite86x \
5175 | sparclet | tsc701 \
70847a48 5176 | v9 | ultrasparc | ultrasparc3 | niagara | niagara2 \
bcc3c3f1 5177 | niagara3 | niagara4 | niagara7 | m8)
7816bea0
DJ
5178 # OK
5179 ;;
5180 *)
5181 echo "Unknown cpu used in --with-$which=$val" 1>&2
5182 exit 1
5183 ;;
5184 esac
5185 done
73f09c99 5186
16aa42c0
NN
5187 case ${with_float} in
5188 "" | soft | hard)
83079d89
DJ
5189 # OK
5190 ;;
5191 *)
7816bea0 5192 echo "Unknown floating point type used in --with-float=$with_float" 1>&2
83079d89
DJ
5193 exit 1
5194 ;;
5195 esac
73f09c99 5196 ;;
73f09c99 5197
bcead286
BS
5198 tic6x-*-*)
5199 supported_defaults="arch"
5200
5201 case ${with_arch} in
5202 "" | c62x | c64x | c64x+ | c67x | c67x+ | c674x)
5203 # OK
5204 ;;
5205 *)
5206 echo "Unknown arch used in --with-arch=$with_arch." 1>&2
5207 exit 1
5208 ;;
5209 esac
5210 ;;
5211
83079d89 5212 v850*-*-*)
7816bea0 5213 supported_defaults=cpu
16aa42c0 5214 case ${with_cpu} in
dbdbd982 5215 "" | v850e | v850e1 | v850e2 | v850es | v850e2v3 | v850e3v5)
83079d89
DJ
5216 # OK
5217 ;;
5218 *)
5219 echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
5220 exit 1
5221 ;;
5222 esac
73f09c99 5223 ;;
175650bc
OH
5224 visium-*-*)
5225 supported_defaults="cpu"
5226 case $with_cpu in
5227 "" | gr5 | gr6)
5228 ;;
5229 *) echo "Unknown cpu used in --with-cpu=$with_cpu" 1>&2
5230 exit 1
5231 ;;
5232 esac
5233 ;;
fe3e7450 5234esac
73f09c99 5235
52e18cdf
OH
5236# Targets for which there is at least one VxWorks port should include
5237# vxworks-dummy.h to allow safe references to various TARGET_VXWORKS kinds
5238# of markers from other files in the port, including the vxworks*.h files to
5239# distinguish VxWorks variants such as VxWorks 7 or 64).
5240
5241case ${target} in
5242arm*-*-* | i[34567]86-*-* | mips*-*-* | powerpc*-*-* | sh*-*-* \
5243| sparc*-*-* | x86_64-*-*)
5244 tm_file="vxworks-dummy.h ${tm_file}"
5245 ;;
5246esac
5247
fe3e7450
AM
5248# Set some miscellaneous flags for particular targets.
5249target_cpu_default2=
5250case ${target} in
24034425 5251 aarch64*-*-*)
a3cd0246 5252 if test x"$target_cpu_cname" != x
24034425 5253 then
24034425
IB
5254 target_cpu_default2=$target_cpu_cname
5255 fi
5256 ;;
5257
83079d89 5258 arm*-*-*)
a4af8a10 5259 if test x$with_cpu = x
32078532 5260 then
a4af8a10
RE
5261 echo "Don't know the target cpu" 1>&2
5262 exit 1
32078532 5263 else
a4af8a10 5264 target_cpu_default2="\\\"$with_cpu\\\""
32078532 5265 fi
83079d89 5266 ;;
0e5a4ad8 5267
cd985f66 5268 hppa*-*-*)
83079d89 5269 if test x$gas = xyes
61ed06c3 5270 then
f4000c0b 5271 target_cpu_default2="MASK_GAS"
83079d89 5272 fi
73f09c99 5273 ;;
73f09c99 5274
cd985f66 5275 fido*-*-* | m68k*-*-*)
900ec02d 5276 target_cpu_default2=$m68k_cpu_ident
47c94d21 5277 tmake_file="m68k/t-opts $tmake_file"
10e96df4
NS
5278 if [ x"$m68k_arch_family" != x ]; then
5279 tmake_file="m68k/t-$m68k_arch_family $tmake_file"
5280 fi
900ec02d
JB
5281 ;;
5282
ff473280 5283 i[34567]86-*-darwin* | x86_64-*-darwin*)
ff473280 5284 ;;
e0cdc09f 5285 i[34567]86-*-linux* | x86_64-*-linux*)
54967b02
L
5286 extra_objs="${extra_objs} gnu-property.o"
5287 tmake_file="$tmake_file i386/t-linux i386/t-gnu-property"
e0cdc09f
MK
5288 ;;
5289 i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu)
5290 tmake_file="$tmake_file i386/t-kfreebsd"
5291 ;;
5292 i[34567]86-*-gnu*)
5293 tmake_file="$tmake_file i386/t-gnu"
ff473280 5294 ;;
3df6ff35
AP
5295 i[34567]86-*-msdosdjgpp*)
5296 tmake_file="${tmake_file} i386/t-djgpp"
5297 ;;
ccd1242e 5298 i[34567]86-*-solaris2* | x86_64-*-solaris2*)
f128db92 5299 ;;
740f2bf3
KT
5300 i[34567]86-*-cygwin* | x86_64-*-cygwin*)
5301 ;;
5302 i[34567]86-*-mingw* | x86_64-*-mingw*)
e997fb9c 5303 ;;
dbed5a9b
JM
5304 i[34567]86-*-dragonfly* | x86_64-*-dragonfly*)
5305 ;;
b6bf4d8a
AT
5306 i[34567]86-*-freebsd*)
5307 ;;
5308 x86_64-*-freebsd*)
5309 tmake_file="${tmake_file} i386/t-freebsd64"
d78552bd 5310 ;;
c252db20 5311 ia64*-*-linux*)
c252db20 5312 ;;
ff473280 5313
83079d89 5314 mips*-*-*)
5811cb27
RS
5315 if test x$gnu_ld = xyes
5316 then
21c425ee 5317 target_cpu_default2="MASK_SPLIT_ADDRESSES"
5811cb27 5318 fi
b01bc573 5319 case ${target} in
83079d89
DJ
5320 mips*el-*-*)
5321 tm_defines="TARGET_ENDIAN_DEFAULT=0 $tm_defines"
5322 ;;
5323 esac
8cfebf86
SE
5324 if test x$with_arch != x; then
5325 default_mips_arch=$with_arch
5326 fi
5327 if test x$with_abi != x; then
5328 default_mips_abi=$with_abi
5329 fi
5330 case ${default_mips_arch} in
5331 mips1) tm_defines="$tm_defines MIPS_ISA_DEFAULT=1" ;;
5332 mips2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=2" ;;
5333 mips3) tm_defines="$tm_defines MIPS_ISA_DEFAULT=3" ;;
5334 mips4) tm_defines="$tm_defines MIPS_ISA_DEFAULT=4" ;;
5335 mips32) tm_defines="$tm_defines MIPS_ISA_DEFAULT=32" ;;
5336 mips32r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=33" ;;
82f84ecb 5337 mips32r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=37" ;;
8cfebf86
SE
5338 mips64) tm_defines="$tm_defines MIPS_ISA_DEFAULT=64" ;;
5339 mips64r2) tm_defines="$tm_defines MIPS_ISA_DEFAULT=65" ;;
82f84ecb 5340 mips64r6) tm_defines="$tm_defines MIPS_ISA_DEFAULT=69" ;;
8cfebf86
SE
5341 esac
5342 case ${default_mips_abi} in
5343 32) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_32" ;;
5344 o64) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_O64" ;;
5345 n32) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_N32" ;;
5346 64) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_64" ;;
5347 eabi) tm_defines="$tm_defines MIPS_ABI_DEFAULT=ABI_EABI" ;;
5348 esac
bd9c1f8f 5349 tmake_file="mips/t-mips $tmake_file"
74826b0f 5350 ;;
83079d89
DJ
5351
5352 powerpc*-*-* | rs6000-*-*)
7816bea0
DJ
5353 # FIXME: The PowerPC port uses the value set at compile time,
5354 # although it's only cosmetic.
83079d89 5355 if test "x$with_cpu" != x
61ed06c3 5356 then
83079d89 5357 target_cpu_default2="\\\"$with_cpu\\\""
61ed06c3 5358 fi
83349046
SB
5359 out_file="${cpu_type}/${cpu_type}.c"
5360 c_target_objs="${c_target_objs} ${cpu_type}-c.o"
5361 cxx_target_objs="${cxx_target_objs} ${cpu_type}-c.o"
b4c522fa 5362 d_target_objs="${d_target_objs} ${cpu_type}-d.o"
83349046 5363 tmake_file="${cpu_type}/t-${cpu_type} ${tmake_file}"
74826b0f 5364 ;;
73f09c99 5365
a6ab9fc0
R
5366 sh[123456ble]*-*-* | sh-*-*)
5367 c_target_objs="${c_target_objs} sh-c.o"
5368 cxx_target_objs="${cxx_target_objs} sh-c.o"
5369 ;;
5370
83079d89 5371 sparc*-*-*)
7816bea0
DJ
5372 # Some standard aliases.
5373 case x$with_cpu in
5374 xsparc)
5375 with_cpu=v7
5376 ;;
7816bea0
DJ
5377 xsparcv9 | xsparc64)
5378 with_cpu=v9
5379 ;;
5380 esac
5381
38ae58ca
EB
5382 if test x$with_tune = x ; then
5383 case ${target} in
5384 *-leon-*)
5385 with_tune=leon
5386 ;;
5387 *-leon[3-9]*)
5388 with_tune=leon3
5389 ;;
5390 esac
5391 fi
5392
a4d05547 5393 # The SPARC port checks this value at compile-time.
73f09c99
DJ
5394 target_cpu_default2="TARGET_CPU_$with_cpu"
5395 ;;
07981468 5396
83079d89
DJ
5397 v850*-*-*)
5398 case "x$with_cpu" in
5399 x)
5400 ;;
dbdbd982 5401 xv850e | xv850e1 | xv850e2 | xv850e2v3 | xv850e3v5)
83079d89
DJ
5402 target_cpu_default2="TARGET_CPU_$with_cpu"
5403 ;;
1dcad079
NC
5404 xv850es)
5405 target_cpu_default2="TARGET_CPU_v850e1"
5406 ;;
83079d89
DJ
5407 esac
5408 ;;
175650bc
OH
5409 visium-*-*)
5410 target_cpu_default2="TARGET_CPU_$with_cpu"
5411 ;;
fe3e7450 5412esac
61ed06c3 5413
fe3e7450 5414t=
d821744c 5415all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan fp_32 odd_spreg_32 divide llsc mips-plt synci tls lxc1-sxc1 madd4"
fe3e7450
AM
5416for option in $all_defaults
5417do
e21d5757 5418 eval "val=\$with_"`echo $option | sed s/-/_/g`
fe3e7450
AM
5419 if test -n "$val"; then
5420 case " $supported_defaults " in
5421 *" $option "*)
5422 ;;
5423 *)
5424 echo "This target does not support --with-$option." 2>&1
6e0eea31 5425 echo "Valid --with options are: $supported_defaults" 2>&1
fe3e7450
AM
5426 exit 1
5427 ;;
5428 esac
7816bea0 5429
fe3e7450
AM
5430 if test "x$t" = x
5431 then
5432 t="{ \"$option\", \"$val\" }"
5433 else
5434 t="${t}, { \"$option\", \"$val\" }"
7816bea0 5435 fi
7816bea0 5436 fi
fe3e7450 5437done
7816bea0 5438
fe3e7450
AM
5439if test "x$t" = x
5440then
5441 configure_default_options="{ { NULL, NULL} }"
5442else
5443 configure_default_options="{ ${t} }"
5444fi
5445
5446if test "$target_cpu_default2" != ""
5447then
5448 if test "$target_cpu_default" != ""
61ed06c3 5449 then
fe3e7450
AM
5450 target_cpu_default="(${target_cpu_default}|${target_cpu_default2})"
5451 else
5452 target_cpu_default=$target_cpu_default2
61ed06c3 5453 fi
fe3e7450 5454fi
87b6c18c
IV
5455
5456case ${target} in
5457i[34567]86-*-* | x86_64-*-*)
5458 if test x$enable_as_accelerator = xyes; then
5459 extra_programs="mkoffload\$(exeext)"
5460 fi
5461 ;;
5462esac