Blame SOURCES/config.sub

b45ece
#! /bin/sh
b45ece
# Configuration validation subroutine script.
b45ece
#   Copyright 1992-2018 Free Software Foundation, Inc.
b45ece
b45ece
timestamp='2018-05-05'
b45ece
b45ece
# This file is free software; you can redistribute it and/or modify it
b45ece
# under the terms of the GNU General Public License as published by
b45ece
# the Free Software Foundation; either version 3 of the License, or
b45ece
# (at your option) any later version.
b45ece
#
b45ece
# This program is distributed in the hope that it will be useful, but
b45ece
# WITHOUT ANY WARRANTY; without even the implied warranty of
b45ece
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
b45ece
# General Public License for more details.
b45ece
#
b45ece
# You should have received a copy of the GNU General Public License
b45ece
# along with this program; if not, see <https://www.gnu.org/licenses/>.
b45ece
#
b45ece
# As a special exception to the GNU General Public License, if you
b45ece
# distribute this file as part of a program that contains a
b45ece
# configuration script generated by Autoconf, you may include it under
b45ece
# the same distribution terms that you use for the rest of that
b45ece
# program.  This Exception is an additional permission under section 7
b45ece
# of the GNU General Public License, version 3 ("GPLv3").
b45ece
b45ece
b45ece
# Please send patches to <config-patches@gnu.org>.
b45ece
#
b45ece
# Configuration subroutine to validate and canonicalize a configuration type.
b45ece
# Supply the specified configuration type as an argument.
b45ece
# If it is invalid, we print an error message on stderr and exit with code 1.
b45ece
# Otherwise, we print the canonical config type on stdout and succeed.
b45ece
b45ece
# You can get the latest version of this script from:
b45ece
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
b45ece
b45ece
# This file is supposed to be the same for all GNU packages
b45ece
# and recognize all the CPU types, system types and aliases
b45ece
# that are meaningful with *any* GNU software.
b45ece
# Each package is responsible for reporting which valid configurations
b45ece
# it does not support.  The user should be able to distinguish
b45ece
# a failure to support a valid configuration from a meaningless
b45ece
# configuration.
b45ece
b45ece
# The goal of this file is to map all the various variations of a given
b45ece
# machine specification into a single specification in the form:
b45ece
#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
b45ece
# or in some cases, the newer four-part form:
b45ece
#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
b45ece
# It is wrong to echo any other type of specification.
b45ece
b45ece
me=`echo "$0" | sed -e 's,.*/,,'`
b45ece
b45ece
usage="\
b45ece
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
b45ece
b45ece
Canonicalize a configuration name.
b45ece
b45ece
Options:
b45ece
  -h, --help         print this help, then exit
b45ece
  -t, --time-stamp   print date of last modification, then exit
b45ece
  -v, --version      print version number, then exit
