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