OSDN Git Service

* config.sub: Accept alphapca56 and alphaev6 properly.
[pf3gnuchains/gcc-fork.git] / config.sub
1 #! /bin/sh
2 # Configuration validation subroutine script, version 1.1.
3 #   Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
4 # This file is (in principle) common to ALL GNU software.
5 # The presence of a machine in this file suggests that SOME GNU software
6 # can handle that machine.  It does not imply ALL GNU software can.
7 #
8 # This file is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330,
21 # Boston, MA 02111-1307, USA.
22
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
27
28 # Configuration subroutine to validate and canonicalize a configuration type.
29 # Supply the specified configuration type as an argument.
30 # If it is invalid, we print an error message on stderr and exit with code 1.
31 # Otherwise, we print the canonical config type on stdout and succeed.
32
33 # This file is supposed to be the same for all GNU packages
34 # and recognize all the CPU types, system types and aliases
35 # that are meaningful with *any* GNU software.
36 # Each package is responsible for reporting which valid configurations
37 # it does not support.  The user should be able to distinguish
38 # a failure to support a valid configuration from a meaningless
39 # configuration.
40
41 # The goal of this file is to map all the various variations of a given
42 # machine specification into a single specification in the form:
43 #       CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
44 # or in some cases, the newer four-part form:
45 #       CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
46 # It is wrong to echo any other type of specification.
47
48 if [ x$1 = x ]
49 then
50         echo Configuration name missing. 1>&2
51         echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
52         echo "or     $0 ALIAS" 1>&2
53         echo where ALIAS is a recognized configuration type. 1>&2
54         exit 1
55 fi
56
57 # First pass through any local machine types.
58 case $1 in
59         *local*)
60                 echo $1
61                 exit 0
62                 ;;
63         *)
64         ;;
65 esac
66
67 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
68 # Here we must recognize all the valid KERNEL-OS combinations.
69 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
70 case $maybe_os in
71   linux-gnu*)
72     os=-$maybe_os
73     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
74     ;;
75   *)
76     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
77     if [ $basic_machine != $1 ]
78     then os=`echo $1 | sed 's/.*-/-/'`
79     else os=; fi
80     ;;
81 esac
82
83 ### Let's recognize common machines as not being operating systems so
84 ### that things like config.sub decstation-3100 work.  We also
85 ### recognize some manufacturers as not being operating systems, so we
86 ### can provide default operating systems below.
87 case $os in
88         -sun*os*)
89                 # Prevent following clause from handling this invalid input.
90                 ;;
91         -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
92         -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
93         -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
94         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
95         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
96         -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
97         -apple)
98                 os=
99                 basic_machine=$1
100                 ;;
101         -sim | -cisco | -oki | -wec | -winbond )        # CYGNUS LOCAL
102                 os=
103                 basic_machine=$1
104                 ;;
105         -scout)                                         # CYGNUS LOCAL
106                 ;;
107         -wrs)                                           # CYGNUS LOCAL
108                 os=vxworks
109                 basic_machine=$1
110                 ;;
111         -hiux*)
112                 os=-hiuxwe2
113                 ;;
114         -sco5)
115                 os=-sco3.2v5
116                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
117                 ;;
118         -sco4)
119                 os=-sco3.2v4
120                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
121                 ;;
122         -sco3.2.[4-9]*)
123                 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
124                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
125                 ;;
126         -sco3.2v[4-9]*)
127                 # Don't forget version if it is 3.2v4 or newer.
128                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
129                 ;;
130         -sco*)
131                 os=-sco3.2v2
132                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
133                 ;;
134         -isc)
135                 os=-isc2.2
136                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
137                 ;;
138         -clix*)
139                 basic_machine=clipper-intergraph
140                 ;;
141         -isc*)
142                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
143                 ;;
144         -lynx*)
145                 os=-lynxos
146                 ;;
147         -ptx*)
148                 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
149                 ;;
150         -windowsnt*)
151                 os=`echo $os | sed -e 's/windowsnt/winnt/'`
152                 ;;
153         -psos*)
154                 os=-psos
155                 ;;
156 esac
157
158 # Decode aliases for certain CPU-COMPANY combinations.
159 case $basic_machine in
160         # Recognize the basic CPU types without company name.
161         # Some are omitted here because they have special meanings below.
162         tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
163                 | arme[lb] | pyramid | mn10200 | mn10300 \
164                 | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
165                 | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \
166                 | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
167                 | 1750a | dsp16xx | pdp11 \
168                 | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
169                 | mipstx39 | mipstx39el \
170                 | sparc | sparclet | sparclite | sparc64 | v850)
171                 basic_machine=$basic_machine-unknown
172                 ;;
173         m88110 | m680[01234]0 | m683?2 | m68360 | z8k | v70 | h8500 | w65) # CYGNUS LOCAL
174                 basic_machine=$basic_machine-unknown
175                 ;;
176         mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith/vr4300
177                 basic_machine=$basic_machine-unknown
178                 ;;
179         mips64vr4100 | mips64vr4100el) # CYGNUS LOCAL jsmith/vr4100
180                 basic_machine=$basic_machine-unknown
181                 ;;
182         mips64vr5000 | mips64vr5000el) # CYGNUS LOCAL ian/vr5000
183                 basic_machine=$basic_machine-unknown
184                 ;;
185         mips16) # CYGNUS LOCAL krk/mips16
186                 basic_machine=$basic_machine-unknown
187                 ;;
188         d10v)                           # CYGNUS LOCAL meissner/d10v
189                 basic_machine=$basic_machine-unknown
190                 ;;
191         # We use `pc' rather than `unknown'
192         # because (1) that's what they normally are, and
193         # (2) the word "unknown" tends to confuse beginning users.
194         i[3456]86)
195           basic_machine=$basic_machine-pc
196           ;;
197         # Object if more than one company name word.
198         *-*-*)
199                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
200                 exit 1
201                 ;;
202         # Recognize the basic CPU types with company name.
203         vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
204               | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
205               | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
206               | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
207               | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
208               | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \
209               | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
210               | xps100-* | clipper-* | orion-* \
211               | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
212               | sparc64-* | mips64-* | mipsel-* \
213               | mips64el-* | mips64orion-* | mips64orionel-* \
214               | mipstx39-* | mipstx39el-* \
215               | f301-*)
216                 ;;
217         m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # CYGNUS LOCAL
218                 ;;
219         mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith/vr4300
220                 ;;
221         mips64vr4100-* | mips64vr4100el-*) # CYGNUS LOCAL jsmith/vr4100
222                 ;;
223         mips16-*) # CYGNUS LOCAL krk/mips16
224                 ;;
225         # Recognize the various machine names and aliases which stand
226         # for a CPU type and a company and sometimes even an OS.
227         386bsd)                                         # CYGNUS LOCAL
228                 basic_machine=i386-unknown
229                 os=-bsd
230                 ;;
231         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
232                 basic_machine=m68000-att
233                 ;;
234         3b*)
235                 basic_machine=we32k-att
236                 ;;
237         a29khif)                                        # CYGNUS LOCAL
238                 basic_machine=a29k-amd
239                 os=-udi
240                 ;;
241         adobe68k)                                       # CYGNUS LOCAL
242                 basic_machine=m68010-adobe
243                 os=-scout
244                 ;;
245         alliant | fx80)
246                 basic_machine=fx80-alliant
247                 ;;
248         altos | altos3068)
249                 basic_machine=m68k-altos
250                 ;;
251         am29k)
252                 basic_machine=a29k-none
253                 os=-bsd
254                 ;;
255         amdahl)
256                 basic_machine=580-amdahl
257                 os=-sysv
258                 ;;
259         amiga | amiga-*)
260                 basic_machine=m68k-cbm
261                 ;;
262         amigaos | amigados)
263                 basic_machine=m68k-cbm
264                 os=-amigaos
265                 ;;
266         amigaunix | amix)
267                 basic_machine=m68k-cbm
268                 os=-sysv4
269                 ;;
270         apollo68)
271                 basic_machine=m68k-apollo
272                 os=-sysv
273                 ;;
274         apollo68bsd)                                    # CYGNUS LOCAL
275                 basic_machine=m68k-apollo
276                 os=-bsd
277                 ;;
278         aux)
279                 basic_machine=m68k-apple
280                 os=-aux
281                 ;;
282         balance)
283                 basic_machine=ns32k-sequent
284                 os=-dynix
285                 ;;
286         convex-c1)
287                 basic_machine=c1-convex
288                 os=-bsd
289                 ;;
290         convex-c2)
291                 basic_machine=c2-convex
292                 os=-bsd
293                 ;;
294         convex-c32)
295                 basic_machine=c32-convex
296                 os=-bsd
297                 ;;
298         convex-c34)
299                 basic_machine=c34-convex
300                 os=-bsd
301                 ;;
302         convex-c38)
303                 basic_machine=c38-convex
304                 os=-bsd
305                 ;;
306         cray | ymp)
307                 basic_machine=ymp-cray
308                 os=-unicos
309                 ;;
310         cray2)
311                 basic_machine=cray2-cray
312                 os=-unicos
313                 ;;
314         [ctj]90-cray)
315                 basic_machine=c90-cray
316                 os=-unicos
317                 ;;
318         crds | unos)
319                 basic_machine=m68k-crds
320                 ;;
321         da30 | da30-*)
322                 basic_machine=m68k-da30
323                 ;;
324         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
325                 basic_machine=mips-dec
326                 ;;
327         delta | 3300 | motorola-3300 | motorola-delta \
328               | 3300-motorola | delta-motorola)
329                 basic_machine=m68k-motorola
330                 ;;
331         delta88)
332                 basic_machine=m88k-motorola
333                 os=-sysv3
334                 ;;
335         dpx20 | dpx20-*)
336                 basic_machine=rs6000-bull
337                 os=-bosx
338                 ;;
339         dpx2* | dpx2*-bull)
340                 basic_machine=m68k-bull
341                 os=-sysv3
342                 ;;
343         ebmon29k)
344                 basic_machine=a29k-amd
345                 os=-ebmon
346                 ;;
347         elxsi)
348                 basic_machine=elxsi-elxsi
349                 os=-bsd
350                 ;;
351         encore | umax | mmax)
352                 basic_machine=ns32k-encore
353                 ;;
354         es1800 | OSE68k | ose68k | ose | OSE)           # CYGNUS LOCAL
355                 basic_machine=m68k-ericsson
356                 os=-ose
357                 ;;
358         fx2800)
359                 basic_machine=i860-alliant
360                 ;;
361         genix)
362                 basic_machine=ns32k-ns
363                 ;;
364         gmicro)
365                 basic_machine=tron-gmicro
366                 os=-sysv
367                 ;;
368         h3050r* | hiux*)
369                 basic_machine=hppa1.1-hitachi
370                 os=-hiuxwe2
371                 ;;
372         h8300hms)
373                 basic_machine=h8300-hitachi
374                 os=-hms
375                 ;;
376         h8300xray)                                      # CYGNUS LOCAL
377                 basic_machine=h8300-hitachi
378                 os=-xray
379                 ;;
380         h8500hms)                                       # CYGNUS LOCAL
381                 basic_machine=h8500-hitachi
382                 os=-hms
383                 ;;
384         harris)
385                 basic_machine=m88k-harris
386                 os=-sysv3
387                 ;;
388         hp300-*)
389                 basic_machine=m68k-hp
390                 ;;
391         hp300bsd)
392                 basic_machine=m68k-hp
393                 os=-bsd
394                 ;;
395         hp300hpux)
396                 basic_machine=m68k-hp
397                 os=-hpux
398                 ;;
399         w89k-*)                                         # CYGNUS LOCAL
400                 basic_machine=hppa1.1-winbond
401                 os=-proelf
402                 ;;
403         op50n-*)                                        # CYGNUS LOCAL
404                 basic_machine=hppa1.1-oki
405                 os=-proelf
406                 ;;
407         op60c-*)                                        # CYGNUS LOCAL
408                 basic_machine=hppa1.1-oki
409                 os=-proelf
410                 ;;
411         hppro)                                          # CYGNUS LOCAL
412                 basic_machine=hppa1.1-hp
413                 os=-proelf
414                 ;;
415         hp9k2[0-9][0-9] | hp9k31[0-9])
416                 basic_machine=m68000-hp
417                 ;;
418         hp9k3[2-9][0-9])
419                 basic_machine=m68k-hp
420                 ;;
421         hp9k6[0-9][0-9] | hp6[0-9][0-9] )
422                 basic_machine=hppa1.0-hp
423                 ;;
424         hp9k7[0-79][0-9] | hp7[0-79][0-9] )
425                 basic_machine=hppa1.1-hp
426                 ;;
427         hp9k78[0-9] | hp78[0-9] )
428                 # FIXME: really hppa2.0-hp
429                 basic_machine=hppa1.1-hp
430                 ;;
431         hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
432         hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
433                 # FIXME: really hppa2.0-hp
434                 basic_machine=hppa1.1-hp
435                 ;;
436         hp9k8[0-9][13679] | hp8[0-9][13679] )
437                 basic_machine=hppa1.1-hp
438                 ;;
439         hp9k8[0-9][0-9] | hp8[0-9][0-9])
440                 basic_machine=hppa1.0-hp
441                 ;;
442         hppa-next)
443                 os=-nextstep3
444                 ;;
445         hppaosf)                                        # CYGNUS LOCAL
446                 basic_machine=hppa1.1-hp
447                 os=-osf
448                 ;;
449         i370-ibm* | ibm*)
450                 basic_machine=i370-ibm
451                 os=-mvs
452                 ;;
453 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
454         i[3456]86v32)
455                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
456                 os=-sysv32
457                 ;;
458         i[3456]86v4*)
459                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
460                 os=-sysv4
461                 ;;
462         i[3456]86v)
463                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
464                 os=-sysv
465                 ;;
466         i[3456]86sol2)
467                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
468                 os=-solaris2
469                 ;;
470         i386mach)                                       # CYGNUS LOCAL
471                 basic_machine=i386-mach
472                 os=-mach
473                 ;;
474         i386-vsta | vsta)                               # CYGNUS LOCAL
475                 basic_machine=i386-unknown
476                 os=-vsta
477                 ;;
478         i386-go32 | go32)                               # CYGNUS LOCAL
479                 basic_machine=i386-unknown
480                 os=-go32
481                 ;;
482         i386-mingw32 | mingw32)
483                 basic_machine=i386-unknown
484                 os=-mingw32
485                 ;;
486         iris | iris4d)
487                 basic_machine=mips-sgi
488                 case $os in
489                     -irix*)
490                         ;;
491                     *)
492                         os=-irix4
493                         ;;
494                 esac
495                 ;;
496         isi68 | isi)
497                 basic_machine=m68k-isi
498                 os=-sysv
499                 ;;
500         m88k-omron*)
501                 basic_machine=m88k-omron
502                 ;;
503         magnum | m3230)
504                 basic_machine=mips-mips
505                 os=-sysv
506                 ;;
507         merlin)
508                 basic_machine=ns32k-utek
509                 os=-sysv
510                 ;;
511         miniframe)
512                 basic_machine=m68000-convergent
513                 ;;
514         mipsel*-linux*)
515                 basic_machine=mipsel-unknown
516                 os=-linux-gnu
517                 ;;
518         mips*-linux*)
519                 basic_machine=mips-unknown
520                 os=-linux-gnu
521                 ;;
522         mips3*-*)
523                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
524                 ;;
525         mips3*)
526                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
527                 ;;
528         monitor)                                        # CYGNUS LOCAL
529                 basic_machine=m68k-rom68k
530                 os=-coff
531                 ;;
532         msdos)                                          # CYGNUS LOCAL
533                 basic_machine=i386-unknown      
534                 os=-msdos
535                 ;;
536         ncr3000)
537                 basic_machine=i486-ncr
538                 os=-sysv4
539                 ;;
540         netbsd386)
541                 basic_machine=i386-unknown              # CYGNUS LOCAL
542                 os=-netbsd
543                 ;;
544         news | news700 | news800 | news900)
545                 basic_machine=m68k-sony
546                 os=-newsos
547                 ;;
548         news1000)
549                 basic_machine=m68030-sony
550                 os=-newsos
551                 ;;
552         news-3600 | risc-news)
553                 basic_machine=mips-sony
554                 os=-newsos
555                 ;;
556         necv70)                                         # CYGNUS LOCAL
557                 basic_machine=v70-nec
558                 os=-sysv
559                 ;;
560         next | m*-next )
561                 basic_machine=m68k-next
562                 case $os in
563                     -nextstep* )
564                         ;;
565                     -ns2*)
566                       os=-nextstep2
567                         ;;
568                     *)
569                       os=-nextstep3
570                         ;;
571                 esac
572                 ;;
573         nh3000)
574                 basic_machine=m68k-harris
575                 os=-cxux
576                 ;;
577         nh[45]000)
578                 basic_machine=m88k-harris
579                 os=-cxux
580                 ;;
581         nindy960)
582                 basic_machine=i960-intel
583                 os=-nindy
584                 ;;
585         mon960)                                         # CYGNUS LOCAL
586                 basic_machine=i960-intel
587                 os=-mon960
588                 ;;
589         np1)
590                 basic_machine=np1-gould
591                 ;;
592         OSE68000 | ose68000)                            # CYGNUS LOCAL
593                 basic_machine=m68000-ericsson
594                 os=-ose
595                 ;;
596         os68k)                                          # CYGNUS LOCAL
597                 basic_machine=m68k-none
598                 os=-os68k
599                 ;;
600         pa-hitachi)
601                 basic_machine=hppa1.1-hitachi
602                 os=-hiuxwe2
603                 ;;
604         paragon)
605                 basic_machine=i860-intel
606                 os=-osf
607                 ;;
608         pbd)
609                 basic_machine=sparc-tti
610                 ;;
611         pbb)
612                 basic_machine=m68k-tti
613                 ;;
614         pc532 | pc532-*)
615                 basic_machine=ns32k-pc532
616                 ;;
617         pentium | p5)
618                 basic_machine=i586-intel
619                 ;;
620         pentiumpro | p6)
621                 basic_machine=i686-intel
622                 ;;
623         pentium-* | p5-*)
624                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
625                 ;;
626         pentiumpro-* | p6-*)
627                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
628                 ;;
629         k5)
630                 # We don't have specific support for AMD's K5 yet, so just call it a Pentium
631                 basic_machine=i586-amd
632                 ;;
633         nexen)
634                 # We don't have specific support for Nexgen yet, so just call it a Pentium
635                 basic_machine=i586-nexgen
636                 ;;
637         pn)
638                 basic_machine=pn-gould
639                 ;;
640         power)  basic_machine=rs6000-ibm
641                 ;;
642         ppc)    basic_machine=powerpc-unknown
643                 ;;
644         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
645                 ;;
646         ppcle | powerpclittle | ppc-le | powerpc-little)
647                 basic_machine=powerpcle-unknown
648                 ;;
649         ppcle-* | powerpclittle-*)
650                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
651                 ;;
652         ps2)
653                 basic_machine=i386-ibm
654                 ;;
655         rom68k)                                         # CYGNUS LOCAL
656                 basic_machine=m68k-rom68k
657                 os=-coff
658                 ;;
659         rm[46]00)
660                 basic_machine=mips-siemens
661                 ;;
662         rtpc | rtpc-*)
663                 basic_machine=romp-ibm
664                 ;;
665         sa29200)                                        # CYGNUS LOCAL
666                 basic_machine=a29k-amd
667                 os=-udi
668                 ;;
669         sequent)
670                 basic_machine=i386-sequent
671                 ;;
672         sh)
673                 basic_machine=sh-hitachi
674                 os=-hms
675                 ;;
676         sparclite-wrs)                                  # CYGNUS LOCAL
677                 basic_machine=sparclite-wrs
678                 os=-vxworks
679                 ;;
680         sps7)
681                 basic_machine=m68k-bull
682                 os=-sysv2
683                 ;;
684         spur)
685                 basic_machine=spur-unknown
686                 ;;
687         st2000)                                         # CYGNUS LOCAL
688                 basic_machine=m68k-tandem
689                 ;;
690         stratus)                                        # CYGNUS LOCAL
691                 basic_machine=i860-stratus
692                 os=-sysv4
693                 ;;
694         sun2)
695                 basic_machine=m68000-sun
696                 ;;
697         sun2os3)
698                 basic_machine=m68000-sun
699                 os=-sunos3
700                 ;;
701         sun2os4)
702                 basic_machine=m68000-sun
703                 os=-sunos4
704                 ;;
705         sun3os3)
706                 basic_machine=m68k-sun
707                 os=-sunos3
708                 ;;
709         sun3os4)
710                 basic_machine=m68k-sun
711                 os=-sunos4
712                 ;;
713         sun4os3)
714                 basic_machine=sparc-sun
715                 os=-sunos3
716                 ;;
717         sun4os4)
718                 basic_machine=sparc-sun
719                 os=-sunos4
720                 ;;
721         sun4sol2)
722                 basic_machine=sparc-sun
723                 os=-solaris2
724                 ;;
725         sun3 | sun3-*)
726                 basic_machine=m68k-sun
727                 ;;
728         sun4)
729                 basic_machine=sparc-sun
730                 ;;
731         sun386 | sun386i | roadrunner)
732                 basic_machine=i386-sun
733                 ;;
734         symmetry)
735                 basic_machine=i386-sequent
736                 os=-dynix
737                 ;;
738         tx39)
739                 basic_machine=mipstx39-unknown
740                 ;;
741         tx39el)
742                 basic_machine=mipstx39el-unknown
743                 ;;
744         tower | tower-32)
745                 basic_machine=m68k-ncr
746                 ;;
747         udi29k)
748                 basic_machine=a29k-amd
749                 os=-udi
750                 ;;
751         ultra3)
752                 basic_machine=a29k-nyu
753                 os=-sym1
754                 ;;
755         v810 | necv810)                                 # CYGNUS LOCAL
756                 basic_machine=v810-nec
757                 os=-none
758                 ;;
759         vaxv)
760                 basic_machine=vax-dec
761                 os=-sysv
762                 ;;
763         vms)
764                 basic_machine=vax-dec
765                 os=-vms
766                 ;;
767         vpp*|vx|vx-*)
768                basic_machine=f301-fujitsu
769                ;;
770         vxworks960)
771                 basic_machine=i960-wrs
772                 os=-vxworks
773                 ;;
774         vxworks68)
775                 basic_machine=m68k-wrs
776                 os=-vxworks
777                 ;;
778         vxworks29k)
779                 basic_machine=a29k-wrs
780                 os=-vxworks
781                 ;;
782         w65*)                                           # CYGNUS LOCAL
783                 basic_machine=w65-wdc
784                 os=-none
785                 ;;
786         xmp)
787                 basic_machine=xmp-cray
788                 os=-unicos
789                 ;;
790         xps | xps100)
791                 basic_machine=xps100-honeywell
792                 ;;
793         z8k-*-coff)                                     # CYGNUS LOCAL
794                 basic_machine=z8k-unknown
795                 os=-sim
796                 ;;
797         none)
798                 basic_machine=none-none
799                 os=-none
800                 ;;
801
802 # Here we handle the default manufacturer of certain CPU types.  It is in
803 # some cases the only manufacturer, in others, it is the most popular.
804         w89k)                                           # CYGNUS LOCAL
805                 basic_machine=hppa1.1-winbond
806                 ;;
807         op50n)                                          # CYGNUS LOCAL
808                 basic_machine=hppa1.1-oki
809                 ;;
810         op60c)                                          # CYGNUS LOCAL
811                 basic_machine=hppa1.1-oki
812                 ;;
813         mips)
814                 if [ x$os = x-linux-gnu ]; then
815                         basic_machine=mips-unknown
816                 else
817                         basic_machine=mips-mips
818                 fi
819                 ;;
820         romp)
821                 basic_machine=romp-ibm
822                 ;;
823         rs6000)
824                 basic_machine=rs6000-ibm
825                 ;;
826         vax)
827                 basic_machine=vax-dec
828                 ;;
829         pdp11)
830                 basic_machine=pdp11-dec
831                 ;;
832         we32k)
833                 basic_machine=we32k-att
834                 ;;
835         sparc)
836                 basic_machine=sparc-sun
837                 ;;
838         cydra)
839                 basic_machine=cydra-cydrome
840                 ;;
841         orion)
842                 basic_machine=orion-highlevel
843                 ;;
844         orion105)
845                 basic_machine=clipper-highlevel
846                 ;;
847         mac | mpw | mac-mpw)                            # CYGNUS LOCAL
848                 basic_machine=m68k-apple
849                 ;;
850         pmac | pmac-mpw)                                # CYGNUS LOCAL
851                 basic_machine=powerpc-apple
852                 ;;
853         *)
854                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
855                 exit 1
856                 ;;
857 esac
858
859 # Here we canonicalize certain aliases for manufacturers.
860 case $basic_machine in
861         *-digital*)
862                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
863                 ;;
864         *-commodore*)
865                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
866                 ;;
867         *)
868                 ;;
869 esac
870
871 # Decode manufacturer-specific aliases for certain operating systems.
872
873 if [ x"$os" != x"" ]
874 then
875 case $os in
876         # First match some system type aliases
877         # that might get confused with valid system types.
878         # -solaris* is a basic system type, with this one exception.
879         -solaris1 | -solaris1.*)
880                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
881                 ;;
882         -solaris)
883                 os=-solaris2
884                 ;;
885         -unixware* | svr4*)
886                 os=-sysv4
887                 ;;
888         -gnu/linux*)
889                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
890                 ;;
891         # First accept the basic system types.
892         # The portable systems comes first.
893         # Each alternative MUST END IN A *, to match a version number.
894         # -sysv* is not here because it comes later, after sysvr4.
895         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
896               | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
897               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
898               | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
899               | -aos* \
900               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
901               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
902               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
903               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
904               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
905               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
906               | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
907               | -mingw32* | -linux-gnu* | -uxpv*)
908         # Remember, each alternative MUST END IN *, to match a version number.
909                 ;;
910         # CYGNUS LOCAL
911         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
912               | -windows* | -osx | -abug |  -netware* | -os9* | -beos* \
913               | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
914                 ;;
915         -mac*)
916                 os=`echo $os | sed -e 's|mac|macos|'`
917                 ;;
918         # END CYGNUS LOCAL
919         -linux*)
920                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
921                 ;;
922         -sunos5*)
923                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
924                 ;;
925         -sunos6*)
926                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
927                 ;;
928         -osfrose*)
929                 os=-osfrose
930                 ;;
931         -osf*)
932                 os=-osf
933                 ;;
934         -utek*)
935                 os=-bsd
936                 ;;
937         -dynix*)
938                 os=-bsd
939                 ;;
940         -acis*)
941                 os=-aos
942                 ;;
943         -386bsd)                                        # CYGNUS LOCAL
944                 os=-bsd
945                 ;;
946         -ctix* | -uts*)
947                 os=-sysv
948                 ;;
949         -ns2 )
950                 os=-nextstep2
951                 ;;
952         # Preserve the version number of sinix5.
953         -sinix5.*)
954                 os=`echo $os | sed -e 's|sinix|sysv|'`
955                 ;;
956         -sinix*)
957                 os=-sysv4
958                 ;;
959         -triton*)
960                 os=-sysv3
961                 ;;
962         -oss*)
963                 os=-sysv3
964                 ;;
965         -svr4)
966                 os=-sysv4
967                 ;;
968         -svr3)
969                 os=-sysv3
970                 ;;
971         -sysvr4)
972                 os=-sysv4
973                 ;;
974         # This must come after -sysvr4.
975         -sysv*)
976                 ;;
977         -ose*)                                          # CYGNUS LOCAL
978                 os=-ose
979                 ;;
980         -es1800*)                                       # CYGNUS LOCAL
981                 os=-ose
982                 ;;
983         -xenix)
984                 os=-xenix
985                 ;;
986         -none)
987                 ;;
988         *)
989                 # Get rid of the `-' at the beginning of $os.
990                 os=`echo $os | sed 's/[^-]*-//'`
991                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
992                 exit 1
993                 ;;
994 esac
995 else
996
997 # Here we handle the default operating systems that come with various machines.
998 # The value should be what the vendor currently ships out the door with their
999 # machine or put another way, the most popular os provided with the machine.
1000
1001 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1002 # "-sun"), then you have to tell the case statement up towards the top
1003 # that MANUFACTURER isn't an operating system.  Otherwise, code above
1004 # will signal an error saying that MANUFACTURER isn't an operating
1005 # system, and we'll never get to this point.
1006
1007 case $basic_machine in
1008         *-acorn)
1009                 os=-riscix1.2
1010                 ;;
1011         arm*-semi)
1012                 os=-aout
1013                 ;;
1014         pdp11-*)
1015                 os=-none
1016                 ;;
1017         *-dec | vax-*)
1018                 os=-ultrix4.2
1019                 ;;
1020         m68*-apollo)
1021                 os=-domain
1022                 ;;
1023         i386-sun)
1024                 os=-sunos4.0.2
1025                 ;;
1026         m68000-sun)
1027                 os=-sunos3
1028                 # This also exists in the configure program, but was not the
1029                 # default.
1030                 # os=-sunos4
1031                 ;;
1032         m68*-cisco)                                     # CYGNUS LOCAL
1033                 os=-aout
1034                 ;;
1035         mips*-cisco)                                    # CYGNUS LOCAL
1036                 os=-elf
1037                 ;;
1038         mips*-*)                                        # CYGNUS LOCAL
1039                 os=-elf
1040                 ;;
1041         *-tti)  # must be before sparc entry or we get the wrong os.
1042                 os=-sysv3
1043                 ;;
1044         sparc-* | *-sun)
1045                 os=-sunos4.1.1
1046                 ;;
1047         *-be)                                           # CYGNUS LOCAL
1048                 os=-beos
1049                 ;;
1050         *-ibm)
1051                 os=-aix
1052                 ;;
1053         *-wec)                                          # CYGNUS LOCAL
1054                 os=-proelf
1055                 ;;
1056         *-winbond)                                      # CYGNUS LOCAL
1057                 os=-proelf
1058                 ;;
1059         *-oki)                                          # CYGNUS LOCAL
1060                 os=-proelf
1061                 ;;
1062         *-hp)
1063                 os=-hpux
1064                 ;;
1065         *-hitachi)
1066                 os=-hiux
1067                 ;;
1068         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1069                 os=-sysv
1070                 ;;
1071         *-cbm)
1072                 os=-amigaos
1073                 ;;
1074         *-dg)
1075                 os=-dgux
1076                 ;;
1077         *-dolphin)
1078                 os=-sysv3
1079                 ;;
1080         m68k-ccur)
1081                 os=-rtu
1082                 ;;
1083         m88k-omron*)
1084                 os=-luna
1085                 ;;
1086         *-next )
1087                 os=-nextstep
1088                 ;;
1089         *-sequent)
1090                 os=-ptx
1091                 ;;
1092         *-crds)
1093                 os=-unos
1094                 ;;
1095         *-ns)
1096                 os=-genix
1097                 ;;
1098         i370-*)
1099                 os=-mvs
1100                 ;;
1101         *-next)
1102                 os=-nextstep3
1103                 ;;
1104         *-gould)
1105                 os=-sysv
1106                 ;;
1107         *-highlevel)
1108                 os=-bsd
1109                 ;;
1110         *-encore)
1111                 os=-bsd
1112                 ;;
1113         *-sgi)
1114                 os=-irix
1115                 ;;
1116         *-siemens)
1117                 os=-sysv4
1118                 ;;
1119         *-masscomp)
1120                 os=-rtu
1121                 ;;
1122         f301-fujitsu)
1123                 os=-uxpv
1124                 ;;
1125         *-rom68k)                                       # CYGNUS LOCAL
1126                 os=-coff
1127                 ;;
1128         *-*bug)                                         # CYGNUS LOCAL
1129                 os=-coff
1130                 ;;
1131         *-apple)                                        # CYGNUS LOCAL
1132                 os=-macos
1133                 ;;
1134         *)
1135                 os=-none
1136                 ;;
1137 esac
1138 fi
1139
1140 # Here we handle the case where we know the os, and the CPU type, but not the
1141 # manufacturer.  We pick the logical manufacturer.
1142 vendor=unknown
1143 case $basic_machine in
1144         *-unknown)
1145                 case $os in
1146                         -riscix*)
1147                                 vendor=acorn
1148                                 ;;
1149                         -sunos*)
1150                                 vendor=sun
1151                                 ;;
1152                         -aix*)
1153                                 vendor=ibm
1154                                 ;;
1155                         -beos*)                                         # CYGNUS LOCAL
1156                                 vendor=be
1157                                 ;;
1158                         -hpux*)
1159                                 vendor=hp
1160                                 ;;
1161                         -hiux*)
1162                                 vendor=hitachi
1163                                 ;;
1164                         -unos*)
1165                                 vendor=crds
1166                                 ;;
1167                         -dgux*)
1168                                 vendor=dg
1169                                 ;;
1170                         -luna*)
1171                                 vendor=omron
1172                                 ;;
1173                         -genix*)
1174                                 vendor=ns
1175                                 ;;
1176                         -mvs*)
1177                                 vendor=ibm
1178                                 ;;
1179                         -ptx*)
1180                                 vendor=sequent
1181                                 ;;
1182                         -vxsim* | -vxworks*)
1183                                 vendor=wrs
1184                                 ;;
1185                         -aux*)
1186                                 vendor=apple
1187                                 ;;
1188                         -hms*)                          # CYGNUS LOCAL
1189                                 vendor=hitachi
1190                                 ;;
1191                         -mpw* | -macos*)                # CYGNUS LOCAL
1192                                 vendor=apple
1193                                 ;;
1194                 esac
1195                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1196                 ;;
1197 esac
1198
1199 echo $basic_machine$os