config.guess revision 2227fc13
12227fc13Smrg#! /bin/sh
22227fc13Smrg# Attempt to guess a canonical system name.
32227fc13Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
42227fc13Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
52227fc13Smrg#   Free Software Foundation, Inc.
62227fc13Smrg
72227fc13Smrgtimestamp='2010-09-24'
82227fc13Smrg
92227fc13Smrg# This file is free software; you can redistribute it and/or modify it
102227fc13Smrg# under the terms of the GNU General Public License as published by
112227fc13Smrg# the Free Software Foundation; either version 2 of the License, or
122227fc13Smrg# (at your option) any later version.
132227fc13Smrg#
142227fc13Smrg# This program is distributed in the hope that it will be useful, but
152227fc13Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
162227fc13Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
172227fc13Smrg# General Public License for more details.
182227fc13Smrg#
192227fc13Smrg# You should have received a copy of the GNU General Public License
202227fc13Smrg# along with this program; if not, write to the Free Software
212227fc13Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
222227fc13Smrg# 02110-1301, USA.
232227fc13Smrg#
242227fc13Smrg# As a special exception to the GNU General Public License, if you
252227fc13Smrg# distribute this file as part of a program that contains a
262227fc13Smrg# configuration script generated by Autoconf, you may include it under
272227fc13Smrg# the same distribution terms that you use for the rest of that program.
282227fc13Smrg
292227fc13Smrg
302227fc13Smrg# Originally written by Per Bothner.  Please send patches (context
312227fc13Smrg# diff format) to <config-patches@gnu.org> and include a ChangeLog
322227fc13Smrg# entry.
332227fc13Smrg#
342227fc13Smrg# This script attempts to guess a canonical system name similar to
352227fc13Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
362227fc13Smrg# exits with 0.  Otherwise, it exits with 1.
372227fc13Smrg#
382227fc13Smrg# You can get the latest version of this script from:
392227fc13Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
402227fc13Smrg
412227fc13Smrgme=`echo "$0" | sed -e 's,.*/,,'`
422227fc13Smrg
432227fc13Smrgusage="\
442227fc13SmrgUsage: $0 [OPTION]
452227fc13Smrg
462227fc13SmrgOutput the configuration name of the system \`$me' is run on.
472227fc13Smrg
482227fc13SmrgOperation modes:
492227fc13Smrg  -h, --help         print this help, then exit
502227fc13Smrg  -t, --time-stamp   print date of last modification, then exit
512227fc13Smrg  -v, --version      print version number, then exit
522227fc13Smrg
532227fc13SmrgReport bugs and patches to <config-patches@gnu.org>."
542227fc13Smrg
552227fc13Smrgversion="\
562227fc13SmrgGNU config.guess ($timestamp)
572227fc13Smrg
582227fc13SmrgOriginally written by Per Bothner.
592227fc13SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
602227fc13Smrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
612227fc13SmrgSoftware Foundation, Inc.
622227fc13Smrg
632227fc13SmrgThis is free software; see the source for copying conditions.  There is NO
642227fc13Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
652227fc13Smrg
662227fc13Smrghelp="
672227fc13SmrgTry \`$me --help' for more information."
682227fc13Smrg
692227fc13Smrg# Parse command line
702227fc13Smrgwhile test $# -gt 0 ; do
712227fc13Smrg  case $1 in
722227fc13Smrg    --time-stamp | --time* | -t )
732227fc13Smrg       echo "$timestamp" ; exit ;;
742227fc13Smrg    --version | -v )
752227fc13Smrg       echo "$version" ; exit ;;
762227fc13Smrg    --help | --h* | -h )
772227fc13Smrg       echo "$usage"; exit ;;
782227fc13Smrg    -- )     # Stop option processing
792227fc13Smrg       shift; break ;;
802227fc13Smrg    - )	# Use stdin as input.
812227fc13Smrg       break ;;
822227fc13Smrg    -* )
832227fc13Smrg       echo "$me: invalid option $1$help" >&2
842227fc13Smrg       exit 1 ;;
852227fc13Smrg    * )
862227fc13Smrg       break ;;
872227fc13Smrg  esac
882227fc13Smrgdone
892227fc13Smrg
902227fc13Smrgif test $# != 0; then
912227fc13Smrg  echo "$me: too many arguments$help" >&2
922227fc13Smrg  exit 1
932227fc13Smrgfi
942227fc13Smrg
952227fc13Smrgtrap 'exit 1' HUP INT TERM
962227fc13Smrg
972227fc13Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
982227fc13Smrg# compiler to aid in system detection is discouraged as it requires
992227fc13Smrg# temporary files to be created and, as you can see below, it is a
1002227fc13Smrg# headache to deal with in a portable fashion.
1012227fc13Smrg
1022227fc13Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
1032227fc13Smrg# use `HOST_CC' if defined, but it is deprecated.
1042227fc13Smrg
1052227fc13Smrg# Portable tmp directory creation inspired by the Autoconf team.
1062227fc13Smrg
1072227fc13Smrgset_cc_for_build='
1082227fc13Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1092227fc13Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
1102227fc13Smrg: ${TMPDIR=/tmp} ;
1112227fc13Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1122227fc13Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1132227fc13Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1142227fc13Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1152227fc13Smrgdummy=$tmp/dummy ;
1162227fc13Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1172227fc13Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1182227fc13Smrg ,,)    echo "int x;" > $dummy.c ;
1192227fc13Smrg	for c in cc gcc c89 c99 ; do
1202227fc13Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1212227fc13Smrg	     CC_FOR_BUILD="$c"; break ;
1222227fc13Smrg	  fi ;
1232227fc13Smrg	done ;
1242227fc13Smrg	if test x"$CC_FOR_BUILD" = x ; then
1252227fc13Smrg	  CC_FOR_BUILD=no_compiler_found ;
1262227fc13Smrg	fi
1272227fc13Smrg	;;
1282227fc13Smrg ,,*)   CC_FOR_BUILD=$CC ;;
1292227fc13Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1302227fc13Smrgesac ; set_cc_for_build= ;'
1312227fc13Smrg
1322227fc13Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1332227fc13Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
1342227fc13Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1352227fc13Smrg	PATH=$PATH:/.attbin ; export PATH
1362227fc13Smrgfi
1372227fc13Smrg
1382227fc13SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1392227fc13SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1402227fc13SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1412227fc13SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1422227fc13Smrg
1432227fc13Smrgcase "${UNAME_SYSTEM}" in
1442227fc13SmrgLinux|GNU/*)
1452227fc13Smrg	eval $set_cc_for_build
1462227fc13Smrg	cat <<-EOF > $dummy.c
1472227fc13Smrg	#include <features.h>
1482227fc13Smrg	#ifdef __UCLIBC__
1492227fc13Smrg	# ifdef __UCLIBC_CONFIG_VERSION__
1502227fc13Smrg	LIBC=uclibc __UCLIBC_CONFIG_VERSION__
1512227fc13Smrg	# else
1522227fc13Smrg	LIBC=uclibc
1532227fc13Smrg	# endif
1542227fc13Smrg	#else
1552227fc13Smrg	# ifdef __dietlibc__
1562227fc13Smrg	LIBC=dietlibc
1572227fc13Smrg	# else
1582227fc13Smrg	LIBC=gnu
1592227fc13Smrg	# endif
1602227fc13Smrg	#endif
1612227fc13Smrg	EOF
1622227fc13Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
1632227fc13Smrg	;;
1642227fc13Smrgesac
1652227fc13Smrg
1662227fc13Smrg# Note: order is significant - the case branches are not exclusive.
1672227fc13Smrg
1682227fc13Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1692227fc13Smrg    *:NetBSD:*:*)
1702227fc13Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
1712227fc13Smrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
1722227fc13Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1732227fc13Smrg	# switched to ELF, *-*-netbsd* would select the old
1742227fc13Smrg	# object file format.  This provides both forward
1752227fc13Smrg	# compatibility and a consistent mechanism for selecting the
1762227fc13Smrg	# object file format.
1772227fc13Smrg	#
1782227fc13Smrg	# Note: NetBSD doesn't particularly care about the vendor
1792227fc13Smrg	# portion of the name.  We always set it to "unknown".
1802227fc13Smrg	sysctl="sysctl -n hw.machine_arch"
1812227fc13Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1822227fc13Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1832227fc13Smrg	case "${UNAME_MACHINE_ARCH}" in
1842227fc13Smrg	    armeb) machine=armeb-unknown ;;
1852227fc13Smrg	    arm*) machine=arm-unknown ;;
1862227fc13Smrg	    sh3el) machine=shl-unknown ;;
1872227fc13Smrg	    sh3eb) machine=sh-unknown ;;
1882227fc13Smrg	    sh5el) machine=sh5le-unknown ;;
1892227fc13Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1902227fc13Smrg	esac
1912227fc13Smrg	# The Operating System including object format, if it has switched
1922227fc13Smrg	# to ELF recently, or will in the future.
1932227fc13Smrg	case "${UNAME_MACHINE_ARCH}" in
1942227fc13Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1952227fc13Smrg		eval $set_cc_for_build
1962227fc13Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1972227fc13Smrg			| grep -q __ELF__
1982227fc13Smrg		then
1992227fc13Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
2002227fc13Smrg		    # Return netbsd for either.  FIX?
2012227fc13Smrg		    os=netbsd
2022227fc13Smrg		else
2032227fc13Smrg		    os=netbsdelf
2042227fc13Smrg		fi
2052227fc13Smrg		;;
2062227fc13Smrg	    *)
2072227fc13Smrg	        os=netbsd
2082227fc13Smrg		;;
2092227fc13Smrg	esac
2102227fc13Smrg	# The OS release
2112227fc13Smrg	# Debian GNU/NetBSD machines have a different userland, and
2122227fc13Smrg	# thus, need a distinct triplet. However, they do not need
2132227fc13Smrg	# kernel version information, so it can be replaced with a
2142227fc13Smrg	# suitable tag, in the style of linux-gnu.
2152227fc13Smrg	case "${UNAME_VERSION}" in
2162227fc13Smrg	    Debian*)
2172227fc13Smrg		release='-gnu'
2182227fc13Smrg		;;
2192227fc13Smrg	    *)
2202227fc13Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
2212227fc13Smrg		;;
2222227fc13Smrg	esac
2232227fc13Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2242227fc13Smrg	# contains redundant information, the shorter form:
2252227fc13Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2262227fc13Smrg	echo "${machine}-${os}${release}"
2272227fc13Smrg	exit ;;
2282227fc13Smrg    *:OpenBSD:*:*)
2292227fc13Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2302227fc13Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2312227fc13Smrg	exit ;;
2322227fc13Smrg    *:ekkoBSD:*:*)
2332227fc13Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2342227fc13Smrg	exit ;;
2352227fc13Smrg    *:SolidBSD:*:*)
2362227fc13Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2372227fc13Smrg	exit ;;
2382227fc13Smrg    macppc:MirBSD:*:*)
2392227fc13Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2402227fc13Smrg	exit ;;
2412227fc13Smrg    *:MirBSD:*:*)
2422227fc13Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2432227fc13Smrg	exit ;;
2442227fc13Smrg    alpha:OSF1:*:*)
2452227fc13Smrg	case $UNAME_RELEASE in
2462227fc13Smrg	*4.0)
2472227fc13Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2482227fc13Smrg		;;
2492227fc13Smrg	*5.*)
2502227fc13Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2512227fc13Smrg		;;
2522227fc13Smrg	esac
2532227fc13Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2542227fc13Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2552227fc13Smrg	# covers most systems running today.  This code pipes the CPU
2562227fc13Smrg	# types through head -n 1, so we only detect the type of CPU 0.
2572227fc13Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2582227fc13Smrg	case "$ALPHA_CPU_TYPE" in
2592227fc13Smrg	    "EV4 (21064)")
2602227fc13Smrg		UNAME_MACHINE="alpha" ;;
2612227fc13Smrg	    "EV4.5 (21064)")
2622227fc13Smrg		UNAME_MACHINE="alpha" ;;
2632227fc13Smrg	    "LCA4 (21066/21068)")
2642227fc13Smrg		UNAME_MACHINE="alpha" ;;
2652227fc13Smrg	    "EV5 (21164)")
2662227fc13Smrg		UNAME_MACHINE="alphaev5" ;;
2672227fc13Smrg	    "EV5.6 (21164A)")
2682227fc13Smrg		UNAME_MACHINE="alphaev56" ;;
2692227fc13Smrg	    "EV5.6 (21164PC)")
2702227fc13Smrg		UNAME_MACHINE="alphapca56" ;;
2712227fc13Smrg	    "EV5.7 (21164PC)")
2722227fc13Smrg		UNAME_MACHINE="alphapca57" ;;
2732227fc13Smrg	    "EV6 (21264)")
2742227fc13Smrg		UNAME_MACHINE="alphaev6" ;;
2752227fc13Smrg	    "EV6.7 (21264A)")
2762227fc13Smrg		UNAME_MACHINE="alphaev67" ;;
2772227fc13Smrg	    "EV6.8CB (21264C)")
2782227fc13Smrg		UNAME_MACHINE="alphaev68" ;;
2792227fc13Smrg	    "EV6.8AL (21264B)")
2802227fc13Smrg		UNAME_MACHINE="alphaev68" ;;
2812227fc13Smrg	    "EV6.8CX (21264D)")
2822227fc13Smrg		UNAME_MACHINE="alphaev68" ;;
2832227fc13Smrg	    "EV6.9A (21264/EV69A)")
2842227fc13Smrg		UNAME_MACHINE="alphaev69" ;;
2852227fc13Smrg	    "EV7 (21364)")
2862227fc13Smrg		UNAME_MACHINE="alphaev7" ;;
2872227fc13Smrg	    "EV7.9 (21364A)")
2882227fc13Smrg		UNAME_MACHINE="alphaev79" ;;
2892227fc13Smrg	esac
2902227fc13Smrg	# A Pn.n version is a patched version.
2912227fc13Smrg	# A Vn.n version is a released version.
2922227fc13Smrg	# A Tn.n version is a released field test version.
2932227fc13Smrg	# A Xn.n version is an unreleased experimental baselevel.
2942227fc13Smrg	# 1.2 uses "1.2" for uname -r.
2952227fc13Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2962227fc13Smrg	exit ;;
2972227fc13Smrg    Alpha\ *:Windows_NT*:*)
2982227fc13Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
2992227fc13Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
3002227fc13Smrg	# of the specific Alpha model?
3012227fc13Smrg	echo alpha-pc-interix
3022227fc13Smrg	exit ;;
3032227fc13Smrg    21064:Windows_NT:50:3)
3042227fc13Smrg	echo alpha-dec-winnt3.5
3052227fc13Smrg	exit ;;
3062227fc13Smrg    Amiga*:UNIX_System_V:4.0:*)
3072227fc13Smrg	echo m68k-unknown-sysv4
3082227fc13Smrg	exit ;;
3092227fc13Smrg    *:[Aa]miga[Oo][Ss]:*:*)
3102227fc13Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
3112227fc13Smrg	exit ;;
3122227fc13Smrg    *:[Mm]orph[Oo][Ss]:*:*)
3132227fc13Smrg	echo ${UNAME_MACHINE}-unknown-morphos
3142227fc13Smrg	exit ;;
3152227fc13Smrg    *:OS/390:*:*)
3162227fc13Smrg	echo i370-ibm-openedition
3172227fc13Smrg	exit ;;
3182227fc13Smrg    *:z/VM:*:*)
3192227fc13Smrg	echo s390-ibm-zvmoe
3202227fc13Smrg	exit ;;
3212227fc13Smrg    *:OS400:*:*)
3222227fc13Smrg        echo powerpc-ibm-os400
3232227fc13Smrg	exit ;;
3242227fc13Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3252227fc13Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
3262227fc13Smrg	exit ;;
3272227fc13Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
3282227fc13Smrg	echo arm-unknown-riscos
3292227fc13Smrg	exit ;;
3302227fc13Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3312227fc13Smrg	echo hppa1.1-hitachi-hiuxmpp
3322227fc13Smrg	exit ;;
3332227fc13Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3342227fc13Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3352227fc13Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3362227fc13Smrg		echo pyramid-pyramid-sysv3
3372227fc13Smrg	else
3382227fc13Smrg		echo pyramid-pyramid-bsd
3392227fc13Smrg	fi
3402227fc13Smrg	exit ;;
3412227fc13Smrg    NILE*:*:*:dcosx)
3422227fc13Smrg	echo pyramid-pyramid-svr4
3432227fc13Smrg	exit ;;
3442227fc13Smrg    DRS?6000:unix:4.0:6*)
3452227fc13Smrg	echo sparc-icl-nx6
3462227fc13Smrg	exit ;;
3472227fc13Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3482227fc13Smrg	case `/usr/bin/uname -p` in
3492227fc13Smrg	    sparc) echo sparc-icl-nx7; exit ;;
3502227fc13Smrg	esac ;;
3512227fc13Smrg    s390x:SunOS:*:*)
3522227fc13Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3532227fc13Smrg	exit ;;
3542227fc13Smrg    sun4H:SunOS:5.*:*)
3552227fc13Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3562227fc13Smrg	exit ;;
3572227fc13Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3582227fc13Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3592227fc13Smrg	exit ;;
3602227fc13Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
3612227fc13Smrg	echo i386-pc-auroraux${UNAME_RELEASE}
3622227fc13Smrg	exit ;;
3632227fc13Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3642227fc13Smrg	eval $set_cc_for_build
3652227fc13Smrg	SUN_ARCH="i386"
3662227fc13Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
3672227fc13Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
3682227fc13Smrg	# This test works for both compilers.
3692227fc13Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
3702227fc13Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
3712227fc13Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
3722227fc13Smrg		grep IS_64BIT_ARCH >/dev/null
3732227fc13Smrg	    then
3742227fc13Smrg		SUN_ARCH="x86_64"
3752227fc13Smrg	    fi
3762227fc13Smrg	fi
3772227fc13Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3782227fc13Smrg	exit ;;
3792227fc13Smrg    sun4*:SunOS:6*:*)
3802227fc13Smrg	# According to config.sub, this is the proper way to canonicalize
3812227fc13Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3822227fc13Smrg	# it's likely to be more like Solaris than SunOS4.
3832227fc13Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3842227fc13Smrg	exit ;;
3852227fc13Smrg    sun4*:SunOS:*:*)
3862227fc13Smrg	case "`/usr/bin/arch -k`" in
3872227fc13Smrg	    Series*|S4*)
3882227fc13Smrg		UNAME_RELEASE=`uname -v`
3892227fc13Smrg		;;
3902227fc13Smrg	esac
3912227fc13Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
3922227fc13Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3932227fc13Smrg	exit ;;
3942227fc13Smrg    sun3*:SunOS:*:*)
3952227fc13Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
3962227fc13Smrg	exit ;;
3972227fc13Smrg    sun*:*:4.2BSD:*)
3982227fc13Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3992227fc13Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
4002227fc13Smrg	case "`/bin/arch`" in
4012227fc13Smrg	    sun3)
4022227fc13Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
4032227fc13Smrg		;;
4042227fc13Smrg	    sun4)
4052227fc13Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
4062227fc13Smrg		;;
4072227fc13Smrg	esac
4082227fc13Smrg	exit ;;
4092227fc13Smrg    aushp:SunOS:*:*)
4102227fc13Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
4112227fc13Smrg	exit ;;
4122227fc13Smrg    # The situation for MiNT is a little confusing.  The machine name
4132227fc13Smrg    # can be virtually everything (everything which is not
4142227fc13Smrg    # "atarist" or "atariste" at least should have a processor
4152227fc13Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
4162227fc13Smrg    # to the lowercase version "mint" (or "freemint").  Finally
4172227fc13Smrg    # the system name "TOS" denotes a system which is actually not
4182227fc13Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
4192227fc13Smrg    # be no problem.
4202227fc13Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4212227fc13Smrg        echo m68k-atari-mint${UNAME_RELEASE}
4222227fc13Smrg	exit ;;
4232227fc13Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4242227fc13Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4252227fc13Smrg        exit ;;
4262227fc13Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4272227fc13Smrg        echo m68k-atari-mint${UNAME_RELEASE}
4282227fc13Smrg	exit ;;
4292227fc13Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4302227fc13Smrg        echo m68k-milan-mint${UNAME_RELEASE}
4312227fc13Smrg        exit ;;
4322227fc13Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4332227fc13Smrg        echo m68k-hades-mint${UNAME_RELEASE}
4342227fc13Smrg        exit ;;
4352227fc13Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4362227fc13Smrg        echo m68k-unknown-mint${UNAME_RELEASE}
4372227fc13Smrg        exit ;;
4382227fc13Smrg    m68k:machten:*:*)
4392227fc13Smrg	echo m68k-apple-machten${UNAME_RELEASE}
4402227fc13Smrg	exit ;;
4412227fc13Smrg    powerpc:machten:*:*)
4422227fc13Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
4432227fc13Smrg	exit ;;
4442227fc13Smrg    RISC*:Mach:*:*)
4452227fc13Smrg	echo mips-dec-mach_bsd4.3
4462227fc13Smrg	exit ;;
4472227fc13Smrg    RISC*:ULTRIX:*:*)
4482227fc13Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
4492227fc13Smrg	exit ;;
4502227fc13Smrg    VAX*:ULTRIX*:*:*)
4512227fc13Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
4522227fc13Smrg	exit ;;
4532227fc13Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4542227fc13Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4552227fc13Smrg	exit ;;
4562227fc13Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4572227fc13Smrg	eval $set_cc_for_build
4582227fc13Smrg	sed 's/^	//' << EOF >$dummy.c
4592227fc13Smrg#ifdef __cplusplus
4602227fc13Smrg#include <stdio.h>  /* for printf() prototype */
4612227fc13Smrg	int main (int argc, char *argv[]) {
4622227fc13Smrg#else
4632227fc13Smrg	int main (argc, argv) int argc; char *argv[]; {
4642227fc13Smrg#endif
4652227fc13Smrg	#if defined (host_mips) && defined (MIPSEB)
4662227fc13Smrg	#if defined (SYSTYPE_SYSV)
4672227fc13Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4682227fc13Smrg	#endif
4692227fc13Smrg	#if defined (SYSTYPE_SVR4)
4702227fc13Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4712227fc13Smrg	#endif
4722227fc13Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4732227fc13Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4742227fc13Smrg	#endif
4752227fc13Smrg	#endif
4762227fc13Smrg	  exit (-1);
4772227fc13Smrg	}
4782227fc13SmrgEOF
4792227fc13Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4802227fc13Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4812227fc13Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4822227fc13Smrg	    { echo "$SYSTEM_NAME"; exit; }
4832227fc13Smrg	echo mips-mips-riscos${UNAME_RELEASE}
4842227fc13Smrg	exit ;;
4852227fc13Smrg    Motorola:PowerMAX_OS:*:*)
4862227fc13Smrg	echo powerpc-motorola-powermax
4872227fc13Smrg	exit ;;
4882227fc13Smrg    Motorola:*:4.3:PL8-*)
4892227fc13Smrg	echo powerpc-harris-powermax
4902227fc13Smrg	exit ;;
4912227fc13Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4922227fc13Smrg	echo powerpc-harris-powermax
4932227fc13Smrg	exit ;;
4942227fc13Smrg    Night_Hawk:Power_UNIX:*:*)
4952227fc13Smrg	echo powerpc-harris-powerunix
4962227fc13Smrg	exit ;;
4972227fc13Smrg    m88k:CX/UX:7*:*)
4982227fc13Smrg	echo m88k-harris-cxux7
4992227fc13Smrg	exit ;;
5002227fc13Smrg    m88k:*:4*:R4*)
5012227fc13Smrg	echo m88k-motorola-sysv4
5022227fc13Smrg	exit ;;
5032227fc13Smrg    m88k:*:3*:R3*)
5042227fc13Smrg	echo m88k-motorola-sysv3
5052227fc13Smrg	exit ;;
5062227fc13Smrg    AViiON:dgux:*:*)
5072227fc13Smrg        # DG/UX returns AViiON for all architectures
5082227fc13Smrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
5092227fc13Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
5102227fc13Smrg	then
5112227fc13Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
5122227fc13Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
5132227fc13Smrg	    then
5142227fc13Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
5152227fc13Smrg	    else
5162227fc13Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
5172227fc13Smrg	    fi
5182227fc13Smrg	else
5192227fc13Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
5202227fc13Smrg	fi
5212227fc13Smrg 	exit ;;
5222227fc13Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
5232227fc13Smrg	echo m88k-dolphin-sysv3
5242227fc13Smrg	exit ;;
5252227fc13Smrg    M88*:*:R3*:*)
5262227fc13Smrg	# Delta 88k system running SVR3
5272227fc13Smrg	echo m88k-motorola-sysv3
5282227fc13Smrg	exit ;;
5292227fc13Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5302227fc13Smrg	echo m88k-tektronix-sysv3
5312227fc13Smrg	exit ;;
5322227fc13Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5332227fc13Smrg	echo m68k-tektronix-bsd
5342227fc13Smrg	exit ;;
5352227fc13Smrg    *:IRIX*:*:*)
5362227fc13Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5372227fc13Smrg	exit ;;
5382227fc13Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5392227fc13Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5402227fc13Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5412227fc13Smrg    i*86:AIX:*:*)
5422227fc13Smrg	echo i386-ibm-aix
5432227fc13Smrg	exit ;;
5442227fc13Smrg    ia64:AIX:*:*)
5452227fc13Smrg	if [ -x /usr/bin/oslevel ] ; then
5462227fc13Smrg		IBM_REV=`/usr/bin/oslevel`
5472227fc13Smrg	else
5482227fc13Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5492227fc13Smrg	fi
5502227fc13Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5512227fc13Smrg	exit ;;
5522227fc13Smrg    *:AIX:2:3)
5532227fc13Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5542227fc13Smrg		eval $set_cc_for_build
5552227fc13Smrg		sed 's/^		//' << EOF >$dummy.c
5562227fc13Smrg		#include <sys/systemcfg.h>
5572227fc13Smrg
5582227fc13Smrg		main()
5592227fc13Smrg			{
5602227fc13Smrg			if (!__power_pc())
5612227fc13Smrg				exit(1);
5622227fc13Smrg			puts("powerpc-ibm-aix3.2.5");
5632227fc13Smrg			exit(0);
5642227fc13Smrg			}
5652227fc13SmrgEOF
5662227fc13Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5672227fc13Smrg		then
5682227fc13Smrg			echo "$SYSTEM_NAME"
5692227fc13Smrg		else
5702227fc13Smrg			echo rs6000-ibm-aix3.2.5
5712227fc13Smrg		fi
5722227fc13Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5732227fc13Smrg		echo rs6000-ibm-aix3.2.4
5742227fc13Smrg	else
5752227fc13Smrg		echo rs6000-ibm-aix3.2
5762227fc13Smrg	fi
5772227fc13Smrg	exit ;;
5782227fc13Smrg    *:AIX:*:[4567])
5792227fc13Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5802227fc13Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5812227fc13Smrg		IBM_ARCH=rs6000
5822227fc13Smrg	else
5832227fc13Smrg		IBM_ARCH=powerpc
5842227fc13Smrg	fi
5852227fc13Smrg	if [ -x /usr/bin/oslevel ] ; then
5862227fc13Smrg		IBM_REV=`/usr/bin/oslevel`
5872227fc13Smrg	else
5882227fc13Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5892227fc13Smrg	fi
5902227fc13Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5912227fc13Smrg	exit ;;
5922227fc13Smrg    *:AIX:*:*)
5932227fc13Smrg	echo rs6000-ibm-aix
5942227fc13Smrg	exit ;;
5952227fc13Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5962227fc13Smrg	echo romp-ibm-bsd4.4
5972227fc13Smrg	exit ;;
5982227fc13Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5992227fc13Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
6002227fc13Smrg	exit ;;                             # report: romp-ibm BSD 4.3
6012227fc13Smrg    *:BOSX:*:*)
6022227fc13Smrg	echo rs6000-bull-bosx
6032227fc13Smrg	exit ;;
6042227fc13Smrg    DPX/2?00:B.O.S.:*:*)
6052227fc13Smrg	echo m68k-bull-sysv3
6062227fc13Smrg	exit ;;
6072227fc13Smrg    9000/[34]??:4.3bsd:1.*:*)
6082227fc13Smrg	echo m68k-hp-bsd
6092227fc13Smrg	exit ;;
6102227fc13Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
6112227fc13Smrg	echo m68k-hp-bsd4.4
6122227fc13Smrg	exit ;;
6132227fc13Smrg    9000/[34678]??:HP-UX:*:*)
6142227fc13Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6152227fc13Smrg	case "${UNAME_MACHINE}" in
6162227fc13Smrg	    9000/31? )            HP_ARCH=m68000 ;;
6172227fc13Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
6182227fc13Smrg	    9000/[678][0-9][0-9])
6192227fc13Smrg		if [ -x /usr/bin/getconf ]; then
6202227fc13Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
6212227fc13Smrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
6222227fc13Smrg                    case "${sc_cpu_version}" in
6232227fc13Smrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
6242227fc13Smrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
6252227fc13Smrg                      532)                      # CPU_PA_RISC2_0
6262227fc13Smrg                        case "${sc_kernel_bits}" in
6272227fc13Smrg                          32) HP_ARCH="hppa2.0n" ;;
6282227fc13Smrg                          64) HP_ARCH="hppa2.0w" ;;
6292227fc13Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
6302227fc13Smrg                        esac ;;
6312227fc13Smrg                    esac
6322227fc13Smrg		fi
6332227fc13Smrg		if [ "${HP_ARCH}" = "" ]; then
6342227fc13Smrg		    eval $set_cc_for_build
6352227fc13Smrg		    sed 's/^              //' << EOF >$dummy.c
6362227fc13Smrg
6372227fc13Smrg              #define _HPUX_SOURCE
6382227fc13Smrg              #include <stdlib.h>
6392227fc13Smrg              #include <unistd.h>
6402227fc13Smrg
6412227fc13Smrg              int main ()
6422227fc13Smrg              {
6432227fc13Smrg              #if defined(_SC_KERNEL_BITS)
6442227fc13Smrg                  long bits = sysconf(_SC_KERNEL_BITS);
6452227fc13Smrg              #endif
6462227fc13Smrg                  long cpu  = sysconf (_SC_CPU_VERSION);
6472227fc13Smrg
6482227fc13Smrg                  switch (cpu)
6492227fc13Smrg              	{
6502227fc13Smrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6512227fc13Smrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6522227fc13Smrg              	case CPU_PA_RISC2_0:
6532227fc13Smrg              #if defined(_SC_KERNEL_BITS)
6542227fc13Smrg              	    switch (bits)
6552227fc13Smrg              		{
6562227fc13Smrg              		case 64: puts ("hppa2.0w"); break;
6572227fc13Smrg              		case 32: puts ("hppa2.0n"); break;
6582227fc13Smrg              		default: puts ("hppa2.0"); break;
6592227fc13Smrg              		} break;
6602227fc13Smrg              #else  /* !defined(_SC_KERNEL_BITS) */
6612227fc13Smrg              	    puts ("hppa2.0"); break;
6622227fc13Smrg              #endif
6632227fc13Smrg              	default: puts ("hppa1.0"); break;
6642227fc13Smrg              	}
6652227fc13Smrg                  exit (0);
6662227fc13Smrg              }
6672227fc13SmrgEOF
6682227fc13Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6692227fc13Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6702227fc13Smrg		fi ;;
6712227fc13Smrg	esac
6722227fc13Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
6732227fc13Smrg	then
6742227fc13Smrg	    eval $set_cc_for_build
6752227fc13Smrg
6762227fc13Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6772227fc13Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6782227fc13Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6792227fc13Smrg	    #
6802227fc13Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
6812227fc13Smrg	    # => hppa2.0w-hp-hpux11.23
6822227fc13Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6832227fc13Smrg	    # => hppa64-hp-hpux11.23
6842227fc13Smrg
6852227fc13Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
6862227fc13Smrg		grep -q __LP64__
6872227fc13Smrg	    then
6882227fc13Smrg		HP_ARCH="hppa2.0w"
6892227fc13Smrg	    else
6902227fc13Smrg		HP_ARCH="hppa64"
6912227fc13Smrg	    fi
6922227fc13Smrg	fi
6932227fc13Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6942227fc13Smrg	exit ;;
6952227fc13Smrg    ia64:HP-UX:*:*)
6962227fc13Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6972227fc13Smrg	echo ia64-hp-hpux${HPUX_REV}
6982227fc13Smrg	exit ;;
6992227fc13Smrg    3050*:HI-UX:*:*)
7002227fc13Smrg	eval $set_cc_for_build
7012227fc13Smrg	sed 's/^	//' << EOF >$dummy.c
7022227fc13Smrg	#include <unistd.h>
7032227fc13Smrg	int
7042227fc13Smrg	main ()
7052227fc13Smrg	{
7062227fc13Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
7072227fc13Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7082227fc13Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7092227fc13Smrg	     results, however.  */
7102227fc13Smrg	  if (CPU_IS_PA_RISC (cpu))
7112227fc13Smrg	    {
7122227fc13Smrg	      switch (cpu)
7132227fc13Smrg		{
7142227fc13Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7152227fc13Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7162227fc13Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7172227fc13Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7182227fc13Smrg		}
7192227fc13Smrg	    }
7202227fc13Smrg	  else if (CPU_IS_HP_MC68K (cpu))
7212227fc13Smrg	    puts ("m68k-hitachi-hiuxwe2");
7222227fc13Smrg	  else puts ("unknown-hitachi-hiuxwe2");
7232227fc13Smrg	  exit (0);
7242227fc13Smrg	}
7252227fc13SmrgEOF
7262227fc13Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7272227fc13Smrg		{ echo "$SYSTEM_NAME"; exit; }
7282227fc13Smrg	echo unknown-hitachi-hiuxwe2
7292227fc13Smrg	exit ;;
7302227fc13Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
7312227fc13Smrg	echo hppa1.1-hp-bsd
7322227fc13Smrg	exit ;;
7332227fc13Smrg    9000/8??:4.3bsd:*:*)
7342227fc13Smrg	echo hppa1.0-hp-bsd
7352227fc13Smrg	exit ;;
7362227fc13Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7372227fc13Smrg	echo hppa1.0-hp-mpeix
7382227fc13Smrg	exit ;;
7392227fc13Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7402227fc13Smrg	echo hppa1.1-hp-osf
7412227fc13Smrg	exit ;;
7422227fc13Smrg    hp8??:OSF1:*:*)
7432227fc13Smrg	echo hppa1.0-hp-osf
7442227fc13Smrg	exit ;;
7452227fc13Smrg    i*86:OSF1:*:*)
7462227fc13Smrg	if [ -x /usr/sbin/sysversion ] ; then
7472227fc13Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
7482227fc13Smrg	else
7492227fc13Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
7502227fc13Smrg	fi
7512227fc13Smrg	exit ;;
7522227fc13Smrg    parisc*:Lites*:*:*)
7532227fc13Smrg	echo hppa1.1-hp-lites
7542227fc13Smrg	exit ;;
7552227fc13Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7562227fc13Smrg	echo c1-convex-bsd
7572227fc13Smrg        exit ;;
7582227fc13Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7592227fc13Smrg	if getsysinfo -f scalar_acc
7602227fc13Smrg	then echo c32-convex-bsd
7612227fc13Smrg	else echo c2-convex-bsd
7622227fc13Smrg	fi
7632227fc13Smrg        exit ;;
7642227fc13Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7652227fc13Smrg	echo c34-convex-bsd
7662227fc13Smrg        exit ;;
7672227fc13Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7682227fc13Smrg	echo c38-convex-bsd
7692227fc13Smrg        exit ;;
7702227fc13Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7712227fc13Smrg	echo c4-convex-bsd
7722227fc13Smrg        exit ;;
7732227fc13Smrg    CRAY*Y-MP:*:*:*)
7742227fc13Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7752227fc13Smrg	exit ;;
7762227fc13Smrg    CRAY*[A-Z]90:*:*:*)
7772227fc13Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7782227fc13Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7792227fc13Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7802227fc13Smrg	      -e 's/\.[^.]*$/.X/'
7812227fc13Smrg	exit ;;
7822227fc13Smrg    CRAY*TS:*:*:*)
7832227fc13Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7842227fc13Smrg	exit ;;
7852227fc13Smrg    CRAY*T3E:*:*:*)
7862227fc13Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7872227fc13Smrg	exit ;;
7882227fc13Smrg    CRAY*SV1:*:*:*)
7892227fc13Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7902227fc13Smrg	exit ;;
7912227fc13Smrg    *:UNICOS/mp:*:*)
7922227fc13Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7932227fc13Smrg	exit ;;
7942227fc13Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7952227fc13Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7962227fc13Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7972227fc13Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7982227fc13Smrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7992227fc13Smrg        exit ;;
8002227fc13Smrg    5000:UNIX_System_V:4.*:*)
8012227fc13Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
8022227fc13Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
8032227fc13Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
8042227fc13Smrg	exit ;;
8052227fc13Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
8062227fc13Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
8072227fc13Smrg	exit ;;
8082227fc13Smrg    sparc*:BSD/OS:*:*)
8092227fc13Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
8102227fc13Smrg	exit ;;
8112227fc13Smrg    *:BSD/OS:*:*)
8122227fc13Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
8132227fc13Smrg	exit ;;
8142227fc13Smrg    *:FreeBSD:*:*)
8152227fc13Smrg	case ${UNAME_MACHINE} in
8162227fc13Smrg	    pc98)
8172227fc13Smrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8182227fc13Smrg	    amd64)
8192227fc13Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8202227fc13Smrg	    *)
8212227fc13Smrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8222227fc13Smrg	esac
8232227fc13Smrg	exit ;;
8242227fc13Smrg    i*:CYGWIN*:*)
8252227fc13Smrg	echo ${UNAME_MACHINE}-pc-cygwin
8262227fc13Smrg	exit ;;
8272227fc13Smrg    *:MINGW*:*)
8282227fc13Smrg	echo ${UNAME_MACHINE}-pc-mingw32
8292227fc13Smrg	exit ;;
8302227fc13Smrg    i*:windows32*:*)
8312227fc13Smrg    	# uname -m includes "-pc" on this system.
8322227fc13Smrg    	echo ${UNAME_MACHINE}-mingw32
8332227fc13Smrg	exit ;;
8342227fc13Smrg    i*:PW*:*)
8352227fc13Smrg	echo ${UNAME_MACHINE}-pc-pw32
8362227fc13Smrg	exit ;;
8372227fc13Smrg    *:Interix*:*)
8382227fc13Smrg    	case ${UNAME_MACHINE} in
8392227fc13Smrg	    x86)
8402227fc13Smrg		echo i586-pc-interix${UNAME_RELEASE}
8412227fc13Smrg		exit ;;
8422227fc13Smrg	    authenticamd | genuineintel | EM64T)
8432227fc13Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
8442227fc13Smrg		exit ;;
8452227fc13Smrg	    IA64)
8462227fc13Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
8472227fc13Smrg		exit ;;
8482227fc13Smrg	esac ;;
8492227fc13Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
8502227fc13Smrg	echo i${UNAME_MACHINE}-pc-mks
8512227fc13Smrg	exit ;;
8522227fc13Smrg    8664:Windows_NT:*)
8532227fc13Smrg	echo x86_64-pc-mks
8542227fc13Smrg	exit ;;
8552227fc13Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
8562227fc13Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
8572227fc13Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8582227fc13Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
8592227fc13Smrg	echo i586-pc-interix
8602227fc13Smrg	exit ;;
8612227fc13Smrg    i*:UWIN*:*)
8622227fc13Smrg	echo ${UNAME_MACHINE}-pc-uwin
8632227fc13Smrg	exit ;;
8642227fc13Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8652227fc13Smrg	echo x86_64-unknown-cygwin
8662227fc13Smrg	exit ;;
8672227fc13Smrg    p*:CYGWIN*:*)
8682227fc13Smrg	echo powerpcle-unknown-cygwin
8692227fc13Smrg	exit ;;
8702227fc13Smrg    prep*:SunOS:5.*:*)
8712227fc13Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8722227fc13Smrg	exit ;;
8732227fc13Smrg    *:GNU:*:*)
8742227fc13Smrg	# the GNU system
8752227fc13Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8762227fc13Smrg	exit ;;
8772227fc13Smrg    *:GNU/*:*:*)
8782227fc13Smrg	# other systems with GNU libc and userland
8792227fc13Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
8802227fc13Smrg	exit ;;
8812227fc13Smrg    i*86:Minix:*:*)
8822227fc13Smrg	echo ${UNAME_MACHINE}-pc-minix
8832227fc13Smrg	exit ;;
8842227fc13Smrg    alpha:Linux:*:*)
8852227fc13Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
8862227fc13Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
8872227fc13Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
8882227fc13Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
8892227fc13Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
8902227fc13Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
8912227fc13Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
8922227fc13Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
8932227fc13Smrg        esac
8942227fc13Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
8952227fc13Smrg	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
8962227fc13Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
8972227fc13Smrg	exit ;;
8982227fc13Smrg    arm*:Linux:*:*)
8992227fc13Smrg	eval $set_cc_for_build
9002227fc13Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
9012227fc13Smrg	    | grep -q __ARM_EABI__
9022227fc13Smrg	then
9032227fc13Smrg	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9042227fc13Smrg	else
9052227fc13Smrg	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
9062227fc13Smrg	fi
9072227fc13Smrg	exit ;;
9082227fc13Smrg    avr32*:Linux:*:*)
9092227fc13Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9102227fc13Smrg	exit ;;
9112227fc13Smrg    cris:Linux:*:*)
9122227fc13Smrg	echo cris-axis-linux-${LIBC}
9132227fc13Smrg	exit ;;
9142227fc13Smrg    crisv32:Linux:*:*)
9152227fc13Smrg	echo crisv32-axis-linux-${LIBC}
9162227fc13Smrg	exit ;;
9172227fc13Smrg    frv:Linux:*:*)
9182227fc13Smrg    	echo frv-unknown-linux-${LIBC}
9192227fc13Smrg	exit ;;
9202227fc13Smrg    i*86:Linux:*:*)
9212227fc13Smrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
9222227fc13Smrg	exit ;;
9232227fc13Smrg    ia64:Linux:*:*)
9242227fc13Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9252227fc13Smrg	exit ;;
9262227fc13Smrg    m32r*:Linux:*:*)
9272227fc13Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9282227fc13Smrg	exit ;;
9292227fc13Smrg    m68*:Linux:*:*)
9302227fc13Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9312227fc13Smrg	exit ;;
9322227fc13Smrg    mips:Linux:*:* | mips64:Linux:*:*)
9332227fc13Smrg	eval $set_cc_for_build
9342227fc13Smrg	sed 's/^	//' << EOF >$dummy.c
9352227fc13Smrg	#undef CPU
9362227fc13Smrg	#undef ${UNAME_MACHINE}
9372227fc13Smrg	#undef ${UNAME_MACHINE}el
9382227fc13Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
9392227fc13Smrg	CPU=${UNAME_MACHINE}el
9402227fc13Smrg	#else
9412227fc13Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9422227fc13Smrg	CPU=${UNAME_MACHINE}
9432227fc13Smrg	#else
9442227fc13Smrg	CPU=
9452227fc13Smrg	#endif
9462227fc13Smrg	#endif
9472227fc13SmrgEOF
9482227fc13Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
9492227fc13Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
9502227fc13Smrg	;;
9512227fc13Smrg    or32:Linux:*:*)
9522227fc13Smrg	echo or32-unknown-linux-${LIBC}
9532227fc13Smrg	exit ;;
9542227fc13Smrg    padre:Linux:*:*)
9552227fc13Smrg	echo sparc-unknown-linux-${LIBC}
9562227fc13Smrg	exit ;;
9572227fc13Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
9582227fc13Smrg	echo hppa64-unknown-linux-${LIBC}
9592227fc13Smrg	exit ;;
9602227fc13Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
9612227fc13Smrg	# Look for CPU level
9622227fc13Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9632227fc13Smrg	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
9642227fc13Smrg	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
9652227fc13Smrg	  *)    echo hppa-unknown-linux-${LIBC} ;;
9662227fc13Smrg	esac
9672227fc13Smrg	exit ;;
9682227fc13Smrg    ppc64:Linux:*:*)
9692227fc13Smrg	echo powerpc64-unknown-linux-${LIBC}
9702227fc13Smrg	exit ;;
9712227fc13Smrg    ppc:Linux:*:*)
9722227fc13Smrg	echo powerpc-unknown-linux-${LIBC}
9732227fc13Smrg	exit ;;
9742227fc13Smrg    s390:Linux:*:* | s390x:Linux:*:*)
9752227fc13Smrg	echo ${UNAME_MACHINE}-ibm-linux
9762227fc13Smrg	exit ;;
9772227fc13Smrg    sh64*:Linux:*:*)
9782227fc13Smrg    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9792227fc13Smrg	exit ;;
9802227fc13Smrg    sh*:Linux:*:*)
9812227fc13Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9822227fc13Smrg	exit ;;
9832227fc13Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
9842227fc13Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9852227fc13Smrg	exit ;;
9862227fc13Smrg    tile*:Linux:*:*)
9872227fc13Smrg	echo ${UNAME_MACHINE}-tilera-linux-gnu
9882227fc13Smrg	exit ;;
9892227fc13Smrg    vax:Linux:*:*)
9902227fc13Smrg	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
9912227fc13Smrg	exit ;;
9922227fc13Smrg    x86_64:Linux:*:*)
9932227fc13Smrg	echo x86_64-unknown-linux-${LIBC}
9942227fc13Smrg	exit ;;
9952227fc13Smrg    xtensa*:Linux:*:*)
9962227fc13Smrg    	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9972227fc13Smrg	exit ;;
9982227fc13Smrg    i*86:DYNIX/ptx:4*:*)
9992227fc13Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10002227fc13Smrg	# earlier versions are messed up and put the nodename in both
10012227fc13Smrg	# sysname and nodename.
10022227fc13Smrg	echo i386-sequent-sysv4
10032227fc13Smrg	exit ;;
10042227fc13Smrg    i*86:UNIX_SV:4.2MP:2.*)
10052227fc13Smrg        # Unixware is an offshoot of SVR4, but it has its own version
10062227fc13Smrg        # number series starting with 2...
10072227fc13Smrg        # I am not positive that other SVR4 systems won't match this,
10082227fc13Smrg	# I just have to hope.  -- rms.
10092227fc13Smrg        # Use sysv4.2uw... so that sysv4* matches it.
10102227fc13Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10112227fc13Smrg	exit ;;
10122227fc13Smrg    i*86:OS/2:*:*)
10132227fc13Smrg	# If we were able to find `uname', then EMX Unix compatibility
10142227fc13Smrg	# is probably installed.
10152227fc13Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
10162227fc13Smrg	exit ;;
10172227fc13Smrg    i*86:XTS-300:*:STOP)
10182227fc13Smrg	echo ${UNAME_MACHINE}-unknown-stop
10192227fc13Smrg	exit ;;
10202227fc13Smrg    i*86:atheos:*:*)
10212227fc13Smrg	echo ${UNAME_MACHINE}-unknown-atheos
10222227fc13Smrg	exit ;;
10232227fc13Smrg    i*86:syllable:*:*)
10242227fc13Smrg	echo ${UNAME_MACHINE}-pc-syllable
10252227fc13Smrg	exit ;;
10262227fc13Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
10272227fc13Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10282227fc13Smrg	exit ;;
10292227fc13Smrg    i*86:*DOS:*:*)
10302227fc13Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10312227fc13Smrg	exit ;;
10322227fc13Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10332227fc13Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10342227fc13Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10352227fc13Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10362227fc13Smrg	else
10372227fc13Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10382227fc13Smrg	fi
10392227fc13Smrg	exit ;;
10402227fc13Smrg    i*86:*:5:[678]*)
10412227fc13Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10422227fc13Smrg	case `/bin/uname -X | grep "^Machine"` in
10432227fc13Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
10442227fc13Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
10452227fc13Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10462227fc13Smrg	esac
10472227fc13Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10482227fc13Smrg	exit ;;
10492227fc13Smrg    i*86:*:3.2:*)
10502227fc13Smrg	if test -f /usr/options/cb.name; then
10512227fc13Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
10522227fc13Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
10532227fc13Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
10542227fc13Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10552227fc13Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10562227fc13Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
10572227fc13Smrg			&& UNAME_MACHINE=i586
10582227fc13Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
10592227fc13Smrg			&& UNAME_MACHINE=i686
10602227fc13Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10612227fc13Smrg			&& UNAME_MACHINE=i686
10622227fc13Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
10632227fc13Smrg	else
10642227fc13Smrg		echo ${UNAME_MACHINE}-pc-sysv32
10652227fc13Smrg	fi
10662227fc13Smrg	exit ;;
10672227fc13Smrg    pc:*:*:*)
10682227fc13Smrg	# Left here for compatibility:
10692227fc13Smrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
10702227fc13Smrg        # the processor, so we play safe by assuming i586.
10712227fc13Smrg	# Note: whatever this is, it MUST be the same as what config.sub
10722227fc13Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
10732227fc13Smrg	# this is a cross-build.
10742227fc13Smrg	echo i586-pc-msdosdjgpp
10752227fc13Smrg        exit ;;
10762227fc13Smrg    Intel:Mach:3*:*)
10772227fc13Smrg	echo i386-pc-mach3
10782227fc13Smrg	exit ;;
10792227fc13Smrg    paragon:*:*:*)
10802227fc13Smrg	echo i860-intel-osf1
10812227fc13Smrg	exit ;;
10822227fc13Smrg    i860:*:4.*:*) # i860-SVR4
10832227fc13Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
10842227fc13Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
10852227fc13Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
10862227fc13Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
10872227fc13Smrg	fi
10882227fc13Smrg	exit ;;
10892227fc13Smrg    mini*:CTIX:SYS*5:*)
10902227fc13Smrg	# "miniframe"
10912227fc13Smrg	echo m68010-convergent-sysv
10922227fc13Smrg	exit ;;
10932227fc13Smrg    mc68k:UNIX:SYSTEM5:3.51m)
10942227fc13Smrg	echo m68k-convergent-sysv
10952227fc13Smrg	exit ;;
10962227fc13Smrg    M680?0:D-NIX:5.3:*)
10972227fc13Smrg	echo m68k-diab-dnix
10982227fc13Smrg	exit ;;
10992227fc13Smrg    M68*:*:R3V[5678]*:*)
11002227fc13Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11012227fc13Smrg    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)
11022227fc13Smrg	OS_REL=''
11032227fc13Smrg	test -r /etc/.relid \
11042227fc13Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11052227fc13Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11062227fc13Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11072227fc13Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11082227fc13Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11092227fc13Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11102227fc13Smrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11112227fc13Smrg          && { echo i486-ncr-sysv4; exit; } ;;
11122227fc13Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
11132227fc13Smrg	OS_REL='.3'
11142227fc13Smrg	test -r /etc/.relid \
11152227fc13Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11162227fc13Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11172227fc13Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11182227fc13Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11192227fc13Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
11202227fc13Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
11212227fc13Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11222227fc13Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11232227fc13Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11242227fc13Smrg	exit ;;
11252227fc13Smrg    mc68030:UNIX_System_V:4.*:*)
11262227fc13Smrg	echo m68k-atari-sysv4
11272227fc13Smrg	exit ;;
11282227fc13Smrg    TSUNAMI:LynxOS:2.*:*)
11292227fc13Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11302227fc13Smrg	exit ;;
11312227fc13Smrg    rs6000:LynxOS:2.*:*)
11322227fc13Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11332227fc13Smrg	exit ;;
11342227fc13Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
11352227fc13Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11362227fc13Smrg	exit ;;
11372227fc13Smrg    SM[BE]S:UNIX_SV:*:*)
11382227fc13Smrg	echo mips-dde-sysv${UNAME_RELEASE}
11392227fc13Smrg	exit ;;
11402227fc13Smrg    RM*:ReliantUNIX-*:*:*)
11412227fc13Smrg	echo mips-sni-sysv4
11422227fc13Smrg	exit ;;
11432227fc13Smrg    RM*:SINIX-*:*:*)
11442227fc13Smrg	echo mips-sni-sysv4
11452227fc13Smrg	exit ;;
11462227fc13Smrg    *:SINIX-*:*:*)
11472227fc13Smrg	if uname -p 2>/dev/null >/dev/null ; then
11482227fc13Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
11492227fc13Smrg		echo ${UNAME_MACHINE}-sni-sysv4
11502227fc13Smrg	else
11512227fc13Smrg		echo ns32k-sni-sysv
11522227fc13Smrg	fi
11532227fc13Smrg	exit ;;
11542227fc13Smrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
11552227fc13Smrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
11562227fc13Smrg        echo i586-unisys-sysv4
11572227fc13Smrg        exit ;;
11582227fc13Smrg    *:UNIX_System_V:4*:FTX*)
11592227fc13Smrg	# From Gerald Hewes <hewes@openmarket.com>.
11602227fc13Smrg	# How about differentiating between stratus architectures? -djm
11612227fc13Smrg	echo hppa1.1-stratus-sysv4
11622227fc13Smrg	exit ;;
11632227fc13Smrg    *:*:*:FTX*)
11642227fc13Smrg	# From seanf@swdc.stratus.com.
11652227fc13Smrg	echo i860-stratus-sysv4
11662227fc13Smrg	exit ;;
11672227fc13Smrg    i*86:VOS:*:*)
11682227fc13Smrg	# From Paul.Green@stratus.com.
11692227fc13Smrg	echo ${UNAME_MACHINE}-stratus-vos
11702227fc13Smrg	exit ;;
11712227fc13Smrg    *:VOS:*:*)
11722227fc13Smrg	# From Paul.Green@stratus.com.
11732227fc13Smrg	echo hppa1.1-stratus-vos
11742227fc13Smrg	exit ;;
11752227fc13Smrg    mc68*:A/UX:*:*)
11762227fc13Smrg	echo m68k-apple-aux${UNAME_RELEASE}
11772227fc13Smrg	exit ;;
11782227fc13Smrg    news*:NEWS-OS:6*:*)
11792227fc13Smrg	echo mips-sony-newsos6
11802227fc13Smrg	exit ;;
11812227fc13Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
11822227fc13Smrg	if [ -d /usr/nec ]; then
11832227fc13Smrg	        echo mips-nec-sysv${UNAME_RELEASE}
11842227fc13Smrg	else
11852227fc13Smrg	        echo mips-unknown-sysv${UNAME_RELEASE}
11862227fc13Smrg	fi
11872227fc13Smrg        exit ;;
11882227fc13Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
11892227fc13Smrg	echo powerpc-be-beos
11902227fc13Smrg	exit ;;
11912227fc13Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
11922227fc13Smrg	echo powerpc-apple-beos
11932227fc13Smrg	exit ;;
11942227fc13Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
11952227fc13Smrg	echo i586-pc-beos
11962227fc13Smrg	exit ;;
11972227fc13Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
11982227fc13Smrg	echo i586-pc-haiku
11992227fc13Smrg	exit ;;
12002227fc13Smrg    SX-4:SUPER-UX:*:*)
12012227fc13Smrg	echo sx4-nec-superux${UNAME_RELEASE}
12022227fc13Smrg	exit ;;
12032227fc13Smrg    SX-5:SUPER-UX:*:*)
12042227fc13Smrg	echo sx5-nec-superux${UNAME_RELEASE}
12052227fc13Smrg	exit ;;
12062227fc13Smrg    SX-6:SUPER-UX:*:*)
12072227fc13Smrg	echo sx6-nec-superux${UNAME_RELEASE}
12082227fc13Smrg	exit ;;
12092227fc13Smrg    SX-7:SUPER-UX:*:*)
12102227fc13Smrg	echo sx7-nec-superux${UNAME_RELEASE}
12112227fc13Smrg	exit ;;
12122227fc13Smrg    SX-8:SUPER-UX:*:*)
12132227fc13Smrg	echo sx8-nec-superux${UNAME_RELEASE}
12142227fc13Smrg	exit ;;
12152227fc13Smrg    SX-8R:SUPER-UX:*:*)
12162227fc13Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
12172227fc13Smrg	exit ;;
12182227fc13Smrg    Power*:Rhapsody:*:*)
12192227fc13Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12202227fc13Smrg	exit ;;
12212227fc13Smrg    *:Rhapsody:*:*)
12222227fc13Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12232227fc13Smrg	exit ;;
12242227fc13Smrg    *:Darwin:*:*)
12252227fc13Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12262227fc13Smrg	case $UNAME_PROCESSOR in
12272227fc13Smrg	    i386)
12282227fc13Smrg		eval $set_cc_for_build
12292227fc13Smrg		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
12302227fc13Smrg		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
12312227fc13Smrg		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
12322227fc13Smrg		      grep IS_64BIT_ARCH >/dev/null
12332227fc13Smrg		  then
12342227fc13Smrg		      UNAME_PROCESSOR="x86_64"
12352227fc13Smrg		  fi
12362227fc13Smrg		fi ;;
12372227fc13Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
12382227fc13Smrg	esac
12392227fc13Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12402227fc13Smrg	exit ;;
12412227fc13Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
12422227fc13Smrg	UNAME_PROCESSOR=`uname -p`
12432227fc13Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
12442227fc13Smrg		UNAME_PROCESSOR=i386
12452227fc13Smrg		UNAME_MACHINE=pc
12462227fc13Smrg	fi
12472227fc13Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
12482227fc13Smrg	exit ;;
12492227fc13Smrg    *:QNX:*:4*)
12502227fc13Smrg	echo i386-pc-qnx
12512227fc13Smrg	exit ;;
12522227fc13Smrg    NEO-?:NONSTOP_KERNEL:*:*)
12532227fc13Smrg	echo neo-tandem-nsk${UNAME_RELEASE}
12542227fc13Smrg	exit ;;
12552227fc13Smrg    NSE-?:NONSTOP_KERNEL:*:*)
12562227fc13Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
12572227fc13Smrg	exit ;;
12582227fc13Smrg    NSR-?:NONSTOP_KERNEL:*:*)
12592227fc13Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
12602227fc13Smrg	exit ;;
12612227fc13Smrg    *:NonStop-UX:*:*)
12622227fc13Smrg	echo mips-compaq-nonstopux
12632227fc13Smrg	exit ;;
12642227fc13Smrg    BS2000:POSIX*:*:*)
12652227fc13Smrg	echo bs2000-siemens-sysv
12662227fc13Smrg	exit ;;
12672227fc13Smrg    DS/*:UNIX_System_V:*:*)
12682227fc13Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
12692227fc13Smrg	exit ;;
12702227fc13Smrg    *:Plan9:*:*)
12712227fc13Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
12722227fc13Smrg	# is converted to i386 for consistency with other x86
12732227fc13Smrg	# operating systems.
12742227fc13Smrg	if test "$cputype" = "386"; then
12752227fc13Smrg	    UNAME_MACHINE=i386
12762227fc13Smrg	else
12772227fc13Smrg	    UNAME_MACHINE="$cputype"
12782227fc13Smrg	fi
12792227fc13Smrg	echo ${UNAME_MACHINE}-unknown-plan9
12802227fc13Smrg	exit ;;
12812227fc13Smrg    *:TOPS-10:*:*)
12822227fc13Smrg	echo pdp10-unknown-tops10
12832227fc13Smrg	exit ;;
12842227fc13Smrg    *:TENEX:*:*)
12852227fc13Smrg	echo pdp10-unknown-tenex
12862227fc13Smrg	exit ;;
12872227fc13Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
12882227fc13Smrg	echo pdp10-dec-tops20
12892227fc13Smrg	exit ;;
12902227fc13Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
12912227fc13Smrg	echo pdp10-xkl-tops20
12922227fc13Smrg	exit ;;
12932227fc13Smrg    *:TOPS-20:*:*)
12942227fc13Smrg	echo pdp10-unknown-tops20
12952227fc13Smrg	exit ;;
12962227fc13Smrg    *:ITS:*:*)
12972227fc13Smrg	echo pdp10-unknown-its
12982227fc13Smrg	exit ;;
12992227fc13Smrg    SEI:*:*:SEIUX)
13002227fc13Smrg        echo mips-sei-seiux${UNAME_RELEASE}
13012227fc13Smrg	exit ;;
13022227fc13Smrg    *:DragonFly:*:*)
13032227fc13Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13042227fc13Smrg	exit ;;
13052227fc13Smrg    *:*VMS:*:*)
13062227fc13Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13072227fc13Smrg	case "${UNAME_MACHINE}" in
13082227fc13Smrg	    A*) echo alpha-dec-vms ; exit ;;
13092227fc13Smrg	    I*) echo ia64-dec-vms ; exit ;;
13102227fc13Smrg	    V*) echo vax-dec-vms ; exit ;;
13112227fc13Smrg	esac ;;
13122227fc13Smrg    *:XENIX:*:SysV)
13132227fc13Smrg	echo i386-pc-xenix
13142227fc13Smrg	exit ;;
13152227fc13Smrg    i*86:skyos:*:*)
13162227fc13Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13172227fc13Smrg	exit ;;
13182227fc13Smrg    i*86:rdos:*:*)
13192227fc13Smrg	echo ${UNAME_MACHINE}-pc-rdos
13202227fc13Smrg	exit ;;
13212227fc13Smrg    i*86:AROS:*:*)
13222227fc13Smrg	echo ${UNAME_MACHINE}-pc-aros
13232227fc13Smrg	exit ;;
13242227fc13Smrgesac
13252227fc13Smrg
13262227fc13Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
13272227fc13Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
13282227fc13Smrg
13292227fc13Smrgeval $set_cc_for_build
13302227fc13Smrgcat >$dummy.c <<EOF
13312227fc13Smrg#ifdef _SEQUENT_
13322227fc13Smrg# include <sys/types.h>
13332227fc13Smrg# include <sys/utsname.h>
13342227fc13Smrg#endif
13352227fc13Smrgmain ()
13362227fc13Smrg{
13372227fc13Smrg#if defined (sony)
13382227fc13Smrg#if defined (MIPSEB)
13392227fc13Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
13402227fc13Smrg     I don't know....  */
13412227fc13Smrg  printf ("mips-sony-bsd\n"); exit (0);
13422227fc13Smrg#else
13432227fc13Smrg#include <sys/param.h>
13442227fc13Smrg  printf ("m68k-sony-newsos%s\n",
13452227fc13Smrg#ifdef NEWSOS4
13462227fc13Smrg          "4"
13472227fc13Smrg#else
13482227fc13Smrg	  ""
13492227fc13Smrg#endif
13502227fc13Smrg         ); exit (0);
13512227fc13Smrg#endif
13522227fc13Smrg#endif
13532227fc13Smrg
13542227fc13Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
13552227fc13Smrg  printf ("arm-acorn-riscix\n"); exit (0);
13562227fc13Smrg#endif
13572227fc13Smrg
13582227fc13Smrg#if defined (hp300) && !defined (hpux)
13592227fc13Smrg  printf ("m68k-hp-bsd\n"); exit (0);
13602227fc13Smrg#endif
13612227fc13Smrg
13622227fc13Smrg#if defined (NeXT)
13632227fc13Smrg#if !defined (__ARCHITECTURE__)
13642227fc13Smrg#define __ARCHITECTURE__ "m68k"
13652227fc13Smrg#endif
13662227fc13Smrg  int version;
13672227fc13Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
13682227fc13Smrg  if (version < 4)
13692227fc13Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
13702227fc13Smrg  else
13712227fc13Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
13722227fc13Smrg  exit (0);
13732227fc13Smrg#endif
13742227fc13Smrg
13752227fc13Smrg#if defined (MULTIMAX) || defined (n16)
13762227fc13Smrg#if defined (UMAXV)
13772227fc13Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
13782227fc13Smrg#else
13792227fc13Smrg#if defined (CMU)
13802227fc13Smrg  printf ("ns32k-encore-mach\n"); exit (0);
13812227fc13Smrg#else
13822227fc13Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
13832227fc13Smrg#endif
13842227fc13Smrg#endif
13852227fc13Smrg#endif
13862227fc13Smrg
13872227fc13Smrg#if defined (__386BSD__)
13882227fc13Smrg  printf ("i386-pc-bsd\n"); exit (0);
13892227fc13Smrg#endif
13902227fc13Smrg
13912227fc13Smrg#if defined (sequent)
13922227fc13Smrg#if defined (i386)
13932227fc13Smrg  printf ("i386-sequent-dynix\n"); exit (0);
13942227fc13Smrg#endif
13952227fc13Smrg#if defined (ns32000)
13962227fc13Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
13972227fc13Smrg#endif
13982227fc13Smrg#endif
13992227fc13Smrg
14002227fc13Smrg#if defined (_SEQUENT_)
14012227fc13Smrg    struct utsname un;
14022227fc13Smrg
14032227fc13Smrg    uname(&un);
14042227fc13Smrg
14052227fc13Smrg    if (strncmp(un.version, "V2", 2) == 0) {
14062227fc13Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
14072227fc13Smrg    }
14082227fc13Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
14092227fc13Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
14102227fc13Smrg    }
14112227fc13Smrg    printf ("i386-sequent-ptx\n"); exit (0);
14122227fc13Smrg
14132227fc13Smrg#endif
14142227fc13Smrg
14152227fc13Smrg#if defined (vax)
14162227fc13Smrg# if !defined (ultrix)
14172227fc13Smrg#  include <sys/param.h>
14182227fc13Smrg#  if defined (BSD)
14192227fc13Smrg#   if BSD == 43
14202227fc13Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
14212227fc13Smrg#   else
14222227fc13Smrg#    if BSD == 199006
14232227fc13Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
14242227fc13Smrg#    else
14252227fc13Smrg      printf ("vax-dec-bsd\n"); exit (0);
14262227fc13Smrg#    endif
14272227fc13Smrg#   endif
14282227fc13Smrg#  else
14292227fc13Smrg    printf ("vax-dec-bsd\n"); exit (0);
14302227fc13Smrg#  endif
14312227fc13Smrg# else
14322227fc13Smrg    printf ("vax-dec-ultrix\n"); exit (0);
14332227fc13Smrg# endif
14342227fc13Smrg#endif
14352227fc13Smrg
14362227fc13Smrg#if defined (alliant) && defined (i860)
14372227fc13Smrg  printf ("i860-alliant-bsd\n"); exit (0);
14382227fc13Smrg#endif
14392227fc13Smrg
14402227fc13Smrg  exit (1);
14412227fc13Smrg}
14422227fc13SmrgEOF
14432227fc13Smrg
14442227fc13Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
14452227fc13Smrg	{ echo "$SYSTEM_NAME"; exit; }
14462227fc13Smrg
14472227fc13Smrg# Apollos put the system type in the environment.
14482227fc13Smrg
14492227fc13Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
14502227fc13Smrg
14512227fc13Smrg# Convex versions that predate uname can use getsysinfo(1)
14522227fc13Smrg
14532227fc13Smrgif [ -x /usr/convex/getsysinfo ]
14542227fc13Smrgthen
14552227fc13Smrg    case `getsysinfo -f cpu_type` in
14562227fc13Smrg    c1*)
14572227fc13Smrg	echo c1-convex-bsd
14582227fc13Smrg	exit ;;
14592227fc13Smrg    c2*)
14602227fc13Smrg	if getsysinfo -f scalar_acc
14612227fc13Smrg	then echo c32-convex-bsd
14622227fc13Smrg	else echo c2-convex-bsd
14632227fc13Smrg	fi
14642227fc13Smrg	exit ;;
14652227fc13Smrg    c34*)
14662227fc13Smrg	echo c34-convex-bsd
14672227fc13Smrg	exit ;;
14682227fc13Smrg    c38*)
14692227fc13Smrg	echo c38-convex-bsd
14702227fc13Smrg	exit ;;
14712227fc13Smrg    c4*)
14722227fc13Smrg	echo c4-convex-bsd
14732227fc13Smrg	exit ;;
14742227fc13Smrg    esac
14752227fc13Smrgfi
14762227fc13Smrg
14772227fc13Smrgcat >&2 <<EOF
14782227fc13Smrg$0: unable to guess system type
14792227fc13Smrg
14802227fc13SmrgThis script, last modified $timestamp, has failed to recognize
14812227fc13Smrgthe operating system you are using. It is advised that you
14822227fc13Smrgdownload the most up to date version of the config scripts from
14832227fc13Smrg
14842227fc13Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
14852227fc13Smrgand
14862227fc13Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
14872227fc13Smrg
14882227fc13SmrgIf the version you run ($0) is already up to date, please
14892227fc13Smrgsend the following data and any information you think might be
14902227fc13Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
14912227fc13Smrginformation to handle your system.
14922227fc13Smrg
14932227fc13Smrgconfig.guess timestamp = $timestamp
14942227fc13Smrg
14952227fc13Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
14962227fc13Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
14972227fc13Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
14982227fc13Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
14992227fc13Smrg
15002227fc13Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
15012227fc13Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
15022227fc13Smrg
15032227fc13Smrghostinfo               = `(hostinfo) 2>/dev/null`
15042227fc13Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
15052227fc13Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
15062227fc13Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
15072227fc13Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
15082227fc13Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
15092227fc13Smrg
15102227fc13SmrgUNAME_MACHINE = ${UNAME_MACHINE}
15112227fc13SmrgUNAME_RELEASE = ${UNAME_RELEASE}
15122227fc13SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
15132227fc13SmrgUNAME_VERSION = ${UNAME_VERSION}
15142227fc13SmrgEOF
15152227fc13Smrg
15162227fc13Smrgexit 1
15172227fc13Smrg
15182227fc13Smrg# Local variables:
15192227fc13Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
15202227fc13Smrg# time-stamp-start: "timestamp='"
15212227fc13Smrg# time-stamp-format: "%:y-%02m-%02d"
15222227fc13Smrg# time-stamp-end: "'"
15232227fc13Smrg# End:
1524