* hppa.c: Apply John's standard fix to avoid "empty translation
[deliverable/binutils-gdb.git] / config.sub
CommitLineData
4f183929 1#!/bin/sh
a2ee3e6d 2# Configuration validation subroutine script, version 1.0.
68cd7865 3# Copyright (C) 1991, 1992 Free Software Foundation, Inc.
a2ee3e6d
JW
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
4f183929
RP
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
a2ee3e6d 31# configuration.
4f183929 32
a2ee3e6d
JW
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
8b204e6e 37
a2ee3e6d
JW
38# First pass through any local machine types.
39case $1 in
40 *local*)
41 echo $1
42 exit 0
43 ;;
44 *)
69e87de2 45 ;;
a2ee3e6d 46esac
b9fe720d 47
a2ee3e6d 48# Separate what the user gave into CPU-COMPANY and OS (if any).
8bcd7db2 49basic_machine=`echo $1 | sed 's/-[^-][^-]*$//'`
a2ee3e6d
JW
50if [ $basic_machine != $1 ]
51then os=`echo $1 | sed 's/.*-/-/'`
52else os=; fi
caebaa16 53
a2ee3e6d
JW
54# Lets recognize common machines as not being OS so that things like
55# config.subr decstation-3100 as legal.
56case $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
88esac
b9fe720d 89
a2ee3e6d
JW
90# Decode aliases for certain CPU-COMPANY combinations.
91case $basic_machine in
92 # Recognize the basic CPU types with without company name.
a5992d11 93 tahoe | i386 | i860 | m68k | m680[01234]0 | m88k | ns32k | arm | pyramid \
8bcd7db2
JW
94 | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 | we32k\
95 | v70)
a2ee3e6d
JW
96 basic_machine=$basic_machine-unknown
97 ;;
98 # Recognize the basic CPU types with with company name.
a5992d11 99 vax-* | tahoe-* | i386-* | i860-* | m68k-* | m680[01234]0-* | m88k-* \
a2ee3e6d
JW
100 | sparc-* | ns32k-* | alliant-* | arm-* | c[123]* \
101 | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
102 | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
8bcd7db2 103 | hppa1.0-* | hppa1.1-* | we32k-*)
a2ee3e6d
JW
104 ;;
105 # Recognize the various machine names and aliases which stand
106 # for a CPU type and a company and sometimes even an OS.
e6602723 107# start-sanitize-life
a2ee3e6d
JW
108 life-*) ;;
109 life)
110 basic_machine=life-philips
111 os=-none
112 ;;
e6602723
JG
113# end-sanitize-life
114
25fa8f53 115# start-sanitize-v9
a2ee3e6d
JW
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 ;;
25fa8f53 133# end-sanitize-v9
7054ee6d 134
a2ee3e6d
JW
135 vaxv)
136 basic_machine=vax-dec
137 os=-sysv
138 ;;
139 vms)
140 basic_machine=vax-dec
141 os=-vms
142 ;;
68cd7865
SEF
143 i386mach)
144 basic_machine=i386-mach
145 os=-mach
146 ;;
a2ee3e6d
JW
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 ;;
2501643a
PB
155 go32 | i386-go32)
156 basic_machine=i386-unknown
157 os=-go32
158 ;;
a2ee3e6d
JW
159 i386-isc* | isc)
160 basic_machine=i386-unknown
161 os=-iscsysv
162 ;;
8bcd7db2
JW
163 i386-linux* | linux)
164 basic_machine=i386-unknown
165 os=-linux
166 ;;
a2ee3e6d
JW
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 ;;
68cd7865
SEF
218 iris | iris3 | iris4d)
219 basic_machine=mips-sgi
220 os=-irix3
221 ;;
222 iris4)
a2ee3e6d 223 basic_machine=mips-sgi
68cd7865 224 os=-irix4
a2ee3e6d
JW
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 ;;
8bcd7db2
JW
275 sun4sol2)
276 basic_machine=sparc-sun
277 os=-solaris2
278 ;;
a2ee3e6d
JW
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
ad1f7512 296 os=-bsd
a2ee3e6d
JW
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 ;;
8bcd7db2
JW
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
a2ee3e6d
JW
309 ;;
310 isi68 | isi)
311 basic_machine=m68k-isi
312 os=-sysv
313 ;;
314 apollo68)
315 basic_machine=m68k-apollo
316 os=-sysv
317 ;;
68cd7865
SEF
318 apollo68bsd)
319 basic_machine=m68k-apollo
320 os=-bsd
321 ;;
a2ee3e6d
JW
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 ;;
68cd7865
SEF
335 st2000)
336 basic_machine=m68kmote-tandem
337 ;;
a2ee3e6d
JW
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 ;;
dd16baba
SEF
368 stratus)
369 basic_machine=i860-stratus
370 os=-sysv4
371 ;;
a2ee3e6d
JW
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 ;;
2501643a
PB
396
397 h8300hms)
a2ee3e6d 398 basic_machine=h8300-hitachi
2501643a
PB
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
a2ee3e6d
JW
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 ;;
8bcd7db2
JW
437 hppabsd)
438 basic_machine=hppa-hp
439 os=-bsd
440 ;;
441 hppahpux)
442 basic_machine=hppa-hp
443 os=-hpux
444 ;;
a2ee3e6d
JW
445 ncr3000)
446 basic_machine=i386-ncr
447 os=-sysv4
448 ;;
68cd7865
SEF
449 necv70)
450 basic_machine=v70-nec
451 os=-sysv
452 ;;
a2ee3e6d
JW
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
c1e296fc 471 os=-sym1
a2ee3e6d
JW
472 ;;
473 vxworks960)
474 basic_machine=i960-wrs
475 os=-vxworks
476 ;;
477 vxworks68)
478 basic_machine=m68k-wrs
479 os=-vxworks
480 ;;
dd16baba
SEF
481 os68k)
482 basic_machine=m68k-none
483 os=-os68k
484 ;;
ad1f7512
MT
485 sparclite)
486 basic_machine=sparclite-fujitsu
487 os=-none
488 ;;
489
a2ee3e6d
JW
490 none)
491 basic_machine=none-none
492 os=-none
493 ;;
69e87de2 494
a2ee3e6d
JW
495# Here we handle the default manufacturer of certain CPU types. It is in
496# some cases the only manufacturer, in others, it is the most popular.
497 mips)
498 basic_machine=mips-mips
499 ;;
500 romp)
501 basic_machine=romp-ibm
502 ;;
503 rs6000)
504 basic_machine=rs6000-ibm
505 ;;
506 vax)
507 basic_machine=vax-dec
508 ;;
509 sparc)
510 basic_machine=sparc-sun
511 ;;
c1e296fc
SG
512 fx2800)
513 basic_machine=i860-alliant
514 ;;
a2ee3e6d
JW
515 *)
516 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
4f183929 517 exit 1
a2ee3e6d 518 ;;
4f183929
RP
519esac
520
a2ee3e6d 521# Decode manufacturer-specific aliases for certain operating systems.
e6602723 522
a2ee3e6d
JW
523if [ "$os" ]
524then
525case $os in
526 # First accept the basic system types.
527 # The portable systems comes first.
528 # Each alternative must end in a *, to match a version number.
ad1f7512 529 -bsd* | -sysv* | -mach* | -minix* | -genix* | -ultrix* | -aout \
a2ee3e6d 530 | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos* | -hpux* \
8bcd7db2 531 | -unos* | -osf* | -v88r* | -luna* | -dgux* | -solaris* | -sym* \
2501643a 532 | -newsos | -amigados* | -msdos* | -none* | -os68k* | -irix* \
8bcd7db2
JW
533 | -nindy* | -vxworks* | -ebmon* | -udi | -hms* | -xray \
534 | -m88kbcs* | -go32 | -linux*)
2501643a 535 ;;
25fa8f53 536# start-sanitize-v9
a2ee3e6d 537 -v7 | -v9 | -hal32 | -hal64) ;;
25fa8f53
RP
538# end-sanitize-v9
539
2501643a
PB
540# Note that readline checks for newsos
541# -newsos*)
542# os=-bsd
543# ;;
a2ee3e6d
JW
544 -osfrose*)
545 os=-osf
546 ;;
547 -osf*)
548 os=-bsd
549 ;;
550 -dynix*)
551 os=-bsd
552 ;;
553 -aos*)
554 os=-bsd
555 ;;
68cd7865 556 -ctix* | -uts*)
a2ee3e6d
JW
557 os=-sysv
558 ;;
c1e296fc
SG
559 -svr4)
560 os=-sysv4
561 ;;
562 -svr3)
563 os=-sysv3
564 ;;
a2ee3e6d
JW
565 *)
566 # Get rid of the `-' at the beginning of $os.
567 os=`echo $1 | sed 's/[^-]*-//'`
568 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
569 exit 1
570 ;;
69e87de2 571esac
a2ee3e6d 572else
69e87de2 573
a2ee3e6d
JW
574# Here we handle the default operating systems that come with various machines.
575# The value should be what the vendor currently ships out the door with their
576# machine or put another way, the most popular os provided with the machine.
577case $basic_machine in
578 *-dec | vax-*)
579 os=-ultrix42
580 ;;
581 i386-sun)
582 os=-sunos402
583 ;;
584 m68000-sun)
585 os=-sunos3
586 # This also exists in the configure program, but was not the
587 # default.
588 # os=-sunos4
589 ;;
590 sparc-* | *-sun)
591 os=-sunos411
592 ;;
593 romp-*)
594 os=-bsd
595 ;;
596 *-ibm)
597 os=-aix
598 ;;
599 *-hp)
600 os=-hpux
601 ;;
602 *-sgi | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
603 os=-sysv
604 ;;
605 *-dg)
606 os=-dgux
607 ;;
608 m88k-omron*)
609 os=-luna
610 ;;
611 *-crds)
612 os=-unos
613 ;;
614 *-ns)
615 os=-genix
616 ;;
617 i386-*)
618 os=-scosysv322
619 ;;
620 *)
621 os=-none
622 ;;
69e87de2 623esac
a2ee3e6d 624fi
69e87de2 625
a2ee3e6d
JW
626# Here we handle the case where we know the os, and the CPU type, but not the
627# manufacturer. We pick the logical manufacturer.
628vendor=unknown
629case $basic_machine in
630 *-unknown)
631 case $os in
632 -sunos*)
633 vendor=sun
634 ;;
635 -aix*)
636 vendor=ibm
637 ;;
638 -hpux*)
639 vendor=hp
640 ;;
641 -unos*)
642 vendor=crds
643 ;;
644 -dgux*)
645 vendor=dg
646 ;;
647 -luna*)
648 vendor=omron
649 ;;
650 -genix*)
651 vendor=ns
652 ;;
653 esac
654 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
655 ;;
4f183929
RP
656esac
657
a2ee3e6d 658echo $basic_machine$os
This page took 0.070818 seconds and 4 git commands to generate.