config.sub revision b7fb5eac
11a30de1fSmrg#! /bin/sh
21a30de1fSmrg# Configuration validation subroutine script.
31a30de1fSmrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4b7fb5eacSmrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5b7fb5eacSmrg#   Free Software Foundation, Inc.
61a30de1fSmrg
7b7fb5eacSmrgtimestamp='2009-04-17'
81a30de1fSmrg
91a30de1fSmrg# This file is (in principle) common to ALL GNU software.
101a30de1fSmrg# The presence of a machine in this file suggests that SOME GNU software
111a30de1fSmrg# can handle that machine.  It does not imply ALL GNU software can.
121a30de1fSmrg#
131a30de1fSmrg# This file is free software; you can redistribute it and/or modify
141a30de1fSmrg# it under the terms of the GNU General Public License as published by
151a30de1fSmrg# the Free Software Foundation; either version 2 of the License, or
161a30de1fSmrg# (at your option) any later version.
171a30de1fSmrg#
181a30de1fSmrg# This program is distributed in the hope that it will be useful,
191a30de1fSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
201a30de1fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
211a30de1fSmrg# GNU General Public License for more details.
221a30de1fSmrg#
231a30de1fSmrg# You should have received a copy of the GNU General Public License
241a30de1fSmrg# along with this program; if not, write to the Free Software
251a30de1fSmrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
261a30de1fSmrg# 02110-1301, USA.
271a30de1fSmrg#
281a30de1fSmrg# As a special exception to the GNU General Public License, if you
291a30de1fSmrg# distribute this file as part of a program that contains a
301a30de1fSmrg# configuration script generated by Autoconf, you may include it under
311a30de1fSmrg# the same distribution terms that you use for the rest of that program.
321a30de1fSmrg
331a30de1fSmrg
341a30de1fSmrg# Please send patches to <config-patches@gnu.org>.  Submit a context
351a30de1fSmrg# diff and a properly formatted ChangeLog entry.
361a30de1fSmrg#
371a30de1fSmrg# Configuration subroutine to validate and canonicalize a configuration type.
381a30de1fSmrg# Supply the specified configuration type as an argument.
391a30de1fSmrg# If it is invalid, we print an error message on stderr and exit with code 1.
401a30de1fSmrg# Otherwise, we print the canonical config type on stdout and succeed.
411a30de1fSmrg
421a30de1fSmrg# This file is supposed to be the same for all GNU packages
431a30de1fSmrg# and recognize all the CPU types, system types and aliases
441a30de1fSmrg# that are meaningful with *any* GNU software.
451a30de1fSmrg# Each package is responsible for reporting which valid configurations
461a30de1fSmrg# it does not support.  The user should be able to distinguish
471a30de1fSmrg# a failure to support a valid configuration from a meaningless
481a30de1fSmrg# configuration.
491a30de1fSmrg
501a30de1fSmrg# The goal of this file is to map all the various variations of a given
511a30de1fSmrg# machine specification into a single specification in the form:
521a30de1fSmrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
531a30de1fSmrg# or in some cases, the newer four-part form:
541a30de1fSmrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
551a30de1fSmrg# It is wrong to echo any other type of specification.
561a30de1fSmrg
571a30de1fSmrgme=`echo "$0" | sed -e 's,.*/,,'`
581a30de1fSmrg
591a30de1fSmrgusage="\
601a30de1fSmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
611a30de1fSmrg       $0 [OPTION] ALIAS
621a30de1fSmrg
631a30de1fSmrgCanonicalize a configuration name.
641a30de1fSmrg
651a30de1fSmrgOperation modes:
661a30de1fSmrg  -h, --help         print this help, then exit
671a30de1fSmrg  -t, --time-stamp   print date of last modification, then exit
681a30de1fSmrg  -v, --version      print version number, then exit
691a30de1fSmrg
701a30de1fSmrgReport bugs and patches to <config-patches@gnu.org>."
711a30de1fSmrg
721a30de1fSmrgversion="\
731a30de1fSmrgGNU config.sub ($timestamp)
741a30de1fSmrg
75b7fb5eacSmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
76b7fb5eacSmrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
771a30de1fSmrg
781a30de1fSmrgThis is free software; see the source for copying conditions.  There is NO
791a30de1fSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
801a30de1fSmrg
811a30de1fSmrghelp="
821a30de1fSmrgTry \`$me --help' for more information."
831a30de1fSmrg
841a30de1fSmrg# Parse command line
851a30de1fSmrgwhile test $# -gt 0 ; do
861a30de1fSmrg  case $1 in
871a30de1fSmrg    --time-stamp | --time* | -t )
881a30de1fSmrg       echo "$timestamp" ; exit ;;
891a30de1fSmrg    --version | -v )
901a30de1fSmrg       echo "$version" ; exit ;;
911a30de1fSmrg    --help | --h* | -h )
921a30de1fSmrg       echo "$usage"; exit ;;
931a30de1fSmrg    -- )     # Stop option processing
941a30de1fSmrg       shift; break ;;
951a30de1fSmrg    - )	# Use stdin as input.
961a30de1fSmrg       break ;;
971a30de1fSmrg    -* )
981a30de1fSmrg       echo "$me: invalid option $1$help"
991a30de1fSmrg       exit 1 ;;
1001a30de1fSmrg
1011a30de1fSmrg    *local*)
1021a30de1fSmrg       # First pass through any local machine types.
1031a30de1fSmrg       echo $1
1041a30de1fSmrg       exit ;;
1051a30de1fSmrg
1061a30de1fSmrg    * )
1071a30de1fSmrg       break ;;
1081a30de1fSmrg  esac
1091a30de1fSmrgdone
1101a30de1fSmrg
1111a30de1fSmrgcase $# in
1121a30de1fSmrg 0) echo "$me: missing argument$help" >&2
1131a30de1fSmrg    exit 1;;
1141a30de1fSmrg 1) ;;
1151a30de1fSmrg *) echo "$me: too many arguments$help" >&2
1161a30de1fSmrg    exit 1;;
1171a30de1fSmrgesac
1181a30de1fSmrg
1191a30de1fSmrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1201a30de1fSmrg# Here we must recognize all the valid KERNEL-OS combinations.
1211a30de1fSmrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1221a30de1fSmrgcase $maybe_os in
1231a30de1fSmrg  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
1241a30de1fSmrg  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125b7fb5eacSmrg  kopensolaris*-gnu* | \
1261a30de1fSmrg  storm-chaos* | os2-emx* | rtmk-nova*)
1271a30de1fSmrg    os=-$maybe_os
1281a30de1fSmrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1291a30de1fSmrg    ;;
1301a30de1fSmrg  *)
1311a30de1fSmrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1321a30de1fSmrg    if [ $basic_machine != $1 ]
1331a30de1fSmrg    then os=`echo $1 | sed 's/.*-/-/'`
1341a30de1fSmrg    else os=; fi
1351a30de1fSmrg    ;;
1361a30de1fSmrgesac
1371a30de1fSmrg
1381a30de1fSmrg### Let's recognize common machines as not being operating systems so
1391a30de1fSmrg### that things like config.sub decstation-3100 work.  We also
1401a30de1fSmrg### recognize some manufacturers as not being operating systems, so we
1411a30de1fSmrg### can provide default operating systems below.
1421a30de1fSmrgcase $os in
1431a30de1fSmrg	-sun*os*)
1441a30de1fSmrg		# Prevent following clause from handling this invalid input.
1451a30de1fSmrg		;;
1461a30de1fSmrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
1471a30de1fSmrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
1481a30de1fSmrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
1491a30de1fSmrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1501a30de1fSmrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1511a30de1fSmrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
1521a30de1fSmrg	-apple | -axis | -knuth | -cray)
1531a30de1fSmrg		os=
1541a30de1fSmrg		basic_machine=$1
1551a30de1fSmrg		;;
1561a30de1fSmrg	-sim | -cisco | -oki | -wec | -winbond)
1571a30de1fSmrg		os=
1581a30de1fSmrg		basic_machine=$1
1591a30de1fSmrg		;;
1601a30de1fSmrg	-scout)
1611a30de1fSmrg		;;
1621a30de1fSmrg	-wrs)
1631a30de1fSmrg		os=-vxworks
1641a30de1fSmrg		basic_machine=$1
1651a30de1fSmrg		;;
1661a30de1fSmrg	-chorusos*)
1671a30de1fSmrg		os=-chorusos
1681a30de1fSmrg		basic_machine=$1
1691a30de1fSmrg		;;
1701a30de1fSmrg 	-chorusrdb)
1711a30de1fSmrg 		os=-chorusrdb
1721a30de1fSmrg		basic_machine=$1
1731a30de1fSmrg 		;;
1741a30de1fSmrg	-hiux*)
1751a30de1fSmrg		os=-hiuxwe2
1761a30de1fSmrg		;;
1771a30de1fSmrg	-sco6)
1781a30de1fSmrg		os=-sco5v6
1791a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1801a30de1fSmrg		;;
1811a30de1fSmrg	-sco5)
1821a30de1fSmrg		os=-sco3.2v5
1831a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1841a30de1fSmrg		;;
1851a30de1fSmrg	-sco4)
1861a30de1fSmrg		os=-sco3.2v4
1871a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1881a30de1fSmrg		;;
1891a30de1fSmrg	-sco3.2.[4-9]*)
1901a30de1fSmrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1911a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1921a30de1fSmrg		;;
1931a30de1fSmrg	-sco3.2v[4-9]*)
1941a30de1fSmrg		# Don't forget version if it is 3.2v4 or newer.
1951a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1961a30de1fSmrg		;;
1971a30de1fSmrg	-sco5v6*)
1981a30de1fSmrg		# Don't forget version if it is 3.2v4 or newer.
1991a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2001a30de1fSmrg		;;
2011a30de1fSmrg	-sco*)
2021a30de1fSmrg		os=-sco3.2v2
2031a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2041a30de1fSmrg		;;
2051a30de1fSmrg	-udk*)
2061a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2071a30de1fSmrg		;;
2081a30de1fSmrg	-isc)
2091a30de1fSmrg		os=-isc2.2
2101a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2111a30de1fSmrg		;;
2121a30de1fSmrg	-clix*)
2131a30de1fSmrg		basic_machine=clipper-intergraph
2141a30de1fSmrg		;;
2151a30de1fSmrg	-isc*)
2161a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2171a30de1fSmrg		;;
2181a30de1fSmrg	-lynx*)
2191a30de1fSmrg		os=-lynxos
2201a30de1fSmrg		;;
2211a30de1fSmrg	-ptx*)
2221a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
2231a30de1fSmrg		;;
2241a30de1fSmrg	-windowsnt*)
2251a30de1fSmrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
2261a30de1fSmrg		;;
2271a30de1fSmrg	-psos*)
2281a30de1fSmrg		os=-psos
2291a30de1fSmrg		;;
2301a30de1fSmrg	-mint | -mint[0-9]*)
2311a30de1fSmrg		basic_machine=m68k-atari
2321a30de1fSmrg		os=-mint
2331a30de1fSmrg		;;
2341a30de1fSmrgesac
2351a30de1fSmrg
2361a30de1fSmrg# Decode aliases for certain CPU-COMPANY combinations.
2371a30de1fSmrgcase $basic_machine in
2381a30de1fSmrg	# Recognize the basic CPU types without company name.
2391a30de1fSmrg	# Some are omitted here because they have special meanings below.
2401a30de1fSmrg	1750a | 580 \
2411a30de1fSmrg	| a29k \
2421a30de1fSmrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
2431a30de1fSmrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
2441a30de1fSmrg	| am33_2.0 \
2451a30de1fSmrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
2461a30de1fSmrg	| bfin \
2471a30de1fSmrg	| c4x | clipper \
2481a30de1fSmrg	| d10v | d30v | dlx | dsp16xx \
249b7fb5eacSmrg	| fido | fr30 | frv \
2501a30de1fSmrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
2511a30de1fSmrg	| i370 | i860 | i960 | ia64 \
2521a30de1fSmrg	| ip2k | iq2000 \
253b7fb5eacSmrg	| lm32 \
2541a30de1fSmrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
255b7fb5eacSmrg	| maxq | mb | microblaze | mcore | mep | metag \
2561a30de1fSmrg	| mips | mipsbe | mipseb | mipsel | mipsle \
2571a30de1fSmrg	| mips16 \
2581a30de1fSmrg	| mips64 | mips64el \
259b7fb5eacSmrg	| mips64octeon | mips64octeonel \
2601a30de1fSmrg	| mips64orion | mips64orionel \
261b7fb5eacSmrg	| mips64r5900 | mips64r5900el \
262b7fb5eacSmrg	| mips64vr | mips64vrel \
2631a30de1fSmrg	| mips64vr4100 | mips64vr4100el \
2641a30de1fSmrg	| mips64vr4300 | mips64vr4300el \
2651a30de1fSmrg	| mips64vr5000 | mips64vr5000el \
2661a30de1fSmrg	| mips64vr5900 | mips64vr5900el \
2671a30de1fSmrg	| mipsisa32 | mipsisa32el \
2681a30de1fSmrg	| mipsisa32r2 | mipsisa32r2el \
2691a30de1fSmrg	| mipsisa64 | mipsisa64el \
2701a30de1fSmrg	| mipsisa64r2 | mipsisa64r2el \
2711a30de1fSmrg	| mipsisa64sb1 | mipsisa64sb1el \
2721a30de1fSmrg	| mipsisa64sr71k | mipsisa64sr71kel \
2731a30de1fSmrg	| mipstx39 | mipstx39el \
2741a30de1fSmrg	| mn10200 | mn10300 \
275b7fb5eacSmrg	| moxie \
2761a30de1fSmrg	| mt \
2771a30de1fSmrg	| msp430 \
2781a30de1fSmrg	| nios | nios2 \
2791a30de1fSmrg	| ns16k | ns32k \
2801a30de1fSmrg	| or32 \
2811a30de1fSmrg	| pdp10 | pdp11 | pj | pjl \
2821a30de1fSmrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
2831a30de1fSmrg	| pyramid \
2841a30de1fSmrg	| score \
285b7fb5eacSmrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
2861a30de1fSmrg	| sh64 | sh64le \
2871a30de1fSmrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
2881a30de1fSmrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
2891a30de1fSmrg	| spu | strongarm \
2901a30de1fSmrg	| tahoe | thumb | tic4x | tic80 | tron \
2911a30de1fSmrg	| v850 | v850e \
2921a30de1fSmrg	| we32k \
2931a30de1fSmrg	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
294b7fb5eacSmrg	| z8k | z80)
2951a30de1fSmrg		basic_machine=$basic_machine-unknown
2961a30de1fSmrg		;;
2971a30de1fSmrg	m6811 | m68hc11 | m6812 | m68hc12)
2981a30de1fSmrg		# Motorola 68HC11/12.
2991a30de1fSmrg		basic_machine=$basic_machine-unknown
3001a30de1fSmrg		os=-none
3011a30de1fSmrg		;;
3021a30de1fSmrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
3031a30de1fSmrg		;;
3041a30de1fSmrg	ms1)
3051a30de1fSmrg		basic_machine=mt-unknown
3061a30de1fSmrg		;;
3071a30de1fSmrg
3081a30de1fSmrg	# We use `pc' rather than `unknown'
3091a30de1fSmrg	# because (1) that's what they normally are, and
3101a30de1fSmrg	# (2) the word "unknown" tends to confuse beginning users.
3111a30de1fSmrg	i*86 | x86_64)
3121a30de1fSmrg	  basic_machine=$basic_machine-pc
3131a30de1fSmrg	  ;;
3141a30de1fSmrg	# Object if more than one company name word.
3151a30de1fSmrg	*-*-*)
3161a30de1fSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
3171a30de1fSmrg		exit 1
3181a30de1fSmrg		;;
3191a30de1fSmrg	# Recognize the basic CPU types with company name.
3201a30de1fSmrg	580-* \
3211a30de1fSmrg	| a29k-* \
3221a30de1fSmrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
3231a30de1fSmrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
3241a30de1fSmrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
3251a30de1fSmrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3261a30de1fSmrg	| avr-* | avr32-* \
3271a30de1fSmrg	| bfin-* | bs2000-* \
3281a30de1fSmrg	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
3291a30de1fSmrg	| clipper-* | craynv-* | cydra-* \
3301a30de1fSmrg	| d10v-* | d30v-* | dlx-* \
3311a30de1fSmrg	| elxsi-* \
332b7fb5eacSmrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
3331a30de1fSmrg	| h8300-* | h8500-* \
3341a30de1fSmrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
3351a30de1fSmrg	| i*86-* | i860-* | i960-* | ia64-* \
3361a30de1fSmrg	| ip2k-* | iq2000-* \
337b7fb5eacSmrg	| lm32-* \
3381a30de1fSmrg	| m32c-* | m32r-* | m32rle-* \
3391a30de1fSmrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
340b7fb5eacSmrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
3411a30de1fSmrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
3421a30de1fSmrg	| mips16-* \
3431a30de1fSmrg	| mips64-* | mips64el-* \
344b7fb5eacSmrg	| mips64octeon-* | mips64octeonel-* \
3451a30de1fSmrg	| mips64orion-* | mips64orionel-* \
346b7fb5eacSmrg	| mips64r5900-* | mips64r5900el-* \
347b7fb5eacSmrg	| mips64vr-* | mips64vrel-* \
3481a30de1fSmrg	| mips64vr4100-* | mips64vr4100el-* \
3491a30de1fSmrg	| mips64vr4300-* | mips64vr4300el-* \
3501a30de1fSmrg	| mips64vr5000-* | mips64vr5000el-* \
3511a30de1fSmrg	| mips64vr5900-* | mips64vr5900el-* \
3521a30de1fSmrg	| mipsisa32-* | mipsisa32el-* \
3531a30de1fSmrg	| mipsisa32r2-* | mipsisa32r2el-* \
3541a30de1fSmrg	| mipsisa64-* | mipsisa64el-* \
3551a30de1fSmrg	| mipsisa64r2-* | mipsisa64r2el-* \
3561a30de1fSmrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
3571a30de1fSmrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
3581a30de1fSmrg	| mipstx39-* | mipstx39el-* \
3591a30de1fSmrg	| mmix-* \
3601a30de1fSmrg	| mt-* \
3611a30de1fSmrg	| msp430-* \
3621a30de1fSmrg	| nios-* | nios2-* \
3631a30de1fSmrg	| none-* | np1-* | ns16k-* | ns32k-* \
3641a30de1fSmrg	| orion-* \
3651a30de1fSmrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
3661a30de1fSmrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
3671a30de1fSmrg	| pyramid-* \
3681a30de1fSmrg	| romp-* | rs6000-* \
369b7fb5eacSmrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
3701a30de1fSmrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
3711a30de1fSmrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
3721a30de1fSmrg	| sparclite-* \
3731a30de1fSmrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
3741a30de1fSmrg	| tahoe-* | thumb-* \
375b7fb5eacSmrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
3761a30de1fSmrg	| tron-* \
3771a30de1fSmrg	| v850-* | v850e-* | vax-* \
3781a30de1fSmrg	| we32k-* \
3791a30de1fSmrg	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
380b7fb5eacSmrg	| xstormy16-* | xtensa*-* \
3811a30de1fSmrg	| ymp-* \
382b7fb5eacSmrg	| z8k-* | z80-*)
383b7fb5eacSmrg		;;
384b7fb5eacSmrg	# Recognize the basic CPU types without company name, with glob match.
385b7fb5eacSmrg	xtensa*)
386b7fb5eacSmrg		basic_machine=$basic_machine-unknown
3871a30de1fSmrg		;;
3881a30de1fSmrg	# Recognize the various machine names and aliases which stand
3891a30de1fSmrg	# for a CPU type and a company and sometimes even an OS.
3901a30de1fSmrg	386bsd)
3911a30de1fSmrg		basic_machine=i386-unknown
3921a30de1fSmrg		os=-bsd
3931a30de1fSmrg		;;
3941a30de1fSmrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
3951a30de1fSmrg		basic_machine=m68000-att
3961a30de1fSmrg		;;
3971a30de1fSmrg	3b*)
3981a30de1fSmrg		basic_machine=we32k-att
3991a30de1fSmrg		;;
4001a30de1fSmrg	a29khif)
4011a30de1fSmrg		basic_machine=a29k-amd
4021a30de1fSmrg		os=-udi
4031a30de1fSmrg		;;
4041a30de1fSmrg    	abacus)
4051a30de1fSmrg		basic_machine=abacus-unknown
4061a30de1fSmrg		;;
4071a30de1fSmrg	adobe68k)
4081a30de1fSmrg		basic_machine=m68010-adobe
4091a30de1fSmrg		os=-scout
4101a30de1fSmrg		;;
4111a30de1fSmrg	alliant | fx80)
4121a30de1fSmrg		basic_machine=fx80-alliant
4131a30de1fSmrg		;;
4141a30de1fSmrg	altos | altos3068)
4151a30de1fSmrg		basic_machine=m68k-altos
4161a30de1fSmrg		;;
4171a30de1fSmrg	am29k)
4181a30de1fSmrg		basic_machine=a29k-none
4191a30de1fSmrg		os=-bsd
4201a30de1fSmrg		;;
4211a30de1fSmrg	amd64)
4221a30de1fSmrg		basic_machine=x86_64-pc
4231a30de1fSmrg		;;
4241a30de1fSmrg	amd64-*)
4251a30de1fSmrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
4261a30de1fSmrg		;;
4271a30de1fSmrg	amdahl)
4281a30de1fSmrg		basic_machine=580-amdahl
4291a30de1fSmrg		os=-sysv
4301a30de1fSmrg		;;
4311a30de1fSmrg	amiga | amiga-*)
4321a30de1fSmrg		basic_machine=m68k-unknown
4331a30de1fSmrg		;;
4341a30de1fSmrg	amigaos | amigados)
4351a30de1fSmrg		basic_machine=m68k-unknown
4361a30de1fSmrg		os=-amigaos
4371a30de1fSmrg		;;
4381a30de1fSmrg	amigaunix | amix)
4391a30de1fSmrg		basic_machine=m68k-unknown
4401a30de1fSmrg		os=-sysv4
4411a30de1fSmrg		;;
4421a30de1fSmrg	apollo68)
4431a30de1fSmrg		basic_machine=m68k-apollo
4441a30de1fSmrg		os=-sysv
4451a30de1fSmrg		;;
4461a30de1fSmrg	apollo68bsd)
4471a30de1fSmrg		basic_machine=m68k-apollo
4481a30de1fSmrg		os=-bsd
4491a30de1fSmrg		;;
450b7fb5eacSmrg	aros)
451b7fb5eacSmrg		basic_machine=i386-pc
452b7fb5eacSmrg		os=-aros
453b7fb5eacSmrg		;;
4541a30de1fSmrg	aux)
4551a30de1fSmrg		basic_machine=m68k-apple
4561a30de1fSmrg		os=-aux
4571a30de1fSmrg		;;
4581a30de1fSmrg	balance)
4591a30de1fSmrg		basic_machine=ns32k-sequent
4601a30de1fSmrg		os=-dynix
4611a30de1fSmrg		;;
462b7fb5eacSmrg	blackfin)
463b7fb5eacSmrg		basic_machine=bfin-unknown
464b7fb5eacSmrg		os=-linux
465b7fb5eacSmrg		;;
466b7fb5eacSmrg	blackfin-*)
467b7fb5eacSmrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
468b7fb5eacSmrg		os=-linux
469b7fb5eacSmrg		;;
4701a30de1fSmrg	c90)
4711a30de1fSmrg		basic_machine=c90-cray
4721a30de1fSmrg		os=-unicos
4731a30de1fSmrg		;;
474b7fb5eacSmrg        cegcc)
475b7fb5eacSmrg		basic_machine=arm-unknown
476b7fb5eacSmrg		os=-cegcc
477b7fb5eacSmrg		;;
4781a30de1fSmrg	convex-c1)
4791a30de1fSmrg		basic_machine=c1-convex
4801a30de1fSmrg		os=-bsd
4811a30de1fSmrg		;;
4821a30de1fSmrg	convex-c2)
4831a30de1fSmrg		basic_machine=c2-convex
4841a30de1fSmrg		os=-bsd
4851a30de1fSmrg		;;
4861a30de1fSmrg	convex-c32)
4871a30de1fSmrg		basic_machine=c32-convex
4881a30de1fSmrg		os=-bsd
4891a30de1fSmrg		;;
4901a30de1fSmrg	convex-c34)
4911a30de1fSmrg		basic_machine=c34-convex
4921a30de1fSmrg		os=-bsd
4931a30de1fSmrg		;;
4941a30de1fSmrg	convex-c38)
4951a30de1fSmrg		basic_machine=c38-convex
4961a30de1fSmrg		os=-bsd
4971a30de1fSmrg		;;
4981a30de1fSmrg	cray | j90)
4991a30de1fSmrg		basic_machine=j90-cray
5001a30de1fSmrg		os=-unicos
5011a30de1fSmrg		;;
5021a30de1fSmrg	craynv)
5031a30de1fSmrg		basic_machine=craynv-cray
5041a30de1fSmrg		os=-unicosmp
5051a30de1fSmrg		;;
506b7fb5eacSmrg	cr16)
507b7fb5eacSmrg		basic_machine=cr16-unknown
5081a30de1fSmrg		os=-elf
5091a30de1fSmrg		;;
5101a30de1fSmrg	crds | unos)
5111a30de1fSmrg		basic_machine=m68k-crds
5121a30de1fSmrg		;;
5131a30de1fSmrg	crisv32 | crisv32-* | etraxfs*)
5141a30de1fSmrg		basic_machine=crisv32-axis
5151a30de1fSmrg		;;
5161a30de1fSmrg	cris | cris-* | etrax*)
5171a30de1fSmrg		basic_machine=cris-axis
5181a30de1fSmrg		;;
5191a30de1fSmrg	crx)
5201a30de1fSmrg		basic_machine=crx-unknown
5211a30de1fSmrg		os=-elf
5221a30de1fSmrg		;;
5231a30de1fSmrg	da30 | da30-*)
5241a30de1fSmrg		basic_machine=m68k-da30
5251a30de1fSmrg		;;
5261a30de1fSmrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
5271a30de1fSmrg		basic_machine=mips-dec
5281a30de1fSmrg		;;
5291a30de1fSmrg	decsystem10* | dec10*)
5301a30de1fSmrg		basic_machine=pdp10-dec
5311a30de1fSmrg		os=-tops10
5321a30de1fSmrg		;;
5331a30de1fSmrg	decsystem20* | dec20*)
5341a30de1fSmrg		basic_machine=pdp10-dec
5351a30de1fSmrg		os=-tops20
5361a30de1fSmrg		;;
5371a30de1fSmrg	delta | 3300 | motorola-3300 | motorola-delta \
5381a30de1fSmrg	      | 3300-motorola | delta-motorola)
5391a30de1fSmrg		basic_machine=m68k-motorola
5401a30de1fSmrg		;;
5411a30de1fSmrg	delta88)
5421a30de1fSmrg		basic_machine=m88k-motorola
5431a30de1fSmrg		os=-sysv3
5441a30de1fSmrg		;;
545b7fb5eacSmrg	dicos)
546b7fb5eacSmrg		basic_machine=i686-pc
547b7fb5eacSmrg		os=-dicos
548b7fb5eacSmrg		;;
5491a30de1fSmrg	djgpp)
5501a30de1fSmrg		basic_machine=i586-pc
5511a30de1fSmrg		os=-msdosdjgpp
5521a30de1fSmrg		;;
5531a30de1fSmrg	dpx20 | dpx20-*)
5541a30de1fSmrg		basic_machine=rs6000-bull
5551a30de1fSmrg		os=-bosx
5561a30de1fSmrg		;;
5571a30de1fSmrg	dpx2* | dpx2*-bull)
5581a30de1fSmrg		basic_machine=m68k-bull
5591a30de1fSmrg		os=-sysv3
5601a30de1fSmrg		;;
5611a30de1fSmrg	ebmon29k)
5621a30de1fSmrg		basic_machine=a29k-amd
5631a30de1fSmrg		os=-ebmon
5641a30de1fSmrg		;;
5651a30de1fSmrg	elxsi)
5661a30de1fSmrg		basic_machine=elxsi-elxsi
5671a30de1fSmrg		os=-bsd
5681a30de1fSmrg		;;
5691a30de1fSmrg	encore | umax | mmax)
5701a30de1fSmrg		basic_machine=ns32k-encore
5711a30de1fSmrg		;;
5721a30de1fSmrg	es1800 | OSE68k | ose68k | ose | OSE)
5731a30de1fSmrg		basic_machine=m68k-ericsson
5741a30de1fSmrg		os=-ose
5751a30de1fSmrg		;;
5761a30de1fSmrg	fx2800)
5771a30de1fSmrg		basic_machine=i860-alliant
5781a30de1fSmrg		;;
5791a30de1fSmrg	genix)
5801a30de1fSmrg		basic_machine=ns32k-ns
5811a30de1fSmrg		;;
5821a30de1fSmrg	gmicro)
5831a30de1fSmrg		basic_machine=tron-gmicro
5841a30de1fSmrg		os=-sysv
5851a30de1fSmrg		;;
5861a30de1fSmrg	go32)
5871a30de1fSmrg		basic_machine=i386-pc
5881a30de1fSmrg		os=-go32
5891a30de1fSmrg		;;
5901a30de1fSmrg	h3050r* | hiux*)
5911a30de1fSmrg		basic_machine=hppa1.1-hitachi
5921a30de1fSmrg		os=-hiuxwe2
5931a30de1fSmrg		;;
5941a30de1fSmrg	h8300hms)
5951a30de1fSmrg		basic_machine=h8300-hitachi
5961a30de1fSmrg		os=-hms
5971a30de1fSmrg		;;
5981a30de1fSmrg	h8300xray)
5991a30de1fSmrg		basic_machine=h8300-hitachi
6001a30de1fSmrg		os=-xray
6011a30de1fSmrg		;;
6021a30de1fSmrg	h8500hms)
6031a30de1fSmrg		basic_machine=h8500-hitachi
6041a30de1fSmrg		os=-hms
6051a30de1fSmrg		;;
6061a30de1fSmrg	harris)
6071a30de1fSmrg		basic_machine=m88k-harris
6081a30de1fSmrg		os=-sysv3
6091a30de1fSmrg		;;
6101a30de1fSmrg	hp300-*)
6111a30de1fSmrg		basic_machine=m68k-hp
6121a30de1fSmrg		;;
6131a30de1fSmrg	hp300bsd)
6141a30de1fSmrg		basic_machine=m68k-hp
6151a30de1fSmrg		os=-bsd
6161a30de1fSmrg		;;
6171a30de1fSmrg	hp300hpux)
6181a30de1fSmrg		basic_machine=m68k-hp
6191a30de1fSmrg		os=-hpux
6201a30de1fSmrg		;;
6211a30de1fSmrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
6221a30de1fSmrg		basic_machine=hppa1.0-hp
6231a30de1fSmrg		;;
6241a30de1fSmrg	hp9k2[0-9][0-9] | hp9k31[0-9])
6251a30de1fSmrg		basic_machine=m68000-hp
6261a30de1fSmrg		;;
6271a30de1fSmrg	hp9k3[2-9][0-9])
6281a30de1fSmrg		basic_machine=m68k-hp
6291a30de1fSmrg		;;
6301a30de1fSmrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
6311a30de1fSmrg		basic_machine=hppa1.0-hp
6321a30de1fSmrg		;;
6331a30de1fSmrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
6341a30de1fSmrg		basic_machine=hppa1.1-hp
6351a30de1fSmrg		;;
6361a30de1fSmrg	hp9k78[0-9] | hp78[0-9])
6371a30de1fSmrg		# FIXME: really hppa2.0-hp
6381a30de1fSmrg		basic_machine=hppa1.1-hp
6391a30de1fSmrg		;;
6401a30de1fSmrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
6411a30de1fSmrg		# FIXME: really hppa2.0-hp
6421a30de1fSmrg		basic_machine=hppa1.1-hp
6431a30de1fSmrg		;;
6441a30de1fSmrg	hp9k8[0-9][13679] | hp8[0-9][13679])
6451a30de1fSmrg		basic_machine=hppa1.1-hp
6461a30de1fSmrg		;;
6471a30de1fSmrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
6481a30de1fSmrg		basic_machine=hppa1.0-hp
6491a30de1fSmrg		;;
6501a30de1fSmrg	hppa-next)
6511a30de1fSmrg		os=-nextstep3
6521a30de1fSmrg		;;
6531a30de1fSmrg	hppaosf)
6541a30de1fSmrg		basic_machine=hppa1.1-hp
6551a30de1fSmrg		os=-osf
6561a30de1fSmrg		;;
6571a30de1fSmrg	hppro)
6581a30de1fSmrg		basic_machine=hppa1.1-hp
6591a30de1fSmrg		os=-proelf
6601a30de1fSmrg		;;
6611a30de1fSmrg	i370-ibm* | ibm*)
6621a30de1fSmrg		basic_machine=i370-ibm
6631a30de1fSmrg		;;
6641a30de1fSmrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
6651a30de1fSmrg	i*86v32)
6661a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6671a30de1fSmrg		os=-sysv32
6681a30de1fSmrg		;;
6691a30de1fSmrg	i*86v4*)
6701a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6711a30de1fSmrg		os=-sysv4
6721a30de1fSmrg		;;
6731a30de1fSmrg	i*86v)
6741a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6751a30de1fSmrg		os=-sysv
6761a30de1fSmrg		;;
6771a30de1fSmrg	i*86sol2)
6781a30de1fSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
6791a30de1fSmrg		os=-solaris2
6801a30de1fSmrg		;;
6811a30de1fSmrg	i386mach)
6821a30de1fSmrg		basic_machine=i386-mach
6831a30de1fSmrg		os=-mach
6841a30de1fSmrg		;;
6851a30de1fSmrg	i386-vsta | vsta)
6861a30de1fSmrg		basic_machine=i386-unknown
6871a30de1fSmrg		os=-vsta
6881a30de1fSmrg		;;
6891a30de1fSmrg	iris | iris4d)
6901a30de1fSmrg		basic_machine=mips-sgi
6911a30de1fSmrg		case $os in
6921a30de1fSmrg		    -irix*)
6931a30de1fSmrg			;;
6941a30de1fSmrg		    *)
6951a30de1fSmrg			os=-irix4
6961a30de1fSmrg			;;
6971a30de1fSmrg		esac
6981a30de1fSmrg		;;
6991a30de1fSmrg	isi68 | isi)
7001a30de1fSmrg		basic_machine=m68k-isi
7011a30de1fSmrg		os=-sysv
7021a30de1fSmrg		;;
703b7fb5eacSmrg	m68knommu)
704b7fb5eacSmrg		basic_machine=m68k-unknown
705b7fb5eacSmrg		os=-linux
706b7fb5eacSmrg		;;
707b7fb5eacSmrg	m68knommu-*)
708b7fb5eacSmrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
709b7fb5eacSmrg		os=-linux
710b7fb5eacSmrg		;;
7111a30de1fSmrg	m88k-omron*)
7121a30de1fSmrg		basic_machine=m88k-omron
7131a30de1fSmrg		;;
7141a30de1fSmrg	magnum | m3230)
7151a30de1fSmrg		basic_machine=mips-mips
7161a30de1fSmrg		os=-sysv
7171a30de1fSmrg		;;
7181a30de1fSmrg	merlin)
7191a30de1fSmrg		basic_machine=ns32k-utek
7201a30de1fSmrg		os=-sysv
7211a30de1fSmrg		;;
7221a30de1fSmrg	mingw32)
7231a30de1fSmrg		basic_machine=i386-pc
7241a30de1fSmrg		os=-mingw32
7251a30de1fSmrg		;;
726b7fb5eacSmrg	mingw32ce)
727b7fb5eacSmrg		basic_machine=arm-unknown
728b7fb5eacSmrg		os=-mingw32ce
729b7fb5eacSmrg		;;
7301a30de1fSmrg	miniframe)
7311a30de1fSmrg		basic_machine=m68000-convergent
7321a30de1fSmrg		;;
7331a30de1fSmrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
7341a30de1fSmrg		basic_machine=m68k-atari
7351a30de1fSmrg		os=-mint
7361a30de1fSmrg		;;
7371a30de1fSmrg	mips3*-*)
7381a30de1fSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
7391a30de1fSmrg		;;
7401a30de1fSmrg	mips3*)
7411a30de1fSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
7421a30de1fSmrg		;;
7431a30de1fSmrg	monitor)
7441a30de1fSmrg		basic_machine=m68k-rom68k
7451a30de1fSmrg		os=-coff
7461a30de1fSmrg		;;
7471a30de1fSmrg	morphos)
7481a30de1fSmrg		basic_machine=powerpc-unknown
7491a30de1fSmrg		os=-morphos
7501a30de1fSmrg		;;
7511a30de1fSmrg	msdos)
7521a30de1fSmrg		basic_machine=i386-pc
7531a30de1fSmrg		os=-msdos
7541a30de1fSmrg		;;
7551a30de1fSmrg	ms1-*)
7561a30de1fSmrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
7571a30de1fSmrg		;;
7581a30de1fSmrg	mvs)
7591a30de1fSmrg		basic_machine=i370-ibm
7601a30de1fSmrg		os=-mvs
7611a30de1fSmrg		;;
7621a30de1fSmrg	ncr3000)
7631a30de1fSmrg		basic_machine=i486-ncr
7641a30de1fSmrg		os=-sysv4
7651a30de1fSmrg		;;
7661a30de1fSmrg	netbsd386)
7671a30de1fSmrg		basic_machine=i386-unknown
7681a30de1fSmrg		os=-netbsd
7691a30de1fSmrg		;;
7701a30de1fSmrg	netwinder)
7711a30de1fSmrg		basic_machine=armv4l-rebel
7721a30de1fSmrg		os=-linux
7731a30de1fSmrg		;;
7741a30de1fSmrg	news | news700 | news800 | news900)
7751a30de1fSmrg		basic_machine=m68k-sony
7761a30de1fSmrg		os=-newsos
7771a30de1fSmrg		;;
7781a30de1fSmrg	news1000)
7791a30de1fSmrg		basic_machine=m68030-sony
7801a30de1fSmrg		os=-newsos
7811a30de1fSmrg		;;
7821a30de1fSmrg	news-3600 | risc-news)
7831a30de1fSmrg		basic_machine=mips-sony
7841a30de1fSmrg		os=-newsos
7851a30de1fSmrg		;;
7861a30de1fSmrg	necv70)
7871a30de1fSmrg		basic_machine=v70-nec
7881a30de1fSmrg		os=-sysv
7891a30de1fSmrg		;;
7901a30de1fSmrg	next | m*-next )
7911a30de1fSmrg		basic_machine=m68k-next
7921a30de1fSmrg		case $os in
7931a30de1fSmrg		    -nextstep* )
7941a30de1fSmrg			;;
7951a30de1fSmrg		    -ns2*)
7961a30de1fSmrg		      os=-nextstep2
7971a30de1fSmrg			;;
7981a30de1fSmrg		    *)
7991a30de1fSmrg		      os=-nextstep3
8001a30de1fSmrg			;;
8011a30de1fSmrg		esac
8021a30de1fSmrg		;;
8031a30de1fSmrg	nh3000)
8041a30de1fSmrg		basic_machine=m68k-harris
8051a30de1fSmrg		os=-cxux
8061a30de1fSmrg		;;
8071a30de1fSmrg	nh[45]000)
8081a30de1fSmrg		basic_machine=m88k-harris
8091a30de1fSmrg		os=-cxux
8101a30de1fSmrg		;;
8111a30de1fSmrg	nindy960)
8121a30de1fSmrg		basic_machine=i960-intel
8131a30de1fSmrg		os=-nindy
8141a30de1fSmrg		;;
8151a30de1fSmrg	mon960)
8161a30de1fSmrg		basic_machine=i960-intel
8171a30de1fSmrg		os=-mon960
8181a30de1fSmrg		;;
8191a30de1fSmrg	nonstopux)
8201a30de1fSmrg		basic_machine=mips-compaq
8211a30de1fSmrg		os=-nonstopux
8221a30de1fSmrg		;;
8231a30de1fSmrg	np1)
8241a30de1fSmrg		basic_machine=np1-gould
8251a30de1fSmrg		;;
8261a30de1fSmrg	nsr-tandem)
8271a30de1fSmrg		basic_machine=nsr-tandem
8281a30de1fSmrg		;;
8291a30de1fSmrg	op50n-* | op60c-*)
8301a30de1fSmrg		basic_machine=hppa1.1-oki
8311a30de1fSmrg		os=-proelf
8321a30de1fSmrg		;;
8331a30de1fSmrg	openrisc | openrisc-*)
8341a30de1fSmrg		basic_machine=or32-unknown
8351a30de1fSmrg		;;
8361a30de1fSmrg	os400)
8371a30de1fSmrg		basic_machine=powerpc-ibm
8381a30de1fSmrg		os=-os400
8391a30de1fSmrg		;;
8401a30de1fSmrg	OSE68000 | ose68000)
8411a30de1fSmrg		basic_machine=m68000-ericsson
8421a30de1fSmrg		os=-ose
8431a30de1fSmrg		;;
8441a30de1fSmrg	os68k)
8451a30de1fSmrg		basic_machine=m68k-none
8461a30de1fSmrg		os=-os68k
8471a30de1fSmrg		;;
8481a30de1fSmrg	pa-hitachi)
8491a30de1fSmrg		basic_machine=hppa1.1-hitachi
8501a30de1fSmrg		os=-hiuxwe2
8511a30de1fSmrg		;;
8521a30de1fSmrg	paragon)
8531a30de1fSmrg		basic_machine=i860-intel
8541a30de1fSmrg		os=-osf
8551a30de1fSmrg		;;
856b7fb5eacSmrg	parisc)
857b7fb5eacSmrg		basic_machine=hppa-unknown
858b7fb5eacSmrg		os=-linux
859b7fb5eacSmrg		;;
860b7fb5eacSmrg	parisc-*)
861b7fb5eacSmrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
862b7fb5eacSmrg		os=-linux
863b7fb5eacSmrg		;;
8641a30de1fSmrg	pbd)
8651a30de1fSmrg		basic_machine=sparc-tti
8661a30de1fSmrg		;;
8671a30de1fSmrg	pbb)
8681a30de1fSmrg		basic_machine=m68k-tti
8691a30de1fSmrg		;;
8701a30de1fSmrg	pc532 | pc532-*)
8711a30de1fSmrg		basic_machine=ns32k-pc532
8721a30de1fSmrg		;;
8731a30de1fSmrg	pc98)
8741a30de1fSmrg		basic_machine=i386-pc
8751a30de1fSmrg		;;
8761a30de1fSmrg	pc98-*)
8771a30de1fSmrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
8781a30de1fSmrg		;;
8791a30de1fSmrg	pentium | p5 | k5 | k6 | nexgen | viac3)
8801a30de1fSmrg		basic_machine=i586-pc
8811a30de1fSmrg		;;
8821a30de1fSmrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
8831a30de1fSmrg		basic_machine=i686-pc
8841a30de1fSmrg		;;
8851a30de1fSmrg	pentiumii | pentium2 | pentiumiii | pentium3)
8861a30de1fSmrg		basic_machine=i686-pc
8871a30de1fSmrg		;;
8881a30de1fSmrg	pentium4)
8891a30de1fSmrg		basic_machine=i786-pc
8901a30de1fSmrg		;;
8911a30de1fSmrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
8921a30de1fSmrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
8931a30de1fSmrg		;;
8941a30de1fSmrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
8951a30de1fSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
8961a30de1fSmrg		;;
8971a30de1fSmrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
8981a30de1fSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
8991a30de1fSmrg		;;
9001a30de1fSmrg	pentium4-*)
9011a30de1fSmrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
9021a30de1fSmrg		;;
9031a30de1fSmrg	pn)
9041a30de1fSmrg		basic_machine=pn-gould
9051a30de1fSmrg		;;
9061a30de1fSmrg	power)	basic_machine=power-ibm
9071a30de1fSmrg		;;
9081a30de1fSmrg	ppc)	basic_machine=powerpc-unknown
9091a30de1fSmrg		;;
9101a30de1fSmrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
9111a30de1fSmrg		;;
9121a30de1fSmrg	ppcle | powerpclittle | ppc-le | powerpc-little)
9131a30de1fSmrg		basic_machine=powerpcle-unknown
9141a30de1fSmrg		;;
9151a30de1fSmrg	ppcle-* | powerpclittle-*)
9161a30de1fSmrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
9171a30de1fSmrg		;;
9181a30de1fSmrg	ppc64)	basic_machine=powerpc64-unknown
9191a30de1fSmrg		;;
9201a30de1fSmrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
9211a30de1fSmrg		;;
9221a30de1fSmrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
9231a30de1fSmrg		basic_machine=powerpc64le-unknown
9241a30de1fSmrg		;;
9251a30de1fSmrg	ppc64le-* | powerpc64little-*)
9261a30de1fSmrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
9271a30de1fSmrg		;;
9281a30de1fSmrg	ps2)
9291a30de1fSmrg		basic_machine=i386-ibm
9301a30de1fSmrg		;;
9311a30de1fSmrg	pw32)
9321a30de1fSmrg		basic_machine=i586-unknown
9331a30de1fSmrg		os=-pw32
9341a30de1fSmrg		;;
9351a30de1fSmrg	rdos)
9361a30de1fSmrg		basic_machine=i386-pc
9371a30de1fSmrg		os=-rdos
9381a30de1fSmrg		;;
9391a30de1fSmrg	rom68k)
9401a30de1fSmrg		basic_machine=m68k-rom68k
9411a30de1fSmrg		os=-coff
9421a30de1fSmrg		;;
9431a30de1fSmrg	rm[46]00)
9441a30de1fSmrg		basic_machine=mips-siemens
9451a30de1fSmrg		;;
9461a30de1fSmrg	rtpc | rtpc-*)
9471a30de1fSmrg		basic_machine=romp-ibm
9481a30de1fSmrg		;;
9491a30de1fSmrg	s390 | s390-*)
9501a30de1fSmrg		basic_machine=s390-ibm
9511a30de1fSmrg		;;
9521a30de1fSmrg	s390x | s390x-*)
9531a30de1fSmrg		basic_machine=s390x-ibm
9541a30de1fSmrg		;;
9551a30de1fSmrg	sa29200)
9561a30de1fSmrg		basic_machine=a29k-amd
9571a30de1fSmrg		os=-udi
9581a30de1fSmrg		;;
9591a30de1fSmrg	sb1)
9601a30de1fSmrg		basic_machine=mipsisa64sb1-unknown
9611a30de1fSmrg		;;
9621a30de1fSmrg	sb1el)
9631a30de1fSmrg		basic_machine=mipsisa64sb1el-unknown
9641a30de1fSmrg		;;
9651a30de1fSmrg	sde)
9661a30de1fSmrg		basic_machine=mipsisa32-sde
9671a30de1fSmrg		os=-elf
9681a30de1fSmrg		;;
9691a30de1fSmrg	sei)
9701a30de1fSmrg		basic_machine=mips-sei
9711a30de1fSmrg		os=-seiux
9721a30de1fSmrg		;;
9731a30de1fSmrg	sequent)
9741a30de1fSmrg		basic_machine=i386-sequent
9751a30de1fSmrg		;;
9761a30de1fSmrg	sh)
9771a30de1fSmrg		basic_machine=sh-hitachi
9781a30de1fSmrg		os=-hms
9791a30de1fSmrg		;;
980b7fb5eacSmrg	sh5el)
981b7fb5eacSmrg		basic_machine=sh5le-unknown
982b7fb5eacSmrg		;;
9831a30de1fSmrg	sh64)
9841a30de1fSmrg		basic_machine=sh64-unknown
9851a30de1fSmrg		;;
9861a30de1fSmrg	sparclite-wrs | simso-wrs)
9871a30de1fSmrg		basic_machine=sparclite-wrs
9881a30de1fSmrg		os=-vxworks
9891a30de1fSmrg		;;
9901a30de1fSmrg	sps7)
9911a30de1fSmrg		basic_machine=m68k-bull
9921a30de1fSmrg		os=-sysv2
9931a30de1fSmrg		;;
9941a30de1fSmrg	spur)
9951a30de1fSmrg		basic_machine=spur-unknown
9961a30de1fSmrg		;;
9971a30de1fSmrg	st2000)
9981a30de1fSmrg		basic_machine=m68k-tandem
9991a30de1fSmrg		;;
10001a30de1fSmrg	stratus)
10011a30de1fSmrg		basic_machine=i860-stratus
10021a30de1fSmrg		os=-sysv4
10031a30de1fSmrg		;;
10041a30de1fSmrg	sun2)
10051a30de1fSmrg		basic_machine=m68000-sun
10061a30de1fSmrg		;;
10071a30de1fSmrg	sun2os3)
10081a30de1fSmrg		basic_machine=m68000-sun
10091a30de1fSmrg		os=-sunos3
10101a30de1fSmrg		;;
10111a30de1fSmrg	sun2os4)
10121a30de1fSmrg		basic_machine=m68000-sun
10131a30de1fSmrg		os=-sunos4
10141a30de1fSmrg		;;
10151a30de1fSmrg	sun3os3)
10161a30de1fSmrg		basic_machine=m68k-sun
10171a30de1fSmrg		os=-sunos3
10181a30de1fSmrg		;;
10191a30de1fSmrg	sun3os4)
10201a30de1fSmrg		basic_machine=m68k-sun
10211a30de1fSmrg		os=-sunos4
10221a30de1fSmrg		;;
10231a30de1fSmrg	sun4os3)
10241a30de1fSmrg		basic_machine=sparc-sun
10251a30de1fSmrg		os=-sunos3
10261a30de1fSmrg		;;
10271a30de1fSmrg	sun4os4)
10281a30de1fSmrg		basic_machine=sparc-sun
10291a30de1fSmrg		os=-sunos4
10301a30de1fSmrg		;;
10311a30de1fSmrg	sun4sol2)
10321a30de1fSmrg		basic_machine=sparc-sun
10331a30de1fSmrg		os=-solaris2
10341a30de1fSmrg		;;
10351a30de1fSmrg	sun3 | sun3-*)
10361a30de1fSmrg		basic_machine=m68k-sun
10371a30de1fSmrg		;;
10381a30de1fSmrg	sun4)
10391a30de1fSmrg		basic_machine=sparc-sun
10401a30de1fSmrg		;;
10411a30de1fSmrg	sun386 | sun386i | roadrunner)
10421a30de1fSmrg		basic_machine=i386-sun
10431a30de1fSmrg		;;
10441a30de1fSmrg	sv1)
10451a30de1fSmrg		basic_machine=sv1-cray
10461a30de1fSmrg		os=-unicos
10471a30de1fSmrg		;;
10481a30de1fSmrg	symmetry)
10491a30de1fSmrg		basic_machine=i386-sequent
10501a30de1fSmrg		os=-dynix
10511a30de1fSmrg		;;
10521a30de1fSmrg	t3e)
10531a30de1fSmrg		basic_machine=alphaev5-cray
10541a30de1fSmrg		os=-unicos
10551a30de1fSmrg		;;
10561a30de1fSmrg	t90)
10571a30de1fSmrg		basic_machine=t90-cray
10581a30de1fSmrg		os=-unicos
10591a30de1fSmrg		;;
10601a30de1fSmrg	tic54x | c54x*)
10611a30de1fSmrg		basic_machine=tic54x-unknown
10621a30de1fSmrg		os=-coff
10631a30de1fSmrg		;;
10641a30de1fSmrg	tic55x | c55x*)
10651a30de1fSmrg		basic_machine=tic55x-unknown
10661a30de1fSmrg		os=-coff
10671a30de1fSmrg		;;
10681a30de1fSmrg	tic6x | c6x*)
10691a30de1fSmrg		basic_machine=tic6x-unknown
10701a30de1fSmrg		os=-coff
10711a30de1fSmrg		;;
1072b7fb5eacSmrg	tile*)
1073b7fb5eacSmrg		basic_machine=tile-unknown
1074b7fb5eacSmrg		os=-linux-gnu
1075b7fb5eacSmrg		;;
10761a30de1fSmrg	tx39)
10771a30de1fSmrg		basic_machine=mipstx39-unknown
10781a30de1fSmrg		;;
10791a30de1fSmrg	tx39el)
10801a30de1fSmrg		basic_machine=mipstx39el-unknown
10811a30de1fSmrg		;;
10821a30de1fSmrg	toad1)
10831a30de1fSmrg		basic_machine=pdp10-xkl
10841a30de1fSmrg		os=-tops20
10851a30de1fSmrg		;;
10861a30de1fSmrg	tower | tower-32)
10871a30de1fSmrg		basic_machine=m68k-ncr
10881a30de1fSmrg		;;
10891a30de1fSmrg	tpf)
10901a30de1fSmrg		basic_machine=s390x-ibm
10911a30de1fSmrg		os=-tpf
10921a30de1fSmrg		;;
10931a30de1fSmrg	udi29k)
10941a30de1fSmrg		basic_machine=a29k-amd
10951a30de1fSmrg		os=-udi
10961a30de1fSmrg		;;
10971a30de1fSmrg	ultra3)
10981a30de1fSmrg		basic_machine=a29k-nyu
10991a30de1fSmrg		os=-sym1
11001a30de1fSmrg		;;
11011a30de1fSmrg	v810 | necv810)
11021a30de1fSmrg		basic_machine=v810-nec
11031a30de1fSmrg		os=-none
11041a30de1fSmrg		;;
11051a30de1fSmrg	vaxv)
11061a30de1fSmrg		basic_machine=vax-dec
11071a30de1fSmrg		os=-sysv
11081a30de1fSmrg		;;
11091a30de1fSmrg	vms)
11101a30de1fSmrg		basic_machine=vax-dec
11111a30de1fSmrg		os=-vms
11121a30de1fSmrg		;;
11131a30de1fSmrg	vpp*|vx|vx-*)
11141a30de1fSmrg		basic_machine=f301-fujitsu
11151a30de1fSmrg		;;
11161a30de1fSmrg	vxworks960)
11171a30de1fSmrg		basic_machine=i960-wrs
11181a30de1fSmrg		os=-vxworks
11191a30de1fSmrg		;;
11201a30de1fSmrg	vxworks68)
11211a30de1fSmrg		basic_machine=m68k-wrs
11221a30de1fSmrg		os=-vxworks
11231a30de1fSmrg		;;
11241a30de1fSmrg	vxworks29k)
11251a30de1fSmrg		basic_machine=a29k-wrs
11261a30de1fSmrg		os=-vxworks
11271a30de1fSmrg		;;
11281a30de1fSmrg	w65*)
11291a30de1fSmrg		basic_machine=w65-wdc
11301a30de1fSmrg		os=-none
11311a30de1fSmrg		;;
11321a30de1fSmrg	w89k-*)
11331a30de1fSmrg		basic_machine=hppa1.1-winbond
11341a30de1fSmrg		os=-proelf
11351a30de1fSmrg		;;
11361a30de1fSmrg	xbox)
11371a30de1fSmrg		basic_machine=i686-pc
11381a30de1fSmrg		os=-mingw32
11391a30de1fSmrg		;;
11401a30de1fSmrg	xps | xps100)
11411a30de1fSmrg		basic_machine=xps100-honeywell
11421a30de1fSmrg		;;
11431a30de1fSmrg	ymp)
11441a30de1fSmrg		basic_machine=ymp-cray
11451a30de1fSmrg		os=-unicos
11461a30de1fSmrg		;;
11471a30de1fSmrg	z8k-*-coff)
11481a30de1fSmrg		basic_machine=z8k-unknown
11491a30de1fSmrg		os=-sim
11501a30de1fSmrg		;;
1151b7fb5eacSmrg	z80-*-coff)
1152b7fb5eacSmrg		basic_machine=z80-unknown
1153b7fb5eacSmrg		os=-sim
1154b7fb5eacSmrg		;;
11551a30de1fSmrg	none)
11561a30de1fSmrg		basic_machine=none-none
11571a30de1fSmrg		os=-none
11581a30de1fSmrg		;;
11591a30de1fSmrg
11601a30de1fSmrg# Here we handle the default manufacturer of certain CPU types.  It is in
11611a30de1fSmrg# some cases the only manufacturer, in others, it is the most popular.
11621a30de1fSmrg	w89k)
11631a30de1fSmrg		basic_machine=hppa1.1-winbond
11641a30de1fSmrg		;;
11651a30de1fSmrg	op50n)
11661a30de1fSmrg		basic_machine=hppa1.1-oki
11671a30de1fSmrg		;;
11681a30de1fSmrg	op60c)
11691a30de1fSmrg		basic_machine=hppa1.1-oki
11701a30de1fSmrg		;;
11711a30de1fSmrg	romp)
11721a30de1fSmrg		basic_machine=romp-ibm
11731a30de1fSmrg		;;
11741a30de1fSmrg	mmix)
11751a30de1fSmrg		basic_machine=mmix-knuth
11761a30de1fSmrg		;;
11771a30de1fSmrg	rs6000)
11781a30de1fSmrg		basic_machine=rs6000-ibm
11791a30de1fSmrg		;;
11801a30de1fSmrg	vax)
11811a30de1fSmrg		basic_machine=vax-dec
11821a30de1fSmrg		;;
11831a30de1fSmrg	pdp10)
11841a30de1fSmrg		# there are many clones, so DEC is not a safe bet
11851a30de1fSmrg		basic_machine=pdp10-unknown
11861a30de1fSmrg		;;
11871a30de1fSmrg	pdp11)
11881a30de1fSmrg		basic_machine=pdp11-dec
11891a30de1fSmrg		;;
11901a30de1fSmrg	we32k)
11911a30de1fSmrg		basic_machine=we32k-att
11921a30de1fSmrg		;;
1193b7fb5eacSmrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
11941a30de1fSmrg		basic_machine=sh-unknown
11951a30de1fSmrg		;;
11961a30de1fSmrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
11971a30de1fSmrg		basic_machine=sparc-sun
11981a30de1fSmrg		;;
11991a30de1fSmrg	cydra)
12001a30de1fSmrg		basic_machine=cydra-cydrome
12011a30de1fSmrg		;;
12021a30de1fSmrg	orion)
12031a30de1fSmrg		basic_machine=orion-highlevel
12041a30de1fSmrg		;;
12051a30de1fSmrg	orion105)
12061a30de1fSmrg		basic_machine=clipper-highlevel
12071a30de1fSmrg		;;
12081a30de1fSmrg	mac | mpw | mac-mpw)
12091a30de1fSmrg		basic_machine=m68k-apple
12101a30de1fSmrg		;;
12111a30de1fSmrg	pmac | pmac-mpw)
12121a30de1fSmrg		basic_machine=powerpc-apple
12131a30de1fSmrg		;;
12141a30de1fSmrg	*-unknown)
12151a30de1fSmrg		# Make sure to match an already-canonicalized machine name.
12161a30de1fSmrg		;;
12171a30de1fSmrg	*)
12181a30de1fSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
12191a30de1fSmrg		exit 1
12201a30de1fSmrg		;;
12211a30de1fSmrgesac
12221a30de1fSmrg
12231a30de1fSmrg# Here we canonicalize certain aliases for manufacturers.
12241a30de1fSmrgcase $basic_machine in
12251a30de1fSmrg	*-digital*)
12261a30de1fSmrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
12271a30de1fSmrg		;;
12281a30de1fSmrg	*-commodore*)
12291a30de1fSmrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
12301a30de1fSmrg		;;
12311a30de1fSmrg	*)
12321a30de1fSmrg		;;
12331a30de1fSmrgesac
12341a30de1fSmrg
12351a30de1fSmrg# Decode manufacturer-specific aliases for certain operating systems.
12361a30de1fSmrg
12371a30de1fSmrgif [ x"$os" != x"" ]
12381a30de1fSmrgthen
12391a30de1fSmrgcase $os in
12401a30de1fSmrg        # First match some system type aliases
12411a30de1fSmrg        # that might get confused with valid system types.
12421a30de1fSmrg	# -solaris* is a basic system type, with this one exception.
12431a30de1fSmrg	-solaris1 | -solaris1.*)
12441a30de1fSmrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
12451a30de1fSmrg		;;
12461a30de1fSmrg	-solaris)
12471a30de1fSmrg		os=-solaris2
12481a30de1fSmrg		;;
12491a30de1fSmrg	-svr4*)
12501a30de1fSmrg		os=-sysv4
12511a30de1fSmrg		;;
12521a30de1fSmrg	-unixware*)
12531a30de1fSmrg		os=-sysv4.2uw
12541a30de1fSmrg		;;
12551a30de1fSmrg	-gnu/linux*)
12561a30de1fSmrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
12571a30de1fSmrg		;;
12581a30de1fSmrg	# First accept the basic system types.
12591a30de1fSmrg	# The portable systems comes first.
12601a30de1fSmrg	# Each alternative MUST END IN A *, to match a version number.
12611a30de1fSmrg	# -sysv* is not here because it comes later, after sysvr4.
12621a30de1fSmrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
12631a30de1fSmrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
12641a30de1fSmrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1265b7fb5eacSmrg	      | -kopensolaris* \
12661a30de1fSmrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1267b7fb5eacSmrg	      | -aos* | -aros* \
12681a30de1fSmrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
12691a30de1fSmrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
12701a30de1fSmrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
12711a30de1fSmrg	      | -openbsd* | -solidbsd* \
12721a30de1fSmrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
12731a30de1fSmrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
12741a30de1fSmrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
12751a30de1fSmrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1276b7fb5eacSmrg	      | -chorusos* | -chorusrdb* | -cegcc* \
12771a30de1fSmrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
12781a30de1fSmrg	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
12791a30de1fSmrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
12801a30de1fSmrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
12811a30de1fSmrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
12821a30de1fSmrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
12831a30de1fSmrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
12841a30de1fSmrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
12851a30de1fSmrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1286b7fb5eacSmrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
12871a30de1fSmrg	# Remember, each alternative MUST END IN *, to match a version number.
12881a30de1fSmrg		;;
12891a30de1fSmrg	-qnx*)
12901a30de1fSmrg		case $basic_machine in
12911a30de1fSmrg		    x86-* | i*86-*)
12921a30de1fSmrg			;;
12931a30de1fSmrg		    *)
12941a30de1fSmrg			os=-nto$os
12951a30de1fSmrg			;;
12961a30de1fSmrg		esac
12971a30de1fSmrg		;;
12981a30de1fSmrg	-nto-qnx*)
12991a30de1fSmrg		;;
13001a30de1fSmrg	-nto*)
13011a30de1fSmrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
13021a30de1fSmrg		;;
13031a30de1fSmrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
13041a30de1fSmrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
13051a30de1fSmrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
13061a30de1fSmrg		;;
13071a30de1fSmrg	-mac*)
13081a30de1fSmrg		os=`echo $os | sed -e 's|mac|macos|'`
13091a30de1fSmrg		;;
13101a30de1fSmrg	-linux-dietlibc)
13111a30de1fSmrg		os=-linux-dietlibc
13121a30de1fSmrg		;;
13131a30de1fSmrg	-linux*)
13141a30de1fSmrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
13151a30de1fSmrg		;;
13161a30de1fSmrg	-sunos5*)
13171a30de1fSmrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
13181a30de1fSmrg		;;
13191a30de1fSmrg	-sunos6*)
13201a30de1fSmrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
13211a30de1fSmrg		;;
13221a30de1fSmrg	-opened*)
13231a30de1fSmrg		os=-openedition
13241a30de1fSmrg		;;
13251a30de1fSmrg        -os400*)
13261a30de1fSmrg		os=-os400
13271a30de1fSmrg		;;
13281a30de1fSmrg	-wince*)
13291a30de1fSmrg		os=-wince
13301a30de1fSmrg		;;
13311a30de1fSmrg	-osfrose*)
13321a30de1fSmrg		os=-osfrose
13331a30de1fSmrg		;;
13341a30de1fSmrg	-osf*)
13351a30de1fSmrg		os=-osf
13361a30de1fSmrg		;;
13371a30de1fSmrg	-utek*)
13381a30de1fSmrg		os=-bsd
13391a30de1fSmrg		;;
13401a30de1fSmrg	-dynix*)
13411a30de1fSmrg		os=-bsd
13421a30de1fSmrg		;;
13431a30de1fSmrg	-acis*)
13441a30de1fSmrg		os=-aos
13451a30de1fSmrg		;;
13461a30de1fSmrg	-atheos*)
13471a30de1fSmrg		os=-atheos
13481a30de1fSmrg		;;
13491a30de1fSmrg	-syllable*)
13501a30de1fSmrg		os=-syllable
13511a30de1fSmrg		;;
13521a30de1fSmrg	-386bsd)
13531a30de1fSmrg		os=-bsd
13541a30de1fSmrg		;;
13551a30de1fSmrg	-ctix* | -uts*)
13561a30de1fSmrg		os=-sysv
13571a30de1fSmrg		;;
13581a30de1fSmrg	-nova*)
13591a30de1fSmrg		os=-rtmk-nova
13601a30de1fSmrg		;;
13611a30de1fSmrg	-ns2 )
13621a30de1fSmrg		os=-nextstep2
13631a30de1fSmrg		;;
13641a30de1fSmrg	-nsk*)
13651a30de1fSmrg		os=-nsk
13661a30de1fSmrg		;;
13671a30de1fSmrg	# Preserve the version number of sinix5.
13681a30de1fSmrg	-sinix5.*)
13691a30de1fSmrg		os=`echo $os | sed -e 's|sinix|sysv|'`
13701a30de1fSmrg		;;
13711a30de1fSmrg	-sinix*)
13721a30de1fSmrg		os=-sysv4
13731a30de1fSmrg		;;
13741a30de1fSmrg        -tpf*)
13751a30de1fSmrg		os=-tpf
13761a30de1fSmrg		;;
13771a30de1fSmrg	-triton*)
13781a30de1fSmrg		os=-sysv3
13791a30de1fSmrg		;;
13801a30de1fSmrg	-oss*)
13811a30de1fSmrg		os=-sysv3
13821a30de1fSmrg		;;
13831a30de1fSmrg	-svr4)
13841a30de1fSmrg		os=-sysv4
13851a30de1fSmrg		;;
13861a30de1fSmrg	-svr3)
13871a30de1fSmrg		os=-sysv3
13881a30de1fSmrg		;;
13891a30de1fSmrg	-sysvr4)
13901a30de1fSmrg		os=-sysv4
13911a30de1fSmrg		;;
13921a30de1fSmrg	# This must come after -sysvr4.
13931a30de1fSmrg	-sysv*)
13941a30de1fSmrg		;;
13951a30de1fSmrg	-ose*)
13961a30de1fSmrg		os=-ose
13971a30de1fSmrg		;;
13981a30de1fSmrg	-es1800*)
13991a30de1fSmrg		os=-ose
14001a30de1fSmrg		;;
14011a30de1fSmrg	-xenix)
14021a30de1fSmrg		os=-xenix
14031a30de1fSmrg		;;
14041a30de1fSmrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
14051a30de1fSmrg		os=-mint
14061a30de1fSmrg		;;
14071a30de1fSmrg	-aros*)
14081a30de1fSmrg		os=-aros
14091a30de1fSmrg		;;
14101a30de1fSmrg	-kaos*)
14111a30de1fSmrg		os=-kaos
14121a30de1fSmrg		;;
14131a30de1fSmrg	-zvmoe)
14141a30de1fSmrg		os=-zvmoe
14151a30de1fSmrg		;;
1416b7fb5eacSmrg	-dicos*)
1417b7fb5eacSmrg		os=-dicos
1418b7fb5eacSmrg		;;
14191a30de1fSmrg	-none)
14201a30de1fSmrg		;;
14211a30de1fSmrg	*)
14221a30de1fSmrg		# Get rid of the `-' at the beginning of $os.
14231a30de1fSmrg		os=`echo $os | sed 's/[^-]*-//'`
14241a30de1fSmrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
14251a30de1fSmrg		exit 1
14261a30de1fSmrg		;;
14271a30de1fSmrgesac
14281a30de1fSmrgelse
14291a30de1fSmrg
14301a30de1fSmrg# Here we handle the default operating systems that come with various machines.
14311a30de1fSmrg# The value should be what the vendor currently ships out the door with their
14321a30de1fSmrg# machine or put another way, the most popular os provided with the machine.
14331a30de1fSmrg
14341a30de1fSmrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
14351a30de1fSmrg# "-sun"), then you have to tell the case statement up towards the top
14361a30de1fSmrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
14371a30de1fSmrg# will signal an error saying that MANUFACTURER isn't an operating
14381a30de1fSmrg# system, and we'll never get to this point.
14391a30de1fSmrg
14401a30de1fSmrgcase $basic_machine in
14411a30de1fSmrg        score-*)
14421a30de1fSmrg		os=-elf
14431a30de1fSmrg		;;
14441a30de1fSmrg        spu-*)
14451a30de1fSmrg		os=-elf
14461a30de1fSmrg		;;
14471a30de1fSmrg	*-acorn)
14481a30de1fSmrg		os=-riscix1.2
14491a30de1fSmrg		;;
14501a30de1fSmrg	arm*-rebel)
14511a30de1fSmrg		os=-linux
14521a30de1fSmrg		;;
14531a30de1fSmrg	arm*-semi)
14541a30de1fSmrg		os=-aout
14551a30de1fSmrg		;;
14561a30de1fSmrg        c4x-* | tic4x-*)
14571a30de1fSmrg        	os=-coff
14581a30de1fSmrg		;;
14591a30de1fSmrg	# This must come before the *-dec entry.
14601a30de1fSmrg	pdp10-*)
14611a30de1fSmrg		os=-tops20
14621a30de1fSmrg		;;
14631a30de1fSmrg	pdp11-*)
14641a30de1fSmrg		os=-none
14651a30de1fSmrg		;;
14661a30de1fSmrg	*-dec | vax-*)
14671a30de1fSmrg		os=-ultrix4.2
14681a30de1fSmrg		;;
14691a30de1fSmrg	m68*-apollo)
14701a30de1fSmrg		os=-domain
14711a30de1fSmrg		;;
14721a30de1fSmrg	i386-sun)
14731a30de1fSmrg		os=-sunos4.0.2
14741a30de1fSmrg		;;
14751a30de1fSmrg	m68000-sun)
14761a30de1fSmrg		os=-sunos3
14771a30de1fSmrg		# This also exists in the configure program, but was not the
14781a30de1fSmrg		# default.
14791a30de1fSmrg		# os=-sunos4
14801a30de1fSmrg		;;
14811a30de1fSmrg	m68*-cisco)
14821a30de1fSmrg		os=-aout
14831a30de1fSmrg		;;
1484b7fb5eacSmrg        mep-*)
1485b7fb5eacSmrg		os=-elf
1486b7fb5eacSmrg		;;
14871a30de1fSmrg	mips*-cisco)
14881a30de1fSmrg		os=-elf
14891a30de1fSmrg		;;
14901a30de1fSmrg	mips*-*)
14911a30de1fSmrg		os=-elf
14921a30de1fSmrg		;;
14931a30de1fSmrg	or32-*)
14941a30de1fSmrg		os=-coff
14951a30de1fSmrg		;;
14961a30de1fSmrg	*-tti)	# must be before sparc entry or we get the wrong os.
14971a30de1fSmrg		os=-sysv3
14981a30de1fSmrg		;;
14991a30de1fSmrg	sparc-* | *-sun)
15001a30de1fSmrg		os=-sunos4.1.1
15011a30de1fSmrg		;;
15021a30de1fSmrg	*-be)
15031a30de1fSmrg		os=-beos
15041a30de1fSmrg		;;
15051a30de1fSmrg	*-haiku)
15061a30de1fSmrg		os=-haiku
15071a30de1fSmrg		;;
15081a30de1fSmrg	*-ibm)
15091a30de1fSmrg		os=-aix
15101a30de1fSmrg		;;
15111a30de1fSmrg    	*-knuth)
15121a30de1fSmrg		os=-mmixware
15131a30de1fSmrg		;;
15141a30de1fSmrg	*-wec)
15151a30de1fSmrg		os=-proelf
15161a30de1fSmrg		;;
15171a30de1fSmrg	*-winbond)
15181a30de1fSmrg		os=-proelf
15191a30de1fSmrg		;;
15201a30de1fSmrg	*-oki)
15211a30de1fSmrg		os=-proelf
15221a30de1fSmrg		;;
15231a30de1fSmrg	*-hp)
15241a30de1fSmrg		os=-hpux
15251a30de1fSmrg		;;
15261a30de1fSmrg	*-hitachi)
15271a30de1fSmrg		os=-hiux
15281a30de1fSmrg		;;
15291a30de1fSmrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
15301a30de1fSmrg		os=-sysv
15311a30de1fSmrg		;;
15321a30de1fSmrg	*-cbm)
15331a30de1fSmrg		os=-amigaos
15341a30de1fSmrg		;;
15351a30de1fSmrg	*-dg)
15361a30de1fSmrg		os=-dgux
15371a30de1fSmrg		;;
15381a30de1fSmrg	*-dolphin)
15391a30de1fSmrg		os=-sysv3
15401a30de1fSmrg		;;
15411a30de1fSmrg	m68k-ccur)
15421a30de1fSmrg		os=-rtu
15431a30de1fSmrg		;;
15441a30de1fSmrg	m88k-omron*)
15451a30de1fSmrg		os=-luna
15461a30de1fSmrg		;;
15471a30de1fSmrg	*-next )
15481a30de1fSmrg		os=-nextstep
15491a30de1fSmrg		;;
15501a30de1fSmrg	*-sequent)
15511a30de1fSmrg		os=-ptx
15521a30de1fSmrg		;;
15531a30de1fSmrg	*-crds)
15541a30de1fSmrg		os=-unos
15551a30de1fSmrg		;;
15561a30de1fSmrg	*-ns)
15571a30de1fSmrg		os=-genix
15581a30de1fSmrg		;;
15591a30de1fSmrg	i370-*)
15601a30de1fSmrg		os=-mvs
15611a30de1fSmrg		;;
15621a30de1fSmrg	*-next)
15631a30de1fSmrg		os=-nextstep3
15641a30de1fSmrg		;;
15651a30de1fSmrg	*-gould)
15661a30de1fSmrg		os=-sysv
15671a30de1fSmrg		;;
15681a30de1fSmrg	*-highlevel)
15691a30de1fSmrg		os=-bsd
15701a30de1fSmrg		;;
15711a30de1fSmrg	*-encore)
15721a30de1fSmrg		os=-bsd
15731a30de1fSmrg		;;
15741a30de1fSmrg	*-sgi)
15751a30de1fSmrg		os=-irix
15761a30de1fSmrg		;;
15771a30de1fSmrg	*-siemens)
15781a30de1fSmrg		os=-sysv4
15791a30de1fSmrg		;;
15801a30de1fSmrg	*-masscomp)
15811a30de1fSmrg		os=-rtu
15821a30de1fSmrg		;;
15831a30de1fSmrg	f30[01]-fujitsu | f700-fujitsu)
15841a30de1fSmrg		os=-uxpv
15851a30de1fSmrg		;;
15861a30de1fSmrg	*-rom68k)
15871a30de1fSmrg		os=-coff
15881a30de1fSmrg		;;
15891a30de1fSmrg	*-*bug)
15901a30de1fSmrg		os=-coff
15911a30de1fSmrg		;;
15921a30de1fSmrg	*-apple)
15931a30de1fSmrg		os=-macos
15941a30de1fSmrg		;;
15951a30de1fSmrg	*-atari*)
15961a30de1fSmrg		os=-mint
15971a30de1fSmrg		;;
15981a30de1fSmrg	*)
15991a30de1fSmrg		os=-none
16001a30de1fSmrg		;;
16011a30de1fSmrgesac
16021a30de1fSmrgfi
16031a30de1fSmrg
16041a30de1fSmrg# Here we handle the case where we know the os, and the CPU type, but not the
16051a30de1fSmrg# manufacturer.  We pick the logical manufacturer.
16061a30de1fSmrgvendor=unknown
16071a30de1fSmrgcase $basic_machine in
16081a30de1fSmrg	*-unknown)
16091a30de1fSmrg		case $os in
16101a30de1fSmrg			-riscix*)
16111a30de1fSmrg				vendor=acorn
16121a30de1fSmrg				;;
16131a30de1fSmrg			-sunos*)
16141a30de1fSmrg				vendor=sun
16151a30de1fSmrg				;;
16161a30de1fSmrg			-aix*)
16171a30de1fSmrg				vendor=ibm
16181a30de1fSmrg				;;
16191a30de1fSmrg			-beos*)
16201a30de1fSmrg				vendor=be
16211a30de1fSmrg				;;
16221a30de1fSmrg			-hpux*)
16231a30de1fSmrg				vendor=hp
16241a30de1fSmrg				;;
16251a30de1fSmrg			-mpeix*)
16261a30de1fSmrg				vendor=hp
16271a30de1fSmrg				;;
16281a30de1fSmrg			-hiux*)
16291a30de1fSmrg				vendor=hitachi
16301a30de1fSmrg				;;
16311a30de1fSmrg			-unos*)
16321a30de1fSmrg				vendor=crds
16331a30de1fSmrg				;;
16341a30de1fSmrg			-dgux*)
16351a30de1fSmrg				vendor=dg
16361a30de1fSmrg				;;
16371a30de1fSmrg			-luna*)
16381a30de1fSmrg				vendor=omron
16391a30de1fSmrg				;;
16401a30de1fSmrg			-genix*)
16411a30de1fSmrg				vendor=ns
16421a30de1fSmrg				;;
16431a30de1fSmrg			-mvs* | -opened*)
16441a30de1fSmrg				vendor=ibm
16451a30de1fSmrg				;;
16461a30de1fSmrg			-os400*)
16471a30de1fSmrg				vendor=ibm
16481a30de1fSmrg				;;
16491a30de1fSmrg			-ptx*)
16501a30de1fSmrg				vendor=sequent
16511a30de1fSmrg				;;
16521a30de1fSmrg			-tpf*)
16531a30de1fSmrg				vendor=ibm
16541a30de1fSmrg				;;
16551a30de1fSmrg			-vxsim* | -vxworks* | -windiss*)
16561a30de1fSmrg				vendor=wrs
16571a30de1fSmrg				;;
16581a30de1fSmrg			-aux*)
16591a30de1fSmrg				vendor=apple
16601a30de1fSmrg				;;
16611a30de1fSmrg			-hms*)
16621a30de1fSmrg				vendor=hitachi
16631a30de1fSmrg				;;
16641a30de1fSmrg			-mpw* | -macos*)
16651a30de1fSmrg				vendor=apple
16661a30de1fSmrg				;;
16671a30de1fSmrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
16681a30de1fSmrg				vendor=atari
16691a30de1fSmrg				;;
16701a30de1fSmrg			-vos*)
16711a30de1fSmrg				vendor=stratus
16721a30de1fSmrg				;;
16731a30de1fSmrg		esac
16741a30de1fSmrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
16751a30de1fSmrg		;;
16761a30de1fSmrgesac
16771a30de1fSmrg
16781a30de1fSmrgecho $basic_machine$os
16791a30de1fSmrgexit
16801a30de1fSmrg
16811a30de1fSmrg# Local variables:
16821a30de1fSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
16831a30de1fSmrg# time-stamp-start: "timestamp='"
16841a30de1fSmrg# time-stamp-format: "%:y-%02m-%02d"
16851a30de1fSmrg# time-stamp-end: "'"
16861a30de1fSmrg# End:
1687