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