b45ece
b45ece
Report bugs and patches to <config-patches@gnu.org>."
b45ece
b45ece
version="\
b45ece
GNU config.sub ($timestamp)
b45ece
b45ece
Copyright 1992-2018 Free Software Foundation, Inc.
b45ece
b45ece
This is free software; see the source for copying conditions.  There is NO
b45ece
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
b45ece
b45ece
help="
b45ece
Try \`$me --help' for more information."
b45ece
b45ece
# Parse command line
b45ece
while test $# -gt 0 ; do
b45ece
  case $1 in
b45ece
    --time-stamp | --time* | -t )
b45ece
       echo "$timestamp" ; exit ;;
b45ece
    --version | -v )
b45ece
       echo "$version" ; exit ;;
b45ece
    --help | --h* | -h )
b45ece
       echo "$usage"; exit ;;
b45ece
    -- )     # Stop option processing
b45ece
       shift; break ;;
b45ece
    - )	# Use stdin as input.
b45ece
       break ;;
b45ece
    -* )
b45ece
       echo "$me: invalid option $1$help"
b45ece
       exit 1 ;;
b45ece
b45ece
    *local*)
b45ece
       # First pass through any local machine types.
b45ece
       echo "$1"
b45ece
       exit ;;
b45ece
b45ece
    * )
b45ece
       break ;;
b45ece
  esac
b45ece
done
b45ece
b45ece
case $# in
b45ece
 0) echo "$me: missing argument$help" >&2
b45ece
    exit 1;;
b45ece
 1) ;;
b45ece
 *) echo "$me: too many arguments$help" >&2
b45ece
    exit 1;;
b45ece
esac
b45ece
b45ece
# Spilt fields of configuration type
b45ece
IFS="-" read -r field1 field2 field3 field4 <
b45ece
$1
b45ece
EOF
b45ece
b45ece
# Separate into logical components for further validation
b45ece
case $1 in
b45ece
	*-*-*-*)
b45ece
		basic_machine=$field1-$field2
b45ece
		os=-$field3-$field4
b45ece
		;;
b45ece
	*-*-*)
b45ece
		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
b45ece
		# parts
b45ece
		maybe_os=$field2-$field3
b45ece
		case $maybe_os in
b45ece
			nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
b45ece
			| linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
b45ece
			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
b45ece
			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
b45ece
			| storm-chaos* | os2-emx* | rtmk-nova*)
b45ece
				basic_machine=$field1
b45ece
				os=-$maybe_os
b45ece
				;;
b45ece
			android-linux)
b45ece
				basic_machine=$field1-unknown
b45ece
				os=-linux-android
b45ece
				;;
b45ece
			*)
b45ece
				basic_machine=$field1-$field2
b45ece
				os=-$field3
b45ece
				;;
b45ece
		esac
b45ece
		;;
b45ece
	*-*)
b45ece
		basic_machine=$field1
b45ece
		os=-$field2
b45ece
		;;
b45ece
	*)
b45ece
		basic_machine=$1
b45ece
		os=
b45ece
		;;
b45ece
esac
b45ece
b45ece
### Let's recognize common machines as not being operating systems so
b45ece
### that things like config.sub decstation-3100 work.  We also
b45ece
### recognize some manufacturers as not being operating systems, so we
b45ece
### can provide default operating systems below.
b45ece
case $os in
b45ece
	-sun*os*)
b45ece
		# Prevent following clause from handling this invalid input.
b45ece
		;;
b45ece
	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
b45ece
	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
b45ece
	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
b45ece
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
b45ece
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
b45ece
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
b45ece
	-apple | -axis | -knuth | -cray | -microblaze*)
b45ece
		os=
b45ece
		basic_machine=$1
b45ece
		;;
b45ece
	-bluegene*)
b45ece
		os=-cnk
b45ece
		;;
b45ece
	-sim | -cisco | -oki | -wec | -winbond)
b45ece
		os=
b45ece
		basic_machine=$1
b45ece
		;;
b45ece
	-scout)
b45ece
		;;
b45ece
	-wrs)
b45ece
		os=-vxworks
b45ece
		basic_machine=$1
b45ece
		;;
b45ece
	-chorusos*)
b45ece
		os=-chorusos
b45ece
		basic_machine=$1
b45ece
		;;
b45ece
	-chorusrdb)
b45ece
		os=-chorusrdb
b45ece
		basic_machine=$1
b45ece
		;;
b45ece
	-hiux*)
b45ece
		os=-hiuxwe2
b45ece
		;;
b45ece
	-sco6)
b45ece
		os=-sco5v6
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-sco5)
b45ece
		os=-sco3.2v5
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-sco4)
b45ece
		os=-sco3.2v4
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-sco3.2.[4-9]*)
b45ece
		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-sco3.2v[4-9]*)
b45ece
		# Don't forget version if it is 3.2v4 or newer.
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-sco5v6*)
b45ece
		# Don't forget version if it is 3.2v4 or newer.
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-sco*)
b45ece
		os=-sco3.2v2
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-udk*)
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-isc)
b45ece
		os=-isc2.2
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-clix*)
b45ece
		basic_machine=clipper-intergraph
b45ece
		;;
b45ece
	-isc*)
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
b45ece
		;;
b45ece
	-lynx*178)
b45ece
		os=-lynxos178
b45ece
		;;
b45ece
	-lynx*5)
b45ece
		os=-lynxos5
b45ece
		;;
b45ece
	-lynx*)
b45ece
		os=-lynxos
b45ece
		;;
b45ece
	-ptx*)
b45ece
		basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
b45ece
		;;
b45ece
	-psos*)
b45ece
		os=-psos
b45ece
		;;
b45ece
	-mint | -mint[0-9]*)
b45ece
		basic_machine=m68k-atari
b45ece
		os=-mint
b45ece
		;;
b45ece
esac
b45ece
b45ece
# Decode aliases for certain CPU-COMPANY combinations.
b45ece
case $basic_machine in
b45ece
	# Recognize the basic CPU types without company name.
b45ece
	# Some are omitted here because they have special meanings below.
b45ece
	1750a | 580 \
b45ece
	| a29k \
b45ece
	| aarch64 | aarch64_be \
b45ece
	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
b45ece
	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
b45ece
	| am33_2.0 \
b45ece
	| arc | arceb \
b45ece
	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv6m | armv[78][arm] \
b45ece
	| avr | avr32 \
b45ece
	| ba \
b45ece
	| be32 | be64 \
b45ece
	| bfin \
b45ece
	| c4x | c8051 | clipper | csky \
b45ece
	| d10v | d30v | dlx | dsp16xx \
b45ece
	| e2k | epiphany \
b45ece
	| fido | fr30 | frv | ft32 \
b45ece
	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
b45ece
	| hexagon \
b45ece
	| i370 | i860 | i960 | ia16 | ia64 \
b45ece
	| ip2k | iq2000 \
b45ece
	| k1om \
b45ece
	| le32 | le64 \
b45ece
	| lm32 \
b45ece
	| m32c | m32r | m32rle | m68000 | m68k | m88k \
b45ece
	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
b45ece
	| mips | mipsbe | mipseb | mipsel | mipsle \
b45ece
	| mips16 \
b45ece
	| mips64 | mips64el \
b45ece
	| mips64octeon | mips64octeonel \
b45ece
	| mips64orion | mips64orionel \
b45ece
	| mips64r5900 | mips64r5900el \
b45ece
	| mips64vr | mips64vrel \
b45ece
	| mips64vr4100 | mips64vr4100el \
b45ece
	| mips64vr4300 | mips64vr4300el \
b45ece
	| mips64vr5000 | mips64vr5000el \
b45ece
	| mips64vr5900 | mips64vr5900el \
b45ece
	| mipsisa32 | mipsisa32el \
b45ece
	| mipsisa32r2 | mipsisa32r2el \
b45ece
	| mipsisa32r6 | mipsisa32r6el \
b45ece
	| mipsisa64 | mipsisa64el \
b45ece
	| mipsisa64r2 | mipsisa64r2el \
b45ece
	| mipsisa64r6 | mipsisa64r6el \
b45ece
	| mipsisa64sb1 | mipsisa64sb1el \
b45ece
	| mipsisa64sr71k | mipsisa64sr71kel \
b45ece
	| mipsr5900 | mipsr5900el \
b45ece
	| mipstx39 | mipstx39el \
b45ece
	| mn10200 | mn10300 \
b45ece
	| moxie \
b45ece
	| mt \
b45ece
	| msp430 \
b45ece
	| nds32 | nds32le | nds32be \
b45ece
	| nfp \
b45ece
	| nios | nios2 | nios2eb | nios2el \
b45ece
	| ns16k | ns32k \
b45ece
	| open8 | or1k | or1knd | or32 \
b45ece
	| pdp10 | pj | pjl \
b45ece
	| powerpc | powerpc64 | powerpc64le | powerpcle \
b45ece
	| pru \
b45ece
	| pyramid \
b45ece
	| riscv32 | riscv64 \
b45ece
	| rl78 | rx \
b45ece
	| score \
b45ece
	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
b45ece
	| sh64 | sh64le \
b45ece
	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
b45ece
	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
b45ece
	| spu \
b45ece
	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
b45ece
	| ubicom32 \
b45ece
	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
b45ece
	| visium \
b45ece
	| wasm32 \
b45ece
	| x86 | xc16x | xstormy16 | xtensa \
b45ece
	| z8k | z80)
b45ece
		basic_machine=$basic_machine-unknown
b45ece
		;;
b45ece
	c54x)
b45ece
		basic_machine=tic54x-unknown
b45ece
		;;
b45ece
	c55x)
b45ece
		basic_machine=tic55x-unknown
b45ece
		;;
b45ece
	c6x)
b45ece
		basic_machine=tic6x-unknown
b45ece
		;;
b45ece
	leon|leon[3-9])
b45ece
		basic_machine=sparc-$basic_machine
b45ece
		;;
b45ece
	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
b45ece
		basic_machine=$basic_machine-unknown
b45ece
		os=-none
b45ece
		;;
b45ece
	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
b45ece
		;;
b45ece
	m9s12z | m68hcs12z | hcs12z | s12z)
b45ece
		basic_machine=s12z-unknown
b45ece
		os=-none
b45ece
		;;
b45ece
	ms1)
b45ece
		basic_machine=mt-unknown
b45ece
		;;
b45ece
b45ece
	strongarm | thumb | xscale)
b45ece
		basic_machine=arm-unknown
b45ece
		;;
b45ece
	xgate)
b45ece
		basic_machine=$basic_machine-unknown
b45ece
		os=-none
b45ece
		;;
b45ece
	xscaleeb)
b45ece
		basic_machine=armeb-unknown
b45ece
		;;
b45ece
b45ece
	xscaleel)
b45ece
		basic_machine=armel-unknown
b45ece
		;;
b45ece
b45ece
	# We use `pc' rather than `unknown'
b45ece
	# because (1) that's what they normally are, and
b45ece
	# (2) the word "unknown" tends to confuse beginning users.
b45ece
	i*86 | x86_64)
b45ece
	  basic_machine=$basic_machine-pc
b45ece
	  ;;
b45ece
	# Object if more than one company name word.
b45ece
	*-*-*)
b45ece
		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
b45ece
		exit 1
b45ece
		;;
b45ece
	# Recognize the basic CPU types with company name.
b45ece
	580-* \
b45ece
	| a29k-* \
b45ece
	| aarch64-* | aarch64_be-* \
b45ece
	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
b45ece
	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
b45ece
	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
b45ece
	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
b45ece
	| avr-* | avr32-* \
b45ece
	| ba-* \
b45ece
	| be32-* | be64-* \
b45ece
	| bfin-* | bs2000-* \
b45ece
	| c[123]* | c30-* | [cjt]90-* | c4x-* \
b45ece
	| c8051-* | clipper-* | craynv-* | csky-* | cydra-* \
b45ece
	| d10v-* | d30v-* | dlx-* \
b45ece
	| e2k-* | elxsi-* \
b45ece
	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
b45ece
	| h8300-* | h8500-* \
b45ece
	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
b45ece
	| hexagon-* \
b45ece
	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
b45ece
	| ip2k-* | iq2000-* \
b45ece
	| k1om-* \
b45ece
	| le32-* | le64-* \
b45ece
	| lm32-* \
b45ece
	| m32c-* | m32r-* | m32rle-* \
b45ece
	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
b45ece
	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
b45ece
	| microblaze-* | microblazeel-* \
b45ece
	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
b45ece
	| mips16-* \
b45ece
	| mips64-* | mips64el-* \
b45ece
	| mips64octeon-* | mips64octeonel-* \
b45ece
	| mips64orion-* | mips64orionel-* \
b45ece
	| mips64r5900-* | mips64r5900el-* \
b45ece
	| mips64vr-* | mips64vrel-* \
b45ece
	| mips64vr4100-* | mips64vr4100el-* \
b45ece
	| mips64vr4300-* | mips64vr4300el-* \
b45ece
	| mips64vr5000-* | mips64vr5000el-* \
b45ece
	| mips64vr5900-* | mips64vr5900el-* \
b45ece
	| mipsisa32-* | mipsisa32el-* \
b45ece
	| mipsisa32r2-* | mipsisa32r2el-* \
b45ece
	| mipsisa32r6-* | mipsisa32r6el-* \
b45ece
	| mipsisa64-* | mipsisa64el-* \
b45ece
	| mipsisa64r2-* | mipsisa64r2el-* \
b45ece
	| mipsisa64r6-* | mipsisa64r6el-* \
b45ece
	| mipsisa64sb1-* | mipsisa64sb1el-* \
b45ece
	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
b45ece
	| mipsr5900-* | mipsr5900el-* \
b45ece
	| mipstx39-* | mipstx39el-* \
b45ece
	| mmix-* \
b45ece
	| mt-* \
b45ece
	| msp430-* \
b45ece
	| nds32-* | nds32le-* | nds32be-* \
b45ece
	| nfp-* \
b45ece
	| nios-* | nios2-* | nios2eb-* | nios2el-* \
b45ece
	| none-* | np1-* | ns16k-* | ns32k-* \
b45ece
	| open8-* \
b45ece
	| or1k*-* \
b45ece
	| orion-* \
b45ece
	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
b45ece
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
b45ece
	| pru-* \
b45ece
	| pyramid-* \
b45ece
	| riscv32-* | riscv64-* \
b45ece
	| rl78-* | romp-* | rs6000-* | rx-* \
b45ece
	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
b45ece
	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
b45ece
	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
b45ece
	| sparclite-* \
b45ece
	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
b45ece
	| tahoe-* \
b45ece
	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
b45ece
	| tile*-* \
b45ece
	| tron-* \
b45ece
	| ubicom32-* \
b45ece
	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
b45ece
	| vax-* \
b45ece
	| visium-* \
b45ece
	| wasm32-* \
b45ece
	| we32k-* \
b45ece
	| x86-* | x86_64-* | xc16x-* | xps100-* \
b45ece
	| xstormy16-* | xtensa*-* \
b45ece
	| ymp-* \
b45ece
	| z8k-* | z80-*)
b45ece
		;;
b45ece
	# Recognize the basic CPU types without company name, with glob match.
b45ece
	xtensa*)
b45ece
		basic_machine=$basic_machine-unknown
b45ece
		;;
b45ece
	# Recognize the various machine names and aliases which stand
b45ece
	# for a CPU type and a company and sometimes even an OS.
b45ece
	386bsd)
b45ece
		basic_machine=i386-pc
b45ece
		os=-bsd
b45ece
		;;
b45ece
	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
b45ece
		basic_machine=m68000-att
b45ece
		;;
b45ece
	3b*)
b45ece
		basic_machine=we32k-att
b45ece
		;;
b45ece
	a29khif)
b45ece
		basic_machine=a29k-amd
b45ece
		os=-udi
b45ece
		;;
b45ece
	abacus)
b45ece
		basic_machine=abacus-unknown
b45ece
		;;
b45ece
	adobe68k)
b45ece
		basic_machine=m68010-adobe
b45ece
		os=-scout
b45ece
		;;
b45ece
	alliant | fx80)
b45ece
		basic_machine=fx80-alliant
b45ece
		;;
b45ece
	altos | altos3068)
b45ece
		basic_machine=m68k-altos
b45ece
		;;
b45ece
	am29k)
b45ece
		basic_machine=a29k-none
b45ece
		os=-bsd
b45ece
		;;
b45ece
	amd64)
b45ece
		basic_machine=x86_64-pc
b45ece
		;;
b45ece
	amd64-*)
b45ece
		basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	amdahl)
b45ece
		basic_machine=580-amdahl
b45ece
		os=-sysv
b45ece
		;;
b45ece
	amiga | amiga-*)
b45ece
		basic_machine=m68k-unknown
b45ece
		;;
b45ece
	amigaos | amigados)
b45ece
		basic_machine=m68k-unknown
b45ece
		os=-amigaos
b45ece
		;;
b45ece
	amigaunix | amix)
b45ece
		basic_machine=m68k-unknown
b45ece
		os=-sysv4
b45ece
		;;
b45ece
	apollo68)
b45ece
		basic_machine=m68k-apollo
b45ece
		os=-sysv
b45ece
		;;
b45ece
	apollo68bsd)
b45ece
		basic_machine=m68k-apollo
b45ece
		os=-bsd
b45ece
		;;
b45ece
	aros)
b45ece
		basic_machine=i386-pc
b45ece
		os=-aros
b45ece
		;;
b45ece
	asmjs)
b45ece
		basic_machine=asmjs-unknown
b45ece
		;;
b45ece
	aux)
b45ece
		basic_machine=m68k-apple
b45ece
		os=-aux
b45ece
		;;
b45ece
	balance)
b45ece
		basic_machine=ns32k-sequent
b45ece
		os=-dynix
b45ece
		;;
b45ece
	blackfin)
b45ece
		basic_machine=bfin-unknown
b45ece
		os=-linux
b45ece
		;;
b45ece
	blackfin-*)
b45ece
		basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		os=-linux
b45ece
		;;
b45ece
	bluegene*)
b45ece
		basic_machine=powerpc-ibm
b45ece
		os=-cnk
b45ece
		;;
b45ece
	c54x-*)
b45ece
		basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	c55x-*)
b45ece
		basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	c6x-*)
b45ece
		basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	c90)
b45ece
		basic_machine=c90-cray
b45ece
		os=-unicos
b45ece
		;;
b45ece
	cegcc)
b45ece
		basic_machine=arm-unknown
b45ece
		os=-cegcc
b45ece
		;;
b45ece
	convex-c1)
b45ece
		basic_machine=c1-convex
b45ece
		os=-bsd
b45ece
		;;
b45ece
	convex-c2)
b45ece
		basic_machine=c2-convex
b45ece
		os=-bsd
b45ece
		;;
b45ece
	convex-c32)
b45ece
		basic_machine=c32-convex
b45ece
		os=-bsd
b45ece
		;;
b45ece
	convex-c34)
b45ece
		basic_machine=c34-convex
b45ece
		os=-bsd
b45ece
		;;
b45ece
	convex-c38)
b45ece
		basic_machine=c38-convex
b45ece
		os=-bsd
b45ece
		;;
b45ece
	cray | j90)
b45ece
		basic_machine=j90-cray
b45ece
		os=-unicos
b45ece
		;;
b45ece
	craynv)
b45ece
		basic_machine=craynv-cray
b45ece
		os=-unicosmp
b45ece
		;;
b45ece
	cr16 | cr16-*)
b45ece
		basic_machine=cr16-unknown
b45ece
		os=-elf
b45ece
		;;
b45ece
	crds | unos)
b45ece
		basic_machine=m68k-crds
b45ece
		;;
b45ece
	crisv32 | crisv32-* | etraxfs*)
b45ece
		basic_machine=crisv32-axis
b45ece
		;;
b45ece
	cris | cris-* | etrax*)
b45ece
		basic_machine=cris-axis
b45ece
		;;
b45ece
	crx)
b45ece
		basic_machine=crx-unknown
b45ece
		os=-elf
b45ece
		;;
b45ece
	da30 | da30-*)
b45ece
		basic_machine=m68k-da30
b45ece
		;;
b45ece
	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
b45ece
		basic_machine=mips-dec
b45ece
		;;
b45ece
	decsystem10* | dec10*)
b45ece
		basic_machine=pdp10-dec
b45ece
		os=-tops10
b45ece
		;;
b45ece
	decsystem20* | dec20*)
b45ece
		basic_machine=pdp10-dec
b45ece
		os=-tops20
b45ece
		;;
b45ece
	delta | 3300 | motorola-3300 | motorola-delta \
b45ece
	      | 3300-motorola | delta-motorola)
b45ece
		basic_machine=m68k-motorola
b45ece
		;;
b45ece
	delta88)
b45ece
		basic_machine=m88k-motorola
b45ece
		os=-sysv3
b45ece
		;;
b45ece
	dicos)
b45ece
		basic_machine=i686-pc
b45ece
		os=-dicos
b45ece
		;;
b45ece
	djgpp)
b45ece
		basic_machine=i586-pc
b45ece
		os=-msdosdjgpp
b45ece
		;;
b45ece
	dpx20 | dpx20-*)
b45ece
		basic_machine=rs6000-bull
b45ece
		os=-bosx
b45ece
		;;
b45ece
	dpx2*)
b45ece
		basic_machine=m68k-bull
b45ece
		os=-sysv3
b45ece
		;;
b45ece
	e500v[12])
b45ece
		basic_machine=powerpc-unknown
b45ece
		os=$os"spe"
b45ece
		;;
b45ece
	e500v[12]-*)
b45ece
		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		os=$os"spe"
b45ece
		;;
b45ece
	ebmon29k)
b45ece
		basic_machine=a29k-amd
b45ece
		os=-ebmon
b45ece
		;;
b45ece
	elxsi)
b45ece
		basic_machine=elxsi-elxsi
b45ece
		os=-bsd
b45ece
		;;
b45ece
	encore | umax | mmax)
b45ece
		basic_machine=ns32k-encore
b45ece
		;;
b45ece
	es1800 | OSE68k | ose68k | ose | OSE)
b45ece
		basic_machine=m68k-ericsson
b45ece
		os=-ose
b45ece
		;;
b45ece
	fx2800)
b45ece
		basic_machine=i860-alliant
b45ece
		;;
b45ece
	genix)
b45ece
		basic_machine=ns32k-ns
b45ece
		;;
b45ece
	gmicro)
b45ece
		basic_machine=tron-gmicro
b45ece
		os=-sysv
b45ece
		;;
b45ece
	go32)
b45ece
		basic_machine=i386-pc
b45ece
		os=-go32
b45ece
		;;
b45ece
	h3050r* | hiux*)
b45ece
		basic_machine=hppa1.1-hitachi
b45ece
		os=-hiuxwe2
b45ece
		;;
b45ece
	h8300hms)
b45ece
		basic_machine=h8300-hitachi
b45ece
		os=-hms
b45ece
		;;
b45ece
	h8300xray)
b45ece
		basic_machine=h8300-hitachi
b45ece
		os=-xray
b45ece
		;;
b45ece
	h8500hms)
b45ece
		basic_machine=h8500-hitachi
b45ece
		os=-hms
b45ece
		;;
b45ece
	harris)
b45ece
		basic_machine=m88k-harris
b45ece
		os=-sysv3
b45ece
		;;
b45ece
	hp300-*)
b45ece
		basic_machine=m68k-hp
b45ece
		;;
b45ece
	hp300bsd)
b45ece
		basic_machine=m68k-hp
b45ece
		os=-bsd
b45ece
		;;
b45ece
	hp300hpux)
b45ece
		basic_machine=m68k-hp
b45ece
		os=-hpux
b45ece
		;;
b45ece
	hp3k9[0-9][0-9] | hp9[0-9][0-9])
b45ece
		basic_machine=hppa1.0-hp
b45ece
		;;
b45ece
	hp9k2[0-9][0-9] | hp9k31[0-9])
b45ece
		basic_machine=m68000-hp
b45ece
		;;
b45ece
	hp9k3[2-9][0-9])
b45ece
		basic_machine=m68k-hp
b45ece
		;;
b45ece
	hp9k6[0-9][0-9] | hp6[0-9][0-9])
b45ece
		basic_machine=hppa1.0-hp
b45ece
		;;
b45ece
	hp9k7[0-79][0-9] | hp7[0-79][0-9])
b45ece
		basic_machine=hppa1.1-hp
b45ece
		;;
b45ece
	hp9k78[0-9] | hp78[0-9])
b45ece
		# FIXME: really hppa2.0-hp
b45ece
		basic_machine=hppa1.1-hp
b45ece
		;;
b45ece
	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
b45ece
		# FIXME: really hppa2.0-hp
b45ece
		basic_machine=hppa1.1-hp
b45ece
		;;
b45ece
	hp9k8[0-9][13679] | hp8[0-9][13679])
b45ece
		basic_machine=hppa1.1-hp
b45ece
		;;
b45ece
	hp9k8[0-9][0-9] | hp8[0-9][0-9])
b45ece
		basic_machine=hppa1.0-hp
b45ece
		;;
b45ece
	hppaosf)
b45ece
		basic_machine=hppa1.1-hp
b45ece
		os=-osf
b45ece
		;;
b45ece
	hppro)
b45ece
		basic_machine=hppa1.1-hp
b45ece
		os=-proelf
b45ece
		;;
b45ece
	i370-ibm* | ibm*)
b45ece
		basic_machine=i370-ibm
b45ece
		;;
b45ece
	i*86v32)
b45ece
		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
b45ece
		os=-sysv32
b45ece
		;;
b45ece
	i*86v4*)
b45ece
		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
b45ece
		os=-sysv4
b45ece
		;;
b45ece
	i*86v)
b45ece
		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
b45ece
		os=-sysv
b45ece
		;;
b45ece
	i*86sol2)
b45ece
		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
b45ece
		os=-solaris2
b45ece
		;;
b45ece
	i386mach)
b45ece
		basic_machine=i386-mach
b45ece
		os=-mach
b45ece
		;;
b45ece
	vsta)
b45ece
		basic_machine=i386-unknown
b45ece
		os=-vsta
b45ece
		;;
b45ece
	iris | iris4d)
b45ece
		basic_machine=mips-sgi
b45ece
		case $os in
b45ece
		    -irix*)
b45ece
			;;
b45ece
		    *)
b45ece
			os=-irix4
b45ece
			;;
b45ece
		esac
b45ece
		;;
b45ece
	isi68 | isi)
b45ece
		basic_machine=m68k-isi
b45ece
		os=-sysv
b45ece
		;;
b45ece
	leon-*|leon[3-9]-*)
b45ece
		basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
b45ece
		;;
b45ece
	m68knommu)
b45ece
		basic_machine=m68k-unknown
b45ece
		os=-linux
b45ece
		;;
b45ece
	m68knommu-*)
b45ece
		basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		os=-linux
b45ece
		;;
b45ece
	magnum | m3230)
b45ece
		basic_machine=mips-mips
b45ece
		os=-sysv
b45ece
		;;
b45ece
	merlin)
b45ece
		basic_machine=ns32k-utek
b45ece
		os=-sysv
b45ece
		;;
b45ece
	microblaze*)
b45ece
		basic_machine=microblaze-xilinx
b45ece
		;;
b45ece
	mingw64)
b45ece
		basic_machine=x86_64-pc
b45ece
		os=-mingw64
b45ece
		;;
b45ece
	mingw32)
b45ece
		basic_machine=i686-pc
b45ece
		os=-mingw32
b45ece
		;;
b45ece
	mingw32ce)
b45ece
		basic_machine=arm-unknown
b45ece
		os=-mingw32ce
b45ece
		;;
b45ece
	miniframe)
b45ece
		basic_machine=m68000-convergent
b45ece
		;;
b45ece
	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
b45ece
		basic_machine=m68k-atari
b45ece
		os=-mint
b45ece
		;;
b45ece
	mips3*-*)
b45ece
		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
b45ece
		;;
b45ece
	mips3*)
b45ece
		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
b45ece
		;;
b45ece
	monitor)
