config.sub revision de7ed6e8
18255a313Smrg#! /bin/sh
28255a313Smrg# Configuration validation subroutine script.
38255a313Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4de7ed6e8Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
58255a313Smrg#   Free Software Foundation, Inc.
68255a313Smrg
7de7ed6e8Smrgtimestamp='2010-09-11'
88255a313Smrg
98255a313Smrg# This file is (in principle) common to ALL GNU software.
108255a313Smrg# The presence of a machine in this file suggests that SOME GNU software
118255a313Smrg# can handle that machine.  It does not imply ALL GNU software can.
128255a313Smrg#
138255a313Smrg# This file is free software; you can redistribute it and/or modify
148255a313Smrg# it under the terms of the GNU General Public License as published by
158255a313Smrg# the Free Software Foundation; either version 2 of the License, or
168255a313Smrg# (at your option) any later version.
178255a313Smrg#
188255a313Smrg# This program is distributed in the hope that it will be useful,
198255a313Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
208255a313Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
218255a313Smrg# GNU General Public License for more details.
228255a313Smrg#
238255a313Smrg# You should have received a copy of the GNU General Public License
248255a313Smrg# along with this program; if not, write to the Free Software
258255a313Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
268255a313Smrg# 02110-1301, USA.
278255a313Smrg#
288255a313Smrg# As a special exception to the GNU General Public License, if you
298255a313Smrg# distribute this file as part of a program that contains a
308255a313Smrg# configuration script generated by Autoconf, you may include it under
318255a313Smrg# the same distribution terms that you use for the rest of that program.
328255a313Smrg
338255a313Smrg
348255a313Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
35de7ed6e8Smrg# diff and a properly formatted GNU ChangeLog entry.
368255a313Smrg#
378255a313Smrg# Configuration subroutine to validate and canonicalize a configuration type.
388255a313Smrg# Supply the specified configuration type as an argument.
398255a313Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
408255a313Smrg# Otherwise, we print the canonical config type on stdout and succeed.
418255a313Smrg
42de7ed6e8Smrg# You can get the latest version of this script from:
43de7ed6e8Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
44de7ed6e8Smrg
458255a313Smrg# This file is supposed to be the same for all GNU packages
468255a313Smrg# and recognize all the CPU types, system types and aliases
478255a313Smrg# that are meaningful with *any* GNU software.
488255a313Smrg# Each package is responsible for reporting which valid configurations
498255a313Smrg# it does not support.  The user should be able to distinguish
508255a313Smrg# a failure to support a valid configuration from a meaningless
518255a313Smrg# configuration.
528255a313Smrg
538255a313Smrg# The goal of this file is to map all the various variations of a given
548255a313Smrg# machine specification into a single specification in the form:
558255a313Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
568255a313Smrg# or in some cases, the newer four-part form:
578255a313Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
588255a313Smrg# It is wrong to echo any other type of specification.
598255a313Smrg
608255a313Smrgme=`echo "$0" | sed -e 's,.*/,,'`
618255a313Smrg
628255a313Smrgusage="\
638255a313SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
648255a313Smrg       $0 [OPTION] ALIAS
658255a313Smrg
668255a313SmrgCanonicalize a configuration name.
678255a313Smrg
688255a313SmrgOperation modes:
698255a313Smrg  -h, --help         print this help, then exit
708255a313Smrg  -t, --time-stamp   print date of last modification, then exit
718255a313Smrg  -v, --version      print version number, then exit
728255a313Smrg
738255a313SmrgReport bugs and patches to <config-patches@gnu.org>."
748255a313Smrg
758255a313Smrgversion="\
768255a313SmrgGNU config.sub ($timestamp)
778255a313Smrg
78de7ed6e8SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79de7ed6e8Smrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
80de7ed6e8SmrgSoftware Foundation, Inc.
818255a313Smrg
828255a313SmrgThis is free software; see the source for copying conditions.  There is NO
838255a313Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
848255a313Smrg
858255a313Smrghelp="
868255a313SmrgTry \`$me --help' for more information."
878255a313Smrg
888255a313Smrg# Parse command line
898255a313Smrgwhile test $# -gt 0 ; do
908255a313Smrg  case $1 in
918255a313Smrg    --time-stamp | --time* | -t )
928255a313Smrg       echo "$timestamp" ; exit ;;
938255a313Smrg    --version | -v )
948255a313Smrg       echo "$version" ; exit ;;
958255a313Smrg    --help | --h* | -h )
968255a313Smrg       echo "$usage"; exit ;;
978255a313Smrg    -- )     # Stop option processing
988255a313Smrg       shift; break ;;
998255a313Smrg    - )	# Use stdin as input.
1008255a313Smrg       break ;;
1018255a313Smrg    -* )
1028255a313Smrg       echo "$me: invalid option $1$help"
1038255a313Smrg       exit 1 ;;
1048255a313Smrg
1058255a313Smrg    *local*)
1068255a313Smrg       # First pass through any local machine types.
1078255a313Smrg       echo $1
1088255a313Smrg       exit ;;
1098255a313Smrg
1108255a313Smrg    * )
1118255a313Smrg       break ;;
1128255a313Smrg  esac
1138255a313Smrgdone
1148255a313Smrg
1158255a313Smrgcase $# in
1168255a313Smrg 0) echo "$me: missing argument$help" >&2
1178255a313Smrg    exit 1;;
1188255a313Smrg 1) ;;
1198255a313Smrg *) echo "$me: too many arguments$help" >&2
1208255a313Smrg    exit 1;;
1218255a313Smrgesac
1228255a313Smrg
1238255a313Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1248255a313Smrg# Here we must recognize all the valid KERNEL-OS combinations.
1258255a313Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1268255a313Smrgcase $maybe_os in
127de7ed6e8Smrg  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128de7ed6e8Smrg  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129de7ed6e8Smrg  knetbsd*-gnu* | netbsd*-gnu* | \
1308255a313Smrg  kopensolaris*-gnu* | \
1318255a313Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
1328255a313Smrg    os=-$maybe_os
1338255a313Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1348255a313Smrg    ;;
1358255a313Smrg  *)
1368255a313Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1378255a313Smrg    if [ $basic_machine != $1 ]
1388255a313Smrg    then os=`echo $1 | sed 's/.*-/-/'`
1398255a313Smrg    else os=; fi
1408255a313Smrg    ;;
1418255a313Smrgesac
1428255a313Smrg
1438255a313Smrg### Let's recognize common machines as not being operating systems so
1448255a313Smrg### that things like config.sub decstation-3100 work.  We also
1458255a313Smrg### recognize some manufacturers as not being operating systems, so we
1468255a313Smrg### can provide default operating systems below.
1478255a313Smrgcase $os in
1488255a313Smrg	-sun*os*)
1498255a313Smrg		# Prevent following clause from handling this invalid input.
1508255a313Smrg		;;
1518255a313Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
1528255a313Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
1538255a313Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
1548255a313Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1558255a313Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1568255a313Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
157de7ed6e8Smrg	-apple | -axis | -knuth | -cray | -microblaze)
1588255a313Smrg		os=
1598255a313Smrg		basic_machine=$1
1608255a313Smrg		;;
161de7ed6e8Smrg        -bluegene*)
162de7ed6e8Smrg	        os=-cnk
163de7ed6e8Smrg		;;
1648255a313Smrg	-sim | -cisco | -oki | -wec | -winbond)
1658255a313Smrg		os=
1668255a313Smrg		basic_machine=$1
1678255a313Smrg		;;
1688255a313Smrg	-scout)
1698255a313Smrg		;;
1708255a313Smrg	-wrs)
1718255a313Smrg		os=-vxworks
1728255a313Smrg		basic_machine=$1
1738255a313Smrg		;;
1748255a313Smrg	-chorusos*)
1758255a313Smrg		os=-chorusos
1768255a313Smrg		basic_machine=$1
1778255a313Smrg		;;
1788255a313Smrg 	-chorusrdb)
1798255a313Smrg 		os=-chorusrdb
1808255a313Smrg		basic_machine=$1
1818255a313Smrg 		;;
1828255a313Smrg	-hiux*)
1838255a313Smrg		os=-hiuxwe2
1848255a313Smrg		;;
1858255a313Smrg	-sco6)
1868255a313Smrg		os=-sco5v6
1878255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1888255a313Smrg		;;
1898255a313Smrg	-sco5)
1908255a313Smrg		os=-sco3.2v5
1918255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1928255a313Smrg		;;
1938255a313Smrg	-sco4)
1948255a313Smrg		os=-sco3.2v4
1958255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1968255a313Smrg		;;
1978255a313Smrg	-sco3.2.[4-9]*)
1988255a313Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1998255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2008255a313Smrg		;;
2018255a313Smrg	-sco3.2v[4-9]*)
2028255a313Smrg		# Don't forget version if it is 3.2v4 or newer.
2038255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2048255a313Smrg		;;
2058255a313Smrg	-sco5v6*)
2068255a313Smrg		# Don't forget version if it is 3.2v4 or newer.
2078255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2088255a313Smrg		;;
2098255a313Smrg	-sco*)
2108255a313Smrg		os=-sco3.2v2
2118255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2128255a313Smrg		;;
2138255a313Smrg	-udk*)
2148255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2158255a313Smrg		;;
2168255a313Smrg	-isc)
2178255a313Smrg		os=-isc2.2
2188255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2198255a313Smrg		;;
2208255a313Smrg	-clix*)
2218255a313Smrg		basic_machine=clipper-intergraph
2228255a313Smrg		;;
2238255a313Smrg	-isc*)
2248255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2258255a313Smrg		;;
2268255a313Smrg	-lynx*)
2278255a313Smrg		os=-lynxos
2288255a313Smrg		;;
2298255a313Smrg	-ptx*)
2308255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
2318255a313Smrg		;;
2328255a313Smrg	-windowsnt*)
2338255a313Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
2348255a313Smrg		;;
2358255a313Smrg	-psos*)
2368255a313Smrg		os=-psos
2378255a313Smrg		;;
2388255a313Smrg	-mint | -mint[0-9]*)
2398255a313Smrg		basic_machine=m68k-atari
2408255a313Smrg		os=-mint
2418255a313Smrg		;;
2428255a313Smrgesac
2438255a313Smrg
2448255a313Smrg# Decode aliases for certain CPU-COMPANY combinations.
2458255a313Smrgcase $basic_machine in
2468255a313Smrg	# Recognize the basic CPU types without company name.
2478255a313Smrg	# Some are omitted here because they have special meanings below.
2488255a313Smrg	1750a | 580 \
2498255a313Smrg	| a29k \
2508255a313Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
2518255a313Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
2528255a313Smrg	| am33_2.0 \
2538255a313Smrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
2548255a313Smrg	| bfin \
2558255a313Smrg	| c4x | clipper \
2568255a313Smrg	| d10v | d30v | dlx | dsp16xx \
2578255a313Smrg	| fido | fr30 | frv \
2588255a313Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
2598255a313Smrg	| i370 | i860 | i960 | ia64 \
2608255a313Smrg	| ip2k | iq2000 \
2618255a313Smrg	| lm32 \
2628255a313Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
2638255a313Smrg	| maxq | mb | microblaze | mcore | mep | metag \
2648255a313Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
2658255a313Smrg	| mips16 \
2668255a313Smrg	| mips64 | mips64el \
2678255a313Smrg	| mips64octeon | mips64octeonel \
2688255a313Smrg	| mips64orion | mips64orionel \
2698255a313Smrg	| mips64r5900 | mips64r5900el \
2708255a313Smrg	| mips64vr | mips64vrel \
2718255a313Smrg	| mips64vr4100 | mips64vr4100el \
2728255a313Smrg	| mips64vr4300 | mips64vr4300el \
2738255a313Smrg	| mips64vr5000 | mips64vr5000el \
2748255a313Smrg	| mips64vr5900 | mips64vr5900el \
2758255a313Smrg	| mipsisa32 | mipsisa32el \
2768255a313Smrg	| mipsisa32r2 | mipsisa32r2el \
2778255a313Smrg	| mipsisa64 | mipsisa64el \
2788255a313Smrg	| mipsisa64r2 | mipsisa64r2el \
2798255a313Smrg	| mipsisa64sb1 | mipsisa64sb1el \
2808255a313Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
2818255a313Smrg	| mipstx39 | mipstx39el \
2828255a313Smrg	| mn10200 | mn10300 \
2838255a313Smrg	| moxie \
2848255a313Smrg	| mt \
2858255a313Smrg	| msp430 \
286de7ed6e8Smrg	| nds32 | nds32le | nds32be \
2878255a313Smrg	| nios | nios2 \
2888255a313Smrg	| ns16k | ns32k \
2898255a313Smrg	| or32 \
2908255a313Smrg	| pdp10 | pdp11 | pj | pjl \
2918255a313Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
2928255a313Smrg	| pyramid \
293de7ed6e8Smrg	| rx \
2948255a313Smrg	| score \
2958255a313Smrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
2968255a313Smrg	| sh64 | sh64le \
2978255a313Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
2988255a313Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
2998255a313Smrg	| spu | strongarm \
300de7ed6e8Smrg	| tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
301de7ed6e8Smrg	| ubicom32 \
3028255a313Smrg	| v850 | v850e \
3038255a313Smrg	| we32k \
3048255a313Smrg	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
3058255a313Smrg	| z8k | z80)
3068255a313Smrg		basic_machine=$basic_machine-unknown
3078255a313Smrg		;;
308de7ed6e8Smrg	c54x)
309de7ed6e8Smrg		basic_machine=tic54x-unknown
310de7ed6e8Smrg		;;
311de7ed6e8Smrg	c55x)
312de7ed6e8Smrg		basic_machine=tic55x-unknown
313de7ed6e8Smrg		;;
314de7ed6e8Smrg	c6x)
315de7ed6e8Smrg		basic_machine=tic6x-unknown
316de7ed6e8Smrg		;;
317de7ed6e8Smrg	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
3188255a313Smrg		# Motorola 68HC11/12.
3198255a313Smrg		basic_machine=$basic_machine-unknown
3208255a313Smrg		os=-none
3218255a313Smrg		;;
3228255a313Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
3238255a313Smrg		;;
3248255a313Smrg	ms1)
3258255a313Smrg		basic_machine=mt-unknown
3268255a313Smrg		;;
3278255a313Smrg
3288255a313Smrg	# We use `pc' rather than `unknown'
3298255a313Smrg	# because (1) that's what they normally are, and
3308255a313Smrg	# (2) the word "unknown" tends to confuse beginning users.
3318255a313Smrg	i*86 | x86_64)
3328255a313Smrg	  basic_machine=$basic_machine-pc
3338255a313Smrg	  ;;
3348255a313Smrg	# Object if more than one company name word.
3358255a313Smrg	*-*-*)
3368255a313Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
3378255a313Smrg		exit 1
3388255a313Smrg		;;
3398255a313Smrg	# Recognize the basic CPU types with company name.
3408255a313Smrg	580-* \
3418255a313Smrg	| a29k-* \
3428255a313Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
3438255a313Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
3448255a313Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
3458255a313Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3468255a313Smrg	| avr-* | avr32-* \
3478255a313Smrg	| bfin-* | bs2000-* \
348de7ed6e8Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* \
3498255a313Smrg	| clipper-* | craynv-* | cydra-* \
3508255a313Smrg	| d10v-* | d30v-* | dlx-* \
3518255a313Smrg	| elxsi-* \
3528255a313Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
3538255a313Smrg	| h8300-* | h8500-* \
3548255a313Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
3558255a313Smrg	| i*86-* | i860-* | i960-* | ia64-* \
3568255a313Smrg	| ip2k-* | iq2000-* \
3578255a313Smrg	| lm32-* \
3588255a313Smrg	| m32c-* | m32r-* | m32rle-* \
3598255a313Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
360de7ed6e8Smrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
3618255a313Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
3628255a313Smrg	| mips16-* \
3638255a313Smrg	| mips64-* | mips64el-* \
3648255a313Smrg	| mips64octeon-* | mips64octeonel-* \
3658255a313Smrg	| mips64orion-* | mips64orionel-* \
3668255a313Smrg	| mips64r5900-* | mips64r5900el-* \
3678255a313Smrg	| mips64vr-* | mips64vrel-* \
3688255a313Smrg	| mips64vr4100-* | mips64vr4100el-* \
3698255a313Smrg	| mips64vr4300-* | mips64vr4300el-* \
3708255a313Smrg	| mips64vr5000-* | mips64vr5000el-* \
3718255a313Smrg	| mips64vr5900-* | mips64vr5900el-* \
3728255a313Smrg	| mipsisa32-* | mipsisa32el-* \
3738255a313Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
3748255a313Smrg	| mipsisa64-* | mipsisa64el-* \
3758255a313Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
3768255a313Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
3778255a313Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
3788255a313Smrg	| mipstx39-* | mipstx39el-* \
3798255a313Smrg	| mmix-* \
3808255a313Smrg	| mt-* \
3818255a313Smrg	| msp430-* \
382de7ed6e8Smrg	| nds32-* | nds32le-* | nds32be-* \
3838255a313Smrg	| nios-* | nios2-* \
3848255a313Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
3858255a313Smrg	| orion-* \
3868255a313Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
3878255a313Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
3888255a313Smrg	| pyramid-* \
389de7ed6e8Smrg	| romp-* | rs6000-* | rx-* \
3908255a313Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
3918255a313Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
3928255a313Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
3938255a313Smrg	| sparclite-* \
3948255a313Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
3958255a313Smrg	| tahoe-* | thumb-* \
396de7ed6e8Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
397de7ed6e8Smrg	| tile-* | tilegx-* \
3988255a313Smrg	| tron-* \
399de7ed6e8Smrg	| ubicom32-* \
4008255a313Smrg	| v850-* | v850e-* | vax-* \
4018255a313Smrg	| we32k-* \
4028255a313Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
4038255a313Smrg	| xstormy16-* | xtensa*-* \
4048255a313Smrg	| ymp-* \
4058255a313Smrg	| z8k-* | z80-*)
4068255a313Smrg		;;
4078255a313Smrg	# Recognize the basic CPU types without company name, with glob match.
4088255a313Smrg	xtensa*)
4098255a313Smrg		basic_machine=$basic_machine-unknown
4108255a313Smrg		;;
4118255a313Smrg	# Recognize the various machine names and aliases which stand
4128255a313Smrg	# for a CPU type and a company and sometimes even an OS.
4138255a313Smrg	386bsd)
4148255a313Smrg		basic_machine=i386-unknown
4158255a313Smrg		os=-bsd
4168255a313Smrg		;;
4178255a313Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
4188255a313Smrg		basic_machine=m68000-att
4198255a313Smrg		;;
4208255a313Smrg	3b*)
4218255a313Smrg		basic_machine=we32k-att
4228255a313Smrg		;;
4238255a313Smrg	a29khif)
4248255a313Smrg		basic_machine=a29k-amd
4258255a313Smrg		os=-udi
4268255a313Smrg		;;
4278255a313Smrg    	abacus)
4288255a313Smrg		basic_machine=abacus-unknown
4298255a313Smrg		;;
4308255a313Smrg	adobe68k)
4318255a313Smrg		basic_machine=m68010-adobe
4328255a313Smrg		os=-scout
4338255a313Smrg		;;
4348255a313Smrg	alliant | fx80)
4358255a313Smrg		basic_machine=fx80-alliant
4368255a313Smrg		;;
4378255a313Smrg	altos | altos3068)
4388255a313Smrg		basic_machine=m68k-altos
4398255a313Smrg		;;
4408255a313Smrg	am29k)
4418255a313Smrg		basic_machine=a29k-none
4428255a313Smrg		os=-bsd
4438255a313Smrg		;;
4448255a313Smrg	amd64)
4458255a313Smrg		basic_machine=x86_64-pc
4468255a313Smrg		;;
4478255a313Smrg	amd64-*)
4488255a313Smrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
4498255a313Smrg		;;
4508255a313Smrg	amdahl)
4518255a313Smrg		basic_machine=580-amdahl
4528255a313Smrg		os=-sysv
4538255a313Smrg		;;
4548255a313Smrg	amiga | amiga-*)
4558255a313Smrg		basic_machine=m68k-unknown
4568255a313Smrg		;;
4578255a313Smrg	amigaos | amigados)
4588255a313Smrg		basic_machine=m68k-unknown
4598255a313Smrg		os=-amigaos
4608255a313Smrg		;;
4618255a313Smrg	amigaunix | amix)
4628255a313Smrg		basic_machine=m68k-unknown
4638255a313Smrg		os=-sysv4
4648255a313Smrg		;;
4658255a313Smrg	apollo68)
4668255a313Smrg		basic_machine=m68k-apollo
4678255a313Smrg		os=-sysv
4688255a313Smrg		;;
4698255a313Smrg	apollo68bsd)
4708255a313Smrg		basic_machine=m68k-apollo
4718255a313Smrg		os=-bsd
4728255a313Smrg		;;
4738255a313Smrg	aros)
4748255a313Smrg		basic_machine=i386-pc
4758255a313Smrg		os=-aros
4768255a313Smrg		;;
4778255a313Smrg	aux)
4788255a313Smrg		basic_machine=m68k-apple
4798255a313Smrg		os=-aux
4808255a313Smrg		;;
4818255a313Smrg	balance)
4828255a313Smrg		basic_machine=ns32k-sequent
4838255a313Smrg		os=-dynix
4848255a313Smrg		;;
4858255a313Smrg	blackfin)
4868255a313Smrg		basic_machine=bfin-unknown
4878255a313Smrg		os=-linux
4888255a313Smrg		;;
4898255a313Smrg	blackfin-*)
4908255a313Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
4918255a313Smrg		os=-linux
4928255a313Smrg		;;
493de7ed6e8Smrg	bluegene*)
494de7ed6e8Smrg		basic_machine=powerpc-ibm
495de7ed6e8Smrg		os=-cnk
496de7ed6e8Smrg		;;
497de7ed6e8Smrg	c54x-*)
498de7ed6e8Smrg		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
499de7ed6e8Smrg		;;
500de7ed6e8Smrg	c55x-*)
501de7ed6e8Smrg		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
502de7ed6e8Smrg		;;
503de7ed6e8Smrg	c6x-*)
504de7ed6e8Smrg		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
505de7ed6e8Smrg		;;
5068255a313Smrg	c90)
5078255a313Smrg		basic_machine=c90-cray
5088255a313Smrg		os=-unicos
5098255a313Smrg		;;
5108255a313Smrg        cegcc)
5118255a313Smrg		basic_machine=arm-unknown
5128255a313Smrg		os=-cegcc
5138255a313Smrg		;;
5148255a313Smrg	convex-c1)
5158255a313Smrg		basic_machine=c1-convex
5168255a313Smrg		os=-bsd
5178255a313Smrg		;;
5188255a313Smrg	convex-c2)
5198255a313Smrg		basic_machine=c2-convex
5208255a313Smrg		os=-bsd
5218255a313Smrg		;;
5228255a313Smrg	convex-c32)
5238255a313Smrg		basic_machine=c32-convex
5248255a313Smrg		os=-bsd
5258255a313Smrg		;;
5268255a313Smrg	convex-c34)
5278255a313Smrg		basic_machine=c34-convex
5288255a313Smrg		os=-bsd
5298255a313Smrg		;;
5308255a313Smrg	convex-c38)
5318255a313Smrg		basic_machine=c38-convex
5328255a313Smrg		os=-bsd
5338255a313Smrg		;;
5348255a313Smrg	cray | j90)
5358255a313Smrg		basic_machine=j90-cray
5368255a313Smrg		os=-unicos
5378255a313Smrg		;;
5388255a313Smrg	craynv)
5398255a313Smrg		basic_machine=craynv-cray
5408255a313Smrg		os=-unicosmp
5418255a313Smrg		;;
5428255a313Smrg	cr16)
5438255a313Smrg		basic_machine=cr16-unknown
5448255a313Smrg		os=-elf
5458255a313Smrg		;;
5468255a313Smrg	crds | unos)
5478255a313Smrg		basic_machine=m68k-crds
5488255a313Smrg		;;
5498255a313Smrg	crisv32 | crisv32-* | etraxfs*)
5508255a313Smrg		basic_machine=crisv32-axis
5518255a313Smrg		;;
5528255a313Smrg	cris | cris-* | etrax*)
5538255a313Smrg		basic_machine=cris-axis
5548255a313Smrg		;;
5558255a313Smrg	crx)
5568255a313Smrg		basic_machine=crx-unknown
5578255a313Smrg		os=-elf
5588255a313Smrg		;;
5598255a313Smrg	da30 | da30-*)
5608255a313Smrg		basic_machine=m68k-da30
5618255a313Smrg		;;
5628255a313Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
5638255a313Smrg		basic_machine=mips-dec
5648255a313Smrg		;;
5658255a313Smrg	decsystem10* | dec10*)
5668255a313Smrg		basic_machine=pdp10-dec
5678255a313Smrg		os=-tops10
5688255a313Smrg		;;
5698255a313Smrg	decsystem20* | dec20*)
5708255a313Smrg		basic_machine=pdp10-dec
5718255a313Smrg		os=-tops20
5728255a313Smrg		;;
5738255a313Smrg	delta | 3300 | motorola-3300 | motorola-delta \
5748255a313Smrg	      | 3300-motorola | delta-motorola)
5758255a313Smrg		basic_machine=m68k-motorola
5768255a313Smrg		;;
5778255a313Smrg	delta88)
5788255a313Smrg		basic_machine=m88k-motorola
5798255a313Smrg		os=-sysv3
5808255a313Smrg		;;
5818255a313Smrg	dicos)
5828255a313Smrg		basic_machine=i686-pc
5838255a313Smrg		os=-dicos
5848255a313Smrg		;;
5858255a313Smrg	djgpp)
5868255a313Smrg		basic_machine=i586-pc
5878255a313Smrg		os=-msdosdjgpp
5888255a313Smrg		;;
5898255a313Smrg	dpx20 | dpx20-*)
5908255a313Smrg		basic_machine=rs6000-bull
5918255a313Smrg		os=-bosx
5928255a313Smrg		;;
5938255a313Smrg	dpx2* | dpx2*-bull)
5948255a313Smrg		basic_machine=m68k-bull
5958255a313Smrg		os=-sysv3
5968255a313Smrg		;;
5978255a313Smrg	ebmon29k)
5988255a313Smrg		basic_machine=a29k-amd
5998255a313Smrg		os=-ebmon
6008255a313Smrg		;;
6018255a313Smrg	elxsi)
6028255a313Smrg		basic_machine=elxsi-elxsi
6038255a313Smrg		os=-bsd
6048255a313Smrg		;;
6058255a313Smrg	encore | umax | mmax)
6068255a313Smrg		basic_machine=ns32k-encore
6078255a313Smrg		;;
6088255a313Smrg	es1800 | OSE68k | ose68k | ose | OSE)
6098255a313Smrg		basic_machine=m68k-ericsson
6108255a313Smrg		os=-ose
6118255a313Smrg		;;
6128255a313Smrg	fx2800)
6138255a313Smrg		basic_machine=i860-alliant
6148255a313Smrg		;;
6158255a313Smrg	genix)
6168255a313Smrg		basic_machine=ns32k-ns
6178255a313Smrg		;;
6188255a313Smrg	gmicro)
6198255a313Smrg		basic_machine=tron-gmicro
6208255a313Smrg		os=-sysv
6218255a313Smrg		;;
6228255a313Smrg	go32)
6238255a313Smrg		basic_machine=i386-pc
6248255a313Smrg		os=-go32
6258255a313Smrg		;;
6268255a313Smrg	h3050r* | hiux*)
6278255a313Smrg		basic_machine=hppa1.1-hitachi
6288255a313Smrg		os=-hiuxwe2
6298255a313Smrg		;;
6308255a313Smrg	h8300hms)
6318255a313Smrg		basic_machine=h8300-hitachi
6328255a313Smrg		os=-hms
6338255a313Smrg		;;
6348255a313Smrg	h8300xray)
6358255a313Smrg		basic_machine=h8300-hitachi
6368255a313Smrg		os=-xray
6378255a313Smrg		;;
6388255a313Smrg	h8500hms)
6398255a313Smrg		basic_machine=h8500-hitachi
6408255a313Smrg		os=-hms
6418255a313Smrg		;;
6428255a313Smrg	harris)
6438255a313Smrg		basic_machine=m88k-harris
6448255a313Smrg		os=-sysv3
6458255a313Smrg		;;
6468255a313Smrg	hp300-*)
6478255a313Smrg		basic_machine=m68k-hp
6488255a313Smrg		;;
6498255a313Smrg	hp300bsd)
6508255a313Smrg		basic_machine=m68k-hp
6518255a313Smrg		os=-bsd
6528255a313Smrg		;;
6538255a313Smrg	hp300hpux)
6548255a313Smrg		basic_machine=m68k-hp
6558255a313Smrg		os=-hpux
6568255a313Smrg		;;
6578255a313Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
6588255a313Smrg		basic_machine=hppa1.0-hp
6598255a313Smrg		;;
6608255a313Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
6618255a313Smrg		basic_machine=m68000-hp
6628255a313Smrg		;;
6638255a313Smrg	hp9k3[2-9][0-9])
6648255a313Smrg		basic_machine=m68k-hp
6658255a313Smrg		;;
6668255a313Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
6678255a313Smrg		basic_machine=hppa1.0-hp
6688255a313Smrg		;;
6698255a313Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
6708255a313Smrg		basic_machine=hppa1.1-hp
6718255a313Smrg		;;
6728255a313Smrg	hp9k78[0-9] | hp78[0-9])
6738255a313Smrg		# FIXME: really hppa2.0-hp
6748255a313Smrg		basic_machine=hppa1.1-hp
6758255a313Smrg		;;
6768255a313Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
6778255a313Smrg		# FIXME: really hppa2.0-hp
6788255a313Smrg		basic_machine=hppa1.1-hp
6798255a313Smrg		;;
6808255a313Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
6818255a313Smrg		basic_machine=hppa1.1-hp
6828255a313Smrg		;;
6838255a313Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
6848255a313Smrg		basic_machine=hppa1.0-hp
6858255a313Smrg		;;
6868255a313Smrg	hppa-next)
6878255a313Smrg		os=-nextstep3
6888255a313Smrg		;;
6898255a313Smrg	hppaosf)
6908255a313Smrg		basic_machine=hppa1.1-hp
6918255a313Smrg		os=-osf
6928255a313Smrg		;;
6938255a313Smrg	hppro)
6948255a313Smrg		basic_machine=hppa1.1-hp
6958255a313Smrg		os=-proelf
6968255a313Smrg		;;
6978255a313Smrg	i370-ibm* | ibm*)
6988255a313Smrg		basic_machine=i370-ibm
6998255a313Smrg		;;
7008255a313Smrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
7018255a313Smrg	i*86v32)
7028255a313Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7038255a313Smrg		os=-sysv32
7048255a313Smrg		;;
7058255a313Smrg	i*86v4*)
7068255a313Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7078255a313Smrg		os=-sysv4
7088255a313Smrg		;;
7098255a313Smrg	i*86v)
7108255a313Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7118255a313Smrg		os=-sysv
7128255a313Smrg		;;
7138255a313Smrg	i*86sol2)
7148255a313Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7158255a313Smrg		os=-solaris2
7168255a313Smrg		;;
7178255a313Smrg	i386mach)
7188255a313Smrg		basic_machine=i386-mach
7198255a313Smrg		os=-mach
7208255a313Smrg		;;
7218255a313Smrg	i386-vsta | vsta)
7228255a313Smrg		basic_machine=i386-unknown
7238255a313Smrg		os=-vsta
7248255a313Smrg		;;
7258255a313Smrg	iris | iris4d)
7268255a313Smrg		basic_machine=mips-sgi
7278255a313Smrg		case $os in
7288255a313Smrg		    -irix*)
7298255a313Smrg			;;
7308255a313Smrg		    *)
7318255a313Smrg			os=-irix4
7328255a313Smrg			;;
7338255a313Smrg		esac
7348255a313Smrg		;;
7358255a313Smrg	isi68 | isi)
7368255a313Smrg		basic_machine=m68k-isi
7378255a313Smrg		os=-sysv
7388255a313Smrg		;;
7398255a313Smrg	m68knommu)
7408255a313Smrg		basic_machine=m68k-unknown
7418255a313Smrg		os=-linux
7428255a313Smrg		;;
7438255a313Smrg	m68knommu-*)
7448255a313Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
7458255a313Smrg		os=-linux
7468255a313Smrg		;;
7478255a313Smrg	m88k-omron*)
7488255a313Smrg		basic_machine=m88k-omron
7498255a313Smrg		;;
7508255a313Smrg	magnum | m3230)
7518255a313Smrg		basic_machine=mips-mips
7528255a313Smrg		os=-sysv
7538255a313Smrg		;;
7548255a313Smrg	merlin)
7558255a313Smrg		basic_machine=ns32k-utek
7568255a313Smrg		os=-sysv
7578255a313Smrg		;;
758de7ed6e8Smrg        microblaze)
759de7ed6e8Smrg		basic_machine=microblaze-xilinx
760de7ed6e8Smrg		;;
7618255a313Smrg	mingw32)
7628255a313Smrg		basic_machine=i386-pc
7638255a313Smrg		os=-mingw32
7648255a313Smrg		;;
7658255a313Smrg	mingw32ce)
7668255a313Smrg		basic_machine=arm-unknown
7678255a313Smrg		os=-mingw32ce
7688255a313Smrg		;;
7698255a313Smrg	miniframe)
7708255a313Smrg		basic_machine=m68000-convergent
7718255a313Smrg		;;
7728255a313Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
7738255a313Smrg		basic_machine=m68k-atari
7748255a313Smrg		os=-mint
7758255a313Smrg		;;
7768255a313Smrg	mips3*-*)
7778255a313Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
7788255a313Smrg		;;
7798255a313Smrg	mips3*)
7808255a313Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
7818255a313Smrg		;;
7828255a313Smrg	monitor)
7838255a313Smrg		basic_machine=m68k-rom68k
7848255a313Smrg		os=-coff
7858255a313Smrg		;;
7868255a313Smrg	morphos)
7878255a313Smrg		basic_machine=powerpc-unknown
7888255a313Smrg		os=-morphos
7898255a313Smrg		;;
7908255a313Smrg	msdos)
7918255a313Smrg		basic_machine=i386-pc
7928255a313Smrg		os=-msdos
7938255a313Smrg		;;
7948255a313Smrg	ms1-*)
7958255a313Smrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
7968255a313Smrg		;;
7978255a313Smrg	mvs)
7988255a313Smrg		basic_machine=i370-ibm
7998255a313Smrg		os=-mvs
8008255a313Smrg		;;
8018255a313Smrg	ncr3000)
8028255a313Smrg		basic_machine=i486-ncr
8038255a313Smrg		os=-sysv4
8048255a313Smrg		;;
8058255a313Smrg	netbsd386)
8068255a313Smrg		basic_machine=i386-unknown
8078255a313Smrg		os=-netbsd
8088255a313Smrg		;;
8098255a313Smrg	netwinder)
8108255a313Smrg		basic_machine=armv4l-rebel
8118255a313Smrg		os=-linux
8128255a313Smrg		;;
8138255a313Smrg	news | news700 | news800 | news900)
8148255a313Smrg		basic_machine=m68k-sony
8158255a313Smrg		os=-newsos
8168255a313Smrg		;;
8178255a313Smrg	news1000)
8188255a313Smrg		basic_machine=m68030-sony
8198255a313Smrg		os=-newsos
8208255a313Smrg		;;
8218255a313Smrg	news-3600 | risc-news)
8228255a313Smrg		basic_machine=mips-sony
8238255a313Smrg		os=-newsos
8248255a313Smrg		;;
8258255a313Smrg	necv70)
8268255a313Smrg		basic_machine=v70-nec
8278255a313Smrg		os=-sysv
8288255a313Smrg		;;
8298255a313Smrg	next | m*-next )
8308255a313Smrg		basic_machine=m68k-next
8318255a313Smrg		case $os in
8328255a313Smrg		    -nextstep* )
8338255a313Smrg			;;
8348255a313Smrg		    -ns2*)
8358255a313Smrg		      os=-nextstep2
8368255a313Smrg			;;
8378255a313Smrg		    *)
8388255a313Smrg		      os=-nextstep3
8398255a313Smrg			;;
8408255a313Smrg		esac
8418255a313Smrg		;;
8428255a313Smrg	nh3000)
8438255a313Smrg		basic_machine=m68k-harris
8448255a313Smrg		os=-cxux
8458255a313Smrg		;;
8468255a313Smrg	nh[45]000)
8478255a313Smrg		basic_machine=m88k-harris
8488255a313Smrg		os=-cxux
8498255a313Smrg		;;
8508255a313Smrg	nindy960)
8518255a313Smrg		basic_machine=i960-intel
8528255a313Smrg		os=-nindy
8538255a313Smrg		;;
8548255a313Smrg	mon960)
8558255a313Smrg		basic_machine=i960-intel
8568255a313Smrg		os=-mon960
8578255a313Smrg		;;
8588255a313Smrg	nonstopux)
8598255a313Smrg		basic_machine=mips-compaq
8608255a313Smrg		os=-nonstopux
8618255a313Smrg		;;
8628255a313Smrg	np1)
8638255a313Smrg		basic_machine=np1-gould
8648255a313Smrg		;;
865de7ed6e8Smrg        neo-tandem)
866de7ed6e8Smrg		basic_machine=neo-tandem
867de7ed6e8Smrg		;;
868de7ed6e8Smrg        nse-tandem)
869de7ed6e8Smrg		basic_machine=nse-tandem
870de7ed6e8Smrg		;;
8718255a313Smrg	nsr-tandem)
8728255a313Smrg		basic_machine=nsr-tandem
8738255a313Smrg		;;
8748255a313Smrg	op50n-* | op60c-*)
8758255a313Smrg		basic_machine=hppa1.1-oki
8768255a313Smrg		os=-proelf
8778255a313Smrg		;;
8788255a313Smrg	openrisc | openrisc-*)
8798255a313Smrg		basic_machine=or32-unknown
8808255a313Smrg		;;
8818255a313Smrg	os400)
8828255a313Smrg		basic_machine=powerpc-ibm
8838255a313Smrg		os=-os400
8848255a313Smrg		;;
8858255a313Smrg	OSE68000 | ose68000)
8868255a313Smrg		basic_machine=m68000-ericsson
8878255a313Smrg		os=-ose
8888255a313Smrg		;;
8898255a313Smrg	os68k)
8908255a313Smrg		basic_machine=m68k-none
8918255a313Smrg		os=-os68k
8928255a313Smrg		;;
8938255a313Smrg	pa-hitachi)
8948255a313Smrg		basic_machine=hppa1.1-hitachi
8958255a313Smrg		os=-hiuxwe2
8968255a313Smrg		;;
8978255a313Smrg	paragon)
8988255a313Smrg		basic_machine=i860-intel
8998255a313Smrg		os=-osf
9008255a313Smrg		;;
9018255a313Smrg	parisc)
9028255a313Smrg		basic_machine=hppa-unknown
9038255a313Smrg		os=-linux
9048255a313Smrg		;;
9058255a313Smrg	parisc-*)
9068255a313Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
9078255a313Smrg		os=-linux
9088255a313Smrg		;;
9098255a313Smrg	pbd)
9108255a313Smrg		basic_machine=sparc-tti
9118255a313Smrg		;;
9128255a313Smrg	pbb)
9138255a313Smrg		basic_machine=m68k-tti
9148255a313Smrg		;;
9158255a313Smrg	pc532 | pc532-*)
9168255a313Smrg		basic_machine=ns32k-pc532
9178255a313Smrg		;;
9188255a313Smrg	pc98)
9198255a313Smrg		basic_machine=i386-pc
9208255a313Smrg		;;
9218255a313Smrg	pc98-*)
9228255a313Smrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
9238255a313Smrg		;;
9248255a313Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
9258255a313Smrg		basic_machine=i586-pc
9268255a313Smrg		;;
9278255a313Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
9288255a313Smrg		basic_machine=i686-pc
9298255a313Smrg		;;
9308255a313Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
9318255a313Smrg		basic_machine=i686-pc
9328255a313Smrg		;;
9338255a313Smrg	pentium4)
9348255a313Smrg		basic_machine=i786-pc
9358255a313Smrg		;;
9368255a313Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
9378255a313Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
9388255a313Smrg		;;
9398255a313Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
9408255a313Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
9418255a313Smrg		;;
9428255a313Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
9438255a313Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
9448255a313Smrg		;;
9458255a313Smrg	pentium4-*)
9468255a313Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
9478255a313Smrg		;;
9488255a313Smrg	pn)
9498255a313Smrg		basic_machine=pn-gould
9508255a313Smrg		;;
9518255a313Smrg	power)	basic_machine=power-ibm
9528255a313Smrg		;;
9538255a313Smrg	ppc)	basic_machine=powerpc-unknown
9548255a313Smrg		;;
9558255a313Smrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
9568255a313Smrg		;;
9578255a313Smrg	ppcle | powerpclittle | ppc-le | powerpc-little)
9588255a313Smrg		basic_machine=powerpcle-unknown
9598255a313Smrg		;;
9608255a313Smrg	ppcle-* | powerpclittle-*)
9618255a313Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
9628255a313Smrg		;;
9638255a313Smrg	ppc64)	basic_machine=powerpc64-unknown
9648255a313Smrg		;;
9658255a313Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
9668255a313Smrg		;;
9678255a313Smrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
9688255a313Smrg		basic_machine=powerpc64le-unknown
9698255a313Smrg		;;
9708255a313Smrg	ppc64le-* | powerpc64little-*)
9718255a313Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
9728255a313Smrg		;;
9738255a313Smrg	ps2)
9748255a313Smrg		basic_machine=i386-ibm
9758255a313Smrg		;;
9768255a313Smrg	pw32)
9778255a313Smrg		basic_machine=i586-unknown
9788255a313Smrg		os=-pw32
9798255a313Smrg		;;
9808255a313Smrg	rdos)
9818255a313Smrg		basic_machine=i386-pc
9828255a313Smrg		os=-rdos
9838255a313Smrg		;;
9848255a313Smrg	rom68k)
9858255a313Smrg		basic_machine=m68k-rom68k
9868255a313Smrg		os=-coff
9878255a313Smrg		;;
9888255a313Smrg	rm[46]00)
9898255a313Smrg		basic_machine=mips-siemens
9908255a313Smrg		;;
9918255a313Smrg	rtpc | rtpc-*)
9928255a313Smrg		basic_machine=romp-ibm
9938255a313Smrg		;;
9948255a313Smrg	s390 | s390-*)
9958255a313Smrg		basic_machine=s390-ibm
9968255a313Smrg		;;
9978255a313Smrg	s390x | s390x-*)
9988255a313Smrg		basic_machine=s390x-ibm
9998255a313Smrg		;;
10008255a313Smrg	sa29200)
10018255a313Smrg		basic_machine=a29k-amd
10028255a313Smrg		os=-udi
10038255a313Smrg		;;
10048255a313Smrg	sb1)
10058255a313Smrg		basic_machine=mipsisa64sb1-unknown
10068255a313Smrg		;;
10078255a313Smrg	sb1el)
10088255a313Smrg		basic_machine=mipsisa64sb1el-unknown
10098255a313Smrg		;;
10108255a313Smrg	sde)
10118255a313Smrg		basic_machine=mipsisa32-sde
10128255a313Smrg		os=-elf
10138255a313Smrg		;;
10148255a313Smrg	sei)
10158255a313Smrg		basic_machine=mips-sei
10168255a313Smrg		os=-seiux
10178255a313Smrg		;;
10188255a313Smrg	sequent)
10198255a313Smrg		basic_machine=i386-sequent
10208255a313Smrg		;;
10218255a313Smrg	sh)
10228255a313Smrg		basic_machine=sh-hitachi
10238255a313Smrg		os=-hms
10248255a313Smrg		;;
10258255a313Smrg	sh5el)
10268255a313Smrg		basic_machine=sh5le-unknown
10278255a313Smrg		;;
10288255a313Smrg	sh64)
10298255a313Smrg		basic_machine=sh64-unknown
10308255a313Smrg		;;
10318255a313Smrg	sparclite-wrs | simso-wrs)
10328255a313Smrg		basic_machine=sparclite-wrs
10338255a313Smrg		os=-vxworks
10348255a313Smrg		;;
10358255a313Smrg	sps7)
10368255a313Smrg		basic_machine=m68k-bull
10378255a313Smrg		os=-sysv2
10388255a313Smrg		;;
10398255a313Smrg	spur)
10408255a313Smrg		basic_machine=spur-unknown
10418255a313Smrg		;;
10428255a313Smrg	st2000)
10438255a313Smrg		basic_machine=m68k-tandem
10448255a313Smrg		;;
10458255a313Smrg	stratus)
10468255a313Smrg		basic_machine=i860-stratus
10478255a313Smrg		os=-sysv4
10488255a313Smrg		;;
10498255a313Smrg	sun2)
10508255a313Smrg		basic_machine=m68000-sun
10518255a313Smrg		;;
10528255a313Smrg	sun2os3)
10538255a313Smrg		basic_machine=m68000-sun
10548255a313Smrg		os=-sunos3
10558255a313Smrg		;;
10568255a313Smrg	sun2os4)
10578255a313Smrg		basic_machine=m68000-sun
10588255a313Smrg		os=-sunos4
10598255a313Smrg		;;
10608255a313Smrg	sun3os3)
10618255a313Smrg		basic_machine=m68k-sun
10628255a313Smrg		os=-sunos3
10638255a313Smrg		;;
10648255a313Smrg	sun3os4)
10658255a313Smrg		basic_machine=m68k-sun
10668255a313Smrg		os=-sunos4
10678255a313Smrg		;;
10688255a313Smrg	sun4os3)
10698255a313Smrg		basic_machine=sparc-sun
10708255a313Smrg		os=-sunos3
10718255a313Smrg		;;
10728255a313Smrg	sun4os4)
10738255a313Smrg		basic_machine=sparc-sun
10748255a313Smrg		os=-sunos4
10758255a313Smrg		;;
10768255a313Smrg	sun4sol2)
10778255a313Smrg		basic_machine=sparc-sun
10788255a313Smrg		os=-solaris2
10798255a313Smrg		;;
10808255a313Smrg	sun3 | sun3-*)
10818255a313Smrg		basic_machine=m68k-sun
10828255a313Smrg		;;
10838255a313Smrg	sun4)
10848255a313Smrg		basic_machine=sparc-sun
10858255a313Smrg		;;
10868255a313Smrg	sun386 | sun386i | roadrunner)
10878255a313Smrg		basic_machine=i386-sun
10888255a313Smrg		;;
10898255a313Smrg	sv1)
10908255a313Smrg		basic_machine=sv1-cray
10918255a313Smrg		os=-unicos
10928255a313Smrg		;;
10938255a313Smrg	symmetry)
10948255a313Smrg		basic_machine=i386-sequent
10958255a313Smrg		os=-dynix
10968255a313Smrg		;;
10978255a313Smrg	t3e)
10988255a313Smrg		basic_machine=alphaev5-cray
10998255a313Smrg		os=-unicos
11008255a313Smrg		;;
11018255a313Smrg	t90)
11028255a313Smrg		basic_machine=t90-cray
11038255a313Smrg		os=-unicos
11048255a313Smrg		;;
1105de7ed6e8Smrg        # This must be matched before tile*.
1106de7ed6e8Smrg        tilegx*)
1107de7ed6e8Smrg		basic_machine=tilegx-unknown
1108de7ed6e8Smrg		os=-linux-gnu
11098255a313Smrg		;;
11108255a313Smrg	tile*)
11118255a313Smrg		basic_machine=tile-unknown
11128255a313Smrg		os=-linux-gnu
11138255a313Smrg		;;
11148255a313Smrg	tx39)
11158255a313Smrg		basic_machine=mipstx39-unknown
11168255a313Smrg		;;
11178255a313Smrg	tx39el)
11188255a313Smrg		basic_machine=mipstx39el-unknown
11198255a313Smrg		;;
11208255a313Smrg	toad1)
11218255a313Smrg		basic_machine=pdp10-xkl
11228255a313Smrg		os=-tops20
11238255a313Smrg		;;
11248255a313Smrg	tower | tower-32)
11258255a313Smrg		basic_machine=m68k-ncr
11268255a313Smrg		;;
11278255a313Smrg	tpf)
11288255a313Smrg		basic_machine=s390x-ibm
11298255a313Smrg		os=-tpf
11308255a313Smrg		;;
11318255a313Smrg	udi29k)
11328255a313Smrg		basic_machine=a29k-amd
11338255a313Smrg		os=-udi
11348255a313Smrg		;;
11358255a313Smrg	ultra3)
11368255a313Smrg		basic_machine=a29k-nyu
11378255a313Smrg		os=-sym1
11388255a313Smrg		;;
11398255a313Smrg	v810 | necv810)
11408255a313Smrg		basic_machine=v810-nec
11418255a313Smrg		os=-none
11428255a313Smrg		;;
11438255a313Smrg	vaxv)
11448255a313Smrg		basic_machine=vax-dec
11458255a313Smrg		os=-sysv
11468255a313Smrg		;;
11478255a313Smrg	vms)
11488255a313Smrg		basic_machine=vax-dec
11498255a313Smrg		os=-vms
11508255a313Smrg		;;
11518255a313Smrg	vpp*|vx|vx-*)
11528255a313Smrg		basic_machine=f301-fujitsu
11538255a313Smrg		;;
11548255a313Smrg	vxworks960)
11558255a313Smrg		basic_machine=i960-wrs
11568255a313Smrg		os=-vxworks
11578255a313Smrg		;;
11588255a313Smrg	vxworks68)
11598255a313Smrg		basic_machine=m68k-wrs
11608255a313Smrg		os=-vxworks
11618255a313Smrg		;;
11628255a313Smrg	vxworks29k)
11638255a313Smrg		basic_machine=a29k-wrs
11648255a313Smrg		os=-vxworks
11658255a313Smrg		;;
11668255a313Smrg	w65*)
11678255a313Smrg		basic_machine=w65-wdc
11688255a313Smrg		os=-none
11698255a313Smrg		;;
11708255a313Smrg	w89k-*)
11718255a313Smrg		basic_machine=hppa1.1-winbond
11728255a313Smrg		os=-proelf
11738255a313Smrg		;;
11748255a313Smrg	xbox)
11758255a313Smrg		basic_machine=i686-pc
11768255a313Smrg		os=-mingw32
11778255a313Smrg		;;
11788255a313Smrg	xps | xps100)
11798255a313Smrg		basic_machine=xps100-honeywell
11808255a313Smrg		;;
11818255a313Smrg	ymp)
11828255a313Smrg		basic_machine=ymp-cray
11838255a313Smrg		os=-unicos
11848255a313Smrg		;;
11858255a313Smrg	z8k-*-coff)
11868255a313Smrg		basic_machine=z8k-unknown
11878255a313Smrg		os=-sim
11888255a313Smrg		;;
11898255a313Smrg	z80-*-coff)
11908255a313Smrg		basic_machine=z80-unknown
11918255a313Smrg		os=-sim
11928255a313Smrg		;;
11938255a313Smrg	none)
11948255a313Smrg		basic_machine=none-none
11958255a313Smrg		os=-none
11968255a313Smrg		;;
11978255a313Smrg
11988255a313Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
11998255a313Smrg# some cases the only manufacturer, in others, it is the most popular.
12008255a313Smrg	w89k)
12018255a313Smrg		basic_machine=hppa1.1-winbond
12028255a313Smrg		;;
12038255a313Smrg	op50n)
12048255a313Smrg		basic_machine=hppa1.1-oki
12058255a313Smrg		;;
12068255a313Smrg	op60c)
12078255a313Smrg		basic_machine=hppa1.1-oki
12088255a313Smrg		;;
12098255a313Smrg	romp)
12108255a313Smrg		basic_machine=romp-ibm
12118255a313Smrg		;;
12128255a313Smrg	mmix)
12138255a313Smrg		basic_machine=mmix-knuth
12148255a313Smrg		;;
12158255a313Smrg	rs6000)
12168255a313Smrg		basic_machine=rs6000-ibm
12178255a313Smrg		;;
12188255a313Smrg	vax)
12198255a313Smrg		basic_machine=vax-dec
12208255a313Smrg		;;
12218255a313Smrg	pdp10)
12228255a313Smrg		# there are many clones, so DEC is not a safe bet
12238255a313Smrg		basic_machine=pdp10-unknown
12248255a313Smrg		;;
12258255a313Smrg	pdp11)
12268255a313Smrg		basic_machine=pdp11-dec
12278255a313Smrg		;;
12288255a313Smrg	we32k)
12298255a313Smrg		basic_machine=we32k-att
12308255a313Smrg		;;
12318255a313Smrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
12328255a313Smrg		basic_machine=sh-unknown
12338255a313Smrg		;;
12348255a313Smrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
12358255a313Smrg		basic_machine=sparc-sun
12368255a313Smrg		;;
12378255a313Smrg	cydra)
12388255a313Smrg		basic_machine=cydra-cydrome
12398255a313Smrg		;;
12408255a313Smrg	orion)
12418255a313Smrg		basic_machine=orion-highlevel
12428255a313Smrg		;;
12438255a313Smrg	orion105)
12448255a313Smrg		basic_machine=clipper-highlevel
12458255a313Smrg		;;
12468255a313Smrg	mac | mpw | mac-mpw)
12478255a313Smrg		basic_machine=m68k-apple
12488255a313Smrg		;;
12498255a313Smrg	pmac | pmac-mpw)
12508255a313Smrg		basic_machine=powerpc-apple
12518255a313Smrg		;;
12528255a313Smrg	*-unknown)
12538255a313Smrg		# Make sure to match an already-canonicalized machine name.
12548255a313Smrg		;;
12558255a313Smrg	*)
12568255a313Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
12578255a313Smrg		exit 1
12588255a313Smrg		;;
12598255a313Smrgesac
12608255a313Smrg
12618255a313Smrg# Here we canonicalize certain aliases for manufacturers.
12628255a313Smrgcase $basic_machine in
12638255a313Smrg	*-digital*)
12648255a313Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
12658255a313Smrg		;;
12668255a313Smrg	*-commodore*)
12678255a313Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
12688255a313Smrg		;;
12698255a313Smrg	*)
12708255a313Smrg		;;
12718255a313Smrgesac
12728255a313Smrg
12738255a313Smrg# Decode manufacturer-specific aliases for certain operating systems.
12748255a313Smrg
12758255a313Smrgif [ x"$os" != x"" ]
12768255a313Smrgthen
12778255a313Smrgcase $os in
12788255a313Smrg        # First match some system type aliases
12798255a313Smrg        # that might get confused with valid system types.
12808255a313Smrg	# -solaris* is a basic system type, with this one exception.
1281de7ed6e8Smrg        -auroraux)
1282de7ed6e8Smrg	        os=-auroraux
1283de7ed6e8Smrg		;;
12848255a313Smrg	-solaris1 | -solaris1.*)
12858255a313Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
12868255a313Smrg		;;
12878255a313Smrg	-solaris)
12888255a313Smrg		os=-solaris2
12898255a313Smrg		;;
12908255a313Smrg	-svr4*)
12918255a313Smrg		os=-sysv4
12928255a313Smrg		;;
12938255a313Smrg	-unixware*)
12948255a313Smrg		os=-sysv4.2uw
12958255a313Smrg		;;
12968255a313Smrg	-gnu/linux*)
12978255a313Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
12988255a313Smrg		;;
12998255a313Smrg	# First accept the basic system types.
13008255a313Smrg	# The portable systems comes first.
13018255a313Smrg	# Each alternative MUST END IN A *, to match a version number.
13028255a313Smrg	# -sysv* is not here because it comes later, after sysvr4.
13038255a313Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1304de7ed6e8Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1305de7ed6e8Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1306de7ed6e8Smrg	      | -sym* | -kopensolaris* \
13078255a313Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
13088255a313Smrg	      | -aos* | -aros* \
13098255a313Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
13108255a313Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
13118255a313Smrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
13128255a313Smrg	      | -openbsd* | -solidbsd* \
13138255a313Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13148255a313Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13158255a313Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
13168255a313Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
13178255a313Smrg	      | -chorusos* | -chorusrdb* | -cegcc* \
13188255a313Smrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1319de7ed6e8Smrg	      | -mingw32* | -linux-gnu* | -linux-android* \
1320de7ed6e8Smrg	      | -linux-newlib* | -linux-uclibc* \
13218255a313Smrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
13228255a313Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
13238255a313Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13248255a313Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13258255a313Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13268255a313Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
13278255a313Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1328de7ed6e8Smrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
13298255a313Smrg	# Remember, each alternative MUST END IN *, to match a version number.
13308255a313Smrg		;;
13318255a313Smrg	-qnx*)
13328255a313Smrg		case $basic_machine in
13338255a313Smrg		    x86-* | i*86-*)
13348255a313Smrg			;;
13358255a313Smrg		    *)
13368255a313Smrg			os=-nto$os
13378255a313Smrg			;;
13388255a313Smrg		esac
13398255a313Smrg		;;
13408255a313Smrg	-nto-qnx*)
13418255a313Smrg		;;
13428255a313Smrg	-nto*)
13438255a313Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
13448255a313Smrg		;;
13458255a313Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
13468255a313Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
13478255a313Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
13488255a313Smrg		;;
13498255a313Smrg	-mac*)
13508255a313Smrg		os=`echo $os | sed -e 's|mac|macos|'`
13518255a313Smrg		;;
13528255a313Smrg	-linux-dietlibc)
13538255a313Smrg		os=-linux-dietlibc
13548255a313Smrg		;;
13558255a313Smrg	-linux*)
13568255a313Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
13578255a313Smrg		;;
13588255a313Smrg	-sunos5*)
13598255a313Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
13608255a313Smrg		;;
13618255a313Smrg	-sunos6*)
13628255a313Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
13638255a313Smrg		;;
13648255a313Smrg	-opened*)
13658255a313Smrg		os=-openedition
13668255a313Smrg		;;
13678255a313Smrg        -os400*)
13688255a313Smrg		os=-os400
13698255a313Smrg		;;
13708255a313Smrg	-wince*)
13718255a313Smrg		os=-wince
13728255a313Smrg		;;
13738255a313Smrg	-osfrose*)
13748255a313Smrg		os=-osfrose
13758255a313Smrg		;;
13768255a313Smrg	-osf*)
13778255a313Smrg		os=-osf
13788255a313Smrg		;;
13798255a313Smrg	-utek*)
13808255a313Smrg		os=-bsd
13818255a313Smrg		;;
13828255a313Smrg	-dynix*)
13838255a313Smrg		os=-bsd
13848255a313Smrg		;;
13858255a313Smrg	-acis*)
13868255a313Smrg		os=-aos
13878255a313Smrg		;;
13888255a313Smrg	-atheos*)
13898255a313Smrg		os=-atheos
13908255a313Smrg		;;
13918255a313Smrg	-syllable*)
13928255a313Smrg		os=-syllable
13938255a313Smrg		;;
13948255a313Smrg	-386bsd)
13958255a313Smrg		os=-bsd
13968255a313Smrg		;;
13978255a313Smrg	-ctix* | -uts*)
13988255a313Smrg		os=-sysv
13998255a313Smrg		;;
14008255a313Smrg	-nova*)
14018255a313Smrg		os=-rtmk-nova
14028255a313Smrg		;;
14038255a313Smrg	-ns2 )
14048255a313Smrg		os=-nextstep2
14058255a313Smrg		;;
14068255a313Smrg	-nsk*)
14078255a313Smrg		os=-nsk
14088255a313Smrg		;;
14098255a313Smrg	# Preserve the version number of sinix5.
14108255a313Smrg	-sinix5.*)
14118255a313Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
14128255a313Smrg		;;
14138255a313Smrg	-sinix*)
14148255a313Smrg		os=-sysv4
14158255a313Smrg		;;
14168255a313Smrg        -tpf*)
14178255a313Smrg		os=-tpf
14188255a313Smrg		;;
14198255a313Smrg	-triton*)
14208255a313Smrg		os=-sysv3
14218255a313Smrg		;;
14228255a313Smrg	-oss*)
14238255a313Smrg		os=-sysv3
14248255a313Smrg		;;
14258255a313Smrg	-svr4)
14268255a313Smrg		os=-sysv4
14278255a313Smrg		;;
14288255a313Smrg	-svr3)
14298255a313Smrg		os=-sysv3
14308255a313Smrg		;;
14318255a313Smrg	-sysvr4)
14328255a313Smrg		os=-sysv4
14338255a313Smrg		;;
14348255a313Smrg	# This must come after -sysvr4.
14358255a313Smrg	-sysv*)
14368255a313Smrg		;;
14378255a313Smrg	-ose*)
14388255a313Smrg		os=-ose
14398255a313Smrg		;;
14408255a313Smrg	-es1800*)
14418255a313Smrg		os=-ose
14428255a313Smrg		;;
14438255a313Smrg	-xenix)
14448255a313Smrg		os=-xenix
14458255a313Smrg		;;
14468255a313Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
14478255a313Smrg		os=-mint
14488255a313Smrg		;;
14498255a313Smrg	-aros*)
14508255a313Smrg		os=-aros
14518255a313Smrg		;;
14528255a313Smrg	-kaos*)
14538255a313Smrg		os=-kaos
14548255a313Smrg		;;
14558255a313Smrg	-zvmoe)
14568255a313Smrg		os=-zvmoe
14578255a313Smrg		;;
14588255a313Smrg	-dicos*)
14598255a313Smrg		os=-dicos
14608255a313Smrg		;;
1461de7ed6e8Smrg        -nacl*)
1462de7ed6e8Smrg	        ;;
14638255a313Smrg	-none)
14648255a313Smrg		;;
14658255a313Smrg	*)
14668255a313Smrg		# Get rid of the `-' at the beginning of $os.
14678255a313Smrg		os=`echo $os | sed 's/[^-]*-//'`
14688255a313Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
14698255a313Smrg		exit 1
14708255a313Smrg		;;
14718255a313Smrgesac
14728255a313Smrgelse
14738255a313Smrg
14748255a313Smrg# Here we handle the default operating systems that come with various machines.
14758255a313Smrg# The value should be what the vendor currently ships out the door with their
14768255a313Smrg# machine or put another way, the most popular os provided with the machine.
14778255a313Smrg
14788255a313Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
14798255a313Smrg# "-sun"), then you have to tell the case statement up towards the top
14808255a313Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
14818255a313Smrg# will signal an error saying that MANUFACTURER isn't an operating
14828255a313Smrg# system, and we'll never get to this point.
14838255a313Smrg
14848255a313Smrgcase $basic_machine in
14858255a313Smrg        score-*)
14868255a313Smrg		os=-elf
14878255a313Smrg		;;
14888255a313Smrg        spu-*)
14898255a313Smrg		os=-elf
14908255a313Smrg		;;
14918255a313Smrg	*-acorn)
14928255a313Smrg		os=-riscix1.2
14938255a313Smrg		;;
14948255a313Smrg	arm*-rebel)
14958255a313Smrg		os=-linux
14968255a313Smrg		;;
14978255a313Smrg	arm*-semi)
14988255a313Smrg		os=-aout
14998255a313Smrg		;;
15008255a313Smrg        c4x-* | tic4x-*)
15018255a313Smrg        	os=-coff
15028255a313Smrg		;;
1503de7ed6e8Smrg	tic54x-*)
1504de7ed6e8Smrg		os=-coff
1505de7ed6e8Smrg		;;
1506de7ed6e8Smrg	tic55x-*)
1507de7ed6e8Smrg		os=-coff
1508de7ed6e8Smrg		;;
1509de7ed6e8Smrg	tic6x-*)
1510de7ed6e8Smrg		os=-coff
1511de7ed6e8Smrg		;;
15128255a313Smrg	# This must come before the *-dec entry.
15138255a313Smrg	pdp10-*)
15148255a313Smrg		os=-tops20
15158255a313Smrg		;;
15168255a313Smrg	pdp11-*)
15178255a313Smrg		os=-none
15188255a313Smrg		;;
15198255a313Smrg	*-dec | vax-*)
15208255a313Smrg		os=-ultrix4.2
15218255a313Smrg		;;
15228255a313Smrg	m68*-apollo)
15238255a313Smrg		os=-domain
15248255a313Smrg		;;
15258255a313Smrg	i386-sun)
15268255a313Smrg		os=-sunos4.0.2
15278255a313Smrg		;;
15288255a313Smrg	m68000-sun)
15298255a313Smrg		os=-sunos3
15308255a313Smrg		# This also exists in the configure program, but was not the
15318255a313Smrg		# default.
15328255a313Smrg		# os=-sunos4
15338255a313Smrg		;;
15348255a313Smrg	m68*-cisco)
15358255a313Smrg		os=-aout
15368255a313Smrg		;;
15378255a313Smrg        mep-*)
15388255a313Smrg		os=-elf
15398255a313Smrg		;;
15408255a313Smrg	mips*-cisco)
15418255a313Smrg		os=-elf
15428255a313Smrg		;;
15438255a313Smrg	mips*-*)
15448255a313Smrg		os=-elf
15458255a313Smrg		;;
15468255a313Smrg	or32-*)
15478255a313Smrg		os=-coff
15488255a313Smrg		;;
15498255a313Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
15508255a313Smrg		os=-sysv3
15518255a313Smrg		;;
15528255a313Smrg	sparc-* | *-sun)
15538255a313Smrg		os=-sunos4.1.1
15548255a313Smrg		;;
15558255a313Smrg	*-be)
15568255a313Smrg		os=-beos
15578255a313Smrg		;;
15588255a313Smrg	*-haiku)
15598255a313Smrg		os=-haiku
15608255a313Smrg		;;
15618255a313Smrg	*-ibm)
15628255a313Smrg		os=-aix
15638255a313Smrg		;;
15648255a313Smrg    	*-knuth)
15658255a313Smrg		os=-mmixware
15668255a313Smrg		;;
15678255a313Smrg	*-wec)
15688255a313Smrg		os=-proelf
15698255a313Smrg		;;
15708255a313Smrg	*-winbond)
15718255a313Smrg		os=-proelf
15728255a313Smrg		;;
15738255a313Smrg	*-oki)
15748255a313Smrg		os=-proelf
15758255a313Smrg		;;
15768255a313Smrg	*-hp)
15778255a313Smrg		os=-hpux
15788255a313Smrg		;;
15798255a313Smrg	*-hitachi)
15808255a313Smrg		os=-hiux
15818255a313Smrg		;;
15828255a313Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
15838255a313Smrg		os=-sysv
15848255a313Smrg		;;
15858255a313Smrg	*-cbm)
15868255a313Smrg		os=-amigaos
15878255a313Smrg		;;
15888255a313Smrg	*-dg)
15898255a313Smrg		os=-dgux
15908255a313Smrg		;;
15918255a313Smrg	*-dolphin)
15928255a313Smrg		os=-sysv3
15938255a313Smrg		;;
15948255a313Smrg	m68k-ccur)
15958255a313Smrg		os=-rtu
15968255a313Smrg		;;
15978255a313Smrg	m88k-omron*)
15988255a313Smrg		os=-luna
15998255a313Smrg		;;
16008255a313Smrg	*-next )
16018255a313Smrg		os=-nextstep
16028255a313Smrg		;;
16038255a313Smrg	*-sequent)
16048255a313Smrg		os=-ptx
16058255a313Smrg		;;
16068255a313Smrg	*-crds)
16078255a313Smrg		os=-unos
16088255a313Smrg		;;
16098255a313Smrg	*-ns)
16108255a313Smrg		os=-genix
16118255a313Smrg		;;
16128255a313Smrg	i370-*)
16138255a313Smrg		os=-mvs
16148255a313Smrg		;;
16158255a313Smrg	*-next)
16168255a313Smrg		os=-nextstep3
16178255a313Smrg		;;
16188255a313Smrg	*-gould)
16198255a313Smrg		os=-sysv
16208255a313Smrg		;;
16218255a313Smrg	*-highlevel)
16228255a313Smrg		os=-bsd
16238255a313Smrg		;;
16248255a313Smrg	*-encore)
16258255a313Smrg		os=-bsd
16268255a313Smrg		;;
16278255a313Smrg	*-sgi)
16288255a313Smrg		os=-irix
16298255a313Smrg		;;
16308255a313Smrg	*-siemens)
16318255a313Smrg		os=-sysv4
16328255a313Smrg		;;
16338255a313Smrg	*-masscomp)
16348255a313Smrg		os=-rtu
16358255a313Smrg		;;
16368255a313Smrg	f30[01]-fujitsu | f700-fujitsu)
16378255a313Smrg		os=-uxpv
16388255a313Smrg		;;
16398255a313Smrg	*-rom68k)
16408255a313Smrg		os=-coff
16418255a313Smrg		;;
16428255a313Smrg	*-*bug)
16438255a313Smrg		os=-coff
16448255a313Smrg		;;
16458255a313Smrg	*-apple)
16468255a313Smrg		os=-macos
16478255a313Smrg		;;
16488255a313Smrg	*-atari*)
16498255a313Smrg		os=-mint
16508255a313Smrg		;;
16518255a313Smrg	*)
16528255a313Smrg		os=-none
16538255a313Smrg		;;
16548255a313Smrgesac
16558255a313Smrgfi
16568255a313Smrg
16578255a313Smrg# Here we handle the case where we know the os, and the CPU type, but not the
16588255a313Smrg# manufacturer.  We pick the logical manufacturer.
16598255a313Smrgvendor=unknown
16608255a313Smrgcase $basic_machine in
16618255a313Smrg	*-unknown)
16628255a313Smrg		case $os in
16638255a313Smrg			-riscix*)
16648255a313Smrg				vendor=acorn
16658255a313Smrg				;;
16668255a313Smrg			-sunos*)
16678255a313Smrg				vendor=sun
16688255a313Smrg				;;
1669de7ed6e8Smrg			-cnk*|-aix*)
16708255a313Smrg				vendor=ibm
16718255a313Smrg				;;
16728255a313Smrg			-beos*)
16738255a313Smrg				vendor=be
16748255a313Smrg				;;
16758255a313Smrg			-hpux*)
16768255a313Smrg				vendor=hp
16778255a313Smrg				;;
16788255a313Smrg			-mpeix*)
16798255a313Smrg				vendor=hp
16808255a313Smrg				;;
16818255a313Smrg			-hiux*)
16828255a313Smrg				vendor=hitachi
16838255a313Smrg				;;
16848255a313Smrg			-unos*)
16858255a313Smrg				vendor=crds
16868255a313Smrg				;;
16878255a313Smrg			-dgux*)
16888255a313Smrg				vendor=dg
16898255a313Smrg				;;
16908255a313Smrg			-luna*)
16918255a313Smrg				vendor=omron
16928255a313Smrg				;;
16938255a313Smrg			-genix*)
16948255a313Smrg				vendor=ns
16958255a313Smrg				;;
16968255a313Smrg			-mvs* | -opened*)
16978255a313Smrg				vendor=ibm
16988255a313Smrg				;;
16998255a313Smrg			-os400*)
17008255a313Smrg				vendor=ibm
17018255a313Smrg				;;
17028255a313Smrg			-ptx*)
17038255a313Smrg				vendor=sequent
17048255a313Smrg				;;
17058255a313Smrg			-tpf*)
17068255a313Smrg				vendor=ibm
17078255a313Smrg				;;
17088255a313Smrg			-vxsim* | -vxworks* | -windiss*)
17098255a313Smrg				vendor=wrs
17108255a313Smrg				;;
17118255a313Smrg			-aux*)
17128255a313Smrg				vendor=apple
17138255a313Smrg				;;
17148255a313Smrg			-hms*)
17158255a313Smrg				vendor=hitachi
17168255a313Smrg				;;
17178255a313Smrg			-mpw* | -macos*)
17188255a313Smrg				vendor=apple
17198255a313Smrg				;;
17208255a313Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
17218255a313Smrg				vendor=atari
17228255a313Smrg				;;
17238255a313Smrg			-vos*)
17248255a313Smrg				vendor=stratus
17258255a313Smrg				;;
17268255a313Smrg		esac
17278255a313Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
17288255a313Smrg		;;
17298255a313Smrgesac
17308255a313Smrg
17318255a313Smrgecho $basic_machine$os
17328255a313Smrgexit
17338255a313Smrg
17348255a313Smrg# Local variables:
17358255a313Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
17368255a313Smrg# time-stamp-start: "timestamp='"
17378255a313Smrg# time-stamp-format: "%:y-%02m-%02d"
17388255a313Smrg# time-stamp-end: "'"
17398255a313Smrg# End:
1740