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