2
# Configuration validation subroutine script.
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5
# Free Software Foundation, Inc.
2
# Configuration validation subroutine script, version 1.1.
3
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
9
4
# This file is (in principle) common to ALL GNU software.
10
5
# The presence of a machine in this file suggests that SOME GNU software
11
6
# can handle that machine. It does not imply ALL GNU software can.
23
18
# You should have received a copy of the GNU General Public License
24
19
# along with this program; if not, write to the Free Software
25
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
20
# Foundation, Inc., 59 Temple Place - Suite 330,
21
# Boston, MA 02111-1307, USA.
28
23
# As a special exception to the GNU General Public License, if you
29
24
# distribute this file as part of a program that contains a
30
25
# configuration script generated by Autoconf, you may include it under
31
26
# the same distribution terms that you use for the rest of that program.
34
# Please send patches to <config-patches@gnu.org>. Submit a context
35
# diff and a properly formatted ChangeLog entry.
37
28
# Configuration subroutine to validate and canonicalize a configuration type.
38
29
# Supply the specified configuration type as an argument.
39
30
# If it is invalid, we print an error message on stderr and exit with code 1.
54
45
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
55
46
# It is wrong to echo any other type of specification.
57
me=`echo "$0" | sed -e 's,.*/,,'`
60
Usage: $0 [OPTION] CPU-MFR-OPSYS
63
Canonicalize a configuration name.
66
-h, --help print this help, then exit
67
-t, --time-stamp print date of last modification, then exit
68
-v, --version print version number, then exit
70
Report bugs and patches to <config-patches@gnu.org>."
73
GNU config.sub ($timestamp)
75
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
76
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
78
This is free software; see the source for copying conditions. There is NO
79
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
82
Try \`$me --help' for more information."
85
while test $# -gt 0 ; do
87
--time-stamp | --time* | -t )
88
echo "$timestamp" ; exit ;;
90
echo "$version" ; exit ;;
92
echo "$usage"; exit ;;
93
-- ) # Stop option processing
95
- ) # Use stdin as input.
98
echo "$me: invalid option $1$help"
102
# First pass through any local machine types.
112
0) echo "$me: missing argument$help" >&2
115
*) echo "$me: too many arguments$help" >&2
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.
119
67
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
120
68
# Here we must recognize all the valid KERNEL-OS combinations.
121
69
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
123
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
124
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125
kopensolaris*-gnu* | \
126
storm-chaos* | os2-emx* | rtmk-nova*)
128
73
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
234
basic_machine=m68k-atari
239
148
# Decode aliases for certain CPU-COMPANY combinations.
240
149
case $basic_machine in
241
150
# Recognize the basic CPU types without company name.
242
151
# Some are omitted here because they have special meanings below.
245
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
246
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
248
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
251
| d10v | d30v | dlx | dsp16xx \
252
| fido | fr30 | frv \
253
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
254
| i370 | i860 | i960 | ia64 \
257
| m32c | m32r | m32rle | m68000 | m68k | m88k \
258
| maxq | mb | microblaze | mcore | mep | metag \
259
| mips | mipsbe | mipseb | mipsel | mipsle \
261
| mips64 | mips64el \
262
| mips64octeon | mips64octeonel \
263
| mips64orion | mips64orionel \
264
| mips64r5900 | mips64r5900el \
265
| mips64vr | mips64vrel \
266
| mips64vr4100 | mips64vr4100el \
267
| mips64vr4300 | mips64vr4300el \
268
| mips64vr5000 | mips64vr5000el \
269
| mips64vr5900 | mips64vr5900el \
270
| mipsisa32 | mipsisa32el \
271
| mipsisa32r2 | mipsisa32r2el \
272
| mipsisa64 | mipsisa64el \
273
| mipsisa64r2 | mipsisa64r2el \
274
| mipsisa64sb1 | mipsisa64sb1el \
275
| mipsisa64sr71k | mipsisa64sr71kel \
276
| mipstx39 | mipstx39el \
277
| mn10200 | mn10300 \
284
| pdp10 | pdp11 | pj | pjl \
285
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
288
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
290
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
291
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
293
| tahoe | thumb | tic4x | tic80 | tron \
296
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
298
basic_machine=$basic_machine-unknown
300
m6811 | m68hc11 | m6812 | m68hc12)
301
# Motorola 68HC11/12.
302
basic_machine=$basic_machine-unknown
305
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
308
basic_machine=mt-unknown
152
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
153
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
154
| 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
156
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
157
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
158
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
159
| mipstx39 | mipstx39el | armv[34][lb] \
160
| sparc | sparclet | sparclite | sparc64 | v850)
161
basic_machine=$basic_machine-unknown
311
163
# We use `pc' rather than `unknown'
312
164
# because (1) that's what they normally are, and
313
165
# (2) the word "unknown" tends to confuse beginning users.
315
167
basic_machine=$basic_machine-pc
317
169
# Object if more than one company name word.
322
174
# Recognize the basic CPU types with company name.
325
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
326
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
327
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
328
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
330
| bfin-* | bs2000-* \
331
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
332
| clipper-* | craynv-* | cydra-* \
333
| d10v-* | d30v-* | dlx-* \
335
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
336
| h8300-* | h8500-* \
337
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
338
| i*86-* | i860-* | i960-* | ia64-* \
339
| ip2k-* | iq2000-* \
341
| m32c-* | m32r-* | m32rle-* \
342
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
343
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
344
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
346
| mips64-* | mips64el-* \
347
| mips64octeon-* | mips64octeonel-* \
348
| mips64orion-* | mips64orionel-* \
349
| mips64r5900-* | mips64r5900el-* \
350
| mips64vr-* | mips64vrel-* \
351
| mips64vr4100-* | mips64vr4100el-* \
352
| mips64vr4300-* | mips64vr4300el-* \
353
| mips64vr5000-* | mips64vr5000el-* \
354
| mips64vr5900-* | mips64vr5900el-* \
355
| mipsisa32-* | mipsisa32el-* \
356
| mipsisa32r2-* | mipsisa32r2el-* \
357
| mipsisa64-* | mipsisa64el-* \
358
| mipsisa64r2-* | mipsisa64r2el-* \
359
| mipsisa64sb1-* | mipsisa64sb1el-* \
360
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
361
| mipstx39-* | mipstx39el-* \
366
| none-* | np1-* | ns16k-* | ns32k-* \
368
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
369
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
371
| romp-* | rs6000-* \
372
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
373
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
374
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
376
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
377
| tahoe-* | thumb-* \
378
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
380
| v850-* | v850e-* | vax-* \
382
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
383
| xstormy16-* | xtensa*-* \
387
# Recognize the basic CPU types without company name, with glob match.
389
basic_machine=$basic_machine-unknown
175
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
176
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
177
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
178
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
179
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
181
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
182
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
183
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
184
| sparc64-* | mips64-* | mipsel-* | armv[34][lb]-*\
185
| mips64el-* | mips64orion-* | mips64orionel-* \
186
| mipstx39-* | mipstx39el-* \
391
189
# Recognize the various machine names and aliases which stand
392
190
# for a CPU type and a company and sometimes even an OS.
394
basic_machine=i386-unknown
397
191
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
398
192
basic_machine=m68000-att
401
195
basic_machine=we32k-att
404
basic_machine=a29k-amd
408
basic_machine=abacus-unknown
411
basic_machine=m68010-adobe
415
198
basic_machine=fx80-alliant
625
332
basic_machine=m68k-hp
628
hp3k9[0-9][0-9] | hp9[0-9][0-9])
629
basic_machine=hppa1.0-hp
631
335
hp9k2[0-9][0-9] | hp9k31[0-9])
632
336
basic_machine=m68000-hp
635
339
basic_machine=m68k-hp
637
hp9k6[0-9][0-9] | hp6[0-9][0-9])
638
basic_machine=hppa1.0-hp
640
hp9k7[0-79][0-9] | hp7[0-79][0-9])
641
basic_machine=hppa1.1-hp
643
hp9k78[0-9] | hp78[0-9])
644
# FIXME: really hppa2.0-hp
645
basic_machine=hppa1.1-hp
647
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
648
# FIXME: really hppa2.0-hp
649
basic_machine=hppa1.1-hp
651
hp9k8[0-9][13679] | hp8[0-9][13679])
341
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
652
342
basic_machine=hppa1.1-hp
654
344
hp9k8[0-9][0-9] | hp8[0-9][0-9])
860
474
basic_machine=i860-intel
864
basic_machine=hppa-unknown
868
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
872
478
basic_machine=sparc-tti
875
481
basic_machine=m68k-tti
878
484
basic_machine=ns32k-pc532
881
basic_machine=i386-pc
884
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
886
pentium | p5 | k5 | k6 | nexgen | viac3)
486
pentium | p5 | k5 | nexen)
887
487
basic_machine=i586-pc
889
pentiumpro | p6 | 6x86 | athlon | athlon_*)
890
basic_machine=i686-pc
892
pentiumii | pentium2 | pentiumiii | pentium3)
893
basic_machine=i686-pc
489
pentiumpro | p6 | k6 | 6x86)
490
basic_machine=i686-pc
492
pentiumii | pentium2)
896
493
basic_machine=i786-pc
898
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
495
pentium-* | p5-* | k5-* | nexen-*)
899
496
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
901
pentiumpro-* | p6-* | 6x86-* | athlon-*)
902
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
904
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
905
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
498
pentiumpro-* | p6-* | k6-* | 6x86-*)
499
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
501
pentiumii-* | pentium2-*)
908
502
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
911
505
basic_machine=pn-gould
913
power) basic_machine=power-ibm
507
power) basic_machine=rs6000-ibm
915
509
ppc) basic_machine=powerpc-unknown
917
511
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
919
513
ppcle | powerpclittle | ppc-le | powerpc-little)
920
514
basic_machine=powerpcle-unknown
922
516
ppcle-* | powerpclittle-*)
923
517
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
925
ppc64) basic_machine=powerpc64-unknown
927
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
929
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
930
basic_machine=powerpc64le-unknown
932
ppc64le-* | powerpc64little-*)
933
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
936
520
basic_machine=i386-ibm
939
basic_machine=i586-unknown
943
basic_machine=i386-pc
947
basic_machine=m68k-rom68k
951
523
basic_machine=mips-siemens
954
526
basic_machine=romp-ibm
957
basic_machine=s390-ibm
960
basic_machine=s390x-ibm
963
basic_machine=a29k-amd
967
basic_machine=mipsisa64sb1-unknown
970
basic_machine=mipsisa64sb1el-unknown
973
basic_machine=mipsisa32-sde
977
basic_machine=mips-sei
981
529
basic_machine=i386-sequent
1167
638
# Here we handle the default manufacturer of certain CPU types. It is in
1168
639
# some cases the only manufacturer, in others, it is the most popular.
1170
basic_machine=hppa1.1-winbond
1173
basic_machine=hppa1.1-oki
1176
basic_machine=hppa1.1-oki
641
if [ x$os = x-linux-gnu ]; then
642
basic_machine=mips-unknown
644
basic_machine=mips-mips
1179
648
basic_machine=romp-ibm
1182
basic_machine=mmix-knuth
1185
651
basic_machine=rs6000-ibm
1188
654
basic_machine=vax-dec
1191
# there are many clones, so DEC is not a safe bet
1192
basic_machine=pdp10-unknown
1195
657
basic_machine=pdp11-dec
1198
660
basic_machine=we32k-att
1200
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1201
basic_machine=sh-unknown
1203
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1204
663
basic_machine=sparc-sun
1207
666
basic_machine=cydra-cydrome
1267
717
# Each alternative MUST END IN A *, to match a version number.
1268
718
# -sysv* is not here because it comes later, after sysvr4.
1269
719
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1270
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
720
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1271
721
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1273
722
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1275
724
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1276
725
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1277
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1278
| -openbsd* | -solidbsd* \
1279
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1280
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
726
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
727
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
1281
728
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1282
729
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1283
| -chorusos* | -chorusrdb* | -cegcc* \
1284
730
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1285
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1286
| -uxpv* | -beos* | -mpeix* | -udk* \
1287
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1288
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1289
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1290
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1291
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1292
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1293
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
731
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -rhapsody* \
732
| -openstep* | -mpeix* | -oskit*)
1294
733
# Remember, each alternative MUST END IN *, to match a version number.
1297
case $basic_machine in
1308
os=`echo $os | sed -e 's|nto|nto-qnx|'`
1310
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1311
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1312
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1315
os=`echo $os | sed -e 's|mac|macos|'`
1321
736
os=`echo $os | sed -e 's|linux|linux-gnu|'`