config.sub revision 01395c31
18255a313Smrg#! /bin/sh
28255a313Smrg# Configuration validation subroutine script.
301395c31Smrg#   Copyright 1992-2017 Free Software Foundation, Inc.
48255a313Smrg
501395c31Smrgtimestamp='2017-01-01'
68255a313Smrg
701395c31Smrg# This file is free software; you can redistribute it and/or modify it
801395c31Smrg# under the terms of the GNU General Public License as published by
901395c31Smrg# the Free Software Foundation; either version 3 of the License, or
108255a313Smrg# (at your option) any later version.
118255a313Smrg#
1201395c31Smrg# This program is distributed in the hope that it will be useful, but
1301395c31Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1401395c31Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1501395c31Smrg# General Public License for more details.
168255a313Smrg#
178255a313Smrg# You should have received a copy of the GNU General Public License
1801395c31Smrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
198255a313Smrg#
208255a313Smrg# As a special exception to the GNU General Public License, if you
218255a313Smrg# distribute this file as part of a program that contains a
228255a313Smrg# configuration script generated by Autoconf, you may include it under
2301395c31Smrg# the same distribution terms that you use for the rest of that
2401395c31Smrg# program.  This Exception is an additional permission under section 7
2501395c31Smrg# of the GNU General Public License, version 3 ("GPLv3").
268255a313Smrg
278255a313Smrg
2801395c31Smrg# Please send patches to <config-patches@gnu.org>.
298255a313Smrg#
308255a313Smrg# Configuration subroutine to validate and canonicalize a configuration type.
318255a313Smrg# Supply the specified configuration type as an argument.
328255a313Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
338255a313Smrg# Otherwise, we print the canonical config type on stdout and succeed.
348255a313Smrg
35de7ed6e8Smrg# You can get the latest version of this script from:
3601395c31Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
37de7ed6e8Smrg
388255a313Smrg# This file is supposed to be the same for all GNU packages
398255a313Smrg# and recognize all the CPU types, system types and aliases
408255a313Smrg# that are meaningful with *any* GNU software.
418255a313Smrg# Each package is responsible for reporting which valid configurations
428255a313Smrg# it does not support.  The user should be able to distinguish
438255a313Smrg# a failure to support a valid configuration from a meaningless
448255a313Smrg# configuration.
458255a313Smrg
468255a313Smrg# The goal of this file is to map all the various variations of a given
478255a313Smrg# machine specification into a single specification in the form:
488255a313Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
498255a313Smrg# or in some cases, the newer four-part form:
508255a313Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
518255a313Smrg# It is wrong to echo any other type of specification.
528255a313Smrg
538255a313Smrgme=`echo "$0" | sed -e 's,.*/,,'`
548255a313Smrg
558255a313Smrgusage="\
5601395c31SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
578255a313Smrg
588255a313SmrgCanonicalize a configuration name.
598255a313Smrg
608255a313SmrgOperation modes:
618255a313Smrg  -h, --help         print this help, then exit
628255a313Smrg  -t, --time-stamp   print date of last modification, then exit
638255a313Smrg  -v, --version      print version number, then exit
648255a313Smrg
658255a313SmrgReport bugs and patches to <config-patches@gnu.org>."
668255a313Smrg
678255a313Smrgversion="\
688255a313SmrgGNU config.sub ($timestamp)
698255a313Smrg
7001395c31SmrgCopyright 1992-2017 Free Software Foundation, Inc.
718255a313Smrg
728255a313SmrgThis is free software; see the source for copying conditions.  There is NO
738255a313Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
748255a313Smrg
758255a313Smrghelp="
768255a313SmrgTry \`$me --help' for more information."
778255a313Smrg
788255a313Smrg# Parse command line
798255a313Smrgwhile test $# -gt 0 ; do
808255a313Smrg  case $1 in
818255a313Smrg    --time-stamp | --time* | -t )
828255a313Smrg       echo "$timestamp" ; exit ;;
838255a313Smrg    --version | -v )
848255a313Smrg       echo "$version" ; exit ;;
858255a313Smrg    --help | --h* | -h )
868255a313Smrg       echo "$usage"; exit ;;
878255a313Smrg    -- )     # Stop option processing
888255a313Smrg       shift; break ;;
898255a313Smrg    - )	# Use stdin as input.
908255a313Smrg       break ;;
918255a313Smrg    -* )
928255a313Smrg       echo "$me: invalid option $1$help"
938255a313Smrg       exit 1 ;;
948255a313Smrg
958255a313Smrg    *local*)
968255a313Smrg       # First pass through any local machine types.
978255a313Smrg       echo $1
988255a313Smrg       exit ;;
998255a313Smrg
1008255a313Smrg    * )
1018255a313Smrg       break ;;
1028255a313Smrg  esac
1038255a313Smrgdone
1048255a313Smrg
1058255a313Smrgcase $# in
1068255a313Smrg 0) echo "$me: missing argument$help" >&2
1078255a313Smrg    exit 1;;
1088255a313Smrg 1) ;;
1098255a313Smrg *) echo "$me: too many arguments$help" >&2
1108255a313Smrg    exit 1;;
1118255a313Smrgesac
1128255a313Smrg
1138255a313Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1148255a313Smrg# Here we must recognize all the valid KERNEL-OS combinations.
1158255a313Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1168255a313Smrgcase $maybe_os in
117de7ed6e8Smrg  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
11801395c31Smrg  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
11901395c31Smrg  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
12001395c31Smrg  kopensolaris*-gnu* | cloudabi*-eabi* | \
1218255a313Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
1228255a313Smrg    os=-$maybe_os
1238255a313Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1248255a313Smrg    ;;
12501395c31Smrg  android-linux)
12601395c31Smrg    os=-linux-android
12701395c31Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
12801395c31Smrg    ;;
1298255a313Smrg  *)
1308255a313Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1318255a313Smrg    if [ $basic_machine != $1 ]
1328255a313Smrg    then os=`echo $1 | sed 's/.*-/-/'`
1338255a313Smrg    else os=; fi
1348255a313Smrg    ;;
1358255a313Smrgesac
1368255a313Smrg
1378255a313Smrg### Let's recognize common machines as not being operating systems so
1388255a313Smrg### that things like config.sub decstation-3100 work.  We also
1398255a313Smrg### recognize some manufacturers as not being operating systems, so we
1408255a313Smrg### can provide default operating systems below.
1418255a313Smrgcase $os in
1428255a313Smrg	-sun*os*)
1438255a313Smrg		# Prevent following clause from handling this invalid input.
1448255a313Smrg		;;
1458255a313Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
1468255a313Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
1478255a313Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
1488255a313Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1498255a313Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1508255a313Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
15101395c31Smrg	-apple | -axis | -knuth | -cray | -microblaze*)
1528255a313Smrg		os=
1538255a313Smrg		basic_machine=$1
1548255a313Smrg		;;
15501395c31Smrg	-bluegene*)
15601395c31Smrg		os=-cnk
157de7ed6e8Smrg		;;
1588255a313Smrg	-sim | -cisco | -oki | -wec | -winbond)
1598255a313Smrg		os=
1608255a313Smrg		basic_machine=$1
1618255a313Smrg		;;
1628255a313Smrg	-scout)
1638255a313Smrg		;;
1648255a313Smrg	-wrs)
1658255a313Smrg		os=-vxworks
1668255a313Smrg		basic_machine=$1
1678255a313Smrg		;;
1688255a313Smrg	-chorusos*)
1698255a313Smrg		os=-chorusos
1708255a313Smrg		basic_machine=$1
1718255a313Smrg		;;
17201395c31Smrg	-chorusrdb)
17301395c31Smrg		os=-chorusrdb
1748255a313Smrg		basic_machine=$1
17501395c31Smrg		;;
1768255a313Smrg	-hiux*)
1778255a313Smrg		os=-hiuxwe2
1788255a313Smrg		;;
1798255a313Smrg	-sco6)
1808255a313Smrg		os=-sco5v6
1818255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1828255a313Smrg		;;
1838255a313Smrg	-sco5)
1848255a313Smrg		os=-sco3.2v5
1858255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1868255a313Smrg		;;
1878255a313Smrg	-sco4)
1888255a313Smrg		os=-sco3.2v4
1898255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1908255a313Smrg		;;
1918255a313Smrg	-sco3.2.[4-9]*)
1928255a313Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1938255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1948255a313Smrg		;;
1958255a313Smrg	-sco3.2v[4-9]*)
1968255a313Smrg		# Don't forget version if it is 3.2v4 or newer.
1978255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1988255a313Smrg		;;
1998255a313Smrg	-sco5v6*)
2008255a313Smrg		# Don't forget version if it is 3.2v4 or newer.
2018255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2028255a313Smrg		;;
2038255a313Smrg	-sco*)
2048255a313Smrg		os=-sco3.2v2
2058255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2068255a313Smrg		;;
2078255a313Smrg	-udk*)
2088255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2098255a313Smrg		;;
2108255a313Smrg	-isc)
2118255a313Smrg		os=-isc2.2
2128255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2138255a313Smrg		;;
2148255a313Smrg	-clix*)
2158255a313Smrg		basic_machine=clipper-intergraph
2168255a313Smrg		;;
2178255a313Smrg	-isc*)
2188255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2198255a313Smrg		;;
22001395c31Smrg	-lynx*178)
22101395c31Smrg		os=-lynxos178
22201395c31Smrg		;;
22301395c31Smrg	-lynx*5)
22401395c31Smrg		os=-lynxos5
22501395c31Smrg		;;
2268255a313Smrg	-lynx*)
2278255a313Smrg		os=-lynxos
2288255a313Smrg		;;
2298255a313Smrg	-ptx*)
2308255a313Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
2318255a313Smrg		;;
2328255a313Smrg	-windowsnt*)
2338255a313Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
2348255a313Smrg		;;
2358255a313Smrg	-psos*)
2368255a313Smrg		os=-psos
2378255a313Smrg		;;
2388255a313Smrg	-mint | -mint[0-9]*)
2398255a313Smrg		basic_machine=m68k-atari
2408255a313Smrg		os=-mint
2418255a313Smrg		;;
2428255a313Smrgesac
2438255a313Smrg
2448255a313Smrg# Decode aliases for certain CPU-COMPANY combinations.
2458255a313Smrgcase $basic_machine in
2468255a313Smrg	# Recognize the basic CPU types without company name.
2478255a313Smrg	# Some are omitted here because they have special meanings below.
2488255a313Smrg	1750a | 580 \
2498255a313Smrg	| a29k \
25001395c31Smrg	| aarch64 | aarch64_be \
2518255a313Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
2528255a313Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
2538255a313Smrg	| am33_2.0 \
25401395c31Smrg	| arc | arceb \
25501395c31Smrg	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
25601395c31Smrg	| avr | avr32 \
25701395c31Smrg	| ba \
25801395c31Smrg	| be32 | be64 \
2598255a313Smrg	| bfin \
26001395c31Smrg	| c4x | c8051 | clipper \
26101395c31Smrg	| d10v | d30v | dlx | dsp16xx | dvp \
26201395c31Smrg	| e2k | epiphany \
26301395c31Smrg	| fido | fr30 | frv | ft32 \
2648255a313Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
26501395c31Smrg	| hexagon \
2668255a313Smrg	| i370 | i860 | i960 | ia64 \
2678255a313Smrg	| ip2k | iq2000 \
26801395c31Smrg	| k1om \
26901395c31Smrg	| le32 | le64 \
2708255a313Smrg	| lm32 \
2718255a313Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
27201395c31Smrg	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
2738255a313Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
2748255a313Smrg	| mips16 \
2758255a313Smrg	| mips64 | mips64el \
2768255a313Smrg	| mips64octeon | mips64octeonel \
2778255a313Smrg	| mips64orion | mips64orionel \
2788255a313Smrg	| mips64r5900 | mips64r5900el \
2798255a313Smrg	| mips64vr | mips64vrel \
2808255a313Smrg	| mips64vr4100 | mips64vr4100el \
2818255a313Smrg	| mips64vr4300 | mips64vr4300el \
2828255a313Smrg	| mips64vr5000 | mips64vr5000el \
2838255a313Smrg	| mips64vr5900 | mips64vr5900el \
2848255a313Smrg	| mipsisa32 | mipsisa32el \
2858255a313Smrg	| mipsisa32r2 | mipsisa32r2el \
28601395c31Smrg	| mipsisa32r6 | mipsisa32r6el \
2878255a313Smrg	| mipsisa64 | mipsisa64el \
2888255a313Smrg	| mipsisa64r2 | mipsisa64r2el \
28901395c31Smrg	| mipsisa64r6 | mipsisa64r6el \
2908255a313Smrg	| mipsisa64sb1 | mipsisa64sb1el \
2918255a313Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
29201395c31Smrg	| mipsr5900 | mipsr5900el \
2938255a313Smrg	| mipstx39 | mipstx39el \
2948255a313Smrg	| mn10200 | mn10300 \
2958255a313Smrg	| moxie \
2968255a313Smrg	| mt \
2978255a313Smrg	| msp430 \
298de7ed6e8Smrg	| nds32 | nds32le | nds32be \
29901395c31Smrg	| nios | nios2 | nios2eb | nios2el \
3008255a313Smrg	| ns16k | ns32k \
30101395c31Smrg	| open8 | or1k | or1knd | or32 \
3028255a313Smrg	| pdp10 | pdp11 | pj | pjl \
30301395c31Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle \
30401395c31Smrg	| pru \
3058255a313Smrg	| pyramid \
30601395c31Smrg	| riscv32 | riscv64 \
30701395c31Smrg	| rl78 | rx \
3088255a313Smrg	| score \
30901395c31Smrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
3108255a313Smrg	| sh64 | sh64le \
3118255a313Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
3128255a313Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
31301395c31Smrg	| spu \
31401395c31Smrg	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
315de7ed6e8Smrg	| ubicom32 \
31601395c31Smrg	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
31701395c31Smrg	| visium \
3188255a313Smrg	| we32k \
31901395c31Smrg	| x86 | xc16x | xstormy16 | xtensa \
3208255a313Smrg	| z8k | z80)
3218255a313Smrg		basic_machine=$basic_machine-unknown
3228255a313Smrg		;;
323de7ed6e8Smrg	c54x)
324de7ed6e8Smrg		basic_machine=tic54x-unknown
325de7ed6e8Smrg		;;
326de7ed6e8Smrg	c55x)
327de7ed6e8Smrg		basic_machine=tic55x-unknown
328de7ed6e8Smrg		;;
329de7ed6e8Smrg	c6x)
330de7ed6e8Smrg		basic_machine=tic6x-unknown
331de7ed6e8Smrg		;;
33201395c31Smrg	leon|leon[3-9])
33301395c31Smrg		basic_machine=sparc-$basic_machine
33401395c31Smrg		;;
33501395c31Smrg	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
3368255a313Smrg		basic_machine=$basic_machine-unknown
3378255a313Smrg		os=-none
3388255a313Smrg		;;
3398255a313Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
3408255a313Smrg		;;
3418255a313Smrg	ms1)
3428255a313Smrg		basic_machine=mt-unknown
3438255a313Smrg		;;
3448255a313Smrg
34501395c31Smrg	strongarm | thumb | xscale)
34601395c31Smrg		basic_machine=arm-unknown
34701395c31Smrg		;;
34801395c31Smrg	xgate)
34901395c31Smrg		basic_machine=$basic_machine-unknown
35001395c31Smrg		os=-none
35101395c31Smrg		;;
35201395c31Smrg	xscaleeb)
35301395c31Smrg		basic_machine=armeb-unknown
35401395c31Smrg		;;
35501395c31Smrg
35601395c31Smrg	xscaleel)
35701395c31Smrg		basic_machine=armel-unknown
35801395c31Smrg		;;
35901395c31Smrg
3608255a313Smrg	# We use `pc' rather than `unknown'
3618255a313Smrg	# because (1) that's what they normally are, and
3628255a313Smrg	# (2) the word "unknown" tends to confuse beginning users.
3638255a313Smrg	i*86 | x86_64)
3648255a313Smrg	  basic_machine=$basic_machine-pc
3658255a313Smrg	  ;;
3668255a313Smrg	# Object if more than one company name word.
3678255a313Smrg	*-*-*)
3688255a313Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
3698255a313Smrg		exit 1
3708255a313Smrg		;;
3718255a313Smrg	# Recognize the basic CPU types with company name.
3728255a313Smrg	580-* \
3738255a313Smrg	| a29k-* \
37401395c31Smrg	| aarch64-* | aarch64_be-* \
3758255a313Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
3768255a313Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
37701395c31Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
3788255a313Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3798255a313Smrg	| avr-* | avr32-* \
38001395c31Smrg	| ba-* \
38101395c31Smrg	| be32-* | be64-* \
3828255a313Smrg	| bfin-* | bs2000-* \
383de7ed6e8Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* \
38401395c31Smrg	| c8051-* | clipper-* | craynv-* | cydra-* \
3858255a313Smrg	| d10v-* | d30v-* | dlx-* \
38601395c31Smrg	| e2k-* | elxsi-* \
3878255a313Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
3888255a313Smrg	| h8300-* | h8500-* \
3898255a313Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
39001395c31Smrg	| hexagon-* \
3918255a313Smrg	| i*86-* | i860-* | i960-* | ia64-* \
3928255a313Smrg	| ip2k-* | iq2000-* \
39301395c31Smrg	| k1om-* \
39401395c31Smrg	| le32-* | le64-* \
3958255a313Smrg	| lm32-* \
3968255a313Smrg	| m32c-* | m32r-* | m32rle-* \
3978255a313Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
39801395c31Smrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
39901395c31Smrg	| microblaze-* | microblazeel-* \
4008255a313Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
4018255a313Smrg	| mips16-* \
4028255a313Smrg	| mips64-* | mips64el-* \
4038255a313Smrg	| mips64octeon-* | mips64octeonel-* \
4048255a313Smrg	| mips64orion-* | mips64orionel-* \
4058255a313Smrg	| mips64r5900-* | mips64r5900el-* \
4068255a313Smrg	| mips64vr-* | mips64vrel-* \
4078255a313Smrg	| mips64vr4100-* | mips64vr4100el-* \
4088255a313Smrg	| mips64vr4300-* | mips64vr4300el-* \
4098255a313Smrg	| mips64vr5000-* | mips64vr5000el-* \
4108255a313Smrg	| mips64vr5900-* | mips64vr5900el-* \
4118255a313Smrg	| mipsisa32-* | mipsisa32el-* \
4128255a313Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
41301395c31Smrg	| mipsisa32r6-* | mipsisa32r6el-* \
4148255a313Smrg	| mipsisa64-* | mipsisa64el-* \
4158255a313Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
41601395c31Smrg	| mipsisa64r6-* | mipsisa64r6el-* \
4178255a313Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
4188255a313Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
41901395c31Smrg	| mipsr5900-* | mipsr5900el-* \
4208255a313Smrg	| mipstx39-* | mipstx39el-* \
4218255a313Smrg	| mmix-* \
4228255a313Smrg	| mt-* \
4238255a313Smrg	| msp430-* \
424de7ed6e8Smrg	| nds32-* | nds32le-* | nds32be-* \
42501395c31Smrg	| nios-* | nios2-* | nios2eb-* | nios2el-* \
4268255a313Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
42701395c31Smrg	| open8-* \
42801395c31Smrg	| or1k*-* \
4298255a313Smrg	| orion-* \
4308255a313Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
43101395c31Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
43201395c31Smrg	| pru-* \
4338255a313Smrg	| pyramid-* \
43401395c31Smrg	| riscv32-* | riscv64-* \
43501395c31Smrg	| rl78-* | romp-* | rs6000-* | rx-* \
4368255a313Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
4378255a313Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
4388255a313Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
4398255a313Smrg	| sparclite-* \
44001395c31Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
44101395c31Smrg	| tahoe-* \
442de7ed6e8Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
44301395c31Smrg	| tile*-* \
4448255a313Smrg	| tron-* \
445de7ed6e8Smrg	| ubicom32-* \
44601395c31Smrg	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
44701395c31Smrg	| vax-* \
44801395c31Smrg	| visium-* \
4498255a313Smrg	| we32k-* \
45001395c31Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* \
4518255a313Smrg	| xstormy16-* | xtensa*-* \
4528255a313Smrg	| ymp-* \
4538255a313Smrg	| z8k-* | z80-*)
4548255a313Smrg		;;
4558255a313Smrg	# Recognize the basic CPU types without company name, with glob match.
4568255a313Smrg	xtensa*)
4578255a313Smrg		basic_machine=$basic_machine-unknown
4588255a313Smrg		;;
4598255a313Smrg	# Recognize the various machine names and aliases which stand
4608255a313Smrg	# for a CPU type and a company and sometimes even an OS.
4618255a313Smrg	386bsd)
4628255a313Smrg		basic_machine=i386-unknown
4638255a313Smrg		os=-bsd
4648255a313Smrg		;;
4658255a313Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
4668255a313Smrg		basic_machine=m68000-att
4678255a313Smrg		;;
4688255a313Smrg	3b*)
4698255a313Smrg		basic_machine=we32k-att
4708255a313Smrg		;;
4718255a313Smrg	a29khif)
4728255a313Smrg		basic_machine=a29k-amd
4738255a313Smrg		os=-udi
4748255a313Smrg		;;
47501395c31Smrg	abacus)
4768255a313Smrg		basic_machine=abacus-unknown
4778255a313Smrg		;;
4788255a313Smrg	adobe68k)
4798255a313Smrg		basic_machine=m68010-adobe
4808255a313Smrg		os=-scout
4818255a313Smrg		;;
4828255a313Smrg	alliant | fx80)
4838255a313Smrg		basic_machine=fx80-alliant
4848255a313Smrg		;;
4858255a313Smrg	altos | altos3068)
4868255a313Smrg		basic_machine=m68k-altos
4878255a313Smrg		;;
4888255a313Smrg	am29k)
4898255a313Smrg		basic_machine=a29k-none
4908255a313Smrg		os=-bsd
4918255a313Smrg		;;
4928255a313Smrg	amd64)
4938255a313Smrg		basic_machine=x86_64-pc
4948255a313Smrg		;;
4958255a313Smrg	amd64-*)
4968255a313Smrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
4978255a313Smrg		;;
4988255a313Smrg	amdahl)
4998255a313Smrg		basic_machine=580-amdahl
5008255a313Smrg		os=-sysv
5018255a313Smrg		;;
5028255a313Smrg	amiga | amiga-*)
5038255a313Smrg		basic_machine=m68k-unknown
5048255a313Smrg		;;
5058255a313Smrg	amigaos | amigados)
5068255a313Smrg		basic_machine=m68k-unknown
5078255a313Smrg		os=-amigaos
5088255a313Smrg		;;
5098255a313Smrg	amigaunix | amix)
5108255a313Smrg		basic_machine=m68k-unknown
5118255a313Smrg		os=-sysv4
5128255a313Smrg		;;
5138255a313Smrg	apollo68)
5148255a313Smrg		basic_machine=m68k-apollo
5158255a313Smrg		os=-sysv
5168255a313Smrg		;;
5178255a313Smrg	apollo68bsd)
5188255a313Smrg		basic_machine=m68k-apollo
5198255a313Smrg		os=-bsd
5208255a313Smrg		;;
5218255a313Smrg	aros)
5228255a313Smrg		basic_machine=i386-pc
5238255a313Smrg		os=-aros
5248255a313Smrg		;;
52501395c31Smrg	asmjs)
52601395c31Smrg		basic_machine=asmjs-unknown
52701395c31Smrg		;;
5288255a313Smrg	aux)
5298255a313Smrg		basic_machine=m68k-apple
5308255a313Smrg		os=-aux
5318255a313Smrg		;;
5328255a313Smrg	balance)
5338255a313Smrg		basic_machine=ns32k-sequent
5348255a313Smrg		os=-dynix
5358255a313Smrg		;;
5368255a313Smrg	blackfin)
5378255a313Smrg		basic_machine=bfin-unknown
5388255a313Smrg		os=-linux
5398255a313Smrg		;;
5408255a313Smrg	blackfin-*)
5418255a313Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
5428255a313Smrg		os=-linux
5438255a313Smrg		;;
544de7ed6e8Smrg	bluegene*)
545de7ed6e8Smrg		basic_machine=powerpc-ibm
546de7ed6e8Smrg		os=-cnk
547de7ed6e8Smrg		;;
548de7ed6e8Smrg	c54x-*)
549de7ed6e8Smrg		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
550de7ed6e8Smrg		;;
551de7ed6e8Smrg	c55x-*)
552de7ed6e8Smrg		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
553de7ed6e8Smrg		;;
554de7ed6e8Smrg	c6x-*)
555de7ed6e8Smrg		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
556de7ed6e8Smrg		;;
5578255a313Smrg	c90)
5588255a313Smrg		basic_machine=c90-cray
5598255a313Smrg		os=-unicos
5608255a313Smrg		;;
56101395c31Smrg	cegcc)
5628255a313Smrg		basic_machine=arm-unknown
5638255a313Smrg		os=-cegcc
5648255a313Smrg		;;
5658255a313Smrg	convex-c1)
5668255a313Smrg		basic_machine=c1-convex
5678255a313Smrg		os=-bsd
5688255a313Smrg		;;
5698255a313Smrg	convex-c2)
5708255a313Smrg		basic_machine=c2-convex
5718255a313Smrg		os=-bsd
5728255a313Smrg		;;
5738255a313Smrg	convex-c32)
5748255a313Smrg		basic_machine=c32-convex
5758255a313Smrg		os=-bsd
5768255a313Smrg		;;
5778255a313Smrg	convex-c34)
5788255a313Smrg		basic_machine=c34-convex
5798255a313Smrg		os=-bsd
5808255a313Smrg		;;
5818255a313Smrg	convex-c38)
5828255a313Smrg		basic_machine=c38-convex
5838255a313Smrg		os=-bsd
5848255a313Smrg		;;
5858255a313Smrg	cray | j90)
5868255a313Smrg		basic_machine=j90-cray
5878255a313Smrg		os=-unicos
5888255a313Smrg		;;
5898255a313Smrg	craynv)
5908255a313Smrg		basic_machine=craynv-cray
5918255a313Smrg		os=-unicosmp
5928255a313Smrg		;;
59301395c31Smrg	cr16 | cr16-*)
5948255a313Smrg		basic_machine=cr16-unknown
5958255a313Smrg		os=-elf
5968255a313Smrg		;;
5978255a313Smrg	crds | unos)
5988255a313Smrg		basic_machine=m68k-crds
5998255a313Smrg		;;
6008255a313Smrg	crisv32 | crisv32-* | etraxfs*)
6018255a313Smrg		basic_machine=crisv32-axis
6028255a313Smrg		;;
6038255a313Smrg	cris | cris-* | etrax*)
6048255a313Smrg		basic_machine=cris-axis
6058255a313Smrg		;;
6068255a313Smrg	crx)
6078255a313Smrg		basic_machine=crx-unknown
6088255a313Smrg		os=-elf
6098255a313Smrg		;;
6108255a313Smrg	da30 | da30-*)
6118255a313Smrg		basic_machine=m68k-da30
6128255a313Smrg		;;
6138255a313Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
6148255a313Smrg		basic_machine=mips-dec
6158255a313Smrg		;;
6168255a313Smrg	decsystem10* | dec10*)
6178255a313Smrg		basic_machine=pdp10-dec
6188255a313Smrg		os=-tops10
6198255a313Smrg		;;
6208255a313Smrg	decsystem20* | dec20*)
6218255a313Smrg		basic_machine=pdp10-dec
6228255a313Smrg		os=-tops20
6238255a313Smrg		;;
6248255a313Smrg	delta | 3300 | motorola-3300 | motorola-delta \
6258255a313Smrg	      | 3300-motorola | delta-motorola)
6268255a313Smrg		basic_machine=m68k-motorola
6278255a313Smrg		;;
6288255a313Smrg	delta88)
6298255a313Smrg		basic_machine=m88k-motorola
6308255a313Smrg		os=-sysv3
6318255a313Smrg		;;
6328255a313Smrg	dicos)
6338255a313Smrg		basic_machine=i686-pc
6348255a313Smrg		os=-dicos
6358255a313Smrg		;;
6368255a313Smrg	djgpp)
6378255a313Smrg		basic_machine=i586-pc
6388255a313Smrg		os=-msdosdjgpp
6398255a313Smrg		;;
6408255a313Smrg	dpx20 | dpx20-*)
6418255a313Smrg		basic_machine=rs6000-bull
6428255a313Smrg		os=-bosx
6438255a313Smrg		;;
6448255a313Smrg	dpx2* | dpx2*-bull)
6458255a313Smrg		basic_machine=m68k-bull
6468255a313Smrg		os=-sysv3
6478255a313Smrg		;;
64801395c31Smrg	e500v[12])
64901395c31Smrg		basic_machine=powerpc-unknown
65001395c31Smrg		os=$os"spe"
65101395c31Smrg		;;
65201395c31Smrg	e500v[12]-*)
65301395c31Smrg		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
65401395c31Smrg		os=$os"spe"
65501395c31Smrg		;;
6568255a313Smrg	ebmon29k)
6578255a313Smrg		basic_machine=a29k-amd
6588255a313Smrg		os=-ebmon
6598255a313Smrg		;;
6608255a313Smrg	elxsi)
6618255a313Smrg		basic_machine=elxsi-elxsi
6628255a313Smrg		os=-bsd
6638255a313Smrg		;;
6648255a313Smrg	encore | umax | mmax)
6658255a313Smrg		basic_machine=ns32k-encore
6668255a313Smrg		;;
6678255a313Smrg	es1800 | OSE68k | ose68k | ose | OSE)
6688255a313Smrg		basic_machine=m68k-ericsson
6698255a313Smrg		os=-ose
6708255a313Smrg		;;
6718255a313Smrg	fx2800)
6728255a313Smrg		basic_machine=i860-alliant
6738255a313Smrg		;;
6748255a313Smrg	genix)
6758255a313Smrg		basic_machine=ns32k-ns
6768255a313Smrg		;;
6778255a313Smrg	gmicro)
6788255a313Smrg		basic_machine=tron-gmicro
6798255a313Smrg		os=-sysv
6808255a313Smrg		;;
6818255a313Smrg	go32)
6828255a313Smrg		basic_machine=i386-pc
6838255a313Smrg		os=-go32
6848255a313Smrg		;;
6858255a313Smrg	h3050r* | hiux*)
6868255a313Smrg		basic_machine=hppa1.1-hitachi
6878255a313Smrg		os=-hiuxwe2
6888255a313Smrg		;;
6898255a313Smrg	h8300hms)
6908255a313Smrg		basic_machine=h8300-hitachi
6918255a313Smrg		os=-hms
6928255a313Smrg		;;
6938255a313Smrg	h8300xray)
6948255a313Smrg		basic_machine=h8300-hitachi
6958255a313Smrg		os=-xray
6968255a313Smrg		;;
6978255a313Smrg	h8500hms)
6988255a313Smrg		basic_machine=h8500-hitachi
6998255a313Smrg		os=-hms
7008255a313Smrg		;;
7018255a313Smrg	harris)
7028255a313Smrg		basic_machine=m88k-harris
7038255a313Smrg		os=-sysv3
7048255a313Smrg		;;
7058255a313Smrg	hp300-*)
7068255a313Smrg		basic_machine=m68k-hp
7078255a313Smrg		;;
7088255a313Smrg	hp300bsd)
7098255a313Smrg		basic_machine=m68k-hp
7108255a313Smrg		os=-bsd
7118255a313Smrg		;;
7128255a313Smrg	hp300hpux)
7138255a313Smrg		basic_machine=m68k-hp
7148255a313Smrg		os=-hpux
7158255a313Smrg		;;
7168255a313Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
7178255a313Smrg		basic_machine=hppa1.0-hp
7188255a313Smrg		;;
7198255a313Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
7208255a313Smrg		basic_machine=m68000-hp
7218255a313Smrg		;;
7228255a313Smrg	hp9k3[2-9][0-9])
7238255a313Smrg		basic_machine=m68k-hp
7248255a313Smrg		;;
7258255a313Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
7268255a313Smrg		basic_machine=hppa1.0-hp
7278255a313Smrg		;;
7288255a313Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
7298255a313Smrg		basic_machine=hppa1.1-hp
7308255a313Smrg		;;
7318255a313Smrg	hp9k78[0-9] | hp78[0-9])
7328255a313Smrg		# FIXME: really hppa2.0-hp
7338255a313Smrg		basic_machine=hppa1.1-hp
7348255a313Smrg		;;
7358255a313Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
7368255a313Smrg		# FIXME: really hppa2.0-hp
7378255a313Smrg		basic_machine=hppa1.1-hp
7388255a313Smrg		;;
7398255a313Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
7408255a313Smrg		basic_machine=hppa1.1-hp
7418255a313Smrg		;;
7428255a313Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
7438255a313Smrg		basic_machine=hppa1.0-hp
7448255a313Smrg		;;
7458255a313Smrg	hppa-next)
7468255a313Smrg		os=-nextstep3
7478255a313Smrg		;;
7488255a313Smrg	hppaosf)
7498255a313Smrg		basic_machine=hppa1.1-hp
7508255a313Smrg		os=-osf
7518255a313Smrg		;;
7528255a313Smrg	hppro)
7538255a313Smrg		basic_machine=hppa1.1-hp
7548255a313Smrg		os=-proelf
7558255a313Smrg		;;
7568255a313Smrg	i370-ibm* | ibm*)
7578255a313Smrg		basic_machine=i370-ibm
7588255a313Smrg		;;
7598255a313Smrg	i*86v32)
7608255a313Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7618255a313Smrg		os=-sysv32
7628255a313Smrg		;;
7638255a313Smrg	i*86v4*)
7648255a313Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7658255a313Smrg		os=-sysv4
7668255a313Smrg		;;
7678255a313Smrg	i*86v)
7688255a313Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7698255a313Smrg		os=-sysv
7708255a313Smrg		;;
7718255a313Smrg	i*86sol2)
7728255a313Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7738255a313Smrg		os=-solaris2
7748255a313Smrg		;;
7758255a313Smrg	i386mach)
7768255a313Smrg		basic_machine=i386-mach
7778255a313Smrg		os=-mach
7788255a313Smrg		;;
7798255a313Smrg	i386-vsta | vsta)
7808255a313Smrg		basic_machine=i386-unknown
7818255a313Smrg		os=-vsta
7828255a313Smrg		;;
7838255a313Smrg	iris | iris4d)
7848255a313Smrg		basic_machine=mips-sgi
7858255a313Smrg		case $os in
7868255a313Smrg		    -irix*)
7878255a313Smrg			;;
7888255a313Smrg		    *)
7898255a313Smrg			os=-irix4
7908255a313Smrg			;;
7918255a313Smrg		esac
7928255a313Smrg		;;
7938255a313Smrg	isi68 | isi)
7948255a313Smrg		basic_machine=m68k-isi
7958255a313Smrg		os=-sysv
7968255a313Smrg		;;
79701395c31Smrg	leon-*|leon[3-9]-*)
79801395c31Smrg		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
79901395c31Smrg		;;
8008255a313Smrg	m68knommu)
8018255a313Smrg		basic_machine=m68k-unknown
8028255a313Smrg		os=-linux
8038255a313Smrg		;;
8048255a313Smrg	m68knommu-*)
8058255a313Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
8068255a313Smrg		os=-linux
8078255a313Smrg		;;
8088255a313Smrg	m88k-omron*)
8098255a313Smrg		basic_machine=m88k-omron
8108255a313Smrg		;;
8118255a313Smrg	magnum | m3230)
8128255a313Smrg		basic_machine=mips-mips
8138255a313Smrg		os=-sysv
8148255a313Smrg		;;
8158255a313Smrg	merlin)
8168255a313Smrg		basic_machine=ns32k-utek
8178255a313Smrg		os=-sysv
8188255a313Smrg		;;
81901395c31Smrg	microblaze*)
820de7ed6e8Smrg		basic_machine=microblaze-xilinx
821de7ed6e8Smrg		;;
82201395c31Smrg	mingw64)
82301395c31Smrg		basic_machine=x86_64-pc
82401395c31Smrg		os=-mingw64
82501395c31Smrg		;;
8268255a313Smrg	mingw32)
82701395c31Smrg		basic_machine=i686-pc
8288255a313Smrg		os=-mingw32
8298255a313Smrg		;;
8308255a313Smrg	mingw32ce)
8318255a313Smrg		basic_machine=arm-unknown
8328255a313Smrg		os=-mingw32ce
8338255a313Smrg		;;
8348255a313Smrg	miniframe)
8358255a313Smrg		basic_machine=m68000-convergent
8368255a313Smrg		;;
8378255a313Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
8388255a313Smrg		basic_machine=m68k-atari
8398255a313Smrg		os=-mint
8408255a313Smrg		;;
84101395c31Smrg	mipsEE* | ee | ps2)
84201395c31Smrg		basic_machine=mips64r5900el-scei
84301395c31Smrg		case $os in
84401395c31Smrg		    -linux*)
84501395c31Smrg			;;
84601395c31Smrg		    *)
84701395c31Smrg			os=-elf
84801395c31Smrg			;;
84901395c31Smrg		esac
85001395c31Smrg		;;
85101395c31Smrg	iop)
85201395c31Smrg		basic_machine=mipsel-scei
85301395c31Smrg		os=-irx
85401395c31Smrg		;;
85501395c31Smrg	dvp)
85601395c31Smrg		basic_machine=dvp-scei
85701395c31Smrg		os=-elf
85801395c31Smrg		;;
8598255a313Smrg	mips3*-*)
8608255a313Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
8618255a313Smrg		;;
8628255a313Smrg	mips3*)
8638255a313Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
8648255a313Smrg		;;
8658255a313Smrg	monitor)
8668255a313Smrg		basic_machine=m68k-rom68k
8678255a313Smrg		os=-coff
8688255a313Smrg		;;
8698255a313Smrg	morphos)
8708255a313Smrg		basic_machine=powerpc-unknown
8718255a313Smrg		os=-morphos
8728255a313Smrg		;;
87301395c31Smrg	moxiebox)
87401395c31Smrg		basic_machine=moxie-unknown
87501395c31Smrg		os=-moxiebox
87601395c31Smrg		;;
8778255a313Smrg	msdos)
8788255a313Smrg		basic_machine=i386-pc
8798255a313Smrg		os=-msdos
8808255a313Smrg		;;
8818255a313Smrg	ms1-*)
8828255a313Smrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
8838255a313Smrg		;;
88401395c31Smrg	msys)
88501395c31Smrg		basic_machine=i686-pc
88601395c31Smrg		os=-msys
88701395c31Smrg		;;
8888255a313Smrg	mvs)
8898255a313Smrg		basic_machine=i370-ibm
8908255a313Smrg		os=-mvs
8918255a313Smrg		;;
89201395c31Smrg	nacl)
89301395c31Smrg		basic_machine=le32-unknown
89401395c31Smrg		os=-nacl
89501395c31Smrg		;;
8968255a313Smrg	ncr3000)
8978255a313Smrg		basic_machine=i486-ncr
8988255a313Smrg		os=-sysv4
8998255a313Smrg		;;
9008255a313Smrg	netbsd386)
9018255a313Smrg		basic_machine=i386-unknown
9028255a313Smrg		os=-netbsd
9038255a313Smrg		;;
9048255a313Smrg	netwinder)
9058255a313Smrg		basic_machine=armv4l-rebel
9068255a313Smrg		os=-linux
9078255a313Smrg		;;
9088255a313Smrg	news | news700 | news800 | news900)
9098255a313Smrg		basic_machine=m68k-sony
9108255a313Smrg		os=-newsos
9118255a313Smrg		;;
9128255a313Smrg	news1000)
9138255a313Smrg		basic_machine=m68030-sony
9148255a313Smrg		os=-newsos
9158255a313Smrg		;;
9168255a313Smrg	news-3600 | risc-news)
9178255a313Smrg		basic_machine=mips-sony
9188255a313Smrg		os=-newsos
9198255a313Smrg		;;
9208255a313Smrg	necv70)
9218255a313Smrg		basic_machine=v70-nec
9228255a313Smrg		os=-sysv
9238255a313Smrg		;;
9248255a313Smrg	next | m*-next )
9258255a313Smrg		basic_machine=m68k-next
9268255a313Smrg		case $os in
9278255a313Smrg		    -nextstep* )
9288255a313Smrg			;;
9298255a313Smrg		    -ns2*)
9308255a313Smrg		      os=-nextstep2
9318255a313Smrg			;;
9328255a313Smrg		    *)
9338255a313Smrg		      os=-nextstep3
9348255a313Smrg			;;
9358255a313Smrg		esac
9368255a313Smrg		;;
9378255a313Smrg	nh3000)
9388255a313Smrg		basic_machine=m68k-harris
9398255a313Smrg		os=-cxux
9408255a313Smrg		;;
9418255a313Smrg	nh[45]000)
9428255a313Smrg		basic_machine=m88k-harris
9438255a313Smrg		os=-cxux
9448255a313Smrg		;;
9458255a313Smrg	nindy960)
9468255a313Smrg		basic_machine=i960-intel
9478255a313Smrg		os=-nindy
9488255a313Smrg		;;
9498255a313Smrg	mon960)
9508255a313Smrg		basic_machine=i960-intel
9518255a313Smrg		os=-mon960
9528255a313Smrg		;;
9538255a313Smrg	nonstopux)
9548255a313Smrg		basic_machine=mips-compaq
9558255a313Smrg		os=-nonstopux
9568255a313Smrg		;;
9578255a313Smrg	np1)
9588255a313Smrg		basic_machine=np1-gould
9598255a313Smrg		;;
96001395c31Smrg	neo-tandem)
961de7ed6e8Smrg		basic_machine=neo-tandem
962de7ed6e8Smrg		;;
96301395c31Smrg	nse-tandem)
964de7ed6e8Smrg		basic_machine=nse-tandem
965de7ed6e8Smrg		;;
9668255a313Smrg	nsr-tandem)
9678255a313Smrg		basic_machine=nsr-tandem
9688255a313Smrg		;;
9698255a313Smrg	op50n-* | op60c-*)
9708255a313Smrg		basic_machine=hppa1.1-oki
9718255a313Smrg		os=-proelf
9728255a313Smrg		;;
9738255a313Smrg	openrisc | openrisc-*)
9748255a313Smrg		basic_machine=or32-unknown
9758255a313Smrg		;;
9768255a313Smrg	os400)
9778255a313Smrg		basic_machine=powerpc-ibm
9788255a313Smrg		os=-os400
9798255a313Smrg		;;
9808255a313Smrg	OSE68000 | ose68000)
9818255a313Smrg		basic_machine=m68000-ericsson
9828255a313Smrg		os=-ose
9838255a313Smrg		;;
9848255a313Smrg	os68k)
9858255a313Smrg		basic_machine=m68k-none
9868255a313Smrg		os=-os68k
9878255a313Smrg		;;
9888255a313Smrg	pa-hitachi)
9898255a313Smrg		basic_machine=hppa1.1-hitachi
9908255a313Smrg		os=-hiuxwe2
9918255a313Smrg		;;
9928255a313Smrg	paragon)
9938255a313Smrg		basic_machine=i860-intel
9948255a313Smrg		os=-osf
9958255a313Smrg		;;
9968255a313Smrg	parisc)
9978255a313Smrg		basic_machine=hppa-unknown
9988255a313Smrg		os=-linux
9998255a313Smrg		;;
10008255a313Smrg	parisc-*)
10018255a313Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
10028255a313Smrg		os=-linux
10038255a313Smrg		;;
10048255a313Smrg	pbd)
10058255a313Smrg		basic_machine=sparc-tti
10068255a313Smrg		;;
10078255a313Smrg	pbb)
10088255a313Smrg		basic_machine=m68k-tti
10098255a313Smrg		;;
10108255a313Smrg	pc532 | pc532-*)
10118255a313Smrg		basic_machine=ns32k-pc532
10128255a313Smrg		;;
10138255a313Smrg	pc98)
10148255a313Smrg		basic_machine=i386-pc
10158255a313Smrg		;;
10168255a313Smrg	pc98-*)
10178255a313Smrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
10188255a313Smrg		;;
10198255a313Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
10208255a313Smrg		basic_machine=i586-pc
10218255a313Smrg		;;
10228255a313Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
10238255a313Smrg		basic_machine=i686-pc
10248255a313Smrg		;;
10258255a313Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
10268255a313Smrg		basic_machine=i686-pc
10278255a313Smrg		;;
10288255a313Smrg	pentium4)
10298255a313Smrg		basic_machine=i786-pc
10308255a313Smrg		;;
10318255a313Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
10328255a313Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
10338255a313Smrg		;;
10348255a313Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
10358255a313Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
10368255a313Smrg		;;
10378255a313Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
10388255a313Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
10398255a313Smrg		;;
10408255a313Smrg	pentium4-*)
10418255a313Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
10428255a313Smrg		;;
10438255a313Smrg	pn)
10448255a313Smrg		basic_machine=pn-gould
10458255a313Smrg		;;
10468255a313Smrg	power)	basic_machine=power-ibm
10478255a313Smrg		;;
104801395c31Smrg	ppc | ppcbe)	basic_machine=powerpc-unknown
10498255a313Smrg		;;
105001395c31Smrg	ppc-* | ppcbe-*)
105101395c31Smrg		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
10528255a313Smrg		;;
105301395c31Smrg	ppcle | powerpclittle)
10548255a313Smrg		basic_machine=powerpcle-unknown
10558255a313Smrg		;;
10568255a313Smrg	ppcle-* | powerpclittle-*)
10578255a313Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
10588255a313Smrg		;;
10598255a313Smrg	ppc64)	basic_machine=powerpc64-unknown
10608255a313Smrg		;;
10618255a313Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
10628255a313Smrg		;;
106301395c31Smrg	ppc64le | powerpc64little)
10648255a313Smrg		basic_machine=powerpc64le-unknown
10658255a313Smrg		;;
10668255a313Smrg	ppc64le-* | powerpc64little-*)
10678255a313Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
10688255a313Smrg		;;
10698255a313Smrg	ps2)
10708255a313Smrg		basic_machine=i386-ibm
10718255a313Smrg		;;
10728255a313Smrg	pw32)
10738255a313Smrg		basic_machine=i586-unknown
10748255a313Smrg		os=-pw32
10758255a313Smrg		;;
107601395c31Smrg	rdos | rdos64)
107701395c31Smrg		basic_machine=x86_64-pc
107801395c31Smrg		os=-rdos
107901395c31Smrg		;;
108001395c31Smrg	rdos32)
10818255a313Smrg		basic_machine=i386-pc
10828255a313Smrg		os=-rdos
10838255a313Smrg		;;
10848255a313Smrg	rom68k)
10858255a313Smrg		basic_machine=m68k-rom68k
10868255a313Smrg		os=-coff
10878255a313Smrg		;;
10888255a313Smrg	rm[46]00)
10898255a313Smrg		basic_machine=mips-siemens
10908255a313Smrg		;;
10918255a313Smrg	rtpc | rtpc-*)
10928255a313Smrg		basic_machine=romp-ibm
10938255a313Smrg		;;
10948255a313Smrg	s390 | s390-*)
10958255a313Smrg		basic_machine=s390-ibm
10968255a313Smrg		;;
10978255a313Smrg	s390x | s390x-*)
10988255a313Smrg		basic_machine=s390x-ibm
10998255a313Smrg		;;
11008255a313Smrg	sa29200)
11018255a313Smrg		basic_machine=a29k-amd
11028255a313Smrg		os=-udi
11038255a313Smrg		;;
11048255a313Smrg	sb1)
11058255a313Smrg		basic_machine=mipsisa64sb1-unknown
11068255a313Smrg		;;
11078255a313Smrg	sb1el)
11088255a313Smrg		basic_machine=mipsisa64sb1el-unknown
11098255a313Smrg		;;
11108255a313Smrg	sde)
11118255a313Smrg		basic_machine=mipsisa32-sde
11128255a313Smrg		os=-elf
11138255a313Smrg		;;
11148255a313Smrg	sei)
11158255a313Smrg		basic_machine=mips-sei
11168255a313Smrg		os=-seiux
11178255a313Smrg		;;
11188255a313Smrg	sequent)
11198255a313Smrg		basic_machine=i386-sequent
11208255a313Smrg		;;
11218255a313Smrg	sh)
11228255a313Smrg		basic_machine=sh-hitachi
11238255a313Smrg		os=-hms
11248255a313Smrg		;;
11258255a313Smrg	sh5el)
11268255a313Smrg		basic_machine=sh5le-unknown
11278255a313Smrg		;;
11288255a313Smrg	sh64)
11298255a313Smrg		basic_machine=sh64-unknown
11308255a313Smrg		;;
11318255a313Smrg	sparclite-wrs | simso-wrs)
11328255a313Smrg		basic_machine=sparclite-wrs
11338255a313Smrg		os=-vxworks
11348255a313Smrg		;;
11358255a313Smrg	sps7)
11368255a313Smrg		basic_machine=m68k-bull
11378255a313Smrg		os=-sysv2
11388255a313Smrg		;;
11398255a313Smrg	spur)
11408255a313Smrg		basic_machine=spur-unknown
11418255a313Smrg		;;
11428255a313Smrg	st2000)
11438255a313Smrg		basic_machine=m68k-tandem
11448255a313Smrg		;;
11458255a313Smrg	stratus)
11468255a313Smrg		basic_machine=i860-stratus
11478255a313Smrg		os=-sysv4
11488255a313Smrg		;;
114901395c31Smrg	strongarm-* | thumb-*)
115001395c31Smrg		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
115101395c31Smrg		;;
11528255a313Smrg	sun2)
11538255a313Smrg		basic_machine=m68000-sun
11548255a313Smrg		;;
11558255a313Smrg	sun2os3)
11568255a313Smrg		basic_machine=m68000-sun
11578255a313Smrg		os=-sunos3
11588255a313Smrg		;;
11598255a313Smrg	sun2os4)
11608255a313Smrg		basic_machine=m68000-sun
11618255a313Smrg		os=-sunos4
11628255a313Smrg		;;
11638255a313Smrg	sun3os3)
11648255a313Smrg		basic_machine=m68k-sun
11658255a313Smrg		os=-sunos3
11668255a313Smrg		;;
11678255a313Smrg	sun3os4)
11688255a313Smrg		basic_machine=m68k-sun
11698255a313Smrg		os=-sunos4
11708255a313Smrg		;;
11718255a313Smrg	sun4os3)
11728255a313Smrg		basic_machine=sparc-sun
11738255a313Smrg		os=-sunos3
11748255a313Smrg		;;
11758255a313Smrg	sun4os4)
11768255a313Smrg		basic_machine=sparc-sun
11778255a313Smrg		os=-sunos4
11788255a313Smrg		;;
11798255a313Smrg	sun4sol2)
11808255a313Smrg		basic_machine=sparc-sun
11818255a313Smrg		os=-solaris2
11828255a313Smrg		;;
11838255a313Smrg	sun3 | sun3-*)
11848255a313Smrg		basic_machine=m68k-sun
11858255a313Smrg		;;
11868255a313Smrg	sun4)
11878255a313Smrg		basic_machine=sparc-sun
11888255a313Smrg		;;
11898255a313Smrg	sun386 | sun386i | roadrunner)
11908255a313Smrg		basic_machine=i386-sun
11918255a313Smrg		;;
11928255a313Smrg	sv1)
11938255a313Smrg		basic_machine=sv1-cray
11948255a313Smrg		os=-unicos
11958255a313Smrg		;;
11968255a313Smrg	symmetry)
11978255a313Smrg		basic_machine=i386-sequent
11988255a313Smrg		os=-dynix
11998255a313Smrg		;;
12008255a313Smrg	t3e)
12018255a313Smrg		basic_machine=alphaev5-cray
12028255a313Smrg		os=-unicos
12038255a313Smrg		;;
12048255a313Smrg	t90)
12058255a313Smrg		basic_machine=t90-cray
12068255a313Smrg		os=-unicos
12078255a313Smrg		;;
12088255a313Smrg	tile*)
120901395c31Smrg		basic_machine=$basic_machine-unknown
12108255a313Smrg		os=-linux-gnu
12118255a313Smrg		;;
12128255a313Smrg	tx39)
12138255a313Smrg		basic_machine=mipstx39-unknown
12148255a313Smrg		;;
12158255a313Smrg	tx39el)
12168255a313Smrg		basic_machine=mipstx39el-unknown
12178255a313Smrg		;;
12188255a313Smrg	toad1)
12198255a313Smrg		basic_machine=pdp10-xkl
12208255a313Smrg		os=-tops20
12218255a313Smrg		;;
12228255a313Smrg	tower | tower-32)
12238255a313Smrg		basic_machine=m68k-ncr
12248255a313Smrg		;;
12258255a313Smrg	tpf)
12268255a313Smrg		basic_machine=s390x-ibm
12278255a313Smrg		os=-tpf
12288255a313Smrg		;;
12298255a313Smrg	udi29k)
12308255a313Smrg		basic_machine=a29k-amd
12318255a313Smrg		os=-udi
12328255a313Smrg		;;
12338255a313Smrg	ultra3)
12348255a313Smrg		basic_machine=a29k-nyu
12358255a313Smrg		os=-sym1
12368255a313Smrg		;;
12378255a313Smrg	v810 | necv810)
12388255a313Smrg		basic_machine=v810-nec
12398255a313Smrg		os=-none
12408255a313Smrg		;;
12418255a313Smrg	vaxv)
12428255a313Smrg		basic_machine=vax-dec
12438255a313Smrg		os=-sysv
12448255a313Smrg		;;
12458255a313Smrg	vms)
12468255a313Smrg		basic_machine=vax-dec
12478255a313Smrg		os=-vms
12488255a313Smrg		;;
12498255a313Smrg	vpp*|vx|vx-*)
12508255a313Smrg		basic_machine=f301-fujitsu
12518255a313Smrg		;;
12528255a313Smrg	vxworks960)
12538255a313Smrg		basic_machine=i960-wrs
12548255a313Smrg		os=-vxworks
12558255a313Smrg		;;
12568255a313Smrg	vxworks68)
12578255a313Smrg		basic_machine=m68k-wrs
12588255a313Smrg		os=-vxworks
12598255a313Smrg		;;
12608255a313Smrg	vxworks29k)
12618255a313Smrg		basic_machine=a29k-wrs
12628255a313Smrg		os=-vxworks
12638255a313Smrg		;;
12648255a313Smrg	w65*)
12658255a313Smrg		basic_machine=w65-wdc
12668255a313Smrg		os=-none
12678255a313Smrg		;;
12688255a313Smrg	w89k-*)
12698255a313Smrg		basic_machine=hppa1.1-winbond
12708255a313Smrg		os=-proelf
12718255a313Smrg		;;
12728255a313Smrg	xbox)
12738255a313Smrg		basic_machine=i686-pc
12748255a313Smrg		os=-mingw32
12758255a313Smrg		;;
12768255a313Smrg	xps | xps100)
12778255a313Smrg		basic_machine=xps100-honeywell
12788255a313Smrg		;;
127901395c31Smrg	xscale-* | xscalee[bl]-*)
128001395c31Smrg		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
128101395c31Smrg		;;
12828255a313Smrg	ymp)
12838255a313Smrg		basic_machine=ymp-cray
12848255a313Smrg		os=-unicos
12858255a313Smrg		;;
12868255a313Smrg	z8k-*-coff)
12878255a313Smrg		basic_machine=z8k-unknown
12888255a313Smrg		os=-sim
12898255a313Smrg		;;
12908255a313Smrg	z80-*-coff)
12918255a313Smrg		basic_machine=z80-unknown
12928255a313Smrg		os=-sim
12938255a313Smrg		;;
12948255a313Smrg	none)
12958255a313Smrg		basic_machine=none-none
12968255a313Smrg		os=-none
12978255a313Smrg		;;
12988255a313Smrg
12998255a313Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
13008255a313Smrg# some cases the only manufacturer, in others, it is the most popular.
13018255a313Smrg	w89k)
13028255a313Smrg		basic_machine=hppa1.1-winbond
13038255a313Smrg		;;
13048255a313Smrg	op50n)
13058255a313Smrg		basic_machine=hppa1.1-oki
13068255a313Smrg		;;
13078255a313Smrg	op60c)
13088255a313Smrg		basic_machine=hppa1.1-oki
13098255a313Smrg		;;
13108255a313Smrg	romp)
13118255a313Smrg		basic_machine=romp-ibm
13128255a313Smrg		;;
13138255a313Smrg	mmix)
13148255a313Smrg		basic_machine=mmix-knuth
13158255a313Smrg		;;
13168255a313Smrg	rs6000)
13178255a313Smrg		basic_machine=rs6000-ibm
13188255a313Smrg		;;
13198255a313Smrg	vax)
13208255a313Smrg		basic_machine=vax-dec
13218255a313Smrg		;;
13228255a313Smrg	pdp10)
13238255a313Smrg		# there are many clones, so DEC is not a safe bet
13248255a313Smrg		basic_machine=pdp10-unknown
13258255a313Smrg		;;
13268255a313Smrg	pdp11)
13278255a313Smrg		basic_machine=pdp11-dec
13288255a313Smrg		;;
13298255a313Smrg	we32k)
13308255a313Smrg		basic_machine=we32k-att
13318255a313Smrg		;;
13328255a313Smrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
13338255a313Smrg		basic_machine=sh-unknown
13348255a313Smrg		;;
13358255a313Smrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
13368255a313Smrg		basic_machine=sparc-sun
13378255a313Smrg		;;
13388255a313Smrg	cydra)
13398255a313Smrg		basic_machine=cydra-cydrome
13408255a313Smrg		;;
13418255a313Smrg	orion)
13428255a313Smrg		basic_machine=orion-highlevel
13438255a313Smrg		;;
13448255a313Smrg	orion105)
13458255a313Smrg		basic_machine=clipper-highlevel
13468255a313Smrg		;;
13478255a313Smrg	mac | mpw | mac-mpw)
13488255a313Smrg		basic_machine=m68k-apple
13498255a313Smrg		;;
13508255a313Smrg	pmac | pmac-mpw)
13518255a313Smrg		basic_machine=powerpc-apple
13528255a313Smrg		;;
13538255a313Smrg	*-unknown)
13548255a313Smrg		# Make sure to match an already-canonicalized machine name.
13558255a313Smrg		;;
13568255a313Smrg	*)
13578255a313Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
13588255a313Smrg		exit 1
13598255a313Smrg		;;
13608255a313Smrgesac
13618255a313Smrg
13628255a313Smrg# Here we canonicalize certain aliases for manufacturers.
13638255a313Smrgcase $basic_machine in
13648255a313Smrg	*-digital*)
13658255a313Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
13668255a313Smrg		;;
13678255a313Smrg	*-commodore*)
13688255a313Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
13698255a313Smrg		;;
13708255a313Smrg	*)
13718255a313Smrg		;;
13728255a313Smrgesac
13738255a313Smrg
13748255a313Smrg# Decode manufacturer-specific aliases for certain operating systems.
13758255a313Smrg
13768255a313Smrgif [ x"$os" != x"" ]
13778255a313Smrgthen
13788255a313Smrgcase $os in
137901395c31Smrg	# First match some system type aliases
138001395c31Smrg	# that might get confused with valid system types.
13818255a313Smrg	# -solaris* is a basic system type, with this one exception.
138201395c31Smrg	-auroraux)
138301395c31Smrg		os=-auroraux
1384de7ed6e8Smrg		;;
13858255a313Smrg	-solaris1 | -solaris1.*)
13868255a313Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
13878255a313Smrg		;;
13888255a313Smrg	-solaris)
13898255a313Smrg		os=-solaris2
13908255a313Smrg		;;
13918255a313Smrg	-svr4*)
13928255a313Smrg		os=-sysv4
13938255a313Smrg		;;
13948255a313Smrg	-unixware*)
13958255a313Smrg		os=-sysv4.2uw
13968255a313Smrg		;;
13978255a313Smrg	-gnu/linux*)
13988255a313Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
13998255a313Smrg		;;
14008255a313Smrg	# First accept the basic system types.
14018255a313Smrg	# The portable systems comes first.
14028255a313Smrg	# Each alternative MUST END IN A *, to match a version number.
14038255a313Smrg	# -sysv* is not here because it comes later, after sysvr4.
14048255a313Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1405de7ed6e8Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1406de7ed6e8Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
140701395c31Smrg	      | -sym* | -kopensolaris* | -plan9* \
14088255a313Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
140901395c31Smrg	      | -aos* | -aros* | -cloudabi* | -sortix* \
14108255a313Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
14118255a313Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
14128255a313Smrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
141301395c31Smrg	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
14148255a313Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
14158255a313Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
14168255a313Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
14178255a313Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
141801395c31Smrg	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
141901395c31Smrg	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
142001395c31Smrg	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
142101395c31Smrg	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
142201395c31Smrg	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
14238255a313Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
14248255a313Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
142501395c31Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -irx* \
14268255a313Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
14278255a313Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
14288255a313Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
142901395c31Smrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
143001395c31Smrg	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
14318255a313Smrg	# Remember, each alternative MUST END IN *, to match a version number.
14328255a313Smrg		;;
14338255a313Smrg	-qnx*)
14348255a313Smrg		case $basic_machine in
14358255a313Smrg		    x86-* | i*86-*)
14368255a313Smrg			;;
14378255a313Smrg		    *)
14388255a313Smrg			os=-nto$os
14398255a313Smrg			;;
14408255a313Smrg		esac
14418255a313Smrg		;;
14428255a313Smrg	-nto-qnx*)
14438255a313Smrg		;;
14448255a313Smrg	-nto*)
14458255a313Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
14468255a313Smrg		;;
14478255a313Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
14488255a313Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
14498255a313Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
14508255a313Smrg		;;
14518255a313Smrg	-mac*)
14528255a313Smrg		os=`echo $os | sed -e 's|mac|macos|'`
14538255a313Smrg		;;
14548255a313Smrg	-linux-dietlibc)
14558255a313Smrg		os=-linux-dietlibc
14568255a313Smrg		;;
14578255a313Smrg	-linux*)
14588255a313Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
14598255a313Smrg		;;
14608255a313Smrg	-sunos5*)
14618255a313Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
14628255a313Smrg		;;
14638255a313Smrg	-sunos6*)
14648255a313Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
14658255a313Smrg		;;
14668255a313Smrg	-opened*)
14678255a313Smrg		os=-openedition
14688255a313Smrg		;;
146901395c31Smrg	-os400*)
14708255a313Smrg		os=-os400
14718255a313Smrg		;;
14728255a313Smrg	-wince*)
14738255a313Smrg		os=-wince
14748255a313Smrg		;;
14758255a313Smrg	-osfrose*)
14768255a313Smrg		os=-osfrose
14778255a313Smrg		;;
14788255a313Smrg	-osf*)
14798255a313Smrg		os=-osf
14808255a313Smrg		;;
14818255a313Smrg	-utek*)
14828255a313Smrg		os=-bsd
14838255a313Smrg		;;
14848255a313Smrg	-dynix*)
14858255a313Smrg		os=-bsd
14868255a313Smrg		;;
14878255a313Smrg	-acis*)
14888255a313Smrg		os=-aos
14898255a313Smrg		;;
14908255a313Smrg	-atheos*)
14918255a313Smrg		os=-atheos
14928255a313Smrg		;;
14938255a313Smrg	-syllable*)
14948255a313Smrg		os=-syllable
14958255a313Smrg		;;
14968255a313Smrg	-386bsd)
14978255a313Smrg		os=-bsd
14988255a313Smrg		;;
14998255a313Smrg	-ctix* | -uts*)
15008255a313Smrg		os=-sysv
15018255a313Smrg		;;
15028255a313Smrg	-nova*)
15038255a313Smrg		os=-rtmk-nova
15048255a313Smrg		;;
15058255a313Smrg	-ns2 )
15068255a313Smrg		os=-nextstep2
15078255a313Smrg		;;
15088255a313Smrg	-nsk*)
15098255a313Smrg		os=-nsk
15108255a313Smrg		;;
15118255a313Smrg	# Preserve the version number of sinix5.
15128255a313Smrg	-sinix5.*)
15138255a313Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
15148255a313Smrg		;;
15158255a313Smrg	-sinix*)
15168255a313Smrg		os=-sysv4
15178255a313Smrg		;;
151801395c31Smrg	-tpf*)
15198255a313Smrg		os=-tpf
15208255a313Smrg		;;
15218255a313Smrg	-triton*)
15228255a313Smrg		os=-sysv3
15238255a313Smrg		;;
15248255a313Smrg	-oss*)
15258255a313Smrg		os=-sysv3
15268255a313Smrg		;;
15278255a313Smrg	-svr4)
15288255a313Smrg		os=-sysv4
15298255a313Smrg		;;
15308255a313Smrg	-svr3)
15318255a313Smrg		os=-sysv3
15328255a313Smrg		;;
15338255a313Smrg	-sysvr4)
15348255a313Smrg		os=-sysv4
15358255a313Smrg		;;
15368255a313Smrg	# This must come after -sysvr4.
15378255a313Smrg	-sysv*)
15388255a313Smrg		;;
15398255a313Smrg	-ose*)
15408255a313Smrg		os=-ose
15418255a313Smrg		;;
15428255a313Smrg	-es1800*)
15438255a313Smrg		os=-ose
15448255a313Smrg		;;
15458255a313Smrg	-xenix)
15468255a313Smrg		os=-xenix
15478255a313Smrg		;;
15488255a313Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
15498255a313Smrg		os=-mint
15508255a313Smrg		;;
15518255a313Smrg	-aros*)
15528255a313Smrg		os=-aros
15538255a313Smrg		;;
15548255a313Smrg	-zvmoe)
15558255a313Smrg		os=-zvmoe
15568255a313Smrg		;;
15578255a313Smrg	-dicos*)
15588255a313Smrg		os=-dicos
15598255a313Smrg		;;
156001395c31Smrg	-nacl*)
156101395c31Smrg		;;
156201395c31Smrg	-ios)
156301395c31Smrg		;;
15648255a313Smrg	-none)
15658255a313Smrg		;;
15668255a313Smrg	*)
15678255a313Smrg		# Get rid of the `-' at the beginning of $os.
15688255a313Smrg		os=`echo $os | sed 's/[^-]*-//'`
15698255a313Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
15708255a313Smrg		exit 1
15718255a313Smrg		;;
15728255a313Smrgesac
15738255a313Smrgelse
15748255a313Smrg
15758255a313Smrg# Here we handle the default operating systems that come with various machines.
15768255a313Smrg# The value should be what the vendor currently ships out the door with their
15778255a313Smrg# machine or put another way, the most popular os provided with the machine.
15788255a313Smrg
15798255a313Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
15808255a313Smrg# "-sun"), then you have to tell the case statement up towards the top
15818255a313Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
15828255a313Smrg# will signal an error saying that MANUFACTURER isn't an operating
15838255a313Smrg# system, and we'll never get to this point.
15848255a313Smrg
15858255a313Smrgcase $basic_machine in
158601395c31Smrg	score-*)
15878255a313Smrg		os=-elf
15888255a313Smrg		;;
158901395c31Smrg	spu-*)
15908255a313Smrg		os=-elf
15918255a313Smrg		;;
15928255a313Smrg	*-acorn)
15938255a313Smrg		os=-riscix1.2
15948255a313Smrg		;;
15958255a313Smrg	arm*-rebel)
15968255a313Smrg		os=-linux
15978255a313Smrg		;;
15988255a313Smrg	arm*-semi)
15998255a313Smrg		os=-aout
16008255a313Smrg		;;
160101395c31Smrg	c4x-* | tic4x-*)
160201395c31Smrg		os=-coff
160301395c31Smrg		;;
160401395c31Smrg	c8051-*)
160501395c31Smrg		os=-elf
160601395c31Smrg		;;
160701395c31Smrg	hexagon-*)
160801395c31Smrg		os=-elf
16098255a313Smrg		;;
1610de7ed6e8Smrg	tic54x-*)
1611de7ed6e8Smrg		os=-coff
1612de7ed6e8Smrg		;;
1613de7ed6e8Smrg	tic55x-*)
1614de7ed6e8Smrg		os=-coff
1615de7ed6e8Smrg		;;
1616de7ed6e8Smrg	tic6x-*)
1617de7ed6e8Smrg		os=-coff
1618de7ed6e8Smrg		;;
16198255a313Smrg	# This must come before the *-dec entry.
16208255a313Smrg	pdp10-*)
16218255a313Smrg		os=-tops20
16228255a313Smrg		;;
16238255a313Smrg	pdp11-*)
16248255a313Smrg		os=-none
16258255a313Smrg		;;
16268255a313Smrg	*-dec | vax-*)
16278255a313Smrg		os=-ultrix4.2
16288255a313Smrg		;;
16298255a313Smrg	m68*-apollo)
16308255a313Smrg		os=-domain
16318255a313Smrg		;;
16328255a313Smrg	i386-sun)
16338255a313Smrg		os=-sunos4.0.2
16348255a313Smrg		;;
16358255a313Smrg	m68000-sun)
16368255a313Smrg		os=-sunos3
16378255a313Smrg		;;
16388255a313Smrg	m68*-cisco)
16398255a313Smrg		os=-aout
16408255a313Smrg		;;
164101395c31Smrg	mep-*)
16428255a313Smrg		os=-elf
16438255a313Smrg		;;
16448255a313Smrg	mips*-cisco)
16458255a313Smrg		os=-elf
16468255a313Smrg		;;
16478255a313Smrg	mips*-*)
16488255a313Smrg		os=-elf
16498255a313Smrg		;;
16508255a313Smrg	or32-*)
16518255a313Smrg		os=-coff
16528255a313Smrg		;;
16538255a313Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
16548255a313Smrg		os=-sysv3
16558255a313Smrg		;;
16568255a313Smrg	sparc-* | *-sun)
16578255a313Smrg		os=-sunos4.1.1
16588255a313Smrg		;;
165901395c31Smrg	pru-*)
166001395c31Smrg		os=-elf
166101395c31Smrg		;;
16628255a313Smrg	*-be)
16638255a313Smrg		os=-beos
16648255a313Smrg		;;
16658255a313Smrg	*-haiku)
16668255a313Smrg		os=-haiku
16678255a313Smrg		;;
16688255a313Smrg	*-ibm)
16698255a313Smrg		os=-aix
16708255a313Smrg		;;
167101395c31Smrg	*-knuth)
16728255a313Smrg		os=-mmixware
16738255a313Smrg		;;
16748255a313Smrg	*-wec)
16758255a313Smrg		os=-proelf
16768255a313Smrg		;;
16778255a313Smrg	*-winbond)
16788255a313Smrg		os=-proelf
16798255a313Smrg		;;
16808255a313Smrg	*-oki)
16818255a313Smrg		os=-proelf
16828255a313Smrg		;;
16838255a313Smrg	*-hp)
16848255a313Smrg		os=-hpux
16858255a313Smrg		;;
16868255a313Smrg	*-hitachi)
16878255a313Smrg		os=-hiux
16888255a313Smrg		;;
16898255a313Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
16908255a313Smrg		os=-sysv
16918255a313Smrg		;;
16928255a313Smrg	*-cbm)
16938255a313Smrg		os=-amigaos
16948255a313Smrg		;;
16958255a313Smrg	*-dg)
16968255a313Smrg		os=-dgux
16978255a313Smrg		;;
16988255a313Smrg	*-dolphin)
16998255a313Smrg		os=-sysv3
17008255a313Smrg		;;
17018255a313Smrg	m68k-ccur)
17028255a313Smrg		os=-rtu
17038255a313Smrg		;;
17048255a313Smrg	m88k-omron*)
17058255a313Smrg		os=-luna
17068255a313Smrg		;;
17078255a313Smrg	*-next )
17088255a313Smrg		os=-nextstep
17098255a313Smrg		;;
17108255a313Smrg	*-sequent)
17118255a313Smrg		os=-ptx
17128255a313Smrg		;;
17138255a313Smrg	*-crds)
17148255a313Smrg		os=-unos
17158255a313Smrg		;;
17168255a313Smrg	*-ns)
17178255a313Smrg		os=-genix
17188255a313Smrg		;;
17198255a313Smrg	i370-*)
17208255a313Smrg		os=-mvs
17218255a313Smrg		;;
17228255a313Smrg	*-next)
17238255a313Smrg		os=-nextstep3
17248255a313Smrg		;;
17258255a313Smrg	*-gould)
17268255a313Smrg		os=-sysv
17278255a313Smrg		;;
17288255a313Smrg	*-highlevel)
17298255a313Smrg		os=-bsd
17308255a313Smrg		;;
17318255a313Smrg	*-encore)
17328255a313Smrg		os=-bsd
17338255a313Smrg		;;
17348255a313Smrg	*-sgi)
17358255a313Smrg		os=-irix
17368255a313Smrg		;;
17378255a313Smrg	*-siemens)
17388255a313Smrg		os=-sysv4
17398255a313Smrg		;;
17408255a313Smrg	*-masscomp)
17418255a313Smrg		os=-rtu
17428255a313Smrg		;;
17438255a313Smrg	f30[01]-fujitsu | f700-fujitsu)
17448255a313Smrg		os=-uxpv
17458255a313Smrg		;;
17468255a313Smrg	*-rom68k)
17478255a313Smrg		os=-coff
17488255a313Smrg		;;
17498255a313Smrg	*-*bug)
17508255a313Smrg		os=-coff
17518255a313Smrg		;;
17528255a313Smrg	*-apple)
17538255a313Smrg		os=-macos
17548255a313Smrg		;;
17558255a313Smrg	*-atari*)
17568255a313Smrg		os=-mint
17578255a313Smrg		;;
17588255a313Smrg	*)
17598255a313Smrg		os=-none
17608255a313Smrg		;;
17618255a313Smrgesac
17628255a313Smrgfi
17638255a313Smrg
17648255a313Smrg# Here we handle the case where we know the os, and the CPU type, but not the
17658255a313Smrg# manufacturer.  We pick the logical manufacturer.
17668255a313Smrgvendor=unknown
17678255a313Smrgcase $basic_machine in
17688255a313Smrg	*-unknown)
17698255a313Smrg		case $os in
17708255a313Smrg			-riscix*)
17718255a313Smrg				vendor=acorn
17728255a313Smrg				;;
17738255a313Smrg			-sunos*)
17748255a313Smrg				vendor=sun
17758255a313Smrg				;;
1776de7ed6e8Smrg			-cnk*|-aix*)
17778255a313Smrg				vendor=ibm
17788255a313Smrg				;;
17798255a313Smrg			-beos*)
17808255a313Smrg				vendor=be
17818255a313Smrg				;;
17828255a313Smrg			-hpux*)
17838255a313Smrg				vendor=hp
17848255a313Smrg				;;
17858255a313Smrg			-mpeix*)
17868255a313Smrg				vendor=hp
17878255a313Smrg				;;
17888255a313Smrg			-hiux*)
17898255a313Smrg				vendor=hitachi
17908255a313Smrg				;;
17918255a313Smrg			-unos*)
17928255a313Smrg				vendor=crds
17938255a313Smrg				;;
17948255a313Smrg			-dgux*)
17958255a313Smrg				vendor=dg
17968255a313Smrg				;;
17978255a313Smrg			-luna*)
17988255a313Smrg				vendor=omron
17998255a313Smrg				;;
18008255a313Smrg			-genix*)
18018255a313Smrg				vendor=ns
18028255a313Smrg				;;
18038255a313Smrg			-mvs* | -opened*)
18048255a313Smrg				vendor=ibm
18058255a313Smrg				;;
18068255a313Smrg			-os400*)
18078255a313Smrg				vendor=ibm
18088255a313Smrg				;;
18098255a313Smrg			-ptx*)
18108255a313Smrg				vendor=sequent
18118255a313Smrg				;;
18128255a313Smrg			-tpf*)
18138255a313Smrg				vendor=ibm
18148255a313Smrg				;;
18158255a313Smrg			-vxsim* | -vxworks* | -windiss*)
18168255a313Smrg				vendor=wrs
18178255a313Smrg				;;
18188255a313Smrg			-aux*)
18198255a313Smrg				vendor=apple
18208255a313Smrg				;;
18218255a313Smrg			-hms*)
18228255a313Smrg				vendor=hitachi
18238255a313Smrg				;;
18248255a313Smrg			-mpw* | -macos*)
18258255a313Smrg				vendor=apple
18268255a313Smrg				;;
18278255a313Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
18288255a313Smrg				vendor=atari
18298255a313Smrg				;;
18308255a313Smrg			-vos*)
18318255a313Smrg				vendor=stratus
18328255a313Smrg				;;
18338255a313Smrg		esac
18348255a313Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
18358255a313Smrg		;;
18368255a313Smrgesac
18378255a313Smrg
18388255a313Smrgecho $basic_machine$os
18398255a313Smrgexit
18408255a313Smrg
18418255a313Smrg# Local variables:
18428255a313Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
18438255a313Smrg# time-stamp-start: "timestamp='"
18448255a313Smrg# time-stamp-format: "%:y-%02m-%02d"
18458255a313Smrg# time-stamp-end: "'"
18468255a313Smrg# End:
1847