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