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