Blame SOURCES/config.sub

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