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