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