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