b45ece
		basic_machine=m68k-rom68k
b45ece
		os=-coff
b45ece
		;;
b45ece
	morphos)
b45ece
		basic_machine=powerpc-unknown
b45ece
		os=-morphos
b45ece
		;;
b45ece
	moxiebox)
b45ece
		basic_machine=moxie-unknown
b45ece
		os=-moxiebox
b45ece
		;;
b45ece
	msdos)
b45ece
		basic_machine=i386-pc
b45ece
		os=-msdos
b45ece
		;;
b45ece
	ms1-*)
b45ece
		basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
b45ece
		;;
b45ece
	msys)
b45ece
		basic_machine=i686-pc
b45ece
		os=-msys
b45ece
		;;
b45ece
	mvs)
b45ece
		basic_machine=i370-ibm
b45ece
		os=-mvs
b45ece
		;;
b45ece
	nacl)
b45ece
		basic_machine=le32-unknown
b45ece
		os=-nacl
b45ece
		;;
b45ece
	ncr3000)
b45ece
		basic_machine=i486-ncr
b45ece
		os=-sysv4
b45ece
		;;
b45ece
	netbsd386)
b45ece
		basic_machine=i386-unknown
b45ece
		os=-netbsd
b45ece
		;;
b45ece
	netwinder)
b45ece
		basic_machine=armv4l-rebel
b45ece
		os=-linux
b45ece
		;;
b45ece
	news | news700 | news800 | news900)
b45ece
		basic_machine=m68k-sony
b45ece
		os=-newsos
b45ece
		;;
b45ece
	news1000)
b45ece
		basic_machine=m68030-sony
b45ece
		os=-newsos
b45ece
		;;
b45ece
	news-3600 | risc-news)
b45ece
		basic_machine=mips-sony
b45ece
		os=-newsos
b45ece
		;;
b45ece
	necv70)
b45ece
		basic_machine=v70-nec
b45ece
		os=-sysv
b45ece
		;;
b45ece
	next | m*-next)
b45ece
		basic_machine=m68k-next
b45ece
		case $os in
b45ece
		    -nextstep* )
b45ece
			;;
b45ece
		    -ns2*)
b45ece
		      os=-nextstep2
b45ece
			;;
b45ece
		    *)
b45ece
		      os=-nextstep3
b45ece
			;;
b45ece
		esac
b45ece
		;;
b45ece
	nh3000)
b45ece
		basic_machine=m68k-harris
b45ece
		os=-cxux
b45ece
		;;
b45ece
	nh[45]000)
b45ece
		basic_machine=m88k-harris
b45ece
		os=-cxux
b45ece
		;;
b45ece
	nindy960)
b45ece
		basic_machine=i960-intel
b45ece
		os=-nindy
b45ece
		;;
b45ece
	mon960)
b45ece
		basic_machine=i960-intel
b45ece
		os=-mon960
b45ece
		;;
b45ece
	nonstopux)
b45ece
		basic_machine=mips-compaq
b45ece
		os=-nonstopux
b45ece
		;;
b45ece
	np1)
b45ece
		basic_machine=np1-gould
b45ece
		;;
b45ece
	neo-tandem)
b45ece
		basic_machine=neo-tandem
b45ece
		;;
b45ece
	nse-tandem)
b45ece
		basic_machine=nse-tandem
b45ece
		;;
b45ece
	nsr-tandem)
b45ece
		basic_machine=nsr-tandem
b45ece
		;;
b45ece
	nsv-tandem)
b45ece
		basic_machine=nsv-tandem
b45ece
		;;
b45ece
	nsx-tandem)
b45ece
		basic_machine=nsx-tandem
b45ece
		;;
b45ece
	op50n-* | op60c-*)
b45ece
		basic_machine=hppa1.1-oki
b45ece
		os=-proelf
b45ece
		;;
b45ece
	openrisc | openrisc-*)
b45ece
		basic_machine=or32-unknown
b45ece
		;;
b45ece
	os400)
b45ece
		basic_machine=powerpc-ibm
b45ece
		os=-os400
b45ece
		;;
b45ece
	OSE68000 | ose68000)
b45ece
		basic_machine=m68000-ericsson
b45ece
		os=-ose
b45ece
		;;
b45ece
	os68k)
b45ece
		basic_machine=m68k-none
b45ece
		os=-os68k
b45ece
		;;
b45ece
	pa-hitachi)
b45ece
		basic_machine=hppa1.1-hitachi
b45ece
		os=-hiuxwe2
b45ece
		;;
b45ece
	paragon)
b45ece
		basic_machine=i860-intel
b45ece
		os=-osf
b45ece
		;;
b45ece
	parisc)
b45ece
		basic_machine=hppa-unknown
b45ece
		os=-linux
b45ece
		;;
b45ece
	parisc-*)
b45ece
		basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		os=-linux
b45ece
		;;
b45ece
	pbd)
b45ece
		basic_machine=sparc-tti
b45ece
		;;
b45ece
	pbb)
b45ece
		basic_machine=m68k-tti
b45ece
		;;
b45ece
	pc532 | pc532-*)
b45ece
		basic_machine=ns32k-pc532
b45ece
		;;
b45ece
	pc98)
b45ece
		basic_machine=i386-pc
b45ece
		;;
b45ece
	pc98-*)
b45ece
		basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	pentium | p5 | k5 | k6 | nexgen | viac3)
b45ece
		basic_machine=i586-pc
b45ece
		;;
b45ece
	pentiumpro | p6 | 6x86 | athlon | athlon_*)
b45ece
		basic_machine=i686-pc
b45ece
		;;
b45ece
	pentiumii | pentium2 | pentiumiii | pentium3)
b45ece
		basic_machine=i686-pc
b45ece
		;;
b45ece
	pentium4)
b45ece
		basic_machine=i786-pc
b45ece
		;;
b45ece
	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
b45ece
		basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	pentiumpro-* | p6-* | 6x86-* | athlon-*)
b45ece
		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
b45ece
		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	pentium4-*)
b45ece
		basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	pn)
b45ece
		basic_machine=pn-gould
b45ece
		;;
b45ece
	power)	basic_machine=power-ibm
b45ece
		;;
b45ece
	ppc | ppcbe)	basic_machine=powerpc-unknown
b45ece
		;;
b45ece
	ppc-* | ppcbe-*)
b45ece
		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	ppcle | powerpclittle)
b45ece
		basic_machine=powerpcle-unknown
b45ece
		;;
b45ece
	ppcle-* | powerpclittle-*)
b45ece
		basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	ppc64)	basic_machine=powerpc64-unknown
b45ece
		;;
b45ece
	ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	ppc64le | powerpc64little)
b45ece
		basic_machine=powerpc64le-unknown
b45ece
		;;
b45ece
	ppc64le-* | powerpc64little-*)
b45ece
		basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	ps2)
b45ece
		basic_machine=i386-ibm
b45ece
		;;
b45ece
	pw32)
b45ece
		basic_machine=i586-unknown
b45ece
		os=-pw32
b45ece
		;;
b45ece
	rdos | rdos64)
b45ece
		basic_machine=x86_64-pc
b45ece
		os=-rdos
b45ece
		;;
b45ece
	rdos32)
b45ece
		basic_machine=i386-pc
b45ece
		os=-rdos
b45ece
		;;
b45ece
	rom68k)
b45ece
		basic_machine=m68k-rom68k
b45ece
		os=-coff
b45ece
		;;
b45ece
	rm[46]00)
b45ece
		basic_machine=mips-siemens
b45ece
		;;
b45ece
	rtpc | rtpc-*)
b45ece
		basic_machine=romp-ibm
b45ece
		;;
b45ece
	s390 | s390-*)
b45ece
		basic_machine=s390-ibm
b45ece
		;;
b45ece
	s390x | s390x-*)
b45ece
		basic_machine=s390x-ibm
