build-scripts/config.sub
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 06 Dec 2014 00:17:52 +0100
changeset 9267 6fe4583d7e1f
parent 8984 bbc802ae0ada
child 9278 8900afb78a19
permissions -rw-r--r--
Fixed warnings about possible loss of data in conversion.
     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-08-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@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@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-android* | linux-dietlibc | linux-newlib* | \
   126   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   127   knetbsd*-gnu* | netbsd*-gnu* | \
   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 | v70 | w65 | z8k)
   336 		;;
   337 	ms1)
   338 		basic_machine=mt-unknown
   339 		;;
   340 
   341 	strongarm | thumb | xscale)
   342 		basic_machine=arm-unknown
   343 		;;
   344 	xgate)
   345 		basic_machine=$basic_machine-unknown
   346 		os=-none
   347 		;;
   348 	xscaleeb)
   349 		basic_machine=armeb-unknown
   350 		;;
   351 
   352 	xscaleel)
   353 		basic_machine=armel-unknown
   354 		;;
   355 
   356 	# We use `pc' rather than `unknown'
   357 	# because (1) that's what they normally are, and
   358 	# (2) the word "unknown" tends to confuse beginning users.
   359 	i*86 | x86_64)
   360 	  basic_machine=$basic_machine-pc
   361 	  ;;
   362 	nacl64*)
   363 		basic_machine=x86_64-pc
   364 		os=-nacl
   365 		;;
   366 	nacl*)
   367 		basic_machine=i686-pc
   368 		os=-nacl
   369 		;;
   370 	pnacl*)
   371 		# le32-unknown-pnacl comes from http://www.chromium.org/nativeclient/pnacl/stability-of-the-pnacl-bitcode-abi
   372 		basic_machine=le32-unknown
   373 		os=-pnacl
   374 		;;
   375 	# Object if more than one company name word.
   376 	*-*-*)
   377 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
   378 		exit 1
   379 		;;
   380 	# Recognize the basic CPU types with company name.
   381 	580-* \
   382 	| a29k-* \
   383 	| aarch64-* | aarch64_be-* \
   384 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
   385 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
   386 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
   387 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
   388 	| avr-* | avr32-* \
   389 	| be32-* | be64-* \
   390 	| bfin-* | bs2000-* \
   391 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
   392 	| clipper-* | craynv-* | cydra-* \
   393 	| d10v-* | d30v-* | dlx-* \
   394 	| elxsi-* \
   395 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
   396 	| h8300-* | h8500-* \
   397 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
   398 	| hexagon-* \
   399 	| i*86-* | i860-* | i960-* | ia64-* \
   400 	| ip2k-* | iq2000-* \
   401 	| le32-* | le64-* \
   402 	| lm32-* \
   403 	| m32c-* | m32r-* | m32rle-* \
   404 	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
   405 	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
   406 	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
   407 	| mips16-* \
   408 	| mips64-* | mips64el-* \
   409 	| mips64octeon-* | mips64octeonel-* \
   410 	| mips64orion-* | mips64orionel-* \
   411 	| mips64r5900-* | mips64r5900el-* \
   412 	| mips64vr-* | mips64vrel-* \
   413 	| mips64vr4100-* | mips64vr4100el-* \
   414 	| mips64vr4300-* | mips64vr4300el-* \
   415 	| mips64vr5000-* | mips64vr5000el-* \
   416 	| mips64vr5900-* | mips64vr5900el-* \
   417 	| mipsisa32-* | mipsisa32el-* \
   418 	| mipsisa32r2-* | mipsisa32r2el-* \
   419 	| mipsisa64-* | mipsisa64el-* \
   420 	| mipsisa64r2-* | mipsisa64r2el-* \
   421 	| mipsisa64sb1-* | mipsisa64sb1el-* \
   422 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
   423 	| mipstx39-* | mipstx39el-* \
   424 	| mmix-* \
   425 	| mt-* \
   426 	| msp430-* \
   427 	| nds32-* | nds32le-* | nds32be-* \
   428 	| nios-* | nios2-* \
   429 	| none-* | np1-* | ns16k-* | ns32k-* \
   430 	| open8-* \
   431 	| orion-* \
   432 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
   433 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
   434 	| pyramid-* \
   435 	| rl78-* | romp-* | rs6000-* | rx-* \
   436 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
   437 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
   438 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
   439 	| sparclite-* \
   440 	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
   441 	| tahoe-* \
   442 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
   443 	| tile*-* \
   444 	| tron-* \
   445 	| ubicom32-* \
   446 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
   447 	| vax-* \
   448 	| we32k-* \
   449 	| x86-* | x86_64-* | xc16x-* | xps100-* \
   450 	| xstormy16-* | xtensa*-* \
   451 	| ymp-* \
   452 	| z8k-* | z80-*)
   453 		;;
   454 	# Recognize the basic CPU types without company name, with glob match.
   455 	xtensa*)
   456 		basic_machine=$basic_machine-unknown
   457 		;;
   458 	# Recognize the various machine names and aliases which stand
   459 	# for a CPU type and a company and sometimes even an OS.
   460 	386bsd)
   461 		basic_machine=i386-unknown
   462 		os=-bsd
   463 		;;
   464 	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
   465 		basic_machine=m68000-att
   466 		;;
   467 	3b*)
   468 		basic_machine=we32k-att
   469 		;;
   470 	a29khif)
   471 		basic_machine=a29k-amd
   472 		os=-udi
   473 		;;
   474 	abacus)
   475 		basic_machine=abacus-unknown
   476 		;;
   477 	adobe68k)
   478 		basic_machine=m68010-adobe
   479 		os=-scout
   480 		;;
   481 	alliant | fx80)
   482 		basic_machine=fx80-alliant
   483 		;;
   484 	altos | altos3068)
   485 		basic_machine=m68k-altos
   486 		;;
   487 	am29k)
   488 		basic_machine=a29k-none
   489 		os=-bsd
   490 		;;
   491 	amd64)
   492 		basic_machine=x86_64-pc
   493 		;;
   494 	amd64-*)
   495 		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
   496 		;;
   497 	amdahl)
   498 		basic_machine=580-amdahl
   499 		os=-sysv
   500 		;;
   501 	amiga | amiga-*)
   502 		basic_machine=m68k-unknown
   503 		;;
   504 	amigaos | amigados)
   505 		basic_machine=m68k-unknown
   506 		os=-amigaos
   507 		;;
   508 	amigaunix | amix)
   509 		basic_machine=m68k-unknown
   510 		os=-sysv4
   511 		;;
   512 	apollo68)
   513 		basic_machine=m68k-apollo
   514 		os=-sysv
   515 		;;
   516 	apollo68bsd)
   517 		basic_machine=m68k-apollo
   518 		os=-bsd
   519 		;;
   520 	aros)
   521 		basic_machine=i386-pc
   522 		os=-aros
   523 		;;
   524 	aux)
   525 		basic_machine=m68k-apple
   526 		os=-aux
   527 		;;
   528 	balance)
   529 		basic_machine=ns32k-sequent
   530 		os=-dynix
   531 		;;
   532 	blackfin)
   533 		basic_machine=bfin-unknown
   534 		os=-linux
   535 		;;
   536 	blackfin-*)
   537 		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
   538 		os=-linux
   539 		;;
   540 	bluegene*)
   541 		basic_machine=powerpc-ibm
   542 		os=-cnk
   543 		;;
   544 	c54x-*)
   545 		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
   546 		;;
   547 	c55x-*)
   548 		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
   549 		;;
   550 	c6x-*)
   551 		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
   552 		;;
   553 	c90)
   554 		basic_machine=c90-cray
   555 		os=-unicos
   556 		;;
   557 	cegcc)
   558 		basic_machine=arm-unknown
   559 		os=-cegcc
   560 		;;
   561 	convex-c1)
   562 		basic_machine=c1-convex
   563 		os=-bsd
   564 		;;
   565 	convex-c2)
   566 		basic_machine=c2-convex
   567 		os=-bsd
   568 		;;
   569 	convex-c32)
   570 		basic_machine=c32-convex
   571 		os=-bsd
   572 		;;
   573 	convex-c34)
   574 		basic_machine=c34-convex
   575 		os=-bsd
   576 		;;
   577 	convex-c38)
   578 		basic_machine=c38-convex
   579 		os=-bsd
   580 		;;
   581 	cray | j90)
   582 		basic_machine=j90-cray
   583 		os=-unicos
   584 		;;
   585 	craynv)
   586 		basic_machine=craynv-cray
   587 		os=-unicosmp
   588 		;;
   589 	cr16 | cr16-*)
   590 		basic_machine=cr16-unknown
   591 		os=-elf
   592 		;;
   593 	crds | unos)
   594 		basic_machine=m68k-crds
   595 		;;
   596 	crisv32 | crisv32-* | etraxfs*)
   597 		basic_machine=crisv32-axis
   598 		;;
   599 	cris | cris-* | etrax*)
   600 		basic_machine=cris-axis
   601 		;;
   602 	crx)
   603 		basic_machine=crx-unknown
   604 		os=-elf
   605 		;;
   606 	da30 | da30-*)
   607 		basic_machine=m68k-da30
   608 		;;
   609 	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
   610 		basic_machine=mips-dec
   611 		;;
   612 	decsystem10* | dec10*)
   613 		basic_machine=pdp10-dec
   614 		os=-tops10
   615 		;;
   616 	decsystem20* | dec20*)
   617 		basic_machine=pdp10-dec
   618 		os=-tops20
   619 		;;
   620 	delta | 3300 | motorola-3300 | motorola-delta \
   621 	      | 3300-motorola | delta-motorola)
   622 		basic_machine=m68k-motorola
   623 		;;
   624 	delta88)
   625 		basic_machine=m88k-motorola
   626 		os=-sysv3
   627 		;;
   628 	dicos)
   629 		basic_machine=i686-pc
   630 		os=-dicos
   631 		;;
   632 	djgpp)
   633 		basic_machine=i586-pc
   634 		os=-msdosdjgpp
   635 		;;
   636 	dpx20 | dpx20-*)
   637 		basic_machine=rs6000-bull
   638 		os=-bosx
   639 		;;
   640 	dpx2* | dpx2*-bull)
   641 		basic_machine=m68k-bull
   642 		os=-sysv3
   643 		;;
   644 	ebmon29k)
   645 		basic_machine=a29k-amd
   646 		os=-ebmon
   647 		;;
   648 	elxsi)
   649 		basic_machine=elxsi-elxsi
   650 		os=-bsd
   651 		;;
   652 	encore | umax | mmax)
   653 		basic_machine=ns32k-encore
   654 		;;
   655 	es1800 | OSE68k | ose68k | ose | OSE)
   656 		basic_machine=m68k-ericsson
   657 		os=-ose
   658 		;;
   659 	fx2800)
   660 		basic_machine=i860-alliant
   661 		;;
   662 	genix)
   663 		basic_machine=ns32k-ns
   664 		;;
   665 	gmicro)
   666 		basic_machine=tron-gmicro
   667 		os=-sysv
   668 		;;
   669 	go32)
   670 		basic_machine=i386-pc
   671 		os=-go32
   672 		;;
   673 	h3050r* | hiux*)
   674 		basic_machine=hppa1.1-hitachi
   675 		os=-hiuxwe2
   676 		;;
   677 	h8300hms)
   678 		basic_machine=h8300-hitachi
   679 		os=-hms
   680 		;;
   681 	h8300xray)
   682 		basic_machine=h8300-hitachi
   683 		os=-xray
   684 		;;
   685 	h8500hms)
   686 		basic_machine=h8500-hitachi
   687 		os=-hms
   688 		;;
   689 	harris)
   690 		basic_machine=m88k-harris
   691 		os=-sysv3
   692 		;;
   693 	hp300-*)
   694 		basic_machine=m68k-hp
   695 		;;
   696 	hp300bsd)
   697 		basic_machine=m68k-hp
   698 		os=-bsd
   699 		;;
   700 	hp300hpux)
   701 		basic_machine=m68k-hp
   702 		os=-hpux
   703 		;;
   704 	hp3k9[0-9][0-9] | hp9[0-9][0-9])
   705 		basic_machine=hppa1.0-hp
   706 		;;
   707 	hp9k2[0-9][0-9] | hp9k31[0-9])
   708 		basic_machine=m68000-hp
   709 		;;
   710 	hp9k3[2-9][0-9])
   711 		basic_machine=m68k-hp
   712 		;;
   713 	hp9k6[0-9][0-9] | hp6[0-9][0-9])
   714 		basic_machine=hppa1.0-hp
   715 		;;
   716 	hp9k7[0-79][0-9] | hp7[0-79][0-9])
   717 		basic_machine=hppa1.1-hp
   718 		;;
   719 	hp9k78[0-9] | hp78[0-9])
   720 		# FIXME: really hppa2.0-hp
   721 		basic_machine=hppa1.1-hp
   722 		;;
   723 	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
   724 		# FIXME: really hppa2.0-hp
   725 		basic_machine=hppa1.1-hp
   726 		;;
   727 	hp9k8[0-9][13679] | hp8[0-9][13679])
   728 		basic_machine=hppa1.1-hp
   729 		;;
   730 	hp9k8[0-9][0-9] | hp8[0-9][0-9])
   731 		basic_machine=hppa1.0-hp
   732 		;;
   733 	hppa-next)
   734 		os=-nextstep3
   735 		;;
   736 	hppaosf)
   737 		basic_machine=hppa1.1-hp
   738 		os=-osf
   739 		;;
   740 	hppro)
   741 		basic_machine=hppa1.1-hp
   742 		os=-proelf
   743 		;;
   744 	i370-ibm* | ibm*)
   745 		basic_machine=i370-ibm
   746 		;;
   747 	i*86v32)
   748 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
   749 		os=-sysv32
   750 		;;
   751 	i*86v4*)
   752 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
   753 		os=-sysv4
   754 		;;
   755 	i*86v)
   756 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
   757 		os=-sysv
   758 		;;
   759 	i*86sol2)
   760 		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
   761 		os=-solaris2
   762 		;;
   763 	i386mach)
   764 		basic_machine=i386-mach
   765 		os=-mach
   766 		;;
   767 	i386-vsta | vsta)
   768 		basic_machine=i386-unknown
   769 		os=-vsta
   770 		;;
   771 	iris | iris4d)
   772 		basic_machine=mips-sgi
   773 		case $os in
   774 		    -irix*)
   775 			;;
   776 		    *)
   777 			os=-irix4
   778 			;;
   779 		esac
   780 		;;
   781 	isi68 | isi)
   782 		basic_machine=m68k-isi
   783 		os=-sysv
   784 		;;
   785 	m68knommu)
   786 		basic_machine=m68k-unknown
   787 		os=-linux
   788 		;;
   789 	m68knommu-*)
   790 		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
   791 		os=-linux
   792 		;;
   793 	m88k-omron*)
   794 		basic_machine=m88k-omron
   795 		;;
   796 	magnum | m3230)
   797 		basic_machine=mips-mips
   798 		os=-sysv
   799 		;;
   800 	merlin)
   801 		basic_machine=ns32k-utek
   802 		os=-sysv
   803 		;;
   804 	microblaze)
   805 		basic_machine=microblaze-xilinx
   806 		;;
   807 	mingw64)
   808 		basic_machine=x86_64-pc
   809 		os=-mingw64
   810 		;;
   811 	mingw32)
   812 		basic_machine=i386-pc
   813 		os=-mingw32
   814 		;;
   815 	mingw32ce)
   816 		basic_machine=arm-unknown
   817 		os=-mingw32ce
   818 		;;
   819 	miniframe)
   820 		basic_machine=m68000-convergent
   821 		;;
   822 	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
   823 		basic_machine=m68k-atari
   824 		os=-mint
   825 		;;
   826 	mips3*-*)
   827 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
   828 		;;
   829 	mips3*)
   830 		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
   831 		;;
   832 	monitor)
   833 		basic_machine=m68k-rom68k
   834 		os=-coff
   835 		;;
   836 	morphos)
   837 		basic_machine=powerpc-unknown
   838 		os=-morphos
   839 		;;
   840 	msdos)
   841 		basic_machine=i386-pc
   842 		os=-msdos
   843 		;;
   844 	ms1-*)
   845 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
   846 		;;
   847 	msys)
   848 		basic_machine=i386-pc
   849 		os=-msys
   850 		;;
   851 	mvs)
   852 		basic_machine=i370-ibm
   853 		os=-mvs
   854 		;;
   855 	nacl)
   856 		basic_machine=le32-unknown
   857 		os=-nacl
   858 		;;
   859 	pnacl)
   860 		basic_machine=le32-unknown
   861 		os=-pnacl
   862 		;;
   863 	ncr3000)
   864 		basic_machine=i486-ncr
   865 		os=-sysv4
   866 		;;
   867 	netbsd386)
   868 		basic_machine=i386-unknown
   869 		os=-netbsd
   870 		;;
   871 	netwinder)
   872 		basic_machine=armv4l-rebel
   873 		os=-linux
   874 		;;
   875 	news | news700 | news800 | news900)
   876 		basic_machine=m68k-sony
   877 		os=-newsos
   878 		;;
   879 	news1000)
   880 		basic_machine=m68030-sony
   881 		os=-newsos
   882 		;;
   883 	news-3600 | risc-news)
   884 		basic_machine=mips-sony
   885 		os=-newsos
   886 		;;
   887 	necv70)
   888 		basic_machine=v70-nec
   889 		os=-sysv
   890 		;;
   891 	next | m*-next )
   892 		basic_machine=m68k-next
   893 		case $os in
   894 		    -nextstep* )
   895 			;;
   896 		    -ns2*)
   897 		      os=-nextstep2
   898 			;;
   899 		    *)
   900 		      os=-nextstep3
   901 			;;
   902 		esac
   903 		;;
   904 	nh3000)
   905 		basic_machine=m68k-harris
   906 		os=-cxux
   907 		;;
   908 	nh[45]000)
   909 		basic_machine=m88k-harris
   910 		os=-cxux
   911 		;;
   912 	nindy960)
   913 		basic_machine=i960-intel
   914 		os=-nindy
   915 		;;
   916 	mon960)
   917 		basic_machine=i960-intel
   918 		os=-mon960
   919 		;;
   920 	nonstopux)
   921 		basic_machine=mips-compaq
   922 		os=-nonstopux
   923 		;;
   924 	np1)
   925 		basic_machine=np1-gould
   926 		;;
   927 	neo-tandem)
   928 		basic_machine=neo-tandem
   929 		;;
   930 	nse-tandem)
   931 		basic_machine=nse-tandem
   932 		;;
   933 	nsr-tandem)
   934 		basic_machine=nsr-tandem
   935 		;;
   936 	op50n-* | op60c-*)
   937 		basic_machine=hppa1.1-oki
   938 		os=-proelf
   939 		;;
   940 	openrisc | openrisc-*)
   941 		basic_machine=or32-unknown
   942 		;;
   943 	os400)
   944 		basic_machine=powerpc-ibm
   945 		os=-os400
   946 		;;
   947 	OSE68000 | ose68000)
   948 		basic_machine=m68000-ericsson
   949 		os=-ose
   950 		;;
   951 	os68k)
   952 		basic_machine=m68k-none
   953 		os=-os68k
   954 		;;
   955 	pa-hitachi)
   956 		basic_machine=hppa1.1-hitachi
   957 		os=-hiuxwe2
   958 		;;
   959 	paragon)
   960 		basic_machine=i860-intel
   961 		os=-osf
   962 		;;
   963 	parisc)
   964 		basic_machine=hppa-unknown
   965 		os=-linux
   966 		;;
   967 	parisc-*)
   968 		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
   969 		os=-linux
   970 		;;
   971 	pbd)
   972 		basic_machine=sparc-tti
   973 		;;
   974 	pbb)
   975 		basic_machine=m68k-tti
   976 		;;
   977 	pc532 | pc532-*)
   978 		basic_machine=ns32k-pc532
   979 		;;
   980 	pc98)
   981 		basic_machine=i386-pc
   982 		;;
   983 	pc98-*)
   984 		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
   985 		;;
   986 	pentium | p5 | k5 | k6 | nexgen | viac3)
   987 		basic_machine=i586-pc
   988 		;;
   989 	pentiumpro | p6 | 6x86 | athlon | athlon_*)
   990 		basic_machine=i686-pc
   991 		;;
   992 	pentiumii | pentium2 | pentiumiii | pentium3)
   993 		basic_machine=i686-pc
   994 		;;
   995 	pentium4)
   996 		basic_machine=i786-pc
   997 		;;
   998 	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
   999 		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
  1000 		;;
  1001 	pentiumpro-* | p6-* | 6x86-* | athlon-*)
  1002 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  1003 		;;
  1004 	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
  1005 		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  1006 		;;
  1007 	pentium4-*)
  1008 		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
  1009 		;;
  1010 	pn)
  1011 		basic_machine=pn-gould
  1012 		;;
  1013 	power)	basic_machine=power-ibm
  1014 		;;
  1015 	ppc | ppcbe)	basic_machine=powerpc-unknown
  1016 		;;
  1017 	ppc-* | ppcbe-*)
  1018 		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
  1019 		;;
  1020 	ppcle | powerpclittle | ppc-le | powerpc-little)
  1021 		basic_machine=powerpcle-unknown
  1022 		;;
  1023 	ppcle-* | powerpclittle-*)
  1024 		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
  1025 		;;
  1026 	ppc64)	basic_machine=powerpc64-unknown
  1027 		;;
  1028 	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
  1029 		;;
  1030 	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
  1031 		basic_machine=powerpc64le-unknown
  1032 		;;
  1033 	ppc64le-* | powerpc64little-*)
  1034 		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
  1035 		;;
  1036 	ps2)
  1037 		basic_machine=i386-ibm
  1038 		;;
  1039 	pw32)
  1040 		basic_machine=i586-unknown
  1041 		os=-pw32
  1042 		;;
  1043 	rdos)
  1044 		basic_machine=i386-pc
  1045 		os=-rdos
  1046 		;;
  1047 	rom68k)
  1048 		basic_machine=m68k-rom68k
  1049 		os=-coff
  1050 		;;
  1051 	rm[46]00)
  1052 		basic_machine=mips-siemens
  1053 		;;
  1054 	rtpc | rtpc-*)
  1055 		basic_machine=romp-ibm
  1056 		;;
  1057 	s390 | s390-*)
  1058 		basic_machine=s390-ibm
  1059 		;;
  1060 	s390x | s390x-*)
  1061 		basic_machine=s390x-ibm
  1062 		;;
  1063 	sa29200)
  1064 		basic_machine=a29k-amd
  1065 		os=-udi
  1066 		;;
  1067 	sb1)
  1068 		basic_machine=mipsisa64sb1-unknown
  1069 		;;
  1070 	sb1el)
  1071 		basic_machine=mipsisa64sb1el-unknown
  1072 		;;
  1073 	sde)
  1074 		basic_machine=mipsisa32-sde
  1075 		os=-elf
  1076 		;;
  1077 	sei)
  1078 		basic_machine=mips-sei
  1079 		os=-seiux
  1080 		;;
  1081 	sequent)
  1082 		basic_machine=i386-sequent
  1083 		;;
  1084 	sh)
  1085 		basic_machine=sh-hitachi
  1086 		os=-hms
  1087 		;;
  1088 	sh5el)
  1089 		basic_machine=sh5le-unknown
  1090 		;;
  1091 	sh64)
  1092 		basic_machine=sh64-unknown
  1093 		;;
  1094 	sparclite-wrs | simso-wrs)
  1095 		basic_machine=sparclite-wrs
  1096 		os=-vxworks
  1097 		;;
  1098 	sps7)
  1099 		basic_machine=m68k-bull
  1100 		os=-sysv2
  1101 		;;
  1102 	spur)
  1103 		basic_machine=spur-unknown
  1104 		;;
  1105 	st2000)
  1106 		basic_machine=m68k-tandem
  1107 		;;
  1108 	stratus)
  1109 		basic_machine=i860-stratus
  1110 		os=-sysv4
  1111 		;;
  1112 	strongarm-* | thumb-*)
  1113 		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
  1114 		;;
  1115 	sun2)
  1116 		basic_machine=m68000-sun
  1117 		;;
  1118 	sun2os3)
  1119 		basic_machine=m68000-sun
  1120 		os=-sunos3
  1121 		;;
  1122 	sun2os4)
  1123 		basic_machine=m68000-sun
  1124 		os=-sunos4
  1125 		;;
  1126 	sun3os3)
  1127 		basic_machine=m68k-sun
  1128 		os=-sunos3
  1129 		;;
  1130 	sun3os4)
  1131 		basic_machine=m68k-sun
  1132 		os=-sunos4
  1133 		;;
  1134 	sun4os3)
  1135 		basic_machine=sparc-sun
  1136 		os=-sunos3
  1137 		;;
  1138 	sun4os4)
  1139 		basic_machine=sparc-sun
  1140 		os=-sunos4
  1141 		;;
  1142 	sun4sol2)
  1143 		basic_machine=sparc-sun
  1144 		os=-solaris2
  1145 		;;
  1146 	sun3 | sun3-*)
  1147 		basic_machine=m68k-sun
  1148 		;;
  1149 	sun4)
  1150 		basic_machine=sparc-sun
  1151 		;;
  1152 	sun386 | sun386i | roadrunner)
  1153 		basic_machine=i386-sun
  1154 		;;
  1155 	sv1)
  1156 		basic_machine=sv1-cray
  1157 		os=-unicos
  1158 		;;
  1159 	symmetry)
  1160 		basic_machine=i386-sequent
  1161 		os=-dynix
  1162 		;;
  1163 	t3e)
  1164 		basic_machine=alphaev5-cray
  1165 		os=-unicos
  1166 		;;
  1167 	t90)
  1168 		basic_machine=t90-cray
  1169 		os=-unicos
  1170 		;;
  1171 	tile*)
  1172 		basic_machine=$basic_machine-unknown
  1173 		os=-linux-gnu
  1174 		;;
  1175 	tx39)
  1176 		basic_machine=mipstx39-unknown
  1177 		;;
  1178 	tx39el)
  1179 		basic_machine=mipstx39el-unknown
  1180 		;;
  1181 	toad1)
  1182 		basic_machine=pdp10-xkl
  1183 		os=-tops20
  1184 		;;
  1185 	tower | tower-32)
  1186 		basic_machine=m68k-ncr
  1187 		;;
  1188 	tpf)
  1189 		basic_machine=s390x-ibm
  1190 		os=-tpf
  1191 		;;
  1192 	udi29k)
  1193 		basic_machine=a29k-amd
  1194 		os=-udi
  1195 		;;
  1196 	ultra3)
  1197 		basic_machine=a29k-nyu
  1198 		os=-sym1
  1199 		;;
  1200 	v810 | necv810)
  1201 		basic_machine=v810-nec
  1202 		os=-none
  1203 		;;
  1204 	vaxv)
  1205 		basic_machine=vax-dec
  1206 		os=-sysv
  1207 		;;
  1208 	vms)
  1209 		basic_machine=vax-dec
  1210 		os=-vms
  1211 		;;
  1212 	vpp*|vx|vx-*)
  1213 		basic_machine=f301-fujitsu
  1214 		;;
  1215 	vxworks960)
  1216 		basic_machine=i960-wrs
  1217 		os=-vxworks
  1218 		;;
  1219 	vxworks68)
  1220 		basic_machine=m68k-wrs
  1221 		os=-vxworks
  1222 		;;
  1223 	vxworks29k)
  1224 		basic_machine=a29k-wrs
  1225 		os=-vxworks
  1226 		;;
  1227 	w65*)
  1228 		basic_machine=w65-wdc
  1229 		os=-none
  1230 		;;
  1231 	w89k-*)
  1232 		basic_machine=hppa1.1-winbond
  1233 		os=-proelf
  1234 		;;
  1235 	xbox)
  1236 		basic_machine=i686-pc
  1237 		os=-mingw32
  1238 		;;
  1239 	xps | xps100)
  1240 		basic_machine=xps100-honeywell
  1241 		;;
  1242 	xscale-* | xscalee[bl]-*)
  1243 		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
  1244 		;;
  1245 	ymp)
  1246 		basic_machine=ymp-cray
  1247 		os=-unicos
  1248 		;;
  1249 	z8k-*-coff)
  1250 		basic_machine=z8k-unknown
  1251 		os=-sim
  1252 		;;
  1253 	z80-*-coff)
  1254 		basic_machine=z80-unknown
  1255 		os=-sim
  1256 		;;
  1257 	none)
  1258 		basic_machine=none-none
  1259 		os=-none
  1260 		;;
  1261 
  1262 # Here we handle the default manufacturer of certain CPU types.  It is in
  1263 # some cases the only manufacturer, in others, it is the most popular.
  1264 	w89k)
  1265 		basic_machine=hppa1.1-winbond
  1266 		;;
  1267 	op50n)
  1268 		basic_machine=hppa1.1-oki
  1269 		;;
  1270 	op60c)
  1271 		basic_machine=hppa1.1-oki
  1272 		;;
  1273 	romp)
  1274 		basic_machine=romp-ibm
  1275 		;;
  1276 	mmix)
  1277 		basic_machine=mmix-knuth
  1278 		;;
  1279 	rs6000)
  1280 		basic_machine=rs6000-ibm
  1281 		;;
  1282 	vax)
  1283 		basic_machine=vax-dec
  1284 		;;
  1285 	pdp10)
  1286 		# there are many clones, so DEC is not a safe bet
  1287 		basic_machine=pdp10-unknown
  1288 		;;
  1289 	pdp11)
  1290 		basic_machine=pdp11-dec
  1291 		;;
  1292 	we32k)
  1293 		basic_machine=we32k-att
  1294 		;;
  1295 	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
  1296 		basic_machine=sh-unknown
  1297 		;;
  1298 	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
  1299 		basic_machine=sparc-sun
  1300 		;;
  1301 	cydra)
  1302 		basic_machine=cydra-cydrome
  1303 		;;
  1304 	orion)
  1305 		basic_machine=orion-highlevel
  1306 		;;
  1307 	orion105)
  1308 		basic_machine=clipper-highlevel
  1309 		;;
  1310 	mac | mpw | mac-mpw)
  1311 		basic_machine=m68k-apple
  1312 		;;
  1313 	pmac | pmac-mpw)
  1314 		basic_machine=powerpc-apple
  1315 		;;
  1316 	*-unknown)
  1317 		# Make sure to match an already-canonicalized machine name.
  1318 		;;
  1319 	*)
  1320 		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  1321 		exit 1
  1322 		;;
  1323 esac
  1324 
  1325 # Here we canonicalize certain aliases for manufacturers.
  1326 case $basic_machine in
  1327 	*-digital*)
  1328 		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
  1329 		;;
  1330 	*-commodore*)
  1331 		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
  1332 		;;
  1333 	*)
  1334 		;;
  1335 esac
  1336 
  1337 # Decode manufacturer-specific aliases for certain operating systems.
  1338 
  1339 if [ x"$os" != x"" ]
  1340 then
  1341 case $os in
  1342 	# First match some system type aliases
  1343 	# that might get confused with valid system types.
  1344 	# -solaris* is a basic system type, with this one exception.
  1345 	-auroraux)
  1346 		os=-auroraux
  1347 		;;
  1348 	-solaris1 | -solaris1.*)
  1349 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
  1350 		;;
  1351 	-solaris)
  1352 		os=-solaris2
  1353 		;;
  1354 	-svr4*)
  1355 		os=-sysv4
  1356 		;;
  1357 	-unixware*)
  1358 		os=-sysv4.2uw
  1359 		;;
  1360 	-gnu/linux*)
  1361 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  1362 		;;
  1363 	# First accept the basic system types.
  1364 	# The portable systems comes first.
  1365 	# Each alternative MUST END IN A *, to match a version number.
  1366 	# -sysv* is not here because it comes later, after sysvr4.
  1367 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  1368 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
  1369 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
  1370 	      | -sym* | -kopensolaris* \
  1371 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  1372 	      | -aos* | -aros* \
  1373 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  1374 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  1375 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
  1376 	      | -bitrig* | -openbsd* | -solidbsd* \
  1377 	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
  1378 	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  1379 	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  1380 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  1381 	      | -chorusos* | -chorusrdb* | -cegcc* \
  1382 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  1383 	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
  1384 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
  1385 	      | -uxpv* | -beos* | -mpeix* | -udk* \
  1386 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
  1387 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  1388 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
  1389 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
  1390 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
  1391 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
  1392 	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
  1393 	# Remember, each alternative MUST END IN *, to match a version number.
  1394 		;;
  1395 	-qnx*)
  1396 		case $basic_machine in
  1397 		    x86-* | i*86-*)
  1398 			;;
  1399 		    *)
  1400 			os=-nto$os
  1401 			;;
  1402 		esac
  1403 		;;
  1404 	-nacl*)
  1405 		os=-nacl
  1406 		;;
  1407 	-pnacl*)
  1408 		os=-pnacl
  1409 		;;
  1410 	-nto-qnx*)
  1411 		;;
  1412 	-nto*)
  1413 		os=`echo $os | sed -e 's|nto|nto-qnx|'`
  1414 		;;
  1415 	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
  1416 	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
  1417 	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
  1418 		;;
  1419 	-mac*)
  1420 		os=`echo $os | sed -e 's|mac|macos|'`
  1421 		;;
  1422 	-linux-dietlibc)
  1423 		os=-linux-dietlibc
  1424 		;;
  1425 	-linux*)
  1426 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
  1427 		;;
  1428 	-sunos5*)
  1429 		os=`echo $os | sed -e 's|sunos5|solaris2|'`
  1430 		;;
  1431 	-sunos6*)
  1432 		os=`echo $os | sed -e 's|sunos6|solaris3|'`
  1433 		;;
  1434 	-opened*)
  1435 		os=-openedition
  1436 		;;
  1437 	-os400*)
  1438 		os=-os400
  1439 		;;
  1440 	-wince*)
  1441 		os=-wince
  1442 		;;
  1443 	-osfrose*)
  1444 		os=-osfrose
  1445 		;;
  1446 	-osf*)
  1447 		os=-osf
  1448 		;;
  1449 	-utek*)
  1450 		os=-bsd
  1451 		;;
  1452 	-dynix*)
  1453 		os=-bsd
  1454 		;;
  1455 	-acis*)
  1456 		os=-aos
  1457 		;;
  1458 	-atheos*)
  1459 		os=-atheos
  1460 		;;
  1461 	-syllable*)
  1462 		os=-syllable
  1463 		;;
  1464 	-386bsd)
  1465 		os=-bsd
  1466 		;;
  1467 	-ctix* | -uts*)
  1468 		os=-sysv
  1469 		;;
  1470 	-nova*)
  1471 		os=-rtmk-nova
  1472 		;;
  1473 	-ns2 )
  1474 		os=-nextstep2
  1475 		;;
  1476 	-nsk*)
  1477 		os=-nsk
  1478 		;;
  1479 	# Preserve the version number of sinix5.
  1480 	-sinix5.*)
  1481 		os=`echo $os | sed -e 's|sinix|sysv|'`
  1482 		;;
  1483 	-sinix*)
  1484 		os=-sysv4
  1485 		;;
  1486 	-tpf*)
  1487 		os=-tpf
  1488 		;;
  1489 	-triton*)
  1490 		os=-sysv3
  1491 		;;
  1492 	-oss*)
  1493 		os=-sysv3
  1494 		;;
  1495 	-svr4)
  1496 		os=-sysv4
  1497 		;;
  1498 	-svr3)
  1499 		os=-sysv3
  1500 		;;
  1501 	-sysvr4)
  1502 		os=-sysv4
  1503 		;;
  1504 	# This must come after -sysvr4.
  1505 	-sysv*)
  1506 		;;
  1507 	-ose*)
  1508 		os=-ose
  1509 		;;
  1510 	-es1800*)
  1511 		os=-ose
  1512 		;;
  1513 	-xenix)
  1514 		os=-xenix
  1515 		;;
  1516 	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
  1517 		os=-mint
  1518 		;;
  1519 	-aros*)
  1520 		os=-aros
  1521 		;;
  1522 	-kaos*)
  1523 		os=-kaos
  1524 		;;
  1525 	-zvmoe)
  1526 		os=-zvmoe
  1527 		;;
  1528 	-dicos*)
  1529 		os=-dicos
  1530 		;;
  1531 	-nacl*)
  1532         os=-nacl
  1533         ;;
  1534 	-pnacl*)
  1535 		os=-pnacl
  1536 		;;
  1537 	-none)
  1538 		;;
  1539 	*)
  1540 		# Get rid of the `-' at the beginning of $os.
  1541 		os=`echo $os | sed 's/[^-]*-//'`
  1542 		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  1543 		exit 1
  1544 		;;
  1545 esac
  1546 else
  1547 
  1548 # Here we handle the default operating systems that come with various machines.
  1549 # The value should be what the vendor currently ships out the door with their
  1550 # machine or put another way, the most popular os provided with the machine.
  1551 
  1552 # Note that if you're going to try to match "-MANUFACTURER" here (say,
  1553 # "-sun"), then you have to tell the case statement up towards the top
  1554 # that MANUFACTURER isn't an operating system.  Otherwise, code above
  1555 # will signal an error saying that MANUFACTURER isn't an operating
  1556 # system, and we'll never get to this point.
  1557 
  1558 case $basic_machine in
  1559 	score-*)
  1560 		os=-elf
  1561 		;;
  1562 	spu-*)
  1563 		os=-elf
  1564 		;;
  1565 	*-acorn)
  1566 		os=-riscix1.2
  1567 		;;
  1568 	arm*-rebel)
  1569 		os=-linux
  1570 		;;
  1571 	arm*-semi)
  1572 		os=-aout
  1573 		;;
  1574 	c4x-* | tic4x-*)
  1575 		os=-coff
  1576 		;;
  1577 	hexagon-*)
  1578 		os=-elf
  1579 		;;
  1580 	tic54x-*)
  1581 		os=-coff
  1582 		;;
  1583 	tic55x-*)
  1584 		os=-coff
  1585 		;;
  1586 	tic6x-*)
  1587 		os=-coff
  1588 		;;
  1589 	# This must come before the *-dec entry.
  1590 	pdp10-*)
  1591 		os=-tops20
  1592 		;;
  1593 	pdp11-*)
  1594 		os=-none
  1595 		;;
  1596 	*-dec | vax-*)
  1597 		os=-ultrix4.2
  1598 		;;
  1599 	m68*-apollo)
  1600 		os=-domain
  1601 		;;
  1602 	i386-sun)
  1603 		os=-sunos4.0.2
  1604 		;;
  1605 	m68000-sun)
  1606 		os=-sunos3
  1607 		;;
  1608 	m68*-cisco)
  1609 		os=-aout
  1610 		;;
  1611 	mep-*)
  1612 		os=-elf
  1613 		;;
  1614 	mips*-cisco)
  1615 		os=-elf
  1616 		;;
  1617 	mips*-*)
  1618 		os=-elf
  1619 		;;
  1620 	or32-*)
  1621 		os=-coff
  1622 		;;
  1623 	*-tti)	# must be before sparc entry or we get the wrong os.
  1624 		os=-sysv3
  1625 		;;
  1626 	sparc-* | *-sun)
  1627 		os=-sunos4.1.1
  1628 		;;
  1629 	*-be)
  1630 		os=-beos
  1631 		;;
  1632 	*-haiku)
  1633 		os=-haiku
  1634 		;;
  1635 	*-ibm)
  1636 		os=-aix
  1637 		;;
  1638 	*-knuth)
  1639 		os=-mmixware
  1640 		;;
  1641 	*-wec)
  1642 		os=-proelf
  1643 		;;
  1644 	*-winbond)
  1645 		os=-proelf
  1646 		;;
  1647 	*-oki)
  1648 		os=-proelf
  1649 		;;
  1650 	*-hp)
  1651 		os=-hpux
  1652 		;;
  1653 	*-hitachi)
  1654 		os=-hiux
  1655 		;;
  1656 	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  1657 		os=-sysv
  1658 		;;
  1659 	*-cbm)
  1660 		os=-amigaos
  1661 		;;
  1662 	*-dg)
  1663 		os=-dgux
  1664 		;;
  1665 	*-dolphin)
  1666 		os=-sysv3
  1667 		;;
  1668 	m68k-ccur)
  1669 		os=-rtu
  1670 		;;
  1671 	m88k-omron*)
  1672 		os=-luna
  1673 		;;
  1674 	*-next )
  1675 		os=-nextstep
  1676 		;;
  1677 	*-sequent)
  1678 		os=-ptx
  1679 		;;
  1680 	*-crds)
  1681 		os=-unos
  1682 		;;
  1683 	*-ns)
  1684 		os=-genix
  1685 		;;
  1686 	i370-*)
  1687 		os=-mvs
  1688 		;;
  1689 	*-next)
  1690 		os=-nextstep3
  1691 		;;
  1692 	*-gould)
  1693 		os=-sysv
  1694 		;;
  1695 	*-highlevel)
  1696 		os=-bsd
  1697 		;;
  1698 	*-encore)
  1699 		os=-bsd
  1700 		;;
  1701 	*-sgi)
  1702 		os=-irix
  1703 		;;
  1704 	*-siemens)
  1705 		os=-sysv4
  1706 		;;
  1707 	*-masscomp)
  1708 		os=-rtu
  1709 		;;
  1710 	f30[01]-fujitsu | f700-fujitsu)
  1711 		os=-uxpv
  1712 		;;
  1713 	*-rom68k)
  1714 		os=-coff
  1715 		;;
  1716 	*-*bug)
  1717 		os=-coff
  1718 		;;
  1719 	*-apple)
  1720 		os=-macos
  1721 		;;
  1722 	*-atari*)
  1723 		os=-mint
  1724 		;;
  1725 	*)
  1726 		os=-none
  1727 		;;
  1728 esac
  1729 fi
  1730 
  1731 # Here we handle the case where we know the os, and the CPU type, but not the
  1732 # manufacturer.  We pick the logical manufacturer.
  1733 vendor=unknown
  1734 case $basic_machine in
  1735 	*-unknown)
  1736 		case $os in
  1737 			-riscix*)
  1738 				vendor=acorn
  1739 				;;
  1740 			-sunos*)
  1741 				vendor=sun
  1742 				;;
  1743 			-cnk*|-aix*)
  1744 				vendor=ibm
  1745 				;;
  1746 			-beos*)
  1747 				vendor=be
  1748 				;;
  1749 			-hpux*)
  1750 				vendor=hp
  1751 				;;
  1752 			-mpeix*)
  1753 				vendor=hp
  1754 				;;
  1755 			-hiux*)
  1756 				vendor=hitachi
  1757 				;;
  1758 			-unos*)
  1759 				vendor=crds
  1760 				;;
  1761 			-dgux*)
  1762 				vendor=dg
  1763 				;;
  1764 			-luna*)
  1765 				vendor=omron
  1766 				;;
  1767 			-genix*)
  1768 				vendor=ns
  1769 				;;
  1770 			-mvs* | -opened*)
  1771 				vendor=ibm
  1772 				;;
  1773 			-os400*)
  1774 				vendor=ibm
  1775 				;;
  1776 			-ptx*)
  1777 				vendor=sequent
  1778 				;;
  1779 			-tpf*)
  1780 				vendor=ibm
  1781 				;;
  1782 			-vxsim* | -vxworks* | -windiss*)
  1783 				vendor=wrs
  1784 				;;
  1785 			-aux*)
  1786 				vendor=apple
  1787 				;;
  1788 			-hms*)
  1789 				vendor=hitachi
  1790 				;;
  1791 			-mpw* | -macos*)
  1792 				vendor=apple
  1793 				;;
  1794 			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
  1795 				vendor=atari
  1796 				;;
  1797 			-vos*)
  1798 				vendor=stratus
  1799 				;;
  1800 		esac
  1801 		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
  1802 		;;
  1803 esac
  1804 
  1805 echo $basic_machine$os
  1806 exit
  1807 
  1808 # Local variables:
  1809 # eval: (add-hook 'write-file-hooks 'time-stamp)
  1810 # time-stamp-start: "timestamp='"
  1811 # time-stamp-format: "%:y-%02m-%02d"
  1812 # time-stamp-end: "'"
  1813 # End: