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, 2006 Free Software Foundation,
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5
# 2011, 2012 Free Software Foundation, Inc.
9
9
# This file is (in principle) common to ALL GNU software.
10
10
# The presence of a machine in this file suggests that SOME GNU software
13
13
# This file is free software; you can redistribute it and/or modify
14
14
# it under the terms of the GNU General Public License as published by
15
# the Free Software Foundation; either version 3 of the License, or
15
# the Free Software Foundation; either version 2 of the License, or
16
16
# (at your option) any later version.
18
18
# This program is distributed in the hope that it will be useful,
21
21
# GNU General Public License for more details.
23
23
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, write to the Free Software
25
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
24
# along with this program; if not, see <http://www.gnu.org/licenses/>.
28
26
# As a special exception to the GNU General Public License, if you
29
27
# distribute this file as part of a program that contains a
34
32
# Please send patches to <config-patches@gnu.org>. Submit a context
35
# diff and a properly formatted ChangeLog entry.
33
# diff and a properly formatted GNU ChangeLog entry.
37
35
# Configuration subroutine to validate and canonicalize a configuration type.
38
36
# Supply the specified configuration type as an argument.
39
37
# If it is invalid, we print an error message on stderr and exit with code 1.
40
38
# Otherwise, we print the canonical config type on stdout and succeed.
40
# You can get the latest version of this script from:
41
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
42
43
# This file is supposed to be the same for all GNU packages
43
44
# and recognize all the CPU types, system types and aliases
44
45
# that are meaningful with *any* GNU software.
73
74
GNU config.sub ($timestamp)
75
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
76
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
77
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
76
78
Free Software Foundation, Inc.
78
80
This is free software; see the source for copying conditions. There is NO
120
122
# Here we must recognize all the valid KERNEL-OS combinations.
121
123
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
122
124
case $maybe_os in
123
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
124
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
126
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
127
knetbsd*-gnu* | netbsd*-gnu* | \
128
kopensolaris*-gnu* | \
125
129
storm-chaos* | os2-emx* | rtmk-nova*)
127
131
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
135
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
130
138
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131
139
if [ $basic_machine != $1 ]
148
156
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149
157
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150
158
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151
-apple | -axis | -knuth | -cray)
159
-apple | -axis | -knuth | -cray | -microblaze)
155
166
-sim | -cisco | -oki | -wec | -winbond)
238
255
# Some are omitted here because they have special meanings below.
258
| aarch64 | aarch64_be \
241
259
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
242
260
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
244
262
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
246
265
| c4x | clipper \
247
266
| d10v | d30v | dlx | dsp16xx \
268
| fido | fr30 | frv \
249
269
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
250
271
| i370 | i860 | i960 | ia64 \
251
272
| ip2k | iq2000 \
252
275
| m32c | m32r | m32rle | m68000 | m68k | m88k \
253
| maxq | mb | microblaze | mcore \
276
| maxq | mb | microblaze | mcore | mep | metag \
254
277
| mips | mipsbe | mipseb | mipsel | mipsle \
256
279
| mips64 | mips64el \
280
| mips64octeon | mips64octeonel \
281
| mips64orion | mips64orionel \
282
| mips64r5900 | mips64r5900el \
257
283
| mips64vr | mips64vrel \
258
| mips64orion | mips64orionel \
259
284
| mips64vr4100 | mips64vr4100el \
260
285
| mips64vr4300 | mips64vr4300el \
261
286
| mips64vr5000 | mips64vr5000el \
268
293
| mipsisa64sr71k | mipsisa64sr71kel \
269
294
| mipstx39 | mipstx39el \
270
295
| mn10200 | mn10300 \
299
| nds32 | nds32le | nds32be \
274
301
| ns16k | ns32k \
276
304
| pdp10 | pdp11 | pj | pjl \
277
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
305
| powerpc | powerpc64 | powerpc64le | powerpcle \
280
| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
309
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
281
310
| sh64 | sh64le \
282
311
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
283
312
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
285
| tahoe | thumb | tic4x | tic80 | tron \
314
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
316
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
288
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
318
| x86 | xc16x | xstormy16 | xtensa \
290
320
basic_machine=$basic_machine-unknown
292
m6811 | m68hc11 | m6812 | m68hc12)
293
# Motorola 68HC11/12.
323
basic_machine=tic54x-unknown
326
basic_machine=tic55x-unknown
329
basic_machine=tic6x-unknown
331
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
294
332
basic_machine=$basic_machine-unknown
300
338
basic_machine=mt-unknown
341
strongarm | thumb | xscale)
342
basic_machine=arm-unknown
345
basic_machine=$basic_machine-unknown
349
basic_machine=armeb-unknown
353
basic_machine=armel-unknown
303
356
# We use `pc' rather than `unknown'
304
357
# because (1) that's what they normally are, and
305
358
# (2) the word "unknown" tends to confuse beginning users.
314
367
# Recognize the basic CPU types with company name.
370
| aarch64-* | aarch64_be-* \
317
371
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
318
372
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
319
373
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
320
374
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
321
375
| avr-* | avr32-* \
322
377
| bfin-* | bs2000-* \
323
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
378
| c[123]* | c30-* | [cjt]90-* | c4x-* \
324
379
| clipper-* | craynv-* | cydra-* \
325
380
| d10v-* | d30v-* | dlx-* \
327
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
382
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
328
383
| h8300-* | h8500-* \
329
384
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
330
386
| i*86-* | i860-* | i960-* | ia64-* \
331
387
| ip2k-* | iq2000-* \
332
390
| m32c-* | m32r-* | m32rle-* \
333
391
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
334
| m88110-* | m88k-* | maxq-* | mcore-* \
392
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
335
393
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
337
395
| mips64-* | mips64el-* \
396
| mips64octeon-* | mips64octeonel-* \
397
| mips64orion-* | mips64orionel-* \
398
| mips64r5900-* | mips64r5900el-* \
338
399
| mips64vr-* | mips64vrel-* \
339
| mips64orion-* | mips64orionel-* \
340
400
| mips64vr4100-* | mips64vr4100el-* \
341
401
| mips64vr4300-* | mips64vr4300el-* \
342
402
| mips64vr5000-* | mips64vr5000el-* \
414
| nds32-* | nds32le-* | nds32be-* \
354
415
| nios-* | nios2-* \
355
416
| none-* | np1-* | ns16k-* | ns32k-* \
357
419
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
358
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
420
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
360
| romp-* | rs6000-* \
361
| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
422
| rl78-* | romp-* | rs6000-* | rx-* \
423
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
362
424
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
363
425
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
365
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
366
| tahoe-* | thumb-* \
427
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
367
429
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
369
| v850-* | v850e-* | vax-* \
433
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
371
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
372
| xstormy16-* | xtensa-* \
436
| x86-* | x86_64-* | xc16x-* | xps100-* \
437
| xstormy16-* | xtensa*-* \
441
# Recognize the basic CPU types without company name, with glob match.
443
basic_machine=$basic_machine-unknown
376
445
# Recognize the various machine names and aliases which stand
377
446
# for a CPU type and a company and sometimes even an OS.
443
516
basic_machine=ns32k-sequent
520
basic_machine=bfin-unknown
524
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
528
basic_machine=powerpc-ibm
532
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
535
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
538
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
447
541
basic_machine=c90-cray
545
basic_machine=arm-unknown
451
549
basic_machine=c1-convex
854
996
power) basic_machine=power-ibm
856
ppc) basic_machine=powerpc-unknown
998
ppc | ppcbe) basic_machine=powerpc-unknown
858
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1001
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
860
1003
ppcle | powerpclittle | ppc-le | powerpc-little)
861
1004
basic_machine=powerpcle-unknown
1002
1151
basic_machine=t90-cray
1006
basic_machine=tic54x-unknown
1010
basic_machine=tic55x-unknown
1014
basic_machine=tic6x-unknown
1155
basic_machine=$basic_machine-unknown
1018
1159
basic_machine=mipstx39-unknown
1174
1322
if [ x"$os" != x"" ]
1177
# First match some system type aliases
1178
# that might get confused with valid system types.
1325
# First match some system type aliases
1326
# that might get confused with valid system types.
1179
1327
# -solaris* is a basic system type, with this one exception.
1180
1331
-solaris1 | -solaris1.*)
1181
1332
os=`echo $os | sed -e 's|solaris1|sunos4|'`
1197
1348
# Each alternative MUST END IN A *, to match a version number.
1198
1349
# -sysv* is not here because it comes later, after sysvr4.
1199
1350
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1200
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1201
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1351
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1352
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1353
| -sym* | -kopensolaris* \
1202
1354
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1204
1356
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1205
1357
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1206
1358
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1207
| -openbsd* | -solidbsd* \
1359
| -bitrig* | -openbsd* | -solidbsd* \
1208
1360
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1209
1361
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1210
1362
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1211
1363
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1212
| -chorusos* | -chorusrdb* \
1213
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1214
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1364
| -chorusos* | -chorusrdb* | -cegcc* \
1365
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1366
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1367
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
1215
1368
| -uxpv* | -beos* | -mpeix* | -udk* \
1216
1369
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1217
1370
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1219
1372
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1220
1373
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1221
1374
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1222
| -skyos* | -haiku* | -rdos* | -toppers*)
1375
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1223
1376
# Remember, each alternative MUST END IN *, to match a version number.