b45ece
		;;
b45ece
	sa29200)
b45ece
		basic_machine=a29k-amd
b45ece
		os=-udi
b45ece
		;;
b45ece
	sb1)
b45ece
		basic_machine=mipsisa64sb1-unknown
b45ece
		;;
b45ece
	sb1el)
b45ece
		basic_machine=mipsisa64sb1el-unknown
b45ece
		;;
b45ece
	sde)
b45ece
		basic_machine=mipsisa32-sde
b45ece
		os=-elf
b45ece
		;;
b45ece
	sei)
b45ece
		basic_machine=mips-sei
b45ece
		os=-seiux
b45ece
		;;
b45ece
	sequent)
b45ece
		basic_machine=i386-sequent
b45ece
		;;
b45ece
	sh5el)
b45ece
		basic_machine=sh5le-unknown
b45ece
		;;
b45ece
	simso-wrs)
b45ece
		basic_machine=sparclite-wrs
b45ece
		os=-vxworks
b45ece
		;;
b45ece
	sps7)
b45ece
		basic_machine=m68k-bull
b45ece
		os=-sysv2
b45ece
		;;
b45ece
	spur)
b45ece
		basic_machine=spur-unknown
b45ece
		;;
b45ece
	st2000)
b45ece
		basic_machine=m68k-tandem
b45ece
		;;
b45ece
	stratus)
b45ece
		basic_machine=i860-stratus
b45ece
		os=-sysv4
b45ece
		;;
b45ece
	strongarm-* | thumb-*)
b45ece
		basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
b45ece
		;;
b45ece
	sun2)
b45ece
		basic_machine=m68000-sun
b45ece
		;;
b45ece
	sun2os3)
b45ece
		basic_machine=m68000-sun
b45ece
		os=-sunos3
b45ece
		;;
b45ece
	sun2os4)
b45ece
		basic_machine=m68000-sun
b45ece
		os=-sunos4
b45ece
		;;
b45ece
	sun3os3)
b45ece
		basic_machine=m68k-sun
b45ece
		os=-sunos3
b45ece
		;;
b45ece
	sun3os4)
b45ece
		basic_machine=m68k-sun
b45ece
		os=-sunos4
b45ece
		;;
b45ece
	sun4os3)
b45ece
		basic_machine=sparc-sun
b45ece
		os=-sunos3
b45ece
		;;
b45ece
	sun4os4)
b45ece
		basic_machine=sparc-sun
b45ece
		os=-sunos4
b45ece
		;;
b45ece
	sun4sol2)
b45ece
		basic_machine=sparc-sun
b45ece
		os=-solaris2
b45ece
		;;
b45ece
	sun3 | sun3-*)
b45ece
		basic_machine=m68k-sun
b45ece
		;;
b45ece
	sun4)
b45ece
		basic_machine=sparc-sun
b45ece
		;;
b45ece
	sun386 | sun386i | roadrunner)
b45ece
		basic_machine=i386-sun
b45ece
		;;
b45ece
	sv1)
b45ece
		basic_machine=sv1-cray
b45ece
		os=-unicos
b45ece
		;;
b45ece
	symmetry)
b45ece
		basic_machine=i386-sequent
b45ece
		os=-dynix
b45ece
		;;
b45ece
	t3e)
b45ece
		basic_machine=alphaev5-cray
b45ece
		os=-unicos
b45ece
		;;
b45ece
	t90)
b45ece
		basic_machine=t90-cray
b45ece
		os=-unicos
b45ece
		;;
b45ece
	tile*)
b45ece
		basic_machine=$basic_machine-unknown
b45ece
		os=-linux-gnu
b45ece
		;;
b45ece
	tx39)
b45ece
		basic_machine=mipstx39-unknown
b45ece
		;;
b45ece
	tx39el)
b45ece
		basic_machine=mipstx39el-unknown
b45ece
		;;
b45ece
	toad1)
b45ece
		basic_machine=pdp10-xkl
b45ece
		os=-tops20
b45ece
		;;
b45ece
	tower | tower-32)
b45ece
		basic_machine=m68k-ncr
b45ece
		;;
b45ece
	tpf)
b45ece
		basic_machine=s390x-ibm
b45ece
		os=-tpf
b45ece
		;;
b45ece
	udi29k)
b45ece
		basic_machine=a29k-amd
b45ece
		os=-udi
b45ece
		;;
b45ece
	ultra3)
b45ece
		basic_machine=a29k-nyu
b45ece
		os=-sym1
b45ece
		;;
b45ece
	v810 | necv810)
b45ece
		basic_machine=v810-nec
b45ece
		os=-none
b45ece
		;;
b45ece
	vaxv)
b45ece
		basic_machine=vax-dec
b45ece
		os=-sysv
b45ece
		;;
b45ece
	vms)
b45ece
		basic_machine=vax-dec
b45ece
		os=-vms
b45ece
		;;
b45ece
	vpp*|vx|vx-*)
b45ece
		basic_machine=f301-fujitsu
b45ece
		;;
b45ece
	vxworks960)
b45ece
		basic_machine=i960-wrs
b45ece
		os=-vxworks
b45ece
		;;
b45ece
	vxworks68)
b45ece
		basic_machine=m68k-wrs
b45ece
		os=-vxworks
b45ece
		;;
b45ece
	vxworks29k)
b45ece
		basic_machine=a29k-wrs
b45ece
		os=-vxworks
b45ece
		;;
b45ece
	w65*)
b45ece
		basic_machine=w65-wdc
b45ece
		os=-none
b45ece
		;;
b45ece
	w89k-*)
b45ece
		basic_machine=hppa1.1-winbond
b45ece
		os=-proelf
b45ece
		;;
b45ece
	x64)
b45ece
		basic_machine=x86_64-pc
b45ece
		;;
b45ece
	xbox)
b45ece
		basic_machine=i686-pc
b45ece
		os=-mingw32
b45ece
		;;
b45ece
	xps | xps100)
b45ece
		basic_machine=xps100-honeywell
b45ece
		;;
b45ece
	xscale-* | xscalee[bl]-*)
b45ece
		basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
b45ece
		;;
b45ece
	ymp)
b45ece
		basic_machine=ymp-cray
b45ece
		os=-unicos
b45ece
		;;
b45ece
	none)
b45ece
		basic_machine=none-none
b45ece
		os=-none
b45ece
		;;
b45ece
b45ece
# Here we handle the default manufacturer of certain CPU types.  It is in
b45ece
# some cases the only manufacturer, in others, it is the most popular.
b45ece
	w89k)
b45ece
		basic_machine=hppa1.1-winbond
b45ece
		;;
b45ece
	op50n)
b45ece
		basic_machine=hppa1.1-oki
b45ece
		;;
b45ece
	op60c)
b45ece
		basic_machine=hppa1.1-oki
b45ece
		;;
b45ece
	romp)
b45ece
		basic_machine=romp-ibm
b45ece
		;;
b45ece
	mmix)
b45ece
		basic_machine=mmix-knuth
b45ece
		;;
b45ece
	rs6000)
b45ece
		basic_machine=rs6000-ibm
b45ece
		;;
b45ece
	vax)
b45ece
		basic_machine=vax-dec
b45ece
		;;
b45ece
	pdp11)
b45ece
		basic_machine=pdp11-dec
b45ece
		;;
b45ece
	we32k)
b45ece
		basic_machine=we32k-att
b45ece
		;;
b45ece
	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
b45ece
		basic_machine=sh-unknown
b45ece
		;;
b45ece
	cydra)
b45ece
		basic_machine=cydra-cydrome
b45ece
		;;
b45ece
	orion)
b45ece
		basic_machine=orion-highlevel
b45ece
		;;
b45ece
	orion105)
b45ece
		basic_machine=clipper-highlevel
b45ece
		;;
b45ece
	mac | mpw | mac-mpw)
