# Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc.
timestamp='2013-10-01'
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
exit 1;;
1) ;;
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
kopensolaris*-gnu* | \
;;
;;
*)
if [ $basic_machine != $1 ]
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
# Prevent following clause from handling this invalid input.
;;
os=
;;
-bluegene*)
;;
os=
;;
-scout)
;;
-wrs)
;;
-chorusos*)
;;
;;
-hiux*)
;;
-sco6)
;;
-sco5)
;;
-sco4)
;;
;;
# Don't forget version if it is 3.2v4 or newer.
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
;;
-sco*)
;;
-udk*)
;;
-isc)
;;
-clix*)
;;
-isc*)
;;
-lynx*178)
;;
-lynx*5)
;;
-lynx*)
;;
-ptx*)
;;
-windowsnt*)
;;
-psos*)
;;
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| am33_2.0 \
| bfin \
| epiphany \
| hexagon \
| k1om \
| lm32 \
| mips16 \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| moxie \
| mt \
| msp430 \
| open8 \
| pyramid \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| spu \
| ubicom32 \
| we32k \
;;
c54x)
;;
c55x)
;;
c6x)
;;
;;
;;
ms1)
;;
;;
;;
;;
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
;;
# Object if more than one company name word.
*-*-*)
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| elxsi-* \
| hexagon-* \
| k1om-* \
| lm32-* \
| microblaze-* | microblazeel-* \
| mips16-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| open8-* \
| orion-* \
| pyramid-* \
| sparclite-* \
| tahoe-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| vax-* \
| we32k-* \
| ymp-* \
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
;;
;;
3b*)
;;
;;
;;
;;
;;
;;
;;
;;
amd64-*)
;;
;;
;;
;;
;;
;;
;;
aros)
;;
aux)
;;
;;
;;
blackfin-*)
;;
bluegene*)
;;
c54x-*)
;;
c55x-*)
;;
c6x-*)
;;
c90)
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
crx)
;;
;;
;;
decsystem10* | dec10*)
;;
decsystem20* | dec20*)
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
go32)
;;
;;
;;
;;
;;
;;
hp300-*)
;;
;;
;;
;;
;;
;;
;;
;;
# FIXME: really hppa2.0-hp
;;
# FIXME: really hppa2.0-hp
;;
;;
;;
hppa-next)
;;
;;
;;
;;
i*86v32)
;;
i*86v4*)
;;
i*86v)
;;
i*86sol2)
;;
;;
;;
-irix*)
;;
*)
;;
esac
;;
;;
;;
m68knommu-*)
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
mips3*-*)
;;
mips3*)
;;
;;
;;
;;
ms1-*)
;;
msys)
;;
mvs)
;;
nacl)
;;
;;
;;
;;
;;
;;
;;
;;
next | m*-next )
basic_machine=m68k-next
-nextstep* )
;;
-ns2*)
;;
*)
;;
esac
;;
;;
;;
;;
;;
;;
np1)
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
parisc-*)
;;
pbd)
;;
pbb)
;;
;;
pc98)
;;
pc98-*)
;;
;;
;;
;;
;;
;;
;;
;;
pentium4-*)
;;
pn)
;;
;;
;;
;;
;;
ppcle-* | powerpclittle-*)
;;
;;
;;
;;
ppc64le-* | powerpc64little-*)
;;
ps2)
;;
pw32)
;;
;;
;;
;;
;;
;;
;;
;;
;;
sb1)
;;
;;
sde)
;;
sei)
;;
;;
sh)
;;
;;
sh64)
;;
;;
sps7)
;;
spur)
;;
;;
;;
;;
sun2)
;;
;;
;;
;;
;;
;;
;;
;;
;;
sun4)
;;
;;
sv1)
;;
;;
t3e)
;;
t90)
;;
tile*)
;;
tx39)
;;
;;
;;
;;
tpf)
;;
;;
;;
;;
vaxv)
;;
vms)
;;
;;
;;
;;
;;
w65*)
;;
w89k-*)
;;
xbox)
;;
;;
;;
ymp)
;;
;;
;;
none)
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
;;
;;
;;
romp)
;;
mmix)
;;
;;
vax)
;;
# there are many clones, so DEC is not a safe bet
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
;;
*-commodore*)
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
;;
;;
-solaris)
;;
-svr4*)
;;
-unixware*)
;;
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
;;
esac
;;
;;
-nto*)
;;
;;
-mac*)
;;
;;
-linux*)
;;
-sunos5*)
;;
-sunos6*)
;;
-opened*)
;;
-os400*)
;;
-wince*)
;;
-osfrose*)
;;
-osf*)
;;
-utek*)
;;
-dynix*)
;;
-acis*)
;;
-atheos*)
;;
-syllable*)
;;
-386bsd)
;;
;;
-nova*)
;;
-ns2 )
;;
-nsk*)
;;
# Preserve the version number of sinix5.
-sinix5.*)
;;
-sinix*)
;;
-tpf*)
;;
-triton*)
;;
-oss*)
;;
-svr4)
;;
-svr3)
;;
-sysvr4)
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
;;
-es1800*)
;;
-xenix)
;;
;;
-aros*)
;;
-zvmoe)
;;
-dicos*)
;;
-nacl*)
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
;;
spu-*)
;;
*-acorn)
;;
;;
;;
;;
c8051-*)
;;
hexagon-*)
;;
tic54x-*)
;;
tic55x-*)
;;
tic6x-*)
;;
# This must come before the *-dec entry.
pdp10-*)
;;
pdp11-*)
;;
;;
;;
;;
;;
;;
mep-*)
;;
;;
mips*-*)
;;
or1k-*)
;;
or32-*)
;;
*-tti) # must be before sparc entry or we get the wrong os.
;;
;;
*-be)
;;
*-haiku)
;;
*-ibm)
;;
*-knuth)
;;
*-wec)
;;
*-winbond)
;;
*-oki)
;;
*-hp)
;;
*-hitachi)
;;
;;
*-cbm)
;;
*-dg)
;;
*-dolphin)
;;
;;
;;
*-next )
;;
*-sequent)
;;
*-crds)
;;
*-ns)
;;
i370-*)
;;
*-next)
;;
*-gould)
;;
*-highlevel)
;;
*-encore)
;;
*-sgi)
;;
*-siemens)
;;
*-masscomp)
;;
;;
*-rom68k)
;;
*-*bug)
;;
*-apple)
;;
*-atari*)
;;
*)
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
case $basic_machine in
*-unknown)
-riscix*)
;;
-sunos*)
;;
;;
-beos*)
;;
-hpux*)
;;
-mpeix*)
;;
-hiux*)
;;
-unos*)
;;
-dgux*)
;;
-luna*)
;;
-genix*)
;;
;;
-os400*)
;;
-ptx*)
;;
-tpf*)
;;
;;
-aux*)
;;
-hms*)
;;
;;
;;
-vos*)
;;
esac
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End: