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