Merge branch 'tizen_base' into tizen
[platform/upstream/expat.git] / conftools / config.sub
1 #! /bin/sh
2 # Configuration validation subroutine script.
3 #   Copyright 1992-2017 Free Software Foundation, Inc.
4
5 timestamp='2017-01-01'
6
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.
11 #
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.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, see <http://www.gnu.org/licenses/>.
19 #
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").
26
27
28 # Please send patches to <config-patches@gnu.org>.
29 #
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.
34
35 # You can get the latest version of this script from:
36 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
37
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.
45
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.
52
53 me=`echo "$0" | sed -e 's,.*/,,'`
54
55 usage="\
56 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
57
58 Canonicalize a configuration name.
59
60 Operation modes:
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
64
65 Report bugs and patches to <config-patches@gnu.org>."
66
67 version="\
68 GNU config.sub ($timestamp)
69
70 Copyright 1992-2017 Free Software Foundation, Inc.
71
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."
74
75 help="
76 Try \`$me --help' for more information."
77
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 ;;
94
95     *local*)
96        # First pass through any local machine types.
97        echo $1
98        exit ;;
99
100     * )
101        break ;;
102   esac
103 done
104
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
112
113 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
114 # Here we must recognize all the valid KERNEL-OS combinations.
115 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
116 case $maybe_os in
117   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
118   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
119   knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
120   kopensolaris*-gnu* | cloudabi*-eabi* | \
121   storm-chaos* | os2-emx* | rtmk-nova*)
122     os=-$maybe_os
123     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
124     ;;
125   android-linux)
126     os=-linux-android
127     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
128     ;;
129   *)
130     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131     if [ $basic_machine != $1 ]
132     then os=`echo $1 | sed 's/.*-/-/'`
133     else os=; fi
134     ;;
135 esac
136
137 ### Let's recognize common machines as not being operating systems so
138 ### that things like config.sub decstation-3100 work.  We also
139 ### recognize some manufacturers as not being operating systems, so we
140 ### can provide default operating systems below.
141 case $os in
142         -sun*os*)
143                 # Prevent following clause from handling this invalid input.
144                 ;;
145         -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
146         -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
147         -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
148         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150         -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151         -apple | -axis | -knuth | -cray | -microblaze*)
152                 os=
153                 basic_machine=$1
154                 ;;
155         -bluegene*)
156                 os=-cnk
157                 ;;
158         -sim | -cisco | -oki | -wec | -winbond)
159                 os=
160                 basic_machine=$1
161                 ;;
162         -scout)
163                 ;;
164         -wrs)
165                 os=-vxworks
166                 basic_machine=$1
167                 ;;
168         -chorusos*)
169                 os=-chorusos
170                 basic_machine=$1
171                 ;;
172         -chorusrdb)
173                 os=-chorusrdb
174                 basic_machine=$1
175                 ;;
176         -hiux*)
177                 os=-hiuxwe2
178                 ;;
179         -sco6)
180                 os=-sco5v6
181                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
182                 ;;
183         -sco5)
184                 os=-sco3.2v5
185                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
186                 ;;
187         -sco4)
188                 os=-sco3.2v4
189                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
190                 ;;
191         -sco3.2.[4-9]*)
192                 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
193                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
194                 ;;
195         -sco3.2v[4-9]*)
196                 # Don't forget version if it is 3.2v4 or newer.
197                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
198                 ;;
199         -sco5v6*)
200                 # Don't forget version if it is 3.2v4 or newer.
201                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
202                 ;;
203         -sco*)
204                 os=-sco3.2v2
205                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206                 ;;
207         -udk*)
208                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
209                 ;;
210         -isc)
211                 os=-isc2.2
212                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
213                 ;;
214         -clix*)
215                 basic_machine=clipper-intergraph
216                 ;;
217         -isc*)
218                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219                 ;;
220         -lynx*178)
221                 os=-lynxos178
222                 ;;
223         -lynx*5)
224                 os=-lynxos5
225                 ;;
226         -lynx*)
227                 os=-lynxos
228                 ;;
229         -ptx*)
230                 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231                 ;;
232         -windowsnt*)
233                 os=`echo $os | sed -e 's/windowsnt/winnt/'`
234                 ;;
235         -psos*)
236                 os=-psos
237                 ;;
238         -mint | -mint[0-9]*)
239                 basic_machine=m68k-atari
240                 os=-mint
241                 ;;
242 esac
243
244 # Decode aliases for certain CPU-COMPANY combinations.
245 case $basic_machine in
246         # Recognize the basic CPU types without company name.
247         # Some are omitted here because they have special meanings below.
248         1750a | 580 \
249         | a29k \
250         | aarch64 | aarch64_be \
251         | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
252         | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
253         | am33_2.0 \
254         | arc | arceb \
255         | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
256         | avr | avr32 \
257         | ba \
258         | be32 | be64 \
259         | bfin \
260         | c4x | c8051 | clipper \
261         | d10v | d30v | dlx | dsp16xx | dvp \
262         | e2k | epiphany \
263         | fido | fr30 | frv | ft32 \
264         | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
265         | hexagon \
266         | i370 | i860 | i960 | ia64 \
267         | ip2k | iq2000 \
268         | k1om \
269         | le32 | le64 \
270         | lm32 \
271         | m32c | m32r | m32rle | m68000 | m68k | m88k \
272         | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
273         | mips | mipsbe | mipseb | mipsel | mipsle \
274         | mips16 \
275         | mips64 | mips64el \
276         | mips64octeon | mips64octeonel \
277         | mips64orion | mips64orionel \
278         | mips64r5900 | mips64r5900el \
279         | mips64vr | mips64vrel \
280         | mips64vr4100 | mips64vr4100el \
281         | mips64vr4300 | mips64vr4300el \
282         | mips64vr5000 | mips64vr5000el \
283         | mips64vr5900 | mips64vr5900el \
284         | mipsisa32 | mipsisa32el \
285         | mipsisa32r2 | mipsisa32r2el \
286         | mipsisa32r6 | mipsisa32r6el \
287         | mipsisa64 | mipsisa64el \
288         | mipsisa64r2 | mipsisa64r2el \
289         | mipsisa64r6 | mipsisa64r6el \
290         | mipsisa64sb1 | mipsisa64sb1el \
291         | mipsisa64sr71k | mipsisa64sr71kel \
292         | mipsr5900 | mipsr5900el \
293         | mipstx39 | mipstx39el \
294         | mn10200 | mn10300 \
295         | moxie \
296         | mt \
297         | msp430 \
298         | nds32 | nds32le | nds32be \
299         | nios | nios2 | nios2eb | nios2el \
300         | ns16k | ns32k \
301         | open8 | or1k | or1knd | or32 \
302         | pdp10 | pdp11 | pj | pjl \
303         | powerpc | powerpc64 | powerpc64le | powerpcle \
304         | pru \
305         | pyramid \
306         | riscv32 | riscv64 \
307         | rl78 | rx \
308         | score \
309         | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
310         | sh64 | sh64le \
311         | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
312         | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
313         | spu \
314         | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
315         | ubicom32 \
316         | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
317         | visium \
318         | we32k \
319         | x86 | xc16x | xstormy16 | xtensa \
320         | z8k | z80)
321                 basic_machine=$basic_machine-unknown
322                 ;;
323         c54x)
324                 basic_machine=tic54x-unknown
325                 ;;
326         c55x)
327                 basic_machine=tic55x-unknown
328                 ;;
329         c6x)
330                 basic_machine=tic6x-unknown
331                 ;;
332         leon|leon[3-9])
333                 basic_machine=sparc-$basic_machine
334                 ;;
335         m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
336                 basic_machine=$basic_machine-unknown
337                 os=-none
338                 ;;
339         m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
340                 ;;
341         ms1)
342                 basic_machine=mt-unknown
343                 ;;
344
345         strongarm | thumb | xscale)
346                 basic_machine=arm-unknown
347                 ;;
348         xgate)
349                 basic_machine=$basic_machine-unknown
350                 os=-none
351                 ;;
352         xscaleeb)
353                 basic_machine=armeb-unknown
354                 ;;
355
356         xscaleel)
357                 basic_machine=armel-unknown
358                 ;;
359
360         # We use `pc' rather than `unknown'
361         # because (1) that's what they normally are, and
362         # (2) the word "unknown" tends to confuse beginning users.
363         i*86 | x86_64)
364           basic_machine=$basic_machine-pc
365           ;;
366         # Object if more than one company name word.
367         *-*-*)
368                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
369                 exit 1
370                 ;;
371         # Recognize the basic CPU types with company name.
372         580-* \
373         | a29k-* \
374         | aarch64-* | aarch64_be-* \
375         | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
376         | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
377         | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
378         | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
379         | avr-* | avr32-* \
380         | ba-* \
381         | be32-* | be64-* \
382         | bfin-* | bs2000-* \
383         | c[123]* | c30-* | [cjt]90-* | c4x-* \
384         | c8051-* | clipper-* | craynv-* | cydra-* \
385         | d10v-* | d30v-* | dlx-* \
386         | e2k-* | elxsi-* \
387         | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
388         | h8300-* | h8500-* \
389         | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
390         | hexagon-* \
391         | i*86-* | i860-* | i960-* | ia64-* \
392         | ip2k-* | iq2000-* \
393         | k1om-* \
394         | le32-* | le64-* \
395         | lm32-* \
396         | m32c-* | m32r-* | m32rle-* \
397         | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
398         | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
399         | microblaze-* | microblazeel-* \
400         | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
401         | mips16-* \
402         | mips64-* | mips64el-* \
403         | mips64octeon-* | mips64octeonel-* \
404         | mips64orion-* | mips64orionel-* \
405         | mips64r5900-* | mips64r5900el-* \
406         | mips64vr-* | mips64vrel-* \
407         | mips64vr4100-* | mips64vr4100el-* \
408         | mips64vr4300-* | mips64vr4300el-* \
409         | mips64vr5000-* | mips64vr5000el-* \
410         | mips64vr5900-* | mips64vr5900el-* \
411         | mipsisa32-* | mipsisa32el-* \
412         | mipsisa32r2-* | mipsisa32r2el-* \
413         | mipsisa32r6-* | mipsisa32r6el-* \
414         | mipsisa64-* | mipsisa64el-* \
415         | mipsisa64r2-* | mipsisa64r2el-* \
416         | mipsisa64r6-* | mipsisa64r6el-* \
417         | mipsisa64sb1-* | mipsisa64sb1el-* \
418         | mipsisa64sr71k-* | mipsisa64sr71kel-* \
419         | mipsr5900-* | mipsr5900el-* \
420         | mipstx39-* | mipstx39el-* \
421         | mmix-* \
422         | mt-* \
423         | msp430-* \
424         | nds32-* | nds32le-* | nds32be-* \
425         | nios-* | nios2-* | nios2eb-* | nios2el-* \
426         | none-* | np1-* | ns16k-* | ns32k-* \
427         | open8-* \
428         | or1k*-* \
429         | orion-* \
430         | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
431         | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
432         | pru-* \
433         | pyramid-* \
434         | riscv32-* | riscv64-* \
435         | rl78-* | romp-* | rs6000-* | rx-* \
436         | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
437         | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
438         | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
439         | sparclite-* \
440         | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
441         | tahoe-* \
442         | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
443         | tile*-* \
444         | tron-* \
445         | ubicom32-* \
446         | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
447         | vax-* \
448         | visium-* \
449         | we32k-* \
450         | x86-* | x86_64-* | xc16x-* | xps100-* \
451         | xstormy16-* | xtensa*-* \
452         | ymp-* \
453         | z8k-* | z80-*)
454                 ;;
455         # Recognize the basic CPU types without company name, with glob match.
456         xtensa*)
457                 basic_machine=$basic_machine-unknown
458                 ;;
459         # Recognize the various machine names and aliases which stand
460         # for a CPU type and a company and sometimes even an OS.
461         386bsd)
462                 basic_machine=i386-unknown
463                 os=-bsd
464                 ;;
465         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
466                 basic_machine=m68000-att
467                 ;;
468         3b*)
469                 basic_machine=we32k-att
470                 ;;
471         a29khif)
472                 basic_machine=a29k-amd
473                 os=-udi
474                 ;;
475         abacus)
476                 basic_machine=abacus-unknown
477                 ;;
478         adobe68k)
479                 basic_machine=m68010-adobe
480                 os=-scout
481                 ;;
482         alliant | fx80)
483                 basic_machine=fx80-alliant
484                 ;;
485         altos | altos3068)
486                 basic_machine=m68k-altos
487                 ;;
488         am29k)
489                 basic_machine=a29k-none
490                 os=-bsd
491                 ;;
492         amd64)
493                 basic_machine=x86_64-pc
494                 ;;
495         amd64-*)
496                 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
497                 ;;
498         amdahl)
499                 basic_machine=580-amdahl
500                 os=-sysv
501                 ;;
502         amiga | amiga-*)
503                 basic_machine=m68k-unknown
504                 ;;
505         amigaos | amigados)
506                 basic_machine=m68k-unknown
507                 os=-amigaos
508                 ;;
509         amigaunix | amix)
510                 basic_machine=m68k-unknown
511                 os=-sysv4
512                 ;;
513         apollo68)
514                 basic_machine=m68k-apollo
515                 os=-sysv
516                 ;;
517         apollo68bsd)
518                 basic_machine=m68k-apollo
519                 os=-bsd
520                 ;;
521         aros)
522                 basic_machine=i386-pc
523                 os=-aros
524                 ;;
525         asmjs)
526                 basic_machine=asmjs-unknown
527                 ;;
528         aux)
529                 basic_machine=m68k-apple
530                 os=-aux
531                 ;;
532         balance)
533                 basic_machine=ns32k-sequent
534                 os=-dynix
535                 ;;
536         blackfin)
537                 basic_machine=bfin-unknown
538                 os=-linux
539                 ;;
540         blackfin-*)
541                 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
542                 os=-linux
543                 ;;
544         bluegene*)
545                 basic_machine=powerpc-ibm
546                 os=-cnk
547                 ;;
548         c54x-*)
549                 basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
550                 ;;
551         c55x-*)
552                 basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
553                 ;;
554         c6x-*)
555                 basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
556                 ;;
557         c90)
558                 basic_machine=c90-cray
559                 os=-unicos
560                 ;;
561         cegcc)
562                 basic_machine=arm-unknown
563                 os=-cegcc
564                 ;;
565         convex-c1)
566                 basic_machine=c1-convex
567                 os=-bsd
568                 ;;
569         convex-c2)
570                 basic_machine=c2-convex
571                 os=-bsd
572                 ;;
573         convex-c32)
574                 basic_machine=c32-convex
575                 os=-bsd
576                 ;;
577         convex-c34)
578                 basic_machine=c34-convex
579                 os=-bsd
580                 ;;
581         convex-c38)
582                 basic_machine=c38-convex
583                 os=-bsd
584                 ;;
585         cray | j90)
586                 basic_machine=j90-cray
587                 os=-unicos
588                 ;;
589         craynv)
590                 basic_machine=craynv-cray
591                 os=-unicosmp
592                 ;;
593         cr16 | cr16-*)
594                 basic_machine=cr16-unknown
595                 os=-elf
596                 ;;
597         crds | unos)
598                 basic_machine=m68k-crds
599                 ;;
600         crisv32 | crisv32-* | etraxfs*)
601                 basic_machine=crisv32-axis
602                 ;;
603         cris | cris-* | etrax*)
604                 basic_machine=cris-axis
605                 ;;
606         crx)
607                 basic_machine=crx-unknown
608                 os=-elf
609                 ;;
610         da30 | da30-*)
611                 basic_machine=m68k-da30
612                 ;;
613         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
614                 basic_machine=mips-dec
615                 ;;
616         decsystem10* | dec10*)
617                 basic_machine=pdp10-dec
618                 os=-tops10
619                 ;;
620         decsystem20* | dec20*)
621                 basic_machine=pdp10-dec
622                 os=-tops20
623                 ;;
624         delta | 3300 | motorola-3300 | motorola-delta \
625               | 3300-motorola | delta-motorola)
626                 basic_machine=m68k-motorola
627                 ;;
628         delta88)
629                 basic_machine=m88k-motorola
630                 os=-sysv3
631                 ;;
632         dicos)
633                 basic_machine=i686-pc
634                 os=-dicos
635                 ;;
636         djgpp)
637                 basic_machine=i586-pc
638                 os=-msdosdjgpp
639                 ;;
640         dpx20 | dpx20-*)
641                 basic_machine=rs6000-bull
642                 os=-bosx
643                 ;;
644         dpx2* | dpx2*-bull)
645                 basic_machine=m68k-bull
646                 os=-sysv3
647                 ;;
648         e500v[12])
649                 basic_machine=powerpc-unknown
650                 os=$os"spe"
651                 ;;
652         e500v[12]-*)
653                 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
654                 os=$os"spe"
655                 ;;
656         ebmon29k)
657                 basic_machine=a29k-amd
658                 os=-ebmon
659                 ;;
660         elxsi)
661                 basic_machine=elxsi-elxsi
662                 os=-bsd
663                 ;;
664         encore | umax | mmax)
665                 basic_machine=ns32k-encore
666                 ;;
667         es1800 | OSE68k | ose68k | ose | OSE)
668                 basic_machine=m68k-ericsson
669                 os=-ose
670                 ;;
671         fx2800)
672                 basic_machine=i860-alliant
673                 ;;
674         genix)
675                 basic_machine=ns32k-ns
676                 ;;
677         gmicro)
678                 basic_machine=tron-gmicro
679                 os=-sysv
680                 ;;
681         go32)
682                 basic_machine=i386-pc
683                 os=-go32
684                 ;;
685         h3050r* | hiux*)
686                 basic_machine=hppa1.1-hitachi
687                 os=-hiuxwe2
688                 ;;
689         h8300hms)
690                 basic_machine=h8300-hitachi
691                 os=-hms
692                 ;;
693         h8300xray)
694                 basic_machine=h8300-hitachi
695                 os=-xray
696                 ;;
697         h8500hms)
698                 basic_machine=h8500-hitachi
699                 os=-hms
700                 ;;
701         harris)
702                 basic_machine=m88k-harris
703                 os=-sysv3
704                 ;;
705         hp300-*)
706                 basic_machine=m68k-hp
707                 ;;
708         hp300bsd)
709                 basic_machine=m68k-hp
710                 os=-bsd
711                 ;;
712         hp300hpux)
713                 basic_machine=m68k-hp
714                 os=-hpux
715                 ;;
716         hp3k9[0-9][0-9] | hp9[0-9][0-9])
717                 basic_machine=hppa1.0-hp
718                 ;;
719         hp9k2[0-9][0-9] | hp9k31[0-9])
720                 basic_machine=m68000-hp
721                 ;;
722         hp9k3[2-9][0-9])
723                 basic_machine=m68k-hp
724                 ;;
725         hp9k6[0-9][0-9] | hp6[0-9][0-9])
726                 basic_machine=hppa1.0-hp
727                 ;;
728         hp9k7[0-79][0-9] | hp7[0-79][0-9])
729                 basic_machine=hppa1.1-hp
730                 ;;
731         hp9k78[0-9] | hp78[0-9])
732                 # FIXME: really hppa2.0-hp
733                 basic_machine=hppa1.1-hp
734                 ;;
735         hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
736                 # FIXME: really hppa2.0-hp
737                 basic_machine=hppa1.1-hp
738                 ;;
739         hp9k8[0-9][13679] | hp8[0-9][13679])
740                 basic_machine=hppa1.1-hp
741                 ;;
742         hp9k8[0-9][0-9] | hp8[0-9][0-9])
743                 basic_machine=hppa1.0-hp
744                 ;;
745         hppa-next)
746                 os=-nextstep3
747                 ;;
748         hppaosf)
749                 basic_machine=hppa1.1-hp
750                 os=-osf
751                 ;;
752         hppro)
753                 basic_machine=hppa1.1-hp
754                 os=-proelf
755                 ;;
756         i370-ibm* | ibm*)
757                 basic_machine=i370-ibm
758                 ;;
759         i*86v32)
760                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
761                 os=-sysv32
762                 ;;
763         i*86v4*)
764                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
765                 os=-sysv4
766                 ;;
767         i*86v)
768                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
769                 os=-sysv
770                 ;;
771         i*86sol2)
772                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
773                 os=-solaris2
774                 ;;
775         i386mach)
776                 basic_machine=i386-mach
777                 os=-mach
778                 ;;
779         i386-vsta | vsta)
780                 basic_machine=i386-unknown
781                 os=-vsta
782                 ;;
783         iris | iris4d)
784                 basic_machine=mips-sgi
785                 case $os in
786                     -irix*)
787                         ;;
788                     *)
789                         os=-irix4
790                         ;;
791                 esac
792                 ;;
793         isi68 | isi)
794                 basic_machine=m68k-isi
795                 os=-sysv
796                 ;;
797         leon-*|leon[3-9]-*)
798                 basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
799                 ;;
800         m68knommu)
801                 basic_machine=m68k-unknown
802                 os=-linux
803                 ;;
804         m68knommu-*)
805                 basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
806                 os=-linux
807                 ;;
808         m88k-omron*)
809                 basic_machine=m88k-omron
810                 ;;
811         magnum | m3230)
812                 basic_machine=mips-mips
813                 os=-sysv
814                 ;;
815         merlin)
816                 basic_machine=ns32k-utek
817                 os=-sysv
818                 ;;
819         microblaze*)
820                 basic_machine=microblaze-xilinx
821                 ;;
822         mingw64)
823                 basic_machine=x86_64-pc
824                 os=-mingw64
825                 ;;
826         mingw32)
827                 basic_machine=i686-pc
828                 os=-mingw32
829                 ;;
830         mingw32ce)
831                 basic_machine=arm-unknown
832                 os=-mingw32ce
833                 ;;
834         miniframe)
835                 basic_machine=m68000-convergent
836                 ;;
837         *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
838                 basic_machine=m68k-atari
839                 os=-mint
840                 ;;
841         mipsEE* | ee | ps2)
842                 basic_machine=mips64r5900el-scei
843                 case $os in
844                     -linux*)
845                         ;;
846                     *)
847                         os=-elf
848                         ;;
849                 esac
850                 ;;
851         iop)
852                 basic_machine=mipsel-scei
853                 os=-irx
854                 ;;
855         dvp)
856                 basic_machine=dvp-scei
857                 os=-elf
858                 ;;
859         mips3*-*)
860                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
861                 ;;
862         mips3*)
863                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
864                 ;;
865         monitor)
866                 basic_machine=m68k-rom68k
867                 os=-coff
868                 ;;
869         morphos)
870                 basic_machine=powerpc-unknown
871                 os=-morphos
872                 ;;
873         moxiebox)
874                 basic_machine=moxie-unknown
875                 os=-moxiebox
876                 ;;
877         msdos)
878                 basic_machine=i386-pc
879                 os=-msdos
880                 ;;
881         ms1-*)
882                 basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
883                 ;;
884         msys)
885                 basic_machine=i686-pc
886                 os=-msys
887                 ;;
888         mvs)
889                 basic_machine=i370-ibm
890                 os=-mvs
891                 ;;
892         nacl)
893                 basic_machine=le32-unknown
894                 os=-nacl
895                 ;;
896         ncr3000)
897                 basic_machine=i486-ncr
898                 os=-sysv4
899                 ;;
900         netbsd386)
901                 basic_machine=i386-unknown
902                 os=-netbsd
903                 ;;
904         netwinder)
905                 basic_machine=armv4l-rebel
906                 os=-linux
907                 ;;
908         news | news700 | news800 | news900)
909                 basic_machine=m68k-sony
910                 os=-newsos
911                 ;;
912         news1000)
913                 basic_machine=m68030-sony
914                 os=-newsos
915                 ;;
916         news-3600 | risc-news)
917                 basic_machine=mips-sony
918                 os=-newsos
919                 ;;
920         necv70)
921                 basic_machine=v70-nec
922                 os=-sysv
923                 ;;
924         next | m*-next )
925                 basic_machine=m68k-next
926                 case $os in
927                     -nextstep* )
928                         ;;
929                     -ns2*)
930                       os=-nextstep2
931                         ;;
932                     *)
933                       os=-nextstep3
934                         ;;
935                 esac
936                 ;;
937         nh3000)
938                 basic_machine=m68k-harris
939                 os=-cxux
940                 ;;
941         nh[45]000)
942                 basic_machine=m88k-harris
943                 os=-cxux
944                 ;;
945         nindy960)
946                 basic_machine=i960-intel
947                 os=-nindy
948                 ;;
949         mon960)
950                 basic_machine=i960-intel
951                 os=-mon960
952                 ;;
953         nonstopux)
954                 basic_machine=mips-compaq
955                 os=-nonstopux
956                 ;;
957         np1)
958                 basic_machine=np1-gould
959                 ;;
960         neo-tandem)
961                 basic_machine=neo-tandem
962                 ;;
963         nse-tandem)
964                 basic_machine=nse-tandem
965                 ;;
966         nsr-tandem)
967                 basic_machine=nsr-tandem
968                 ;;
969         op50n-* | op60c-*)
970                 basic_machine=hppa1.1-oki
971                 os=-proelf
972                 ;;
973         openrisc | openrisc-*)
974                 basic_machine=or32-unknown
975                 ;;
976         os400)
977                 basic_machine=powerpc-ibm
978                 os=-os400
979                 ;;
980         OSE68000 | ose68000)
981                 basic_machine=m68000-ericsson
982                 os=-ose
983                 ;;
984         os68k)
985                 basic_machine=m68k-none
986                 os=-os68k
987                 ;;
988         pa-hitachi)
989                 basic_machine=hppa1.1-hitachi
990                 os=-hiuxwe2
991                 ;;
992         paragon)
993                 basic_machine=i860-intel
994                 os=-osf
995                 ;;
996         parisc)
997                 basic_machine=hppa-unknown
998                 os=-linux
999                 ;;
1000         parisc-*)
1001                 basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
1002                 os=-linux
1003                 ;;
1004         pbd)
1005                 basic_machine=sparc-tti
1006                 ;;
1007         pbb)
1008                 basic_machine=m68k-tti
1009                 ;;
1010         pc532 | pc532-*)
1011                 basic_machine=ns32k-pc532
1012                 ;;
1013         pc98)
1014                 basic_machine=i386-pc
1015                 ;;
1016         pc98-*)
1017                 basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
1018                 ;;
1019         pentium | p5 | k5 | k6 | nexgen | viac3)
1020                 basic_machine=i586-pc
1021                 ;;
1022         pentiumpro | p6 | 6x86 | athlon | athlon_*)
1023                 basic_machine=i686-pc
1024                 ;;
1025         pentiumii | pentium2 | pentiumiii | pentium3)
1026                 basic_machine=i686-pc
1027                 ;;
1028         pentium4)
1029                 basic_machine=i786-pc
1030                 ;;
1031         pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1032                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
1033                 ;;
1034         pentiumpro-* | p6-* | 6x86-* | athlon-*)
1035                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1036                 ;;
1037         pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1038                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
1039                 ;;
1040         pentium4-*)
1041                 basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
1042                 ;;
1043         pn)
1044                 basic_machine=pn-gould
1045                 ;;
1046         power)  basic_machine=power-ibm
1047                 ;;
1048         ppc | ppcbe)    basic_machine=powerpc-unknown
1049                 ;;
1050         ppc-* | ppcbe-*)
1051                 basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
1052                 ;;
1053         ppcle | powerpclittle)
1054                 basic_machine=powerpcle-unknown
1055                 ;;
1056         ppcle-* | powerpclittle-*)
1057                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
1058                 ;;
1059         ppc64)  basic_machine=powerpc64-unknown
1060                 ;;
1061         ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
1062                 ;;
1063         ppc64le | powerpc64little)
1064                 basic_machine=powerpc64le-unknown
1065                 ;;
1066         ppc64le-* | powerpc64little-*)
1067                 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
1068                 ;;
1069         ps2)
1070                 basic_machine=i386-ibm
1071                 ;;
1072         pw32)
1073                 basic_machine=i586-unknown
1074                 os=-pw32
1075                 ;;
1076         rdos | rdos64)
1077                 basic_machine=x86_64-pc
1078                 os=-rdos
1079                 ;;
1080         rdos32)
1081                 basic_machine=i386-pc
1082                 os=-rdos
1083                 ;;
1084         rom68k)
1085                 basic_machine=m68k-rom68k
1086                 os=-coff
1087                 ;;
1088         rm[46]00)
1089                 basic_machine=mips-siemens
1090                 ;;
1091         rtpc | rtpc-*)
1092                 basic_machine=romp-ibm
1093                 ;;
1094         s390 | s390-*)
1095                 basic_machine=s390-ibm
1096                 ;;
1097         s390x | s390x-*)
1098                 basic_machine=s390x-ibm
1099                 ;;
1100         sa29200)
1101                 basic_machine=a29k-amd
1102                 os=-udi
1103                 ;;
1104         sb1)
1105                 basic_machine=mipsisa64sb1-unknown
1106                 ;;
1107         sb1el)
1108                 basic_machine=mipsisa64sb1el-unknown
1109                 ;;
1110         sde)
1111                 basic_machine=mipsisa32-sde
1112                 os=-elf
1113                 ;;
1114         sei)
1115                 basic_machine=mips-sei
1116                 os=-seiux
1117                 ;;
1118         sequent)
1119                 basic_machine=i386-sequent
1120                 ;;
1121         sh)
1122                 basic_machine=sh-hitachi
1123                 os=-hms
1124                 ;;
1125         sh5el)
1126                 basic_machine=sh5le-unknown
1127                 ;;
1128         sh64)
1129                 basic_machine=sh64-unknown
1130                 ;;
1131         sparclite-wrs | simso-wrs)
1132                 basic_machine=sparclite-wrs
1133                 os=-vxworks
1134                 ;;
1135         sps7)
1136                 basic_machine=m68k-bull
1137                 os=-sysv2
1138                 ;;
1139         spur)
1140                 basic_machine=spur-unknown
1141                 ;;
1142         st2000)
1143                 basic_machine=m68k-tandem
1144                 ;;
1145         stratus)
1146                 basic_machine=i860-stratus
1147                 os=-sysv4
1148                 ;;
1149         strongarm-* | thumb-*)
1150                 basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1151                 ;;
1152         sun2)
1153                 basic_machine=m68000-sun
1154                 ;;
1155         sun2os3)
1156                 basic_machine=m68000-sun
1157                 os=-sunos3
1158                 ;;
1159         sun2os4)
1160                 basic_machine=m68000-sun
1161                 os=-sunos4
1162                 ;;
1163         sun3os3)
1164                 basic_machine=m68k-sun
1165                 os=-sunos3
1166                 ;;
1167         sun3os4)
1168                 basic_machine=m68k-sun
1169                 os=-sunos4
1170                 ;;
1171         sun4os3)
1172                 basic_machine=sparc-sun
1173                 os=-sunos3
1174                 ;;
1175         sun4os4)
1176                 basic_machine=sparc-sun
1177                 os=-sunos4
1178                 ;;
1179         sun4sol2)
1180                 basic_machine=sparc-sun
1181                 os=-solaris2
1182                 ;;
1183         sun3 | sun3-*)
1184                 basic_machine=m68k-sun
1185                 ;;
1186         sun4)
1187                 basic_machine=sparc-sun
1188                 ;;
1189         sun386 | sun386i | roadrunner)
1190                 basic_machine=i386-sun
1191                 ;;
1192         sv1)
1193                 basic_machine=sv1-cray
1194                 os=-unicos
1195                 ;;
1196         symmetry)
1197                 basic_machine=i386-sequent
1198                 os=-dynix
1199                 ;;
1200         t3e)
1201                 basic_machine=alphaev5-cray
1202                 os=-unicos
1203                 ;;
1204         t90)
1205                 basic_machine=t90-cray
1206                 os=-unicos
1207                 ;;
1208         tile*)
1209                 basic_machine=$basic_machine-unknown
1210                 os=-linux-gnu
1211                 ;;
1212         tx39)
1213                 basic_machine=mipstx39-unknown
1214                 ;;
1215         tx39el)
1216                 basic_machine=mipstx39el-unknown
1217                 ;;
1218         toad1)
1219                 basic_machine=pdp10-xkl
1220                 os=-tops20
1221                 ;;
1222         tower | tower-32)
1223                 basic_machine=m68k-ncr
1224                 ;;
1225         tpf)
1226                 basic_machine=s390x-ibm
1227                 os=-tpf
1228                 ;;
1229         udi29k)
1230                 basic_machine=a29k-amd
1231                 os=-udi
1232                 ;;
1233         ultra3)
1234                 basic_machine=a29k-nyu
1235                 os=-sym1
1236                 ;;
1237         v810 | necv810)
1238                 basic_machine=v810-nec
1239                 os=-none
1240                 ;;
1241         vaxv)
1242                 basic_machine=vax-dec
1243                 os=-sysv
1244                 ;;
1245         vms)
1246                 basic_machine=vax-dec
1247                 os=-vms
1248                 ;;
1249         vpp*|vx|vx-*)
1250                 basic_machine=f301-fujitsu
1251                 ;;
1252         vxworks960)
1253                 basic_machine=i960-wrs
1254                 os=-vxworks
1255                 ;;
1256         vxworks68)
1257                 basic_machine=m68k-wrs
1258                 os=-vxworks
1259                 ;;
1260         vxworks29k)
1261                 basic_machine=a29k-wrs
1262                 os=-vxworks
1263                 ;;
1264         w65*)
1265                 basic_machine=w65-wdc
1266                 os=-none
1267                 ;;
1268         w89k-*)
1269                 basic_machine=hppa1.1-winbond
1270                 os=-proelf
1271                 ;;
1272         xbox)
1273                 basic_machine=i686-pc
1274                 os=-mingw32
1275                 ;;
1276         xps | xps100)
1277                 basic_machine=xps100-honeywell
1278                 ;;
1279         xscale-* | xscalee[bl]-*)
1280                 basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1281                 ;;
1282         ymp)
1283                 basic_machine=ymp-cray
1284                 os=-unicos
1285                 ;;
1286         z8k-*-coff)
1287                 basic_machine=z8k-unknown
1288                 os=-sim
1289                 ;;
1290         z80-*-coff)
1291                 basic_machine=z80-unknown
1292                 os=-sim
1293                 ;;
1294         none)
1295                 basic_machine=none-none
1296                 os=-none
1297                 ;;
1298
1299 # Here we handle the default manufacturer of certain CPU types.  It is in
1300 # some cases the only manufacturer, in others, it is the most popular.
1301         w89k)
1302                 basic_machine=hppa1.1-winbond
1303                 ;;
1304         op50n)
1305                 basic_machine=hppa1.1-oki
1306                 ;;
1307         op60c)
1308                 basic_machine=hppa1.1-oki
1309                 ;;
1310         romp)
1311                 basic_machine=romp-ibm
1312                 ;;
1313         mmix)
1314                 basic_machine=mmix-knuth
1315                 ;;
1316         rs6000)
1317                 basic_machine=rs6000-ibm
1318                 ;;
1319         vax)
1320                 basic_machine=vax-dec
1321                 ;;
1322         pdp10)
1323                 # there are many clones, so DEC is not a safe bet
1324                 basic_machine=pdp10-unknown
1325                 ;;
1326         pdp11)
1327                 basic_machine=pdp11-dec
1328                 ;;
1329         we32k)
1330                 basic_machine=we32k-att
1331                 ;;
1332         sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1333                 basic_machine=sh-unknown
1334                 ;;
1335         sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1336                 basic_machine=sparc-sun
1337                 ;;
1338         cydra)
1339                 basic_machine=cydra-cydrome
1340                 ;;
1341         orion)
1342                 basic_machine=orion-highlevel
1343                 ;;
1344         orion105)
1345                 basic_machine=clipper-highlevel
1346                 ;;
1347         mac | mpw | mac-mpw)
1348                 basic_machine=m68k-apple
1349                 ;;
1350         pmac | pmac-mpw)
1351                 basic_machine=powerpc-apple
1352                 ;;
1353         *-unknown)
1354                 # Make sure to match an already-canonicalized machine name.
1355                 ;;
1356         *)
1357                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1358                 exit 1
1359                 ;;
1360 esac
1361
1362 # Here we canonicalize certain aliases for manufacturers.
1363 case $basic_machine in
1364         *-digital*)
1365                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1366                 ;;
1367         *-commodore*)
1368                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1369                 ;;
1370         *)
1371                 ;;
1372 esac
1373
1374 # Decode manufacturer-specific aliases for certain operating systems.
1375
1376 if [ x"$os" != x"" ]
1377 then
1378 case $os in
1379         # First match some system type aliases
1380         # that might get confused with valid system types.
1381         # -solaris* is a basic system type, with this one exception.
1382         -auroraux)
1383                 os=-auroraux
1384                 ;;
1385         -solaris1 | -solaris1.*)
1386                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1387                 ;;
1388         -solaris)
1389                 os=-solaris2
1390                 ;;
1391         -svr4*)
1392                 os=-sysv4
1393                 ;;
1394         -unixware*)
1395                 os=-sysv4.2uw
1396                 ;;
1397         -gnu/linux*)
1398                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1399                 ;;
1400         # First accept the basic system types.
1401         # The portable systems comes first.
1402         # Each alternative MUST END IN A *, to match a version number.
1403         # -sysv* is not here because it comes later, after sysvr4.
1404         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1405               | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1406               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1407               | -sym* | -kopensolaris* | -plan9* \
1408               | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1409               | -aos* | -aros* | -cloudabi* | -sortix* \
1410               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1411               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1412               | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1413               | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
1414               | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1415               | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1416               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1417               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1418               | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
1419               | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1420               | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1421               | -linux-newlib* | -linux-musl* | -linux-uclibc* \
1422               | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
1423               | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1424               | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1425               | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \
1426               | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1427               | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1428               | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1429               | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
1430               | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
1431         # Remember, each alternative MUST END IN *, to match a version number.
1432                 ;;
1433         -qnx*)
1434                 case $basic_machine in
1435                     x86-* | i*86-*)
1436                         ;;
1437                     *)
1438                         os=-nto$os
1439                         ;;
1440                 esac
1441                 ;;
1442         -nto-qnx*)
1443                 ;;
1444         -nto*)
1445                 os=`echo $os | sed -e 's|nto|nto-qnx|'`
1446                 ;;
1447         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1448               | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1449               | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1450                 ;;
1451         -mac*)
1452                 os=`echo $os | sed -e 's|mac|macos|'`
1453                 ;;
1454         -linux-dietlibc)
1455                 os=-linux-dietlibc
1456                 ;;
1457         -linux*)
1458                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1459                 ;;
1460         -sunos5*)
1461                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1462                 ;;
1463         -sunos6*)
1464                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1465                 ;;
1466         -opened*)
1467                 os=-openedition
1468                 ;;
1469         -os400*)
1470                 os=-os400
1471                 ;;
1472         -wince*)
1473                 os=-wince
1474                 ;;
1475         -osfrose*)
1476                 os=-osfrose
1477                 ;;
1478         -osf*)
1479                 os=-osf
1480                 ;;
1481         -utek*)
1482                 os=-bsd
1483                 ;;
1484         -dynix*)
1485                 os=-bsd
1486                 ;;
1487         -acis*)
1488                 os=-aos
1489                 ;;
1490         -atheos*)
1491                 os=-atheos
1492                 ;;
1493         -syllable*)
1494                 os=-syllable
1495                 ;;
1496         -386bsd)
1497                 os=-bsd
1498                 ;;
1499         -ctix* | -uts*)
1500                 os=-sysv
1501                 ;;
1502         -nova*)
1503                 os=-rtmk-nova
1504                 ;;
1505         -ns2 )
1506                 os=-nextstep2
1507                 ;;
1508         -nsk*)
1509                 os=-nsk
1510                 ;;
1511         # Preserve the version number of sinix5.
1512         -sinix5.*)
1513                 os=`echo $os | sed -e 's|sinix|sysv|'`
1514                 ;;
1515         -sinix*)
1516                 os=-sysv4
1517                 ;;
1518         -tpf*)
1519                 os=-tpf
1520                 ;;
1521         -triton*)
1522                 os=-sysv3
1523                 ;;
1524         -oss*)
1525                 os=-sysv3
1526                 ;;
1527         -svr4)
1528                 os=-sysv4
1529                 ;;
1530         -svr3)
1531                 os=-sysv3
1532                 ;;
1533         -sysvr4)
1534                 os=-sysv4
1535                 ;;
1536         # This must come after -sysvr4.
1537         -sysv*)
1538                 ;;
1539         -ose*)
1540                 os=-ose
1541                 ;;
1542         -es1800*)
1543                 os=-ose
1544                 ;;
1545         -xenix)
1546                 os=-xenix
1547                 ;;
1548         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1549                 os=-mint
1550                 ;;
1551         -aros*)
1552                 os=-aros
1553                 ;;
1554         -zvmoe)
1555                 os=-zvmoe
1556                 ;;
1557         -dicos*)
1558                 os=-dicos
1559                 ;;
1560         -nacl*)
1561                 ;;
1562         -ios)
1563                 ;;
1564         -none)
1565                 ;;
1566         *)
1567                 # Get rid of the `-' at the beginning of $os.
1568                 os=`echo $os | sed 's/[^-]*-//'`
1569                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1570                 exit 1
1571                 ;;
1572 esac
1573 else
1574
1575 # Here we handle the default operating systems that come with various machines.
1576 # The value should be what the vendor currently ships out the door with their
1577 # machine or put another way, the most popular os provided with the machine.
1578
1579 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1580 # "-sun"), then you have to tell the case statement up towards the top
1581 # that MANUFACTURER isn't an operating system.  Otherwise, code above
1582 # will signal an error saying that MANUFACTURER isn't an operating
1583 # system, and we'll never get to this point.
1584
1585 case $basic_machine in
1586         score-*)
1587                 os=-elf
1588                 ;;
1589         spu-*)
1590                 os=-elf
1591                 ;;
1592         *-acorn)
1593                 os=-riscix1.2
1594                 ;;
1595         arm*-rebel)
1596                 os=-linux
1597                 ;;
1598         arm*-semi)
1599                 os=-aout
1600                 ;;
1601         c4x-* | tic4x-*)
1602                 os=-coff
1603                 ;;
1604         c8051-*)
1605                 os=-elf
1606                 ;;
1607         hexagon-*)
1608                 os=-elf
1609                 ;;
1610         tic54x-*)
1611                 os=-coff
1612                 ;;
1613         tic55x-*)
1614                 os=-coff
1615                 ;;
1616         tic6x-*)
1617                 os=-coff
1618                 ;;
1619         # This must come before the *-dec entry.
1620         pdp10-*)
1621                 os=-tops20
1622                 ;;
1623         pdp11-*)
1624                 os=-none
1625                 ;;
1626         *-dec | vax-*)
1627                 os=-ultrix4.2
1628                 ;;
1629         m68*-apollo)
1630                 os=-domain
1631                 ;;
1632         i386-sun)
1633                 os=-sunos4.0.2
1634                 ;;
1635         m68000-sun)
1636                 os=-sunos3
1637                 ;;
1638         m68*-cisco)
1639                 os=-aout
1640                 ;;
1641         mep-*)
1642                 os=-elf
1643                 ;;
1644         mips*-cisco)
1645                 os=-elf
1646                 ;;
1647         mips*-*)
1648                 os=-elf
1649                 ;;
1650         or32-*)
1651                 os=-coff
1652                 ;;
1653         *-tti)  # must be before sparc entry or we get the wrong os.
1654                 os=-sysv3
1655                 ;;
1656         sparc-* | *-sun)
1657                 os=-sunos4.1.1
1658                 ;;
1659         pru-*)
1660                 os=-elf
1661                 ;;
1662         *-be)
1663                 os=-beos
1664                 ;;
1665         *-haiku)
1666                 os=-haiku
1667                 ;;
1668         *-ibm)
1669                 os=-aix
1670                 ;;
1671         *-knuth)
1672                 os=-mmixware
1673                 ;;
1674         *-wec)
1675                 os=-proelf
1676                 ;;
1677         *-winbond)
1678                 os=-proelf
1679                 ;;
1680         *-oki)
1681                 os=-proelf
1682                 ;;
1683         *-hp)
1684                 os=-hpux
1685                 ;;
1686         *-hitachi)
1687                 os=-hiux
1688                 ;;
1689         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1690                 os=-sysv
1691                 ;;
1692         *-cbm)
1693                 os=-amigaos
1694                 ;;
1695         *-dg)
1696                 os=-dgux
1697                 ;;
1698         *-dolphin)
1699                 os=-sysv3
1700                 ;;
1701         m68k-ccur)
1702                 os=-rtu
1703                 ;;
1704         m88k-omron*)
1705                 os=-luna
1706                 ;;
1707         *-next )
1708                 os=-nextstep
1709                 ;;
1710         *-sequent)
1711                 os=-ptx
1712                 ;;
1713         *-crds)
1714                 os=-unos
1715                 ;;
1716         *-ns)
1717                 os=-genix
1718                 ;;
1719         i370-*)
1720                 os=-mvs
1721                 ;;
1722         *-next)
1723                 os=-nextstep3
1724                 ;;
1725         *-gould)
1726                 os=-sysv
1727                 ;;
1728         *-highlevel)
1729                 os=-bsd
1730                 ;;
1731         *-encore)
1732                 os=-bsd
1733                 ;;
1734         *-sgi)
1735                 os=-irix
1736                 ;;
1737         *-siemens)
1738                 os=-sysv4
1739                 ;;
1740         *-masscomp)
1741                 os=-rtu
1742                 ;;
1743         f30[01]-fujitsu | f700-fujitsu)
1744                 os=-uxpv
1745                 ;;
1746         *-rom68k)
1747                 os=-coff
1748                 ;;
1749         *-*bug)
1750                 os=-coff
1751                 ;;
1752         *-apple)
1753                 os=-macos
1754                 ;;
1755         *-atari*)
1756                 os=-mint
1757                 ;;
1758         *)
1759                 os=-none
1760                 ;;
1761 esac
1762 fi
1763
1764 # Here we handle the case where we know the os, and the CPU type, but not the
1765 # manufacturer.  We pick the logical manufacturer.
1766 vendor=unknown
1767 case $basic_machine in
1768         *-unknown)
1769                 case $os in
1770                         -riscix*)
1771                                 vendor=acorn
1772                                 ;;
1773                         -sunos*)
1774                                 vendor=sun
1775                                 ;;
1776                         -cnk*|-aix*)
1777                                 vendor=ibm
1778                                 ;;
1779                         -beos*)
1780                                 vendor=be
1781                                 ;;
1782                         -hpux*)
1783                                 vendor=hp
1784                                 ;;
1785                         -mpeix*)
1786                                 vendor=hp
1787                                 ;;
1788                         -hiux*)
1789                                 vendor=hitachi
1790                                 ;;
1791                         -unos*)
1792                                 vendor=crds
1793                                 ;;
1794                         -dgux*)
1795                                 vendor=dg
1796                                 ;;
1797                         -luna*)
1798                                 vendor=omron
1799                                 ;;
1800                         -genix*)
1801                                 vendor=ns
1802                                 ;;
1803                         -mvs* | -opened*)
1804                                 vendor=ibm
1805                                 ;;
1806                         -os400*)
1807                                 vendor=ibm
1808                                 ;;
1809                         -ptx*)
1810                                 vendor=sequent
1811                                 ;;
1812                         -tpf*)
1813                                 vendor=ibm
1814                                 ;;
1815                         -vxsim* | -vxworks* | -windiss*)
1816                                 vendor=wrs
1817                                 ;;
1818                         -aux*)
1819                                 vendor=apple
1820                                 ;;
1821                         -hms*)
1822                                 vendor=hitachi
1823                                 ;;
1824                         -mpw* | -macos*)
1825                                 vendor=apple
1826                                 ;;
1827                         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1828                                 vendor=atari
1829                                 ;;
1830                         -vos*)
1831                                 vendor=stratus
1832                                 ;;
1833                 esac
1834                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1835                 ;;
1836 esac
1837
1838 echo $basic_machine$os
1839 exit
1840
1841 # Local variables:
1842 # eval: (add-hook 'write-file-hooks 'time-stamp)
1843 # time-stamp-start: "timestamp='"
1844 # time-stamp-format: "%:y-%02m-%02d"
1845 # time-stamp-end: "'"
1846 # End: