Force generation of substitute .h file when C++ support is enabled.
[gnulib.git] / build-aux / config.sub
blob52eb02e29a259e46c91bfad15264ff1b6ae3599d
1 #! /bin/sh
2 # Configuration validation subroutine script.
3 # Copyright 1992-2018 Free Software Foundation, Inc.
5 timestamp='2018-07-25'
7 # This file is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, see <https://www.gnu.org/licenses/>.
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that
24 # program. This Exception is an additional permission under section 7
25 # of the GNU General Public License, version 3 ("GPLv3").
28 # Please send patches to <config-patches@gnu.org>.
30 # Configuration subroutine to validate and canonicalize a configuration type.
31 # Supply the specified configuration type as an argument.
32 # If it is invalid, we print an error message on stderr and exit with code 1.
33 # Otherwise, we print the canonical config type on stdout and succeed.
35 # You can get the latest version of this script from:
36 # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
38 # This file is supposed to be the same for all GNU packages
39 # and recognize all the CPU types, system types and aliases
40 # that are meaningful with *any* GNU software.
41 # Each package is responsible for reporting which valid configurations
42 # it does not support. The user should be able to distinguish
43 # a failure to support a valid configuration from a meaningless
44 # configuration.
46 # The goal of this file is to map all the various variations of a given
47 # machine specification into a single specification in the form:
48 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
49 # or in some cases, the newer four-part form:
50 # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
51 # It is wrong to echo any other type of specification.
53 me=`echo "$0" | sed -e 's,.*/,,'`
55 usage="\
56 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
58 Canonicalize a configuration name.
60 Options:
61 -h, --help print this help, then exit
62 -t, --time-stamp print date of last modification, then exit
63 -v, --version print version number, then exit
65 Report bugs and patches to <config-patches@gnu.org>."
67 version="\
68 GNU config.sub ($timestamp)
70 Copyright 1992-2018 Free Software Foundation, Inc.
72 This is free software; see the source for copying conditions. There is NO
73 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
75 help="
76 Try \`$me --help' for more information."
78 # Parse command line
79 while test $# -gt 0 ; do
80 case $1 in
81 --time-stamp | --time* | -t )
82 echo "$timestamp" ; exit ;;
83 --version | -v )
84 echo "$version" ; exit ;;
85 --help | --h* | -h )
86 echo "$usage"; exit ;;
87 -- ) # Stop option processing
88 shift; break ;;
89 - ) # Use stdin as input.
90 break ;;
91 -* )
92 echo "$me: invalid option $1$help"
93 exit 1 ;;
95 *local*)
96 # First pass through any local machine types.
97 echo "$1"
98 exit ;;
101 break ;;
102 esac
103 done
105 case $# in
106 0) echo "$me: missing argument$help" >&2
107 exit 1;;
108 1) ;;
109 *) echo "$me: too many arguments$help" >&2
110 exit 1;;
111 esac
113 # Split fields of configuration type
114 IFS="-" read -r field1 field2 field3 field4 <<EOF
118 # Separate into logical components for further validation
119 case $1 in
120 *-*-*-*-*)
121 echo Invalid configuration \`"$1"\': more than four components >&2
122 exit 1
124 *-*-*-*)
125 basic_machine=$field1-$field2
126 os=$field3-$field4
128 *-*-*)
129 # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
130 # parts
131 maybe_os=$field2-$field3
132 case $maybe_os in
133 nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
134 | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
135 | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
136 | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
137 | storm-chaos* | os2-emx* | rtmk-nova*)
138 basic_machine=$field1
139 os=$maybe_os
141 android-linux)
142 basic_machine=$field1-unknown
143 os=linux-android
146 basic_machine=$field1-$field2
147 os=$field3
149 esac
151 *-*)
152 # Second component is usually, but not always the OS
153 case $field2 in
154 # Prevent following clause from handling this valid os
155 sun*os*)
156 basic_machine=$field1
157 os=$field2
159 # Manufacturers
160 dec* | mips* | sequent* | encore* | pc532* | sgi* | sony* \
161 | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
162 | unicom* | ibm* | next | hp | isi* | apollo | altos* \
163 | convergent* | ncr* | news | 32* | 3600* | 3100* | hitachi* \
164 | c[123]* | convex* | sun | crds | omron* | dg | ultra | tti* \
165 | harris | dolphin | highlevel | gould | cbm | ns | masscomp \
166 | apple | axis | knuth | cray | microblaze* \
167 | sim | cisco | oki | wec | wrs | winbond)
168 basic_machine=$field1-$field2
172 basic_machine=$field1
173 os=$field2
175 esac
178 # Convert single-component short-hands not valid as part of
179 # multi-component configurations.
180 case $field1 in
181 386bsd)
182 basic_machine=i386-pc
183 os=bsd
185 a29khif)
186 basic_machine=a29k-amd
187 os=udi
189 adobe68k)
190 basic_machine=m68010-adobe
191 os=scout
193 am29k)
194 basic_machine=a29k-none
195 os=bsd
197 amdahl)
198 basic_machine=580-amdahl
199 os=sysv
201 amigaos | amigados)
202 basic_machine=m68k-unknown
203 os=amigaos
205 amigaunix | amix)
206 basic_machine=m68k-unknown
207 os=sysv4
209 apollo68)
210 basic_machine=m68k-apollo
211 os=sysv
213 apollo68bsd)
214 basic_machine=m68k-apollo
215 os=bsd
217 aros)
218 basic_machine=i386-pc
219 os=aros
221 aux)
222 basic_machine=m68k-apple
223 os=aux
225 balance)
226 basic_machine=ns32k-sequent
227 os=dynix
229 blackfin)
230 basic_machine=bfin-unknown
231 os=linux
233 cegcc)
234 basic_machine=arm-unknown
235 os=cegcc
237 cray)
238 basic_machine=j90-cray
239 os=unicos
241 craynv)
242 basic_machine=craynv-cray
243 os=unicosmp
245 delta88)
246 basic_machine=m88k-motorola
247 os=sysv3
249 dicos)
250 basic_machine=i686-pc
251 os=dicos
253 djgpp)
254 basic_machine=i586-pc
255 os=msdosdjgpp
257 ebmon29k)
258 basic_machine=a29k-amd
259 os=ebmon
261 es1800 | OSE68k | ose68k | ose | OSE)
262 basic_machine=m68k-ericsson
263 os=ose
265 gmicro)
266 basic_machine=tron-gmicro
267 os=sysv
269 go32)
270 basic_machine=i386-pc
271 os=go32
273 h8300hms)
274 basic_machine=h8300-hitachi
275 os=hms
277 h8300xray)
278 basic_machine=h8300-hitachi
279 os=xray
281 h8500hms)
282 basic_machine=h8500-hitachi
283 os=hms
285 harris)
286 basic_machine=m88k-harris
287 os=sysv3
289 hp300bsd)
290 basic_machine=m68k-hp
291 os=bsd
293 hp300hpux)
294 basic_machine=m68k-hp
295 os=hpux
297 hppaosf)
298 basic_machine=hppa1.1-hp
299 os=osf
301 hppro)
302 basic_machine=hppa1.1-hp
303 os=proelf
305 i386mach)
306 basic_machine=i386-mach
307 os=mach
309 vsta)
310 basic_machine=i386-pc
311 os=vsta
313 isi68 | isi)
314 basic_machine=m68k-isi
315 os=sysv
317 m68knommu)
318 basic_machine=m68k-unknown
319 os=linux
321 magnum | m3230)
322 basic_machine=mips-mips
323 os=sysv
325 merlin)
326 basic_machine=ns32k-utek
327 os=sysv
329 mingw64)
330 basic_machine=x86_64-pc
331 os=mingw64
333 mingw32)
334 basic_machine=i686-pc
335 os=mingw32
337 mingw32ce)
338 basic_machine=arm-unknown
339 os=mingw32ce
341 monitor)
342 basic_machine=m68k-rom68k
343 os=coff
345 morphos)
346 basic_machine=powerpc-unknown
347 os=morphos
349 moxiebox)
350 basic_machine=moxie-unknown
351 os=moxiebox
353 msdos)
354 basic_machine=i386-pc
355 os=msdos
357 msys)
358 basic_machine=i686-pc
359 os=msys
361 mvs)
362 basic_machine=i370-ibm
363 os=mvs
365 nacl)
366 basic_machine=le32-unknown
367 os=nacl
369 ncr3000)
370 basic_machine=i486-ncr
371 os=sysv4
373 netbsd386)
374 basic_machine=i386-pc
375 os=netbsd
377 netwinder)
378 basic_machine=armv4l-rebel
379 os=linux
381 news | news700 | news800 | news900)
382 basic_machine=m68k-sony
383 os=newsos
385 news1000)
386 basic_machine=m68030-sony
387 os=newsos
389 necv70)
390 basic_machine=v70-nec
391 os=sysv
393 nh3000)
394 basic_machine=m68k-harris
395 os=cxux
397 nh[45]000)
398 basic_machine=m88k-harris
399 os=cxux
401 nindy960)
402 basic_machine=i960-intel
403 os=nindy
405 mon960)
406 basic_machine=i960-intel
407 os=mon960
409 nonstopux)
410 basic_machine=mips-compaq
411 os=nonstopux
413 os400)
414 basic_machine=powerpc-ibm
415 os=os400
417 OSE68000 | ose68000)
418 basic_machine=m68000-ericsson
419 os=ose
421 os68k)
422 basic_machine=m68k-none
423 os=os68k
425 paragon)
426 basic_machine=i860-intel
427 os=osf
429 parisc)
430 basic_machine=hppa-unknown
431 os=linux
433 pw32)
434 basic_machine=i586-unknown
435 os=pw32
437 rdos | rdos64)
438 basic_machine=x86_64-pc
439 os=rdos
441 rdos32)
442 basic_machine=i386-pc
443 os=rdos
445 rom68k)
446 basic_machine=m68k-rom68k
447 os=coff
449 sa29200)
450 basic_machine=a29k-amd
451 os=udi
453 sei)
454 basic_machine=mips-sei
455 os=seiux
457 sps7)
458 basic_machine=m68k-bull
459 os=sysv2
461 stratus)
462 basic_machine=i860-stratus
463 os=sysv4
465 sun2os3)
466 basic_machine=m68000-sun
467 os=sunos3
469 sun2os4)
470 basic_machine=m68000-sun
471 os=sunos4
473 sun3os3)
474 basic_machine=m68k-sun
475 os=sunos3
477 sun3os4)
478 basic_machine=m68k-sun
479 os=sunos4
481 sun4os3)
482 basic_machine=sparc-sun
483 os=sunos3
485 sun4os4)
486 basic_machine=sparc-sun
487 os=sunos4
489 sun4sol2)
490 basic_machine=sparc-sun
491 os=solaris2
493 sv1)
494 basic_machine=sv1-cray
495 os=unicos
497 symmetry)
498 basic_machine=i386-sequent
499 os=dynix
501 t3e)
502 basic_machine=alphaev5-cray
503 os=unicos
505 t90)
506 basic_machine=t90-cray
507 os=unicos
509 toad1)
510 basic_machine=pdp10-xkl
511 os=tops20
513 tpf)
514 basic_machine=s390x-ibm
515 os=tpf
517 udi29k)
518 basic_machine=a29k-amd
519 os=udi
521 ultra3)
522 basic_machine=a29k-nyu
523 os=sym1
525 v810 | necv810)
526 basic_machine=v810-nec
527 os=none
529 vaxv)
530 basic_machine=vax-dec
531 os=sysv
533 vms)
534 basic_machine=vax-dec
535 os=vms
537 vxworks960)
538 basic_machine=i960-wrs
539 os=vxworks
541 vxworks68)
542 basic_machine=m68k-wrs
543 os=vxworks
545 vxworks29k)
546 basic_machine=a29k-wrs
547 os=vxworks
549 xbox)
550 basic_machine=i686-pc
551 os=mingw32
553 ymp)
554 basic_machine=ymp-cray
555 os=unicos
558 basic_machine=$1
561 esac
563 esac
565 # Decode aliases for certain CPU-COMPANY combinations.
566 case $basic_machine in
567 # Recognize the basic CPU types without company name.
568 # Some are omitted here because they have special meanings below.
569 1750a | 580 \
570 | a29k \
571 | aarch64 | aarch64_be \
572 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
573 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
574 | am33_2.0 \
575 | arc | arceb \
576 | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \
577 | avr | avr32 \
578 | ba \
579 | be32 | be64 \
580 | bfin \
581 | c4x | c8051 | clipper | csky \
582 | d10v | d30v | dlx | dsp16xx \
583 | e2k | epiphany \
584 | fido | fr30 | frv | ft32 \
585 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
586 | hexagon \
587 | i370 | i860 | i960 | ia16 | ia64 \
588 | ip2k | iq2000 \
589 | k1om \
590 | le32 | le64 \
591 | lm32 \
592 | m32c | m32r | m32rle | m68000 | m68k | m88k \
593 | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
594 | mips | mipsbe | mipseb | mipsel | mipsle \
595 | mips16 \
596 | mips64 | mips64el \
597 | mips64octeon | mips64octeonel \
598 | mips64orion | mips64orionel \
599 | mips64r5900 | mips64r5900el \
600 | mips64vr | mips64vrel \
601 | mips64vr4100 | mips64vr4100el \
602 | mips64vr4300 | mips64vr4300el \
603 | mips64vr5000 | mips64vr5000el \
604 | mips64vr5900 | mips64vr5900el \
605 | mipsisa32 | mipsisa32el \
606 | mipsisa32r2 | mipsisa32r2el \
607 | mipsisa32r6 | mipsisa32r6el \
608 | mipsisa64 | mipsisa64el \
609 | mipsisa64r2 | mipsisa64r2el \
610 | mipsisa64r6 | mipsisa64r6el \
611 | mipsisa64sb1 | mipsisa64sb1el \
612 | mipsisa64sr71k | mipsisa64sr71kel \
613 | mipsr5900 | mipsr5900el \
614 | mipstx39 | mipstx39el \
615 | mn10200 | mn10300 \
616 | moxie \
617 | mt \
618 | msp430 \
619 | nds32 | nds32le | nds32be \
620 | nfp \
621 | nios | nios2 | nios2eb | nios2el \
622 | ns16k | ns32k \
623 | open8 | or1k | or1knd | or32 \
624 | pdp10 | pj | pjl \
625 | powerpc | powerpc64 | powerpc64le | powerpcle \
626 | pru \
627 | pyramid \
628 | riscv | riscv32 | riscv64 \
629 | rl78 | rx \
630 | score \
631 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
632 | sh64 | sh64le \
633 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
634 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
635 | spu \
636 | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
637 | ubicom32 \
638 | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
639 | visium \
640 | wasm32 \
641 | x86 | xc16x | xstormy16 | xtensa \
642 | z8k | z80)
643 basic_machine=$basic_machine-unknown
645 c54x)
646 basic_machine=tic54x-unknown
648 c55x)
649 basic_machine=tic55x-unknown
651 c6x)
652 basic_machine=tic6x-unknown
654 leon|leon[3-9])
655 basic_machine=sparc-$basic_machine
657 m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
658 basic_machine=$basic_machine-unknown
659 os=${os:-none}
661 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
663 m9s12z | m68hcs12z | hcs12z | s12z)
664 basic_machine=s12z-unknown
665 os=${os:-none}
667 ms1)
668 basic_machine=mt-unknown
670 strongarm | thumb | xscale)
671 basic_machine=arm-unknown
673 xgate)
674 basic_machine=$basic_machine-unknown
675 os=${os:-none}
677 xscaleeb)
678 basic_machine=armeb-unknown
681 xscaleel)
682 basic_machine=armel-unknown
685 # We use `pc' rather than `unknown'
686 # because (1) that's what they normally are, and
687 # (2) the word "unknown" tends to confuse beginning users.
688 i*86 | x86_64)
689 basic_machine=$basic_machine-pc
691 # Recognize the basic CPU types with company name.
692 580-* \
693 | a29k-* \
694 | aarch64-* | aarch64_be-* \
695 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
696 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
697 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
698 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
699 | avr-* | avr32-* \
700 | ba-* \
701 | be32-* | be64-* \
702 | bfin-* | bs2000-* \
703 | c[123]* | c30-* | [cjt]90-* | c4x-* \
704 | c8051-* | clipper-* | craynv-* | csky-* | cydra-* \
705 | d10v-* | d30v-* | dlx-* \
706 | e2k-* | elxsi-* \
707 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
708 | h8300-* | h8500-* \
709 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
710 | hexagon-* \
711 | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
712 | ip2k-* | iq2000-* \
713 | k1om-* \
714 | le32-* | le64-* \
715 | lm32-* \
716 | m32c-* | m32r-* | m32rle-* \
717 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
718 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
719 | microblaze-* | microblazeel-* \
720 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
721 | mips16-* \
722 | mips64-* | mips64el-* \
723 | mips64octeon-* | mips64octeonel-* \
724 | mips64orion-* | mips64orionel-* \
725 | mips64r5900-* | mips64r5900el-* \
726 | mips64vr-* | mips64vrel-* \
727 | mips64vr4100-* | mips64vr4100el-* \
728 | mips64vr4300-* | mips64vr4300el-* \
729 | mips64vr5000-* | mips64vr5000el-* \
730 | mips64vr5900-* | mips64vr5900el-* \
731 | mipsisa32-* | mipsisa32el-* \
732 | mipsisa32r2-* | mipsisa32r2el-* \
733 | mipsisa32r6-* | mipsisa32r6el-* \
734 | mipsisa64-* | mipsisa64el-* \
735 | mipsisa64r2-* | mipsisa64r2el-* \
736 | mipsisa64r6-* | mipsisa64r6el-* \
737 | mipsisa64sb1-* | mipsisa64sb1el-* \
738 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
739 | mipsr5900-* | mipsr5900el-* \
740 | mipstx39-* | mipstx39el-* \
741 | mmix-* \
742 | moxie-* \
743 | mt-* \
744 | msp430-* \
745 | nds32-* | nds32le-* | nds32be-* \
746 | nfp-* \
747 | nios-* | nios2-* | nios2eb-* | nios2el-* \
748 | none-* | np1-* | ns16k-* | ns32k-* \
749 | open8-* \
750 | or1k*-* \
751 | orion-* \
752 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
753 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
754 | pru-* \
755 | pyramid-* \
756 | riscv-* | riscv32-* | riscv64-* \
757 | rl78-* | romp-* | rs6000-* | rx-* \
758 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
759 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
760 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
761 | sparclite-* \
762 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
763 | tahoe-* \
764 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
765 | tile*-* \
766 | tron-* \
767 | ubicom32-* \
768 | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
769 | vax-* \
770 | visium-* \
771 | wasm32-* \
772 | we32k-* \
773 | x86-* | x86_64-* | xc16x-* | xps100-* \
774 | xstormy16-* | xtensa*-* \
775 | ymp-* \
776 | z8k-* | z80-*)
778 # Recognize the basic CPU types without company name, with glob match.
779 xtensa*)
780 basic_machine=$basic_machine-unknown
782 # Recognize the various machine names and aliases which stand
783 # for a CPU type and a company and sometimes even an OS.
784 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
785 basic_machine=m68000-att
787 3b*)
788 basic_machine=we32k-att
790 abacus)
791 basic_machine=abacus-unknown
793 alliant | fx80)
794 basic_machine=fx80-alliant
796 altos | altos3068)
797 basic_machine=m68k-altos
799 amd64)
800 basic_machine=x86_64-pc
802 amd64-*)
803 basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
805 amiga | amiga-*)
806 basic_machine=m68k-unknown
808 asmjs)
809 basic_machine=asmjs-unknown
811 blackfin-*)
812 basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
813 os=linux
815 bluegene*)
816 basic_machine=powerpc-ibm
817 os=cnk
819 c54x-*)
820 basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
822 c55x-*)
823 basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
825 c6x-*)
826 basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
828 c90)
829 basic_machine=c90-cray
830 os=${os:-unicos}
832 convex-c1)
833 basic_machine=c1-convex
834 os=bsd
836 convex-c2)
837 basic_machine=c2-convex
838 os=bsd
840 convex-c32)
841 basic_machine=c32-convex
842 os=bsd
844 convex-c34)
845 basic_machine=c34-convex
846 os=bsd
848 convex-c38)
849 basic_machine=c38-convex
850 os=bsd
852 cr16 | cr16-*)
853 basic_machine=cr16-unknown
854 os=${os:-elf}
856 crds | unos)
857 basic_machine=m68k-crds
859 crisv32 | crisv32-* | etraxfs*)
860 basic_machine=crisv32-axis
862 cris | cris-* | etrax*)
863 basic_machine=cris-axis
865 crx)
866 basic_machine=crx-unknown
867 os=${os:-elf}
869 da30 | da30-*)
870 basic_machine=m68k-da30
872 decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
873 basic_machine=mips-dec
875 decsystem10* | dec10*)
876 basic_machine=pdp10-dec
877 os=tops10
879 decsystem20* | dec20*)
880 basic_machine=pdp10-dec
881 os=tops20
883 delta | 3300 | motorola-3300 | motorola-delta \
884 | 3300-motorola | delta-motorola)
885 basic_machine=m68k-motorola
887 dpx20 | dpx20-*)
888 basic_machine=rs6000-bull
889 os=${os:-bosx}
891 dpx2*)
892 basic_machine=m68k-bull
893 os=sysv3
895 e500v[12])
896 basic_machine=powerpc-unknown
897 os=$os"spe"
899 e500v[12]-*)
900 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
901 os=$os"spe"
903 encore | umax | mmax)
904 basic_machine=ns32k-encore
906 elxsi)
907 basic_machine=elxsi-elxsi
908 os=${os:-bsd}
910 fx2800)
911 basic_machine=i860-alliant
913 genix)
914 basic_machine=ns32k-ns
916 h3050r* | hiux*)
917 basic_machine=hppa1.1-hitachi
918 os=hiuxwe2
920 hp300-*)
921 basic_machine=m68k-hp
923 hp3k9[0-9][0-9] | hp9[0-9][0-9])
924 basic_machine=hppa1.0-hp
926 hp9k2[0-9][0-9] | hp9k31[0-9])
927 basic_machine=m68000-hp
929 hp9k3[2-9][0-9])
930 basic_machine=m68k-hp
932 hp9k6[0-9][0-9] | hp6[0-9][0-9])
933 basic_machine=hppa1.0-hp
935 hp9k7[0-79][0-9] | hp7[0-79][0-9])
936 basic_machine=hppa1.1-hp
938 hp9k78[0-9] | hp78[0-9])
939 # FIXME: really hppa2.0-hp
940 basic_machine=hppa1.1-hp
942 hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
943 # FIXME: really hppa2.0-hp
944 basic_machine=hppa1.1-hp
946 hp9k8[0-9][13679] | hp8[0-9][13679])
947 basic_machine=hppa1.1-hp
949 hp9k8[0-9][0-9] | hp8[0-9][0-9])
950 basic_machine=hppa1.0-hp
952 i370-ibm* | ibm*)
953 basic_machine=i370-ibm
955 i*86v32)
956 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
957 os=sysv32
959 i*86v4*)
960 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
961 os=sysv4
963 i*86v)
964 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
965 os=sysv
967 i*86sol2)
968 basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
969 os=solaris2
971 j90 | j90-cray)
972 basic_machine=j90-cray
973 os=${os:-unicos}
975 iris | iris4d)
976 basic_machine=mips-sgi
977 case $os in
978 irix*)
981 os=irix4
983 esac
985 leon-*|leon[3-9]-*)
986 basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
988 m68knommu-*)
989 basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
990 os=linux
992 microblaze*)
993 basic_machine=microblaze-xilinx
995 miniframe)
996 basic_machine=m68000-convergent
998 *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
999 basic_machine=m68k-atari
1000 os=mint
1002 mips3*-*)
1003 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
1005 mips3*)
1006 basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
1008 ms1-*)
1009 basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
1011 news-3600 | risc-news)
1012 basic_machine=mips-sony
1013 os=newsos
1015 next | m*-next)
1016 basic_machine=m68k-next
1017 case $os in
1018 nextstep* )
1020 ns2*)
1021 os=nextstep2
1024 os=nextstep3
1026 esac
1028 np1)
1029 basic_machine=np1-gould
1031 neo-tandem)
1032 basic_machine=neo-tandem
1034 nse-tandem)
1035 basic_machine=nse-tandem
1037 nsr-tandem)
1038 basic_machine=nsr-tandem
1040 nsv-tandem)
1041 basic_machine=nsv-tandem
1043 nsx-tandem)
1044 basic_machine=nsx-tandem
1046 op50n-* | op60c-*)
1047 basic_machine=hppa1.1-oki
1048 os=proelf
1050 openrisc | openrisc-*)
1051 basic_machine=or32-unknown
1053 pa-hitachi)
1054 basic_machine=hppa1.1-hitachi
1055 os=hiuxwe2
1057 parisc-*)
1058 basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1059 os=linux
1061 pbd)
1062 basic_machine=sparc-tti
1064 pbb)
1065 basic_machine=m68k-tti
1067 pc532 | pc532-*)
1068 basic_machine=ns32k-pc532
1070 pc98)
1071 basic_machine=i386-pc
1073 pc98-*)
1074 basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1076 pentium | p5 | k5 | k6 | nexgen | viac3)
1077 basic_machine=i586-pc
1079 pentiumpro | p6 | 6x86 | athlon | athlon_*)
1080 basic_machine=i686-pc
1082 pentiumii | pentium2 | pentiumiii | pentium3)
1083 basic_machine=i686-pc
1085 pentium4)
1086 basic_machine=i786-pc
1088 pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1089 basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1091 pentiumpro-* | p6-* | 6x86-* | athlon-*)
1092 basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1094 pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1095 basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1097 pentium4-*)
1098 basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1101 basic_machine=pn-gould
1103 power) basic_machine=power-ibm
1105 ppc | ppcbe) basic_machine=powerpc-unknown
1107 ppc-* | ppcbe-*)
1108 basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1110 ppcle | powerpclittle)
1111 basic_machine=powerpcle-unknown
1113 ppcle-* | powerpclittle-*)
1114 basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1116 ppc64) basic_machine=powerpc64-unknown
1118 ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1120 ppc64le | powerpc64little)
1121 basic_machine=powerpc64le-unknown
1123 ppc64le-* | powerpc64little-*)
1124 basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1126 ps2)
1127 basic_machine=i386-ibm
1129 rm[46]00)
1130 basic_machine=mips-siemens
1132 rtpc | rtpc-*)
1133 basic_machine=romp-ibm
1135 s390 | s390-*)
1136 basic_machine=s390-ibm
1138 s390x | s390x-*)
1139 basic_machine=s390x-ibm
1141 sb1)
1142 basic_machine=mipsisa64sb1-unknown
1144 sb1el)
1145 basic_machine=mipsisa64sb1el-unknown
1147 sde)
1148 basic_machine=mipsisa32-sde
1149 os=${os:-elf}
1151 sequent)
1152 basic_machine=i386-sequent
1154 sh5el)
1155 basic_machine=sh5le-unknown
1157 simso-wrs)
1158 basic_machine=sparclite-wrs
1159 os=vxworks
1161 spur)
1162 basic_machine=spur-unknown
1164 st2000)
1165 basic_machine=m68k-tandem
1167 strongarm-* | thumb-*)
1168 basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1170 sun2)
1171 basic_machine=m68000-sun
1173 sun3 | sun3-*)
1174 basic_machine=m68k-sun
1176 sun4)
1177 basic_machine=sparc-sun
1179 sun386 | sun386i | roadrunner)
1180 basic_machine=i386-sun
1182 tile*)
1183 basic_machine=$basic_machine-unknown
1184 os=linux-gnu
1186 tx39)
1187 basic_machine=mipstx39-unknown
1189 tx39el)
1190 basic_machine=mipstx39el-unknown
1192 tower | tower-32)
1193 basic_machine=m68k-ncr
1195 vpp*|vx|vx-*)
1196 basic_machine=f301-fujitsu
1198 w65*)
1199 basic_machine=w65-wdc
1200 os=none
1202 w89k-*)
1203 basic_machine=hppa1.1-winbond
1204 os=proelf
1206 x64)
1207 basic_machine=x86_64-pc
1209 xps | xps100)
1210 basic_machine=xps100-honeywell
1212 xscale-* | xscalee[bl]-*)
1213 basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
1215 none)
1216 basic_machine=none-none
1217 os=${os:-none}
1220 # Here we handle the default manufacturer of certain CPU types. It is in
1221 # some cases the only manufacturer, in others, it is the most popular.
1222 w89k)
1223 basic_machine=hppa1.1-winbond
1225 op50n)
1226 basic_machine=hppa1.1-oki
1228 op60c)
1229 basic_machine=hppa1.1-oki
1231 romp)
1232 basic_machine=romp-ibm
1234 mmix)
1235 basic_machine=mmix-knuth
1237 rs6000)
1238 basic_machine=rs6000-ibm
1240 vax)
1241 basic_machine=vax-dec
1243 pdp11)
1244 basic_machine=pdp11-dec
1246 we32k)
1247 basic_machine=we32k-att
1249 sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1250 basic_machine=sh-unknown
1252 cydra)
1253 basic_machine=cydra-cydrome
1255 orion)
1256 basic_machine=orion-highlevel
1258 orion105)
1259 basic_machine=clipper-highlevel
1261 mac | mpw | mac-mpw)
1262 basic_machine=m68k-apple
1264 pmac | pmac-mpw)
1265 basic_machine=powerpc-apple
1268 echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
1269 exit 1
1271 esac
1273 # Here we canonicalize certain aliases for manufacturers.
1274 case $basic_machine in
1275 *-digital*)
1276 basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
1278 *-commodore*)
1279 basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
1283 esac
1285 # Decode manufacturer-specific aliases for certain operating systems.
1287 if [ x$os != x ]
1288 then
1289 case $os in
1290 # First match some system type aliases that might get confused
1291 # with valid system types.
1292 # solaris* is a basic system type, with this one exception.
1293 auroraux)
1294 os=auroraux
1296 bluegene*)
1297 os=cnk
1299 solaris1 | solaris1.*)
1300 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1302 solaris)
1303 os=solaris2
1305 unixware*)
1306 os=sysv4.2uw
1308 gnu/linux*)
1309 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1311 # es1800 is here to avoid being matched by es* (a different OS)
1312 es1800*)
1313 os=ose
1315 # Some version numbers need modification
1316 chorusos*)
1317 os=chorusos
1319 isc)
1320 os=isc2.2
1322 sco6)
1323 os=sco5v6
1325 sco5)
1326 os=sco3.2v5
1328 sco4)
1329 os=sco3.2v4
1331 sco3.2.[4-9]*)
1332 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1334 sco3.2v[4-9]* | sco5v6*)
1335 # Don't forget version if it is 3.2v4 or newer.
1337 scout)
1338 # Don't match below
1340 sco*)
1341 os=sco3.2v2
1343 psos*)
1344 os=psos
1346 # Now accept the basic system types.
1347 # The portable systems comes first.
1348 # Each alternative MUST end in a * to match a version number.
1349 # sysv* is not here because it comes later, after sysvr4.
1350 gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1351 | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
1352 | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1353 | sym* | kopensolaris* | plan9* \
1354 | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1355 | aos* | aros* | cloudabi* | sortix* \
1356 | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1357 | clix* | riscos* | uniplus* | iris* | rtu* | xenix* \
1358 | knetbsd* | mirbsd* | netbsd* \
1359 | bitrig* | openbsd* | solidbsd* | libertybsd* \
1360 | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
1361 | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1362 | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1363 | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
1364 | chorusrdb* | cegcc* | glidix* \
1365 | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1366 | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
1367 | linux-newlib* | linux-musl* | linux-uclibc* \
1368 | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1369 | interix* | uwin* | mks* | rhapsody* | darwin* \
1370 | openstep* | oskit* | conix* | pw32* | nonstopux* \
1371 | storm-chaos* | tops10* | tenex* | tops20* | its* \
1372 | os2* | vos* | palmos* | uclinux* | nucleus* \
1373 | morphos* | superux* | rtmk* | windiss* \
1374 | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1375 | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1376 | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1377 | midnightbsd*)
1378 # Remember, each alternative MUST END IN *, to match a version number.
1380 qnx*)
1381 case $basic_machine in
1382 x86-* | i*86-*)
1385 os=nto-$os
1387 esac
1389 hiux*)
1390 os=hiuxwe2
1392 nto-qnx*)
1394 nto*)
1395 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1397 sim | xray | os68k* | v88r* \
1398 | windows* | osx | abug | netware* | os9* \
1399 | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
1401 linux-dietlibc)
1402 os=linux-dietlibc
1404 linux*)
1405 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1407 lynx*178)
1408 os=lynxos178
1410 lynx*5)
1411 os=lynxos5
1413 lynx*)
1414 os=lynxos
1416 mac*)
1417 os=`echo "$os" | sed -e 's|mac|macos|'`
1419 opened*)
1420 os=openedition
1422 os400*)
1423 os=os400
1425 sunos5*)
1426 os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1428 sunos6*)
1429 os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1431 wince*)
1432 os=wince
1434 utek*)
1435 os=bsd
1437 dynix*)
1438 os=bsd
1440 acis*)
1441 os=aos
1443 atheos*)
1444 os=atheos
1446 syllable*)
1447 os=syllable
1449 386bsd)
1450 os=bsd
1452 ctix* | uts*)
1453 os=sysv
1455 nova*)
1456 os=rtmk-nova
1458 ns2)
1459 os=nextstep2
1461 nsk*)
1462 os=nsk
1464 # Preserve the version number of sinix5.
1465 sinix5.*)
1466 os=`echo $os | sed -e 's|sinix|sysv|'`
1468 sinix*)
1469 os=sysv4
1471 tpf*)
1472 os=tpf
1474 triton*)
1475 os=sysv3
1477 oss*)
1478 os=sysv3
1480 svr4*)
1481 os=sysv4
1483 svr3)
1484 os=sysv3
1486 sysvr4)
1487 os=sysv4
1489 # This must come after sysvr4.
1490 sysv*)
1492 ose*)
1493 os=ose
1495 *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1496 os=mint
1498 zvmoe)
1499 os=zvmoe
1501 dicos*)
1502 os=dicos
1504 pikeos*)
1505 # Until real need of OS specific support for
1506 # particular features comes up, bare metal
1507 # configurations are quite functional.
1508 case $basic_machine in
1509 arm*)
1510 os=eabi
1513 os=elf
1515 esac
1517 nacl*)
1519 ios)
1521 none)
1523 *-eabi)
1526 echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
1527 exit 1
1529 esac
1530 else
1532 # Here we handle the default operating systems that come with various machines.
1533 # The value should be what the vendor currently ships out the door with their
1534 # machine or put another way, the most popular os provided with the machine.
1536 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1537 # "-sun"), then you have to tell the case statement up towards the top
1538 # that MANUFACTURER isn't an operating system. Otherwise, code above
1539 # will signal an error saying that MANUFACTURER isn't an operating
1540 # system, and we'll never get to this point.
1542 case $basic_machine in
1543 score-*)
1544 os=elf
1546 spu-*)
1547 os=elf
1549 *-acorn)
1550 os=riscix1.2
1552 arm*-rebel)
1553 os=linux
1555 arm*-semi)
1556 os=aout
1558 c4x-* | tic4x-*)
1559 os=coff
1561 c8051-*)
1562 os=elf
1564 clipper-intergraph)
1565 os=clix
1567 hexagon-*)
1568 os=elf
1570 tic54x-*)
1571 os=coff
1573 tic55x-*)
1574 os=coff
1576 tic6x-*)
1577 os=coff
1579 # This must come before the *-dec entry.
1580 pdp10-*)
1581 os=tops20
1583 pdp11-*)
1584 os=none
1586 *-dec | vax-*)
1587 os=ultrix4.2
1589 m68*-apollo)
1590 os=domain
1592 i386-sun)
1593 os=sunos4.0.2
1595 m68000-sun)
1596 os=sunos3
1598 m68*-cisco)
1599 os=aout
1601 mep-*)
1602 os=elf
1604 mips*-cisco)
1605 os=elf
1607 mips*-*)
1608 os=elf
1610 or32-*)
1611 os=coff
1613 *-tti) # must be before sparc entry or we get the wrong os.
1614 os=sysv3
1616 sparc-* | *-sun)
1617 os=sunos4.1.1
1619 pru-*)
1620 os=elf
1622 *-be)
1623 os=beos
1625 *-ibm)
1626 os=aix
1628 *-knuth)
1629 os=mmixware
1631 *-wec)
1632 os=proelf
1634 *-winbond)
1635 os=proelf
1637 *-oki)
1638 os=proelf
1640 *-hp)
1641 os=hpux
1643 *-hitachi)
1644 os=hiux
1646 i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1647 os=sysv
1649 *-cbm)
1650 os=amigaos
1652 *-dg)
1653 os=dgux
1655 *-dolphin)
1656 os=sysv3
1658 m68k-ccur)
1659 os=rtu
1661 m88k-omron*)
1662 os=luna
1664 *-next)
1665 os=nextstep
1667 *-sequent)
1668 os=ptx
1670 *-crds)
1671 os=unos
1673 *-ns)
1674 os=genix
1676 i370-*)
1677 os=mvs
1679 *-gould)
1680 os=sysv
1682 *-highlevel)
1683 os=bsd
1685 *-encore)
1686 os=bsd
1688 *-sgi)
1689 os=irix
1691 *-siemens)
1692 os=sysv4
1694 *-masscomp)
1695 os=rtu
1697 f30[01]-fujitsu | f700-fujitsu)
1698 os=uxpv
1700 *-rom68k)
1701 os=coff
1703 *-*bug)
1704 os=coff
1706 *-apple)
1707 os=macos
1709 *-atari*)
1710 os=mint
1712 *-wrs)
1713 os=vxworks
1716 os=none
1718 esac
1721 # Here we handle the case where we know the os, and the CPU type, but not the
1722 # manufacturer. We pick the logical manufacturer.
1723 vendor=unknown
1724 case $basic_machine in
1725 *-unknown)
1726 case $os in
1727 riscix*)
1728 vendor=acorn
1730 sunos*)
1731 vendor=sun
1733 cnk*|-aix*)
1734 vendor=ibm
1736 beos*)
1737 vendor=be
1739 hpux*)
1740 vendor=hp
1742 mpeix*)
1743 vendor=hp
1745 hiux*)
1746 vendor=hitachi
1748 unos*)
1749 vendor=crds
1751 dgux*)
1752 vendor=dg
1754 luna*)
1755 vendor=omron
1757 genix*)
1758 vendor=ns
1760 clix*)
1761 vendor=intergraph
1763 mvs* | opened*)
1764 vendor=ibm
1766 os400*)
1767 vendor=ibm
1769 ptx*)
1770 vendor=sequent
1772 tpf*)
1773 vendor=ibm
1775 vxsim* | vxworks* | windiss*)
1776 vendor=wrs
1778 aux*)
1779 vendor=apple
1781 hms*)
1782 vendor=hitachi
1784 mpw* | macos*)
1785 vendor=apple
1787 *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1788 vendor=atari
1790 vos*)
1791 vendor=stratus
1793 esac
1794 basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
1796 esac
1798 echo "$basic_machine-$os"
1799 exit
1801 # Local variables:
1802 # eval: (add-hook 'before-save-hook 'time-stamp)
1803 # time-stamp-start: "timestamp='"
1804 # time-stamp-format: "%:y-%02m-%02d"
1805 # time-stamp-end: "'"
1806 # End: