Blame SOURCES/config.sub

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