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