Make it compile for cross-debugging.
[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 \
fe6c6bdd 29 | romp | 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
ad3cef4d 57 os=amigados # Native Amiga operating system
a5a8b9b1
JG
58 ;;
59amigaunix | amix)
60 cpu=m68k
61 vendor=cbm
ad3cef4d 62 os=svr4
a5a8b9b1 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 122
caebaa16
SC
123harris)
124 cpu=m88k
125 vendor=harris
126 os=m88kbcs
127 ;;
128
b9fe720d
RP
129h8300hds)
130 cpu=h8300
131 vendor=hitachi
132 os=hds
133 ;;
134
e6602723
JG
135# start-sanitize-life
136life)
137 cpu=life
138 vendor=philips
139 os=none
140 ;;
141# end-sanitize-life
142
25fa8f53
RP
143# start-sanitize-v9
144hal-32 | hal32)
145 cpu=sparc64
146 vendor=hal
147 os=hal32
148 ;;
149hal-64 | hal64)
150 cpu=sparc64
151 vendor=hal
152 os=hal64
153 ;;
154sparc64)
155 cpu=sparc64
156 vendor=sun
157 os=v9
158 ;;
159sparc64-v7 | sparc64v7)
160 cpu=sparc64
161 vendor=sun
162 os=v7
163 ;;
164# end-sanitize-v9
165hp300bsd)
166 cpu=m68k
167 vendor=hp
168 os=bsd
169 ;;
170hp300hpux | hpux | hp9k3[2-9][0-9])
171 cpu=m68k
172 vendor=hp
173 os=hpux
174 ;;
175hp9k31[0-9] | hp9k2[0-9][0-9])
176 cpu=m68000
177 vendor=hp
178 os=hpux
179 ;;
180i386sco)
181 cpu=i386
182 vendor=sco
f7c88ce7 183 os=sysv # maybe?
25fa8f53
RP
184 ;;
185i386v)
186 cpu=i386
187 vendor=none
188 os=sysv
189 ;;
190i386v32)
191 cpu=i386
192 vendor=none
193 os=sysv32
194 ;;
69e87de2
RP
195iris | iris4d)
196 cpu=mips
197 vendor=sgi
25fa8f53
RP
198 os=irix # maybe?
199 ;;
7054ee6d
RP
200
201dpx2)
5c5c52fc
PB
202 vendor=bull
203 cpu=m68k
204 os=sysv
7054ee6d 205 ;;
25fa8f53
RP
206isi | isi68)
207 cpu=m68k
208 vendor=isi
69e87de2
RP
209 os=sysv # maybe?
210 ;;
25fa8f53
RP
211littlemips)
212 cpu=mips
213 vendor=little
214 os=bsd
215 ;;
216magnum | m3230)
217 cpu=mips
218 vendor=mips
219 os=sysv # maybe?
220 ;;
221merlin)
222 cpu=ns32k
223 vendor=utek
224 os=sysv # maybe?
225 ;;
226miniframe)
227 cpu=m68000
228 vendor=convergent
229 os=sysv # maybe?
230 ;;
231mmax)
232 cpu=ns32k
233 vendor=encore
69e87de2
RP
234 os=sysv # maybe?
235 ;;
ad3cef4d
FF
236ncr3000)
237 cpu=i386
238 vendor=ncr
239 os=svr4
240 ;;
69e87de2
RP
241news | news700 | news800 | news900)
242 cpu=m68k
243 vendor=sony
4ee8b8e5 244 os=newsos # newsos3c or newsos4c, c stands for cisc. Based on bsd-4.3.
69e87de2 245 ;;
25fa8f53
RP
246news1000)
247 cpu=m68030
248 vendor=sony
4ee8b8e5 249 os=newsos
69e87de2 250 ;;
25fa8f53
RP
251news-3600 | bigmips | risc-news)
252 cpu=mips
253 vendor=sony
4ee8b8e5 254 os=newsos # Presumably newsos4r, r stands for risc. Based on bsd-4.3.
25fa8f53
RP
255 ;;
256next)
69e87de2 257 cpu=m68k
25fa8f53 258 vendor=next
69e87de2
RP
259 os=sysv # maybe?
260 ;;
25fa8f53
RP
261nindy960)
262 cpu=i960
263 vendor=intel
264 os=nindy
69e87de2 265 ;;
25fa8f53
RP
266none)
267 cpu=none
268 vendor=none
269 os=none
69e87de2 270 ;;
25fa8f53
RP
271np1)
272 cpu=np1
273 vendor=gould
69e87de2
RP
274 os=sysv # maybe?
275 ;;
7054ee6d
RP
276rtpc)
277 cpu=romp
278 vendor=ibm
279 os=aix # maybe?
280 ;;
25fa8f53
RP
281pbd)
282 cpu=sparc
283 vendor=unicom
284 os=sysv
285 ;;
286pn)
287 cpu=pn
288 vendor=gould
289 os=sysv # maybe?
290 ;;
f7c88ce7 291powersys | rs6000)
e6602723
JG
292 cpu=rs6000
293 vendor=ibm
294 os=aix
295 ;;
25fa8f53 296ps2)
69e87de2 297 cpu=i386
25fa8f53
RP
298 vendor=ibm
299 os=sysv # maybe?
69e87de2
RP
300 ;;
301sun2)
302 cpu=m68000
303 vendor=sun
304 os=sunos4
305 ;;
306sun2os3)
307 cpu=m68000
308 vendor=sun
309 os=sunos3
310 ;;
311sun2os4)
312 cpu=m68000
313 vendor=sun
314 os=sunos4
315 ;;
316sun3)
317 cpu=m68k
318 vendor=sun
319 os=sunos4
320 ;;
321sun3os3)
322 cpu=m68k
323 vendor=sun
324 os=sunos3
325 ;;
326sun3os4)
327 cpu=m68k
328 vendor=sun
329 os=sunos4
330 ;;
25fa8f53
RP
331sun386 | roadrunner | sun386i)
332 cpu=i386
333 vendor=sun
334 os=sunos
335 ;;
69e87de2
RP
336sun4)
337 cpu=sparc
338 vendor=sun
339 os=sunos4
340 ;;
341sun4os3)
342 cpu=sparc
343 vendor=sun
344 os=sunos3
345 ;;
346sun4os4)
347 cpu=sparc
348 vendor=sun
349 os=sunos4
350 ;;
25fa8f53 351symmetry)
69e87de2 352 cpu=i386
25fa8f53
RP
353 vendor=sequent
354 os=dynix
69e87de2 355 ;;
25fa8f53 356tower | tower-32)
69e87de2 357 cpu=m68k
25fa8f53 358 vendor=ncr
69e87de2
RP
359 os=sysv # maybe?
360 ;;
7952caa6
JG
361ultra3)
362 cpu=a29k
363 vendor=nyu
364 os=sym1
365 ;;
25fa8f53
RP
366umax)
367 cpu=ns32k
368 vendor=encore
69e87de2
RP
369 os=sysv # maybe?
370 ;;
25fa8f53 371unixpc | safari | pc7300 | 3b1 | 7300 | 7300-att | att-7300)
69e87de2 372 cpu=m68k
25fa8f53 373 vendor=att
69e87de2
RP
374 os=sysv # maybe?
375 ;;
25fa8f53
RP
376vax-dec)
377 cpu=vax
69e87de2 378 vendor=dec
25fa8f53 379 os=ultrix # maybe?
69e87de2 380 ;;
25fa8f53
RP
381vxworks68)
382 cpu=m68k
383 vendor=wrs
384 os=vxworks
69e87de2 385 ;;
25fa8f53
RP
386vxworks960)
387 cpu=i960
388 vendor=wrs
389 os=vxworks
69e87de2 390 ;;
25fa8f53
RP
391xmp)
392 cpu=xmp
393 vendor=cray
394 os=unicos
69e87de2 395 ;;
69e87de2
RP
396# not an alias. parse what we expect to be a canonical name.
397*)
398 cpu=`echo $1 | sed 's/-.*$//'`
399
400 if [ "${cpu}" = "$1" ] ; then
401 # no vendor so this is an invalid name.
4ee8b8e5 402 echo '***' Configuration \"$1\" not recognized 1>&2
4f183929 403 exit 1
69e87de2
RP
404 else
405 # parse out vendor
406 rest=`echo $1 | sed "s/${cpu}-//"`
407 vendor=`echo ${rest} | sed 's/-.*$//'`
408
409 if [ "${vendor}" = "${rest}" ] ; then
410 # a missing os is acceptable
411 os=none
412 else
413 os=`echo ${rest} | sed "s/${vendor}-//"`
414 fi
415 fi
416 ;;
4f183929
RP
417esac
418
69e87de2
RP
419# At this point we should have three parts of a canonical name in cpu,
420# vendor, and os.
4f183929 421
69e87de2
RP
422# verify that the cpu is known.
423
424case "${cpu}" in
25fa8f53
RP
425none | vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc \
426 | ns32k | alliant | arm | c1 | c2 | mips | pyramid | tron \
7054ee6d 427 | a29k | romp | rs6000 | i960 | xmp | ymp | cray2 | 580 | h8300)
69e87de2 428 ;;
25fa8f53 429
e6602723
JG
430# start-sanitize-life
431life) ;;
432# end-sanitize-life
433
25fa8f53
RP
434# start-sanitize-v9
435sparc64) ;;
436# end-sanitize-v9
437
69e87de2
RP
438*)
439 echo '***' Invalid cpu \`${cpu}\': configuration \`$1\' not recognized 1>&2
440 exit 1
441 ;;
442esac
443
444# verify that the vendor is known.
445
446case "${vendor}" in
e6602723 447 altos | amd | amdahl | aout | apollo | att | bcs | bout |\
a5a8b9b1 448 cbm | convergent | convex | coff | cray | dec | encore |\
caebaa16 449 gould | harris | hitachi | intel | isi | hp | ibm | little | mips | motorola | \
a5a8b9b1 450 ncr | next | none | nyu | sco | sequent | sgi | sony | sun |\
7054ee6d 451 unicom | utek | wrs | bull ) ;;
25fa8f53 452
e6602723
JG
453# start-sanitize-life
454philips) ;;
455# end-sanitize-life
456
25fa8f53
RP
457# start-sanitize-v9
458hal) ;;
459# end-sanitize-v9
460
69e87de2
RP
461*)
462 echo '***' Invalid vendor \`${vendor}\': configuration \`$1\' not recognized 1>&2
463 exit 1
464 ;;
465esac
466
467# verify that the os is known, if it exists.
468
469case "${os}" in
27366314
SC
470aix* | aout | bout | bsd* | coff | ctix* | dgux* | dynix* | esix* \
471 | ebmon | hpux* \
4ee8b8e5 472 | hds | irix* | isc* | kern | mach* | msdos* | newsos* | nindy* | none \
b9fe720d 473 | osf* | sco* | sunos* | sysv* | ultrix* | unos* | v88r* \
fe6c6bdd 474 | vms* | vxworks* | sym[1-9]* | unicos* | uts | svr4 | m88kbcs \
b9fe720d 475 | amigados)
69e87de2 476 ;;
25fa8f53
RP
477
478# start-sanitize-v9
479hal32 | hal64 | v7 | v9) ;;
480# end-sanitize-v9
481
69e87de2
RP
482*)
483 echo '***' Invalid os \`${os}\': configuration \`$1\' not recognized 1>&2
484 exit 1
485 ;;
4f183929
RP
486esac
487
69e87de2 488echo ${cpu}-${vendor}-${os}
This page took 0.051501 seconds and 4 git commands to generate.