b45ece
		basic_machine=m68k-apple
b45ece
		;;
b45ece
	pmac | pmac-mpw)
b45ece
		basic_machine=powerpc-apple
b45ece
		;;
b45ece
	*-unknown)
b45ece
		# Make sure to match an already-canonicalized machine name.
b45ece
		;;
b45ece
	*)
b45ece
		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
b45ece
		exit 1
b45ece
		;;
b45ece
esac
b45ece
b45ece
# Here we canonicalize certain aliases for manufacturers.
b45ece
case $basic_machine in
b45ece
	*-digital*)
b45ece
		basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
b45ece
		;;
b45ece
	*-commodore*)
b45ece
		basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
b45ece
		;;
b45ece
	*)
b45ece
		;;
b45ece
esac
b45ece
b45ece
# Decode manufacturer-specific aliases for certain operating systems.
b45ece
b45ece
if [ x$os != x ]
b45ece
then
b45ece
case $os in
b45ece
	# First match some system type aliases that might get confused
b45ece
	# with valid system types.
b45ece
	# -solaris* is a basic system type, with this one exception.
b45ece
	-auroraux)
b45ece
		os=-auroraux
b45ece
		;;
b45ece
	-solaris1 | -solaris1.*)
b45ece
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
b45ece
		;;
b45ece
	-solaris)
b45ece
		os=-solaris2
b45ece
		;;
b45ece
	-unixware*)
b45ece
		os=-sysv4.2uw
b45ece
		;;
b45ece
	-gnu/linux*)
b45ece
		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
b45ece
		;;
b45ece
	# es1800 is here to avoid being matched by es* (a different OS)
b45ece
	-es1800*)
b45ece
		os=-ose
b45ece
		;;
b45ece
	# Now accept the basic system types.
b45ece
	# The portable systems comes first.
b45ece
	# Each alternative MUST end in a * to match a version number.
b45ece
	# -sysv* is not here because it comes later, after sysvr4.
b45ece
	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
b45ece
	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
b45ece
	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
b45ece
	      | -sym* | -kopensolaris* | -plan9* \
b45ece
	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
b45ece
	      | -aos* | -aros* | -cloudabi* | -sortix* \
b45ece
	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
b45ece
	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
b45ece
	      | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
b45ece
	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
b45ece
	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
b45ece
	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
b45ece
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
b45ece
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
b45ece
	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
b45ece
	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
b45ece
	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
b45ece
	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
b45ece
	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
b45ece
	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
b45ece
	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
b45ece
	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
b45ece
	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
b45ece
	      | -morphos* | -superux* | -rtmk* | -windiss* \
b45ece
	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
b45ece
	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
b45ece
	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
b45ece
	      | -midnightbsd*)
b45ece
	# Remember, each alternative MUST END IN *, to match a version number.
b45ece
		;;
b45ece
	-qnx*)
b45ece
		case $basic_machine in
b45ece
		    x86-* | i*86-*)
b45ece
			;;
b45ece
		    *)
b45ece
			os=-nto$os
b45ece
			;;
b45ece
		esac
b45ece
		;;
b45ece
	-nto-qnx*)
b45ece
		;;
b45ece
	-nto*)
b45ece
		os=`echo $os | sed -e 's|nto|nto-qnx|'`
b45ece
		;;
b45ece
	-sim | -xray | -os68k* | -v88r* \
b45ece
	      | -windows* | -osx | -abug | -netware* | -os9* \
b45ece
	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
b45ece
		;;
b45ece
	-mac*)
b45ece
		os=`echo "$os" | sed -e 's|mac|macos|'`
b45ece
		;;
b45ece
	-linux-dietlibc)
b45ece
		os=-linux-dietlibc
b45ece
		;;
b45ece
	-linux*)
b45ece
		os=`echo $os | sed -e 's|linux|linux-gnu|'`
b45ece
		;;
b45ece
	-sunos5*)
b45ece
		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
b45ece
		;;
b45ece
	-sunos6*)
b45ece
		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
b45ece
		;;
b45ece
	-opened*)
b45ece
		os=-openedition
b45ece
		;;
b45ece
	-os400*)
b45ece
		os=-os400
b45ece
		;;
b45ece
	-wince*)
b45ece
		os=-wince
b45ece
		;;
b45ece
	-utek*)
b45ece
		os=-bsd
b45ece
		;;
b45ece
	-dynix*)
b45ece
		os=-bsd
b45ece
		;;
b45ece
	-acis*)
b45ece
		os=-aos
b45ece
		;;
b45ece
	-atheos*)
b45ece
		os=-atheos
b45ece
		;;
b45ece
	-syllable*)
b45ece
		os=-syllable
b45ece
		;;
b45ece
	-386bsd)
b45ece
		os=-bsd
b45ece
		;;
b45ece
	-ctix* | -uts*)
b45ece
		os=-sysv
b45ece
		;;
b45ece
	-nova*)
b45ece
		os=-rtmk-nova
b45ece
		;;
b45ece
	-ns2)
b45ece
		os=-nextstep2
b45ece
		;;
b45ece
	-nsk*)
b45ece
		os=-nsk
b45ece
		;;
b45ece
	# Preserve the version number of sinix5.
b45ece
	-sinix5.*)
b45ece
		os=`echo $os | sed -e 's|sinix|sysv|'`
b45ece
		;;
b45ece
	-sinix*)
b45ece
		os=-sysv4
b45ece
		;;
b45ece
	-tpf*)
b45ece
		os=-tpf
b45ece
		;;
b45ece
	-triton*)
b45ece
		os=-sysv3
b45ece
		;;
b45ece
	-oss*)
b45ece
		os=-sysv3
b45ece
		;;
b45ece
	-svr4*)
b45ece
		os=-sysv4
b45ece
		;;
b45ece
	-svr3)
b45ece
		os=-sysv3
b45ece
		;;
b45ece
	-sysvr4)
b45ece
		os=-sysv4
b45ece
		;;
b45ece
	# This must come after -sysvr4.
b45ece
	-sysv*)
b45ece
		;;
b45ece
	-ose*)
b45ece
		os=-ose
b45ece
		;;
b45ece
	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
b45ece
		os=-mint
b45ece
		;;
b45ece
	-zvmoe)
b45ece
		os=-zvmoe
b45ece
		;;
b45ece
	-dicos*)
b45ece
		os=-dicos
b45ece
		;;
b45ece
	-pikeos*)
b45ece
		# Until real need of OS specific support for
b45ece
		# particular features comes up, bare metal
b45ece
		# configurations are quite functional.
b45ece
		case $basic_machine in
b45ece
		    arm*)
b45ece
			os=-eabi
b45ece
			;;
b45ece
		    *)
b45ece
			os=-elf
b45ece
			;;
b45ece
		esac
b45ece
		;;
b45ece
	-nacl*)
b45ece
		;;
b45ece
	-ios)
b45ece
		;;
b45ece
	-none)
b45ece
		;;
b45ece
	-*-eabi)
b45ece
		case $basic_machine in
b45ece
		    arm*)
b45ece
			;;
b45ece
		esac
b45ece
		;;
b45ece
	*)
b45ece
		# Get rid of the `-' at the beginning of $os.
b45ece
		os=`echo $os | sed 's/[^-]*-//'`
b45ece
		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
b45ece
		exit 1
b45ece
		;;
b45ece
esac
b45ece
else
b45ece
b45ece
# Here we handle the default operating systems that come with various machines.
b45ece
# The value should be what the vendor currently ships out the door with their
b45ece
# machine or put another way, the most popular os provided with the machine.
b45ece
b45ece
# Note that if you're going to try to match "-MANUFACTURER" here (say,
b45ece
# "-sun"), then you have to tell the case statement up towards the top
b45ece
# that MANUFACTURER isn't an operating system.  Otherwise, code above
b45ece
# will signal an error saying that MANUFACTURER isn't an operating
b45ece
# system, and we'll never get to this point.
b45ece
b45ece
case $basic_machine in
b45ece
	score-*)
