config.sub revision 27935385
129459361Smrg#! /bin/sh
229459361Smrg# Configuration validation subroutine script.
327935385Smrg#   Copyright 1992-2018 Free Software Foundation, Inc.
429459361Smrg
527935385Smrgtimestamp='2018-02-28'
629459361Smrg
7f66e55a2Smrg# This file is free software; you can redistribute it and/or modify it
8f66e55a2Smrg# under the terms of the GNU General Public License as published by
9f66e55a2Smrg# the Free Software Foundation; either version 3 of the License, or
1029459361Smrg# (at your option) any later version.
1129459361Smrg#
12f66e55a2Smrg# This program is distributed in the hope that it will be useful, but
13f66e55a2Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
14f66e55a2Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15f66e55a2Smrg# General Public License for more details.
1629459361Smrg#
1729459361Smrg# You should have received a copy of the GNU General Public License
1827935385Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
1929459361Smrg#
2029459361Smrg# As a special exception to the GNU General Public License, if you
2129459361Smrg# distribute this file as part of a program that contains a
2229459361Smrg# configuration script generated by Autoconf, you may include it under
23f66e55a2Smrg# the same distribution terms that you use for the rest of that
24f66e55a2Smrg# program.  This Exception is an additional permission under section 7
25f66e55a2Smrg# of the GNU General Public License, version 3 ("GPLv3").
2629459361Smrg
2729459361Smrg
2827935385Smrg# Please send patches to <config-patches@gnu.org>.
2929459361Smrg#
3029459361Smrg# Configuration subroutine to validate and canonicalize a configuration type.
3129459361Smrg# Supply the specified configuration type as an argument.
3229459361Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
3329459361Smrg# Otherwise, we print the canonical config type on stdout and succeed.
3429459361Smrg
35c3c9b392Smrg# You can get the latest version of this script from:
3627935385Smrg# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
37c3c9b392Smrg
3829459361Smrg# This file is supposed to be the same for all GNU packages
3929459361Smrg# and recognize all the CPU types, system types and aliases
4029459361Smrg# that are meaningful with *any* GNU software.
4129459361Smrg# Each package is responsible for reporting which valid configurations
4229459361Smrg# it does not support.  The user should be able to distinguish
4329459361Smrg# a failure to support a valid configuration from a meaningless
4429459361Smrg# configuration.
4529459361Smrg
4629459361Smrg# The goal of this file is to map all the various variations of a given
4729459361Smrg# machine specification into a single specification in the form:
4829459361Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
4929459361Smrg# or in some cases, the newer four-part form:
5029459361Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5129459361Smrg# It is wrong to echo any other type of specification.
5229459361Smrg
5329459361Smrgme=`echo "$0" | sed -e 's,.*/,,'`
5429459361Smrg
5529459361Smrgusage="\
5627935385SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
5729459361Smrg
5829459361SmrgCanonicalize a configuration name.
5929459361Smrg
6027935385SmrgOptions:
6129459361Smrg  -h, --help         print this help, then exit
6229459361Smrg  -t, --time-stamp   print date of last modification, then exit
6329459361Smrg  -v, --version      print version number, then exit
6429459361Smrg
6529459361SmrgReport bugs and patches to <config-patches@gnu.org>."
6629459361Smrg
6729459361Smrgversion="\
6829459361SmrgGNU config.sub ($timestamp)
6929459361Smrg
7027935385SmrgCopyright 1992-2018 Free Software Foundation, Inc.
7129459361Smrg
7229459361SmrgThis is free software; see the source for copying conditions.  There is NO
7329459361Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
7429459361Smrg
7529459361Smrghelp="
7629459361SmrgTry \`$me --help' for more information."
7729459361Smrg
7829459361Smrg# Parse command line
7929459361Smrgwhile test $# -gt 0 ; do
8029459361Smrg  case $1 in
8129459361Smrg    --time-stamp | --time* | -t )
8229459361Smrg       echo "$timestamp" ; exit ;;
8329459361Smrg    --version | -v )
8429459361Smrg       echo "$version" ; exit ;;
8529459361Smrg    --help | --h* | -h )
8629459361Smrg       echo "$usage"; exit ;;
8729459361Smrg    -- )     # Stop option processing
8829459361Smrg       shift; break ;;
8929459361Smrg    - )	# Use stdin as input.
9029459361Smrg       break ;;
9129459361Smrg    -* )
9229459361Smrg       echo "$me: invalid option $1$help"
9329459361Smrg       exit 1 ;;
9429459361Smrg
9529459361Smrg    *local*)
9629459361Smrg       # First pass through any local machine types.
9727935385Smrg       echo "$1"
9829459361Smrg       exit ;;
9929459361Smrg
10029459361Smrg    * )
10129459361Smrg       break ;;
10229459361Smrg  esac
10329459361Smrgdone
10429459361Smrg
10529459361Smrgcase $# in
10629459361Smrg 0) echo "$me: missing argument$help" >&2
10729459361Smrg    exit 1;;
10829459361Smrg 1) ;;
10929459361Smrg *) echo "$me: too many arguments$help" >&2
11029459361Smrg    exit 1;;
11129459361Smrgesac
11229459361Smrg
11329459361Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
11429459361Smrg# Here we must recognize all the valid KERNEL-OS combinations.
11527935385Smrgmaybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
11629459361Smrgcase $maybe_os in
117c3c9b392Smrg  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
118f66e55a2Smrg  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
11927935385Smrg  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
12027935385Smrg  kopensolaris*-gnu* | cloudabi*-eabi* | \
12129459361Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
12229459361Smrg    os=-$maybe_os
12327935385Smrg    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
12429459361Smrg    ;;
125f66e55a2Smrg  android-linux)
126f66e55a2Smrg    os=-linux-android
12727935385Smrg    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
128f66e55a2Smrg    ;;
12929459361Smrg  *)
13027935385Smrg    basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
13127935385Smrg    if [ "$basic_machine" != "$1" ]
13227935385Smrg    then os=`echo "$1" | sed 's/.*-/-/'`
13329459361Smrg    else os=; fi
13429459361Smrg    ;;
13529459361Smrgesac
13629459361Smrg
13729459361Smrg### Let's recognize common machines as not being operating systems so
13829459361Smrg### that things like config.sub decstation-3100 work.  We also
13929459361Smrg### recognize some manufacturers as not being operating systems, so we
14029459361Smrg### can provide default operating systems below.
14129459361Smrgcase $os in
14229459361Smrg	-sun*os*)
14329459361Smrg		# Prevent following clause from handling this invalid input.
14429459361Smrg		;;
14529459361Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
14629459361Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
14729459361Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
14829459361Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
14929459361Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
15029459361Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151f66e55a2Smrg	-apple | -axis | -knuth | -cray | -microblaze*)
15229459361Smrg		os=
15329459361Smrg		basic_machine=$1
15429459361Smrg		;;
155f66e55a2Smrg	-bluegene*)
156f66e55a2Smrg		os=-cnk
157c3c9b392Smrg		;;
15829459361Smrg	-sim | -cisco | -oki | -wec | -winbond)
15929459361Smrg		os=
16029459361Smrg		basic_machine=$1
16129459361Smrg		;;
16229459361Smrg	-scout)
16329459361Smrg		;;
16429459361Smrg	-wrs)
16529459361Smrg		os=-vxworks
16629459361Smrg		basic_machine=$1
16729459361Smrg		;;
16829459361Smrg	-chorusos*)
16929459361Smrg		os=-chorusos
17029459361Smrg		basic_machine=$1
17129459361Smrg		;;
172f66e55a2Smrg	-chorusrdb)
173f66e55a2Smrg		os=-chorusrdb
17429459361Smrg		basic_machine=$1
175f66e55a2Smrg		;;
17629459361Smrg	-hiux*)
17729459361Smrg		os=-hiuxwe2
17829459361Smrg		;;
17929459361Smrg	-sco6)
18029459361Smrg		os=-sco5v6
18127935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
18229459361Smrg		;;
18329459361Smrg	-sco5)
18429459361Smrg		os=-sco3.2v5
18527935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
18629459361Smrg		;;
18729459361Smrg	-sco4)
18829459361Smrg		os=-sco3.2v4
18927935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
19029459361Smrg		;;
19129459361Smrg	-sco3.2.[4-9]*)
19229459361Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
19327935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
19429459361Smrg		;;
19529459361Smrg	-sco3.2v[4-9]*)
19629459361Smrg		# Don't forget version if it is 3.2v4 or newer.
19727935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
19829459361Smrg		;;
19929459361Smrg	-sco5v6*)
20029459361Smrg		# Don't forget version if it is 3.2v4 or newer.
20127935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
20229459361Smrg		;;
20329459361Smrg	-sco*)
20429459361Smrg		os=-sco3.2v2
20527935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
20629459361Smrg		;;
20729459361Smrg	-udk*)
20827935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
20929459361Smrg		;;
21029459361Smrg	-isc)
21129459361Smrg		os=-isc2.2
21227935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
21329459361Smrg		;;
21429459361Smrg	-clix*)
21529459361Smrg		basic_machine=clipper-intergraph
21629459361Smrg		;;
21729459361Smrg	-isc*)
21827935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
21929459361Smrg		;;
220f66e55a2Smrg	-lynx*178)
221f66e55a2Smrg		os=-lynxos178
222f66e55a2Smrg		;;
223f66e55a2Smrg	-lynx*5)
224f66e55a2Smrg		os=-lynxos5
225f66e55a2Smrg		;;
22629459361Smrg	-lynx*)
22729459361Smrg		os=-lynxos
22829459361Smrg		;;
22929459361Smrg	-ptx*)
23027935385Smrg		basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
23129459361Smrg		;;
23229459361Smrg	-psos*)
23329459361Smrg		os=-psos
23429459361Smrg		;;
23529459361Smrg	-mint | -mint[0-9]*)
23629459361Smrg		basic_machine=m68k-atari
23729459361Smrg		os=-mint
23829459361Smrg		;;
23929459361Smrgesac
24029459361Smrg
24129459361Smrg# Decode aliases for certain CPU-COMPANY combinations.
24229459361Smrgcase $basic_machine in
24329459361Smrg	# Recognize the basic CPU types without company name.
24429459361Smrg	# Some are omitted here because they have special meanings below.
24529459361Smrg	1750a | 580 \
24629459361Smrg	| a29k \
247f66e55a2Smrg	| aarch64 | aarch64_be \
24829459361Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
24929459361Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
25029459361Smrg	| am33_2.0 \
251f66e55a2Smrg	| arc | arceb \
252f66e55a2Smrg	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
253f66e55a2Smrg	| avr | avr32 \
25427935385Smrg	| ba \
255f66e55a2Smrg	| be32 | be64 \
25629459361Smrg	| bfin \
25727935385Smrg	| c4x | c8051 | clipper \
25829459361Smrg	| d10v | d30v | dlx | dsp16xx \
25927935385Smrg	| e2k | epiphany \
26027935385Smrg	| fido | fr30 | frv | ft32 \
26129459361Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
262f66e55a2Smrg	| hexagon \
26327935385Smrg	| i370 | i860 | i960 | ia16 | ia64 \
26429459361Smrg	| ip2k | iq2000 \
26527935385Smrg	| k1om \
266f66e55a2Smrg	| le32 | le64 \
2675715adc0Smrg	| lm32 \
26829459361Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
269f66e55a2Smrg	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
27029459361Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
27129459361Smrg	| mips16 \
27229459361Smrg	| mips64 | mips64el \
2735715adc0Smrg	| mips64octeon | mips64octeonel \
27429459361Smrg	| mips64orion | mips64orionel \
2755715adc0Smrg	| mips64r5900 | mips64r5900el \
2765715adc0Smrg	| mips64vr | mips64vrel \
27729459361Smrg	| mips64vr4100 | mips64vr4100el \
27829459361Smrg	| mips64vr4300 | mips64vr4300el \
27929459361Smrg	| mips64vr5000 | mips64vr5000el \
28029459361Smrg	| mips64vr5900 | mips64vr5900el \
28129459361Smrg	| mipsisa32 | mipsisa32el \
28229459361Smrg	| mipsisa32r2 | mipsisa32r2el \
28327935385Smrg	| mipsisa32r6 | mipsisa32r6el \
28429459361Smrg	| mipsisa64 | mipsisa64el \
28529459361Smrg	| mipsisa64r2 | mipsisa64r2el \
28627935385Smrg	| mipsisa64r6 | mipsisa64r6el \
28729459361Smrg	| mipsisa64sb1 | mipsisa64sb1el \
28829459361Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
289f66e55a2Smrg	| mipsr5900 | mipsr5900el \
29029459361Smrg	| mipstx39 | mipstx39el \
29129459361Smrg	| mn10200 | mn10300 \
2925715adc0Smrg	| moxie \
29329459361Smrg	| mt \
29429459361Smrg	| msp430 \
295c3c9b392Smrg	| nds32 | nds32le | nds32be \
296f66e55a2Smrg	| nios | nios2 | nios2eb | nios2el \
29729459361Smrg	| ns16k | ns32k \
29827935385Smrg	| open8 | or1k | or1knd | or32 \
29927935385Smrg	| pdp10 | pj | pjl \
300f66e55a2Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle \
30127935385Smrg	| pru \
30229459361Smrg	| pyramid \
30327935385Smrg	| riscv32 | riscv64 \
304f66e55a2Smrg	| rl78 | rx \
30529459361Smrg	| score \
30627935385Smrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
30729459361Smrg	| sh64 | sh64le \
30829459361Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
30929459361Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
310f66e55a2Smrg	| spu \
311f66e55a2Smrg	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
312c3c9b392Smrg	| ubicom32 \
313f66e55a2Smrg	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
31427935385Smrg	| visium \
31527935385Smrg	| wasm32 \
316f66e55a2Smrg	| x86 | xc16x | xstormy16 | xtensa \
3175715adc0Smrg	| z8k | z80)
31829459361Smrg		basic_machine=$basic_machine-unknown
31929459361Smrg		;;
320c3c9b392Smrg	c54x)
321c3c9b392Smrg		basic_machine=tic54x-unknown
322c3c9b392Smrg		;;
323c3c9b392Smrg	c55x)
324c3c9b392Smrg		basic_machine=tic55x-unknown
325c3c9b392Smrg		;;
326c3c9b392Smrg	c6x)
327c3c9b392Smrg		basic_machine=tic6x-unknown
328c3c9b392Smrg		;;
32927935385Smrg	leon|leon[3-9])
33027935385Smrg		basic_machine=sparc-$basic_machine
33127935385Smrg		;;
33227935385Smrg	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
33329459361Smrg		basic_machine=$basic_machine-unknown
33429459361Smrg		os=-none
33529459361Smrg		;;
33627935385Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
33729459361Smrg		;;
33829459361Smrg	ms1)
33929459361Smrg		basic_machine=mt-unknown
34029459361Smrg		;;
34129459361Smrg
342f66e55a2Smrg	strongarm | thumb | xscale)
343f66e55a2Smrg		basic_machine=arm-unknown
344f66e55a2Smrg		;;
345f66e55a2Smrg	xgate)
346f66e55a2Smrg		basic_machine=$basic_machine-unknown
347f66e55a2Smrg		os=-none
348f66e55a2Smrg		;;
349f66e55a2Smrg	xscaleeb)
350f66e55a2Smrg		basic_machine=armeb-unknown
351f66e55a2Smrg		;;
352f66e55a2Smrg
353f66e55a2Smrg	xscaleel)
354f66e55a2Smrg		basic_machine=armel-unknown
355f66e55a2Smrg		;;
356f66e55a2Smrg
35729459361Smrg	# We use `pc' rather than `unknown'
35829459361Smrg	# because (1) that's what they normally are, and
35929459361Smrg	# (2) the word "unknown" tends to confuse beginning users.
36029459361Smrg	i*86 | x86_64)
36129459361Smrg	  basic_machine=$basic_machine-pc
36229459361Smrg	  ;;
36329459361Smrg	# Object if more than one company name word.
36429459361Smrg	*-*-*)
36527935385Smrg		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
36629459361Smrg		exit 1
36729459361Smrg		;;
36829459361Smrg	# Recognize the basic CPU types with company name.
36929459361Smrg	580-* \
37029459361Smrg	| a29k-* \
371f66e55a2Smrg	| aarch64-* | aarch64_be-* \
37229459361Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
37329459361Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
374f66e55a2Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
37529459361Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
37629459361Smrg	| avr-* | avr32-* \
37727935385Smrg	| ba-* \
378f66e55a2Smrg	| be32-* | be64-* \
37929459361Smrg	| bfin-* | bs2000-* \
380c3c9b392Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* \
38127935385Smrg	| c8051-* | clipper-* | craynv-* | cydra-* \
38229459361Smrg	| d10v-* | d30v-* | dlx-* \
38327935385Smrg	| e2k-* | elxsi-* \
38429459361Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
38529459361Smrg	| h8300-* | h8500-* \
38629459361Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
387f66e55a2Smrg	| hexagon-* \
38827935385Smrg	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
38929459361Smrg	| ip2k-* | iq2000-* \
39027935385Smrg	| k1om-* \
391f66e55a2Smrg	| le32-* | le64-* \
3925715adc0Smrg	| lm32-* \
39329459361Smrg	| m32c-* | m32r-* | m32rle-* \
39429459361Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
395f66e55a2Smrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
396f66e55a2Smrg	| microblaze-* | microblazeel-* \
39729459361Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
39829459361Smrg	| mips16-* \
39929459361Smrg	| mips64-* | mips64el-* \
4005715adc0Smrg	| mips64octeon-* | mips64octeonel-* \
40129459361Smrg	| mips64orion-* | mips64orionel-* \
4025715adc0Smrg	| mips64r5900-* | mips64r5900el-* \
4035715adc0Smrg	| mips64vr-* | mips64vrel-* \
40429459361Smrg	| mips64vr4100-* | mips64vr4100el-* \
40529459361Smrg	| mips64vr4300-* | mips64vr4300el-* \
40629459361Smrg	| mips64vr5000-* | mips64vr5000el-* \
40729459361Smrg	| mips64vr5900-* | mips64vr5900el-* \
40829459361Smrg	| mipsisa32-* | mipsisa32el-* \
40929459361Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
41027935385Smrg	| mipsisa32r6-* | mipsisa32r6el-* \
41129459361Smrg	| mipsisa64-* | mipsisa64el-* \
41229459361Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
41327935385Smrg	| mipsisa64r6-* | mipsisa64r6el-* \
41429459361Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
41529459361Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
416f66e55a2Smrg	| mipsr5900-* | mipsr5900el-* \
41729459361Smrg	| mipstx39-* | mipstx39el-* \
41829459361Smrg	| mmix-* \
41929459361Smrg	| mt-* \
42029459361Smrg	| msp430-* \
421c3c9b392Smrg	| nds32-* | nds32le-* | nds32be-* \
422f66e55a2Smrg	| nios-* | nios2-* | nios2eb-* | nios2el-* \
42329459361Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
424f66e55a2Smrg	| open8-* \
42527935385Smrg	| or1k*-* \
42629459361Smrg	| orion-* \
42729459361Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
428f66e55a2Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
42927935385Smrg	| pru-* \
43029459361Smrg	| pyramid-* \
43127935385Smrg	| riscv32-* | riscv64-* \
432f66e55a2Smrg	| rl78-* | romp-* | rs6000-* | rx-* \
4335715adc0Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
43429459361Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
43529459361Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
43629459361Smrg	| sparclite-* \
43727935385Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
438f66e55a2Smrg	| tahoe-* \
439c3c9b392Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
440f66e55a2Smrg	| tile*-* \
44129459361Smrg	| tron-* \
442c3c9b392Smrg	| ubicom32-* \
443f66e55a2Smrg	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
444f66e55a2Smrg	| vax-* \
44527935385Smrg	| visium-* \
44627935385Smrg	| wasm32-* \
44729459361Smrg	| we32k-* \
448f66e55a2Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* \
4495715adc0Smrg	| xstormy16-* | xtensa*-* \
45029459361Smrg	| ymp-* \
4515715adc0Smrg	| z8k-* | z80-*)
4525715adc0Smrg		;;
4535715adc0Smrg	# Recognize the basic CPU types without company name, with glob match.
4545715adc0Smrg	xtensa*)
4555715adc0Smrg		basic_machine=$basic_machine-unknown
45629459361Smrg		;;
45729459361Smrg	# Recognize the various machine names and aliases which stand
45829459361Smrg	# for a CPU type and a company and sometimes even an OS.
45929459361Smrg	386bsd)
46027935385Smrg		basic_machine=i386-pc
46129459361Smrg		os=-bsd
46229459361Smrg		;;
46329459361Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
46429459361Smrg		basic_machine=m68000-att
46529459361Smrg		;;
46629459361Smrg	3b*)
46729459361Smrg		basic_machine=we32k-att
46829459361Smrg		;;
46929459361Smrg	a29khif)
47029459361Smrg		basic_machine=a29k-amd
47129459361Smrg		os=-udi
47229459361Smrg		;;
473f66e55a2Smrg	abacus)
47429459361Smrg		basic_machine=abacus-unknown
47529459361Smrg		;;
47629459361Smrg	adobe68k)
47729459361Smrg		basic_machine=m68010-adobe
47829459361Smrg		os=-scout
47929459361Smrg		;;
48029459361Smrg	alliant | fx80)
48129459361Smrg		basic_machine=fx80-alliant
48229459361Smrg		;;
48329459361Smrg	altos | altos3068)
48429459361Smrg		basic_machine=m68k-altos
48529459361Smrg		;;
48629459361Smrg	am29k)
48729459361Smrg		basic_machine=a29k-none
48829459361Smrg		os=-bsd
48929459361Smrg		;;
49029459361Smrg	amd64)
49129459361Smrg		basic_machine=x86_64-pc
49229459361Smrg		;;
49329459361Smrg	amd64-*)
49427935385Smrg		basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
49529459361Smrg		;;
49629459361Smrg	amdahl)
49729459361Smrg		basic_machine=580-amdahl
49829459361Smrg		os=-sysv
49929459361Smrg		;;
50029459361Smrg	amiga | amiga-*)
50129459361Smrg		basic_machine=m68k-unknown
50229459361Smrg		;;
50329459361Smrg	amigaos | amigados)
50429459361Smrg		basic_machine=m68k-unknown
50529459361Smrg		os=-amigaos
50629459361Smrg		;;
50729459361Smrg	amigaunix | amix)
50829459361Smrg		basic_machine=m68k-unknown
50929459361Smrg		os=-sysv4
51029459361Smrg		;;
51129459361Smrg	apollo68)
51229459361Smrg		basic_machine=m68k-apollo
51329459361Smrg		os=-sysv
51429459361Smrg		;;
51529459361Smrg	apollo68bsd)
51629459361Smrg		basic_machine=m68k-apollo
51729459361Smrg		os=-bsd
51829459361Smrg		;;
5195715adc0Smrg	aros)
5205715adc0Smrg		basic_machine=i386-pc
5215715adc0Smrg		os=-aros
5225715adc0Smrg		;;
52327935385Smrg	asmjs)
52427935385Smrg		basic_machine=asmjs-unknown
52527935385Smrg		;;
52629459361Smrg	aux)
52729459361Smrg		basic_machine=m68k-apple
52829459361Smrg		os=-aux
52929459361Smrg		;;
53029459361Smrg	balance)
53129459361Smrg		basic_machine=ns32k-sequent
53229459361Smrg		os=-dynix
53329459361Smrg		;;
5345715adc0Smrg	blackfin)
5355715adc0Smrg		basic_machine=bfin-unknown
5365715adc0Smrg		os=-linux
5375715adc0Smrg		;;
5385715adc0Smrg	blackfin-*)
53927935385Smrg		basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
5405715adc0Smrg		os=-linux
5415715adc0Smrg		;;
542c3c9b392Smrg	bluegene*)
543c3c9b392Smrg		basic_machine=powerpc-ibm
544c3c9b392Smrg		os=-cnk
545c3c9b392Smrg		;;
546c3c9b392Smrg	c54x-*)
54727935385Smrg		basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
548c3c9b392Smrg		;;
549c3c9b392Smrg	c55x-*)
55027935385Smrg		basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
551c3c9b392Smrg		;;
552c3c9b392Smrg	c6x-*)
55327935385Smrg		basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
554c3c9b392Smrg		;;
55529459361Smrg	c90)
55629459361Smrg		basic_machine=c90-cray
55729459361Smrg		os=-unicos
55829459361Smrg		;;
559f66e55a2Smrg	cegcc)
5605715adc0Smrg		basic_machine=arm-unknown
5615715adc0Smrg		os=-cegcc
5625715adc0Smrg		;;
56329459361Smrg	convex-c1)
56429459361Smrg		basic_machine=c1-convex
56529459361Smrg		os=-bsd
56629459361Smrg		;;
56729459361Smrg	convex-c2)
56829459361Smrg		basic_machine=c2-convex
56929459361Smrg		os=-bsd
57029459361Smrg		;;
57129459361Smrg	convex-c32)
57229459361Smrg		basic_machine=c32-convex
57329459361Smrg		os=-bsd
57429459361Smrg		;;
57529459361Smrg	convex-c34)
57629459361Smrg		basic_machine=c34-convex
57729459361Smrg		os=-bsd
57829459361Smrg		;;
57929459361Smrg	convex-c38)
58029459361Smrg		basic_machine=c38-convex
58129459361Smrg		os=-bsd
58229459361Smrg		;;
58329459361Smrg	cray | j90)
58429459361Smrg		basic_machine=j90-cray
58529459361Smrg		os=-unicos
58629459361Smrg		;;
58729459361Smrg	craynv)
58829459361Smrg		basic_machine=craynv-cray
58929459361Smrg		os=-unicosmp
59029459361Smrg		;;
591f66e55a2Smrg	cr16 | cr16-*)
5925715adc0Smrg		basic_machine=cr16-unknown
59329459361Smrg		os=-elf
59429459361Smrg		;;
59529459361Smrg	crds | unos)
59629459361Smrg		basic_machine=m68k-crds
59729459361Smrg		;;
59829459361Smrg	crisv32 | crisv32-* | etraxfs*)
59929459361Smrg		basic_machine=crisv32-axis
60029459361Smrg		;;
60129459361Smrg	cris | cris-* | etrax*)
60229459361Smrg		basic_machine=cris-axis
60329459361Smrg		;;
60429459361Smrg	crx)
60529459361Smrg		basic_machine=crx-unknown
60629459361Smrg		os=-elf
60729459361Smrg		;;
60829459361Smrg	da30 | da30-*)
60929459361Smrg		basic_machine=m68k-da30
61029459361Smrg		;;
61129459361Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
61229459361Smrg		basic_machine=mips-dec
61329459361Smrg		;;
61429459361Smrg	decsystem10* | dec10*)
61529459361Smrg		basic_machine=pdp10-dec
61629459361Smrg		os=-tops10
61729459361Smrg		;;
61829459361Smrg	decsystem20* | dec20*)
61929459361Smrg		basic_machine=pdp10-dec
62029459361Smrg		os=-tops20
62129459361Smrg		;;
62229459361Smrg	delta | 3300 | motorola-3300 | motorola-delta \
62329459361Smrg	      | 3300-motorola | delta-motorola)
62429459361Smrg		basic_machine=m68k-motorola
62529459361Smrg		;;
62629459361Smrg	delta88)
62729459361Smrg		basic_machine=m88k-motorola
62829459361Smrg		os=-sysv3
62929459361Smrg		;;
6305715adc0Smrg	dicos)
6315715adc0Smrg		basic_machine=i686-pc
6325715adc0Smrg		os=-dicos
6335715adc0Smrg		;;
63429459361Smrg	djgpp)
63529459361Smrg		basic_machine=i586-pc
63629459361Smrg		os=-msdosdjgpp
63729459361Smrg		;;
63829459361Smrg	dpx20 | dpx20-*)
63929459361Smrg		basic_machine=rs6000-bull
64029459361Smrg		os=-bosx
64129459361Smrg		;;
64227935385Smrg	dpx2*)
64329459361Smrg		basic_machine=m68k-bull
64429459361Smrg		os=-sysv3
64529459361Smrg		;;
64627935385Smrg	e500v[12])
64727935385Smrg		basic_machine=powerpc-unknown
64827935385Smrg		os=$os"spe"
64927935385Smrg		;;
65027935385Smrg	e500v[12]-*)
65127935385Smrg		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
65227935385Smrg		os=$os"spe"
65327935385Smrg		;;
65429459361Smrg	ebmon29k)
65529459361Smrg		basic_machine=a29k-amd
65629459361Smrg		os=-ebmon
65729459361Smrg		;;
65829459361Smrg	elxsi)
65929459361Smrg		basic_machine=elxsi-elxsi
66029459361Smrg		os=-bsd
66129459361Smrg		;;
66229459361Smrg	encore | umax | mmax)
66329459361Smrg		basic_machine=ns32k-encore
66429459361Smrg		;;
66529459361Smrg	es1800 | OSE68k | ose68k | ose | OSE)
66629459361Smrg		basic_machine=m68k-ericsson
66729459361Smrg		os=-ose
66829459361Smrg		;;
66929459361Smrg	fx2800)
67029459361Smrg		basic_machine=i860-alliant
67129459361Smrg		;;
67229459361Smrg	genix)
67329459361Smrg		basic_machine=ns32k-ns
67429459361Smrg		;;
67529459361Smrg	gmicro)
67629459361Smrg		basic_machine=tron-gmicro
67729459361Smrg		os=-sysv
67829459361Smrg		;;
67929459361Smrg	go32)
68029459361Smrg		basic_machine=i386-pc
68129459361Smrg		os=-go32
68229459361Smrg		;;
68329459361Smrg	h3050r* | hiux*)
68429459361Smrg		basic_machine=hppa1.1-hitachi
68529459361Smrg		os=-hiuxwe2
68629459361Smrg		;;
68729459361Smrg	h8300hms)
68829459361Smrg		basic_machine=h8300-hitachi
68929459361Smrg		os=-hms
69029459361Smrg		;;
69129459361Smrg	h8300xray)
69229459361Smrg		basic_machine=h8300-hitachi
69329459361Smrg		os=-xray
69429459361Smrg		;;
69529459361Smrg	h8500hms)
69629459361Smrg		basic_machine=h8500-hitachi
69729459361Smrg		os=-hms
69829459361Smrg		;;
69929459361Smrg	harris)
70029459361Smrg		basic_machine=m88k-harris
70129459361Smrg		os=-sysv3
70229459361Smrg		;;
70329459361Smrg	hp300-*)
70429459361Smrg		basic_machine=m68k-hp
70529459361Smrg		;;
70629459361Smrg	hp300bsd)
70729459361Smrg		basic_machine=m68k-hp
70829459361Smrg		os=-bsd
70929459361Smrg		;;
71029459361Smrg	hp300hpux)
71129459361Smrg		basic_machine=m68k-hp
71229459361Smrg		os=-hpux
71329459361Smrg		;;
71429459361Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
71529459361Smrg		basic_machine=hppa1.0-hp
71629459361Smrg		;;
71729459361Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
71829459361Smrg		basic_machine=m68000-hp
71929459361Smrg		;;
72029459361Smrg	hp9k3[2-9][0-9])
72129459361Smrg		basic_machine=m68k-hp
72229459361Smrg		;;
72329459361Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
72429459361Smrg		basic_machine=hppa1.0-hp
72529459361Smrg		;;
72629459361Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
72729459361Smrg		basic_machine=hppa1.1-hp
72829459361Smrg		;;
72929459361Smrg	hp9k78[0-9] | hp78[0-9])
73029459361Smrg		# FIXME: really hppa2.0-hp
73129459361Smrg		basic_machine=hppa1.1-hp
73229459361Smrg		;;
73329459361Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
73429459361Smrg		# FIXME: really hppa2.0-hp
73529459361Smrg		basic_machine=hppa1.1-hp
73629459361Smrg		;;
73729459361Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
73829459361Smrg		basic_machine=hppa1.1-hp
73929459361Smrg		;;
74029459361Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
74129459361Smrg		basic_machine=hppa1.0-hp
74229459361Smrg		;;
74329459361Smrg	hppaosf)
74429459361Smrg		basic_machine=hppa1.1-hp
74529459361Smrg		os=-osf
74629459361Smrg		;;
74729459361Smrg	hppro)
74829459361Smrg		basic_machine=hppa1.1-hp
74929459361Smrg		os=-proelf
75029459361Smrg		;;
75129459361Smrg	i370-ibm* | ibm*)
75229459361Smrg		basic_machine=i370-ibm
75329459361Smrg		;;
75429459361Smrg	i*86v32)
75527935385Smrg		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
75629459361Smrg		os=-sysv32
75729459361Smrg		;;
75829459361Smrg	i*86v4*)
75927935385Smrg		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
76029459361Smrg		os=-sysv4
76129459361Smrg		;;
76229459361Smrg	i*86v)
76327935385Smrg		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
76429459361Smrg		os=-sysv
76529459361Smrg		;;
76629459361Smrg	i*86sol2)
76727935385Smrg		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
76829459361Smrg		os=-solaris2
76929459361Smrg		;;
77029459361Smrg	i386mach)
77129459361Smrg		basic_machine=i386-mach
77229459361Smrg		os=-mach
77329459361Smrg		;;
77427935385Smrg	vsta)
77529459361Smrg		basic_machine=i386-unknown
77629459361Smrg		os=-vsta
77729459361Smrg		;;
77829459361Smrg	iris | iris4d)
77929459361Smrg		basic_machine=mips-sgi
78029459361Smrg		case $os in
78129459361Smrg		    -irix*)
78229459361Smrg			;;
78329459361Smrg		    *)
78429459361Smrg			os=-irix4
78529459361Smrg			;;
78629459361Smrg		esac
78729459361Smrg		;;
78829459361Smrg	isi68 | isi)
78929459361Smrg		basic_machine=m68k-isi
79029459361Smrg		os=-sysv
79129459361Smrg		;;
79227935385Smrg	leon-*|leon[3-9]-*)
79327935385Smrg		basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
79427935385Smrg		;;
7955715adc0Smrg	m68knommu)
7965715adc0Smrg		basic_machine=m68k-unknown
7975715adc0Smrg		os=-linux
7985715adc0Smrg		;;
7995715adc0Smrg	m68knommu-*)
80027935385Smrg		basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
8015715adc0Smrg		os=-linux
8025715adc0Smrg		;;
80329459361Smrg	magnum | m3230)
80429459361Smrg		basic_machine=mips-mips
80529459361Smrg		os=-sysv
80629459361Smrg		;;
80729459361Smrg	merlin)
80829459361Smrg		basic_machine=ns32k-utek
80929459361Smrg		os=-sysv
81029459361Smrg		;;
811f66e55a2Smrg	microblaze*)
812c3c9b392Smrg		basic_machine=microblaze-xilinx
813c3c9b392Smrg		;;
814f66e55a2Smrg	mingw64)
815f66e55a2Smrg		basic_machine=x86_64-pc
816f66e55a2Smrg		os=-mingw64
817f66e55a2Smrg		;;
81829459361Smrg	mingw32)
81927935385Smrg		basic_machine=i686-pc
82029459361Smrg		os=-mingw32
82129459361Smrg		;;
8225715adc0Smrg	mingw32ce)
8235715adc0Smrg		basic_machine=arm-unknown
8245715adc0Smrg		os=-mingw32ce
8255715adc0Smrg		;;
82629459361Smrg	miniframe)
82729459361Smrg		basic_machine=m68000-convergent
82829459361Smrg		;;
82929459361Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
83029459361Smrg		basic_machine=m68k-atari
83129459361Smrg		os=-mint
83229459361Smrg		;;
83329459361Smrg	mips3*-*)
83427935385Smrg		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
83529459361Smrg		;;
83629459361Smrg	mips3*)
83727935385Smrg		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
83829459361Smrg		;;
83929459361Smrg	monitor)
84029459361Smrg		basic_machine=m68k-rom68k
84129459361Smrg		os=-coff
84229459361Smrg		;;
84329459361Smrg	morphos)
84429459361Smrg		basic_machine=powerpc-unknown
84529459361Smrg		os=-morphos
84629459361Smrg		;;
84727935385Smrg	moxiebox)
84827935385Smrg		basic_machine=moxie-unknown
84927935385Smrg		os=-moxiebox
85027935385Smrg		;;
85129459361Smrg	msdos)
85229459361Smrg		basic_machine=i386-pc
85329459361Smrg		os=-msdos
85429459361Smrg		;;
85529459361Smrg	ms1-*)
85627935385Smrg		basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
85729459361Smrg		;;
858f66e55a2Smrg	msys)
85927935385Smrg		basic_machine=i686-pc
860f66e55a2Smrg		os=-msys
861f66e55a2Smrg		;;
86229459361Smrg	mvs)
86329459361Smrg		basic_machine=i370-ibm
86429459361Smrg		os=-mvs
86529459361Smrg		;;
866f66e55a2Smrg	nacl)
867f66e55a2Smrg		basic_machine=le32-unknown
868f66e55a2Smrg		os=-nacl
869f66e55a2Smrg		;;
87029459361Smrg	ncr3000)
87129459361Smrg		basic_machine=i486-ncr
87229459361Smrg		os=-sysv4
87329459361Smrg		;;
87429459361Smrg	netbsd386)
87529459361Smrg		basic_machine=i386-unknown
87629459361Smrg		os=-netbsd
87729459361Smrg		;;
87829459361Smrg	netwinder)
87929459361Smrg		basic_machine=armv4l-rebel
88029459361Smrg		os=-linux
88129459361Smrg		;;
88229459361Smrg	news | news700 | news800 | news900)
88329459361Smrg		basic_machine=m68k-sony
88429459361Smrg		os=-newsos
88529459361Smrg		;;
88629459361Smrg	news1000)
88729459361Smrg		basic_machine=m68030-sony
88829459361Smrg		os=-newsos
88929459361Smrg		;;
89029459361Smrg	news-3600 | risc-news)
89129459361Smrg		basic_machine=mips-sony
89229459361Smrg		os=-newsos
89329459361Smrg		;;
89429459361Smrg	necv70)
89529459361Smrg		basic_machine=v70-nec
89629459361Smrg		os=-sysv
89729459361Smrg		;;
89827935385Smrg	next | m*-next)
89929459361Smrg		basic_machine=m68k-next
90029459361Smrg		case $os in
90129459361Smrg		    -nextstep* )
90229459361Smrg			;;
90329459361Smrg		    -ns2*)
90429459361Smrg		      os=-nextstep2
90529459361Smrg			;;
90629459361Smrg		    *)
90729459361Smrg		      os=-nextstep3
90829459361Smrg			;;
90929459361Smrg		esac
91029459361Smrg		;;
91129459361Smrg	nh3000)
91229459361Smrg		basic_machine=m68k-harris
91329459361Smrg		os=-cxux
91429459361Smrg		;;
91529459361Smrg	nh[45]000)
91629459361Smrg		basic_machine=m88k-harris
91729459361Smrg		os=-cxux
91829459361Smrg		;;
91929459361Smrg	nindy960)
92029459361Smrg		basic_machine=i960-intel
92129459361Smrg		os=-nindy
92229459361Smrg		;;
92329459361Smrg	mon960)
92429459361Smrg		basic_machine=i960-intel
92529459361Smrg		os=-mon960
92629459361Smrg		;;
92729459361Smrg	nonstopux)
92829459361Smrg		basic_machine=mips-compaq
92929459361Smrg		os=-nonstopux
93029459361Smrg		;;
93129459361Smrg	np1)
93229459361Smrg		basic_machine=np1-gould
93329459361Smrg		;;
934f66e55a2Smrg	neo-tandem)
935c3c9b392Smrg		basic_machine=neo-tandem
936c3c9b392Smrg		;;
937f66e55a2Smrg	nse-tandem)
938c3c9b392Smrg		basic_machine=nse-tandem
939c3c9b392Smrg		;;
94029459361Smrg	nsr-tandem)
94129459361Smrg		basic_machine=nsr-tandem
94229459361Smrg		;;
94327935385Smrg	nsv-tandem)
94427935385Smrg		basic_machine=nsv-tandem
94527935385Smrg		;;
94627935385Smrg	nsx-tandem)
94727935385Smrg		basic_machine=nsx-tandem
94827935385Smrg		;;
94929459361Smrg	op50n-* | op60c-*)
95029459361Smrg		basic_machine=hppa1.1-oki
95129459361Smrg		os=-proelf
95229459361Smrg		;;
95329459361Smrg	openrisc | openrisc-*)
95429459361Smrg		basic_machine=or32-unknown
95529459361Smrg		;;
95629459361Smrg	os400)
95729459361Smrg		basic_machine=powerpc-ibm
95829459361Smrg		os=-os400
95929459361Smrg		;;
96029459361Smrg	OSE68000 | ose68000)
96129459361Smrg		basic_machine=m68000-ericsson
96229459361Smrg		os=-ose
96329459361Smrg		;;
96429459361Smrg	os68k)
96529459361Smrg		basic_machine=m68k-none
96629459361Smrg		os=-os68k
96729459361Smrg		;;
96829459361Smrg	pa-hitachi)
96929459361Smrg		basic_machine=hppa1.1-hitachi
97029459361Smrg		os=-hiuxwe2
97129459361Smrg		;;
97229459361Smrg	paragon)
97329459361Smrg		basic_machine=i860-intel
97429459361Smrg		os=-osf
97529459361Smrg		;;
9765715adc0Smrg	parisc)
9775715adc0Smrg		basic_machine=hppa-unknown
9785715adc0Smrg		os=-linux
9795715adc0Smrg		;;
9805715adc0Smrg	parisc-*)
98127935385Smrg		basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
9825715adc0Smrg		os=-linux
9835715adc0Smrg		;;
98429459361Smrg	pbd)
98529459361Smrg		basic_machine=sparc-tti
98629459361Smrg		;;
98729459361Smrg	pbb)
98829459361Smrg		basic_machine=m68k-tti
98929459361Smrg		;;
99029459361Smrg	pc532 | pc532-*)
99129459361Smrg		basic_machine=ns32k-pc532
99229459361Smrg		;;
99329459361Smrg	pc98)
99429459361Smrg		basic_machine=i386-pc
99529459361Smrg		;;
99629459361Smrg	pc98-*)
99727935385Smrg		basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
99829459361Smrg		;;
99929459361Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
100029459361Smrg		basic_machine=i586-pc
100129459361Smrg		;;
100229459361Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
100329459361Smrg		basic_machine=i686-pc
100429459361Smrg		;;
100529459361Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
100629459361Smrg		basic_machine=i686-pc
100729459361Smrg		;;
100829459361Smrg	pentium4)
100929459361Smrg		basic_machine=i786-pc
101029459361Smrg		;;
101129459361Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
101227935385Smrg		basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
101329459361Smrg		;;
101429459361Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
101527935385Smrg		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
101629459361Smrg		;;
101729459361Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
101827935385Smrg		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
101929459361Smrg		;;
102029459361Smrg	pentium4-*)
102127935385Smrg		basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
102229459361Smrg		;;
102329459361Smrg	pn)
102429459361Smrg		basic_machine=pn-gould
102529459361Smrg		;;
102629459361Smrg	power)	basic_machine=power-ibm
102729459361Smrg		;;
1028f66e55a2Smrg	ppc | ppcbe)	basic_machine=powerpc-unknown
102929459361Smrg		;;
1030f66e55a2Smrg	ppc-* | ppcbe-*)
103127935385Smrg		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
103229459361Smrg		;;
103327935385Smrg	ppcle | powerpclittle)
103429459361Smrg		basic_machine=powerpcle-unknown
103529459361Smrg		;;
103629459361Smrg	ppcle-* | powerpclittle-*)
103727935385Smrg		basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
103829459361Smrg		;;
103929459361Smrg	ppc64)	basic_machine=powerpc64-unknown
104029459361Smrg		;;
104127935385Smrg	ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
104229459361Smrg		;;
104327935385Smrg	ppc64le | powerpc64little)
104429459361Smrg		basic_machine=powerpc64le-unknown
104529459361Smrg		;;
104629459361Smrg	ppc64le-* | powerpc64little-*)
104727935385Smrg		basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
104829459361Smrg		;;
104929459361Smrg	ps2)
105029459361Smrg		basic_machine=i386-ibm
105129459361Smrg		;;
105229459361Smrg	pw32)
105329459361Smrg		basic_machine=i586-unknown
105429459361Smrg		os=-pw32
105529459361Smrg		;;
1056f66e55a2Smrg	rdos | rdos64)
1057f66e55a2Smrg		basic_machine=x86_64-pc
1058f66e55a2Smrg		os=-rdos
1059f66e55a2Smrg		;;
1060f66e55a2Smrg	rdos32)
106129459361Smrg		basic_machine=i386-pc
106229459361Smrg		os=-rdos
106329459361Smrg		;;
106429459361Smrg	rom68k)
106529459361Smrg		basic_machine=m68k-rom68k
106629459361Smrg		os=-coff
106729459361Smrg		;;
106829459361Smrg	rm[46]00)
106929459361Smrg		basic_machine=mips-siemens
107029459361Smrg		;;
107129459361Smrg	rtpc | rtpc-*)
107229459361Smrg		basic_machine=romp-ibm
107329459361Smrg		;;
107429459361Smrg	s390 | s390-*)
107529459361Smrg		basic_machine=s390-ibm
107629459361Smrg		;;
107729459361Smrg	s390x | s390x-*)
107829459361Smrg		basic_machine=s390x-ibm
107929459361Smrg		;;
108029459361Smrg	sa29200)
108129459361Smrg		basic_machine=a29k-amd
108229459361Smrg		os=-udi
108329459361Smrg		;;
108429459361Smrg	sb1)
108529459361Smrg		basic_machine=mipsisa64sb1-unknown
108629459361Smrg		;;
108729459361Smrg	sb1el)
108829459361Smrg		basic_machine=mipsisa64sb1el-unknown
108929459361Smrg		;;
109029459361Smrg	sde)
109129459361Smrg		basic_machine=mipsisa32-sde
109229459361Smrg		os=-elf
109329459361Smrg		;;
109429459361Smrg	sei)
109529459361Smrg		basic_machine=mips-sei
109629459361Smrg		os=-seiux
109729459361Smrg		;;
109829459361Smrg	sequent)
109929459361Smrg		basic_machine=i386-sequent
110029459361Smrg		;;
110129459361Smrg	sh5el)
110229459361Smrg		basic_machine=sh5le-unknown
110329459361Smrg		;;
110427935385Smrg	simso-wrs)
110529459361Smrg		basic_machine=sparclite-wrs
110629459361Smrg		os=-vxworks
110729459361Smrg		;;
110829459361Smrg	sps7)
110929459361Smrg		basic_machine=m68k-bull
111029459361Smrg		os=-sysv2
111129459361Smrg		;;
111229459361Smrg	spur)
111329459361Smrg		basic_machine=spur-unknown
111429459361Smrg		;;
111529459361Smrg	st2000)
111629459361Smrg		basic_machine=m68k-tandem
111729459361Smrg		;;
111829459361Smrg	stratus)
111929459361Smrg		basic_machine=i860-stratus
112029459361Smrg		os=-sysv4
112129459361Smrg		;;
1122f66e55a2Smrg	strongarm-* | thumb-*)
112327935385Smrg		basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
1124f66e55a2Smrg		;;
112529459361Smrg	sun2)
112629459361Smrg		basic_machine=m68000-sun
112729459361Smrg		;;
112829459361Smrg	sun2os3)
112929459361Smrg		basic_machine=m68000-sun
113029459361Smrg		os=-sunos3
113129459361Smrg		;;
113229459361Smrg	sun2os4)
113329459361Smrg		basic_machine=m68000-sun
113429459361Smrg		os=-sunos4
113529459361Smrg		;;
113629459361Smrg	sun3os3)
113729459361Smrg		basic_machine=m68k-sun
113829459361Smrg		os=-sunos3
113929459361Smrg		;;
114029459361Smrg	sun3os4)
114129459361Smrg		basic_machine=m68k-sun
114229459361Smrg		os=-sunos4
114329459361Smrg		;;
114429459361Smrg	sun4os3)
114529459361Smrg		basic_machine=sparc-sun
114629459361Smrg		os=-sunos3
114729459361Smrg		;;
114829459361Smrg	sun4os4)
114929459361Smrg		basic_machine=sparc-sun
115029459361Smrg		os=-sunos4
115129459361Smrg		;;
115229459361Smrg	sun4sol2)
115329459361Smrg		basic_machine=sparc-sun
115429459361Smrg		os=-solaris2
115529459361Smrg		;;
115629459361Smrg	sun3 | sun3-*)
115729459361Smrg		basic_machine=m68k-sun
115829459361Smrg		;;
115929459361Smrg	sun4)
116029459361Smrg		basic_machine=sparc-sun
116129459361Smrg		;;
116229459361Smrg	sun386 | sun386i | roadrunner)
116329459361Smrg		basic_machine=i386-sun
116429459361Smrg		;;
116529459361Smrg	sv1)
116629459361Smrg		basic_machine=sv1-cray
116729459361Smrg		os=-unicos
116829459361Smrg		;;
116929459361Smrg	symmetry)
117029459361Smrg		basic_machine=i386-sequent
117129459361Smrg		os=-dynix
117229459361Smrg		;;
117329459361Smrg	t3e)
117429459361Smrg		basic_machine=alphaev5-cray
117529459361Smrg		os=-unicos
117629459361Smrg		;;
117729459361Smrg	t90)
117829459361Smrg		basic_machine=t90-cray
117929459361Smrg		os=-unicos
118029459361Smrg		;;
11815715adc0Smrg	tile*)
1182f66e55a2Smrg		basic_machine=$basic_machine-unknown
11835715adc0Smrg		os=-linux-gnu
11845715adc0Smrg		;;
118529459361Smrg	tx39)
118629459361Smrg		basic_machine=mipstx39-unknown
118729459361Smrg		;;
118829459361Smrg	tx39el)
118929459361Smrg		basic_machine=mipstx39el-unknown
119029459361Smrg		;;
119129459361Smrg	toad1)
119229459361Smrg		basic_machine=pdp10-xkl
119329459361Smrg		os=-tops20
119429459361Smrg		;;
119529459361Smrg	tower | tower-32)
119629459361Smrg		basic_machine=m68k-ncr
119729459361Smrg		;;
119829459361Smrg	tpf)
119929459361Smrg		basic_machine=s390x-ibm
120029459361Smrg		os=-tpf
120129459361Smrg		;;
120229459361Smrg	udi29k)
120329459361Smrg		basic_machine=a29k-amd
120429459361Smrg		os=-udi
120529459361Smrg		;;
120629459361Smrg	ultra3)
120729459361Smrg		basic_machine=a29k-nyu
120829459361Smrg		os=-sym1
120929459361Smrg		;;
121029459361Smrg	v810 | necv810)
121129459361Smrg		basic_machine=v810-nec
121229459361Smrg		os=-none
121329459361Smrg		;;
121429459361Smrg	vaxv)
121529459361Smrg		basic_machine=vax-dec
121629459361Smrg		os=-sysv
121729459361Smrg		;;
121829459361Smrg	vms)
121929459361Smrg		basic_machine=vax-dec
122029459361Smrg		os=-vms
122129459361Smrg		;;
122229459361Smrg	vpp*|vx|vx-*)
122329459361Smrg		basic_machine=f301-fujitsu
122429459361Smrg		;;
122529459361Smrg	vxworks960)
122629459361Smrg		basic_machine=i960-wrs
122729459361Smrg		os=-vxworks
122829459361Smrg		;;
122929459361Smrg	vxworks68)
123029459361Smrg		basic_machine=m68k-wrs
123129459361Smrg		os=-vxworks
123229459361Smrg		;;
123329459361Smrg	vxworks29k)
123429459361Smrg		basic_machine=a29k-wrs
123529459361Smrg		os=-vxworks
123629459361Smrg		;;
123729459361Smrg	w65*)
123829459361Smrg		basic_machine=w65-wdc
123929459361Smrg		os=-none
124029459361Smrg		;;
124129459361Smrg	w89k-*)
124229459361Smrg		basic_machine=hppa1.1-winbond
124329459361Smrg		os=-proelf
124429459361Smrg		;;
124527935385Smrg	x64)
124627935385Smrg		basic_machine=x86_64-pc
124727935385Smrg		;;
124829459361Smrg	xbox)
124929459361Smrg		basic_machine=i686-pc
125029459361Smrg		os=-mingw32
125129459361Smrg		;;
125229459361Smrg	xps | xps100)
125329459361Smrg		basic_machine=xps100-honeywell
125429459361Smrg		;;
1255f66e55a2Smrg	xscale-* | xscalee[bl]-*)
125627935385Smrg		basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
1257f66e55a2Smrg		;;
125829459361Smrg	ymp)
125929459361Smrg		basic_machine=ymp-cray
126029459361Smrg		os=-unicos
126129459361Smrg		;;
126229459361Smrg	none)
126329459361Smrg		basic_machine=none-none
126429459361Smrg		os=-none
126529459361Smrg		;;
126629459361Smrg
126729459361Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
126829459361Smrg# some cases the only manufacturer, in others, it is the most popular.
126929459361Smrg	w89k)
127029459361Smrg		basic_machine=hppa1.1-winbond
127129459361Smrg		;;
127229459361Smrg	op50n)
127329459361Smrg		basic_machine=hppa1.1-oki
127429459361Smrg		;;
127529459361Smrg	op60c)
127629459361Smrg		basic_machine=hppa1.1-oki
127729459361Smrg		;;
127829459361Smrg	romp)
127929459361Smrg		basic_machine=romp-ibm
128029459361Smrg		;;
128129459361Smrg	mmix)
128229459361Smrg		basic_machine=mmix-knuth
128329459361Smrg		;;
128429459361Smrg	rs6000)
128529459361Smrg		basic_machine=rs6000-ibm
128629459361Smrg		;;
128729459361Smrg	vax)
128829459361Smrg		basic_machine=vax-dec
128929459361Smrg		;;
129029459361Smrg	pdp11)
129129459361Smrg		basic_machine=pdp11-dec
129229459361Smrg		;;
129329459361Smrg	we32k)
129429459361Smrg		basic_machine=we32k-att
129529459361Smrg		;;
12965715adc0Smrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
129729459361Smrg		basic_machine=sh-unknown
129829459361Smrg		;;
129929459361Smrg	cydra)
130029459361Smrg		basic_machine=cydra-cydrome
130129459361Smrg		;;
130229459361Smrg	orion)
130329459361Smrg		basic_machine=orion-highlevel
130429459361Smrg		;;
130529459361Smrg	orion105)
130629459361Smrg		basic_machine=clipper-highlevel
130729459361Smrg		;;
130829459361Smrg	mac | mpw | mac-mpw)
130929459361Smrg		basic_machine=m68k-apple
131029459361Smrg		;;
131129459361Smrg	pmac | pmac-mpw)
131229459361Smrg		basic_machine=powerpc-apple
131329459361Smrg		;;
131429459361Smrg	*-unknown)
131529459361Smrg		# Make sure to match an already-canonicalized machine name.
131629459361Smrg		;;
131729459361Smrg	*)
131827935385Smrg		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
131929459361Smrg		exit 1
132029459361Smrg		;;
132129459361Smrgesac
132229459361Smrg
132329459361Smrg# Here we canonicalize certain aliases for manufacturers.
132429459361Smrgcase $basic_machine in
132529459361Smrg	*-digital*)
132627935385Smrg		basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
132729459361Smrg		;;
132829459361Smrg	*-commodore*)
132927935385Smrg		basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
133029459361Smrg		;;
133129459361Smrg	*)
133229459361Smrg		;;
133329459361Smrgesac
133429459361Smrg
133529459361Smrg# Decode manufacturer-specific aliases for certain operating systems.
133629459361Smrg
133729459361Smrgif [ x"$os" != x"" ]
133829459361Smrgthen
133929459361Smrgcase $os in
134027935385Smrg	# First match some system type aliases that might get confused
134127935385Smrg	# with valid system types.
134229459361Smrg	# -solaris* is a basic system type, with this one exception.
1343f66e55a2Smrg	-auroraux)
1344f66e55a2Smrg		os=-auroraux
1345c3c9b392Smrg		;;
134629459361Smrg	-solaris1 | -solaris1.*)
134729459361Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
134829459361Smrg		;;
134929459361Smrg	-solaris)
135029459361Smrg		os=-solaris2
135129459361Smrg		;;
135229459361Smrg	-unixware*)
135329459361Smrg		os=-sysv4.2uw
135429459361Smrg		;;
135529459361Smrg	-gnu/linux*)
135629459361Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
135729459361Smrg		;;
135827935385Smrg	# es1800 is here to avoid being matched by es* (a different OS)
135927935385Smrg	-es1800*)
136027935385Smrg		os=-ose
136127935385Smrg		;;
136227935385Smrg	# Now accept the basic system types.
136329459361Smrg	# The portable systems comes first.
136427935385Smrg	# Each alternative MUST end in a * to match a version number.
136529459361Smrg	# -sysv* is not here because it comes later, after sysvr4.
136629459361Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1367c3c9b392Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1368c3c9b392Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1369f66e55a2Smrg	      | -sym* | -kopensolaris* | -plan9* \
137029459361Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
137127935385Smrg	      | -aos* | -aros* | -cloudabi* | -sortix* \
137229459361Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
137329459361Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
137427935385Smrg	      | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
137527935385Smrg	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
137629459361Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
137729459361Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
137829459361Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
137927935385Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
138027935385Smrg	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
1381f66e55a2Smrg	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
138227935385Smrg	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
1383f66e55a2Smrg	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
138427935385Smrg	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
138527935385Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
138629459361Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
138729459361Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
138829459361Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
138927935385Smrg	      | -morphos* | -superux* | -rtmk* | -windiss* \
139029459361Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
139127935385Smrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
139227935385Smrg	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
139327935385Smrg	      | -midnightbsd*)
139429459361Smrg	# Remember, each alternative MUST END IN *, to match a version number.
139529459361Smrg		;;
139629459361Smrg	-qnx*)
139729459361Smrg		case $basic_machine in
139829459361Smrg		    x86-* | i*86-*)
139929459361Smrg			;;
140029459361Smrg		    *)
140129459361Smrg			os=-nto$os
140229459361Smrg			;;
140329459361Smrg		esac
140429459361Smrg		;;
140529459361Smrg	-nto-qnx*)
140629459361Smrg		;;
140729459361Smrg	-nto*)
140829459361Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
140929459361Smrg		;;
141027935385Smrg	-sim | -xray | -os68k* | -v88r* \
141127935385Smrg	      | -windows* | -osx | -abug | -netware* | -os9* \
141229459361Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
141329459361Smrg		;;
141429459361Smrg	-mac*)
141527935385Smrg		os=`echo "$os" | sed -e 's|mac|macos|'`
141629459361Smrg		;;
141729459361Smrg	-linux-dietlibc)
141829459361Smrg		os=-linux-dietlibc
141929459361Smrg		;;
142029459361Smrg	-linux*)
142129459361Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
142229459361Smrg		;;
142329459361Smrg	-sunos5*)
142427935385Smrg		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
142529459361Smrg		;;
142629459361Smrg	-sunos6*)
142727935385Smrg		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
142829459361Smrg		;;
142929459361Smrg	-opened*)
143029459361Smrg		os=-openedition
143129459361Smrg		;;
1432f66e55a2Smrg	-os400*)
143329459361Smrg		os=-os400
143429459361Smrg		;;
143529459361Smrg	-wince*)
143629459361Smrg		os=-wince
143729459361Smrg		;;
143829459361Smrg	-utek*)
143929459361Smrg		os=-bsd
144029459361Smrg		;;
144129459361Smrg	-dynix*)
144229459361Smrg		os=-bsd
144329459361Smrg		;;
144429459361Smrg	-acis*)
144529459361Smrg		os=-aos
144629459361Smrg		;;
144729459361Smrg	-atheos*)
144829459361Smrg		os=-atheos
144929459361Smrg		;;
145029459361Smrg	-syllable*)
145129459361Smrg		os=-syllable
145229459361Smrg		;;
145329459361Smrg	-386bsd)
145429459361Smrg		os=-bsd
145529459361Smrg		;;
145629459361Smrg	-ctix* | -uts*)
145729459361Smrg		os=-sysv
145829459361Smrg		;;
145929459361Smrg	-nova*)
146029459361Smrg		os=-rtmk-nova
146129459361Smrg		;;
146227935385Smrg	-ns2)
146329459361Smrg		os=-nextstep2
146429459361Smrg		;;
146529459361Smrg	-nsk*)
146629459361Smrg		os=-nsk
146729459361Smrg		;;
146829459361Smrg	# Preserve the version number of sinix5.
146929459361Smrg	-sinix5.*)
147029459361Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
147129459361Smrg		;;
147229459361Smrg	-sinix*)
147329459361Smrg		os=-sysv4
147429459361Smrg		;;
1475f66e55a2Smrg	-tpf*)
147629459361Smrg		os=-tpf
147729459361Smrg		;;
147829459361Smrg	-triton*)
147929459361Smrg		os=-sysv3
148029459361Smrg		;;
148129459361Smrg	-oss*)
148229459361Smrg		os=-sysv3
148329459361Smrg		;;
148427935385Smrg	-svr4*)
148529459361Smrg		os=-sysv4
148629459361Smrg		;;
148729459361Smrg	-svr3)
148829459361Smrg		os=-sysv3
148929459361Smrg		;;
149029459361Smrg	-sysvr4)
149129459361Smrg		os=-sysv4
149229459361Smrg		;;
149329459361Smrg	# This must come after -sysvr4.
149429459361Smrg	-sysv*)
149529459361Smrg		;;
149629459361Smrg	-ose*)
149729459361Smrg		os=-ose
149829459361Smrg		;;
149929459361Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
150029459361Smrg		os=-mint
150129459361Smrg		;;
150229459361Smrg	-zvmoe)
150329459361Smrg		os=-zvmoe
150429459361Smrg		;;
15055715adc0Smrg	-dicos*)
15065715adc0Smrg		os=-dicos
15075715adc0Smrg		;;
150827935385Smrg	-pikeos*)
150927935385Smrg		# Until real need of OS specific support for
151027935385Smrg		# particular features comes up, bare metal
151127935385Smrg		# configurations are quite functional.
151227935385Smrg		case $basic_machine in
151327935385Smrg		    arm*)
151427935385Smrg			os=-eabi
151527935385Smrg			;;
151627935385Smrg		    *)
151727935385Smrg			os=-elf
151827935385Smrg			;;
151927935385Smrg		esac
152027935385Smrg		;;
1521f66e55a2Smrg	-nacl*)
1522f66e55a2Smrg		;;
152327935385Smrg	-ios)
152427935385Smrg		;;
152529459361Smrg	-none)
152629459361Smrg		;;
152729459361Smrg	*)
152829459361Smrg		# Get rid of the `-' at the beginning of $os.
152929459361Smrg		os=`echo $os | sed 's/[^-]*-//'`
153027935385Smrg		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
153129459361Smrg		exit 1
153229459361Smrg		;;
153329459361Smrgesac
153429459361Smrgelse
153529459361Smrg
153629459361Smrg# Here we handle the default operating systems that come with various machines.
153729459361Smrg# The value should be what the vendor currently ships out the door with their
153829459361Smrg# machine or put another way, the most popular os provided with the machine.
153929459361Smrg
154029459361Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
154129459361Smrg# "-sun"), then you have to tell the case statement up towards the top
154229459361Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
154329459361Smrg# will signal an error saying that MANUFACTURER isn't an operating
154429459361Smrg# system, and we'll never get to this point.
154529459361Smrg
154629459361Smrgcase $basic_machine in
1547f66e55a2Smrg	score-*)
154829459361Smrg		os=-elf
154929459361Smrg		;;
1550f66e55a2Smrg	spu-*)
155129459361Smrg		os=-elf
155229459361Smrg		;;
155329459361Smrg	*-acorn)
155429459361Smrg		os=-riscix1.2
155529459361Smrg		;;
155629459361Smrg	arm*-rebel)
155729459361Smrg		os=-linux
155829459361Smrg		;;
155929459361Smrg	arm*-semi)
156029459361Smrg		os=-aout
156129459361Smrg		;;
1562f66e55a2Smrg	c4x-* | tic4x-*)
1563f66e55a2Smrg		os=-coff
1564f66e55a2Smrg		;;
156527935385Smrg	c8051-*)
156627935385Smrg		os=-elf
156727935385Smrg		;;
1568f66e55a2Smrg	hexagon-*)
1569f66e55a2Smrg		os=-elf
157029459361Smrg		;;
1571c3c9b392Smrg	tic54x-*)
1572c3c9b392Smrg		os=-coff
1573c3c9b392Smrg		;;
1574c3c9b392Smrg	tic55x-*)
1575c3c9b392Smrg		os=-coff
1576c3c9b392Smrg		;;
1577c3c9b392Smrg	tic6x-*)
1578c3c9b392Smrg		os=-coff
1579c3c9b392Smrg		;;
158029459361Smrg	# This must come before the *-dec entry.
158129459361Smrg	pdp10-*)
158229459361Smrg		os=-tops20
158329459361Smrg		;;
158429459361Smrg	pdp11-*)
158529459361Smrg		os=-none
158629459361Smrg		;;
158729459361Smrg	*-dec | vax-*)
158829459361Smrg		os=-ultrix4.2
158929459361Smrg		;;
159029459361Smrg	m68*-apollo)
159129459361Smrg		os=-domain
159229459361Smrg		;;
159329459361Smrg	i386-sun)
159429459361Smrg		os=-sunos4.0.2
159529459361Smrg		;;
159629459361Smrg	m68000-sun)
159729459361Smrg		os=-sunos3
159829459361Smrg		;;
159929459361Smrg	m68*-cisco)
160029459361Smrg		os=-aout
160129459361Smrg		;;
1602f66e55a2Smrg	mep-*)
16035715adc0Smrg		os=-elf
16045715adc0Smrg		;;
160529459361Smrg	mips*-cisco)
160629459361Smrg		os=-elf
160729459361Smrg		;;
160829459361Smrg	mips*-*)
160929459361Smrg		os=-elf
161029459361Smrg		;;
161129459361Smrg	or32-*)
161229459361Smrg		os=-coff
161329459361Smrg		;;
161429459361Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
161529459361Smrg		os=-sysv3
161629459361Smrg		;;
161729459361Smrg	sparc-* | *-sun)
161829459361Smrg		os=-sunos4.1.1
161929459361Smrg		;;
162027935385Smrg	pru-*)
162127935385Smrg		os=-elf
162227935385Smrg		;;
162329459361Smrg	*-be)
162429459361Smrg		os=-beos
162529459361Smrg		;;
162629459361Smrg	*-ibm)
162729459361Smrg		os=-aix
162829459361Smrg		;;
1629f66e55a2Smrg	*-knuth)
163029459361Smrg		os=-mmixware
163129459361Smrg		;;
163229459361Smrg	*-wec)
163329459361Smrg		os=-proelf
163429459361Smrg		;;
163529459361Smrg	*-winbond)
163629459361Smrg		os=-proelf
163729459361Smrg		;;
163829459361Smrg	*-oki)
163929459361Smrg		os=-proelf
164029459361Smrg		;;
164129459361Smrg	*-hp)
164229459361Smrg		os=-hpux
164329459361Smrg		;;
164429459361Smrg	*-hitachi)
164529459361Smrg		os=-hiux
164629459361Smrg		;;
164729459361Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
164829459361Smrg		os=-sysv
164929459361Smrg		;;
165029459361Smrg	*-cbm)
165129459361Smrg		os=-amigaos
165229459361Smrg		;;
165329459361Smrg	*-dg)
165429459361Smrg		os=-dgux
165529459361Smrg		;;
165629459361Smrg	*-dolphin)
165729459361Smrg		os=-sysv3
165829459361Smrg		;;
165929459361Smrg	m68k-ccur)
166029459361Smrg		os=-rtu
166129459361Smrg		;;
166229459361Smrg	m88k-omron*)
166329459361Smrg		os=-luna
166429459361Smrg		;;
166527935385Smrg	*-next)
166629459361Smrg		os=-nextstep
166729459361Smrg		;;
166829459361Smrg	*-sequent)
166929459361Smrg		os=-ptx
167029459361Smrg		;;
167129459361Smrg	*-crds)
167229459361Smrg		os=-unos
167329459361Smrg		;;
167429459361Smrg	*-ns)
167529459361Smrg		os=-genix
167629459361Smrg		;;
167729459361Smrg	i370-*)
167829459361Smrg		os=-mvs
167929459361Smrg		;;
168029459361Smrg	*-gould)
168129459361Smrg		os=-sysv
168229459361Smrg		;;
168329459361Smrg	*-highlevel)
168429459361Smrg		os=-bsd
168529459361Smrg		;;
168629459361Smrg	*-encore)
168729459361Smrg		os=-bsd
168829459361Smrg		;;
168929459361Smrg	*-sgi)
169029459361Smrg		os=-irix
169129459361Smrg		;;
169229459361Smrg	*-siemens)
169329459361Smrg		os=-sysv4
169429459361Smrg		;;
169529459361Smrg	*-masscomp)
169629459361Smrg		os=-rtu
169729459361Smrg		;;
169829459361Smrg	f30[01]-fujitsu | f700-fujitsu)
169929459361Smrg		os=-uxpv
170029459361Smrg		;;
170129459361Smrg	*-rom68k)
170229459361Smrg		os=-coff
170329459361Smrg		;;
170429459361Smrg	*-*bug)
170529459361Smrg		os=-coff
170629459361Smrg		;;
170729459361Smrg	*-apple)
170829459361Smrg		os=-macos
170929459361Smrg		;;
171029459361Smrg	*-atari*)
171129459361Smrg		os=-mint
171229459361Smrg		;;
171329459361Smrg	*)
171429459361Smrg		os=-none
171529459361Smrg		;;
171629459361Smrgesac
171729459361Smrgfi
171829459361Smrg
171929459361Smrg# Here we handle the case where we know the os, and the CPU type, but not the
172029459361Smrg# manufacturer.  We pick the logical manufacturer.
172129459361Smrgvendor=unknown
172229459361Smrgcase $basic_machine in
172329459361Smrg	*-unknown)
172429459361Smrg		case $os in
172529459361Smrg			-riscix*)
172629459361Smrg				vendor=acorn
172729459361Smrg				;;
172829459361Smrg			-sunos*)
172929459361Smrg				vendor=sun
173029459361Smrg				;;
1731c3c9b392Smrg			-cnk*|-aix*)
173229459361Smrg				vendor=ibm
173329459361Smrg				;;
173429459361Smrg			-beos*)
173529459361Smrg				vendor=be
173629459361Smrg				;;
173729459361Smrg			-hpux*)
173829459361Smrg				vendor=hp
173929459361Smrg				;;
174029459361Smrg			-mpeix*)
174129459361Smrg				vendor=hp
174229459361Smrg				;;
174329459361Smrg			-hiux*)
174429459361Smrg				vendor=hitachi
174529459361Smrg				;;
174629459361Smrg			-unos*)
174729459361Smrg				vendor=crds
174829459361Smrg				;;
174929459361Smrg			-dgux*)
175029459361Smrg				vendor=dg
175129459361Smrg				;;
175229459361Smrg			-luna*)
175329459361Smrg				vendor=omron
175429459361Smrg				;;
175529459361Smrg			-genix*)
175629459361Smrg				vendor=ns
175729459361Smrg				;;
175829459361Smrg			-mvs* | -opened*)
175929459361Smrg				vendor=ibm
176029459361Smrg				;;
176129459361Smrg			-os400*)
176229459361Smrg				vendor=ibm
176329459361Smrg				;;
176429459361Smrg			-ptx*)
176529459361Smrg				vendor=sequent
176629459361Smrg				;;
176729459361Smrg			-tpf*)
176829459361Smrg				vendor=ibm
176929459361Smrg				;;
177029459361Smrg			-vxsim* | -vxworks* | -windiss*)
177129459361Smrg				vendor=wrs
177229459361Smrg				;;
177329459361Smrg			-aux*)
177429459361Smrg				vendor=apple
177529459361Smrg				;;
177629459361Smrg			-hms*)
177729459361Smrg				vendor=hitachi
177829459361Smrg				;;
177929459361Smrg			-mpw* | -macos*)
178029459361Smrg				vendor=apple
178129459361Smrg				;;
178229459361Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
178329459361Smrg				vendor=atari
178429459361Smrg				;;
178529459361Smrg			-vos*)
178629459361Smrg				vendor=stratus
178729459361Smrg				;;
178829459361Smrg		esac
178927935385Smrg		basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
179029459361Smrg		;;
179129459361Smrgesac
179229459361Smrg
179327935385Smrgecho "$basic_machine$os"
179429459361Smrgexit
179529459361Smrg
179629459361Smrg# Local variables:
179727935385Smrg# eval: (add-hook 'write-file-functions 'time-stamp)
179829459361Smrg# time-stamp-start: "timestamp='"
179929459361Smrg# time-stamp-format: "%:y-%02m-%02d"
180029459361Smrg# time-stamp-end: "'"
180129459361Smrg# End:
1802