OSDN Git Service

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