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