config.sub revision 9586ba5a
176888252Smrg#! /bin/sh
276888252Smrg# Configuration validation subroutine script.
39586ba5aSmrg#   Copyright 1992-2014 Free Software Foundation, Inc.
476888252Smrg
59586ba5aSmrgtimestamp='2014-09-11'
676888252Smrg
79586ba5aSmrg# This file is free software; you can redistribute it and/or modify it
89586ba5aSmrg# under the terms of the GNU General Public License as published by
99586ba5aSmrg# the Free Software Foundation; either version 3 of the License, or
1076888252Smrg# (at your option) any later version.
1176888252Smrg#
129586ba5aSmrg# This program is distributed in the hope that it will be useful, but
139586ba5aSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
149586ba5aSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
159586ba5aSmrg# General Public License for more details.
1676888252Smrg#
1776888252Smrg# You should have received a copy of the GNU General Public License
1863847c39Smrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
191ae1b5e8Smrg#
2076888252Smrg# As a special exception to the GNU General Public License, if you
2176888252Smrg# distribute this file as part of a program that contains a
2276888252Smrg# configuration script generated by Autoconf, you may include it under
239586ba5aSmrg# the same distribution terms that you use for the rest of that
249586ba5aSmrg# program.  This Exception is an additional permission under section 7
259586ba5aSmrg# of the GNU General Public License, version 3 ("GPLv3").
2676888252Smrg
271ae1b5e8Smrg
289586ba5aSmrg# Please send patches with a ChangeLog entry to config-patches@gnu.org.
2976888252Smrg#
3076888252Smrg# Configuration subroutine to validate and canonicalize a configuration type.
3176888252Smrg# Supply the specified configuration type as an argument.
3276888252Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
3376888252Smrg# Otherwise, we print the canonical config type on stdout and succeed.
3476888252Smrg
3563847c39Smrg# You can get the latest version of this script from:
3663847c39Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
3763847c39Smrg
3876888252Smrg# This file is supposed to be the same for all GNU packages
3976888252Smrg# and recognize all the CPU types, system types and aliases
4076888252Smrg# that are meaningful with *any* GNU software.
4176888252Smrg# Each package is responsible for reporting which valid configurations
4276888252Smrg# it does not support.  The user should be able to distinguish
4376888252Smrg# a failure to support a valid configuration from a meaningless
4476888252Smrg# configuration.
4576888252Smrg
4676888252Smrg# The goal of this file is to map all the various variations of a given
4776888252Smrg# machine specification into a single specification in the form:
4876888252Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
4976888252Smrg# or in some cases, the newer four-part form:
5076888252Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5176888252Smrg# It is wrong to echo any other type of specification.
5276888252Smrg
5376888252Smrgme=`echo "$0" | sed -e 's,.*/,,'`
5476888252Smrg
5576888252Smrgusage="\
5676888252SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
5776888252Smrg       $0 [OPTION] ALIAS
5876888252Smrg
5976888252SmrgCanonicalize a configuration name.
6076888252Smrg
6176888252SmrgOperation modes:
6276888252Smrg  -h, --help         print this help, then exit
6376888252Smrg  -t, --time-stamp   print date of last modification, then exit
6476888252Smrg  -v, --version      print version number, then exit
6576888252Smrg
6676888252SmrgReport bugs and patches to <config-patches@gnu.org>."
6776888252Smrg
6876888252Smrgversion="\
6976888252SmrgGNU config.sub ($timestamp)
7076888252Smrg
719586ba5aSmrgCopyright 1992-2014 Free Software Foundation, Inc.
7276888252Smrg
7376888252SmrgThis is free software; see the source for copying conditions.  There is NO
7476888252Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
7576888252Smrg
7676888252Smrghelp="
7776888252SmrgTry \`$me --help' for more information."
7876888252Smrg
7976888252Smrg# Parse command line
8076888252Smrgwhile test $# -gt 0 ; do
8176888252Smrg  case $1 in
8276888252Smrg    --time-stamp | --time* | -t )
831ae1b5e8Smrg       echo "$timestamp" ; exit ;;
8476888252Smrg    --version | -v )
851ae1b5e8Smrg       echo "$version" ; exit ;;
8676888252Smrg    --help | --h* | -h )
871ae1b5e8Smrg       echo "$usage"; exit ;;
8876888252Smrg    -- )     # Stop option processing
8976888252Smrg       shift; break ;;
9076888252Smrg    - )	# Use stdin as input.
9176888252Smrg       break ;;
9276888252Smrg    -* )
9376888252Smrg       echo "$me: invalid option $1$help"
9476888252Smrg       exit 1 ;;
9576888252Smrg
9676888252Smrg    *local*)
9776888252Smrg       # First pass through any local machine types.
9876888252Smrg       echo $1
991ae1b5e8Smrg       exit ;;
10076888252Smrg
10176888252Smrg    * )
10276888252Smrg       break ;;
10376888252Smrg  esac
10476888252Smrgdone
10576888252Smrg
10676888252Smrgcase $# in
10776888252Smrg 0) echo "$me: missing argument$help" >&2
10876888252Smrg    exit 1;;
10976888252Smrg 1) ;;
11076888252Smrg *) echo "$me: too many arguments$help" >&2
11176888252Smrg    exit 1;;
11276888252Smrgesac
11376888252Smrg
11476888252Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
11576888252Smrg# Here we must recognize all the valid KERNEL-OS combinations.
11676888252Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
11776888252Smrgcase $maybe_os in
11863847c39Smrg  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
1199586ba5aSmrg  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
12063847c39Smrg  knetbsd*-gnu* | netbsd*-gnu* | \
12163847c39Smrg  kopensolaris*-gnu* | \
1221ae1b5e8Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
12376888252Smrg    os=-$maybe_os
12476888252Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
12576888252Smrg    ;;
12663847c39Smrg  android-linux)
12763847c39Smrg    os=-linux-android
12863847c39Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
12963847c39Smrg    ;;
13076888252Smrg  *)
13176888252Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
13276888252Smrg    if [ $basic_machine != $1 ]
13376888252Smrg    then os=`echo $1 | sed 's/.*-/-/'`
13476888252Smrg    else os=; fi
13576888252Smrg    ;;
13676888252Smrgesac
13776888252Smrg
13876888252Smrg### Let's recognize common machines as not being operating systems so
13976888252Smrg### that things like config.sub decstation-3100 work.  We also
14076888252Smrg### recognize some manufacturers as not being operating systems, so we
14176888252Smrg### can provide default operating systems below.
14276888252Smrgcase $os in
14376888252Smrg	-sun*os*)
14476888252Smrg		# Prevent following clause from handling this invalid input.
14576888252Smrg		;;
14676888252Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
14776888252Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
14876888252Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
14976888252Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
15076888252Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
15176888252Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
1529586ba5aSmrg	-apple | -axis | -knuth | -cray | -microblaze*)
15376888252Smrg		os=
15476888252Smrg		basic_machine=$1
15576888252Smrg		;;
15663847c39Smrg	-bluegene*)
15763847c39Smrg		os=-cnk
15863847c39Smrg		;;
15976888252Smrg	-sim | -cisco | -oki | -wec | -winbond)
16076888252Smrg		os=
16176888252Smrg		basic_machine=$1
16276888252Smrg		;;
16376888252Smrg	-scout)
16476888252Smrg		;;
16576888252Smrg	-wrs)
16676888252Smrg		os=-vxworks
16776888252Smrg		basic_machine=$1
16876888252Smrg		;;
16976888252Smrg	-chorusos*)
17076888252Smrg		os=-chorusos
17176888252Smrg		basic_machine=$1
17276888252Smrg		;;
17363847c39Smrg	-chorusrdb)
17463847c39Smrg		os=-chorusrdb
17576888252Smrg		basic_machine=$1
17663847c39Smrg		;;
17776888252Smrg	-hiux*)
17876888252Smrg		os=-hiuxwe2
17976888252Smrg		;;
1801ae1b5e8Smrg	-sco6)
1811ae1b5e8Smrg		os=-sco5v6
1821ae1b5e8Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1831ae1b5e8Smrg		;;
18476888252Smrg	-sco5)
18576888252Smrg		os=-sco3.2v5
18676888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18776888252Smrg		;;
18876888252Smrg	-sco4)
18976888252Smrg		os=-sco3.2v4
19076888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19176888252Smrg		;;
19276888252Smrg	-sco3.2.[4-9]*)
19376888252Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
19476888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19576888252Smrg		;;
19676888252Smrg	-sco3.2v[4-9]*)
19776888252Smrg		# Don't forget version if it is 3.2v4 or newer.
19876888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19976888252Smrg		;;
2001ae1b5e8Smrg	-sco5v6*)
2011ae1b5e8Smrg		# Don't forget version if it is 3.2v4 or newer.
2021ae1b5e8Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2031ae1b5e8Smrg		;;
20476888252Smrg	-sco*)
20576888252Smrg		os=-sco3.2v2
20676888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20776888252Smrg		;;
20876888252Smrg	-udk*)
20976888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21076888252Smrg		;;
21176888252Smrg	-isc)
21276888252Smrg		os=-isc2.2
21376888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21476888252Smrg		;;
21576888252Smrg	-clix*)
21676888252Smrg		basic_machine=clipper-intergraph
21776888252Smrg		;;
21876888252Smrg	-isc*)
21976888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
22076888252Smrg		;;
2219586ba5aSmrg	-lynx*178)
2229586ba5aSmrg		os=-lynxos178
2239586ba5aSmrg		;;
2249586ba5aSmrg	-lynx*5)
2259586ba5aSmrg		os=-lynxos5
2269586ba5aSmrg		;;
22776888252Smrg	-lynx*)
22876888252Smrg		os=-lynxos
22976888252Smrg		;;
23076888252Smrg	-ptx*)
23176888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
23276888252Smrg		;;
23376888252Smrg	-windowsnt*)
23476888252Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
23576888252Smrg		;;
23676888252Smrg	-psos*)
23776888252Smrg		os=-psos
23876888252Smrg		;;
23976888252Smrg	-mint | -mint[0-9]*)
24076888252Smrg		basic_machine=m68k-atari
24176888252Smrg		os=-mint
24276888252Smrg		;;
24376888252Smrgesac
24476888252Smrg
24576888252Smrg# Decode aliases for certain CPU-COMPANY combinations.
24676888252Smrgcase $basic_machine in
24776888252Smrg	# Recognize the basic CPU types without company name.
24876888252Smrg	# Some are omitted here because they have special meanings below.
24976888252Smrg	1750a | 580 \
25076888252Smrg	| a29k \
25163847c39Smrg	| aarch64 | aarch64_be \
25276888252Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
25376888252Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
2541ae1b5e8Smrg	| am33_2.0 \
2559586ba5aSmrg	| arc | arceb \
2569586ba5aSmrg	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
2579586ba5aSmrg	| avr | avr32 \
2589586ba5aSmrg	| be32 | be64 \
2591ae1b5e8Smrg	| bfin \
2609586ba5aSmrg	| c4x | c8051 | clipper \
26176888252Smrg	| d10v | d30v | dlx | dsp16xx \
26263847c39Smrg	| epiphany \
2631ae1b5e8Smrg	| fido | fr30 | frv \
26476888252Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
26563847c39Smrg	| hexagon \
26676888252Smrg	| i370 | i860 | i960 | ia64 \
2671ae1b5e8Smrg	| ip2k | iq2000 \
2689586ba5aSmrg	| k1om \
26963847c39Smrg	| le32 | le64 \
27063847c39Smrg	| lm32 \
2711ae1b5e8Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
2729586ba5aSmrg	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
27376888252Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
27476888252Smrg	| mips16 \
27576888252Smrg	| mips64 | mips64el \
27663847c39Smrg	| mips64octeon | mips64octeonel \
277d8556812Smrg	| mips64orion | mips64orionel \
27863847c39Smrg	| mips64r5900 | mips64r5900el \
27963847c39Smrg	| mips64vr | mips64vrel \
28076888252Smrg	| mips64vr4100 | mips64vr4100el \
28176888252Smrg	| mips64vr4300 | mips64vr4300el \
28276888252Smrg	| mips64vr5000 | mips64vr5000el \
2831ae1b5e8Smrg	| mips64vr5900 | mips64vr5900el \
28476888252Smrg	| mipsisa32 | mipsisa32el \
28576888252Smrg	| mipsisa32r2 | mipsisa32r2el \
2869586ba5aSmrg	| mipsisa32r6 | mipsisa32r6el \
28776888252Smrg	| mipsisa64 | mipsisa64el \
2881ae1b5e8Smrg	| mipsisa64r2 | mipsisa64r2el \
2899586ba5aSmrg	| mipsisa64r6 | mipsisa64r6el \
29076888252Smrg	| mipsisa64sb1 | mipsisa64sb1el \
29176888252Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
2929586ba5aSmrg	| mipsr5900 | mipsr5900el \
29376888252Smrg	| mipstx39 | mipstx39el \
29476888252Smrg	| mn10200 | mn10300 \
29563847c39Smrg	| moxie \
2961ae1b5e8Smrg	| mt \
29776888252Smrg	| msp430 \
29863847c39Smrg	| nds32 | nds32le | nds32be \
2999586ba5aSmrg	| nios | nios2 | nios2eb | nios2el \
30076888252Smrg	| ns16k | ns32k \
3019586ba5aSmrg	| open8 | or1k | or1knd | or32 \
30276888252Smrg	| pdp10 | pdp11 | pj | pjl \
30363847c39Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle \
30476888252Smrg	| pyramid \
3059586ba5aSmrg	| riscv32 | riscv64 \
30663847c39Smrg	| rl78 | rx \
3071ae1b5e8Smrg	| score \
30863847c39Smrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
30976888252Smrg	| sh64 | sh64le \
3101ae1b5e8Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
3111ae1b5e8Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
31263847c39Smrg	| spu \
31363847c39Smrg	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
31463847c39Smrg	| ubicom32 \
31563847c39Smrg	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
31676888252Smrg	| we32k \
31763847c39Smrg	| x86 | xc16x | xstormy16 | xtensa \
31863847c39Smrg	| z8k | z80)
31976888252Smrg		basic_machine=$basic_machine-unknown
32076888252Smrg		;;
32163847c39Smrg	c54x)
32263847c39Smrg		basic_machine=tic54x-unknown
32363847c39Smrg		;;
32463847c39Smrg	c55x)
32563847c39Smrg		basic_machine=tic55x-unknown
32663847c39Smrg		;;
32763847c39Smrg	c6x)
32863847c39Smrg		basic_machine=tic6x-unknown
32963847c39Smrg		;;
3309586ba5aSmrg	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
33176888252Smrg		basic_machine=$basic_machine-unknown
33276888252Smrg		os=-none
33376888252Smrg		;;
33476888252Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
33576888252Smrg		;;
3361ae1b5e8Smrg	ms1)
3371ae1b5e8Smrg		basic_machine=mt-unknown
3381ae1b5e8Smrg		;;
33976888252Smrg
34063847c39Smrg	strongarm | thumb | xscale)
34163847c39Smrg		basic_machine=arm-unknown
34263847c39Smrg		;;
34363847c39Smrg	xgate)
34463847c39Smrg		basic_machine=$basic_machine-unknown
34563847c39Smrg		os=-none
34663847c39Smrg		;;
34763847c39Smrg	xscaleeb)
34863847c39Smrg		basic_machine=armeb-unknown
34963847c39Smrg		;;
35063847c39Smrg
35163847c39Smrg	xscaleel)
35263847c39Smrg		basic_machine=armel-unknown
35363847c39Smrg		;;
35463847c39Smrg
35576888252Smrg	# We use `pc' rather than `unknown'
35676888252Smrg	# because (1) that's what they normally are, and
35776888252Smrg	# (2) the word "unknown" tends to confuse beginning users.
35876888252Smrg	i*86 | x86_64)
35976888252Smrg	  basic_machine=$basic_machine-pc
36076888252Smrg	  ;;
36176888252Smrg	# Object if more than one company name word.
36276888252Smrg	*-*-*)
36376888252Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
36476888252Smrg		exit 1
36576888252Smrg		;;
36676888252Smrg	# Recognize the basic CPU types with company name.
36776888252Smrg	580-* \
36876888252Smrg	| a29k-* \
36963847c39Smrg	| aarch64-* | aarch64_be-* \
37076888252Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
37176888252Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
3729586ba5aSmrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
37376888252Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3741ae1b5e8Smrg	| avr-* | avr32-* \
37563847c39Smrg	| be32-* | be64-* \
3761ae1b5e8Smrg	| bfin-* | bs2000-* \
37763847c39Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* \
3789586ba5aSmrg	| c8051-* | clipper-* | craynv-* | cydra-* \
37976888252Smrg	| d10v-* | d30v-* | dlx-* \
38076888252Smrg	| elxsi-* \
3811ae1b5e8Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
38276888252Smrg	| h8300-* | h8500-* \
38376888252Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
38463847c39Smrg	| hexagon-* \
38576888252Smrg	| i*86-* | i860-* | i960-* | ia64-* \
3861ae1b5e8Smrg	| ip2k-* | iq2000-* \
3879586ba5aSmrg	| k1om-* \
38863847c39Smrg	| le32-* | le64-* \
38963847c39Smrg	| lm32-* \
3901ae1b5e8Smrg	| m32c-* | m32r-* | m32rle-* \
39176888252Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
3929586ba5aSmrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
3939586ba5aSmrg	| microblaze-* | microblazeel-* \
39476888252Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
39576888252Smrg	| mips16-* \
39676888252Smrg	| mips64-* | mips64el-* \
39763847c39Smrg	| mips64octeon-* | mips64octeonel-* \
398d8556812Smrg	| mips64orion-* | mips64orionel-* \
39963847c39Smrg	| mips64r5900-* | mips64r5900el-* \
40063847c39Smrg	| mips64vr-* | mips64vrel-* \
40176888252Smrg	| mips64vr4100-* | mips64vr4100el-* \
40276888252Smrg	| mips64vr4300-* | mips64vr4300el-* \
40376888252Smrg	| mips64vr5000-* | mips64vr5000el-* \
4041ae1b5e8Smrg	| mips64vr5900-* | mips64vr5900el-* \
40576888252Smrg	| mipsisa32-* | mipsisa32el-* \
40676888252Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
4079586ba5aSmrg	| mipsisa32r6-* | mipsisa32r6el-* \
40876888252Smrg	| mipsisa64-* | mipsisa64el-* \
4091ae1b5e8Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
4109586ba5aSmrg	| mipsisa64r6-* | mipsisa64r6el-* \
41176888252Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
41276888252Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
4139586ba5aSmrg	| mipsr5900-* | mipsr5900el-* \
41476888252Smrg	| mipstx39-* | mipstx39el-* \
4151ae1b5e8Smrg	| mmix-* \
4161ae1b5e8Smrg	| mt-* \
41776888252Smrg	| msp430-* \
41863847c39Smrg	| nds32-* | nds32le-* | nds32be-* \
4199586ba5aSmrg	| nios-* | nios2-* | nios2eb-* | nios2el-* \
4201ae1b5e8Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
42163847c39Smrg	| open8-* \
4229586ba5aSmrg	| or1k*-* \
42376888252Smrg	| orion-* \
42476888252Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
42563847c39Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
42676888252Smrg	| pyramid-* \
42763847c39Smrg	| rl78-* | romp-* | rs6000-* | rx-* \
42863847c39Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
42976888252Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
4301ae1b5e8Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
4311ae1b5e8Smrg	| sparclite-* \
43263847c39Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
43363847c39Smrg	| tahoe-* \
434d8556812Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
43563847c39Smrg	| tile*-* \
43676888252Smrg	| tron-* \
43763847c39Smrg	| ubicom32-* \
43863847c39Smrg	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
43963847c39Smrg	| vax-* \
44076888252Smrg	| we32k-* \
44163847c39Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* \
4421ae1b5e8Smrg	| xstormy16-* | xtensa*-* \
44376888252Smrg	| ymp-* \
44463847c39Smrg	| z8k-* | z80-*)
4451ae1b5e8Smrg		;;
4461ae1b5e8Smrg	# Recognize the basic CPU types without company name, with glob match.
4471ae1b5e8Smrg	xtensa*)
4481ae1b5e8Smrg		basic_machine=$basic_machine-unknown
44976888252Smrg		;;
45076888252Smrg	# Recognize the various machine names and aliases which stand
45176888252Smrg	# for a CPU type and a company and sometimes even an OS.
45276888252Smrg	386bsd)
45376888252Smrg		basic_machine=i386-unknown
45476888252Smrg		os=-bsd
45576888252Smrg		;;
45676888252Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
45776888252Smrg		basic_machine=m68000-att
45876888252Smrg		;;
45976888252Smrg	3b*)
46076888252Smrg		basic_machine=we32k-att
46176888252Smrg		;;
46276888252Smrg	a29khif)
46376888252Smrg		basic_machine=a29k-amd
46476888252Smrg		os=-udi
46576888252Smrg		;;
46663847c39Smrg	abacus)
4671ae1b5e8Smrg		basic_machine=abacus-unknown
4681ae1b5e8Smrg		;;
46976888252Smrg	adobe68k)
47076888252Smrg		basic_machine=m68010-adobe
47176888252Smrg		os=-scout
47276888252Smrg		;;
47376888252Smrg	alliant | fx80)
47476888252Smrg		basic_machine=fx80-alliant
47576888252Smrg		;;
47676888252Smrg	altos | altos3068)
47776888252Smrg		basic_machine=m68k-altos
47876888252Smrg		;;
47976888252Smrg	am29k)
48076888252Smrg		basic_machine=a29k-none
48176888252Smrg		os=-bsd
48276888252Smrg		;;
48376888252Smrg	amd64)
48476888252Smrg		basic_machine=x86_64-pc
48576888252Smrg		;;
4861ae1b5e8Smrg	amd64-*)
4871ae1b5e8Smrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
4881ae1b5e8Smrg		;;
48976888252Smrg	amdahl)
49076888252Smrg		basic_machine=580-amdahl
49176888252Smrg		os=-sysv
49276888252Smrg		;;
49376888252Smrg	amiga | amiga-*)
49476888252Smrg		basic_machine=m68k-unknown
49576888252Smrg		;;
49676888252Smrg	amigaos | amigados)
49776888252Smrg		basic_machine=m68k-unknown
49876888252Smrg		os=-amigaos
49976888252Smrg		;;
50076888252Smrg	amigaunix | amix)
50176888252Smrg		basic_machine=m68k-unknown
50276888252Smrg		os=-sysv4
50376888252Smrg		;;
50476888252Smrg	apollo68)
50576888252Smrg		basic_machine=m68k-apollo
50676888252Smrg		os=-sysv
50776888252Smrg		;;
50876888252Smrg	apollo68bsd)
50976888252Smrg		basic_machine=m68k-apollo
51076888252Smrg		os=-bsd
51176888252Smrg		;;
51263847c39Smrg	aros)
51363847c39Smrg		basic_machine=i386-pc
51463847c39Smrg		os=-aros
51563847c39Smrg		;;
51676888252Smrg	aux)
51776888252Smrg		basic_machine=m68k-apple
51876888252Smrg		os=-aux
51976888252Smrg		;;
52076888252Smrg	balance)
52176888252Smrg		basic_machine=ns32k-sequent
52276888252Smrg		os=-dynix
52376888252Smrg		;;
5241ae1b5e8Smrg	blackfin)
5251ae1b5e8Smrg		basic_machine=bfin-unknown
5261ae1b5e8Smrg		os=-linux
5271ae1b5e8Smrg		;;
5281ae1b5e8Smrg	blackfin-*)
5291ae1b5e8Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
5301ae1b5e8Smrg		os=-linux
5311ae1b5e8Smrg		;;
53263847c39Smrg	bluegene*)
53363847c39Smrg		basic_machine=powerpc-ibm
53463847c39Smrg		os=-cnk
53563847c39Smrg		;;
53663847c39Smrg	c54x-*)
53763847c39Smrg		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
53863847c39Smrg		;;
53963847c39Smrg	c55x-*)
54063847c39Smrg		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
54163847c39Smrg		;;
54263847c39Smrg	c6x-*)
54363847c39Smrg		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
54463847c39Smrg		;;
54576888252Smrg	c90)
54676888252Smrg		basic_machine=c90-cray
54776888252Smrg		os=-unicos
54876888252Smrg		;;
54963847c39Smrg	cegcc)
55063847c39Smrg		basic_machine=arm-unknown
55163847c39Smrg		os=-cegcc
55263847c39Smrg		;;
55376888252Smrg	convex-c1)
55476888252Smrg		basic_machine=c1-convex
55576888252Smrg		os=-bsd
55676888252Smrg		;;
55776888252Smrg	convex-c2)
55876888252Smrg		basic_machine=c2-convex
55976888252Smrg		os=-bsd
56076888252Smrg		;;
56176888252Smrg	convex-c32)
56276888252Smrg		basic_machine=c32-convex
56376888252Smrg		os=-bsd
56476888252Smrg		;;
56576888252Smrg	convex-c34)
56676888252Smrg		basic_machine=c34-convex
56776888252Smrg		os=-bsd
56876888252Smrg		;;
56976888252Smrg	convex-c38)
57076888252Smrg		basic_machine=c38-convex
57176888252Smrg		os=-bsd
57276888252Smrg		;;
57376888252Smrg	cray | j90)
57476888252Smrg		basic_machine=j90-cray
57576888252Smrg		os=-unicos
57676888252Smrg		;;
5771ae1b5e8Smrg	craynv)
5781ae1b5e8Smrg		basic_machine=craynv-cray
5791ae1b5e8Smrg		os=-unicosmp
5801ae1b5e8Smrg		;;
58163847c39Smrg	cr16 | cr16-*)
5821ae1b5e8Smrg		basic_machine=cr16-unknown
5831ae1b5e8Smrg		os=-elf
5841ae1b5e8Smrg		;;
58576888252Smrg	crds | unos)
58676888252Smrg		basic_machine=m68k-crds
58776888252Smrg		;;
5881ae1b5e8Smrg	crisv32 | crisv32-* | etraxfs*)
5891ae1b5e8Smrg		basic_machine=crisv32-axis
5901ae1b5e8Smrg		;;
59176888252Smrg	cris | cris-* | etrax*)
59276888252Smrg		basic_machine=cris-axis
59376888252Smrg		;;
5941ae1b5e8Smrg	crx)
5951ae1b5e8Smrg		basic_machine=crx-unknown
5961ae1b5e8Smrg		os=-elf
5971ae1b5e8Smrg		;;
59876888252Smrg	da30 | da30-*)
59976888252Smrg		basic_machine=m68k-da30
60076888252Smrg		;;
60176888252Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
60276888252Smrg		basic_machine=mips-dec
60376888252Smrg		;;
60476888252Smrg	decsystem10* | dec10*)
60576888252Smrg		basic_machine=pdp10-dec
60676888252Smrg		os=-tops10
60776888252Smrg		;;
60876888252Smrg	decsystem20* | dec20*)
60976888252Smrg		basic_machine=pdp10-dec
61076888252Smrg		os=-tops20
61176888252Smrg		;;
61276888252Smrg	delta | 3300 | motorola-3300 | motorola-delta \
61376888252Smrg	      | 3300-motorola | delta-motorola)
61476888252Smrg		basic_machine=m68k-motorola
61576888252Smrg		;;
61676888252Smrg	delta88)
61776888252Smrg		basic_machine=m88k-motorola
61876888252Smrg		os=-sysv3
61976888252Smrg		;;
62063847c39Smrg	dicos)
62163847c39Smrg		basic_machine=i686-pc
62263847c39Smrg		os=-dicos
62363847c39Smrg		;;
6241ae1b5e8Smrg	djgpp)
6251ae1b5e8Smrg		basic_machine=i586-pc
6261ae1b5e8Smrg		os=-msdosdjgpp
6271ae1b5e8Smrg		;;
62876888252Smrg	dpx20 | dpx20-*)
62976888252Smrg		basic_machine=rs6000-bull
63076888252Smrg		os=-bosx
63176888252Smrg		;;
63276888252Smrg	dpx2* | dpx2*-bull)
63376888252Smrg		basic_machine=m68k-bull
63476888252Smrg		os=-sysv3
63576888252Smrg		;;
63676888252Smrg	ebmon29k)
63776888252Smrg		basic_machine=a29k-amd
63876888252Smrg		os=-ebmon
63976888252Smrg		;;
64076888252Smrg	elxsi)
64176888252Smrg		basic_machine=elxsi-elxsi
64276888252Smrg		os=-bsd
64376888252Smrg		;;
64476888252Smrg	encore | umax | mmax)
64576888252Smrg		basic_machine=ns32k-encore
64676888252Smrg		;;
64776888252Smrg	es1800 | OSE68k | ose68k | ose | OSE)
64876888252Smrg		basic_machine=m68k-ericsson
64976888252Smrg		os=-ose
65076888252Smrg		;;
65176888252Smrg	fx2800)
65276888252Smrg		basic_machine=i860-alliant
65376888252Smrg		;;
65476888252Smrg	genix)
65576888252Smrg		basic_machine=ns32k-ns
65676888252Smrg		;;
65776888252Smrg	gmicro)
65876888252Smrg		basic_machine=tron-gmicro
65976888252Smrg		os=-sysv
66076888252Smrg		;;
66176888252Smrg	go32)
66276888252Smrg		basic_machine=i386-pc
66376888252Smrg		os=-go32
66476888252Smrg		;;
66576888252Smrg	h3050r* | hiux*)
66676888252Smrg		basic_machine=hppa1.1-hitachi
66776888252Smrg		os=-hiuxwe2
66876888252Smrg		;;
66976888252Smrg	h8300hms)
67076888252Smrg		basic_machine=h8300-hitachi
67176888252Smrg		os=-hms
67276888252Smrg		;;
67376888252Smrg	h8300xray)
67476888252Smrg		basic_machine=h8300-hitachi
67576888252Smrg		os=-xray
67676888252Smrg		;;
67776888252Smrg	h8500hms)
67876888252Smrg		basic_machine=h8500-hitachi
67976888252Smrg		os=-hms
68076888252Smrg		;;
68176888252Smrg	harris)
68276888252Smrg		basic_machine=m88k-harris
68376888252Smrg		os=-sysv3
68476888252Smrg		;;
68576888252Smrg	hp300-*)
68676888252Smrg		basic_machine=m68k-hp
68776888252Smrg		;;
68876888252Smrg	hp300bsd)
68976888252Smrg		basic_machine=m68k-hp
69076888252Smrg		os=-bsd
69176888252Smrg		;;
69276888252Smrg	hp300hpux)
69376888252Smrg		basic_machine=m68k-hp
69476888252Smrg		os=-hpux
69576888252Smrg		;;
69676888252Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
69776888252Smrg		basic_machine=hppa1.0-hp
69876888252Smrg		;;
69976888252Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
70076888252Smrg		basic_machine=m68000-hp
70176888252Smrg		;;
70276888252Smrg	hp9k3[2-9][0-9])
70376888252Smrg		basic_machine=m68k-hp
70476888252Smrg		;;
70576888252Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
70676888252Smrg		basic_machine=hppa1.0-hp
70776888252Smrg		;;
70876888252Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
70976888252Smrg		basic_machine=hppa1.1-hp
71076888252Smrg		;;
71176888252Smrg	hp9k78[0-9] | hp78[0-9])
71276888252Smrg		# FIXME: really hppa2.0-hp
71376888252Smrg		basic_machine=hppa1.1-hp
71476888252Smrg		;;
71576888252Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
71676888252Smrg		# FIXME: really hppa2.0-hp
71776888252Smrg		basic_machine=hppa1.1-hp
71876888252Smrg		;;
71976888252Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
72076888252Smrg		basic_machine=hppa1.1-hp
72176888252Smrg		;;
72276888252Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
72376888252Smrg		basic_machine=hppa1.0-hp
72476888252Smrg		;;
72576888252Smrg	hppa-next)
72676888252Smrg		os=-nextstep3
72776888252Smrg		;;
72876888252Smrg	hppaosf)
72976888252Smrg		basic_machine=hppa1.1-hp
73076888252Smrg		os=-osf
73176888252Smrg		;;
73276888252Smrg	hppro)
73376888252Smrg		basic_machine=hppa1.1-hp
73476888252Smrg		os=-proelf
73576888252Smrg		;;
73676888252Smrg	i370-ibm* | ibm*)
73776888252Smrg		basic_machine=i370-ibm
73876888252Smrg		;;
73976888252Smrg	i*86v32)
74076888252Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
74176888252Smrg		os=-sysv32
74276888252Smrg		;;
74376888252Smrg	i*86v4*)
74476888252Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
74576888252Smrg		os=-sysv4
74676888252Smrg		;;
74776888252Smrg	i*86v)
74876888252Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
74976888252Smrg		os=-sysv
75076888252Smrg		;;
75176888252Smrg	i*86sol2)
75276888252Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
75376888252Smrg		os=-solaris2
75476888252Smrg		;;
75576888252Smrg	i386mach)
75676888252Smrg		basic_machine=i386-mach
75776888252Smrg		os=-mach
75876888252Smrg		;;
75976888252Smrg	i386-vsta | vsta)
76076888252Smrg		basic_machine=i386-unknown
76176888252Smrg		os=-vsta
76276888252Smrg		;;
76376888252Smrg	iris | iris4d)
76476888252Smrg		basic_machine=mips-sgi
76576888252Smrg		case $os in
76676888252Smrg		    -irix*)
76776888252Smrg			;;
76876888252Smrg		    *)
76976888252Smrg			os=-irix4
77076888252Smrg			;;
77176888252Smrg		esac
77276888252Smrg		;;
77376888252Smrg	isi68 | isi)
77476888252Smrg		basic_machine=m68k-isi
77576888252Smrg		os=-sysv
77676888252Smrg		;;
7771ae1b5e8Smrg	m68knommu)
7781ae1b5e8Smrg		basic_machine=m68k-unknown
7791ae1b5e8Smrg		os=-linux
7801ae1b5e8Smrg		;;
7811ae1b5e8Smrg	m68knommu-*)
7821ae1b5e8Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
7831ae1b5e8Smrg		os=-linux
7841ae1b5e8Smrg		;;
78576888252Smrg	m88k-omron*)
78676888252Smrg		basic_machine=m88k-omron
78776888252Smrg		;;
78876888252Smrg	magnum | m3230)
78976888252Smrg		basic_machine=mips-mips
79076888252Smrg		os=-sysv
79176888252Smrg		;;
79276888252Smrg	merlin)
79376888252Smrg		basic_machine=ns32k-utek
79476888252Smrg		os=-sysv
79576888252Smrg		;;
7969586ba5aSmrg	microblaze*)
79763847c39Smrg		basic_machine=microblaze-xilinx
79863847c39Smrg		;;
7999586ba5aSmrg	mingw64)
8009586ba5aSmrg		basic_machine=x86_64-pc
8019586ba5aSmrg		os=-mingw64
8029586ba5aSmrg		;;
80376888252Smrg	mingw32)
8049586ba5aSmrg		basic_machine=i686-pc
80576888252Smrg		os=-mingw32
80676888252Smrg		;;
8071ae1b5e8Smrg	mingw32ce)
8081ae1b5e8Smrg		basic_machine=arm-unknown
8091ae1b5e8Smrg		os=-mingw32ce
8101ae1b5e8Smrg		;;
81176888252Smrg	miniframe)
81276888252Smrg		basic_machine=m68000-convergent
81376888252Smrg		;;
81476888252Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
81576888252Smrg		basic_machine=m68k-atari
81676888252Smrg		os=-mint
81776888252Smrg		;;
81876888252Smrg	mips3*-*)
81976888252Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
82076888252Smrg		;;
82176888252Smrg	mips3*)
82276888252Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
82376888252Smrg		;;
82476888252Smrg	monitor)
82576888252Smrg		basic_machine=m68k-rom68k
82676888252Smrg		os=-coff
82776888252Smrg		;;
82876888252Smrg	morphos)
82976888252Smrg		basic_machine=powerpc-unknown
83076888252Smrg		os=-morphos
83176888252Smrg		;;
8329586ba5aSmrg	moxiebox)
8339586ba5aSmrg		basic_machine=moxie-unknown
8349586ba5aSmrg		os=-moxiebox
8359586ba5aSmrg		;;
83676888252Smrg	msdos)
83776888252Smrg		basic_machine=i386-pc
83876888252Smrg		os=-msdos
83976888252Smrg		;;
8401ae1b5e8Smrg	ms1-*)
8411ae1b5e8Smrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
8421ae1b5e8Smrg		;;
84363847c39Smrg	msys)
8449586ba5aSmrg		basic_machine=i686-pc
84563847c39Smrg		os=-msys
84663847c39Smrg		;;
84776888252Smrg	mvs)
84876888252Smrg		basic_machine=i370-ibm
84976888252Smrg		os=-mvs
85076888252Smrg		;;
85163847c39Smrg	nacl)
85263847c39Smrg		basic_machine=le32-unknown
85363847c39Smrg		os=-nacl
85463847c39Smrg		;;
85576888252Smrg	ncr3000)
85676888252Smrg		basic_machine=i486-ncr
85776888252Smrg		os=-sysv4
85876888252Smrg		;;
85976888252Smrg	netbsd386)
86076888252Smrg		basic_machine=i386-unknown
86176888252Smrg		os=-netbsd
86276888252Smrg		;;
86376888252Smrg	netwinder)
86476888252Smrg		basic_machine=armv4l-rebel
86576888252Smrg		os=-linux
86676888252Smrg		;;
86776888252Smrg	news | news700 | news800 | news900)
86876888252Smrg		basic_machine=m68k-sony
86976888252Smrg		os=-newsos
87076888252Smrg		;;
87176888252Smrg	news1000)
87276888252Smrg		basic_machine=m68030-sony
87376888252Smrg		os=-newsos
87476888252Smrg		;;
87576888252Smrg	news-3600 | risc-news)
87676888252Smrg		basic_machine=mips-sony
87776888252Smrg		os=-newsos
87876888252Smrg		;;
87976888252Smrg	necv70)
88076888252Smrg		basic_machine=v70-nec
88176888252Smrg		os=-sysv
88276888252Smrg		;;
88376888252Smrg	next | m*-next )
88476888252Smrg		basic_machine=m68k-next
88576888252Smrg		case $os in
88676888252Smrg		    -nextstep* )
88776888252Smrg			;;
88876888252Smrg		    -ns2*)
88976888252Smrg		      os=-nextstep2
89076888252Smrg			;;
89176888252Smrg		    *)
89276888252Smrg		      os=-nextstep3
89376888252Smrg			;;
89476888252Smrg		esac
89576888252Smrg		;;
89676888252Smrg	nh3000)
89776888252Smrg		basic_machine=m68k-harris
89876888252Smrg		os=-cxux
89976888252Smrg		;;
90076888252Smrg	nh[45]000)
90176888252Smrg		basic_machine=m88k-harris
90276888252Smrg		os=-cxux
90376888252Smrg		;;
90476888252Smrg	nindy960)
90576888252Smrg		basic_machine=i960-intel
90676888252Smrg		os=-nindy
90776888252Smrg		;;
90876888252Smrg	mon960)
90976888252Smrg		basic_machine=i960-intel
91076888252Smrg		os=-mon960
91176888252Smrg		;;
91276888252Smrg	nonstopux)
91376888252Smrg		basic_machine=mips-compaq
91476888252Smrg		os=-nonstopux
91576888252Smrg		;;
91676888252Smrg	np1)
91776888252Smrg		basic_machine=np1-gould
91876888252Smrg		;;
91963847c39Smrg	neo-tandem)
92063847c39Smrg		basic_machine=neo-tandem
92163847c39Smrg		;;
92263847c39Smrg	nse-tandem)
92363847c39Smrg		basic_machine=nse-tandem
92463847c39Smrg		;;
92576888252Smrg	nsr-tandem)
92676888252Smrg		basic_machine=nsr-tandem
92776888252Smrg		;;
92876888252Smrg	op50n-* | op60c-*)
92976888252Smrg		basic_machine=hppa1.1-oki
93076888252Smrg		os=-proelf
93176888252Smrg		;;
9321ae1b5e8Smrg	openrisc | openrisc-*)
93376888252Smrg		basic_machine=or32-unknown
9341ae1b5e8Smrg		;;
9351ae1b5e8Smrg	os400)
9361ae1b5e8Smrg		basic_machine=powerpc-ibm
9371ae1b5e8Smrg		os=-os400
93876888252Smrg		;;
93976888252Smrg	OSE68000 | ose68000)
94076888252Smrg		basic_machine=m68000-ericsson
94176888252Smrg		os=-ose
94276888252Smrg		;;
94376888252Smrg	os68k)
94476888252Smrg		basic_machine=m68k-none
94576888252Smrg		os=-os68k
94676888252Smrg		;;
94776888252Smrg	pa-hitachi)
94876888252Smrg		basic_machine=hppa1.1-hitachi
94976888252Smrg		os=-hiuxwe2
95076888252Smrg		;;
95176888252Smrg	paragon)
95276888252Smrg		basic_machine=i860-intel
95376888252Smrg		os=-osf
95476888252Smrg		;;
9551ae1b5e8Smrg	parisc)
9561ae1b5e8Smrg		basic_machine=hppa-unknown
9571ae1b5e8Smrg		os=-linux
9581ae1b5e8Smrg		;;
9591ae1b5e8Smrg	parisc-*)
9601ae1b5e8Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
9611ae1b5e8Smrg		os=-linux
9621ae1b5e8Smrg		;;
96376888252Smrg	pbd)
96476888252Smrg		basic_machine=sparc-tti
96576888252Smrg		;;
96676888252Smrg	pbb)
96776888252Smrg		basic_machine=m68k-tti
96876888252Smrg		;;
96976888252Smrg	pc532 | pc532-*)
97076888252Smrg		basic_machine=ns32k-pc532
97176888252Smrg		;;
9721ae1b5e8Smrg	pc98)
9731ae1b5e8Smrg		basic_machine=i386-pc
9741ae1b5e8Smrg		;;
9751ae1b5e8Smrg	pc98-*)
9761ae1b5e8Smrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
9771ae1b5e8Smrg		;;
97876888252Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
97976888252Smrg		basic_machine=i586-pc
98076888252Smrg		;;
98176888252Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
98276888252Smrg		basic_machine=i686-pc
98376888252Smrg		;;
98476888252Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
98576888252Smrg		basic_machine=i686-pc
98676888252Smrg		;;
98776888252Smrg	pentium4)
98876888252Smrg		basic_machine=i786-pc
98976888252Smrg		;;
99076888252Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
99176888252Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
99276888252Smrg		;;
99376888252Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
99476888252Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
99576888252Smrg		;;
99676888252Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
99776888252Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
99876888252Smrg		;;
99976888252Smrg	pentium4-*)
100076888252Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
100176888252Smrg		;;
100276888252Smrg	pn)
100376888252Smrg		basic_machine=pn-gould
100476888252Smrg		;;
100576888252Smrg	power)	basic_machine=power-ibm
100676888252Smrg		;;
100763847c39Smrg	ppc | ppcbe)	basic_machine=powerpc-unknown
100876888252Smrg		;;
100963847c39Smrg	ppc-* | ppcbe-*)
101063847c39Smrg		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
101176888252Smrg		;;
101276888252Smrg	ppcle | powerpclittle | ppc-le | powerpc-little)
101376888252Smrg		basic_machine=powerpcle-unknown
101476888252Smrg		;;
101576888252Smrg	ppcle-* | powerpclittle-*)
101676888252Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
101776888252Smrg		;;
101876888252Smrg	ppc64)	basic_machine=powerpc64-unknown
101976888252Smrg		;;
102076888252Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
102176888252Smrg		;;
102276888252Smrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
102376888252Smrg		basic_machine=powerpc64le-unknown
102476888252Smrg		;;
102576888252Smrg	ppc64le-* | powerpc64little-*)
102676888252Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
102776888252Smrg		;;
102876888252Smrg	ps2)
102976888252Smrg		basic_machine=i386-ibm
103076888252Smrg		;;
103176888252Smrg	pw32)
103276888252Smrg		basic_machine=i586-unknown
103376888252Smrg		os=-pw32
103476888252Smrg		;;
10359586ba5aSmrg	rdos | rdos64)
10369586ba5aSmrg		basic_machine=x86_64-pc
10379586ba5aSmrg		os=-rdos
10389586ba5aSmrg		;;
10399586ba5aSmrg	rdos32)
10401ae1b5e8Smrg		basic_machine=i386-pc
10411ae1b5e8Smrg		os=-rdos
10421ae1b5e8Smrg		;;
104376888252Smrg	rom68k)
104476888252Smrg		basic_machine=m68k-rom68k
104576888252Smrg		os=-coff
104676888252Smrg		;;
104776888252Smrg	rm[46]00)
104876888252Smrg		basic_machine=mips-siemens
104976888252Smrg		;;
105076888252Smrg	rtpc | rtpc-*)
105176888252Smrg		basic_machine=romp-ibm
105276888252Smrg		;;
10531ae1b5e8Smrg	s390 | s390-*)
10541ae1b5e8Smrg		basic_machine=s390-ibm
10551ae1b5e8Smrg		;;
10561ae1b5e8Smrg	s390x | s390x-*)
10571ae1b5e8Smrg		basic_machine=s390x-ibm
10581ae1b5e8Smrg		;;
105976888252Smrg	sa29200)
106076888252Smrg		basic_machine=a29k-amd
106176888252Smrg		os=-udi
106276888252Smrg		;;
106376888252Smrg	sb1)
106476888252Smrg		basic_machine=mipsisa64sb1-unknown
106576888252Smrg		;;
106676888252Smrg	sb1el)
106776888252Smrg		basic_machine=mipsisa64sb1el-unknown
106876888252Smrg		;;
10691ae1b5e8Smrg	sde)
10701ae1b5e8Smrg		basic_machine=mipsisa32-sde
10711ae1b5e8Smrg		os=-elf
10721ae1b5e8Smrg		;;
107376888252Smrg	sei)
107476888252Smrg		basic_machine=mips-sei
107576888252Smrg		os=-seiux
107676888252Smrg		;;
107776888252Smrg	sequent)
107876888252Smrg		basic_machine=i386-sequent
107976888252Smrg		;;
108076888252Smrg	sh)
108176888252Smrg		basic_machine=sh-hitachi
108276888252Smrg		os=-hms
108376888252Smrg		;;
10841ae1b5e8Smrg	sh5el)
10851ae1b5e8Smrg		basic_machine=sh5le-unknown
10861ae1b5e8Smrg		;;
108776888252Smrg	sh64)
108876888252Smrg		basic_machine=sh64-unknown
108976888252Smrg		;;
109076888252Smrg	sparclite-wrs | simso-wrs)
109176888252Smrg		basic_machine=sparclite-wrs
109276888252Smrg		os=-vxworks
109376888252Smrg		;;
109476888252Smrg	sps7)
109576888252Smrg		basic_machine=m68k-bull
109676888252Smrg		os=-sysv2
109776888252Smrg		;;
109876888252Smrg	spur)
109976888252Smrg		basic_machine=spur-unknown
110076888252Smrg		;;
110176888252Smrg	st2000)
110276888252Smrg		basic_machine=m68k-tandem
110376888252Smrg		;;
110476888252Smrg	stratus)
110576888252Smrg		basic_machine=i860-stratus
110676888252Smrg		os=-sysv4
110776888252Smrg		;;
110863847c39Smrg	strongarm-* | thumb-*)
110963847c39Smrg		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
111063847c39Smrg		;;
111176888252Smrg	sun2)
111276888252Smrg		basic_machine=m68000-sun
111376888252Smrg		;;
111476888252Smrg	sun2os3)
111576888252Smrg		basic_machine=m68000-sun
111676888252Smrg		os=-sunos3
111776888252Smrg		;;
111876888252Smrg	sun2os4)
111976888252Smrg		basic_machine=m68000-sun
112076888252Smrg		os=-sunos4
112176888252Smrg		;;
112276888252Smrg	sun3os3)
112376888252Smrg		basic_machine=m68k-sun
112476888252Smrg		os=-sunos3
112576888252Smrg		;;
112676888252Smrg	sun3os4)
112776888252Smrg		basic_machine=m68k-sun
112876888252Smrg		os=-sunos4
112976888252Smrg		;;
113076888252Smrg	sun4os3)
113176888252Smrg		basic_machine=sparc-sun
113276888252Smrg		os=-sunos3
113376888252Smrg		;;
113476888252Smrg	sun4os4)
113576888252Smrg		basic_machine=sparc-sun
113676888252Smrg		os=-sunos4
113776888252Smrg		;;
113876888252Smrg	sun4sol2)
113976888252Smrg		basic_machine=sparc-sun
114076888252Smrg		os=-solaris2
114176888252Smrg		;;
114276888252Smrg	sun3 | sun3-*)
114376888252Smrg		basic_machine=m68k-sun
114476888252Smrg		;;
114576888252Smrg	sun4)
114676888252Smrg		basic_machine=sparc-sun
114776888252Smrg		;;
114876888252Smrg	sun386 | sun386i | roadrunner)
114976888252Smrg		basic_machine=i386-sun
115076888252Smrg		;;
115176888252Smrg	sv1)
115276888252Smrg		basic_machine=sv1-cray
115376888252Smrg		os=-unicos
115476888252Smrg		;;
115576888252Smrg	symmetry)
115676888252Smrg		basic_machine=i386-sequent
115776888252Smrg		os=-dynix
115876888252Smrg		;;
115976888252Smrg	t3e)
116076888252Smrg		basic_machine=alphaev5-cray
116176888252Smrg		os=-unicos
116276888252Smrg		;;
116376888252Smrg	t90)
116476888252Smrg		basic_machine=t90-cray
116576888252Smrg		os=-unicos
116676888252Smrg		;;
11671ae1b5e8Smrg	tile*)
116863847c39Smrg		basic_machine=$basic_machine-unknown
11691ae1b5e8Smrg		os=-linux-gnu
11701ae1b5e8Smrg		;;
117176888252Smrg	tx39)
117276888252Smrg		basic_machine=mipstx39-unknown
117376888252Smrg		;;
117476888252Smrg	tx39el)
117576888252Smrg		basic_machine=mipstx39el-unknown
117676888252Smrg		;;
117776888252Smrg	toad1)
117876888252Smrg		basic_machine=pdp10-xkl
117976888252Smrg		os=-tops20
118076888252Smrg		;;
118176888252Smrg	tower | tower-32)
118276888252Smrg		basic_machine=m68k-ncr
118376888252Smrg		;;
11841ae1b5e8Smrg	tpf)
11851ae1b5e8Smrg		basic_machine=s390x-ibm
11861ae1b5e8Smrg		os=-tpf
11871ae1b5e8Smrg		;;
118876888252Smrg	udi29k)
118976888252Smrg		basic_machine=a29k-amd
119076888252Smrg		os=-udi
119176888252Smrg		;;
119276888252Smrg	ultra3)
119376888252Smrg		basic_machine=a29k-nyu
119476888252Smrg		os=-sym1
119576888252Smrg		;;
119676888252Smrg	v810 | necv810)
119776888252Smrg		basic_machine=v810-nec
119876888252Smrg		os=-none
119976888252Smrg		;;
120076888252Smrg	vaxv)
120176888252Smrg		basic_machine=vax-dec
120276888252Smrg		os=-sysv
120376888252Smrg		;;
120476888252Smrg	vms)
120576888252Smrg		basic_machine=vax-dec
120676888252Smrg		os=-vms
120776888252Smrg		;;
120876888252Smrg	vpp*|vx|vx-*)
120976888252Smrg		basic_machine=f301-fujitsu
121076888252Smrg		;;
121176888252Smrg	vxworks960)
121276888252Smrg		basic_machine=i960-wrs
121376888252Smrg		os=-vxworks
121476888252Smrg		;;
121576888252Smrg	vxworks68)
121676888252Smrg		basic_machine=m68k-wrs
121776888252Smrg		os=-vxworks
121876888252Smrg		;;
121976888252Smrg	vxworks29k)
122076888252Smrg		basic_machine=a29k-wrs
122176888252Smrg		os=-vxworks
122276888252Smrg		;;
122376888252Smrg	w65*)
122476888252Smrg		basic_machine=w65-wdc
122576888252Smrg		os=-none
122676888252Smrg		;;
122776888252Smrg	w89k-*)
122876888252Smrg		basic_machine=hppa1.1-winbond
122976888252Smrg		os=-proelf
123076888252Smrg		;;
12311ae1b5e8Smrg	xbox)
12321ae1b5e8Smrg		basic_machine=i686-pc
12331ae1b5e8Smrg		os=-mingw32
12341ae1b5e8Smrg		;;
123576888252Smrg	xps | xps100)
123676888252Smrg		basic_machine=xps100-honeywell
123776888252Smrg		;;
123863847c39Smrg	xscale-* | xscalee[bl]-*)
123963847c39Smrg		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
124063847c39Smrg		;;
124176888252Smrg	ymp)
124276888252Smrg		basic_machine=ymp-cray
124376888252Smrg		os=-unicos
124476888252Smrg		;;
124576888252Smrg	z8k-*-coff)
124676888252Smrg		basic_machine=z8k-unknown
124776888252Smrg		os=-sim
124876888252Smrg		;;
124963847c39Smrg	z80-*-coff)
125063847c39Smrg		basic_machine=z80-unknown
125163847c39Smrg		os=-sim
125263847c39Smrg		;;
125376888252Smrg	none)
125476888252Smrg		basic_machine=none-none
125576888252Smrg		os=-none
125676888252Smrg		;;
125776888252Smrg
125876888252Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
125976888252Smrg# some cases the only manufacturer, in others, it is the most popular.
126076888252Smrg	w89k)
126176888252Smrg		basic_machine=hppa1.1-winbond
126276888252Smrg		;;
126376888252Smrg	op50n)
126476888252Smrg		basic_machine=hppa1.1-oki
126576888252Smrg		;;
126676888252Smrg	op60c)
126776888252Smrg		basic_machine=hppa1.1-oki
126876888252Smrg		;;
126976888252Smrg	romp)
127076888252Smrg		basic_machine=romp-ibm
127176888252Smrg		;;
12721ae1b5e8Smrg	mmix)
12731ae1b5e8Smrg		basic_machine=mmix-knuth
12741ae1b5e8Smrg		;;
127576888252Smrg	rs6000)
127676888252Smrg		basic_machine=rs6000-ibm
127776888252Smrg		;;
127876888252Smrg	vax)
127976888252Smrg		basic_machine=vax-dec
128076888252Smrg		;;
128176888252Smrg	pdp10)
128276888252Smrg		# there are many clones, so DEC is not a safe bet
128376888252Smrg		basic_machine=pdp10-unknown
128476888252Smrg		;;
128576888252Smrg	pdp11)
128676888252Smrg		basic_machine=pdp11-dec
128776888252Smrg		;;
128876888252Smrg	we32k)
128976888252Smrg		basic_machine=we32k-att
129076888252Smrg		;;
129163847c39Smrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
129276888252Smrg		basic_machine=sh-unknown
129376888252Smrg		;;
12941ae1b5e8Smrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
129576888252Smrg		basic_machine=sparc-sun
129676888252Smrg		;;
129776888252Smrg	cydra)
129876888252Smrg		basic_machine=cydra-cydrome
129976888252Smrg		;;
130076888252Smrg	orion)
130176888252Smrg		basic_machine=orion-highlevel
130276888252Smrg		;;
130376888252Smrg	orion105)
130476888252Smrg		basic_machine=clipper-highlevel
130576888252Smrg		;;
130676888252Smrg	mac | mpw | mac-mpw)
130776888252Smrg		basic_machine=m68k-apple
130876888252Smrg		;;
130976888252Smrg	pmac | pmac-mpw)
131076888252Smrg		basic_machine=powerpc-apple
131176888252Smrg		;;
131276888252Smrg	*-unknown)
131376888252Smrg		# Make sure to match an already-canonicalized machine name.
131476888252Smrg		;;
131576888252Smrg	*)
131676888252Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
131776888252Smrg		exit 1
131876888252Smrg		;;
131976888252Smrgesac
132076888252Smrg
132176888252Smrg# Here we canonicalize certain aliases for manufacturers.
132276888252Smrgcase $basic_machine in
132376888252Smrg	*-digital*)
132476888252Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
132576888252Smrg		;;
132676888252Smrg	*-commodore*)
132776888252Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
132876888252Smrg		;;
132976888252Smrg	*)
133076888252Smrg		;;
133176888252Smrgesac
133276888252Smrg
133376888252Smrg# Decode manufacturer-specific aliases for certain operating systems.
133476888252Smrg
133576888252Smrgif [ x"$os" != x"" ]
133676888252Smrgthen
133776888252Smrgcase $os in
133863847c39Smrg	# First match some system type aliases
133963847c39Smrg	# that might get confused with valid system types.
134076888252Smrg	# -solaris* is a basic system type, with this one exception.
134163847c39Smrg	-auroraux)
134263847c39Smrg		os=-auroraux
134363847c39Smrg		;;
134476888252Smrg	-solaris1 | -solaris1.*)
134576888252Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
134676888252Smrg		;;
134776888252Smrg	-solaris)
134876888252Smrg		os=-solaris2
134976888252Smrg		;;
135076888252Smrg	-svr4*)
135176888252Smrg		os=-sysv4
135276888252Smrg		;;
135376888252Smrg	-unixware*)
135476888252Smrg		os=-sysv4.2uw
135576888252Smrg		;;
135676888252Smrg	-gnu/linux*)
135776888252Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
135876888252Smrg		;;
135976888252Smrg	# First accept the basic system types.
136076888252Smrg	# The portable systems comes first.
136176888252Smrg	# Each alternative MUST END IN A *, to match a version number.
136276888252Smrg	# -sysv* is not here because it comes later, after sysvr4.
136376888252Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
136463847c39Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
136563847c39Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
13669586ba5aSmrg	      | -sym* | -kopensolaris* | -plan9* \
136776888252Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
136863847c39Smrg	      | -aos* | -aros* \
136976888252Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
137076888252Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
13711ae1b5e8Smrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
13729586ba5aSmrg	      | -bitrig* | -openbsd* | -solidbsd* \
13731ae1b5e8Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13741ae1b5e8Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
137576888252Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
137676888252Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
137763847c39Smrg	      | -chorusos* | -chorusrdb* | -cegcc* \
137863847c39Smrg	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
13799586ba5aSmrg	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
13809586ba5aSmrg	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
13819586ba5aSmrg	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
138276888252Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
138376888252Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
138476888252Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
138576888252Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
138676888252Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
13871ae1b5e8Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
13889586ba5aSmrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
138976888252Smrg	# Remember, each alternative MUST END IN *, to match a version number.
139076888252Smrg		;;
139176888252Smrg	-qnx*)
139276888252Smrg		case $basic_machine in
139376888252Smrg		    x86-* | i*86-*)
139476888252Smrg			;;
139576888252Smrg		    *)
139676888252Smrg			os=-nto$os
139776888252Smrg			;;
139876888252Smrg		esac
139976888252Smrg		;;
140076888252Smrg	-nto-qnx*)
140176888252Smrg		;;
140276888252Smrg	-nto*)
140376888252Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
140476888252Smrg		;;
140576888252Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
14061ae1b5e8Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
140776888252Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
140876888252Smrg		;;
140976888252Smrg	-mac*)
141076888252Smrg		os=`echo $os | sed -e 's|mac|macos|'`
141176888252Smrg		;;
14121ae1b5e8Smrg	-linux-dietlibc)
14131ae1b5e8Smrg		os=-linux-dietlibc
14141ae1b5e8Smrg		;;
141576888252Smrg	-linux*)
141676888252Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
141776888252Smrg		;;
141876888252Smrg	-sunos5*)
141976888252Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
142076888252Smrg		;;
142176888252Smrg	-sunos6*)
142276888252Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
142376888252Smrg		;;
142476888252Smrg	-opened*)
142576888252Smrg		os=-openedition
142676888252Smrg		;;
142763847c39Smrg	-os400*)
14281ae1b5e8Smrg		os=-os400
14291ae1b5e8Smrg		;;
143076888252Smrg	-wince*)
143176888252Smrg		os=-wince
143276888252Smrg		;;
143376888252Smrg	-osfrose*)
143476888252Smrg		os=-osfrose
143576888252Smrg		;;
143676888252Smrg	-osf*)
143776888252Smrg		os=-osf
143876888252Smrg		;;
143976888252Smrg	-utek*)
144076888252Smrg		os=-bsd
144176888252Smrg		;;
144276888252Smrg	-dynix*)
144376888252Smrg		os=-bsd
144476888252Smrg		;;
144576888252Smrg	-acis*)
144676888252Smrg		os=-aos
144776888252Smrg		;;
144876888252Smrg	-atheos*)
144976888252Smrg		os=-atheos
145076888252Smrg		;;
14511ae1b5e8Smrg	-syllable*)
14521ae1b5e8Smrg		os=-syllable
14531ae1b5e8Smrg		;;
145476888252Smrg	-386bsd)
145576888252Smrg		os=-bsd
145676888252Smrg		;;
145776888252Smrg	-ctix* | -uts*)
145876888252Smrg		os=-sysv
145976888252Smrg		;;
146076888252Smrg	-nova*)
146176888252Smrg		os=-rtmk-nova
146276888252Smrg		;;
146376888252Smrg	-ns2 )
146476888252Smrg		os=-nextstep2
146576888252Smrg		;;
146676888252Smrg	-nsk*)
146776888252Smrg		os=-nsk
146876888252Smrg		;;
146976888252Smrg	# Preserve the version number of sinix5.
147076888252Smrg	-sinix5.*)
147176888252Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
147276888252Smrg		;;
147376888252Smrg	-sinix*)
147476888252Smrg		os=-sysv4
147576888252Smrg		;;
147663847c39Smrg	-tpf*)
14771ae1b5e8Smrg		os=-tpf
14781ae1b5e8Smrg		;;
147976888252Smrg	-triton*)
148076888252Smrg		os=-sysv3
148176888252Smrg		;;
148276888252Smrg	-oss*)
148376888252Smrg		os=-sysv3
148476888252Smrg		;;
148576888252Smrg	-svr4)
148676888252Smrg		os=-sysv4
148776888252Smrg		;;
148876888252Smrg	-svr3)
148976888252Smrg		os=-sysv3
149076888252Smrg		;;
149176888252Smrg	-sysvr4)
149276888252Smrg		os=-sysv4
149376888252Smrg		;;
149476888252Smrg	# This must come after -sysvr4.
149576888252Smrg	-sysv*)
149676888252Smrg		;;
149776888252Smrg	-ose*)
149876888252Smrg		os=-ose
149976888252Smrg		;;
150076888252Smrg	-es1800*)
150176888252Smrg		os=-ose
150276888252Smrg		;;
150376888252Smrg	-xenix)
150476888252Smrg		os=-xenix
150576888252Smrg		;;
150676888252Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
150776888252Smrg		os=-mint
150876888252Smrg		;;
150976888252Smrg	-aros*)
151076888252Smrg		os=-aros
151176888252Smrg		;;
15121ae1b5e8Smrg	-zvmoe)
15131ae1b5e8Smrg		os=-zvmoe
15141ae1b5e8Smrg		;;
151563847c39Smrg	-dicos*)
151663847c39Smrg		os=-dicos
151763847c39Smrg		;;
151863847c39Smrg	-nacl*)
151963847c39Smrg		;;
152076888252Smrg	-none)
152176888252Smrg		;;
152276888252Smrg	*)
152376888252Smrg		# Get rid of the `-' at the beginning of $os.
152476888252Smrg		os=`echo $os | sed 's/[^-]*-//'`
152576888252Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
152676888252Smrg		exit 1
152776888252Smrg		;;
152876888252Smrgesac
152976888252Smrgelse
153076888252Smrg
153176888252Smrg# Here we handle the default operating systems that come with various machines.
153276888252Smrg# The value should be what the vendor currently ships out the door with their
153376888252Smrg# machine or put another way, the most popular os provided with the machine.
153476888252Smrg
153576888252Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
153676888252Smrg# "-sun"), then you have to tell the case statement up towards the top
153776888252Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
153876888252Smrg# will signal an error saying that MANUFACTURER isn't an operating
153976888252Smrg# system, and we'll never get to this point.
154076888252Smrg
154176888252Smrgcase $basic_machine in
154263847c39Smrg	score-*)
15431ae1b5e8Smrg		os=-elf
15441ae1b5e8Smrg		;;
154563847c39Smrg	spu-*)
15461ae1b5e8Smrg		os=-elf
15471ae1b5e8Smrg		;;
154876888252Smrg	*-acorn)
154976888252Smrg		os=-riscix1.2
155076888252Smrg		;;
155176888252Smrg	arm*-rebel)
155276888252Smrg		os=-linux
155376888252Smrg		;;
155476888252Smrg	arm*-semi)
155576888252Smrg		os=-aout
155676888252Smrg		;;
155763847c39Smrg	c4x-* | tic4x-*)
155863847c39Smrg		os=-coff
155963847c39Smrg		;;
15609586ba5aSmrg	c8051-*)
15619586ba5aSmrg		os=-elf
15629586ba5aSmrg		;;
15639586ba5aSmrg	hexagon-*)
15649586ba5aSmrg		os=-elf
15659586ba5aSmrg		;;
156663847c39Smrg	tic54x-*)
156763847c39Smrg		os=-coff
156863847c39Smrg		;;
156963847c39Smrg	tic55x-*)
157063847c39Smrg		os=-coff
157163847c39Smrg		;;
157263847c39Smrg	tic6x-*)
157363847c39Smrg		os=-coff
157476888252Smrg		;;
157576888252Smrg	# This must come before the *-dec entry.
157676888252Smrg	pdp10-*)
157776888252Smrg		os=-tops20
157876888252Smrg		;;
157976888252Smrg	pdp11-*)
158076888252Smrg		os=-none
158176888252Smrg		;;
158276888252Smrg	*-dec | vax-*)
158376888252Smrg		os=-ultrix4.2
158476888252Smrg		;;
158576888252Smrg	m68*-apollo)
158676888252Smrg		os=-domain
158776888252Smrg		;;
158876888252Smrg	i386-sun)
158976888252Smrg		os=-sunos4.0.2
159076888252Smrg		;;
159176888252Smrg	m68000-sun)
159276888252Smrg		os=-sunos3
159376888252Smrg		;;
159476888252Smrg	m68*-cisco)
159576888252Smrg		os=-aout
159676888252Smrg		;;
159763847c39Smrg	mep-*)
15981ae1b5e8Smrg		os=-elf
15991ae1b5e8Smrg		;;
160076888252Smrg	mips*-cisco)
160176888252Smrg		os=-elf
160276888252Smrg		;;
160376888252Smrg	mips*-*)
160476888252Smrg		os=-elf
160576888252Smrg		;;
160676888252Smrg	or32-*)
160776888252Smrg		os=-coff
160876888252Smrg		;;
160976888252Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
161076888252Smrg		os=-sysv3
161176888252Smrg		;;
161276888252Smrg	sparc-* | *-sun)
161376888252Smrg		os=-sunos4.1.1
161476888252Smrg		;;
161576888252Smrg	*-be)
161676888252Smrg		os=-beos
161776888252Smrg		;;
16181ae1b5e8Smrg	*-haiku)
16191ae1b5e8Smrg		os=-haiku
16201ae1b5e8Smrg		;;
162176888252Smrg	*-ibm)
162276888252Smrg		os=-aix
162376888252Smrg		;;
162463847c39Smrg	*-knuth)
16251ae1b5e8Smrg		os=-mmixware
16261ae1b5e8Smrg		;;
162776888252Smrg	*-wec)
162876888252Smrg		os=-proelf
162976888252Smrg		;;
163076888252Smrg	*-winbond)
163176888252Smrg		os=-proelf
163276888252Smrg		;;
163376888252Smrg	*-oki)
163476888252Smrg		os=-proelf
163576888252Smrg		;;
163676888252Smrg	*-hp)
163776888252Smrg		os=-hpux
163876888252Smrg		;;
163976888252Smrg	*-hitachi)
164076888252Smrg		os=-hiux
164176888252Smrg		;;
164276888252Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
164376888252Smrg		os=-sysv
164476888252Smrg		;;
164576888252Smrg	*-cbm)
164676888252Smrg		os=-amigaos
164776888252Smrg		;;
164876888252Smrg	*-dg)
164976888252Smrg		os=-dgux
165076888252Smrg		;;
165176888252Smrg	*-dolphin)
165276888252Smrg		os=-sysv3
165376888252Smrg		;;
165476888252Smrg	m68k-ccur)
165576888252Smrg		os=-rtu
165676888252Smrg		;;
165776888252Smrg	m88k-omron*)
165876888252Smrg		os=-luna
165976888252Smrg		;;
166076888252Smrg	*-next )
166176888252Smrg		os=-nextstep
166276888252Smrg		;;
166376888252Smrg	*-sequent)
166476888252Smrg		os=-ptx
166576888252Smrg		;;
166676888252Smrg	*-crds)
166776888252Smrg		os=-unos
166876888252Smrg		;;
166976888252Smrg	*-ns)
167076888252Smrg		os=-genix
167176888252Smrg		;;
167276888252Smrg	i370-*)
167376888252Smrg		os=-mvs
167476888252Smrg		;;
167576888252Smrg	*-next)
167676888252Smrg		os=-nextstep3
167776888252Smrg		;;
167876888252Smrg	*-gould)
167976888252Smrg		os=-sysv
168076888252Smrg		;;
168176888252Smrg	*-highlevel)
168276888252Smrg		os=-bsd
168376888252Smrg		;;
168476888252Smrg	*-encore)
168576888252Smrg		os=-bsd
168676888252Smrg		;;
168776888252Smrg	*-sgi)
168876888252Smrg		os=-irix
168976888252Smrg		;;
169076888252Smrg	*-siemens)
169176888252Smrg		os=-sysv4
169276888252Smrg		;;
169376888252Smrg	*-masscomp)
169476888252Smrg		os=-rtu
169576888252Smrg		;;
169676888252Smrg	f30[01]-fujitsu | f700-fujitsu)
169776888252Smrg		os=-uxpv
169876888252Smrg		;;
169976888252Smrg	*-rom68k)
170076888252Smrg		os=-coff
170176888252Smrg		;;
170276888252Smrg	*-*bug)
170376888252Smrg		os=-coff
170476888252Smrg		;;
170576888252Smrg	*-apple)
170676888252Smrg		os=-macos
170776888252Smrg		;;
170876888252Smrg	*-atari*)
170976888252Smrg		os=-mint
171076888252Smrg		;;
171176888252Smrg	*)
171276888252Smrg		os=-none
171376888252Smrg		;;
171476888252Smrgesac
171576888252Smrgfi
171676888252Smrg
171776888252Smrg# Here we handle the case where we know the os, and the CPU type, but not the
171876888252Smrg# manufacturer.  We pick the logical manufacturer.
171976888252Smrgvendor=unknown
172076888252Smrgcase $basic_machine in
172176888252Smrg	*-unknown)
172276888252Smrg		case $os in
172376888252Smrg			-riscix*)
172476888252Smrg				vendor=acorn
172576888252Smrg				;;
172676888252Smrg			-sunos*)
172776888252Smrg				vendor=sun
172876888252Smrg				;;
172963847c39Smrg			-cnk*|-aix*)
173076888252Smrg				vendor=ibm
173176888252Smrg				;;
173276888252Smrg			-beos*)
173376888252Smrg				vendor=be
173476888252Smrg				;;
173576888252Smrg			-hpux*)
173676888252Smrg				vendor=hp
173776888252Smrg				;;
173876888252Smrg			-mpeix*)
173976888252Smrg				vendor=hp
174076888252Smrg				;;
174176888252Smrg			-hiux*)
174276888252Smrg				vendor=hitachi
174376888252Smrg				;;
174476888252Smrg			-unos*)
174576888252Smrg				vendor=crds
174676888252Smrg				;;
174776888252Smrg			-dgux*)
174876888252Smrg				vendor=dg
174976888252Smrg				;;
175076888252Smrg			-luna*)
175176888252Smrg				vendor=omron
175276888252Smrg				;;
175376888252Smrg			-genix*)
175476888252Smrg				vendor=ns
175576888252Smrg				;;
175676888252Smrg			-mvs* | -opened*)
175776888252Smrg				vendor=ibm
175876888252Smrg				;;
17591ae1b5e8Smrg			-os400*)
17601ae1b5e8Smrg				vendor=ibm
17611ae1b5e8Smrg				;;
176276888252Smrg			-ptx*)
176376888252Smrg				vendor=sequent
176476888252Smrg				;;
17651ae1b5e8Smrg			-tpf*)
17661ae1b5e8Smrg				vendor=ibm
17671ae1b5e8Smrg				;;
176876888252Smrg			-vxsim* | -vxworks* | -windiss*)
176976888252Smrg				vendor=wrs
177076888252Smrg				;;
177176888252Smrg			-aux*)
177276888252Smrg				vendor=apple
177376888252Smrg				;;
177476888252Smrg			-hms*)
177576888252Smrg				vendor=hitachi
177676888252Smrg				;;
177776888252Smrg			-mpw* | -macos*)
177876888252Smrg				vendor=apple
177976888252Smrg				;;
178076888252Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
178176888252Smrg				vendor=atari
178276888252Smrg				;;
178376888252Smrg			-vos*)
178476888252Smrg				vendor=stratus
178576888252Smrg				;;
178676888252Smrg		esac
178776888252Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
178876888252Smrg		;;
178976888252Smrgesac
179076888252Smrg
179176888252Smrgecho $basic_machine$os
17921ae1b5e8Smrgexit
179376888252Smrg
179476888252Smrg# Local variables:
179576888252Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
179676888252Smrg# time-stamp-start: "timestamp='"
179776888252Smrg# time-stamp-format: "%:y-%02m-%02d"
179876888252Smrg# time-stamp-end: "'"
179976888252Smrg# End:
1800