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