# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
# Inc.
timestamp='2007-04-29'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 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, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# 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.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
# 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.
# 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 (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
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.
;;
*)
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=
;;
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*)
;;
-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 \
| am33_2.0 \
| bfin \
| mips16 \
| mips64vr | mips64vrel \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipstx39 | mipstx39el \
| mt \
| msp430 \
| or32 \
| pyramid \
| score \
| we32k \
| z8k)
;;
# Motorola 68HC11/12.
;;
;;
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-* \
| elxsi-* \
| mips16-* \
| mips64vr-* | mips64vrel-* \
| mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| orion-* \
| pyramid-* \
| sparclite-* \
| tron-* \
| we32k-* \
| ymp-* \
| z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
;;
;;
3b*)
;;
;;
;;
;;
;;
;;
;;
;;
amd64-*)
;;
;;
;;
;;
;;
;;
;;
aux)
;;
;;
c90)
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
crx)
;;
;;
;;
decsystem10* | dec10*)
;;
decsystem20* | dec20*)
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
;;
go32)
;;
;;
;;
;;
;;
;;
hp300-*)
;;
;;
;;
;;
;;
;;
;;
;;
# FIXME: really hppa2.0-hp
;;
# FIXME: really hppa2.0-hp
;;
;;
;;
hppa-next)
;;
;;
;;
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
;;
i*86v4*)
;;
i*86v)
;;
i*86sol2)
;;
;;
;;
-irix*)
;;
*)
;;
esac
;;
;;
;;
;;
;;
;;
;;
;;
;;
mips3*-*)
;;
mips3*)
;;
;;
;;
;;
ms1-*)
;;
mvs)
;;
;;
;;
;;
;;
;;
;;
;;
next | m*-next )
basic_machine=m68k-next
-nextstep* )
;;
-ns2*)
;;
*)
;;
esac
;;
;;
;;
;;
;;
;;
np1)
;;
;;
;;
;;
;;
;;
;;
;;
;;
pbd)
;;
pbb)
;;
;;
pc98)
;;
pc98-*)
;;
;;
;;
;;
;;
;;
;;
;;
pentium4-*)
;;
pn)
;;
;;
;;
;;
;;
ppcle-* | powerpclittle-*)
;;
;;
;;
;;
ppc64le-* | powerpc64little-*)
;;
ps2)
;;
pw32)
;;
rdos)
;;
;;
;;
;;
;;
;;
;;
sb1)
;;
;;
sde)
;;
sei)
;;
;;
sh)
;;
;;
sh64)
;;
;;
sps7)
;;
spur)
;;
;;
;;
sun2)
;;
;;
;;
;;
;;
;;
;;
;;
;;
sun4)
;;
;;
sv1)
;;
;;
t3e)
;;
t90)
;;
;;
;;
;;
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.
;;
-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.
| -aos* \
# 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*)
;;
-kaos*)
;;
-zvmoe)
;;
-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)
;;
;;
;;
;;
# This must come before the *-dec entry.
pdp10-*)
;;
pdp11-*)
;;
;;
;;
;;
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
;;
mep-*)
;;
;;
mips*-*)
;;
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*)
;;
-aix*)
;;
-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: