* config.sub: Refer to NeXT's operating system as nextstep.
[external/binutils.git] / config.sub
1 #!/bin/sh
2 # Configuration validation subroutine script, version 1.1.
3 #   Copyright (C) 1991, 1992, 1993, 1994 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., 675 Mass Ave, Cambridge, MA 02139, USA.
21
22
23 # Configuration subroutine to validate and canonicalize a configuration type.
24 # Supply the specified configuration type as an argument.
25 # If it is invalid, we print an error message on stderr and exit with code 1.
26 # Otherwise, we print the canonical config type on stdout and succeed.
27
28 # This file is supposed to be the same for all GNU packages
29 # and recognize all the CPU types, system types and aliases
30 # that are meaningful with *any* GNU software.
31 # Each package is responsible for reporting which valid configurations
32 # it does not support.  The user should be able to distinguish
33 # a failure to support a valid configuration from a meaningless
34 # configuration.
35
36 # The goal of this file is to map all the various variations of a given
37 # machine specification into a single specification in the form:
38 #       CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
39 # It is wrong to echo any other type of specification.
40
41 if [ x$1 = x ]
42 then
43         echo Configuration name missing. 1>&2
44         echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
45         echo "or     $0 ALIAS" 1>&2
46         echo where ALIAS is a recognized configuration type. 1>&2
47         exit 1
48 fi
49
50 # First pass through any local machine types.
51 case $1 in
52         *local*)
53                 echo $1
54                 exit 0
55                 ;;
56         *)
57         ;;
58 esac
59
60 # Separate what the user gave into CPU-COMPANY and OS (if any).
61 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
62 if [ $basic_machine != $1 ]
63 then os=`echo $1 | sed 's/.*-/-/'`
64 else os=; fi
65
66 ### Let's recognize common machines as not being operating systems so
67 ### that things like config.sub decstation-3100 work.  We also
68 ### recognize some manufacturers as not being operating systems, so we
69 ### can provide default operating systems below.
70 case $os in
71         -sun*os*)
72                 # Prevent following clause from handling this invalid input.
73                 ;;
74         -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
75         -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
76         -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
77         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
78         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
79         -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
80         -sim | -cisco)                                          # CYGNUS LOCAL
81                 os=
82                 basic_machine=$1
83                 ;;
84         -scout)                                         # CYGNUS LOCAL
85                 ;;
86         -wrs)                                           # CYGNUS LOCAL
87                 os=vxworks
88                 basic_machine=$1
89                 ;;
90         -unixware)                                      # CYGNUS LOCAL
91                 os=-sysv4
92                 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
93                 ;;
94         -hiux*)
95                 os=-hiuxwe2
96                 ;;
97         -sco4)
98                 os=-sco3.2v4
99                 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
100                 ;;
101         -sco3.2.[4-9]*)
102                 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
103                 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
104                 ;;
105         -sco3.2v[4-9]*)
106                 # Don't forget version if it is 3.2v4 or newer.
107                 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
108                 ;;
109         -sco*)
110                 os=-sco3.2v2
111                 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
112                 ;;
113         -isc)
114                 os=-isc2.2
115                 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
116                 ;;
117         -clix*)
118                 basic_machine=clipper-intergraph
119                 ;;
120         -isc*)
121                 basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
122                 ;;
123         -lynx*)
124                 os=-lynxos
125                 ;;
126         -os9k)
127                 os=-os9k
128                 ;;
129         -os9)
130                 os=-os9
131                 ;;
132 esac
133
134 # Decode aliases for certain CPU-COMPANY combinations.
135 case $basic_machine in
136         # Recognize the basic CPU types without company name.
137         # Some are omitted here because they have special meanings below.
138         tahoe | i[34]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \
139                 | tron | a29k | 580 | i960 | hppa1.0 | hppa1.1 \
140                 | alpha | we32k | ns16k | clipper | sparclite | i370 \
141                 | powerpc \
142                 | h8300 | h8300h | sh \
143                 | m88110 | sparc | m680[01234]0 | m683?2 | z8k | v70 \
144                 | v810 \
145                 | h8500 | mips64 | mipsel | mips64el) # CYGNUS LOCAL
146                 basic_machine=$basic_machine-unknown
147                 ;;
148         # Object if more than one company name word.
149         *-*-*)
150                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
151                 exit 1
152                 ;;
153         # Recognize the basic CPU types with company name.
154         vax-* | tahoe-* | i[34]86-* | i860-* | m68k-* | m68000-* | m88k-* \
155               | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
156               | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
157               | none-* | 580-* | cray2-* | i960-* | xmp-* | ymp-* \
158               | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
159               | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
160               | powerpc-* \
161               | h8300-* | h8300h-* | sh-* \
162               | m88110-* | m680[01234]0-* | m683?2-* | z8k-* | h8500-* \
163               | mips64-* | mipsel-* | mips64el-*) # CYGNUS LOCAL
164                 ;;
165         # Recognize the various machine names and aliases which stand
166         # for a CPU type and a company and sometimes even an OS.
167         386bsd)                                         # CYGNUS LOCAL
168                 basic_machine=i386-unknown
169                 os=-bsd
170                 ;;
171         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
172                 basic_machine=m68000-att
173                 ;;
174         3b*)
175                 basic_machine=we32k-att
176                 ;;
177         a29khif)                                        # CYGNUS LOCAL
178                 basic_machine=a29k-amd
179                 os=-udi
180                 ;;
181         adobe68k)                                       # CYGNUS LOCAL
182                 basic_machine=m68010-adobe
183                 os=-scout
184                 ;;
185         alliant | fx80)
186                 basic_machine=fx80-alliant
187                 ;;
188         altos | altos3068)
189                 basic_machine=m68k-altos
190                 ;;
191         am29k)
192                 basic_machine=a29k-none
193                 os=-bsd
194                 ;;
195         amdahl)
196                 basic_machine=580-amdahl
197                 os=-sysv
198                 ;;
199         amiga)
200                 basic_machine=m68k-cbm
201                 ;;
202         amigados)
203                 basic_machine=m68k-cbm
204                 os=-amigados
205                 ;;
206         amigaunix | amix)
207                 basic_machine=m68k-cbm
208                 os=-sysv4
209                 ;;
210         apollo68)
211                 basic_machine=m68k-apollo
212                 os=-sysv
213                 ;;
214         apollo68bsd)                                    # CYGNUS LOCAL
215                 basic_machine=m68k-apollo
216                 os=-bsd
217                 ;;
218         balance)
219                 basic_machine=ns32k-sequent
220                 os=-dynix
221                 ;;
222         m68k-ccur)
223                 basic_machine=m68k-ccur
224                 os=-rtu
225                 ;;
226         convex-c1)
227                 basic_machine=c1-convex
228                 os=-bsd
229                 ;;
230         convex-c2)
231                 basic_machine=c2-convex
232                 os=-bsd
233                 ;;
234         convex-c32)
235                 basic_machine=c32-convex
236                 os=-bsd
237                 ;;
238         convex-c34)
239                 basic_machine=c34-convex
240                 os=-bsd
241                 ;;
242         convex-c38)
243                 basic_machine=c38-convex
244                 os=-bsd
245                 ;;
246         cray | ymp)
247                 basic_machine=ymp-cray
248                 os=-unicos
249                 ;;
250         cray2)
251                 basic_machine=cray2-cray
252                 os=-unicos
253                 ;;
254         crds | unos)
255                 basic_machine=m68k-crds
256                 ;;
257         decstation | decstation-3100 | pmax | pmin | dec3100 | decstatn)
258                 basic_machine=mips-dec
259                 ;;
260         delta | 3300 | motorola-3300 | motorola-delta \
261               | 3300-motorola | delta-motorola)
262                 basic_machine=m68k-motorola
263                 ;;
264         delta88)
265                 basic_machine=m88k-motorola
266                 os=-sysv3
267                 ;;
268         dpx20 | dpx20-*)
269                 basic_machine=rs6000-bull
270                 os=-bosx
271                 ;;
272         dpx2* | dpx2*-bull)
273                 basic_machine=m68k-bull
274                 os=-sysv3
275                 ;;
276         ebmon29k)
277                 basic_machine=a29k-amd
278                 os=-ebmon
279                 ;;
280         elxsi)
281                 basic_machine=elxsi-elxsi
282                 os=-bsd
283                 ;;
284         encore | umax | mmax)
285                 basic_machine=ns32k-encore
286                 ;;
287         es1800 | OSE68k | ose68k | ose | OSE)           # CYGNUS LOCAL
288                 basic_machine=m68k-ericsson
289                 os=-ose
290                 ;;
291         fx2800)
292                 basic_machine=i860-alliant
293                 ;;
294         genix)
295                 basic_machine=ns32k-ns
296                 ;;
297         gmicro)
298                 basic_machine=tron-gmicro
299                 os=-sysv
300                 ;;
301         go32 | i386-go32)                               # CYGNUS LOCAL
302                 basic_machine=i386-unknown
303                 os=-go32
304                 ;;
305         h3050r* | hiux*)
306                 basic_machine=hppa1.1-hitachi
307                 os=-hiuxwe2
308                 ;;
309         h8300hds)
310                 basic_machine=h8300-hitachi
311                 os=-hds
312                 ;;
313         h8300hms)                                       # CYGNUS LOCAL
314                 basic_machine=h8300-hitachi
315                 os=-hms
316                 ;;
317         h8300xray)                                      # CYGNUS LOCAL
318                 basic_machine=h8300-hitachi
319                 os=-xray
320                 ;;
321         h8500hms)                                       # CYGNUS LOCAL
322                 basic_machine=h8500-hitachi
323                 os=-hms
324                 ;;
325         harris)
326                 basic_machine=m88k-harris
327                 os=-sysv3
328                 ;;
329         h3050r* | hppahitachi)
330                 basic_machine=hppa1.1-hitachi
331                 ;;
332         hp300bsd)
333                 basic_machine=m68k-hp
334                 os=-bsd
335                 ;;
336         hp300hpux)
337                 basic_machine=m68k-hp
338                 os=-hpux
339                 ;;
340         hp9k2[0-9][0-9] | hp9k31[0-9])
341                 basic_machine=m68000-hp
342                 ;;
343         hp9k3[2-9][0-9])
344                 basic_machine=m68k-hp
345                 ;;
346         hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
347                 basic_machine=hppa1.1-hp
348                 ;;
349         hp9k8[0-9][0-9] | hp8[0-9][0-9])
350                 basic_machine=hppa1.0-hp
351                 ;;
352         hppaosf)
353                 basic_machine=hppa1.1-hp
354                 os=-osf
355                 ;;
356         i370-ibm* | ibm*)
357                 basic_machine=i370-ibm
358                 os=-mvs
359                 ;;
360         i386mach)                                       # CYGNUS LOCAL
361                 basic_machine=i386-mach
362                 os=-mach
363                 ;;
364 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
365         i[34]86v32)
366                 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
367                 os=-sysv32
368                 ;;
369         i[34]86v4*)
370                 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
371                 os=-sysv4
372                 ;;
373         i[34]86v)
374                 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
375                 os=-sysv
376                 ;;
377         i[34]86sol2)
378                 basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
379                 os=-solaris2
380                 ;;
381         i386-linux* | linux)                            # CYGNUS LOCAL
382                 basic_machine=i386-unknown
383                 os=-linux
384                 ;;
385         i386-linux*coff | linuxcoff)                    # CYGNUS LOCAL
386                 basic_machine=i386-unknown
387                 os=-linuxcoff
388                 ;;
389         i386-linux*elf | linuxelf)                      # CYGNUS LOCAL
390                 basic_machine=i386-unknown
391                 os=-linuxelf
392                 ;;
393         iris | iris4d | \
394         iris3 | iris4)                                  # CYGNUS LOCAL
395                 basic_machine=mips-sgi
396                 case $os in
397                     -irix*)
398                         ;;
399                     *)
400                         os=-irix4
401                         ;;
402                 esac
403                 ;;
404         isi68 | isi)
405                 basic_machine=m68k-isi
406                 os=-sysv
407                 ;;
408         m6*bug)                                           # CYGNUS LOCAL
409                 basic_machine=m68k-bug
410                 os=-coff
411                 ;;
412         m88k-omron*)
413                 basic_machine=m88k-omron
414                 ;;
415         magnum | m3230)
416                 basic_machine=mips-mips
417                 os=-sysv
418                 ;;
419         merlin)
420                 basic_machine=ns32k-utek
421                 os=-sysv
422                 ;;
423         miniframe)
424                 basic_machine=m68010-convergent
425                 ;;
426         mips3-*)                                        # CYGNUS LOCAL
427                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
428                 ;;
429         mips3)                                          # CYGNUS LOCAL
430                 basic_machine=mips64-unknown
431                 ;;
432         monitor)                                         # CYGNUS LOCAL
433                 basic_machine=m68k-rom68k
434                 os=-coff
435                 ;;
436         msdos)                                          # CYGNUS LOCAL
437                 basic_machine=i386-unknown      
438                 os=-msdos
439                 ;;
440         ncr3000)
441                 basic_machine=i486-ncr
442                 os=-sysv4
443                 ;;
444         necv70)                                         # CYGNUS LOCAL
445                 basic_machine=v70-nec
446                 os=-sysv
447                 ;;
448         netbsd386)
449                 basic_machine=i386-unknown              # CYGNUS LOCAL
450                 os=-netbsd
451                 ;;
452         news | news700 | news800 | news900)
453                 basic_machine=m68k-sony
454                 os=-newsos
455                 ;;
456         news1000)
457                 basic_machine=m68030-sony
458                 os=-newsos
459                 ;;
460         news-3600 | risc-news)
461                 basic_machine=mips-sony
462                 os=-newsos
463                 ;;
464         next)
465                 basic_machine=m68k-next
466                 case $os in
467                     -ns2* | -nextstep2*)
468                         ;;
469                     *)
470                       os=-nextstep3
471                         ;;
472                 esac
473                 ;;
474         nh3000)
475                 basic_machine=m68k-harris
476                 os=-cxux
477                 ;;
478         nh[45]000)
479                 basic_machine=m88k-harris
480                 os=-cxux
481                 ;;
482         nindy960)
483                 basic_machine=i960-intel
484                 os=-nindy
485                 ;;
486         np1)
487                 basic_machine=np1-gould
488                 ;;
489         os68k)                                          # CYGNUS LOCAL
490                 basic_machine=m68k-none
491                 os=-os68k
492                 ;;
493         OSE68000 | ose68000)                            # CYGNUS LOCAL
494                 basic_machine=m68000-ericsson
495                 os=-ose
496                 ;;
497         pa-hitachi)
498                 basic_machine=hppa1.1-hitachi
499                 os=-hiuxwe2
500                 ;;
501         paragon)
502                 basic_machine=i860-intel
503                 os=-osf
504                 ;;
505         pbd)
506                 basic_machine=sparc-tti
507                 ;;
508         pbb)
509                 basic_machine=m68k-tti
510                 ;;
511         pc532)
512                 basic_machine=ns32k-pc532
513                 ;;
514         pn)
515                 basic_machine=pn-gould
516                 ;;
517         ps2)
518                 basic_machine=i386-ibm
519                 ;;
520         rom68k)                                         # CYGNUS LOCAL
521                 basic_machine=m68k-rom68k
522                 os=-coff
523                 ;;
524         rtpc | rtpc-*)
525                 basic_machine=romp-ibm
526                 ;;
527         sa29200)                                        # CYGNUS LOCAL
528                 basic_machine=a29k-amd
529                 os=-udi
530                 ;;
531         sh*)                                            # CYGNUS LOCAL
532                 basic_machine=sh-hitachi
533                 os=-hms
534                 ;;
535         sparc64)                                        # CYGNUS LOCAL
536                 basic_machine=sparc64-sun
537                 os=-elf
538                 ;;
539         sparc64-*)                                      # CYGNUS LOCAL
540                 ;;
541
542         sparclite-wrs)                                  # CYGNUS LOCAL
543                 basic_machine=sparclite-wrs
544                 os=-vxworks
545                 ;;
546         sparcfrw)                                       # CYGNUS LOCAL
547                 basic_machine=sparcfrw-sun
548                 os=-sunos4
549                 ;;
550         sparcfrwcompat)                                 # CYGNUS LOCAL
551                 basic_machine=sparcfrwcompat-sun
552                 os=-sunos4
553                 ;;
554         sparclitefrw)                                   # CYGNUS LOCAL
555                 basic_machine=sparclitefrw-fujitsu
556                 ;;
557         sparclitefrwcompat)                             # CYGNUS LOCAL
558                 basic_machine=sparclitefrwcompat-fujitsu
559                 ;;
560         sps7)
561                 basic_machine=m68k-bull
562                 os=-sysv2
563                 ;;
564         spur)
565                 basic_machine=spur-unknown
566                 ;;
567         st2000)                                         # CYGNUS LOCAL
568                 basic_machine=m68k-tandem
569                 ;;
570         stratus)                                        # CYGNUS LOCAL
571                 basic_machine=i860-stratus
572                 os=-sysv4
573                 ;;
574         sun2)
575                 basic_machine=m68000-sun
576                 ;;
577         sun2os3)
578                 basic_machine=m68000-sun
579                 os=-sunos3
580                 ;;
581         sun2os4)
582                 basic_machine=m68000-sun
583                 os=-sunos4
584                 ;;
585         sun3os3)
586                 basic_machine=m68k-sun
587                 os=-sunos3
588                 ;;
589         sun3os4)
590                 basic_machine=m68k-sun
591                 os=-sunos4
592                 ;;
593         sun4os3)
594                 basic_machine=sparc-sun
595                 os=-sunos3
596                 ;;
597         sun4os4)
598                 basic_machine=sparc-sun
599                 os=-sunos4
600                 ;;
601         sun4sol2)                                       # CYGNUS LOCAL
602                 basic_machine=sparc-sun
603                 os=-solaris2
604                 ;;
605         sun3)
606                 basic_machine=m68k-sun
607                 ;;
608         sun4)
609                 basic_machine=sparc-sun
610                 ;;
611         sun386 | sun386i | roadrunner)
612                 basic_machine=i386-sun
613                 ;;
614         symmetry)
615                 basic_machine=i386-sequent
616                 os=-dynix
617                 ;;
618         tower | tower-32)
619                 basic_machine=m68k-ncr
620                 ;;
621         udi29k)                                         # CYGNUS LOCAL
622                 basic_machine=a29k-amd
623                 os=-udi
624                 ;;
625         ultra3)
626                 basic_machine=a29k-nyu
627                 os=-sym1
628                 ;;
629         unixware)                                       # CYGNUS LOCAL
630                 os=-sysv4
631                 basic_machine=i386-unknown
632                 ;;
633         v810 | necv810)
634                 basic_machine=v810-nec
635                 os=-none
636                 ;;
637         vaxv)
638                 basic_machine=vax-dec
639                 os=-sysv
640                 ;;
641         vms)
642                 basic_machine=vax-dec
643                 os=-vms
644                 ;;
645         vxworks960)
646                 basic_machine=i960-wrs
647                 os=-vxworks
648                 ;;
649         vxworks68)
650                 basic_machine=m68k-wrs
651                 os=-vxworks
652                 ;;
653         vsta | i386-vsta)                               # CYGNUS LOCAL
654                 basic_machine=i386-unknown
655                 os=-vsta
656                 ;;
657         xmp)
658                 basic_machine=xmp-cray
659                 os=-unicos
660                 ;;
661         xps | xps100)
662                 basic_machine=xps100-honeywell
663                 ;;
664         z8ksim)                                         # CYGNUS LOCAL
665                 basic_machine=z8k-zilog
666                 os=-sim
667                 ;;
668         none)
669                 basic_machine=none-none
670                 os=-none
671                 ;;
672
673 # Here we handle the default manufacturer of certain CPU types.  It is in
674 # some cases the only manufacturer, in others, it is the most popular.
675         mips)
676                 basic_machine=mips-mips
677                 ;;
678         romp)
679                 basic_machine=romp-ibm
680                 ;;
681         rs6000)
682                 basic_machine=rs6000-ibm
683                 ;;
684         vax)
685                 basic_machine=vax-dec
686                 ;;
687         we32k)
688                 basic_machine=we32k-att
689                 ;;
690         sparc)
691                 basic_machine=sparc-sun
692                 ;;
693         cydra)
694                 basic_machine=cydra-cydrome
695                 ;;
696         orion)
697                 basic_machine=orion-highlevel
698                 ;;
699         orion105)
700                 basic_machine=clipper-highlevel
701                 ;;
702 ## start-sanitize-mpw
703         mac)                                            # CYGNUS LOCAL
704                 basic_machine=m68k-apple
705                 ;;
706         mpw)                                            # CYGNUS LOCAL
707                 basic_machine=m68k-apple
708                 ;;
709 ## end-sanitize-mpw
710         *)
711                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
712                 exit 1
713                 ;;
714 esac
715
716 # Here we canonicalize certain aliases for manufacturers.
717 case $basic_machine in
718         *-digital*)
719                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
720                 ;;
721         *-commodore*)
722                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
723                 ;;
724         *)
725                 ;;
726 esac
727
728 # Decode manufacturer-specific aliases for certain operating systems.
729
730 if [ x"$os" != x"" ]
731 then
732 case $os in
733         # -solaris* is a basic system type, with this one exception.
734         -solaris1 | -solaris1.*)
735                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
736                 ;;
737         -solaris)
738                 os=-solaris2
739                 ;;
740         # First accept the basic system types.
741         # The portable systems comes first.
742         # Each alternative must end in a *, to match a version number.
743         # -sysv* is not here because it comes later, after sysvr4.
744         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
745               | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]* | -hpux* \
746               | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
747               | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
748               | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
749               | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
750               | -hiux* | -386bsd* | -netbsd* | -nextstep | -riscix* | -lynxos*\
751               | -go32 | -vsta | -sim | -es1800* | -udi | -hms* | -xray | -hds* \
752               | -os68k* | -none* | -v88r* | -aout* | -coff | -elf* | -bosx* \
753               | -abug | -ecoff* | -netware* | -os9* )
754                                 # The last three lines above are CYGNUS LOCAL
755         ;;
756         -sunos5*)
757                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
758                 ;;
759         -sunos6*)
760                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
761                 ;;
762         -osfrose*)
763                 os=-osfrose
764                 ;;
765         -osf*)
766                 os=-osf
767                 ;;
768         -utek*)
769                 os=-bsd
770                 ;;
771         -dynix*)
772                 os=-bsd
773                 ;;
774         -acis*)
775                 os=-aos
776                 ;;
777         -386bsd)                                        # CYGNUS LOCAL
778                 os=-bsd
779                 ;;
780         -ctix* | -uts*)
781                 os=-sysv
782                 ;;
783         -triton*)
784                 os=-sysv3
785                 ;;
786         -oss*)
787                 os=-sysv3
788                 ;;
789         -svr4)
790                 os=-sysv4
791                 ;;
792         -unixware)
793                 os=-sysv4
794                 ;;
795         -svr3)
796                 os=-sysv3
797                 ;;
798         -sysvr4)
799                 os=-sysv4
800                 ;;
801         # This must come after -sysvr4.
802         -sysv*)
803                 ;;
804         -ose*)                                          # CYGNUS LOCAL
805                 os=-ose
806                 ;;
807         -es1800*)                                       # CYGNUS LOCAL
808                 os=-ose
809                 ;;
810         -cxux7*)
811                 os=-cxux7
812                 ;;
813         -xenix)
814                 os=-xenix
815                 ;;
816         -none)
817                 ;;
818         *)
819                 # Get rid of the `-' at the beginning of $os.
820                 os=`echo $1 | sed 's/[^-]*-//'`
821                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
822                 exit 1
823                 ;;
824 esac
825 else
826
827 # Here we handle the default operating systems that come with various machines.
828 # The value should be what the vendor currently ships out the door with their
829 # machine or put another way, the most popular os provided with the machine.
830
831 # Note that if you're going to try to match "-MANUFACTURER" here (say,
832 # "-sun"), then you have to tell the case statement up towards the top
833 # that MANUFACTURER isn't an operating system.  Otherwise, code above
834 # will signal an error saying that MANUFACTURER isn't an operating
835 # system, and we'll never get to this point.
836
837 case $basic_machine in
838         *-acorn)
839                 os=-riscix1.2
840                 ;;
841         *-dec | vax-*)
842                 os=-ultrix4.2
843                 ;;
844         i386-sun)
845                 os=-sunos4.0.2
846                 ;;
847         m68000-sun)
848                 os=-sunos3
849                 # This also exists in the configure program, but was not the
850                 # default.
851                 # os=-sunos4
852                 ;;
853         m68*-cisco)
854                 os=-aout
855                 ;;
856         mips*-cisco)
857                 os=-elf
858                 ;;
859         *-tti)  # must be before sparc entry or we get the wrong os.
860                 os=-sysv3
861                 ;;
862         sparc-* | *-sun)
863                 os=-sunos4.1.1
864                 ;;
865         *-ibm)
866                 os=-aix
867                 ;;
868         *-hp)
869                 os=-hpux
870                 ;;
871         *-hitachi)
872                 os=-hiux
873                 ;;
874         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
875                 os=-sysv
876                 ;;
877         *-cbm)
878                 os=-amigados
879                 ;;
880         *-dg)
881                 os=-dgux
882                 ;;
883         *-dolphin)
884                 os=-sysv3
885                 ;;
886         m88k-omron*)
887                 os=-luna
888                 ;;
889         *-sequent)
890                 os=-bsd
891                 ;;
892         *-crds)
893                 os=-unos
894                 ;;
895         *-ns)
896                 os=-genix
897                 ;;
898         i370-*)
899                 os=-mvs
900                 ;;
901         *-next)
902                 os=-nextstep
903                 ;;
904         i[34]86-*)
905                 os=-sco3.2v2
906                 ;;
907         *-gould)
908                 os=-sysv
909                 ;;
910         *-highlevel)
911                 os=-bsd
912                 ;;
913         *-encore)
914                 os=-bsd
915                 ;;
916         *-sgi)
917                 os=-irix
918                 ;;
919         *-masscomp)
920                 os=-rtu
921                 ;;
922         *-rom68k)                                       # CYGNUS LOCAL
923                 os=-coff
924                 ;;
925         *-*bug)                                         # CYGNUS LOCAL
926                 os=-coff
927                 ;;
928 ## start-sanitize-mpw
929         *-apple)                                        # CYGNUS LOCAL
930                 os=-mpw
931                 ;;
932 ## end-sanitize-mpw
933         *)
934                 os=-none
935                 ;;
936 esac
937 fi
938
939 # Here we handle the case where we know the os, and the CPU type, but not the
940 # manufacturer.  We pick the logical manufacturer.
941 vendor=unknown
942 case $basic_machine in
943         *-unknown)
944                 case $os in
945                         -riscix*)
946                                 vendor=acorn
947                                 ;;
948                         -sunos*)
949                                 vendor=sun
950                                 ;;
951                         -bosx*)                 # CYGNUS LOCAL
952                                 vendor=bull
953                                 ;;
954                         -lynxos*)
955                                 vendor=lynx
956                                 ;;
957                         -aix*)
958                                 vendor=ibm
959                                 ;;
960                         -hpux*)
961                                 vendor=hp
962                                 ;;
963                         -hiux*)
964                                 vendor=hitachi
965                                 ;;
966                         -unos*)
967                                 vendor=crds
968                                 ;;
969                         -dgux*)
970                                 vendor=dg
971                                 ;;
972                         -luna*)
973                                 vendor=omron
974                                 ;;
975                         -genix*)
976                                 vendor=ns
977                                 ;;
978                         -mvs*)
979                                 vendor=ibm
980                                 ;;
981                         -vxworks*)
982                                 vendor=wrs              # CYGNUS LOCAL
983                                 ;;
984                         -hms*)                          # CYGNUS LOCAL
985                                 vendor=hitachi
986                                 ;;
987 ## start-sanitize-mpw
988                         -mpw*)                          # CYGNUS LOCAL
989                                 vendor=apple
990                                 ;;
991 ## end-sanitize-mpw
992                 esac
993                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
994                 ;;
995 esac
996
997 echo $basic_machine$os