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