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