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