config.sub revision 05cf1079
11.67Smlelstv#! /bin/sh
21.1Srh# Configuration validation subroutine script.
31.1Srh#   Copyright 1992-2018 Free Software Foundation, Inc.
41.18Sfredette
51.18Sfredettetimestamp='2018-02-22'
61.18Sfredette
71.23Skeihan# This file is free software; you can redistribute it and/or modify it
81.1Srh# under the terms of the GNU General Public License as published by
91.1Srh# the Free Software Foundation; either version 3 of the License, or
101.1Srh# (at your option) any later version.
111.1Srh#
121.1Srh# This program is distributed in the hope that it will be useful, but
131.1Srh# WITHOUT ANY WARRANTY; without even the implied warranty of
141.1Srh# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
151.1Srh# General Public License for more details.
161.1Srh#
171.1Srh# You should have received a copy of the GNU General Public License
181.1Srh# along with this program; if not, see <https://www.gnu.org/licenses/>.
191.1Srh#
201.1Srh# As a special exception to the GNU General Public License, if you
211.1Srh# distribute this file as part of a program that contains a
221.1Srh# configuration script generated by Autoconf, you may include it under
231.1Srh# the same distribution terms that you use for the rest of that
241.1Srh# program.  This Exception is an additional permission under section 7
251.1Srh# of the GNU General Public License, version 3 ("GPLv3").
261.1Srh
271.1Srh
281.1Srh# Please send patches to <config-patches@gnu.org>.
291.1Srh#
301.1Srh# Configuration subroutine to validate and canonicalize a configuration type.
311.1Srh# Supply the specified configuration type as an argument.
321.1Srh# If it is invalid, we print an error message on stderr and exit with code 1.
331.1Srh# Otherwise, we print the canonical config type on stdout and succeed.
341.1Srh
351.1Srh# You can get the latest version of this script from:
361.1Srh# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
371.1Srh
381.1Srh# This file is supposed to be the same for all GNU packages
391.1Srh# and recognize all the CPU types, system types and aliases
401.1Srh# that are meaningful with *any* GNU software.
411.18Sfredette# Each package is responsible for reporting which valid configurations
421.1Srh# it does not support.  The user should be able to distinguish
431.1Srh# a failure to support a valid configuration from a meaningless
441.1Srh# configuration.
451.1Srh
461.1Srh# The goal of this file is to map all the various variations of a given
471.1Srh# machine specification into a single specification in the form:
481.1Srh#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
491.1Srh# or in some cases, the newer four-part form:
501.1Srh#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
511.1Srh# It is wrong to echo any other type of specification.
521.1Srh
531.1Srhme=`echo "$0" | sed -e 's,.*/,,'`
541.1Srh
551.1Srhusage="\
561.1SrhUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
571.1Srh
581.1SrhCanonicalize a configuration name.
591.1Srh
601.1SrhOptions:
611.1Srh  -h, --help         print this help, then exit
621.1Srh  -t, --time-stamp   print date of last modification, then exit
631.1Srh  -v, --version      print version number, then exit
641.1Srh
651.1SrhReport bugs and patches to <config-patches@gnu.org>."
661.1Srh
671.12Slukemversion="\
681.12SlukemGNU config.sub ($timestamp)
691.67Smlelstv
701.1SrhCopyright 1992-2018 Free Software Foundation, Inc.
711.1Srh
721.1SrhThis is free software; see the source for copying conditions.  There is NO
731.1Srhwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
741.54Sjmcneill
751.1Srhhelp="
761.43SadTry \`$me --help' for more information."
771.54Sjmcneill
781.1Srh# Parse command line
791.62Sisakiwhile test $# -gt 0 ; do
801.54Sjmcneill  case $1 in
811.1Srh    --time-stamp | --time* | -t )
821.8Sichiro       echo "$timestamp" ; exit ;;
831.1Srh    --version | -v )
841.1Srh       echo "$version" ; exit ;;
851.1Srh    --help | --h* | -h )
861.1Srh       echo "$usage"; exit ;;
871.1Srh    -- )     # Stop option processing
881.1Srh       shift; break ;;
891.1Srh    - )	# Use stdin as input.
901.1Srh       break ;;
911.1Srh    -* )
921.1Srh       echo "$me: invalid option $1$help"
931.1Srh       exit 1 ;;
941.1Srh
951.1Srh    *local*)
961.1Srh       # First pass through any local machine types.
971.1Srh       echo "$1"
981.1Srh       exit ;;
991.1Srh
1001.1Srh    * )
1011.1Srh       break ;;
1021.1Srh  esac
1031.1Srhdone
1041.1Srh
1051.3Srhcase $# in
1061.8Sichiro 0) echo "$me: missing argument$help" >&2
1071.1Srh    exit 1;;
1081.1Srh 1) ;;
1091.1Srh *) echo "$me: too many arguments$help" >&2
1101.1Srh    exit 1;;
1111.1Srhesac
1121.1Srh
1131.1Srh# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1141.1Srh# Here we must recognize all the valid KERNEL-OS combinations.
1151.1Srhmaybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1161.1Srhcase $maybe_os in
1171.1Srh  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
1181.1Srh  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
1191.1Srh  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
1201.32Sperry  kopensolaris*-gnu* | cloudabi*-eabi* | \
1211.1Srh  storm-chaos* | os2-emx* | rtmk-nova*)
1221.30Skent    os=-$maybe_os
1231.1Srh    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1241.30Skent    ;;
1251.30Skent  android-linux)
1261.30Skent    os=-linux-android
1271.30Skent    basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
1281.30Skent    ;;
1291.1Srh  *)
1301.1Srh    basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
1311.1Srh    if [ "$basic_machine" != "$1" ]
1321.1Srh    then os=`echo "$1" | sed 's/.*-/-/'`
1331.30Skent    else os=; fi
1341.30Skent    ;;
1351.1Srhesac
1361.1Srh
1371.1Srh### Let's recognize common machines as not being operating systems so
1381.1Srh### that things like config.sub decstation-3100 work.  We also
1391.1Srh### recognize some manufacturers as not being operating systems, so we
1401.29Skent### can provide default operating systems below.
1411.18Sfredettecase $os in
1421.29Skent	-sun*os*)
1431.1Srh		# Prevent following clause from handling this invalid input.
1441.53Sdyoung		;;
1451.53Sdyoung	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
1461.45Sdyoung	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
1471.48Scegger	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
1481.45Sdyoung	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1491.45Sdyoung	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1501.45Sdyoung	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
1511.45Sdyoung	-apple | -axis | -knuth | -cray | -microblaze*)
1521.45Sdyoung		os=
1531.45Sdyoung		basic_machine=$1
1541.45Sdyoung		;;
1551.7Sichiro	-bluegene*)
1561.45Sdyoung		os=-cnk
1571.49Scegger		;;
1581.45Sdyoung	-sim | -cisco | -oki | -wec | -winbond)
1591.1Srh		os=
1601.28Syamt		basic_machine=$1
1611.62Sisaki		;;
1621.62Sisaki	-scout)
1631.61Sisaki		;;
1641.61Sisaki	-wrs)
1651.61Sisaki		os=-vxworks
1661.61Sisaki		basic_machine=$1
1671.61Sisaki		;;
1681.61Sisaki	-chorusos*)
1691.61Sisaki		os=-chorusos
1701.61Sisaki		basic_machine=$1
1711.61Sisaki		;;
1721.61Sisaki	-chorusrdb)
1731.61Sisaki		os=-chorusrdb
1741.61Sisaki		basic_machine=$1
1751.61Sisaki		;;
1761.61Sisaki	-hiux*)
1771.61Sisaki		os=-hiuxwe2
1781.61Sisaki		;;
1791.1Srh	-sco6)
1801.1Srh		os=-sco5v6
1811.1Srh		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
1821.1Srh		;;
1831.1Srh	-sco5)
1841.1Srh		os=-sco3.2v5
1851.1Srh		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
1861.1Srh		;;
1871.62Sisaki	-sco4)
1881.62Sisaki		os=-sco3.2v4
1891.62Sisaki		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
1901.62Sisaki		;;
1911.62Sisaki	-sco3.2.[4-9]*)
1921.62Sisaki		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
1931.62Sisaki		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
1941.62Sisaki		;;
1951.62Sisaki	-sco3.2v[4-9]*)
1961.62Sisaki		# Don't forget version if it is 3.2v4 or newer.
1971.62Sisaki		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
1981.62Sisaki		;;
1991.62Sisaki	-sco5v6*)
2001.62Sisaki		# Don't forget version if it is 3.2v4 or newer.
2011.62Sisaki		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
2021.62Sisaki		;;
2031.62Sisaki	-sco*)
2041.62Sisaki		os=-sco3.2v2
2051.62Sisaki		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
2061.62Sisaki		;;
2071.29Skent	-udk*)
2081.62Sisaki		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
2091.3Srh		;;
2101.3Srh	-isc)
2111.3Srh		os=-isc2.2
2121.3Srh		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
2131.3Srh		;;
2141.5Srh	-clix*)
2151.5Srh		basic_machine=clipper-intergraph
2161.5Srh		;;
2171.3Srh	-isc*)
2181.3Srh		basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
2191.3Srh		;;
2201.3Srh	-lynx*178)
2211.6Srh		os=-lynxos178
2221.6Srh		;;
2231.10Ssimonb	-lynx*5)
2241.10Ssimonb		os=-lynxos5
2251.3Srh		;;
2261.3Srh	-lynx*)
2271.3Srh		os=-lynxos
2281.3Srh		;;
2291.3Srh	-ptx*)
2301.3Srh		basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
2311.3Srh		;;
2321.50Scegger	-psos*)
2331.3Srh		os=-psos
2341.3Srh		;;
2351.3Srh	-mint | -mint[0-9]*)
2361.3Srh		basic_machine=m68k-atari
2371.3Srh		os=-mint
2381.3Srh		;;
2391.3Srhesac
2401.3Srh
2411.3Srh# Decode aliases for certain CPU-COMPANY combinations.
2421.3Srhcase $basic_machine in
2431.1Srh	# Recognize the basic CPU types without company name.
2441.1Srh	# Some are omitted here because they have special meanings below.
2451.1Srh	1750a | 580 \
2461.1Srh	| a29k \
2471.1Srh	| aarch64 | aarch64_be \
2481.1Srh	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
2491.1Srh	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
2501.1Srh	| am33_2.0 \
2511.1Srh	| arc | arceb \
2521.1Srh	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
2531.1Srh	| avr | avr32 \
2541.1Srh	| ba \
2551.1Srh	| be32 | be64 \
2561.1Srh	| bfin \
2571.1Srh	| c4x | c8051 | clipper \
2581.1Srh	| d10v | d30v | dlx | dsp16xx \
2591.1Srh	| e2k | epiphany \
2601.1Srh	| fido | fr30 | frv | ft32 \
2611.1Srh	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
2621.3Srh	| hexagon \
2631.1Srh	| i370 | i860 | i960 | ia16 | ia64 \
2641.1Srh	| ip2k | iq2000 \
2651.2Slukem	| k1om \
2661.2Slukem	| le32 | le64 \
2671.1Srh	| lm32 \
2681.3Srh	| m32c | m32r | m32rle | m68000 | m68k | m88k \
2691.1Srh	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
2701.49Scegger	| mips | mipsbe | mipseb | mipsel | mipsle \
2711.50Scegger	| mips16 \
2721.1Srh	| mips64 | mips64el \
2731.1Srh	| mips64octeon | mips64octeonel \
2741.1Srh	| mips64orion | mips64orionel \
2751.1Srh	| mips64r5900 | mips64r5900el \
2761.1Srh	| mips64vr | mips64vrel \
2771.1Srh	| mips64vr4100 | mips64vr4100el \
2781.1Srh	| mips64vr4300 | mips64vr4300el \
2791.1Srh	| mips64vr5000 | mips64vr5000el \
2801.1Srh	| mips64vr5900 | mips64vr5900el \
2811.1Srh	| mipsisa32 | mipsisa32el \
2821.1Srh	| mipsisa32r2 | mipsisa32r2el \
2831.1Srh	| mipsisa32r6 | mipsisa32r6el \
2841.1Srh	| mipsisa64 | mipsisa64el \
2851.1Srh	| mipsisa64r2 | mipsisa64r2el \
2861.1Srh	| mipsisa64r6 | mipsisa64r6el \
2871.1Srh	| mipsisa64sb1 | mipsisa64sb1el \
2881.1Srh	| mipsisa64sr71k | mipsisa64sr71kel \
2891.1Srh	| mipsr5900 | mipsr5900el \
2901.1Srh	| mipstx39 | mipstx39el \
2911.1Srh	| mn10200 | mn10300 \
2921.1Srh	| moxie \
2931.1Srh	| mt \
2941.3Srh	| msp430 \
2951.1Srh	| nds32 | nds32le | nds32be \
2961.1Srh	| nios | nios2 | nios2eb | nios2el \
2971.1Srh	| ns16k | ns32k \
2981.1Srh	| open8 | or1k | or1knd | or32 \
2991.1Srh	| pdp10 | pj | pjl \
3001.1Srh	| powerpc | powerpc64 | powerpc64le | powerpcle \
3011.1Srh	| pru \
3021.1Srh	| pyramid \
3031.1Srh	| riscv32 | riscv64 \
3041.30Skent	| rl78 | rx \
3051.1Srh	| score \
3061.30Skent	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
3071.1Srh	| sh64 | sh64le \
3081.1Srh	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
3091.30Skent	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
3101.1Srh	| spu \
3111.1Srh	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
3121.1Srh	| ubicom32 \
3131.1Srh	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
3141.1Srh	| visium \
3151.1Srh	| wasm32 \
3161.1Srh	| x86 | xc16x | xstormy16 | xtensa \
3171.1Srh	| z8k | z80)
3181.1Srh		basic_machine=$basic_machine-unknown
3191.49Scegger		;;
3201.1Srh	c54x)
3211.1Srh		basic_machine=tic54x-unknown
3221.1Srh		;;
3231.1Srh	c55x)
3241.1Srh		basic_machine=tic55x-unknown
3251.1Srh		;;
3261.1Srh	c6x)
3271.1Srh		basic_machine=tic6x-unknown
3281.1Srh		;;
3291.1Srh	leon|leon[3-9])
3301.1Srh		basic_machine=sparc-$basic_machine
3311.1Srh		;;
3321.1Srh	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
3331.1Srh		basic_machine=$basic_machine-unknown
3341.1Srh		os=-none
3351.49Scegger		;;
3361.1Srh	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
3371.1Srh		;;
3381.1Srh	ms1)
3391.1Srh		basic_machine=mt-unknown
3401.1Srh		;;
3411.1Srh
3421.1Srh	strongarm | thumb | xscale)
3431.30Skent		basic_machine=arm-unknown
3441.1Srh		;;
3451.30Skent	xgate)
3461.1Srh		basic_machine=$basic_machine-unknown
3471.1Srh		os=-none
3481.30Skent		;;
3491.1Srh	xscaleeb)
3501.1Srh		basic_machine=armeb-unknown
3511.1Srh		;;
3521.1Srh
3531.1Srh	xscaleel)
3541.1Srh		basic_machine=armel-unknown
3551.1Srh		;;
3561.1Srh
3571.1Srh	# We use `pc' rather than `unknown'
3581.1Srh	# because (1) that's what they normally are, and
3591.49Scegger	# (2) the word "unknown" tends to confuse beginning users.
3601.1Srh	i*86 | x86_64)
3611.1Srh	  basic_machine=$basic_machine-pc
3621.1Srh	  ;;
3631.1Srh	# Object if more than one company name word.
3641.1Srh	*-*-*)
3651.1Srh		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
3661.1Srh		exit 1
3671.1Srh		;;
3681.1Srh	# Recognize the basic CPU types with company name.
3691.1Srh	580-* \
3701.1Srh	| a29k-* \
3711.1Srh	| aarch64-* | aarch64_be-* \
3721.1Srh	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
3731.1Srh	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
3741.1Srh	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
3751.30Skent	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3761.1Srh	| avr-* | avr32-* \
3771.1Srh	| ba-* \
3781.1Srh	| be32-* | be64-* \
3791.1Srh	| bfin-* | bs2000-* \
3801.1Srh	| c[123]* | c30-* | [cjt]90-* | c4x-* \
3811.1Srh	| c8051-* | clipper-* | craynv-* | cydra-* \
3821.1Srh	| d10v-* | d30v-* | dlx-* \
3831.1Srh	| e2k-* | elxsi-* \
3841.1Srh	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
3851.30Skent	| h8300-* | h8500-* \
3861.30Skent	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
3871.1Srh	| hexagon-* \
3881.30Skent	| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
3891.1Srh	| ip2k-* | iq2000-* \
3901.1Srh	| k1om-* \
3911.1Srh	| le32-* | le64-* \
3921.1Srh	| lm32-* \
3931.1Srh	| m32c-* | m32r-* | m32rle-* \
3941.30Skent	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
3951.1Srh	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
3961.30Skent	| microblaze-* | microblazeel-* \
3971.1Srh	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
3981.1Srh	| mips16-* \
3991.1Srh	| mips64-* | mips64el-* \
4001.1Srh	| mips64octeon-* | mips64octeonel-* \
4011.1Srh	| mips64orion-* | mips64orionel-* \
4021.30Skent	| mips64r5900-* | mips64r5900el-* \
4031.1Srh	| mips64vr-* | mips64vrel-* \
4041.1Srh	| mips64vr4100-* | mips64vr4100el-* \
4051.1Srh	| mips64vr4300-* | mips64vr4300el-* \
4061.1Srh	| mips64vr5000-* | mips64vr5000el-* \
4071.1Srh	| mips64vr5900-* | mips64vr5900el-* \
4081.1Srh	| mipsisa32-* | mipsisa32el-* \
4091.1Srh	| mipsisa32r2-* | mipsisa32r2el-* \
4101.1Srh	| mipsisa32r6-* | mipsisa32r6el-* \
4111.1Srh	| mipsisa64-* | mipsisa64el-* \
4121.1Srh	| mipsisa64r2-* | mipsisa64r2el-* \
4131.1Srh	| mipsisa64r6-* | mipsisa64r6el-* \
4141.49Scegger	| mipsisa64sb1-* | mipsisa64sb1el-* \
4151.1Srh	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
4161.1Srh	| mipsr5900-* | mipsr5900el-* \
4171.30Skent	| mipstx39-* | mipstx39el-* \
4181.30Skent	| mmix-* \
4191.1Srh	| mt-* \
4201.30Skent	| msp430-* \
4211.1Srh	| nds32-* | nds32le-* | nds32be-* \
4221.1Srh	| nios-* | nios2-* | nios2eb-* | nios2el-* \
4231.1Srh	| none-* | np1-* | ns16k-* | ns32k-* \
4241.1Srh	| open8-* \
4251.1Srh	| or1k*-* \
4261.1Srh	| orion-* \
4271.1Srh	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
4281.30Skent	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
4291.1Srh	| pru-* \
4301.1Srh	| pyramid-* \
4311.1Srh	| riscv32-* | riscv64-* \
4321.1Srh	| rl78-* | romp-* | rs6000-* | rx-* \
4331.1Srh	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
4341.1Srh	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
4351.1Srh	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
4361.1Srh	| sparclite-* \
4371.1Srh	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
4381.1Srh	| tahoe-* \
4391.1Srh	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
4401.1Srh	| tile*-* \
4411.1Srh	| tron-* \
4421.1Srh	| ubicom32-* \
4431.1Srh	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
4441.49Scegger	| vax-* \
4451.1Srh	| visium-* \
4461.1Srh	| wasm32-* \
4471.1Srh	| we32k-* \
4481.1Srh	| x86-* | x86_64-* | xc16x-* | xps100-* \
4491.1Srh	| xstormy16-* | xtensa*-* \
4501.30Skent	| ymp-* \
4511.30Skent	| z8k-* | z80-*)
4521.1Srh		;;
4531.30Skent	# Recognize the basic CPU types without company name, with glob match.
4541.30Skent	xtensa*)
4551.30Skent		basic_machine=$basic_machine-unknown
4561.1Srh		;;
4571.1Srh	# Recognize the various machine names and aliases which stand
4581.1Srh	# for a CPU type and a company and sometimes even an OS.
4591.1Srh	386bsd)
4601.1Srh		basic_machine=i386-pc
4611.1Srh		os=-bsd
4621.1Srh		;;
4631.1Srh	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
4641.1Srh		basic_machine=m68000-att
4651.1Srh		;;
4661.1Srh	3b*)
4671.1Srh		basic_machine=we32k-att
4681.1Srh		;;
4691.1Srh	a29khif)
4701.1Srh		basic_machine=a29k-amd
4711.1Srh		os=-udi
4721.1Srh		;;
4731.1Srh	abacus)
4741.1Srh		basic_machine=abacus-unknown
4751.1Srh		;;
4761.1Srh	adobe68k)
4771.1Srh		basic_machine=m68010-adobe
4781.30Skent		os=-scout
4791.1Srh		;;
4801.1Srh	alliant | fx80)
4811.1Srh		basic_machine=fx80-alliant
4821.1Srh		;;
4831.1Srh	altos | altos3068)
4841.1Srh		basic_machine=m68k-altos
4851.30Skent		;;
4861.1Srh	am29k)
4871.1Srh		basic_machine=a29k-none
4881.1Srh		os=-bsd
4891.1Srh		;;
4901.1Srh	amd64)
4911.1Srh		basic_machine=x86_64-pc
4921.1Srh		;;
4931.30Skent	amd64-*)
4941.1Srh		basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
4951.30Skent		;;
4961.1Srh	amdahl)
4971.1Srh		basic_machine=580-amdahl
4981.1Srh		os=-sysv
4991.1Srh		;;
5001.1Srh	amiga | amiga-*)
5011.30Skent		basic_machine=m68k-unknown
5021.1Srh		;;
5031.30Skent	amigaos | amigados)
5041.1Srh		basic_machine=m68k-unknown
5051.1Srh		os=-amigaos
5061.1Srh		;;
5071.1Srh	amigaunix | amix)
5081.1Srh		basic_machine=m68k-unknown
5091.1Srh		os=-sysv4
5101.1Srh		;;
5111.1Srh	apollo68)
5121.1Srh		basic_machine=m68k-apollo
5131.1Srh		os=-sysv
5141.30Skent		;;
5151.1Srh	apollo68bsd)
5161.30Skent		basic_machine=m68k-apollo
5171.1Srh		os=-bsd
5181.1Srh		;;
5191.1Srh	aros)
5201.1Srh		basic_machine=i386-pc
5211.1Srh		os=-aros
5221.27Skent		;;
5231.41Schristos	asmjs)
5241.1Srh		basic_machine=asmjs-unknown
5251.30Skent		;;
5261.27Skent	aux)
5271.1Srh		basic_machine=m68k-apple
5281.1Srh		os=-aux
5291.1Srh		;;
5301.3Srh	balance)
5311.3Srh		basic_machine=ns32k-sequent
5321.3Srh		os=-dynix
5331.30Skent		;;
5341.3Srh	blackfin)
5351.30Skent		basic_machine=bfin-unknown
5361.3Srh		os=-linux
5371.3Srh		;;
5381.3Srh	blackfin-*)
5391.3Srh		basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
5401.1Srh		os=-linux
5411.1Srh		;;
5421.1Srh	bluegene*)
5431.30Skent		basic_machine=powerpc-ibm
5441.1Srh		os=-cnk
5451.1Srh		;;
5461.1Srh	c54x-*)
5471.1Srh		basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
5481.1Srh		;;
5491.1Srh	c55x-*)
5501.1Srh		basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
5511.1Srh		;;
5521.1Srh	c6x-*)
5531.1Srh		basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
5541.1Srh		;;
5551.1Srh	c90)
5561.1Srh		basic_machine=c90-cray
5571.1Srh		os=-unicos
5581.1Srh		;;
5591.1Srh	cegcc)
5601.1Srh		basic_machine=arm-unknown
5611.1Srh		os=-cegcc
5621.1Srh		;;
5631.1Srh	convex-c1)
5641.1Srh		basic_machine=c1-convex
5651.1Srh		os=-bsd
5661.1Srh		;;
5671.49Scegger	convex-c2)
5681.1Srh		basic_machine=c2-convex
5691.1Srh		os=-bsd
5701.1Srh		;;
5711.1Srh	convex-c32)
5721.1Srh		basic_machine=c32-convex
5731.1Srh		os=-bsd
5741.1Srh		;;
5751.1Srh	convex-c34)
5761.1Srh		basic_machine=c34-convex
5771.1Srh		os=-bsd
5781.1Srh		;;
5791.1Srh	convex-c38)
5801.1Srh		basic_machine=c38-convex
5811.1Srh		os=-bsd
5821.1Srh		;;
5831.1Srh	cray | j90)
5841.1Srh		basic_machine=j90-cray
5851.1Srh		os=-unicos
5861.1Srh		;;
5871.1Srh	craynv)
5881.1Srh		basic_machine=craynv-cray
5891.1Srh		os=-unicosmp
5901.1Srh		;;
5911.1Srh	cr16 | cr16-*)
5921.1Srh		basic_machine=cr16-unknown
5931.30Skent		os=-elf
5941.1Srh		;;
5951.1Srh	crds | unos)
5961.1Srh		basic_machine=m68k-crds
5971.1Srh		;;
5981.1Srh	crisv32 | crisv32-* | etraxfs*)
5991.1Srh		basic_machine=crisv32-axis
6001.1Srh		;;
6011.1Srh	cris | cris-* | etrax*)
6021.1Srh		basic_machine=cris-axis
6031.1Srh		;;
6041.1Srh	crx)
6051.1Srh		basic_machine=crx-unknown
6061.1Srh		os=-elf
6071.1Srh		;;
6081.1Srh	da30 | da30-*)
6091.1Srh		basic_machine=m68k-da30
6101.1Srh		;;
6111.1Srh	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
6121.1Srh		basic_machine=mips-dec
6131.1Srh		;;
6141.1Srh	decsystem10* | dec10*)
6151.1Srh		basic_machine=pdp10-dec
6161.1Srh		os=-tops10
6171.1Srh		;;
6181.18Sfredette	decsystem20* | dec20*)
6191.18Sfredette		basic_machine=pdp10-dec
6201.18Sfredette		os=-tops20
6211.18Sfredette		;;
6221.18Sfredette	delta | 3300 | motorola-3300 | motorola-delta \
6231.18Sfredette	      | 3300-motorola | delta-motorola)
6241.18Sfredette		basic_machine=m68k-motorola
6251.18Sfredette		;;
6261.1Srh	delta88)
6271.1Srh		basic_machine=m88k-motorola
6281.1Srh		os=-sysv3
6291.1Srh		;;
6301.1Srh	dicos)
6311.1Srh		basic_machine=i686-pc
6321.1Srh		os=-dicos
6331.1Srh		;;
6341.1Srh	djgpp)
6351.1Srh		basic_machine=i586-pc
6361.1Srh		os=-msdosdjgpp
6371.1Srh		;;
6381.1Srh	dpx20 | dpx20-*)
6391.1Srh		basic_machine=rs6000-bull
6401.3Srh		os=-bosx
6411.3Srh		;;
6421.3Srh	dpx2*)
6431.3Srh		basic_machine=m68k-bull
6441.3Srh		os=-sysv3
6451.3Srh		;;
6461.3Srh	e500v[12])
6471.3Srh		basic_machine=powerpc-unknown
6481.1Srh		os=$os"spe"
6491.1Srh		;;
6501.1Srh	e500v[12]-*)
6511.1Srh		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
6521.1Srh		os=$os"spe"
6531.1Srh		;;
6541.1Srh	ebmon29k)
6551.1Srh		basic_machine=a29k-amd
6561.41Schristos		os=-ebmon
6571.1Srh		;;
6581.30Skent	elxsi)
6591.1Srh		basic_machine=elxsi-elxsi
6601.1Srh		os=-bsd
6611.30Skent		;;
6621.18Sfredette	encore | umax | mmax)
6631.42Schristos		basic_machine=ns32k-encore
6641.1Srh		;;
6651.49Scegger	es1800 | OSE68k | ose68k | ose | OSE)
6661.1Srh		basic_machine=m68k-ericsson
6671.1Srh		os=-ose
6681.1Srh		;;
6691.18Sfredette	fx2800)
6701.1Srh		basic_machine=i860-alliant
6711.1Srh		;;
6721.49Scegger	genix)
6731.1Srh		basic_machine=ns32k-ns
6741.18Sfredette		;;
6751.18Sfredette	gmicro)
6761.18Sfredette		basic_machine=tron-gmicro
6771.18Sfredette		os=-sysv
6781.41Schristos		;;
6791.18Sfredette	go32)
6801.30Skent		basic_machine=i386-pc
6811.18Sfredette		os=-go32
6821.18Sfredette		;;
6831.30Skent	h3050r* | hiux*)
6841.18Sfredette		basic_machine=hppa1.1-hitachi
6851.42Schristos		os=-hiuxwe2
6861.18Sfredette		;;
6871.49Scegger	h8300hms)
6881.18Sfredette		basic_machine=h8300-hitachi
6891.18Sfredette		os=-hms
6901.18Sfredette		;;
6911.18Sfredette	h8300xray)
6921.18Sfredette		basic_machine=h8300-hitachi
6931.18Sfredette		os=-xray
6941.18Sfredette		;;
6951.18Sfredette	h8500hms)
6961.18Sfredette		basic_machine=h8500-hitachi
6971.18Sfredette		os=-hms
6981.18Sfredette		;;
6991.18Sfredette	harris)
7001.18Sfredette		basic_machine=m88k-harris
7011.49Scegger		os=-sysv3
7021.1Srh		;;
7031.1Srh	hp300-*)
7041.1Srh		basic_machine=m68k-hp
7051.1Srh		;;
7061.1Srh	hp300bsd)
7071.1Srh		basic_machine=m68k-hp
7081.41Schristos		os=-bsd
7091.1Srh		;;
7101.30Skent	hp300hpux)
7111.30Skent		basic_machine=m68k-hp
7121.30Skent		os=-hpux
7131.1Srh		;;
7141.30Skent	hp3k9[0-9][0-9] | hp9[0-9][0-9])
7151.30Skent		basic_machine=hppa1.0-hp
7161.30Skent		;;
7171.30Skent	hp9k2[0-9][0-9] | hp9k31[0-9])
7181.1Srh		basic_machine=m68000-hp
7191.1Srh		;;
7201.1Srh	hp9k3[2-9][0-9])
7211.1Srh		basic_machine=m68k-hp
7221.30Skent		;;
7231.30Skent	hp9k6[0-9][0-9] | hp6[0-9][0-9])
7241.30Skent		basic_machine=hppa1.0-hp
7251.30Skent		;;
7261.30Skent	hp9k7[0-79][0-9] | hp7[0-79][0-9])
7271.30Skent		basic_machine=hppa1.1-hp
7281.1Srh		;;
7291.1Srh	hp9k78[0-9] | hp78[0-9])
7301.1Srh		# FIXME: really hppa2.0-hp
7311.1Srh		basic_machine=hppa1.1-hp
7321.49Scegger		;;
7331.1Srh	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
7341.1Srh		# FIXME: really hppa2.0-hp
7351.1Srh		basic_machine=hppa1.1-hp
7361.1Srh		;;
7371.1Srh	hp9k8[0-9][13679] | hp8[0-9][13679])
7381.1Srh		basic_machine=hppa1.1-hp
7391.18Sfredette		;;
7401.42Schristos	hp9k8[0-9][0-9] | hp8[0-9][0-9])
7411.1Srh		basic_machine=hppa1.0-hp
7421.49Scegger		;;
7431.1Srh	hppaosf)
7441.1Srh		basic_machine=hppa1.1-hp
7451.1Srh		os=-osf
7461.1Srh		;;
7471.1Srh	hppro)
7481.1Srh		basic_machine=hppa1.1-hp
7491.1Srh		os=-proelf
7501.42Schristos		;;
7511.18Sfredette	i370-ibm* | ibm*)
7521.1Srh		basic_machine=i370-ibm
7531.18Sfredette		;;
7541.1Srh	i*86v32)
7551.1Srh		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
7561.26Skleink		os=-sysv32
7571.26Skleink		;;
7581.1Srh	i*86v4*)
7591.1Srh		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
7601.1Srh		os=-sysv4
7611.1Srh		;;
7621.1Srh	i*86v)
7631.1Srh		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
7641.1Srh		os=-sysv
7651.1Srh		;;
7661.1Srh	i*86sol2)
7671.3Srh		basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
7681.3Srh		os=-solaris2
7691.3Srh		;;
7701.3Srh	i386mach)
7711.3Srh		basic_machine=i386-mach
7721.1Srh		os=-mach
7731.1Srh		;;
7741.1Srh	vsta)
7751.1Srh		basic_machine=i386-unknown
7761.1Srh		os=-vsta
7771.1Srh		;;
7781.1Srh	iris | iris4d)
7791.18Sfredette		basic_machine=mips-sgi
7801.1Srh		case $os in
7811.1Srh		    -irix*)
7821.1Srh			;;
7831.1Srh		    *)
7841.1Srh			os=-irix4
7851.1Srh			;;
7861.1Srh		esac
7871.1Srh		;;
7881.1Srh	isi68 | isi)
7891.3Srh		basic_machine=m68k-isi
7901.3Srh		os=-sysv
7911.3Srh		;;
7921.3Srh	leon-*|leon[3-9]-*)
7931.3Srh		basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
7941.3Srh		;;
7951.3Srh	m68knommu)
7961.1Srh		basic_machine=m68k-unknown
7971.1Srh		os=-linux
7981.3Srh		;;
7991.1Srh	m68knommu-*)
8001.3Srh		basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
8011.1Srh		os=-linux
8021.1Srh		;;
8031.1Srh	magnum | m3230)
8041.1Srh		basic_machine=mips-mips
8051.3Srh		os=-sysv
8061.1Srh		;;
8071.1Srh	merlin)
8081.3Srh		basic_machine=ns32k-utek
8091.3Srh		os=-sysv
8101.1Srh		;;
8111.1Srh	microblaze*)
8121.1Srh		basic_machine=microblaze-xilinx
8131.1Srh		;;
8141.1Srh	mingw64)
8151.1Srh		basic_machine=x86_64-pc
8161.1Srh		os=-mingw64
8171.1Srh		;;
8181.1Srh	mingw32)
8191.1Srh		basic_machine=i686-pc
8201.1Srh		os=-mingw32
8211.1Srh		;;
8221.41Schristos	mingw32ce)
8231.1Srh		basic_machine=arm-unknown
8241.18Sfredette		os=-mingw32ce
8251.18Sfredette		;;
8261.30Skent	miniframe)
8271.30Skent		basic_machine=m68000-convergent
8281.30Skent		;;
8291.30Skent	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
8301.30Skent		basic_machine=m68k-atari
8311.30Skent		os=-mint
8321.30Skent		;;
8331.30Skent	mips3*-*)
8341.30Skent		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
8351.18Sfredette		;;
8361.18Sfredette	mips3*)
8371.18Sfredette		basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
8381.18Sfredette		;;
8391.30Skent	monitor)
8401.30Skent		basic_machine=m68k-rom68k
8411.30Skent		os=-coff
8421.30Skent		;;
8431.30Skent	morphos)
8441.18Sfredette		basic_machine=powerpc-unknown
8451.18Sfredette		os=-morphos
8461.18Sfredette		;;
8471.18Sfredette	moxiebox)
8481.49Scegger		basic_machine=moxie-unknown
8491.18Sfredette		os=-moxiebox
8501.18Sfredette		;;
8511.18Sfredette	msdos)
8521.18Sfredette		basic_machine=i386-pc
8531.18Sfredette		os=-msdos
8541.18Sfredette		;;
8551.18Sfredette	ms1-*)
8561.42Schristos		basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
8571.18Sfredette		;;
8581.49Scegger	msys)
8591.18Sfredette		basic_machine=i686-pc
8601.18Sfredette		os=-msys
8611.18Sfredette		;;
8621.42Schristos	mvs)
8631.18Sfredette		basic_machine=i370-ibm
8641.18Sfredette		os=-mvs
8651.42Schristos		;;
8661.18Sfredette	nacl)
8671.18Sfredette		basic_machine=le32-unknown
8681.18Sfredette		os=-nacl
8691.42Schristos		;;
8701.18Sfredette	ncr3000)
8711.18Sfredette		basic_machine=i486-ncr
8721.18Sfredette		os=-sysv4
8731.18Sfredette		;;
8741.18Sfredette	netbsd386)
8751.18Sfredette		basic_machine=i386-unknown
8761.18Sfredette		os=-netbsd
8771.18Sfredette		;;
8781.18Sfredette	netwinder)
8791.18Sfredette		basic_machine=armv4l-rebel
8801.18Sfredette		os=-linux
8811.18Sfredette		;;
8821.18Sfredette	news | news700 | news800 | news900)
8831.18Sfredette		basic_machine=m68k-sony
8841.18Sfredette		os=-newsos
8851.18Sfredette		;;
8861.18Sfredette	news1000)
8871.18Sfredette		basic_machine=m68030-sony
8881.18Sfredette		os=-newsos
8891.18Sfredette		;;
8901.18Sfredette	news-3600 | risc-news)
8911.18Sfredette		basic_machine=mips-sony
8921.18Sfredette		os=-newsos
8931.18Sfredette		;;
8941.18Sfredette	necv70)
8951.18Sfredette		basic_machine=v70-nec
8961.18Sfredette		os=-sysv
8971.18Sfredette		;;
8981.18Sfredette	next | m*-next)
8991.33Slukem		basic_machine=m68k-next
9001.18Sfredette		case $os in
9011.18Sfredette		    -nextstep* )
9021.18Sfredette			;;
9031.18Sfredette		    -ns2*)
9041.18Sfredette		      os=-nextstep2
9051.18Sfredette			;;
9061.18Sfredette		    *)
9071.18Sfredette		      os=-nextstep3
9081.18Sfredette			;;
9091.18Sfredette		esac
9101.18Sfredette		;;
9111.18Sfredette	nh3000)
9121.18Sfredette		basic_machine=m68k-harris
9131.18Sfredette		os=-cxux
9141.18Sfredette		;;
9151.18Sfredette	nh[45]000)
9161.18Sfredette		basic_machine=m88k-harris
9171.18Sfredette		os=-cxux
9181.18Sfredette		;;
9191.18Sfredette	nindy960)
9201.18Sfredette		basic_machine=i960-intel
9211.18Sfredette		os=-nindy
9221.18Sfredette		;;
9231.18Sfredette	mon960)
9241.18Sfredette		basic_machine=i960-intel
9251.18Sfredette		os=-mon960
9261.18Sfredette		;;
9271.18Sfredette	nonstopux)
9281.18Sfredette		basic_machine=mips-compaq
9291.18Sfredette		os=-nonstopux
9301.26Skleink		;;
9311.26Skleink	np1)
9321.18Sfredette		basic_machine=np1-gould
9331.18Sfredette		;;
9341.18Sfredette	neo-tandem)
9351.18Sfredette		basic_machine=neo-tandem
9361.18Sfredette		;;
9371.18Sfredette	nse-tandem)
9381.18Sfredette		basic_machine=nse-tandem
9391.18Sfredette		;;
9401.18Sfredette	nsr-tandem)
9411.18Sfredette		basic_machine=nsr-tandem
9421.18Sfredette		;;
9431.18Sfredette	nsv-tandem)
9441.18Sfredette		basic_machine=nsv-tandem
9451.18Sfredette		;;
9461.18Sfredette	nsx-tandem)
9471.18Sfredette		basic_machine=nsx-tandem
9481.18Sfredette		;;
9491.18Sfredette	op50n-* | op60c-*)
9501.30Skent		basic_machine=hppa1.1-oki
9511.18Sfredette		os=-proelf
9521.18Sfredette		;;
9531.18Sfredette	openrisc | openrisc-*)
9541.18Sfredette		basic_machine=or32-unknown
9551.18Sfredette		;;
9561.18Sfredette	os400)
9571.18Sfredette		basic_machine=powerpc-ibm
9581.18Sfredette		os=-os400
9591.18Sfredette		;;
9601.18Sfredette	OSE68000 | ose68000)
9611.18Sfredette		basic_machine=m68000-ericsson
9621.26Skleink		os=-ose
9631.26Skleink		;;
9641.18Sfredette	os68k)
9651.18Sfredette		basic_machine=m68k-none
9661.18Sfredette		os=-os68k
9671.18Sfredette		;;
9681.18Sfredette	pa-hitachi)
9691.18Sfredette		basic_machine=hppa1.1-hitachi
9701.18Sfredette		os=-hiuxwe2
9711.18Sfredette		;;
9721.18Sfredette	paragon)
9731.18Sfredette		basic_machine=i860-intel
9741.18Sfredette		os=-osf
9751.18Sfredette		;;
9761.18Sfredette	parisc)
9771.18Sfredette		basic_machine=hppa-unknown
9781.18Sfredette		os=-linux
9791.18Sfredette		;;
9801.18Sfredette	parisc-*)
9811.18Sfredette		basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
9821.18Sfredette		os=-linux
9831.18Sfredette		;;
9841.18Sfredette	pbd)
9851.1Srh		basic_machine=sparc-tti
9861.1Srh		;;
9871.1Srh	pbb)
9881.1Srh		basic_machine=m68k-tti
9891.1Srh		;;
9901.1Srh	pc532 | pc532-*)
9911.30Skent		basic_machine=ns32k-pc532
9921.30Skent		;;
9931.1Srh	pc98)
9941.1Srh		basic_machine=i386-pc
9951.30Skent		;;
9961.30Skent	pc98-*)
9971.1Srh		basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
9981.1Srh		;;
9991.1Srh	pentium | p5 | k5 | k6 | nexgen | viac3)
10001.1Srh		basic_machine=i586-pc
10011.1Srh		;;
10021.1Srh	pentiumpro | p6 | 6x86 | athlon | athlon_*)
10031.1Srh		basic_machine=i686-pc
10041.1Srh		;;
10051.1Srh	pentiumii | pentium2 | pentiumiii | pentium3)
10061.1Srh		basic_machine=i686-pc
10071.1Srh		;;
10081.1Srh	pentium4)
10091.1Srh		basic_machine=i786-pc
10101.1Srh		;;
10111.1Srh	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
10121.1Srh		basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10131.30Skent		;;
10141.30Skent	pentiumpro-* | p6-* | 6x86-* | athlon-*)
10151.18Sfredette		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10161.18Sfredette		;;
10171.30Skent	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
10181.30Skent		basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10191.18Sfredette		;;
10201.18Sfredette	pentium4-*)
10211.18Sfredette		basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10221.18Sfredette		;;
10231.18Sfredette	pn)
10241.18Sfredette		basic_machine=pn-gould
10251.18Sfredette		;;
10261.18Sfredette	power)	basic_machine=power-ibm
10271.18Sfredette		;;
10281.18Sfredette	ppc | ppcbe)	basic_machine=powerpc-unknown
10291.18Sfredette		;;
10301.18Sfredette	ppc-* | ppcbe-*)
10311.18Sfredette		basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10321.18Sfredette		;;
10331.1Srh	ppcle | powerpclittle)
10341.1Srh		basic_machine=powerpcle-unknown
10351.1Srh		;;
10361.1Srh	ppcle-* | powerpclittle-*)
10371.1Srh		basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10381.1Srh		;;
10391.1Srh	ppc64)	basic_machine=powerpc64-unknown
10401.1Srh		;;
10411.1Srh	ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10421.1Srh		;;
10431.1Srh	ppc64le | powerpc64little)
10441.1Srh		basic_machine=powerpc64le-unknown
10451.1Srh		;;
10461.1Srh	ppc64le-* | powerpc64little-*)
10471.1Srh		basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
10481.1Srh		;;
10491.1Srh	ps2)
10501.1Srh		basic_machine=i386-ibm
10511.1Srh		;;
10521.1Srh	pw32)
10531.30Skent		basic_machine=i586-unknown
10541.1Srh		os=-pw32
10551.30Skent		;;
10561.1Srh	rdos | rdos64)
10571.1Srh		basic_machine=x86_64-pc
10581.1Srh		os=-rdos
10591.1Srh		;;
10601.1Srh	rdos32)
10611.18Sfredette		basic_machine=i386-pc
10621.1Srh		os=-rdos
10631.1Srh		;;
10641.1Srh	rom68k)
10651.18Sfredette		basic_machine=m68k-rom68k
10661.18Sfredette		os=-coff
10671.1Srh		;;
10681.30Skent	rm[46]00)
10691.1Srh		basic_machine=mips-siemens
10701.1Srh		;;
10711.1Srh	rtpc | rtpc-*)
10721.1Srh		basic_machine=romp-ibm
10731.1Srh		;;
10741.1Srh	s390 | s390-*)
10751.29Skent		basic_machine=s390-ibm
10761.1Srh		;;
10771.30Skent	s390x | s390x-*)
10781.30Skent		basic_machine=s390x-ibm
10791.1Srh		;;
10801.30Skent	sa29200)
10811.30Skent		basic_machine=a29k-amd
10821.1Srh		os=-udi
10831.1Srh		;;
10841.1Srh	sb1)
10851.1Srh		basic_machine=mipsisa64sb1-unknown
10861.29Skent		;;
10871.1Srh	sb1el)
10881.25Ssimonb		basic_machine=mipsisa64sb1el-unknown
10891.25Ssimonb		;;
10901.25Ssimonb	sde)
10911.25Ssimonb		basic_machine=mipsisa32-sde
10921.1Srh		os=-elf
10931.25Ssimonb		;;
10941.25Ssimonb	sei)
10951.1Srh		basic_machine=mips-sei
10961.1Srh		os=-seiux
10971.1Srh		;;
10981.1Srh	sequent)
10991.1Srh		basic_machine=i386-sequent
11001.1Srh		;;
11011.29Skent	sh5el)
11021.29Skent		basic_machine=sh5le-unknown
11031.1Srh		;;
11041.1Srh	simso-wrs)
11051.18Sfredette		basic_machine=sparclite-wrs
11061.18Sfredette		os=-vxworks
11071.30Skent		;;
11081.18Sfredette	sps7)
11091.18Sfredette		basic_machine=m68k-bull
11101.18Sfredette		os=-sysv2
11111.18Sfredette		;;
11121.18Sfredette	spur)
11131.18Sfredette		basic_machine=spur-unknown
11141.30Skent		;;
11151.30Skent	st2000)
11161.30Skent		basic_machine=m68k-tandem
11171.18Sfredette		;;
11181.18Sfredette	stratus)
11191.18Sfredette		basic_machine=i860-stratus
11201.18Sfredette		os=-sysv4
11211.18Sfredette		;;
11221.18Sfredette	strongarm-* | thumb-*)
11231.18Sfredette		basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
11241.18Sfredette		;;
11251.18Sfredette	sun2)
11261.18Sfredette		basic_machine=m68000-sun
11271.42Schristos		;;
11281.18Sfredette	sun2os3)
11291.18Sfredette		basic_machine=m68000-sun
11301.18Sfredette		os=-sunos3
11311.42Schristos		;;
11321.18Sfredette	sun2os4)
11331.18Sfredette		basic_machine=m68000-sun
11341.18Sfredette		os=-sunos4
11351.42Schristos		;;
11361.18Sfredette	sun3os3)
11371.18Sfredette		basic_machine=m68k-sun
11381.18Sfredette		os=-sunos3
11391.18Sfredette		;;
11401.18Sfredette	sun3os4)
11411.18Sfredette		basic_machine=m68k-sun
11421.18Sfredette		os=-sunos4
11431.18Sfredette		;;
11441.18Sfredette	sun4os3)
11451.18Sfredette		basic_machine=sparc-sun
11461.18Sfredette		os=-sunos3
11471.18Sfredette		;;
11481.30Skent	sun4os4)
11491.18Sfredette		basic_machine=sparc-sun
11501.18Sfredette		os=-sunos4
11511.18Sfredette		;;
11521.18Sfredette	sun4sol2)
11531.18Sfredette		basic_machine=sparc-sun
11541.18Sfredette		os=-solaris2
11551.18Sfredette		;;
11561.18Sfredette	sun3 | sun3-*)
11571.18Sfredette		basic_machine=m68k-sun
11581.18Sfredette		;;
11591.18Sfredette	sun4)
11601.18Sfredette		basic_machine=sparc-sun
11611.18Sfredette		;;
11621.18Sfredette	sun386 | sun386i | roadrunner)
11631.18Sfredette		basic_machine=i386-sun
11641.18Sfredette		;;
11651.18Sfredette	sv1)
11661.18Sfredette		basic_machine=sv1-cray
11671.1Srh		os=-unicos
11681.1Srh		;;
11691.1Srh	symmetry)
11701.1Srh		basic_machine=i386-sequent
11711.1Srh		os=-dynix
11721.1Srh		;;
11731.41Schristos	t3e)
11741.1Srh		basic_machine=alphaev5-cray
11751.30Skent		os=-unicos
11761.1Srh		;;
11771.1Srh	t90)
11781.1Srh		basic_machine=t90-cray
11791.1Srh		os=-unicos
11801.1Srh		;;
11811.41Schristos	tile*)
11821.41Schristos		basic_machine=$basic_machine-unknown
11831.1Srh		os=-linux-gnu
11841.30Skent		;;
11851.1Srh	tx39)
11861.1Srh		basic_machine=mipstx39-unknown
11871.1Srh		;;
11881.1Srh	tx39el)
11891.65Sisaki		basic_machine=mipstx39el-unknown
11901.65Sisaki		;;
11911.1Srh	toad1)
11921.1Srh		basic_machine=pdp10-xkl
11931.1Srh		os=-tops20
11941.1Srh		;;
11951.1Srh	tower | tower-32)
11961.1Srh		basic_machine=m68k-ncr
11971.1Srh		;;
11981.62Sisaki	tpf)
11991.1Srh		basic_machine=s390x-ibm
12001.30Skent		os=-tpf
12011.62Sisaki		;;
12021.1Srh	udi29k)
12031.1Srh		basic_machine=a29k-amd
12041.1Srh		os=-udi
12051.62Sisaki		;;
12061.62Sisaki	ultra3)
12071.62Sisaki		basic_machine=a29k-nyu
12081.1Srh		os=-sym1
12091.30Skent		;;
12101.1Srh	v810 | necv810)
12111.1Srh		basic_machine=v810-nec
12121.62Sisaki		os=-none
12131.62Sisaki		;;
12141.30Skent	vaxv)
12151.1Srh		basic_machine=vax-dec
12161.62Sisaki		os=-sysv
12171.62Sisaki		;;
12181.62Sisaki	vms)
12191.62Sisaki		basic_machine=vax-dec
12201.1Srh		os=-vms
12211.1Srh		;;
12221.1Srh	vpp*|vx|vx-*)
12231.1Srh		basic_machine=f301-fujitsu
12241.1Srh		;;
12251.1Srh	vxworks960)
12261.1Srh		basic_machine=i960-wrs
12271.30Skent		os=-vxworks
12281.1Srh		;;
12291.30Skent	vxworks68)
12301.30Skent		basic_machine=m68k-wrs
12311.1Srh		os=-vxworks
12321.1Srh		;;
12331.1Srh	vxworks29k)
12341.1Srh		basic_machine=a29k-wrs
12351.1Srh		os=-vxworks
12361.30Skent		;;
12371.1Srh	w65*)
12381.30Skent		basic_machine=w65-wdc
12391.30Skent		os=-none
12401.1Srh		;;
12411.1Srh	w89k-*)
12421.1Srh		basic_machine=hppa1.1-winbond
12431.1Srh		os=-proelf
12441.1Srh		;;
12451.30Skent	x64)
12461.1Srh		basic_machine=x86_64-pc
12471.30Skent		;;
12481.30Skent	xbox)
12491.1Srh		basic_machine=i686-pc
12501.1Srh		os=-mingw32
12511.1Srh		;;
12521.54Sjmcneill	xps | xps100)
12531.1Srh		basic_machine=xps100-honeywell
12541.30Skent		;;
12551.18Sfredette	xscale-* | xscalee[bl]-*)
12561.1Srh		basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
12571.1Srh		;;
12581.54Sjmcneill	ymp)
12591.30Skent		basic_machine=ymp-cray
12601.18Sfredette		os=-unicos
12611.18Sfredette		;;
12621.18Sfredette	none)
12631.18Sfredette		basic_machine=none-none
12641.1Srh		os=-none
12651.1Srh		;;
12661.1Srh
12671.1Srh# Here we handle the default manufacturer of certain CPU types.  It is in
12681.18Sfredette# some cases the only manufacturer, in others, it is the most popular.
12691.18Sfredette	w89k)
12701.18Sfredette		basic_machine=hppa1.1-winbond
12711.18Sfredette		;;
12721.18Sfredette	op50n)
12731.18Sfredette		basic_machine=hppa1.1-oki
12741.18Sfredette		;;
12751.18Sfredette	op60c)
12761.42Schristos		basic_machine=hppa1.1-oki
12771.18Sfredette		;;
12781.42Schristos	romp)
12791.1Srh		basic_machine=romp-ibm
12801.1Srh		;;
12811.1Srh	mmix)
12821.54Sjmcneill		basic_machine=mmix-knuth
12831.1Srh		;;
12841.30Skent	rs6000)
12851.1Srh		basic_machine=rs6000-ibm
12861.54Sjmcneill		;;
12871.30Skent	vax)
12881.42Schristos		basic_machine=vax-dec
12891.18Sfredette		;;
12901.42Schristos	pdp11)
12911.18Sfredette		basic_machine=pdp11-dec
12921.1Srh		;;
12931.1Srh	we32k)
12941.1Srh		basic_machine=we32k-att
12951.41Schristos		;;
12961.1Srh	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
12971.30Skent		basic_machine=sh-unknown
12981.18Sfredette		;;
12991.18Sfredette	cydra)
13001.18Sfredette		basic_machine=cydra-cydrome
13011.18Sfredette		;;
13021.1Srh	orion)
13031.1Srh		basic_machine=orion-highlevel
13041.1Srh		;;
13051.1Srh	orion105)
13061.41Schristos		basic_machine=clipper-highlevel
13071.1Srh		;;
13081.30Skent	mac | mpw | mac-mpw)
13091.63Sisaki		basic_machine=m68k-apple
13101.63Sisaki		;;
13111.1Srh	pmac | pmac-mpw)
13121.1Srh		basic_machine=powerpc-apple
13131.1Srh		;;
13141.1Srh	*-unknown)
13151.1Srh		# Make sure to match an already-canonicalized machine name.
13161.1Srh		;;
13171.1Srh	*)
13181.45Sdyoung		echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
13191.1Srh		exit 1
13201.1Srh		;;
13211.30Skentesac
13221.30Skent
13231.30Skent# Here we canonicalize certain aliases for manufacturers.
13241.1Srhcase $basic_machine in
13251.30Skent	*-digital*)
13261.54Sjmcneill		basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
13271.1Srh		;;
13281.67Smlelstv	*-commodore*)
13291.1Srh		basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
13301.1Srh		;;
13311.67Smlelstv	*)
13321.1Srh		;;
13331.1Srhesac
13341.1Srh
13351.1Srh# Decode manufacturer-specific aliases for certain operating systems.
13361.1Srh
13371.1Srhif [ x"$os" != x"" ]
13381.1Srhthen
13391.1Srhcase $os in
13401.1Srh	# First match some system type aliases that might get confused
13411.1Srh	# with valid system types.
13421.1Srh	# -solaris* is a basic system type, with this one exception.
13431.1Srh	-auroraux)
13441.1Srh		os=-auroraux
13451.1Srh		;;
13461.1Srh	-solaris1 | -solaris1.*)
13471.1Srh		os=`echo $os | sed -e 's|solaris1|sunos4|'`
13481.1Srh		;;
13491.1Srh	-solaris)
13501.1Srh		os=-solaris2
13511.1Srh		;;
13521.1Srh	-unixware*)
13531.1Srh		os=-sysv4.2uw
13541.1Srh		;;
13551.1Srh	-gnu/linux*)
13561.1Srh		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
13571.1Srh		;;
13581.1Srh	# es1800 is here to avoid being matched by es* (a different OS)
13591.1Srh	-es1800*)
13601.1Srh		os=-ose
13611.18Sfredette		;;
13621.1Srh	# Now accept the basic system types.
13631.1Srh	# The portable systems comes first.
13641.1Srh	# Each alternative MUST end in a * to match a version number.
13651.1Srh	# -sysv* is not here because it comes later, after sysvr4.
13661.1Srh	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
13671.1Srh	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
13681.1Srh	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
13691.1Srh	      | -sym* | -kopensolaris* | -plan9* \
13701.1Srh	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
13711.1Srh	      | -aos* | -aros* | -cloudabi* | -sortix* \
13721.1Srh	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
13731.1Srh	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
13741.1Srh	      | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
13751.1Srh	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
13761.1Srh	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13771.1Srh	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13781.1Srh	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
13791.1Srh	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
13801.1Srh	      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
13811.1Srh	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
13821.1Srh	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
13831.18Sfredette	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
13841.1Srh	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
13851.1Srh	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
13861.1Srh	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13871.1Srh	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13881.1Srh	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13891.1Srh	      | -morphos* | -superux* | -rtmk* | -windiss* \
13901.1Srh	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
13911.1Srh	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
13921.1Srh	      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
13931.18Sfredette	      | -midnightbsd*)
13941.18Sfredette	# Remember, each alternative MUST END IN *, to match a version number.
13951.18Sfredette		;;
13961.18Sfredette	-qnx*)
13971.18Sfredette		case $basic_machine in
13981.18Sfredette		    x86-* | i*86-*)
13991.1Srh			;;
14001.1Srh		    *)
14011.1Srh			os=-nto$os
14021.1Srh			;;
14031.54Sjmcneill		esac
14041.1Srh		;;
14051.67Smlelstv	-nto-qnx*)
14061.1Srh		;;
14071.1Srh	-nto*)
14081.45Sdyoung		os=`echo $os | sed -e 's|nto|nto-qnx|'`
14091.45Sdyoung		;;
14101.45Sdyoung	-sim | -xray | -os68k* | -v88r* \
14111.45Sdyoung	      | -windows* | -osx | -abug | -netware* | -os9* \
14121.45Sdyoung	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
14131.45Sdyoung		;;
14141.66Srin	-mac*)
14151.66Srin		os=`echo "$os" | sed -e 's|mac|macos|'`
14161.66Srin		;;
14171.45Sdyoung	-linux-dietlibc)
14181.45Sdyoung		os=-linux-dietlibc
14191.45Sdyoung		;;
14201.66Srin	-linux*)
14211.45Sdyoung		os=`echo $os | sed -e 's|linux|linux-gnu|'`
14221.45Sdyoung		;;
14231.45Sdyoung	-sunos5*)
14241.45Sdyoung		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
14251.45Sdyoung		;;
14261.1Srh	-sunos6*)
14271.1Srh		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
14281.1Srh		;;
14291.1Srh	-opened*)
14301.1Srh		os=-openedition
14311.1Srh		;;
14321.1Srh	-os400*)
14331.50Scegger		os=-os400
14341.54Sjmcneill		;;
14351.1Srh	-wince*)
14361.1Srh		os=-wince
14371.1Srh		;;
14381.1Srh	-utek*)
14391.54Sjmcneill		os=-bsd
14401.1Srh		;;
14411.1Srh	-dynix*)
14421.1Srh		os=-bsd
14431.1Srh		;;
14441.54Sjmcneill	-acis*)
14451.1Srh		os=-aos
14461.1Srh		;;
14471.1Srh	-atheos*)
14481.1Srh		os=-atheos
14491.54Sjmcneill		;;
14501.1Srh	-syllable*)
14511.1Srh		os=-syllable
14521.1Srh		;;
14531.1Srh	-386bsd)
14541.1Srh		os=-bsd
14551.1Srh		;;
14561.1Srh	-ctix* | -uts*)
14571.1Srh		os=-sysv
14581.1Srh		;;
14591.1Srh	-nova*)
14601.1Srh		os=-rtmk-nova
14611.1Srh		;;
14621.45Sdyoung	-ns2)
14631.1Srh		os=-nextstep2
14641.1Srh		;;
14651.1Srh	-nsk*)
14661.45Sdyoung		os=-nsk
14671.48Scegger		;;
14681.1Srh	# Preserve the version number of sinix5.
14691.30Skent	-sinix5.*)
14701.1Srh		os=`echo $os | sed -e 's|sinix|sysv|'`
14711.30Skent		;;
14721.1Srh	-sinix*)
14731.1Srh		os=-sysv4
14741.1Srh		;;
14751.1Srh	-tpf*)
14761.1Srh		os=-tpf
14771.1Srh		;;
14781.1Srh	-triton*)
14791.1Srh		os=-sysv3
14801.64Smrg		;;
14811.1Srh	-oss*)
14821.1Srh		os=-sysv3
14831.1Srh		;;
14841.1Srh	-svr4*)
14851.1Srh		os=-sysv4
14861.1Srh		;;
14871.1Srh	-svr3)
14881.1Srh		os=-sysv3
14891.1Srh		;;
14901.1Srh	-sysvr4)
14911.45Sdyoung		os=-sysv4
14921.45Sdyoung		;;
14931.1Srh	# This must come after -sysvr4.
14941.30Skent	-sysv*)
14951.30Skent		;;
14961.30Skent	-ose*)
14971.30Skent		os=-ose
14981.30Skent		;;
14991.1Srh	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
15001.1Srh		os=-mint
15011.30Skent		;;
15021.30Skent	-zvmoe)
15031.35Schristos		os=-zvmoe
15041.58Schristos		;;
15051.1Srh	-dicos*)
15061.45Sdyoung		os=-dicos
15071.49Scegger		;;
15081.30Skent	-pikeos*)
15091.30Skent		# Until real need of OS specific support for
15101.30Skent		# particular features comes up, bare metal
15111.20Sthorpej		# configurations are quite functional.
15121.56Sdrochner		case $basic_machine in
15131.1Srh		    arm*)
15141.54Sjmcneill			os=-eabi
15151.55Smrg			;;
15161.54Sjmcneill		    *)
15171.1Srh			os=-elf
15181.1Srh			;;
15191.1Srh		esac
15201.1Srh		;;
15211.1Srh	-nacl*)
15221.1Srh		;;
15231.1Srh	-ios)
15241.45Sdyoung		;;
15251.49Scegger	-none)
15261.54Sjmcneill		;;
15271.54Sjmcneill	*)
15281.1Srh		# Get rid of the `-' at the beginning of $os.
15291.1Srh		os=`echo $os | sed 's/[^-]*-//'`
15301.1Srh		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
15311.1Srh		exit 1
15321.1Srh		;;
15331.18Sfredetteesac
15341.1Srhelse
15351.1Srh
15361.1Srh# Here we handle the default operating systems that come with various machines.
15371.1Srh# The value should be what the vendor currently ships out the door with their
15381.1Srh# machine or put another way, the most popular os provided with the machine.
15391.3Srh
15401.3Srh# Note that if you're going to try to match "-MANUFACTURER" here (say,
15411.49Scegger# "-sun"), then you have to tell the case statement up towards the top
15421.3Srh# that MANUFACTURER isn't an operating system.  Otherwise, code above
15431.3Srh# will signal an error saying that MANUFACTURER isn't an operating
15441.1Srh# system, and we'll never get to this point.
15451.1Srh
15461.49Sceggercase $basic_machine in
15471.54Sjmcneill	score-*)
15481.54Sjmcneill		os=-elf
15491.1Srh		;;
15501.1Srh	spu-*)
15511.58Schristos		os=-elf
15521.67Smlelstv		;;
15531.60Sjdolecek	*-acorn)
15541.1Srh		os=-riscix1.2
15551.49Scegger		;;
15561.1Srh	arm*-rebel)
15571.51Snjoly		os=-linux
15581.51Snjoly		;;
15591.54Sjmcneill	arm*-semi)
15601.54Sjmcneill		os=-aout
15611.1Srh		;;
15621.1Srh	c4x-* | tic4x-*)
15631.59Smsaitoh		os=-coff
15641.1Srh		;;
15651.1Srh	c8051-*)
15661.1Srh		os=-elf
15671.1Srh		;;
15681.1Srh	hexagon-*)
15691.35Schristos		os=-elf
15701.46Sdyoung		;;
15711.35Schristos	tic54x-*)
15721.59Smsaitoh		os=-coff
15731.54Sjmcneill		;;
15741.54Sjmcneill	tic55x-*)
15751.35Schristos		os=-coff
15761.35Schristos		;;
15771.1Srh	tic6x-*)
15781.1Srh		os=-coff
15791.1Srh		;;
15801.1Srh	# This must come before the *-dec entry.
15811.1Srh	pdp10-*)
15821.1Srh		os=-tops20
15831.1Srh		;;
15841.1Srh	pdp11-*)
15851.1Srh		os=-none
15861.1Srh		;;
15871.1Srh	*-dec | vax-*)
15881.1Srh		os=-ultrix4.2
15891.1Srh		;;
15901.1Srh	m68*-apollo)
15911.1Srh		os=-domain
15921.1Srh		;;
15931.1Srh	i386-sun)
15941.1Srh		os=-sunos4.0.2
15951.1Srh		;;
15961.1Srh	m68000-sun)
15971.49Scegger		os=-sunos3
15981.54Sjmcneill		;;
15991.54Sjmcneill	m68*-cisco)
16001.1Srh		os=-aout
16011.1Srh		;;
16021.1Srh	mep-*)
16031.3Srh		os=-elf
16041.3Srh		;;
16051.3Srh	mips*-cisco)
16061.3Srh		os=-elf
16071.3Srh		;;
16081.3Srh	mips*-*)
16091.3Srh		os=-elf
16101.3Srh		;;
16111.3Srh	or32-*)
16121.5Srh		os=-coff
16131.3Srh		;;
16141.1Srh	*-tti)	# must be before sparc entry or we get the wrong os.
16151.67Smlelstv		os=-sysv3
16161.1Srh		;;
16171.1Srh	sparc-* | *-sun)
16181.1Srh		os=-sunos4.1.1
16191.1Srh		;;
16201.3Srh	pru-*)
16211.1Srh		os=-elf
16221.54Sjmcneill		;;
16231.54Sjmcneill	*-be)
16241.54Sjmcneill		os=-beos
16251.1Srh		;;
16261.54Sjmcneill	*-ibm)
16271.18Sfredette		os=-aix
16281.18Sfredette		;;
16291.18Sfredette	*-knuth)
16301.18Sfredette		os=-mmixware
16311.49Scegger		;;
16321.54Sjmcneill	*-wec)
16331.54Sjmcneill		os=-proelf
16341.18Sfredette		;;
16351.18Sfredette	*-winbond)
16361.18Sfredette		os=-proelf
16371.18Sfredette		;;
16381.18Sfredette	*-oki)
16391.18Sfredette		os=-proelf
16401.18Sfredette		;;
16411.18Sfredette	*-hp)
16421.1Srh		os=-hpux
16431.67Smlelstv		;;
16441.7Sichiro	*-hitachi)
16451.44Sjmcneill		os=-hiux
16461.44Sjmcneill		;;
16471.7Sichiro	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
16481.7Sichiro		os=-sysv
16491.45Sdyoung		;;
16501.45Sdyoung	*-cbm)
16511.45Sdyoung		os=-amigaos
16521.45Sdyoung		;;
16531.45Sdyoung	*-dg)
16541.45Sdyoung		os=-dgux
16551.45Sdyoung		;;
16561.45Sdyoung	*-dolphin)
16571.45Sdyoung		os=-sysv3
16581.45Sdyoung		;;
16591.45Sdyoung	m68k-ccur)
16601.45Sdyoung		os=-rtu
16611.45Sdyoung		;;
16621.45Sdyoung	m88k-omron*)
16631.54Sjmcneill		os=-luna
16641.45Sdyoung		;;
16651.45Sdyoung	*-next)
16661.45Sdyoung		os=-nextstep
16671.45Sdyoung		;;
16681.54Sjmcneill	*-sequent)
16691.54Sjmcneill		os=-ptx
16701.45Sdyoung		;;
16711.54Sjmcneill	*-crds)
16721.54Sjmcneill		os=-unos
16731.45Sdyoung		;;
16741.45Sdyoung	*-ns)
16751.45Sdyoung		os=-genix
16761.45Sdyoung		;;
16771.45Sdyoung	i370-*)
16781.45Sdyoung		os=-mvs
16791.45Sdyoung		;;
16801.45Sdyoung	*-gould)
16811.45Sdyoung		os=-sysv
16821.54Sjmcneill		;;
16831.54Sjmcneill	*-highlevel)
16841.45Sdyoung		os=-bsd
16851.45Sdyoung		;;
16861.45Sdyoung	*-encore)
16871.45Sdyoung		os=-bsd
16881.44Sjmcneill		;;
16891.53Sdyoung	*-sgi)
16901.1Srh		os=-irix
16911.44Sjmcneill		;;
16921.1Srh	*-siemens)
16931.54Sjmcneill		os=-sysv4
16941.54Sjmcneill		;;
16951.1Srh	*-masscomp)
16961.1Srh		os=-rtu
16971.1Srh		;;
16981.1Srh	f30[01]-fujitsu | f700-fujitsu)
16991.54Sjmcneill		os=-uxpv
17001.1Srh		;;
17011.1Srh	*-rom68k)
17021.1Srh		os=-coff
17031.1Srh		;;
17041.1Srh	*-*bug)
17051.1Srh		os=-coff
17061.54Sjmcneill		;;
17071.1Srh	*-apple)
17081.44Sjmcneill		os=-macos
17091.1Srh		;;
17101.1Srh	*-atari*)
17111.44Sjmcneill		os=-mint
17121.53Sdyoung		;;
17131.1Srh	*)
17141.44Sjmcneill		os=-none
17151.38Sjmcneill		;;
17161.1Srhesac
17171.1Srhfi
17181.54Sjmcneill
17191.54Sjmcneill# Here we handle the case where we know the os, and the CPU type, but not the
17201.54Sjmcneill# manufacturer.  We pick the logical manufacturer.
17211.1Srhvendor=unknown
17221.8Sichirocase $basic_machine in
17231.38Sjmcneill	*-unknown)
17241.38Sjmcneill		case $os in
17251.38Sjmcneill			-riscix*)
17261.38Sjmcneill				vendor=acorn
17271.54Sjmcneill				;;
17281.30Skent			-sunos*)
17291.54Sjmcneill				vendor=sun
17301.8Sichiro				;;
17311.1Srh			-cnk*|-aix*)
17321.1Srh				vendor=ibm
17331.49Scegger				;;
17341.1Srh			-beos*)
17351.1Srh				vendor=be
17361.8Sichiro				;;
17371.1Srh			-hpux*)
17381.8Sichiro				vendor=hp
17391.1Srh				;;
17401.1Srh			-mpeix*)
17411.1Srh				vendor=hp
17421.1Srh				;;
17431.30Skent			-hiux*)
17441.1Srh				vendor=hitachi
17451.1Srh				;;
17461.1Srh			-unos*)
17471.1Srh				vendor=crds
17481.54Sjmcneill				;;
17491.54Sjmcneill			-dgux*)
17501.1Srh				vendor=dg
17511.44Sjmcneill				;;
17521.1Srh			-luna*)
17531.54Sjmcneill				vendor=omron
17541.54Sjmcneill				;;
17551.54Sjmcneill			-genix*)
17561.54Sjmcneill				vendor=ns
17571.54Sjmcneill				;;
17581.54Sjmcneill			-mvs* | -opened*)
17591.54Sjmcneill				vendor=ibm
17601.54Sjmcneill				;;
17611.54Sjmcneill			-os400*)
17621.54Sjmcneill				vendor=ibm
1763				;;
1764			-ptx*)
1765				vendor=sequent
1766				;;
1767			-tpf*)
1768				vendor=ibm
1769				;;
1770			-vxsim* | -vxworks* | -windiss*)
1771				vendor=wrs
1772				;;
1773			-aux*)
1774				vendor=apple
1775				;;
1776			-hms*)
1777				vendor=hitachi
1778				;;
1779			-mpw* | -macos*)
1780				vendor=apple
1781				;;
1782			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1783				vendor=atari
1784				;;
1785			-vos*)
1786				vendor=stratus
1787				;;
1788		esac
1789		basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
1790		;;
1791esac
1792
1793echo "$basic_machine$os"
1794exit
1795
1796# Local variables:
1797# eval: (add-hook 'write-file-functions 'time-stamp)
1798# time-stamp-start: "timestamp='"
1799# time-stamp-format: "%:y-%02m-%02d"
1800# time-stamp-end: "'"
1801# End:
1802