OSDN Git Service

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