]> git.ipfire.org Git - thirdparty/gcc.git/blame - config.sub
Fix breakage from 6th Feb thread_prologue_and_epilogue_insns change:
[thirdparty/gcc.git] / config.sub
CommitLineData
6599da04
JM
1#! /bin/sh
2# Configuration validation subroutine script, version 1.1.
7a15eef5
FS
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
4# Free Software Foundation, Inc.
5#
6599da04
JM
6# This file is (in principle) common to ALL GNU software.
7# The presence of a machine in this file suggests that SOME GNU software
8# can handle that machine. It does not imply ALL GNU software can.
9#
10# This file is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, write to the Free Software
22# Foundation, Inc., 59 Temple Place - Suite 330,
23# Boston, MA 02111-1307, USA.
24
25# As a special exception to the GNU General Public License, if you
26# distribute this file as part of a program that contains a
27# configuration script generated by Autoconf, you may include it under
28# the same distribution terms that you use for the rest of that program.
29
7a15eef5
FS
30# Written by Per Bothner <bothner@cygnus.com>.
31# Please send patches to <config-patches@gnu.org>.
32#
6599da04
JM
33# Configuration subroutine to validate and canonicalize a configuration type.
34# Supply the specified configuration type as an argument.
35# If it is invalid, we print an error message on stderr and exit with code 1.
36# Otherwise, we print the canonical config type on stdout and succeed.
37
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
53if [ x$1 = x ]
54then
55 echo Configuration name missing. 1>&2
56 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
57 echo "or $0 ALIAS" 1>&2
58 echo where ALIAS is a recognized configuration type. 1>&2
59 exit 1
60fi
61
62# First pass through any local machine types.
63case $1 in
64 *local*)
65 echo $1
66 exit 0
67 ;;
68 *)
69 ;;
70esac
71
72# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
73# Here we must recognize all the valid KERNEL-OS combinations.
74maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
75case $maybe_os in
76 linux-gnu*)
77 os=-$maybe_os
78 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
79 ;;
80 *)
81 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
82 if [ $basic_machine != $1 ]
83 then os=`echo $1 | sed 's/.*-/-/'`
84 else os=; fi
85 ;;
86esac
87
88### Let's recognize common machines as not being operating systems so
89### that things like config.sub decstation-3100 work. We also
90### recognize some manufacturers as not being operating systems, so we
91### can provide default operating systems below.
92case $os in
93 -sun*os*)
94 # Prevent following clause from handling this invalid input.
95 ;;
96 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
97 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
98 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
99 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
100 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
101 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
102 -apple)
103 os=
104 basic_machine=$1
105 ;;
b1345c72 106 -sim | -cisco | -oki | -wec | -winbond)
6599da04
JM
107 os=
108 basic_machine=$1
109 ;;
b1345c72 110 -scout)
6599da04 111 ;;
b1345c72 112 -wrs)
dbd83e11 113 os=-vxworks
6599da04
JM
114 basic_machine=$1
115 ;;
116 -hiux*)
117 os=-hiuxwe2
118 ;;
119 -sco5)
3e07bdbd 120 os=-sco3.2v5
6599da04
JM
121 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
122 ;;
123 -sco4)
124 os=-sco3.2v4
125 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
126 ;;
127 -sco3.2.[4-9]*)
128 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
129 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
130 ;;
131 -sco3.2v[4-9]*)
132 # Don't forget version if it is 3.2v4 or newer.
133 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
134 ;;
135 -sco*)
136 os=-sco3.2v2
137 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
138 ;;
73a6d2e7
RL
139 -udk*)
140 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
141 ;;
6599da04
JM
142 -isc)
143 os=-isc2.2
144 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
145 ;;
146 -clix*)
147 basic_machine=clipper-intergraph
148 ;;
149 -isc*)
150 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
151 ;;
152 -lynx*)
153 os=-lynxos
154 ;;
155 -ptx*)
156 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
157 ;;
158 -windowsnt*)
159 os=`echo $os | sed -e 's/windowsnt/winnt/'`
160 ;;
161 -psos*)
162 os=-psos
163 ;;
eeda916a
AO
164 -mint | -mint[0-9]*)
165 basic_machine=m68k-atari
166 os=-mint
167 ;;
6599da04
JM
168esac
169
170# Decode aliases for certain CPU-COMPANY combinations.
171case $basic_machine in
172 # Recognize the basic CPU types without company name.
173 # Some are omitted here because they have special meanings below.
eeda916a 174 tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
b1345c72
BE
175 | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
176 | 580 | i960 | h8300 \
ebe12325 177 | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
c2f5d030
RH
178 | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
179 | alphaev6[78] \
9a06b842 180 | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
b1345c72
BE
181 | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
182 | mips64orion | mips64orionel | mipstx39 | mipstx39el \
183 | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
eeda916a
AO
184 | mips64vr5000 | miprs64vr5000el | mcore \
185 | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
ba96c72d 186 | thumb | d10v | fr30 | avr)
6599da04
JM
187 basic_machine=$basic_machine-unknown
188 ;;
eeda916a
AO
189 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
190 ;;
191
6599da04
JM
192 # We use `pc' rather than `unknown'
193 # because (1) that's what they normally are, and
194 # (2) the word "unknown" tends to confuse beginning users.
85ee6037 195 i[34567]86)
6599da04
JM
196 basic_machine=$basic_machine-pc
197 ;;
198 # Object if more than one company name word.
199 *-*-*)
200 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
201 exit 1
202 ;;
203 # Recognize the basic CPU types with company name.
eeda916a
AO
204 # FIXME: clean up the formatting here.
205 vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
6599da04
JM
206 | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
207 | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
b1345c72 208 | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
ebe12325 209 | xmp-* | ymp-* \
b1345c72 210 | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
c2f5d030
RH
211 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
212 | alphaev6[78]-* \
b1345c72
BE
213 | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
214 | clipper-* | orion-* \
6599da04 215 | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
b1345c72
BE
216 | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
217 | mips64el-* | mips64orion-* | mips64orionel-* \
218 | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
eeda916a 219 | mipstx39-* | mipstx39el-* | mcore-* \
7a15eef5 220 | f301-* | armv*-* | s390-* | sv1-* | t3e-* \
b1345c72 221 | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
09b5f8bf 222 | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
85ee6037 223 ;;
6599da04
JM
224 # Recognize the various machine names and aliases which stand
225 # for a CPU type and a company and sometimes even an OS.
b1345c72 226 386bsd)
6599da04
JM
227 basic_machine=i386-unknown
228 os=-bsd
229 ;;
230 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
231 basic_machine=m68000-att
232 ;;
233 3b*)
234 basic_machine=we32k-att
235 ;;
b1345c72 236 a29khif)
6599da04
JM
237 basic_machine=a29k-amd
238 os=-udi
239 ;;
b1345c72 240 adobe68k)
6599da04
JM
241 basic_machine=m68010-adobe
242 os=-scout
243 ;;
244 alliant | fx80)
245 basic_machine=fx80-alliant
246 ;;
247 altos | altos3068)
248 basic_machine=m68k-altos
249 ;;
250 am29k)
251 basic_machine=a29k-none
252 os=-bsd
253 ;;
254 amdahl)
255 basic_machine=580-amdahl
256 os=-sysv
257 ;;
258 amiga | amiga-*)
259 basic_machine=m68k-cbm
260 ;;
becdcf6d 261 amigaos | amigados)
6599da04 262 basic_machine=m68k-cbm
0c82f6bf 263 os=-amigaos
6599da04
JM
264 ;;
265 amigaunix | amix)
266 basic_machine=m68k-cbm
267 os=-sysv4
268 ;;
269 apollo68)
270 basic_machine=m68k-apollo
271 os=-sysv
272 ;;
b1345c72 273 apollo68bsd)
6599da04
JM
274 basic_machine=m68k-apollo
275 os=-bsd
276 ;;
277 aux)
278 basic_machine=m68k-apple
279 os=-aux
280 ;;
281 balance)
282 basic_machine=ns32k-sequent
283 os=-dynix
284 ;;
285 convex-c1)
286 basic_machine=c1-convex
287 os=-bsd
288 ;;
289 convex-c2)
290 basic_machine=c2-convex
291 os=-bsd
292 ;;
293 convex-c32)
294 basic_machine=c32-convex
295 os=-bsd
296 ;;
297 convex-c34)
298 basic_machine=c34-convex
299 os=-bsd
300 ;;
301 convex-c38)
302 basic_machine=c38-convex
303 os=-bsd
304 ;;
305 cray | ymp)
306 basic_machine=ymp-cray
307 os=-unicos
308 ;;
309 cray2)
310 basic_machine=cray2-cray
311 os=-unicos
312 ;;
313 [ctj]90-cray)
314 basic_machine=c90-cray
315 os=-unicos
316 ;;
317 crds | unos)
318 basic_machine=m68k-crds
319 ;;
320 da30 | da30-*)
321 basic_machine=m68k-da30
322 ;;
323 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
324 basic_machine=mips-dec
325 ;;
326 delta | 3300 | motorola-3300 | motorola-delta \
327 | 3300-motorola | delta-motorola)
328 basic_machine=m68k-motorola
329 ;;
330 delta88)
331 basic_machine=m88k-motorola
332 os=-sysv3
333 ;;
334 dpx20 | dpx20-*)
335 basic_machine=rs6000-bull
336 os=-bosx
337 ;;
338 dpx2* | dpx2*-bull)
339 basic_machine=m68k-bull
340 os=-sysv3
341 ;;
342 ebmon29k)
343 basic_machine=a29k-amd
344 os=-ebmon
345 ;;
346 elxsi)
347 basic_machine=elxsi-elxsi
348 os=-bsd
349 ;;
350 encore | umax | mmax)
351 basic_machine=ns32k-encore
352 ;;
b1345c72 353 es1800 | OSE68k | ose68k | ose | OSE)
6599da04
JM
354 basic_machine=m68k-ericsson
355 os=-ose
356 ;;
357 fx2800)
358 basic_machine=i860-alliant
359 ;;
360 genix)
361 basic_machine=ns32k-ns
362 ;;
363 gmicro)
364 basic_machine=tron-gmicro
365 os=-sysv
366 ;;
367 h3050r* | hiux*)
368 basic_machine=hppa1.1-hitachi
369 os=-hiuxwe2
370 ;;
371 h8300hms)
372 basic_machine=h8300-hitachi
373 os=-hms
374 ;;
b1345c72 375 h8300xray)
6599da04
JM
376 basic_machine=h8300-hitachi
377 os=-xray
378 ;;
b1345c72 379 h8500hms)
6599da04
JM
380 basic_machine=h8500-hitachi
381 os=-hms
382 ;;
383 harris)
384 basic_machine=m88k-harris
385 os=-sysv3
386 ;;
387 hp300-*)
388 basic_machine=m68k-hp
389 ;;
390 hp300bsd)
391 basic_machine=m68k-hp
392 os=-bsd
393 ;;
394 hp300hpux)
395 basic_machine=m68k-hp
396 os=-hpux
397 ;;
85ee6037 398 hp3k9[0-9][0-9] | hp9[0-9][0-9])
c4acd909
MK
399 basic_machine=hppa1.0-hp
400 ;;
6599da04
JM
401 hp9k2[0-9][0-9] | hp9k31[0-9])
402 basic_machine=m68000-hp
403 ;;
404 hp9k3[2-9][0-9])
405 basic_machine=m68k-hp
406 ;;
b1345c72 407 hp9k6[0-9][0-9] | hp6[0-9][0-9])
228197ee
LT
408 basic_machine=hppa1.0-hp
409 ;;
b1345c72 410 hp9k7[0-79][0-9] | hp7[0-79][0-9])
228197ee
LT
411 basic_machine=hppa1.1-hp
412 ;;
b1345c72 413 hp9k78[0-9] | hp78[0-9])
228197ee
LT
414 # FIXME: really hppa2.0-hp
415 basic_machine=hppa1.1-hp
416 ;;
b1345c72 417 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
228197ee
LT
418 # FIXME: really hppa2.0-hp
419 basic_machine=hppa1.1-hp
420 ;;
b1345c72 421 hp9k8[0-9][13679] | hp8[0-9][13679])
6599da04
JM
422 basic_machine=hppa1.1-hp
423 ;;
424 hp9k8[0-9][0-9] | hp8[0-9][0-9])
425 basic_machine=hppa1.0-hp
426 ;;
427 hppa-next)
428 os=-nextstep3
429 ;;
b1345c72 430 hppaosf)
6599da04
JM
431 basic_machine=hppa1.1-hp
432 os=-osf
433 ;;
b1345c72
BE
434 hppro)
435 basic_machine=hppa1.1-hp
436 os=-proelf
437 ;;
6599da04
JM
438 i370-ibm* | ibm*)
439 basic_machine=i370-ibm
6599da04
JM
440 ;;
441# I'm not sure what "Sysv32" means. Should this be sysv3.2?
85ee6037 442 i[34567]86v32)
6599da04
JM
443 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
444 os=-sysv32
445 ;;
85ee6037 446 i[34567]86v4*)
6599da04
JM
447 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
448 os=-sysv4
449 ;;
85ee6037 450 i[34567]86v)
6599da04
JM
451 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
452 os=-sysv
453 ;;
85ee6037 454 i[34567]86sol2)
6599da04
JM
455 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
456 os=-solaris2
457 ;;
b1345c72 458 i386mach)
6599da04
JM
459 basic_machine=i386-mach
460 os=-mach
461 ;;
b1345c72 462 i386-vsta | vsta)
6599da04
JM
463 basic_machine=i386-unknown
464 os=-vsta
465 ;;
b1345c72 466 i386-go32 | go32)
6599da04
JM
467 basic_machine=i386-unknown
468 os=-go32
469 ;;
d39cd7a1
MK
470 i386-mingw32 | mingw32)
471 basic_machine=i386-unknown
472 os=-mingw32
473 ;;
eeda916a
AO
474 i386-qnx | qnx)
475 basic_machine=i386-qnx
476 ;;
6599da04
JM
477 iris | iris4d)
478 basic_machine=mips-sgi
479 case $os in
480 -irix*)
481 ;;
482 *)
483 os=-irix4
484 ;;
485 esac
486 ;;
487 isi68 | isi)
488 basic_machine=m68k-isi
489 os=-sysv
490 ;;
491 m88k-omron*)
492 basic_machine=m88k-omron
493 ;;
494 magnum | m3230)
495 basic_machine=mips-mips
496 os=-sysv
497 ;;
498 merlin)
499 basic_machine=ns32k-utek
500 os=-sysv
501 ;;
502 miniframe)
503 basic_machine=m68000-convergent
504 ;;
eeda916a 505 *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
b1345c72
BE
506 basic_machine=m68k-atari
507 os=-mint
508 ;;
6599da04
JM
509 mipsel*-linux*)
510 basic_machine=mipsel-unknown
511 os=-linux-gnu
512 ;;
513 mips*-linux*)
514 basic_machine=mips-unknown
515 os=-linux-gnu
516 ;;
517 mips3*-*)
518 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
519 ;;
520 mips3*)
521 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
522 ;;
784a3a80
HPN
523 mmix*)
524 basic_machine=mmix-knuth
525 os=-mmixware
526 ;;
b1345c72 527 monitor)
6599da04
JM
528 basic_machine=m68k-rom68k
529 os=-coff
530 ;;
b1345c72
BE
531 msdos)
532 basic_machine=i386-unknown
6599da04
JM
533 os=-msdos
534 ;;
0b77644a
LV
535 mvs)
536 basic_machine=i370-ibm
537 os=-mvs
538 ;;
6599da04
JM
539 ncr3000)
540 basic_machine=i486-ncr
541 os=-sysv4
542 ;;
543 netbsd386)
b1345c72 544 basic_machine=i386-unknown
6599da04
JM
545 os=-netbsd
546 ;;
3b7265ff 547 netwinder)
eeda916a 548 basic_machine=armv4l-rebel
3b7265ff
NC
549 os=-linux
550 ;;
6599da04
JM
551 news | news700 | news800 | news900)
552 basic_machine=m68k-sony
553 os=-newsos
554 ;;
555 news1000)
556 basic_machine=m68030-sony
557 os=-newsos
558 ;;
559 news-3600 | risc-news)
560 basic_machine=mips-sony
561 os=-newsos
562 ;;
b1345c72 563 necv70)
6599da04
JM
564 basic_machine=v70-nec
565 os=-sysv
566 ;;
567 next | m*-next )
568 basic_machine=m68k-next
569 case $os in
570 -nextstep* )
571 ;;
572 -ns2*)
573 os=-nextstep2
574 ;;
575 *)
576 os=-nextstep3
577 ;;
578 esac
579 ;;
580 nh3000)
581 basic_machine=m68k-harris
582 os=-cxux
583 ;;
584 nh[45]000)
585 basic_machine=m88k-harris
586 os=-cxux
587 ;;
588 nindy960)
589 basic_machine=i960-intel
590 os=-nindy
591 ;;
b1345c72 592 mon960)
6599da04
JM
593 basic_machine=i960-intel
594 os=-mon960
595 ;;
596 np1)
597 basic_machine=np1-gould
598 ;;
b1345c72
BE
599 op50n-* | op60c-*)
600 basic_machine=hppa1.1-oki
601 os=-proelf
602 ;;
603 OSE68000 | ose68000)
6599da04
JM
604 basic_machine=m68000-ericsson
605 os=-ose
606 ;;
b1345c72 607 os68k)
6599da04
JM
608 basic_machine=m68k-none
609 os=-os68k
610 ;;
611 pa-hitachi)
612 basic_machine=hppa1.1-hitachi
613 os=-hiuxwe2
614 ;;
615 paragon)
616 basic_machine=i860-intel
617 os=-osf
618 ;;
619 pbd)
620 basic_machine=sparc-tti
621 ;;
622 pbb)
623 basic_machine=m68k-tti
624 ;;
625 pc532 | pc532-*)
626 basic_machine=ns32k-pc532
627 ;;
f9ae47d6 628 pentium | p5 | k5 | k6 | nexen)
85ee6037
ILT
629 basic_machine=i586-pc
630 ;;
f9ae47d6 631 pentiumpro | p6 | 6x86)
85ee6037 632 basic_machine=i686-pc
6599da04 633 ;;
85ee6037
ILT
634 pentiumii | pentium2)
635 basic_machine=i786-pc
6599da04 636 ;;
f9ae47d6 637 pentium-* | p5-* | k5-* | k6-* | nexen-*)
6599da04
JM
638 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
639 ;;
f9ae47d6 640 pentiumpro-* | p6-* | 6x86-*)
6599da04
JM
641 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
642 ;;
85ee6037
ILT
643 pentiumii-* | pentium2-*)
644 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
6599da04
JM
645 ;;
646 pn)
647 basic_machine=pn-gould
648 ;;
649 power) basic_machine=rs6000-ibm
650 ;;
651 ppc) basic_machine=powerpc-unknown
652 ;;
653 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
654 ;;
655 ppcle | powerpclittle | ppc-le | powerpc-little)
656 basic_machine=powerpcle-unknown
657 ;;
658 ppcle-* | powerpclittle-*)
659 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
660 ;;
661 ps2)
662 basic_machine=i386-ibm
663 ;;
b1345c72 664 rom68k)
6599da04
JM
665 basic_machine=m68k-rom68k
666 os=-coff
667 ;;
668 rm[46]00)
669 basic_machine=mips-siemens
670 ;;
671 rtpc | rtpc-*)
672 basic_machine=romp-ibm
673 ;;
b1345c72 674 sa29200)
6599da04
JM
675 basic_machine=a29k-amd
676 os=-udi
677 ;;
678 sequent)
679 basic_machine=i386-sequent
680 ;;
681 sh)
682 basic_machine=sh-hitachi
683 os=-hms
684 ;;
b1345c72 685 sparclite-wrs)
6599da04
JM
686 basic_machine=sparclite-wrs
687 os=-vxworks
688 ;;
689 sps7)
690 basic_machine=m68k-bull
691 os=-sysv2
692 ;;
693 spur)
694 basic_machine=spur-unknown
695 ;;
b1345c72 696 st2000)
6599da04
JM
697 basic_machine=m68k-tandem
698 ;;
b1345c72 699 stratus)
6599da04
JM
700 basic_machine=i860-stratus
701 os=-sysv4
702 ;;
703 sun2)
704 basic_machine=m68000-sun
705 ;;
706 sun2os3)
707 basic_machine=m68000-sun
708 os=-sunos3
709 ;;
710 sun2os4)
711 basic_machine=m68000-sun
712 os=-sunos4
713 ;;
714 sun3os3)
715 basic_machine=m68k-sun
716 os=-sunos3
717 ;;
718 sun3os4)
719 basic_machine=m68k-sun
720 os=-sunos4
721 ;;
722 sun4os3)
723 basic_machine=sparc-sun
724 os=-sunos3
725 ;;
726 sun4os4)
727 basic_machine=sparc-sun
728 os=-sunos4
729 ;;
730 sun4sol2)
731 basic_machine=sparc-sun
732 os=-solaris2
733 ;;
734 sun3 | sun3-*)
735 basic_machine=m68k-sun
736 ;;
737 sun4)
738 basic_machine=sparc-sun
739 ;;
740 sun386 | sun386i | roadrunner)
741 basic_machine=i386-sun
742 ;;
7a15eef5
FS
743 sv1)
744 basic_machine=sv1-cray
745 os=-unicos
746 ;;
6599da04
JM
747 symmetry)
748 basic_machine=i386-sequent
749 os=-dynix
750 ;;
b1345c72
BE
751 t3e)
752 basic_machine=t3e-cray
753 os=-unicos
754 ;;
6599da04
JM
755 tx39)
756 basic_machine=mipstx39-unknown
757 ;;
758 tx39el)
759 basic_machine=mipstx39el-unknown
760 ;;
761 tower | tower-32)
762 basic_machine=m68k-ncr
763 ;;
764 udi29k)
765 basic_machine=a29k-amd
766 os=-udi
767 ;;
768 ultra3)
769 basic_machine=a29k-nyu
770 os=-sym1
771 ;;
b1345c72 772 v810 | necv810)
6599da04
JM
773 basic_machine=v810-nec
774 os=-none
775 ;;
776 vaxv)
777 basic_machine=vax-dec
778 os=-sysv
779 ;;
780 vms)
781 basic_machine=vax-dec
782 os=-vms
783 ;;
784 vpp*|vx|vx-*)
785 basic_machine=f301-fujitsu
786 ;;
787 vxworks960)
788 basic_machine=i960-wrs
789 os=-vxworks
790 ;;
791 vxworks68)
792 basic_machine=m68k-wrs
793 os=-vxworks
794 ;;
795 vxworks29k)
796 basic_machine=a29k-wrs
797 os=-vxworks
798 ;;
b1345c72
BE
799 w65*)
800 basic_machine=w65-wdc
801 os=-none
802 ;;
803 w89k-*)
804 basic_machine=hppa1.1-winbond
805 os=-proelf
6599da04
JM
806 ;;
807 xmp)
808 basic_machine=xmp-cray
809 os=-unicos
810 ;;
811 xps | xps100)
812 basic_machine=xps100-honeywell
813 ;;
b1345c72 814 z8k-*-coff)
6599da04
JM
815 basic_machine=z8k-unknown
816 os=-sim
817 ;;
818 none)
819 basic_machine=none-none
820 os=-none
821 ;;
822
823# Here we handle the default manufacturer of certain CPU types. It is in
824# some cases the only manufacturer, in others, it is the most popular.
b1345c72 825 w89k)
6599da04
JM
826 basic_machine=hppa1.1-winbond
827 ;;
b1345c72 828 op50n)
6599da04
JM
829 basic_machine=hppa1.1-oki
830 ;;
b1345c72 831 op60c)
6599da04
JM
832 basic_machine=hppa1.1-oki
833 ;;
834 mips)
835 if [ x$os = x-linux-gnu ]; then
836 basic_machine=mips-unknown
837 else
838 basic_machine=mips-mips
839 fi
840 ;;
841 romp)
842 basic_machine=romp-ibm
843 ;;
844 rs6000)
845 basic_machine=rs6000-ibm
846 ;;
847 vax)
848 basic_machine=vax-dec
849 ;;
850 pdp11)
851 basic_machine=pdp11-dec
852 ;;
853 we32k)
854 basic_machine=we32k-att
855 ;;
d7496fbb 856 sparc | sparcv9)
6599da04
JM
857 basic_machine=sparc-sun
858 ;;
859 cydra)
860 basic_machine=cydra-cydrome
861 ;;
862 orion)
863 basic_machine=orion-highlevel
864 ;;
865 orion105)
866 basic_machine=clipper-highlevel
867 ;;
b1345c72 868 mac | mpw | mac-mpw)
6599da04
JM
869 basic_machine=m68k-apple
870 ;;
b1345c72 871 pmac | pmac-mpw)
6599da04
JM
872 basic_machine=powerpc-apple
873 ;;
b1345c72
BE
874 c4x*)
875 basic_machine=c4x-none
876 os=-coff
877 ;;
6599da04
JM
878 *)
879 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
880 exit 1
881 ;;
882esac
883
884# Here we canonicalize certain aliases for manufacturers.
885case $basic_machine in
886 *-digital*)
887 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
888 ;;
889 *-commodore*)
890 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
891 ;;
892 *)
893 ;;
894esac
895
896# Decode manufacturer-specific aliases for certain operating systems.
897
898if [ x"$os" != x"" ]
899then
900case $os in
901 # First match some system type aliases
902 # that might get confused with valid system types.
903 # -solaris* is a basic system type, with this one exception.
904 -solaris1 | -solaris1.*)
905 os=`echo $os | sed -e 's|solaris1|sunos4|'`
906 ;;
907 -solaris)
908 os=-solaris2
909 ;;
85ee6037 910 -svr4*)
6599da04
JM
911 os=-sysv4
912 ;;
85ee6037
ILT
913 -unixware*)
914 os=-sysv4.2uw
915 ;;
6599da04
JM
916 -gnu/linux*)
917 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
918 ;;
919 # First accept the basic system types.
920 # The portable systems comes first.
921 # Each alternative MUST END IN A *, to match a version number.
922 # -sysv* is not here because it comes later, after sysvr4.
923 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
924 | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
925 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
becdcf6d 926 | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
eeda916a 927 | -aos* \
6599da04
JM
928 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
929 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
930 | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
bbd8fa7f 931 | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
6599da04
JM
932 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
933 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
282e5df8 934 | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
c9ffaa63 935 | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
eeda916a 936 | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
6599da04
JM
937 # Remember, each alternative MUST END IN *, to match a version number.
938 ;;
6599da04 939 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
b1345c72 940 | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
784a3a80 941 | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
6599da04
JM
942 ;;
943 -mac*)
944 os=`echo $os | sed -e 's|mac|macos|'`
945 ;;
6599da04
JM
946 -linux*)
947 os=`echo $os | sed -e 's|linux|linux-gnu|'`
948 ;;
949 -sunos5*)
950 os=`echo $os | sed -e 's|sunos5|solaris2|'`
951 ;;
952 -sunos6*)
953 os=`echo $os | sed -e 's|sunos6|solaris3|'`
954 ;;
0b77644a
LV
955 -opened*)
956 os=-openedition
957 ;;
6599da04
JM
958 -osfrose*)
959 os=-osfrose
960 ;;
961 -osf*)
962 os=-osf
963 ;;
964 -utek*)
965 os=-bsd
966 ;;
967 -dynix*)
968 os=-bsd
969 ;;
970 -acis*)
971 os=-aos
972 ;;
b1345c72 973 -386bsd)
6599da04
JM
974 os=-bsd
975 ;;
976 -ctix* | -uts*)
977 os=-sysv
978 ;;
979 -ns2 )
980 os=-nextstep2
981 ;;
982 # Preserve the version number of sinix5.
983 -sinix5.*)
984 os=`echo $os | sed -e 's|sinix|sysv|'`
985 ;;
986 -sinix*)
987 os=-sysv4
988 ;;
989 -triton*)
990 os=-sysv3
991 ;;
992 -oss*)
993 os=-sysv3
994 ;;
eeda916a
AO
995 -qnx)
996 os=-qnx4
997 ;;
6599da04
JM
998 -svr4)
999 os=-sysv4
1000 ;;
1001 -svr3)
1002 os=-sysv3
1003 ;;
1004 -sysvr4)
1005 os=-sysv4
1006 ;;
1007 # This must come after -sysvr4.
1008 -sysv*)
1009 ;;
b1345c72 1010 -ose*)
6599da04
JM
1011 os=-ose
1012 ;;
b1345c72 1013 -es1800*)
6599da04
JM
1014 os=-ose
1015 ;;
1016 -xenix)
1017 os=-xenix
1018 ;;
b1345c72
BE
1019 -*mint | -*MiNT)
1020 os=-mint
1021 ;;
6599da04
JM
1022 -none)
1023 ;;
1024 *)
1025 # Get rid of the `-' at the beginning of $os.
1026 os=`echo $os | sed 's/[^-]*-//'`
1027 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1028 exit 1
1029 ;;
1030esac
1031else
1032
1033# Here we handle the default operating systems that come with various machines.
1034# The value should be what the vendor currently ships out the door with their
1035# machine or put another way, the most popular os provided with the machine.
1036
1037# Note that if you're going to try to match "-MANUFACTURER" here (say,
1038# "-sun"), then you have to tell the case statement up towards the top
1039# that MANUFACTURER isn't an operating system. Otherwise, code above
1040# will signal an error saying that MANUFACTURER isn't an operating
1041# system, and we'll never get to this point.
1042
1043case $basic_machine in
1044 *-acorn)
1045 os=-riscix1.2
1046 ;;
eeda916a 1047 arm*-rebel)
3b7265ff
NC
1048 os=-linux
1049 ;;
6599da04
JM
1050 arm*-semi)
1051 os=-aout
1052 ;;
1053 pdp11-*)
1054 os=-none
1055 ;;
1056 *-dec | vax-*)
1057 os=-ultrix4.2
1058 ;;
1059 m68*-apollo)
1060 os=-domain
1061 ;;
1062 i386-sun)
1063 os=-sunos4.0.2
1064 ;;
1065 m68000-sun)
1066 os=-sunos3
1067 # This also exists in the configure program, but was not the
1068 # default.
1069 # os=-sunos4
1070 ;;
b1345c72 1071 m68*-cisco)
6599da04
JM
1072 os=-aout
1073 ;;
b1345c72
BE
1074 mips*-cisco)
1075 os=-elf
1076 ;;
1077 mips*-*)
6599da04
JM
1078 os=-elf
1079 ;;
6599da04
JM
1080 *-tti) # must be before sparc entry or we get the wrong os.
1081 os=-sysv3
1082 ;;
1083 sparc-* | *-sun)
1084 os=-sunos4.1.1
1085 ;;
85ee6037 1086 *-be)
6599da04
JM
1087 os=-beos
1088 ;;
1089 *-ibm)
1090 os=-aix
1091 ;;
b1345c72 1092 *-wec)
6599da04
JM
1093 os=-proelf
1094 ;;
b1345c72 1095 *-winbond)
6599da04
JM
1096 os=-proelf
1097 ;;
b1345c72 1098 *-oki)
6599da04
JM
1099 os=-proelf
1100 ;;
1101 *-hp)
1102 os=-hpux
1103 ;;
1104 *-hitachi)
1105 os=-hiux
1106 ;;
1107 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1108 os=-sysv
1109 ;;
1110 *-cbm)
0c82f6bf 1111 os=-amigaos
6599da04
JM
1112 ;;
1113 *-dg)
1114 os=-dgux
1115 ;;
1116 *-dolphin)
1117 os=-sysv3
1118 ;;
1119 m68k-ccur)
1120 os=-rtu
1121 ;;
1122 m88k-omron*)
1123 os=-luna
1124 ;;
1125 *-next )
1126 os=-nextstep
1127 ;;
1128 *-sequent)
1129 os=-ptx
1130 ;;
1131 *-crds)
1132 os=-unos
1133 ;;
1134 *-ns)
1135 os=-genix
1136 ;;
1137 i370-*)
1138 os=-mvs
1139 ;;
1140 *-next)
1141 os=-nextstep3
1142 ;;
1143 *-gould)
1144 os=-sysv
1145 ;;
1146 *-highlevel)
1147 os=-bsd
1148 ;;
1149 *-encore)
1150 os=-bsd
1151 ;;
1152 *-sgi)
1153 os=-irix
1154 ;;
1155 *-siemens)
1156 os=-sysv4
1157 ;;
1158 *-masscomp)
1159 os=-rtu
1160 ;;
1161 f301-fujitsu)
1162 os=-uxpv
1163 ;;
b1345c72 1164 *-rom68k)
6599da04
JM
1165 os=-coff
1166 ;;
b1345c72 1167 *-*bug)
6599da04
JM
1168 os=-coff
1169 ;;
b1345c72 1170 *-apple)
6599da04
JM
1171 os=-macos
1172 ;;
b1345c72
BE
1173 *-atari*)
1174 os=-mint
1175 ;;
6599da04
JM
1176 *)
1177 os=-none
1178 ;;
1179esac
1180fi
1181
1182# Here we handle the case where we know the os, and the CPU type, but not the
1183# manufacturer. We pick the logical manufacturer.
1184vendor=unknown
1185case $basic_machine in
1186 *-unknown)
1187 case $os in
1188 -riscix*)
1189 vendor=acorn
1190 ;;
1191 -sunos*)
1192 vendor=sun
1193 ;;
1194 -aix*)
1195 vendor=ibm
1196 ;;
85ee6037 1197 -beos*)
6599da04
JM
1198 vendor=be
1199 ;;
1200 -hpux*)
85ee6037
ILT
1201 vendor=hp
1202 ;;
c4acd909 1203 -mpeix*)
85ee6037
ILT
1204 vendor=hp
1205 ;;
6599da04
JM
1206 -hiux*)
1207 vendor=hitachi
1208 ;;
1209 -unos*)
1210 vendor=crds
1211 ;;
1212 -dgux*)
1213 vendor=dg
1214 ;;
1215 -luna*)
1216 vendor=omron
1217 ;;
1218 -genix*)
1219 vendor=ns
1220 ;;
0b77644a 1221 -mvs* | -opened*)
6599da04
JM
1222 vendor=ibm
1223 ;;
1224 -ptx*)
1225 vendor=sequent
1226 ;;
1227 -vxsim* | -vxworks*)
1228 vendor=wrs
1229 ;;
1230 -aux*)
1231 vendor=apple
1232 ;;
b1345c72 1233 -hms*)
6599da04
JM
1234 vendor=hitachi
1235 ;;
b1345c72 1236 -mpw* | -macos*)
6599da04
JM
1237 vendor=apple
1238 ;;
b1345c72
BE
1239 -*mint | -*MiNT)
1240 vendor=atari
1241 ;;
6599da04
JM
1242 esac
1243 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1244 ;;
1245esac
1246
1247echo $basic_machine$os