source: trunk/server/source3/lib/ldb/config.sub@ 454

Last change on this file since 454 was 414, checked in by Herwig Bauernfeind, 16 years ago

Samba 3.5.0: Initial import

File size: 33.2 KB
Line 
1#! /bin/sh
2# Configuration validation subroutine script.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5# Free Software Foundation, Inc.
6
7timestamp='2009-04-17'
8
9# This file is (in principle) common to ALL GNU software.
10# The presence of a machine in this file suggests that SOME GNU software
11# can handle that machine. It does not imply ALL GNU software can.
12#
13# This file is free software; you can redistribute it and/or modify
14# it under the terms of the GNU General Public License as published by
15# the Free Software Foundation; either version 2 of the License, or
16# (at your option) any later version.
17#
18# This program is distributed in the hope that it will be useful,
19# but WITHOUT ANY WARRANTY; without even the implied warranty of
20# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21# GNU General Public License for more details.
22#
23# You should have received a copy of the GNU General Public License
24# along with this program; if not, write to the Free Software
25# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26# 02110-1301, USA.
27#
28# As a special exception to the GNU General Public License, if you
29# distribute this file as part of a program that contains a
30# configuration script generated by Autoconf, you may include it under
31# the same distribution terms that you use for the rest of that program.
32
33
34# Please send patches to <[email protected]>. Submit a context
35# diff and a properly formatted ChangeLog entry.
36#
37# Configuration subroutine to validate and canonicalize a configuration type.
38# Supply the specified configuration type as an argument.
39# If it is invalid, we print an error message on stderr and exit with code 1.
40# Otherwise, we print the canonical config type on stdout and succeed.
41
42# This file is supposed to be the same for all GNU packages
43# and recognize all the CPU types, system types and aliases
44# that are meaningful with *any* GNU software.
45# Each package is responsible for reporting which valid configurations
46# it does not support. The user should be able to distinguish
47# a failure to support a valid configuration from a meaningless
48# configuration.
49
50# The goal of this file is to map all the various variations of a given
51# machine specification into a single specification in the form:
52# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
53# or in some cases, the newer four-part form:
54# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
55# It is wrong to echo any other type of specification.
56
57me=`echo "$0" | sed -e 's,.*/,,'`
58
59usage="\
60Usage: $0 [OPTION] CPU-MFR-OPSYS
61 $0 [OPTION] ALIAS
62
63Canonicalize a configuration name.
64
65Operation modes:
66 -h, --help print this help, then exit
67 -t, --time-stamp print date of last modification, then exit
68 -v, --version print version number, then exit
69
70Report bugs and patches to <[email protected]>."
71
72version="\
73GNU config.sub ($timestamp)
74
75Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
762002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
77
78This is free software; see the source for copying conditions. There is NO
79warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
80
81help="
82Try \`$me --help' for more information."
83
84# Parse command line
85while test $# -gt 0 ; do
86 case $1 in
87 --time-stamp | --time* | -t )
88 echo "$timestamp" ; exit ;;
89 --version | -v )
90 echo "$version" ; exit ;;
91 --help | --h* | -h )
92 echo "$usage"; exit ;;
93 -- ) # Stop option processing
94 shift; break ;;
95 - ) # Use stdin as input.
96 break ;;
97 -* )
98 echo "$me: invalid option $1$help"
99 exit 1 ;;
100
101 *local*)
102 # First pass through any local machine types.
103 echo $1
104 exit ;;
105
106 * )
107 break ;;
108 esac
109done
110
111case $# in
112 0) echo "$me: missing argument$help" >&2
113 exit 1;;
114 1) ;;
115 *) echo "$me: too many arguments$help" >&2
116 exit 1;;
117esac
118
119# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
120# Here we must recognize all the valid KERNEL-OS combinations.
121maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
122case $maybe_os in
123 nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
124 uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125 kopensolaris*-gnu* | \
126 storm-chaos* | os2-emx* | rtmk-nova*)
127 os=-$maybe_os
128 basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
129 ;;
130 *)
131 basic_machine=`echo $1 | sed 's/-[^-]*$//'`
132 if [ $basic_machine != $1 ]
133 then os=`echo $1 | sed 's/.*-/-/'`
134 else os=; fi
135 ;;
136esac
137
138### Let's recognize common machines as not being operating systems so
139### that things like config.sub decstation-3100 work. We also
140### recognize some manufacturers as not being operating systems, so we
141### can provide default operating systems below.
142case $os in
143 -sun*os*)
144 # Prevent following clause from handling this invalid input.
145 ;;
146 -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
147 -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
148 -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
149 -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
150 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
151 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
152 -apple | -axis | -knuth | -cray)
153 os=
154 basic_machine=$1
155 ;;
156 -sim | -cisco | -oki | -wec | -winbond)
157 os=
158 basic_machine=$1
159 ;;
160 -scout)
161 ;;
162 -wrs)
163 os=-vxworks
164 basic_machine=$1
165 ;;
166 -chorusos*)
167 os=-chorusos
168 basic_machine=$1
169 ;;
170 -chorusrdb)
171 os=-chorusrdb
172 basic_machine=$1
173 ;;
174 -hiux*)
175 os=-hiuxwe2
176 ;;
177 -sco6)
178 os=-sco5v6
179 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
180 ;;
181 -sco5)
182 os=-sco3.2v5
183 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
184 ;;
185 -sco4)
186 os=-sco3.2v4
187 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188 ;;
189 -sco3.2.[4-9]*)
190 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
191 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
192 ;;
193 -sco3.2v[4-9]*)
194 # Don't forget version if it is 3.2v4 or newer.
195 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
196 ;;
197 -sco5v6*)
198 # Don't forget version if it is 3.2v4 or newer.
199 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
200 ;;
201 -sco*)
202 os=-sco3.2v2
203 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
204 ;;
205 -udk*)
206 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207 ;;
208 -isc)
209 os=-isc2.2
210 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
211 ;;
212 -clix*)
213 basic_machine=clipper-intergraph
214 ;;
215 -isc*)
216 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
217 ;;
218 -lynx*)
219 os=-lynxos
220 ;;
221 -ptx*)
222 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
223 ;;
224 -windowsnt*)
225 os=`echo $os | sed -e 's/windowsnt/winnt/'`
226 ;;
227 -psos*)
228 os=-psos
229 ;;
230 -mint | -mint[0-9]*)
231 basic_machine=m68k-atari
232 os=-mint
233 ;;
234esac
235
236# Decode aliases for certain CPU-COMPANY combinations.
237case $basic_machine in
238 # Recognize the basic CPU types without company name.
239 # Some are omitted here because they have special meanings below.
240 1750a | 580 \
241 | a29k \
242 | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
243 | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
244 | am33_2.0 \
245 | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
246 | bfin \
247 | c4x | clipper \
248 | d10v | d30v | dlx | dsp16xx \
249 | fido | fr30 | frv \
250 | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
251 | i370 | i860 | i960 | ia64 \
252 | ip2k | iq2000 \
253 | lm32 \
254 | m32c | m32r | m32rle | m68000 | m68k | m88k \
255 | maxq | mb | microblaze | mcore | mep | metag \
256 | mips | mipsbe | mipseb | mipsel | mipsle \
257 | mips16 \
258 | mips64 | mips64el \
259 | mips64octeon | mips64octeonel \
260 | mips64orion | mips64orionel \
261 | mips64r5900 | mips64r5900el \
262 | mips64vr | mips64vrel \
263 | mips64vr4100 | mips64vr4100el \
264 | mips64vr4300 | mips64vr4300el \
265 | mips64vr5000 | mips64vr5000el \
266 | mips64vr5900 | mips64vr5900el \
267 | mipsisa32 | mipsisa32el \
268 | mipsisa32r2 | mipsisa32r2el \
269 | mipsisa64 | mipsisa64el \
270 | mipsisa64r2 | mipsisa64r2el \
271 | mipsisa64sb1 | mipsisa64sb1el \
272 | mipsisa64sr71k | mipsisa64sr71kel \
273 | mipstx39 | mipstx39el \
274 | mn10200 | mn10300 \
275 | moxie \
276 | mt \
277 | msp430 \
278 | nios | nios2 \
279 | ns16k | ns32k \
280 | or32 \
281 | pdp10 | pdp11 | pj | pjl \
282 | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
283 | pyramid \
284 | score \
285 | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
286 | sh64 | sh64le \
287 | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
288 | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
289 | spu | strongarm \
290 | tahoe | thumb | tic4x | tic80 | tron \
291 | v850 | v850e \
292 | we32k \
293 | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
294 | z8k | z80)
295 basic_machine=$basic_machine-unknown
296 ;;
297 m6811 | m68hc11 | m6812 | m68hc12)
298 # Motorola 68HC11/12.
299 basic_machine=$basic_machine-unknown
300 os=-none
301 ;;
302 m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
303 ;;
304 ms1)
305 basic_machine=mt-unknown
306 ;;
307
308 # We use `pc' rather than `unknown'
309 # because (1) that's what they normally are, and
310 # (2) the word "unknown" tends to confuse beginning users.
311 i*86 | x86_64)
312 basic_machine=$basic_machine-pc
313 ;;
314 # Object if more than one company name word.
315 *-*-*)
316 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
317 exit 1
318 ;;
319 # Recognize the basic CPU types with company name.
320 580-* \
321 | a29k-* \
322 | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
323 | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
324 | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
325 | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
326 | avr-* | avr32-* \
327 | bfin-* | bs2000-* \
328 | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
329 | clipper-* | craynv-* | cydra-* \
330 | d10v-* | d30v-* | dlx-* \
331 | elxsi-* \
332 | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
333 | h8300-* | h8500-* \
334 | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
335 | i*86-* | i860-* | i960-* | ia64-* \
336 | ip2k-* | iq2000-* \
337 | lm32-* \
338 | m32c-* | m32r-* | m32rle-* \
339 | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
340 | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
341 | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
342 | mips16-* \
343 | mips64-* | mips64el-* \
344 | mips64octeon-* | mips64octeonel-* \
345 | mips64orion-* | mips64orionel-* \
346 | mips64r5900-* | mips64r5900el-* \
347 | mips64vr-* | mips64vrel-* \
348 | mips64vr4100-* | mips64vr4100el-* \
349 | mips64vr4300-* | mips64vr4300el-* \
350 | mips64vr5000-* | mips64vr5000el-* \
351 | mips64vr5900-* | mips64vr5900el-* \
352 | mipsisa32-* | mipsisa32el-* \
353 | mipsisa32r2-* | mipsisa32r2el-* \
354 | mipsisa64-* | mipsisa64el-* \
355 | mipsisa64r2-* | mipsisa64r2el-* \
356 | mipsisa64sb1-* | mipsisa64sb1el-* \
357 | mipsisa64sr71k-* | mipsisa64sr71kel-* \
358 | mipstx39-* | mipstx39el-* \
359 | mmix-* \
360 | mt-* \
361 | msp430-* \
362 | nios-* | nios2-* \
363 | none-* | np1-* | ns16k-* | ns32k-* \
364 | orion-* \
365 | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
366 | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
367 | pyramid-* \
368 | romp-* | rs6000-* \
369 | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
370 | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
371 | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
372 | sparclite-* \
373 | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
374 | tahoe-* | thumb-* \
375 | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
376 | tron-* \
377 | v850-* | v850e-* | vax-* \
378 | we32k-* \
379 | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
380 | xstormy16-* | xtensa*-* \
381 | ymp-* \
382 | z8k-* | z80-*)
383 ;;
384 # Recognize the basic CPU types without company name, with glob match.
385 xtensa*)
386 basic_machine=$basic_machine-unknown
387 ;;
388 # Recognize the various machine names and aliases which stand
389 # for a CPU type and a company and sometimes even an OS.
390 386bsd)
391 basic_machine=i386-unknown
392 os=-bsd
393 ;;
394 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
395 basic_machine=m68000-att
396 ;;
397 3b*)
398 basic_machine=we32k-att
399 ;;
400 a29khif)
401 basic_machine=a29k-amd
402 os=-udi
403 ;;
404 abacus)
405 basic_machine=abacus-unknown
406 ;;
407 adobe68k)
408 basic_machine=m68010-adobe
409 os=-scout
410 ;;
411 alliant | fx80)
412 basic_machine=fx80-alliant
413 ;;
414 altos | altos3068)
415 basic_machine=m68k-altos
416 ;;
417 am29k)
418 basic_machine=a29k-none
419 os=-bsd
420 ;;
421 amd64)
422 basic_machine=x86_64-pc
423 ;;
424 amd64-*)
425 basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
426 ;;
427 amdahl)
428 basic_machine=580-amdahl
429 os=-sysv
430 ;;
431 amiga | amiga-*)
432 basic_machine=m68k-unknown
433 ;;
434 amigaos | amigados)
435 basic_machine=m68k-unknown
436 os=-amigaos
437 ;;
438 amigaunix | amix)
439 basic_machine=m68k-unknown
440 os=-sysv4
441 ;;
442 apollo68)
443 basic_machine=m68k-apollo
444 os=-sysv
445 ;;
446 apollo68bsd)
447 basic_machine=m68k-apollo
448 os=-bsd
449 ;;
450 aros)
451 basic_machine=i386-pc
452 os=-aros
453 ;;
454 aux)
455 basic_machine=m68k-apple
456 os=-aux
457 ;;
458 balance)
459 basic_machine=ns32k-sequent
460 os=-dynix
461 ;;
462 blackfin)
463 basic_machine=bfin-unknown
464 os=-linux
465 ;;
466 blackfin-*)
467 basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
468 os=-linux
469 ;;
470 c90)
471 basic_machine=c90-cray
472 os=-unicos
473 ;;
474 cegcc)
475 basic_machine=arm-unknown
476 os=-cegcc
477 ;;
478 convex-c1)
479 basic_machine=c1-convex
480 os=-bsd
481 ;;
482 convex-c2)
483 basic_machine=c2-convex
484 os=-bsd
485 ;;
486 convex-c32)
487 basic_machine=c32-convex
488 os=-bsd
489 ;;
490 convex-c34)
491 basic_machine=c34-convex
492 os=-bsd
493 ;;
494 convex-c38)
495 basic_machine=c38-convex
496 os=-bsd
497 ;;
498 cray | j90)
499 basic_machine=j90-cray
500 os=-unicos
501 ;;
502 craynv)
503 basic_machine=craynv-cray
504 os=-unicosmp
505 ;;
506 cr16)
507 basic_machine=cr16-unknown
508 os=-elf
509 ;;
510 crds | unos)
511 basic_machine=m68k-crds
512 ;;