* Makefile.in, configure.in, targets.c, elf.c: Add preliminary
[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
4f183929 20
69e87de2
RP
21case "$1" in
22# cpu alone is a valid alias for cpu-none-none.
23vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc | ns32k \
24 | alliant | arm | c1 | c2 | mips | pyramid | tron | a29k \
7054ee6d 25 | romp | rs6000 | i960 | h8300)
69e87de2
RP
26 cpu=$1
27 vendor=none
28 os=none
29 ;;
25fa8f53 30altos | altos3068)
69e87de2 31 cpu=m68k
25fa8f53
RP
32 vendor=altos
33 os=sysv # maybe?
69e87de2 34 ;;
25fa8f53
RP
35altosgas)
36 cpu=m68k
37 vendor=altos
38 os=gas
69e87de2 39 ;;
4f73c36a
RP
40am29k)
41 cpu=a29k
42 vendor=none
43 os=bsd
44 ;;
25fa8f53
RP
45amdahl)
46 cpu=580
47 vendor=amdahl
48 os=uts
49 ;;
a5a8b9b1
JG
50amigados)
51 cpu=m68k
52 vendor=cbm
53 os=amigados # Native AmigaDOS
54 ;;
55amigaunix | amix)
56 cpu=m68k
57 vendor=cbm
58 os=svr4 # System V Release 4 (svr4 is an industry recognized acronym)
59 ;;
25fa8f53
RP
60apollo68)
61 cpu=m68k
62 vendor=apollo
63 os=sysv # maybe?
64 ;;
65balance)
69e87de2 66 cpu=ns32k
25fa8f53
RP
67 vendor=sequent
68 os=dynix
69 ;;
70convex-c1)
71 cpu=c1
72 vendor=convex
69e87de2
RP
73 os=sysv # maybe?
74 ;;
25fa8f53
RP
75convex-c2)
76 cpu=c2
77 vendor=convex
69e87de2
RP
78 os=sysv # maybe?
79 ;;
25fa8f53
RP
80cray | ymp)
81 cpu=ymp
82 vendor=cray
83 os=unicos
84 ;;
85cray2)
86 cpu=cray2
87 vendor=cray
88 os=unicos
89 ;;
90dec3100 | decstatn | decstation | decstation-3100 | pmax | pmin)
91 cpu=mips
92 vendor=dec
93 os=ultrix
94 ;;
95delta | 3300 | motorola-3300 | motorola-delta \
96 | 3300-motorola | delta-motorola)
97 cpu=m68k
98 vendor=motorola
69e87de2
RP
99 os=sysv # maybe?
100 ;;
ae07c044
SC
101
102delta88)
103 cpu=m88k
104 vendor=motorola
105 os=m88kbcs
106 ;;
107
25fa8f53
RP
108gmicro)
109 cpu=tron
110 vendor=gmicro
69e87de2
RP
111 os=sysv # maybe?
112 ;;
25fa8f53
RP
113# start-sanitize-v9
114hal-32 | hal32)
115 cpu=sparc64
116 vendor=hal
117 os=hal32
118 ;;
119hal-64 | hal64)
120 cpu=sparc64
121 vendor=hal
122 os=hal64
123 ;;
124sparc64)
125 cpu=sparc64
126 vendor=sun
127 os=v9
128 ;;
129sparc64-v7 | sparc64v7)
130 cpu=sparc64
131 vendor=sun
132 os=v7
133 ;;
134# end-sanitize-v9
135hp300bsd)
136 cpu=m68k
137 vendor=hp
138 os=bsd
139 ;;
140hp300hpux | hpux | hp9k3[2-9][0-9])
141 cpu=m68k
142 vendor=hp
143 os=hpux
144 ;;
145hp9k31[0-9] | hp9k2[0-9][0-9])
146 cpu=m68000
147 vendor=hp
148 os=hpux
149 ;;
150i386sco)
151 cpu=i386
152 vendor=sco
153 os=sysv # maybe?
154 ;;
155i386v)
156 cpu=i386
157 vendor=none
158 os=sysv
159 ;;
160i386v32)
161 cpu=i386
162 vendor=none
163 os=sysv32
164 ;;
69e87de2
RP
165iris | iris4d)
166 cpu=mips
167 vendor=sgi
25fa8f53
RP
168 os=irix # maybe?
169 ;;
7054ee6d
RP
170
171dpx2)
5c5c52fc
PB
172 vendor=bull
173 cpu=m68k
174 os=sysv
7054ee6d 175 ;;
25fa8f53
RP
176isi | isi68)
177 cpu=m68k
178 vendor=isi
69e87de2
RP
179 os=sysv # maybe?
180 ;;
25fa8f53
RP
181littlemips)
182 cpu=mips
183 vendor=little
184 os=bsd
185 ;;
186magnum | m3230)
187 cpu=mips
188 vendor=mips
189 os=sysv # maybe?
190 ;;
191merlin)
192 cpu=ns32k
193 vendor=utek
194 os=sysv # maybe?
195 ;;
196miniframe)
197 cpu=m68000
198 vendor=convergent
199 os=sysv # maybe?
200 ;;
201mmax)
202 cpu=ns32k
203 vendor=encore
69e87de2
RP
204 os=sysv # maybe?
205 ;;
206news | news700 | news800 | news900)
207 cpu=m68k
208 vendor=sony
5c5c52fc 209 os=newsos3 # Based on bsd-4.3
69e87de2 210 ;;
25fa8f53
RP
211news1000)
212 cpu=m68030
213 vendor=sony
5c5c52fc 214 os=newsos3 # ?
69e87de2 215 ;;
25fa8f53
RP
216news-3600 | bigmips | risc-news)
217 cpu=mips
218 vendor=sony
5c5c52fc 219 os=newsos4 # Presumably?
25fa8f53
RP
220 ;;
221next)
69e87de2 222 cpu=m68k
25fa8f53 223 vendor=next
69e87de2
RP
224 os=sysv # maybe?
225 ;;
25fa8f53
RP
226nindy960)
227 cpu=i960
228 vendor=intel
229 os=nindy
69e87de2 230 ;;
25fa8f53
RP
231none)
232 cpu=none
233 vendor=none
234 os=none
69e87de2 235 ;;
25fa8f53
RP
236np1)
237 cpu=np1
238 vendor=gould
69e87de2
RP
239 os=sysv # maybe?
240 ;;
7054ee6d
RP
241rtpc)
242 cpu=romp
243 vendor=ibm
244 os=aix # maybe?
245 ;;
25fa8f53
RP
246pbd)
247 cpu=sparc
248 vendor=unicom
249 os=sysv
250 ;;
251pn)
252 cpu=pn
253 vendor=gould
254 os=sysv # maybe?
255 ;;
256ps2)
69e87de2 257 cpu=i386
25fa8f53
RP
258 vendor=ibm
259 os=sysv # maybe?
69e87de2
RP
260 ;;
261sun2)
262 cpu=m68000
263 vendor=sun
264 os=sunos4
265 ;;
266sun2os3)
267 cpu=m68000
268 vendor=sun
269 os=sunos3
270 ;;
271sun2os4)
272 cpu=m68000
273 vendor=sun
274 os=sunos4
275 ;;
276sun3)
277 cpu=m68k
278 vendor=sun
279 os=sunos4
280 ;;
281sun3os3)
282 cpu=m68k
283 vendor=sun
284 os=sunos3
285 ;;
286sun3os4)
287 cpu=m68k
288 vendor=sun
289 os=sunos4
290 ;;
25fa8f53
RP
291sun386 | roadrunner | sun386i)
292 cpu=i386
293 vendor=sun
294 os=sunos
295 ;;
69e87de2
RP
296sun4)
297 cpu=sparc
298 vendor=sun
299 os=sunos4
300 ;;
301sun4os3)
302 cpu=sparc
303 vendor=sun
304 os=sunos3
305 ;;
306sun4os4)
307 cpu=sparc
308 vendor=sun
309 os=sunos4
310 ;;
25fa8f53 311symmetry)
69e87de2 312 cpu=i386
25fa8f53
RP
313 vendor=sequent
314 os=dynix
69e87de2 315 ;;
25fa8f53 316tower | tower-32)
69e87de2 317 cpu=m68k
25fa8f53 318 vendor=ncr
69e87de2
RP
319 os=sysv # maybe?
320 ;;
7952caa6
JG
321ultra3)
322 cpu=a29k
323 vendor=nyu
324 os=sym1
325 ;;
25fa8f53
RP
326umax)
327 cpu=ns32k
328 vendor=encore
69e87de2
RP
329 os=sysv # maybe?
330 ;;
25fa8f53 331unixpc | safari | pc7300 | 3b1 | 7300 | 7300-att | att-7300)
69e87de2 332 cpu=m68k
25fa8f53 333 vendor=att
69e87de2
RP
334 os=sysv # maybe?
335 ;;
25fa8f53
RP
336vax-dec)
337 cpu=vax
69e87de2 338 vendor=dec
25fa8f53 339 os=ultrix # maybe?
69e87de2 340 ;;
25fa8f53
RP
341vxworks68)
342 cpu=m68k
343 vendor=wrs
344 os=vxworks
69e87de2 345 ;;
25fa8f53
RP
346vxworks960)
347 cpu=i960
348 vendor=wrs
349 os=vxworks
69e87de2 350 ;;
25fa8f53
RP
351xmp)
352 cpu=xmp
353 vendor=cray
354 os=unicos
69e87de2 355 ;;
69e87de2
RP
356# not an alias. parse what we expect to be a canonical name.
357*)
358 cpu=`echo $1 | sed 's/-.*$//'`
359
360 if [ "${cpu}" = "$1" ] ; then
361 # no vendor so this is an invalid name.
362 echo '***' No vendor: configuration \`$1\' not recognized 1>&2
4f183929 363 exit 1
69e87de2
RP
364 else
365 # parse out vendor
366 rest=`echo $1 | sed "s/${cpu}-//"`
367 vendor=`echo ${rest} | sed 's/-.*$//'`
368
369 if [ "${vendor}" = "${rest}" ] ; then
370 # a missing os is acceptable
371 os=none
372 else
373 os=`echo ${rest} | sed "s/${vendor}-//"`
374 fi
375 fi
376 ;;
4f183929
RP
377esac
378
69e87de2
RP
379# At this point we should have three parts of a canonical name in cpu,
380# vendor, and os.
4f183929 381
69e87de2
RP
382# verify that the cpu is known.
383
384case "${cpu}" in
25fa8f53
RP
385none | vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc \
386 | ns32k | alliant | arm | c1 | c2 | mips | pyramid | tron \
7054ee6d 387 | a29k | romp | rs6000 | i960 | xmp | ymp | cray2 | 580 | h8300)
69e87de2 388 ;;
25fa8f53
RP
389
390# start-sanitize-v9
391sparc64) ;;
392# end-sanitize-v9
393
69e87de2
RP
394*)
395 echo '***' Invalid cpu \`${cpu}\': configuration \`$1\' not recognized 1>&2
396 exit 1
397 ;;
398esac
399
400# verify that the vendor is known.
401
402case "${vendor}" in
a5a8b9b1
JG
403 altos | amdahl | aout | apollo | att | bcs | bout |\
404 cbm | convergent | convex | coff | cray | dec | encore |\
405 gould | intel | isi | hp | ibm | little | mips | motorola |\
406 ncr | next | none | nyu | sco | sequent | sgi | sony | sun |\
7054ee6d 407 unicom | utek | wrs | bull ) ;;
25fa8f53
RP
408
409# start-sanitize-v9
410hal) ;;
411# end-sanitize-v9
412
69e87de2
RP
413*)
414 echo '***' Invalid vendor \`${vendor}\': configuration \`$1\' not recognized 1>&2
415 exit 1
416 ;;
417esac
418
419# verify that the os is known, if it exists.
420
421case "${os}" in
25fa8f53 422aix* | aout | bout | bsd* | coff | ctix* | dynix* | esix* | hpux* | irix* \
4f73c36a 423 | isc* | kern | mach* | newsos* | nindy* | none | osf* | sco* \
25fa8f53 424 | sunos* | sysv* | ultrix* | unos* | v88r* | vms* | vxworks* \
a5a8b9b1 425 | sym[1-9]* | unicos* | uts | svr4 | amigados)
69e87de2 426 ;;
25fa8f53
RP
427
428# start-sanitize-v9
429hal32 | hal64 | v7 | v9) ;;
430# end-sanitize-v9
431
69e87de2
RP
432*)
433 echo '***' Invalid os \`${os}\': configuration \`$1\' not recognized 1>&2
434 exit 1
435 ;;
4f183929
RP
436esac
437
69e87de2 438echo ${cpu}-${vendor}-${os}
This page took 0.042254 seconds and 4 git commands to generate.