Added support for OS/68k (as a target) and Apollo Series 400's (as
[external/binutils.git] / config.sub
1 #!/bin/sh
2 # Configuration validation subroutine script, version 1.0.
3 #   Copyright (C) 1991 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         -isc*)
71                 os=-iscsysv
72                 basic_machine=i386-unknown
73                 ;;
74 # start-sanitize-v9
75         -32)
76                 basic_machine=sparc64-hal
77                 os=-hal32
78                 ;;
79         -64)
80                 basic_machine=sparc64-hal
81                 os=-hal64
82                 ;;
83         -v7)
84                 basic_machine=sparc64-sun
85                 os=-v7
86                 ;;
87 # end-sanitize-v9       
88 esac
89
90 # Decode aliases for certain CPU-COMPANY combinations.
91 case $basic_machine in
92         # Recognize the basic CPU types with without company name.
93         tahoe | i386 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \
94                 | tron | a29k | 580 | i960 | h8300)
95                 basic_machine=$basic_machine-unknown
96                 ;;
97         # Recognize the basic CPU types with with company name.
98         vax-* | tahoe-* | i386-* | i860-* | m68k-* | m68000-* | m88k-* \
99               | sparc-* | ns32k-* | alliant-* | arm-* | c[123]* \
100               | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
101               | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
102               | hppa-*)
103                 ;;
104         # Recognize the various machine names and aliases which stand
105         # for a CPU type and a company and sometimes even an OS.
106 # start-sanitize-life
107         life-*) ;;
108         life)
109                 basic_machine=life-philips
110                 os=-none
111                 ;;
112 # end-sanitize-life
113
114 # start-sanitize-v9
115         sparc64-*) ;;
116         hal-32 | hal32)
117                 basic_machine=sparc64-hal
118                 os=-hal32
119                 ;;
120         hal-64 | hal64)
121                 basic_machine=sparc64-hal
122                 os=-hal64
123                 ;;
124         sparc64)
125                 basic_machine=sparc64-sun
126                 os=-v9
127                 ;;
128         sparc64-v7 | sparc64v7)
129                 basic_machine=sparc64-sun
130                 os=-v7
131                 ;;
132 # end-sanitize-v9
133
134         vaxv)
135                 basic_machine=vax-dec
136                 os=-sysv
137                 ;;
138         vms)
139                 basic_machine=vax-dec
140                 os=-vms
141                 ;;
142         i386v32)
143                 basic_machine=i386-unknown
144                 os=-sysv32
145                 ;;
146         i386-sco* | i386sco | sco)
147                 basic_machine=i386-unknown
148                 os=-scosysv322
149                 ;;
150         i386-isc* | isc)
151                 basic_machine=i386-unknown
152                 os=-iscsysv
153                 ;;
154         i386v4*)
155                 basic_machine=i386-unknown
156                 os=-sysv4
157                 ;;
158         i386v)
159                 basic_machine=i386-unknown
160                 os=-sysv
161                 ;;
162         spur)
163                 basic_machine=spur-unknown
164                 ;;
165         alliant)
166                 basic_machine=alliant-alliant
167                 ;;
168         convex-c1)
169                 basic_machine=c1-convex
170                 os=-sysv
171                 ;;
172         convex-c2)
173                 basic_machine=c2-convex
174                 os=-sysv
175                 ;;
176         convex-c32)
177                 basic_machine=c32-convex
178                 os=-sysv
179                 ;;
180         convex-c34)
181                 basic_machine=c34-convex
182                 os=-sysv
183                 ;;
184         convex-c38)
185                 basic_machine=c38-convex
186                 os=-sysv
187                 ;;
188         m88k-omron*)
189                 basic_machine=m88k-omron
190                 ;;
191         merlin)
192                 basic_machine=ns32k-utek
193                 os=-sysv
194                 ;;
195         crds | unos)
196                 basic_machine=m68k-crds
197                 ;;
198         encore | umax | mmax)
199                 basic_machine=ns32k-encore
200                 os=-sysv
201                 ;;
202         genix)
203                 basic_machine=ns32k-ns
204                 ;;
205         iris | iris4d)
206                 basic_machine=mips-sgi
207                 os=-irix
208                 ;;
209         news | news700 | news800 | news900)
210                 basic_machine=m68k-sony
211                 os=-newsos
212                 ;;
213         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
214                 basic_machine=m68k-att
215                 ;;
216         delta | 3300 | motorola-3300 | motorola-delta \
217               | 3300-motorola | delta-motorola)
218                 basic_machine=m68k-motorola
219                 ;;
220         balance)
221                 basic_machine=ns32k-sequent
222                 os=-dynix
223                 ;;
224         pc532)
225                 basic_machine=ns32k-pc532
226                 ;;
227         symmetry)
228                 basic_machine=i386-sequent
229                 os=-dynix
230                 ;;
231         sun2)
232                 basic_machine=m68000-sun
233                 ;;
234         sun2os3)
235                 basic_machine=m68000-sun
236                 os=-sunos3
237                 ;;
238         sun2os4)
239                 basic_machine=m68000-sun
240                 os=-sunos4
241                 ;;
242         sun3os3)
243                 basic_machine=m68k-sun
244                 os=-sunos3
245                 ;;
246         sun3os4)
247                 basic_machine=m68k-sun
248                 os=-sunos4
249                 ;;
250         sun4os3)
251                 basic_machine=sparc-sun
252                 os=-sunos3
253                 ;;
254         sun4os4)
255                 basic_machine=sparc-sun
256                 os=-sunos4
257                 ;;
258         sun3)
259                 basic_machine=m68k-sun
260                 ;;
261         sun4)
262                 basic_machine=sparc-sun
263                 ;;
264         pbd)
265                 basic_machine=sparc-unicom
266                 ;;
267         sun386 | sun386i | roadrunner)
268                 basic_machine=i386-sun
269                 ;;
270         ps2)
271                 basic_machine=i386-ibm
272                 ;;
273         next)
274                 basic_machine=m68k-next
275                 os=-sysv
276                 ;;
277         hp9k3[2-9][0-9])
278                 basic_machine=m68k-hp
279                 ;;
280         hp9k31[0-9] | hp9k2[0-9][0-9])
281                 basic_machine=m68000-hp
282                 ;;
283         hp9k8[0-9][0-9] | hp9k7[0-9][0-9] | hp8[0-9][0-9] | hp7[0-9][0-9])
284                 basic_machine=hp800-hp
285                 ;;
286         isi68 | isi)
287                 basic_machine=m68k-isi
288                 os=-sysv
289                 ;;
290         apollo68)
291                 basic_machine=m68k-apollo
292                 os=-sysv
293                 ;;
294         altos | altos3068)
295                 basic_machine=m68k-altos
296                 ;;
297         miniframe)
298                 basic_machine=m68000-convergent
299                 ;;
300         tower | tower-32)
301                 basic_machine=m68k-ncr
302                 ;;
303         news-3600 | risc-news)
304                 basic_machine=mips-sony
305                 os=-newsos
306                 ;;
307         decstation-dec | decstation | decstation-3100 | pmax | pmin | dec3100 | decstatn)
308                 basic_machine=mips-dec
309                 ;;
310         magnum | m3230)
311                 basic_machine=mips-mips
312                 os=-sysv
313                 ;;
314         gmicro)
315                 basic_machine=tron-gmicro
316                 os=-sysv
317                 ;;
318         rtpc | rtpc-*)
319                 basic_machine=romp-ibm
320                 ;;
321         am29k)
322                 basic_machine=a29k-none
323                 os=-bsd
324                 ;;
325         amdahl)
326                 basic_machine=580-amdahl
327                 os=-sysv
328                 ;;
329         amigados)
330                 basic_machine=m68k-cbm
331                 os=-amigados
332                 ;;
333         amigaunix | amix)
334                 basic_machine=m68k-cbm
335                 os=-sysv4
336                 ;;
337         stratus)
338                 basic_machine=i860-stratus
339                 os=-sysv4
340                 ;;
341         cray | ymp)
342                 basic_machine=ymp-cray
343                 os=-unicos
344                 ;;
345         cray2)
346                 basic_machine=cray2-cray
347                 os=-unicos
348                 ;;
349         xmp)
350                 basic_machine=xmp-cray
351                 os=-unicos
352                 ;;
353         delta88)
354                 basic_machine=m88k-motorola
355                 os=-m88kbcs
356                 ;;
357         dpx2)
358                 basic_machine=m68k-bull
359                 os=-sysv
360                 ;;
361         ebmon29k)
362                 basic_machine=a29k-amd
363                 os=-ebmon
364                 ;;
365         h8300hds)
366                 basic_machine=h8300-hitachi
367                 os=-hds
368                 ;;
369         harris)
370                 basic_machine=m88k-harris
371                 os=-m88kbcs
372                 ;;
373         hp300bsd)
374                 basic_machine=m68k-hp
375                 os=-bsd
376                 ;;
377         hp300hpux)
378                 basic_machine=m68k-hp
379                 os=-hpux
380                 ;;
381         hp9k2[0-9][0-9] | hp9k31[0-9])
382                 basic_machine=m68000-hp
383                 os=-hpux
384                 ;;
385         hp9k3[2-9][0-9])
386                 basic_machine=m68k-hp
387                 os=-hpux
388                 ;;
389         ncr3000)
390                 basic_machine=i386-ncr
391                 os=-sysv4
392                 ;;
393         news1000)
394                 basic_machine=m68030-sony
395                 os=-newsos
396                 ;;
397         nindy960)
398                 basic_machine=i960-intel
399                 os=-nindy
400                 ;;
401         pn)
402                 basic_machine=pn-gould
403                 os=-sysv
404                 ;;
405         np1)
406                 basic_machine=np1-gould
407                 os=-sysv
408                 ;;
409         ultra3)
410                 basic_machine=a29k-nyu
411                 os=-sym1
412                 ;;
413         vxworks960)
414                 basic_machine=i960-wrs
415                 os=-vxworks
416                 ;;
417         vxworks68)
418                 basic_machine=m68k-wrs
419                 os=-vxworks
420                 ;;
421         os68k)
422                 basic_machine=m68k-none
423                 os=-os68k
424                 ;;
425         none)
426                 basic_machine=none-none
427                 os=-none
428                 ;;
429
430 # Here we handle the default manufacturer of certain CPU types.  It is in
431 # some cases the only manufacturer, in others, it is the most popular.
432         mips)
433                 basic_machine=mips-mips
434                 ;;
435         romp)
436                 basic_machine=romp-ibm
437                 ;;
438         rs6000)
439                 basic_machine=rs6000-ibm
440                 ;;
441         vax)
442                 basic_machine=vax-dec
443                 ;;
444         sparc)
445                 basic_machine=sparc-sun
446                 ;;
447         fx2800)
448                 basic_machine=i860-alliant
449                 ;;
450         *)
451                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
452                 exit 1
453                 ;;
454 esac
455
456 # Decode manufacturer-specific aliases for certain operating systems.
457
458 if [ "$os" ]
459 then
460 case $os in
461         # First accept the basic system types.
462         # The portable systems comes first.
463         # Each alternative must end in a *, to match a version number.
464         -bsd* | -sysv* | -mach* | -minix* | -genix* | -ultrix* \
465               | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos* | -hpux* \
466               | -unos* | -osf* | -v88r* | -luna* | -dgux* | -solari* | -sym* \
467               | -amigados* | -msdos* | -none* | -os68k* \
468               | -nindy* | -vxworks* | -ebmon* | -hds* | -m88kbcs*)
469                 ;;
470 # start-sanitize-v9
471         -v7 | -v9 | -hal32 | -hal64) ;;
472 # end-sanitize-v9
473
474         -newsos*)
475                 os=-bsd
476                 ;;
477         -osfrose*)
478                 os=-osf
479                 ;;
480         -osf*)
481                 os=-bsd
482                 ;;
483         -dynix*)
484                 os=-bsd
485                 ;;
486         -aos*)
487                 os=-bsd
488                 ;;
489         -ctix* | -irix* | -uts*)
490                 os=-sysv
491                 ;;
492         -svr4)
493                 os=-sysv4
494                 ;;
495         -svr3)
496                 os=-sysv3
497                 ;;
498         *)
499                 # Get rid of the `-' at the beginning of $os.
500                 os=`echo $1 | sed 's/[^-]*-//'`
501                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
502                 exit 1
503                 ;;
504 esac
505 else
506
507 # Here we handle the default operating systems that come with various machines.
508 # The value should be what the vendor currently ships out the door with their
509 # machine or put another way, the most popular os provided with the machine.
510 case $basic_machine in
511         *-dec | vax-*)
512                 os=-ultrix42
513                 ;;
514         i386-sun)
515                 os=-sunos402
516                 ;;
517         m68000-sun)
518                 os=-sunos3
519                 # This also exists in the configure program, but was not the
520                 # default.
521                 # os=-sunos4
522                 ;;
523         sparc-* | *-sun)
524                 os=-sunos411
525                 ;;
526         romp-*)
527                 os=-bsd
528                 ;;
529         *-ibm)
530                 os=-aix
531                 ;;
532         *-hp)
533                 os=-hpux
534                 ;;
535         *-sgi | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
536                 os=-sysv
537                 ;;
538         *-dg)
539                 os=-dgux
540                 ;;
541         m88k-omron*)
542                 os=-luna
543                 ;;
544         *-crds)
545                 os=-unos
546                 ;;
547         *-ns)
548                 os=-genix
549                 ;;
550         i386-*)
551                 os=-scosysv322
552                 ;;
553         *)
554                 os=-none
555                 ;;
556 esac
557 fi
558
559 # Here we handle the case where we know the os, and the CPU type, but not the
560 # manufacturer.  We pick the logical manufacturer.
561 vendor=unknown
562 case $basic_machine in
563         *-unknown)
564                 case $os in
565                         -sunos*)
566                                 vendor=sun
567                                 ;;
568                         -aix*)
569                                 vendor=ibm
570                                 ;;
571                         -hpux*)
572                                 vendor=hp
573                                 ;;
574                         -unos*)
575                                 vendor=crds
576                                 ;;
577                         -dgux*)
578                                 vendor=dg
579                                 ;;
580                         -luna*)
581                                 vendor=omron
582                                 ;;
583                         -genix*)
584                                 vendor=ns
585                                 ;;
586                 esac
587                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
588                 ;;
589 esac
590
591 echo $basic_machine$os