132001f49Smrg#! /bin/sh
232001f49Smrg# Configuration validation subroutine script.
37ec3b29aSmrg#   Copyright 1992-2017 Free Software Foundation, Inc.
432001f49Smrg
57ec3b29aSmrgtimestamp='2017-11-23'
632001f49Smrg
732001f49Smrg# This file is free software; you can redistribute it and/or modify it
832001f49Smrg# under the terms of the GNU General Public License as published by
932001f49Smrg# the Free Software Foundation; either version 3 of the License, or
1032001f49Smrg# (at your option) any later version.
1132001f49Smrg#
1232001f49Smrg# This program is distributed in the hope that it will be useful, but
1332001f49Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1432001f49Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1532001f49Smrg# General Public License for more details.
1632001f49Smrg#
1732001f49Smrg# You should have received a copy of the GNU General Public License
187ec3b29aSmrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
1932001f49Smrg#
2032001f49Smrg# As a special exception to the GNU General Public License, if you
2132001f49Smrg# distribute this file as part of a program that contains a
2232001f49Smrg# configuration script generated by Autoconf, you may include it under
2332001f49Smrg# the same distribution terms that you use for the rest of that
2432001f49Smrg# program.  This Exception is an additional permission under section 7
2532001f49Smrg# of the GNU General Public License, version 3 ("GPLv3").
2632001f49Smrg
2732001f49Smrg
287ec3b29aSmrg# Please send patches to <config-patches@gnu.org>.
2932001f49Smrg#
3032001f49Smrg# Configuration subroutine to validate and canonicalize a configuration type.
3132001f49Smrg# Supply the specified configuration type as an argument.
3232001f49Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
3332001f49Smrg# Otherwise, we print the canonical config type on stdout and succeed.
3432001f49Smrg
3532001f49Smrg# You can get the latest version of this script from:
367ec3b29aSmrg# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
3732001f49Smrg
3832001f49Smrg# This file is supposed to be the same for all GNU packages
3932001f49Smrg# and recognize all the CPU types, system types and aliases
4032001f49Smrg# that are meaningful with *any* GNU software.
4132001f49Smrg# Each package is responsible for reporting which valid configurations
4232001f49Smrg# it does not support.  The user should be able to distinguish
4332001f49Smrg# a failure to support a valid configuration from a meaningless
4432001f49Smrg# configuration.
4532001f49Smrg
4632001f49Smrg# The goal of this file is to map all the various variations of a given
4732001f49Smrg# machine specification into a single specification in the form:
4832001f49Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
4932001f49Smrg# or in some cases, the newer four-part form:
5032001f49Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5132001f49Smrg# It is wrong to echo any other type of specification.
5232001f49Smrg
5332001f49Smrgme=`echo "$0" | sed -e 's,.*/,,'`
5432001f49Smrg
5532001f49Smrgusage="\
567ec3b29aSmrgUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
5732001f49Smrg
5832001f49SmrgCanonicalize a configuration name.
5932001f49Smrg
607ec3b29aSmrgOptions:
6132001f49Smrg  -h, --help         print this help, then exit
6232001f49Smrg  -t, --time-stamp   print date of last modification, then exit
6332001f49Smrg  -v, --version      print version number, then exit
6432001f49Smrg
6532001f49SmrgReport bugs and patches to <config-patches@gnu.org>."
6632001f49Smrg
6732001f49Smrgversion="\
6832001f49SmrgGNU config.sub ($timestamp)
6932001f49Smrg
707ec3b29aSmrgCopyright 1992-2017 Free Software Foundation, Inc.
7132001f49Smrg
7232001f49SmrgThis is free software; see the source for copying conditions.  There is NO
7332001f49Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
7432001f49Smrg
7532001f49Smrghelp="
7632001f49SmrgTry \`$me --help' for more information."
7732001f49Smrg
7832001f49Smrg# Parse command line
7932001f49Smrgwhile test $# -gt 0 ; do
8032001f49Smrg  case $1 in
8132001f49Smrg    --time-stamp | --time* | -t )
8232001f49Smrg       echo "$timestamp" ; exit ;;
8332001f49Smrg    --version | -v )
8432001f49Smrg       echo "$version" ; exit ;;
8532001f49Smrg    --help | --h* | -h )
8632001f49Smrg       echo "$usage"; exit ;;
8732001f49Smrg    -- )     # Stop option processing
8832001f49Smrg       shift; break ;;
8932001f49Smrg    - )	# Use stdin as input.
9032001f49Smrg       break ;;
9132001f49Smrg    -* )
9232001f49Smrg       echo "$me: invalid option $1$help"
9332001f49Smrg       exit 1 ;;
9432001f49Smrg
9532001f49Smrg    *local*)
9632001f49Smrg       # First pass through any local machine types.
9732001f49Smrg       echo $1
9832001f49Smrg       exit ;;
9932001f49Smrg
10032001f49Smrg    * )
10132001f49Smrg       break ;;
10232001f49Smrg  esac
10332001f49Smrgdone
10432001f49Smrg
10532001f49Smrgcase $# in
10632001f49Smrg 0) echo "$me: missing argument$help" >&2
10732001f49Smrg    exit 1;;
10832001f49Smrg 1) ;;
10932001f49Smrg *) echo "$me: too many arguments$help" >&2
11032001f49Smrg    exit 1;;
11132001f49Smrgesac
11232001f49Smrg
11332001f49Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
11432001f49Smrg# Here we must recognize all the valid KERNEL-OS combinations.
11532001f49Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
11632001f49Smrgcase $maybe_os in
11732001f49Smrg  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
11832001f49Smrg  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
1197ec3b29aSmrg  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
1207ec3b29aSmrg  kopensolaris*-gnu* | cloudabi*-eabi* | \
12132001f49Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
12232001f49Smrg    os=-$maybe_os
12332001f49Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
12432001f49Smrg    ;;
12532001f49Smrg  android-linux)
12632001f49Smrg    os=-linux-android
12732001f49Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
12832001f49Smrg    ;;
12932001f49Smrg  *)
13032001f49Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
13132001f49Smrg    if [ $basic_machine != $1 ]
13232001f49Smrg    then os=`echo $1 | sed 's/.*-/-/'`
13332001f49Smrg    else os=; fi
13432001f49Smrg    ;;
13532001f49Smrgesac
13632001f49Smrg
13732001f49Smrg### Let's recognize common machines as not being operating systems so
13832001f49Smrg### that things like config.sub decstation-3100 work.  We also
13932001f49Smrg### recognize some manufacturers as not being operating systems, so we
14032001f49Smrg### can provide default operating systems below.
14132001f49Smrgcase $os in
14232001f49Smrg	-sun*os*)
14332001f49Smrg		# Prevent following clause from handling this invalid input.
14432001f49Smrg		;;
14532001f49Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
14632001f49Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
14732001f49Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
14832001f49Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
14932001f49Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
15032001f49Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
15132001f49Smrg	-apple | -axis | -knuth | -cray | -microblaze*)
15232001f49Smrg		os=
15332001f49Smrg		basic_machine=$1
15432001f49Smrg		;;
15532001f49Smrg	-bluegene*)
15632001f49Smrg		os=-cnk
15732001f49Smrg		;;
15832001f49Smrg	-sim | -cisco | -oki | -wec | -winbond)
15932001f49Smrg		os=
16032001f49Smrg		basic_machine=$1
16132001f49Smrg		;;
16232001f49Smrg	-scout)
16332001f49Smrg		;;
16432001f49Smrg	-wrs)
16532001f49Smrg		os=-vxworks
16632001f49Smrg		basic_machine=$1
16732001f49Smrg		;;
16832001f49Smrg	-chorusos*)
16932001f49Smrg		os=-chorusos
17032001f49Smrg		basic_machine=$1
17132001f49Smrg		;;
17232001f49Smrg	-chorusrdb)
17332001f49Smrg		os=-chorusrdb
17432001f49Smrg		basic_machine=$1
17532001f49Smrg		;;
17632001f49Smrg	-hiux*)
17732001f49Smrg		os=-hiuxwe2
17832001f49Smrg		;;
17932001f49Smrg	-sco6)
18032001f49Smrg		os=-sco5v6
18132001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18232001f49Smrg		;;
18332001f49Smrg	-sco5)
18432001f49Smrg		os=-sco3.2v5
18532001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18632001f49Smrg		;;
18732001f49Smrg	-sco4)
18832001f49Smrg		os=-sco3.2v4
18932001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19032001f49Smrg		;;
19132001f49Smrg	-sco3.2.[4-9]*)
19232001f49Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
19332001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19432001f49Smrg		;;
19532001f49Smrg	-sco3.2v[4-9]*)
19632001f49Smrg		# Don't forget version if it is 3.2v4 or newer.
19732001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19832001f49Smrg		;;
19932001f49Smrg	-sco5v6*)
20032001f49Smrg		# Don't forget version if it is 3.2v4 or newer.
20132001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20232001f49Smrg		;;
20332001f49Smrg	-sco*)
20432001f49Smrg		os=-sco3.2v2
20532001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20632001f49Smrg		;;
20732001f49Smrg	-udk*)
20832001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20932001f49Smrg		;;
21032001f49Smrg	-isc)
21132001f49Smrg		os=-isc2.2
21232001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21332001f49Smrg		;;
21432001f49Smrg	-clix*)
21532001f49Smrg		basic_machine=clipper-intergraph
21632001f49Smrg		;;
21732001f49Smrg	-isc*)
21832001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21932001f49Smrg		;;
22032001f49Smrg	-lynx*178)
22132001f49Smrg		os=-lynxos178
22232001f49Smrg		;;
22332001f49Smrg	-lynx*5)
22432001f49Smrg		os=-lynxos5
22532001f49Smrg		;;
22632001f49Smrg	-lynx*)
22732001f49Smrg		os=-lynxos
22832001f49Smrg		;;
22932001f49Smrg	-ptx*)
23032001f49Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
23132001f49Smrg		;;
23232001f49Smrg	-psos*)
23332001f49Smrg		os=-psos
23432001f49Smrg		;;
23532001f49Smrg	-mint | -mint[0-9]*)
23632001f49Smrg		basic_machine=m68k-atari
23732001f49Smrg		os=-mint
23832001f49Smrg		;;
23932001f49Smrgesac
24032001f49Smrg
24132001f49Smrg# Decode aliases for certain CPU-COMPANY combinations.
24232001f49Smrgcase $basic_machine in
24332001f49Smrg	# Recognize the basic CPU types without company name.
24432001f49Smrg	# Some are omitted here because they have special meanings below.
24532001f49Smrg	1750a | 580 \
24632001f49Smrg	| a29k \
24732001f49Smrg	| aarch64 | aarch64_be \
24832001f49Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
24932001f49Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
25032001f49Smrg	| am33_2.0 \
25132001f49Smrg	| arc | arceb \
25232001f49Smrg	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
25332001f49Smrg	| avr | avr32 \
2547ec3b29aSmrg	| ba \
25532001f49Smrg	| be32 | be64 \
25632001f49Smrg	| bfin \
25732001f49Smrg	| c4x | c8051 | clipper \
25832001f49Smrg	| d10v | d30v | dlx | dsp16xx \
2597ec3b29aSmrg	| e2k | epiphany \
2607ec3b29aSmrg	| fido | fr30 | frv | ft32 \
26132001f49Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
26232001f49Smrg	| hexagon \
2637ec3b29aSmrg	| i370 | i860 | i960 | ia16 | ia64 \
26432001f49Smrg	| ip2k | iq2000 \
26532001f49Smrg	| k1om \
26632001f49Smrg	| le32 | le64 \
26732001f49Smrg	| lm32 \
26832001f49Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
26932001f49Smrg	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
27032001f49Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
27132001f49Smrg	| mips16 \
27232001f49Smrg	| mips64 | mips64el \
27332001f49Smrg	| mips64octeon | mips64octeonel \
27432001f49Smrg	| mips64orion | mips64orionel \
27532001f49Smrg	| mips64r5900 | mips64r5900el \
27632001f49Smrg	| mips64vr | mips64vrel \
27732001f49Smrg	| mips64vr4100 | mips64vr4100el \
27832001f49Smrg	| mips64vr4300 | mips64vr4300el \
27932001f49Smrg	| mips64vr5000 | mips64vr5000el \
28032001f49Smrg	| mips64vr5900 | mips64vr5900el \
28132001f49Smrg	| mipsisa32 | mipsisa32el \
28232001f49Smrg	| mipsisa32r2 | mipsisa32r2el \
28332001f49Smrg	| mipsisa32r6 | mipsisa32r6el \
28432001f49Smrg	| mipsisa64 | mipsisa64el \
28532001f49Smrg	| mipsisa64r2 | mipsisa64r2el \
28632001f49Smrg	| mipsisa64r6 | mipsisa64r6el \
28732001f49Smrg	| mipsisa64sb1 | mipsisa64sb1el \
28832001f49Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
28932001f49Smrg	| mipsr5900 | mipsr5900el \
29032001f49Smrg	| mipstx39 | mipstx39el \
29132001f49Smrg	| mn10200 | mn10300 \
29232001f49Smrg	| moxie \
29332001f49Smrg	| mt \
29432001f49Smrg	| msp430 \
29532001f49Smrg	| nds32 | nds32le | nds32be \
29632001f49Smrg	| nios | nios2 | nios2eb | nios2el \
29732001f49Smrg	| ns16k | ns32k \
29832001f49Smrg	| open8 | or1k | or1knd | or32 \
29932001f49Smrg	| pdp10 | pdp11 | pj | pjl \
30032001f49Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle \
3017ec3b29aSmrg	| pru \
30232001f49Smrg	| pyramid \
3037ec3b29aSmrg	| riscv32 | riscv64 \
30432001f49Smrg	| rl78 | rx \
30532001f49Smrg	| score \
3067ec3b29aSmrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
30732001f49Smrg	| sh64 | sh64le \
30832001f49Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
30932001f49Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
31032001f49Smrg	| spu \
31132001f49Smrg	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
31232001f49Smrg	| ubicom32 \
31332001f49Smrg	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
3147ec3b29aSmrg	| visium \
3157ec3b29aSmrg	| wasm32 \
31632001f49Smrg	| x86 | xc16x | xstormy16 | xtensa \
31732001f49Smrg	| z8k | z80)
31832001f49Smrg		basic_machine=$basic_machine-unknown
31932001f49Smrg		;;
32032001f49Smrg	c54x)
32132001f49Smrg		basic_machine=tic54x-unknown
32232001f49Smrg		;;
32332001f49Smrg	c55x)
32432001f49Smrg		basic_machine=tic55x-unknown
32532001f49Smrg		;;
32632001f49Smrg	c6x)
32732001f49Smrg		basic_machine=tic6x-unknown
32832001f49Smrg		;;
3297ec3b29aSmrg	leon|leon[3-9])
3307ec3b29aSmrg		basic_machine=sparc-$basic_machine
3317ec3b29aSmrg		;;
33232001f49Smrg	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
33332001f49Smrg		basic_machine=$basic_machine-unknown
33432001f49Smrg		os=-none
33532001f49Smrg		;;
33632001f49Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
33732001f49Smrg		;;
33832001f49Smrg	ms1)
33932001f49Smrg		basic_machine=mt-unknown
34032001f49Smrg		;;
34132001f49Smrg
34232001f49Smrg	strongarm | thumb | xscale)
34332001f49Smrg		basic_machine=arm-unknown
34432001f49Smrg		;;
34532001f49Smrg	xgate)
34632001f49Smrg		basic_machine=$basic_machine-unknown
34732001f49Smrg		os=-none
34832001f49Smrg		;;
34932001f49Smrg	xscaleeb)
35032001f49Smrg		basic_machine=armeb-unknown
35132001f49Smrg		;;
35232001f49Smrg
35332001f49Smrg	xscaleel)
35432001f49Smrg		basic_machine=armel-unknown
35532001f49Smrg		;;
35632001f49Smrg
35732001f49Smrg	# We use `pc' rather than `unknown'
35832001f49Smrg	# because (1) that's what they normally are, and
35932001f49Smrg	# (2) the word "unknown" tends to confuse beginning users.
36032001f49Smrg	i*86 | x86_64)
36132001f49Smrg	  basic_machine=$basic_machine-pc
36232001f49Smrg	  ;;
36332001f49Smrg	# Object if more than one company name word.
36432001f49Smrg	*-*-*)
36532001f49Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
36632001f49Smrg		exit 1
36732001f49Smrg		;;
36832001f49Smrg	# Recognize the basic CPU types with company name.
36932001f49Smrg	580-* \
37032001f49Smrg	| a29k-* \
37132001f49Smrg	| aarch64-* | aarch64_be-* \
37232001f49Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
37332001f49Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
37432001f49Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
37532001f49Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
37632001f49Smrg	| avr-* | avr32-* \
3777ec3b29aSmrg	| ba-* \
37832001f49Smrg	| be32-* | be64-* \
37932001f49Smrg	| bfin-* | bs2000-* \
38032001f49Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* \
38132001f49Smrg	| c8051-* | clipper-* | craynv-* | cydra-* \
38232001f49Smrg	| d10v-* | d30v-* | dlx-* \
3837ec3b29aSmrg	| e2k-* | elxsi-* \
38432001f49Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
38532001f49Smrg	| h8300-* | h8500-* \
38632001f49Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
38732001f49Smrg	| hexagon-* \
3887ec3b29aSmrg	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
38932001f49Smrg	| ip2k-* | iq2000-* \
39032001f49Smrg	| k1om-* \
39132001f49Smrg	| le32-* | le64-* \
39232001f49Smrg	| lm32-* \
39332001f49Smrg	| m32c-* | m32r-* | m32rle-* \
39432001f49Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
39532001f49Smrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
39632001f49Smrg	| microblaze-* | microblazeel-* \
39732001f49Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
39832001f49Smrg	| mips16-* \
39932001f49Smrg	| mips64-* | mips64el-* \
40032001f49Smrg	| mips64octeon-* | mips64octeonel-* \
40132001f49Smrg	| mips64orion-* | mips64orionel-* \
40232001f49Smrg	| mips64r5900-* | mips64r5900el-* \
40332001f49Smrg	| mips64vr-* | mips64vrel-* \
40432001f49Smrg	| mips64vr4100-* | mips64vr4100el-* \
40532001f49Smrg	| mips64vr4300-* | mips64vr4300el-* \
40632001f49Smrg	| mips64vr5000-* | mips64vr5000el-* \
40732001f49Smrg	| mips64vr5900-* | mips64vr5900el-* \
40832001f49Smrg	| mipsisa32-* | mipsisa32el-* \
40932001f49Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
41032001f49Smrg	| mipsisa32r6-* | mipsisa32r6el-* \
41132001f49Smrg	| mipsisa64-* | mipsisa64el-* \
41232001f49Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
41332001f49Smrg	| mipsisa64r6-* | mipsisa64r6el-* \
41432001f49Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
41532001f49Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
41632001f49Smrg	| mipsr5900-* | mipsr5900el-* \
41732001f49Smrg	| mipstx39-* | mipstx39el-* \
41832001f49Smrg	| mmix-* \
41932001f49Smrg	| mt-* \
42032001f49Smrg	| msp430-* \
42132001f49Smrg	| nds32-* | nds32le-* | nds32be-* \
42232001f49Smrg	| nios-* | nios2-* | nios2eb-* | nios2el-* \
42332001f49Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
42432001f49Smrg	| open8-* \
42532001f49Smrg	| or1k*-* \
42632001f49Smrg	| orion-* \
42732001f49Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
42832001f49Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
4297ec3b29aSmrg	| pru-* \
43032001f49Smrg	| pyramid-* \
4317ec3b29aSmrg	| riscv32-* | riscv64-* \
43232001f49Smrg	| rl78-* | romp-* | rs6000-* | rx-* \
43332001f49Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
43432001f49Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
43532001f49Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
43632001f49Smrg	| sparclite-* \
4377ec3b29aSmrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
43832001f49Smrg	| tahoe-* \
43932001f49Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
44032001f49Smrg	| tile*-* \
44132001f49Smrg	| tron-* \
44232001f49Smrg	| ubicom32-* \
44332001f49Smrg	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
44432001f49Smrg	| vax-* \
4457ec3b29aSmrg	| visium-* \
4467ec3b29aSmrg	| wasm32-* \
44732001f49Smrg	| we32k-* \
44832001f49Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* \
44932001f49Smrg	| xstormy16-* | xtensa*-* \
45032001f49Smrg	| ymp-* \
45132001f49Smrg	| z8k-* | z80-*)
45232001f49Smrg		;;
45332001f49Smrg	# Recognize the basic CPU types without company name, with glob match.
45432001f49Smrg	xtensa*)
45532001f49Smrg		basic_machine=$basic_machine-unknown
45632001f49Smrg		;;
45732001f49Smrg	# Recognize the various machine names and aliases which stand
45832001f49Smrg	# for a CPU type and a company and sometimes even an OS.
45932001f49Smrg	386bsd)
46032001f49Smrg		basic_machine=i386-unknown
46132001f49Smrg		os=-bsd
46232001f49Smrg		;;
46332001f49Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
46432001f49Smrg		basic_machine=m68000-att
46532001f49Smrg		;;
46632001f49Smrg	3b*)
46732001f49Smrg		basic_machine=we32k-att
46832001f49Smrg		;;
46932001f49Smrg	a29khif)
47032001f49Smrg		basic_machine=a29k-amd
47132001f49Smrg		os=-udi
47232001f49Smrg		;;
47332001f49Smrg	abacus)
47432001f49Smrg		basic_machine=abacus-unknown
47532001f49Smrg		;;
47632001f49Smrg	adobe68k)
47732001f49Smrg		basic_machine=m68010-adobe
47832001f49Smrg		os=-scout
47932001f49Smrg		;;
48032001f49Smrg	alliant | fx80)
48132001f49Smrg		basic_machine=fx80-alliant
48232001f49Smrg		;;
48332001f49Smrg	altos | altos3068)
48432001f49Smrg		basic_machine=m68k-altos
48532001f49Smrg		;;
48632001f49Smrg	am29k)
48732001f49Smrg		basic_machine=a29k-none
48832001f49Smrg		os=-bsd
48932001f49Smrg		;;
49032001f49Smrg	amd64)
49132001f49Smrg		basic_machine=x86_64-pc
49232001f49Smrg		;;
49332001f49Smrg	amd64-*)
49432001f49Smrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
49532001f49Smrg		;;
49632001f49Smrg	amdahl)
49732001f49Smrg		basic_machine=580-amdahl
49832001f49Smrg		os=-sysv
49932001f49Smrg		;;
50032001f49Smrg	amiga | amiga-*)
50132001f49Smrg		basic_machine=m68k-unknown
50232001f49Smrg		;;
50332001f49Smrg	amigaos | amigados)
50432001f49Smrg		basic_machine=m68k-unknown
50532001f49Smrg		os=-amigaos
50632001f49Smrg		;;
50732001f49Smrg	amigaunix | amix)
50832001f49Smrg		basic_machine=m68k-unknown
50932001f49Smrg		os=-sysv4
51032001f49Smrg		;;
51132001f49Smrg	apollo68)
51232001f49Smrg		basic_machine=m68k-apollo
51332001f49Smrg		os=-sysv
51432001f49Smrg		;;
51532001f49Smrg	apollo68bsd)
51632001f49Smrg		basic_machine=m68k-apollo
51732001f49Smrg		os=-bsd
51832001f49Smrg		;;
51932001f49Smrg	aros)
52032001f49Smrg		basic_machine=i386-pc
52132001f49Smrg		os=-aros
52232001f49Smrg		;;
5237ec3b29aSmrg	asmjs)
5247ec3b29aSmrg		basic_machine=asmjs-unknown
5257ec3b29aSmrg		;;
52632001f49Smrg	aux)
52732001f49Smrg		basic_machine=m68k-apple
52832001f49Smrg		os=-aux
52932001f49Smrg		;;
53032001f49Smrg	balance)
53132001f49Smrg		basic_machine=ns32k-sequent
53232001f49Smrg		os=-dynix
53332001f49Smrg		;;
53432001f49Smrg	blackfin)
53532001f49Smrg		basic_machine=bfin-unknown
53632001f49Smrg		os=-linux
53732001f49Smrg		;;
53832001f49Smrg	blackfin-*)
53932001f49Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
54032001f49Smrg		os=-linux
54132001f49Smrg		;;
54232001f49Smrg	bluegene*)
54332001f49Smrg		basic_machine=powerpc-ibm
54432001f49Smrg		os=-cnk
54532001f49Smrg		;;
54632001f49Smrg	c54x-*)
54732001f49Smrg		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
54832001f49Smrg		;;
54932001f49Smrg	c55x-*)
55032001f49Smrg		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
55132001f49Smrg		;;
55232001f49Smrg	c6x-*)
55332001f49Smrg		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
55432001f49Smrg		;;
55532001f49Smrg	c90)
55632001f49Smrg		basic_machine=c90-cray
55732001f49Smrg		os=-unicos
55832001f49Smrg		;;
55932001f49Smrg	cegcc)
56032001f49Smrg		basic_machine=arm-unknown
56132001f49Smrg		os=-cegcc
56232001f49Smrg		;;
56332001f49Smrg	convex-c1)
56432001f49Smrg		basic_machine=c1-convex
56532001f49Smrg		os=-bsd
56632001f49Smrg		;;
56732001f49Smrg	convex-c2)
56832001f49Smrg		basic_machine=c2-convex
56932001f49Smrg		os=-bsd
57032001f49Smrg		;;
57132001f49Smrg	convex-c32)
57232001f49Smrg		basic_machine=c32-convex
57332001f49Smrg		os=-bsd
57432001f49Smrg		;;
57532001f49Smrg	convex-c34)
57632001f49Smrg		basic_machine=c34-convex
57732001f49Smrg		os=-bsd
57832001f49Smrg		;;
57932001f49Smrg	convex-c38)
58032001f49Smrg		basic_machine=c38-convex
58132001f49Smrg		os=-bsd
58232001f49Smrg		;;
58332001f49Smrg	cray | j90)
58432001f49Smrg		basic_machine=j90-cray
58532001f49Smrg		os=-unicos
58632001f49Smrg		;;
58732001f49Smrg	craynv)
58832001f49Smrg		basic_machine=craynv-cray
58932001f49Smrg		os=-unicosmp
59032001f49Smrg		;;
59132001f49Smrg	cr16 | cr16-*)
59232001f49Smrg		basic_machine=cr16-unknown
59332001f49Smrg		os=-elf
59432001f49Smrg		;;
59532001f49Smrg	crds | unos)
59632001f49Smrg		basic_machine=m68k-crds
59732001f49Smrg		;;
59832001f49Smrg	crisv32 | crisv32-* | etraxfs*)
59932001f49Smrg		basic_machine=crisv32-axis
60032001f49Smrg		;;
60132001f49Smrg	cris | cris-* | etrax*)
60232001f49Smrg		basic_machine=cris-axis
60332001f49Smrg		;;
60432001f49Smrg	crx)
60532001f49Smrg		basic_machine=crx-unknown
60632001f49Smrg		os=-elf
60732001f49Smrg		;;
60832001f49Smrg	da30 | da30-*)
60932001f49Smrg		basic_machine=m68k-da30
61032001f49Smrg		;;
61132001f49Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
61232001f49Smrg		basic_machine=mips-dec
61332001f49Smrg		;;
61432001f49Smrg	decsystem10* | dec10*)
61532001f49Smrg		basic_machine=pdp10-dec
61632001f49Smrg		os=-tops10
61732001f49Smrg		;;
61832001f49Smrg	decsystem20* | dec20*)
61932001f49Smrg		basic_machine=pdp10-dec
62032001f49Smrg		os=-tops20
62132001f49Smrg		;;
62232001f49Smrg	delta | 3300 | motorola-3300 | motorola-delta \
62332001f49Smrg	      | 3300-motorola | delta-motorola)
62432001f49Smrg		basic_machine=m68k-motorola
62532001f49Smrg		;;
62632001f49Smrg	delta88)
62732001f49Smrg		basic_machine=m88k-motorola
62832001f49Smrg		os=-sysv3
62932001f49Smrg		;;
63032001f49Smrg	dicos)
63132001f49Smrg		basic_machine=i686-pc
63232001f49Smrg		os=-dicos
63332001f49Smrg		;;
63432001f49Smrg	djgpp)
63532001f49Smrg		basic_machine=i586-pc
63632001f49Smrg		os=-msdosdjgpp
63732001f49Smrg		;;
63832001f49Smrg	dpx20 | dpx20-*)
63932001f49Smrg		basic_machine=rs6000-bull
64032001f49Smrg		os=-bosx
64132001f49Smrg		;;
6427ec3b29aSmrg	dpx2*)
64332001f49Smrg		basic_machine=m68k-bull
64432001f49Smrg		os=-sysv3
64532001f49Smrg		;;
6467ec3b29aSmrg	e500v[12])
6477ec3b29aSmrg		basic_machine=powerpc-unknown
6487ec3b29aSmrg		os=$os"spe"
6497ec3b29aSmrg		;;
6507ec3b29aSmrg	e500v[12]-*)
6517ec3b29aSmrg		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
6527ec3b29aSmrg		os=$os"spe"
6537ec3b29aSmrg		;;
65432001f49Smrg	ebmon29k)
65532001f49Smrg		basic_machine=a29k-amd
65632001f49Smrg		os=-ebmon
65732001f49Smrg		;;
65832001f49Smrg	elxsi)
65932001f49Smrg		basic_machine=elxsi-elxsi
66032001f49Smrg		os=-bsd
66132001f49Smrg		;;
66232001f49Smrg	encore | umax | mmax)
66332001f49Smrg		basic_machine=ns32k-encore
66432001f49Smrg		;;
66532001f49Smrg	es1800 | OSE68k | ose68k | ose | OSE)
66632001f49Smrg		basic_machine=m68k-ericsson
66732001f49Smrg		os=-ose
66832001f49Smrg		;;
66932001f49Smrg	fx2800)
67032001f49Smrg		basic_machine=i860-alliant
67132001f49Smrg		;;
67232001f49Smrg	genix)
67332001f49Smrg		basic_machine=ns32k-ns
67432001f49Smrg		;;
67532001f49Smrg	gmicro)
67632001f49Smrg		basic_machine=tron-gmicro
67732001f49Smrg		os=-sysv
67832001f49Smrg		;;
67932001f49Smrg	go32)
68032001f49Smrg		basic_machine=i386-pc
68132001f49Smrg		os=-go32
68232001f49Smrg		;;
68332001f49Smrg	h3050r* | hiux*)
68432001f49Smrg		basic_machine=hppa1.1-hitachi
68532001f49Smrg		os=-hiuxwe2
68632001f49Smrg		;;
68732001f49Smrg	h8300hms)
68832001f49Smrg		basic_machine=h8300-hitachi
68932001f49Smrg		os=-hms
69032001f49Smrg		;;
69132001f49Smrg	h8300xray)
69232001f49Smrg		basic_machine=h8300-hitachi
69332001f49Smrg		os=-xray
69432001f49Smrg		;;
69532001f49Smrg	h8500hms)
69632001f49Smrg		basic_machine=h8500-hitachi
69732001f49Smrg		os=-hms
69832001f49Smrg		;;
69932001f49Smrg	harris)
70032001f49Smrg		basic_machine=m88k-harris
70132001f49Smrg		os=-sysv3
70232001f49Smrg		;;
70332001f49Smrg	hp300-*)
70432001f49Smrg		basic_machine=m68k-hp
70532001f49Smrg		;;
70632001f49Smrg	hp300bsd)
70732001f49Smrg		basic_machine=m68k-hp
70832001f49Smrg		os=-bsd
70932001f49Smrg		;;
71032001f49Smrg	hp300hpux)
71132001f49Smrg		basic_machine=m68k-hp
71232001f49Smrg		os=-hpux
71332001f49Smrg		;;
71432001f49Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
71532001f49Smrg		basic_machine=hppa1.0-hp
71632001f49Smrg		;;
71732001f49Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
71832001f49Smrg		basic_machine=m68000-hp
71932001f49Smrg		;;
72032001f49Smrg	hp9k3[2-9][0-9])
72132001f49Smrg		basic_machine=m68k-hp
72232001f49Smrg		;;
72332001f49Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
72432001f49Smrg		basic_machine=hppa1.0-hp
72532001f49Smrg		;;
72632001f49Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
72732001f49Smrg		basic_machine=hppa1.1-hp
72832001f49Smrg		;;
72932001f49Smrg	hp9k78[0-9] | hp78[0-9])
73032001f49Smrg		# FIXME: really hppa2.0-hp
73132001f49Smrg		basic_machine=hppa1.1-hp
73232001f49Smrg		;;
73332001f49Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
73432001f49Smrg		# FIXME: really hppa2.0-hp
73532001f49Smrg		basic_machine=hppa1.1-hp
73632001f49Smrg		;;
73732001f49Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
73832001f49Smrg		basic_machine=hppa1.1-hp
73932001f49Smrg		;;
74032001f49Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
74132001f49Smrg		basic_machine=hppa1.0-hp
74232001f49Smrg		;;
74332001f49Smrg	hppa-next)
74432001f49Smrg		os=-nextstep3
74532001f49Smrg		;;
74632001f49Smrg	hppaosf)
74732001f49Smrg		basic_machine=hppa1.1-hp
74832001f49Smrg		os=-osf
74932001f49Smrg		;;
75032001f49Smrg	hppro)
75132001f49Smrg		basic_machine=hppa1.1-hp
75232001f49Smrg		os=-proelf
75332001f49Smrg		;;
75432001f49Smrg	i370-ibm* | ibm*)
75532001f49Smrg		basic_machine=i370-ibm
75632001f49Smrg		;;
75732001f49Smrg	i*86v32)
75832001f49Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
75932001f49Smrg		os=-sysv32
76032001f49Smrg		;;
76132001f49Smrg	i*86v4*)
76232001f49Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
76332001f49Smrg		os=-sysv4
76432001f49Smrg		;;
76532001f49Smrg	i*86v)
76632001f49Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
76732001f49Smrg		os=-sysv
76832001f49Smrg		;;
76932001f49Smrg	i*86sol2)
77032001f49Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
77132001f49Smrg		os=-solaris2
77232001f49Smrg		;;
77332001f49Smrg	i386mach)
77432001f49Smrg		basic_machine=i386-mach
77532001f49Smrg		os=-mach
77632001f49Smrg		;;
77732001f49Smrg	i386-vsta | vsta)
77832001f49Smrg		basic_machine=i386-unknown
77932001f49Smrg		os=-vsta
78032001f49Smrg		;;
78132001f49Smrg	iris | iris4d)
78232001f49Smrg		basic_machine=mips-sgi
78332001f49Smrg		case $os in
78432001f49Smrg		    -irix*)
78532001f49Smrg			;;
78632001f49Smrg		    *)
78732001f49Smrg			os=-irix4
78832001f49Smrg			;;
78932001f49Smrg		esac
79032001f49Smrg		;;
79132001f49Smrg	isi68 | isi)
79232001f49Smrg		basic_machine=m68k-isi
79332001f49Smrg		os=-sysv
79432001f49Smrg		;;
7957ec3b29aSmrg	leon-*|leon[3-9]-*)
7967ec3b29aSmrg		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
7977ec3b29aSmrg		;;
79832001f49Smrg	m68knommu)
79932001f49Smrg		basic_machine=m68k-unknown
80032001f49Smrg		os=-linux
80132001f49Smrg		;;
80232001f49Smrg	m68knommu-*)
80332001f49Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
80432001f49Smrg		os=-linux
80532001f49Smrg		;;
80632001f49Smrg	m88k-omron*)
80732001f49Smrg		basic_machine=m88k-omron
80832001f49Smrg		;;
80932001f49Smrg	magnum | m3230)
81032001f49Smrg		basic_machine=mips-mips
81132001f49Smrg		os=-sysv
81232001f49Smrg		;;
81332001f49Smrg	merlin)
81432001f49Smrg		basic_machine=ns32k-utek
81532001f49Smrg		os=-sysv
81632001f49Smrg		;;
81732001f49Smrg	microblaze*)
81832001f49Smrg		basic_machine=microblaze-xilinx
81932001f49Smrg		;;
82032001f49Smrg	mingw64)
82132001f49Smrg		basic_machine=x86_64-pc
82232001f49Smrg		os=-mingw64
82332001f49Smrg		;;
82432001f49Smrg	mingw32)
82532001f49Smrg		basic_machine=i686-pc
82632001f49Smrg		os=-mingw32
82732001f49Smrg		;;
82832001f49Smrg	mingw32ce)
82932001f49Smrg		basic_machine=arm-unknown
83032001f49Smrg		os=-mingw32ce
83132001f49Smrg		;;
83232001f49Smrg	miniframe)
83332001f49Smrg		basic_machine=m68000-convergent
83432001f49Smrg		;;
83532001f49Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
83632001f49Smrg		basic_machine=m68k-atari
83732001f49Smrg		os=-mint
83832001f49Smrg		;;
83932001f49Smrg	mips3*-*)
84032001f49Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
84132001f49Smrg		;;
84232001f49Smrg	mips3*)
84332001f49Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
84432001f49Smrg		;;
84532001f49Smrg	monitor)
84632001f49Smrg		basic_machine=m68k-rom68k
84732001f49Smrg		os=-coff
84832001f49Smrg		;;
84932001f49Smrg	morphos)
85032001f49Smrg		basic_machine=powerpc-unknown
85132001f49Smrg		os=-morphos
85232001f49Smrg		;;
8537ec3b29aSmrg	moxiebox)
8547ec3b29aSmrg		basic_machine=moxie-unknown
8557ec3b29aSmrg		os=-moxiebox
8567ec3b29aSmrg		;;
85732001f49Smrg	msdos)
85832001f49Smrg		basic_machine=i386-pc
85932001f49Smrg		os=-msdos
86032001f49Smrg		;;
86132001f49Smrg	ms1-*)
86232001f49Smrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
86332001f49Smrg		;;
86432001f49Smrg	msys)
86532001f49Smrg		basic_machine=i686-pc
86632001f49Smrg		os=-msys
86732001f49Smrg		;;
86832001f49Smrg	mvs)
86932001f49Smrg		basic_machine=i370-ibm
87032001f49Smrg		os=-mvs
87132001f49Smrg		;;
87232001f49Smrg	nacl)
87332001f49Smrg		basic_machine=le32-unknown
87432001f49Smrg		os=-nacl
87532001f49Smrg		;;
87632001f49Smrg	ncr3000)
87732001f49Smrg		basic_machine=i486-ncr
87832001f49Smrg		os=-sysv4
87932001f49Smrg		;;
88032001f49Smrg	netbsd386)
88132001f49Smrg		basic_machine=i386-unknown
88232001f49Smrg		os=-netbsd
88332001f49Smrg		;;
88432001f49Smrg	netwinder)
88532001f49Smrg		basic_machine=armv4l-rebel
88632001f49Smrg		os=-linux
88732001f49Smrg		;;
88832001f49Smrg	news | news700 | news800 | news900)
88932001f49Smrg		basic_machine=m68k-sony
89032001f49Smrg		os=-newsos
89132001f49Smrg		;;
89232001f49Smrg	news1000)
89332001f49Smrg		basic_machine=m68030-sony
89432001f49Smrg		os=-newsos
89532001f49Smrg		;;
89632001f49Smrg	news-3600 | risc-news)
89732001f49Smrg		basic_machine=mips-sony
89832001f49Smrg		os=-newsos
89932001f49Smrg		;;
90032001f49Smrg	necv70)
90132001f49Smrg		basic_machine=v70-nec
90232001f49Smrg		os=-sysv
90332001f49Smrg		;;
9047ec3b29aSmrg	next | m*-next)
90532001f49Smrg		basic_machine=m68k-next
90632001f49Smrg		case $os in
90732001f49Smrg		    -nextstep* )
90832001f49Smrg			;;
90932001f49Smrg		    -ns2*)
91032001f49Smrg		      os=-nextstep2
91132001f49Smrg			;;
91232001f49Smrg		    *)
91332001f49Smrg		      os=-nextstep3
91432001f49Smrg			;;
91532001f49Smrg		esac
91632001f49Smrg		;;
91732001f49Smrg	nh3000)
91832001f49Smrg		basic_machine=m68k-harris
91932001f49Smrg		os=-cxux
92032001f49Smrg		;;
92132001f49Smrg	nh[45]000)
92232001f49Smrg		basic_machine=m88k-harris
92332001f49Smrg		os=-cxux
92432001f49Smrg		;;
92532001f49Smrg	nindy960)
92632001f49Smrg		basic_machine=i960-intel
92732001f49Smrg		os=-nindy
92832001f49Smrg		;;
92932001f49Smrg	mon960)
93032001f49Smrg		basic_machine=i960-intel
93132001f49Smrg		os=-mon960
93232001f49Smrg		;;
93332001f49Smrg	nonstopux)
93432001f49Smrg		basic_machine=mips-compaq
93532001f49Smrg		os=-nonstopux
93632001f49Smrg		;;
93732001f49Smrg	np1)
93832001f49Smrg		basic_machine=np1-gould
93932001f49Smrg		;;
94032001f49Smrg	neo-tandem)
94132001f49Smrg		basic_machine=neo-tandem
94232001f49Smrg		;;
94332001f49Smrg	nse-tandem)
94432001f49Smrg		basic_machine=nse-tandem
94532001f49Smrg		;;
94632001f49Smrg	nsr-tandem)
94732001f49Smrg		basic_machine=nsr-tandem
94832001f49Smrg		;;
9497ec3b29aSmrg	nsx-tandem)
9507ec3b29aSmrg		basic_machine=nsx-tandem
9517ec3b29aSmrg		;;
95232001f49Smrg	op50n-* | op60c-*)
95332001f49Smrg		basic_machine=hppa1.1-oki
95432001f49Smrg		os=-proelf
95532001f49Smrg		;;
95632001f49Smrg	openrisc | openrisc-*)
95732001f49Smrg		basic_machine=or32-unknown
95832001f49Smrg		;;
95932001f49Smrg	os400)
96032001f49Smrg		basic_machine=powerpc-ibm
96132001f49Smrg		os=-os400
96232001f49Smrg		;;
96332001f49Smrg	OSE68000 | ose68000)
96432001f49Smrg		basic_machine=m68000-ericsson
96532001f49Smrg		os=-ose
96632001f49Smrg		;;
96732001f49Smrg	os68k)
96832001f49Smrg		basic_machine=m68k-none
96932001f49Smrg		os=-os68k
97032001f49Smrg		;;
97132001f49Smrg	pa-hitachi)
97232001f49Smrg		basic_machine=hppa1.1-hitachi
97332001f49Smrg		os=-hiuxwe2
97432001f49Smrg		;;
97532001f49Smrg	paragon)
97632001f49Smrg		basic_machine=i860-intel
97732001f49Smrg		os=-osf
97832001f49Smrg		;;
97932001f49Smrg	parisc)
98032001f49Smrg		basic_machine=hppa-unknown
98132001f49Smrg		os=-linux
98232001f49Smrg		;;
98332001f49Smrg	parisc-*)
98432001f49Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
98532001f49Smrg		os=-linux
98632001f49Smrg		;;
98732001f49Smrg	pbd)
98832001f49Smrg		basic_machine=sparc-tti
98932001f49Smrg		;;
99032001f49Smrg	pbb)
99132001f49Smrg		basic_machine=m68k-tti
99232001f49Smrg		;;
99332001f49Smrg	pc532 | pc532-*)
99432001f49Smrg		basic_machine=ns32k-pc532
99532001f49Smrg		;;
99632001f49Smrg	pc98)
99732001f49Smrg		basic_machine=i386-pc
99832001f49Smrg		;;
99932001f49Smrg	pc98-*)
100032001f49Smrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
100132001f49Smrg		;;
100232001f49Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
100332001f49Smrg		basic_machine=i586-pc
100432001f49Smrg		;;
100532001f49Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
100632001f49Smrg		basic_machine=i686-pc
100732001f49Smrg		;;
100832001f49Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
100932001f49Smrg		basic_machine=i686-pc
101032001f49Smrg		;;
101132001f49Smrg	pentium4)
101232001f49Smrg		basic_machine=i786-pc
101332001f49Smrg		;;
101432001f49Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
101532001f49Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
101632001f49Smrg		;;
101732001f49Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
101832001f49Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
101932001f49Smrg		;;
102032001f49Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
102132001f49Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
102232001f49Smrg		;;
102332001f49Smrg	pentium4-*)
102432001f49Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
102532001f49Smrg		;;
102632001f49Smrg	pn)
102732001f49Smrg		basic_machine=pn-gould
102832001f49Smrg		;;
102932001f49Smrg	power)	basic_machine=power-ibm
103032001f49Smrg		;;
103132001f49Smrg	ppc | ppcbe)	basic_machine=powerpc-unknown
103232001f49Smrg		;;
103332001f49Smrg	ppc-* | ppcbe-*)
103432001f49Smrg		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
103532001f49Smrg		;;
10367ec3b29aSmrg	ppcle | powerpclittle)
103732001f49Smrg		basic_machine=powerpcle-unknown
103832001f49Smrg		;;
103932001f49Smrg	ppcle-* | powerpclittle-*)
104032001f49Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
104132001f49Smrg		;;
104232001f49Smrg	ppc64)	basic_machine=powerpc64-unknown
104332001f49Smrg		;;
104432001f49Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
104532001f49Smrg		;;
10467ec3b29aSmrg	ppc64le | powerpc64little)
104732001f49Smrg		basic_machine=powerpc64le-unknown
104832001f49Smrg		;;
104932001f49Smrg	ppc64le-* | powerpc64little-*)
105032001f49Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
105132001f49Smrg		;;
105232001f49Smrg	ps2)
105332001f49Smrg		basic_machine=i386-ibm
105432001f49Smrg		;;
105532001f49Smrg	pw32)
105632001f49Smrg		basic_machine=i586-unknown
105732001f49Smrg		os=-pw32
105832001f49Smrg		;;
105932001f49Smrg	rdos | rdos64)
106032001f49Smrg		basic_machine=x86_64-pc
106132001f49Smrg		os=-rdos
106232001f49Smrg		;;
106332001f49Smrg	rdos32)
106432001f49Smrg		basic_machine=i386-pc
106532001f49Smrg		os=-rdos
106632001f49Smrg		;;
106732001f49Smrg	rom68k)
106832001f49Smrg		basic_machine=m68k-rom68k
106932001f49Smrg		os=-coff
107032001f49Smrg		;;
107132001f49Smrg	rm[46]00)
107232001f49Smrg		basic_machine=mips-siemens
107332001f49Smrg		;;
107432001f49Smrg	rtpc | rtpc-*)
107532001f49Smrg		basic_machine=romp-ibm
107632001f49Smrg		;;
107732001f49Smrg	s390 | s390-*)
107832001f49Smrg		basic_machine=s390-ibm
107932001f49Smrg		;;
108032001f49Smrg	s390x | s390x-*)
108132001f49Smrg		basic_machine=s390x-ibm
108232001f49Smrg		;;
108332001f49Smrg	sa29200)
108432001f49Smrg		basic_machine=a29k-amd
108532001f49Smrg		os=-udi
108632001f49Smrg		;;
108732001f49Smrg	sb1)
108832001f49Smrg		basic_machine=mipsisa64sb1-unknown
108932001f49Smrg		;;
109032001f49Smrg	sb1el)
109132001f49Smrg		basic_machine=mipsisa64sb1el-unknown
109232001f49Smrg		;;
109332001f49Smrg	sde)
109432001f49Smrg		basic_machine=mipsisa32-sde
109532001f49Smrg		os=-elf
109632001f49Smrg		;;
109732001f49Smrg	sei)
109832001f49Smrg		basic_machine=mips-sei
109932001f49Smrg		os=-seiux
110032001f49Smrg		;;
110132001f49Smrg	sequent)
110232001f49Smrg		basic_machine=i386-sequent
110332001f49Smrg		;;
110432001f49Smrg	sh)
110532001f49Smrg		basic_machine=sh-hitachi
110632001f49Smrg		os=-hms
110732001f49Smrg		;;
110832001f49Smrg	sh5el)
110932001f49Smrg		basic_machine=sh5le-unknown
111032001f49Smrg		;;
111132001f49Smrg	sh64)
111232001f49Smrg		basic_machine=sh64-unknown
111332001f49Smrg		;;
111432001f49Smrg	sparclite-wrs | simso-wrs)
111532001f49Smrg		basic_machine=sparclite-wrs
111632001f49Smrg		os=-vxworks
111732001f49Smrg		;;
111832001f49Smrg	sps7)
111932001f49Smrg		basic_machine=m68k-bull
112032001f49Smrg		os=-sysv2
112132001f49Smrg		;;
112232001f49Smrg	spur)
112332001f49Smrg		basic_machine=spur-unknown
112432001f49Smrg		;;
112532001f49Smrg	st2000)
112632001f49Smrg		basic_machine=m68k-tandem
112732001f49Smrg		;;
112832001f49Smrg	stratus)
112932001f49Smrg		basic_machine=i860-stratus
113032001f49Smrg		os=-sysv4
113132001f49Smrg		;;
113232001f49Smrg	strongarm-* | thumb-*)
113332001f49Smrg		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
113432001f49Smrg		;;
113532001f49Smrg	sun2)
113632001f49Smrg		basic_machine=m68000-sun
113732001f49Smrg		;;
113832001f49Smrg	sun2os3)
113932001f49Smrg		basic_machine=m68000-sun
114032001f49Smrg		os=-sunos3
114132001f49Smrg		;;
114232001f49Smrg	sun2os4)
114332001f49Smrg		basic_machine=m68000-sun
114432001f49Smrg		os=-sunos4
114532001f49Smrg		;;
114632001f49Smrg	sun3os3)
114732001f49Smrg		basic_machine=m68k-sun
114832001f49Smrg		os=-sunos3
114932001f49Smrg		;;
115032001f49Smrg	sun3os4)
115132001f49Smrg		basic_machine=m68k-sun
115232001f49Smrg		os=-sunos4
115332001f49Smrg		;;
115432001f49Smrg	sun4os3)
115532001f49Smrg		basic_machine=sparc-sun
115632001f49Smrg		os=-sunos3
115732001f49Smrg		;;
115832001f49Smrg	sun4os4)
115932001f49Smrg		basic_machine=sparc-sun
116032001f49Smrg		os=-sunos4
116132001f49Smrg		;;
116232001f49Smrg	sun4sol2)
116332001f49Smrg		basic_machine=sparc-sun
116432001f49Smrg		os=-solaris2
116532001f49Smrg		;;
116632001f49Smrg	sun3 | sun3-*)
116732001f49Smrg		basic_machine=m68k-sun
116832001f49Smrg		;;
116932001f49Smrg	sun4)
117032001f49Smrg		basic_machine=sparc-sun
117132001f49Smrg		;;
117232001f49Smrg	sun386 | sun386i | roadrunner)
117332001f49Smrg		basic_machine=i386-sun
117432001f49Smrg		;;
117532001f49Smrg	sv1)
117632001f49Smrg		basic_machine=sv1-cray
117732001f49Smrg		os=-unicos
117832001f49Smrg		;;
117932001f49Smrg	symmetry)
118032001f49Smrg		basic_machine=i386-sequent
118132001f49Smrg		os=-dynix
118232001f49Smrg		;;
118332001f49Smrg	t3e)
118432001f49Smrg		basic_machine=alphaev5-cray
118532001f49Smrg		os=-unicos
118632001f49Smrg		;;
118732001f49Smrg	t90)
118832001f49Smrg		basic_machine=t90-cray
118932001f49Smrg		os=-unicos
119032001f49Smrg		;;
119132001f49Smrg	tile*)
119232001f49Smrg		basic_machine=$basic_machine-unknown
119332001f49Smrg		os=-linux-gnu
119432001f49Smrg		;;
119532001f49Smrg	tx39)
119632001f49Smrg		basic_machine=mipstx39-unknown
119732001f49Smrg		;;
119832001f49Smrg	tx39el)
119932001f49Smrg		basic_machine=mipstx39el-unknown
120032001f49Smrg		;;
120132001f49Smrg	toad1)
120232001f49Smrg		basic_machine=pdp10-xkl
120332001f49Smrg		os=-tops20
120432001f49Smrg		;;
120532001f49Smrg	tower | tower-32)
120632001f49Smrg		basic_machine=m68k-ncr
120732001f49Smrg		;;
120832001f49Smrg	tpf)
120932001f49Smrg		basic_machine=s390x-ibm
121032001f49Smrg		os=-tpf
121132001f49Smrg		;;
121232001f49Smrg	udi29k)
121332001f49Smrg		basic_machine=a29k-amd
121432001f49Smrg		os=-udi
121532001f49Smrg		;;
121632001f49Smrg	ultra3)
121732001f49Smrg		basic_machine=a29k-nyu
121832001f49Smrg		os=-sym1
121932001f49Smrg		;;
122032001f49Smrg	v810 | necv810)
122132001f49Smrg		basic_machine=v810-nec
122232001f49Smrg		os=-none
122332001f49Smrg		;;
122432001f49Smrg	vaxv)
122532001f49Smrg		basic_machine=vax-dec
122632001f49Smrg		os=-sysv
122732001f49Smrg		;;
122832001f49Smrg	vms)
122932001f49Smrg		basic_machine=vax-dec
123032001f49Smrg		os=-vms
123132001f49Smrg		;;
123232001f49Smrg	vpp*|vx|vx-*)
123332001f49Smrg		basic_machine=f301-fujitsu
123432001f49Smrg		;;
123532001f49Smrg	vxworks960)
123632001f49Smrg		basic_machine=i960-wrs
123732001f49Smrg		os=-vxworks
123832001f49Smrg		;;
123932001f49Smrg	vxworks68)
124032001f49Smrg		basic_machine=m68k-wrs
124132001f49Smrg		os=-vxworks
124232001f49Smrg		;;
124332001f49Smrg	vxworks29k)
124432001f49Smrg		basic_machine=a29k-wrs
124532001f49Smrg		os=-vxworks
124632001f49Smrg		;;
12477ec3b29aSmrg	wasm32)
12487ec3b29aSmrg		basic_machine=wasm32-unknown
12497ec3b29aSmrg		;;
125032001f49Smrg	w65*)
125132001f49Smrg		basic_machine=w65-wdc
125232001f49Smrg		os=-none
125332001f49Smrg		;;
125432001f49Smrg	w89k-*)
125532001f49Smrg		basic_machine=hppa1.1-winbond
125632001f49Smrg		os=-proelf
125732001f49Smrg		;;
12587ec3b29aSmrg	x64)
12597ec3b29aSmrg		basic_machine=x86_64-pc
12607ec3b29aSmrg		;;
126132001f49Smrg	xbox)
126232001f49Smrg		basic_machine=i686-pc
126332001f49Smrg		os=-mingw32
126432001f49Smrg		;;
126532001f49Smrg	xps | xps100)
126632001f49Smrg		basic_machine=xps100-honeywell
126732001f49Smrg		;;
126832001f49Smrg	xscale-* | xscalee[bl]-*)
126932001f49Smrg		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
127032001f49Smrg		;;
127132001f49Smrg	ymp)
127232001f49Smrg		basic_machine=ymp-cray
127332001f49Smrg		os=-unicos
127432001f49Smrg		;;
127532001f49Smrg	z8k-*-coff)
127632001f49Smrg		basic_machine=z8k-unknown
127732001f49Smrg		os=-sim
127832001f49Smrg		;;
127932001f49Smrg	z80-*-coff)
128032001f49Smrg		basic_machine=z80-unknown
128132001f49Smrg		os=-sim
128232001f49Smrg		;;
128332001f49Smrg	none)
128432001f49Smrg		basic_machine=none-none
128532001f49Smrg		os=-none
128632001f49Smrg		;;
128732001f49Smrg
128832001f49Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
128932001f49Smrg# some cases the only manufacturer, in others, it is the most popular.
129032001f49Smrg	w89k)
129132001f49Smrg		basic_machine=hppa1.1-winbond
129232001f49Smrg		;;
129332001f49Smrg	op50n)
129432001f49Smrg		basic_machine=hppa1.1-oki
129532001f49Smrg		;;
129632001f49Smrg	op60c)
129732001f49Smrg		basic_machine=hppa1.1-oki
129832001f49Smrg		;;
129932001f49Smrg	romp)
130032001f49Smrg		basic_machine=romp-ibm
130132001f49Smrg		;;
130232001f49Smrg	mmix)
130332001f49Smrg		basic_machine=mmix-knuth
130432001f49Smrg		;;
130532001f49Smrg	rs6000)
130632001f49Smrg		basic_machine=rs6000-ibm
130732001f49Smrg		;;
130832001f49Smrg	vax)
130932001f49Smrg		basic_machine=vax-dec
131032001f49Smrg		;;
131132001f49Smrg	pdp10)
131232001f49Smrg		# there are many clones, so DEC is not a safe bet
131332001f49Smrg		basic_machine=pdp10-unknown
131432001f49Smrg		;;
131532001f49Smrg	pdp11)
131632001f49Smrg		basic_machine=pdp11-dec
131732001f49Smrg		;;
131832001f49Smrg	we32k)
131932001f49Smrg		basic_machine=we32k-att
132032001f49Smrg		;;
132132001f49Smrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
132232001f49Smrg		basic_machine=sh-unknown
132332001f49Smrg		;;
132432001f49Smrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
132532001f49Smrg		basic_machine=sparc-sun
132632001f49Smrg		;;
132732001f49Smrg	cydra)
132832001f49Smrg		basic_machine=cydra-cydrome
132932001f49Smrg		;;
133032001f49Smrg	orion)
133132001f49Smrg		basic_machine=orion-highlevel
133232001f49Smrg		;;
133332001f49Smrg	orion105)
133432001f49Smrg		basic_machine=clipper-highlevel
133532001f49Smrg		;;
133632001f49Smrg	mac | mpw | mac-mpw)
133732001f49Smrg		basic_machine=m68k-apple
133832001f49Smrg		;;
133932001f49Smrg	pmac | pmac-mpw)
134032001f49Smrg		basic_machine=powerpc-apple
134132001f49Smrg		;;
134232001f49Smrg	*-unknown)
134332001f49Smrg		# Make sure to match an already-canonicalized machine name.
134432001f49Smrg		;;
134532001f49Smrg	*)
134632001f49Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
134732001f49Smrg		exit 1
134832001f49Smrg		;;
134932001f49Smrgesac
135032001f49Smrg
135132001f49Smrg# Here we canonicalize certain aliases for manufacturers.
135232001f49Smrgcase $basic_machine in
135332001f49Smrg	*-digital*)
135432001f49Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
135532001f49Smrg		;;
135632001f49Smrg	*-commodore*)
135732001f49Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
135832001f49Smrg		;;
135932001f49Smrg	*)
136032001f49Smrg		;;
136132001f49Smrgesac
136232001f49Smrg
136332001f49Smrg# Decode manufacturer-specific aliases for certain operating systems.
136432001f49Smrg
136532001f49Smrgif [ x"$os" != x"" ]
136632001f49Smrgthen
136732001f49Smrgcase $os in
13687ec3b29aSmrg	# First match some system type aliases that might get confused
13697ec3b29aSmrg	# with valid system types.
137032001f49Smrg	# -solaris* is a basic system type, with this one exception.
137132001f49Smrg	-auroraux)
137232001f49Smrg		os=-auroraux
137332001f49Smrg		;;
137432001f49Smrg	-solaris1 | -solaris1.*)
137532001f49Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
137632001f49Smrg		;;
137732001f49Smrg	-solaris)
137832001f49Smrg		os=-solaris2
137932001f49Smrg		;;
138032001f49Smrg	-svr4*)
138132001f49Smrg		os=-sysv4
138232001f49Smrg		;;
138332001f49Smrg	-unixware*)
138432001f49Smrg		os=-sysv4.2uw
138532001f49Smrg		;;
138632001f49Smrg	-gnu/linux*)
138732001f49Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
138832001f49Smrg		;;
13897ec3b29aSmrg	# Now accept the basic system types.
139032001f49Smrg	# The portable systems comes first.
13917ec3b29aSmrg	# Each alternative MUST end in a * to match a version number.
139232001f49Smrg	# -sysv* is not here because it comes later, after sysvr4.
139332001f49Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
139432001f49Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
139532001f49Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
139632001f49Smrg	      | -sym* | -kopensolaris* | -plan9* \
139732001f49Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
13987ec3b29aSmrg	      | -aos* | -aros* | -cloudabi* | -sortix* \
139932001f49Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
140032001f49Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
140132001f49Smrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
14027ec3b29aSmrg	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
140332001f49Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
140432001f49Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
140532001f49Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
140632001f49Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
14077ec3b29aSmrg	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
140832001f49Smrg	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
14097ec3b29aSmrg	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
141032001f49Smrg	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
14117ec3b29aSmrg	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
141232001f49Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
141332001f49Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
141432001f49Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
141532001f49Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
141632001f49Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
141732001f49Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
14187ec3b29aSmrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
14197ec3b29aSmrg	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
142032001f49Smrg	# Remember, each alternative MUST END IN *, to match a version number.
142132001f49Smrg		;;
142232001f49Smrg	-qnx*)
142332001f49Smrg		case $basic_machine in
142432001f49Smrg		    x86-* | i*86-*)
142532001f49Smrg			;;
142632001f49Smrg		    *)
142732001f49Smrg			os=-nto$os
142832001f49Smrg			;;
142932001f49Smrg		esac
143032001f49Smrg		;;
143132001f49Smrg	-nto-qnx*)
143232001f49Smrg		;;
143332001f49Smrg	-nto*)
143432001f49Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
143532001f49Smrg		;;
143632001f49Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
143732001f49Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
143832001f49Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
143932001f49Smrg		;;
144032001f49Smrg	-mac*)
144132001f49Smrg		os=`echo $os | sed -e 's|mac|macos|'`
144232001f49Smrg		;;
144332001f49Smrg	-linux-dietlibc)
144432001f49Smrg		os=-linux-dietlibc
144532001f49Smrg		;;
144632001f49Smrg	-linux*)
144732001f49Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
144832001f49Smrg		;;
144932001f49Smrg	-sunos5*)
145032001f49Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
145132001f49Smrg		;;
145232001f49Smrg	-sunos6*)
145332001f49Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
145432001f49Smrg		;;
145532001f49Smrg	-opened*)
145632001f49Smrg		os=-openedition
145732001f49Smrg		;;
145832001f49Smrg	-os400*)
145932001f49Smrg		os=-os400
146032001f49Smrg		;;
146132001f49Smrg	-wince*)
146232001f49Smrg		os=-wince
146332001f49Smrg		;;
146432001f49Smrg	-osfrose*)
146532001f49Smrg		os=-osfrose
146632001f49Smrg		;;
146732001f49Smrg	-osf*)
146832001f49Smrg		os=-osf
146932001f49Smrg		;;
147032001f49Smrg	-utek*)
147132001f49Smrg		os=-bsd
147232001f49Smrg		;;
147332001f49Smrg	-dynix*)
147432001f49Smrg		os=-bsd
147532001f49Smrg		;;
147632001f49Smrg	-acis*)
147732001f49Smrg		os=-aos
147832001f49Smrg		;;
147932001f49Smrg	-atheos*)
148032001f49Smrg		os=-atheos
148132001f49Smrg		;;
148232001f49Smrg	-syllable*)
148332001f49Smrg		os=-syllable
148432001f49Smrg		;;
148532001f49Smrg	-386bsd)
148632001f49Smrg		os=-bsd
148732001f49Smrg		;;
148832001f49Smrg	-ctix* | -uts*)
148932001f49Smrg		os=-sysv
149032001f49Smrg		;;
149132001f49Smrg	-nova*)
149232001f49Smrg		os=-rtmk-nova
149332001f49Smrg		;;
14947ec3b29aSmrg	-ns2)
149532001f49Smrg		os=-nextstep2
149632001f49Smrg		;;
149732001f49Smrg	-nsk*)
149832001f49Smrg		os=-nsk
149932001f49Smrg		;;
150032001f49Smrg	# Preserve the version number of sinix5.
150132001f49Smrg	-sinix5.*)
150232001f49Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
150332001f49Smrg		;;
150432001f49Smrg	-sinix*)
150532001f49Smrg		os=-sysv4
150632001f49Smrg		;;
150732001f49Smrg	-tpf*)
150832001f49Smrg		os=-tpf
150932001f49Smrg		;;
151032001f49Smrg	-triton*)
151132001f49Smrg		os=-sysv3
151232001f49Smrg		;;
151332001f49Smrg	-oss*)
151432001f49Smrg		os=-sysv3
151532001f49Smrg		;;
151632001f49Smrg	-svr4)
151732001f49Smrg		os=-sysv4
151832001f49Smrg		;;
151932001f49Smrg	-svr3)
152032001f49Smrg		os=-sysv3
152132001f49Smrg		;;
152232001f49Smrg	-sysvr4)
152332001f49Smrg		os=-sysv4
152432001f49Smrg		;;
152532001f49Smrg	# This must come after -sysvr4.
152632001f49Smrg	-sysv*)
152732001f49Smrg		;;
152832001f49Smrg	-ose*)
152932001f49Smrg		os=-ose
153032001f49Smrg		;;
153132001f49Smrg	-es1800*)
153232001f49Smrg		os=-ose
153332001f49Smrg		;;
153432001f49Smrg	-xenix)
153532001f49Smrg		os=-xenix
153632001f49Smrg		;;
153732001f49Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
153832001f49Smrg		os=-mint
153932001f49Smrg		;;
154032001f49Smrg	-aros*)
154132001f49Smrg		os=-aros
154232001f49Smrg		;;
154332001f49Smrg	-zvmoe)
154432001f49Smrg		os=-zvmoe
154532001f49Smrg		;;
154632001f49Smrg	-dicos*)
154732001f49Smrg		os=-dicos
154832001f49Smrg		;;
15497ec3b29aSmrg	-pikeos*)
15507ec3b29aSmrg		# Until real need of OS specific support for
15517ec3b29aSmrg		# particular features comes up, bare metal
15527ec3b29aSmrg		# configurations are quite functional.
15537ec3b29aSmrg		case $basic_machine in
15547ec3b29aSmrg		    arm*)
15557ec3b29aSmrg			os=-eabi
15567ec3b29aSmrg			;;
15577ec3b29aSmrg		    *)
15587ec3b29aSmrg			os=-elf
15597ec3b29aSmrg			;;
15607ec3b29aSmrg		esac
15617ec3b29aSmrg		;;
156232001f49Smrg	-nacl*)
156332001f49Smrg		;;
15647ec3b29aSmrg	-ios)
15657ec3b29aSmrg		;;
156632001f49Smrg	-none)
156732001f49Smrg		;;
156832001f49Smrg	*)
156932001f49Smrg		# Get rid of the `-' at the beginning of $os.
157032001f49Smrg		os=`echo $os | sed 's/[^-]*-//'`
157132001f49Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
157232001f49Smrg		exit 1
157332001f49Smrg		;;
157432001f49Smrgesac
157532001f49Smrgelse
157632001f49Smrg
157732001f49Smrg# Here we handle the default operating systems that come with various machines.
157832001f49Smrg# The value should be what the vendor currently ships out the door with their
157932001f49Smrg# machine or put another way, the most popular os provided with the machine.
158032001f49Smrg
158132001f49Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
158232001f49Smrg# "-sun"), then you have to tell the case statement up towards the top
158332001f49Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
158432001f49Smrg# will signal an error saying that MANUFACTURER isn't an operating
158532001f49Smrg# system, and we'll never get to this point.
158632001f49Smrg
158732001f49Smrgcase $basic_machine in
158832001f49Smrg	score-*)
158932001f49Smrg		os=-elf
159032001f49Smrg		;;
159132001f49Smrg	spu-*)
159232001f49Smrg		os=-elf
159332001f49Smrg		;;
159432001f49Smrg	*-acorn)
159532001f49Smrg		os=-riscix1.2
159632001f49Smrg		;;
159732001f49Smrg	arm*-rebel)
159832001f49Smrg		os=-linux
159932001f49Smrg		;;
160032001f49Smrg	arm*-semi)
160132001f49Smrg		os=-aout
160232001f49Smrg		;;
160332001f49Smrg	c4x-* | tic4x-*)
160432001f49Smrg		os=-coff
160532001f49Smrg		;;
160632001f49Smrg	c8051-*)
160732001f49Smrg		os=-elf
160832001f49Smrg		;;
160932001f49Smrg	hexagon-*)
161032001f49Smrg		os=-elf
161132001f49Smrg		;;
161232001f49Smrg	tic54x-*)
161332001f49Smrg		os=-coff
161432001f49Smrg		;;
161532001f49Smrg	tic55x-*)
161632001f49Smrg		os=-coff
161732001f49Smrg		;;
161832001f49Smrg	tic6x-*)
161932001f49Smrg		os=-coff
162032001f49Smrg		;;
162132001f49Smrg	# This must come before the *-dec entry.
162232001f49Smrg	pdp10-*)
162332001f49Smrg		os=-tops20
162432001f49Smrg		;;
162532001f49Smrg	pdp11-*)
162632001f49Smrg		os=-none
162732001f49Smrg		;;
162832001f49Smrg	*-dec | vax-*)
162932001f49Smrg		os=-ultrix4.2
163032001f49Smrg		;;
163132001f49Smrg	m68*-apollo)
163232001f49Smrg		os=-domain
163332001f49Smrg		;;
163432001f49Smrg	i386-sun)
163532001f49Smrg		os=-sunos4.0.2
163632001f49Smrg		;;
163732001f49Smrg	m68000-sun)
163832001f49Smrg		os=-sunos3
163932001f49Smrg		;;
164032001f49Smrg	m68*-cisco)
164132001f49Smrg		os=-aout
164232001f49Smrg		;;
164332001f49Smrg	mep-*)
164432001f49Smrg		os=-elf
164532001f49Smrg		;;
164632001f49Smrg	mips*-cisco)
164732001f49Smrg		os=-elf
164832001f49Smrg		;;
164932001f49Smrg	mips*-*)
165032001f49Smrg		os=-elf
165132001f49Smrg		;;
165232001f49Smrg	or32-*)
165332001f49Smrg		os=-coff
165432001f49Smrg		;;
165532001f49Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
165632001f49Smrg		os=-sysv3
165732001f49Smrg		;;
165832001f49Smrg	sparc-* | *-sun)
165932001f49Smrg		os=-sunos4.1.1
166032001f49Smrg		;;
16617ec3b29aSmrg	pru-*)
16627ec3b29aSmrg		os=-elf
16637ec3b29aSmrg		;;
166432001f49Smrg	*-be)
166532001f49Smrg		os=-beos
166632001f49Smrg		;;
166732001f49Smrg	*-haiku)
166832001f49Smrg		os=-haiku
166932001f49Smrg		;;
167032001f49Smrg	*-ibm)
167132001f49Smrg		os=-aix
167232001f49Smrg		;;
167332001f49Smrg	*-knuth)
167432001f49Smrg		os=-mmixware
167532001f49Smrg		;;
167632001f49Smrg	*-wec)
167732001f49Smrg		os=-proelf
167832001f49Smrg		;;
167932001f49Smrg	*-winbond)
168032001f49Smrg		os=-proelf
168132001f49Smrg		;;
168232001f49Smrg	*-oki)
168332001f49Smrg		os=-proelf
168432001f49Smrg		;;
168532001f49Smrg	*-hp)
168632001f49Smrg		os=-hpux
168732001f49Smrg		;;
168832001f49Smrg	*-hitachi)
168932001f49Smrg		os=-hiux
169032001f49Smrg		;;
169132001f49Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
169232001f49Smrg		os=-sysv
169332001f49Smrg		;;
169432001f49Smrg	*-cbm)
169532001f49Smrg		os=-amigaos
169632001f49Smrg		;;
169732001f49Smrg	*-dg)
169832001f49Smrg		os=-dgux
169932001f49Smrg		;;
170032001f49Smrg	*-dolphin)
170132001f49Smrg		os=-sysv3
170232001f49Smrg		;;
170332001f49Smrg	m68k-ccur)
170432001f49Smrg		os=-rtu
170532001f49Smrg		;;
170632001f49Smrg	m88k-omron*)
170732001f49Smrg		os=-luna
170832001f49Smrg		;;
17097ec3b29aSmrg	*-next)
171032001f49Smrg		os=-nextstep
171132001f49Smrg		;;
171232001f49Smrg	*-sequent)
171332001f49Smrg		os=-ptx
171432001f49Smrg		;;
171532001f49Smrg	*-crds)
171632001f49Smrg		os=-unos
171732001f49Smrg		;;
171832001f49Smrg	*-ns)
171932001f49Smrg		os=-genix
172032001f49Smrg		;;
172132001f49Smrg	i370-*)
172232001f49Smrg		os=-mvs
172332001f49Smrg		;;
172432001f49Smrg	*-next)
172532001f49Smrg		os=-nextstep3
172632001f49Smrg		;;
172732001f49Smrg	*-gould)
172832001f49Smrg		os=-sysv
172932001f49Smrg		;;
173032001f49Smrg	*-highlevel)
173132001f49Smrg		os=-bsd
173232001f49Smrg		;;
173332001f49Smrg	*-encore)
173432001f49Smrg		os=-bsd
173532001f49Smrg		;;
173632001f49Smrg	*-sgi)
173732001f49Smrg		os=-irix
173832001f49Smrg		;;
173932001f49Smrg	*-siemens)
174032001f49Smrg		os=-sysv4
174132001f49Smrg		;;
174232001f49Smrg	*-masscomp)
174332001f49Smrg		os=-rtu
174432001f49Smrg		;;
174532001f49Smrg	f30[01]-fujitsu | f700-fujitsu)
174632001f49Smrg		os=-uxpv
174732001f49Smrg		;;
174832001f49Smrg	*-rom68k)
174932001f49Smrg		os=-coff
175032001f49Smrg		;;
175132001f49Smrg	*-*bug)
175232001f49Smrg		os=-coff
175332001f49Smrg		;;
175432001f49Smrg	*-apple)
175532001f49Smrg		os=-macos
175632001f49Smrg		;;
175732001f49Smrg	*-atari*)
175832001f49Smrg		os=-mint
175932001f49Smrg		;;
176032001f49Smrg	*)
176132001f49Smrg		os=-none
176232001f49Smrg		;;
176332001f49Smrgesac
176432001f49Smrgfi
176532001f49Smrg
176632001f49Smrg# Here we handle the case where we know the os, and the CPU type, but not the
176732001f49Smrg# manufacturer.  We pick the logical manufacturer.
176832001f49Smrgvendor=unknown
176932001f49Smrgcase $basic_machine in
177032001f49Smrg	*-unknown)
177132001f49Smrg		case $os in
177232001f49Smrg			-riscix*)
177332001f49Smrg				vendor=acorn
177432001f49Smrg				;;
177532001f49Smrg			-sunos*)
177632001f49Smrg				vendor=sun
177732001f49Smrg				;;
177832001f49Smrg			-cnk*|-aix*)
177932001f49Smrg				vendor=ibm
178032001f49Smrg				;;
178132001f49Smrg			-beos*)
178232001f49Smrg				vendor=be
178332001f49Smrg				;;
178432001f49Smrg			-hpux*)
178532001f49Smrg				vendor=hp
178632001f49Smrg				;;
178732001f49Smrg			-mpeix*)
178832001f49Smrg				vendor=hp
178932001f49Smrg				;;
179032001f49Smrg			-hiux*)
179132001f49Smrg				vendor=hitachi
179232001f49Smrg				;;
179332001f49Smrg			-unos*)
179432001f49Smrg				vendor=crds
179532001f49Smrg				;;
179632001f49Smrg			-dgux*)
179732001f49Smrg				vendor=dg
179832001f49Smrg				;;
179932001f49Smrg			-luna*)
180032001f49Smrg				vendor=omron
180132001f49Smrg				;;
180232001f49Smrg			-genix*)
180332001f49Smrg				vendor=ns
180432001f49Smrg				;;
180532001f49Smrg			-mvs* | -opened*)
180632001f49Smrg				vendor=ibm
180732001f49Smrg				;;
180832001f49Smrg			-os400*)
180932001f49Smrg				vendor=ibm
181032001f49Smrg				;;
181132001f49Smrg			-ptx*)
181232001f49Smrg				vendor=sequent
181332001f49Smrg				;;
181432001f49Smrg			-tpf*)
181532001f49Smrg				vendor=ibm
181632001f49Smrg				;;
181732001f49Smrg			-vxsim* | -vxworks* | -windiss*)
181832001f49Smrg				vendor=wrs
181932001f49Smrg				;;
182032001f49Smrg			-aux*)
182132001f49Smrg				vendor=apple
182232001f49Smrg				;;
182332001f49Smrg			-hms*)
182432001f49Smrg				vendor=hitachi
182532001f49Smrg				;;
182632001f49Smrg			-mpw* | -macos*)
182732001f49Smrg				vendor=apple
182832001f49Smrg				;;
182932001f49Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
183032001f49Smrg				vendor=atari
183132001f49Smrg				;;
183232001f49Smrg			-vos*)
183332001f49Smrg				vendor=stratus
183432001f49Smrg				;;
183532001f49Smrg		esac
183632001f49Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
183732001f49Smrg		;;
183832001f49Smrgesac
183932001f49Smrg
184032001f49Smrgecho $basic_machine$os
184132001f49Smrgexit
184232001f49Smrg
184332001f49Smrg# Local variables:
18447ec3b29aSmrg# eval: (add-hook 'write-file-functions 'time-stamp)
184532001f49Smrg# time-stamp-start: "timestamp='"
184632001f49Smrg# time-stamp-format: "%:y-%02m-%02d"
184732001f49Smrg# time-stamp-end: "'"
184832001f49Smrg# End:
1849