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