2 # Configuration validation subroutine script, version 1.1.
3 # Copyright (C) 1991, 1992, 1993, 1994, 1995 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, Boston, MA 02111-1307, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 # Configuration subroutine to validate and canonicalize a configuration type.
28 # Supply the specified configuration type as an argument.
29 # If it is invalid, we print an error message on stderr and exit with code 1.
30 # Otherwise, we print the canonical config type on stdout and succeed.
32 # This file is supposed to be the same for all GNU packages
33 # and recognize all the CPU types, system types and aliases
34 # that are meaningful with *any* GNU software.
35 # Each package is responsible for reporting which valid configurations
36 # it does not support. The user should be able to distinguish
37 # a failure to support a valid configuration from a meaningless
40 # The goal of this file is to map all the various variations of a given
41 # machine specification into a single specification in the form:
42 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
43 # It is wrong to echo any other type of specification.
47 echo Configuration name missing. 1>&2
48 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
49 echo "or $0 ALIAS" 1>&2
50 echo where ALIAS is a recognized configuration type. 1>&2
54 # First pass through any local machine types.
64 # Separate what the user gave into CPU-COMPANY and OS (if any).
65 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
66 if [ $basic_machine != $1 ]
67 then os=`echo $1 | sed 's/.*-/-/'`
70 ### Let's recognize common machines as not being operating systems so
71 ### that things like config.sub decstation-3100 work. We also
72 ### recognize some manufacturers as not being operating systems, so we
73 ### can provide default operating systems below.
76 # Prevent following clause from handling this invalid input.
78 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
79 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
80 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
81 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
82 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
83 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
87 -sim | -cisco | -oki | -wec | -winbond ) # CYGNUS LOCAL
91 -apple*) # CYGNUS LOCAL
95 -scout) # CYGNUS LOCAL
106 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
109 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
110 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
113 # Don't forget version if it is 3.2v4 or newer.
114 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
118 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
122 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
125 basic_machine=clipper-intergraph
128 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
134 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
137 os=`echo $os | sed -e 's/windowsnt/winnt/'`
141 # Decode aliases for certain CPU-COMPANY combinations.
142 case $basic_machine in
143 # Recognize the basic CPU types without company name.
144 # Some are omitted here because they have special meanings below.
145 tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm | armeb \
147 | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
148 | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
149 | powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
150 | pdp11 | mips64el | mips64orion | mips64orionel \
152 basic_machine=$basic_machine-unknown
154 m88110 | m680[01234]0 | m683?2 | m68360 | z8k | v70 | h8500 | w65) # CYGNUS LOCAL
155 basic_machine=$basic_machine-unknown
157 mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith
158 basic_machine=$basic_machine-unknown
160 # Object if more than one company name word.
162 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
165 # Recognize the basic CPU types with company name.
166 vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
167 | sparc-* | ns32k-* | fx80-* | arm-* | arme[lb]-* | c[123]* \
168 | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
169 | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
170 | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
171 | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
172 | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
173 | mips64el-* | mips64orion-* | mips64orionel-*)
175 m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-*) # CYGNUS LOCAL
177 mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith
179 # Recognize the various machine names and aliases which stand
180 # for a CPU type and a company and sometimes even an OS.
181 386bsd) # CYGNUS LOCAL
182 basic_machine=i386-unknown
185 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
186 basic_machine=m68000-att
189 basic_machine=we32k-att
191 a29khif) # CYGNUS LOCAL
192 basic_machine=a29k-amd
195 adobe68k) # CYGNUS LOCAL
196 basic_machine=m68010-adobe
200 basic_machine=fx80-alliant
203 basic_machine=m68k-altos
206 basic_machine=a29k-none
210 basic_machine=580-amdahl
214 basic_machine=m68k-cbm
217 basic_machine=m68k-cbm
221 basic_machine=m68k-cbm
225 basic_machine=m68k-apollo
228 apollo68bsd) # CYGNUS LOCAL
229 basic_machine=m68k-apollo
233 basic_machine=arm-arm
238 basic_machine=arc-unknown
244 basic_machine=ns32k-sequent
248 basic_machine=c1-convex
252 basic_machine=c2-convex
256 basic_machine=c32-convex
260 basic_machine=c34-convex
264 basic_machine=c38-convex
268 basic_machine=ymp-cray
272 basic_machine=cray2-cray
276 basic_machine=m68k-crds
279 basic_machine=m68k-da30
281 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
282 basic_machine=mips-dec
284 delta | 3300 | motorola-3300 | motorola-delta \
285 | 3300-motorola | delta-motorola)
286 basic_machine=m68k-motorola
289 basic_machine=m88k-motorola
293 basic_machine=rs6000-bull
297 basic_machine=m68k-bull
301 basic_machine=a29k-amd
305 basic_machine=elxsi-elxsi
308 encore | umax | mmax)
309 basic_machine=ns32k-encore
311 es1800 | OSE68k | ose68k | ose | OSE) # CYGNUS LOCAL
312 basic_machine=m68k-ericsson
316 basic_machine=i860-alliant
319 basic_machine=ns32k-ns
322 basic_machine=tron-gmicro
326 basic_machine=hppa1.1-hitachi
330 basic_machine=h8300-hitachi
333 h8300xray) # CYGNUS LOCAL
334 basic_machine=h8300-hitachi
337 h8500hms) # CYGNUS LOCAL
338 basic_machine=h8500-hitachi
342 basic_machine=m88k-harris
346 basic_machine=m68k-hp
349 basic_machine=m68k-hp
353 basic_machine=m68k-hp
356 w89k-*) # CYGNUS LOCAL
357 basic_machine=hppa1.1-winbond
360 op50n-*) # CYGNUS LOCAL
361 basic_machine=hppa1.1-oki
364 op60c-*) # CYGNUS LOCAL
365 basic_machine=hppa1.1-oki
368 hppro) # CYGNUS LOCAL
369 basic_machine=hppa1.1-hp
372 hp9k2[0-9][0-9] | hp9k31[0-9])
373 basic_machine=m68000-hp
376 basic_machine=m68k-hp
378 hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
379 basic_machine=hppa1.1-hp
381 hp9k8[0-9][0-9] | hp8[0-9][0-9])
382 basic_machine=hppa1.0-hp
384 hppaosf) # CYGNUS LOCAL
385 basic_machine=hppa1.1-hp
389 basic_machine=i370-ibm
392 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
394 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
398 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
402 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
406 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
409 i386mach) # CYGNUS LOCAL
410 basic_machine=i386-mach
413 i386-vsta | vsta) # CYGNUS LOCAL
414 basic_machine=i386-unknown
417 i386-go32 | go32) # CYGNUS LOCAL
418 basic_machine=i386-unknown
422 basic_machine=mips-sgi
432 basic_machine=m68k-isi
435 # start-sanitize-jaguar
437 basic_machine=jaguar-unknown
441 # end-sanitize-jaguar
443 basic_machine=m88k-omron
446 basic_machine=mips-mips
450 basic_machine=ns32k-utek
454 basic_machine=m68000-convergent
457 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
460 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
462 monitor) # CYGNUS LOCAL
463 basic_machine=m68k-rom68k
466 msdos) # CYGNUS LOCAL
467 basic_machine=i386-unknown
471 basic_machine=i486-ncr
475 basic_machine=i386-unknown # CYGNUS LOCAL
478 news | news700 | news800 | news900)
479 basic_machine=m68k-sony
483 basic_machine=m68030-sony
486 news-3600 | risc-news)
487 basic_machine=mips-sony
490 necv70) # CYGNUS LOCAL
491 basic_machine=v70-nec
495 basic_machine=m68k-next
508 basic_machine=m68k-harris
512 basic_machine=m88k-harris
516 basic_machine=i960-intel
520 basic_machine=np1-gould
522 OSE68000 | ose68000) # CYGNUS LOCAL
523 basic_machine=m68000-ericsson
526 os68k) # CYGNUS LOCAL
527 basic_machine=m68k-none
531 basic_machine=hppa1.1-hitachi
535 basic_machine=i860-intel
539 basic_machine=sparc-tti
542 basic_machine=m68k-tti
545 basic_machine=ns32k-pc532
548 # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
549 basic_machine=i586-intel
551 pentium-* | p5-* | p6-*)
552 # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
553 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
556 # We don't have specific support for AMD's K5 yet, so just call it a Pentium
557 basic_machine=i586-amd
560 # We don't have specific support for Nexgen yet, so just call it a Pentium
561 basic_machine=i586-nexgen
564 basic_machine=pn-gould
566 power) basic_machine=rs6000-ibm
568 ppc) basic_machine=powerpc-unknown
570 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
572 ppcle | powerpclittle | ppc-le | powerpc-little)
573 basic_machine=powerpcle-unknown
575 ppcle-* | powerpclittle-*)
576 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
579 basic_machine=i386-ibm
583 basic_machine=rce-unknown
588 rom68k) # CYGNUS LOCAL
589 basic_machine=m68k-rom68k
593 basic_machine=mips-siemens
596 basic_machine=romp-ibm
598 sa29200) # CYGNUS LOCAL
599 basic_machine=a29k-amd
603 basic_machine=i386-sequent
606 basic_machine=sh-hitachi
609 sparclite-wrs) # CYGNUS LOCAL
610 basic_machine=sparclite-wrs
613 sparcfrw) # CYGNUS LOCAL
614 basic_machine=sparcfrw-sun
617 sparcfrwcompat) # CYGNUS LOCAL
618 basic_machine=sparcfrwcompat-sun
621 sparclitefrw) # CYGNUS LOCAL
622 basic_machine=sparclitefrw-fujitsu
624 sparclitefrwcompat) # CYGNUS LOCAL
625 basic_machine=sparclitefrwcompat-fujitsu
628 basic_machine=m68k-bull
632 basic_machine=spur-unknown
634 st2000) # CYGNUS LOCAL
635 basic_machine=m68k-tandem
637 stratus) # CYGNUS LOCAL
638 basic_machine=i860-stratus
642 basic_machine=m68000-sun
645 basic_machine=m68000-sun
649 basic_machine=m68000-sun
653 basic_machine=m68k-sun
657 basic_machine=m68k-sun
661 basic_machine=sparc-sun
665 basic_machine=sparc-sun
669 basic_machine=sparc-sun
673 basic_machine=m68k-sun
676 basic_machine=sparc-sun
678 sun386 | sun386i | roadrunner)
679 basic_machine=i386-sun
682 basic_machine=i386-sequent
686 basic_machine=m68k-ncr
689 basic_machine=a29k-amd
693 basic_machine=a29k-nyu
696 v810 | necv810) # CYGNUS LOCAL
697 basic_machine=v810-nec
701 basic_machine=vax-dec
705 basic_machine=vax-dec
709 basic_machine=i960-wrs
713 basic_machine=m68k-wrs
716 vxworks29k) # CYGNUS LOCAL
717 basic_machine=a29k-wrs
721 basic_machine=w65-wdc
725 basic_machine=xmp-cray
729 basic_machine=xps100-honeywell
731 z8k-*-coff) # CYGNUS LOCAL
732 basic_machine=z8k-unknown
736 basic_machine=none-none
740 # Here we handle the default manufacturer of certain CPU types. It is in
741 # some cases the only manufacturer, in others, it is the most popular.
743 basic_machine=hppa1.1-winbond
745 op50n) # CYGNUS LOCAL
746 basic_machine=hppa1.1-oki
748 op60c) # CYGNUS LOCAL
749 basic_machine=hppa1.1-oki
752 basic_machine=mips-mips
755 basic_machine=romp-ibm
758 basic_machine=rs6000-ibm
761 basic_machine=vax-dec
764 basic_machine=pdp11-dec
767 basic_machine=we32k-att
770 basic_machine=sparc-sun
773 basic_machine=cydra-cydrome
776 basic_machine=orion-highlevel
779 basic_machine=clipper-highlevel
781 mac | mpw | mac-mpw) # CYGNUS LOCAL
782 basic_machine=m68k-apple
784 pmac | pmac-mpw) # CYGNUS LOCAL
785 basic_machine=powerpc-apple
788 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
793 # Here we canonicalize certain aliases for manufacturers.
794 case $basic_machine in
796 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
799 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
805 # Decode manufacturer-specific aliases for certain operating systems.
810 # -solaris* is a basic system type, with this one exception.
811 -solaris1 | -solaris1.*)
812 os=`echo $os | sed -e 's|solaris1|sunos4|'`
821 os=`echo $os | sed -e 's|gnu/linux|linux|'`
823 # First accept the basic system types.
824 # The portable systems comes first.
825 # Each alternative must end in a *, to match a version number.
826 # -sysv* is not here because it comes later, after sysvr4.
827 -gnu* | -bsd* | -mach* | -lites* | -minix* | -genix* | -ultrix* | -irix* \
828 | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \
829 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
830 | -amigados* | -msdos* | -moss* | -newsos* | -unicos* | -aos* \
831 | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
832 | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
833 | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* | -lites* \
834 | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
835 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta | -udi \
839 -go32 | -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
840 | -windows* | -osx | -abug | -netware* | -proelf | -os9* \
841 | -macos* | -mpw* | -magic* | -pe* | -win32)
843 -mac*) # CYGNUS LOCAL
844 os=`echo $os | sed -e 's|mac|macos|'`
847 os=`echo $os | sed -e 's|sunos5|solaris2|'`
850 os=`echo $os | sed -e 's|sunos6|solaris3|'`
867 -386bsd) # CYGNUS LOCAL
873 # Preserve the version number of sinix5.
875 os=`echo $os | sed -e 's|sinix|sysv|'`
895 # This must come after -sysvr4.
898 -ose*) # CYGNUS LOCAL
901 -es1800*) # CYGNUS LOCAL
910 # Get rid of the `-' at the beginning of $os.
911 os=`echo $os | sed 's/[^-]*-//'`
912 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
918 # Here we handle the default operating systems that come with various machines.
919 # The value should be what the vendor currently ships out the door with their
920 # machine or put another way, the most popular os provided with the machine.
922 # Note that if you're going to try to match "-MANUFACTURER" here (say,
923 # "-sun"), then you have to tell the case statement up towards the top
924 # that MANUFACTURER isn't an operating system. Otherwise, code above
925 # will signal an error saying that MANUFACTURER isn't an operating
926 # system, and we'll never get to this point.
928 case $basic_machine in
946 # This also exists in the configure program, but was not the
950 m68*-cisco) # CYGNUS LOCAL
953 mips*-cisco) # CYGNUS LOCAL
956 *-tti) # must be before sparc entry or we get the wrong os.
965 *-wec) # CYGNUS LOCAL
968 *-winbond) # CYGNUS LOCAL
971 *-oki) # CYGNUS LOCAL
980 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1031 *-rom68k) # CYGNUS LOCAL
1034 *-*bug) # CYGNUS LOCAL
1037 *-apple) # CYGNUS LOCAL
1046 # Here we handle the case where we know the os, and the CPU type, but not the
1047 # manufacturer. We pick the logical manufacturer.
1049 case $basic_machine in
1058 -bosx*) # CYGNUS LOCAL
1094 -hms*) # CYGNUS LOCAL
1097 -mpw* | -macos*) # CYGNUS LOCAL
1101 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1105 echo $basic_machine$os