config.guess revision 0a6b08f8
11.91Schristos#! /bin/sh
21.15Scgd# Attempt to guess a canonical system name.
31.1Scgd#   Copyright 1992-2013 Free Software Foundation, Inc.
41.14Smycroft
51.14Smycrofttimestamp='2013-06-10'
61.1Scgd
71.8Scgd# This file is free software; you can redistribute it and/or modify it
81.1Scgd# under the terms of the GNU General Public License as published by
91.1Scgd# the Free Software Foundation; either version 3 of the License, or
101.2Scgd# (at your option) any later version.
111.2Scgd#
121.2Scgd# This program is distributed in the hope that it will be useful, but
131.2Scgd# WITHOUT ANY WARRANTY; without even the implied warranty of
141.2Scgd# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
151.2Scgd# General Public License for more details.
161.2Scgd#
171.2Scgd# You should have received a copy of the GNU General Public License
181.78Sagc# along with this program; if not, see <http://www.gnu.org/licenses/>.
191.2Scgd#
201.2Scgd# As a special exception to the GNU General Public License, if you
211.1Scgd# distribute this file as part of a program that contains a
221.2Scgd# configuration script generated by Autoconf, you may include it under
231.2Scgd# the same distribution terms that you use for the rest of that
241.2Scgd# program.  This Exception is an additional permission under section 7
251.2Scgd# of the GNU General Public License, version 3 ("GPLv3").
261.2Scgd#
271.2Scgd# Originally written by Per Bothner.
281.2Scgd#
291.2Scgd# You can get the latest version of this script from:
301.2Scgd# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
311.2Scgd#
321.2Scgd# Please send patches with a ChangeLog entry to config-patches@gnu.org.
331.1Scgd
341.44Sfvdl
351.22Smycroftme=`echo "$0" | sed -e 's,.*/,,'`
361.22Smycroft
371.1Scgdusage="\
381.1ScgdUsage: $0 [OPTION]
391.1Scgd
401.1ScgdOutput the configuration name of the system \`$me' is run on.
411.1Scgd
421.65SlukemOperation modes:
431.65Slukem  -h, --help         print this help, then exit
441.91Schristos  -t, --time-stamp   print date of last modification, then exit
451.1Scgd  -v, --version      print version number, then exit
461.8Scgd
471.8ScgdReport bugs and patches to <config-patches@gnu.org>."
481.8Scgd
491.8Scgdversion="\
501.8ScgdGNU config.guess ($timestamp)
511.8Scgd
521.30SchristosOriginally written by Per Bothner.
531.8ScgdCopyright 1992-2013 Free Software Foundation, Inc.
541.8Scgd
551.14SmycroftThis is free software; see the source for copying conditions.  There is NO
561.32Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
571.8Scgd
581.8Scgdhelp="
591.8ScgdTry \`$me --help' for more information."
601.8Scgd
611.8Scgd# Parse command line
621.14Smycroftwhile test $# -gt 0 ; do
631.30Schristos  case $1 in
641.34Smycroft    --time-stamp | --time* | -t )
651.8Scgd       echo "$timestamp" ; exit ;;
661.34Smycroft    --version | -v )
671.8Scgd       echo "$version" ; exit ;;
681.14Smycroft    --help | --h* | -h )
691.8Scgd       echo "$usage"; exit ;;
701.8Scgd    -- )     # Stop option processing
711.8Scgd       shift; break ;;
721.14Smycroft    - )	# Use stdin as input.
731.14Smycroft       break ;;
741.14Smycroft    -* )
751.8Scgd       echo "$me: invalid option $1$help" >&2
761.8Scgd       exit 1 ;;
771.8Scgd    * )
781.8Scgd       break ;;
791.8Scgd  esac
801.16Smycroftdone
811.14Smycroft
821.17Smycroftif test $# != 0; then
831.17Smycroft  echo "$me: too many arguments$help" >&2
841.17Smycroft  exit 1
851.17Smycroftfi
861.14Smycroft
871.86Sxtraemetrap 'exit 1' 1 2 15
881.74Sjdolecek
891.74Sjdolecek# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
901.86Sxtraeme# compiler to aid in system detection is discouraged as it requires
911.34Smycroft# temporary files to be created and, as you can see below, it is a
921.34Smycroft# headache to deal with in a portable fashion.
931.86Sxtraeme
941.86Sxtraeme# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
951.86Sxtraeme# use `HOST_CC' if defined, but it is deprecated.
961.86Sxtraeme
971.86Sxtraeme# Portable tmp directory creation inspired by the Autoconf team.
981.86Sxtraeme
991.86Sxtraemeset_cc_for_build='
1001.34Smycrofttrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1011.50Swrstudentrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1021.34Smycroft: ${TMPDIR=/tmp} ;
1031.40Sfvdl { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1041.74Sjdolecek { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1051.86Sxtraeme { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1061.74Sjdolecek { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1071.74Sjdolecekdummy=$tmp/dummy ;
1081.74Sjdolecektmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1091.86Sxtraemecase $CC_FOR_BUILD,$HOST_CC,$CC in
1101.86Sxtraeme ,,)    echo "int x;" > $dummy.c ;
1111.86Sxtraeme	for c in cc gcc c89 c99 ; do
1121.34Smycroft	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1131.86Sxtraeme	     CC_FOR_BUILD="$c"; break ;
1141.86Sxtraeme	  fi ;
1151.48Swrstuden	done ;
1161.48Swrstuden	if test x"$CC_FOR_BUILD" = x ; then
1171.34Smycroft	  CC_FOR_BUILD=no_compiler_found ;
1181.34Smycroft	fi
1191.86Sxtraeme	;;
1201.86Sxtraeme ,,*)   CC_FOR_BUILD=$CC ;;
1211.48Swrstuden ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1221.47Skleinkesac ; set_cc_for_build= ;'
1231.34Smycroft
1241.44Sfvdl# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1251.67Schs# (ghazi@noc.rutgers.edu 1994-08-24)
1261.30Schristosif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1271.89Schristos	PATH=$PATH:/.attbin ; export PATH
1281.30Schristosfi
1291.86Sxtraeme
1301.58SjdolecekUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1311.30SchristosUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1321.34SmycroftUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1331.34SmycroftUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1341.34Smycroft
1351.34Smycroftcase "${UNAME_SYSTEM}" in
1361.34SmycroftLinux|GNU|GNU/*)
1371.34Smycroft	# If the system lacks a compiler, then just pick glibc.
1381.34Smycroft	# We could probably try harder.
1391.34Smycroft	LIBC=gnu
1401.34Smycroft
1411.34Smycroft	eval $set_cc_for_build
1421.34Smycroft	cat <<-EOF > $dummy.c
1431.50Swrstuden	#include <features.h>
1441.35Smycroft	#if defined(__UCLIBC__)
1451.71Sjdolecek	LIBC=uclibc
1461.44Sfvdl	#elif defined(__dietlibc__)
1471.34Smycroft	LIBC=dietlibc
1481.34Smycroft	#else
1491.34Smycroft	LIBC=gnu
1501.34Smycroft	#endif
1511.34Smycroft	EOF
1521.34Smycroft	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
1531.34Smycroft	;;
1541.34Smycroftesac
1551.34Smycroft
1561.34Smycroft# Note: order is significant - the case branches are not exclusive.
1571.34Smycroft
1581.34Smycroftcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1591.34Smycroft    *:NetBSD:*:*)
1601.34Smycroft	# NetBSD (nbsd) targets should (where applicable) match one or
1611.34Smycroft	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
1621.34Smycroft	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1631.34Smycroft	# switched to ELF, *-*-netbsd* would select the old
1641.34Smycroft	# object file format.  This provides both forward
1651.34Smycroft	# compatibility and a consistent mechanism for selecting the
1661.34Smycroft	# object file format.
1671.34Smycroft	#
1681.34Smycroft	# Note: NetBSD doesn't particularly care about the vendor
1691.34Smycroft	# portion of the name.  We always set it to "unknown".
1701.67Schs	sysctl="sysctl -n hw.machine_arch"
1711.67Schs	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1721.30Schristos	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1731.30Schristos	case "${UNAME_MACHINE_ARCH}" in
1741.58Sjdolecek	    armeb) machine=armeb-unknown ;;
1751.30Schristos	    arm*) machine=arm-unknown ;;
1761.30Schristos	    sh3el) machine=shl-unknown ;;
1771.70Sgehenna	    sh3eb) machine=sh-unknown ;;
1781.70Sgehenna	    sh5el) machine=sh5le-unknown ;;
1791.14Smycroft	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1801.14Smycroft	esac
1811.14Smycroft	# The Operating System including object format, if it has switched
1821.30Schristos	# to ELF recently, or will in the future.
1831.14Smycroft	case "${UNAME_MACHINE_ARCH}" in
1841.14Smycroft	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1851.32Smrg		eval $set_cc_for_build
1861.14Smycroft		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1871.32Smrg			| grep -q __ELF__
1881.70Sgehenna		then
1891.32Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1901.57Sad		    # Return netbsd for either.  FIX?
1911.54Sjdolecek		    os=netbsd
1921.54Sjdolecek		else
1931.54Sjdolecek		    os=netbsdelf
1941.54Sjdolecek		fi
1951.54Sjdolecek		;;
1961.54Sjdolecek	    *)
1971.54Sjdolecek		os=netbsd
1981.54Sjdolecek		;;
1991.54Sjdolecek	esac
2001.14Smycroft	# The OS release
2011.14Smycroft	# Debian GNU/NetBSD machines have a different userland, and
2021.48Swrstuden	# thus, need a distinct triplet. However, they do not need
2031.48Swrstuden	# kernel version information, so it can be replaced with a
2041.48Swrstuden	# suitable tag, in the style of linux-gnu.
2051.14Smycroft	case "${UNAME_VERSION}" in
2061.8Scgd	    Debian*)
2071.8Scgd		release='-gnu'
2081.8Scgd		;;
2091.8Scgd	    *)
2101.8Scgd		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
2111.8Scgd		;;
2121.17Smycroft	esac
2131.14Smycroft	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2141.8Scgd	# contains redundant information, the shorter form:
2151.8Scgd	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2161.17Smycroft	echo "${machine}-${os}${release}"
2171.8Scgd	exit ;;
2181.17Smycroft    *:Bitrig:*:*)
2191.14Smycroft	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
2201.76Sthorpej	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
2211.8Scgd	exit ;;
2221.14Smycroft    *:OpenBSD:*:*)
2231.8Scgd	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2241.8Scgd	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2251.8Scgd	exit ;;
2261.8Scgd    *:ekkoBSD:*:*)
2271.8Scgd	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2281.8Scgd	exit ;;
2291.8Scgd    *:SolidBSD:*:*)
2301.83Sperry	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2311.14Smycroft	exit ;;
2321.14Smycroft    macppc:MirBSD:*:*)
2331.55Sthorpej	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2341.8Scgd	exit ;;
2351.8Scgd    *:MirBSD:*:*)
2361.14Smycroft	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2371.1Scgd	exit ;;
2381.14Smycroft    alpha:OSF1:*:*)
2391.8Scgd	case $UNAME_RELEASE in
2401.8Scgd	*4.0)
2411.14Smycroft		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2421.14Smycroft		;;
2431.14Smycroft	*5.*)
2441.14Smycroft		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2451.14Smycroft		;;
2461.14Smycroft	esac
2471.14Smycroft	# According to Compaq, /usr/sbin/psrinfo has been available on
2481.48Swrstuden	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2491.17Smycroft	# covers most systems running today.  This code pipes the CPU
2501.8Scgd	# types through head -n 1, so we only detect the type of CPU 0.
2511.8Scgd	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2521.14Smycroft	case "$ALPHA_CPU_TYPE" in
2531.8Scgd	    "EV4 (21064)")
2541.14Smycroft		UNAME_MACHINE="alpha" ;;
2551.14Smycroft	    "EV4.5 (21064)")
2561.81Sjrf		UNAME_MACHINE="alpha" ;;
2571.8Scgd	    "LCA4 (21066/21068)")
2581.8Scgd		UNAME_MACHINE="alpha" ;;
2591.8Scgd	    "EV5 (21164)")
2601.8Scgd		UNAME_MACHINE="alphaev5" ;;
2611.1Scgd	    "EV5.6 (21164A)")
2621.1Scgd		UNAME_MACHINE="alphaev56" ;;
2631.1Scgd	    "EV5.6 (21164PC)")
2641.1Scgd		UNAME_MACHINE="alphapca56" ;;
2651.1Scgd	    "EV5.7 (21164PC)")
2661.14Smycroft		UNAME_MACHINE="alphapca57" ;;
2671.30Schristos	    "EV6 (21264)")
2681.30Schristos		UNAME_MACHINE="alphaev6" ;;
2691.30Schristos	    "EV6.7 (21264A)")
2701.14Smycroft		UNAME_MACHINE="alphaev67" ;;
2711.14Smycroft	    "EV6.8CB (21264C)")
2721.14Smycroft		UNAME_MACHINE="alphaev68" ;;
2731.14Smycroft	    "EV6.8AL (21264B)")
2741.30Schristos		UNAME_MACHINE="alphaev68" ;;
2751.14Smycroft	    "EV6.8CX (21264D)")
2761.14Smycroft		UNAME_MACHINE="alphaev68" ;;
2771.44Sfvdl	    "EV6.9A (21264/EV69A)")
2781.89Schristos		UNAME_MACHINE="alphaev69" ;;
2791.44Sfvdl	    "EV7 (21364)")
2801.89Schristos		UNAME_MACHINE="alphaev7" ;;
2811.84Schristos	    "EV7.9 (21364A)")
2821.30Schristos		UNAME_MACHINE="alphaev79" ;;
2831.1Scgd	esac
2841.1Scgd	# A Pn.n version is a patched version.
2851.84Schristos	# A Vn.n version is a released version.
2861.1Scgd	# A Tn.n version is a released field test version.
2871.44Sfvdl	# A Xn.n version is an unreleased experimental baselevel.
2881.14Smycroft	# 1.2 uses "1.2" for uname -r.
2891.44Sfvdl	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2901.1Scgd	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
2911.1Scgd	exitcode=$?
2921.1Scgd	trap '' 0
2931.8Scgd	exit $exitcode ;;
2941.8Scgd    Alpha\ *:Windows_NT*:*)
2951.8Scgd	# How do we know it's Interix rather than the generic POSIX subsystem?
2961.8Scgd	# Should we change UNAME_MACHINE based on the output of uname instead
2971.8Scgd	# of the specific Alpha model?
2981.8Scgd	echo alpha-pc-interix
2991.8Scgd	exit ;;
3001.8Scgd    21064:Windows_NT:50:3)
3011.8Scgd	echo alpha-dec-winnt3.5
3021.46Sperry	exit ;;
3031.8Scgd    Amiga*:UNIX_System_V:4.0:*)
3041.8Scgd	echo m68k-unknown-sysv4
3051.8Scgd	exit ;;
3061.14Smycroft    *:[Aa]miga[Oo][Ss]:*:*)
3071.8Scgd	echo ${UNAME_MACHINE}-unknown-amigaos
3081.48Swrstuden	exit ;;
3091.8Scgd    *:[Mm]orph[Oo][Ss]:*:*)
3101.8Scgd	echo ${UNAME_MACHINE}-unknown-morphos
3111.46Sperry	exit ;;
3121.8Scgd    *:OS/390:*:*)
3131.8Scgd	echo i370-ibm-openedition
3141.8Scgd	exit ;;
3151.8Scgd    *:z/VM:*:*)
3161.8Scgd	echo s390-ibm-zvmoe
3171.8Scgd	exit ;;
3181.8Scgd    *:OS400:*:*)
3191.8Scgd	echo powerpc-ibm-os400
3201.14Smycroft	exit ;;
3211.32Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3221.48Swrstuden	echo arm-acorn-riscix${UNAME_RELEASE}
3231.8Scgd	exit ;;
3241.8Scgd    arm*:riscos:*:*|arm*:RISCOS:*:*)
3251.8Scgd	echo arm-unknown-riscos
3261.44Sfvdl	exit ;;
3271.8Scgd    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3281.46Sperry	echo hppa1.1-hitachi-hiuxmpp
3291.8Scgd	exit ;;
3301.8Scgd    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3311.8Scgd	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3321.1Scgd	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3331.8Scgd		echo pyramid-pyramid-sysv3
3341.46Sperry	else
3351.8Scgd		echo pyramid-pyramid-bsd
3361.8Scgd	fi
3371.8Scgd	exit ;;
3381.46Sperry    NILE*:*:*:dcosx)
3391.8Scgd	echo pyramid-pyramid-svr4
3401.8Scgd	exit ;;
3411.8Scgd    DRS?6000:unix:4.0:6*)
3421.8Scgd	echo sparc-icl-nx6
3431.8Scgd	exit ;;
3441.8Scgd    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3451.8Scgd	case `/usr/bin/uname -p` in
3461.8Scgd	    sparc) echo sparc-icl-nx7; exit ;;
3471.8Scgd	esac ;;
3481.8Scgd    s390x:SunOS:*:*)
3491.84Schristos	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3501.84Schristos	exit ;;
3511.14Smycroft    sun4H:SunOS:5.*:*)
3521.8Scgd	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3531.48Swrstuden	exit ;;
3541.8Scgd    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3551.8Scgd	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3561.8Scgd	exit ;;
3571.8Scgd    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
3581.8Scgd	echo i386-pc-auroraux${UNAME_RELEASE}
3591.14Smycroft	exit ;;
3601.8Scgd    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3611.8Scgd	eval $set_cc_for_build
3621.46Sperry	SUN_ARCH="i386"
3631.48Swrstuden	# If there is a compiler, see if it is configured for 64-bit objects.
3641.48Swrstuden	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
3651.76Sthorpej	# This test works for both compilers.
3661.44Sfvdl	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
3671.44Sfvdl	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
3681.48Swrstuden		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
3691.48Swrstuden		grep IS_64BIT_ARCH >/dev/null
3701.48Swrstuden	    then
3711.48Swrstuden		SUN_ARCH="x86_64"
3721.48Swrstuden	    fi
3731.48Swrstuden	fi
3741.48Swrstuden	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3751.48Swrstuden	exit ;;
3761.8Scgd    sun4*:SunOS:6*:*)
3771.8Scgd	# According to config.sub, this is the proper way to canonicalize
3781.8Scgd	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3791.8Scgd	# it's likely to be more like Solaris than SunOS4.
3801.8Scgd	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3811.84Schristos	exit ;;
3821.8Scgd    sun4*:SunOS:*:*)
3831.8Scgd	case "`/usr/bin/arch -k`" in
3841.1Scgd	    Series*|S4*)
3851.8Scgd		UNAME_RELEASE=`uname -v`
3861.8Scgd		;;
3871.8Scgd	esac
3881.8Scgd	# Japanese Language versions have a version number like `4.1.3-JL'.
3891.1Scgd	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3901.84Schristos	exit ;;
3911.63Sthorpej    sun3*:SunOS:*:*)
3921.8Scgd	echo m68k-sun-sunos${UNAME_RELEASE}
3931.8Scgd	exit ;;
3941.8Scgd    sun*:*:4.2BSD:*)
3951.1Scgd	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3961.8Scgd	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
3971.8Scgd	case "`/bin/arch`" in
3981.8Scgd	    sun3)
3991.8Scgd		echo m68k-sun-sunos${UNAME_RELEASE}
4001.14Smycroft		;;
4011.48Swrstuden	    sun4)
4021.8Scgd		echo sparc-sun-sunos${UNAME_RELEASE}
4031.1Scgd		;;
4041.1Scgd	esac
4051.14Smycroft	exit ;;
4061.1Scgd    aushp:SunOS:*:*)
4071.48Swrstuden	echo sparc-auspex-sunos${UNAME_RELEASE}
4081.48Swrstuden	exit ;;
4091.48Swrstuden    # The situation for MiNT is a little confusing.  The machine name
4101.48Swrstuden    # can be virtually everything (everything which is not
4111.48Swrstuden    # "atarist" or "atariste" at least should have a processor
4121.48Swrstuden    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
4131.48Swrstuden    # to the lowercase version "mint" (or "freemint").  Finally
4141.48Swrstuden    # the system name "TOS" denotes a system which is actually not
4151.48Swrstuden    # MiNT.  But MiNT is downward compatible to TOS, so this should
4161.48Swrstuden    # be no problem.
4171.48Swrstuden    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4181.48Swrstuden	echo m68k-atari-mint${UNAME_RELEASE}
4191.48Swrstuden	exit ;;
4201.1Scgd    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4211.1Scgd	echo m68k-atari-mint${UNAME_RELEASE}
4221.14Smycroft	exit ;;
4231.30Schristos    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4241.30Schristos	echo m68k-atari-mint${UNAME_RELEASE}
4251.30Schristos	exit ;;
4261.14Smycroft    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4271.14Smycroft	echo m68k-milan-mint${UNAME_RELEASE}
4281.14Smycroft	exit ;;
4291.14Smycroft    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4301.89Schristos	echo m68k-hades-mint${UNAME_RELEASE}
4311.30Schristos	exit ;;
4321.14Smycroft    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4331.8Scgd	echo m68k-unknown-mint${UNAME_RELEASE}
4341.8Scgd	exit ;;
4351.8Scgd    m68k:machten:*:*)
4361.23Smycroft	echo m68k-apple-machten${UNAME_RELEASE}
4371.79Sjdolecek	exit ;;
4381.83Sperry    powerpc:machten:*:*)
4391.23Smycroft	echo powerpc-apple-machten${UNAME_RELEASE}
4401.23Smycroft	exit ;;
4411.23Smycroft    RISC*:Mach:*:*)
4421.23Smycroft	echo mips-dec-mach_bsd4.3
4431.23Smycroft	exit ;;
4441.79Sjdolecek    RISC*:ULTRIX:*:*)
4451.82Schristos	echo mips-dec-ultrix${UNAME_RELEASE}
4461.1Scgd	exit ;;
4471.8Scgd    VAX*:ULTRIX*:*:*)
4481.89Schristos	echo vax-dec-ultrix${UNAME_RELEASE}
4491.30Schristos	exit ;;
4501.30Schristos    2020:CLIX:*:* | 2430:CLIX:*:*)
4511.30Schristos	echo clipper-intergraph-clix${UNAME_RELEASE}
4521.30Schristos	exit ;;
4531.8Scgd    mips:*:*:UMIPS | mips:*:*:RISCos)
4541.1Scgd	eval $set_cc_for_build
4551.21Smycroft	sed 's/^	//' << EOF >$dummy.c
4561.1Scgd#ifdef __cplusplus
4571.1Scgd#include <stdio.h>  /* for printf() prototype */
4581.1Scgd	int main (int argc, char *argv[]) {
4591.89Schristos#else
4601.1Scgd	int main (argc, argv) int argc; char *argv[]; {
4611.1Scgd#endif
4621.1Scgd	#if defined (host_mips) && defined (MIPSEB)
4631.89Schristos	#if defined (SYSTYPE_SYSV)
4641.1Scgd	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4651.89Schristos	#endif
4661.1Scgd	#if defined (SYSTYPE_SVR4)
4671.1Scgd	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4681.8Scgd	#endif
4691.1Scgd	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4701.1Scgd	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4711.63Sthorpej	#endif
4721.1Scgd	#endif
4731.1Scgd	  exit (-1);
4741.1Scgd	}
4751.1ScgdEOF
4761.73Spk	$CC_FOR_BUILD -o $dummy $dummy.c &&
4771.89Schristos	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4781.8Scgd	  SYSTEM_NAME=`$dummy $dummyarg` &&
4791.8Scgd	    { echo "$SYSTEM_NAME"; exit; }
4801.22Smycroft	echo mips-mips-riscos${UNAME_RELEASE}
4811.22Smycroft	exit ;;
4821.8Scgd    Motorola:PowerMAX_OS:*:*)
4831.41Smycroft	echo powerpc-motorola-powermax
4841.8Scgd	exit ;;
4851.1Scgd    Motorola:*:4.3:PL8-*)
4861.1Scgd	echo powerpc-harris-powermax
4871.69Sjdolecek	exit ;;
4881.61Sjdolecek    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4891.69Sjdolecek	echo powerpc-harris-powermax
4901.89Schristos	exit ;;
4911.89Schristos    Night_Hawk:Power_UNIX:*:*)
4921.69Sjdolecek	echo powerpc-harris-powerunix
4931.69Sjdolecek	exit ;;
4941.69Sjdolecek    m88k:CX/UX:7*:*)
4951.69Sjdolecek	echo m88k-harris-cxux7
4961.69Sjdolecek	exit ;;
4971.69Sjdolecek    m88k:*:4*:R4*)
4981.69Sjdolecek	echo m88k-motorola-sysv4
4991.69Sjdolecek	exit ;;
5001.69Sjdolecek    m88k:*:3*:R3*)
5011.69Sjdolecek	echo m88k-motorola-sysv3
5021.69Sjdolecek	exit ;;
5031.69Sjdolecek    AViiON:dgux:*:*)
5041.69Sjdolecek	# DG/UX returns AViiON for all architectures
5051.69Sjdolecek	UNAME_PROCESSOR=`/usr/bin/uname -p`
5061.69Sjdolecek	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
5071.8Scgd	then
5081.69Sjdolecek	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
5091.69Sjdolecek	       [ ${TARGET_BINARY_INTERFACE}x = x ]
5101.69Sjdolecek	    then
5111.69Sjdolecek		echo m88k-dg-dgux${UNAME_RELEASE}
5121.69Sjdolecek	    else
5131.69Sjdolecek		echo m88k-dg-dguxbcs${UNAME_RELEASE}
5141.69Sjdolecek	    fi
5151.69Sjdolecek	else
5161.69Sjdolecek	    echo i586-dg-dgux${UNAME_RELEASE}
5171.69Sjdolecek	fi
5181.69Sjdolecek	exit ;;
5191.69Sjdolecek    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
5201.69Sjdolecek	echo m88k-dolphin-sysv3
5211.69Sjdolecek	exit ;;
5221.69Sjdolecek    M88*:*:R3*:*)
5231.1Scgd	# Delta 88k system running SVR3
5241.1Scgd	echo m88k-motorola-sysv3
5251.1Scgd	exit ;;
5261.1Scgd    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5271.1Scgd	echo m88k-tektronix-sysv3
5281.1Scgd	exit ;;
5291.14Smycroft    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5301.30Schristos	echo m68k-tektronix-bsd
5311.30Schristos	exit ;;
5321.30Schristos    *:IRIX*:*:*)
5331.14Smycroft	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5341.14Smycroft	exit ;;
5351.14Smycroft    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5361.14Smycroft	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5371.89Schristos	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5381.30Schristos    i*86:AIX:*:*)
5391.14Smycroft	echo i386-ibm-aix
5401.14Smycroft	exit ;;
5411.1Scgd    ia64:AIX:*:*)
5421.8Scgd	if [ -x /usr/bin/oslevel ] ; then
5431.1Scgd		IBM_REV=`/usr/bin/oslevel`
5441.8Scgd	else
5451.8Scgd		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5461.8Scgd	fi
5471.8Scgd	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5481.8Scgd	exit ;;
5491.33Smrg    *:AIX:2:3)
5501.8Scgd	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5511.8Scgd		eval $set_cc_for_build
5521.30Schristos		sed 's/^		//' << EOF >$dummy.c
5531.30Schristos		#include <sys/systemcfg.h>
5541.30Schristos
5551.30Schristos		main()
5561.8Scgd			{
5571.8Scgd			if (!__power_pc())
5581.30Schristos				exit(1);
5591.8Scgd			puts("powerpc-ibm-aix3.2.5");
5601.32Smrg			exit(0);
5611.8Scgd			}
5621.8ScgdEOF
5631.8Scgd		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5641.8Scgd		then
5651.8Scgd			echo "$SYSTEM_NAME"
5661.30Schristos		else
5671.32Smrg			echo rs6000-ibm-aix3.2.5
5681.32Smrg		fi
5691.8Scgd	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5701.8Scgd		echo rs6000-ibm-aix3.2.4
5711.8Scgd	else
5721.8Scgd		echo rs6000-ibm-aix3.2
5731.8Scgd	fi
5741.30Schristos	exit ;;
5751.8Scgd    *:AIX:*:[4567])
5761.32Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5771.8Scgd	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5781.8Scgd		IBM_ARCH=rs6000
5791.8Scgd	else
5801.8Scgd		IBM_ARCH=powerpc
5811.1Scgd	fi
5821.1Scgd	if [ -x /usr/bin/oslevel ] ; then
5831.80Schristos		IBM_REV=`/usr/bin/oslevel`
5841.1Scgd	else
5851.28Sjtc		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5861.28Sjtc	fi
5871.1Scgd	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5881.14Smycroft	exit ;;
5891.1Scgd    *:AIX:*:*)
5901.1Scgd	echo rs6000-ibm-aix
5911.1Scgd	exit ;;
5921.8Scgd    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5931.8Scgd	echo romp-ibm-bsd4.4
5941.8Scgd	exit ;;
5951.8Scgd    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5961.89Schristos	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5971.8Scgd	exit ;;                             # report: romp-ibm BSD 4.3
5981.8Scgd    *:BOSX:*:*)
5991.8Scgd	echo rs6000-bull-bosx
6001.8Scgd	exit ;;
6011.83Sperry    DPX/2?00:B.O.S.:*:*)
6021.1Scgd	echo m68k-bull-sysv3
6031.1Scgd	exit ;;
6041.1Scgd    9000/[34]??:4.3bsd:1.*:*)
6051.1Scgd	echo m68k-hp-bsd
6061.8Scgd	exit ;;
6071.1Scgd    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
6081.1Scgd	echo m68k-hp-bsd4.4
6091.1Scgd	exit ;;
6101.14Smycroft    9000/[34678]??:HP-UX:*:*)
6111.30Schristos	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6121.30Schristos	case "${UNAME_MACHINE}" in
6131.30Schristos	    9000/31? )            HP_ARCH=m68000 ;;
6141.14Smycroft	    9000/[34]?? )         HP_ARCH=m68k ;;
6151.14Smycroft	    9000/[678][0-9][0-9])
6161.14Smycroft		if [ -x /usr/bin/getconf ]; then
6171.14Smycroft		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
6181.89Schristos		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
6191.30Schristos		    case "${sc_cpu_version}" in
6201.89Schristos		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
6211.73Spk		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
6221.1Scgd		      532)                      # CPU_PA_RISC2_0
6231.1Scgd			case "${sc_kernel_bits}" in
6241.1Scgd			  32) HP_ARCH="hppa2.0n" ;;
6251.1Scgd			  64) HP_ARCH="hppa2.0w" ;;
6261.1Scgd			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
6271.14Smycroft			esac ;;
6281.8Scgd		    esac
6291.8Scgd		fi
6301.8Scgd		if [ "${HP_ARCH}" = "" ]; then
6311.8Scgd		    eval $set_cc_for_build
6321.8Scgd		    sed 's/^		//' << EOF >$dummy.c
6331.8Scgd
6341.8Scgd		#define _HPUX_SOURCE
6351.1Scgd		#include <stdlib.h>
6361.8Scgd		#include <unistd.h>
6371.1Scgd
6381.14Smycroft		int main ()
6391.73Spk		{
6401.1Scgd		#if defined(_SC_KERNEL_BITS)
6411.1Scgd		    long bits = sysconf(_SC_KERNEL_BITS);
6421.1Scgd		#endif
6431.68Sjmc		    long cpu  = sysconf (_SC_CPU_VERSION);
6441.68Sjmc
6451.68Sjmc		    switch (cpu)
6461.1Scgd			{
6471.73Spk			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6481.69Sjdolecek			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6491.1Scgd			case CPU_PA_RISC2_0:
6501.1Scgd		#if defined(_SC_KERNEL_BITS)
6511.8Scgd			    switch (bits)
6521.25Smycroft				{
6531.25Smycroft				case 64: puts ("hppa2.0w"); break;
6541.25Smycroft				case 32: puts ("hppa2.0n"); break;
6551.25Smycroft				default: puts ("hppa2.0"); break;
6561.84Schristos				} break;
6571.25Smycroft		#else  /* !defined(_SC_KERNEL_BITS) */
6581.25Smycroft			    puts ("hppa2.0"); break;
6591.25Smycroft		#endif
6601.27Smycroft			default: puts ("hppa1.0"); break;
6611.27Smycroft			}
6621.27Smycroft		    exit (0);
6631.25Smycroft		}
6641.25SmycroftEOF
6651.85Schristos		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6661.8Scgd		    test -z "$HP_ARCH" && HP_ARCH=hppa
6671.25Smycroft		fi ;;
6681.8Scgd	esac
6691.14Smycroft	if [ ${HP_ARCH} = "hppa2.0w" ]
6701.30Schristos	then
6711.30Schristos	    eval $set_cc_for_build
6721.30Schristos
6731.14Smycroft	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6741.14Smycroft	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6751.14Smycroft	    # generating 64-bit code.  GNU and HP use different nomenclature:
6761.14Smycroft	    #
6771.22Smycroft	    # $ CC_FOR_BUILD=cc ./config.guess
6781.44Sfvdl	    # => hppa2.0w-hp-hpux11.23
6791.44Sfvdl	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6801.30Schristos	    # => hppa64-hp-hpux11.23
6811.14Smycroft
6821.25Smycroft	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
6831.1Scgd		grep -q __LP64__
6841.53Ssommerfe	    then
6851.87Schristos		HP_ARCH="hppa2.0w"
6861.1Scgd	    else
6871.44Sfvdl		HP_ARCH="hppa64"
6881.87Schristos	    fi
6891.11Sws	fi
6901.14Smycroft	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6911.8Scgd	exit ;;
6921.87Schristos    ia64:HP-UX:*:*)
6931.8Scgd	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6941.8Scgd	echo ia64-hp-hpux${HPUX_REV}
6951.87Schristos	exit ;;
6961.30Schristos    3050*:HI-UX:*:*)
6971.30Schristos	eval $set_cc_for_build
6981.30Schristos	sed 's/^	//' << EOF >$dummy.c
6991.8Scgd	#include <unistd.h>
7001.1Scgd	int
7011.90Syamt	main ()
7021.8Scgd	{
7031.25Smycroft	  long cpu = sysconf (_SC_CPU_VERSION);
7041.87Schristos	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7051.26Smycroft	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7061.87Schristos	     results, however.  */
7071.25Smycroft	  if (CPU_IS_PA_RISC (cpu))
7081.25Smycroft	    {
7091.26Smycroft	      switch (cpu)
7101.87Schristos		{
7111.25Smycroft		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7121.44Sfvdl		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7131.87Schristos		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7141.87Schristos		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7151.87Schristos		}
7161.25Smycroft	    }
7171.14Smycroft	  else if (CPU_IS_HP_MC68K (cpu))
7181.25Smycroft	    puts ("m68k-hitachi-hiuxwe2");
7191.51Schristos	  else puts ("unknown-hitachi-hiuxwe2");
7201.51Schristos	  exit (0);
7211.52Ssommerfe	}
7221.3ScgdEOF
7231.44Sfvdl	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7241.44Sfvdl		{ echo "$SYSTEM_NAME"; exit; }
7251.56Sthorpej	echo unknown-hitachi-hiuxwe2
7261.44Sfvdl	exit ;;
7271.44Sfvdl    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
7281.44Sfvdl	echo hppa1.1-hp-bsd
7291.44Sfvdl	exit ;;
7301.44Sfvdl    9000/8??:4.3bsd:*:*)
7311.87Schristos	echo hppa1.0-hp-bsd
7321.87Schristos	exit ;;
7331.25Smycroft    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7341.8Scgd	echo hppa1.0-hp-mpeix
7351.90Syamt	exit ;;
7361.8Scgd    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7371.8Scgd	echo hppa1.1-hp-osf
7381.8Scgd	exit ;;
7391.8Scgd    hp8??:OSF1:*:*)
7401.8Scgd	echo hppa1.0-hp-osf
7411.8Scgd	exit ;;
7421.87Schristos    i*86:OSF1:*:*)
7431.8Scgd	if [ -x /usr/sbin/sysversion ] ; then
7441.87Schristos	    echo ${UNAME_MACHINE}-unknown-osf1mk
7451.87Schristos	else
7461.87Schristos	    echo ${UNAME_MACHINE}-unknown-osf1
7471.87Schristos	fi
7481.87Schristos	exit ;;
7491.87Schristos    parisc*:Lites*:*:*)
7501.87Schristos	echo hppa1.1-hp-lites
7511.87Schristos	exit ;;
7521.8Scgd    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7531.8Scgd	echo c1-convex-bsd
7541.8Scgd	exit ;;
7551.25Smycroft    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7561.25Smycroft	if getsysinfo -f scalar_acc
7571.25Smycroft	then echo c32-convex-bsd
7581.87Schristos	else echo c2-convex-bsd
7591.25Smycroft	fi
7601.25Smycroft	exit ;;
7611.81Sjrf    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7621.8Scgd	echo c34-convex-bsd
7631.44Sfvdl	exit ;;
7641.26Smycroft    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7651.3Scgd	echo c38-convex-bsd
7661.25Smycroft	exit ;;
7671.87Schristos    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7681.44Sfvdl	echo c4-convex-bsd
7691.87Schristos	exit ;;
7701.56Sthorpej    CRAY*Y-MP:*:*:*)
7711.56Sthorpej	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7721.44Sfvdl	exit ;;
7731.44Sfvdl    CRAY*[A-Z]90:*:*:*)
7741.44Sfvdl	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7751.87Schristos	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7761.25Smycroft	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7771.25Smycroft	      -e 's/\.[^.]*$/.X/'
7781.25Smycroft	exit ;;
7791.25Smycroft    CRAY*TS:*:*:*)
7801.25Smycroft	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7811.87Schristos	exit ;;
7821.25Smycroft    CRAY*T3E:*:*:*)
7831.25Smycroft	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7841.25Smycroft	exit ;;
7851.83Sperry    CRAY*SV1:*:*:*)
7861.25Smycroft	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7871.87Schristos	exit ;;
7881.87Schristos    *:UNICOS/mp:*:*)
7891.91Schristos	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7901.87Schristos	exit ;;
7911.25Smycroft    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7921.87Schristos	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7931.87Schristos	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7941.25Smycroft	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7951.25Smycroft	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7961.25Smycroft	exit ;;
7971.8Scgd    5000:UNIX_System_V:4.*:*)
7981.81Sjrf	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7991.1Scgd	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
8001.44Sfvdl	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
8011.26Smycroft	exit ;;
8021.1Scgd    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
8031.8Scgd	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
8041.8Scgd	exit ;;
8051.44Sfvdl    sparc*:BSD/OS:*:*)
8061.56Sthorpej	echo sparc-unknown-bsdi${UNAME_RELEASE}
8071.44Sfvdl	exit ;;
8081.44Sfvdl    *:BSD/OS:*:*)
8091.44Sfvdl	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
8101.44Sfvdl	exit ;;
8111.26Smycroft    *:FreeBSD:*:*)
8121.87Schristos	UNAME_PROCESSOR=`/usr/bin/uname -p`
8131.8Scgd	case ${UNAME_PROCESSOR} in
8141.8Scgd	    amd64)
8151.14Smycroft		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8161.30Schristos	    *)
8171.30Schristos		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8181.30Schristos	esac
8191.14Smycroft	exit ;;
8201.14Smycroft    i*:CYGWIN*:*)
8211.14Smycroft	echo ${UNAME_MACHINE}-pc-cygwin
8221.14Smycroft	exit ;;
8231.30Schristos    *:MINGW64*:*)
8241.14Smycroft	echo ${UNAME_MACHINE}-pc-mingw64
8251.8Scgd	exit ;;
8261.8Scgd    *:MINGW*:*)
8271.14Smycroft	echo ${UNAME_MACHINE}-pc-mingw32
8281.14Smycroft	exit ;;
8291.14Smycroft    i*:MSYS*:*)
8301.8Scgd	echo ${UNAME_MACHINE}-pc-msys
8311.8Scgd	exit ;;
8321.14Smycroft    i*:windows32*:*)
8331.8Scgd	# uname -m includes "-pc" on this system.
8341.8Scgd	echo ${UNAME_MACHINE}-mingw32
8351.8Scgd	exit ;;
8361.8Scgd    i*:PW*:*)
8371.8Scgd	echo ${UNAME_MACHINE}-pc-pw32
8381.8Scgd	exit ;;
8391.8Scgd    *:Interix*:*)
8401.14Smycroft	case ${UNAME_MACHINE} in
8411.30Schristos	    x86)
8421.30Schristos		echo i586-pc-interix${UNAME_RELEASE}
8431.30Schristos		exit ;;
8441.14Smycroft	    authenticamd | genuineintel | EM64T)
8451.14Smycroft		echo x86_64-unknown-interix${UNAME_RELEASE}
8461.14Smycroft		exit ;;
8471.14Smycroft	    IA64)
8481.14Smycroft		echo ia64-unknown-interix${UNAME_RELEASE}
8491.30Schristos		exit ;;
8501.8Scgd	esac ;;
8511.49Sthorpej    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
8521.8Scgd	echo i${UNAME_MACHINE}-pc-mks
8531.49Sthorpej	exit ;;
8541.8Scgd    8664:Windows_NT:*)
8551.49Sthorpej	echo x86_64-pc-mks
8561.70Sgehenna	exit ;;
8571.49Sthorpej    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
8581.8Scgd	# How do we know it's Interix rather than the generic POSIX subsystem?
8591.8Scgd	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8601.8Scgd	# UNAME_MACHINE based on the output of uname instead of i386?
8611.8Scgd	echo i586-pc-interix
8621.8Scgd	exit ;;
8631.8Scgd    i*:UWIN*:*)
8641.83Sperry	echo ${UNAME_MACHINE}-pc-uwin
8651.8Scgd	exit ;;
8661.8Scgd    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8671.8Scgd	echo x86_64-unknown-cygwin
8681.14Smycroft	exit ;;
8691.30Schristos    p*:CYGWIN*:*)
8701.30Schristos	echo powerpcle-unknown-cygwin
8711.30Schristos	exit ;;
8721.14Smycroft    prep*:SunOS:5.*:*)
8731.14Smycroft	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8741.14Smycroft	exit ;;
8751.14Smycroft    *:GNU:*:*)
8761.14Smycroft	# the GNU system
8771.30Schristos	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8781.8Scgd	exit ;;
8791.49Sthorpej    *:GNU/*:*:*)
8801.8Scgd	# other systems with GNU libc and userland
8811.49Sthorpej	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
8821.8Scgd	exit ;;
8831.49Sthorpej    i*86:Minix:*:*)
8841.70Sgehenna	echo ${UNAME_MACHINE}-pc-minix
8851.70Sgehenna	exit ;;
8861.49Sthorpej    aarch64:Linux:*:*)
8871.8Scgd	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
8881.8Scgd	exit ;;
8891.8Scgd    aarch64_be:Linux:*:*)
8901.8Scgd	UNAME_MACHINE=aarch64_be
8911.8Scgd	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
8921.8Scgd	exit ;;
8931.83Sperry    alpha:Linux:*:*)
8941.8Scgd	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
8951.8Scgd	  EV5)   UNAME_MACHINE=alphaev5 ;;
8961.8Scgd	  EV56)  UNAME_MACHINE=alphaev56 ;;
8971.14Smycroft	  PCA56) UNAME_MACHINE=alphapca56 ;;
8981.30Schristos	  PCA57) UNAME_MACHINE=alphapca56 ;;
8991.30Schristos	  EV6)   UNAME_MACHINE=alphaev6 ;;
9001.30Schristos	  EV67)  UNAME_MACHINE=alphaev67 ;;
9011.14Smycroft	  EV68*) UNAME_MACHINE=alphaev68 ;;
9021.14Smycroft	esac
9031.19Scgd	objdump --private-headers /bin/sh | grep -q ld.so.1
9041.81Sjrf	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
9051.14Smycroft	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9061.14Smycroft	exit ;;
9071.89Schristos    arc:Linux:*:* | arceb:Linux:*:*)
9081.30Schristos	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9091.8Scgd	exit ;;
9101.8Scgd    arm*:Linux:*:*)
9111.14Smycroft	eval $set_cc_for_build
9121.8Scgd	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
9131.70Sgehenna	    | grep -q __ARM_EABI__
9141.70Sgehenna	then
9151.89Schristos	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9161.8Scgd	else
9171.8Scgd	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
9181.8Scgd		| grep -q __ARM_PCS_VFP
9191.8Scgd	    then
9201.8Scgd		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
9211.1Scgd	    else
9221.83Sperry		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
9231.8Scgd	    fi
9241.8Scgd	fi
9251.8Scgd	exit ;;
9261.14Smycroft    avr32*:Linux:*:*)
9271.35Smycroft	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9281.30Schristos	exit ;;
9291.30Schristos    cris:Linux:*:*)
9301.35Smycroft	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
9311.14Smycroft	exit ;;
9321.35Smycroft    crisv32:Linux:*:*)
9331.89Schristos	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
9341.30Schristos	exit ;;
9351.35Smycroft    frv:Linux:*:*)
9361.8Scgd	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9371.14Smycroft	exit ;;
9381.8Scgd    hexagon:Linux:*:*)
9391.89Schristos	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9401.8Scgd	exit ;;
9411.1Scgd    i*86:Linux:*:*)
9421.8Scgd	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
9431.35Smycroft	exit ;;
9441.8Scgd    ia64:Linux:*:*)
9451.8Scgd	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9461.34Smycroft	exit ;;
9471.35Smycroft    m32r*:Linux:*:*)
9481.71Sjdolecek	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9491.71Sjdolecek	exit ;;
9501.71Sjdolecek    m68*:Linux:*:*)
9511.71Sjdolecek	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9521.71Sjdolecek	exit ;;
9531.71Sjdolecek    mips:Linux:*:* | mips64:Linux:*:*)
9541.71Sjdolecek	eval $set_cc_for_build
9551.71Sjdolecek	sed 's/^	//' << EOF >$dummy.c
9561.71Sjdolecek	#undef CPU
9571.71Sjdolecek	#undef ${UNAME_MACHINE}
9581.71Sjdolecek	#undef ${UNAME_MACHINE}el
9591.71Sjdolecek	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
9601.89Schristos	CPU=${UNAME_MACHINE}el
9611.71Sjdolecek	#else
9621.71Sjdolecek	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9631.71Sjdolecek	CPU=${UNAME_MACHINE}
9641.71Sjdolecek	#else
9651.71Sjdolecek	CPU=
9661.71Sjdolecek	#endif
9671.71Sjdolecek	#endif
9681.71SjdolecekEOF
9691.71Sjdolecek	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
9701.89Schristos	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
9711.89Schristos	;;
9721.71Sjdolecek    or1k:Linux:*:*)
9731.71Sjdolecek	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9741.83Sperry	exit ;;
9751.71Sjdolecek    or32:Linux:*:*)
9761.71Sjdolecek	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9771.89Schristos	exit ;;
9781.71Sjdolecek    padre:Linux:*:*)
9791.71Sjdolecek	echo sparc-unknown-linux-${LIBC}
9801.71Sjdolecek	exit ;;
9811.71Sjdolecek    parisc64:Linux:*:* | hppa64:Linux:*:*)
9821.71Sjdolecek	echo hppa64-unknown-linux-${LIBC}
9831.71Sjdolecek	exit ;;
9841.71Sjdolecek    parisc:Linux:*:* | hppa:Linux:*:*)
9851.1Scgd	# Look for CPU level
9861.1Scgd	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9871.14Smycroft	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
9881.30Schristos	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
9891.30Schristos	  *)    echo hppa-unknown-linux-${LIBC} ;;
9901.30Schristos	esac
9911.14Smycroft	exit ;;
9921.14Smycroft    ppc64:Linux:*:*)
9931.89Schristos	echo powerpc64-unknown-linux-${LIBC}
9941.30Schristos	exit ;;
9951.14Smycroft    ppc:Linux:*:*)
9961.14Smycroft	echo powerpc-unknown-linux-${LIBC}
9971.1Scgd	exit ;;
9981.1Scgd    ppc64le:Linux:*:*)
9991.1Scgd	echo powerpc64le-unknown-linux-${LIBC}
10001.1Scgd	exit ;;
10011.44Sfvdl    ppcle:Linux:*:*)
10021.1Scgd	echo powerpcle-unknown-linux-${LIBC}
10031.1Scgd	exit ;;
10041.1Scgd    s390:Linux:*:* | s390x:Linux:*:*)
10051.1Scgd	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
10061.14Smycroft	exit ;;
10071.30Schristos    sh64*:Linux:*:*)
10081.30Schristos	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10091.30Schristos	exit ;;
10101.14Smycroft    sh*:Linux:*:*)
10111.14Smycroft	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10121.30Schristos	exit ;;
10131.14Smycroft    sparc:Linux:*:* | sparc64:Linux:*:*)
10141.17Smycroft	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10151.14Smycroft	exit ;;
10161.17Smycroft    tile*:Linux:*:*)
10171.14Smycroft	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10181.14Smycroft	exit ;;
10191.14Smycroft    vax:Linux:*:*)
10201.14Smycroft	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
10211.14Smycroft	exit ;;
10221.14Smycroft    x86_64:Linux:*:*)
10231.14Smycroft	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10241.14Smycroft	exit ;;
10251.14Smycroft    xtensa*:Linux:*:*)
10261.30Schristos	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10271.30Schristos	exit ;;
10281.30Schristos    i*86:DYNIX/ptx:4*:*)
10291.30Schristos	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10301.14Smycroft	# earlier versions are messed up and put the nodename in both
10311.14Smycroft	# sysname and nodename.
10321.14Smycroft	echo i386-sequent-sysv4
10331.18Scgd	exit ;;
10341.30Schristos    i*86:UNIX_SV:4.2MP:2.*)
10351.8Scgd	# Unixware is an offshoot of SVR4, but it has its own version
10361.14Smycroft	# number series starting with 2...
10371.14Smycroft	# I am not positive that other SVR4 systems won't match this,
10381.14Smycroft	# I just have to hope.  -- rms.
10391.14Smycroft	# Use sysv4.2uw... so that sysv4* matches it.
10401.14Smycroft	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10411.14Smycroft	exit ;;
10421.14Smycroft    i*86:OS/2:*:*)
10431.14Smycroft	# If we were able to find `uname', then EMX Unix compatibility
10441.14Smycroft	# is probably installed.
10451.14Smycroft	echo ${UNAME_MACHINE}-pc-os2-emx
10461.14Smycroft	exit ;;
10471.14Smycroft    i*86:XTS-300:*:STOP)
10481.14Smycroft	echo ${UNAME_MACHINE}-unknown-stop
10491.14Smycroft	exit ;;
10501.14Smycroft    i*86:atheos:*:*)
10511.14Smycroft	echo ${UNAME_MACHINE}-unknown-atheos
10521.14Smycroft	exit ;;
10531.14Smycroft    i*86:syllable:*:*)
10541.45Skleink	echo ${UNAME_MACHINE}-pc-syllable
10551.45Skleink	exit ;;
10561.45Skleink    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
10571.14Smycroft	echo i386-unknown-lynxos${UNAME_RELEASE}
10581.14Smycroft	exit ;;
10591.14Smycroft    i*86:*DOS:*:*)
10601.8Scgd	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10611.14Smycroft	exit ;;
10621.8Scgd    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10631.8Scgd	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10641.1Scgd	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10651.1Scgd		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10661.1Scgd	else
10671.1Scgd		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10681.14Smycroft	fi
10691.30Schristos	exit ;;
10701.30Schristos    i*86:*:5:[678]*)
10711.1Scgd	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10721.37Schristos	case `/bin/uname -X | grep "^Machine"` in
10731.14Smycroft	    *486*)	     UNAME_MACHINE=i486 ;;
10741.14Smycroft	    *Pentium)	     UNAME_MACHINE=i586 ;;
10751.14Smycroft	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10761.14Smycroft	esac
10771.83Sperry	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10781.30Schristos	exit ;;
10791.30Schristos    i*86:*:3.2:*)
10801.29Smycroft	if test -f /usr/options/cb.name; then
10811.29Smycroft		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
10821.83Sperry		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
10831.29Smycroft	elif /bin/uname -X 2>/dev/null >/dev/null ; then
10841.30Schristos		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10851.83Sperry		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10861.29Smycroft		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
10871.29Smycroft			&& UNAME_MACHINE=i586
10881.29Smycroft		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
10891.29Smycroft			&& UNAME_MACHINE=i686
10901.29Smycroft		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10911.29Smycroft			&& UNAME_MACHINE=i686
10921.30Schristos		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
10931.30Schristos	else
10941.30Schristos		echo ${UNAME_MACHINE}-pc-sysv32
10951.29Smycroft	fi
10961.29Smycroft	exit ;;
10971.29Smycroft    pc:*:*:*)
10981.29Smycroft	# Left here for compatibility:
10991.29Smycroft	# uname -m prints for DJGPP always 'pc', but it prints nothing about
11001.29Smycroft	# the processor, so we play safe by assuming i586.
11011.30Schristos	# Note: whatever this is, it MUST be the same as what config.sub
11021.83Sperry	# prints for the "djgpp" host, or else GDB configury will decide that
11031.29Smycroft	# this is a cross-build.
11041.29Smycroft	echo i586-pc-msdosdjgpp
11051.29Smycroft	exit ;;
11061.1Scgd    Intel:Mach:3*:*)
1107	echo i386-pc-mach3
1108	exit ;;
1109    paragon:*:*:*)
1110	echo i860-intel-osf1
1111	exit ;;
1112    i860:*:4.*:*) # i860-SVR4
1113	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1114	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1115	else # Add other i860-SVR4 vendors below as they are discovered.
1116	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1117	fi
1118	exit ;;
1119    mini*:CTIX:SYS*5:*)
1120	# "miniframe"
1121	echo m68010-convergent-sysv
1122	exit ;;
1123    mc68k:UNIX:SYSTEM5:3.51m)
1124	echo m68k-convergent-sysv
1125	exit ;;
1126    M680?0:D-NIX:5.3:*)
1127	echo m68k-diab-dnix
1128	exit ;;
1129    M68*:*:R3V[5678]*:*)
1130	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1131    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1132	OS_REL=''
1133	test -r /etc/.relid \
1134	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1135	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1136	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1137	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1138	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1139    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1140	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1141	  && { echo i486-ncr-sysv4; exit; } ;;
1142    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1143	OS_REL='.3'
1144	test -r /etc/.relid \
1145	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1146	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1147	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1148	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1149	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1150	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1151	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1152    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1153	echo m68k-unknown-lynxos${UNAME_RELEASE}
1154	exit ;;
1155    mc68030:UNIX_System_V:4.*:*)
1156	echo m68k-atari-sysv4
1157	exit ;;
1158    TSUNAMI:LynxOS:2.*:*)
1159	echo sparc-unknown-lynxos${UNAME_RELEASE}
1160	exit ;;
1161    rs6000:LynxOS:2.*:*)
1162	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1163	exit ;;
1164    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1165	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1166	exit ;;
1167    SM[BE]S:UNIX_SV:*:*)
1168	echo mips-dde-sysv${UNAME_RELEASE}
1169	exit ;;
1170    RM*:ReliantUNIX-*:*:*)
1171	echo mips-sni-sysv4
1172	exit ;;
1173    RM*:SINIX-*:*:*)
1174	echo mips-sni-sysv4
1175	exit ;;
1176    *:SINIX-*:*:*)
1177	if uname -p 2>/dev/null >/dev/null ; then
1178		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1179		echo ${UNAME_MACHINE}-sni-sysv4
1180	else
1181		echo ns32k-sni-sysv
1182	fi
1183	exit ;;
1184    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1185			# says <Richard.M.Bartel@ccMail.Census.GOV>
1186	echo i586-unisys-sysv4
1187	exit ;;
1188    *:UNIX_System_V:4*:FTX*)
1189	# From Gerald Hewes <hewes@openmarket.com>.
1190	# How about differentiating between stratus architectures? -djm
1191	echo hppa1.1-stratus-sysv4
1192	exit ;;
1193    *:*:*:FTX*)
1194	# From seanf@swdc.stratus.com.
1195	echo i860-stratus-sysv4
1196	exit ;;
1197    i*86:VOS:*:*)
1198	# From Paul.Green@stratus.com.
1199	echo ${UNAME_MACHINE}-stratus-vos
1200	exit ;;
1201    *:VOS:*:*)
1202	# From Paul.Green@stratus.com.
1203	echo hppa1.1-stratus-vos
1204	exit ;;
1205    mc68*:A/UX:*:*)
1206	echo m68k-apple-aux${UNAME_RELEASE}
1207	exit ;;
1208    news*:NEWS-OS:6*:*)
1209	echo mips-sony-newsos6
1210	exit ;;
1211    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1212	if [ -d /usr/nec ]; then
1213		echo mips-nec-sysv${UNAME_RELEASE}
1214	else
1215		echo mips-unknown-sysv${UNAME_RELEASE}
1216	fi
1217	exit ;;
1218    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1219	echo powerpc-be-beos
1220	exit ;;
1221    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1222	echo powerpc-apple-beos
1223	exit ;;
1224    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1225	echo i586-pc-beos
1226	exit ;;
1227    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1228	echo i586-pc-haiku
1229	exit ;;
1230    x86_64:Haiku:*:*)
1231	echo x86_64-unknown-haiku
1232	exit ;;
1233    SX-4:SUPER-UX:*:*)
1234	echo sx4-nec-superux${UNAME_RELEASE}
1235	exit ;;
1236    SX-5:SUPER-UX:*:*)
1237	echo sx5-nec-superux${UNAME_RELEASE}
1238	exit ;;
1239    SX-6:SUPER-UX:*:*)
1240	echo sx6-nec-superux${UNAME_RELEASE}
1241	exit ;;
1242    SX-7:SUPER-UX:*:*)
1243	echo sx7-nec-superux${UNAME_RELEASE}
1244	exit ;;
1245    SX-8:SUPER-UX:*:*)
1246	echo sx8-nec-superux${UNAME_RELEASE}
1247	exit ;;
1248    SX-8R:SUPER-UX:*:*)
1249	echo sx8r-nec-superux${UNAME_RELEASE}
1250	exit ;;
1251    Power*:Rhapsody:*:*)
1252	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1253	exit ;;
1254    *:Rhapsody:*:*)
1255	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1256	exit ;;
1257    *:Darwin:*:*)
1258	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1259	eval $set_cc_for_build
1260	if test "$UNAME_PROCESSOR" = unknown ; then
1261	    UNAME_PROCESSOR=powerpc
1262	fi
1263	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1264	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1265		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1266		grep IS_64BIT_ARCH >/dev/null
1267	    then
1268		case $UNAME_PROCESSOR in
1269		    i386) UNAME_PROCESSOR=x86_64 ;;
1270		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1271		esac
1272	    fi
1273	fi
1274	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1275	exit ;;
1276    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1277	UNAME_PROCESSOR=`uname -p`
1278	if test "$UNAME_PROCESSOR" = "x86"; then
1279		UNAME_PROCESSOR=i386
1280		UNAME_MACHINE=pc
1281	fi
1282	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1283	exit ;;
1284    *:QNX:*:4*)
1285	echo i386-pc-qnx
1286	exit ;;
1287    NEO-?:NONSTOP_KERNEL:*:*)
1288	echo neo-tandem-nsk${UNAME_RELEASE}
1289	exit ;;
1290    NSE-*:NONSTOP_KERNEL:*:*)
1291	echo nse-tandem-nsk${UNAME_RELEASE}
1292	exit ;;
1293    NSR-?:NONSTOP_KERNEL:*:*)
1294	echo nsr-tandem-nsk${UNAME_RELEASE}
1295	exit ;;
1296    *:NonStop-UX:*:*)
1297	echo mips-compaq-nonstopux
1298	exit ;;
1299    BS2000:POSIX*:*:*)
1300	echo bs2000-siemens-sysv
1301	exit ;;
1302    DS/*:UNIX_System_V:*:*)
1303	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1304	exit ;;
1305    *:Plan9:*:*)
1306	# "uname -m" is not consistent, so use $cputype instead. 386
1307	# is converted to i386 for consistency with other x86
1308	# operating systems.
1309	if test "$cputype" = "386"; then
1310	    UNAME_MACHINE=i386
1311	else
1312	    UNAME_MACHINE="$cputype"
1313	fi
1314	echo ${UNAME_MACHINE}-unknown-plan9
1315	exit ;;
1316    *:TOPS-10:*:*)
1317	echo pdp10-unknown-tops10
1318	exit ;;
1319    *:TENEX:*:*)
1320	echo pdp10-unknown-tenex
1321	exit ;;
1322    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1323	echo pdp10-dec-tops20
1324	exit ;;
1325    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1326	echo pdp10-xkl-tops20
1327	exit ;;
1328    *:TOPS-20:*:*)
1329	echo pdp10-unknown-tops20
1330	exit ;;
1331    *:ITS:*:*)
1332	echo pdp10-unknown-its
1333	exit ;;
1334    SEI:*:*:SEIUX)
1335	echo mips-sei-seiux${UNAME_RELEASE}
1336	exit ;;
1337    *:DragonFly:*:*)
1338	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1339	exit ;;
1340    *:*VMS:*:*)
1341	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1342	case "${UNAME_MACHINE}" in
1343	    A*) echo alpha-dec-vms ; exit ;;
1344	    I*) echo ia64-dec-vms ; exit ;;
1345	    V*) echo vax-dec-vms ; exit ;;
1346	esac ;;
1347    *:XENIX:*:SysV)
1348	echo i386-pc-xenix
1349	exit ;;
1350    i*86:skyos:*:*)
1351	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1352	exit ;;
1353    i*86:rdos:*:*)
1354	echo ${UNAME_MACHINE}-pc-rdos
1355	exit ;;
1356    i*86:AROS:*:*)
1357	echo ${UNAME_MACHINE}-pc-aros
1358	exit ;;
1359    x86_64:VMkernel:*:*)
1360	echo ${UNAME_MACHINE}-unknown-esx
1361	exit ;;
1362esac
1363
1364eval $set_cc_for_build
1365cat >$dummy.c <<EOF
1366#ifdef _SEQUENT_
1367# include <sys/types.h>
1368# include <sys/utsname.h>
1369#endif
1370main ()
1371{
1372#if defined (sony)
1373#if defined (MIPSEB)
1374  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1375     I don't know....  */
1376  printf ("mips-sony-bsd\n"); exit (0);
1377#else
1378#include <sys/param.h>
1379  printf ("m68k-sony-newsos%s\n",
1380#ifdef NEWSOS4
1381	"4"
1382#else
1383	""
1384#endif
1385	); exit (0);
1386#endif
1387#endif
1388
1389#if defined (__arm) && defined (__acorn) && defined (__unix)
1390  printf ("arm-acorn-riscix\n"); exit (0);
1391#endif
1392
1393#if defined (hp300) && !defined (hpux)
1394  printf ("m68k-hp-bsd\n"); exit (0);
1395#endif
1396
1397#if defined (NeXT)
1398#if !defined (__ARCHITECTURE__)
1399#define __ARCHITECTURE__ "m68k"
1400#endif
1401  int version;
1402  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1403  if (version < 4)
1404    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1405  else
1406    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1407  exit (0);
1408#endif
1409
1410#if defined (MULTIMAX) || defined (n16)
1411#if defined (UMAXV)
1412  printf ("ns32k-encore-sysv\n"); exit (0);
1413#else
1414#if defined (CMU)
1415  printf ("ns32k-encore-mach\n"); exit (0);
1416#else
1417  printf ("ns32k-encore-bsd\n"); exit (0);
1418#endif
1419#endif
1420#endif
1421
1422#if defined (__386BSD__)
1423  printf ("i386-pc-bsd\n"); exit (0);
1424#endif
1425
1426#if defined (sequent)
1427#if defined (i386)
1428  printf ("i386-sequent-dynix\n"); exit (0);
1429#endif
1430#if defined (ns32000)
1431  printf ("ns32k-sequent-dynix\n"); exit (0);
1432#endif
1433#endif
1434
1435#if defined (_SEQUENT_)
1436    struct utsname un;
1437
1438    uname(&un);
1439
1440    if (strncmp(un.version, "V2", 2) == 0) {
1441	printf ("i386-sequent-ptx2\n"); exit (0);
1442    }
1443    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1444	printf ("i386-sequent-ptx1\n"); exit (0);
1445    }
1446    printf ("i386-sequent-ptx\n"); exit (0);
1447
1448#endif
1449
1450#if defined (vax)
1451# if !defined (ultrix)
1452#  include <sys/param.h>
1453#  if defined (BSD)
1454#   if BSD == 43
1455      printf ("vax-dec-bsd4.3\n"); exit (0);
1456#   else
1457#    if BSD == 199006
1458      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1459#    else
1460      printf ("vax-dec-bsd\n"); exit (0);
1461#    endif
1462#   endif
1463#  else
1464    printf ("vax-dec-bsd\n"); exit (0);
1465#  endif
1466# else
1467    printf ("vax-dec-ultrix\n"); exit (0);
1468# endif
1469#endif
1470
1471#if defined (alliant) && defined (i860)
1472  printf ("i860-alliant-bsd\n"); exit (0);
1473#endif
1474
1475  exit (1);
1476}
1477EOF
1478
1479$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1480	{ echo "$SYSTEM_NAME"; exit; }
1481
1482# Apollos put the system type in the environment.
1483
1484test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1485
1486# Convex versions that predate uname can use getsysinfo(1)
1487
1488if [ -x /usr/convex/getsysinfo ]
1489then
1490    case `getsysinfo -f cpu_type` in
1491    c1*)
1492	echo c1-convex-bsd
1493	exit ;;
1494    c2*)
1495	if getsysinfo -f scalar_acc
1496	then echo c32-convex-bsd
1497	else echo c2-convex-bsd
1498	fi
1499	exit ;;
1500    c34*)
1501	echo c34-convex-bsd
1502	exit ;;
1503    c38*)
1504	echo c38-convex-bsd
1505	exit ;;
1506    c4*)
1507	echo c4-convex-bsd
1508	exit ;;
1509    esac
1510fi
1511
1512cat >&2 <<EOF
1513$0: unable to guess system type
1514
1515This script, last modified $timestamp, has failed to recognize
1516the operating system you are using. It is advised that you
1517download the most up to date version of the config scripts from
1518
1519  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1520and
1521  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1522
1523If the version you run ($0) is already up to date, please
1524send the following data and any information you think might be
1525pertinent to <config-patches@gnu.org> in order to provide the needed
1526information to handle your system.
1527
1528config.guess timestamp = $timestamp
1529
1530uname -m = `(uname -m) 2>/dev/null || echo unknown`
1531uname -r = `(uname -r) 2>/dev/null || echo unknown`
1532uname -s = `(uname -s) 2>/dev/null || echo unknown`
1533uname -v = `(uname -v) 2>/dev/null || echo unknown`
1534
1535/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1536/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1537
1538hostinfo               = `(hostinfo) 2>/dev/null`
1539/bin/universe          = `(/bin/universe) 2>/dev/null`
1540/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1541/bin/arch              = `(/bin/arch) 2>/dev/null`
1542/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1543/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1544
1545UNAME_MACHINE = ${UNAME_MACHINE}
1546UNAME_RELEASE = ${UNAME_RELEASE}
1547UNAME_SYSTEM  = ${UNAME_SYSTEM}
1548UNAME_VERSION = ${UNAME_VERSION}
1549EOF
1550
1551exit 1
1552
1553# Local variables:
1554# eval: (add-hook 'write-file-hooks 'time-stamp)
1555# time-stamp-start: "timestamp='"
1556# time-stamp-format: "%:y-%02m-%02d"
1557# time-stamp-end: "'"
1558# End:
1559