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