]>
Commit | Line | Data |
---|---|---|
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 | # [email protected] | |
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 | 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 | ebmon29k) | |
113 | cpu=a29k | |
114 | vendor=amd | |
115 | os=ebmon | |
116 | ;; | |
117 | gmicro) | |
118 | cpu=tron | |
119 | vendor=gmicro | |
120 | os=sysv # maybe? | |
121 | ;; | |
122 | ||
123 | harris) | |
124 | cpu=m88k | |
125 | vendor=harris | |
126 | os=m88kbcs | |
127 | ;; | |
128 | ||
129 | h8300hds) | |
130 | cpu=h8300 | |
131 | vendor=hitachi | |
132 | os=hds | |
133 | ;; | |
134 | ||
135 | # start-sanitize-life | |
136 | life) | |
137 | cpu=life | |
138 | vendor=philips | |
139 | os=none | |
140 | ;; | |
141 | # end-sanitize-life | |
142 | ||
143 | # start-sanitize-v9 | |
144 | hal-32 | hal32) | |
145 | cpu=sparc64 | |
146 | vendor=hal | |
147 | os=hal32 | |
148 | ;; | |
149 | hal-64 | hal64) | |
150 | cpu=sparc64 | |
151 | vendor=hal | |
152 | os=hal64 | |
153 | ;; | |
154 | sparc64) | |
155 | cpu=sparc64 | |
156 | vendor=sun | |
157 | os=v9 | |
158 | ;; | |
159 | sparc64-v7 | sparc64v7) | |
160 | cpu=sparc64 | |
161 | vendor=sun | |
162 | os=v7 | |
163 | ;; | |
164 | # end-sanitize-v9 | |
165 | hp300bsd) | |
166 | cpu=m68k | |
167 | vendor=hp | |
168 | os=bsd | |
169 | ;; | |
170 | hp300hpux | hpux | hp9k3[2-9][0-9]) | |
171 | cpu=m68k | |
172 | vendor=hp | |
173 | os=hpux | |
174 | ;; | |
175 | hp9k31[0-9] | hp9k2[0-9][0-9]) | |
176 | cpu=m68000 | |
177 | vendor=hp | |
178 | os=hpux | |
179 | ;; | |
180 | i386sco) | |
181 | cpu=i386 | |
182 | vendor=sco | |
183 | os=sysv32 # maybe? | |
184 | ;; | |
185 | i386v) | |
186 | cpu=i386 | |
187 | vendor=none | |
188 | os=sysv | |
189 | ;; | |
190 | i386v32) | |
191 | cpu=i386 | |
192 | vendor=none | |
193 | os=sysv32 | |
194 | ;; | |
195 | iris | iris4d) | |
196 | cpu=mips | |
197 | vendor=sgi | |
198 | os=irix # maybe? | |
199 | ;; | |
200 | ||
201 | dpx2) | |
202 | vendor=bull | |
203 | cpu=m68k | |
204 | os=sysv | |
205 | ;; | |
206 | isi | isi68) | |
207 | cpu=m68k | |
208 | vendor=isi | |
209 | os=sysv # maybe? | |
210 | ;; | |
211 | littlemips) | |
212 | cpu=mips | |
213 | vendor=little | |
214 | os=bsd | |
215 | ;; | |
216 | magnum | m3230) | |
217 | cpu=mips | |
218 | vendor=mips | |
219 | os=sysv # maybe? | |
220 | ;; | |
221 | merlin) | |
222 | cpu=ns32k | |
223 | vendor=utek | |
224 | os=sysv # maybe? | |
225 | ;; | |
226 | miniframe) | |
227 | cpu=m68000 | |
228 | vendor=convergent | |
229 | os=sysv # maybe? | |
230 | ;; | |
231 | mmax) | |
232 | cpu=ns32k | |
233 | vendor=encore | |
234 | os=sysv # maybe? | |
235 | ;; | |
236 | news | news700 | news800 | news900) | |
237 | cpu=m68k | |
238 | vendor=sony | |
239 | os=newsos # newsos3c or newsos4c, c stands for cisc. Based on bsd-4.3. | |
240 | ;; | |
241 | news1000) | |
242 | cpu=m68030 | |
243 | vendor=sony | |
244 | os=newsos | |
245 | ;; | |
246 | news-3600 | bigmips | risc-news) | |
247 | cpu=mips | |
248 | vendor=sony | |
249 | os=newsos # Presumably newsos4r, r stands for risc. Based on bsd-4.3. | |
250 | ;; | |
251 | next) | |
252 | cpu=m68k | |
253 | vendor=next | |
254 | os=sysv # maybe? | |
255 | ;; | |
256 | nindy960) | |
257 | cpu=i960 | |
258 | vendor=intel | |
259 | os=nindy | |
260 | ;; | |
261 | none) | |
262 | cpu=none | |
263 | vendor=none | |
264 | os=none | |
265 | ;; | |
266 | np1) | |
267 | cpu=np1 | |
268 | vendor=gould | |
269 | os=sysv # maybe? | |
270 | ;; | |
271 | rtpc) | |
272 | cpu=romp | |
273 | vendor=ibm | |
274 | os=aix # maybe? | |
275 | ;; | |
276 | pbd) | |
277 | cpu=sparc | |
278 | vendor=unicom | |
279 | os=sysv | |
280 | ;; | |
281 | pn) | |
282 | cpu=pn | |
283 | vendor=gould | |
284 | os=sysv # maybe? | |
285 | ;; | |
286 | rs6000) | |
287 | cpu=rs6000 | |
288 | vendor=ibm | |
289 | os=aix | |
290 | ;; | |
291 | ps2) | |
292 | cpu=i386 | |
293 | vendor=ibm | |
294 | os=sysv # maybe? | |
295 | ;; | |
296 | sun2) | |
297 | cpu=m68000 | |
298 | vendor=sun | |
299 | os=sunos4 | |
300 | ;; | |
301 | sun2os3) | |
302 | cpu=m68000 | |
303 | vendor=sun | |
304 | os=sunos3 | |
305 | ;; | |
306 | sun2os4) | |
307 | cpu=m68000 | |
308 | vendor=sun | |
309 | os=sunos4 | |
310 | ;; | |
311 | sun3) | |
312 | cpu=m68k | |
313 | vendor=sun | |
314 | os=sunos4 | |
315 | ;; | |
316 | sun3os3) | |
317 | cpu=m68k | |
318 | vendor=sun | |
319 | os=sunos3 | |
320 | ;; | |
321 | sun3os4) | |
322 | cpu=m68k | |
323 | vendor=sun | |
324 | os=sunos4 | |
325 | ;; | |
326 | sun386 | roadrunner | sun386i) | |
327 | cpu=i386 | |
328 | vendor=sun | |
329 | os=sunos | |
330 | ;; | |
331 | sun4) | |
332 | cpu=sparc | |
333 | vendor=sun | |
334 | os=sunos4 | |
335 | ;; | |
336 | sun4os3) | |
337 | cpu=sparc | |
338 | vendor=sun | |
339 | os=sunos3 | |
340 | ;; | |
341 | sun4os4) | |
342 | cpu=sparc | |
343 | vendor=sun | |
344 | os=sunos4 | |
345 | ;; | |
346 | symmetry) | |
347 | cpu=i386 | |
348 | vendor=sequent | |
349 | os=dynix | |
350 | ;; | |
351 | tower | tower-32) | |
352 | cpu=m68k | |
353 | vendor=ncr | |
354 | os=sysv # maybe? | |
355 | ;; | |
356 | ultra3) | |
357 | cpu=a29k | |
358 | vendor=nyu | |
359 | os=sym1 | |
360 | ;; | |
361 | umax) | |
362 | cpu=ns32k | |
363 | vendor=encore | |
364 | os=sysv # maybe? | |
365 | ;; | |
366 | unixpc | safari | pc7300 | 3b1 | 7300 | 7300-att | att-7300) | |
367 | cpu=m68k | |
368 | vendor=att | |
369 | os=sysv # maybe? | |
370 | ;; | |
371 | vax-dec) | |
372 | cpu=vax | |
373 | vendor=dec | |
374 | os=ultrix # maybe? | |
375 | ;; | |
376 | vxworks68) | |
377 | cpu=m68k | |
378 | vendor=wrs | |
379 | os=vxworks | |
380 | ;; | |
381 | vxworks960) | |
382 | cpu=i960 | |
383 | vendor=wrs | |
384 | os=vxworks | |
385 | ;; | |
386 | xmp) | |
387 | cpu=xmp | |
388 | vendor=cray | |
389 | os=unicos | |
390 | ;; | |
391 | # not an alias. parse what we expect to be a canonical name. | |
392 | *) | |
393 | cpu=`echo $1 | sed 's/-.*$//'` | |
394 | ||
395 | if [ "${cpu}" = "$1" ] ; then | |
396 | # no vendor so this is an invalid name. | |
397 | echo '***' Configuration \"$1\" not recognized 1>&2 | |
398 | exit 1 | |
399 | else | |
400 | # parse out vendor | |
401 | rest=`echo $1 | sed "s/${cpu}-//"` | |
402 | vendor=`echo ${rest} | sed 's/-.*$//'` | |
403 | ||
404 | if [ "${vendor}" = "${rest}" ] ; then | |
405 | # a missing os is acceptable | |
406 | os=none | |
407 | else | |
408 | os=`echo ${rest} | sed "s/${vendor}-//"` | |
409 | fi | |
410 | fi | |
411 | ;; | |
412 | esac | |
413 | ||
414 | # At this point we should have three parts of a canonical name in cpu, | |
415 | # vendor, and os. | |
416 | ||
417 | # verify that the cpu is known. | |
418 | ||
419 | case "${cpu}" in | |
420 | none | vax | tahoe | i386 | i860 | m68k | m68000 | m88k | sparc \ | |
421 | | ns32k | alliant | arm | c1 | c2 | mips | pyramid | tron \ | |
422 | | a29k | romp | rs6000 | i960 | xmp | ymp | cray2 | 580 | h8300) | |
423 | ;; | |
424 | ||
425 | # start-sanitize-life | |
426 | life) ;; | |
427 | # end-sanitize-life | |
428 | ||
429 | # start-sanitize-v9 | |
430 | sparc64) ;; | |
431 | # end-sanitize-v9 | |
432 | ||
433 | *) | |
434 | echo '***' Invalid cpu \`${cpu}\': configuration \`$1\' not recognized 1>&2 | |
435 | exit 1 | |
436 | ;; | |
437 | esac | |
438 | ||
439 | # verify that the vendor is known. | |
440 | ||
441 | case "${vendor}" in | |
442 | altos | amd | amdahl | aout | apollo | att | bcs | bout |\ | |
443 | cbm | convergent | convex | coff | cray | dec | encore |\ | |
444 | gould | harris | hitachi | intel | isi | hp | ibm | little | mips | motorola | \ | |
445 | ncr | next | none | nyu | sco | sequent | sgi | sony | sun |\ | |
446 | unicom | utek | wrs | bull ) ;; | |
447 | ||
448 | # start-sanitize-life | |
449 | philips) ;; | |
450 | # end-sanitize-life | |
451 | ||
452 | # start-sanitize-v9 | |
453 | hal) ;; | |
454 | # end-sanitize-v9 | |
455 | ||
456 | *) | |
457 | echo '***' Invalid vendor \`${vendor}\': configuration \`$1\' not recognized 1>&2 | |
458 | exit 1 | |
459 | ;; | |
460 | esac | |
461 | ||
462 | # verify that the os is known, if it exists. | |
463 | ||
464 | case "${os}" in | |
465 | aix* | aout | bout | bsd* | coff | ctix* | dgux* | dynix* | esix* \ | |
466 | | ebmon | hpux* \ | |
467 | | hds | irix* | isc* | kern | mach* | msdos* | newsos* | nindy* | none \ | |
468 | | osf* | sco* | sunos* | sysv* | ultrix* | unos* | v88r* \ | |
469 | | vms* | vxworks* | sym[1-9]* | unicos* | uts | svr4 | m88kbcs \ | |
470 | | amigados) | |
471 | ;; | |
472 | ||
473 | # start-sanitize-v9 | |
474 | hal32 | hal64 | v7 | v9) ;; | |
475 | # end-sanitize-v9 | |
476 | ||
477 | *) | |
478 | echo '***' Invalid os \`${os}\': configuration \`$1\' not recognized 1>&2 | |
479 | exit 1 | |
480 | ;; | |
481 | esac | |
482 | ||
483 | echo ${cpu}-${vendor}-${os} |