]> git.sur5r.net Git - openldap/blob - build/config.sub
Updated to FSF versions. Make cause tool breakage.
[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
6 timestamp='2002-01-02'
7
8 # This file is (in principle) common to ALL GNU software.
9 # The presence of a machine in this file suggests that SOME GNU software
10 # can handle that machine.  It does not imply ALL GNU software can.
11 #
12 # This file is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 2 of the License, or
15 # (at your option) any later version.
16 #
17 # This program is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write to the Free Software
24 # Foundation, Inc., 59 Temple Place - Suite 330,
25 # Boston, MA 02111-1307, USA.
26
27 # As a special exception to the GNU General Public License, if you
28 # distribute this file as part of a program that contains a
29 # configuration script generated by Autoconf, you may include it under
30 # the same distribution terms that you use for the rest of that program.
31
32 # Portions Copyright 1998-2002 OpenLDAP Foundation.
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 \
252         | pdp10 | pdp11 | pj | pjl \
253         | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
254         | pyramid \
255         | sh | sh[34] | sh[34]eb | shbe | shle \
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-* \
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         OSE68000 | ose68000)
724                 basic_machine=m68000-ericsson
725                 os=-ose
726                 ;;
727         os68k)
728                 basic_machine=m68k-none
729                 os=-os68k
730                 ;;
731         pa-hitachi)
732                 basic_machine=hppa1.1-hitachi
733                 os=-hiuxwe2
734                 ;;
735         paragon)
736                 basic_machine=i860-intel
737                 os=-osf
738                 ;;
739         pbd)
740                 basic_machine=sparc-tti
741                 ;;
742         pbb)
743                 basic_machine=m68k-tti
744                 ;;
745         pc532 | pc532-*)
746                 basic_machine=ns32k-pc532
747                 ;;
748         pentium | p5 | k5 | k6 | nexgen | viac3)
749                 basic_machine=i586-pc
750                 ;;
751         pentiumpro | p6 | 6x86 | athlon)
752                 basic_machine=i686-pc
753                 ;;
754         pentiumii | pentium2)
755                 basic_machine=i686-pc
756                 ;;
757         pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
758                 basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
759                 ;;
760         pentiumpro-* | p6-* | 6x86-* | athlon-*)
761                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
762                 ;;
763         pentiumii-* | pentium2-*)
764                 basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
765                 ;;
766         pn)
767                 basic_machine=pn-gould
768                 ;;
769         power)  basic_machine=power-ibm
770                 ;;
771         ppc)    basic_machine=powerpc-unknown
772                 ;;
773         ppc-*)  basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
774                 ;;
775         ppcle | powerpclittle | ppc-le | powerpc-little)
776                 basic_machine=powerpcle-unknown
777                 ;;
778         ppcle-* | powerpclittle-*)
779                 basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
780                 ;;
781         ppc64)  basic_machine=powerpc64-unknown
782                 ;;
783         ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
784                 ;;
785         ppc64le | powerpc64little | ppc64-le | powerpc64-little)
786                 basic_machine=powerpc64le-unknown
787                 ;;
788         ppc64le-* | powerpc64little-*)
789                 basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
790                 ;;
791         ps2)
792                 basic_machine=i386-ibm
793                 ;;
794         pw32)
795                 basic_machine=i586-unknown
796                 os=-pw32
797                 ;;
798         rom68k)
799                 basic_machine=m68k-rom68k
800                 os=-coff
801                 ;;
802         rm[46]00)
803                 basic_machine=mips-siemens
804                 ;;
805         rtpc | rtpc-*)
806                 basic_machine=romp-ibm
807                 ;;
808         s390 | s390-*)
809                 basic_machine=s390-ibm
810                 ;;
811         s390x | s390x-*)
812                 basic_machine=s390x-ibm
813                 ;;
814         sa29200)
815                 basic_machine=a29k-amd
816                 os=-udi
817                 ;;
818         sequent)
819                 basic_machine=i386-sequent
820                 ;;
821         sh)
822                 basic_machine=sh-hitachi
823                 os=-hms
824                 ;;
825         sparclite-wrs | simso-wrs)
826                 basic_machine=sparclite-wrs
827                 os=-vxworks
828                 ;;
829         sps7)
830                 basic_machine=m68k-bull
831                 os=-sysv2
832                 ;;
833         spur)
834                 basic_machine=spur-unknown
835                 ;;
836         st2000)
837                 basic_machine=m68k-tandem
838                 ;;
839         stratus)
840                 basic_machine=i860-stratus
841                 os=-sysv4
842                 ;;
843         sun2)
844                 basic_machine=m68000-sun
845                 ;;
846         sun2os3)
847                 basic_machine=m68000-sun
848                 os=-sunos3
849                 ;;
850         sun2os4)
851                 basic_machine=m68000-sun
852                 os=-sunos4
853                 ;;
854         sun3os3)
855                 basic_machine=m68k-sun
856                 os=-sunos3
857                 ;;
858         sun3os4)
859                 basic_machine=m68k-sun
860                 os=-sunos4
861                 ;;
862         sun4os3)
863                 basic_machine=sparc-sun
864                 os=-sunos3
865                 ;;
866         sun4os4)
867                 basic_machine=sparc-sun
868                 os=-sunos4
869                 ;;
870         sun4sol2)
871                 basic_machine=sparc-sun
872                 os=-solaris2
873                 ;;
874         sun3 | sun3-*)
875                 basic_machine=m68k-sun
876                 ;;
877         sun4)
878                 basic_machine=sparc-sun
879                 ;;
880         sun386 | sun386i | roadrunner)
881                 basic_machine=i386-sun
882                 ;;
883         sv1)
884                 basic_machine=sv1-cray
885                 os=-unicos
886                 ;;
887         symmetry)
888                 basic_machine=i386-sequent
889                 os=-dynix
890                 ;;
891         t3e)
892                 basic_machine=t3e-cray
893                 os=-unicos
894                 ;;
895         tic54x | c54x*)
896                 basic_machine=tic54x-unknown
897                 os=-coff
898                 ;;
899         tx39)
900                 basic_machine=mipstx39-unknown
901                 ;;
902         tx39el)
903                 basic_machine=mipstx39el-unknown
904                 ;;
905         toad1)
906                 basic_machine=pdp10-xkl
907                 os=-tops20
908                 ;;
909         tower | tower-32)
910                 basic_machine=m68k-ncr
911                 ;;
912         udi29k)
913                 basic_machine=a29k-amd
914                 os=-udi
915                 ;;
916         ultra3)
917                 basic_machine=a29k-nyu
918                 os=-sym1
919                 ;;
920         v810 | necv810)
921                 basic_machine=v810-nec
922                 os=-none
923                 ;;
924         vaxv)
925                 basic_machine=vax-dec
926                 os=-sysv
927                 ;;
928         vms)
929                 basic_machine=vax-dec
930                 os=-vms
931                 ;;
932         vpp*|vx|vx-*)
933                basic_machine=f301-fujitsu
934                ;;
935         vxworks960)
936                 basic_machine=i960-wrs
937                 os=-vxworks
938                 ;;
939         vxworks68)
940                 basic_machine=m68k-wrs
941                 os=-vxworks
942                 ;;
943         vxworks29k)
944                 basic_machine=a29k-wrs
945                 os=-vxworks
946                 ;;
947         w65*)
948                 basic_machine=w65-wdc
949                 os=-none
950                 ;;
951         w89k-*)
952                 basic_machine=hppa1.1-winbond
953                 os=-proelf
954                 ;;
955         windows32)
956                 basic_machine=i386-pc
957                 os=-windows32-msvcrt
958                 ;;
959         xmp)
960                 basic_machine=xmp-cray
961                 os=-unicos
962                 ;;
963         xps | xps100)
964                 basic_machine=xps100-honeywell
965                 ;;
966         z8k-*-coff)
967                 basic_machine=z8k-unknown
968                 os=-sim
969                 ;;
970         none)
971                 basic_machine=none-none
972                 os=-none
973                 ;;
974
975 # Here we handle the default manufacturer of certain CPU types.  It is in
976 # some cases the only manufacturer, in others, it is the most popular.
977         w89k)
978                 basic_machine=hppa1.1-winbond
979                 ;;
980         op50n)
981                 basic_machine=hppa1.1-oki
982                 ;;
983         op60c)
984                 basic_machine=hppa1.1-oki
985                 ;;
986         mips)
987                 if [ x$os = x-linux-gnu ]; then
988                         basic_machine=mips-unknown
989                 else
990                         basic_machine=mips-mips
991                 fi
992                 ;;
993         romp)
994                 basic_machine=romp-ibm
995                 ;;
996         rs6000)
997                 basic_machine=rs6000-ibm
998                 ;;
999         vax)
1000                 basic_machine=vax-dec
1001                 ;;
1002         pdp10)
1003                 # there are many clones, so DEC is not a safe bet
1004                 basic_machine=pdp10-unknown
1005                 ;;
1006         pdp11)
1007                 basic_machine=pdp11-dec
1008                 ;;
1009         we32k)
1010                 basic_machine=we32k-att
1011                 ;;
1012         sh3 | sh4 | sh3eb | sh4eb)
1013                 basic_machine=sh-unknown
1014                 ;;
1015         sparc | sparcv9 | sparcv9b)
1016                 basic_machine=sparc-sun
1017                 ;;
1018         cydra)
1019                 basic_machine=cydra-cydrome
1020                 ;;
1021         orion)
1022                 basic_machine=orion-highlevel
1023                 ;;
1024         orion105)
1025                 basic_machine=clipper-highlevel
1026                 ;;
1027         mac | mpw | mac-mpw)
1028                 basic_machine=m68k-apple
1029                 ;;
1030         pmac | pmac-mpw)
1031                 basic_machine=powerpc-apple
1032                 ;;
1033         c4x*)
1034                 basic_machine=c4x-none
1035                 os=-coff
1036                 ;;
1037         *-unknown)
1038                 # Make sure to match an already-canonicalized machine name.
1039                 ;;
1040         *)
1041                 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1042                 exit 1
1043                 ;;
1044 esac
1045
1046 # Here we canonicalize certain aliases for manufacturers.
1047 case $basic_machine in
1048         *-digital*)
1049                 basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1050                 ;;
1051         *-commodore*)
1052                 basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1053                 ;;
1054         *)
1055                 ;;
1056 esac
1057
1058 # Decode manufacturer-specific aliases for certain operating systems.
1059
1060 if [ x"$os" != x"" ]
1061 then
1062 case $os in
1063         # First match some system type aliases
1064         # that might get confused with valid system types.
1065         # -solaris* is a basic system type, with this one exception.
1066         -solaris1 | -solaris1.*)
1067                 os=`echo $os | sed -e 's|solaris1|sunos4|'`
1068                 ;;
1069         -solaris)
1070                 os=-solaris2
1071                 ;;
1072         -svr4*)
1073                 os=-sysv4
1074                 ;;
1075         -unixware*)
1076                 os=-sysv4.2uw
1077                 ;;
1078         -gnu/linux*)
1079                 os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1080                 ;;
1081         # First accept the basic system types.
1082         # The portable systems comes first.
1083         # Each alternative MUST END IN A *, to match a version number.
1084         # -sysv* is not here because it comes later, after sysvr4.
1085         -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1086               | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1087               | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1088               | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1089               | -aos* \
1090               | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1091               | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1092               | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
1093               | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1094               | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1095               | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1096               | -chorusos* | -chorusrdb* \
1097               | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1098               | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
1099               | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
1100               | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1101               | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1102               | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* | -morphos*)
1103         # Remember, each alternative MUST END IN *, to match a version number.
1104                 ;;
1105         -qnx*)
1106                 case $basic_machine in
1107                     x86-* | i*86-*)
1108                         ;;
1109                     *)
1110                         os=-nto$os
1111                         ;;
1112                 esac
1113                 ;;
1114         -nto*)
1115                 os=-nto-qnx
1116                 ;;
1117         -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1118               | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
1119               | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1120                 ;;
1121         -mac*)
1122                 os=`echo $os | sed -e 's|mac|macos|'`
1123                 ;;
1124         -linux*)
1125                 os=`echo $os | sed -e 's|linux|linux-gnu|'`
1126                 ;;
1127         -sunos5*)
1128                 os=`echo $os | sed -e 's|sunos5|solaris2|'`
1129                 ;;
1130         -sunos6*)
1131                 os=`echo $os | sed -e 's|sunos6|solaris3|'`
1132                 ;;
1133         -opened*)
1134                 os=-openedition
1135                 ;;
1136         -wince*)
1137                 os=-wince
1138                 ;;
1139         -osfrose*)
1140                 os=-osfrose
1141                 ;;
1142         -osf*)
1143                 os=-osf
1144                 ;;
1145         -utek*)
1146                 os=-bsd
1147                 ;;
1148         -dynix*)
1149                 os=-bsd
1150                 ;;
1151         -acis*)
1152                 os=-aos
1153                 ;;
1154         -atheos*)
1155                 os=-atheos
1156                 ;;
1157         -386bsd)
1158                 os=-bsd
1159                 ;;
1160         -ctix* | -uts*)
1161                 os=-sysv
1162                 ;;
1163         -ns2 )
1164                 os=-nextstep2
1165                 ;;
1166         -nsk*)
1167                 os=-nsk
1168                 ;;
1169         # Preserve the version number of sinix5.
1170         -sinix5.*)
1171                 os=`echo $os | sed -e 's|sinix|sysv|'`
1172                 ;;
1173         -sinix*)
1174                 os=-sysv4
1175                 ;;
1176         -triton*)
1177                 os=-sysv3
1178                 ;;
1179         -oss*)
1180                 os=-sysv3
1181                 ;;
1182         -svr4)
1183                 os=-sysv4
1184                 ;;
1185         -svr3)
1186                 os=-sysv3
1187                 ;;
1188         -sysvr4)
1189                 os=-sysv4
1190                 ;;
1191         # This must come after -sysvr4.
1192         -sysv*)
1193                 ;;
1194         -ose*)
1195                 os=-ose
1196                 ;;
1197         -es1800*)
1198                 os=-ose
1199                 ;;
1200         -xenix)
1201                 os=-xenix
1202                 ;;
1203         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1204                 os=-mint
1205                 ;;
1206         -none)
1207                 ;;
1208         *)
1209                 # Get rid of the `-' at the beginning of $os.
1210                 os=`echo $os | sed 's/[^-]*-//'`
1211                 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1212                 exit 1
1213                 ;;
1214 esac
1215 else
1216
1217 # Here we handle the default operating systems that come with various machines.
1218 # The value should be what the vendor currently ships out the door with their
1219 # machine or put another way, the most popular os provided with the machine.
1220
1221 # Note that if you're going to try to match "-MANUFACTURER" here (say,
1222 # "-sun"), then you have to tell the case statement up towards the top
1223 # that MANUFACTURER isn't an operating system.  Otherwise, code above
1224 # will signal an error saying that MANUFACTURER isn't an operating
1225 # system, and we'll never get to this point.
1226
1227 case $basic_machine in
1228         *-acorn)
1229                 os=-riscix1.2
1230                 ;;
1231         arm*-rebel)
1232                 os=-linux
1233                 ;;
1234         arm*-semi)
1235                 os=-aout
1236                 ;;
1237         # This must come before the *-dec entry.
1238         pdp10-*)
1239                 os=-tops20
1240                 ;;
1241         pdp11-*)
1242                 os=-none
1243                 ;;
1244         *-dec | vax-*)
1245                 os=-ultrix4.2
1246                 ;;
1247         m68*-apollo)
1248                 os=-domain
1249                 ;;
1250         i386-sun)
1251                 os=-sunos4.0.2
1252                 ;;
1253         m68000-sun)
1254                 os=-sunos3
1255                 # This also exists in the configure program, but was not the
1256                 # default.
1257                 # os=-sunos4
1258                 ;;
1259         m68*-cisco)
1260                 os=-aout
1261                 ;;
1262         mips*-cisco)
1263                 os=-elf
1264                 ;;
1265         mips*-*)
1266                 os=-elf
1267                 ;;
1268         *-tti)  # must be before sparc entry or we get the wrong os.
1269                 os=-sysv3
1270                 ;;
1271         sparc-* | *-sun)
1272                 os=-sunos4.1.1
1273                 ;;
1274         *-be)
1275                 os=-beos
1276                 ;;
1277         *-ibm)
1278                 os=-aix
1279                 ;;
1280         *-wec)
1281                 os=-proelf
1282                 ;;
1283         *-winbond)
1284                 os=-proelf
1285                 ;;
1286         *-oki)
1287                 os=-proelf
1288                 ;;
1289         *-hp)
1290                 os=-hpux
1291                 ;;
1292         *-hitachi)
1293                 os=-hiux
1294                 ;;
1295         i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1296                 os=-sysv
1297                 ;;
1298         *-cbm)
1299                 os=-amigaos
1300                 ;;
1301         *-dg)
1302                 os=-dgux
1303                 ;;
1304         *-dolphin)
1305                 os=-sysv3
1306                 ;;
1307         m68k-ccur)
1308                 os=-rtu
1309                 ;;
1310         m88k-omron*)
1311                 os=-luna
1312                 ;;
1313         *-next )
1314                 os=-nextstep
1315                 ;;
1316         *-sequent)
1317                 os=-ptx
1318                 ;;
1319         *-crds)
1320                 os=-unos
1321                 ;;
1322         *-ns)
1323                 os=-genix
1324                 ;;
1325         i370-*)
1326                 os=-mvs
1327                 ;;
1328         *-next)
1329                 os=-nextstep3
1330                 ;;
1331         *-gould)
1332                 os=-sysv
1333                 ;;
1334         *-highlevel)
1335                 os=-bsd
1336                 ;;
1337         *-encore)
1338                 os=-bsd
1339                 ;;
1340         *-sgi)
1341                 os=-irix
1342                 ;;
1343         *-siemens)
1344                 os=-sysv4
1345                 ;;
1346         *-masscomp)
1347                 os=-rtu
1348                 ;;
1349         f30[01]-fujitsu | f700-fujitsu)
1350                 os=-uxpv
1351                 ;;
1352         *-rom68k)
1353                 os=-coff
1354                 ;;
1355         *-*bug)
1356                 os=-coff
1357                 ;;
1358         *-apple)
1359                 os=-macos
1360                 ;;
1361         *-atari*)
1362                 os=-mint
1363                 ;;
1364         *)
1365                 os=-none
1366                 ;;
1367 esac
1368 fi
1369
1370 # Here we handle the case where we know the os, and the CPU type, but not the
1371 # manufacturer.  We pick the logical manufacturer.
1372 vendor=unknown
1373 case $basic_machine in
1374         *-unknown)
1375                 case $os in
1376                         -riscix*)
1377                                 vendor=acorn
1378                                 ;;
1379                         -sunos*)
1380                                 vendor=sun
1381                                 ;;
1382                         -aix*)
1383                                 vendor=ibm
1384                                 ;;
1385                         -beos*)
1386                                 vendor=be
1387                                 ;;
1388                         -hpux*)
1389                                 vendor=hp
1390                                 ;;
1391                         -mpeix*)
1392                                 vendor=hp
1393                                 ;;
1394                         -hiux*)
1395                                 vendor=hitachi
1396                                 ;;
1397                         -unos*)
1398                                 vendor=crds
1399                                 ;;
1400                         -dgux*)
1401                                 vendor=dg
1402                                 ;;
1403                         -luna*)
1404                                 vendor=omron
1405                                 ;;
1406                         -genix*)
1407                                 vendor=ns
1408                                 ;;
1409                         -mvs* | -opened*)
1410                                 vendor=ibm
1411                                 ;;
1412                         -ptx*)
1413                                 vendor=sequent
1414                                 ;;
1415                         -vxsim* | -vxworks*)
1416                                 vendor=wrs
1417                                 ;;
1418                         -aux*)
1419                                 vendor=apple
1420                                 ;;
1421                         -hms*)
1422                                 vendor=hitachi
1423                                 ;;
1424                         -mpw* | -macos*)
1425                                 vendor=apple
1426                                 ;;
1427                         -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1428                                 vendor=atari
1429                                 ;;
1430                         -vos*)
1431                                 vendor=stratus
1432                                 ;;
1433                 esac
1434                 basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1435                 ;;
1436 esac
1437
1438 echo $basic_machine$os
1439 exit 0
1440
1441 # Local variables:
1442 # eval: (add-hook 'write-file-hooks 'time-stamp)
1443 # time-stamp-start: "timestamp='"
1444 # time-stamp-format: "%:y-%02m-%02d"
1445 # time-stamp-end: "'"
1446 # End: