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