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