A bug fix for the previous select bug fix.
[glibc.git] / config.sub
blobb2691160cf03fe196340adad6c0aa58eb0ca4550
1 #! /bin/sh
2 # Configuration validation subroutine script, version 1.1.
3 # Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
4 # This file is (in principle) common to ALL GNU software.
5 # The presence of a machine in this file suggests that SOME GNU software
6 # can handle that machine. It does not imply ALL GNU software can.
8 # This file is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330,
21 # Boston, MA 02111-1307, USA.
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
28 # Configuration subroutine to validate and canonicalize a configuration type.
29 # Supply the specified configuration type as an argument.
30 # If it is invalid, we print an error message on stderr and exit with code 1.
31 # Otherwise, we print the canonical config type on stdout and succeed.
33 # This file is supposed to be the same for all GNU packages
34 # and recognize all the CPU types, system types and aliases
35 # that are meaningful with *any* GNU software.
36 # Each package is responsible for reporting which valid configurations
37 # it does not support. The user should be able to distinguish
38 # a failure to support a valid configuration from a meaningless
39 # configuration.
41 # The goal of this file is to map all the various variations of a given
42 # machine specification into a single specification in the form:
43 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
44 # It is wrong to echo any other type of specification.
46 if [ x$1 = x ]
47 then
48 echo Configuration name missing. 1>&2
49 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
50 echo "or $0 ALIAS" 1>&2
51 echo where ALIAS is a recognized configuration type. 1>&2
52 exit 1
55 # First pass through any local machine types.
56 case $1 in
57 *local*)
58 echo $1
59 exit 0
63 esac
65 # Separate what the user gave into CPU-COMPANY and OS (if any).
66 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
67 if [ $basic_machine != $1 ]
68 then os=`echo $1 | sed 's/.*-/-/'`
69 else os=; fi
71 ### Let's recognize common machines as not being operating systems so
72 ### that things like config.sub decstation-3100 work. We also
73 ### recognize some manufacturers as not being operating systems, so we
74 ### can provide default operating systems below.
75 case $os in
76 -sun*os*)
77 # Prevent following clause from handling this invalid input.
79 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
80 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
81 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
82 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
83 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
84 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
85 os=
86 basic_machine=$1
88 -hiux*)
89 os=-hiuxwe2
91 -sco5)
92 os=sco3.2v5
93 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
95 -sco4)
96 os=-sco3.2v4
97 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
99 -sco3.2.[4-9]*)
100 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
101 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
103 -sco3.2v[4-9]*)
104 # Don't forget version if it is 3.2v4 or newer.
105 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
107 -sco*)
108 os=-sco3.2v2
109 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
111 -isc)
112 os=-isc2.2
113 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
115 -clix*)
116 basic_machine=clipper-intergraph
118 -isc*)
119 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
121 -lynx*)
122 os=-lynxos
124 -ptx*)
125 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
127 -windowsnt*)
128 os=`echo $os | sed -e 's/windowsnt/winnt/'`
130 -psos*)
131 os=-psos
133 esac
135 # Decode aliases for certain CPU-COMPANY combinations.
136 case $basic_machine in
137 # Recognize the basic CPU types without company name.
138 # Some are omitted here because they have special meanings below.
139 tahoe | i[3456]86 | i860 | m68k | m68000 | m88k | ns32k | arm \
140 | arme[lb] | pyramid \
141 | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
142 | alpha | we32k | ns16k | clipper | i370 | sh \
143 | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
144 | pdp11 | mips64el | mips64orion | mips64orionel \
145 | sparc | sparclet | sparclite | sparc64)
146 basic_machine=$basic_machine-unknown
148 # Object if more than one company name word.
149 *-*-*)
150 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
151 exit 1
153 # Recognize the basic CPU types with company name.
154 vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
155 | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
156 | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
157 | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
158 | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
159 | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
160 | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
161 | mips64el-* | mips64orion-* | mips64orionel-*)
163 # Recognize the various machine names and aliases which stand
164 # for a CPU type and a company and sometimes even an OS.
165 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
166 basic_machine=m68000-att
168 3b*)
169 basic_machine=we32k-att
171 alliant | fx80)
172 basic_machine=fx80-alliant
174 altos | altos3068)
175 basic_machine=m68k-altos
177 am29k)
178 basic_machine=a29k-none
179 os=-bsd
181 amdahl)
182 basic_machine=580-amdahl
183 os=-sysv
185 amiga | amiga-*)
186 basic_machine=m68k-cbm
188 amigados)
189 basic_machine=m68k-cbm
190 os=-amigados
192 amigaunix | amix)
193 basic_machine=m68k-cbm
194 os=-sysv4
196 apollo68)
197 basic_machine=m68k-apollo
198 os=-sysv
200 aux)
201 basic_machine=m68k-apple
202 os=-aux
204 balance)
205 basic_machine=ns32k-sequent
206 os=-dynix
208 convex-c1)
209 basic_machine=c1-convex
210 os=-bsd
212 convex-c2)
213 basic_machine=c2-convex
214 os=-bsd
216 convex-c32)
217 basic_machine=c32-convex
218 os=-bsd
220 convex-c34)
221 basic_machine=c34-convex
222 os=-bsd
224 convex-c38)
225 basic_machine=c38-convex
226 os=-bsd
228 cray | ymp)
229 basic_machine=ymp-cray
230 os=-unicos
232 cray2)
233 basic_machine=cray2-cray
234 os=-unicos
236 [ctj]90-cray)
237 basic_machine=c90-cray
238 os=-unicos
240 crds | unos)
241 basic_machine=m68k-crds
243 da30 | da30-*)
244 basic_machine=m68k-da30
246 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
247 basic_machine=mips-dec
249 delta | 3300 | motorola-3300 | motorola-delta \
250 | 3300-motorola | delta-motorola)
251 basic_machine=m68k-motorola
253 delta88)
254 basic_machine=m88k-motorola
255 os=-sysv3
257 dpx20 | dpx20-*)
258 basic_machine=rs6000-bull
259 os=-bosx
261 dpx2* | dpx2*-bull)
262 basic_machine=m68k-bull
263 os=-sysv3
265 ebmon29k)
266 basic_machine=a29k-amd
267 os=-ebmon
269 elxsi)
270 basic_machine=elxsi-elxsi
271 os=-bsd
273 encore | umax | mmax)
274 basic_machine=ns32k-encore
276 fx2800)
277 basic_machine=i860-alliant
279 genix)
280 basic_machine=ns32k-ns
282 gmicro)
283 basic_machine=tron-gmicro
284 os=-sysv
286 h3050r* | hiux*)
287 basic_machine=hppa1.1-hitachi
288 os=-hiuxwe2
290 h8300hms)
291 basic_machine=h8300-hitachi
292 os=-hms
294 harris)
295 basic_machine=m88k-harris
296 os=-sysv3
298 hp300-*)
299 basic_machine=m68k-hp
301 hp300bsd)
302 basic_machine=m68k-hp
303 os=-bsd
305 hp300hpux)
306 basic_machine=m68k-hp
307 os=-hpux
309 hp9k2[0-9][0-9] | hp9k31[0-9])
310 basic_machine=m68000-hp
312 hp9k3[2-9][0-9])
313 basic_machine=m68k-hp
315 hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
316 basic_machine=hppa1.1-hp
318 hp9k8[0-9][0-9] | hp8[0-9][0-9])
319 basic_machine=hppa1.0-hp
321 i370-ibm* | ibm*)
322 basic_machine=i370-ibm
323 os=-mvs
325 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
326 i[3456]86v32)
327 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
328 os=-sysv32
330 i[3456]86v4*)
331 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
332 os=-sysv4
334 i[3456]86v)
335 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
336 os=-sysv
338 i[3456]86sol2)
339 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
340 os=-solaris2
342 iris | iris4d)
343 basic_machine=mips-sgi
344 case $os in
345 -irix*)
348 os=-irix4
350 esac
352 isi68 | isi)
353 basic_machine=m68k-isi
354 os=-sysv
356 m88k-omron*)
357 basic_machine=m88k-omron
359 magnum | m3230)
360 basic_machine=mips-mips
361 os=-sysv
363 merlin)
364 basic_machine=ns32k-utek
365 os=-sysv
367 miniframe)
368 basic_machine=m68000-convergent
370 mips3*-*)
371 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
373 mips3*)
374 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
376 ncr3000)
377 basic_machine=i486-ncr
378 os=-sysv4
380 news | news700 | news800 | news900)
381 basic_machine=m68k-sony
382 os=-newsos
384 news1000)
385 basic_machine=m68030-sony
386 os=-newsos
388 news-3600 | risc-news)
389 basic_machine=mips-sony
390 os=-newsos
392 next | m*-next )
393 basic_machine=m68k-next
394 case $os in
395 -nextstep* )
397 -ns2*)
398 os=-nextstep2
401 os=-nextstep3
403 esac
405 nh3000)
406 basic_machine=m68k-harris
407 os=-cxux
409 nh[45]000)
410 basic_machine=m88k-harris
411 os=-cxux
413 nindy960)
414 basic_machine=i960-intel
415 os=-nindy
417 np1)
418 basic_machine=np1-gould
420 pa-hitachi)
421 basic_machine=hppa1.1-hitachi
422 os=-hiuxwe2
424 paragon)
425 basic_machine=i860-intel
426 os=-osf
428 pbd)
429 basic_machine=sparc-tti
431 pbb)
432 basic_machine=m68k-tti
434 pc532 | pc532-*)
435 basic_machine=ns32k-pc532
437 pentium | p5)
438 basic_machine=i586-intel
440 pentiumpro | p6)
441 basic_machine=i686-intel
443 pentium-* | p5-*)
444 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
446 pentiumpro-* | p6-*)
447 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
450 # We don't have specific support for AMD's K5 yet, so just call it a Pentium
451 basic_machine=i586-amd
453 nexen)
454 # We don't have specific support for Nexgen yet, so just call it a Pentium
455 basic_machine=i586-nexgen
458 basic_machine=pn-gould
460 power) basic_machine=rs6000-ibm
462 ppc) basic_machine=powerpc-unknown
464 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
466 ppcle | powerpclittle | ppc-le | powerpc-little)
467 basic_machine=powerpcle-unknown
469 ppcle-* | powerpclittle-*)
470 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
472 ps2)
473 basic_machine=i386-ibm
475 rm[46]00)
476 basic_machine=mips-siemens
478 rtpc | rtpc-*)
479 basic_machine=romp-ibm
481 sequent)
482 basic_machine=i386-sequent
485 basic_machine=sh-hitachi
486 os=-hms
488 sps7)
489 basic_machine=m68k-bull
490 os=-sysv2
492 spur)
493 basic_machine=spur-unknown
495 sun2)
496 basic_machine=m68000-sun
498 sun2os3)
499 basic_machine=m68000-sun
500 os=-sunos3
502 sun2os4)
503 basic_machine=m68000-sun
504 os=-sunos4
506 sun3os3)
507 basic_machine=m68k-sun
508 os=-sunos3
510 sun3os4)
511 basic_machine=m68k-sun
512 os=-sunos4
514 sun4os3)
515 basic_machine=sparc-sun
516 os=-sunos3
518 sun4os4)
519 basic_machine=sparc-sun
520 os=-sunos4
522 sun4sol2)
523 basic_machine=sparc-sun
524 os=-solaris2
526 sun3 | sun3-*)
527 basic_machine=m68k-sun
529 sun4)
530 basic_machine=sparc-sun
532 sun386 | sun386i | roadrunner)
533 basic_machine=i386-sun
535 symmetry)
536 basic_machine=i386-sequent
537 os=-dynix
539 tower | tower-32)
540 basic_machine=m68k-ncr
542 udi29k)
543 basic_machine=a29k-amd
544 os=-udi
546 ultra3)
547 basic_machine=a29k-nyu
548 os=-sym1
550 vaxv)
551 basic_machine=vax-dec
552 os=-sysv
554 vms)
555 basic_machine=vax-dec
556 os=-vms
558 vxworks960)
559 basic_machine=i960-wrs
560 os=-vxworks
562 vxworks68)
563 basic_machine=m68k-wrs
564 os=-vxworks
566 vxworks29k)
567 basic_machine=a29k-wrs
568 os=-vxworks
570 xmp)
571 basic_machine=xmp-cray
572 os=-unicos
574 xps | xps100)
575 basic_machine=xps100-honeywell
577 none)
578 basic_machine=none-none
579 os=-none
582 # Here we handle the default manufacturer of certain CPU types. It is in
583 # some cases the only manufacturer, in others, it is the most popular.
584 mips)
585 basic_machine=mips-mips
587 romp)
588 basic_machine=romp-ibm
590 rs6000)
591 basic_machine=rs6000-ibm
593 vax)
594 basic_machine=vax-dec
596 pdp11)
597 basic_machine=pdp11-dec
599 we32k)
600 basic_machine=we32k-att
602 sparc)
603 basic_machine=sparc-sun
605 cydra)
606 basic_machine=cydra-cydrome
608 orion)
609 basic_machine=orion-highlevel
611 orion105)
612 basic_machine=clipper-highlevel
615 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
616 exit 1
618 esac
620 # Here we canonicalize certain aliases for manufacturers.
621 case $basic_machine in
622 *-digital*)
623 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
625 *-commodore*)
626 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
630 esac
632 # Decode manufacturer-specific aliases for certain operating systems.
634 if [ x"$os" != x"" ]
635 then
636 case $os in
637 # -solaris* is a basic system type, with this one exception.
638 -solaris1 | -solaris1.*)
639 os=`echo $os | sed -e 's|solaris1|sunos4|'`
641 -solaris)
642 os=-solaris2
644 -unixware* | svr4*)
645 os=-sysv4
647 -gnu/linux*)
648 os=`echo $os | sed -e 's|gnu/linux|linux|'`
650 # First accept the basic system types.
651 # The portable systems comes first.
652 # Each alternative MUST END IN A *, to match a version number.
653 # -sysv* is not here because it comes later, after sysvr4.
654 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
655 | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[3456]* \
656 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
657 | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
658 | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
659 | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
660 | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
661 | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
662 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
663 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
664 | -cygwin32* | -pe* | -psos* | -moss*)
665 # Remember, each alternative MUST END IN *, to match a version number.
667 -sunos5*)
668 os=`echo $os | sed -e 's|sunos5|solaris2|'`
670 -sunos6*)
671 os=`echo $os | sed -e 's|sunos6|solaris3|'`
673 -osfrose*)
674 os=-osfrose
676 -osf*)
677 os=-osf
679 -utek*)
680 os=-bsd
682 -dynix*)
683 os=-bsd
685 -acis*)
686 os=-aos
688 -ctix* | -uts*)
689 os=-sysv
691 -ns2 )
692 os=-nextstep2
694 # Preserve the version number of sinix5.
695 -sinix5.*)
696 os=`echo $os | sed -e 's|sinix|sysv|'`
698 -sinix*)
699 os=-sysv4
701 -triton*)
702 os=-sysv3
704 -oss*)
705 os=-sysv3
707 -svr4)
708 os=-sysv4
710 -svr3)
711 os=-sysv3
713 -sysvr4)
714 os=-sysv4
716 # This must come after -sysvr4.
717 -sysv*)
719 -xenix)
720 os=-xenix
722 -none)
725 # Get rid of the `-' at the beginning of $os.
726 os=`echo $os | sed 's/[^-]*-//'`
727 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
728 exit 1
730 esac
731 else
733 # Here we handle the default operating systems that come with various machines.
734 # The value should be what the vendor currently ships out the door with their
735 # machine or put another way, the most popular os provided with the machine.
737 # Note that if you're going to try to match "-MANUFACTURER" here (say,
738 # "-sun"), then you have to tell the case statement up towards the top
739 # that MANUFACTURER isn't an operating system. Otherwise, code above
740 # will signal an error saying that MANUFACTURER isn't an operating
741 # system, and we'll never get to this point.
743 case $basic_machine in
744 *-acorn)
745 os=-riscix1.2
747 arm*-semi)
748 os=-aout
750 pdp11-*)
751 os=-none
753 *-dec | vax-*)
754 os=-ultrix4.2
756 m68*-apollo)
757 os=-domain
759 i386-sun)
760 os=-sunos4.0.2
762 m68000-sun)
763 os=-sunos3
764 # This also exists in the configure program, but was not the
765 # default.
766 # os=-sunos4
768 *-tti) # must be before sparc entry or we get the wrong os.
769 os=-sysv3
771 sparc-* | *-sun)
772 os=-sunos4.1.1
774 *-ibm)
775 os=-aix
777 *-hp)
778 os=-hpux
780 *-hitachi)
781 os=-hiux
783 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
784 os=-sysv
786 *-cbm)
787 os=-amigados
789 *-dg)
790 os=-dgux
792 *-dolphin)
793 os=-sysv3
795 m68k-ccur)
796 os=-rtu
798 m88k-omron*)
799 os=-luna
801 *-next )
802 os=-nextstep
804 *-sequent)
805 os=-ptx
807 *-crds)
808 os=-unos
810 *-ns)
811 os=-genix
813 i370-*)
814 os=-mvs
816 *-next)
817 os=-nextstep3
819 *-gould)
820 os=-sysv
822 *-highlevel)
823 os=-bsd
825 *-encore)
826 os=-bsd
828 *-sgi)
829 os=-irix
831 *-siemens)
832 os=-sysv4
834 *-masscomp)
835 os=-rtu
838 os=-none
840 esac
843 # Here we handle the case where we know the os, and the CPU type, but not the
844 # manufacturer. We pick the logical manufacturer.
845 vendor=unknown
846 case $basic_machine in
847 *-unknown)
848 case $os in
849 -riscix*)
850 vendor=acorn
852 -sunos*)
853 vendor=sun
855 -lynxos*)
856 vendor=lynx
858 -aix*)
859 vendor=ibm
861 -hpux*)
862 vendor=hp
864 -hiux*)
865 vendor=hitachi
867 -unos*)
868 vendor=crds
870 -dgux*)
871 vendor=dg
873 -luna*)
874 vendor=omron
876 -genix*)
877 vendor=ns
879 -mvs*)
880 vendor=ibm
882 -ptx*)
883 vendor=sequent
885 -vxworks*)
886 vendor=wrs
888 -aux*)
889 vendor=apple
890 esac
891 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
893 esac
895 echo $basic_machine$os