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