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