Recognize powerpc.
[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         alliant | fx80)
164                 basic_machine=fx80-alliant
165                 ;;
166         convex-c1)
167                 basic_machine=c1-convex
168                 os=-bsd
169                 ;;
170         convex-c2)
171                 basic_machine=c2-convex
172                 os=-bsd
173                 ;;
174         convex-c32)
175                 basic_machine=c32-convex
176                 os=-bsd
177                 ;;
178         convex-c34)
179                 basic_machine=c34-convex
180                 os=-bsd
181                 ;;
182         convex-c38)
183                 basic_machine=c38-convex
184                 os=-bsd
185                 ;;
186         m88k-omron*)
187                 basic_machine=m88k-omron
188                 ;;
189         merlin)
190                 basic_machine=ns32k-utek
191                 os=-sysv
192                 ;;
193         crds | unos)
194                 basic_machine=m68k-crds
195                 ;;
196         elxsi)
197                 basic_machine=elxsi-elxsi
198                 os=-bsd
199                 ;;
200         encore | umax | mmax)
201                 basic_machine=ns32k-encore
202                 ;;
203         genix)
204                 basic_machine=ns32k-ns
205                 ;;
206         iris | iris4d)
207                 basic_machine=mips-sgi
208                 case $os in
209                     -irix*)
210                         ;;
211                     *)
212                         os=-irix4
213                         ;;
214                 esac
215                 ;;
216         news | news700 | news800 | news900)
217                 basic_machine=m68k-sony
218                 os=-newsos
219                 ;;
220         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
221                 basic_machine=m68000-att
222                 ;;
223         3b*)
224                 basic_machine=we32k-att
225                 ;;
226         delta | 3300 | motorola-3300 | motorola-delta \
227               | 3300-motorola | delta-motorola)
228                 basic_machine=m68k-motorola
229                 ;;
230         balance)
231                 basic_machine=ns32k-sequent
232                 os=-dynix
233                 ;;
234         pc532)
235                 basic_machine=ns32k-pc532
236                 ;;
237         symmetry)
238                 basic_machine=i386-sequent
239                 os=-dynix
240                 ;;
241         sun2)
242                 basic_machine=m68000-sun
243                 ;;
244         sun2os3)
245                 basic_machine=m68000-sun
246                 os=-sunos3
247                 ;;
248         sun2os4)
249                 basic_machine=m68000-sun
250                 os=-sunos4
251                 ;;
252         sun3os3)
253                 basic_machine=m68k-sun
254                 os=-sunos3
255                 ;;
256         sun3os4)
257                 basic_machine=m68k-sun
258                 os=-sunos4
259                 ;;
260         sun4os3)
261                 basic_machine=sparc-sun
262                 os=-sunos3
263                 ;;
264         sun4os4)
265                 basic_machine=sparc-sun
266                 os=-sunos4
267                 ;;
268         sun3)
269                 basic_machine=m68k-sun
270                 ;;
271         sun4)
272                 basic_machine=sparc-sun
273                 ;;
274         pbd)
275                 basic_machine=sparc-tti
276                 ;;
277         pbb)
278                 basic_machine=m68k-tti
279                 ;;
280         sun386 | sun386i | roadrunner)
281                 basic_machine=i386-sun
282                 ;;
283         ps2)
284                 basic_machine=i386-ibm
285                 ;;
286         fx2800)
287                 basic_machine=i860-alliant
288                 ;;
289         next)
290                 basic_machine=m68k-next
291                 os=-bsd
292                 ;;
293         amiga)
294                 basic_machine=m68k-cbm
295                 ;;
296         amigados)
297                 basic_machine=m68k-cbm
298                 os=-amigados
299                 ;;
300         amigaunix | amix)
301                 basic_machine=m68k-cbm
302                 os=-sysv4
303                 ;;
304         hp9k3[2-9][0-9])
305                 basic_machine=m68k-hp
306                 ;;
307         hp9k31[0-9] | hp9k2[0-9][0-9])
308                 basic_machine=m68000-hp
309                 ;;
310         hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
311                 basic_machine=hppa1.1-hp
312                 ;;
313         hp9k8[0-9][0-9] | hp8[0-9][0-9])
314                 basic_machine=hppa1.0-hp
315                 ;;
316         isi68 | isi)
317                 basic_machine=m68k-isi
318                 os=-sysv
319                 ;;
320         apollo68)
321                 basic_machine=m68k-apollo
322                 os=-sysv
323                 ;;
324         altos | altos3068)
325                 basic_machine=m68k-altos
326                 ;;
327         miniframe)
328                 basic_machine=m68000-convergent
329                 ;;
330         tower | tower-32)
331                 basic_machine=m68k-ncr
332                 ;;
333         news-3600 | risc-news)
334                 basic_machine=mips-sony
335                 os=-newsos
336                 ;;
337         decstation | decstation-3100 | pmax | pmin | dec3100 | decstatn)
338                 basic_machine=mips-dec
339                 ;;
340         magnum | m3230)
341                 basic_machine=mips-mips
342                 os=-sysv
343                 ;;
344         gmicro)
345                 basic_machine=tron-gmicro
346                 os=-sysv
347                 ;;
348         rtpc | rtpc-*)
349                 basic_machine=romp-ibm
350                 ;;
351         am29k)
352                 basic_machine=a29k-none
353                 os=-bsd
354                 ;;
355         amdahl)
356                 basic_machine=580-amdahl
357                 os=-sysv
358                 ;;
359         cray | ymp)
360                 basic_machine=ymp-cray
361                 os=-unicos
362                 ;;
363         cray2)
364                 basic_machine=cray2-cray
365                 os=-unicos
366                 ;;
367         xmp)
368                 basic_machine=xmp-cray
369                 os=-unicos
370                 ;;
371         delta88)
372                 basic_machine=m88k-motorola
373                 os=-sysv3
374                 ;;
375         dpx2* | dpx2*-bull)
376                 basic_machine=m68k-bull
377                 os=-sysv3
378                 ;;
379         sps7)
380                 basic_machine=m68k-bull
381                 os=-sysv2
382                 ;;
383         ebmon29k)
384                 basic_machine=a29k-amd
385                 os=-ebmon
386                 ;;
387         h8300hms)
388                 basic_machine=h8300-hitachi
389                 os=-hms
390                 ;;
391         sh)
392                 basic_machine=sh-hitachi
393                 os=-hms
394                 ;;
395         harris)
396                 basic_machine=m88k-harris
397                 os=-sysv3
398                 ;;
399         hp300bsd)
400                 basic_machine=m68k-hp
401                 os=-bsd
402                 ;;
403         hp300hpux)
404                 basic_machine=m68k-hp
405                 os=-hpux
406                 ;;
407         hp9k2[0-9][0-9] | hp9k31[0-9])
408                 basic_machine=m68000-hp
409                 os=-hpux
410                 ;;
411         hp9k3[2-9][0-9])
412                 basic_machine=m68k-hp
413                 os=-hpux
414                 ;;
415         ncr3000)
416                 basic_machine=i486-ncr
417                 os=-sysv4
418                 ;;
419         news1000)
420                 basic_machine=m68030-sony
421                 os=-newsos
422                 ;;
423         nindy960)
424                 basic_machine=i960-intel
425                 os=-nindy
426                 ;;
427         pn)
428                 basic_machine=pn-gould
429                 ;;
430         np1)
431                 basic_machine=np1-gould
432                 ;;
433         ultra3)
434                 basic_machine=a29k-nyu
435                 os=-sym1
436                 ;;
437         vxworks960)
438                 basic_machine=i960-wrs
439                 os=-vxworks
440                 ;;
441         vxworks68)
442                 basic_machine=m68k-wrs
443                 os=-vxworks
444                 ;;
445         xps | xps100)
446                 basic_machine=xps100-honeywell
447                 ;;
448         none)
449                 basic_machine=none-none
450                 os=-none
451                 ;;
452
453 # Here we handle the default manufacturer of certain CPU types.  It is in
454 # some cases the only manufacturer, in others, it is the most popular.
455         mips)
456                 basic_machine=mips-mips
457                 ;;
458         romp)
459                 basic_machine=romp-ibm
460                 ;;
461         rs6000)
462                 basic_machine=rs6000-ibm
463                 ;;
464         vax)
465                 basic_machine=vax-dec
466                 ;;
467         we32k)
468                 basic_machine=we32k-att
469                 ;;
470         sparc)
471                 basic_machine=sparc-sun
472                 ;;
473         cydra)
474                 basic_machine=cydra-cydrome
475                 ;;
476         orion)
477                 basic_machine=orion-highlevel
478                 ;;
479         orion105)
480                 basic_machine=clipper-highlevel
481                 ;;
482         *)
483                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
484                 exit 1
485                 ;;
486 esac
487
488 # Here we canonicalize certain aliases for manufacturers.
489 case $basic_machine in
490         *-digital*)
491                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
492                 ;;
493         *-commodore*)
494                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
495                 ;;
496         *)
497                 ;;
498 esac
499
500 # Decode manufacturer-specific aliases for certain operating systems.
501
502 if [ x"$os" != x"" ]
503 then
504 case $os in
505         # -solaris* is a basic system type, with this one exception.
506         -solaris1 | -solaris1.*)
507                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
508                 ;;
509         -solaris)
510                 os=-solaris2
511                 ;;
512         # First accept the basic system types.
513         # The portable systems comes first.
514         # Each alternative must end in a *, to match a version number.
515         # -sysv* is not here because it comes later, after sysvr4.
516         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
517               | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]* | -hpux* \
518               | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
519               | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
520               | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
521               | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
522               | -386bsd* | -netbsd* | -riscix* | -lynxos*)
523                 ;;
524         -sunos5*)
525                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
526                 ;;
527         -sunos6*)
528                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
529                 ;;
530         -osfrose*)
531                 os=-osfrose
532                 ;;
533         -osf*)
534                 os=-osf
535                 ;;
536         -utek*)
537                 os=-bsd
538                 ;;
539         -dynix*)
540                 os=-bsd
541                 ;;
542         -acis*)
543                 os=-aos
544                 ;;
545         -ctix* | -uts*)
546                 os=-sysv
547                 ;;
548         -triton*)
549                 os=-sysv3
550                 ;;
551         -oss*)
552                 os=-sysv3
553                 ;;
554         -svr4)
555                 os=-sysv4
556                 ;;
557         -svr3)
558                 os=-sysv3
559                 ;;
560         -sysvr4)
561                 os=-sysv4
562                 ;;
563         # This must come after -sysvr4.
564         -sysv*)
565                 ;;
566         -xenix)
567                 os=-xenix
568                 ;;
569         -none)
570                 ;;
571         *)
572                 # Get rid of the `-' at the beginning of $os.
573                 os=`echo $1 | sed 's/[^-]*-//'`
574                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
575                 exit 1
576                 ;;
577 esac
578 else
579
580 # Here we handle the default operating systems that come with various machines.
581 # The value should be what the vendor currently ships out the door with their
582 # machine or put another way, the most popular os provided with the machine.
583
584 # Note that if you're going to try to match "-MANUFACTURER" here (say,
585 # "-sun"), then you have to tell the case statement up towards the top
586 # that MANUFACTURER isn't an operating system.  Otherwise, code above
587 # will signal an error saying that MANUFACTURER isn't an operating
588 # system, and we'll never get to this point.
589
590 case $basic_machine in
591         *-acorn)
592                 os=-riscix1.2
593                 ;;
594         *-dec | vax-*)
595                 os=-ultrix4.2
596                 ;;
597         i386-sun)
598                 os=-sunos4.0.2
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         *-tti)  # must be before sparc entry or we get the wrong os.
607                 os=-sysv3
608                 ;;
609         sparc-* | *-sun)
610                 os=-sunos4.1.1
611                 ;;
612         *-ibm)
613                 os=-aix
614                 ;;
615         *-hp)
616                 os=-hpux
617                 ;;
618         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
619                 os=-sysv
620                 ;;
621         *-cbm)
622                 os=-amigados
623                 ;;
624         *-dg)
625                 os=-dgux
626                 ;;
627         *-dolphin)
628                 os=-sysv3
629                 ;;
630         m88k-omron*)
631                 os=-luna
632                 ;;
633         *-sequent)
634                 os=-bsd
635                 ;;
636         *-crds)
637                 os=-unos
638                 ;;
639         *-ns)
640                 os=-genix
641                 ;;
642         i370-*)
643                 os=-mvs
644                 ;;
645         *-next)
646                 os=-bsd
647                 ;;
648         i[34]86-*)
649                 os=-sco3.2v2
650                 ;;
651         *-gould)
652                 os=-sysv
653                 ;;
654         *-highlevel)
655                 os=-bsd
656                 ;;
657         *-encore)
658                 os=-bsd
659                 ;;
660         *-sgi)
661                 os=-irix
662                 ;;
663         *-masscomp)
664                 os=-rtu
665                 ;;
666         *)
667                 os=-none
668                 ;;
669 esac
670 fi
671
672 # Here we handle the case where we know the os, and the CPU type, but not the
673 # manufacturer.  We pick the logical manufacturer.
674 vendor=unknown
675 case $basic_machine in
676         *-unknown)
677                 case $os in
678                         -riscix*)
679                                 vendor=acorn
680                                 ;;
681                         -sunos*)
682                                 vendor=sun
683                                 ;;
684                         -lynxos*)
685                                 vendor=lynx
686                                 ;;
687                         -aix*)
688                                 vendor=ibm
689                                 ;;
690                         -hpux*)
691                                 vendor=hp
692                                 ;;
693                         -unos*)
694                                 vendor=crds
695                                 ;;
696                         -dgux*)
697                                 vendor=dg
698                                 ;;
699                         -luna*)
700                                 vendor=omron
701                                 ;;
702                         -genix*)
703                                 vendor=ns
704                                 ;;
705                         -mvs*)
706                                 vendor=ibm
707                                 ;;
708                 esac
709                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
710                 ;;
711 esac
712
713 echo $basic_machine$os