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