2
2
# Configuration validation subroutine script.
3
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5
# 2011 Free Software Foundation, Inc.
8
9
# This file is (in principle) common to ALL GNU software.
9
10
# The presence of a machine in this file suggests that SOME GNU software
33
34
# Please send patches to <config-patches@gnu.org>. Submit a context
34
# diff and a properly formatted ChangeLog entry.
35
# diff and a properly formatted GNU ChangeLog entry.
36
37
# Configuration subroutine to validate and canonicalize a configuration type.
37
38
# Supply the specified configuration type as an argument.
38
39
# If it is invalid, we print an error message on stderr and exit with code 1.
39
40
# Otherwise, we print the canonical config type on stdout and succeed.
42
# You can get the latest version of this script from:
43
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
41
45
# This file is supposed to be the same for all GNU packages
42
46
# and recognize all the CPU types, system types and aliases
43
47
# that are meaningful with *any* GNU software.
72
76
GNU config.sub ($timestamp)
74
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
75
Free Software Foundation, Inc.
78
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
80
Software Foundation, Inc.
77
82
This is free software; see the source for copying conditions. There is NO
78
83
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
119
124
# Here we must recognize all the valid KERNEL-OS combinations.
120
125
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
121
126
case $maybe_os in
122
nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
123
kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
127
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128
linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129
knetbsd*-gnu* | netbsd*-gnu* | \
130
kopensolaris*-gnu* | \
131
storm-chaos* | os2-emx* | rtmk-nova*)
125
133
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
146
154
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
147
155
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
148
156
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
149
-apple | -axis | -knuth | -cray)
157
-apple | -axis | -knuth | -cray | -microblaze)
153
164
-sim | -cisco | -oki | -wec | -winbond)
187
202
# Don't forget version if it is 3.2v4 or newer.
188
203
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206
# Don't forget version if it is 3.2v4 or newer.
207
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
192
211
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
231
250
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
232
251
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
234
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
253
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
236
255
| c4x | clipper \
237
256
| d10v | d30v | dlx | dsp16xx \
257
| fido | fr30 | frv \
239
258
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
240
259
| i370 | i860 | i960 | ia64 \
241
260
| ip2k | iq2000 \
242
| m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
262
| m32c | m32r | m32rle | m68000 | m68k | m88k \
263
| maxq | mb | microblaze | mcore | mep | metag \
243
264
| mips | mipsbe | mipseb | mipsel | mipsle \
245
266
| mips64 | mips64el \
267
| mips64octeon | mips64octeonel \
268
| mips64orion | mips64orionel \
269
| mips64r5900 | mips64r5900el \
246
270
| mips64vr | mips64vrel \
247
| mips64orion | mips64orionel \
248
271
| mips64vr4100 | mips64vr4100el \
249
272
| mips64vr4300 | mips64vr4300el \
250
273
| mips64vr5000 | mips64vr5000el \
257
280
| mipsisa64sr71k | mipsisa64sr71kel \
258
281
| mipstx39 | mipstx39el \
259
282
| mn10200 | mn10300 \
286
| nds32 | nds32le | nds32be \
262
288
| ns16k | ns32k \
264
291
| pdp10 | pdp11 | pj | pjl \
265
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
292
| powerpc | powerpc64 | powerpc64le | powerpcle \
267
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
296
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
268
297
| sh64 | sh64le \
269
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
270
| sparcv8 | sparcv9 | sparcv9b \
272
| tahoe | thumb | tic4x | tic80 | tron \
298
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
299
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
301
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
303
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
275
| x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
277
basic_machine=$basic_machine-unknown
280
basic_machine=$basic_machine-unknown
282
m6811 | m68hc11 | m6812 | m68hc12)
305
| x86 | xc16x | xstormy16 | xtensa \
307
basic_machine=$basic_machine-unknown
310
basic_machine=tic54x-unknown
313
basic_machine=tic55x-unknown
316
basic_machine=tic6x-unknown
318
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
283
319
# Motorola 68HC11/12.
284
320
basic_machine=$basic_machine-unknown
287
323
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
326
basic_machine=mt-unknown
329
strongarm | thumb | xscale)
330
basic_machine=arm-unknown
334
basic_machine=armeb-unknown
338
basic_machine=armel-unknown
290
341
# We use `pc' rather than `unknown'
291
342
# because (1) that's what they normally are, and
305
356
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
306
357
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
307
358
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
309
360
| bfin-* | bs2000-* \
310
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
361
| c[123]* | c30-* | [cjt]90-* | c4x-* \
311
362
| clipper-* | craynv-* | cydra-* \
312
363
| d10v-* | d30v-* | dlx-* \
314
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
365
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
315
366
| h8300-* | h8500-* \
316
367
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
317
368
| i*86-* | i860-* | i960-* | ia64-* \
318
369
| ip2k-* | iq2000-* \
319
| m32r-* | m32rle-* \
371
| m32c-* | m32r-* | m32rle-* \
320
372
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
321
| m88110-* | m88k-* | maxq-* | mcore-* \
373
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
322
374
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
324
376
| mips64-* | mips64el-* \
377
| mips64octeon-* | mips64octeonel-* \
378
| mips64orion-* | mips64orionel-* \
379
| mips64r5900-* | mips64r5900el-* \
325
380
| mips64vr-* | mips64vrel-* \
326
| mips64orion-* | mips64orionel-* \
327
381
| mips64vr4100-* | mips64vr4100el-* \
328
382
| mips64vr4300-* | mips64vr4300el-* \
329
383
| mips64vr5000-* | mips64vr5000el-* \
336
390
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
337
391
| mipstx39-* | mipstx39el-* \
395
| nds32-* | nds32le-* | nds32be-* \
341
397
| none-* | np1-* | ns16k-* | ns32k-* \
343
400
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
344
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
401
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
346
| romp-* | rs6000-* \
347
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
403
| romp-* | rs6000-* | rx-* \
404
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
348
405
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
349
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
406
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
351
| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
352
| tahoe-* | thumb-* \
408
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
353
410
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
355
| v850-* | v850e-* | vax-* \
414
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
357
| x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
358
| xstormy16-* | xtensa-* \
417
| x86-* | x86_64-* | xc16x-* | xps100-* \
418
| xstormy16-* | xtensa*-* \
422
# Recognize the basic CPU types without company name, with glob match.
424
basic_machine=$basic_machine-unknown
364
426
# Recognize the various machine names and aliases which stand
365
427
# for a CPU type and a company and sometimes even an OS.
431
497
basic_machine=ns32k-sequent
501
basic_machine=bfin-unknown
505
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
509
basic_machine=powerpc-ibm
513
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
516
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
519
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
435
522
basic_machine=c90-cray
526
basic_machine=arm-unknown
439
530
basic_machine=c1-convex
833
966
power) basic_machine=power-ibm
835
ppc) basic_machine=powerpc-unknown
968
ppc | ppcbe) basic_machine=powerpc-unknown
837
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
971
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
839
973
ppcle | powerpclittle | ppc-le | powerpc-little)
840
974
basic_machine=powerpcle-unknown
973
1121
basic_machine=t90-cray
977
basic_machine=tic54x-unknown
981
basic_machine=tic55x-unknown
985
basic_machine=tic6x-unknown
1125
basic_machine=$basic_machine-unknown
989
1129
basic_machine=mipstx39-unknown
1099
1246
basic_machine=we32k-att
1101
sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1248
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1102
1249
basic_machine=sh-unknown
1104
sparc | sparcv8 | sparcv9 | sparcv9b)
1251
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1105
1252
basic_machine=sparc-sun
1145
1292
if [ x"$os" != x"" ]
1148
# First match some system type aliases
1149
# that might get confused with valid system types.
1295
# First match some system type aliases
1296
# that might get confused with valid system types.
1150
1297
# -solaris* is a basic system type, with this one exception.
1151
1301
-solaris1 | -solaris1.*)
1152
1302
os=`echo $os | sed -e 's|solaris1|sunos4|'`
1168
1318
# Each alternative MUST END IN A *, to match a version number.
1169
1319
# -sysv* is not here because it comes later, after sysvr4.
1170
1320
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1171
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1172
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1321
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1322
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1323
| -sym* | -kopensolaris* \
1173
1324
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1175
1326
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1176
1327
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1177
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
1328
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1329
| -openbsd* | -solidbsd* \
1178
1330
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1179
1331
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1180
1332
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1181
1333
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1182
| -chorusos* | -chorusrdb* \
1334
| -chorusos* | -chorusrdb* | -cegcc* \
1183
1335
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1184
| -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
1336
| -mingw32* | -linux-gnu* | -linux-android* \
1337
| -linux-newlib* | -linux-uclibc* \
1338
| -uxpv* | -beos* | -mpeix* | -udk* \
1185
1339
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1186
1340
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1187
1341
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1188
1342
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1189
1343
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1190
1344
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1191
| -skyos* | -haiku*)
1345
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1192
1346
# Remember, each alternative MUST END IN *, to match a version number.