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