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