config.sub revision 1f27ce9a
16df26cacSmrg#! /bin/sh
26df26cacSmrg# Configuration validation subroutine script.
36df26cacSmrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
41f27ce9aSmrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5b68e1f86Smrg#   Free Software Foundation, Inc.
66df26cacSmrg
71f27ce9aSmrgtimestamp='2009-11-20'
86df26cacSmrg
96df26cacSmrg# This file is (in principle) common to ALL GNU software.
106df26cacSmrg# The presence of a machine in this file suggests that SOME GNU software
116df26cacSmrg# can handle that machine.  It does not imply ALL GNU software can.
126df26cacSmrg#
136df26cacSmrg# This file is free software; you can redistribute it and/or modify
146df26cacSmrg# it under the terms of the GNU General Public License as published by
156df26cacSmrg# the Free Software Foundation; either version 2 of the License, or
166df26cacSmrg# (at your option) any later version.
176df26cacSmrg#
186df26cacSmrg# This program is distributed in the hope that it will be useful,
196df26cacSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
206df26cacSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
216df26cacSmrg# GNU General Public License for more details.
226df26cacSmrg#
236df26cacSmrg# You should have received a copy of the GNU General Public License
246df26cacSmrg# along with this program; if not, write to the Free Software
256df26cacSmrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
266df26cacSmrg# 02110-1301, USA.
276df26cacSmrg#
286df26cacSmrg# As a special exception to the GNU General Public License, if you
296df26cacSmrg# distribute this file as part of a program that contains a
306df26cacSmrg# configuration script generated by Autoconf, you may include it under
316df26cacSmrg# the same distribution terms that you use for the rest of that program.
326df26cacSmrg
336df26cacSmrg
346df26cacSmrg# Please send patches to <config-patches@gnu.org>.  Submit a context
351f27ce9aSmrg# diff and a properly formatted GNU ChangeLog entry.
366df26cacSmrg#
376df26cacSmrg# Configuration subroutine to validate and canonicalize a configuration type.
386df26cacSmrg# Supply the specified configuration type as an argument.
396df26cacSmrg# If it is invalid, we print an error message on stderr and exit with code 1.
406df26cacSmrg# Otherwise, we print the canonical config type on stdout and succeed.
416df26cacSmrg
421f27ce9aSmrg# You can get the latest version of this script from:
431f27ce9aSmrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
441f27ce9aSmrg
456df26cacSmrg# This file is supposed to be the same for all GNU packages
466df26cacSmrg# and recognize all the CPU types, system types and aliases
476df26cacSmrg# that are meaningful with *any* GNU software.
486df26cacSmrg# Each package is responsible for reporting which valid configurations
496df26cacSmrg# it does not support.  The user should be able to distinguish
506df26cacSmrg# a failure to support a valid configuration from a meaningless
516df26cacSmrg# configuration.
526df26cacSmrg
536df26cacSmrg# The goal of this file is to map all the various variations of a given
546df26cacSmrg# machine specification into a single specification in the form:
556df26cacSmrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
566df26cacSmrg# or in some cases, the newer four-part form:
576df26cacSmrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
586df26cacSmrg# It is wrong to echo any other type of specification.
596df26cacSmrg
606df26cacSmrgme=`echo "$0" | sed -e 's,.*/,,'`
616df26cacSmrg
626df26cacSmrgusage="\
636df26cacSmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
646df26cacSmrg       $0 [OPTION] ALIAS
656df26cacSmrg
666df26cacSmrgCanonicalize a configuration name.
676df26cacSmrg
686df26cacSmrgOperation modes:
696df26cacSmrg  -h, --help         print this help, then exit
706df26cacSmrg  -t, --time-stamp   print date of last modification, then exit
716df26cacSmrg  -v, --version      print version number, then exit
726df26cacSmrg
736df26cacSmrgReport bugs and patches to <config-patches@gnu.org>."
746df26cacSmrg
756df26cacSmrgversion="\
766df26cacSmrgGNU config.sub ($timestamp)
776df26cacSmrg
78b68e1f86SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
79b68e1f86Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
806df26cacSmrg
816df26cacSmrgThis is free software; see the source for copying conditions.  There is NO
826df26cacSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
836df26cacSmrg
846df26cacSmrghelp="
856df26cacSmrgTry \`$me --help' for more information."
866df26cacSmrg
876df26cacSmrg# Parse command line
886df26cacSmrgwhile test $# -gt 0 ; do
896df26cacSmrg  case $1 in
906df26cacSmrg    --time-stamp | --time* | -t )
916df26cacSmrg       echo "$timestamp" ; exit ;;
926df26cacSmrg    --version | -v )
936df26cacSmrg       echo "$version" ; exit ;;
946df26cacSmrg    --help | --h* | -h )
956df26cacSmrg       echo "$usage"; exit ;;
966df26cacSmrg    -- )     # Stop option processing
976df26cacSmrg       shift; break ;;
986df26cacSmrg    - )	# Use stdin as input.
996df26cacSmrg       break ;;
1006df26cacSmrg    -* )
1016df26cacSmrg       echo "$me: invalid option $1$help"
1026df26cacSmrg       exit 1 ;;
1036df26cacSmrg
1046df26cacSmrg    *local*)
1056df26cacSmrg       # First pass through any local machine types.
1066df26cacSmrg       echo $1
1076df26cacSmrg       exit ;;
1086df26cacSmrg
1096df26cacSmrg    * )
1106df26cacSmrg       break ;;
1116df26cacSmrg  esac
1126df26cacSmrgdone
1136df26cacSmrg
1146df26cacSmrgcase $# in
1156df26cacSmrg 0) echo "$me: missing argument$help" >&2
1166df26cacSmrg    exit 1;;
1176df26cacSmrg 1) ;;
1186df26cacSmrg *) echo "$me: too many arguments$help" >&2
1196df26cacSmrg    exit 1;;
1206df26cacSmrgesac
1216df26cacSmrg
1226df26cacSmrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1236df26cacSmrg# Here we must recognize all the valid KERNEL-OS combinations.
1246df26cacSmrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1256df26cacSmrgcase $maybe_os in
1266df26cacSmrg  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
1276df26cacSmrg  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
1281f27ce9aSmrg  kopensolaris*-gnu* | \
1296df26cacSmrg  storm-chaos* | os2-emx* | rtmk-nova*)
1306df26cacSmrg    os=-$maybe_os
1316df26cacSmrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1326df26cacSmrg    ;;
1336df26cacSmrg  *)
1346df26cacSmrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1356df26cacSmrg    if [ $basic_machine != $1 ]
1366df26cacSmrg    then os=`echo $1 | sed 's/.*-/-/'`
1376df26cacSmrg    else os=; fi
1386df26cacSmrg    ;;
1396df26cacSmrgesac
1406df26cacSmrg
1416df26cacSmrg### Let's recognize common machines as not being operating systems so
1426df26cacSmrg### that things like config.sub decstation-3100 work.  We also
1436df26cacSmrg### recognize some manufacturers as not being operating systems, so we
1446df26cacSmrg### can provide default operating systems below.
1456df26cacSmrgcase $os in
1466df26cacSmrg	-sun*os*)
1476df26cacSmrg		# Prevent following clause from handling this invalid input.
1486df26cacSmrg		;;
1496df26cacSmrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
1506df26cacSmrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
1516df26cacSmrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
1526df26cacSmrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1536df26cacSmrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1546df26cacSmrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
1551f27ce9aSmrg	-apple | -axis | -knuth | -cray | -microblaze)
1566df26cacSmrg		os=
1576df26cacSmrg		basic_machine=$1
1586df26cacSmrg		;;
1591f27ce9aSmrg        -bluegene*)
1601f27ce9aSmrg	        os=-cnk
1611f27ce9aSmrg		;;
1626df26cacSmrg	-sim | -cisco | -oki | -wec | -winbond)
1636df26cacSmrg		os=
1646df26cacSmrg		basic_machine=$1
1656df26cacSmrg		;;
1666df26cacSmrg	-scout)
1676df26cacSmrg		;;
1686df26cacSmrg	-wrs)
1696df26cacSmrg		os=-vxworks
1706df26cacSmrg		basic_machine=$1
1716df26cacSmrg		;;
1726df26cacSmrg	-chorusos*)
1736df26cacSmrg		os=-chorusos
1746df26cacSmrg		basic_machine=$1
1756df26cacSmrg		;;
1766df26cacSmrg 	-chorusrdb)
1776df26cacSmrg 		os=-chorusrdb
1786df26cacSmrg		basic_machine=$1
1796df26cacSmrg 		;;
1806df26cacSmrg	-hiux*)
1816df26cacSmrg		os=-hiuxwe2
1826df26cacSmrg		;;
1836df26cacSmrg	-sco6)
1846df26cacSmrg		os=-sco5v6
1856df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1866df26cacSmrg		;;
1876df26cacSmrg	-sco5)
1886df26cacSmrg		os=-sco3.2v5
1896df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1906df26cacSmrg		;;
1916df26cacSmrg	-sco4)
1926df26cacSmrg		os=-sco3.2v4
1936df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1946df26cacSmrg		;;
1956df26cacSmrg	-sco3.2.[4-9]*)
1966df26cacSmrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1976df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1986df26cacSmrg		;;
1996df26cacSmrg	-sco3.2v[4-9]*)
2006df26cacSmrg		# Don't forget version if it is 3.2v4 or newer.
2016df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2026df26cacSmrg		;;
2036df26cacSmrg	-sco5v6*)
2046df26cacSmrg		# Don't forget version if it is 3.2v4 or newer.
2056df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2066df26cacSmrg		;;
2076df26cacSmrg	-sco*)
2086df26cacSmrg		os=-sco3.2v2
2096df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2106df26cacSmrg		;;
2116df26cacSmrg	-udk*)
2126df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2136df26cacSmrg		;;
2146df26cacSmrg	-isc)
2156df26cacSmrg		os=-isc2.2
2166df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2176df26cacSmrg		;;
2186df26cacSmrg	-clix*)
2196df26cacSmrg		basic_machine=clipper-intergraph
2206df26cacSmrg		;;
2216df26cacSmrg	-isc*)
2226df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2236df26cacSmrg		;;
2246df26cacSmrg	-lynx*)
2256df26cacSmrg		os=-lynxos
2266df26cacSmrg		;;
2276df26cacSmrg	-ptx*)
2286df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
2296df26cacSmrg		;;
2306df26cacSmrg	-windowsnt*)
2316df26cacSmrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
2326df26cacSmrg		;;
2336df26cacSmrg	-psos*)
2346df26cacSmrg		os=-psos
2356df26cacSmrg		;;
2366df26cacSmrg	-mint | -mint[0-9]*)
2376df26cacSmrg		basic_machine=m68k-atari
2386df26cacSmrg		os=-mint
2396df26cacSmrg		;;
2406df26cacSmrgesac
2416df26cacSmrg
2426df26cacSmrg# Decode aliases for certain CPU-COMPANY combinations.
2436df26cacSmrgcase $basic_machine in
2446df26cacSmrg	# Recognize the basic CPU types without company name.
2456df26cacSmrg	# Some are omitted here because they have special meanings below.
2466df26cacSmrg	1750a | 580 \
2476df26cacSmrg	| a29k \
2486df26cacSmrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
2496df26cacSmrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
2506df26cacSmrg	| am33_2.0 \
2516df26cacSmrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
2526df26cacSmrg	| bfin \
2536df26cacSmrg	| c4x | clipper \
2546df26cacSmrg	| d10v | d30v | dlx | dsp16xx \
25516fd1166Smrg	| fido | fr30 | frv \
2566df26cacSmrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
2576df26cacSmrg	| i370 | i860 | i960 | ia64 \
2586df26cacSmrg	| ip2k | iq2000 \
2591f27ce9aSmrg	| lm32 \
2606df26cacSmrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
2611f27ce9aSmrg	| maxq | mb | microblaze | mcore | mep | metag \
2626df26cacSmrg	| mips | mipsbe | mipseb | mipsel | mipsle \
2636df26cacSmrg	| mips16 \
2646df26cacSmrg	| mips64 | mips64el \
2651f27ce9aSmrg	| mips64octeon | mips64octeonel \
2666df26cacSmrg	| mips64orion | mips64orionel \
2671f27ce9aSmrg	| mips64r5900 | mips64r5900el \
2681f27ce9aSmrg	| mips64vr | mips64vrel \
2696df26cacSmrg	| mips64vr4100 | mips64vr4100el \
2706df26cacSmrg	| mips64vr4300 | mips64vr4300el \
2716df26cacSmrg	| mips64vr5000 | mips64vr5000el \
2726df26cacSmrg	| mips64vr5900 | mips64vr5900el \
2736df26cacSmrg	| mipsisa32 | mipsisa32el \
2746df26cacSmrg	| mipsisa32r2 | mipsisa32r2el \
2756df26cacSmrg	| mipsisa64 | mipsisa64el \
2766df26cacSmrg	| mipsisa64r2 | mipsisa64r2el \
2776df26cacSmrg	| mipsisa64sb1 | mipsisa64sb1el \
2786df26cacSmrg	| mipsisa64sr71k | mipsisa64sr71kel \
2796df26cacSmrg	| mipstx39 | mipstx39el \
2806df26cacSmrg	| mn10200 | mn10300 \
2811f27ce9aSmrg	| moxie \
2826df26cacSmrg	| mt \
2836df26cacSmrg	| msp430 \
2846df26cacSmrg	| nios | nios2 \
2856df26cacSmrg	| ns16k | ns32k \
2866df26cacSmrg	| or32 \
2876df26cacSmrg	| pdp10 | pdp11 | pj | pjl \
2886df26cacSmrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
2896df26cacSmrg	| pyramid \
2901f27ce9aSmrg	| rx \
2916df26cacSmrg	| score \
2921f27ce9aSmrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
2936df26cacSmrg	| sh64 | sh64le \
2946df26cacSmrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
2956df26cacSmrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
2966df26cacSmrg	| spu | strongarm \
2976df26cacSmrg	| tahoe | thumb | tic4x | tic80 | tron \
2981f27ce9aSmrg	| ubicom32 \
2996df26cacSmrg	| v850 | v850e \
3006df26cacSmrg	| we32k \
3016df26cacSmrg	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
3021f27ce9aSmrg	| z8k | z80)
3036df26cacSmrg		basic_machine=$basic_machine-unknown
3046df26cacSmrg		;;
3051f27ce9aSmrg	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
3066df26cacSmrg		# Motorola 68HC11/12.
3076df26cacSmrg		basic_machine=$basic_machine-unknown
3086df26cacSmrg		os=-none
3096df26cacSmrg		;;
3106df26cacSmrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
3116df26cacSmrg		;;
3126df26cacSmrg	ms1)
3136df26cacSmrg		basic_machine=mt-unknown
3146df26cacSmrg		;;
3156df26cacSmrg
3166df26cacSmrg	# We use `pc' rather than `unknown'
3176df26cacSmrg	# because (1) that's what they normally are, and
3186df26cacSmrg	# (2) the word "unknown" tends to confuse beginning users.
3196df26cacSmrg	i*86 | x86_64)
3206df26cacSmrg	  basic_machine=$basic_machine-pc
3216df26cacSmrg	  ;;
3226df26cacSmrg	# Object if more than one company name word.
3236df26cacSmrg	*-*-*)
3246df26cacSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
3256df26cacSmrg		exit 1
3266df26cacSmrg		;;
3276df26cacSmrg	# Recognize the basic CPU types with company name.
3286df26cacSmrg	580-* \
3296df26cacSmrg	| a29k-* \
3306df26cacSmrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
3316df26cacSmrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
3326df26cacSmrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
3336df26cacSmrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3346df26cacSmrg	| avr-* | avr32-* \
3356df26cacSmrg	| bfin-* | bs2000-* \
3366df26cacSmrg	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
3376df26cacSmrg	| clipper-* | craynv-* | cydra-* \
3386df26cacSmrg	| d10v-* | d30v-* | dlx-* \
3396df26cacSmrg	| elxsi-* \
34016fd1166Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
3416df26cacSmrg	| h8300-* | h8500-* \
3426df26cacSmrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
3436df26cacSmrg	| i*86-* | i860-* | i960-* | ia64-* \
3446df26cacSmrg	| ip2k-* | iq2000-* \
3451f27ce9aSmrg	| lm32-* \
3466df26cacSmrg	| m32c-* | m32r-* | m32rle-* \
3476df26cacSmrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
3481f27ce9aSmrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
3496df26cacSmrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
3506df26cacSmrg	| mips16-* \
3516df26cacSmrg	| mips64-* | mips64el-* \
3521f27ce9aSmrg	| mips64octeon-* | mips64octeonel-* \
3536df26cacSmrg	| mips64orion-* | mips64orionel-* \
3541f27ce9aSmrg	| mips64r5900-* | mips64r5900el-* \
3551f27ce9aSmrg	| mips64vr-* | mips64vrel-* \
3566df26cacSmrg	| mips64vr4100-* | mips64vr4100el-* \
3576df26cacSmrg	| mips64vr4300-* | mips64vr4300el-* \
3586df26cacSmrg	| mips64vr5000-* | mips64vr5000el-* \
3596df26cacSmrg	| mips64vr5900-* | mips64vr5900el-* \
3606df26cacSmrg	| mipsisa32-* | mipsisa32el-* \
3616df26cacSmrg	| mipsisa32r2-* | mipsisa32r2el-* \
3626df26cacSmrg	| mipsisa64-* | mipsisa64el-* \
3636df26cacSmrg	| mipsisa64r2-* | mipsisa64r2el-* \
3646df26cacSmrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
3656df26cacSmrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
3666df26cacSmrg	| mipstx39-* | mipstx39el-* \
3676df26cacSmrg	| mmix-* \
3686df26cacSmrg	| mt-* \
3696df26cacSmrg	| msp430-* \
3706df26cacSmrg	| nios-* | nios2-* \
3716df26cacSmrg	| none-* | np1-* | ns16k-* | ns32k-* \
3726df26cacSmrg	| orion-* \
3736df26cacSmrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
3746df26cacSmrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
3756df26cacSmrg	| pyramid-* \
3761f27ce9aSmrg	| romp-* | rs6000-* | rx-* \
3771f27ce9aSmrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
3786df26cacSmrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
3796df26cacSmrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
3806df26cacSmrg	| sparclite-* \
3816df26cacSmrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
3826df26cacSmrg	| tahoe-* | thumb-* \
3831f27ce9aSmrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
3846df26cacSmrg	| tron-* \
3851f27ce9aSmrg	| ubicom32-* \
3866df26cacSmrg	| v850-* | v850e-* | vax-* \
3876df26cacSmrg	| we32k-* \
3886df26cacSmrg	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
389b68e1f86Smrg	| xstormy16-* | xtensa*-* \
3906df26cacSmrg	| ymp-* \
3911f27ce9aSmrg	| z8k-* | z80-*)
3926df26cacSmrg		;;
393b68e1f86Smrg	# Recognize the basic CPU types without company name, with glob match.
394b68e1f86Smrg	xtensa*)
395b68e1f86Smrg		basic_machine=$basic_machine-unknown
396b68e1f86Smrg		;;
3976df26cacSmrg	# Recognize the various machine names and aliases which stand
3986df26cacSmrg	# for a CPU type and a company and sometimes even an OS.
3996df26cacSmrg	386bsd)
4006df26cacSmrg		basic_machine=i386-unknown
4016df26cacSmrg		os=-bsd
4026df26cacSmrg		;;
4036df26cacSmrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
4046df26cacSmrg		basic_machine=m68000-att
4056df26cacSmrg		;;
4066df26cacSmrg	3b*)
4076df26cacSmrg		basic_machine=we32k-att
4086df26cacSmrg		;;
4096df26cacSmrg	a29khif)
4106df26cacSmrg		basic_machine=a29k-amd
4116df26cacSmrg		os=-udi
4126df26cacSmrg		;;
4136df26cacSmrg    	abacus)
4146df26cacSmrg		basic_machine=abacus-unknown
4156df26cacSmrg		;;
4166df26cacSmrg	adobe68k)
4176df26cacSmrg		basic_machine=m68010-adobe
4186df26cacSmrg		os=-scout
4196df26cacSmrg		;;
4206df26cacSmrg	alliant | fx80)
4216df26cacSmrg		basic_machine=fx80-alliant
4226df26cacSmrg		;;
4236df26cacSmrg	altos | altos3068)
4246df26cacSmrg		basic_machine=m68k-altos
4256df26cacSmrg		;;
4266df26cacSmrg	am29k)
4276df26cacSmrg		basic_machine=a29k-none
4286df26cacSmrg		os=-bsd
4296df26cacSmrg		;;
4306df26cacSmrg	amd64)
4316df26cacSmrg		basic_machine=x86_64-pc
4326df26cacSmrg		;;
4336df26cacSmrg	amd64-*)
4346df26cacSmrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
4356df26cacSmrg		;;
4366df26cacSmrg	amdahl)
4376df26cacSmrg		basic_machine=580-amdahl
4386df26cacSmrg		os=-sysv
4396df26cacSmrg		;;
4406df26cacSmrg	amiga | amiga-*)
4416df26cacSmrg		basic_machine=m68k-unknown
4426df26cacSmrg		;;
4436df26cacSmrg	amigaos | amigados)
4446df26cacSmrg		basic_machine=m68k-unknown
4456df26cacSmrg		os=-amigaos
4466df26cacSmrg		;;
4476df26cacSmrg	amigaunix | amix)
4486df26cacSmrg		basic_machine=m68k-unknown
4496df26cacSmrg		os=-sysv4
4506df26cacSmrg		;;
4516df26cacSmrg	apollo68)
4526df26cacSmrg		basic_machine=m68k-apollo
4536df26cacSmrg		os=-sysv
4546df26cacSmrg		;;
4556df26cacSmrg	apollo68bsd)
4566df26cacSmrg		basic_machine=m68k-apollo
4576df26cacSmrg		os=-bsd
4586df26cacSmrg		;;
4591f27ce9aSmrg	aros)
4601f27ce9aSmrg		basic_machine=i386-pc
4611f27ce9aSmrg		os=-aros
4621f27ce9aSmrg		;;
4636df26cacSmrg	aux)
4646df26cacSmrg		basic_machine=m68k-apple
4656df26cacSmrg		os=-aux
4666df26cacSmrg		;;
4676df26cacSmrg	balance)
4686df26cacSmrg		basic_machine=ns32k-sequent
4696df26cacSmrg		os=-dynix
4706df26cacSmrg		;;
471b68e1f86Smrg	blackfin)
472b68e1f86Smrg		basic_machine=bfin-unknown
473b68e1f86Smrg		os=-linux
474b68e1f86Smrg		;;
475b68e1f86Smrg	blackfin-*)
476b68e1f86Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
477b68e1f86Smrg		os=-linux
478b68e1f86Smrg		;;
4791f27ce9aSmrg	bluegene*)
4801f27ce9aSmrg		basic_machine=powerpc-ibm
4811f27ce9aSmrg		os=-cnk
4821f27ce9aSmrg		;;
4836df26cacSmrg	c90)
4846df26cacSmrg		basic_machine=c90-cray
4856df26cacSmrg		os=-unicos
4866df26cacSmrg		;;
4871f27ce9aSmrg        cegcc)
4881f27ce9aSmrg		basic_machine=arm-unknown
4891f27ce9aSmrg		os=-cegcc
4901f27ce9aSmrg		;;
4916df26cacSmrg	convex-c1)
4926df26cacSmrg		basic_machine=c1-convex
4936df26cacSmrg		os=-bsd
4946df26cacSmrg		;;
4956df26cacSmrg	convex-c2)
4966df26cacSmrg		basic_machine=c2-convex
4976df26cacSmrg		os=-bsd
4986df26cacSmrg		;;
4996df26cacSmrg	convex-c32)
5006df26cacSmrg		basic_machine=c32-convex
5016df26cacSmrg		os=-bsd
5026df26cacSmrg		;;
5036df26cacSmrg	convex-c34)
5046df26cacSmrg		basic_machine=c34-convex
5056df26cacSmrg		os=-bsd
5066df26cacSmrg		;;
5076df26cacSmrg	convex-c38)
5086df26cacSmrg		basic_machine=c38-convex
5096df26cacSmrg		os=-bsd
5106df26cacSmrg		;;
5116df26cacSmrg	cray | j90)
5126df26cacSmrg		basic_machine=j90-cray
5136df26cacSmrg		os=-unicos
5146df26cacSmrg		;;
5156df26cacSmrg	craynv)
5166df26cacSmrg		basic_machine=craynv-cray
5176df26cacSmrg		os=-unicosmp
5186df26cacSmrg		;;
519b68e1f86Smrg	cr16)
520b68e1f86Smrg		basic_machine=cr16-unknown
5216df26cacSmrg		os=-elf
5226df26cacSmrg		;;
5236df26cacSmrg	crds | unos)
5246df26cacSmrg		basic_machine=m68k-crds
5256df26cacSmrg		;;
5266df26cacSmrg	crisv32 | crisv32-* | etraxfs*)
5276df26cacSmrg		basic_machine=crisv32-axis
5286df26cacSmrg		;;
5296df26cacSmrg	cris | cris-* | etrax*)
5306df26cacSmrg		basic_machine=cris-axis
5316df26cacSmrg		;;
5326df26cacSmrg	crx)
5336df26cacSmrg		basic_machine=crx-unknown
5346df26cacSmrg		os=-elf
5356df26cacSmrg		;;
5366df26cacSmrg	da30 | da30-*)
5376df26cacSmrg		basic_machine=m68k-da30
5386df26cacSmrg		;;
5396df26cacSmrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
5406df26cacSmrg		basic_machine=mips-dec
5416df26cacSmrg		;;
5426df26cacSmrg	decsystem10* | dec10*)
5436df26cacSmrg		basic_machine=pdp10-dec
5446df26cacSmrg		os=-tops10
5456df26cacSmrg		;;
5466df26cacSmrg	decsystem20* | dec20*)
5476df26cacSmrg		basic_machine=pdp10-dec
5486df26cacSmrg		os=-tops20
5496df26cacSmrg		;;
5506df26cacSmrg	delta | 3300 | motorola-3300 | motorola-delta \
5516df26cacSmrg	      | 3300-motorola | delta-motorola)
5526df26cacSmrg		basic_machine=m68k-motorola
5536df26cacSmrg		;;
5546df26cacSmrg	delta88)
5556df26cacSmrg		basic_machine=m88k-motorola
5566df26cacSmrg		os=-sysv3
5576df26cacSmrg		;;
5581f27ce9aSmrg	dicos)
5591f27ce9aSmrg		basic_machine=i686-pc
5601f27ce9aSmrg		os=-dicos
5611f27ce9aSmrg		;;
5626df26cacSmrg	djgpp)
5636df26cacSmrg		basic_machine=i586-pc
5646df26cacSmrg		os=-msdosdjgpp
5656df26cacSmrg		;;
5666df26cacSmrg	dpx20 | dpx20-*)
5676df26cacSmrg		basic_machine=rs6000-bull
5686df26cacSmrg		os=-bosx
5696df26cacSmrg		;;
5706df26cacSmrg	dpx2* | dpx2*-bull)
5716df26cacSmrg		basic_machine=m68k-bull
5726df26cacSmrg		os=-sysv3
5736df26cacSmrg		;;
5746df26cacSmrg	ebmon29k)
5756df26cacSmrg		basic_machine=a29k-amd
5766df26cacSmrg		os=-ebmon
5776df26cacSmrg		;;
5786df26cacSmrg	elxsi)
5796df26cacSmrg		basic_machine=elxsi-elxsi
5806df26cacSmrg		os=-bsd
5816df26cacSmrg		;;
5826df26cacSmrg	encore | umax | mmax)
5836df26cacSmrg		basic_machine=ns32k-encore
5846df26cacSmrg		;;
5856df26cacSmrg	es1800 | OSE68k | ose68k | ose | OSE)
5866df26cacSmrg		basic_machine=m68k-ericsson
5876df26cacSmrg		os=-ose
5886df26cacSmrg		;;
5896df26cacSmrg	fx2800)
5906df26cacSmrg		basic_machine=i860-alliant
5916df26cacSmrg		;;
5926df26cacSmrg	genix)
5936df26cacSmrg		basic_machine=ns32k-ns
5946df26cacSmrg		;;
5956df26cacSmrg	gmicro)
5966df26cacSmrg		basic_machine=tron-gmicro
5976df26cacSmrg		os=-sysv
5986df26cacSmrg		;;
5996df26cacSmrg	go32)
6006df26cacSmrg		basic_machine=i386-pc
6016df26cacSmrg		os=-go32
6026df26cacSmrg		;;
6036df26cacSmrg	h3050r* | hiux*)
6046df26cacSmrg		basic_machine=hppa1.1-hitachi
6056df26cacSmrg		os=-hiuxwe2
6066df26cacSmrg		;;
6076df26cacSmrg	h8300hms)
6086df26cacSmrg		basic_machine=h8300-hitachi
6096df26cacSmrg		os=-hms
6106df26cacSmrg		;;
6116df26cacSmrg	h8300xray)
6126df26cacSmrg		basic_machine=h8300-hitachi
6136df26cacSmrg		os=-xray
6146df26cacSmrg		;;
6156df26cacSmrg	h8500hms)
6166df26cacSmrg		basic_machine=h8500-hitachi
6176df26cacSmrg		os=-hms
6186df26cacSmrg		;;
6196df26cacSmrg	harris)
6206df26cacSmrg		basic_machine=m88k-harris
6216df26cacSmrg		os=-sysv3
6226df26cacSmrg		;;
6236df26cacSmrg	hp300-*)
6246df26cacSmrg		basic_machine=m68k-hp
6256df26cacSmrg		;;
6266df26cacSmrg	hp300bsd)
6276df26cacSmrg		basic_machine=m68k-hp
6286df26cacSmrg		os=-bsd
6296df26cacSmrg		;;
6306df26cacSmrg	hp300hpux)
6316df26cacSmrg		basic_machine=m68k-hp
6326df26cacSmrg		os=-hpux
6336df26cacSmrg		;;
6346df26cacSmrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
6356df26cacSmrg		basic_machine=hppa1.0-hp
6366df26cacSmrg		;;
6376df26cacSmrg	hp9k2[0-9][0-9] | hp9k31[0-9])
6386df26cacSmrg		basic_machine=m68000-hp
6396df26cacSmrg		;;
6406df26cacSmrg	hp9k3[2-9][0-9])
6416df26cacSmrg		basic_machine=m68k-hp
6426df26cacSmrg		;;
6436df26cacSmrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
6446df26cacSmrg		basic_machine=hppa1.0-hp
6456df26cacSmrg		;;
6466df26cacSmrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
6476df26cacSmrg		basic_machine=hppa1.1-hp
6486df26cacSmrg		;;
6496df26cacSmrg	hp9k78[0-9] | hp78[0-9])
6506df26cacSmrg		# FIXME: really hppa2.0-hp
6516df26cacSmrg		basic_machine=hppa1.1-hp
6526df26cacSmrg		;;
6536df26cacSmrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
6546df26cacSmrg		# FIXME: really hppa2.0-hp
6556df26cacSmrg		basic_machine=hppa1.1-hp
6566df26cacSmrg		;;
6576df26cacSmrg	hp9k8[0-9][13679] | hp8[0-9][13679])
6586df26cacSmrg		basic_machine=hppa1.1-hp
6596df26cacSmrg		;;
6606df26cacSmrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
6616df26cacSmrg		basic_machine=hppa1.0-hp
6626df26cacSmrg		;;
6636df26cacSmrg	hppa-next)
6646df26cacSmrg		os=-nextstep3
6656df26cacSmrg		;;
6666df26cacSmrg	hppaosf)
6676df26cacSmrg		basic_machine=hppa1.1-hp
6686df26cacSmrg		os=-osf
6696df26cacSmrg		;;
6706df26cacSmrg	hppro)
6716df26cacSmrg		basic_machine=hppa1.1-hp
6726df26cacSmrg		os=-proelf
6736df26cacSmrg		;;
6746df26cacSmrg	i370-ibm* | ibm*)
6756df26cacSmrg		basic_machine=i370-ibm
6766df26cacSmrg		;;
6776df26cacSmrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
6786df26cacSmrg	i*86v32)
6796df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6806df26cacSmrg		os=-sysv32
6816df26cacSmrg		;;
6826df26cacSmrg	i*86v4*)
6836df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6846df26cacSmrg		os=-sysv4
6856df26cacSmrg		;;
6866df26cacSmrg	i*86v)
6876df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6886df26cacSmrg		os=-sysv
6896df26cacSmrg		;;
6906df26cacSmrg	i*86sol2)
6916df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6926df26cacSmrg		os=-solaris2
6936df26cacSmrg		;;
6946df26cacSmrg	i386mach)
6956df26cacSmrg		basic_machine=i386-mach
6966df26cacSmrg		os=-mach
6976df26cacSmrg		;;
6986df26cacSmrg	i386-vsta | vsta)
6996df26cacSmrg		basic_machine=i386-unknown
7006df26cacSmrg		os=-vsta
7016df26cacSmrg		;;
7026df26cacSmrg	iris | iris4d)
7036df26cacSmrg		basic_machine=mips-sgi
7046df26cacSmrg		case $os in
7056df26cacSmrg		    -irix*)
7066df26cacSmrg			;;
7076df26cacSmrg		    *)
7086df26cacSmrg			os=-irix4
7096df26cacSmrg			;;
7106df26cacSmrg		esac
7116df26cacSmrg		;;
7126df26cacSmrg	isi68 | isi)
7136df26cacSmrg		basic_machine=m68k-isi
7146df26cacSmrg		os=-sysv
7156df26cacSmrg		;;
716b68e1f86Smrg	m68knommu)
717b68e1f86Smrg		basic_machine=m68k-unknown
718b68e1f86Smrg		os=-linux
719b68e1f86Smrg		;;
720b68e1f86Smrg	m68knommu-*)
721b68e1f86Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
722b68e1f86Smrg		os=-linux
723b68e1f86Smrg		;;
7246df26cacSmrg	m88k-omron*)
7256df26cacSmrg		basic_machine=m88k-omron
7266df26cacSmrg		;;
7276df26cacSmrg	magnum | m3230)
7286df26cacSmrg		basic_machine=mips-mips
7296df26cacSmrg		os=-sysv
7306df26cacSmrg		;;
7316df26cacSmrg	merlin)
7326df26cacSmrg		basic_machine=ns32k-utek
7336df26cacSmrg		os=-sysv
7346df26cacSmrg		;;
7351f27ce9aSmrg        microblaze)
7361f27ce9aSmrg		basic_machine=microblaze-xilinx
7371f27ce9aSmrg		;;
7386df26cacSmrg	mingw32)
7396df26cacSmrg		basic_machine=i386-pc
7406df26cacSmrg		os=-mingw32
7416df26cacSmrg		;;
74216fd1166Smrg	mingw32ce)
74316fd1166Smrg		basic_machine=arm-unknown
74416fd1166Smrg		os=-mingw32ce
74516fd1166Smrg		;;
7466df26cacSmrg	miniframe)
7476df26cacSmrg		basic_machine=m68000-convergent
7486df26cacSmrg		;;
7496df26cacSmrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
7506df26cacSmrg		basic_machine=m68k-atari
7516df26cacSmrg		os=-mint
7526df26cacSmrg		;;
7536df26cacSmrg	mips3*-*)
7546df26cacSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
7556df26cacSmrg		;;
7566df26cacSmrg	mips3*)
7576df26cacSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
7586df26cacSmrg		;;
7596df26cacSmrg	monitor)
7606df26cacSmrg		basic_machine=m68k-rom68k
7616df26cacSmrg		os=-coff
7626df26cacSmrg		;;
7636df26cacSmrg	morphos)
7646df26cacSmrg		basic_machine=powerpc-unknown
7656df26cacSmrg		os=-morphos
7666df26cacSmrg		;;
7676df26cacSmrg	msdos)
7686df26cacSmrg		basic_machine=i386-pc
7696df26cacSmrg		os=-msdos
7706df26cacSmrg		;;
7716df26cacSmrg	ms1-*)
7726df26cacSmrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
7736df26cacSmrg		;;
7746df26cacSmrg	mvs)
7756df26cacSmrg		basic_machine=i370-ibm
7766df26cacSmrg		os=-mvs
7776df26cacSmrg		;;
7786df26cacSmrg	ncr3000)
7796df26cacSmrg		basic_machine=i486-ncr
7806df26cacSmrg		os=-sysv4
7816df26cacSmrg		;;
7826df26cacSmrg	netbsd386)
7836df26cacSmrg		basic_machine=i386-unknown
7846df26cacSmrg		os=-netbsd
7856df26cacSmrg		;;
7866df26cacSmrg	netwinder)
7876df26cacSmrg		basic_machine=armv4l-rebel
7886df26cacSmrg		os=-linux
7896df26cacSmrg		;;
7906df26cacSmrg	news | news700 | news800 | news900)
7916df26cacSmrg		basic_machine=m68k-sony
7926df26cacSmrg		os=-newsos
7936df26cacSmrg		;;
7946df26cacSmrg	news1000)
7956df26cacSmrg		basic_machine=m68030-sony
7966df26cacSmrg		os=-newsos
7976df26cacSmrg		;;
7986df26cacSmrg	news-3600 | risc-news)
7996df26cacSmrg		basic_machine=mips-sony
8006df26cacSmrg		os=-newsos
8016df26cacSmrg		;;
8026df26cacSmrg	necv70)
8036df26cacSmrg		basic_machine=v70-nec
8046df26cacSmrg		os=-sysv
8056df26cacSmrg		;;
8066df26cacSmrg	next | m*-next )
8076df26cacSmrg		basic_machine=m68k-next
8086df26cacSmrg		case $os in
8096df26cacSmrg		    -nextstep* )
8106df26cacSmrg			;;
8116df26cacSmrg		    -ns2*)
8126df26cacSmrg		      os=-nextstep2
8136df26cacSmrg			;;
8146df26cacSmrg		    *)
8156df26cacSmrg		      os=-nextstep3
8166df26cacSmrg			;;
8176df26cacSmrg		esac
8186df26cacSmrg		;;
8196df26cacSmrg	nh3000)
8206df26cacSmrg		basic_machine=m68k-harris
8216df26cacSmrg		os=-cxux
8226df26cacSmrg		;;
8236df26cacSmrg	nh[45]000)
8246df26cacSmrg		basic_machine=m88k-harris
8256df26cacSmrg		os=-cxux
8266df26cacSmrg		;;
8276df26cacSmrg	nindy960)
8286df26cacSmrg		basic_machine=i960-intel
8296df26cacSmrg		os=-nindy
8306df26cacSmrg		;;
8316df26cacSmrg	mon960)
8326df26cacSmrg		basic_machine=i960-intel
8336df26cacSmrg		os=-mon960
8346df26cacSmrg		;;
8356df26cacSmrg	nonstopux)
8366df26cacSmrg		basic_machine=mips-compaq
8376df26cacSmrg		os=-nonstopux
8386df26cacSmrg		;;
8396df26cacSmrg	np1)
8406df26cacSmrg		basic_machine=np1-gould
8416df26cacSmrg		;;
8426df26cacSmrg	nsr-tandem)
8436df26cacSmrg		basic_machine=nsr-tandem
8446df26cacSmrg		;;
8456df26cacSmrg	op50n-* | op60c-*)
8466df26cacSmrg		basic_machine=hppa1.1-oki
8476df26cacSmrg		os=-proelf
8486df26cacSmrg		;;
8496df26cacSmrg	openrisc | openrisc-*)
8506df26cacSmrg		basic_machine=or32-unknown
8516df26cacSmrg		;;
8526df26cacSmrg	os400)
8536df26cacSmrg		basic_machine=powerpc-ibm
8546df26cacSmrg		os=-os400
8556df26cacSmrg		;;
8566df26cacSmrg	OSE68000 | ose68000)
8576df26cacSmrg		basic_machine=m68000-ericsson
8586df26cacSmrg		os=-ose
8596df26cacSmrg		;;
8606df26cacSmrg	os68k)
8616df26cacSmrg		basic_machine=m68k-none
8626df26cacSmrg		os=-os68k
8636df26cacSmrg		;;
8646df26cacSmrg	pa-hitachi)
8656df26cacSmrg		basic_machine=hppa1.1-hitachi
8666df26cacSmrg		os=-hiuxwe2
8676df26cacSmrg		;;
8686df26cacSmrg	paragon)
8696df26cacSmrg		basic_machine=i860-intel
8706df26cacSmrg		os=-osf
8716df26cacSmrg		;;
872b68e1f86Smrg	parisc)
873b68e1f86Smrg		basic_machine=hppa-unknown
874b68e1f86Smrg		os=-linux
875b68e1f86Smrg		;;
876b68e1f86Smrg	parisc-*)
877b68e1f86Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
878b68e1f86Smrg		os=-linux
879b68e1f86Smrg		;;
8806df26cacSmrg	pbd)
8816df26cacSmrg		basic_machine=sparc-tti
8826df26cacSmrg		;;
8836df26cacSmrg	pbb)
8846df26cacSmrg		basic_machine=m68k-tti
8856df26cacSmrg		;;
8866df26cacSmrg	pc532 | pc532-*)
8876df26cacSmrg		basic_machine=ns32k-pc532
8886df26cacSmrg		;;
8896df26cacSmrg	pc98)
8906df26cacSmrg		basic_machine=i386-pc
8916df26cacSmrg		;;
8926df26cacSmrg	pc98-*)
8936df26cacSmrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
8946df26cacSmrg		;;
8956df26cacSmrg	pentium | p5 | k5 | k6 | nexgen | viac3)
8966df26cacSmrg		basic_machine=i586-pc
8976df26cacSmrg		;;
8986df26cacSmrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
8996df26cacSmrg		basic_machine=i686-pc
9006df26cacSmrg		;;
9016df26cacSmrg	pentiumii | pentium2 | pentiumiii | pentium3)
9026df26cacSmrg		basic_machine=i686-pc
9036df26cacSmrg		;;
9046df26cacSmrg	pentium4)
9056df26cacSmrg		basic_machine=i786-pc
9066df26cacSmrg		;;
9076df26cacSmrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
9086df26cacSmrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
9096df26cacSmrg		;;
9106df26cacSmrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
9116df26cacSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
9126df26cacSmrg		;;
9136df26cacSmrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
9146df26cacSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
9156df26cacSmrg		;;
9166df26cacSmrg	pentium4-*)
9176df26cacSmrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
9186df26cacSmrg		;;
9196df26cacSmrg	pn)
9206df26cacSmrg		basic_machine=pn-gould
9216df26cacSmrg		;;
9226df26cacSmrg	power)	basic_machine=power-ibm
9236df26cacSmrg		;;
9246df26cacSmrg	ppc)	basic_machine=powerpc-unknown
9256df26cacSmrg		;;
9266df26cacSmrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
9276df26cacSmrg		;;
9286df26cacSmrg	ppcle | powerpclittle | ppc-le | powerpc-little)
9296df26cacSmrg		basic_machine=powerpcle-unknown
9306df26cacSmrg		;;
9316df26cacSmrg	ppcle-* | powerpclittle-*)
9326df26cacSmrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
9336df26cacSmrg		;;
9346df26cacSmrg	ppc64)	basic_machine=powerpc64-unknown
9356df26cacSmrg		;;
9366df26cacSmrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
9376df26cacSmrg		;;
9386df26cacSmrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
9396df26cacSmrg		basic_machine=powerpc64le-unknown
9406df26cacSmrg		;;
9416df26cacSmrg	ppc64le-* | powerpc64little-*)
9426df26cacSmrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
9436df26cacSmrg		;;
9446df26cacSmrg	ps2)
9456df26cacSmrg		basic_machine=i386-ibm
9466df26cacSmrg		;;
9476df26cacSmrg	pw32)
9486df26cacSmrg		basic_machine=i586-unknown
9496df26cacSmrg		os=-pw32
9506df26cacSmrg		;;
9516df26cacSmrg	rdos)
9526df26cacSmrg		basic_machine=i386-pc
9536df26cacSmrg		os=-rdos
9546df26cacSmrg		;;
9556df26cacSmrg	rom68k)
9566df26cacSmrg		basic_machine=m68k-rom68k
9576df26cacSmrg		os=-coff
9586df26cacSmrg		;;
9596df26cacSmrg	rm[46]00)
9606df26cacSmrg		basic_machine=mips-siemens
9616df26cacSmrg		;;
9626df26cacSmrg	rtpc | rtpc-*)
9636df26cacSmrg		basic_machine=romp-ibm
9646df26cacSmrg		;;
9656df26cacSmrg	s390 | s390-*)
9666df26cacSmrg		basic_machine=s390-ibm
9676df26cacSmrg		;;
9686df26cacSmrg	s390x | s390x-*)
9696df26cacSmrg		basic_machine=s390x-ibm
9706df26cacSmrg		;;
9716df26cacSmrg	sa29200)
9726df26cacSmrg		basic_machine=a29k-amd
9736df26cacSmrg		os=-udi
9746df26cacSmrg		;;
9756df26cacSmrg	sb1)
9766df26cacSmrg		basic_machine=mipsisa64sb1-unknown
9776df26cacSmrg		;;
9786df26cacSmrg	sb1el)
9796df26cacSmrg		basic_machine=mipsisa64sb1el-unknown
9806df26cacSmrg		;;
9816df26cacSmrg	sde)
9826df26cacSmrg		basic_machine=mipsisa32-sde
9836df26cacSmrg		os=-elf
9846df26cacSmrg		;;
9856df26cacSmrg	sei)
9866df26cacSmrg		basic_machine=mips-sei
9876df26cacSmrg		os=-seiux
9886df26cacSmrg		;;
9896df26cacSmrg	sequent)
9906df26cacSmrg		basic_machine=i386-sequent
9916df26cacSmrg		;;
9926df26cacSmrg	sh)
9936df26cacSmrg		basic_machine=sh-hitachi
9946df26cacSmrg		os=-hms
9956df26cacSmrg		;;
99616fd1166Smrg	sh5el)
99716fd1166Smrg		basic_machine=sh5le-unknown
99816fd1166Smrg		;;
9996df26cacSmrg	sh64)
10006df26cacSmrg		basic_machine=sh64-unknown
10016df26cacSmrg		;;
10026df26cacSmrg	sparclite-wrs | simso-wrs)
10036df26cacSmrg		basic_machine=sparclite-wrs
10046df26cacSmrg		os=-vxworks
10056df26cacSmrg		;;
10066df26cacSmrg	sps7)
10076df26cacSmrg		basic_machine=m68k-bull
10086df26cacSmrg		os=-sysv2
10096df26cacSmrg		;;
10106df26cacSmrg	spur)
10116df26cacSmrg		basic_machine=spur-unknown
10126df26cacSmrg		;;
10136df26cacSmrg	st2000)
10146df26cacSmrg		basic_machine=m68k-tandem
10156df26cacSmrg		;;
10166df26cacSmrg	stratus)
10176df26cacSmrg		basic_machine=i860-stratus
10186df26cacSmrg		os=-sysv4
10196df26cacSmrg		;;
10206df26cacSmrg	sun2)
10216df26cacSmrg		basic_machine=m68000-sun
10226df26cacSmrg		;;
10236df26cacSmrg	sun2os3)
10246df26cacSmrg		basic_machine=m68000-sun
10256df26cacSmrg		os=-sunos3
10266df26cacSmrg		;;
10276df26cacSmrg	sun2os4)
10286df26cacSmrg		basic_machine=m68000-sun
10296df26cacSmrg		os=-sunos4
10306df26cacSmrg		;;
10316df26cacSmrg	sun3os3)
10326df26cacSmrg		basic_machine=m68k-sun
10336df26cacSmrg		os=-sunos3
10346df26cacSmrg		;;
10356df26cacSmrg	sun3os4)
10366df26cacSmrg		basic_machine=m68k-sun
10376df26cacSmrg		os=-sunos4
10386df26cacSmrg		;;
10396df26cacSmrg	sun4os3)
10406df26cacSmrg		basic_machine=sparc-sun
10416df26cacSmrg		os=-sunos3
10426df26cacSmrg		;;
10436df26cacSmrg	sun4os4)
10446df26cacSmrg		basic_machine=sparc-sun
10456df26cacSmrg		os=-sunos4
10466df26cacSmrg		;;
10476df26cacSmrg	sun4sol2)
10486df26cacSmrg		basic_machine=sparc-sun
10496df26cacSmrg		os=-solaris2
10506df26cacSmrg		;;
10516df26cacSmrg	sun3 | sun3-*)
10526df26cacSmrg		basic_machine=m68k-sun
10536df26cacSmrg		;;
10546df26cacSmrg	sun4)
10556df26cacSmrg		basic_machine=sparc-sun
10566df26cacSmrg		;;
10576df26cacSmrg	sun386 | sun386i | roadrunner)
10586df26cacSmrg		basic_machine=i386-sun
10596df26cacSmrg		;;
10606df26cacSmrg	sv1)
10616df26cacSmrg		basic_machine=sv1-cray
10626df26cacSmrg		os=-unicos
10636df26cacSmrg		;;
10646df26cacSmrg	symmetry)
10656df26cacSmrg		basic_machine=i386-sequent
10666df26cacSmrg		os=-dynix
10676df26cacSmrg		;;
10686df26cacSmrg	t3e)
10696df26cacSmrg		basic_machine=alphaev5-cray
10706df26cacSmrg		os=-unicos
10716df26cacSmrg		;;
10726df26cacSmrg	t90)
10736df26cacSmrg		basic_machine=t90-cray
10746df26cacSmrg		os=-unicos
10756df26cacSmrg		;;
10766df26cacSmrg	tic54x | c54x*)
10776df26cacSmrg		basic_machine=tic54x-unknown
10786df26cacSmrg		os=-coff
10796df26cacSmrg		;;
10806df26cacSmrg	tic55x | c55x*)
10816df26cacSmrg		basic_machine=tic55x-unknown
10826df26cacSmrg		os=-coff
10836df26cacSmrg		;;
10846df26cacSmrg	tic6x | c6x*)
10856df26cacSmrg		basic_machine=tic6x-unknown
10866df26cacSmrg		os=-coff
10876df26cacSmrg		;;
1088b68e1f86Smrg	tile*)
1089b68e1f86Smrg		basic_machine=tile-unknown
1090b68e1f86Smrg		os=-linux-gnu
1091b68e1f86Smrg		;;
10926df26cacSmrg	tx39)
10936df26cacSmrg		basic_machine=mipstx39-unknown
10946df26cacSmrg		;;
10956df26cacSmrg	tx39el)
10966df26cacSmrg		basic_machine=mipstx39el-unknown
10976df26cacSmrg		;;
10986df26cacSmrg	toad1)
10996df26cacSmrg		basic_machine=pdp10-xkl
11006df26cacSmrg		os=-tops20
11016df26cacSmrg		;;
11026df26cacSmrg	tower | tower-32)
11036df26cacSmrg		basic_machine=m68k-ncr
11046df26cacSmrg		;;
11056df26cacSmrg	tpf)
11066df26cacSmrg		basic_machine=s390x-ibm
11076df26cacSmrg		os=-tpf
11086df26cacSmrg		;;
11096df26cacSmrg	udi29k)
11106df26cacSmrg		basic_machine=a29k-amd
11116df26cacSmrg		os=-udi
11126df26cacSmrg		;;
11136df26cacSmrg	ultra3)
11146df26cacSmrg		basic_machine=a29k-nyu
11156df26cacSmrg		os=-sym1
11166df26cacSmrg		;;
11176df26cacSmrg	v810 | necv810)
11186df26cacSmrg		basic_machine=v810-nec
11196df26cacSmrg		os=-none
11206df26cacSmrg		;;
11216df26cacSmrg	vaxv)
11226df26cacSmrg		basic_machine=vax-dec
11236df26cacSmrg		os=-sysv
11246df26cacSmrg		;;
11256df26cacSmrg	vms)
11266df26cacSmrg		basic_machine=vax-dec
11276df26cacSmrg		os=-vms
11286df26cacSmrg		;;
11296df26cacSmrg	vpp*|vx|vx-*)
11306df26cacSmrg		basic_machine=f301-fujitsu
11316df26cacSmrg		;;
11326df26cacSmrg	vxworks960)
11336df26cacSmrg		basic_machine=i960-wrs
11346df26cacSmrg		os=-vxworks
11356df26cacSmrg		;;
11366df26cacSmrg	vxworks68)
11376df26cacSmrg		basic_machine=m68k-wrs
11386df26cacSmrg		os=-vxworks
11396df26cacSmrg		;;
11406df26cacSmrg	vxworks29k)
11416df26cacSmrg		basic_machine=a29k-wrs
11426df26cacSmrg		os=-vxworks
11436df26cacSmrg		;;
11446df26cacSmrg	w65*)
11456df26cacSmrg		basic_machine=w65-wdc
11466df26cacSmrg		os=-none
11476df26cacSmrg		;;
11486df26cacSmrg	w89k-*)
11496df26cacSmrg		basic_machine=hppa1.1-winbond
11506df26cacSmrg		os=-proelf
11516df26cacSmrg		;;
11526df26cacSmrg	xbox)
11536df26cacSmrg		basic_machine=i686-pc
11546df26cacSmrg		os=-mingw32
11556df26cacSmrg		;;
11566df26cacSmrg	xps | xps100)
11576df26cacSmrg		basic_machine=xps100-honeywell
11586df26cacSmrg		;;
11596df26cacSmrg	ymp)
11606df26cacSmrg		basic_machine=ymp-cray
11616df26cacSmrg		os=-unicos
11626df26cacSmrg		;;
11636df26cacSmrg	z8k-*-coff)
11646df26cacSmrg		basic_machine=z8k-unknown
11656df26cacSmrg		os=-sim
11666df26cacSmrg		;;
11671f27ce9aSmrg	z80-*-coff)
11681f27ce9aSmrg		basic_machine=z80-unknown
11691f27ce9aSmrg		os=-sim
11701f27ce9aSmrg		;;
11716df26cacSmrg	none)
11726df26cacSmrg		basic_machine=none-none
11736df26cacSmrg		os=-none
11746df26cacSmrg		;;
11756df26cacSmrg
11766df26cacSmrg# Here we handle the default manufacturer of certain CPU types.  It is in
11776df26cacSmrg# some cases the only manufacturer, in others, it is the most popular.
11786df26cacSmrg	w89k)
11796df26cacSmrg		basic_machine=hppa1.1-winbond
11806df26cacSmrg		;;
11816df26cacSmrg	op50n)
11826df26cacSmrg		basic_machine=hppa1.1-oki
11836df26cacSmrg		;;
11846df26cacSmrg	op60c)
11856df26cacSmrg		basic_machine=hppa1.1-oki
11866df26cacSmrg		;;
11876df26cacSmrg	romp)
11886df26cacSmrg		basic_machine=romp-ibm
11896df26cacSmrg		;;
11906df26cacSmrg	mmix)
11916df26cacSmrg		basic_machine=mmix-knuth
11926df26cacSmrg		;;
11936df26cacSmrg	rs6000)
11946df26cacSmrg		basic_machine=rs6000-ibm
11956df26cacSmrg		;;
11966df26cacSmrg	vax)
11976df26cacSmrg		basic_machine=vax-dec
11986df26cacSmrg		;;
11996df26cacSmrg	pdp10)
12006df26cacSmrg		# there are many clones, so DEC is not a safe bet
12016df26cacSmrg		basic_machine=pdp10-unknown
12026df26cacSmrg		;;
12036df26cacSmrg	pdp11)
12046df26cacSmrg		basic_machine=pdp11-dec
12056df26cacSmrg		;;
12066df26cacSmrg	we32k)
12076df26cacSmrg		basic_machine=we32k-att
12086df26cacSmrg		;;
12091f27ce9aSmrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
12106df26cacSmrg		basic_machine=sh-unknown
12116df26cacSmrg		;;
12126df26cacSmrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
12136df26cacSmrg		basic_machine=sparc-sun
12146df26cacSmrg		;;
12156df26cacSmrg	cydra)
12166df26cacSmrg		basic_machine=cydra-cydrome
12176df26cacSmrg		;;
12186df26cacSmrg	orion)
12196df26cacSmrg		basic_machine=orion-highlevel
12206df26cacSmrg		;;
12216df26cacSmrg	orion105)
12226df26cacSmrg		basic_machine=clipper-highlevel
12236df26cacSmrg		;;
12246df26cacSmrg	mac | mpw | mac-mpw)
12256df26cacSmrg		basic_machine=m68k-apple
12266df26cacSmrg		;;
12276df26cacSmrg	pmac | pmac-mpw)
12286df26cacSmrg		basic_machine=powerpc-apple
12296df26cacSmrg		;;
12306df26cacSmrg	*-unknown)
12316df26cacSmrg		# Make sure to match an already-canonicalized machine name.
12326df26cacSmrg		;;
12336df26cacSmrg	*)
12346df26cacSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
12356df26cacSmrg		exit 1
12366df26cacSmrg		;;
12376df26cacSmrgesac
12386df26cacSmrg
12396df26cacSmrg# Here we canonicalize certain aliases for manufacturers.
12406df26cacSmrgcase $basic_machine in
12416df26cacSmrg	*-digital*)
12426df26cacSmrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
12436df26cacSmrg		;;
12446df26cacSmrg	*-commodore*)
12456df26cacSmrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
12466df26cacSmrg		;;
12476df26cacSmrg	*)
12486df26cacSmrg		;;
12496df26cacSmrgesac
12506df26cacSmrg
12516df26cacSmrg# Decode manufacturer-specific aliases for certain operating systems.
12526df26cacSmrg
12536df26cacSmrgif [ x"$os" != x"" ]
12546df26cacSmrgthen
12556df26cacSmrgcase $os in
12566df26cacSmrg        # First match some system type aliases
12576df26cacSmrg        # that might get confused with valid system types.
12586df26cacSmrg	# -solaris* is a basic system type, with this one exception.
12591f27ce9aSmrg        -auroraux)
12601f27ce9aSmrg	        os=-auroraux
12611f27ce9aSmrg		;;
12626df26cacSmrg	-solaris1 | -solaris1.*)
12636df26cacSmrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
12646df26cacSmrg		;;
12656df26cacSmrg	-solaris)
12666df26cacSmrg		os=-solaris2
12676df26cacSmrg		;;
12686df26cacSmrg	-svr4*)
12696df26cacSmrg		os=-sysv4
12706df26cacSmrg		;;
12716df26cacSmrg	-unixware*)
12726df26cacSmrg		os=-sysv4.2uw
12736df26cacSmrg		;;
12746df26cacSmrg	-gnu/linux*)
12756df26cacSmrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
12766df26cacSmrg		;;
12776df26cacSmrg	# First accept the basic system types.
12786df26cacSmrg	# The portable systems comes first.
12796df26cacSmrg	# Each alternative MUST END IN A *, to match a version number.
12806df26cacSmrg	# -sysv* is not here because it comes later, after sysvr4.
12816df26cacSmrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
12821f27ce9aSmrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
12831f27ce9aSmrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
12841f27ce9aSmrg	      | -sym* | -kopensolaris* \
12856df26cacSmrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
12861f27ce9aSmrg	      | -aos* | -aros* \
12876df26cacSmrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
12886df26cacSmrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
12896df26cacSmrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
12906df26cacSmrg	      | -openbsd* | -solidbsd* \
12916df26cacSmrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
12926df26cacSmrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
12936df26cacSmrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
12946df26cacSmrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
12951f27ce9aSmrg	      | -chorusos* | -chorusrdb* | -cegcc* \
12966df26cacSmrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
12976df26cacSmrg	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
12986df26cacSmrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
12996df26cacSmrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
13006df26cacSmrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13016df26cacSmrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13026df26cacSmrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13036df26cacSmrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
13046df26cacSmrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
13051f27ce9aSmrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
13066df26cacSmrg	# Remember, each alternative MUST END IN *, to match a version number.
13076df26cacSmrg		;;
13086df26cacSmrg	-qnx*)
13096df26cacSmrg		case $basic_machine in
13106df26cacSmrg		    x86-* | i*86-*)
13116df26cacSmrg			;;
13126df26cacSmrg		    *)
13136df26cacSmrg			os=-nto$os
13146df26cacSmrg			;;
13156df26cacSmrg		esac
13166df26cacSmrg		;;
13176df26cacSmrg	-nto-qnx*)
13186df26cacSmrg		;;
13196df26cacSmrg	-nto*)
13206df26cacSmrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
13216df26cacSmrg		;;
13226df26cacSmrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
13236df26cacSmrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
13246df26cacSmrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
13256df26cacSmrg		;;
13266df26cacSmrg	-mac*)
13276df26cacSmrg		os=`echo $os | sed -e 's|mac|macos|'`
13286df26cacSmrg		;;
13296df26cacSmrg	-linux-dietlibc)
13306df26cacSmrg		os=-linux-dietlibc
13316df26cacSmrg		;;
13326df26cacSmrg	-linux*)
13336df26cacSmrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
13346df26cacSmrg		;;
13356df26cacSmrg	-sunos5*)
13366df26cacSmrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
13376df26cacSmrg		;;
13386df26cacSmrg	-sunos6*)
13396df26cacSmrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
13406df26cacSmrg		;;
13416df26cacSmrg	-opened*)
13426df26cacSmrg		os=-openedition
13436df26cacSmrg		;;
13446df26cacSmrg        -os400*)
13456df26cacSmrg		os=-os400
13466df26cacSmrg		;;
13476df26cacSmrg	-wince*)
13486df26cacSmrg		os=-wince
13496df26cacSmrg		;;
13506df26cacSmrg	-osfrose*)
13516df26cacSmrg		os=-osfrose
13526df26cacSmrg		;;
13536df26cacSmrg	-osf*)
13546df26cacSmrg		os=-osf
13556df26cacSmrg		;;
13566df26cacSmrg	-utek*)
13576df26cacSmrg		os=-bsd
13586df26cacSmrg		;;
13596df26cacSmrg	-dynix*)
13606df26cacSmrg		os=-bsd
13616df26cacSmrg		;;
13626df26cacSmrg	-acis*)
13636df26cacSmrg		os=-aos
13646df26cacSmrg		;;
13656df26cacSmrg	-atheos*)
13666df26cacSmrg		os=-atheos
13676df26cacSmrg		;;
13686df26cacSmrg	-syllable*)
13696df26cacSmrg		os=-syllable
13706df26cacSmrg		;;
13716df26cacSmrg	-386bsd)
13726df26cacSmrg		os=-bsd
13736df26cacSmrg		;;
13746df26cacSmrg	-ctix* | -uts*)
13756df26cacSmrg		os=-sysv
13766df26cacSmrg		;;
13776df26cacSmrg	-nova*)
13786df26cacSmrg		os=-rtmk-nova
13796df26cacSmrg		;;
13806df26cacSmrg	-ns2 )
13816df26cacSmrg		os=-nextstep2
13826df26cacSmrg		;;
13836df26cacSmrg	-nsk*)
13846df26cacSmrg		os=-nsk
13856df26cacSmrg		;;
13866df26cacSmrg	# Preserve the version number of sinix5.
13876df26cacSmrg	-sinix5.*)
13886df26cacSmrg		os=`echo $os | sed -e 's|sinix|sysv|'`
13896df26cacSmrg		;;
13906df26cacSmrg	-sinix*)
13916df26cacSmrg		os=-sysv4
13926df26cacSmrg		;;
13936df26cacSmrg        -tpf*)
13946df26cacSmrg		os=-tpf
13956df26cacSmrg		;;
13966df26cacSmrg	-triton*)
13976df26cacSmrg		os=-sysv3
13986df26cacSmrg		;;
13996df26cacSmrg	-oss*)
14006df26cacSmrg		os=-sysv3
14016df26cacSmrg		;;
14026df26cacSmrg	-svr4)
14036df26cacSmrg		os=-sysv4
14046df26cacSmrg		;;
14056df26cacSmrg	-svr3)
14066df26cacSmrg		os=-sysv3
14076df26cacSmrg		;;
14086df26cacSmrg	-sysvr4)
14096df26cacSmrg		os=-sysv4
14106df26cacSmrg		;;
14116df26cacSmrg	# This must come after -sysvr4.
14126df26cacSmrg	-sysv*)
14136df26cacSmrg		;;
14146df26cacSmrg	-ose*)
14156df26cacSmrg		os=-ose
14166df26cacSmrg		;;
14176df26cacSmrg	-es1800*)
14186df26cacSmrg		os=-ose
14196df26cacSmrg		;;
14206df26cacSmrg	-xenix)
14216df26cacSmrg		os=-xenix
14226df26cacSmrg		;;
14236df26cacSmrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
14246df26cacSmrg		os=-mint
14256df26cacSmrg		;;
14266df26cacSmrg	-aros*)
14276df26cacSmrg		os=-aros
14286df26cacSmrg		;;
14296df26cacSmrg	-kaos*)
14306df26cacSmrg		os=-kaos
14316df26cacSmrg		;;
14326df26cacSmrg	-zvmoe)
14336df26cacSmrg		os=-zvmoe
14346df26cacSmrg		;;
14351f27ce9aSmrg	-dicos*)
14361f27ce9aSmrg		os=-dicos
14371f27ce9aSmrg		;;
14386df26cacSmrg	-none)
14396df26cacSmrg		;;
14406df26cacSmrg	*)
14416df26cacSmrg		# Get rid of the `-' at the beginning of $os.
14426df26cacSmrg		os=`echo $os | sed 's/[^-]*-//'`
14436df26cacSmrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
14446df26cacSmrg		exit 1
14456df26cacSmrg		;;
14466df26cacSmrgesac
14476df26cacSmrgelse
14486df26cacSmrg
14496df26cacSmrg# Here we handle the default operating systems that come with various machines.
14506df26cacSmrg# The value should be what the vendor currently ships out the door with their
14516df26cacSmrg# machine or put another way, the most popular os provided with the machine.
14526df26cacSmrg
14536df26cacSmrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
14546df26cacSmrg# "-sun"), then you have to tell the case statement up towards the top
14556df26cacSmrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
14566df26cacSmrg# will signal an error saying that MANUFACTURER isn't an operating
14576df26cacSmrg# system, and we'll never get to this point.
14586df26cacSmrg
14596df26cacSmrgcase $basic_machine in
14606df26cacSmrg        score-*)
14616df26cacSmrg		os=-elf
14626df26cacSmrg		;;
14636df26cacSmrg        spu-*)
14646df26cacSmrg		os=-elf
14656df26cacSmrg		;;
14666df26cacSmrg	*-acorn)
14676df26cacSmrg		os=-riscix1.2
14686df26cacSmrg		;;
14696df26cacSmrg	arm*-rebel)
14706df26cacSmrg		os=-linux
14716df26cacSmrg		;;
14726df26cacSmrg	arm*-semi)
14736df26cacSmrg		os=-aout
14746df26cacSmrg		;;
14756df26cacSmrg        c4x-* | tic4x-*)
14766df26cacSmrg        	os=-coff
14776df26cacSmrg		;;
14786df26cacSmrg	# This must come before the *-dec entry.
14796df26cacSmrg	pdp10-*)
14806df26cacSmrg		os=-tops20
14816df26cacSmrg		;;
14826df26cacSmrg	pdp11-*)
14836df26cacSmrg		os=-none
14846df26cacSmrg		;;
14856df26cacSmrg	*-dec | vax-*)
14866df26cacSmrg		os=-ultrix4.2
14876df26cacSmrg		;;
14886df26cacSmrg	m68*-apollo)
14896df26cacSmrg		os=-domain
14906df26cacSmrg		;;
14916df26cacSmrg	i386-sun)
14926df26cacSmrg		os=-sunos4.0.2
14936df26cacSmrg		;;
14946df26cacSmrg	m68000-sun)
14956df26cacSmrg		os=-sunos3
14966df26cacSmrg		# This also exists in the configure program, but was not the
14976df26cacSmrg		# default.
14986df26cacSmrg		# os=-sunos4
14996df26cacSmrg		;;
15006df26cacSmrg	m68*-cisco)
15016df26cacSmrg		os=-aout
15026df26cacSmrg		;;
150316fd1166Smrg        mep-*)
150416fd1166Smrg		os=-elf
150516fd1166Smrg		;;
15066df26cacSmrg	mips*-cisco)
15076df26cacSmrg		os=-elf
15086df26cacSmrg		;;
15096df26cacSmrg	mips*-*)
15106df26cacSmrg		os=-elf
15116df26cacSmrg		;;
15126df26cacSmrg	or32-*)
15136df26cacSmrg		os=-coff
15146df26cacSmrg		;;
15156df26cacSmrg	*-tti)	# must be before sparc entry or we get the wrong os.
15166df26cacSmrg		os=-sysv3
15176df26cacSmrg		;;
15186df26cacSmrg	sparc-* | *-sun)
15196df26cacSmrg		os=-sunos4.1.1
15206df26cacSmrg		;;
15216df26cacSmrg	*-be)
15226df26cacSmrg		os=-beos
15236df26cacSmrg		;;
15246df26cacSmrg	*-haiku)
15256df26cacSmrg		os=-haiku
15266df26cacSmrg		;;
15276df26cacSmrg	*-ibm)
15286df26cacSmrg		os=-aix
15296df26cacSmrg		;;
15306df26cacSmrg    	*-knuth)
15316df26cacSmrg		os=-mmixware
15326df26cacSmrg		;;
15336df26cacSmrg	*-wec)
15346df26cacSmrg		os=-proelf
15356df26cacSmrg		;;
15366df26cacSmrg	*-winbond)
15376df26cacSmrg		os=-proelf
15386df26cacSmrg		;;
15396df26cacSmrg	*-oki)
15406df26cacSmrg		os=-proelf
15416df26cacSmrg		;;
15426df26cacSmrg	*-hp)
15436df26cacSmrg		os=-hpux
15446df26cacSmrg		;;
15456df26cacSmrg	*-hitachi)
15466df26cacSmrg		os=-hiux
15476df26cacSmrg		;;
15486df26cacSmrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
15496df26cacSmrg		os=-sysv
15506df26cacSmrg		;;
15516df26cacSmrg	*-cbm)
15526df26cacSmrg		os=-amigaos
15536df26cacSmrg		;;
15546df26cacSmrg	*-dg)
15556df26cacSmrg		os=-dgux
15566df26cacSmrg		;;
15576df26cacSmrg	*-dolphin)
15586df26cacSmrg		os=-sysv3
15596df26cacSmrg		;;
15606df26cacSmrg	m68k-ccur)
15616df26cacSmrg		os=-rtu
15626df26cacSmrg		;;
15636df26cacSmrg	m88k-omron*)
15646df26cacSmrg		os=-luna
15656df26cacSmrg		;;
15666df26cacSmrg	*-next )
15676df26cacSmrg		os=-nextstep
15686df26cacSmrg		;;
15696df26cacSmrg	*-sequent)
15706df26cacSmrg		os=-ptx
15716df26cacSmrg		;;
15726df26cacSmrg	*-crds)
15736df26cacSmrg		os=-unos
15746df26cacSmrg		;;
15756df26cacSmrg	*-ns)
15766df26cacSmrg		os=-genix
15776df26cacSmrg		;;
15786df26cacSmrg	i370-*)
15796df26cacSmrg		os=-mvs
15806df26cacSmrg		;;
15816df26cacSmrg	*-next)
15826df26cacSmrg		os=-nextstep3
15836df26cacSmrg		;;
15846df26cacSmrg	*-gould)
15856df26cacSmrg		os=-sysv
15866df26cacSmrg		;;
15876df26cacSmrg	*-highlevel)
15886df26cacSmrg		os=-bsd
15896df26cacSmrg		;;
15906df26cacSmrg	*-encore)
15916df26cacSmrg		os=-bsd
15926df26cacSmrg		;;
15936df26cacSmrg	*-sgi)
15946df26cacSmrg		os=-irix
15956df26cacSmrg		;;
15966df26cacSmrg	*-siemens)
15976df26cacSmrg		os=-sysv4
15986df26cacSmrg		;;
15996df26cacSmrg	*-masscomp)
16006df26cacSmrg		os=-rtu
16016df26cacSmrg		;;
16026df26cacSmrg	f30[01]-fujitsu | f700-fujitsu)
16036df26cacSmrg		os=-uxpv
16046df26cacSmrg		;;
16056df26cacSmrg	*-rom68k)
16066df26cacSmrg		os=-coff
16076df26cacSmrg		;;
16086df26cacSmrg	*-*bug)
16096df26cacSmrg		os=-coff
16106df26cacSmrg		;;
16116df26cacSmrg	*-apple)
16126df26cacSmrg		os=-macos
16136df26cacSmrg		;;
16146df26cacSmrg	*-atari*)
16156df26cacSmrg		os=-mint
16166df26cacSmrg		;;
16176df26cacSmrg	*)
16186df26cacSmrg		os=-none
16196df26cacSmrg		;;
16206df26cacSmrgesac
16216df26cacSmrgfi
16226df26cacSmrg
16236df26cacSmrg# Here we handle the case where we know the os, and the CPU type, but not the
16246df26cacSmrg# manufacturer.  We pick the logical manufacturer.
16256df26cacSmrgvendor=unknown
16266df26cacSmrgcase $basic_machine in
16276df26cacSmrg	*-unknown)
16286df26cacSmrg		case $os in
16296df26cacSmrg			-riscix*)
16306df26cacSmrg				vendor=acorn
16316df26cacSmrg				;;
16326df26cacSmrg			-sunos*)
16336df26cacSmrg				vendor=sun
16346df26cacSmrg				;;
16351f27ce9aSmrg			-cnk*|-aix*)
16366df26cacSmrg				vendor=ibm
16376df26cacSmrg				;;
16386df26cacSmrg			-beos*)
16396df26cacSmrg				vendor=be
16406df26cacSmrg				;;
16416df26cacSmrg			-hpux*)
16426df26cacSmrg				vendor=hp
16436df26cacSmrg				;;
16446df26cacSmrg			-mpeix*)
16456df26cacSmrg				vendor=hp
16466df26cacSmrg				;;
16476df26cacSmrg			-hiux*)
16486df26cacSmrg				vendor=hitachi
16496df26cacSmrg				;;
16506df26cacSmrg			-unos*)
16516df26cacSmrg				vendor=crds
16526df26cacSmrg				;;
16536df26cacSmrg			-dgux*)
16546df26cacSmrg				vendor=dg
16556df26cacSmrg				;;
16566df26cacSmrg			-luna*)
16576df26cacSmrg				vendor=omron
16586df26cacSmrg				;;
16596df26cacSmrg			-genix*)
16606df26cacSmrg				vendor=ns
16616df26cacSmrg				;;
16626df26cacSmrg			-mvs* | -opened*)
16636df26cacSmrg				vendor=ibm
16646df26cacSmrg				;;
16656df26cacSmrg			-os400*)
16666df26cacSmrg				vendor=ibm
16676df26cacSmrg				;;
16686df26cacSmrg			-ptx*)
16696df26cacSmrg				vendor=sequent
16706df26cacSmrg				;;
16716df26cacSmrg			-tpf*)
16726df26cacSmrg				vendor=ibm
16736df26cacSmrg				;;
16746df26cacSmrg			-vxsim* | -vxworks* | -windiss*)
16756df26cacSmrg				vendor=wrs
16766df26cacSmrg				;;
16776df26cacSmrg			-aux*)
16786df26cacSmrg				vendor=apple
16796df26cacSmrg				;;
16806df26cacSmrg			-hms*)
16816df26cacSmrg				vendor=hitachi
16826df26cacSmrg				;;
16836df26cacSmrg			-mpw* | -macos*)
16846df26cacSmrg				vendor=apple
16856df26cacSmrg				;;
16866df26cacSmrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
16876df26cacSmrg				vendor=atari
16886df26cacSmrg				;;
16896df26cacSmrg			-vos*)
16906df26cacSmrg				vendor=stratus
16916df26cacSmrg				;;
16926df26cacSmrg		esac
16936df26cacSmrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
16946df26cacSmrg		;;
16956df26cacSmrgesac
16966df26cacSmrg
16976df26cacSmrgecho $basic_machine$os
16986df26cacSmrgexit
16996df26cacSmrg
17006df26cacSmrg# Local variables:
17016df26cacSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
17026df26cacSmrg# time-stamp-start: "timestamp='"
17036df26cacSmrg# time-stamp-format: "%:y-%02m-%02d"
17046df26cacSmrg# time-stamp-end: "'"
17056df26cacSmrg# End:
1706