b45ece
		os=-elf
b45ece
		;;
b45ece
	spu-*)
b45ece
		os=-elf
b45ece
		;;
b45ece
	*-acorn)
b45ece
		os=-riscix1.2
b45ece
		;;
b45ece
	arm*-rebel)
b45ece
		os=-linux
b45ece
		;;
b45ece
	arm*-semi)
b45ece
		os=-aout
b45ece
		;;
b45ece
	c4x-* | tic4x-*)
b45ece
		os=-coff
b45ece
		;;
b45ece
	c8051-*)
b45ece
		os=-elf
b45ece
		;;
b45ece
	hexagon-*)
b45ece
		os=-elf
b45ece
		;;
b45ece
	tic54x-*)
b45ece
		os=-coff
b45ece
		;;
b45ece
	tic55x-*)
b45ece
		os=-coff
b45ece
		;;
b45ece
	tic6x-*)
b45ece
		os=-coff
b45ece
		;;
b45ece
	# This must come before the *-dec entry.
b45ece
	pdp10-*)
b45ece
		os=-tops20
b45ece
		;;
b45ece
	pdp11-*)
b45ece
		os=-none
b45ece
		;;
b45ece
	*-dec | vax-*)
b45ece
		os=-ultrix4.2
b45ece
		;;
b45ece
	m68*-apollo)
b45ece
		os=-domain
b45ece
		;;
b45ece
	i386-sun)
b45ece
		os=-sunos4.0.2
b45ece
		;;
b45ece
	m68000-sun)
b45ece
		os=-sunos3
b45ece
		;;
b45ece
	m68*-cisco)
b45ece
		os=-aout
b45ece
		;;
b45ece
	mep-*)
b45ece
		os=-elf
b45ece
		;;
b45ece
	mips*-cisco)
b45ece
		os=-elf
b45ece
		;;
b45ece
	mips*-*)
b45ece
		os=-elf
b45ece
		;;
b45ece
	or32-*)
b45ece
		os=-coff
b45ece
		;;
b45ece
	*-tti)	# must be before sparc entry or we get the wrong os.
b45ece
		os=-sysv3
b45ece
		;;
b45ece
	sparc-* | *-sun)
b45ece
		os=-sunos4.1.1
b45ece
		;;
b45ece
	pru-*)
b45ece
		os=-elf
b45ece
		;;
b45ece
	*-be)
b45ece
		os=-beos
b45ece
		;;
b45ece
	*-ibm)
b45ece
		os=-aix
b45ece
		;;
b45ece
	*-knuth)
b45ece
		os=-mmixware
b45ece
		;;
b45ece
	*-wec)
b45ece
		os=-proelf
b45ece
		;;
b45ece
	*-winbond)
b45ece
		os=-proelf
b45ece
		;;
b45ece
	*-oki)
b45ece
		os=-proelf
b45ece
		;;
b45ece
	*-hp)
b45ece
		os=-hpux
b45ece
		;;
b45ece
	*-hitachi)
b45ece
		os=-hiux
b45ece
		;;
b45ece
	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
b45ece
		os=-sysv
b45ece
		;;
b45ece
	*-cbm)
b45ece
		os=-amigaos
b45ece
		;;
b45ece
	*-dg)
b45ece
		os=-dgux
b45ece
		;;
b45ece
	*-dolphin)
b45ece
		os=-sysv3
b45ece
		;;
b45ece
	m68k-ccur)
b45ece
		os=-rtu
b45ece
		;;
b45ece
	m88k-omron*)
b45ece
		os=-luna
b45ece
		;;
b45ece
	*-next)
b45ece
		os=-nextstep
b45ece
		;;
b45ece
	*-sequent)
b45ece
		os=-ptx
b45ece
		;;
b45ece
	*-crds)
b45ece
		os=-unos
b45ece
		;;
b45ece
	*-ns)
b45ece
		os=-genix
b45ece
		;;
b45ece
	i370-*)
b45ece
		os=-mvs
b45ece
		;;
b45ece
	*-gould)
b45ece
		os=-sysv
b45ece
		;;
b45ece
	*-highlevel)
b45ece
		os=-bsd
b45ece
		;;
b45ece
	*-encore)
b45ece
		os=-bsd
b45ece
		;;
b45ece
	*-sgi)
b45ece
		os=-irix
b45ece
		;;
b45ece
	*-siemens)
b45ece
		os=-sysv4
b45ece
		;;
b45ece
	*-masscomp)
b45ece
		os=-rtu
b45ece
		;;
b45ece
	f30[01]-fujitsu | f700-fujitsu)
b45ece
		os=-uxpv
b45ece
		;;
b45ece
	*-rom68k)
b45ece
		os=-coff
b45ece
		;;
b45ece
	*-*bug)
b45ece
		os=-coff
b45ece
		;;
b45ece
	*-apple)
b45ece
		os=-macos
b45ece
		;;
b45ece
	*-atari*)
b45ece
		os=-mint
b45ece
		;;
b45ece
	*)
b45ece
		os=-none
b45ece
		;;
b45ece
esac
b45ece
fi
b45ece
b45ece
# Here we handle the case where we know the os, and the CPU type, but not the
b45ece
# manufacturer.  We pick the logical manufacturer.
b45ece
vendor=unknown
b45ece
case $basic_machine in
b45ece
	*-unknown)
b45ece
		case $os in
b45ece
			-riscix*)
b45ece
				vendor=acorn
b45ece
				;;
b45ece
			-sunos*)
b45ece
				vendor=sun
b45ece
				;;
b45ece
			-cnk*|-aix*)
b45ece
				vendor=ibm
b45ece
				;;
b45ece
			-beos*)
b45ece
				vendor=be
b45ece
				;;
b45ece
			-hpux*)
b45ece
				vendor=hp
b45ece
				;;
b45ece
			-mpeix*)
b45ece
				vendor=hp
b45ece
				;;
b45ece
			-hiux*)
b45ece
				vendor=hitachi
b45ece
				;;
b45ece
			-unos*)
b45ece
				vendor=crds
b45ece
				;;
b45ece
			-dgux*)
b45ece
				vendor=dg
b45ece
				;;
b45ece
			-luna*)
b45ece
				vendor=omron
b45ece
				;;
b45ece
			-genix*)
b45ece
				vendor=ns
b45ece
				;;
b45ece
			-mvs* | -opened*)
b45ece
				vendor=ibm
b45ece
				;;
b45ece
			-os400*)
b45ece
				vendor=ibm
b45ece
				;;
b45ece
			-ptx*)
b45ece
				vendor=sequent
b45ece
				;;
b45ece
			-tpf*)
b45ece
				vendor=ibm
b45ece
				;;
b45ece
			-vxsim* | -vxworks* | -windiss*)
b45ece
				vendor=wrs
b45ece
				;;
b45ece
			-aux*)
b45ece
				vendor=apple
b45ece
				;;
b45ece
			-hms*)
b45ece
				vendor=hitachi
b45ece
				;;
b45ece
			-mpw* | -macos*)
b45ece
				vendor=apple
b45ece
				;;
b45ece
			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
b45ece
				vendor=atari
b45ece
				;;
b45ece
			-vos*)
b45ece
				vendor=stratus
b45ece
				;;
b45ece
		esac
b45ece
		basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
b45ece
		;;
b45ece
esac
b45ece
b45ece
echo "$basic_machine$os"
b45ece
exit
b45ece
b45ece
# Local variables:
b45ece
# eval: (add-hook 'before-save-hook 'time-stamp)
b45ece
# time-stamp-start: "timestamp='"
b45ece
# time-stamp-format: "%:y-%02m-%02d"
b45ece
# time-stamp-end: "'"
b45ece
# End: