1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington# Configuration validation subroutine script.
ae871ebb28959bed920cc96cd9e91063b6625b78Mark Andrews# Copyright 1992-2013 Free Software Foundation, Inc.
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# This file is free software; you can redistribute it and/or modify it
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# under the terms of the GNU General Public License as published by
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# the Free Software Foundation; either version 3 of the License, or
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# (at your option) any later version.
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# This program is distributed in the hope that it will be useful, but
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# WITHOUT ANY WARRANTY; without even the implied warranty of
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# General Public License for more details.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# You should have received a copy of the GNU General Public License
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# along with this program; if not, see <http://www.gnu.org/licenses/>.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# As a special exception to the GNU General Public License, if you
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# distribute this file as part of a program that contains a
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# configuration script generated by Autoconf, you may include it under
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# the same distribution terms that you use for the rest of that
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# program. This Exception is an additional permission under section 7
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# of the GNU General Public License, version 3 ("GPLv3").
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# Please send patches with a ChangeLog entry to config-patches@gnu.org.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Configuration subroutine to validate and canonicalize a configuration type.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Supply the specified configuration type as an argument.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# If it is invalid, we print an error message on stderr and exit with code 1.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Otherwise, we print the canonical config type on stdout and succeed.
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# You can get the latest version of this script from:
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# This file is supposed to be the same for all GNU packages
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# and recognize all the CPU types, system types and aliases
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# that are meaningful with *any* GNU software.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Each package is responsible for reporting which valid configurations
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# it does not support. The user should be able to distinguish
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# a failure to support a valid configuration from a meaningless
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# configuration.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# The goal of this file is to map all the various variations of a given
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# machine specification into a single specification in the form:
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# or in some cases, the newer four-part form:
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# It is wrong to echo any other type of specification.
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian WellingtonUsage: $0 [OPTION] CPU-MFR-OPSYS
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington $0 [OPTION] ALIAS
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian WellingtonCanonicalize a configuration name.
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian WellingtonOperation modes:
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington -h, --help print this help, then exit
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington -t, --time-stamp print date of last modification, then exit
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington -v, --version print version number, then exit
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian WellingtonReport bugs and patches to <config-patches@gnu.org>."
ae871ebb28959bed920cc96cd9e91063b6625b78Mark AndrewsCopyright 1992-2013 Free Software Foundation, Inc.
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian WellingtonThis is free software; see the source for copying conditions. There is NO
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellingtonwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian WellingtonTry \`$me --help' for more information."
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington# Parse command line
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington --time-stamp | --time* | -t )
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews echo "$timestamp" ; exit ;;
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews echo "$version" ; exit ;;
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington --help | --h* | -h )
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews echo "$usage"; exit ;;
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington -- ) # Stop option processing
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington shift; break ;;
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington - ) # Use stdin as input.
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington echo "$me: invalid option $1$help"
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington # First pass through any local machine types.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Here we must recognize all the valid KERNEL-OS combinations.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halleymaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley### Let's recognize common machines as not being operating systems so
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley### that things like config.sub decstation-3100 work. We also
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley### recognize some manufacturers as not being operating systems, so we
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley### can provide default operating systems below.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Prevent following clause from handling this invalid input.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews -apple | -axis | -knuth | -cray | -microblaze*)
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Don't forget version if it is 3.2v4 or newer.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews # Don't forget version if it is 3.2v4 or newer.
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Decode aliases for certain CPU-COMPANY combinations.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Recognize the basic CPU types without company name.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Some are omitted here because they have special meanings below.
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | m32c | m32r | m32rle | m68000 | m68k | m88k \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | powerpc | powerpc64 | powerpc64le | powerpcle \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
ae871ebb28959bed920cc96cd9e91063b6625b78Mark Andrews m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
822cd79080cf9cdf2a6667358d56d97f4213493eMark Andrews m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # We use `pc' rather than `unknown'
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # because (1) that's what they normally are, and
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # (2) the word "unknown" tends to confuse beginning users.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Object if more than one company name word.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Recognize the basic CPU types with company name.
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
ae871ebb28959bed920cc96cd9e91063b6625b78Mark Andrews | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews # Recognize the basic CPU types without company name, with glob match.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Recognize the various machine names and aliases which stand
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # for a CPU type and a company and sometimes even an OS.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley # FIXME: really hppa2.0-hp
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley # FIXME: really hppa2.0-hp
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley next | m*-next )
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson ppc64le | powerpc64little | ppc64-le | powerpc64-little)
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Here we handle the default manufacturer of certain CPU types. It is in
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# some cases the only manufacturer, in others, it is the most popular.
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington # there are many clones, so DEC is not a safe bet
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington # Make sure to match an already-canonicalized machine name.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Here we canonicalize certain aliases for manufacturers.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Decode manufacturer-specific aliases for certain operating systems.
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews # First match some system type aliases
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews # that might get confused with valid system types.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # -solaris* is a basic system type, with this one exception.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # First accept the basic system types.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # The portable systems comes first.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Each alternative MUST END IN A *, to match a version number.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # -sysv* is not here because it comes later, after sysvr4.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
7c8662961e2876e22e34c96d41dad0cd70e3ce4cMark Andrews | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
7c8662961e2876e22e34c96d41dad0cd70e3ce4cMark Andrews | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -linux-newlib* | -linux-musl* | -linux-uclibc* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
fdef562ba7ec9468a920cdbdc4f55c3e3ded6490Andreas Gustafsson | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Remember, each alternative MUST END IN *, to match a version number.
64e41159a919b0711321fe688ca5da4f4d1b7d80Bob Halley -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
beb12aad6bebb0d6891613e65a4e19a42e6e3f8eMark Andrews | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
6d100ee72e4a47dd9855d7a7d7d4509c5cd88c65Bob Halley | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Preserve the version number of sinix5.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # This must come after -sysvr4.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley # Get rid of the `-' at the beginning of $os.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Here we handle the default operating systems that come with various machines.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# The value should be what the vendor currently ships out the door with their
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# machine or put another way, the most popular os provided with the machine.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Note that if you're going to try to match "-MANUFACTURER" here (say,
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# "-sun"), then you have to tell the case statement up towards the top
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# that MANUFACTURER isn't an operating system. Otherwise, code above
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# will signal an error saying that MANUFACTURER isn't an operating
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# system, and we'll never get to this point.
74cb99072c4b0ebd2ccafcfa284288fa760f7a1aMark Andrews # This must come before the *-dec entry.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley *-tti) # must be before sparc entry or we get the wrong os.
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# Here we handle the case where we know the os, and the CPU type, but not the
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley# manufacturer. We pick the logical manufacturer.
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
a5d43b72413db3edd6b36a58f9bdf2cf6ff692f2Bob Halley basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington# Local variables:
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington# eval: (add-hook 'write-file-hooks 'time-stamp)
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington# time-stamp-start: "timestamp='"
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington# time-stamp-format: "%:y-%02m-%02d"
1812c92e63f4f84f1111cc2ef9cda53fd6009981Brian Wellington# time-stamp-end: "'"