date and time created 93/06/07 22:17:12 by elan
[unix-history] / usr / src / contrib / gdb-4.7.LBL / config.sub
CommitLineData
c7ff96fd
EA
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
38if [ x$1 = x ]
39then
40 echo Configuration name missing. 1>&2
41 echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
42 echo "or $0 ALIAS" 1>&2
43 echo where ALIAS is a recognized configuration type. 1>&2
44 exit 1
45fi
46
47# First pass through any local machine types.
48case $1 in
49 *local*)
50 echo $1
51 exit 0
52 ;;
53 *)
54 ;;
55esac
56
57# Separate what the user gave into CPU-COMPANY and OS (if any).
58basic_machine=`echo $1 | sed 's/-[^-][^-]*$//'`
59if [ $basic_machine != $1 ]
60then os=`echo $1 | sed 's/.*-/-/'`
61else os=; fi
62
63# Lets recognize common machines as not being OS so that things like
64# config.subr decstation-3100 as legal.
65case $os in
66 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
67 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
68 -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | \
69 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -osf* | \
70 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
71 -harris | -sim)
72 os=
73 basic_machine=$1
74 ;;
75 -scout)
76 ;;
77 -sco*)
78 os=-scosysv322
79 basic_machine=i386-unknown
80 ;;
81 -OSE68k | -ose68k | -OSE | -ose | -es1800)
82 os=-ose
83 basic_machine=m68k-ericsson
84 ;;
85 -OSE68000 | -ose68000)
86 os=-ose
87 basic_machine=m68000-ericsson
88 ;;
89 -isc*)
90 os=-iscsysv
91 basic_machine=i386-unknown
92 ;;
93esac
94
95# Decode aliases for certain CPU-COMPANY combinations.
96case $basic_machine in
97 # Recognize the basic CPU types with without company name.
98 tahoe | i386 | i486 | i860 | m68k | m680[01234]0 | m683?2 \
99 | m88k | ns32k | arm | pyramid \
100 | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 | we32k\
101 | v70 | we32k | z8k)
102 basic_machine=$basic_machine-unknown
103 ;;
104 # Recognize the basic CPU types with with company name.
105 vax-* | tahoe-* | i386-* | i486-* | i860-* | m68k-* \
106 | m680[01234]0-* | m683?2-* | m88k-* \
107 | sparc-* | ns32k-* | alliant-* | arm-* | c[123]* \
108 | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
109 | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
110 | hppa1.0-* | hppa1.1-* | we32k-* | z8k-*)
111 ;;
112 # Recognize the various machine names and aliases which stand
113 # for a CPU type and a company and sometimes even an OS.
114
115
116 vaxv)
117 basic_machine=vax-dec
118 os=-sysv
119 ;;
120 vms)
121 basic_machine=vax-dec
122 os=-vms
123 ;;
124 i386mach)
125 basic_machine=i386-mach
126 os=-mach
127 ;;
128 i386v32)
129 basic_machine=i386-unknown
130 os=-sysv32
131 ;;
132 i386-sco* | i386sco | sco)
133 basic_machine=i386-unknown
134 os=-scosysv322
135 ;;
136 go32 | i386-go32)
137 basic_machine=i386-unknown
138 os=-go32
139 ;;
140 i386-isc* | isc)
141 basic_machine=i386-unknown
142 os=-iscsysv
143 ;;
144 i386-linux* | linux)
145 basic_machine=i386-unknown
146 os=-linux
147 ;;
148 i386v4*)
149 basic_machine=i386-unknown
150 os=-sysv4
151 ;;
152 i486v4*)
153 basic_machine=i486-unknown
154 os=-sysv4
155 ;;
156 i386v)
157 basic_machine=i386-unknown
158 os=-sysv
159 ;;
160 i486v)
161 basic_machine=i486-unknown
162 os=-sysv
163 ;;
164 386bsd)
165 basic_machine=i386-unknown
166 os=-bsd
167 ;;
168 spur)
169 basic_machine=spur-unknown
170 ;;
171 alliant)
172 basic_machine=alliant-alliant
173 ;;
174 convex-c1)
175 basic_machine=c1-convex
176 os=-sysv
177 ;;
178 convex-c2)
179 basic_machine=c2-convex
180 os=-sysv
181 ;;
182 convex-c32)
183 basic_machine=c32-convex
184 os=-sysv
185 ;;
186 convex-c34)
187 basic_machine=c34-convex
188 os=-sysv
189 ;;
190 convex-c38)
191 basic_machine=c38-convex
192 os=-sysv
193 ;;
194 m88k-omron*)
195 basic_machine=m88k-omron
196 ;;
197 merlin)
198 basic_machine=ns32k-utek
199 os=-sysv
200 ;;
201 crds | unos)
202 basic_machine=m68k-crds
203 ;;
204 encore | umax | mmax)
205 basic_machine=ns32k-encore
206 os=-sysv
207 ;;
208 genix)
209 basic_machine=ns32k-ns
210 ;;
211 iris | iris3 | iris4d)
212 basic_machine=mips-sgi
213 os=-irix3
214 ;;
215 iris4)
216 basic_machine=mips-sgi
217 os=-irix4
218 ;;
219 news | news700 | news800 | news900)
220 basic_machine=m68k-sony
221 os=-newsos
222 ;;
223 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
224 basic_machine=m68k-att
225 ;;
226 3b* | we32k* )
227 basic_machine=we32k-att
228 os=-sysv
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 sun4sol2)
273 basic_machine=sparc-sun
274 os=-solaris2
275 ;;
276 z8ksim)
277 basic_machine=z8k-unknown
278 os=-sim
279 ;;
280 sun3)
281 basic_machine=m68k-sun
282 ;;
283 sun4)
284 basic_machine=sparc-sun
285 ;;
286 msdos)
287 basic_machine=i386-unknown
288 os=-msdos
289 ;;
290 pbd)
291 basic_machine=sparc-unicom
292 ;;
293 sun386 | sun386i | roadrunner)
294 basic_machine=i386-sun
295 ;;
296 ps2)
297 basic_machine=i386-ibm
298 ;;
299 next)
300 basic_machine=m68k-next
301 os=-bsd
302 ;;
303 hp9k3[2-9][0-9])
304 basic_machine=m68k-hp
305 ;;
306 hp9k31[0-9] | hp9k2[0-9][0-9])
307 basic_machine=m68000-hp
308 ;;
309 hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
310 basic_machine=hppa1.1-hp
311 ;;
312 hp9k8[0-9][0-9] | hp8[0-9][0-9])
313 basic_machine=hppa1.0-hp
314 ;;
315 isi68 | isi)
316 basic_machine=m68k-isi
317 os=-sysv
318 ;;
319 apollo68)
320 basic_machine=m68k-apollo
321 os=-sysv
322 ;;
323 apollo68bsd)
324 basic_machine=m68k-apollo
325 os=-bsd
326 ;;
327 altos | altos3068)
328 basic_machine=m68k-altos
329 ;;
330 miniframe)
331 basic_machine=m68000-convergent
332 ;;
333 tower | tower-32)
334 basic_machine=m68k-ncr
335 ;;
336 news-3600 | risc-news)
337 basic_machine=mips-sony
338 os=-newsos
339 ;;
340 st2000)
341 basic_machine=m68k-tandem
342 ;;
343 decstation-dec | decstation | decstation-3100 | pmax | pmin | dec3100 | decstatn)
344 basic_machine=mips-dec
345 ;;
346 magnum | m3230)
347 basic_machine=mips-mips
348 os=-sysv
349 ;;
350 gmicro)
351 basic_machine=tron-gmicro
352 os=-sysv
353 ;;
354 rtpc | rtpc-*)
355 basic_machine=romp-ibm
356 ;;
357 am29k)
358 basic_machine=a29k-none
359 os=-bsd
360 ;;
361 amdahl)
362 basic_machine=580-amdahl
363 os=-sysv
364 ;;
365 amigados)
366 basic_machine=m68k-cbm
367 os=-amigados
368 ;;
369 amigaunix | amix)
370 basic_machine=m68k-cbm
371 os=-sysv4
372 ;;
373 stratus)
374 basic_machine=i860-stratus
375 os=-sysv4
376 ;;
377 cray | ymp)
378 basic_machine=ymp-cray
379 os=-unicos
380 ;;
381 cray2)
382 basic_machine=cray2-cray
383 os=-unicos
384 ;;
385 xmp)
386 basic_machine=xmp-cray
387 os=-unicos
388 ;;
389 delta88)
390 basic_machine=m88k-motorola
391 os=-m88kbcs
392 ;;
393 dpx2)
394 basic_machine=m68k-bull
395 os=-sysv
396 ;;
397 ebmon29k)
398 basic_machine=a29k-amd
399 os=-ebmon
400 ;;
401
402 h8300hms)
403 basic_machine=h8300-hitachi
404 os=-hms
405 ;;
406 udi29k)
407 basic_machine=a29k-amd
408 os=-udi
409 ;;
410 a29khif)
411 basic_machine=a29k-amd
412 os=-udi
413 ;;
414 sa29200)
415 basic_machine=a29k-amd
416 os=-udi
417 ;;
418 h8300xray)
419 basic_machine=h8300-hitachi
420 os=-xray
421 ;;
422 harris)
423 basic_machine=m88k-harris
424 os=-m88kbcs
425 ;;
426 hp300bsd)
427 basic_machine=m68k-hp
428 os=-bsd
429 ;;
430 hp300hpux)
431 basic_machine=m68k-hp
432 os=-hpux
433 ;;
434 hp9k2[0-9][0-9] | hp9k31[0-9])
435 basic_machine=m68000-hp
436 os=-hpux
437 ;;
438 hp9k3[2-9][0-9])
439 basic_machine=m68k-hp
440 os=-hpux
441 ;;
442 hppabsd)
443 basic_machine=hppa-hp
444 os=-bsd
445 ;;
446 hppahpux)
447 basic_machine=hppa-hp
448 os=-hpux
449 ;;
450 ncr3000)
451 basic_machine=i486-ncr
452 os=-sysv4
453 ;;
454 necv70)
455 basic_machine=v70-nec
456 os=-sysv
457 ;;
458 news1000)
459 basic_machine=m68030-sony
460 os=-newsos
461 ;;
462 nindy960)
463 basic_machine=i960-intel
464 os=-nindy
465 ;;
466 pn)
467 basic_machine=pn-gould
468 os=-sysv
469 ;;
470 np1)
471 basic_machine=np1-gould
472 os=-sysv
473 ;;
474 ultra3)
475 basic_machine=a29k-nyu
476 os=-sym1
477 ;;
478 vxworks960)
479 basic_machine=i960-wrs
480 os=-vxworks
481 ;;
482 vxworks68)
483 basic_machine=m68k-wrs
484 os=-vxworks
485 ;;
486 es1800 | OSE68k | ose68k)
487 basic_machine=m68k-ericsson
488 os=-ose
489 ;;
490 OSE68000 | ose68000)
491 basic_machine=m68000-ericsson
492 os=-ose
493 ;;
494 os68k)
495 basic_machine=m68k-none
496 os=-os68k
497 ;;
498 sparclite)
499 basic_machine=sparclite-fujitsu
500 os=-none
501 ;;
502 sparclite-wrs)
503 basic_machine=sparclite-wrs
504 os=-vxworks
505 ;;
506 sparcfrw)
507 basic_machine=sparcfrw-sun
508 os=-sunos4
509 ;;
510 sparcfrwcompat)
511 basic_machine=sparcfrwcompat-sun
512 os=-sunos4
513 ;;
514 sparclitefrw)
515 basic_machine=sparclitefrw-fujitsu
516 os=-none
517 ;;
518 sparclitefrwcompat)
519 basic_machine=sparclitefrwcompat-fujitsu
520 os=-none
521 ;;
522 adobe68k)
523 basic_machine=m68010-adobe
524 os=-scout
525 ;;
526
527 none)
528 basic_machine=none-none
529 os=-none
530 ;;
531
532# Here we handle the default manufacturer of certain CPU types. It is in
533# some cases the only manufacturer, in others, it is the most popular.
534 mips)
535 basic_machine=mips-mips
536 ;;
537 romp)
538 basic_machine=romp-ibm
539 ;;
540 rs6000)
541 basic_machine=rs6000-ibm
542 ;;
543 vax)
544 basic_machine=vax-dec
545 ;;
546 sparc)
547 basic_machine=sparc-sun
548 ;;
549 fx2800)
550 basic_machine=i860-alliant
551 ;;
552 *)
553 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
554 exit 1
555 ;;
556esac
557
558# Decode manufacturer-specific aliases for certain operating systems.
559
560if [ "$os" ]
561then
562case $os in
563 # First accept the basic system types.
564 # The portable systems comes first.
565 # Each alternative must end in a *, to match a version number.
566 -bsd* | -sysv* | -mach* | -minix* | -genix* | -ultrix* \
567 | -aout | -coff | -elf \
568 | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos* | -hpux* \
569 | -unos* | -osf* | -v88r* | -luna* | -dgux* | -solaris* | -sym* \
570 | -newsos | -amigados* | -msdos* | -none* | -os68k* | -irix* \
571 | -nindy* | -vxworks* | -ebmon* | -udi | -hms* | -xray \
572 | -m88kbcs* | -go32 | -linux* | -sim | -es1800*)
573 ;;
574
575# Note that readline checks for newsos
576# -newsos*)
577# os=-bsd
578# ;;
579 -osfrose*)
580 os=-osf
581 ;;
582 -osf*)
583 os=-bsd
584 ;;
585 -dynix*)
586 os=-bsd
587 ;;
588 -aos*)
589 os=-bsd
590 ;;
591 -386bsd)
592 os=-bsd
593 ;;
594 -ctix* | -uts*)
595 os=-sysv
596 ;;
597 -svr4)
598 os=-sysv4
599 ;;
600 -svr3)
601 os=-sysv3
602 ;;
603 -ose*)
604 os=-ose
605 ;;
606 -es1800*)
607 os=-ose
608 ;;
609 *)
610 # Get rid of the `-' at the beginning of $os.
611 os=`echo $1 | sed 's/[^-]*-//'`
612 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
613 exit 1
614 ;;
615esac
616else
617
618# Here we handle the default operating systems that come with various machines.
619# The value should be what the vendor currently ships out the door with their
620# machine or put another way, the most popular os provided with the machine.
621case $basic_machine in
622 *-dec | vax-*)
623 os=-ultrix42
624 ;;
625 i386-sun)
626 os=-sunos402
627 ;;
628 m68000-sun)
629 os=-sunos3
630 # This also exists in the configure program, but was not the
631 # default.
632 # os=-sunos4
633 ;;
634 sparc-* | *-sun)
635 os=-sunos411
636 ;;
637 romp-*)
638 os=-bsd
639 ;;
640 *-ibm)
641 os=-aix
642 ;;
643 *-hp)
644 os=-hpux
645 ;;
646 *-sgi | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
647 os=-sysv
648 ;;
649 *-dg)
650 os=-dgux
651 ;;
652 m88k-omron*)
653 os=-luna
654 ;;
655 *-crds)
656 os=-unos
657 ;;
658 *-ns)
659 os=-genix
660 ;;
661 i386-*)
662 os=-scosysv322
663 ;;
664 *)
665 os=-none
666 ;;
667esac
668fi
669
670# Here we handle the case where we know the os, and the CPU type, but not the
671# manufacturer. We pick the logical manufacturer.
672vendor=unknown
673case $basic_machine in
674 *-unknown)
675 case $os in
676 -sunos*)
677 vendor=sun
678 ;;
679 -aix*)
680 vendor=ibm
681 ;;
682 -hpux*)
683 vendor=hp
684 ;;
685 -unos*)
686 vendor=crds
687 ;;
688 -dgux*)
689 vendor=dg
690 ;;
691 -luna*)
692 vendor=omron
693 ;;
694 -genix*)
695 vendor=ns
696 ;;
697 -vxworks*)
698 vendor=wrs
699 ;;
700 esac
701 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
702 ;;
703esac
704
705echo $basic_machine$os