]> git.sur5r.net Git - openldap/blob - build/config.sub
Suck in latest config.* from HEAD
[openldap] / build / config.sub
1 #! /bin/sh
2 # Configuration validation subroutine script.
3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 #   2000, 2001, 2002 Free Software Foundation, Inc.
5 # Portions Copyright 1998-2002 OpenLDAP Foundation.
6
7 timestamp='2002-02-01'
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., 59 Temple Place - Suite 330,
26 # Boston, MA 02111-1307, 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 # This file is distributed with OpenLDAP Software, which contains a
34 # configuration script generated by autoconf and is distributable
35 # under the same distributions terms as OpenLDAP inself.
36 # See the OpenLDAP COPYRIGHT and LICENSE file for details.
37
38 # Please send patches to <config-patches@gnu.org>.  Submit a context
39 # diff and a properly formatted ChangeLog entry.
40 #
41 # Configuration subroutine to validate and canonicalize a configuration type.
42 # Supply the specified configuration type as an argument.
43 # If it is invalid, we print an error message on stderr and exit with code 1.
44 # Otherwise, we print the canonical config type on stdout and succeed.
45
46 # This file is supposed to be the same for all GNU packages
47 # and recognize all the CPU types, system types and aliases
48 # that are meaningful with *any* GNU software.
49 # Each package is responsible for reporting which valid configurations
50 # it does not support.  The user should be able to distinguish
51 # a failure to support a valid configuration from a meaningless
52 # configuration.
53
54 # The goal of this file is to map all the various variations of a given
55 # machine specification into a single specification in the form:
56 #       CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
57 # or in some cases, the newer four-part form:
58 #       CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
59 # It is wrong to echo any other type of specification.
60
61 me=`echo "$0" | sed -e 's,.*/,,'`
62
63 usage="\
64 Usage: $0 [OPTION] CPU-MFR-OPSYS
65        $0 [OPTION] ALIAS
66
67 Canonicalize a configuration name.
68
69 Operation modes:
70   -h, --help         print this help, then exit
71   -t, --time-stamp   print date of last modification, then exit
72   -v, --version      print version number, then exit
73
74 Report bugs and patches to <config-patches@gnu.org>."
75
76 version="\
77 GNU config.sub ($timestamp)
78
79 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
80 Free Software Foundation, Inc.
81
82 This is free software; see the source for copying conditions.  There is NO
83 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
84
85 help="
86 Try \`$me --help' for more information."
87
88 # Parse command line
89 while test $# -gt 0 ; do
90   case $1 in
91     --time-stamp | --time* | -t )
92        echo "$timestamp" ; exit 0 ;;
93     --version | -v )
94        echo "$version" ; exit 0 ;;
95     --help | --h* | -h )
96        echo "$usage"; exit 0 ;;
97     -- )     # Stop option processing
98        shift; break ;;
99     - ) # Use stdin as input.
100        break ;;
101     -* )
102        echo "$me: invalid option $1$help"
103        exit 1 ;;
104
105     *local*)
106        # First pass through any local machine types.
107        echo $1
108        exit 0;;
109
110     * )
111        break ;;
112   esac
113 done
114
115 case $# in
116  0) echo "$me: missing argument$help" >&2
117     exit 1;;
118  1) ;;
119  *) echo "$me: too many arguments$help" >&2
120     exit 1;;
121 esac
122
123 # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
124 # Here we must recognize all the valid KERNEL-OS combinations.
125 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126 case $maybe_os in
127   nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
128     os=-$maybe_os
129     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
130     ;;
131   *)
132     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
133     if [ $basic_machine != $1 ]
134     then os=`echo $1 | sed 's/.*-/-/'`
135     else os=; fi
136     ;;
137 esac
138
139 ### Let's recognize common machines as not being operating systems so
140 ### that things like config.sub decstation-3100 work.  We also
141 ### recognize some manufacturers as not being operating systems, so we
142 ### can provide default operating systems below.
143 case $os in
144         -sun*os*)
145                 # Prevent following clause from handling this invalid input.
146                 ;;
147         -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
148         -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
149         -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
150         -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
151         -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
152         -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
153         -apple | -axis)
154                 os=
155                 basic_machine=$1
156                 ;;
157         -sim | -cisco | -oki | -wec | -winbond)
158                 os=
159                 basic_machine=$1
160                 ;;
161         -scout)
162                 ;;
163         -wrs)
164                 os=-vxworks
165                 basic_machine=$1
166                 ;;
167         -chorusos*)
168                 os=-chorusos
169                 basic_machine=$1
170                 ;;
171         -chorusrdb)
172                 os=-chorusrdb
173                 basic_machine=$1
174                 ;;
175         -hiux*)
176                 os=-hiuxwe2
177                 ;;
178         -sco5)
179                 os=-sco3.2v5
180                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
181                 ;;
182         -sco4)
183                 os=-sco3.2v4
184                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
185                 ;;
186         -sco3.2.[4-9]*)
187                 os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
188                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
189                 ;;
190         -sco3.2v[4-9]*)
191                 # Don't forget version if it is 3.2v4 or newer.
192                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
193                 ;;
194         -sco*)
195                 os=-sco3.2v2
196                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
197                 ;;
198         -udk*)
199                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
200                 ;;
201         -isc)
202                 os=-isc2.2
203                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
204                 ;;
205         -clix*)
206                 basic_machine=clipper-intergraph
207                 ;;
208         -isc*)
209                 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
210                 ;;
211         -lynx*)
212                 os=-lynxos
213                 ;;
214         -ptx*)
215                 basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
216                 ;;
217         -windowsnt*)
218                 os=`echo $os | sed -e 's/windowsnt/winnt/'`
219                 ;;
220         -psos*)
221                 os=-psos
222                 ;;
223         -mint | -mint[0-9]*)
224                 basic_machine=m68k-atari
225                 os=-mint
226                 ;;
227 esac
228
229 # Decode aliases for certain CPU-COMPANY combinations.
230 case $basic_machine in
231         # Recognize the basic CPU types without company name.
232         # Some are omitted here because they have special meanings below.
233         1750a | 580 \
234         | a29k \
235         | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
236         | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
237         | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
238         | c4x | clipper \
239         | d10v | d30v | dsp16xx \
240         | fr30 \
241         | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
242         | i370 | i860 | i960 | ia64 \
243         | m32r | m68000 | m68k | m88k | mcore \
244         | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
245         | mips64vr4100 | mips64vr4100el | mips64vr4300 \
246         | mips64vr4300el | mips64vr5000 | mips64vr5000el \
247         | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
248         | mipsisa32 \
249         | mn10200 | mn10300 \
250         | ns16k | ns32k \
251         | openrisc | or32 \
252         | pdp10 | pdp11 | pj | pjl \
253         | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
254         | pyramid \
255         | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
256         | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
257         | strongarm \
258         | tahoe | thumb | tic80 | tron \
259         | v850 | v850e \
260         | we32k \
261         | x86 | xscale | xstormy16 | xtensa \
262         | z8k)
263                 basic_machine=$basic_machine-unknown
264                 ;;
265         m6811 | m68hc11 | m6812 | m68hc12)
266                 # Motorola 68HC11/12.
267                 basic_machine=$basic_machine-unknown
268                 os=-none
269                 ;;
270         m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
271                 ;;
272
273         # We use `pc' rather than `unknown'
274         # because (1) that's what they normally are, and
275         # (2) the word "unknown" tends to confuse beginning users.
276         i*86 | x86_64)
277           basic_machine=$basic_machine-pc
278           ;;
279         # Object if more than one company name word.
280         *-*-*)
281                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
282                 exit 1
283                 ;;
284         # Recognize the basic CPU types with company name.
285         580-* \
286         | a29k-* \
287         | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
288         | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
289         | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
290         | arm-*  | armbe-* | armle-* | armv*-* \
291         | avr-* \
292         | bs2000-* \
293         | c[123]* | c30-* | [cjt]90-* | c54x-* \
294         | clipper-* | cray2-* | cydra-* \
295         | d10v-* | d30v-* \
296         | elxsi-* \
297         | f30[01]-* | f700-* | fr30-* | fx80-* \
298         | h8300-* | h8500-* \
299         | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
300         | i*86-* | i860-* | i960-* | ia64-* \
301         | m32r-* \
302         | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
303         | m88110-* | m88k-* | mcore-* \
304         | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
305         | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
306         | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
307         | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
308         | none-* | np1-* | ns16k-* | ns32k-* \
309         | orion-* \
310         | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
311         | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
312         | pyramid-* \
313         | romp-* | rs6000-* \
314         | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
315         | sparc-* | sparc64-* | sparc86x-* | sparclite-* \
316         | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \
317         | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
318         | v850-* | v850e-* | vax-* \
319         | we32k-* \
320         | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \
321         | xtensa-* \
322         | ymp-* \
323         | z8k-*)
324                 ;;
325         # Recognize the various machine names and aliases which stand
326         # for a CPU type and a company and sometimes even an OS.
327         386bsd)
328                 basic_machine=i386-unknown
329                 os=-bsd
330                 ;;
331         3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
332                 basic_machine=m68000-att
333                 ;;
334         3b*)
335                 basic_machine=we32k-att
336                 ;;
337         a29khif)
338                 basic_machine=a29k-amd
339                 os=-udi
340                 ;;
341         adobe68k)
342                 basic_machine=m68010-adobe
343                 os=-scout
344                 ;;
345         alliant | fx80)
346                 basic_machine=fx80-alliant
347                 ;;
348         altos | altos3068)
349                 basic_machine=m68k-altos
350                 ;;
351         am29k)
352                 basic_machine=a29k-none
353                 os=-bsd
354                 ;;
355         amdahl)
356                 basic_machine=580-amdahl
357                 os=-sysv
358                 ;;
359         amiga | amiga-*)
360                 basic_machine=m68k-unknown
361                 ;;
362         amigaos | amigados)
363                 basic_machine=m68k-unknown
364                 os=-amigaos
365                 ;;
366         amigaunix | amix)
367                 basic_machine=m68k-unknown
368                 os=-sysv4
369                 ;;
370         apollo68)
371                 basic_machine=m68k-apollo
372                 os=-sysv
373                 ;;
374         apollo68bsd)
375                 basic_machine=m68k-apollo
376                 os=-bsd
377                 ;;
378         aux)
379                 basic_machine=m68k-apple
380                 os=-aux
381                 ;;
382         balance)
383                 basic_machine=ns32k-sequent
384                 os=-dynix
385                 ;;
386         convex-c1)
387                 basic_machine=c1-convex
388                 os=-bsd
389                 ;;
390         convex-c2)
391                 basic_machine=c2-convex
392                 os=-bsd
393                 ;;
394         convex-c32)
395                 basic_machine=c32-convex
396                 os=-bsd
397                 ;;
398         convex-c34)
399                 basic_machine=c34-convex
400                 os=-bsd
401                 ;;
402         convex-c38)
403                 basic_machine=c38-convex
404                 os=-bsd
405                 ;;
406         cray | ymp)
407                 basic_machine=ymp-cray
408                 os=-unicos
409                 ;;
410         cray2)
411                 basic_machine=cray2-cray
412                 os=-unicos
413                 ;;
414         [cjt]90)
415                 basic_machine=${basic_machine}-cray
416                 os=-unicos
417                 ;;
418         crds | unos)
419                 basic_machine=m68k-crds
420                 ;;
421         cris | cris-* | etrax*)
422                 basic_machine=cris-axis
423                 ;;
424         da30 | da30-*)
425                 basic_machine=m68k-da30
426                 ;;
427         decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
428                 basic_machine=mips-dec
429                 ;;
430         decsystem10* | dec10*)
431                 basic_machine=pdp10-dec
432                 os=-tops10
433                 ;;
434         decsystem20* | dec20*)
435                 basic_machine=pdp10-dec
436                 os=-tops20
437                 ;;
438         delta | 3300 | motorola-3300 | motorola-delta \
439               | 3300-motorola | delta-motorola)
440                 basic_machine=m68k-motorola
441                 ;;
442         delta88)
443                 basic_machine=m88k-motorola
444                 os=-sysv3
445                 ;;
446         dpx20 | dpx20-*)
447                 basic_machine=rs6000-bull
448                 os=-bosx
449                 ;;
450         dpx2* | dpx2*-bull)
451                 basic_machine=m68k-bull
452                 os=-sysv3
453                 ;;
454         ebmon29k)
455                 basic_machine=a29k-amd
456                 os=-ebmon
457                 ;;
458         elxsi)
459                 basic_machine=elxsi-elxsi
460                 os=-bsd
461                 ;;
462         encore | umax | mmax)
463                 basic_machine=ns32k-encore
464                 ;;
465         es1800 | OSE68k | ose68k | ose | OSE)
466                 basic_machine=m68k-ericsson
467                 os=-ose
468                 ;;
469         fx2800)
470                 basic_machine=i860-alliant
471                 ;;
472         genix)
473                 basic_machine=ns32k-ns
474                 ;;
475         gmicro)
476                 basic_machine=tron-gmicro
477                 os=-sysv
478                 ;;
479         go32)
480                 basic_machine=i386-pc
481                 os=-go32
482                 ;;
483         h3050r* | hiux*)
484                 basic_machine=hppa1.1-hitachi
485                 os=-hiuxwe2
486                 ;;
487         h8300hms)
488                 basic_machine=h8300-hitachi
489                 os=-hms
490                 ;;
491         h8300xray)
492                 basic_machine=h8300-hitachi
493                 os=-xray
494                 ;;
495         h8500hms)
496                 basic_machine=h8500-hitachi
497                 os=-hms
498                 ;;
499         harris)
500                 basic_machine=m88k-harris
501                 os=-sysv3
502                 ;;
503         hp300-*)
504                 basic_machine=m68k-hp
505                 ;;
506         hp300bsd)
507                 basic_machine=m68k-hp
508                 os=-bsd
509                 ;;
510         hp300hpux)
511                 basic_machine=m68k-hp
512                 os=-hpux
513                 ;;
514         hp3k9[0-9][0-9] | hp9[0-9][0-9])
515                 basic_machine=hppa1.0-hp
516                 ;;
517         hp9k2[0-9][0-9] | hp9k31[0-9])
518                 basic_machine=m68000-hp
519                 ;;
520         hp9k3[2-9][0-9])
521                 basic_machine=m68k-hp
522                 ;;
523         hp9k6[0-9][0-9] | hp6[0-9][0-9])
524                 basic_machine=hppa1.0-hp
525                 ;;
526         hp9k7[0-79][0-9] | hp7[0-79][0-9])
527                 basic_machine=hppa1.1-hp
528                 ;;
529         hp9k78[0-9] | hp78[0-9])
530                 # FIXME: really hppa2.0-hp
531                 basic_machine=hppa1.1-hp
532                 ;;
533         hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
534                 # FIXME: really hppa2.0-hp
535                 basic_machine=hppa1.1-hp
536                 ;;
537         hp9k8[0-9][13679] | hp8[0-9][13679])
538                 basic_machine=hppa1.1-hp
539                 ;;
540         hp9k8[0-9][0-9] | hp8[0-9][0-9])
541                 basic_machine=hppa1.0-hp
542                 ;;
543         hppa-next)
544                 os=-nextstep3
545                 ;;
546         hppaosf)
547                 basic_machine=hppa1.1-hp
548                 os=-osf
549                 ;;
550         hppro)
551                 basic_machine=hppa1.1-hp
552                 os=-proelf
553                 ;;
554         i370-ibm* | ibm*)
555                 basic_machine=i370-ibm
556                 ;;
557 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
558         i*86v32)
559                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
560                 os=-sysv32
561                 ;;
562         i*86v4*)
563                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
564                 os=-sysv4
565                 ;;
566         i*86v)
567                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
568                 os=-sysv
569                 ;;
570         i*86sol2)
571                 basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
572                 os=-solaris2
573                 ;;
574         i386mach)
575                 basic_machine=i386-mach
576                 os=-mach
577                 ;;
578         i386-vsta | vsta)
579                 basic_machine=i386-unknown
580                 os=-vsta
581                 ;;
582         iris | iris4d)
583                 basic_machine=mips-sgi
584                 case $os in
585                     -irix*)
586                         ;;
587                     *)
588                         os=-irix4
589                         ;;
590                 esac
591                 ;;
592         isi68 | isi)
593                 basic_machine=m68k-isi
594                 os=-sysv
595                 ;;
596         m88k-omron*)
597                 basic_machine=m88k-omron
598                 ;;
599         magnum | m3230)
600                 basic_machine=mips-mips
601                 os=-sysv
602                 ;;
603         merlin)
604                 basic_machine=ns32k-utek
605                 os=-sysv
606                 ;;
607         mingw32)
608                 basic_machine=i386-pc
609                 os=-mingw32
610                 ;;
611         miniframe)
612                 basic_machine=m68000-convergent
613                 ;;
614         *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
615                 basic_machine=m68k-atari
616                 os=-mint
617                 ;;
618         mipsel*-linux*)
619                 basic_machine=mipsel-unknown
620                 os=-linux-gnu
621                 ;;
622         mips*-linux*)
623                 basic_machine=mips-unknown
624                 os=-linux-gnu
625                 ;;
626         mips3*-*)
627                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
628                 ;;
629         mips3*)
630                 basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
631                 ;;
632         mmix*)
633                 basic_machine=mmix-knuth
634                 os=-mmixware
635                 ;;
636         monitor)
637                 basic_machine=m68k-rom68k
638                 os=-coff
639                 ;;
640         morphos)
641                 basic_machine=powerpc-unknown
642                 os=-morphos
643                 ;;
644         msdos)
645                 basic_machine=i386-pc
646                 os=-msdos
647                 ;;
648         mvs)
649                 basic_machine=i370-ibm
650                 os=-mvs
651                 ;;
652         ncr3000)
653                 basic_machine=i486-ncr
654                 os=-sysv4
655                 ;;
656         netbsd386)
657                 basic_machine=i386-unknown
658                 os=-netbsd
659                 ;;
660         netwinder)
661                 basic_machine=armv4l-rebel
662                 os=-linux
663                 ;;
664         news | news700 | news800 | news900)
665                 basic_machine=m68k-sony
666                 os=-newsos
667                 ;;
668         news1000)
669                 basic_machine=m68030-sony
670                 os=-newsos
671                 ;;
672         news-3600 | risc-news)
673                 basic_machine=mips-sony
674                 os=-newsos
675                 ;;
676         necv70)
677                 basic_machine=v70-nec
678                 os=-sysv
679                 ;;
680         next | m*-next )
681                 basic_machine=m68k-next
682                 case $os in
683                     -nextstep* )
684                         ;;
685                     -ns2*)
686                       os=-nextstep2
687                         ;;
688                     *)
689                       os=-nextstep3
690                         ;;
691                 esac
692                 ;;
693         nh3000)
694                 basic_machine=m68k-harris
695                 os=-cxux
696                 ;;
697         nh[45]000)
698                 basic_machine=m88k-harris
699                 os=-cxux
700                 ;;
701         nindy960)
702                 basic_machine=i960-intel
703                 os=-nindy
704                 ;;
705         mon960)
706                 basic_machine=i960-intel
707                 os=-mon960
708                 ;;
709         nonstopux)
710                 basic_machine=mips-compaq
711                 os=-nonstopux
712                 ;;
713         np1)
714                 basic_machine=np1-gould
715                 ;;
716         nsr-tandem)
717                 basic_machine=nsr-tandem
718                 ;;
719         op50n-* | op60c-*)
720                 basic_machine=hppa1.1-oki
721                 os=-proelf
722                 ;;
723         or32 | or32-*)
724                 basic_machine=or32-unknown
725                 os=-coff
726                 ;;
727         OSE68000 | ose68000)
728                 basic_machine=m68000-ericsson
729                 os=-ose
730                 ;;
731         os68k)
732                 basic_machine=m68k-none
733                 os=-os68k
734                 ;;
735         pa-hitachi)
736                 basic_machine=hppa1.1-hitachi
737                 os=-hiuxwe2
738                 ;;
739         paragon)
740                 basic_machine=i860-intel
741                 os=-osf
742                 ;;
743         pbd)
744                 basic_machine=sparc-tti
745                 ;;
746         pbb)
747                 basic_machine=m68k-tti
748                 ;;
749         pc532 | pc532-*)
750                 basic_machine=ns32k-pc532
751                 ;;
752         pentium | p5 | k5 | k6 | nexgen | viac3)
753                 basic_machine=i586-pc
754                 ;;
755         pentiumpro | p6 | 6x86 | athlon)
756                 basic_machine=i686-pc
757                 ;;
758         pentiumii | pentium2)
759                 basic_machine=i686-pc
760                 ;;
761         pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
762                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
763                 ;;
764         pentiumpro-* | p6-* | 6x86-* | athlon-*)
765                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
766                 ;;
767         pentiumii-* | pentium2-*)
768                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
769                 ;;
770         pn)
771                 basic_machine=pn-gould
772                 ;;
773         power)  basic_machine=power-ibm
774                 ;;
775         ppc)    basic_machine=powerpc-unknown
776                 ;;
777         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
778                 ;;
779         ppcle | powerpclittle | ppc-le | powerpc-little)
780                 basic_machine=powerpcle-unknown
781                 ;;
782         ppcle-* | powerpclittle-*)
783                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
784                 ;;
785         ppc64)  basic_machine=powerpc64-unknown
786                 ;;
787         ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
788                 ;;
789         ppc64le | powerpc64little | ppc64-le | powerpc64-little)
790                 basic_machine=powerpc64le-unknown
791                 ;;
792         ppc64le-* | powerpc64little-*)
793                 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
794                 ;;
795         ps2)
796                 basic_machine=i386-ibm
797                 ;;
798         pw32)
799                 basic_machine=i586-unknown
800                 os=-pw32
801                 ;;
802         rom68k)
803                 basic_machine=m68k-rom68k
804                 os=-coff
805                 ;;
806         rm[46]00)
807                 basic_machine=mips-siemens
808                 ;;
809         rtpc | rtpc-*)
810                 basic_machine=romp-ibm
811                 ;;
812         s390 | s390-*)
813                 basic_machine=s390-ibm
814                 ;;
815         s390x | s390x-*)
816                 basic_machine=s390x-ibm
817                 ;;
818         sa29200)
819                 basic_machine=a29k-amd
820                 os=-udi
821                 ;;
822         sequent)
823                 basic_machine=i386-sequent
824                 ;;
825         sh)
826                 basic_machine=sh-hitachi
827                 os=-hms
828                 ;;
829         sparclite-wrs | simso-wrs)
830                 basic_machine=sparclite-wrs
831                 os=-vxworks
832                 ;;
833         sps7)
834                 basic_machine=m68k-bull
835                 os=-sysv2
836                 ;;
837         spur)
838                 basic_machine=spur-unknown
839                 ;;
840         st2000)
841                 basic_machine=m68k-tandem
842                 ;;
843         stratus)
844                 basic_machine=i860-stratus
845                 os=-sysv4
846                 ;;
847         sun2)
848                 basic_machine=m68000-sun
849                 ;;
850         sun2os3)
851                 basic_machine=m68000-sun
852                 os=-sunos3
853                 ;;
854         sun2os4)
855                 basic_machine=m68000-sun
856                 os=-sunos4
857                 ;;
858         sun3os3)
859                 basic_machine=m68k-sun
860                 os=-sunos3
861                 ;;
862         sun3os4)
863                 basic_machine=m68k-sun
864                 os=-sunos4
865                 ;;
866         sun4os3)
867                 basic_machine=sparc-sun
868                 os=-sunos3
869                 ;;
870         sun4os4)
871                 basic_machine=sparc-sun
872                 os=-sunos4
873                 ;;
874         sun4sol2)
875                 basic_machine=sparc-sun
876                 os=-solaris2
877                 ;;
878         sun3 | sun3-*)
879                 basic_machine=m68k-sun
880                 ;;
881         sun4)
882                 basic_machine=sparc-sun
883                 ;;
884         sun386 | sun386i | roadrunner)
885                 basic_machine=i386-sun
886                 ;;
887         sv1)
888                 basic_machine=sv1-cray
889                 os=-unicos
890                 ;;
891         symmetry)
892                 basic_machine=i386-sequent
893                 os=-dynix
894                 ;;
895         t3e)
896                 basic_machine=t3e-cray
897                 os=-unicos
898                 ;;
899         tic54x | c54x*)
900                 basic_machine=tic54x-unknown
901                 os=-coff
902                 ;;
903         tx39)
904                 basic_machine=mipstx39-unknown
905                 ;;
906         tx39el)
907                 basic_machine=mipstx39el-unknown
908                 ;;
909         toad1)
910                 basic_machine=pdp10-xkl
911                 os=-tops20
912                 ;;
913         tower | tower-32)
914                 basic_machine=m68k-ncr
915                 ;;
916         udi29k)
917                 basic_machine=a29k-amd
918                 os=-udi
919                 ;;
920         ultra3)
921                 basic_machine=a29k-nyu
922                 os=-sym1
923                 ;;
924         v810 | necv810)
925                 basic_machine=v810-nec
926                 os=-none
927                 ;;
928         vaxv)
929                 basic_machine=vax-dec
930                 os=-sysv
931                 ;;
932         vms)
933                 basic_machine=vax-dec
934                 os=-vms
935                 ;;
936         vpp*|vx|vx-*)
937                basic_machine=f301-fujitsu
938                ;;
939         vxworks960)
940                 basic_machine=i960-wrs
941                 os=-vxworks
942                 ;;
943         vxworks68)
944                 basic_machine=m68k-wrs
945                 os=-vxworks
946                 ;;
947         vxworks29k)
948                 basic_machine=a29k-wrs
949                 os=-vxworks
950                 ;;
951         w65*)
952                 basic_machine=w65-wdc
953                 os=-none
954                 ;;
955         w89k-*)
956                 basic_machine=hppa1.1-winbond
957                 os=-proelf
958                 ;;
959         windows32)
960                 basic_machine=i386-pc
961                 os=-windows32-msvcrt
962                 ;;
963         xmp)
964                 basic_machine=xmp-cray
965                 os=-unicos
966                 ;;
967         xps | xps100)
968                 basic_machine=xps100-honeywell
969                 ;;
970         z8k-*-coff)
971                 basic_machine=z8k-unknown
972                 os=-sim
973                 ;;
974         none)
975                 basic_machine=none-none
976                 os=-none
977                 ;;
978
979 # Here we handle the default manufacturer of certain CPU types.  It is in
980 # some cases the only manufacturer, in others, it is the most popular.
981         w89k)
982                 basic_machine=hppa1.1-winbond
983                 ;;
984         op50n)
985                 basic_machine=hppa1.1-oki
986                 ;;
987         op60c)
988                 basic_machine=hppa1.1-oki
989                 ;;
990         mips)
991                 if [ x$os = x-linux-gnu ]; then
992                         basic_machine=mips-unknown
993                 else
994                         basic_machine=mips-mips
995                 fi
996                 ;;
997         romp)
998                 basic_machine=romp-ibm
999                 ;;
1000         rs6000)
1001                 basic_machine=rs6000-ibm
1002                 ;;
1003         vax)
1004                 basic_machine=vax-dec
1005                 ;;
1006         pdp10)
1007                 # there are many clones, so DEC is not a safe bet
1008                 basic_machine=pdp10-unknown
1009                 ;;
1010         pdp11)
1011                 basic_machine=pdp11-dec
1012                 ;;
1013         we32k)
1014                 basic_machine=we32k-att
1015                 ;;
1016         sh3 | sh4 | sh3eb | sh4eb)
1017                 basic_machine=sh-unknown
1018                 ;;
1019         sh64)
1020                 basic_machine=sh64-unknown
1021                 ;;
1022         sparc | sparcv9 | sparcv9b)
1023                 basic_machine=sparc-sun
1024                 ;;
1025         cydra)
1026                 basic_machine=cydra-cydrome
1027                 ;;
1028         orion)
1029                 basic_machine=orion-highlevel
1030                 ;;
1031         orion105)
1032                 basic_machine=clipper-highlevel
1033                 ;;
1034         mac | mpw | mac-mpw)
1035                 basic_machine=m68k-apple
1036                 ;;
1037         pmac | pmac-mpw)
1038                 basic_machine=powerpc-apple
1039                 ;;
1040         c4x*)
1041                 basic_machine=c4x-none
1042                 os=-coff
1043                 ;;
1044         *-unknown)
1045                 # Make sure to match an already-canonicalized machine name.
1046                 ;;
1047         *)
1048                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1049                 exit 1
1050                 ;;
1051 esac
1052
1053 # Here we canonicalize certain aliases for manufacturers.
1054 case $basic_machine in
1055         *-digital*)
1056                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1057                 ;;
1058         *-commodore*)
1059                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1060                 ;;
1061         *)
1062                 ;;
1063 esac
1064
1065 # Decode manufacturer-specific aliases for certain operating systems.
1066
1067 if [ x"$os" != x"" ]
1068 then
1069 case $os in
1070         # First match some system type aliases
1071         # that might get confused with valid system types.
1072         # -solaris* is a basic system type, with this one exception.
1073         -solaris1 | -solaris1.*)
1074                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1075                 ;;
1076         -solaris)
1077                 os=-solaris2
1078                 ;;
1079         -svr4*)
1080                 os=-sysv4
1081                 ;;
1082         -unixware*)
1083                 os=-sysv4.2uw
1084                 ;;
1085         -gnu/linux*)
1086                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1087                 ;;
1088         # First accept the basic system types.
1089         # The portable systems comes first.
1090         # Each alternative MUST END IN A *, to match a version number.
1091         # -sysv* is not here because it comes later, after sysvr4.
1092         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1093               | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1094               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1095               | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1096               | -aos* \
1097               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1098               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1099               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
1100               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1101               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1102               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1103               | -chorusos* | -chorusrdb* \
1104               | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1105               | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
1106               | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
1107               | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1108               | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1109               | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* | -morphos*)
1110         # Remember, each alternative MUST END IN *, to match a version number.
1111                 ;;
1112         -qnx*)
1113                 case $basic_machine in
1114                     x86-* | i*86-*)
1115                         ;;
1116                     *)
1117                         os=-nto$os
1118                         ;;
1119                 esac
1120                 ;;
1121         -nto*)
1122                 os=-nto-qnx
1123                 ;;
1124         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1125               | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
1126               | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1127                 ;;
1128         -mac*)
1129                 os=`echo $os | sed -e 's|mac|macos|'`
1130                 ;;
1131         -linux*)
1132                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1133                 ;;
1134         -sunos5*)
1135                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1136                 ;;
1137         -sunos6*)
1138                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1139                 ;;
1140         -opened*)
1141                 os=-openedition
1142                 ;;
1143         -wince*)
1144                 os=-wince
1145                 ;;
1146         -osfrose*)
1147                 os=-osfrose
1148                 ;;
1149         -osf*)
1150                 os=-osf
1151                 ;;
1152         -utek*)
1153                 os=-bsd
1154                 ;;
1155         -dynix*)
1156                 os=-bsd
1157                 ;;
1158         -acis*)
1159                 os=-aos
1160                 ;;
1161         -atheos*)
1162                 os=-atheos
1163                 ;;
1164         -386bsd)
1165                 os=-bsd
1166                 ;;
1167         -ctix* | -uts*)
1168                 os=-sysv
1169                 ;;
1170         -ns2 )
1171                 os=-nextstep2
1172                 ;;
1173         -nsk*)
1174                 os=-nsk
1175                 ;;
1176         # Preserve the version number of sinix5.
1177         -sinix5.*)
1178                 os=`echo $os | sed -e 's|sinix|sysv|'`
1179                 ;;
1180         -sinix*)
1181                 os=-sysv4
1182                 ;;
1183         -triton*)
1184                 os=-sysv3
1185                 ;;
1186         -oss*)
1187                 os=-sysv3
1188                 ;;
1189         -svr4)
1190                 os=-sysv4
1191                 ;;
1192         -svr3)
1193                 os=-sysv3
1194                 ;;
1195         -sysvr4)
1196                 os=-sysv4
1197                 ;;
1198         # This must come after -sysvr4.
1199         -sysv*)
1200                 ;;
1201         -ose*)
1202                 os=-ose
1203                 ;;
1204         -es1800*)
1205                 os=-ose
1206                 ;;
1207         -xenix)
1208                 os=-xenix
1209                 ;;
1210         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1211                 os=-mint
1212                 ;;
1213         -none)
1214                 ;;
1215         *)
1216                 # Get rid of the `-' at the beginning of $os.
1217                 os=`echo $os | sed 's/[^-]*-//'`
1218                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1219                 exit 1
1220                 ;;
1221 esac
1222 else
1223
1224 # Here we handle the default operating systems that come with various machines.
1225 # The value should be what the vendor currently ships out the door with their
1226 # machine or put another way, the most popular os provided with the machine.
1227
1228 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1229 # "-sun"), then you have to tell the case statement up towards the top
1230 # that MANUFACTURER isn't an operating system.  Otherwise, code above
1231 # will signal an error saying that MANUFACTURER isn't an operating
1232 # system, and we'll never get to this point.
1233
1234 case $basic_machine in
1235         *-acorn)
1236                 os=-riscix1.2
1237                 ;;
1238         arm*-rebel)
1239                 os=-linux
1240                 ;;
1241         arm*-semi)
1242                 os=-aout
1243                 ;;
1244         # This must come before the *-dec entry.
1245         pdp10-*)
1246                 os=-tops20
1247                 ;;
1248         pdp11-*)
1249                 os=-none
1250                 ;;
1251         *-dec | vax-*)
1252                 os=-ultrix4.2
1253                 ;;
1254         m68*-apollo)
1255                 os=-domain
1256                 ;;
1257         i386-sun)
1258                 os=-sunos4.0.2
1259                 ;;
1260         m68000-sun)
1261                 os=-sunos3
1262                 # This also exists in the configure program, but was not the
1263                 # default.
1264                 # os=-sunos4
1265                 ;;
1266         m68*-cisco)
1267                 os=-aout
1268                 ;;
1269         mips*-cisco)
1270                 os=-elf
1271                 ;;
1272         mips*-*)
1273                 os=-elf
1274                 ;;
1275         or32-*)
1276                 os=-coff
1277                 ;;
1278         *-tti)  # must be before sparc entry or we get the wrong os.
1279                 os=-sysv3
1280                 ;;
1281         sparc-* | *-sun)
1282                 os=-sunos4.1.1
1283                 ;;
1284         *-be)
1285                 os=-beos
1286                 ;;
1287         *-ibm)
1288                 os=-aix
1289                 ;;
1290         *-wec)
1291                 os=-proelf
1292                 ;;
1293         *-winbond)
1294                 os=-proelf
1295                 ;;
1296         *-oki)
1297                 os=-proelf
1298                 ;;
1299         *-hp)
1300                 os=-hpux
1301                 ;;
1302         *-hitachi)
1303                 os=-hiux
1304                 ;;
1305         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1306                 os=-sysv
1307                 ;;
1308         *-cbm)
1309                 os=-amigaos
1310                 ;;
1311         *-dg)
1312                 os=-dgux
1313                 ;;
1314         *-dolphin)
1315                 os=-sysv3
1316                 ;;
1317         m68k-ccur)
1318                 os=-rtu
1319                 ;;
1320         m88k-omron*)
1321                 os=-luna
1322                 ;;
1323         *-next )
1324                 os=-nextstep
1325                 ;;
1326         *-sequent)
1327                 os=-ptx
1328                 ;;
1329         *-crds)
1330                 os=-unos
1331                 ;;
1332         *-ns)
1333                 os=-genix
1334                 ;;
1335         i370-*)
1336                 os=-mvs
1337                 ;;
1338         *-next)
1339                 os=-nextstep3
1340                 ;;
1341         *-gould)
1342                 os=-sysv
1343                 ;;
1344         *-highlevel)
1345                 os=-bsd
1346                 ;;
1347         *-encore)
1348                 os=-bsd
1349                 ;;
1350         *-sgi)
1351                 os=-irix
1352                 ;;
1353         *-siemens)
1354                 os=-sysv4
1355                 ;;
1356         *-masscomp)
1357                 os=-rtu
1358                 ;;
1359         f30[01]-fujitsu | f700-fujitsu)
1360                 os=-uxpv
1361                 ;;
1362         *-rom68k)
1363                 os=-coff
1364                 ;;
1365         *-*bug)
1366                 os=-coff
1367                 ;;
1368         *-apple)
1369                 os=-macos
1370                 ;;
1371         *-atari*)
1372                 os=-mint
1373                 ;;
1374         *)
1375                 os=-none
1376                 ;;
1377 esac
1378 fi
1379
1380 # Here we handle the case where we know the os, and the CPU type, but not the
1381 # manufacturer.  We pick the logical manufacturer.
1382 vendor=unknown
1383 case $basic_machine in
1384         *-unknown)
1385                 case $os in
1386                         -riscix*)
1387                                 vendor=acorn
1388                                 ;;
1389                         -sunos*)
1390                                 vendor=sun
1391                                 ;;
1392                         -aix*)
1393                                 vendor=ibm
1394                                 ;;
1395                         -beos*)
1396                                 vendor=be
1397                                 ;;
1398                         -hpux*)
1399                                 vendor=hp
1400                                 ;;
1401                         -mpeix*)
1402                                 vendor=hp
1403                                 ;;
1404                         -hiux*)
1405                                 vendor=hitachi
1406                                 ;;
1407                         -unos*)
1408                                 vendor=crds
1409                                 ;;
1410                         -dgux*)
1411                                 vendor=dg
1412                                 ;;
1413                         -luna*)
1414                                 vendor=omron
1415                                 ;;
1416                         -genix*)
1417                                 vendor=ns
1418                                 ;;
1419                         -mvs* | -opened*)
1420                                 vendor=ibm
1421                                 ;;
1422                         -ptx*)
1423                                 vendor=sequent
1424                                 ;;
1425                         -vxsim* | -vxworks*)
1426                                 vendor=wrs
1427                                 ;;
1428                         -aux*)
1429                                 vendor=apple
1430                                 ;;
1431                         -hms*)
1432                                 vendor=hitachi
1433                                 ;;
1434                         -mpw* | -macos*)
1435                                 vendor=apple
1436                                 ;;
1437                         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1438                                 vendor=atari
1439                                 ;;
1440                         -vos*)
1441                                 vendor=stratus
1442                                 ;;
1443                 esac
1444                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1445                 ;;
1446 esac
1447
1448 echo $basic_machine$os
1449 exit 0
1450
1451 # Local variables:
1452 # eval: (add-hook 'write-file-hooks 'time-stamp)
1453 # time-stamp-start: "timestamp='"
1454 # time-stamp-format: "%:y-%02m-%02d"
1455 # time-stamp-end: "'"
1456 # End: