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