]> git.ipfire.org Git - thirdparty/gcc.git/blame - config.sub
re PR driver/36312 (should refuse to overwrite input file with output file)
[thirdparty/gcc.git] / config.sub
CommitLineData
6599da04 1#! /bin/sh
ae3ca0a9 2# Configuration validation subroutine script.
a4ebe104 3# Copyright 1992-2014 Free Software Foundation, Inc.
ef0b4ef8 4
8ed499f8 5timestamp='2014-07-28'
ef0b4ef8 6
6c9c2cf2
BE
7# This file is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3 of the License, or
6599da04
JM
10# (at your option) any later version.
11#
6c9c2cf2
BE
12# This program is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15# General Public License for more details.
6599da04
JM
16#
17# You should have received a copy of the GNU General Public License
95e5b9a4 18# along with this program; if not, see <http://www.gnu.org/licenses/>.
0063a823 19#
6599da04
JM
20# As a special exception to the GNU General Public License, if you
21# distribute this file as part of a program that contains a
22# configuration script generated by Autoconf, you may include it under
6c9c2cf2
BE
23# the same distribution terms that you use for the rest of that
24# program. This Exception is an additional permission under section 7
25# of the GNU General Public License, version 3 ("GPLv3").
6599da04 26
0063a823 27
6c9c2cf2 28# Please send patches with a ChangeLog entry to config-patches@gnu.org.
7a15eef5 29#
6599da04
JM
30# Configuration subroutine to validate and canonicalize a configuration type.
31# Supply the specified configuration type as an argument.
32# If it is invalid, we print an error message on stderr and exit with code 1.
33# Otherwise, we print the canonical config type on stdout and succeed.
34
d4c74acc
NC
35# You can get the latest version of this script from:
36# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
37
6599da04
JM
38# This file is supposed to be the same for all GNU packages
39# and recognize all the CPU types, system types and aliases
40# that are meaningful with *any* GNU software.
41# Each package is responsible for reporting which valid configurations
42# it does not support. The user should be able to distinguish
43# a failure to support a valid configuration from a meaningless
44# configuration.
45
46# The goal of this file is to map all the various variations of a given
47# machine specification into a single specification in the form:
48# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
49# or in some cases, the newer four-part form:
50# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
51# It is wrong to echo any other type of specification.
52
ef0b4ef8 53me=`echo "$0" | sed -e 's,.*/,,'`
6599da04 54
ef0b4ef8
PT
55usage="\
56Usage: $0 [OPTION] CPU-MFR-OPSYS
57 $0 [OPTION] ALIAS
58
59Canonicalize a configuration name.
60
61Operation modes:
ae3ca0a9
PE
62 -h, --help print this help, then exit
63 -t, --time-stamp print date of last modification, then exit
64 -v, --version print version number, then exit
65
66Report bugs and patches to <config-patches@gnu.org>."
67
68version="\
69GNU config.sub ($timestamp)
70
a4ebe104 71Copyright 1992-2014 Free Software Foundation, Inc.
ae3ca0a9
PE
72
73This is free software; see the source for copying conditions. There is NO
74warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
ef0b4ef8
PT
75
76help="
77Try \`$me --help' for more information."
78
79# Parse command line
80while test $# -gt 0 ; do
ae3ca0a9
PE
81 case $1 in
82 --time-stamp | --time* | -t )
0063a823 83 echo "$timestamp" ; exit ;;
ae3ca0a9 84 --version | -v )
0063a823 85 echo "$version" ; exit ;;
ef0b4ef8 86 --help | --h* | -h )
0063a823 87 echo "$usage"; exit ;;
ef0b4ef8
PT
88 -- ) # Stop option processing
89 shift; break ;;
90 - ) # Use stdin as input.
91 break ;;
92 -* )
ae3ca0a9 93 echo "$me: invalid option $1$help"
ef0b4ef8
PT
94 exit 1 ;;
95
96 *local*)
97 # First pass through any local machine types.
98 echo $1
0063a823 99 exit ;;
ef0b4ef8
PT
100
101 * )
102 break ;;
103 esac
104done
105
106case $# in
107 0) echo "$me: missing argument$help" >&2
108 exit 1;;
109 1) ;;
110 *) echo "$me: too many arguments$help" >&2
111 exit 1;;
6599da04
JM
112esac
113
114# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
115# Here we must recognize all the valid KERNEL-OS combinations.
116maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
117case $maybe_os in
1ab55d69 118 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
f08bdd69 119 linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
1ab55d69 120 knetbsd*-gnu* | netbsd*-gnu* | \
070bdbd9 121 kopensolaris*-gnu* | \
8d1171cb 122 storm-chaos* | os2-emx* | rtmk-nova*)
6599da04
JM
123 os=-$maybe_os
124 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
125 ;;
95e5b9a4
JB
126 android-linux)
127 os=-linux-android
128 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
129 ;;
6599da04
JM
130 *)
131 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
132 if [ $basic_machine != $1 ]
133 then os=`echo $1 | sed 's/.*-/-/'`
134 else os=; fi
135 ;;
136esac
137
138### Let's recognize common machines as not being operating systems so
139### that things like config.sub decstation-3100 work. We also
140### recognize some manufacturers as not being operating systems, so we
141### can provide default operating systems below.
142case $os in
143 -sun*os*)
144 # Prevent following clause from handling this invalid input.
145 ;;
146 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
147 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
148 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
149 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
150 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
151 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
f08bdd69 152 -apple | -axis | -knuth | -cray | -microblaze*)
6599da04
JM
153 os=
154 basic_machine=$1
155 ;;
41446fec
DE
156 -bluegene*)
157 os=-cnk
e9d9afef 158 ;;
b1345c72 159 -sim | -cisco | -oki | -wec | -winbond)
6599da04
JM
160 os=
161 basic_machine=$1
162 ;;
b1345c72 163 -scout)
6599da04 164 ;;
b1345c72 165 -wrs)
dbd83e11 166 os=-vxworks
6599da04
JM
167 basic_machine=$1
168 ;;
818f0c85
AO
169 -chorusos*)
170 os=-chorusos
171 basic_machine=$1
172 ;;
41446fec
DE
173 -chorusrdb)
174 os=-chorusrdb
818f0c85 175 basic_machine=$1
41446fec 176 ;;
6599da04
JM
177 -hiux*)
178 os=-hiuxwe2
179 ;;
b4623110
KJ
180 -sco6)
181 os=-sco5v6
182 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
183 ;;
6599da04 184 -sco5)
3e07bdbd 185 os=-sco3.2v5
6599da04
JM
186 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
187 ;;
188 -sco4)
189 os=-sco3.2v4
190 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
191 ;;
192 -sco3.2.[4-9]*)
193 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
194 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
195 ;;
196 -sco3.2v[4-9]*)
197 # Don't forget version if it is 3.2v4 or newer.
198 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
199 ;;
b4623110
KJ
200 -sco5v6*)
201 # Don't forget version if it is 3.2v4 or newer.
202 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
203 ;;
6599da04
JM
204 -sco*)
205 os=-sco3.2v2
206 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207 ;;
73a6d2e7
RL
208 -udk*)
209 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
210 ;;
6599da04
JM
211 -isc)
212 os=-isc2.2
213 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
214 ;;
215 -clix*)
216 basic_machine=clipper-intergraph
217 ;;
218 -isc*)
219 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
220 ;;
95e5b9a4
JB
221 -lynx*178)
222 os=-lynxos178
223 ;;
224 -lynx*5)
225 os=-lynxos5
226 ;;
6599da04
JM
227 -lynx*)
228 os=-lynxos
229 ;;
230 -ptx*)
231 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
232 ;;
233 -windowsnt*)
234 os=`echo $os | sed -e 's/windowsnt/winnt/'`
235 ;;
236 -psos*)
237 os=-psos
238 ;;
eeda916a
AO
239 -mint | -mint[0-9]*)
240 basic_machine=m68k-atari
241 os=-mint
242 ;;
6599da04
JM
243esac
244
245# Decode aliases for certain CPU-COMPANY combinations.
246case $basic_machine in
247 # Recognize the basic CPU types without company name.
248 # Some are omitted here because they have special meanings below.
f6084f99
ZW
249 1750a | 580 \
250 | a29k \
95e5b9a4 251 | aarch64 | aarch64_be \
f6084f99 252 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
3cd87679 253 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
26db814a 254 | am33_2.0 \
2a3e690a 255 | arc | arceb \
f08bdd69
JBG
256 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
257 | avr | avr32 \
258 | be32 | be64 \
acb217cb 259 | bfin \
2a3e690a 260 | c4x | c8051 | clipper \
11d8b408 261 | d10v | d30v | dlx | dsp16xx \
e7a7929d 262 | epiphany \
9b6f37a0 263 | fido | fr30 | frv \
f6084f99 264 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
e7a7929d 265 | hexagon \
f6084f99 266 | i370 | i860 | i960 | ia64 \
26db814a 267 | ip2k | iq2000 \
2a3e690a 268 | k1om \
e7a7929d 269 | le32 | le64 \
18430d27 270 | lm32 \
8d1171cb 271 | m32c | m32r | m32rle | m68000 | m68k | m88k \
f08bdd69 272 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
e2d83b8c
CD
273 | mips | mipsbe | mipseb | mipsel | mipsle \
274 | mips16 \
275 | mips64 | mips64el \
954910ef 276 | mips64octeon | mips64octeonel \
e2d83b8c 277 | mips64orion | mips64orionel \
954910ef
BE
278 | mips64r5900 | mips64r5900el \
279 | mips64vr | mips64vrel \
e2d83b8c
CD
280 | mips64vr4100 | mips64vr4100el \
281 | mips64vr4300 | mips64vr4300el \
282 | mips64vr5000 | mips64vr5000el \
0063a823 283 | mips64vr5900 | mips64vr5900el \
e2d83b8c 284 | mipsisa32 | mipsisa32el \
66e2aa7d 285 | mipsisa32r2 | mipsisa32r2el \
a4ebe104 286 | mipsisa32r6 | mipsisa32r6el \
e2d83b8c 287 | mipsisa64 | mipsisa64el \
26db814a 288 | mipsisa64r2 | mipsisa64r2el \
a4ebe104 289 | mipsisa64r6 | mipsisa64r6el \
e2d83b8c 290 | mipsisa64sb1 | mipsisa64sb1el \
5ce6f47b 291 | mipsisa64sr71k | mipsisa64sr71kel \
969a00c7 292 | mipsr5900 | mipsr5900el \
e2d83b8c 293 | mipstx39 | mipstx39el \
f6084f99 294 | mn10200 | mn10300 \
070bdbd9 295 | moxie \
64f182bd 296 | mt \
66e2aa7d 297 | msp430 \
41446fec 298 | nds32 | nds32le | nds32be \
2a3e690a 299 | nios | nios2 | nios2eb | nios2el \
f6084f99 300 | ns16k | ns32k \
a4ebe104 301 | open8 | or1k | or1knd | or32 \
f6084f99 302 | pdp10 | pdp11 | pj | pjl \
f3e8ab19 303 | powerpc | powerpc64 | powerpc64le | powerpcle \
f6084f99 304 | pyramid \
753a0ad8 305 | rl78 | rx \
f6a1687e 306 | score \
18430d27 307 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
e2d83b8c 308 | sh64 | sh64le \
8d1171cb
PB
309 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
310 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
f3e8ab19
JM
311 | spu \
312 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
f6c56be6 313 | ubicom32 \
9baa43b6 314 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
f6084f99 315 | we32k \
f3e8ab19 316 | x86 | xc16x | xstormy16 | xtensa \
e03dd84a 317 | z8k | z80)
6599da04
JM
318 basic_machine=$basic_machine-unknown
319 ;;
0d1152b1
JM
320 c54x)
321 basic_machine=tic54x-unknown
322 ;;
323 c55x)
324 basic_machine=tic55x-unknown
325 ;;
326 c6x)
327 basic_machine=tic6x-unknown
328 ;;
2a3e690a 329 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
d207ebef
JM
330 basic_machine=$basic_machine-unknown
331 os=-none
332 ;;
ae3ca0a9 333 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
eeda916a 334 ;;
8d1171cb
PB
335 ms1)
336 basic_machine=mt-unknown
337 ;;
eeda916a 338
f3e8ab19
JM
339 strongarm | thumb | xscale)
340 basic_machine=arm-unknown
341 ;;
95e5b9a4
JB
342 xgate)
343 basic_machine=$basic_machine-unknown
344 os=-none
345 ;;
f3e8ab19
JM
346 xscaleeb)
347 basic_machine=armeb-unknown
348 ;;
349
350 xscaleel)
351 basic_machine=armel-unknown
352 ;;
353
6599da04
JM
354 # We use `pc' rather than `unknown'
355 # because (1) that's what they normally are, and
356 # (2) the word "unknown" tends to confuse beginning users.
ae3ca0a9 357 i*86 | x86_64)
6599da04
JM
358 basic_machine=$basic_machine-pc
359 ;;
360 # Object if more than one company name word.
361 *-*-*)
362 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
363 exit 1
364 ;;
365 # Recognize the basic CPU types with company name.
f6084f99
ZW
366 580-* \
367 | a29k-* \
95e5b9a4 368 | aarch64-* | aarch64_be-* \
f6084f99 369 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
3cd87679 370 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
2a3e690a 371 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
ac30211c 372 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
f6a1687e 373 | avr-* | avr32-* \
e7a7929d 374 | be32-* | be64-* \
acb217cb 375 | bfin-* | bs2000-* \
0d1152b1 376 | c[123]* | c30-* | [cjt]90-* | c4x-* \
2a3e690a 377 | c8051-* | clipper-* | craynv-* | cydra-* \
11d8b408 378 | d10v-* | d30v-* | dlx-* \
f6084f99 379 | elxsi-* \
9b6f37a0 380 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
f6084f99
ZW
381 | h8300-* | h8500-* \
382 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
e7a7929d 383 | hexagon-* \
f6084f99 384 | i*86-* | i860-* | i960-* | ia64-* \
26db814a 385 | ip2k-* | iq2000-* \
2a3e690a 386 | k1om-* \
e7a7929d 387 | le32-* | le64-* \
18430d27 388 | lm32-* \
8d1171cb 389 | m32c-* | m32r-* | m32rle-* \
4434687a 390 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
f08bdd69
JBG
391 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
392 | microblaze-* | microblazeel-* \
e2d83b8c
CD
393 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
394 | mips16-* \
395 | mips64-* | mips64el-* \
954910ef 396 | mips64octeon-* | mips64octeonel-* \
e2d83b8c 397 | mips64orion-* | mips64orionel-* \
954910ef
BE
398 | mips64r5900-* | mips64r5900el-* \
399 | mips64vr-* | mips64vrel-* \
e2d83b8c
CD
400 | mips64vr4100-* | mips64vr4100el-* \
401 | mips64vr4300-* | mips64vr4300el-* \
402 | mips64vr5000-* | mips64vr5000el-* \
0063a823 403 | mips64vr5900-* | mips64vr5900el-* \
e2d83b8c 404 | mipsisa32-* | mipsisa32el-* \
66e2aa7d 405 | mipsisa32r2-* | mipsisa32r2el-* \
a4ebe104 406 | mipsisa32r6-* | mipsisa32r6el-* \
e2d83b8c 407 | mipsisa64-* | mipsisa64el-* \
26db814a 408 | mipsisa64r2-* | mipsisa64r2el-* \
a4ebe104 409 | mipsisa64r6-* | mipsisa64r6el-* \
e2d83b8c 410 | mipsisa64sb1-* | mipsisa64sb1el-* \
5ce6f47b 411 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
969a00c7 412 | mipsr5900-* | mipsr5900el-* \
66e2aa7d 413 | mipstx39-* | mipstx39el-* \
fc4d0e82 414 | mmix-* \
64f182bd 415 | mt-* \
66e2aa7d 416 | msp430-* \
41446fec 417 | nds32-* | nds32le-* | nds32be-* \
2a3e690a 418 | nios-* | nios2-* | nios2eb-* | nios2el-* \
fc4d0e82 419 | none-* | np1-* | ns16k-* | ns32k-* \
32827f18 420 | open8-* \
a4ebe104 421 | or1k*-* \
f6084f99
ZW
422 | orion-* \
423 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
f3e8ab19 424 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
f6084f99 425 | pyramid-* \
753a0ad8 426 | rl78-* | romp-* | rs6000-* | rx-* \
18430d27 427 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
e2d83b8c 428 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
8d1171cb 429 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
acb217cb 430 | sparclite-* \
f3e8ab19
JM
431 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
432 | tahoe-* \
0d1152b1 433 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
9baa43b6 434 | tile*-* \
f7c50032 435 | tron-* \
f6c56be6 436 | ubicom32-* \
9baa43b6
NC
437 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
438 | vax-* \
f6084f99 439 | we32k-* \
f3e8ab19 440 | x86-* | x86_64-* | xc16x-* | xps100-* \
c3220d4c 441 | xstormy16-* | xtensa*-* \
f6084f99 442 | ymp-* \
e03dd84a 443 | z8k-* | z80-*)
85ee6037 444 ;;
c3220d4c
BE
445 # Recognize the basic CPU types without company name, with glob match.
446 xtensa*)
447 basic_machine=$basic_machine-unknown
448 ;;
6599da04
JM
449 # Recognize the various machine names and aliases which stand
450 # for a CPU type and a company and sometimes even an OS.
b1345c72 451 386bsd)
6599da04
JM
452 basic_machine=i386-unknown
453 os=-bsd
454 ;;
455 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
456 basic_machine=m68000-att
457 ;;
458 3b*)
459 basic_machine=we32k-att
460 ;;
b1345c72 461 a29khif)
6599da04
JM
462 basic_machine=a29k-amd
463 os=-udi
464 ;;
41446fec 465 abacus)
a7ca14fc
AC
466 basic_machine=abacus-unknown
467 ;;
b1345c72 468 adobe68k)
6599da04
JM
469 basic_machine=m68010-adobe
470 os=-scout
471 ;;
472 alliant | fx80)
473 basic_machine=fx80-alliant
474 ;;
475 altos | altos3068)
476 basic_machine=m68k-altos
477 ;;
478 am29k)
479 basic_machine=a29k-none
480 os=-bsd
481 ;;
f7c50032
AJ
482 amd64)
483 basic_machine=x86_64-pc
484 ;;
a7ca14fc
AC
485 amd64-*)
486 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
487 ;;
6599da04
JM
488 amdahl)
489 basic_machine=580-amdahl
490 os=-sysv
491 ;;
492 amiga | amiga-*)
cb011248 493 basic_machine=m68k-unknown
6599da04 494 ;;
becdcf6d 495 amigaos | amigados)
cb011248 496 basic_machine=m68k-unknown
0c82f6bf 497 os=-amigaos
6599da04
JM
498 ;;
499 amigaunix | amix)
cb011248 500 basic_machine=m68k-unknown
6599da04
JM
501 os=-sysv4
502 ;;
503 apollo68)
504 basic_machine=m68k-apollo
505 os=-sysv
506 ;;
b1345c72 507 apollo68bsd)
6599da04
JM
508 basic_machine=m68k-apollo
509 os=-bsd
510 ;;
070bdbd9
BE
511 aros)
512 basic_machine=i386-pc
513 os=-aros
514 ;;
6599da04
JM
515 aux)
516 basic_machine=m68k-apple
517 os=-aux
518 ;;
519 balance)
520 basic_machine=ns32k-sequent
521 os=-dynix
522 ;;
c3220d4c
BE
523 blackfin)
524 basic_machine=bfin-unknown
525 os=-linux
526 ;;
527 blackfin-*)
528 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
529 os=-linux
530 ;;
e9d9afef
BE
531 bluegene*)
532 basic_machine=powerpc-ibm
533 os=-cnk
534 ;;
0d1152b1
JM
535 c54x-*)
536 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
537 ;;
538 c55x-*)
539 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
540 ;;
541 c6x-*)
542 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
543 ;;
4434687a
MM
544 c90)
545 basic_machine=c90-cray
546 os=-unicos
547 ;;
41446fec 548 cegcc)
e03dd84a
BE
549 basic_machine=arm-unknown
550 os=-cegcc
551 ;;
6599da04
JM
552 convex-c1)
553 basic_machine=c1-convex
554 os=-bsd
555 ;;
556 convex-c2)
557 basic_machine=c2-convex
558 os=-bsd
559 ;;
560 convex-c32)
561 basic_machine=c32-convex
562 os=-bsd
563 ;;
564 convex-c34)
565 basic_machine=c34-convex
566 os=-bsd
567 ;;
568 convex-c38)
569 basic_machine=c38-convex
570 os=-bsd
571 ;;
4434687a
MM
572 cray | j90)
573 basic_machine=j90-cray
6599da04
JM
574 os=-unicos
575 ;;
fc4d0e82
NC
576 craynv)
577 basic_machine=craynv-cray
578 os=-unicosmp
579 ;;
41446fec 580 cr16 | cr16-*)
15098359
SR
581 basic_machine=cr16-unknown
582 os=-elf
583 ;;
6599da04
JM
584 crds | unos)
585 basic_machine=m68k-crds
586 ;;
fc4d0e82
NC
587 crisv32 | crisv32-* | etraxfs*)
588 basic_machine=crisv32-axis
589 ;;
d207ebef
JM
590 cris | cris-* | etrax*)
591 basic_machine=cris-axis
592 ;;
fc4d0e82
NC
593 crx)
594 basic_machine=crx-unknown
595 os=-elf
596 ;;
6599da04
JM
597 da30 | da30-*)
598 basic_machine=m68k-da30
599 ;;
600 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
601 basic_machine=mips-dec
602 ;;
3cd87679
L
603 decsystem10* | dec10*)
604 basic_machine=pdp10-dec
605 os=-tops10
606 ;;
607 decsystem20* | dec20*)
608 basic_machine=pdp10-dec
609 os=-tops20
610 ;;
6599da04
JM
611 delta | 3300 | motorola-3300 | motorola-delta \
612 | 3300-motorola | delta-motorola)
613 basic_machine=m68k-motorola
614 ;;
615 delta88)
616 basic_machine=m88k-motorola
617 os=-sysv3
618 ;;
8479b1b1
BE
619 dicos)
620 basic_machine=i686-pc
621 os=-dicos
622 ;;
9587be8a
KC
623 djgpp)
624 basic_machine=i586-pc
625 os=-msdosdjgpp
626 ;;
6599da04
JM
627 dpx20 | dpx20-*)
628 basic_machine=rs6000-bull
629 os=-bosx
630 ;;
631 dpx2* | dpx2*-bull)
632 basic_machine=m68k-bull
633 os=-sysv3
634 ;;
635 ebmon29k)
636 basic_machine=a29k-amd
637 os=-ebmon
638 ;;
639 elxsi)
640 basic_machine=elxsi-elxsi
641 os=-bsd
642 ;;
643 encore | umax | mmax)
644 basic_machine=ns32k-encore
645 ;;
b1345c72 646 es1800 | OSE68k | ose68k | ose | OSE)
6599da04
JM
647 basic_machine=m68k-ericsson
648 os=-ose
649 ;;
650 fx2800)
651 basic_machine=i860-alliant
652 ;;
653 genix)
654 basic_machine=ns32k-ns
655 ;;
656 gmicro)
657 basic_machine=tron-gmicro
658 os=-sysv
659 ;;
ae3ca0a9
PE
660 go32)
661 basic_machine=i386-pc
662 os=-go32
663 ;;
6599da04
JM
664 h3050r* | hiux*)
665 basic_machine=hppa1.1-hitachi
666 os=-hiuxwe2
667 ;;
668 h8300hms)
669 basic_machine=h8300-hitachi
670 os=-hms
671 ;;
b1345c72 672 h8300xray)
6599da04
JM
673 basic_machine=h8300-hitachi
674 os=-xray
675 ;;
b1345c72 676 h8500hms)
6599da04
JM
677 basic_machine=h8500-hitachi
678 os=-hms
679 ;;
680 harris)
681 basic_machine=m88k-harris
682 os=-sysv3
683 ;;
684 hp300-*)
685 basic_machine=m68k-hp
686 ;;
687 hp300bsd)
688 basic_machine=m68k-hp
689 os=-bsd
690 ;;
691 hp300hpux)
692 basic_machine=m68k-hp
693 os=-hpux
694 ;;
85ee6037 695 hp3k9[0-9][0-9] | hp9[0-9][0-9])
c4acd909
MK
696 basic_machine=hppa1.0-hp
697 ;;
6599da04
JM
698 hp9k2[0-9][0-9] | hp9k31[0-9])
699 basic_machine=m68000-hp
700 ;;
701 hp9k3[2-9][0-9])
702 basic_machine=m68k-hp
703 ;;
b1345c72 704 hp9k6[0-9][0-9] | hp6[0-9][0-9])
228197ee
LT
705 basic_machine=hppa1.0-hp
706 ;;
b1345c72 707 hp9k7[0-79][0-9] | hp7[0-79][0-9])
228197ee
LT
708 basic_machine=hppa1.1-hp
709 ;;
b1345c72 710 hp9k78[0-9] | hp78[0-9])
228197ee
LT
711 # FIXME: really hppa2.0-hp
712 basic_machine=hppa1.1-hp
713 ;;
b1345c72 714 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
228197ee
LT
715 # FIXME: really hppa2.0-hp
716 basic_machine=hppa1.1-hp
717 ;;
b1345c72 718 hp9k8[0-9][13679] | hp8[0-9][13679])
6599da04
JM
719 basic_machine=hppa1.1-hp
720 ;;
721 hp9k8[0-9][0-9] | hp8[0-9][0-9])
722 basic_machine=hppa1.0-hp
723 ;;
724 hppa-next)
725 os=-nextstep3
726 ;;
b1345c72 727 hppaosf)
6599da04
JM
728 basic_machine=hppa1.1-hp
729 os=-osf
730 ;;
b1345c72
BE
731 hppro)
732 basic_machine=hppa1.1-hp
733 os=-proelf
734 ;;
6599da04
JM
735 i370-ibm* | ibm*)
736 basic_machine=i370-ibm
6599da04 737 ;;
ae3ca0a9 738 i*86v32)
6599da04
JM
739 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
740 os=-sysv32
741 ;;
ae3ca0a9 742 i*86v4*)
6599da04
JM
743 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
744 os=-sysv4
745 ;;
ae3ca0a9 746 i*86v)
6599da04
JM
747 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
748 os=-sysv
749 ;;
ae3ca0a9 750 i*86sol2)
6599da04
JM
751 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
752 os=-solaris2
753 ;;
b1345c72 754 i386mach)
6599da04
JM
755 basic_machine=i386-mach
756 os=-mach
757 ;;
b1345c72 758 i386-vsta | vsta)
6599da04
JM
759 basic_machine=i386-unknown
760 os=-vsta
761 ;;
6599da04
JM
762 iris | iris4d)
763 basic_machine=mips-sgi
764 case $os in
765 -irix*)
766 ;;
767 *)
768 os=-irix4
769 ;;
770 esac
771 ;;
772 isi68 | isi)
773 basic_machine=m68k-isi
774 os=-sysv
775 ;;
c3220d4c
BE
776 m68knommu)
777 basic_machine=m68k-unknown
778 os=-linux
779 ;;
780 m68knommu-*)
781 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
782 os=-linux
783 ;;
6599da04
JM
784 m88k-omron*)
785 basic_machine=m88k-omron
786 ;;
787 magnum | m3230)
788 basic_machine=mips-mips
789 os=-sysv
790 ;;
791 merlin)
792 basic_machine=ns32k-utek
793 os=-sysv
794 ;;
f08bdd69 795 microblaze*)
e9d9afef
BE
796 basic_machine=microblaze-xilinx
797 ;;
f08bdd69
JBG
798 mingw64)
799 basic_machine=x86_64-pc
800 os=-mingw64
801 ;;
ae3ca0a9 802 mingw32)
2a3e690a 803 basic_machine=i686-pc
ae3ca0a9
PE
804 os=-mingw32
805 ;;
a894d2c3
BE
806 mingw32ce)
807 basic_machine=arm-unknown
808 os=-mingw32ce
809 ;;
6599da04
JM
810 miniframe)
811 basic_machine=m68000-convergent
812 ;;
eeda916a 813 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
b1345c72
BE
814 basic_machine=m68k-atari
815 os=-mint
816 ;;
6599da04
JM
817 mips3*-*)
818 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
819 ;;
820 mips3*)
821 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
822 ;;
b1345c72 823 monitor)
6599da04
JM
824 basic_machine=m68k-rom68k
825 os=-coff
826 ;;
3cd87679
L
827 morphos)
828 basic_machine=powerpc-unknown
829 os=-morphos
830 ;;
8ed499f8
AG
831 moxiebox)
832 basic_machine=moxie-unknown
833 os=-moxiebox
834 ;;
b1345c72 835 msdos)
ae3ca0a9 836 basic_machine=i386-pc
6599da04
JM
837 os=-msdos
838 ;;
64f182bd 839 ms1-*)
8d1171cb 840 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
64f182bd 841 ;;
95e5b9a4 842 msys)
2a3e690a 843 basic_machine=i686-pc
95e5b9a4
JB
844 os=-msys
845 ;;
0b77644a
LV
846 mvs)
847 basic_machine=i370-ibm
848 os=-mvs
849 ;;
e7a7929d
NC
850 nacl)
851 basic_machine=le32-unknown
852 os=-nacl
853 ;;
6599da04
JM
854 ncr3000)
855 basic_machine=i486-ncr
856 os=-sysv4
857 ;;
858 netbsd386)
b1345c72 859 basic_machine=i386-unknown
6599da04
JM
860 os=-netbsd
861 ;;
3b7265ff 862 netwinder)
eeda916a 863 basic_machine=armv4l-rebel
3b7265ff
NC
864 os=-linux
865 ;;
6599da04
JM
866 news | news700 | news800 | news900)
867 basic_machine=m68k-sony
868 os=-newsos
869 ;;
870 news1000)
871 basic_machine=m68030-sony
872 os=-newsos
873 ;;
874 news-3600 | risc-news)
875 basic_machine=mips-sony
876 os=-newsos
877 ;;
b1345c72 878 necv70)
6599da04
JM
879 basic_machine=v70-nec
880 os=-sysv
881 ;;
882 next | m*-next )
883 basic_machine=m68k-next
884 case $os in
885 -nextstep* )
886 ;;
887 -ns2*)
888 os=-nextstep2
889 ;;
890 *)
891 os=-nextstep3
892 ;;
893 esac
894 ;;
895 nh3000)
896 basic_machine=m68k-harris
897 os=-cxux
898 ;;
899 nh[45]000)
900 basic_machine=m88k-harris
901 os=-cxux
902 ;;
903 nindy960)
904 basic_machine=i960-intel
905 os=-nindy
906 ;;
b1345c72 907 mon960)
6599da04
JM
908 basic_machine=i960-intel
909 os=-mon960
910 ;;
ae3ca0a9
PE
911 nonstopux)
912 basic_machine=mips-compaq
913 os=-nonstopux
914 ;;
6599da04
JM
915 np1)
916 basic_machine=np1-gould
917 ;;
41446fec
DE
918 neo-tandem)
919 basic_machine=neo-tandem
920 ;;
921 nse-tandem)
922 basic_machine=nse-tandem
923 ;;
ef0b4ef8
PT
924 nsr-tandem)
925 basic_machine=nsr-tandem
926 ;;
b1345c72
BE
927 op50n-* | op60c-*)
928 basic_machine=hppa1.1-oki
929 os=-proelf
930 ;;
0063a823 931 openrisc | openrisc-*)
40fe0ec3 932 basic_machine=or32-unknown
40fe0ec3 933 ;;
507ec745
BI
934 os400)
935 basic_machine=powerpc-ibm
936 os=-os400
937 ;;
b1345c72 938 OSE68000 | ose68000)
6599da04
JM
939 basic_machine=m68000-ericsson
940 os=-ose
941 ;;
b1345c72 942 os68k)
6599da04
JM
943 basic_machine=m68k-none
944 os=-os68k
945 ;;
946 pa-hitachi)
947 basic_machine=hppa1.1-hitachi
948 os=-hiuxwe2
949 ;;
950 paragon)
951 basic_machine=i860-intel
952 os=-osf
953 ;;
c3220d4c
BE
954 parisc)
955 basic_machine=hppa-unknown
956 os=-linux
957 ;;
958 parisc-*)
959 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
960 os=-linux
961 ;;
6599da04
JM
962 pbd)
963 basic_machine=sparc-tti
964 ;;
965 pbb)
966 basic_machine=m68k-tti
967 ;;
ab17919f 968 pc532 | pc532-*)
6599da04
JM
969 basic_machine=ns32k-pc532
970 ;;
8d1171cb
PB
971 pc98)
972 basic_machine=i386-pc
973 ;;
974 pc98-*)
975 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
976 ;;
dd3a88c9 977 pentium | p5 | k5 | k6 | nexgen | viac3)
85ee6037
ILT
978 basic_machine=i586-pc
979 ;;
5ce6f47b 980 pentiumpro | p6 | 6x86 | athlon | athlon_*)
85ee6037 981 basic_machine=i686-pc
6599da04 982 ;;
0bb41a37 983 pentiumii | pentium2 | pentiumiii | pentium3)
ae3ca0a9 984 basic_machine=i686-pc
6599da04 985 ;;
0bb41a37
L
986 pentium4)
987 basic_machine=i786-pc
988 ;;
dd3a88c9 989 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
6599da04
JM
990 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
991 ;;
ef0b4ef8 992 pentiumpro-* | p6-* | 6x86-* | athlon-*)
6599da04
JM
993 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
994 ;;
0bb41a37 995 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
ae3ca0a9 996 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
6599da04 997 ;;
0bb41a37
L
998 pentium4-*)
999 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
1000 ;;
6599da04
JM
1001 pn)
1002 basic_machine=pn-gould
1003 ;;
ae3ca0a9 1004 power) basic_machine=power-ibm
6599da04 1005 ;;
f3e8ab19 1006 ppc | ppcbe) basic_machine=powerpc-unknown
ab17919f 1007 ;;
f3e8ab19
JM
1008 ppc-* | ppcbe-*)
1009 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
6599da04
JM
1010 ;;
1011 ppcle | powerpclittle | ppc-le | powerpc-little)
1012 basic_machine=powerpcle-unknown
ab17919f 1013 ;;
6599da04
JM
1014 ppcle-* | powerpclittle-*)
1015 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
1016 ;;
f6084f99 1017 ppc64) basic_machine=powerpc64-unknown
ab17919f 1018 ;;
f6084f99
ZW
1019 ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
1020 ;;
1021 ppc64le | powerpc64little | ppc64-le | powerpc64-little)
1022 basic_machine=powerpc64le-unknown
ab17919f 1023 ;;
f6084f99
ZW
1024 ppc64le-* | powerpc64little-*)
1025 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1026 ;;
6599da04
JM
1027 ps2)
1028 basic_machine=i386-ibm
1029 ;;
ae3ca0a9
PE
1030 pw32)
1031 basic_machine=i586-unknown
1032 os=-pw32
1033 ;;
f08bdd69
JBG
1034 rdos | rdos64)
1035 basic_machine=x86_64-pc
1036 os=-rdos
1037 ;;
1038 rdos32)
8d1171cb
PB
1039 basic_machine=i386-pc
1040 os=-rdos
1041 ;;
b1345c72 1042 rom68k)
6599da04
JM
1043 basic_machine=m68k-rom68k
1044 os=-coff
1045 ;;
1046 rm[46]00)
1047 basic_machine=mips-siemens
1048 ;;
1049 rtpc | rtpc-*)
1050 basic_machine=romp-ibm
1051 ;;
c6243b4c
GK
1052 s390 | s390-*)
1053 basic_machine=s390-ibm
1054 ;;
1055 s390x | s390x-*)
1056 basic_machine=s390x-ibm
1057 ;;
b1345c72 1058 sa29200)
6599da04
JM
1059 basic_machine=a29k-amd
1060 os=-udi
1061 ;;
5ce6f47b
EC
1062 sb1)
1063 basic_machine=mipsisa64sb1-unknown
1064 ;;
1065 sb1el)
1066 basic_machine=mipsisa64sb1el-unknown
1067 ;;
f6a1687e
BE
1068 sde)
1069 basic_machine=mipsisa32-sde
1070 os=-elf
1071 ;;
26db814a
BI
1072 sei)
1073 basic_machine=mips-sei
1074 os=-seiux
1075 ;;
6599da04
JM
1076 sequent)
1077 basic_machine=i386-sequent
1078 ;;
1079 sh)
1080 basic_machine=sh-hitachi
1081 os=-hms
1082 ;;
9b6f37a0
BE
1083 sh5el)
1084 basic_machine=sh5le-unknown
1085 ;;
26db814a
BI
1086 sh64)
1087 basic_machine=sh64-unknown
1088 ;;
dd3a88c9 1089 sparclite-wrs | simso-wrs)
6599da04
JM
1090 basic_machine=sparclite-wrs
1091 os=-vxworks
1092 ;;
1093 sps7)
1094 basic_machine=m68k-bull
1095 os=-sysv2
1096 ;;
1097 spur)
1098 basic_machine=spur-unknown
1099 ;;
b1345c72 1100 st2000)
6599da04
JM
1101 basic_machine=m68k-tandem
1102 ;;
b1345c72 1103 stratus)
6599da04
JM
1104 basic_machine=i860-stratus
1105 os=-sysv4
1106 ;;
f3e8ab19
JM
1107 strongarm-* | thumb-*)
1108 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1109 ;;
6599da04
JM
1110 sun2)
1111 basic_machine=m68000-sun
1112 ;;
1113 sun2os3)
1114 basic_machine=m68000-sun
1115 os=-sunos3
1116 ;;
1117 sun2os4)
1118 basic_machine=m68000-sun
1119 os=-sunos4
1120 ;;
1121 sun3os3)
1122 basic_machine=m68k-sun
1123 os=-sunos3
1124 ;;
1125 sun3os4)
1126 basic_machine=m68k-sun
1127 os=-sunos4
1128 ;;
1129 sun4os3)
1130 basic_machine=sparc-sun
1131 os=-sunos3
1132 ;;
1133 sun4os4)
1134 basic_machine=sparc-sun
1135 os=-sunos4
1136 ;;
1137 sun4sol2)
1138 basic_machine=sparc-sun
1139 os=-solaris2
1140 ;;
1141 sun3 | sun3-*)
1142 basic_machine=m68k-sun
1143 ;;
1144 sun4)
1145 basic_machine=sparc-sun
1146 ;;
1147 sun386 | sun386i | roadrunner)
1148 basic_machine=i386-sun
1149 ;;
ab17919f 1150 sv1)
7a15eef5
FS
1151 basic_machine=sv1-cray
1152 os=-unicos
1153 ;;
6599da04
JM
1154 symmetry)
1155 basic_machine=i386-sequent
1156 os=-dynix
1157 ;;
b1345c72 1158 t3e)
4434687a
MM
1159 basic_machine=alphaev5-cray
1160 os=-unicos
1161 ;;
1162 t90)
1163 basic_machine=t90-cray
b1345c72
BE
1164 os=-unicos
1165 ;;
3ca06a68 1166 tile*)
9baa43b6 1167 basic_machine=$basic_machine-unknown
3ca06a68
BE
1168 os=-linux-gnu
1169 ;;
6599da04
JM
1170 tx39)
1171 basic_machine=mipstx39-unknown
1172 ;;
1173 tx39el)
1174 basic_machine=mipstx39el-unknown
1175 ;;
3cd87679
L
1176 toad1)
1177 basic_machine=pdp10-xkl
1178 os=-tops20
1179 ;;
6599da04
JM
1180 tower | tower-32)
1181 basic_machine=m68k-ncr
1182 ;;
20af77cd
UW
1183 tpf)
1184 basic_machine=s390x-ibm
1185 os=-tpf
1186 ;;
6599da04
JM
1187 udi29k)
1188 basic_machine=a29k-amd
1189 os=-udi
1190 ;;
1191 ultra3)
1192 basic_machine=a29k-nyu
1193 os=-sym1
1194 ;;
b1345c72 1195 v810 | necv810)
6599da04
JM
1196 basic_machine=v810-nec
1197 os=-none
1198 ;;
1199 vaxv)
1200 basic_machine=vax-dec
1201 os=-sysv
1202 ;;
1203 vms)
1204 basic_machine=vax-dec
1205 os=-vms
1206 ;;
1207 vpp*|vx|vx-*)
ab17919f
SS
1208 basic_machine=f301-fujitsu
1209 ;;
6599da04
JM
1210 vxworks960)
1211 basic_machine=i960-wrs
1212 os=-vxworks
1213 ;;
1214 vxworks68)
1215 basic_machine=m68k-wrs
1216 os=-vxworks
1217 ;;
1218 vxworks29k)
1219 basic_machine=a29k-wrs
1220 os=-vxworks
1221 ;;
b1345c72
BE
1222 w65*)
1223 basic_machine=w65-wdc
1224 os=-none
1225 ;;
1226 w89k-*)
1227 basic_machine=hppa1.1-winbond
1228 os=-proelf
6599da04 1229 ;;
385870f5
KC
1230 xbox)
1231 basic_machine=i686-pc
1232 os=-mingw32
1233 ;;
ab17919f 1234 xps | xps100)
6599da04
JM
1235 basic_machine=xps100-honeywell
1236 ;;
f3e8ab19
JM
1237 xscale-* | xscalee[bl]-*)
1238 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1239 ;;
4434687a
MM
1240 ymp)
1241 basic_machine=ymp-cray
1242 os=-unicos
1243 ;;
b1345c72 1244 z8k-*-coff)
6599da04
JM
1245 basic_machine=z8k-unknown
1246 os=-sim
1247 ;;
e03dd84a
BE
1248 z80-*-coff)
1249 basic_machine=z80-unknown
1250 os=-sim
1251 ;;
6599da04
JM
1252 none)
1253 basic_machine=none-none
1254 os=-none
1255 ;;
1256
1257# Here we handle the default manufacturer of certain CPU types. It is in
1258# some cases the only manufacturer, in others, it is the most popular.
b1345c72 1259 w89k)
6599da04
JM
1260 basic_machine=hppa1.1-winbond
1261 ;;
b1345c72 1262 op50n)
6599da04
JM
1263 basic_machine=hppa1.1-oki
1264 ;;
b1345c72 1265 op60c)
6599da04
JM
1266 basic_machine=hppa1.1-oki
1267 ;;
6599da04
JM
1268 romp)
1269 basic_machine=romp-ibm
1270 ;;
fc4d0e82
NC
1271 mmix)
1272 basic_machine=mmix-knuth
1273 ;;
6599da04
JM
1274 rs6000)
1275 basic_machine=rs6000-ibm
1276 ;;
1277 vax)
1278 basic_machine=vax-dec
1279 ;;
ae3ca0a9
PE
1280 pdp10)
1281 # there are many clones, so DEC is not a safe bet
1282 basic_machine=pdp10-unknown
1283 ;;
6599da04
JM
1284 pdp11)
1285 basic_machine=pdp11-dec
1286 ;;
1287 we32k)
1288 basic_machine=we32k-att
1289 ;;
18430d27 1290 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
c4880c99 1291 basic_machine=sh-unknown
d207ebef 1292 ;;
8d1171cb 1293 sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
6599da04
JM
1294 basic_machine=sparc-sun
1295 ;;
ab17919f 1296 cydra)
6599da04
JM
1297 basic_machine=cydra-cydrome
1298 ;;
1299 orion)
1300 basic_machine=orion-highlevel
1301 ;;
1302 orion105)
1303 basic_machine=clipper-highlevel
1304 ;;
b1345c72 1305 mac | mpw | mac-mpw)
6599da04
JM
1306 basic_machine=m68k-apple
1307 ;;
b1345c72 1308 pmac | pmac-mpw)
6599da04
JM
1309 basic_machine=powerpc-apple
1310 ;;
d2bc0628 1311 *-unknown)
ae3ca0a9
PE
1312 # Make sure to match an already-canonicalized machine name.
1313 ;;
6599da04
JM
1314 *)
1315 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1316 exit 1
1317 ;;
1318esac
1319
1320# Here we canonicalize certain aliases for manufacturers.
1321case $basic_machine in
1322 *-digital*)
1323 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1324 ;;
1325 *-commodore*)
1326 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1327 ;;
1328 *)
1329 ;;
1330esac
1331
1332# Decode manufacturer-specific aliases for certain operating systems.
1333
1334if [ x"$os" != x"" ]
1335then
1336case $os in
41446fec
DE
1337 # First match some system type aliases
1338 # that might get confused with valid system types.
6599da04 1339 # -solaris* is a basic system type, with this one exception.
41446fec
DE
1340 -auroraux)
1341 os=-auroraux
4960e3f0 1342 ;;
6599da04
JM
1343 -solaris1 | -solaris1.*)
1344 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1345 ;;
1346 -solaris)
1347 os=-solaris2
1348 ;;
85ee6037 1349 -svr4*)
6599da04
JM
1350 os=-sysv4
1351 ;;
85ee6037
ILT
1352 -unixware*)
1353 os=-sysv4.2uw
1354 ;;
6599da04
JM
1355 -gnu/linux*)
1356 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1357 ;;
1358 # First accept the basic system types.
1359 # The portable systems comes first.
1360 # Each alternative MUST END IN A *, to match a version number.
1361 # -sysv* is not here because it comes later, after sysvr4.
1362 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
e9d9afef 1363 | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
4960e3f0 1364 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
24c4a93e 1365 | -sym* | -kopensolaris* | -plan9* \
becdcf6d 1366 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
070bdbd9 1367 | -aos* | -aros* \
6599da04
JM
1368 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1369 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
8d1171cb 1370 | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
f08bdd69 1371 | -bitrig* | -openbsd* | -solidbsd* \
a7ca14fc
AC
1372 | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1373 | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
6599da04
JM
1374 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1375 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
e03dd84a 1376 | -chorusos* | -chorusrdb* | -cegcc* \
95e5b9a4 1377 | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
f08bdd69
JBG
1378 | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1379 | -linux-newlib* | -linux-musl* | -linux-uclibc* \
8ed499f8 1380 | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
ab17919f 1381 | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
ae3ca0a9 1382 | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
f6084f99 1383 | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
4434687a 1384 | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
ab17919f 1385 | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
0063a823 1386 | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
a4ebe104 1387 | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
6599da04
JM
1388 # Remember, each alternative MUST END IN *, to match a version number.
1389 ;;
ef0b4ef8
PT
1390 -qnx*)
1391 case $basic_machine in
ae3ca0a9 1392 x86-* | i*86-*)
ef0b4ef8
PT
1393 ;;
1394 *)
1395 os=-nto$os
1396 ;;
1397 esac
1398 ;;
ab17919f
SS
1399 -nto-qnx*)
1400 ;;
ef0b4ef8 1401 -nto*)
ab17919f 1402 os=`echo $os | sed -e 's|nto|nto-qnx|'`
ef0b4ef8 1403 ;;
6599da04 1404 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
0063a823 1405 | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
784a3a80 1406 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
6599da04
JM
1407 ;;
1408 -mac*)
1409 os=`echo $os | sed -e 's|mac|macos|'`
1410 ;;
26db814a
BI
1411 -linux-dietlibc)
1412 os=-linux-dietlibc
1413 ;;
6599da04
JM
1414 -linux*)
1415 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1416 ;;
1417 -sunos5*)
1418 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1419 ;;
1420 -sunos6*)
1421 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1422 ;;
0b77644a
LV
1423 -opened*)
1424 os=-openedition
1425 ;;
41446fec 1426 -os400*)
507ec745
BI
1427 os=-os400
1428 ;;
521fe9d0
NC
1429 -wince*)
1430 os=-wince
1431 ;;
6599da04
JM
1432 -osfrose*)
1433 os=-osfrose
1434 ;;
1435 -osf*)
1436 os=-osf
1437 ;;
1438 -utek*)
1439 os=-bsd
1440 ;;
1441 -dynix*)
1442 os=-bsd
1443 ;;
1444 -acis*)
1445 os=-aos
1446 ;;
251931f3
LG
1447 -atheos*)
1448 os=-atheos
1449 ;;
a7ca14fc
AC
1450 -syllable*)
1451 os=-syllable
1452 ;;
b1345c72 1453 -386bsd)
6599da04
JM
1454 os=-bsd
1455 ;;
1456 -ctix* | -uts*)
1457 os=-sysv
1458 ;;
4434687a
MM
1459 -nova*)
1460 os=-rtmk-nova
1461 ;;
6599da04 1462 -ns2 )
ab17919f 1463 os=-nextstep2
6599da04 1464 ;;
61a77fea 1465 -nsk*)
ef0b4ef8
PT
1466 os=-nsk
1467 ;;
6599da04
JM
1468 # Preserve the version number of sinix5.
1469 -sinix5.*)
1470 os=`echo $os | sed -e 's|sinix|sysv|'`
1471 ;;
1472 -sinix*)
1473 os=-sysv4
1474 ;;
41446fec 1475 -tpf*)
20af77cd
UW
1476 os=-tpf
1477 ;;
6599da04
JM
1478 -triton*)
1479 os=-sysv3
1480 ;;
1481 -oss*)
1482 os=-sysv3
1483 ;;
1484 -svr4)
1485 os=-sysv4
1486 ;;
1487 -svr3)
1488 os=-sysv3
1489 ;;
1490 -sysvr4)
1491 os=-sysv4
1492 ;;
1493 # This must come after -sysvr4.
1494 -sysv*)
1495 ;;
b1345c72 1496 -ose*)
6599da04
JM
1497 os=-ose
1498 ;;
b1345c72 1499 -es1800*)
6599da04
JM
1500 os=-ose
1501 ;;
1502 -xenix)
1503 os=-xenix
1504 ;;
ab17919f
SS
1505 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1506 os=-mint
b1345c72 1507 ;;
ccf9f10c
RS
1508 -aros*)
1509 os=-aros
1510 ;;
9587be8a
KC
1511 -zvmoe)
1512 os=-zvmoe
1513 ;;
8479b1b1
BE
1514 -dicos*)
1515 os=-dicos
1516 ;;
41446fec
DE
1517 -nacl*)
1518 ;;
6599da04
JM
1519 -none)
1520 ;;
1521 *)
1522 # Get rid of the `-' at the beginning of $os.
1523 os=`echo $os | sed 's/[^-]*-//'`
1524 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1525 exit 1
1526 ;;
1527esac
1528else
1529
1530# Here we handle the default operating systems that come with various machines.
1531# The value should be what the vendor currently ships out the door with their
1532# machine or put another way, the most popular os provided with the machine.
1533
1534# Note that if you're going to try to match "-MANUFACTURER" here (say,
1535# "-sun"), then you have to tell the case statement up towards the top
1536# that MANUFACTURER isn't an operating system. Otherwise, code above
1537# will signal an error saying that MANUFACTURER isn't an operating
1538# system, and we'll never get to this point.
1539
1540case $basic_machine in
41446fec 1541 score-*)
f6a1687e
BE
1542 os=-elf
1543 ;;
41446fec 1544 spu-*)
8d1171cb
PB
1545 os=-elf
1546 ;;
6599da04
JM
1547 *-acorn)
1548 os=-riscix1.2
1549 ;;
eeda916a 1550 arm*-rebel)
3b7265ff
NC
1551 os=-linux
1552 ;;
6599da04
JM
1553 arm*-semi)
1554 os=-aout
1555 ;;
41446fec
DE
1556 c4x-* | tic4x-*)
1557 os=-coff
8d1171cb 1558 ;;
2a3e690a
JR
1559 c8051-*)
1560 os=-elf
1561 ;;
f08bdd69
JBG
1562 hexagon-*)
1563 os=-elf
1564 ;;
0d1152b1
JM
1565 tic54x-*)
1566 os=-coff
1567 ;;
1568 tic55x-*)
1569 os=-coff
1570 ;;
1571 tic6x-*)
1572 os=-coff
1573 ;;
3cd87679 1574 # This must come before the *-dec entry.
ae3ca0a9
PE
1575 pdp10-*)
1576 os=-tops20
1577 ;;
ab17919f 1578 pdp11-*)
6599da04
JM
1579 os=-none
1580 ;;
1581 *-dec | vax-*)
1582 os=-ultrix4.2
1583 ;;
1584 m68*-apollo)
1585 os=-domain
1586 ;;
1587 i386-sun)
1588 os=-sunos4.0.2
1589 ;;
1590 m68000-sun)
1591 os=-sunos3
6599da04 1592 ;;
b1345c72 1593 m68*-cisco)
6599da04
JM
1594 os=-aout
1595 ;;
41446fec 1596 mep-*)
a894d2c3
BE
1597 os=-elf
1598 ;;
b1345c72
BE
1599 mips*-cisco)
1600 os=-elf
1601 ;;
1602 mips*-*)
6599da04
JM
1603 os=-elf
1604 ;;
40fe0ec3
AO
1605 or32-*)
1606 os=-coff
1607 ;;
6599da04
JM
1608 *-tti) # must be before sparc entry or we get the wrong os.
1609 os=-sysv3
1610 ;;
1611 sparc-* | *-sun)
1612 os=-sunos4.1.1
1613 ;;
85ee6037 1614 *-be)
6599da04
JM
1615 os=-beos
1616 ;;
0063a823
KC
1617 *-haiku)
1618 os=-haiku
1619 ;;
6599da04
JM
1620 *-ibm)
1621 os=-aix
1622 ;;
41446fec 1623 *-knuth)
fc4d0e82
NC
1624 os=-mmixware
1625 ;;
b1345c72 1626 *-wec)
6599da04
JM
1627 os=-proelf
1628 ;;
b1345c72 1629 *-winbond)
6599da04
JM
1630 os=-proelf
1631 ;;
b1345c72 1632 *-oki)
6599da04
JM
1633 os=-proelf
1634 ;;
1635 *-hp)
1636 os=-hpux
1637 ;;
1638 *-hitachi)
1639 os=-hiux
1640 ;;
1641 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1642 os=-sysv
1643 ;;
1644 *-cbm)
0c82f6bf 1645 os=-amigaos
6599da04
JM
1646 ;;
1647 *-dg)
1648 os=-dgux
1649 ;;
1650 *-dolphin)
1651 os=-sysv3
1652 ;;
1653 m68k-ccur)
1654 os=-rtu
1655 ;;
1656 m88k-omron*)
1657 os=-luna
1658 ;;
1659 *-next )
1660 os=-nextstep
1661 ;;
1662 *-sequent)
1663 os=-ptx
1664 ;;
1665 *-crds)
1666 os=-unos
1667 ;;
1668 *-ns)
1669 os=-genix
1670 ;;
1671 i370-*)
1672 os=-mvs
1673 ;;
1674 *-next)
1675 os=-nextstep3
1676 ;;
ab17919f 1677 *-gould)
6599da04
JM
1678 os=-sysv
1679 ;;
ab17919f 1680 *-highlevel)
6599da04
JM
1681 os=-bsd
1682 ;;
1683 *-encore)
1684 os=-bsd
1685 ;;
ab17919f 1686 *-sgi)
6599da04
JM
1687 os=-irix
1688 ;;
ab17919f 1689 *-siemens)
6599da04
JM
1690 os=-sysv4
1691 ;;
1692 *-masscomp)
1693 os=-rtu
1694 ;;
ae3ca0a9 1695 f30[01]-fujitsu | f700-fujitsu)
6599da04
JM
1696 os=-uxpv
1697 ;;
b1345c72 1698 *-rom68k)
6599da04
JM
1699 os=-coff
1700 ;;
b1345c72 1701 *-*bug)
6599da04
JM
1702 os=-coff
1703 ;;
b1345c72 1704 *-apple)
6599da04
JM
1705 os=-macos
1706 ;;
b1345c72
BE
1707 *-atari*)
1708 os=-mint
1709 ;;
6599da04
JM
1710 *)
1711 os=-none
1712 ;;
1713esac
1714fi
1715
1716# Here we handle the case where we know the os, and the CPU type, but not the
1717# manufacturer. We pick the logical manufacturer.
1718vendor=unknown
1719case $basic_machine in
1720 *-unknown)
1721 case $os in
1722 -riscix*)
1723 vendor=acorn
1724 ;;
1725 -sunos*)
1726 vendor=sun
1727 ;;
e9d9afef 1728 -cnk*|-aix*)
6599da04
JM
1729 vendor=ibm
1730 ;;
85ee6037 1731 -beos*)
6599da04
JM
1732 vendor=be
1733 ;;
1734 -hpux*)
85ee6037
ILT
1735 vendor=hp
1736 ;;
c4acd909 1737 -mpeix*)
85ee6037
ILT
1738 vendor=hp
1739 ;;
6599da04
JM
1740 -hiux*)
1741 vendor=hitachi
1742 ;;
1743 -unos*)
1744 vendor=crds
1745 ;;
1746 -dgux*)
1747 vendor=dg
1748 ;;
1749 -luna*)
1750 vendor=omron
1751 ;;
1752 -genix*)
1753 vendor=ns
1754 ;;
0b77644a 1755 -mvs* | -opened*)
6599da04
JM
1756 vendor=ibm
1757 ;;
507ec745
BI
1758 -os400*)
1759 vendor=ibm
1760 ;;
6599da04
JM
1761 -ptx*)
1762 vendor=sequent
1763 ;;
20af77cd
UW
1764 -tpf*)
1765 vendor=ibm
1766 ;;
4434687a 1767 -vxsim* | -vxworks* | -windiss*)
6599da04
JM
1768 vendor=wrs
1769 ;;
1770 -aux*)
1771 vendor=apple
1772 ;;
b1345c72 1773 -hms*)
6599da04
JM
1774 vendor=hitachi
1775 ;;
b1345c72 1776 -mpw* | -macos*)
6599da04
JM
1777 vendor=apple
1778 ;;
ae3ca0a9 1779 -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
b1345c72
BE
1780 vendor=atari
1781 ;;
f6084f99
ZW
1782 -vos*)
1783 vendor=stratus
1784 ;;
6599da04
JM
1785 esac
1786 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1787 ;;
1788esac
1789
1790echo $basic_machine$os
0063a823 1791exit
ef0b4ef8
PT
1792
1793# Local variables:
1794# eval: (add-hook 'write-file-hooks 'time-stamp)
ae3ca0a9 1795# time-stamp-start: "timestamp='"
ef0b4ef8
PT
1796# time-stamp-format: "%:y-%02m-%02d"
1797# time-stamp-end: "'"
1798# End: