OSDN Git Service

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