Blame SOURCES/config.sub

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