config.sub revision 20915927
18440cca4Smrg#! /bin/sh
28440cca4Smrg# Configuration validation subroutine script.
38440cca4Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
420915927Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
520915927Smrg#   2011 Free Software Foundation, Inc.
68440cca4Smrg
720915927Smrgtimestamp='2011-11-11'
88440cca4Smrg
98440cca4Smrg# This file is (in principle) common to ALL GNU software.
108440cca4Smrg# The presence of a machine in this file suggests that SOME GNU software
118440cca4Smrg# can handle that machine.  It does not imply ALL GNU software can.
128440cca4Smrg#
138440cca4Smrg# This file is free software; you can redistribute it and/or modify
148440cca4Smrg# it under the terms of the GNU General Public License as published by
158440cca4Smrg# the Free Software Foundation; either version 2 of the License, or
168440cca4Smrg# (at your option) any later version.
178440cca4Smrg#
188440cca4Smrg# This program is distributed in the hope that it will be useful,
198440cca4Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
208440cca4Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
218440cca4Smrg# GNU General Public License for more details.
228440cca4Smrg#
238440cca4Smrg# You should have received a copy of the GNU General Public License
248440cca4Smrg# along with this program; if not, write to the Free Software
25d1c293acSmrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26d1c293acSmrg# 02110-1301, USA.
27d1c293acSmrg#
288440cca4Smrg# As a special exception to the GNU General Public License, if you
298440cca4Smrg# distribute this file as part of a program that contains a
308440cca4Smrg# configuration script generated by Autoconf, you may include it under
318440cca4Smrg# the same distribution terms that you use for the rest of that program.
328440cca4Smrg
33d1c293acSmrg
348440cca4Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
35d1c293acSmrg# diff and a properly formatted GNU ChangeLog entry.
368440cca4Smrg#
378440cca4Smrg# Configuration subroutine to validate and canonicalize a configuration type.
388440cca4Smrg# Supply the specified configuration type as an argument.
398440cca4Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
408440cca4Smrg# Otherwise, we print the canonical config type on stdout and succeed.
418440cca4Smrg
42d1c293acSmrg# You can get the latest version of this script from:
43d1c293acSmrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
44d1c293acSmrg
458440cca4Smrg# This file is supposed to be the same for all GNU packages
468440cca4Smrg# and recognize all the CPU types, system types and aliases
478440cca4Smrg# that are meaningful with *any* GNU software.
488440cca4Smrg# Each package is responsible for reporting which valid configurations
498440cca4Smrg# it does not support.  The user should be able to distinguish
508440cca4Smrg# a failure to support a valid configuration from a meaningless
518440cca4Smrg# configuration.
528440cca4Smrg
538440cca4Smrg# The goal of this file is to map all the various variations of a given
548440cca4Smrg# machine specification into a single specification in the form:
558440cca4Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
568440cca4Smrg# or in some cases, the newer four-part form:
578440cca4Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
588440cca4Smrg# It is wrong to echo any other type of specification.
598440cca4Smrg
608440cca4Smrgme=`echo "$0" | sed -e 's,.*/,,'`
618440cca4Smrg
628440cca4Smrgusage="\
638440cca4SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
648440cca4Smrg       $0 [OPTION] ALIAS
658440cca4Smrg
668440cca4SmrgCanonicalize a configuration name.
678440cca4Smrg
688440cca4SmrgOperation modes:
698440cca4Smrg  -h, --help         print this help, then exit
708440cca4Smrg  -t, --time-stamp   print date of last modification, then exit
718440cca4Smrg  -v, --version      print version number, then exit
728440cca4Smrg
738440cca4SmrgReport bugs and patches to <config-patches@gnu.org>."
748440cca4Smrg
758440cca4Smrgversion="\
768440cca4SmrgGNU config.sub ($timestamp)
778440cca4Smrg
78d1c293acSmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
7920915927Smrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
80d1c293acSmrgSoftware Foundation, Inc.
818440cca4Smrg
828440cca4SmrgThis is free software; see the source for copying conditions.  There is NO
838440cca4Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
848440cca4Smrg
858440cca4Smrghelp="
868440cca4SmrgTry \`$me --help' for more information."
878440cca4Smrg
888440cca4Smrg# Parse command line
898440cca4Smrgwhile test $# -gt 0 ; do
908440cca4Smrg  case $1 in
918440cca4Smrg    --time-stamp | --time* | -t )
92d1c293acSmrg       echo "$timestamp" ; exit ;;
938440cca4Smrg    --version | -v )
94d1c293acSmrg       echo "$version" ; exit ;;
958440cca4Smrg    --help | --h* | -h )
96d1c293acSmrg       echo "$usage"; exit ;;
978440cca4Smrg    -- )     # Stop option processing
988440cca4Smrg       shift; break ;;
998440cca4Smrg    - )	# Use stdin as input.
1008440cca4Smrg       break ;;
1018440cca4Smrg    -* )
1028440cca4Smrg       echo "$me: invalid option $1$help"
1038440cca4Smrg       exit 1 ;;
1048440cca4Smrg
1058440cca4Smrg    *local*)
1068440cca4Smrg       # First pass through any local machine types.
1078440cca4Smrg       echo $1
108d1c293acSmrg       exit ;;
1098440cca4Smrg
1108440cca4Smrg    * )
1118440cca4Smrg       break ;;
1128440cca4Smrg  esac
1138440cca4Smrgdone
1148440cca4Smrg
1158440cca4Smrgcase $# in
1168440cca4Smrg 0) echo "$me: missing argument$help" >&2
1178440cca4Smrg    exit 1;;
1188440cca4Smrg 1) ;;
1198440cca4Smrg *) echo "$me: too many arguments$help" >&2
1208440cca4Smrg    exit 1;;
1218440cca4Smrgesac
1228440cca4Smrg
1238440cca4Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1248440cca4Smrg# Here we must recognize all the valid KERNEL-OS combinations.
1258440cca4Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1268440cca4Smrgcase $maybe_os in
127d1c293acSmrg  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128d1c293acSmrg  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129d1c293acSmrg  knetbsd*-gnu* | netbsd*-gnu* | \
130d1c293acSmrg  kopensolaris*-gnu* | \
131d1c293acSmrg  storm-chaos* | os2-emx* | rtmk-nova*)
1328440cca4Smrg    os=-$maybe_os
1338440cca4Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1348440cca4Smrg    ;;
1358440cca4Smrg  *)
1368440cca4Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1378440cca4Smrg    if [ $basic_machine != $1 ]
1388440cca4Smrg    then os=`echo $1 | sed 's/.*-/-/'`
1398440cca4Smrg    else os=; fi
1408440cca4Smrg    ;;
1418440cca4Smrgesac
1428440cca4Smrg
1438440cca4Smrg### Let's recognize common machines as not being operating systems so
1448440cca4Smrg### that things like config.sub decstation-3100 work.  We also
1458440cca4Smrg### recognize some manufacturers as not being operating systems, so we
1468440cca4Smrg### can provide default operating systems below.
1478440cca4Smrgcase $os in
1488440cca4Smrg	-sun*os*)
1498440cca4Smrg		# Prevent following clause from handling this invalid input.
1508440cca4Smrg		;;
1518440cca4Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
1528440cca4Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
1538440cca4Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
1548440cca4Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1558440cca4Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1568440cca4Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
157d1c293acSmrg	-apple | -axis | -knuth | -cray | -microblaze)
1588440cca4Smrg		os=
1598440cca4Smrg		basic_machine=$1
1608440cca4Smrg		;;
16120915927Smrg	-bluegene*)
16220915927Smrg		os=-cnk
163d1c293acSmrg		;;
1648440cca4Smrg	-sim | -cisco | -oki | -wec | -winbond)
1658440cca4Smrg		os=
1668440cca4Smrg		basic_machine=$1
1678440cca4Smrg		;;
1688440cca4Smrg	-scout)
1698440cca4Smrg		;;
1708440cca4Smrg	-wrs)
1718440cca4Smrg		os=-vxworks
1728440cca4Smrg		basic_machine=$1
1738440cca4Smrg		;;
1748440cca4Smrg	-chorusos*)
1758440cca4Smrg		os=-chorusos
1768440cca4Smrg		basic_machine=$1
1778440cca4Smrg		;;
17820915927Smrg	-chorusrdb)
17920915927Smrg		os=-chorusrdb
1808440cca4Smrg		basic_machine=$1
18120915927Smrg		;;
1828440cca4Smrg	-hiux*)
1838440cca4Smrg		os=-hiuxwe2
1848440cca4Smrg		;;
185d1c293acSmrg	-sco6)
186d1c293acSmrg		os=-sco5v6
187d1c293acSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188d1c293acSmrg		;;
1898440cca4Smrg	-sco5)
1908440cca4Smrg		os=-sco3.2v5
1918440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1928440cca4Smrg		;;
1938440cca4Smrg	-sco4)
1948440cca4Smrg		os=-sco3.2v4
1958440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1968440cca4Smrg		;;
1978440cca4Smrg	-sco3.2.[4-9]*)
1988440cca4Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1998440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2008440cca4Smrg		;;
2018440cca4Smrg	-sco3.2v[4-9]*)
2028440cca4Smrg		# Don't forget version if it is 3.2v4 or newer.
2038440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2048440cca4Smrg		;;
205d1c293acSmrg	-sco5v6*)
206d1c293acSmrg		# Don't forget version if it is 3.2v4 or newer.
207d1c293acSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
208d1c293acSmrg		;;
2098440cca4Smrg	-sco*)
2108440cca4Smrg		os=-sco3.2v2
2118440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2128440cca4Smrg		;;
2138440cca4Smrg	-udk*)
2148440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2158440cca4Smrg		;;
2168440cca4Smrg	-isc)
2178440cca4Smrg		os=-isc2.2
2188440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2198440cca4Smrg		;;
2208440cca4Smrg	-clix*)
2218440cca4Smrg		basic_machine=clipper-intergraph
2228440cca4Smrg		;;
2238440cca4Smrg	-isc*)
2248440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2258440cca4Smrg		;;
2268440cca4Smrg	-lynx*)
2278440cca4Smrg		os=-lynxos
2288440cca4Smrg		;;
2298440cca4Smrg	-ptx*)
2308440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
2318440cca4Smrg		;;
2328440cca4Smrg	-windowsnt*)
2338440cca4Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
2348440cca4Smrg		;;
2358440cca4Smrg	-psos*)
2368440cca4Smrg		os=-psos
2378440cca4Smrg		;;
2388440cca4Smrg	-mint | -mint[0-9]*)
2398440cca4Smrg		basic_machine=m68k-atari
2408440cca4Smrg		os=-mint
2418440cca4Smrg		;;
2428440cca4Smrgesac
2438440cca4Smrg
2448440cca4Smrg# Decode aliases for certain CPU-COMPANY combinations.
2458440cca4Smrgcase $basic_machine in
2468440cca4Smrg	# Recognize the basic CPU types without company name.
2478440cca4Smrg	# Some are omitted here because they have special meanings below.
2488440cca4Smrg	1750a | 580 \
2498440cca4Smrg	| a29k \
2508440cca4Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
2518440cca4Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
252d1c293acSmrg	| am33_2.0 \
253d1c293acSmrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
25420915927Smrg        | be32 | be64 \
255d1c293acSmrg	| bfin \
2568440cca4Smrg	| c4x | clipper \
2578440cca4Smrg	| d10v | d30v | dlx | dsp16xx \
25820915927Smrg	| epiphany \
259d1c293acSmrg	| fido | fr30 | frv \
2608440cca4Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
26120915927Smrg	| hexagon \
2628440cca4Smrg	| i370 | i860 | i960 | ia64 \
263d1c293acSmrg	| ip2k | iq2000 \
26420915927Smrg	| le32 | le64 \
265d1c293acSmrg	| lm32 \
266d1c293acSmrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
267d1c293acSmrg	| maxq | mb | microblaze | mcore | mep | metag \
2688440cca4Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
2698440cca4Smrg	| mips16 \
2708440cca4Smrg	| mips64 | mips64el \
271d1c293acSmrg	| mips64octeon | mips64octeonel \
2728440cca4Smrg	| mips64orion | mips64orionel \
273d1c293acSmrg	| mips64r5900 | mips64r5900el \
274d1c293acSmrg	| mips64vr | mips64vrel \
2758440cca4Smrg	| mips64vr4100 | mips64vr4100el \
2768440cca4Smrg	| mips64vr4300 | mips64vr4300el \
2778440cca4Smrg	| mips64vr5000 | mips64vr5000el \
278d1c293acSmrg	| mips64vr5900 | mips64vr5900el \
2798440cca4Smrg	| mipsisa32 | mipsisa32el \
2808440cca4Smrg	| mipsisa32r2 | mipsisa32r2el \
2818440cca4Smrg	| mipsisa64 | mipsisa64el \
282d1c293acSmrg	| mipsisa64r2 | mipsisa64r2el \
2838440cca4Smrg	| mipsisa64sb1 | mipsisa64sb1el \
2848440cca4Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
2858440cca4Smrg	| mipstx39 | mipstx39el \
2868440cca4Smrg	| mn10200 | mn10300 \
287d1c293acSmrg	| moxie \
288d1c293acSmrg	| mt \
2898440cca4Smrg	| msp430 \
290d1c293acSmrg	| nds32 | nds32le | nds32be \
291d1c293acSmrg	| nios | nios2 \
2928440cca4Smrg	| ns16k | ns32k \
29320915927Smrg	| open8 \
294d1c293acSmrg	| or32 \
2958440cca4Smrg	| pdp10 | pdp11 | pj | pjl \
29620915927Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle \
2978440cca4Smrg	| pyramid \
29820915927Smrg	| rl78 | rx \
299d1c293acSmrg	| score \
300d1c293acSmrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
3018440cca4Smrg	| sh64 | sh64le \
302d1c293acSmrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
303d1c293acSmrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
30420915927Smrg	| spu \
30520915927Smrg	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
306d1c293acSmrg	| ubicom32 \
30720915927Smrg	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
3088440cca4Smrg	| we32k \
30920915927Smrg	| x86 | xc16x | xstormy16 | xtensa \
310d1c293acSmrg	| z8k | z80)
3118440cca4Smrg		basic_machine=$basic_machine-unknown
3128440cca4Smrg		;;
313d1c293acSmrg	c54x)
314d1c293acSmrg		basic_machine=tic54x-unknown
315d1c293acSmrg		;;
316d1c293acSmrg	c55x)
317d1c293acSmrg		basic_machine=tic55x-unknown
318d1c293acSmrg		;;
319d1c293acSmrg	c6x)
320d1c293acSmrg		basic_machine=tic6x-unknown
321d1c293acSmrg		;;
322d1c293acSmrg	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
3238440cca4Smrg		# Motorola 68HC11/12.
3248440cca4Smrg		basic_machine=$basic_machine-unknown
3258440cca4Smrg		os=-none
3268440cca4Smrg		;;
3278440cca4Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
3288440cca4Smrg		;;
329d1c293acSmrg	ms1)
330d1c293acSmrg		basic_machine=mt-unknown
331d1c293acSmrg		;;
3328440cca4Smrg
33320915927Smrg	strongarm | thumb | xscale)
33420915927Smrg		basic_machine=arm-unknown
33520915927Smrg		;;
33620915927Smrg
33720915927Smrg	xscaleeb)
33820915927Smrg		basic_machine=armeb-unknown
33920915927Smrg		;;
34020915927Smrg
34120915927Smrg	xscaleel)
34220915927Smrg		basic_machine=armel-unknown
34320915927Smrg		;;
34420915927Smrg
3458440cca4Smrg	# We use `pc' rather than `unknown'
3468440cca4Smrg	# because (1) that's what they normally are, and
3478440cca4Smrg	# (2) the word "unknown" tends to confuse beginning users.
3488440cca4Smrg	i*86 | x86_64)
3498440cca4Smrg	  basic_machine=$basic_machine-pc
3508440cca4Smrg	  ;;
3518440cca4Smrg	# Object if more than one company name word.
3528440cca4Smrg	*-*-*)
3538440cca4Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
3548440cca4Smrg		exit 1
3558440cca4Smrg		;;
3568440cca4Smrg	# Recognize the basic CPU types with company name.
3578440cca4Smrg	580-* \
3588440cca4Smrg	| a29k-* \
3598440cca4Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
3608440cca4Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
3618440cca4Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
3628440cca4Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
363d1c293acSmrg	| avr-* | avr32-* \
36420915927Smrg	| be32-* | be64-* \
365d1c293acSmrg	| bfin-* | bs2000-* \
366d1c293acSmrg	| c[123]* | c30-* | [cjt]90-* | c4x-* \
367d1c293acSmrg	| clipper-* | craynv-* | cydra-* \
3688440cca4Smrg	| d10v-* | d30v-* | dlx-* \
3698440cca4Smrg	| elxsi-* \
370d1c293acSmrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
3718440cca4Smrg	| h8300-* | h8500-* \
3728440cca4Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
37320915927Smrg	| hexagon-* \
3748440cca4Smrg	| i*86-* | i860-* | i960-* | ia64-* \
375d1c293acSmrg	| ip2k-* | iq2000-* \
37620915927Smrg	| le32-* | le64-* \
377d1c293acSmrg	| lm32-* \
378d1c293acSmrg	| m32c-* | m32r-* | m32rle-* \
3798440cca4Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
380d1c293acSmrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
3818440cca4Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
3828440cca4Smrg	| mips16-* \
3838440cca4Smrg	| mips64-* | mips64el-* \
384d1c293acSmrg	| mips64octeon-* | mips64octeonel-* \
3858440cca4Smrg	| mips64orion-* | mips64orionel-* \
386d1c293acSmrg	| mips64r5900-* | mips64r5900el-* \
387d1c293acSmrg	| mips64vr-* | mips64vrel-* \
3888440cca4Smrg	| mips64vr4100-* | mips64vr4100el-* \
3898440cca4Smrg	| mips64vr4300-* | mips64vr4300el-* \
3908440cca4Smrg	| mips64vr5000-* | mips64vr5000el-* \
391d1c293acSmrg	| mips64vr5900-* | mips64vr5900el-* \
3928440cca4Smrg	| mipsisa32-* | mipsisa32el-* \
3938440cca4Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
3948440cca4Smrg	| mipsisa64-* | mipsisa64el-* \
395d1c293acSmrg	| mipsisa64r2-* | mipsisa64r2el-* \
3968440cca4Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
3978440cca4Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
3988440cca4Smrg	| mipstx39-* | mipstx39el-* \
399d1c293acSmrg	| mmix-* \
400d1c293acSmrg	| mt-* \
4018440cca4Smrg	| msp430-* \
402d1c293acSmrg	| nds32-* | nds32le-* | nds32be-* \
403d1c293acSmrg	| nios-* | nios2-* \
404d1c293acSmrg	| none-* | np1-* | ns16k-* | ns32k-* \
40520915927Smrg	| open8-* \
4068440cca4Smrg	| orion-* \
4078440cca4Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
40820915927Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
4098440cca4Smrg	| pyramid-* \
41020915927Smrg	| rl78-* | romp-* | rs6000-* | rx-* \
411d1c293acSmrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
4128440cca4Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
413d1c293acSmrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
414d1c293acSmrg	| sparclite-* \
41520915927Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
41620915927Smrg	| tahoe-* \
4178440cca4Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
41820915927Smrg	| tile*-* \
4198440cca4Smrg	| tron-* \
420d1c293acSmrg	| ubicom32-* \
42120915927Smrg	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
42220915927Smrg	| vax-* \
4238440cca4Smrg	| we32k-* \
42420915927Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* \
425d1c293acSmrg	| xstormy16-* | xtensa*-* \
4268440cca4Smrg	| ymp-* \
427d1c293acSmrg	| z8k-* | z80-*)
428d1c293acSmrg		;;
429d1c293acSmrg	# Recognize the basic CPU types without company name, with glob match.
430d1c293acSmrg	xtensa*)
431d1c293acSmrg		basic_machine=$basic_machine-unknown
4328440cca4Smrg		;;
4338440cca4Smrg	# Recognize the various machine names and aliases which stand
4348440cca4Smrg	# for a CPU type and a company and sometimes even an OS.
4358440cca4Smrg	386bsd)
4368440cca4Smrg		basic_machine=i386-unknown
4378440cca4Smrg		os=-bsd
4388440cca4Smrg		;;
4398440cca4Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
4408440cca4Smrg		basic_machine=m68000-att
4418440cca4Smrg		;;
4428440cca4Smrg	3b*)
4438440cca4Smrg		basic_machine=we32k-att
4448440cca4Smrg		;;
4458440cca4Smrg	a29khif)
4468440cca4Smrg		basic_machine=a29k-amd
4478440cca4Smrg		os=-udi
4488440cca4Smrg		;;
44920915927Smrg	abacus)
450d1c293acSmrg		basic_machine=abacus-unknown
451d1c293acSmrg		;;
4528440cca4Smrg	adobe68k)
4538440cca4Smrg		basic_machine=m68010-adobe
4548440cca4Smrg		os=-scout
4558440cca4Smrg		;;
4568440cca4Smrg	alliant | fx80)
4578440cca4Smrg		basic_machine=fx80-alliant
4588440cca4Smrg		;;
4598440cca4Smrg	altos | altos3068)
4608440cca4Smrg		basic_machine=m68k-altos
4618440cca4Smrg		;;
4628440cca4Smrg	am29k)
4638440cca4Smrg		basic_machine=a29k-none
4648440cca4Smrg		os=-bsd
4658440cca4Smrg		;;
4668440cca4Smrg	amd64)
4678440cca4Smrg		basic_machine=x86_64-pc
4688440cca4Smrg		;;
469d1c293acSmrg	amd64-*)
470d1c293acSmrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
471d1c293acSmrg		;;
4728440cca4Smrg	amdahl)
4738440cca4Smrg		basic_machine=580-amdahl
4748440cca4Smrg		os=-sysv
4758440cca4Smrg		;;
4768440cca4Smrg	amiga | amiga-*)
4778440cca4Smrg		basic_machine=m68k-unknown
4788440cca4Smrg		;;
4798440cca4Smrg	amigaos | amigados)
4808440cca4Smrg		basic_machine=m68k-unknown
4818440cca4Smrg		os=-amigaos
4828440cca4Smrg		;;
4838440cca4Smrg	amigaunix | amix)
4848440cca4Smrg		basic_machine=m68k-unknown
4858440cca4Smrg		os=-sysv4
4868440cca4Smrg		;;
4878440cca4Smrg	apollo68)
4888440cca4Smrg		basic_machine=m68k-apollo
4898440cca4Smrg		os=-sysv
4908440cca4Smrg		;;
4918440cca4Smrg	apollo68bsd)
4928440cca4Smrg		basic_machine=m68k-apollo
4938440cca4Smrg		os=-bsd
4948440cca4Smrg		;;
495d1c293acSmrg	aros)
496d1c293acSmrg		basic_machine=i386-pc
497d1c293acSmrg		os=-aros
498d1c293acSmrg		;;
4998440cca4Smrg	aux)
5008440cca4Smrg		basic_machine=m68k-apple
5018440cca4Smrg		os=-aux
5028440cca4Smrg		;;
5038440cca4Smrg	balance)
5048440cca4Smrg		basic_machine=ns32k-sequent
5058440cca4Smrg		os=-dynix
5068440cca4Smrg		;;
507d1c293acSmrg	blackfin)
508d1c293acSmrg		basic_machine=bfin-unknown
509d1c293acSmrg		os=-linux
510d1c293acSmrg		;;
511d1c293acSmrg	blackfin-*)
512d1c293acSmrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
513d1c293acSmrg		os=-linux
514d1c293acSmrg		;;
515d1c293acSmrg	bluegene*)
516d1c293acSmrg		basic_machine=powerpc-ibm
517d1c293acSmrg		os=-cnk
518d1c293acSmrg		;;
519d1c293acSmrg	c54x-*)
520d1c293acSmrg		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
521d1c293acSmrg		;;
522d1c293acSmrg	c55x-*)
523d1c293acSmrg		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
524d1c293acSmrg		;;
525d1c293acSmrg	c6x-*)
526d1c293acSmrg		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
527d1c293acSmrg		;;
5288440cca4Smrg	c90)
5298440cca4Smrg		basic_machine=c90-cray
5308440cca4Smrg		os=-unicos
5318440cca4Smrg		;;
53220915927Smrg	cegcc)
533d1c293acSmrg		basic_machine=arm-unknown
534d1c293acSmrg		os=-cegcc
535d1c293acSmrg		;;
5368440cca4Smrg	convex-c1)
5378440cca4Smrg		basic_machine=c1-convex
5388440cca4Smrg		os=-bsd
5398440cca4Smrg		;;
5408440cca4Smrg	convex-c2)
5418440cca4Smrg		basic_machine=c2-convex
5428440cca4Smrg		os=-bsd
5438440cca4Smrg		;;
5448440cca4Smrg	convex-c32)
5458440cca4Smrg		basic_machine=c32-convex
5468440cca4Smrg		os=-bsd
5478440cca4Smrg		;;
5488440cca4Smrg	convex-c34)
5498440cca4Smrg		basic_machine=c34-convex
5508440cca4Smrg		os=-bsd
5518440cca4Smrg		;;
5528440cca4Smrg	convex-c38)
5538440cca4Smrg		basic_machine=c38-convex
5548440cca4Smrg		os=-bsd
5558440cca4Smrg		;;
5568440cca4Smrg	cray | j90)
5578440cca4Smrg		basic_machine=j90-cray
5588440cca4Smrg		os=-unicos
5598440cca4Smrg		;;
560d1c293acSmrg	craynv)
561d1c293acSmrg		basic_machine=craynv-cray
562d1c293acSmrg		os=-unicosmp
563d1c293acSmrg		;;
56420915927Smrg	cr16 | cr16-*)
565d1c293acSmrg		basic_machine=cr16-unknown
566d1c293acSmrg		os=-elf
567d1c293acSmrg		;;
5688440cca4Smrg	crds | unos)
5698440cca4Smrg		basic_machine=m68k-crds
5708440cca4Smrg		;;
571d1c293acSmrg	crisv32 | crisv32-* | etraxfs*)
572d1c293acSmrg		basic_machine=crisv32-axis
573d1c293acSmrg		;;
5748440cca4Smrg	cris | cris-* | etrax*)
5758440cca4Smrg		basic_machine=cris-axis
5768440cca4Smrg		;;
577d1c293acSmrg	crx)
578d1c293acSmrg		basic_machine=crx-unknown
579d1c293acSmrg		os=-elf
580d1c293acSmrg		;;
5818440cca4Smrg	da30 | da30-*)
5828440cca4Smrg		basic_machine=m68k-da30
5838440cca4Smrg		;;
5848440cca4Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
5858440cca4Smrg		basic_machine=mips-dec
5868440cca4Smrg		;;
5878440cca4Smrg	decsystem10* | dec10*)
5888440cca4Smrg		basic_machine=pdp10-dec
5898440cca4Smrg		os=-tops10
5908440cca4Smrg		;;
5918440cca4Smrg	decsystem20* | dec20*)
5928440cca4Smrg		basic_machine=pdp10-dec
5938440cca4Smrg		os=-tops20
5948440cca4Smrg		;;
5958440cca4Smrg	delta | 3300 | motorola-3300 | motorola-delta \
5968440cca4Smrg	      | 3300-motorola | delta-motorola)
5978440cca4Smrg		basic_machine=m68k-motorola
5988440cca4Smrg		;;
5998440cca4Smrg	delta88)
6008440cca4Smrg		basic_machine=m88k-motorola
6018440cca4Smrg		os=-sysv3
6028440cca4Smrg		;;
603d1c293acSmrg	dicos)
604d1c293acSmrg		basic_machine=i686-pc
605d1c293acSmrg		os=-dicos
606d1c293acSmrg		;;
607d1c293acSmrg	djgpp)
608d1c293acSmrg		basic_machine=i586-pc
609d1c293acSmrg		os=-msdosdjgpp
610d1c293acSmrg		;;
6118440cca4Smrg	dpx20 | dpx20-*)
6128440cca4Smrg		basic_machine=rs6000-bull
6138440cca4Smrg		os=-bosx
6148440cca4Smrg		;;
6158440cca4Smrg	dpx2* | dpx2*-bull)
6168440cca4Smrg		basic_machine=m68k-bull
6178440cca4Smrg		os=-sysv3
6188440cca4Smrg		;;
6198440cca4Smrg	ebmon29k)
6208440cca4Smrg		basic_machine=a29k-amd
6218440cca4Smrg		os=-ebmon
6228440cca4Smrg		;;
6238440cca4Smrg	elxsi)
6248440cca4Smrg		basic_machine=elxsi-elxsi
6258440cca4Smrg		os=-bsd
6268440cca4Smrg		;;
6278440cca4Smrg	encore | umax | mmax)
6288440cca4Smrg		basic_machine=ns32k-encore
6298440cca4Smrg		;;
6308440cca4Smrg	es1800 | OSE68k | ose68k | ose | OSE)
6318440cca4Smrg		basic_machine=m68k-ericsson
6328440cca4Smrg		os=-ose
6338440cca4Smrg		;;
6348440cca4Smrg	fx2800)
6358440cca4Smrg		basic_machine=i860-alliant
6368440cca4Smrg		;;
6378440cca4Smrg	genix)
6388440cca4Smrg		basic_machine=ns32k-ns
6398440cca4Smrg		;;
6408440cca4Smrg	gmicro)
6418440cca4Smrg		basic_machine=tron-gmicro
6428440cca4Smrg		os=-sysv
6438440cca4Smrg		;;
6448440cca4Smrg	go32)
6458440cca4Smrg		basic_machine=i386-pc
6468440cca4Smrg		os=-go32
6478440cca4Smrg		;;
6488440cca4Smrg	h3050r* | hiux*)
6498440cca4Smrg		basic_machine=hppa1.1-hitachi
6508440cca4Smrg		os=-hiuxwe2
6518440cca4Smrg		;;
6528440cca4Smrg	h8300hms)
6538440cca4Smrg		basic_machine=h8300-hitachi
6548440cca4Smrg		os=-hms
6558440cca4Smrg		;;
6568440cca4Smrg	h8300xray)
6578440cca4Smrg		basic_machine=h8300-hitachi
6588440cca4Smrg		os=-xray
6598440cca4Smrg		;;
6608440cca4Smrg	h8500hms)
6618440cca4Smrg		basic_machine=h8500-hitachi
6628440cca4Smrg		os=-hms
6638440cca4Smrg		;;
6648440cca4Smrg	harris)
6658440cca4Smrg		basic_machine=m88k-harris
6668440cca4Smrg		os=-sysv3
6678440cca4Smrg		;;
6688440cca4Smrg	hp300-*)
6698440cca4Smrg		basic_machine=m68k-hp
6708440cca4Smrg		;;
6718440cca4Smrg	hp300bsd)
6728440cca4Smrg		basic_machine=m68k-hp
6738440cca4Smrg		os=-bsd
6748440cca4Smrg		;;
6758440cca4Smrg	hp300hpux)
6768440cca4Smrg		basic_machine=m68k-hp
6778440cca4Smrg		os=-hpux
6788440cca4Smrg		;;
6798440cca4Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
6808440cca4Smrg		basic_machine=hppa1.0-hp
6818440cca4Smrg		;;
6828440cca4Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
6838440cca4Smrg		basic_machine=m68000-hp
6848440cca4Smrg		;;
6858440cca4Smrg	hp9k3[2-9][0-9])
6868440cca4Smrg		basic_machine=m68k-hp
6878440cca4Smrg		;;
6888440cca4Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
6898440cca4Smrg		basic_machine=hppa1.0-hp
6908440cca4Smrg		;;
6918440cca4Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
6928440cca4Smrg		basic_machine=hppa1.1-hp
6938440cca4Smrg		;;
6948440cca4Smrg	hp9k78[0-9] | hp78[0-9])
6958440cca4Smrg		# FIXME: really hppa2.0-hp
6968440cca4Smrg		basic_machine=hppa1.1-hp
6978440cca4Smrg		;;
6988440cca4Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
6998440cca4Smrg		# FIXME: really hppa2.0-hp
7008440cca4Smrg		basic_machine=hppa1.1-hp
7018440cca4Smrg		;;
7028440cca4Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
7038440cca4Smrg		basic_machine=hppa1.1-hp
7048440cca4Smrg		;;
7058440cca4Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
7068440cca4Smrg		basic_machine=hppa1.0-hp
7078440cca4Smrg		;;
7088440cca4Smrg	hppa-next)
7098440cca4Smrg		os=-nextstep3
7108440cca4Smrg		;;
7118440cca4Smrg	hppaosf)
7128440cca4Smrg		basic_machine=hppa1.1-hp
7138440cca4Smrg		os=-osf
7148440cca4Smrg		;;
7158440cca4Smrg	hppro)
7168440cca4Smrg		basic_machine=hppa1.1-hp
7178440cca4Smrg		os=-proelf
7188440cca4Smrg		;;
7198440cca4Smrg	i370-ibm* | ibm*)
7208440cca4Smrg		basic_machine=i370-ibm
7218440cca4Smrg		;;
7228440cca4Smrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
7238440cca4Smrg	i*86v32)
7248440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7258440cca4Smrg		os=-sysv32
7268440cca4Smrg		;;
7278440cca4Smrg	i*86v4*)
7288440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7298440cca4Smrg		os=-sysv4
7308440cca4Smrg		;;
7318440cca4Smrg	i*86v)
7328440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7338440cca4Smrg		os=-sysv
7348440cca4Smrg		;;
7358440cca4Smrg	i*86sol2)
7368440cca4Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7378440cca4Smrg		os=-solaris2
7388440cca4Smrg		;;
7398440cca4Smrg	i386mach)
7408440cca4Smrg		basic_machine=i386-mach
7418440cca4Smrg		os=-mach
7428440cca4Smrg		;;
7438440cca4Smrg	i386-vsta | vsta)
7448440cca4Smrg		basic_machine=i386-unknown
7458440cca4Smrg		os=-vsta
7468440cca4Smrg		;;
7478440cca4Smrg	iris | iris4d)
7488440cca4Smrg		basic_machine=mips-sgi
7498440cca4Smrg		case $os in
7508440cca4Smrg		    -irix*)
7518440cca4Smrg			;;
7528440cca4Smrg		    *)
7538440cca4Smrg			os=-irix4
7548440cca4Smrg			;;
7558440cca4Smrg		esac
7568440cca4Smrg		;;
7578440cca4Smrg	isi68 | isi)
7588440cca4Smrg		basic_machine=m68k-isi
7598440cca4Smrg		os=-sysv
7608440cca4Smrg		;;
761d1c293acSmrg	m68knommu)
762d1c293acSmrg		basic_machine=m68k-unknown
763d1c293acSmrg		os=-linux
764d1c293acSmrg		;;
765d1c293acSmrg	m68knommu-*)
766d1c293acSmrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
767d1c293acSmrg		os=-linux
768d1c293acSmrg		;;
7698440cca4Smrg	m88k-omron*)
7708440cca4Smrg		basic_machine=m88k-omron
7718440cca4Smrg		;;
7728440cca4Smrg	magnum | m3230)
7738440cca4Smrg		basic_machine=mips-mips
7748440cca4Smrg		os=-sysv
7758440cca4Smrg		;;
7768440cca4Smrg	merlin)
7778440cca4Smrg		basic_machine=ns32k-utek
7788440cca4Smrg		os=-sysv
7798440cca4Smrg		;;
78020915927Smrg	microblaze)
781d1c293acSmrg		basic_machine=microblaze-xilinx
782d1c293acSmrg		;;
7838440cca4Smrg	mingw32)
7848440cca4Smrg		basic_machine=i386-pc
7858440cca4Smrg		os=-mingw32
7868440cca4Smrg		;;
787d1c293acSmrg	mingw32ce)
788d1c293acSmrg		basic_machine=arm-unknown
789d1c293acSmrg		os=-mingw32ce
790d1c293acSmrg		;;
7918440cca4Smrg	miniframe)
7928440cca4Smrg		basic_machine=m68000-convergent
7938440cca4Smrg		;;
7948440cca4Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
7958440cca4Smrg		basic_machine=m68k-atari
7968440cca4Smrg		os=-mint
7978440cca4Smrg		;;
7988440cca4Smrg	mips3*-*)
7998440cca4Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
8008440cca4Smrg		;;
8018440cca4Smrg	mips3*)
8028440cca4Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
8038440cca4Smrg		;;
8048440cca4Smrg	monitor)
8058440cca4Smrg		basic_machine=m68k-rom68k
8068440cca4Smrg		os=-coff
8078440cca4Smrg		;;
8088440cca4Smrg	morphos)
8098440cca4Smrg		basic_machine=powerpc-unknown
8108440cca4Smrg		os=-morphos
8118440cca4Smrg		;;
8128440cca4Smrg	msdos)
8138440cca4Smrg		basic_machine=i386-pc
8148440cca4Smrg		os=-msdos
8158440cca4Smrg		;;
816d1c293acSmrg	ms1-*)
817d1c293acSmrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
818d1c293acSmrg		;;
81920915927Smrg	msys)
82020915927Smrg		basic_machine=i386-pc
82120915927Smrg		os=-msys
82220915927Smrg		;;
8238440cca4Smrg	mvs)
8248440cca4Smrg		basic_machine=i370-ibm
8258440cca4Smrg		os=-mvs
8268440cca4Smrg		;;
82720915927Smrg	nacl)
82820915927Smrg		basic_machine=le32-unknown
82920915927Smrg		os=-nacl
83020915927Smrg		;;
8318440cca4Smrg	ncr3000)
8328440cca4Smrg		basic_machine=i486-ncr
8338440cca4Smrg		os=-sysv4
8348440cca4Smrg		;;
8358440cca4Smrg	netbsd386)
8368440cca4Smrg		basic_machine=i386-unknown
8378440cca4Smrg		os=-netbsd
8388440cca4Smrg		;;
8398440cca4Smrg	netwinder)
8408440cca4Smrg		basic_machine=armv4l-rebel
8418440cca4Smrg		os=-linux
8428440cca4Smrg		;;
8438440cca4Smrg	news | news700 | news800 | news900)
8448440cca4Smrg		basic_machine=m68k-sony
8458440cca4Smrg		os=-newsos
8468440cca4Smrg		;;
8478440cca4Smrg	news1000)
8488440cca4Smrg		basic_machine=m68030-sony
8498440cca4Smrg		os=-newsos
8508440cca4Smrg		;;
8518440cca4Smrg	news-3600 | risc-news)
8528440cca4Smrg		basic_machine=mips-sony
8538440cca4Smrg		os=-newsos
8548440cca4Smrg		;;
8558440cca4Smrg	necv70)
8568440cca4Smrg		basic_machine=v70-nec
8578440cca4Smrg		os=-sysv
8588440cca4Smrg		;;
8598440cca4Smrg	next | m*-next )
8608440cca4Smrg		basic_machine=m68k-next
8618440cca4Smrg		case $os in
8628440cca4Smrg		    -nextstep* )
8638440cca4Smrg			;;
8648440cca4Smrg		    -ns2*)
8658440cca4Smrg		      os=-nextstep2
8668440cca4Smrg			;;
8678440cca4Smrg		    *)
8688440cca4Smrg		      os=-nextstep3
8698440cca4Smrg			;;
8708440cca4Smrg		esac
8718440cca4Smrg		;;
8728440cca4Smrg	nh3000)
8738440cca4Smrg		basic_machine=m68k-harris
8748440cca4Smrg		os=-cxux
8758440cca4Smrg		;;
8768440cca4Smrg	nh[45]000)
8778440cca4Smrg		basic_machine=m88k-harris
8788440cca4Smrg		os=-cxux
8798440cca4Smrg		;;
8808440cca4Smrg	nindy960)
8818440cca4Smrg		basic_machine=i960-intel
8828440cca4Smrg		os=-nindy
8838440cca4Smrg		;;
8848440cca4Smrg	mon960)
8858440cca4Smrg		basic_machine=i960-intel
8868440cca4Smrg		os=-mon960
8878440cca4Smrg		;;
8888440cca4Smrg	nonstopux)
8898440cca4Smrg		basic_machine=mips-compaq
8908440cca4Smrg		os=-nonstopux
8918440cca4Smrg		;;
8928440cca4Smrg	np1)
8938440cca4Smrg		basic_machine=np1-gould
8948440cca4Smrg		;;
89520915927Smrg	neo-tandem)
896d1c293acSmrg		basic_machine=neo-tandem
897d1c293acSmrg		;;
89820915927Smrg	nse-tandem)
899d1c293acSmrg		basic_machine=nse-tandem
9008440cca4Smrg		;;
9018440cca4Smrg	nsr-tandem)
9028440cca4Smrg		basic_machine=nsr-tandem
9038440cca4Smrg		;;
9048440cca4Smrg	op50n-* | op60c-*)
9058440cca4Smrg		basic_machine=hppa1.1-oki
9068440cca4Smrg		os=-proelf
9078440cca4Smrg		;;
908d1c293acSmrg	openrisc | openrisc-*)
9098440cca4Smrg		basic_machine=or32-unknown
910d1c293acSmrg		;;
911d1c293acSmrg	os400)
912d1c293acSmrg		basic_machine=powerpc-ibm
913d1c293acSmrg		os=-os400
9148440cca4Smrg		;;
9158440cca4Smrg	OSE68000 | ose68000)
9168440cca4Smrg		basic_machine=m68000-ericsson
9178440cca4Smrg		os=-ose
9188440cca4Smrg		;;
9198440cca4Smrg	os68k)
9208440cca4Smrg		basic_machine=m68k-none
9218440cca4Smrg		os=-os68k
9228440cca4Smrg		;;
9238440cca4Smrg	pa-hitachi)
9248440cca4Smrg		basic_machine=hppa1.1-hitachi
9258440cca4Smrg		os=-hiuxwe2
9268440cca4Smrg		;;
9278440cca4Smrg	paragon)
9288440cca4Smrg		basic_machine=i860-intel
9298440cca4Smrg		os=-osf
9308440cca4Smrg		;;
931d1c293acSmrg	parisc)
932d1c293acSmrg		basic_machine=hppa-unknown
933d1c293acSmrg		os=-linux
934d1c293acSmrg		;;
935d1c293acSmrg	parisc-*)
936d1c293acSmrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
937d1c293acSmrg		os=-linux
938d1c293acSmrg		;;
9398440cca4Smrg	pbd)
9408440cca4Smrg		basic_machine=sparc-tti
9418440cca4Smrg		;;
9428440cca4Smrg	pbb)
9438440cca4Smrg		basic_machine=m68k-tti
9448440cca4Smrg		;;
9458440cca4Smrg	pc532 | pc532-*)
9468440cca4Smrg		basic_machine=ns32k-pc532
9478440cca4Smrg		;;
948d1c293acSmrg	pc98)
949d1c293acSmrg		basic_machine=i386-pc
950d1c293acSmrg		;;
951d1c293acSmrg	pc98-*)
952d1c293acSmrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
953d1c293acSmrg		;;
9548440cca4Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
9558440cca4Smrg		basic_machine=i586-pc
9568440cca4Smrg		;;
9578440cca4Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
9588440cca4Smrg		basic_machine=i686-pc
9598440cca4Smrg		;;
9608440cca4Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
9618440cca4Smrg		basic_machine=i686-pc
9628440cca4Smrg		;;
9638440cca4Smrg	pentium4)
9648440cca4Smrg		basic_machine=i786-pc
9658440cca4Smrg		;;
9668440cca4Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
9678440cca4Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
9688440cca4Smrg		;;
9698440cca4Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
9708440cca4Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
9718440cca4Smrg		;;
9728440cca4Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
9738440cca4Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
9748440cca4Smrg		;;
9758440cca4Smrg	pentium4-*)
9768440cca4Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
9778440cca4Smrg		;;
9788440cca4Smrg	pn)
9798440cca4Smrg		basic_machine=pn-gould
9808440cca4Smrg		;;
9818440cca4Smrg	power)	basic_machine=power-ibm
9828440cca4Smrg		;;
98320915927Smrg	ppc | ppcbe)	basic_machine=powerpc-unknown
9848440cca4Smrg		;;
98520915927Smrg	ppc-* | ppcbe-*)
98620915927Smrg		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
9878440cca4Smrg		;;
9888440cca4Smrg	ppcle | powerpclittle | ppc-le | powerpc-little)
9898440cca4Smrg		basic_machine=powerpcle-unknown
9908440cca4Smrg		;;
9918440cca4Smrg	ppcle-* | powerpclittle-*)
9928440cca4Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
9938440cca4Smrg		;;
9948440cca4Smrg	ppc64)	basic_machine=powerpc64-unknown
9958440cca4Smrg		;;
9968440cca4Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
9978440cca4Smrg		;;
9988440cca4Smrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
9998440cca4Smrg		basic_machine=powerpc64le-unknown
10008440cca4Smrg		;;
10018440cca4Smrg	ppc64le-* | powerpc64little-*)
10028440cca4Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
10038440cca4Smrg		;;
10048440cca4Smrg	ps2)
10058440cca4Smrg		basic_machine=i386-ibm
10068440cca4Smrg		;;
10078440cca4Smrg	pw32)
10088440cca4Smrg		basic_machine=i586-unknown
10098440cca4Smrg		os=-pw32
10108440cca4Smrg		;;
1011d1c293acSmrg	rdos)
1012d1c293acSmrg		basic_machine=i386-pc
1013d1c293acSmrg		os=-rdos
1014d1c293acSmrg		;;
10158440cca4Smrg	rom68k)
10168440cca4Smrg		basic_machine=m68k-rom68k
10178440cca4Smrg		os=-coff
10188440cca4Smrg		;;
10198440cca4Smrg	rm[46]00)
10208440cca4Smrg		basic_machine=mips-siemens
10218440cca4Smrg		;;
10228440cca4Smrg	rtpc | rtpc-*)
10238440cca4Smrg		basic_machine=romp-ibm
10248440cca4Smrg		;;
1025d1c293acSmrg	s390 | s390-*)
1026d1c293acSmrg		basic_machine=s390-ibm
1027d1c293acSmrg		;;
1028d1c293acSmrg	s390x | s390x-*)
1029d1c293acSmrg		basic_machine=s390x-ibm
1030d1c293acSmrg		;;
10318440cca4Smrg	sa29200)
10328440cca4Smrg		basic_machine=a29k-amd
10338440cca4Smrg		os=-udi
10348440cca4Smrg		;;
10358440cca4Smrg	sb1)
10368440cca4Smrg		basic_machine=mipsisa64sb1-unknown
10378440cca4Smrg		;;
10388440cca4Smrg	sb1el)
10398440cca4Smrg		basic_machine=mipsisa64sb1el-unknown
10408440cca4Smrg		;;
1041d1c293acSmrg	sde)
1042d1c293acSmrg		basic_machine=mipsisa32-sde
1043d1c293acSmrg		os=-elf
1044d1c293acSmrg		;;
10458440cca4Smrg	sei)
10468440cca4Smrg		basic_machine=mips-sei
10478440cca4Smrg		os=-seiux
10488440cca4Smrg		;;
10498440cca4Smrg	sequent)
10508440cca4Smrg		basic_machine=i386-sequent
10518440cca4Smrg		;;
10528440cca4Smrg	sh)
10538440cca4Smrg		basic_machine=sh-hitachi
10548440cca4Smrg		os=-hms
10558440cca4Smrg		;;
1056d1c293acSmrg	sh5el)
1057d1c293acSmrg		basic_machine=sh5le-unknown
1058d1c293acSmrg		;;
10598440cca4Smrg	sh64)
10608440cca4Smrg		basic_machine=sh64-unknown
10618440cca4Smrg		;;
10628440cca4Smrg	sparclite-wrs | simso-wrs)
10638440cca4Smrg		basic_machine=sparclite-wrs
10648440cca4Smrg		os=-vxworks
10658440cca4Smrg		;;
10668440cca4Smrg	sps7)
10678440cca4Smrg		basic_machine=m68k-bull
10688440cca4Smrg		os=-sysv2
10698440cca4Smrg		;;
10708440cca4Smrg	spur)
10718440cca4Smrg		basic_machine=spur-unknown
10728440cca4Smrg		;;
10738440cca4Smrg	st2000)
10748440cca4Smrg		basic_machine=m68k-tandem
10758440cca4Smrg		;;
10768440cca4Smrg	stratus)
10778440cca4Smrg		basic_machine=i860-stratus
10788440cca4Smrg		os=-sysv4
10798440cca4Smrg		;;
108020915927Smrg	strongarm-* | thumb-*)
108120915927Smrg		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
108220915927Smrg		;;
10838440cca4Smrg	sun2)
10848440cca4Smrg		basic_machine=m68000-sun
10858440cca4Smrg		;;
10868440cca4Smrg	sun2os3)
10878440cca4Smrg		basic_machine=m68000-sun
10888440cca4Smrg		os=-sunos3
10898440cca4Smrg		;;
10908440cca4Smrg	sun2os4)
10918440cca4Smrg		basic_machine=m68000-sun
10928440cca4Smrg		os=-sunos4
10938440cca4Smrg		;;
10948440cca4Smrg	sun3os3)
10958440cca4Smrg		basic_machine=m68k-sun
10968440cca4Smrg		os=-sunos3
10978440cca4Smrg		;;
10988440cca4Smrg	sun3os4)
10998440cca4Smrg		basic_machine=m68k-sun
11008440cca4Smrg		os=-sunos4
11018440cca4Smrg		;;
11028440cca4Smrg	sun4os3)
11038440cca4Smrg		basic_machine=sparc-sun
11048440cca4Smrg		os=-sunos3
11058440cca4Smrg		;;
11068440cca4Smrg	sun4os4)
11078440cca4Smrg		basic_machine=sparc-sun
11088440cca4Smrg		os=-sunos4
11098440cca4Smrg		;;
11108440cca4Smrg	sun4sol2)
11118440cca4Smrg		basic_machine=sparc-sun
11128440cca4Smrg		os=-solaris2
11138440cca4Smrg		;;
11148440cca4Smrg	sun3 | sun3-*)
11158440cca4Smrg		basic_machine=m68k-sun
11168440cca4Smrg		;;
11178440cca4Smrg	sun4)
11188440cca4Smrg		basic_machine=sparc-sun
11198440cca4Smrg		;;
11208440cca4Smrg	sun386 | sun386i | roadrunner)
11218440cca4Smrg		basic_machine=i386-sun
11228440cca4Smrg		;;
11238440cca4Smrg	sv1)
11248440cca4Smrg		basic_machine=sv1-cray
11258440cca4Smrg		os=-unicos
11268440cca4Smrg		;;
11278440cca4Smrg	symmetry)
11288440cca4Smrg		basic_machine=i386-sequent
11298440cca4Smrg		os=-dynix
11308440cca4Smrg		;;
11318440cca4Smrg	t3e)
11328440cca4Smrg		basic_machine=alphaev5-cray
11338440cca4Smrg		os=-unicos
11348440cca4Smrg		;;
11358440cca4Smrg	t90)
11368440cca4Smrg		basic_machine=t90-cray
11378440cca4Smrg		os=-unicos
11388440cca4Smrg		;;
1139d1c293acSmrg	tile*)
114020915927Smrg		basic_machine=$basic_machine-unknown
1141d1c293acSmrg		os=-linux-gnu
11428440cca4Smrg		;;
11438440cca4Smrg	tx39)
11448440cca4Smrg		basic_machine=mipstx39-unknown
11458440cca4Smrg		;;
11468440cca4Smrg	tx39el)
11478440cca4Smrg		basic_machine=mipstx39el-unknown
11488440cca4Smrg		;;
11498440cca4Smrg	toad1)
11508440cca4Smrg		basic_machine=pdp10-xkl
11518440cca4Smrg		os=-tops20
11528440cca4Smrg		;;
11538440cca4Smrg	tower | tower-32)
11548440cca4Smrg		basic_machine=m68k-ncr
11558440cca4Smrg		;;
1156d1c293acSmrg	tpf)
1157d1c293acSmrg		basic_machine=s390x-ibm
1158d1c293acSmrg		os=-tpf
1159d1c293acSmrg		;;
11608440cca4Smrg	udi29k)
11618440cca4Smrg		basic_machine=a29k-amd
11628440cca4Smrg		os=-udi
11638440cca4Smrg		;;
11648440cca4Smrg	ultra3)
11658440cca4Smrg		basic_machine=a29k-nyu
11668440cca4Smrg		os=-sym1
11678440cca4Smrg		;;
11688440cca4Smrg	v810 | necv810)
11698440cca4Smrg		basic_machine=v810-nec
11708440cca4Smrg		os=-none
11718440cca4Smrg		;;
11728440cca4Smrg	vaxv)
11738440cca4Smrg		basic_machine=vax-dec
11748440cca4Smrg		os=-sysv
11758440cca4Smrg		;;
11768440cca4Smrg	vms)
11778440cca4Smrg		basic_machine=vax-dec
11788440cca4Smrg		os=-vms
11798440cca4Smrg		;;
11808440cca4Smrg	vpp*|vx|vx-*)
11818440cca4Smrg		basic_machine=f301-fujitsu
11828440cca4Smrg		;;
11838440cca4Smrg	vxworks960)
11848440cca4Smrg		basic_machine=i960-wrs
11858440cca4Smrg		os=-vxworks
11868440cca4Smrg		;;
11878440cca4Smrg	vxworks68)
11888440cca4Smrg		basic_machine=m68k-wrs
11898440cca4Smrg		os=-vxworks
11908440cca4Smrg		;;
11918440cca4Smrg	vxworks29k)
11928440cca4Smrg		basic_machine=a29k-wrs
11938440cca4Smrg		os=-vxworks
11948440cca4Smrg		;;
11958440cca4Smrg	w65*)
11968440cca4Smrg		basic_machine=w65-wdc
11978440cca4Smrg		os=-none
11988440cca4Smrg		;;
11998440cca4Smrg	w89k-*)
12008440cca4Smrg		basic_machine=hppa1.1-winbond
12018440cca4Smrg		os=-proelf
12028440cca4Smrg		;;
1203d1c293acSmrg	xbox)
1204d1c293acSmrg		basic_machine=i686-pc
1205d1c293acSmrg		os=-mingw32
1206d1c293acSmrg		;;
12078440cca4Smrg	xps | xps100)
12088440cca4Smrg		basic_machine=xps100-honeywell
12098440cca4Smrg		;;
121020915927Smrg	xscale-* | xscalee[bl]-*)
121120915927Smrg		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
121220915927Smrg		;;
12138440cca4Smrg	ymp)
12148440cca4Smrg		basic_machine=ymp-cray
12158440cca4Smrg		os=-unicos
12168440cca4Smrg		;;
12178440cca4Smrg	z8k-*-coff)
12188440cca4Smrg		basic_machine=z8k-unknown
12198440cca4Smrg		os=-sim
12208440cca4Smrg		;;
1221d1c293acSmrg	z80-*-coff)
1222d1c293acSmrg		basic_machine=z80-unknown
1223d1c293acSmrg		os=-sim
1224d1c293acSmrg		;;
12258440cca4Smrg	none)
12268440cca4Smrg		basic_machine=none-none
12278440cca4Smrg		os=-none
12288440cca4Smrg		;;
12298440cca4Smrg
12308440cca4Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
12318440cca4Smrg# some cases the only manufacturer, in others, it is the most popular.
12328440cca4Smrg	w89k)
12338440cca4Smrg		basic_machine=hppa1.1-winbond
12348440cca4Smrg		;;
12358440cca4Smrg	op50n)
12368440cca4Smrg		basic_machine=hppa1.1-oki
12378440cca4Smrg		;;
12388440cca4Smrg	op60c)
12398440cca4Smrg		basic_machine=hppa1.1-oki
12408440cca4Smrg		;;
12418440cca4Smrg	romp)
12428440cca4Smrg		basic_machine=romp-ibm
12438440cca4Smrg		;;
1244d1c293acSmrg	mmix)
1245d1c293acSmrg		basic_machine=mmix-knuth
1246d1c293acSmrg		;;
12478440cca4Smrg	rs6000)
12488440cca4Smrg		basic_machine=rs6000-ibm
12498440cca4Smrg		;;
12508440cca4Smrg	vax)
12518440cca4Smrg		basic_machine=vax-dec
12528440cca4Smrg		;;
12538440cca4Smrg	pdp10)
12548440cca4Smrg		# there are many clones, so DEC is not a safe bet
12558440cca4Smrg		basic_machine=pdp10-unknown
12568440cca4Smrg		;;
12578440cca4Smrg	pdp11)
12588440cca4Smrg		basic_machine=pdp11-dec
12598440cca4Smrg		;;
12608440cca4Smrg	we32k)
12618440cca4Smrg		basic_machine=we32k-att
12628440cca4Smrg		;;
1263d1c293acSmrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
12648440cca4Smrg		basic_machine=sh-unknown
12658440cca4Smrg		;;
1266d1c293acSmrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
12678440cca4Smrg		basic_machine=sparc-sun
12688440cca4Smrg		;;
12698440cca4Smrg	cydra)
12708440cca4Smrg		basic_machine=cydra-cydrome
12718440cca4Smrg		;;
12728440cca4Smrg	orion)
12738440cca4Smrg		basic_machine=orion-highlevel
12748440cca4Smrg		;;
12758440cca4Smrg	orion105)
12768440cca4Smrg		basic_machine=clipper-highlevel
12778440cca4Smrg		;;
12788440cca4Smrg	mac | mpw | mac-mpw)
12798440cca4Smrg		basic_machine=m68k-apple
12808440cca4Smrg		;;
12818440cca4Smrg	pmac | pmac-mpw)
12828440cca4Smrg		basic_machine=powerpc-apple
12838440cca4Smrg		;;
12848440cca4Smrg	*-unknown)
12858440cca4Smrg		# Make sure to match an already-canonicalized machine name.
12868440cca4Smrg		;;
12878440cca4Smrg	*)
12888440cca4Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
12898440cca4Smrg		exit 1
12908440cca4Smrg		;;
12918440cca4Smrgesac
12928440cca4Smrg
12938440cca4Smrg# Here we canonicalize certain aliases for manufacturers.
12948440cca4Smrgcase $basic_machine in
12958440cca4Smrg	*-digital*)
12968440cca4Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
12978440cca4Smrg		;;
12988440cca4Smrg	*-commodore*)
12998440cca4Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
13008440cca4Smrg		;;
13018440cca4Smrg	*)
13028440cca4Smrg		;;
13038440cca4Smrgesac
13048440cca4Smrg
13058440cca4Smrg# Decode manufacturer-specific aliases for certain operating systems.
13068440cca4Smrg
13078440cca4Smrgif [ x"$os" != x"" ]
13088440cca4Smrgthen
13098440cca4Smrgcase $os in
131020915927Smrg	# First match some system type aliases
131120915927Smrg	# that might get confused with valid system types.
13128440cca4Smrg	# -solaris* is a basic system type, with this one exception.
131320915927Smrg	-auroraux)
131420915927Smrg		os=-auroraux
1315d1c293acSmrg		;;
13168440cca4Smrg	-solaris1 | -solaris1.*)
13178440cca4Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
13188440cca4Smrg		;;
13198440cca4Smrg	-solaris)
13208440cca4Smrg		os=-solaris2
13218440cca4Smrg		;;
13228440cca4Smrg	-svr4*)
13238440cca4Smrg		os=-sysv4
13248440cca4Smrg		;;
13258440cca4Smrg	-unixware*)
13268440cca4Smrg		os=-sysv4.2uw
13278440cca4Smrg		;;
13288440cca4Smrg	-gnu/linux*)
13298440cca4Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
13308440cca4Smrg		;;
13318440cca4Smrg	# First accept the basic system types.
13328440cca4Smrg	# The portable systems comes first.
13338440cca4Smrg	# Each alternative MUST END IN A *, to match a version number.
13348440cca4Smrg	# -sysv* is not here because it comes later, after sysvr4.
13358440cca4Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1336d1c293acSmrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1337d1c293acSmrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1338d1c293acSmrg	      | -sym* | -kopensolaris* \
13398440cca4Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1340d1c293acSmrg	      | -aos* | -aros* \
13418440cca4Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
13428440cca4Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1343d1c293acSmrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1344d1c293acSmrg	      | -openbsd* | -solidbsd* \
1345d1c293acSmrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1346d1c293acSmrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13478440cca4Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
13488440cca4Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1349d1c293acSmrg	      | -chorusos* | -chorusrdb* | -cegcc* \
135020915927Smrg	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1351d1c293acSmrg	      | -mingw32* | -linux-gnu* | -linux-android* \
1352d1c293acSmrg	      | -linux-newlib* | -linux-uclibc* \
1353d1c293acSmrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
13548440cca4Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
13558440cca4Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13568440cca4Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13578440cca4Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13588440cca4Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1359d1c293acSmrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1360d1c293acSmrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
13618440cca4Smrg	# Remember, each alternative MUST END IN *, to match a version number.
13628440cca4Smrg		;;
13638440cca4Smrg	-qnx*)
13648440cca4Smrg		case $basic_machine in
13658440cca4Smrg		    x86-* | i*86-*)
13668440cca4Smrg			;;
13678440cca4Smrg		    *)
13688440cca4Smrg			os=-nto$os
13698440cca4Smrg			;;
13708440cca4Smrg		esac
13718440cca4Smrg		;;
13728440cca4Smrg	-nto-qnx*)
13738440cca4Smrg		;;
13748440cca4Smrg	-nto*)
13758440cca4Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
13768440cca4Smrg		;;
13778440cca4Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1378d1c293acSmrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
13798440cca4Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
13808440cca4Smrg		;;
13818440cca4Smrg	-mac*)
13828440cca4Smrg		os=`echo $os | sed -e 's|mac|macos|'`
13838440cca4Smrg		;;
1384d1c293acSmrg	-linux-dietlibc)
1385d1c293acSmrg		os=-linux-dietlibc
1386d1c293acSmrg		;;
13878440cca4Smrg	-linux*)
13888440cca4Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
13898440cca4Smrg		;;
13908440cca4Smrg	-sunos5*)
13918440cca4Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
13928440cca4Smrg		;;
13938440cca4Smrg	-sunos6*)
13948440cca4Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
13958440cca4Smrg		;;
13968440cca4Smrg	-opened*)
13978440cca4Smrg		os=-openedition
13988440cca4Smrg		;;
139920915927Smrg	-os400*)
1400d1c293acSmrg		os=-os400
1401d1c293acSmrg		;;
14028440cca4Smrg	-wince*)
14038440cca4Smrg		os=-wince
14048440cca4Smrg		;;
14058440cca4Smrg	-osfrose*)
14068440cca4Smrg		os=-osfrose
14078440cca4Smrg		;;
14088440cca4Smrg	-osf*)
14098440cca4Smrg		os=-osf
14108440cca4Smrg		;;
14118440cca4Smrg	-utek*)
14128440cca4Smrg		os=-bsd
14138440cca4Smrg		;;
14148440cca4Smrg	-dynix*)
14158440cca4Smrg		os=-bsd
14168440cca4Smrg		;;
14178440cca4Smrg	-acis*)
14188440cca4Smrg		os=-aos
14198440cca4Smrg		;;
14208440cca4Smrg	-atheos*)
14218440cca4Smrg		os=-atheos
14228440cca4Smrg		;;
1423d1c293acSmrg	-syllable*)
1424d1c293acSmrg		os=-syllable
1425d1c293acSmrg		;;
14268440cca4Smrg	-386bsd)
14278440cca4Smrg		os=-bsd
14288440cca4Smrg		;;
14298440cca4Smrg	-ctix* | -uts*)
14308440cca4Smrg		os=-sysv
14318440cca4Smrg		;;
14328440cca4Smrg	-nova*)
14338440cca4Smrg		os=-rtmk-nova
14348440cca4Smrg		;;
14358440cca4Smrg	-ns2 )
14368440cca4Smrg		os=-nextstep2
14378440cca4Smrg		;;
14388440cca4Smrg	-nsk*)
14398440cca4Smrg		os=-nsk
14408440cca4Smrg		;;
14418440cca4Smrg	# Preserve the version number of sinix5.
14428440cca4Smrg	-sinix5.*)
14438440cca4Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
14448440cca4Smrg		;;
14458440cca4Smrg	-sinix*)
14468440cca4Smrg		os=-sysv4
14478440cca4Smrg		;;
144820915927Smrg	-tpf*)
1449d1c293acSmrg		os=-tpf
1450d1c293acSmrg		;;
14518440cca4Smrg	-triton*)
14528440cca4Smrg		os=-sysv3
14538440cca4Smrg		;;
14548440cca4Smrg	-oss*)
14558440cca4Smrg		os=-sysv3
14568440cca4Smrg		;;
14578440cca4Smrg	-svr4)
14588440cca4Smrg		os=-sysv4
14598440cca4Smrg		;;
14608440cca4Smrg	-svr3)
14618440cca4Smrg		os=-sysv3
14628440cca4Smrg		;;
14638440cca4Smrg	-sysvr4)
14648440cca4Smrg		os=-sysv4
14658440cca4Smrg		;;
14668440cca4Smrg	# This must come after -sysvr4.
14678440cca4Smrg	-sysv*)
14688440cca4Smrg		;;
14698440cca4Smrg	-ose*)
14708440cca4Smrg		os=-ose
14718440cca4Smrg		;;
14728440cca4Smrg	-es1800*)
14738440cca4Smrg		os=-ose
14748440cca4Smrg		;;
14758440cca4Smrg	-xenix)
14768440cca4Smrg		os=-xenix
14778440cca4Smrg		;;
14788440cca4Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
14798440cca4Smrg		os=-mint
14808440cca4Smrg		;;
14818440cca4Smrg	-aros*)
14828440cca4Smrg		os=-aros
14838440cca4Smrg		;;
14848440cca4Smrg	-kaos*)
14858440cca4Smrg		os=-kaos
14868440cca4Smrg		;;
1487d1c293acSmrg	-zvmoe)
1488d1c293acSmrg		os=-zvmoe
1489d1c293acSmrg		;;
1490d1c293acSmrg	-dicos*)
1491d1c293acSmrg		os=-dicos
1492d1c293acSmrg		;;
149320915927Smrg	-nacl*)
149420915927Smrg		;;
14958440cca4Smrg	-none)
14968440cca4Smrg		;;
14978440cca4Smrg	*)
14988440cca4Smrg		# Get rid of the `-' at the beginning of $os.
14998440cca4Smrg		os=`echo $os | sed 's/[^-]*-//'`
15008440cca4Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
15018440cca4Smrg		exit 1
15028440cca4Smrg		;;
15038440cca4Smrgesac
15048440cca4Smrgelse
15058440cca4Smrg
15068440cca4Smrg# Here we handle the default operating systems that come with various machines.
15078440cca4Smrg# The value should be what the vendor currently ships out the door with their
15088440cca4Smrg# machine or put another way, the most popular os provided with the machine.
15098440cca4Smrg
15108440cca4Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
15118440cca4Smrg# "-sun"), then you have to tell the case statement up towards the top
15128440cca4Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
15138440cca4Smrg# will signal an error saying that MANUFACTURER isn't an operating
15148440cca4Smrg# system, and we'll never get to this point.
15158440cca4Smrg
15168440cca4Smrgcase $basic_machine in
151720915927Smrg	score-*)
1518d1c293acSmrg		os=-elf
1519d1c293acSmrg		;;
152020915927Smrg	spu-*)
1521d1c293acSmrg		os=-elf
1522d1c293acSmrg		;;
15238440cca4Smrg	*-acorn)
15248440cca4Smrg		os=-riscix1.2
15258440cca4Smrg		;;
15268440cca4Smrg	arm*-rebel)
15278440cca4Smrg		os=-linux
15288440cca4Smrg		;;
15298440cca4Smrg	arm*-semi)
15308440cca4Smrg		os=-aout
15318440cca4Smrg		;;
153220915927Smrg	c4x-* | tic4x-*)
153320915927Smrg		os=-coff
1534d1c293acSmrg		;;
1535d1c293acSmrg	tic54x-*)
1536d1c293acSmrg		os=-coff
1537d1c293acSmrg		;;
1538d1c293acSmrg	tic55x-*)
1539d1c293acSmrg		os=-coff
1540d1c293acSmrg		;;
1541d1c293acSmrg	tic6x-*)
15428440cca4Smrg		os=-coff
15438440cca4Smrg		;;
15448440cca4Smrg	# This must come before the *-dec entry.
15458440cca4Smrg	pdp10-*)
15468440cca4Smrg		os=-tops20
15478440cca4Smrg		;;
15488440cca4Smrg	pdp11-*)
15498440cca4Smrg		os=-none
15508440cca4Smrg		;;
15518440cca4Smrg	*-dec | vax-*)
15528440cca4Smrg		os=-ultrix4.2
15538440cca4Smrg		;;
15548440cca4Smrg	m68*-apollo)
15558440cca4Smrg		os=-domain
15568440cca4Smrg		;;
15578440cca4Smrg	i386-sun)
15588440cca4Smrg		os=-sunos4.0.2
15598440cca4Smrg		;;
15608440cca4Smrg	m68000-sun)
15618440cca4Smrg		os=-sunos3
15628440cca4Smrg		# This also exists in the configure program, but was not the
15638440cca4Smrg		# default.
15648440cca4Smrg		# os=-sunos4
15658440cca4Smrg		;;
15668440cca4Smrg	m68*-cisco)
15678440cca4Smrg		os=-aout
15688440cca4Smrg		;;
156920915927Smrg	mep-*)
1570d1c293acSmrg		os=-elf
1571d1c293acSmrg		;;
15728440cca4Smrg	mips*-cisco)
15738440cca4Smrg		os=-elf
15748440cca4Smrg		;;
15758440cca4Smrg	mips*-*)
15768440cca4Smrg		os=-elf
15778440cca4Smrg		;;
15788440cca4Smrg	or32-*)
15798440cca4Smrg		os=-coff
15808440cca4Smrg		;;
15818440cca4Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
15828440cca4Smrg		os=-sysv3
15838440cca4Smrg		;;
15848440cca4Smrg	sparc-* | *-sun)
15858440cca4Smrg		os=-sunos4.1.1
15868440cca4Smrg		;;
15878440cca4Smrg	*-be)
15888440cca4Smrg		os=-beos
15898440cca4Smrg		;;
1590d1c293acSmrg	*-haiku)
1591d1c293acSmrg		os=-haiku
1592d1c293acSmrg		;;
15938440cca4Smrg	*-ibm)
15948440cca4Smrg		os=-aix
15958440cca4Smrg		;;
159620915927Smrg	*-knuth)
1597d1c293acSmrg		os=-mmixware
1598d1c293acSmrg		;;
15998440cca4Smrg	*-wec)
16008440cca4Smrg		os=-proelf
16018440cca4Smrg		;;
16028440cca4Smrg	*-winbond)
16038440cca4Smrg		os=-proelf
16048440cca4Smrg		;;
16058440cca4Smrg	*-oki)
16068440cca4Smrg		os=-proelf
16078440cca4Smrg		;;
16088440cca4Smrg	*-hp)
16098440cca4Smrg		os=-hpux
16108440cca4Smrg		;;
16118440cca4Smrg	*-hitachi)
16128440cca4Smrg		os=-hiux
16138440cca4Smrg		;;
16148440cca4Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
16158440cca4Smrg		os=-sysv
16168440cca4Smrg		;;
16178440cca4Smrg	*-cbm)
16188440cca4Smrg		os=-amigaos
16198440cca4Smrg		;;
16208440cca4Smrg	*-dg)
16218440cca4Smrg		os=-dgux
16228440cca4Smrg		;;
16238440cca4Smrg	*-dolphin)
16248440cca4Smrg		os=-sysv3
16258440cca4Smrg		;;
16268440cca4Smrg	m68k-ccur)
16278440cca4Smrg		os=-rtu
16288440cca4Smrg		;;
16298440cca4Smrg	m88k-omron*)
16308440cca4Smrg		os=-luna
16318440cca4Smrg		;;
16328440cca4Smrg	*-next )
16338440cca4Smrg		os=-nextstep
16348440cca4Smrg		;;
16358440cca4Smrg	*-sequent)
16368440cca4Smrg		os=-ptx
16378440cca4Smrg		;;
16388440cca4Smrg	*-crds)
16398440cca4Smrg		os=-unos
16408440cca4Smrg		;;
16418440cca4Smrg	*-ns)
16428440cca4Smrg		os=-genix
16438440cca4Smrg		;;
16448440cca4Smrg	i370-*)
16458440cca4Smrg		os=-mvs
16468440cca4Smrg		;;
16478440cca4Smrg	*-next)
16488440cca4Smrg		os=-nextstep3
16498440cca4Smrg		;;
16508440cca4Smrg	*-gould)
16518440cca4Smrg		os=-sysv
16528440cca4Smrg		;;
16538440cca4Smrg	*-highlevel)
16548440cca4Smrg		os=-bsd
16558440cca4Smrg		;;
16568440cca4Smrg	*-encore)
16578440cca4Smrg		os=-bsd
16588440cca4Smrg		;;
16598440cca4Smrg	*-sgi)
16608440cca4Smrg		os=-irix
16618440cca4Smrg		;;
16628440cca4Smrg	*-siemens)
16638440cca4Smrg		os=-sysv4
16648440cca4Smrg		;;
16658440cca4Smrg	*-masscomp)
16668440cca4Smrg		os=-rtu
16678440cca4Smrg		;;
16688440cca4Smrg	f30[01]-fujitsu | f700-fujitsu)
16698440cca4Smrg		os=-uxpv
16708440cca4Smrg		;;
16718440cca4Smrg	*-rom68k)
16728440cca4Smrg		os=-coff
16738440cca4Smrg		;;
16748440cca4Smrg	*-*bug)
16758440cca4Smrg		os=-coff
16768440cca4Smrg		;;
16778440cca4Smrg	*-apple)
16788440cca4Smrg		os=-macos
16798440cca4Smrg		;;
16808440cca4Smrg	*-atari*)
16818440cca4Smrg		os=-mint
16828440cca4Smrg		;;
16838440cca4Smrg	*)
16848440cca4Smrg		os=-none
16858440cca4Smrg		;;
16868440cca4Smrgesac
16878440cca4Smrgfi
16888440cca4Smrg
16898440cca4Smrg# Here we handle the case where we know the os, and the CPU type, but not the
16908440cca4Smrg# manufacturer.  We pick the logical manufacturer.
16918440cca4Smrgvendor=unknown
16928440cca4Smrgcase $basic_machine in
16938440cca4Smrg	*-unknown)
16948440cca4Smrg		case $os in
16958440cca4Smrg			-riscix*)
16968440cca4Smrg				vendor=acorn
16978440cca4Smrg				;;
16988440cca4Smrg			-sunos*)
16998440cca4Smrg				vendor=sun
17008440cca4Smrg				;;
1701d1c293acSmrg			-cnk*|-aix*)
17028440cca4Smrg				vendor=ibm
17038440cca4Smrg				;;
17048440cca4Smrg			-beos*)
17058440cca4Smrg				vendor=be
17068440cca4Smrg				;;
17078440cca4Smrg			-hpux*)
17088440cca4Smrg				vendor=hp
17098440cca4Smrg				;;
17108440cca4Smrg			-mpeix*)
17118440cca4Smrg				vendor=hp
17128440cca4Smrg				;;
17138440cca4Smrg			-hiux*)
17148440cca4Smrg				vendor=hitachi
17158440cca4Smrg				;;
17168440cca4Smrg			-unos*)
17178440cca4Smrg				vendor=crds
17188440cca4Smrg				;;
17198440cca4Smrg			-dgux*)
17208440cca4Smrg				vendor=dg
17218440cca4Smrg				;;
17228440cca4Smrg			-luna*)
17238440cca4Smrg				vendor=omron
17248440cca4Smrg				;;
17258440cca4Smrg			-genix*)
17268440cca4Smrg				vendor=ns
17278440cca4Smrg				;;
17288440cca4Smrg			-mvs* | -opened*)
17298440cca4Smrg				vendor=ibm
17308440cca4Smrg				;;
1731d1c293acSmrg			-os400*)
1732d1c293acSmrg				vendor=ibm
1733d1c293acSmrg				;;
17348440cca4Smrg			-ptx*)
17358440cca4Smrg				vendor=sequent
17368440cca4Smrg				;;
1737d1c293acSmrg			-tpf*)
1738d1c293acSmrg				vendor=ibm
1739d1c293acSmrg				;;
17408440cca4Smrg			-vxsim* | -vxworks* | -windiss*)
17418440cca4Smrg				vendor=wrs
17428440cca4Smrg				;;
17438440cca4Smrg			-aux*)
17448440cca4Smrg				vendor=apple
17458440cca4Smrg				;;
17468440cca4Smrg			-hms*)
17478440cca4Smrg				vendor=hitachi
17488440cca4Smrg				;;
17498440cca4Smrg			-mpw* | -macos*)
17508440cca4Smrg				vendor=apple
17518440cca4Smrg				;;
17528440cca4Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
17538440cca4Smrg				vendor=atari
17548440cca4Smrg				;;
17558440cca4Smrg			-vos*)
17568440cca4Smrg				vendor=stratus
17578440cca4Smrg				;;
17588440cca4Smrg		esac
17598440cca4Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
17608440cca4Smrg		;;
17618440cca4Smrgesac
17628440cca4Smrg
17638440cca4Smrgecho $basic_machine$os
1764d1c293acSmrgexit
17658440cca4Smrg
17668440cca4Smrg# Local variables:
17678440cca4Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
17688440cca4Smrg# time-stamp-start: "timestamp='"
17698440cca4Smrg# time-stamp-format: "%:y-%02m-%02d"
17708440cca4Smrg# time-stamp-end: "'"
17718440cca4Smrg# End:
1772