OSDN Git Service

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