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