Blame SOURCES/config.sub

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