config.guess revision 9d0b5e55
16c321187Smrg#! /bin/sh
26c321187Smrg# Attempt to guess a canonical system name.
39d0b5e55Smrg#   Copyright 1992-2013 Free Software Foundation, Inc.
46c321187Smrg
59d0b5e55Smrgtimestamp='2013-06-10'
66c321187Smrg
76c321187Smrg# This file is free software; you can redistribute it and/or modify it
86c321187Smrg# under the terms of the GNU General Public License as published by
99d0b5e55Smrg# the Free Software Foundation; either version 3 of the License, or
106c321187Smrg# (at your option) any later version.
116c321187Smrg#
126c321187Smrg# This program is distributed in the hope that it will be useful, but
136c321187Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
146c321187Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
156c321187Smrg# General Public License for more details.
166c321187Smrg#
176c321187Smrg# You should have received a copy of the GNU General Public License
189d0b5e55Smrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
196c321187Smrg#
206c321187Smrg# As a special exception to the GNU General Public License, if you
216c321187Smrg# distribute this file as part of a program that contains a
226c321187Smrg# configuration script generated by Autoconf, you may include it under
239d0b5e55Smrg# the same distribution terms that you use for the rest of that
249d0b5e55Smrg# program.  This Exception is an additional permission under section 7
259d0b5e55Smrg# of the GNU General Public License, version 3 ("GPLv3").
266c321187Smrg#
279d0b5e55Smrg# Originally written by Per Bothner.
286c321187Smrg#
29e120bd27Smrg# You can get the latest version of this script from:
30e120bd27Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
319d0b5e55Smrg#
329d0b5e55Smrg# Please send patches with a ChangeLog entry to config-patches@gnu.org.
339d0b5e55Smrg
346c321187Smrg
356c321187Smrgme=`echo "$0" | sed -e 's,.*/,,'`
366c321187Smrg
376c321187Smrgusage="\
386c321187SmrgUsage: $0 [OPTION]
396c321187Smrg
406c321187SmrgOutput the configuration name of the system \`$me' is run on.
416c321187Smrg
426c321187SmrgOperation modes:
436c321187Smrg  -h, --help         print this help, then exit
446c321187Smrg  -t, --time-stamp   print date of last modification, then exit
456c321187Smrg  -v, --version      print version number, then exit
466c321187Smrg
476c321187SmrgReport bugs and patches to <config-patches@gnu.org>."
486c321187Smrg
496c321187Smrgversion="\
506c321187SmrgGNU config.guess ($timestamp)
516c321187Smrg
526c321187SmrgOriginally written by Per Bothner.
539d0b5e55SmrgCopyright 1992-2013 Free Software Foundation, Inc.
546c321187Smrg
556c321187SmrgThis is free software; see the source for copying conditions.  There is NO
566c321187Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
576c321187Smrg
586c321187Smrghelp="
596c321187SmrgTry \`$me --help' for more information."
606c321187Smrg
616c321187Smrg# Parse command line
626c321187Smrgwhile test $# -gt 0 ; do
636c321187Smrg  case $1 in
646c321187Smrg    --time-stamp | --time* | -t )
656c321187Smrg       echo "$timestamp" ; exit ;;
666c321187Smrg    --version | -v )
676c321187Smrg       echo "$version" ; exit ;;
686c321187Smrg    --help | --h* | -h )
696c321187Smrg       echo "$usage"; exit ;;
706c321187Smrg    -- )     # Stop option processing
716c321187Smrg       shift; break ;;
726c321187Smrg    - )	# Use stdin as input.
736c321187Smrg       break ;;
746c321187Smrg    -* )
756c321187Smrg       echo "$me: invalid option $1$help" >&2
766c321187Smrg       exit 1 ;;
776c321187Smrg    * )
786c321187Smrg       break ;;
796c321187Smrg  esac
806c321187Smrgdone
816c321187Smrg
826c321187Smrgif test $# != 0; then
836c321187Smrg  echo "$me: too many arguments$help" >&2
846c321187Smrg  exit 1
856c321187Smrgfi
866c321187Smrg
879d0b5e55Smrgtrap 'exit 1' 1 2 15
886c321187Smrg
896c321187Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
906c321187Smrg# compiler to aid in system detection is discouraged as it requires
916c321187Smrg# temporary files to be created and, as you can see below, it is a
926c321187Smrg# headache to deal with in a portable fashion.
936c321187Smrg
946c321187Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
956c321187Smrg# use `HOST_CC' if defined, but it is deprecated.
966c321187Smrg
976c321187Smrg# Portable tmp directory creation inspired by the Autoconf team.
986c321187Smrg
996c321187Smrgset_cc_for_build='
1006c321187Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1019d0b5e55Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1026c321187Smrg: ${TMPDIR=/tmp} ;
10393493779Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1046c321187Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1056c321187Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1066c321187Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1076c321187Smrgdummy=$tmp/dummy ;
1086c321187Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1096c321187Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1106c321187Smrg ,,)    echo "int x;" > $dummy.c ;
1116c321187Smrg	for c in cc gcc c89 c99 ; do
1126c321187Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1136c321187Smrg	     CC_FOR_BUILD="$c"; break ;
1146c321187Smrg	  fi ;
1156c321187Smrg	done ;
1166c321187Smrg	if test x"$CC_FOR_BUILD" = x ; then
1176c321187Smrg	  CC_FOR_BUILD=no_compiler_found ;
1186c321187Smrg	fi
1196c321187Smrg	;;
1206c321187Smrg ,,*)   CC_FOR_BUILD=$CC ;;
1216c321187Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1226c321187Smrgesac ; set_cc_for_build= ;'
1236c321187Smrg
1246c321187Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1256c321187Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
1266c321187Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1276c321187Smrg	PATH=$PATH:/.attbin ; export PATH
1286c321187Smrgfi
1296c321187Smrg
1306c321187SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1316c321187SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1326c321187SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1336c321187SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1346c321187Smrg
1359d0b5e55Smrgcase "${UNAME_SYSTEM}" in
1369d0b5e55SmrgLinux|GNU|GNU/*)
1379d0b5e55Smrg	# If the system lacks a compiler, then just pick glibc.
1389d0b5e55Smrg	# We could probably try harder.
1399d0b5e55Smrg	LIBC=gnu
1409d0b5e55Smrg
1419d0b5e55Smrg	eval $set_cc_for_build
1429d0b5e55Smrg	cat <<-EOF > $dummy.c
1439d0b5e55Smrg	#include <features.h>
1449d0b5e55Smrg	#if defined(__UCLIBC__)
1459d0b5e55Smrg	LIBC=uclibc
1469d0b5e55Smrg	#elif defined(__dietlibc__)
1479d0b5e55Smrg	LIBC=dietlibc
1489d0b5e55Smrg	#else
1499d0b5e55Smrg	LIBC=gnu
1509d0b5e55Smrg	#endif
1519d0b5e55Smrg	EOF
1529d0b5e55Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
1539d0b5e55Smrg	;;
1549d0b5e55Smrgesac
1559d0b5e55Smrg
1566c321187Smrg# Note: order is significant - the case branches are not exclusive.
1576c321187Smrg
1586c321187Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1596c321187Smrg    *:NetBSD:*:*)
1606c321187Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
1619d0b5e55Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
1626c321187Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1636c321187Smrg	# switched to ELF, *-*-netbsd* would select the old
1646c321187Smrg	# object file format.  This provides both forward
1656c321187Smrg	# compatibility and a consistent mechanism for selecting the
1666c321187Smrg	# object file format.
1676c321187Smrg	#
1686c321187Smrg	# Note: NetBSD doesn't particularly care about the vendor
1696c321187Smrg	# portion of the name.  We always set it to "unknown".
1706c321187Smrg	sysctl="sysctl -n hw.machine_arch"
1716c321187Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1726c321187Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1736c321187Smrg	case "${UNAME_MACHINE_ARCH}" in
1746c321187Smrg	    armeb) machine=armeb-unknown ;;
1756c321187Smrg	    arm*) machine=arm-unknown ;;
1766c321187Smrg	    sh3el) machine=shl-unknown ;;
1776c321187Smrg	    sh3eb) machine=sh-unknown ;;
17893493779Smrg	    sh5el) machine=sh5le-unknown ;;
1796c321187Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1806c321187Smrg	esac
1816c321187Smrg	# The Operating System including object format, if it has switched
1826c321187Smrg	# to ELF recently, or will in the future.
1836c321187Smrg	case "${UNAME_MACHINE_ARCH}" in
1846c321187Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1856c321187Smrg		eval $set_cc_for_build
1866c321187Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
187e120bd27Smrg			| grep -q __ELF__
1886c321187Smrg		then
1896c321187Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1906c321187Smrg		    # Return netbsd for either.  FIX?
1916c321187Smrg		    os=netbsd
1926c321187Smrg		else
1936c321187Smrg		    os=netbsdelf
1946c321187Smrg		fi
1956c321187Smrg		;;
1966c321187Smrg	    *)
1979d0b5e55Smrg		os=netbsd
1986c321187Smrg		;;
1996c321187Smrg	esac
2006c321187Smrg	# The OS release
2016c321187Smrg	# Debian GNU/NetBSD machines have a different userland, and
2026c321187Smrg	# thus, need a distinct triplet. However, they do not need
2036c321187Smrg	# kernel version information, so it can be replaced with a
2046c321187Smrg	# suitable tag, in the style of linux-gnu.
2056c321187Smrg	case "${UNAME_VERSION}" in
2066c321187Smrg	    Debian*)
2076c321187Smrg		release='-gnu'
2086c321187Smrg		;;
2096c321187Smrg	    *)
2106c321187Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
2116c321187Smrg		;;
2126c321187Smrg	esac
2136c321187Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2146c321187Smrg	# contains redundant information, the shorter form:
2156c321187Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2166c321187Smrg	echo "${machine}-${os}${release}"
2176c321187Smrg	exit ;;
2189d0b5e55Smrg    *:Bitrig:*:*)
2199d0b5e55Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
2209d0b5e55Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
2219d0b5e55Smrg	exit ;;
2226c321187Smrg    *:OpenBSD:*:*)
2236c321187Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2246c321187Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2256c321187Smrg	exit ;;
2266c321187Smrg    *:ekkoBSD:*:*)
2276c321187Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2286c321187Smrg	exit ;;
22993493779Smrg    *:SolidBSD:*:*)
23093493779Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
23193493779Smrg	exit ;;
2326c321187Smrg    macppc:MirBSD:*:*)
23393493779Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2346c321187Smrg	exit ;;
2356c321187Smrg    *:MirBSD:*:*)
2366c321187Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2376c321187Smrg	exit ;;
2386c321187Smrg    alpha:OSF1:*:*)
2396c321187Smrg	case $UNAME_RELEASE in
2406c321187Smrg	*4.0)
2416c321187Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2426c321187Smrg		;;
2436c321187Smrg	*5.*)
2449d0b5e55Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2456c321187Smrg		;;
2466c321187Smrg	esac
2476c321187Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2486c321187Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2496c321187Smrg	# covers most systems running today.  This code pipes the CPU
2506c321187Smrg	# types through head -n 1, so we only detect the type of CPU 0.
2516c321187Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2526c321187Smrg	case "$ALPHA_CPU_TYPE" in
2536c321187Smrg	    "EV4 (21064)")
2546c321187Smrg		UNAME_MACHINE="alpha" ;;
2556c321187Smrg	    "EV4.5 (21064)")
2566c321187Smrg		UNAME_MACHINE="alpha" ;;
2576c321187Smrg	    "LCA4 (21066/21068)")
2586c321187Smrg		UNAME_MACHINE="alpha" ;;
2596c321187Smrg	    "EV5 (21164)")
2606c321187Smrg		UNAME_MACHINE="alphaev5" ;;
2616c321187Smrg	    "EV5.6 (21164A)")
2626c321187Smrg		UNAME_MACHINE="alphaev56" ;;
2636c321187Smrg	    "EV5.6 (21164PC)")
2646c321187Smrg		UNAME_MACHINE="alphapca56" ;;
2656c321187Smrg	    "EV5.7 (21164PC)")
2666c321187Smrg		UNAME_MACHINE="alphapca57" ;;
2676c321187Smrg	    "EV6 (21264)")
2686c321187Smrg		UNAME_MACHINE="alphaev6" ;;
2696c321187Smrg	    "EV6.7 (21264A)")
2706c321187Smrg		UNAME_MACHINE="alphaev67" ;;
2716c321187Smrg	    "EV6.8CB (21264C)")
2726c321187Smrg		UNAME_MACHINE="alphaev68" ;;
2736c321187Smrg	    "EV6.8AL (21264B)")
2746c321187Smrg		UNAME_MACHINE="alphaev68" ;;
2756c321187Smrg	    "EV6.8CX (21264D)")
2766c321187Smrg		UNAME_MACHINE="alphaev68" ;;
2776c321187Smrg	    "EV6.9A (21264/EV69A)")
2786c321187Smrg		UNAME_MACHINE="alphaev69" ;;
2796c321187Smrg	    "EV7 (21364)")
2806c321187Smrg		UNAME_MACHINE="alphaev7" ;;
2816c321187Smrg	    "EV7.9 (21364A)")
2826c321187Smrg		UNAME_MACHINE="alphaev79" ;;
2836c321187Smrg	esac
2846c321187Smrg	# A Pn.n version is a patched version.
2856c321187Smrg	# A Vn.n version is a released version.
2866c321187Smrg	# A Tn.n version is a released field test version.
2876c321187Smrg	# A Xn.n version is an unreleased experimental baselevel.
2886c321187Smrg	# 1.2 uses "1.2" for uname -r.
2896c321187Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2909d0b5e55Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
2919d0b5e55Smrg	exitcode=$?
2929d0b5e55Smrg	trap '' 0
2939d0b5e55Smrg	exit $exitcode ;;
2946c321187Smrg    Alpha\ *:Windows_NT*:*)
2956c321187Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
2966c321187Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
2976c321187Smrg	# of the specific Alpha model?
2986c321187Smrg	echo alpha-pc-interix
2996c321187Smrg	exit ;;
3006c321187Smrg    21064:Windows_NT:50:3)
3016c321187Smrg	echo alpha-dec-winnt3.5
3026c321187Smrg	exit ;;
3036c321187Smrg    Amiga*:UNIX_System_V:4.0:*)
3046c321187Smrg	echo m68k-unknown-sysv4
3056c321187Smrg	exit ;;
3066c321187Smrg    *:[Aa]miga[Oo][Ss]:*:*)
3076c321187Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
3086c321187Smrg	exit ;;
3096c321187Smrg    *:[Mm]orph[Oo][Ss]:*:*)
3106c321187Smrg	echo ${UNAME_MACHINE}-unknown-morphos
3116c321187Smrg	exit ;;
3126c321187Smrg    *:OS/390:*:*)
3136c321187Smrg	echo i370-ibm-openedition
3146c321187Smrg	exit ;;
3156c321187Smrg    *:z/VM:*:*)
3166c321187Smrg	echo s390-ibm-zvmoe
3176c321187Smrg	exit ;;
3186c321187Smrg    *:OS400:*:*)
3199d0b5e55Smrg	echo powerpc-ibm-os400
3206c321187Smrg	exit ;;
3216c321187Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3226c321187Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
3236c321187Smrg	exit ;;
3249d0b5e55Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
3256c321187Smrg	echo arm-unknown-riscos
3266c321187Smrg	exit ;;
3276c321187Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3286c321187Smrg	echo hppa1.1-hitachi-hiuxmpp
3296c321187Smrg	exit ;;
3306c321187Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3316c321187Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3326c321187Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3336c321187Smrg		echo pyramid-pyramid-sysv3
3346c321187Smrg	else
3356c321187Smrg		echo pyramid-pyramid-bsd
3366c321187Smrg	fi
3376c321187Smrg	exit ;;
3386c321187Smrg    NILE*:*:*:dcosx)
3396c321187Smrg	echo pyramid-pyramid-svr4
3406c321187Smrg	exit ;;
3416c321187Smrg    DRS?6000:unix:4.0:6*)
3426c321187Smrg	echo sparc-icl-nx6
3436c321187Smrg	exit ;;
3446c321187Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3456c321187Smrg	case `/usr/bin/uname -p` in
3466c321187Smrg	    sparc) echo sparc-icl-nx7; exit ;;
3476c321187Smrg	esac ;;
348e120bd27Smrg    s390x:SunOS:*:*)
349e120bd27Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
350e120bd27Smrg	exit ;;
3516c321187Smrg    sun4H:SunOS:5.*:*)
3526c321187Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3536c321187Smrg	exit ;;
3546c321187Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3556c321187Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3566c321187Smrg	exit ;;
357e120bd27Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
358e120bd27Smrg	echo i386-pc-auroraux${UNAME_RELEASE}
359e120bd27Smrg	exit ;;
36093493779Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
361e120bd27Smrg	eval $set_cc_for_build
362e120bd27Smrg	SUN_ARCH="i386"
363e120bd27Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
364e120bd27Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
365e120bd27Smrg	# This test works for both compilers.
366e120bd27Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
367e120bd27Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
368e120bd27Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
369e120bd27Smrg		grep IS_64BIT_ARCH >/dev/null
370e120bd27Smrg	    then
371e120bd27Smrg		SUN_ARCH="x86_64"
372e120bd27Smrg	    fi
373e120bd27Smrg	fi
374e120bd27Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3756c321187Smrg	exit ;;
3766c321187Smrg    sun4*:SunOS:6*:*)
3776c321187Smrg	# According to config.sub, this is the proper way to canonicalize
3786c321187Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3796c321187Smrg	# it's likely to be more like Solaris than SunOS4.
3806c321187Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3816c321187Smrg	exit ;;
3826c321187Smrg    sun4*:SunOS:*:*)
3836c321187Smrg	case "`/usr/bin/arch -k`" in
3846c321187Smrg	    Series*|S4*)
3856c321187Smrg		UNAME_RELEASE=`uname -v`
3866c321187Smrg		;;
3876c321187Smrg	esac
3886c321187Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
3896c321187Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3906c321187Smrg	exit ;;
3916c321187Smrg    sun3*:SunOS:*:*)
3926c321187Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
3936c321187Smrg	exit ;;
3946c321187Smrg    sun*:*:4.2BSD:*)
3956c321187Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3966c321187Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
3976c321187Smrg	case "`/bin/arch`" in
3986c321187Smrg	    sun3)
3996c321187Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
4006c321187Smrg		;;
4016c321187Smrg	    sun4)
4026c321187Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
4036c321187Smrg		;;
4046c321187Smrg	esac
4056c321187Smrg	exit ;;
4066c321187Smrg    aushp:SunOS:*:*)
4076c321187Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
4086c321187Smrg	exit ;;
4096c321187Smrg    # The situation for MiNT is a little confusing.  The machine name
4106c321187Smrg    # can be virtually everything (everything which is not
4116c321187Smrg    # "atarist" or "atariste" at least should have a processor
4126c321187Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
4136c321187Smrg    # to the lowercase version "mint" (or "freemint").  Finally
4146c321187Smrg    # the system name "TOS" denotes a system which is actually not
4156c321187Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
4166c321187Smrg    # be no problem.
4176c321187Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4189d0b5e55Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4196c321187Smrg	exit ;;
4206c321187Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4216c321187Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4229d0b5e55Smrg	exit ;;
4236c321187Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4249d0b5e55Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4256c321187Smrg	exit ;;
4266c321187Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4279d0b5e55Smrg	echo m68k-milan-mint${UNAME_RELEASE}
4289d0b5e55Smrg	exit ;;
4296c321187Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4309d0b5e55Smrg	echo m68k-hades-mint${UNAME_RELEASE}
4319d0b5e55Smrg	exit ;;
4326c321187Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4339d0b5e55Smrg	echo m68k-unknown-mint${UNAME_RELEASE}
4349d0b5e55Smrg	exit ;;
4356c321187Smrg    m68k:machten:*:*)
4366c321187Smrg	echo m68k-apple-machten${UNAME_RELEASE}
4376c321187Smrg	exit ;;
4386c321187Smrg    powerpc:machten:*:*)
4396c321187Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
4406c321187Smrg	exit ;;
4416c321187Smrg    RISC*:Mach:*:*)
4426c321187Smrg	echo mips-dec-mach_bsd4.3
4436c321187Smrg	exit ;;
4446c321187Smrg    RISC*:ULTRIX:*:*)
4456c321187Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
4466c321187Smrg	exit ;;
4476c321187Smrg    VAX*:ULTRIX*:*:*)
4486c321187Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
4496c321187Smrg	exit ;;
4506c321187Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4516c321187Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4526c321187Smrg	exit ;;
4536c321187Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4546c321187Smrg	eval $set_cc_for_build
4556c321187Smrg	sed 's/^	//' << EOF >$dummy.c
4566c321187Smrg#ifdef __cplusplus
4576c321187Smrg#include <stdio.h>  /* for printf() prototype */
4586c321187Smrg	int main (int argc, char *argv[]) {
4596c321187Smrg#else
4606c321187Smrg	int main (argc, argv) int argc; char *argv[]; {
4616c321187Smrg#endif
4626c321187Smrg	#if defined (host_mips) && defined (MIPSEB)
4636c321187Smrg	#if defined (SYSTYPE_SYSV)
4646c321187Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4656c321187Smrg	#endif
4666c321187Smrg	#if defined (SYSTYPE_SVR4)
4676c321187Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4686c321187Smrg	#endif
4696c321187Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4706c321187Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4716c321187Smrg	#endif
4726c321187Smrg	#endif
4736c321187Smrg	  exit (-1);
4746c321187Smrg	}
4756c321187SmrgEOF
4766c321187Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4776c321187Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4786c321187Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4796c321187Smrg	    { echo "$SYSTEM_NAME"; exit; }
4806c321187Smrg	echo mips-mips-riscos${UNAME_RELEASE}
4816c321187Smrg	exit ;;
4826c321187Smrg    Motorola:PowerMAX_OS:*:*)
4836c321187Smrg	echo powerpc-motorola-powermax
4846c321187Smrg	exit ;;
4856c321187Smrg    Motorola:*:4.3:PL8-*)
4866c321187Smrg	echo powerpc-harris-powermax
4876c321187Smrg	exit ;;
4886c321187Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4896c321187Smrg	echo powerpc-harris-powermax
4906c321187Smrg	exit ;;
4916c321187Smrg    Night_Hawk:Power_UNIX:*:*)
4926c321187Smrg	echo powerpc-harris-powerunix
4936c321187Smrg	exit ;;
4946c321187Smrg    m88k:CX/UX:7*:*)
4956c321187Smrg	echo m88k-harris-cxux7
4966c321187Smrg	exit ;;
4976c321187Smrg    m88k:*:4*:R4*)
4986c321187Smrg	echo m88k-motorola-sysv4
4996c321187Smrg	exit ;;
5006c321187Smrg    m88k:*:3*:R3*)
5016c321187Smrg	echo m88k-motorola-sysv3
5026c321187Smrg	exit ;;
5036c321187Smrg    AViiON:dgux:*:*)
5049d0b5e55Smrg	# DG/UX returns AViiON for all architectures
5059d0b5e55Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
5066c321187Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
5076c321187Smrg	then
5086c321187Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
5096c321187Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
5106c321187Smrg	    then
5116c321187Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
5126c321187Smrg	    else
5136c321187Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
5146c321187Smrg	    fi
5156c321187Smrg	else
5166c321187Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
5176c321187Smrg	fi
5189d0b5e55Smrg	exit ;;
5196c321187Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
5206c321187Smrg	echo m88k-dolphin-sysv3
5216c321187Smrg	exit ;;
5226c321187Smrg    M88*:*:R3*:*)
5236c321187Smrg	# Delta 88k system running SVR3
5246c321187Smrg	echo m88k-motorola-sysv3
5256c321187Smrg	exit ;;
5266c321187Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5276c321187Smrg	echo m88k-tektronix-sysv3
5286c321187Smrg	exit ;;
5296c321187Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5306c321187Smrg	echo m68k-tektronix-bsd
5316c321187Smrg	exit ;;
5326c321187Smrg    *:IRIX*:*:*)
5336c321187Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5346c321187Smrg	exit ;;
5356c321187Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5366c321187Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5376c321187Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5386c321187Smrg    i*86:AIX:*:*)
5396c321187Smrg	echo i386-ibm-aix
5406c321187Smrg	exit ;;
5416c321187Smrg    ia64:AIX:*:*)
5426c321187Smrg	if [ -x /usr/bin/oslevel ] ; then
5436c321187Smrg		IBM_REV=`/usr/bin/oslevel`
5446c321187Smrg	else
5456c321187Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5466c321187Smrg	fi
5476c321187Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5486c321187Smrg	exit ;;
5496c321187Smrg    *:AIX:2:3)
5506c321187Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5516c321187Smrg		eval $set_cc_for_build
5526c321187Smrg		sed 's/^		//' << EOF >$dummy.c
5536c321187Smrg		#include <sys/systemcfg.h>
5546c321187Smrg
5556c321187Smrg		main()
5566c321187Smrg			{
5576c321187Smrg			if (!__power_pc())
5586c321187Smrg				exit(1);
5596c321187Smrg			puts("powerpc-ibm-aix3.2.5");
5606c321187Smrg			exit(0);
5616c321187Smrg			}
5626c321187SmrgEOF
5636c321187Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5646c321187Smrg		then
5656c321187Smrg			echo "$SYSTEM_NAME"
5666c321187Smrg		else
5676c321187Smrg			echo rs6000-ibm-aix3.2.5
5686c321187Smrg		fi
5696c321187Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5706c321187Smrg		echo rs6000-ibm-aix3.2.4
5716c321187Smrg	else
5726c321187Smrg		echo rs6000-ibm-aix3.2
5736c321187Smrg	fi
5746c321187Smrg	exit ;;
575e120bd27Smrg    *:AIX:*:[4567])
5766c321187Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5776c321187Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5786c321187Smrg		IBM_ARCH=rs6000
5796c321187Smrg	else
5806c321187Smrg		IBM_ARCH=powerpc
5816c321187Smrg	fi
5826c321187Smrg	if [ -x /usr/bin/oslevel ] ; then
5836c321187Smrg		IBM_REV=`/usr/bin/oslevel`
5846c321187Smrg	else
5856c321187Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5866c321187Smrg	fi
5876c321187Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5886c321187Smrg	exit ;;
5896c321187Smrg    *:AIX:*:*)
5906c321187Smrg	echo rs6000-ibm-aix
5916c321187Smrg	exit ;;
5926c321187Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5936c321187Smrg	echo romp-ibm-bsd4.4
5946c321187Smrg	exit ;;
5956c321187Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5966c321187Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5976c321187Smrg	exit ;;                             # report: romp-ibm BSD 4.3
5986c321187Smrg    *:BOSX:*:*)
5996c321187Smrg	echo rs6000-bull-bosx
6006c321187Smrg	exit ;;
6016c321187Smrg    DPX/2?00:B.O.S.:*:*)
6026c321187Smrg	echo m68k-bull-sysv3
6036c321187Smrg	exit ;;
6046c321187Smrg    9000/[34]??:4.3bsd:1.*:*)
6056c321187Smrg	echo m68k-hp-bsd
6066c321187Smrg	exit ;;
6076c321187Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
6086c321187Smrg	echo m68k-hp-bsd4.4
6096c321187Smrg	exit ;;
6106c321187Smrg    9000/[34678]??:HP-UX:*:*)
6116c321187Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6126c321187Smrg	case "${UNAME_MACHINE}" in
6136c321187Smrg	    9000/31? )            HP_ARCH=m68000 ;;
6146c321187Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
6156c321187Smrg	    9000/[678][0-9][0-9])
6166c321187Smrg		if [ -x /usr/bin/getconf ]; then
6176c321187Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
6189d0b5e55Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
6199d0b5e55Smrg		    case "${sc_cpu_version}" in
6209d0b5e55Smrg		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
6219d0b5e55Smrg		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
6229d0b5e55Smrg		      532)                      # CPU_PA_RISC2_0
6239d0b5e55Smrg			case "${sc_kernel_bits}" in
6249d0b5e55Smrg			  32) HP_ARCH="hppa2.0n" ;;
6259d0b5e55Smrg			  64) HP_ARCH="hppa2.0w" ;;
6266c321187Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
6279d0b5e55Smrg			esac ;;
6289d0b5e55Smrg		    esac
6296c321187Smrg		fi
6306c321187Smrg		if [ "${HP_ARCH}" = "" ]; then
6316c321187Smrg		    eval $set_cc_for_build
6329d0b5e55Smrg		    sed 's/^		//' << EOF >$dummy.c
6336c321187Smrg
6349d0b5e55Smrg		#define _HPUX_SOURCE
6359d0b5e55Smrg		#include <stdlib.h>
6369d0b5e55Smrg		#include <unistd.h>
6376c321187Smrg
6389d0b5e55Smrg		int main ()
6399d0b5e55Smrg		{
6409d0b5e55Smrg		#if defined(_SC_KERNEL_BITS)
6419d0b5e55Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
6429d0b5e55Smrg		#endif
6439d0b5e55Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
6446c321187Smrg
6459d0b5e55Smrg		    switch (cpu)
6469d0b5e55Smrg			{
6479d0b5e55Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6489d0b5e55Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6499d0b5e55Smrg			case CPU_PA_RISC2_0:
6509d0b5e55Smrg		#if defined(_SC_KERNEL_BITS)
6519d0b5e55Smrg			    switch (bits)
6529d0b5e55Smrg				{
6539d0b5e55Smrg				case 64: puts ("hppa2.0w"); break;
6549d0b5e55Smrg				case 32: puts ("hppa2.0n"); break;
6559d0b5e55Smrg				default: puts ("hppa2.0"); break;
6569d0b5e55Smrg				} break;
6579d0b5e55Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
6589d0b5e55Smrg			    puts ("hppa2.0"); break;
6599d0b5e55Smrg		#endif
6609d0b5e55Smrg			default: puts ("hppa1.0"); break;
6619d0b5e55Smrg			}
6629d0b5e55Smrg		    exit (0);
6639d0b5e55Smrg		}
6646c321187SmrgEOF
6656c321187Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6666c321187Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6676c321187Smrg		fi ;;
6686c321187Smrg	esac
6696c321187Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
6706c321187Smrg	then
6716c321187Smrg	    eval $set_cc_for_build
6726c321187Smrg
6736c321187Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6746c321187Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6756c321187Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6766c321187Smrg	    #
6776c321187Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
6786c321187Smrg	    # => hppa2.0w-hp-hpux11.23
6796c321187Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6806c321187Smrg	    # => hppa64-hp-hpux11.23
6816c321187Smrg
6826c321187Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
683e120bd27Smrg		grep -q __LP64__
6846c321187Smrg	    then
6856c321187Smrg		HP_ARCH="hppa2.0w"
6866c321187Smrg	    else
6876c321187Smrg		HP_ARCH="hppa64"
6886c321187Smrg	    fi
6896c321187Smrg	fi
6906c321187Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6916c321187Smrg	exit ;;
6926c321187Smrg    ia64:HP-UX:*:*)
6936c321187Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6946c321187Smrg	echo ia64-hp-hpux${HPUX_REV}
6956c321187Smrg	exit ;;
6966c321187Smrg    3050*:HI-UX:*:*)
6976c321187Smrg	eval $set_cc_for_build
6986c321187Smrg	sed 's/^	//' << EOF >$dummy.c
6996c321187Smrg	#include <unistd.h>
7006c321187Smrg	int
7016c321187Smrg	main ()
7026c321187Smrg	{
7036c321187Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
7046c321187Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7056c321187Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7066c321187Smrg	     results, however.  */
7076c321187Smrg	  if (CPU_IS_PA_RISC (cpu))
7086c321187Smrg	    {
7096c321187Smrg	      switch (cpu)
7106c321187Smrg		{
7116c321187Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7126c321187Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7136c321187Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7146c321187Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7156c321187Smrg		}
7166c321187Smrg	    }
7176c321187Smrg	  else if (CPU_IS_HP_MC68K (cpu))
7186c321187Smrg	    puts ("m68k-hitachi-hiuxwe2");
7196c321187Smrg	  else puts ("unknown-hitachi-hiuxwe2");
7206c321187Smrg	  exit (0);
7216c321187Smrg	}
7226c321187SmrgEOF
7236c321187Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7246c321187Smrg		{ echo "$SYSTEM_NAME"; exit; }
7256c321187Smrg	echo unknown-hitachi-hiuxwe2
7266c321187Smrg	exit ;;
7276c321187Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
7286c321187Smrg	echo hppa1.1-hp-bsd
7296c321187Smrg	exit ;;
7306c321187Smrg    9000/8??:4.3bsd:*:*)
7316c321187Smrg	echo hppa1.0-hp-bsd
7326c321187Smrg	exit ;;
7336c321187Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7346c321187Smrg	echo hppa1.0-hp-mpeix
7356c321187Smrg	exit ;;
7366c321187Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7376c321187Smrg	echo hppa1.1-hp-osf
7386c321187Smrg	exit ;;
7396c321187Smrg    hp8??:OSF1:*:*)
7406c321187Smrg	echo hppa1.0-hp-osf
7416c321187Smrg	exit ;;
7426c321187Smrg    i*86:OSF1:*:*)
7436c321187Smrg	if [ -x /usr/sbin/sysversion ] ; then
7446c321187Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
7456c321187Smrg	else
7466c321187Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
7476c321187Smrg	fi
7486c321187Smrg	exit ;;
7496c321187Smrg    parisc*:Lites*:*:*)
7506c321187Smrg	echo hppa1.1-hp-lites
7516c321187Smrg	exit ;;
7526c321187Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7536c321187Smrg	echo c1-convex-bsd
7549d0b5e55Smrg	exit ;;
7556c321187Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7566c321187Smrg	if getsysinfo -f scalar_acc
7576c321187Smrg	then echo c32-convex-bsd
7586c321187Smrg	else echo c2-convex-bsd
7596c321187Smrg	fi
7609d0b5e55Smrg	exit ;;
7616c321187Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7626c321187Smrg	echo c34-convex-bsd
7639d0b5e55Smrg	exit ;;
7646c321187Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7656c321187Smrg	echo c38-convex-bsd
7669d0b5e55Smrg	exit ;;
7676c321187Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7686c321187Smrg	echo c4-convex-bsd
7699d0b5e55Smrg	exit ;;
7706c321187Smrg    CRAY*Y-MP:*:*:*)
7716c321187Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7726c321187Smrg	exit ;;
7736c321187Smrg    CRAY*[A-Z]90:*:*:*)
7746c321187Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7756c321187Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7766c321187Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7776c321187Smrg	      -e 's/\.[^.]*$/.X/'
7786c321187Smrg	exit ;;
7796c321187Smrg    CRAY*TS:*:*:*)
7806c321187Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7816c321187Smrg	exit ;;
7826c321187Smrg    CRAY*T3E:*:*:*)
7836c321187Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7846c321187Smrg	exit ;;
7856c321187Smrg    CRAY*SV1:*:*:*)
7866c321187Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7876c321187Smrg	exit ;;
7886c321187Smrg    *:UNICOS/mp:*:*)
7896c321187Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7906c321187Smrg	exit ;;
7916c321187Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7926c321187Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7939d0b5e55Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7949d0b5e55Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7959d0b5e55Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7969d0b5e55Smrg	exit ;;
7976c321187Smrg    5000:UNIX_System_V:4.*:*)
7989d0b5e55Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7999d0b5e55Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
8009d0b5e55Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
8016c321187Smrg	exit ;;
8026c321187Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
8036c321187Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
8046c321187Smrg	exit ;;
8056c321187Smrg    sparc*:BSD/OS:*:*)
8066c321187Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
8076c321187Smrg	exit ;;
8086c321187Smrg    *:BSD/OS:*:*)
8096c321187Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
8106c321187Smrg	exit ;;
8116c321187Smrg    *:FreeBSD:*:*)
8129d0b5e55Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
8139d0b5e55Smrg	case ${UNAME_PROCESSOR} in
81493493779Smrg	    amd64)
81593493779Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
81693493779Smrg	    *)
8179d0b5e55Smrg		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
81893493779Smrg	esac
8196c321187Smrg	exit ;;
8206c321187Smrg    i*:CYGWIN*:*)
8216c321187Smrg	echo ${UNAME_MACHINE}-pc-cygwin
8226c321187Smrg	exit ;;
8239d0b5e55Smrg    *:MINGW64*:*)
8249d0b5e55Smrg	echo ${UNAME_MACHINE}-pc-mingw64
8259d0b5e55Smrg	exit ;;
82693493779Smrg    *:MINGW*:*)
8276c321187Smrg	echo ${UNAME_MACHINE}-pc-mingw32
8286c321187Smrg	exit ;;
8299d0b5e55Smrg    i*:MSYS*:*)
8309d0b5e55Smrg	echo ${UNAME_MACHINE}-pc-msys
8319d0b5e55Smrg	exit ;;
8326c321187Smrg    i*:windows32*:*)
8339d0b5e55Smrg	# uname -m includes "-pc" on this system.
8349d0b5e55Smrg	echo ${UNAME_MACHINE}-mingw32
8356c321187Smrg	exit ;;
8366c321187Smrg    i*:PW*:*)
8376c321187Smrg	echo ${UNAME_MACHINE}-pc-pw32
8386c321187Smrg	exit ;;
839e120bd27Smrg    *:Interix*:*)
8409d0b5e55Smrg	case ${UNAME_MACHINE} in
84193493779Smrg	    x86)
84293493779Smrg		echo i586-pc-interix${UNAME_RELEASE}
84393493779Smrg		exit ;;
844e120bd27Smrg	    authenticamd | genuineintel | EM64T)
84593493779Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
84693493779Smrg		exit ;;
84793493779Smrg	    IA64)
84893493779Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
84993493779Smrg		exit ;;
85093493779Smrg	esac ;;
8516c321187Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
8526c321187Smrg	echo i${UNAME_MACHINE}-pc-mks
8536c321187Smrg	exit ;;
854e120bd27Smrg    8664:Windows_NT:*)
855e120bd27Smrg	echo x86_64-pc-mks
856e120bd27Smrg	exit ;;
8576c321187Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
8586c321187Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
8596c321187Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8606c321187Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
8616c321187Smrg	echo i586-pc-interix
8626c321187Smrg	exit ;;
8636c321187Smrg    i*:UWIN*:*)
8646c321187Smrg	echo ${UNAME_MACHINE}-pc-uwin
8656c321187Smrg	exit ;;
8666c321187Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8676c321187Smrg	echo x86_64-unknown-cygwin
8686c321187Smrg	exit ;;
8696c321187Smrg    p*:CYGWIN*:*)
8706c321187Smrg	echo powerpcle-unknown-cygwin
8716c321187Smrg	exit ;;
8726c321187Smrg    prep*:SunOS:5.*:*)
8736c321187Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8746c321187Smrg	exit ;;
8756c321187Smrg    *:GNU:*:*)
8766c321187Smrg	# the GNU system
8779d0b5e55Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8786c321187Smrg	exit ;;
8796c321187Smrg    *:GNU/*:*:*)
8806c321187Smrg	# other systems with GNU libc and userland
8819d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
8826c321187Smrg	exit ;;
8836c321187Smrg    i*86:Minix:*:*)
8846c321187Smrg	echo ${UNAME_MACHINE}-pc-minix
8856c321187Smrg	exit ;;
8869d0b5e55Smrg    aarch64:Linux:*:*)
8879d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
8889d0b5e55Smrg	exit ;;
8899d0b5e55Smrg    aarch64_be:Linux:*:*)
8909d0b5e55Smrg	UNAME_MACHINE=aarch64_be
8919d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
8929d0b5e55Smrg	exit ;;
893e120bd27Smrg    alpha:Linux:*:*)
894e120bd27Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
895e120bd27Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
896e120bd27Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
897e120bd27Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
898e120bd27Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
899e120bd27Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
900e120bd27Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
901e120bd27Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
9029d0b5e55Smrg	esac
903e120bd27Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
9049d0b5e55Smrg	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
9059d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9069d0b5e55Smrg	exit ;;
9079d0b5e55Smrg    arc:Linux:*:* | arceb:Linux:*:*)
9089d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
909e120bd27Smrg	exit ;;
9106c321187Smrg    arm*:Linux:*:*)
91193493779Smrg	eval $set_cc_for_build
91293493779Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
91393493779Smrg	    | grep -q __ARM_EABI__
91493493779Smrg	then
9159d0b5e55Smrg	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
91693493779Smrg	else
9179d0b5e55Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
9189d0b5e55Smrg		| grep -q __ARM_PCS_VFP
9199d0b5e55Smrg	    then
9209d0b5e55Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
9219d0b5e55Smrg	    else
9229d0b5e55Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
9239d0b5e55Smrg	    fi
92493493779Smrg	fi
92593493779Smrg	exit ;;
92693493779Smrg    avr32*:Linux:*:*)
9279d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9286c321187Smrg	exit ;;
9296c321187Smrg    cris:Linux:*:*)
9309d0b5e55Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
9316c321187Smrg	exit ;;
9326c321187Smrg    crisv32:Linux:*:*)
9339d0b5e55Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
9346c321187Smrg	exit ;;
9356c321187Smrg    frv:Linux:*:*)
9369d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9379d0b5e55Smrg	exit ;;
9389d0b5e55Smrg    hexagon:Linux:*:*)
9399d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9406c321187Smrg	exit ;;
941e120bd27Smrg    i*86:Linux:*:*)
9429d0b5e55Smrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
943e120bd27Smrg	exit ;;
9446c321187Smrg    ia64:Linux:*:*)
9459d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9466c321187Smrg	exit ;;
9476c321187Smrg    m32r*:Linux:*:*)
9489d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9496c321187Smrg	exit ;;
9506c321187Smrg    m68*:Linux:*:*)
9519d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9526c321187Smrg	exit ;;
953e120bd27Smrg    mips:Linux:*:* | mips64:Linux:*:*)
9546c321187Smrg	eval $set_cc_for_build
9556c321187Smrg	sed 's/^	//' << EOF >$dummy.c
9566c321187Smrg	#undef CPU
957e120bd27Smrg	#undef ${UNAME_MACHINE}
958e120bd27Smrg	#undef ${UNAME_MACHINE}el
9596c321187Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
960e120bd27Smrg	CPU=${UNAME_MACHINE}el
9616c321187Smrg	#else
9626c321187Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
963e120bd27Smrg	CPU=${UNAME_MACHINE}
9646c321187Smrg	#else
9656c321187Smrg	CPU=
9666c321187Smrg	#endif
9676c321187Smrg	#endif
9686c321187SmrgEOF
969e120bd27Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
9709d0b5e55Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
9716c321187Smrg	;;
9729d0b5e55Smrg    or1k:Linux:*:*)
9739d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9749d0b5e55Smrg	exit ;;
9756c321187Smrg    or32:Linux:*:*)
9769d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9776c321187Smrg	exit ;;
978e120bd27Smrg    padre:Linux:*:*)
9799d0b5e55Smrg	echo sparc-unknown-linux-${LIBC}
9806c321187Smrg	exit ;;
981e120bd27Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
9829d0b5e55Smrg	echo hppa64-unknown-linux-${LIBC}
9836c321187Smrg	exit ;;
9846c321187Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
9856c321187Smrg	# Look for CPU level
9866c321187Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9879d0b5e55Smrg	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
9889d0b5e55Smrg	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
9899d0b5e55Smrg	  *)    echo hppa-unknown-linux-${LIBC} ;;
9906c321187Smrg	esac
9916c321187Smrg	exit ;;
992e120bd27Smrg    ppc64:Linux:*:*)
9939d0b5e55Smrg	echo powerpc64-unknown-linux-${LIBC}
994e120bd27Smrg	exit ;;
995e120bd27Smrg    ppc:Linux:*:*)
9969d0b5e55Smrg	echo powerpc-unknown-linux-${LIBC}
9979d0b5e55Smrg	exit ;;
9989d0b5e55Smrg    ppc64le:Linux:*:*)
9999d0b5e55Smrg	echo powerpc64le-unknown-linux-${LIBC}
10009d0b5e55Smrg	exit ;;
10019d0b5e55Smrg    ppcle:Linux:*:*)
10029d0b5e55Smrg	echo powerpcle-unknown-linux-${LIBC}
10036c321187Smrg	exit ;;
10046c321187Smrg    s390:Linux:*:* | s390x:Linux:*:*)
10059d0b5e55Smrg	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
10066c321187Smrg	exit ;;
10076c321187Smrg    sh64*:Linux:*:*)
10089d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10096c321187Smrg	exit ;;
10106c321187Smrg    sh*:Linux:*:*)
10119d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10126c321187Smrg	exit ;;
10136c321187Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
10149d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10156c321187Smrg	exit ;;
1016e120bd27Smrg    tile*:Linux:*:*)
10179d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1018e120bd27Smrg	exit ;;
10196c321187Smrg    vax:Linux:*:*)
10209d0b5e55Smrg	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
10216c321187Smrg	exit ;;
10226c321187Smrg    x86_64:Linux:*:*)
10239d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10246c321187Smrg	exit ;;
102593493779Smrg    xtensa*:Linux:*:*)
10269d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
102793493779Smrg	exit ;;
10286c321187Smrg    i*86:DYNIX/ptx:4*:*)
10296c321187Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10306c321187Smrg	# earlier versions are messed up and put the nodename in both
10316c321187Smrg	# sysname and nodename.
10326c321187Smrg	echo i386-sequent-sysv4
10336c321187Smrg	exit ;;
10346c321187Smrg    i*86:UNIX_SV:4.2MP:2.*)
10359d0b5e55Smrg	# Unixware is an offshoot of SVR4, but it has its own version
10369d0b5e55Smrg	# number series starting with 2...
10379d0b5e55Smrg	# I am not positive that other SVR4 systems won't match this,
10386c321187Smrg	# I just have to hope.  -- rms.
10399d0b5e55Smrg	# Use sysv4.2uw... so that sysv4* matches it.
10406c321187Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10416c321187Smrg	exit ;;
10426c321187Smrg    i*86:OS/2:*:*)
10436c321187Smrg	# If we were able to find `uname', then EMX Unix compatibility
10446c321187Smrg	# is probably installed.
10456c321187Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
10466c321187Smrg	exit ;;
10476c321187Smrg    i*86:XTS-300:*:STOP)
10486c321187Smrg	echo ${UNAME_MACHINE}-unknown-stop
10496c321187Smrg	exit ;;
10506c321187Smrg    i*86:atheos:*:*)
10516c321187Smrg	echo ${UNAME_MACHINE}-unknown-atheos
10526c321187Smrg	exit ;;
10536c321187Smrg    i*86:syllable:*:*)
10546c321187Smrg	echo ${UNAME_MACHINE}-pc-syllable
10556c321187Smrg	exit ;;
1056e120bd27Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
10576c321187Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10586c321187Smrg	exit ;;
10596c321187Smrg    i*86:*DOS:*:*)
10606c321187Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10616c321187Smrg	exit ;;
10626c321187Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10636c321187Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10646c321187Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10656c321187Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10666c321187Smrg	else
10676c321187Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10686c321187Smrg	fi
10696c321187Smrg	exit ;;
10706c321187Smrg    i*86:*:5:[678]*)
10719d0b5e55Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10726c321187Smrg	case `/bin/uname -X | grep "^Machine"` in
10736c321187Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
10746c321187Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
10756c321187Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10766c321187Smrg	esac
10776c321187Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10786c321187Smrg	exit ;;
10796c321187Smrg    i*86:*:3.2:*)
10806c321187Smrg	if test -f /usr/options/cb.name; then
10816c321187Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
10826c321187Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
10836c321187Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
10846c321187Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10856c321187Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10866c321187Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
10876c321187Smrg			&& UNAME_MACHINE=i586
10886c321187Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
10896c321187Smrg			&& UNAME_MACHINE=i686
10906c321187Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10916c321187Smrg			&& UNAME_MACHINE=i686
10926c321187Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
10936c321187Smrg	else
10946c321187Smrg		echo ${UNAME_MACHINE}-pc-sysv32
10956c321187Smrg	fi
10966c321187Smrg	exit ;;
10976c321187Smrg    pc:*:*:*)
10986c321187Smrg	# Left here for compatibility:
10999d0b5e55Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
11009d0b5e55Smrg	# the processor, so we play safe by assuming i586.
1101e120bd27Smrg	# Note: whatever this is, it MUST be the same as what config.sub
1102e120bd27Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
1103e120bd27Smrg	# this is a cross-build.
1104e120bd27Smrg	echo i586-pc-msdosdjgpp
11059d0b5e55Smrg	exit ;;
11066c321187Smrg    Intel:Mach:3*:*)
11076c321187Smrg	echo i386-pc-mach3
11086c321187Smrg	exit ;;
11096c321187Smrg    paragon:*:*:*)
11106c321187Smrg	echo i860-intel-osf1
11116c321187Smrg	exit ;;
11126c321187Smrg    i860:*:4.*:*) # i860-SVR4
11136c321187Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
11146c321187Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
11156c321187Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
11166c321187Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
11176c321187Smrg	fi
11186c321187Smrg	exit ;;
11196c321187Smrg    mini*:CTIX:SYS*5:*)
11206c321187Smrg	# "miniframe"
11216c321187Smrg	echo m68010-convergent-sysv
11226c321187Smrg	exit ;;
11236c321187Smrg    mc68k:UNIX:SYSTEM5:3.51m)
11246c321187Smrg	echo m68k-convergent-sysv
11256c321187Smrg	exit ;;
11266c321187Smrg    M680?0:D-NIX:5.3:*)
11276c321187Smrg	echo m68k-diab-dnix
11286c321187Smrg	exit ;;
11296c321187Smrg    M68*:*:R3V[5678]*:*)
11306c321187Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11316c321187Smrg    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)
11326c321187Smrg	OS_REL=''
11336c321187Smrg	test -r /etc/.relid \
11346c321187Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11356c321187Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11366c321187Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11376c321187Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11386c321187Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11396c321187Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11409d0b5e55Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11419d0b5e55Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
1142e120bd27Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1143e120bd27Smrg	OS_REL='.3'
1144e120bd27Smrg	test -r /etc/.relid \
1145e120bd27Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1146e120bd27Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1147e120bd27Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1148e120bd27Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1149e120bd27Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1150e120bd27Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1151e120bd27Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11526c321187Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11536c321187Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11546c321187Smrg	exit ;;
11556c321187Smrg    mc68030:UNIX_System_V:4.*:*)
11566c321187Smrg	echo m68k-atari-sysv4
11576c321187Smrg	exit ;;
11586c321187Smrg    TSUNAMI:LynxOS:2.*:*)
11596c321187Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11606c321187Smrg	exit ;;
11616c321187Smrg    rs6000:LynxOS:2.*:*)
11626c321187Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11636c321187Smrg	exit ;;
1164e120bd27Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
11656c321187Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11666c321187Smrg	exit ;;
11676c321187Smrg    SM[BE]S:UNIX_SV:*:*)
11686c321187Smrg	echo mips-dde-sysv${UNAME_RELEASE}
11696c321187Smrg	exit ;;
11706c321187Smrg    RM*:ReliantUNIX-*:*:*)
11716c321187Smrg	echo mips-sni-sysv4
11726c321187Smrg	exit ;;
11736c321187Smrg    RM*:SINIX-*:*:*)
11746c321187Smrg	echo mips-sni-sysv4
11756c321187Smrg	exit ;;
11766c321187Smrg    *:SINIX-*:*:*)
11776c321187Smrg	if uname -p 2>/dev/null >/dev/null ; then
11786c321187Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
11796c321187Smrg		echo ${UNAME_MACHINE}-sni-sysv4
11806c321187Smrg	else
11816c321187Smrg		echo ns32k-sni-sysv
11826c321187Smrg	fi
11836c321187Smrg	exit ;;
11849d0b5e55Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
11859d0b5e55Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
11869d0b5e55Smrg	echo i586-unisys-sysv4
11879d0b5e55Smrg	exit ;;
11886c321187Smrg    *:UNIX_System_V:4*:FTX*)
11896c321187Smrg	# From Gerald Hewes <hewes@openmarket.com>.
11906c321187Smrg	# How about differentiating between stratus architectures? -djm
11916c321187Smrg	echo hppa1.1-stratus-sysv4
11926c321187Smrg	exit ;;
11936c321187Smrg    *:*:*:FTX*)
11946c321187Smrg	# From seanf@swdc.stratus.com.
11956c321187Smrg	echo i860-stratus-sysv4
11966c321187Smrg	exit ;;
11976c321187Smrg    i*86:VOS:*:*)
11986c321187Smrg	# From Paul.Green@stratus.com.
11996c321187Smrg	echo ${UNAME_MACHINE}-stratus-vos
12006c321187Smrg	exit ;;
12016c321187Smrg    *:VOS:*:*)
12026c321187Smrg	# From Paul.Green@stratus.com.
12036c321187Smrg	echo hppa1.1-stratus-vos
12046c321187Smrg	exit ;;
12056c321187Smrg    mc68*:A/UX:*:*)
12066c321187Smrg	echo m68k-apple-aux${UNAME_RELEASE}
12076c321187Smrg	exit ;;
12086c321187Smrg    news*:NEWS-OS:6*:*)
12096c321187Smrg	echo mips-sony-newsos6
12106c321187Smrg	exit ;;
12116c321187Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12126c321187Smrg	if [ -d /usr/nec ]; then
12139d0b5e55Smrg		echo mips-nec-sysv${UNAME_RELEASE}
12146c321187Smrg	else
12159d0b5e55Smrg		echo mips-unknown-sysv${UNAME_RELEASE}
12166c321187Smrg	fi
12179d0b5e55Smrg	exit ;;
12186c321187Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
12196c321187Smrg	echo powerpc-be-beos
12206c321187Smrg	exit ;;
12216c321187Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
12226c321187Smrg	echo powerpc-apple-beos
12236c321187Smrg	exit ;;
12246c321187Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
12256c321187Smrg	echo i586-pc-beos
12266c321187Smrg	exit ;;
1227e120bd27Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1228e120bd27Smrg	echo i586-pc-haiku
1229e120bd27Smrg	exit ;;
12309d0b5e55Smrg    x86_64:Haiku:*:*)
12319d0b5e55Smrg	echo x86_64-unknown-haiku
12329d0b5e55Smrg	exit ;;
12336c321187Smrg    SX-4:SUPER-UX:*:*)
12346c321187Smrg	echo sx4-nec-superux${UNAME_RELEASE}
12356c321187Smrg	exit ;;
12366c321187Smrg    SX-5:SUPER-UX:*:*)
12376c321187Smrg	echo sx5-nec-superux${UNAME_RELEASE}
12386c321187Smrg	exit ;;
12396c321187Smrg    SX-6:SUPER-UX:*:*)
12406c321187Smrg	echo sx6-nec-superux${UNAME_RELEASE}
12416c321187Smrg	exit ;;
124293493779Smrg    SX-7:SUPER-UX:*:*)
124393493779Smrg	echo sx7-nec-superux${UNAME_RELEASE}
124493493779Smrg	exit ;;
124593493779Smrg    SX-8:SUPER-UX:*:*)
124693493779Smrg	echo sx8-nec-superux${UNAME_RELEASE}
124793493779Smrg	exit ;;
124893493779Smrg    SX-8R:SUPER-UX:*:*)
124993493779Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
125093493779Smrg	exit ;;
12516c321187Smrg    Power*:Rhapsody:*:*)
12526c321187Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12536c321187Smrg	exit ;;
12546c321187Smrg    *:Rhapsody:*:*)
12556c321187Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12566c321187Smrg	exit ;;
12576c321187Smrg    *:Darwin:*:*)
12586c321187Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12599d0b5e55Smrg	eval $set_cc_for_build
12609d0b5e55Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
12619d0b5e55Smrg	    UNAME_PROCESSOR=powerpc
12629d0b5e55Smrg	fi
12639d0b5e55Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
12649d0b5e55Smrg	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
12659d0b5e55Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
12669d0b5e55Smrg		grep IS_64BIT_ARCH >/dev/null
12679d0b5e55Smrg	    then
12689d0b5e55Smrg		case $UNAME_PROCESSOR in
12699d0b5e55Smrg		    i386) UNAME_PROCESSOR=x86_64 ;;
12709d0b5e55Smrg		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
12719d0b5e55Smrg		esac
12729d0b5e55Smrg	    fi
12739d0b5e55Smrg	fi
12746c321187Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12756c321187Smrg	exit ;;
12766c321187Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
12776c321187Smrg	UNAME_PROCESSOR=`uname -p`
12786c321187Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
12796c321187Smrg		UNAME_PROCESSOR=i386
12806c321187Smrg		UNAME_MACHINE=pc
12816c321187Smrg	fi
12826c321187Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
12836c321187Smrg	exit ;;
12846c321187Smrg    *:QNX:*:4*)
12856c321187Smrg	echo i386-pc-qnx
12866c321187Smrg	exit ;;
12879d0b5e55Smrg    NEO-?:NONSTOP_KERNEL:*:*)
12889d0b5e55Smrg	echo neo-tandem-nsk${UNAME_RELEASE}
12899d0b5e55Smrg	exit ;;
12909d0b5e55Smrg    NSE-*:NONSTOP_KERNEL:*:*)
12916c321187Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
12926c321187Smrg	exit ;;
12936c321187Smrg    NSR-?:NONSTOP_KERNEL:*:*)
12946c321187Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
12956c321187Smrg	exit ;;
12966c321187Smrg    *:NonStop-UX:*:*)
12976c321187Smrg	echo mips-compaq-nonstopux
12986c321187Smrg	exit ;;
12996c321187Smrg    BS2000:POSIX*:*:*)
13006c321187Smrg	echo bs2000-siemens-sysv
13016c321187Smrg	exit ;;
13026c321187Smrg    DS/*:UNIX_System_V:*:*)
13036c321187Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
13046c321187Smrg	exit ;;
13056c321187Smrg    *:Plan9:*:*)
13066c321187Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
13076c321187Smrg	# is converted to i386 for consistency with other x86
13086c321187Smrg	# operating systems.
13096c321187Smrg	if test "$cputype" = "386"; then
13106c321187Smrg	    UNAME_MACHINE=i386
13116c321187Smrg	else
13126c321187Smrg	    UNAME_MACHINE="$cputype"
13136c321187Smrg	fi
13146c321187Smrg	echo ${UNAME_MACHINE}-unknown-plan9
13156c321187Smrg	exit ;;
13166c321187Smrg    *:TOPS-10:*:*)
13176c321187Smrg	echo pdp10-unknown-tops10
13186c321187Smrg	exit ;;
13196c321187Smrg    *:TENEX:*:*)
13206c321187Smrg	echo pdp10-unknown-tenex
13216c321187Smrg	exit ;;
13226c321187Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
13236c321187Smrg	echo pdp10-dec-tops20
13246c321187Smrg	exit ;;
13256c321187Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
13266c321187Smrg	echo pdp10-xkl-tops20
13276c321187Smrg	exit ;;
13286c321187Smrg    *:TOPS-20:*:*)
13296c321187Smrg	echo pdp10-unknown-tops20
13306c321187Smrg	exit ;;
13316c321187Smrg    *:ITS:*:*)
13326c321187Smrg	echo pdp10-unknown-its
13336c321187Smrg	exit ;;
13346c321187Smrg    SEI:*:*:SEIUX)
13359d0b5e55Smrg	echo mips-sei-seiux${UNAME_RELEASE}
13366c321187Smrg	exit ;;
13376c321187Smrg    *:DragonFly:*:*)
13386c321187Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13396c321187Smrg	exit ;;
13406c321187Smrg    *:*VMS:*:*)
13419d0b5e55Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13426c321187Smrg	case "${UNAME_MACHINE}" in
13436c321187Smrg	    A*) echo alpha-dec-vms ; exit ;;
13446c321187Smrg	    I*) echo ia64-dec-vms ; exit ;;
13456c321187Smrg	    V*) echo vax-dec-vms ; exit ;;
13466c321187Smrg	esac ;;
13476c321187Smrg    *:XENIX:*:SysV)
13486c321187Smrg	echo i386-pc-xenix
13496c321187Smrg	exit ;;
13506c321187Smrg    i*86:skyos:*:*)
13516c321187Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13526c321187Smrg	exit ;;
13536c321187Smrg    i*86:rdos:*:*)
13546c321187Smrg	echo ${UNAME_MACHINE}-pc-rdos
13556c321187Smrg	exit ;;
1356e120bd27Smrg    i*86:AROS:*:*)
1357e120bd27Smrg	echo ${UNAME_MACHINE}-pc-aros
1358e120bd27Smrg	exit ;;
13599d0b5e55Smrg    x86_64:VMkernel:*:*)
13609d0b5e55Smrg	echo ${UNAME_MACHINE}-unknown-esx
13619d0b5e55Smrg	exit ;;
13626c321187Smrgesac
13636c321187Smrg
13646c321187Smrgeval $set_cc_for_build
13656c321187Smrgcat >$dummy.c <<EOF
13666c321187Smrg#ifdef _SEQUENT_
13676c321187Smrg# include <sys/types.h>
13686c321187Smrg# include <sys/utsname.h>
13696c321187Smrg#endif
13706c321187Smrgmain ()
13716c321187Smrg{
13726c321187Smrg#if defined (sony)
13736c321187Smrg#if defined (MIPSEB)
13746c321187Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
13756c321187Smrg     I don't know....  */
13766c321187Smrg  printf ("mips-sony-bsd\n"); exit (0);
13776c321187Smrg#else
13786c321187Smrg#include <sys/param.h>
13796c321187Smrg  printf ("m68k-sony-newsos%s\n",
13806c321187Smrg#ifdef NEWSOS4
13819d0b5e55Smrg	"4"
13826c321187Smrg#else
13839d0b5e55Smrg	""
13846c321187Smrg#endif
13859d0b5e55Smrg	); exit (0);
13866c321187Smrg#endif
13876c321187Smrg#endif
13886c321187Smrg
13896c321187Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
13906c321187Smrg  printf ("arm-acorn-riscix\n"); exit (0);
13916c321187Smrg#endif
13926c321187Smrg
13936c321187Smrg#if defined (hp300) && !defined (hpux)
13946c321187Smrg  printf ("m68k-hp-bsd\n"); exit (0);
13956c321187Smrg#endif
13966c321187Smrg
13976c321187Smrg#if defined (NeXT)
13986c321187Smrg#if !defined (__ARCHITECTURE__)
13996c321187Smrg#define __ARCHITECTURE__ "m68k"
14006c321187Smrg#endif
14016c321187Smrg  int version;
14026c321187Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
14036c321187Smrg  if (version < 4)
14046c321187Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
14056c321187Smrg  else
14066c321187Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
14076c321187Smrg  exit (0);
14086c321187Smrg#endif
14096c321187Smrg
14106c321187Smrg#if defined (MULTIMAX) || defined (n16)
14116c321187Smrg#if defined (UMAXV)
14126c321187Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
14136c321187Smrg#else
14146c321187Smrg#if defined (CMU)
14156c321187Smrg  printf ("ns32k-encore-mach\n"); exit (0);
14166c321187Smrg#else
14176c321187Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
14186c321187Smrg#endif
14196c321187Smrg#endif
14206c321187Smrg#endif
14216c321187Smrg
14226c321187Smrg#if defined (__386BSD__)
14236c321187Smrg  printf ("i386-pc-bsd\n"); exit (0);
14246c321187Smrg#endif
14256c321187Smrg
14266c321187Smrg#if defined (sequent)
14276c321187Smrg#if defined (i386)
14286c321187Smrg  printf ("i386-sequent-dynix\n"); exit (0);
14296c321187Smrg#endif
14306c321187Smrg#if defined (ns32000)
14316c321187Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
14326c321187Smrg#endif
14336c321187Smrg#endif
14346c321187Smrg
14356c321187Smrg#if defined (_SEQUENT_)
14366c321187Smrg    struct utsname un;
14376c321187Smrg
14386c321187Smrg    uname(&un);
14396c321187Smrg
14406c321187Smrg    if (strncmp(un.version, "V2", 2) == 0) {
14416c321187Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
14426c321187Smrg    }
14436c321187Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
14446c321187Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
14456c321187Smrg    }
14466c321187Smrg    printf ("i386-sequent-ptx\n"); exit (0);
14476c321187Smrg
14486c321187Smrg#endif
14496c321187Smrg
14506c321187Smrg#if defined (vax)
14516c321187Smrg# if !defined (ultrix)
14526c321187Smrg#  include <sys/param.h>
14536c321187Smrg#  if defined (BSD)
14546c321187Smrg#   if BSD == 43
14556c321187Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
14566c321187Smrg#   else
14576c321187Smrg#    if BSD == 199006
14586c321187Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
14596c321187Smrg#    else
14606c321187Smrg      printf ("vax-dec-bsd\n"); exit (0);
14616c321187Smrg#    endif
14626c321187Smrg#   endif
14636c321187Smrg#  else
14646c321187Smrg    printf ("vax-dec-bsd\n"); exit (0);
14656c321187Smrg#  endif
14666c321187Smrg# else
14676c321187Smrg    printf ("vax-dec-ultrix\n"); exit (0);
14686c321187Smrg# endif
14696c321187Smrg#endif
14706c321187Smrg
14716c321187Smrg#if defined (alliant) && defined (i860)
14726c321187Smrg  printf ("i860-alliant-bsd\n"); exit (0);
14736c321187Smrg#endif
14746c321187Smrg
14756c321187Smrg  exit (1);
14766c321187Smrg}
14776c321187SmrgEOF
14786c321187Smrg
14796c321187Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
14806c321187Smrg	{ echo "$SYSTEM_NAME"; exit; }
14816c321187Smrg
14826c321187Smrg# Apollos put the system type in the environment.
14836c321187Smrg
14846c321187Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
14856c321187Smrg
14866c321187Smrg# Convex versions that predate uname can use getsysinfo(1)
14876c321187Smrg
14886c321187Smrgif [ -x /usr/convex/getsysinfo ]
14896c321187Smrgthen
14906c321187Smrg    case `getsysinfo -f cpu_type` in
14916c321187Smrg    c1*)
14926c321187Smrg	echo c1-convex-bsd
14936c321187Smrg	exit ;;
14946c321187Smrg    c2*)
14956c321187Smrg	if getsysinfo -f scalar_acc
14966c321187Smrg	then echo c32-convex-bsd
14976c321187Smrg	else echo c2-convex-bsd
14986c321187Smrg	fi
14996c321187Smrg	exit ;;
15006c321187Smrg    c34*)
15016c321187Smrg	echo c34-convex-bsd
15026c321187Smrg	exit ;;
15036c321187Smrg    c38*)
15046c321187Smrg	echo c38-convex-bsd
15056c321187Smrg	exit ;;
15066c321187Smrg    c4*)
15076c321187Smrg	echo c4-convex-bsd
15086c321187Smrg	exit ;;
15096c321187Smrg    esac
15106c321187Smrgfi
15116c321187Smrg
15126c321187Smrgcat >&2 <<EOF
15136c321187Smrg$0: unable to guess system type
15146c321187Smrg
15156c321187SmrgThis script, last modified $timestamp, has failed to recognize
15166c321187Smrgthe operating system you are using. It is advised that you
15176c321187Smrgdownload the most up to date version of the config scripts from
15186c321187Smrg
151993493779Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
15206c321187Smrgand
152193493779Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
15226c321187Smrg
15236c321187SmrgIf the version you run ($0) is already up to date, please
15246c321187Smrgsend the following data and any information you think might be
15256c321187Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
15266c321187Smrginformation to handle your system.
15276c321187Smrg
15286c321187Smrgconfig.guess timestamp = $timestamp
15296c321187Smrg
15306c321187Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
15316c321187Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
15326c321187Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
15336c321187Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
15346c321187Smrg
15356c321187Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
15366c321187Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
15376c321187Smrg
15386c321187Smrghostinfo               = `(hostinfo) 2>/dev/null`
15396c321187Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
15406c321187Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
15416c321187Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
15426c321187Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
15436c321187Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
15446c321187Smrg
15456c321187SmrgUNAME_MACHINE = ${UNAME_MACHINE}
15466c321187SmrgUNAME_RELEASE = ${UNAME_RELEASE}
15476c321187SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
15486c321187SmrgUNAME_VERSION = ${UNAME_VERSION}
15496c321187SmrgEOF
15506c321187Smrg
15516c321187Smrgexit 1
15526c321187Smrg
15536c321187Smrg# Local variables:
15546c321187Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
15556c321187Smrg# time-stamp-start: "timestamp='"
15566c321187Smrg# time-stamp-format: "%:y-%02m-%02d"
15576c321187Smrg# time-stamp-end: "'"
15586c321187Smrg# End:
1559