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