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