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
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 # or in some cases, the newer four-part form:
45 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
46 # It is wrong to echo any other type of specification.
50 echo Configuration name missing. 1>&2
51 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
52 echo "or $0 ALIAS" 1>&2
53 echo where ALIAS is a recognized configuration type. 1>&2
57 # First pass through any local machine types.
67 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
68 # Here we must recognize all the valid KERNEL-OS combinations.
69 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
73 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
76 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
77 if [ $basic_machine != $1 ]
78 then os=`echo $1 | sed 's/.*-/-/'`
83 ### Let's recognize common machines as not being operating systems so
84 ### that things like config.sub decstation-3100 work. We also
85 ### recognize some manufacturers as not being operating systems, so we
86 ### can provide default operating systems below.
89 # Prevent following clause from handling this invalid input.
91 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
92 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
93 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
94 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
95 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
96 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
101 -sim | -cisco | -oki | -wec | -winbond ) # CYGNUS LOCAL
105 -scout) # CYGNUS LOCAL
116 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
120 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
123 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
124 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
127 # Don't forget version if it is 3.2v4 or newer.
128 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
132 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
136 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
139 basic_machine=clipper-intergraph
142 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
148 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
151 os=`echo $os | sed -e 's/windowsnt/winnt/'`
158 # Decode aliases for certain CPU-COMPANY combinations.
159 case $basic_machine in
160 # Recognize the basic CPU types without company name.
161 # Some are omitted here because they have special meanings below.
162 tahoe | i860 | m68k | m68000 | m88k | ns32k | arm \
163 | arme[lb] | pyramid \
164 | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
165 | alpha | we32k | ns16k | clipper | i370 | sh \
166 | powerpc | powerpcle | 1750a | dsp16xx | mips64 | mipsel \
167 | pdp11 | mips64el | mips64orion | mips64orionel \
168 | sparc | sparclet | sparclite | sparc64)
169 basic_machine=$basic_machine-unknown
171 m88110 | m680[01234]0 | m683?2 | m68360 | z8k | v70 | h8500 | w65) # CYGNUS LOCAL
172 basic_machine=$basic_machine-unknown
174 mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith/vr4300
175 basic_machine=$basic_machine-unknown
177 mips64vr4100 | mips64vr4100el) # CYGNUS LOCAL jsmith/vr4100
178 basic_machine=$basic_machine-unknown
180 mips64vr5000 | mips64vr5000el) # CYGNUS LOCAL ian/vr5000
181 basic_machine=$basic_machine-unknown
183 mips16) # CYGNUS LOCAL krk/mips16
184 basic_machine=$basic_machine-unknown
188 basic_machine=$basic_machine-unknown
191 basic_machine=$basic_machine-unknown
194 # start-sanitize-v850
195 v850) # CYGNUS LOCAL jtc/v850
196 basic_machine=$basic_machine-unknown
199 # start-sanitize-d10v
200 d10v) # CYGNUS LOCAL meissner/d10v
201 basic_machine=$basic_machine-unknown
204 # start-sanitize-m32r
206 basic_machine=$basic_machine-unknown
209 mn10200) # CYGNUS LOCAL
210 basic_machine=$basic_machine-unknown
212 mn10300) # CYGNUS LOCAL
213 basic_machine=$basic_machine-unknown
215 # We use `pc' rather than `unknown'
216 # because (1) that's what they normally are, and
217 # (2) the word "unknown" tends to confuse beginning users.
219 basic_machine=$basic_machine-pc
221 # Object if more than one company name word.
223 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
226 # Recognize the basic CPU types with company name.
227 vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
228 | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
229 | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
230 | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
231 | hppa-* | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
232 | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
233 | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
234 | mips64el-* | mips64orion-* | mips64orionel-* | f301-*)
236 m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | v850-* | d10v-*) # CYGNUS LOCAL
238 mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith/vr4300
240 mips64vr4100-* | mips64vr4100el-*) # CYGNUS LOCAL jsmith/vr4100
242 mips16-*) # CYGNUS LOCAL krk/mips16
244 # Recognize the various machine names and aliases which stand
245 # for a CPU type and a company and sometimes even an OS.
246 386bsd) # CYGNUS LOCAL
247 basic_machine=i386-unknown
250 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
251 basic_machine=m68000-att
254 basic_machine=we32k-att
256 a29khif) # CYGNUS LOCAL
257 basic_machine=a29k-amd
260 adobe68k) # CYGNUS LOCAL
261 basic_machine=m68010-adobe
265 basic_machine=fx80-alliant
268 basic_machine=m68k-altos
271 basic_machine=a29k-none
275 basic_machine=580-amdahl
279 basic_machine=m68k-cbm
282 basic_machine=m68k-cbm
286 basic_machine=m68k-cbm
290 basic_machine=m68k-apollo
293 apollo68bsd) # CYGNUS LOCAL
294 basic_machine=m68k-apollo
299 basic_machine=arc-unknown
301 arc-*) # CYGNUS LOCAL
305 basic_machine=m68k-apple
309 basic_machine=ns32k-sequent
313 basic_machine=c1-convex
317 basic_machine=c2-convex
321 basic_machine=c32-convex
325 basic_machine=c34-convex
329 basic_machine=c38-convex
333 basic_machine=ymp-cray
337 basic_machine=cray2-cray
341 basic_machine=c90-cray
345 basic_machine=m68k-crds
348 basic_machine=m68k-da30
350 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
351 basic_machine=mips-dec
353 delta | 3300 | motorola-3300 | motorola-delta \
354 | 3300-motorola | delta-motorola)
355 basic_machine=m68k-motorola
358 basic_machine=m88k-motorola
362 basic_machine=rs6000-bull
366 basic_machine=m68k-bull
370 basic_machine=a29k-amd
374 basic_machine=elxsi-elxsi
377 encore | umax | mmax)
378 basic_machine=ns32k-encore
380 es1800 | OSE68k | ose68k | ose | OSE) # CYGNUS LOCAL
381 basic_machine=m68k-ericsson
385 basic_machine=i860-alliant
388 basic_machine=ns32k-ns
391 basic_machine=tron-gmicro
395 basic_machine=hppa1.1-hitachi
399 basic_machine=h8300-hitachi
402 h8300xray) # CYGNUS LOCAL
403 basic_machine=h8300-hitachi
406 h8500hms) # CYGNUS LOCAL
407 basic_machine=h8500-hitachi
411 basic_machine=m88k-harris
415 basic_machine=m68k-hp
418 basic_machine=m68k-hp
422 basic_machine=m68k-hp
425 w89k-*) # CYGNUS LOCAL
426 basic_machine=hppa1.1-winbond
429 op50n-*) # CYGNUS LOCAL
430 basic_machine=hppa1.1-oki
433 op60c-*) # CYGNUS LOCAL
434 basic_machine=hppa1.1-oki
437 hppro) # CYGNUS LOCAL
438 basic_machine=hppa1.1-hp
441 hp9k2[0-9][0-9] | hp9k31[0-9])
442 basic_machine=m68000-hp
445 basic_machine=m68k-hp
447 hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
448 basic_machine=hppa1.1-hp
450 hp9k8[0-9][0-9] | hp8[0-9][0-9])
451 basic_machine=hppa1.0-hp
456 hppaosf) # CYGNUS LOCAL
457 basic_machine=hppa1.1-hp
461 basic_machine=i370-ibm
464 # I'm not sure what "Sysv32" means. Should this be sysv3.2?
466 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
470 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
474 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
478 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
481 i386mach) # CYGNUS LOCAL
482 basic_machine=i386-mach
485 i386-vsta | vsta) # CYGNUS LOCAL
486 basic_machine=i386-unknown
489 i386-go32 | go32) # CYGNUS LOCAL
490 basic_machine=i386-unknown
494 basic_machine=mips-sgi
504 basic_machine=m68k-isi
508 basic_machine=m88k-omron
511 basic_machine=mips-mips
515 basic_machine=ns32k-utek
519 basic_machine=m68000-convergent
522 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
525 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
527 monitor) # CYGNUS LOCAL
528 basic_machine=m68k-rom68k
531 msdos) # CYGNUS LOCAL
532 basic_machine=i386-unknown
536 basic_machine=i486-ncr
540 basic_machine=i386-unknown # CYGNUS LOCAL
543 news | news700 | news800 | news900)
544 basic_machine=m68k-sony
548 basic_machine=m68030-sony
551 news-3600 | risc-news)
552 basic_machine=mips-sony
555 necv70) # CYGNUS LOCAL
556 basic_machine=v70-nec
560 basic_machine=m68k-next
573 basic_machine=m68k-harris
577 basic_machine=m88k-harris
581 basic_machine=i960-intel
584 mon960) # CYGNUS LOCAL
585 basic_machine=i960-intel
589 basic_machine=np1-gould
591 OSE68000 | ose68000) # CYGNUS LOCAL
592 basic_machine=m68000-ericsson
595 os68k) # CYGNUS LOCAL
596 basic_machine=m68k-none
600 basic_machine=hppa1.1-hitachi
604 basic_machine=i860-intel
608 basic_machine=sparc-tti
611 basic_machine=m68k-tti
614 basic_machine=ns32k-pc532
617 basic_machine=i586-intel
620 basic_machine=i686-intel
623 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
626 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
629 # We don't have specific support for AMD's K5 yet, so just call it a Pentium
630 basic_machine=i586-amd
633 # We don't have specific support for Nexgen yet, so just call it a Pentium
634 basic_machine=i586-nexgen
637 basic_machine=pn-gould
639 power) basic_machine=rs6000-ibm
641 ppc) basic_machine=powerpc-unknown
643 ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
645 ppcle | powerpclittle | ppc-le | powerpc-little)
646 basic_machine=powerpcle-unknown
648 ppcle-* | powerpclittle-*)
649 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
652 basic_machine=i386-ibm
654 rom68k) # CYGNUS LOCAL
655 basic_machine=m68k-rom68k
659 basic_machine=mips-siemens
662 basic_machine=romp-ibm
664 sa29200) # CYGNUS LOCAL
665 basic_machine=a29k-amd
669 basic_machine=i386-sequent
672 basic_machine=sh-hitachi
675 sparclite-wrs) # CYGNUS LOCAL
676 basic_machine=sparclite-wrs
680 basic_machine=m68k-bull
684 basic_machine=spur-unknown
686 st2000) # CYGNUS LOCAL
687 basic_machine=m68k-tandem
689 stratus) # CYGNUS LOCAL
690 basic_machine=i860-stratus
694 basic_machine=m68000-sun
697 basic_machine=m68000-sun
701 basic_machine=m68000-sun
705 basic_machine=m68k-sun
709 basic_machine=m68k-sun
713 basic_machine=sparc-sun
717 basic_machine=sparc-sun
721 basic_machine=sparc-sun
725 basic_machine=m68k-sun
728 basic_machine=sparc-sun
730 sun386 | sun386i | roadrunner)
731 basic_machine=i386-sun
734 basic_machine=i386-sequent
738 basic_machine=m68k-ncr
741 basic_machine=a29k-amd
745 basic_machine=a29k-nyu
748 v810 | necv810) # CYGNUS LOCAL
749 basic_machine=v810-nec
753 basic_machine=vax-dec
757 basic_machine=vax-dec
761 basic_machine=f301-fujitsu
764 basic_machine=i960-wrs
768 basic_machine=m68k-wrs
772 basic_machine=a29k-wrs
776 basic_machine=w65-wdc
780 basic_machine=xmp-cray
784 basic_machine=xps100-honeywell
786 z8k-*-coff) # CYGNUS LOCAL
787 basic_machine=z8k-unknown
791 basic_machine=none-none
795 # Here we handle the default manufacturer of certain CPU types. It is in
796 # some cases the only manufacturer, in others, it is the most popular.
798 basic_machine=hppa1.1-winbond
800 op50n) # CYGNUS LOCAL
801 basic_machine=hppa1.1-oki
803 op60c) # CYGNUS LOCAL
804 basic_machine=hppa1.1-oki
807 basic_machine=mips-mips
810 basic_machine=romp-ibm
813 basic_machine=rs6000-ibm
816 basic_machine=vax-dec
819 basic_machine=pdp11-dec
822 basic_machine=we32k-att
825 basic_machine=sparc-sun
828 basic_machine=cydra-cydrome
831 basic_machine=orion-highlevel
834 basic_machine=clipper-highlevel
836 mac | mpw | mac-mpw) # CYGNUS LOCAL
837 basic_machine=m68k-apple
839 pmac | pmac-mpw) # CYGNUS LOCAL
840 basic_machine=powerpc-apple
843 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
848 # Here we canonicalize certain aliases for manufacturers.
849 case $basic_machine in
851 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
854 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
860 # Decode manufacturer-specific aliases for certain operating systems.
865 # First match some system type aliases
866 # that might get confused with valid system types.
867 # -solaris* is a basic system type, with this one exception.
868 -solaris1 | -solaris1.*)
869 os=`echo $os | sed -e 's|solaris1|sunos4|'`
878 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
880 # First accept the basic system types.
881 # The portable systems comes first.
882 # Each alternative MUST END IN A *, to match a version number.
883 # -sysv* is not here because it comes later, after sysvr4.
884 -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
885 | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
886 | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
887 | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
888 | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
889 | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
890 | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
891 | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
892 | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
893 | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
894 | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
895 | -linux-gnu* | -uxpv*)
896 # Remember, each alternative MUST END IN *, to match a version number.
899 -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
900 | -windows* | -osx | -abug | -netware* | -os9* \
901 | -macos* | -mpw* | -magic* | -mon960*)
904 os=`echo $os | sed -e 's|mac|macos|'`
908 os=`echo $os | sed -e 's|linux|linux-gnu|'`
911 os=`echo $os | sed -e 's|sunos5|solaris2|'`
914 os=`echo $os | sed -e 's|sunos6|solaris3|'`
931 -386bsd) # CYGNUS LOCAL
940 # Preserve the version number of sinix5.
942 os=`echo $os | sed -e 's|sinix|sysv|'`
962 # This must come after -sysvr4.
965 -ose*) # CYGNUS LOCAL
968 -es1800*) # CYGNUS LOCAL
977 # Get rid of the `-' at the beginning of $os.
978 os=`echo $os | sed 's/[^-]*-//'`
979 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
985 # Here we handle the default operating systems that come with various machines.
986 # The value should be what the vendor currently ships out the door with their
987 # machine or put another way, the most popular os provided with the machine.
989 # Note that if you're going to try to match "-MANUFACTURER" here (say,
990 # "-sun"), then you have to tell the case statement up towards the top
991 # that MANUFACTURER isn't an operating system. Otherwise, code above
992 # will signal an error saying that MANUFACTURER isn't an operating
993 # system, and we'll never get to this point.
995 case $basic_machine in
1016 # This also exists in the configure program, but was not the
1020 m68*-cisco) # CYGNUS LOCAL
1023 mips*-cisco) # CYGNUS LOCAL
1026 *-tti) # must be before sparc entry or we get the wrong os.
1035 *-wec) # CYGNUS LOCAL
1038 *-winbond) # CYGNUS LOCAL
1041 *-oki) # CYGNUS LOCAL
1050 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1107 *-rom68k) # CYGNUS LOCAL
1110 *-*bug) # CYGNUS LOCAL
1113 *-apple) # CYGNUS LOCAL
1122 # Here we handle the case where we know the os, and the CPU type, but not the
1123 # manufacturer. We pick the logical manufacturer.
1125 case $basic_machine in
1161 -vxsim* | -vxworks*)
1167 -hms*) # CYGNUS LOCAL
1170 -mpw* | -macos*) # CYGNUS LOCAL
1174 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1178 echo $basic_machine$os