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