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