Renamed OSE configuration to ose.
[external/binutils.git] / config.sub
1 #!/bin/sh
2 # Configuration validation subroutine script, version 1.0.
3 #   Copyright (C) 1991, 1992 Free Software Foundation, Inc.
4
5 #This file is free software; you can redistribute it and/or modify
6 #it under the terms of the GNU General Public License as published by
7 #the Free Software Foundation; either version 2 of the License, or
8 #(at your option) any later version.
9
10 #This program is distributed in the hope that it will be useful,
11 #but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #GNU General Public License for more details.
14
15 #You should have received a copy of the GNU General Public License
16 #along with this program; if not, write to the Free Software
17 #Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19
20 # Configuration subroutine to validate and canonicalize a configuration type.
21 # Supply the specified configuration type as an argument.
22 # If it is invalid, we print an error message on stderr and exit with code 1.
23 # Otherwise, we print the canonical config type on stdout and succeed.
24
25 # This file is supposed to be the same for all GNU packages
26 # and recognize all the CPU types, system types and aliases
27 # that are meaningful with *any* GNU software.
28 # Each package is responsible for reporting which valid configurations
29 # it does not support.  The user should be able to distinguish
30 # a failure to support a valid configuration from a meaningless
31 # configuration.
32
33 # The goal of this file is to map all the various variations of a given
34 # machine specification into a single specification in the form:
35 #       CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
36 # it is wrong to echo any other type of specification
37
38 # First pass through any local machine types.
39 case $1 in
40         *local*)
41                 echo $1
42                 exit 0
43                 ;;
44         *)
45         ;;
46 esac
47
48 # Separate what the user gave into CPU-COMPANY and OS (if any).
49 basic_machine=`echo $1 | sed 's/-[^-][^-]*$//'`
50 if [ $basic_machine != $1 ]
51 then os=`echo $1 | sed 's/.*-/-/'`
52 else os=; fi
53
54 # Lets recognize common machines as not being OS so that things like
55 # config.subr decstation-3100 as legal.
56 case $os in
57         -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
58         -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
59         -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | \
60         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -osf* | \
61         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
62         -harris)
63                 os=
64                 basic_machine=$1
65                 ;;
66         -sco*)
67                 os=-scosysv322
68                 basic_machine=i386-unknown
69                 ;;
70         -OSE68k | -ose68k | -OSE | -ose | -es1800)
71                 os=-ose
72                 basic_machine=m68k-ericsson
73                 ;;
74         -OSE68000 | -ose68000)
75                 os=-ose
76                 basic_machine=m68000-ericsson
77                 ;;
78         -isc*)
79                 os=-iscsysv
80                 basic_machine=i386-unknown
81                 ;;
82 # start-sanitize-v9
83         -32)
84                 basic_machine=sparc64-hal
85                 os=-hal32
86                 ;;
87         -64)
88                 basic_machine=sparc64-hal
89                 os=-hal64
90                 ;;
91         -v7)
92                 basic_machine=sparc64-sun
93                 os=-v7
94                 ;;
95 # end-sanitize-v9       
96 esac
97
98 # Decode aliases for certain CPU-COMPANY combinations.
99 case $basic_machine in
100         # Recognize the basic CPU types with without company name.
101         tahoe | i386 | i486 | i860 | m68k | m680[01234]0 | m683?2 \
102                 | m88k | ns32k | arm | pyramid \
103                 | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 | we32k\
104                 | v70)
105                 basic_machine=$basic_machine-unknown
106                 ;;
107         # Recognize the basic CPU types with with company name.
108         vax-* | tahoe-* | i386-* | i860-* | m68k-* \
109               | m680[01234]0-* | m683?2-* | m88k-* \
110               | sparc-* | ns32k-* | alliant-* | arm-* | c[123]* \
111               | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
112               | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
113               | hppa1.0-* | hppa1.1-* | we32k-*)
114                 ;;
115         # Recognize the various machine names and aliases which stand
116         # for a CPU type and a company and sometimes even an OS.
117 # start-sanitize-life
118         life-*) ;;
119         life)
120                 basic_machine=life-philips
121                 os=-none
122                 ;;
123 # end-sanitize-life
124
125 # start-sanitize-v9
126         sparc64-*) ;;
127         hal-32 | hal32)
128                 basic_machine=sparc64-hal
129                 os=-hal32
130                 ;;
131         hal-64 | hal64)
132                 basic_machine=sparc64-hal
133                 os=-hal64
134                 ;;
135         sparc64)
136                 basic_machine=sparc64-sun
137                 os=-v9
138                 ;;
139         sparc64-v7 | sparc64v7)
140                 basic_machine=sparc64-sun
141                 os=-v7
142                 ;;
143 # end-sanitize-v9
144
145         vaxv)
146                 basic_machine=vax-dec
147                 os=-sysv
148                 ;;
149         vms)
150                 basic_machine=vax-dec
151                 os=-vms
152                 ;;
153         i386mach)
154                 basic_machine=i386-mach
155                 os=-mach
156                 ;;
157         i386v32)
158                 basic_machine=i386-unknown
159                 os=-sysv32
160                 ;;
161         i386-sco* | i386sco | sco)
162                 basic_machine=i386-unknown
163                 os=-scosysv322
164                 ;;
165         go32 | i386-go32)
166                 basic_machine=i386-unknown
167                 os=-go32
168                 ;;
169         i386-isc* | isc)
170                 basic_machine=i386-unknown
171                 os=-iscsysv
172                 ;;
173         i386-linux* | linux)
174                 basic_machine=i386-unknown
175                 os=-linux
176                 ;;
177         i386v4*)
178                 basic_machine=i386-unknown
179                 os=-sysv4
180                 ;;
181         i386v)
182                 basic_machine=i386-unknown
183                 os=-sysv
184                 ;;
185         spur)
186                 basic_machine=spur-unknown
187                 ;;
188         alliant)
189                 basic_machine=alliant-alliant
190                 ;;
191         convex-c1)
192                 basic_machine=c1-convex
193                 os=-sysv
194                 ;;
195         convex-c2)
196                 basic_machine=c2-convex
197                 os=-sysv
198                 ;;
199         convex-c32)
200                 basic_machine=c32-convex
201                 os=-sysv
202                 ;;
203         convex-c34)
204                 basic_machine=c34-convex
205                 os=-sysv
206                 ;;
207         convex-c38)
208                 basic_machine=c38-convex
209                 os=-sysv
210                 ;;
211         m88k-omron*)
212                 basic_machine=m88k-omron
213                 ;;
214         merlin)
215                 basic_machine=ns32k-utek
216                 os=-sysv
217                 ;;
218         crds | unos)
219                 basic_machine=m68k-crds
220                 ;;
221         encore | umax | mmax)
222                 basic_machine=ns32k-encore
223                 os=-sysv
224                 ;;
225         genix)
226                 basic_machine=ns32k-ns
227                 ;;
228         iris | iris3 | iris4d)
229                 basic_machine=mips-sgi
230                 os=-irix3
231                 ;;
232         iris4)
233                 basic_machine=mips-sgi
234                 os=-irix4
235                 ;;
236         news | news700 | news800 | news900)
237                 basic_machine=m68k-sony
238                 os=-newsos
239                 ;;
240         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
241                 basic_machine=m68k-att
242                 ;;
243         delta | 3300 | motorola-3300 | motorola-delta \
244               | 3300-motorola | delta-motorola)
245                 basic_machine=m68k-motorola
246                 ;;
247         balance)
248                 basic_machine=ns32k-sequent
249                 os=-dynix
250                 ;;
251         pc532)
252                 basic_machine=ns32k-pc532
253                 ;;
254         symmetry)
255                 basic_machine=i386-sequent
256                 os=-dynix
257                 ;;
258         sun2)
259                 basic_machine=m68000-sun
260                 ;;
261         sun2os3)
262                 basic_machine=m68000-sun
263                 os=-sunos3
264                 ;;
265         sun2os4)
266                 basic_machine=m68000-sun
267                 os=-sunos4
268                 ;;
269         sun3os3)
270                 basic_machine=m68k-sun
271                 os=-sunos3
272                 ;;
273         sun3os4)
274                 basic_machine=m68k-sun
275                 os=-sunos4
276                 ;;
277         sun4os3)
278                 basic_machine=sparc-sun
279                 os=-sunos3
280                 ;;
281         sun4os4)
282                 basic_machine=sparc-sun
283                 os=-sunos4
284                 ;;
285         sun4sol2)
286                 basic_machine=sparc-sun
287                 os=-solaris2
288                 ;;
289         sun3)
290                 basic_machine=m68k-sun
291                 ;;
292         sun4)
293                 basic_machine=sparc-sun
294                 ;;
295         msdos)
296                 basic_machine=i386-unknown      
297                 os=-msdos
298                 ;;
299         pbd)
300                 basic_machine=sparc-unicom
301                 ;;
302         sun386 | sun386i | roadrunner)
303                 basic_machine=i386-sun
304                 ;;
305         ps2)
306                 basic_machine=i386-ibm
307                 ;;
308         next)
309                 basic_machine=m68k-next
310                 os=-bsd
311                 ;;
312         hp9k3[2-9][0-9])
313                 basic_machine=m68k-hp
314                 ;;
315         hp9k31[0-9] | hp9k2[0-9][0-9])
316                 basic_machine=m68000-hp
317                 ;;
318         hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
319                 basic_machine=hppa1.1-hp
320                 ;;
321         hp9k8[0-9][0-9] | hp8[0-9][0-9])
322                 basic_machine=hppa1.0-hp
323                 ;;
324         isi68 | isi)
325                 basic_machine=m68k-isi
326                 os=-sysv
327                 ;;
328         apollo68)
329                 basic_machine=m68k-apollo
330                 os=-sysv
331                 ;;
332         apollo68bsd)
333                 basic_machine=m68k-apollo
334                 os=-bsd
335                 ;;
336         altos | altos3068)
337                 basic_machine=m68k-altos
338                 ;;
339         miniframe)
340                 basic_machine=m68000-convergent
341                 ;;
342         tower | tower-32)
343                 basic_machine=m68k-ncr
344                 ;;
345         news-3600 | risc-news)
346                 basic_machine=mips-sony
347                 os=-newsos
348                 ;;
349         st2000)
350                 basic_machine=m68kmote-tandem
351                 ;;
352         decstation-dec | decstation | decstation-3100 | pmax | pmin | dec3100 | decstatn)
353                 basic_machine=mips-dec
354                 ;;
355         magnum | m3230)
356                 basic_machine=mips-mips
357                 os=-sysv
358                 ;;
359         gmicro)
360                 basic_machine=tron-gmicro
361                 os=-sysv
362                 ;;
363         rtpc | rtpc-*)
364                 basic_machine=romp-ibm
365                 ;;
366         am29k)
367                 basic_machine=a29k-none
368                 os=-bsd
369                 ;;
370         amdahl)
371                 basic_machine=580-amdahl
372                 os=-sysv
373                 ;;
374         amigados)
375                 basic_machine=m68k-cbm
376                 os=-amigados
377                 ;;
378         amigaunix | amix)
379                 basic_machine=m68k-cbm
380                 os=-sysv4
381                 ;;
382         stratus)
383                 basic_machine=i860-stratus
384                 os=-sysv4
385                 ;;
386         cray | ymp)
387                 basic_machine=ymp-cray
388                 os=-unicos
389                 ;;
390         cray2)
391                 basic_machine=cray2-cray
392                 os=-unicos
393                 ;;
394         xmp)
395                 basic_machine=xmp-cray
396                 os=-unicos
397                 ;;
398         delta88)
399                 basic_machine=m88k-motorola
400                 os=-m88kbcs
401                 ;;
402         dpx2)
403                 basic_machine=m68k-bull
404                 os=-sysv
405                 ;;
406         ebmon29k)
407                 basic_machine=a29k-amd
408                 os=-ebmon
409                 ;;
410
411         h8300hms)
412                 basic_machine=h8300-hitachi
413                 os=-hms
414                 ;;
415         udi29k)
416                 basic_machine=a29k-amd
417                 os=-udi
418                 ;;
419         a29khif)
420                 basic_machine=a29k-amd
421                 os=-udi
422                 ;;
423         sa29200)
424                 basic_machine=a29k-amd
425                 os=-udi
426                 ;;
427         h8300xray)
428                 basic_machine=h8300-hitachi
429                 os=-xray
430                 ;;
431         harris)
432                 basic_machine=m88k-harris
433                 os=-m88kbcs
434                 ;;
435         hp300bsd)
436                 basic_machine=m68k-hp
437                 os=-bsd
438                 ;;
439         hp300hpux)
440                 basic_machine=m68k-hp
441                 os=-hpux
442                 ;;
443         hp9k2[0-9][0-9] | hp9k31[0-9])
444                 basic_machine=m68000-hp
445                 os=-hpux
446                 ;;
447         hp9k3[2-9][0-9])
448                 basic_machine=m68k-hp
449                 os=-hpux
450                 ;;
451         hppabsd)
452                 basic_machine=hppa-hp
453                 os=-bsd
454                 ;;
455         hppahpux)
456                 basic_machine=hppa-hp
457                 os=-hpux
458                 ;;
459         ncr3000)
460                 basic_machine=i486-ncr
461                 os=-sysv4
462                 ;;
463         necv70)
464                 basic_machine=v70-nec
465                 os=-sysv
466                 ;;
467         news1000)
468                 basic_machine=m68030-sony
469                 os=-newsos
470                 ;;
471         nindy960)
472                 basic_machine=i960-intel
473                 os=-nindy
474                 ;;
475         pn)
476                 basic_machine=pn-gould
477                 os=-sysv
478                 ;;
479         np1)
480                 basic_machine=np1-gould
481                 os=-sysv
482                 ;;
483         ultra3)
484                 basic_machine=a29k-nyu
485                 os=-sym1
486                 ;;
487         vxworks960)
488                 basic_machine=i960-wrs
489                 os=-vxworks
490                 ;;
491         vxworks68)
492                 basic_machine=m68k-wrs
493                 os=-vxworks
494                 ;;
495         es1800 | OSE68k | ose68k)
496                 basic_machine=m68k-ericsson
497                 os=-ose
498                 ;;
499         OSE68000 | ose68000)
500                 basic_machine=m68000-ericsson
501                 os=-ose
502                 ;;
503         os68k)
504                 basic_machine=m68k-none
505                 os=-os68k
506                 ;;
507         sparclite)
508                 basic_machine=sparclite-fujitsu
509                 os=-none
510                 ;;
511         sparcfrw)
512                 basic_machine=sparcfrw-sun
513                 os=-sunos4
514                 ;;
515         sparcfrwcompat)
516                 basic_machine=sparcfrwcompat-sun
517                 os=-sunos4
518                 ;;
519         sparclitefrw)
520                 basic_machine=sparclitefrw-fujitsu
521                 os=-none
522                 ;;
523         sparclitefrwcompat)
524                 basic_machine=sparclitefrwcompat-fujitsu
525                 os=-none
526                 ;;
527
528         none)
529                 basic_machine=none-none
530                 os=-none
531                 ;;
532
533 # Here we handle the default manufacturer of certain CPU types.  It is in
534 # some cases the only manufacturer, in others, it is the most popular.
535         mips)
536                 basic_machine=mips-mips
537                 ;;
538         romp)
539                 basic_machine=romp-ibm
540                 ;;
541         rs6000)
542                 basic_machine=rs6000-ibm
543                 ;;
544         vax)
545                 basic_machine=vax-dec
546                 ;;
547         sparc)
548                 basic_machine=sparc-sun
549                 ;;
550         fx2800)
551                 basic_machine=i860-alliant
552                 ;;
553         *)
554                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
555                 exit 1
556                 ;;
557 esac
558
559 # Decode manufacturer-specific aliases for certain operating systems.
560
561 if [ "$os" ]
562 then
563 case $os in
564         # First accept the basic system types.
565         # The portable systems comes first.
566         # Each alternative must end in a *, to match a version number.
567         -bsd* | -sysv* | -mach* | -minix* | -genix* | -ultrix* | -aout | -coff \
568               | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos* | -hpux* \
569               | -unos* | -osf* | -v88r* | -luna* | -dgux* | -solaris* | -sym* \
570               | -newsos | -amigados* | -msdos* | -none* | -os68k* | -irix* \
571               | -nindy* | -vxworks* | -ebmon* | -udi | -hms* | -xray \
572               | -m88kbcs* | -go32 | -linux* )
573         ;;
574 # start-sanitize-v9
575         -v7 | -v9 | -hal32 | -hal64) ;;
576 # end-sanitize-v9
577
578 # Note that readline checks for newsos
579 #       -newsos*)
580 #               os=-bsd
581 #               ;;
582         -osfrose*)
583                 os=-osf
584                 ;;
585         -osf*)
586                 os=-bsd
587                 ;;
588         -dynix*)
589                 os=-bsd
590                 ;;
591         -aos*)
592                 os=-bsd
593                 ;;
594         -ctix* | -uts*)
595                 os=-sysv
596                 ;;
597         -svr4)
598                 os=-sysv4
599                 ;;
600         -svr3)
601                 os=-sysv3
602                 ;;
603         -ose*)
604                 os=-ose
605                 ;;
606         -es1800*)
607                 os=-ose
608                 ;;
609         *)
610                 # Get rid of the `-' at the beginning of $os.
611                 os=`echo $1 | sed 's/[^-]*-//'`
612                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
613                 exit 1
614                 ;;
615 esac
616 else
617
618 # Here we handle the default operating systems that come with various machines.
619 # The value should be what the vendor currently ships out the door with their
620 # machine or put another way, the most popular os provided with the machine.
621 case $basic_machine in
622         *-dec | vax-*)
623                 os=-ultrix42
624                 ;;
625         i386-sun)
626                 os=-sunos402
627                 ;;
628         m68000-sun)
629                 os=-sunos3
630                 # This also exists in the configure program, but was not the
631                 # default.
632                 # os=-sunos4
633                 ;;
634         sparc-* | *-sun)
635                 os=-sunos411
636                 ;;
637         romp-*)
638                 os=-bsd
639                 ;;
640         *-ibm)
641                 os=-aix
642                 ;;
643         *-hp)
644                 os=-hpux
645                 ;;
646         *-sgi | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
647                 os=-sysv
648                 ;;
649         *-dg)
650                 os=-dgux
651                 ;;
652         m88k-omron*)
653                 os=-luna
654                 ;;
655         *-crds)
656                 os=-unos
657                 ;;
658         *-ns)
659                 os=-genix
660                 ;;
661         i386-*)
662                 os=-scosysv322
663                 ;;
664         *)
665                 os=-none
666                 ;;
667 esac
668 fi
669
670 # Here we handle the case where we know the os, and the CPU type, but not the
671 # manufacturer.  We pick the logical manufacturer.
672 vendor=unknown
673 case $basic_machine in
674         *-unknown)
675                 case $os in
676                         -sunos*)
677                                 vendor=sun
678                                 ;;
679                         -aix*)
680                                 vendor=ibm
681                                 ;;
682                         -hpux*)
683                                 vendor=hp
684                                 ;;
685                         -unos*)
686                                 vendor=crds
687                                 ;;
688                         -dgux*)
689                                 vendor=dg
690                                 ;;
691                         -luna*)
692                                 vendor=omron
693                                 ;;
694                         -genix*)
695                                 vendor=ns
696                                 ;;
697                         -vxworks*)
698                                 vendor=wrs
699                                 ;;
700                 esac
701                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
702                 ;;
703 esac
704
705 echo $basic_machine$os