* ldmisc.c, ldmisc.h: Re-write info() to take a filename
[deliverable/binutils-gdb.git] / config.sub
CommitLineData
4f183929
RP
1#!/bin/sh
2
3# Configuration subroutine to validate and canonicalize a configuration type.
4# Supply the specified configuration type as an argument.
5# If it is invalid, we print an error message on stderr and exit with code 1.
6# Otherwise, we print the canonical config type on stdout and succeed.
7
8# This file is supposed to be the same for all GNU packages
9# and recognize all the CPU types, system types and aliases
10# that are meaningful with *any* GNU software.
11# Each package is responsible for reporting which valid configurations
12# it does not support. The user should be able to distinguish
13# a failure to support a valid configuration from a meaningless
7952caa6 14# configuration (e.g. a typo).
4f183929 15
8b204e6e
RP
16# Please email any bugs, comments, and/or additions to this file to:
17# configure@cygnus.com
18
69e87de2 19# decode aliases into canonical names
4ee8b8e5
JG
20# Note that aliases MUST fit into 12 characters or less otherwise the
21# install targets and subdir builds all die on machines that support
22# only 14 char file names. They die miserably on machines that rudely
23# enforce the 14 character limit.
4f183929 24
69e87de2
RP
25case "$1" in
26# cpu alone is a valid alias for cpu-none-none.
27vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc | ns32k \
28 | alliant | arm | c1 | c2 | mips | pyramid | tron | a29k \
7054ee6d 29 | romp | rs6000 | i960 | h8300)
69e87de2
RP
30 cpu=$1
31 vendor=none
32 os=none
33 ;;
25fa8f53 34altos | altos3068)
69e87de2 35 cpu=m68k
25fa8f53
RP
36 vendor=altos
37 os=sysv # maybe?
69e87de2 38 ;;
25fa8f53
RP
39altosgas)
40 cpu=m68k
41 vendor=altos
42 os=gas
69e87de2 43 ;;
4f73c36a
RP
44am29k)
45 cpu=a29k
46 vendor=none
47 os=bsd
48 ;;
25fa8f53
RP
49amdahl)
50 cpu=580
51 vendor=amdahl
52 os=uts
53 ;;
a5a8b9b1
JG
54amigados)
55 cpu=m68k
56 vendor=cbm
57 os=amigados # Native AmigaDOS
58 ;;
59amigaunix | amix)
60 cpu=m68k
61 vendor=cbm
62 os=svr4 # System V Release 4 (svr4 is an industry recognized acronym)
63 ;;
25fa8f53
RP
64apollo68)
65 cpu=m68k
66 vendor=apollo
67 os=sysv # maybe?
68 ;;
69balance)
69e87de2 70 cpu=ns32k
25fa8f53
RP
71 vendor=sequent
72 os=dynix
73 ;;
74convex-c1)
75 cpu=c1
76 vendor=convex
69e87de2
RP
77 os=sysv # maybe?
78 ;;
25fa8f53
RP
79convex-c2)
80 cpu=c2
81 vendor=convex
69e87de2
RP
82 os=sysv # maybe?
83 ;;
25fa8f53
RP
84cray | ymp)
85 cpu=ymp
86 vendor=cray
87 os=unicos
88 ;;
89cray2)
90 cpu=cray2
91 vendor=cray
92 os=unicos
93 ;;
94dec3100 | decstatn | decstation | decstation-3100 | pmax | pmin)
95 cpu=mips
96 vendor=dec
97 os=ultrix
98 ;;
99delta | 3300 | motorola-3300 | motorola-delta \
100 | 3300-motorola | delta-motorola)
101 cpu=m68k
102 vendor=motorola
69e87de2
RP
103 os=sysv # maybe?
104 ;;
ae07c044
SC
105
106delta88)
107 cpu=m88k
108 vendor=motorola
109 os=m88kbcs
110 ;;
111
e6602723
JG
112ebmon29k)
113 cpu=a29k
114 vendor=amd
115 os=ebmon
116 ;;
25fa8f53
RP
117gmicro)
118 cpu=tron
119 vendor=gmicro
69e87de2
RP
120 os=sysv # maybe?
121 ;;
b9fe720d
RP
122
123h8300hds)
124 cpu=h8300
125 vendor=hitachi
126 os=hds
127 ;;
128
e6602723
JG
129# start-sanitize-life
130life)
131 cpu=life
132 vendor=philips
133 os=none
134 ;;
135# end-sanitize-life
136
25fa8f53
RP
137# start-sanitize-v9
138hal-32 | hal32)
139 cpu=sparc64
140 vendor=hal
141 os=hal32
142 ;;
143hal-64 | hal64)
144 cpu=sparc64
145 vendor=hal
146 os=hal64
147 ;;
148sparc64)
149 cpu=sparc64
150 vendor=sun
151 os=v9
152 ;;
153sparc64-v7 | sparc64v7)
154 cpu=sparc64
155 vendor=sun
156 os=v7
157 ;;
158# end-sanitize-v9
159hp300bsd)
160 cpu=m68k
161 vendor=hp
162 os=bsd
163 ;;
164hp300hpux | hpux | hp9k3[2-9][0-9])
165 cpu=m68k
166 vendor=hp
167 os=hpux
168 ;;
169hp9k31[0-9] | hp9k2[0-9][0-9])
170 cpu=m68000
171 vendor=hp
172 os=hpux
173 ;;
174i386sco)
175 cpu=i386
176 vendor=sco
177 os=sysv # maybe?
178 ;;
179i386v)
180 cpu=i386
181 vendor=none
182 os=sysv
183 ;;
184i386v32)
185 cpu=i386
186 vendor=none
187 os=sysv32
188 ;;
69e87de2
RP
189iris | iris4d)
190 cpu=mips
191 vendor=sgi
25fa8f53
RP
192 os=irix # maybe?
193 ;;
7054ee6d
RP
194
195dpx2)
5c5c52fc
PB
196 vendor=bull
197 cpu=m68k
198 os=sysv
7054ee6d 199 ;;
25fa8f53
RP
200isi | isi68)
201 cpu=m68k
202 vendor=isi
69e87de2
RP
203 os=sysv # maybe?
204 ;;
25fa8f53
RP
205littlemips)
206 cpu=mips
207 vendor=little
208 os=bsd
209 ;;
210magnum | m3230)
211 cpu=mips
212 vendor=mips
213 os=sysv # maybe?
214 ;;
215merlin)
216 cpu=ns32k
217 vendor=utek
218 os=sysv # maybe?
219 ;;
220miniframe)
221 cpu=m68000
222 vendor=convergent
223 os=sysv # maybe?
224 ;;
225mmax)
226 cpu=ns32k
227 vendor=encore
69e87de2
RP
228 os=sysv # maybe?
229 ;;
230news | news700 | news800 | news900)
231 cpu=m68k
232 vendor=sony
4ee8b8e5 233 os=newsos # newsos3c or newsos4c, c stands for cisc. Based on bsd-4.3.
69e87de2 234 ;;
25fa8f53
RP
235news1000)
236 cpu=m68030
237 vendor=sony
4ee8b8e5 238 os=newsos
69e87de2 239 ;;
25fa8f53
RP
240news-3600 | bigmips | risc-news)
241 cpu=mips
242 vendor=sony
4ee8b8e5 243 os=newsos # Presumably newsos4r, r stands for risc. Based on bsd-4.3.
25fa8f53
RP
244 ;;
245next)
69e87de2 246 cpu=m68k
25fa8f53 247 vendor=next
69e87de2
RP
248 os=sysv # maybe?
249 ;;
25fa8f53
RP
250nindy960)
251 cpu=i960
252 vendor=intel
253 os=nindy
69e87de2 254 ;;
25fa8f53
RP
255none)
256 cpu=none
257 vendor=none
258 os=none
69e87de2 259 ;;
25fa8f53
RP
260np1)
261 cpu=np1
262 vendor=gould
69e87de2
RP
263 os=sysv # maybe?
264 ;;
7054ee6d
RP
265rtpc)
266 cpu=romp
267 vendor=ibm
268 os=aix # maybe?
269 ;;
25fa8f53
RP
270pbd)
271 cpu=sparc
272 vendor=unicom
273 os=sysv
274 ;;
275pn)
276 cpu=pn
277 vendor=gould
278 os=sysv # maybe?
279 ;;
e6602723
JG
280powersys)
281 cpu=rs6000
282 vendor=ibm
283 os=aix
284 ;;
25fa8f53 285ps2)
69e87de2 286 cpu=i386
25fa8f53
RP
287 vendor=ibm
288 os=sysv # maybe?
69e87de2
RP
289 ;;
290sun2)
291 cpu=m68000
292 vendor=sun
293 os=sunos4
294 ;;
295sun2os3)
296 cpu=m68000
297 vendor=sun
298 os=sunos3
299 ;;
300sun2os4)
301 cpu=m68000
302 vendor=sun
303 os=sunos4
304 ;;
305sun3)
306 cpu=m68k
307 vendor=sun
308 os=sunos4
309 ;;
310sun3os3)
311 cpu=m68k
312 vendor=sun
313 os=sunos3
314 ;;
315sun3os4)
316 cpu=m68k
317 vendor=sun
318 os=sunos4
319 ;;
25fa8f53
RP
320sun386 | roadrunner | sun386i)
321 cpu=i386
322 vendor=sun
323 os=sunos
324 ;;
69e87de2
RP
325sun4)
326 cpu=sparc
327 vendor=sun
328 os=sunos4
329 ;;
330sun4os3)
331 cpu=sparc
332 vendor=sun
333 os=sunos3
334 ;;
335sun4os4)
336 cpu=sparc
337 vendor=sun
338 os=sunos4
339 ;;
25fa8f53 340symmetry)
69e87de2 341 cpu=i386
25fa8f53
RP
342 vendor=sequent
343 os=dynix
69e87de2 344 ;;
25fa8f53 345tower | tower-32)
69e87de2 346 cpu=m68k
25fa8f53 347 vendor=ncr
69e87de2
RP
348 os=sysv # maybe?
349 ;;
7952caa6
JG
350ultra3)
351 cpu=a29k
352 vendor=nyu
353 os=sym1
354 ;;
25fa8f53
RP
355umax)
356 cpu=ns32k
357 vendor=encore
69e87de2
RP
358 os=sysv # maybe?
359 ;;
25fa8f53 360unixpc | safari | pc7300 | 3b1 | 7300 | 7300-att | att-7300)
69e87de2 361 cpu=m68k
25fa8f53 362 vendor=att
69e87de2
RP
363 os=sysv # maybe?
364 ;;
25fa8f53
RP
365vax-dec)
366 cpu=vax
69e87de2 367 vendor=dec
25fa8f53 368 os=ultrix # maybe?
69e87de2 369 ;;
25fa8f53
RP
370vxworks68)
371 cpu=m68k
372 vendor=wrs
373 os=vxworks
69e87de2 374 ;;
25fa8f53
RP
375vxworks960)
376 cpu=i960
377 vendor=wrs
378 os=vxworks
69e87de2 379 ;;
25fa8f53
RP
380xmp)
381 cpu=xmp
382 vendor=cray
383 os=unicos
69e87de2 384 ;;
69e87de2
RP
385# not an alias. parse what we expect to be a canonical name.
386*)
387 cpu=`echo $1 | sed 's/-.*$//'`
388
389 if [ "${cpu}" = "$1" ] ; then
390 # no vendor so this is an invalid name.
4ee8b8e5 391 echo '***' Configuration \"$1\" not recognized 1>&2
4f183929 392 exit 1
69e87de2
RP
393 else
394 # parse out vendor
395 rest=`echo $1 | sed "s/${cpu}-//"`
396 vendor=`echo ${rest} | sed 's/-.*$//'`
397
398 if [ "${vendor}" = "${rest}" ] ; then
399 # a missing os is acceptable
400 os=none
401 else
402 os=`echo ${rest} | sed "s/${vendor}-//"`
403 fi
404 fi
405 ;;
4f183929
RP
406esac
407
69e87de2
RP
408# At this point we should have three parts of a canonical name in cpu,
409# vendor, and os.
4f183929 410
69e87de2
RP
411# verify that the cpu is known.
412
413case "${cpu}" in
25fa8f53
RP
414none | vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc \
415 | ns32k | alliant | arm | c1 | c2 | mips | pyramid | tron \
7054ee6d 416 | a29k | romp | rs6000 | i960 | xmp | ymp | cray2 | 580 | h8300)
69e87de2 417 ;;
25fa8f53 418
e6602723
JG
419# start-sanitize-life
420life) ;;
421# end-sanitize-life
422
25fa8f53
RP
423# start-sanitize-v9
424sparc64) ;;
425# end-sanitize-v9
426
69e87de2
RP
427*)
428 echo '***' Invalid cpu \`${cpu}\': configuration \`$1\' not recognized 1>&2
429 exit 1
430 ;;
431esac
432
433# verify that the vendor is known.
434
435case "${vendor}" in
e6602723 436 altos | amd | amdahl | aout | apollo | att | bcs | bout |\
a5a8b9b1 437 cbm | convergent | convex | coff | cray | dec | encore |\
b9fe720d 438 gould | hitachi | intel | isi | hp | ibm | little | mips | motorola |\
a5a8b9b1 439 ncr | next | none | nyu | sco | sequent | sgi | sony | sun |\
7054ee6d 440 unicom | utek | wrs | bull ) ;;
25fa8f53 441
e6602723
JG
442# start-sanitize-life
443philips) ;;
444# end-sanitize-life
445
25fa8f53
RP
446# start-sanitize-v9
447hal) ;;
448# end-sanitize-v9
449
69e87de2
RP
450*)
451 echo '***' Invalid vendor \`${vendor}\': configuration \`$1\' not recognized 1>&2
452 exit 1
453 ;;
454esac
455
456# verify that the os is known, if it exists.
457
458case "${os}" in
27366314
SC
459aix* | aout | bout | bsd* | coff | ctix* | dgux* | dynix* | esix* \
460 | ebmon | hpux* \
4ee8b8e5 461 | hds | irix* | isc* | kern | mach* | msdos* | newsos* | nindy* | none \
b9fe720d
RP
462 | osf* | sco* | sunos* | sysv* | ultrix* | unos* | v88r* \
463 | vms* | vxworks* | sym[1-9]* | unicos* | uts | svr4 \
464 | amigados)
69e87de2 465 ;;
25fa8f53
RP
466
467# start-sanitize-v9
468hal32 | hal64 | v7 | v9) ;;
469# end-sanitize-v9
470
69e87de2
RP
471*)
472 echo '***' Invalid os \`${os}\': configuration \`$1\' not recognized 1>&2
473 exit 1
474 ;;
4f183929
RP
475esac
476
69e87de2 477echo ${cpu}-${vendor}-${os}
This page took 0.055703 seconds and 4 git commands to generate.