config.guess revision 8650bb69
12c7c4e3dSmrg#! /bin/sh
22c7c4e3dSmrg# Attempt to guess a canonical system name.
32c7c4e3dSmrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
48650bb69Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
58650bb69Smrg#   Free Software Foundation, Inc.
62c7c4e3dSmrg
78650bb69Smrgtimestamp='2009-04-27'
82c7c4e3dSmrg
92c7c4e3dSmrg# This file is free software; you can redistribute it and/or modify it
102c7c4e3dSmrg# under the terms of the GNU General Public License as published by
112c7c4e3dSmrg# the Free Software Foundation; either version 2 of the License, or
122c7c4e3dSmrg# (at your option) any later version.
132c7c4e3dSmrg#
142c7c4e3dSmrg# This program is distributed in the hope that it will be useful, but
152c7c4e3dSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
162c7c4e3dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
172c7c4e3dSmrg# General Public License for more details.
182c7c4e3dSmrg#
192c7c4e3dSmrg# You should have received a copy of the GNU General Public License
202c7c4e3dSmrg# along with this program; if not, write to the Free Software
218650bb69Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
228650bb69Smrg# 02110-1301, USA.
232c7c4e3dSmrg#
242c7c4e3dSmrg# As a special exception to the GNU General Public License, if you
252c7c4e3dSmrg# distribute this file as part of a program that contains a
262c7c4e3dSmrg# configuration script generated by Autoconf, you may include it under
272c7c4e3dSmrg# the same distribution terms that you use for the rest of that program.
282c7c4e3dSmrg
298650bb69Smrg
302c7c4e3dSmrg# Originally written by Per Bothner <per@bothner.com>.
312c7c4e3dSmrg# Please send patches to <config-patches@gnu.org>.  Submit a context
322c7c4e3dSmrg# diff and a properly formatted ChangeLog entry.
332c7c4e3dSmrg#
342c7c4e3dSmrg# This script attempts to guess a canonical system name similar to
352c7c4e3dSmrg# config.sub.  If it succeeds, it prints the system name on stdout, and
362c7c4e3dSmrg# exits with 0.  Otherwise, it exits with 1.
372c7c4e3dSmrg#
382c7c4e3dSmrg# The plan is that this can be called by configure scripts if you
392c7c4e3dSmrg# don't specify an explicit build system type.
402c7c4e3dSmrg
412c7c4e3dSmrgme=`echo "$0" | sed -e 's,.*/,,'`
422c7c4e3dSmrg
432c7c4e3dSmrgusage="\
442c7c4e3dSmrgUsage: $0 [OPTION]
452c7c4e3dSmrg
462c7c4e3dSmrgOutput the configuration name of the system \`$me' is run on.
472c7c4e3dSmrg
482c7c4e3dSmrgOperation modes:
492c7c4e3dSmrg  -h, --help         print this help, then exit
502c7c4e3dSmrg  -t, --time-stamp   print date of last modification, then exit
512c7c4e3dSmrg  -v, --version      print version number, then exit
522c7c4e3dSmrg
532c7c4e3dSmrgReport bugs and patches to <config-patches@gnu.org>."
542c7c4e3dSmrg
552c7c4e3dSmrgversion="\
562c7c4e3dSmrgGNU config.guess ($timestamp)
572c7c4e3dSmrg
582c7c4e3dSmrgOriginally written by Per Bothner.
598650bb69SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
608650bb69Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
612c7c4e3dSmrg
622c7c4e3dSmrgThis is free software; see the source for copying conditions.  There is NO
632c7c4e3dSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
642c7c4e3dSmrg
652c7c4e3dSmrghelp="
662c7c4e3dSmrgTry \`$me --help' for more information."
672c7c4e3dSmrg
682c7c4e3dSmrg# Parse command line
692c7c4e3dSmrgwhile test $# -gt 0 ; do
702c7c4e3dSmrg  case $1 in
712c7c4e3dSmrg    --time-stamp | --time* | -t )
728650bb69Smrg       echo "$timestamp" ; exit ;;
732c7c4e3dSmrg    --version | -v )
748650bb69Smrg       echo "$version" ; exit ;;
752c7c4e3dSmrg    --help | --h* | -h )
768650bb69Smrg       echo "$usage"; exit ;;
772c7c4e3dSmrg    -- )     # Stop option processing
782c7c4e3dSmrg       shift; break ;;
792c7c4e3dSmrg    - )	# Use stdin as input.
802c7c4e3dSmrg       break ;;
812c7c4e3dSmrg    -* )
822c7c4e3dSmrg       echo "$me: invalid option $1$help" >&2
832c7c4e3dSmrg       exit 1 ;;
842c7c4e3dSmrg    * )
852c7c4e3dSmrg       break ;;
862c7c4e3dSmrg  esac
872c7c4e3dSmrgdone
882c7c4e3dSmrg
892c7c4e3dSmrgif test $# != 0; then
902c7c4e3dSmrg  echo "$me: too many arguments$help" >&2
912c7c4e3dSmrg  exit 1
922c7c4e3dSmrgfi
932c7c4e3dSmrg
942c7c4e3dSmrgtrap 'exit 1' 1 2 15
952c7c4e3dSmrg
962c7c4e3dSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
972c7c4e3dSmrg# compiler to aid in system detection is discouraged as it requires
982c7c4e3dSmrg# temporary files to be created and, as you can see below, it is a
992c7c4e3dSmrg# headache to deal with in a portable fashion.
1002c7c4e3dSmrg
1012c7c4e3dSmrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
1022c7c4e3dSmrg# use `HOST_CC' if defined, but it is deprecated.
1032c7c4e3dSmrg
1042c7c4e3dSmrg# Portable tmp directory creation inspired by the Autoconf team.
1052c7c4e3dSmrg
1062c7c4e3dSmrgset_cc_for_build='
1072c7c4e3dSmrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1082c7c4e3dSmrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1092c7c4e3dSmrg: ${TMPDIR=/tmp} ;
1108650bb69Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1112c7c4e3dSmrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1122c7c4e3dSmrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1132c7c4e3dSmrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1142c7c4e3dSmrgdummy=$tmp/dummy ;
1152c7c4e3dSmrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1162c7c4e3dSmrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1172c7c4e3dSmrg ,,)    echo "int x;" > $dummy.c ;
1182c7c4e3dSmrg	for c in cc gcc c89 c99 ; do
1192c7c4e3dSmrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1202c7c4e3dSmrg	     CC_FOR_BUILD="$c"; break ;
1212c7c4e3dSmrg	  fi ;
1222c7c4e3dSmrg	done ;
1232c7c4e3dSmrg	if test x"$CC_FOR_BUILD" = x ; then
1242c7c4e3dSmrg	  CC_FOR_BUILD=no_compiler_found ;
1252c7c4e3dSmrg	fi
1262c7c4e3dSmrg	;;
1272c7c4e3dSmrg ,,*)   CC_FOR_BUILD=$CC ;;
1282c7c4e3dSmrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1298650bb69Smrgesac ; set_cc_for_build= ;'
1302c7c4e3dSmrg
1312c7c4e3dSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1322c7c4e3dSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
1332c7c4e3dSmrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1342c7c4e3dSmrg	PATH=$PATH:/.attbin ; export PATH
1352c7c4e3dSmrgfi
1362c7c4e3dSmrg
1372c7c4e3dSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1382c7c4e3dSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1392c7c4e3dSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1402c7c4e3dSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1412c7c4e3dSmrg
1422c7c4e3dSmrg# Note: order is significant - the case branches are not exclusive.
1432c7c4e3dSmrg
1442c7c4e3dSmrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1452c7c4e3dSmrg    *:NetBSD:*:*)
1462c7c4e3dSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
1472c7c4e3dSmrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
1482c7c4e3dSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1492c7c4e3dSmrg	# switched to ELF, *-*-netbsd* would select the old
1502c7c4e3dSmrg	# object file format.  This provides both forward
1512c7c4e3dSmrg	# compatibility and a consistent mechanism for selecting the
1522c7c4e3dSmrg	# object file format.
1532c7c4e3dSmrg	#
1542c7c4e3dSmrg	# Note: NetBSD doesn't particularly care about the vendor
1552c7c4e3dSmrg	# portion of the name.  We always set it to "unknown".
1562c7c4e3dSmrg	sysctl="sysctl -n hw.machine_arch"
1572c7c4e3dSmrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1582c7c4e3dSmrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1592c7c4e3dSmrg	case "${UNAME_MACHINE_ARCH}" in
1602c7c4e3dSmrg	    armeb) machine=armeb-unknown ;;
1612c7c4e3dSmrg	    arm*) machine=arm-unknown ;;
1622c7c4e3dSmrg	    sh3el) machine=shl-unknown ;;
1632c7c4e3dSmrg	    sh3eb) machine=sh-unknown ;;
1648650bb69Smrg	    sh5el) machine=sh5le-unknown ;;
1652c7c4e3dSmrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1662c7c4e3dSmrg	esac
1672c7c4e3dSmrg	# The Operating System including object format, if it has switched
1682c7c4e3dSmrg	# to ELF recently, or will in the future.
1692c7c4e3dSmrg	case "${UNAME_MACHINE_ARCH}" in
1702c7c4e3dSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1712c7c4e3dSmrg		eval $set_cc_for_build
1722c7c4e3dSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1732c7c4e3dSmrg			| grep __ELF__ >/dev/null
1742c7c4e3dSmrg		then
1752c7c4e3dSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1762c7c4e3dSmrg		    # Return netbsd for either.  FIX?
1772c7c4e3dSmrg		    os=netbsd
1782c7c4e3dSmrg		else
1792c7c4e3dSmrg		    os=netbsdelf
1802c7c4e3dSmrg		fi
1812c7c4e3dSmrg		;;
1822c7c4e3dSmrg	    *)
1832c7c4e3dSmrg	        os=netbsd
1842c7c4e3dSmrg		;;
1852c7c4e3dSmrg	esac
1862c7c4e3dSmrg	# The OS release
1872c7c4e3dSmrg	# Debian GNU/NetBSD machines have a different userland, and
1882c7c4e3dSmrg	# thus, need a distinct triplet. However, they do not need
1892c7c4e3dSmrg	# kernel version information, so it can be replaced with a
1902c7c4e3dSmrg	# suitable tag, in the style of linux-gnu.
1912c7c4e3dSmrg	case "${UNAME_VERSION}" in
1922c7c4e3dSmrg	    Debian*)
1932c7c4e3dSmrg		release='-gnu'
1942c7c4e3dSmrg		;;
1952c7c4e3dSmrg	    *)
1962c7c4e3dSmrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
1972c7c4e3dSmrg		;;
1982c7c4e3dSmrg	esac
1992c7c4e3dSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2002c7c4e3dSmrg	# contains redundant information, the shorter form:
2012c7c4e3dSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2022c7c4e3dSmrg	echo "${machine}-${os}${release}"
2038650bb69Smrg	exit ;;
2042c7c4e3dSmrg    *:OpenBSD:*:*)
2058650bb69Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2068650bb69Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2078650bb69Smrg	exit ;;
2088650bb69Smrg    *:ekkoBSD:*:*)
2098650bb69Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2108650bb69Smrg	exit ;;
2118650bb69Smrg    *:SolidBSD:*:*)
2128650bb69Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2138650bb69Smrg	exit ;;
2148650bb69Smrg    macppc:MirBSD:*:*)
2158650bb69Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2168650bb69Smrg	exit ;;
2178650bb69Smrg    *:MirBSD:*:*)
2188650bb69Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2198650bb69Smrg	exit ;;
2202c7c4e3dSmrg    alpha:OSF1:*:*)
2218650bb69Smrg	case $UNAME_RELEASE in
2228650bb69Smrg	*4.0)
2232c7c4e3dSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2248650bb69Smrg		;;
2258650bb69Smrg	*5.*)
2268650bb69Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2278650bb69Smrg		;;
2288650bb69Smrg	esac
2292c7c4e3dSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2302c7c4e3dSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2312c7c4e3dSmrg	# covers most systems running today.  This code pipes the CPU
2322c7c4e3dSmrg	# types through head -n 1, so we only detect the type of CPU 0.
2332c7c4e3dSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2342c7c4e3dSmrg	case "$ALPHA_CPU_TYPE" in
2352c7c4e3dSmrg	    "EV4 (21064)")
2362c7c4e3dSmrg		UNAME_MACHINE="alpha" ;;
2372c7c4e3dSmrg	    "EV4.5 (21064)")
2382c7c4e3dSmrg		UNAME_MACHINE="alpha" ;;
2392c7c4e3dSmrg	    "LCA4 (21066/21068)")
2402c7c4e3dSmrg		UNAME_MACHINE="alpha" ;;
2412c7c4e3dSmrg	    "EV5 (21164)")
2422c7c4e3dSmrg		UNAME_MACHINE="alphaev5" ;;
2432c7c4e3dSmrg	    "EV5.6 (21164A)")
2442c7c4e3dSmrg		UNAME_MACHINE="alphaev56" ;;
2452c7c4e3dSmrg	    "EV5.6 (21164PC)")
2462c7c4e3dSmrg		UNAME_MACHINE="alphapca56" ;;
2472c7c4e3dSmrg	    "EV5.7 (21164PC)")
2482c7c4e3dSmrg		UNAME_MACHINE="alphapca57" ;;
2492c7c4e3dSmrg	    "EV6 (21264)")
2502c7c4e3dSmrg		UNAME_MACHINE="alphaev6" ;;
2512c7c4e3dSmrg	    "EV6.7 (21264A)")
2522c7c4e3dSmrg		UNAME_MACHINE="alphaev67" ;;
2532c7c4e3dSmrg	    "EV6.8CB (21264C)")
2542c7c4e3dSmrg		UNAME_MACHINE="alphaev68" ;;
2552c7c4e3dSmrg	    "EV6.8AL (21264B)")
2562c7c4e3dSmrg		UNAME_MACHINE="alphaev68" ;;
2572c7c4e3dSmrg	    "EV6.8CX (21264D)")
2582c7c4e3dSmrg		UNAME_MACHINE="alphaev68" ;;
2592c7c4e3dSmrg	    "EV6.9A (21264/EV69A)")
2602c7c4e3dSmrg		UNAME_MACHINE="alphaev69" ;;
2612c7c4e3dSmrg	    "EV7 (21364)")
2622c7c4e3dSmrg		UNAME_MACHINE="alphaev7" ;;
2632c7c4e3dSmrg	    "EV7.9 (21364A)")
2642c7c4e3dSmrg		UNAME_MACHINE="alphaev79" ;;
2652c7c4e3dSmrg	esac
2668650bb69Smrg	# A Pn.n version is a patched version.
2672c7c4e3dSmrg	# A Vn.n version is a released version.
2682c7c4e3dSmrg	# A Tn.n version is a released field test version.
2692c7c4e3dSmrg	# A Xn.n version is an unreleased experimental baselevel.
2702c7c4e3dSmrg	# 1.2 uses "1.2" for uname -r.
2718650bb69Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2728650bb69Smrg	exit ;;
2732c7c4e3dSmrg    Alpha\ *:Windows_NT*:*)
2742c7c4e3dSmrg	# How do we know it's Interix rather than the generic POSIX subsystem?
2752c7c4e3dSmrg	# Should we change UNAME_MACHINE based on the output of uname instead
2762c7c4e3dSmrg	# of the specific Alpha model?
2772c7c4e3dSmrg	echo alpha-pc-interix
2788650bb69Smrg	exit ;;
2792c7c4e3dSmrg    21064:Windows_NT:50:3)
2802c7c4e3dSmrg	echo alpha-dec-winnt3.5
2818650bb69Smrg	exit ;;
2822c7c4e3dSmrg    Amiga*:UNIX_System_V:4.0:*)
2832c7c4e3dSmrg	echo m68k-unknown-sysv4
2848650bb69Smrg	exit ;;
2852c7c4e3dSmrg    *:[Aa]miga[Oo][Ss]:*:*)
2862c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-amigaos
2878650bb69Smrg	exit ;;
2882c7c4e3dSmrg    *:[Mm]orph[Oo][Ss]:*:*)
2892c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-morphos
2908650bb69Smrg	exit ;;
2912c7c4e3dSmrg    *:OS/390:*:*)
2922c7c4e3dSmrg	echo i370-ibm-openedition
2938650bb69Smrg	exit ;;
2948650bb69Smrg    *:z/VM:*:*)
2958650bb69Smrg	echo s390-ibm-zvmoe
2968650bb69Smrg	exit ;;
2978650bb69Smrg    *:OS400:*:*)
2988650bb69Smrg        echo powerpc-ibm-os400
2998650bb69Smrg	exit ;;
3002c7c4e3dSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3012c7c4e3dSmrg	echo arm-acorn-riscix${UNAME_RELEASE}
3028650bb69Smrg	exit ;;
3038650bb69Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
3048650bb69Smrg	echo arm-unknown-riscos
3058650bb69Smrg	exit ;;
3062c7c4e3dSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3072c7c4e3dSmrg	echo hppa1.1-hitachi-hiuxmpp
3088650bb69Smrg	exit ;;
3092c7c4e3dSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3102c7c4e3dSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3112c7c4e3dSmrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3122c7c4e3dSmrg		echo pyramid-pyramid-sysv3
3132c7c4e3dSmrg	else
3142c7c4e3dSmrg		echo pyramid-pyramid-bsd
3152c7c4e3dSmrg	fi
3168650bb69Smrg	exit ;;
3172c7c4e3dSmrg    NILE*:*:*:dcosx)
3182c7c4e3dSmrg	echo pyramid-pyramid-svr4
3198650bb69Smrg	exit ;;
3202c7c4e3dSmrg    DRS?6000:unix:4.0:6*)
3212c7c4e3dSmrg	echo sparc-icl-nx6
3228650bb69Smrg	exit ;;
3238650bb69Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3242c7c4e3dSmrg	case `/usr/bin/uname -p` in
3258650bb69Smrg	    sparc) echo sparc-icl-nx7; exit ;;
3262c7c4e3dSmrg	esac ;;
3278650bb69Smrg    s390x:SunOS:*:*)
3288650bb69Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3298650bb69Smrg	exit ;;
3302c7c4e3dSmrg    sun4H:SunOS:5.*:*)
3312c7c4e3dSmrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3328650bb69Smrg	exit ;;
3332c7c4e3dSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3342c7c4e3dSmrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3358650bb69Smrg	exit ;;
3368650bb69Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3378650bb69Smrg	eval $set_cc_for_build
3388650bb69Smrg	SUN_ARCH="i386"
3398650bb69Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
3408650bb69Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
3418650bb69Smrg	# This test works for both compilers.
3428650bb69Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
3438650bb69Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
3448650bb69Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
3458650bb69Smrg		grep IS_64BIT_ARCH >/dev/null
3468650bb69Smrg	    then
3478650bb69Smrg		SUN_ARCH="x86_64"
3488650bb69Smrg	    fi
3498650bb69Smrg	fi
3508650bb69Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3518650bb69Smrg	exit ;;
3522c7c4e3dSmrg    sun4*:SunOS:6*:*)
3532c7c4e3dSmrg	# According to config.sub, this is the proper way to canonicalize
3542c7c4e3dSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3552c7c4e3dSmrg	# it's likely to be more like Solaris than SunOS4.
3562c7c4e3dSmrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3578650bb69Smrg	exit ;;
3582c7c4e3dSmrg    sun4*:SunOS:*:*)
3592c7c4e3dSmrg	case "`/usr/bin/arch -k`" in
3602c7c4e3dSmrg	    Series*|S4*)
3612c7c4e3dSmrg		UNAME_RELEASE=`uname -v`
3622c7c4e3dSmrg		;;
3632c7c4e3dSmrg	esac
3642c7c4e3dSmrg	# Japanese Language versions have a version number like `4.1.3-JL'.
3652c7c4e3dSmrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3668650bb69Smrg	exit ;;
3672c7c4e3dSmrg    sun3*:SunOS:*:*)
3682c7c4e3dSmrg	echo m68k-sun-sunos${UNAME_RELEASE}
3698650bb69Smrg	exit ;;
3702c7c4e3dSmrg    sun*:*:4.2BSD:*)
3712c7c4e3dSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3722c7c4e3dSmrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
3732c7c4e3dSmrg	case "`/bin/arch`" in
3742c7c4e3dSmrg	    sun3)
3752c7c4e3dSmrg		echo m68k-sun-sunos${UNAME_RELEASE}
3762c7c4e3dSmrg		;;
3772c7c4e3dSmrg	    sun4)
3782c7c4e3dSmrg		echo sparc-sun-sunos${UNAME_RELEASE}
3792c7c4e3dSmrg		;;
3802c7c4e3dSmrg	esac
3818650bb69Smrg	exit ;;
3822c7c4e3dSmrg    aushp:SunOS:*:*)
3832c7c4e3dSmrg	echo sparc-auspex-sunos${UNAME_RELEASE}
3848650bb69Smrg	exit ;;
3852c7c4e3dSmrg    # The situation for MiNT is a little confusing.  The machine name
3862c7c4e3dSmrg    # can be virtually everything (everything which is not
3872c7c4e3dSmrg    # "atarist" or "atariste" at least should have a processor
3882c7c4e3dSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
3892c7c4e3dSmrg    # to the lowercase version "mint" (or "freemint").  Finally
3902c7c4e3dSmrg    # the system name "TOS" denotes a system which is actually not
3912c7c4e3dSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
3922c7c4e3dSmrg    # be no problem.
3932c7c4e3dSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
3942c7c4e3dSmrg        echo m68k-atari-mint${UNAME_RELEASE}
3958650bb69Smrg	exit ;;
3962c7c4e3dSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
3972c7c4e3dSmrg	echo m68k-atari-mint${UNAME_RELEASE}
3988650bb69Smrg        exit ;;
3992c7c4e3dSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4002c7c4e3dSmrg        echo m68k-atari-mint${UNAME_RELEASE}
4018650bb69Smrg	exit ;;
4022c7c4e3dSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4032c7c4e3dSmrg        echo m68k-milan-mint${UNAME_RELEASE}
4048650bb69Smrg        exit ;;
4052c7c4e3dSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4062c7c4e3dSmrg        echo m68k-hades-mint${UNAME_RELEASE}
4078650bb69Smrg        exit ;;
4082c7c4e3dSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4092c7c4e3dSmrg        echo m68k-unknown-mint${UNAME_RELEASE}
4108650bb69Smrg        exit ;;
4118650bb69Smrg    m68k:machten:*:*)
4128650bb69Smrg	echo m68k-apple-machten${UNAME_RELEASE}
4138650bb69Smrg	exit ;;
4142c7c4e3dSmrg    powerpc:machten:*:*)
4152c7c4e3dSmrg	echo powerpc-apple-machten${UNAME_RELEASE}
4168650bb69Smrg	exit ;;
4172c7c4e3dSmrg    RISC*:Mach:*:*)
4182c7c4e3dSmrg	echo mips-dec-mach_bsd4.3
4198650bb69Smrg	exit ;;
4202c7c4e3dSmrg    RISC*:ULTRIX:*:*)
4212c7c4e3dSmrg	echo mips-dec-ultrix${UNAME_RELEASE}
4228650bb69Smrg	exit ;;
4232c7c4e3dSmrg    VAX*:ULTRIX*:*:*)
4242c7c4e3dSmrg	echo vax-dec-ultrix${UNAME_RELEASE}
4258650bb69Smrg	exit ;;
4262c7c4e3dSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4272c7c4e3dSmrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4288650bb69Smrg	exit ;;
4292c7c4e3dSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4302c7c4e3dSmrg	eval $set_cc_for_build
4312c7c4e3dSmrg	sed 's/^	//' << EOF >$dummy.c
4322c7c4e3dSmrg#ifdef __cplusplus
4332c7c4e3dSmrg#include <stdio.h>  /* for printf() prototype */
4342c7c4e3dSmrg	int main (int argc, char *argv[]) {
4352c7c4e3dSmrg#else
4362c7c4e3dSmrg	int main (argc, argv) int argc; char *argv[]; {
4372c7c4e3dSmrg#endif
4382c7c4e3dSmrg	#if defined (host_mips) && defined (MIPSEB)
4392c7c4e3dSmrg	#if defined (SYSTYPE_SYSV)
4402c7c4e3dSmrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4412c7c4e3dSmrg	#endif
4422c7c4e3dSmrg	#if defined (SYSTYPE_SVR4)
4432c7c4e3dSmrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4442c7c4e3dSmrg	#endif
4452c7c4e3dSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4462c7c4e3dSmrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4472c7c4e3dSmrg	#endif
4482c7c4e3dSmrg	#endif
4492c7c4e3dSmrg	  exit (-1);
4502c7c4e3dSmrg	}
4512c7c4e3dSmrgEOF
4528650bb69Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4538650bb69Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4548650bb69Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4558650bb69Smrg	    { echo "$SYSTEM_NAME"; exit; }
4562c7c4e3dSmrg	echo mips-mips-riscos${UNAME_RELEASE}
4578650bb69Smrg	exit ;;
4582c7c4e3dSmrg    Motorola:PowerMAX_OS:*:*)
4592c7c4e3dSmrg	echo powerpc-motorola-powermax
4608650bb69Smrg	exit ;;
4612c7c4e3dSmrg    Motorola:*:4.3:PL8-*)
4622c7c4e3dSmrg	echo powerpc-harris-powermax
4638650bb69Smrg	exit ;;
4642c7c4e3dSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4652c7c4e3dSmrg	echo powerpc-harris-powermax
4668650bb69Smrg	exit ;;
4672c7c4e3dSmrg    Night_Hawk:Power_UNIX:*:*)
4682c7c4e3dSmrg	echo powerpc-harris-powerunix
4698650bb69Smrg	exit ;;
4702c7c4e3dSmrg    m88k:CX/UX:7*:*)
4712c7c4e3dSmrg	echo m88k-harris-cxux7
4728650bb69Smrg	exit ;;
4732c7c4e3dSmrg    m88k:*:4*:R4*)
4742c7c4e3dSmrg	echo m88k-motorola-sysv4
4758650bb69Smrg	exit ;;
4762c7c4e3dSmrg    m88k:*:3*:R3*)
4772c7c4e3dSmrg	echo m88k-motorola-sysv3
4788650bb69Smrg	exit ;;
4792c7c4e3dSmrg    AViiON:dgux:*:*)
4802c7c4e3dSmrg        # DG/UX returns AViiON for all architectures
4812c7c4e3dSmrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
4822c7c4e3dSmrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
4832c7c4e3dSmrg	then
4842c7c4e3dSmrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
4852c7c4e3dSmrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
4862c7c4e3dSmrg	    then
4872c7c4e3dSmrg		echo m88k-dg-dgux${UNAME_RELEASE}
4882c7c4e3dSmrg	    else
4892c7c4e3dSmrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
4902c7c4e3dSmrg	    fi
4912c7c4e3dSmrg	else
4922c7c4e3dSmrg	    echo i586-dg-dgux${UNAME_RELEASE}
4932c7c4e3dSmrg	fi
4948650bb69Smrg 	exit ;;
4952c7c4e3dSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
4962c7c4e3dSmrg	echo m88k-dolphin-sysv3
4978650bb69Smrg	exit ;;
4982c7c4e3dSmrg    M88*:*:R3*:*)
4992c7c4e3dSmrg	# Delta 88k system running SVR3
5002c7c4e3dSmrg	echo m88k-motorola-sysv3
5018650bb69Smrg	exit ;;
5022c7c4e3dSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5032c7c4e3dSmrg	echo m88k-tektronix-sysv3
5048650bb69Smrg	exit ;;
5052c7c4e3dSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5062c7c4e3dSmrg	echo m68k-tektronix-bsd
5078650bb69Smrg	exit ;;
5082c7c4e3dSmrg    *:IRIX*:*:*)
5092c7c4e3dSmrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5108650bb69Smrg	exit ;;
5112c7c4e3dSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5128650bb69Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5138650bb69Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5142c7c4e3dSmrg    i*86:AIX:*:*)
5152c7c4e3dSmrg	echo i386-ibm-aix
5168650bb69Smrg	exit ;;
5172c7c4e3dSmrg    ia64:AIX:*:*)
5182c7c4e3dSmrg	if [ -x /usr/bin/oslevel ] ; then
5192c7c4e3dSmrg		IBM_REV=`/usr/bin/oslevel`
5202c7c4e3dSmrg	else
5212c7c4e3dSmrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5222c7c4e3dSmrg	fi
5232c7c4e3dSmrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5248650bb69Smrg	exit ;;
5252c7c4e3dSmrg    *:AIX:2:3)
5262c7c4e3dSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5272c7c4e3dSmrg		eval $set_cc_for_build
5282c7c4e3dSmrg		sed 's/^		//' << EOF >$dummy.c
5292c7c4e3dSmrg		#include <sys/systemcfg.h>
5302c7c4e3dSmrg
5312c7c4e3dSmrg		main()
5322c7c4e3dSmrg			{
5332c7c4e3dSmrg			if (!__power_pc())
5342c7c4e3dSmrg				exit(1);
5352c7c4e3dSmrg			puts("powerpc-ibm-aix3.2.5");
5362c7c4e3dSmrg			exit(0);
5372c7c4e3dSmrg			}
5382c7c4e3dSmrgEOF
5398650bb69Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5408650bb69Smrg		then
5418650bb69Smrg			echo "$SYSTEM_NAME"
5428650bb69Smrg		else
5438650bb69Smrg			echo rs6000-ibm-aix3.2.5
5448650bb69Smrg		fi
5452c7c4e3dSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5462c7c4e3dSmrg		echo rs6000-ibm-aix3.2.4
5472c7c4e3dSmrg	else
5482c7c4e3dSmrg		echo rs6000-ibm-aix3.2
5492c7c4e3dSmrg	fi
5508650bb69Smrg	exit ;;
5518650bb69Smrg    *:AIX:*:[456])
5522c7c4e3dSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5532c7c4e3dSmrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5542c7c4e3dSmrg		IBM_ARCH=rs6000
5552c7c4e3dSmrg	else
5562c7c4e3dSmrg		IBM_ARCH=powerpc
5572c7c4e3dSmrg	fi
5582c7c4e3dSmrg	if [ -x /usr/bin/oslevel ] ; then
5592c7c4e3dSmrg		IBM_REV=`/usr/bin/oslevel`
5602c7c4e3dSmrg	else
5612c7c4e3dSmrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5622c7c4e3dSmrg	fi
5632c7c4e3dSmrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5648650bb69Smrg	exit ;;
5652c7c4e3dSmrg    *:AIX:*:*)
5662c7c4e3dSmrg	echo rs6000-ibm-aix
5678650bb69Smrg	exit ;;
5682c7c4e3dSmrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5692c7c4e3dSmrg	echo romp-ibm-bsd4.4
5708650bb69Smrg	exit ;;
5712c7c4e3dSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5722c7c4e3dSmrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5738650bb69Smrg	exit ;;                             # report: romp-ibm BSD 4.3
5742c7c4e3dSmrg    *:BOSX:*:*)
5752c7c4e3dSmrg	echo rs6000-bull-bosx
5768650bb69Smrg	exit ;;
5772c7c4e3dSmrg    DPX/2?00:B.O.S.:*:*)
5782c7c4e3dSmrg	echo m68k-bull-sysv3
5798650bb69Smrg	exit ;;
5802c7c4e3dSmrg    9000/[34]??:4.3bsd:1.*:*)
5812c7c4e3dSmrg	echo m68k-hp-bsd
5828650bb69Smrg	exit ;;
5832c7c4e3dSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
5842c7c4e3dSmrg	echo m68k-hp-bsd4.4
5858650bb69Smrg	exit ;;
5862c7c4e3dSmrg    9000/[34678]??:HP-UX:*:*)
5872c7c4e3dSmrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
5882c7c4e3dSmrg	case "${UNAME_MACHINE}" in
5892c7c4e3dSmrg	    9000/31? )            HP_ARCH=m68000 ;;
5902c7c4e3dSmrg	    9000/[34]?? )         HP_ARCH=m68k ;;
5912c7c4e3dSmrg	    9000/[678][0-9][0-9])
5922c7c4e3dSmrg		if [ -x /usr/bin/getconf ]; then
5932c7c4e3dSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
5942c7c4e3dSmrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
5952c7c4e3dSmrg                    case "${sc_cpu_version}" in
5962c7c4e3dSmrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
5972c7c4e3dSmrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
5982c7c4e3dSmrg                      532)                      # CPU_PA_RISC2_0
5992c7c4e3dSmrg                        case "${sc_kernel_bits}" in
6002c7c4e3dSmrg                          32) HP_ARCH="hppa2.0n" ;;
6012c7c4e3dSmrg                          64) HP_ARCH="hppa2.0w" ;;
6022c7c4e3dSmrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
6032c7c4e3dSmrg                        esac ;;
6042c7c4e3dSmrg                    esac
6052c7c4e3dSmrg		fi
6062c7c4e3dSmrg		if [ "${HP_ARCH}" = "" ]; then
6072c7c4e3dSmrg		    eval $set_cc_for_build
6082c7c4e3dSmrg		    sed 's/^              //' << EOF >$dummy.c
6092c7c4e3dSmrg
6102c7c4e3dSmrg              #define _HPUX_SOURCE
6112c7c4e3dSmrg              #include <stdlib.h>
6122c7c4e3dSmrg              #include <unistd.h>
6132c7c4e3dSmrg
6142c7c4e3dSmrg              int main ()
6152c7c4e3dSmrg              {
6162c7c4e3dSmrg              #if defined(_SC_KERNEL_BITS)
6172c7c4e3dSmrg                  long bits = sysconf(_SC_KERNEL_BITS);
6182c7c4e3dSmrg              #endif
6192c7c4e3dSmrg                  long cpu  = sysconf (_SC_CPU_VERSION);
6202c7c4e3dSmrg
6212c7c4e3dSmrg                  switch (cpu)
6222c7c4e3dSmrg              	{
6232c7c4e3dSmrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6242c7c4e3dSmrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6252c7c4e3dSmrg              	case CPU_PA_RISC2_0:
6262c7c4e3dSmrg              #if defined(_SC_KERNEL_BITS)
6272c7c4e3dSmrg              	    switch (bits)
6282c7c4e3dSmrg              		{
6292c7c4e3dSmrg              		case 64: puts ("hppa2.0w"); break;
6302c7c4e3dSmrg              		case 32: puts ("hppa2.0n"); break;
6312c7c4e3dSmrg              		default: puts ("hppa2.0"); break;
6322c7c4e3dSmrg              		} break;
6332c7c4e3dSmrg              #else  /* !defined(_SC_KERNEL_BITS) */
6342c7c4e3dSmrg              	    puts ("hppa2.0"); break;
6352c7c4e3dSmrg              #endif
6362c7c4e3dSmrg              	default: puts ("hppa1.0"); break;
6372c7c4e3dSmrg              	}
6382c7c4e3dSmrg                  exit (0);
6392c7c4e3dSmrg              }
6402c7c4e3dSmrgEOF
6412c7c4e3dSmrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6422c7c4e3dSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6432c7c4e3dSmrg		fi ;;
6442c7c4e3dSmrg	esac
6452c7c4e3dSmrg	if [ ${HP_ARCH} = "hppa2.0w" ]
6462c7c4e3dSmrg	then
6478650bb69Smrg	    eval $set_cc_for_build
6488650bb69Smrg
6498650bb69Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6508650bb69Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6518650bb69Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6528650bb69Smrg	    #
6538650bb69Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
6548650bb69Smrg	    # => hppa2.0w-hp-hpux11.23
6558650bb69Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6568650bb69Smrg	    # => hppa64-hp-hpux11.23
6578650bb69Smrg
6588650bb69Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
6598650bb69Smrg		grep __LP64__ >/dev/null
6602c7c4e3dSmrg	    then
6612c7c4e3dSmrg		HP_ARCH="hppa2.0w"
6622c7c4e3dSmrg	    else
6632c7c4e3dSmrg		HP_ARCH="hppa64"
6642c7c4e3dSmrg	    fi
6652c7c4e3dSmrg	fi
6662c7c4e3dSmrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6678650bb69Smrg	exit ;;
6682c7c4e3dSmrg    ia64:HP-UX:*:*)
6692c7c4e3dSmrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6702c7c4e3dSmrg	echo ia64-hp-hpux${HPUX_REV}
6718650bb69Smrg	exit ;;
6722c7c4e3dSmrg    3050*:HI-UX:*:*)
6732c7c4e3dSmrg	eval $set_cc_for_build
6742c7c4e3dSmrg	sed 's/^	//' << EOF >$dummy.c
6752c7c4e3dSmrg	#include <unistd.h>
6762c7c4e3dSmrg	int
6772c7c4e3dSmrg	main ()
6782c7c4e3dSmrg	{
6792c7c4e3dSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
6802c7c4e3dSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
6812c7c4e3dSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
6822c7c4e3dSmrg	     results, however.  */
6832c7c4e3dSmrg	  if (CPU_IS_PA_RISC (cpu))
6842c7c4e3dSmrg	    {
6852c7c4e3dSmrg	      switch (cpu)
6862c7c4e3dSmrg		{
6872c7c4e3dSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
6882c7c4e3dSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
6892c7c4e3dSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
6902c7c4e3dSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
6912c7c4e3dSmrg		}
6922c7c4e3dSmrg	    }
6932c7c4e3dSmrg	  else if (CPU_IS_HP_MC68K (cpu))
6942c7c4e3dSmrg	    puts ("m68k-hitachi-hiuxwe2");
6952c7c4e3dSmrg	  else puts ("unknown-hitachi-hiuxwe2");
6962c7c4e3dSmrg	  exit (0);
6972c7c4e3dSmrg	}
6982c7c4e3dSmrgEOF
6998650bb69Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7008650bb69Smrg		{ echo "$SYSTEM_NAME"; exit; }
7012c7c4e3dSmrg	echo unknown-hitachi-hiuxwe2
7028650bb69Smrg	exit ;;
7032c7c4e3dSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
7042c7c4e3dSmrg	echo hppa1.1-hp-bsd
7058650bb69Smrg	exit ;;
7062c7c4e3dSmrg    9000/8??:4.3bsd:*:*)
7072c7c4e3dSmrg	echo hppa1.0-hp-bsd
7088650bb69Smrg	exit ;;
7092c7c4e3dSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7102c7c4e3dSmrg	echo hppa1.0-hp-mpeix
7118650bb69Smrg	exit ;;
7122c7c4e3dSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7132c7c4e3dSmrg	echo hppa1.1-hp-osf
7148650bb69Smrg	exit ;;
7152c7c4e3dSmrg    hp8??:OSF1:*:*)
7162c7c4e3dSmrg	echo hppa1.0-hp-osf
7178650bb69Smrg	exit ;;
7182c7c4e3dSmrg    i*86:OSF1:*:*)
7192c7c4e3dSmrg	if [ -x /usr/sbin/sysversion ] ; then
7202c7c4e3dSmrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
7212c7c4e3dSmrg	else
7222c7c4e3dSmrg	    echo ${UNAME_MACHINE}-unknown-osf1
7232c7c4e3dSmrg	fi
7248650bb69Smrg	exit ;;
7252c7c4e3dSmrg    parisc*:Lites*:*:*)
7262c7c4e3dSmrg	echo hppa1.1-hp-lites
7278650bb69Smrg	exit ;;
7282c7c4e3dSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7292c7c4e3dSmrg	echo c1-convex-bsd
7308650bb69Smrg        exit ;;
7312c7c4e3dSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7322c7c4e3dSmrg	if getsysinfo -f scalar_acc
7332c7c4e3dSmrg	then echo c32-convex-bsd
7342c7c4e3dSmrg	else echo c2-convex-bsd
7352c7c4e3dSmrg	fi
7368650bb69Smrg        exit ;;
7372c7c4e3dSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7382c7c4e3dSmrg	echo c34-convex-bsd
7398650bb69Smrg        exit ;;
7402c7c4e3dSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7412c7c4e3dSmrg	echo c38-convex-bsd
7428650bb69Smrg        exit ;;
7432c7c4e3dSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7442c7c4e3dSmrg	echo c4-convex-bsd
7458650bb69Smrg        exit ;;
7462c7c4e3dSmrg    CRAY*Y-MP:*:*:*)
7472c7c4e3dSmrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7488650bb69Smrg	exit ;;
7492c7c4e3dSmrg    CRAY*[A-Z]90:*:*:*)
7502c7c4e3dSmrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7512c7c4e3dSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7522c7c4e3dSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7532c7c4e3dSmrg	      -e 's/\.[^.]*$/.X/'
7548650bb69Smrg	exit ;;
7552c7c4e3dSmrg    CRAY*TS:*:*:*)
7562c7c4e3dSmrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7578650bb69Smrg	exit ;;
7582c7c4e3dSmrg    CRAY*T3E:*:*:*)
7592c7c4e3dSmrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7608650bb69Smrg	exit ;;
7612c7c4e3dSmrg    CRAY*SV1:*:*:*)
7622c7c4e3dSmrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7638650bb69Smrg	exit ;;
7642c7c4e3dSmrg    *:UNICOS/mp:*:*)
7658650bb69Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7668650bb69Smrg	exit ;;
7672c7c4e3dSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7682c7c4e3dSmrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7692c7c4e3dSmrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7702c7c4e3dSmrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7712c7c4e3dSmrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7728650bb69Smrg        exit ;;
7738650bb69Smrg    5000:UNIX_System_V:4.*:*)
7748650bb69Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7758650bb69Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
7768650bb69Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7778650bb69Smrg	exit ;;
7782c7c4e3dSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
7792c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
7808650bb69Smrg	exit ;;
7812c7c4e3dSmrg    sparc*:BSD/OS:*:*)
7822c7c4e3dSmrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
7838650bb69Smrg	exit ;;
7842c7c4e3dSmrg    *:BSD/OS:*:*)
7852c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
7868650bb69Smrg	exit ;;
7878650bb69Smrg    *:FreeBSD:*:*)
7888650bb69Smrg	case ${UNAME_MACHINE} in
7898650bb69Smrg	    pc98)
7908650bb69Smrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7918650bb69Smrg	    amd64)
7928650bb69Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7938650bb69Smrg	    *)
7948650bb69Smrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7958650bb69Smrg	esac
7968650bb69Smrg	exit ;;
7972c7c4e3dSmrg    i*:CYGWIN*:*)
7982c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-cygwin
7998650bb69Smrg	exit ;;
8008650bb69Smrg    *:MINGW*:*)
8012c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-mingw32
8028650bb69Smrg	exit ;;
8038650bb69Smrg    i*:windows32*:*)
8048650bb69Smrg    	# uname -m includes "-pc" on this system.
8058650bb69Smrg    	echo ${UNAME_MACHINE}-mingw32
8068650bb69Smrg	exit ;;
8072c7c4e3dSmrg    i*:PW*:*)
8082c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-pw32
8098650bb69Smrg	exit ;;
8108650bb69Smrg    *:Interix*:[3456]*)
8118650bb69Smrg    	case ${UNAME_MACHINE} in
8128650bb69Smrg	    x86)
8138650bb69Smrg		echo i586-pc-interix${UNAME_RELEASE}
8148650bb69Smrg		exit ;;
8158650bb69Smrg	    EM64T | authenticamd | genuineintel)
8168650bb69Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
8178650bb69Smrg		exit ;;
8188650bb69Smrg	    IA64)
8198650bb69Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
8208650bb69Smrg		exit ;;
8218650bb69Smrg	esac ;;
8222c7c4e3dSmrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
8232c7c4e3dSmrg	echo i${UNAME_MACHINE}-pc-mks
8248650bb69Smrg	exit ;;
8252c7c4e3dSmrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
8262c7c4e3dSmrg	# How do we know it's Interix rather than the generic POSIX subsystem?
8272c7c4e3dSmrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8282c7c4e3dSmrg	# UNAME_MACHINE based on the output of uname instead of i386?
8292c7c4e3dSmrg	echo i586-pc-interix
8308650bb69Smrg	exit ;;
8312c7c4e3dSmrg    i*:UWIN*:*)
8322c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-uwin
8338650bb69Smrg	exit ;;
8348650bb69Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8358650bb69Smrg	echo x86_64-unknown-cygwin
8368650bb69Smrg	exit ;;
8372c7c4e3dSmrg    p*:CYGWIN*:*)
8382c7c4e3dSmrg	echo powerpcle-unknown-cygwin
8398650bb69Smrg	exit ;;
8402c7c4e3dSmrg    prep*:SunOS:5.*:*)
8412c7c4e3dSmrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8428650bb69Smrg	exit ;;
8432c7c4e3dSmrg    *:GNU:*:*)
8448650bb69Smrg	# the GNU system
8452c7c4e3dSmrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8468650bb69Smrg	exit ;;
8478650bb69Smrg    *:GNU/*:*:*)
8488650bb69Smrg	# other systems with GNU libc and userland
8498650bb69Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
8508650bb69Smrg	exit ;;
8512c7c4e3dSmrg    i*86:Minix:*:*)
8522c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-minix
8538650bb69Smrg	exit ;;
8542c7c4e3dSmrg    arm*:Linux:*:*)
8558650bb69Smrg	eval $set_cc_for_build
8568650bb69Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
8578650bb69Smrg	    | grep -q __ARM_EABI__
8588650bb69Smrg	then
8598650bb69Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
8608650bb69Smrg	else
8618650bb69Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
8628650bb69Smrg	fi
8638650bb69Smrg	exit ;;
8648650bb69Smrg    avr32*:Linux:*:*)
8652c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8668650bb69Smrg	exit ;;
8672c7c4e3dSmrg    cris:Linux:*:*)
8682c7c4e3dSmrg	echo cris-axis-linux-gnu
8698650bb69Smrg	exit ;;
8708650bb69Smrg    crisv32:Linux:*:*)
8718650bb69Smrg	echo crisv32-axis-linux-gnu
8728650bb69Smrg	exit ;;
8738650bb69Smrg    frv:Linux:*:*)
8748650bb69Smrg    	echo frv-unknown-linux-gnu
8758650bb69Smrg	exit ;;
8762c7c4e3dSmrg    ia64:Linux:*:*)
8778650bb69Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8788650bb69Smrg	exit ;;
8798650bb69Smrg    m32r*:Linux:*:*)
8808650bb69Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8818650bb69Smrg	exit ;;
8822c7c4e3dSmrg    m68*:Linux:*:*)
8832c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8848650bb69Smrg	exit ;;
8852c7c4e3dSmrg    mips:Linux:*:*)
8862c7c4e3dSmrg	eval $set_cc_for_build
8872c7c4e3dSmrg	sed 's/^	//' << EOF >$dummy.c
8882c7c4e3dSmrg	#undef CPU
8892c7c4e3dSmrg	#undef mips
8902c7c4e3dSmrg	#undef mipsel
8912c7c4e3dSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
8922c7c4e3dSmrg	CPU=mipsel
8932c7c4e3dSmrg	#else
8942c7c4e3dSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
8952c7c4e3dSmrg	CPU=mips
8962c7c4e3dSmrg	#else
8972c7c4e3dSmrg	CPU=
8982c7c4e3dSmrg	#endif
8992c7c4e3dSmrg	#endif
9002c7c4e3dSmrgEOF
9018650bb69Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
9028650bb69Smrg	    /^CPU/{
9038650bb69Smrg		s: ::g
9048650bb69Smrg		p
9058650bb69Smrg	    }'`"
9068650bb69Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
9072c7c4e3dSmrg	;;
9082c7c4e3dSmrg    mips64:Linux:*:*)
9092c7c4e3dSmrg	eval $set_cc_for_build
9102c7c4e3dSmrg	sed 's/^	//' << EOF >$dummy.c
9112c7c4e3dSmrg	#undef CPU
9122c7c4e3dSmrg	#undef mips64
9132c7c4e3dSmrg	#undef mips64el
9142c7c4e3dSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
9152c7c4e3dSmrg	CPU=mips64el
9162c7c4e3dSmrg	#else
9172c7c4e3dSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9182c7c4e3dSmrg	CPU=mips64
9192c7c4e3dSmrg	#else
9202c7c4e3dSmrg	CPU=
9212c7c4e3dSmrg	#endif
9222c7c4e3dSmrg	#endif
9232c7c4e3dSmrgEOF
9248650bb69Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
9258650bb69Smrg	    /^CPU/{
9268650bb69Smrg		s: ::g
9278650bb69Smrg		p
9288650bb69Smrg	    }'`"
9298650bb69Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
9302c7c4e3dSmrg	;;
9318650bb69Smrg    or32:Linux:*:*)
9328650bb69Smrg	echo or32-unknown-linux-gnu
9338650bb69Smrg	exit ;;
9342c7c4e3dSmrg    ppc:Linux:*:*)
9358650bb69Smrg	echo powerpc-unknown-linux-gnu
9368650bb69Smrg	exit ;;
9372c7c4e3dSmrg    ppc64:Linux:*:*)
9388650bb69Smrg	echo powerpc64-unknown-linux-gnu
9398650bb69Smrg	exit ;;
9402c7c4e3dSmrg    alpha:Linux:*:*)
9412c7c4e3dSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
9422c7c4e3dSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
9432c7c4e3dSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
9442c7c4e3dSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
9452c7c4e3dSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
9462c7c4e3dSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
9472c7c4e3dSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
9482c7c4e3dSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
9492c7c4e3dSmrg        esac
9502c7c4e3dSmrg	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
9512c7c4e3dSmrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
9522c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
9538650bb69Smrg	exit ;;
9548650bb69Smrg    padre:Linux:*:*)
9558650bb69Smrg	echo sparc-unknown-linux-gnu
9568650bb69Smrg	exit ;;
9572c7c4e3dSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
9582c7c4e3dSmrg	# Look for CPU level
9592c7c4e3dSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9602c7c4e3dSmrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
9612c7c4e3dSmrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
9622c7c4e3dSmrg	  *)    echo hppa-unknown-linux-gnu ;;
9632c7c4e3dSmrg	esac
9648650bb69Smrg	exit ;;
9652c7c4e3dSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
9662c7c4e3dSmrg	echo hppa64-unknown-linux-gnu
9678650bb69Smrg	exit ;;
9682c7c4e3dSmrg    s390:Linux:*:* | s390x:Linux:*:*)
9698650bb69Smrg	echo ${UNAME_MACHINE}-ibm-linux
9708650bb69Smrg	exit ;;
9712c7c4e3dSmrg    sh64*:Linux:*:*)
9722c7c4e3dSmrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
9738650bb69Smrg	exit ;;
9742c7c4e3dSmrg    sh*:Linux:*:*)
9752c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9768650bb69Smrg	exit ;;
9772c7c4e3dSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
9782c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9798650bb69Smrg	exit ;;
9808650bb69Smrg    vax:Linux:*:*)
9818650bb69Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
9828650bb69Smrg	exit ;;
9832c7c4e3dSmrg    x86_64:Linux:*:*)
9848650bb69Smrg	echo x86_64-unknown-linux-gnu
9858650bb69Smrg	exit ;;
9868650bb69Smrg    xtensa*:Linux:*:*)
9878650bb69Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
9888650bb69Smrg	exit ;;
9892c7c4e3dSmrg    i*86:Linux:*:*)
9902c7c4e3dSmrg	# The BFD linker knows what the default object file format is, so
9912c7c4e3dSmrg	# first see if it will tell us. cd to the root directory to prevent
9922c7c4e3dSmrg	# problems with other programs or directories called `ld' in the path.
9932c7c4e3dSmrg	# Set LC_ALL=C to ensure ld outputs messages in English.
9942c7c4e3dSmrg	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
9952c7c4e3dSmrg			 | sed -ne '/supported targets:/!d
9962c7c4e3dSmrg				    s/[ 	][ 	]*/ /g
9972c7c4e3dSmrg				    s/.*supported targets: *//
9982c7c4e3dSmrg				    s/ .*//
9992c7c4e3dSmrg				    p'`
10002c7c4e3dSmrg        case "$ld_supported_targets" in
10012c7c4e3dSmrg	  elf32-i386)
10022c7c4e3dSmrg		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
10032c7c4e3dSmrg		;;
10042c7c4e3dSmrg	  a.out-i386-linux)
10052c7c4e3dSmrg		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
10068650bb69Smrg		exit ;;
10072c7c4e3dSmrg	  "")
10082c7c4e3dSmrg		# Either a pre-BFD a.out linker (linux-gnuoldld) or
10092c7c4e3dSmrg		# one that does not give us useful --help.
10102c7c4e3dSmrg		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
10118650bb69Smrg		exit ;;
10122c7c4e3dSmrg	esac
10132c7c4e3dSmrg	# Determine whether the default compiler is a.out or elf
10142c7c4e3dSmrg	eval $set_cc_for_build
10152c7c4e3dSmrg	sed 's/^	//' << EOF >$dummy.c
10162c7c4e3dSmrg	#include <features.h>
10172c7c4e3dSmrg	#ifdef __ELF__
10182c7c4e3dSmrg	# ifdef __GLIBC__
10192c7c4e3dSmrg	#  if __GLIBC__ >= 2
10202c7c4e3dSmrg	LIBC=gnu
10212c7c4e3dSmrg	#  else
10222c7c4e3dSmrg	LIBC=gnulibc1
10232c7c4e3dSmrg	#  endif
10242c7c4e3dSmrg	# else
10252c7c4e3dSmrg	LIBC=gnulibc1
10262c7c4e3dSmrg	# endif
10272c7c4e3dSmrg	#else
10288650bb69Smrg	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
10292c7c4e3dSmrg	LIBC=gnu
10302c7c4e3dSmrg	#else
10312c7c4e3dSmrg	LIBC=gnuaout
10322c7c4e3dSmrg	#endif
10332c7c4e3dSmrg	#endif
10348650bb69Smrg	#ifdef __dietlibc__
10358650bb69Smrg	LIBC=dietlibc
10368650bb69Smrg	#endif
10372c7c4e3dSmrgEOF
10388650bb69Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
10398650bb69Smrg	    /^LIBC/{
10408650bb69Smrg		s: ::g
10418650bb69Smrg		p
10428650bb69Smrg	    }'`"
10438650bb69Smrg	test x"${LIBC}" != x && {
10448650bb69Smrg		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
10458650bb69Smrg		exit
10468650bb69Smrg	}
10478650bb69Smrg	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
10482c7c4e3dSmrg	;;
10492c7c4e3dSmrg    i*86:DYNIX/ptx:4*:*)
10502c7c4e3dSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10512c7c4e3dSmrg	# earlier versions are messed up and put the nodename in both
10522c7c4e3dSmrg	# sysname and nodename.
10532c7c4e3dSmrg	echo i386-sequent-sysv4
10548650bb69Smrg	exit ;;
10552c7c4e3dSmrg    i*86:UNIX_SV:4.2MP:2.*)
10562c7c4e3dSmrg        # Unixware is an offshoot of SVR4, but it has its own version
10572c7c4e3dSmrg        # number series starting with 2...
10582c7c4e3dSmrg        # I am not positive that other SVR4 systems won't match this,
10592c7c4e3dSmrg	# I just have to hope.  -- rms.
10602c7c4e3dSmrg        # Use sysv4.2uw... so that sysv4* matches it.
10612c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10628650bb69Smrg	exit ;;
10632c7c4e3dSmrg    i*86:OS/2:*:*)
10642c7c4e3dSmrg	# If we were able to find `uname', then EMX Unix compatibility
10652c7c4e3dSmrg	# is probably installed.
10662c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-os2-emx
10678650bb69Smrg	exit ;;
10682c7c4e3dSmrg    i*86:XTS-300:*:STOP)
10692c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-stop
10708650bb69Smrg	exit ;;
10712c7c4e3dSmrg    i*86:atheos:*:*)
10722c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-atheos
10738650bb69Smrg	exit ;;
10748650bb69Smrg    i*86:syllable:*:*)
10758650bb69Smrg	echo ${UNAME_MACHINE}-pc-syllable
10768650bb69Smrg	exit ;;
10772c7c4e3dSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
10782c7c4e3dSmrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10798650bb69Smrg	exit ;;
10802c7c4e3dSmrg    i*86:*DOS:*:*)
10812c7c4e3dSmrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10828650bb69Smrg	exit ;;
10832c7c4e3dSmrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10842c7c4e3dSmrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10852c7c4e3dSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10862c7c4e3dSmrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10872c7c4e3dSmrg	else
10882c7c4e3dSmrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10892c7c4e3dSmrg	fi
10908650bb69Smrg	exit ;;
10918650bb69Smrg    i*86:*:5:[678]*)
10928650bb69Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10932c7c4e3dSmrg	case `/bin/uname -X | grep "^Machine"` in
10942c7c4e3dSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
10952c7c4e3dSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
10962c7c4e3dSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10972c7c4e3dSmrg	esac
10982c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10998650bb69Smrg	exit ;;
11002c7c4e3dSmrg    i*86:*:3.2:*)
11012c7c4e3dSmrg	if test -f /usr/options/cb.name; then
11022c7c4e3dSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
11032c7c4e3dSmrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
11042c7c4e3dSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
11052c7c4e3dSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
11062c7c4e3dSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
11072c7c4e3dSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
11082c7c4e3dSmrg			&& UNAME_MACHINE=i586
11092c7c4e3dSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
11102c7c4e3dSmrg			&& UNAME_MACHINE=i686
11112c7c4e3dSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
11122c7c4e3dSmrg			&& UNAME_MACHINE=i686
11132c7c4e3dSmrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
11142c7c4e3dSmrg	else
11152c7c4e3dSmrg		echo ${UNAME_MACHINE}-pc-sysv32
11162c7c4e3dSmrg	fi
11178650bb69Smrg	exit ;;
11182c7c4e3dSmrg    pc:*:*:*)
11192c7c4e3dSmrg	# Left here for compatibility:
11202c7c4e3dSmrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
11218650bb69Smrg        # the processor, so we play safe by assuming i586.
11228650bb69Smrg	# Note: whatever this is, it MUST be the same as what config.sub
11238650bb69Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
11248650bb69Smrg	# this is a cross-build.
11258650bb69Smrg	echo i586-pc-msdosdjgpp
11268650bb69Smrg        exit ;;
11272c7c4e3dSmrg    Intel:Mach:3*:*)
11282c7c4e3dSmrg	echo i386-pc-mach3
11298650bb69Smrg	exit ;;
11302c7c4e3dSmrg    paragon:*:*:*)
11312c7c4e3dSmrg	echo i860-intel-osf1
11328650bb69Smrg	exit ;;
11332c7c4e3dSmrg    i860:*:4.*:*) # i860-SVR4
11342c7c4e3dSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
11352c7c4e3dSmrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
11362c7c4e3dSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
11372c7c4e3dSmrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
11382c7c4e3dSmrg	fi
11398650bb69Smrg	exit ;;
11402c7c4e3dSmrg    mini*:CTIX:SYS*5:*)
11412c7c4e3dSmrg	# "miniframe"
11422c7c4e3dSmrg	echo m68010-convergent-sysv
11438650bb69Smrg	exit ;;
11442c7c4e3dSmrg    mc68k:UNIX:SYSTEM5:3.51m)
11452c7c4e3dSmrg	echo m68k-convergent-sysv
11468650bb69Smrg	exit ;;
11472c7c4e3dSmrg    M680?0:D-NIX:5.3:*)
11482c7c4e3dSmrg	echo m68k-diab-dnix
11498650bb69Smrg	exit ;;
11508650bb69Smrg    M68*:*:R3V[5678]*:*)
11518650bb69Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11528650bb69Smrg    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)
11532c7c4e3dSmrg	OS_REL=''
11542c7c4e3dSmrg	test -r /etc/.relid \
11552c7c4e3dSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11562c7c4e3dSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11578650bb69Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11582c7c4e3dSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11598650bb69Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11602c7c4e3dSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11612c7c4e3dSmrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11628650bb69Smrg          && { echo i486-ncr-sysv4; exit; } ;;
11638650bb69Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
11648650bb69Smrg	OS_REL='.3'
11658650bb69Smrg	test -r /etc/.relid \
11668650bb69Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11678650bb69Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11688650bb69Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11698650bb69Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11708650bb69Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
11718650bb69Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
11728650bb69Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11732c7c4e3dSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11742c7c4e3dSmrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11758650bb69Smrg	exit ;;
11762c7c4e3dSmrg    mc68030:UNIX_System_V:4.*:*)
11772c7c4e3dSmrg	echo m68k-atari-sysv4
11788650bb69Smrg	exit ;;
11792c7c4e3dSmrg    TSUNAMI:LynxOS:2.*:*)
11802c7c4e3dSmrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11818650bb69Smrg	exit ;;
11822c7c4e3dSmrg    rs6000:LynxOS:2.*:*)
11832c7c4e3dSmrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11848650bb69Smrg	exit ;;
11852c7c4e3dSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
11862c7c4e3dSmrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11878650bb69Smrg	exit ;;
11882c7c4e3dSmrg    SM[BE]S:UNIX_SV:*:*)
11892c7c4e3dSmrg	echo mips-dde-sysv${UNAME_RELEASE}
11908650bb69Smrg	exit ;;
11912c7c4e3dSmrg    RM*:ReliantUNIX-*:*:*)
11922c7c4e3dSmrg	echo mips-sni-sysv4
11938650bb69Smrg	exit ;;
11942c7c4e3dSmrg    RM*:SINIX-*:*:*)
11952c7c4e3dSmrg	echo mips-sni-sysv4
11968650bb69Smrg	exit ;;
11972c7c4e3dSmrg    *:SINIX-*:*:*)
11982c7c4e3dSmrg	if uname -p 2>/dev/null >/dev/null ; then
11992c7c4e3dSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
12002c7c4e3dSmrg		echo ${UNAME_MACHINE}-sni-sysv4
12012c7c4e3dSmrg	else
12022c7c4e3dSmrg		echo ns32k-sni-sysv
12032c7c4e3dSmrg	fi
12048650bb69Smrg	exit ;;
12052c7c4e3dSmrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
12062c7c4e3dSmrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
12072c7c4e3dSmrg        echo i586-unisys-sysv4
12088650bb69Smrg        exit ;;
12092c7c4e3dSmrg    *:UNIX_System_V:4*:FTX*)
12102c7c4e3dSmrg	# From Gerald Hewes <hewes@openmarket.com>.
12112c7c4e3dSmrg	# How about differentiating between stratus architectures? -djm
12122c7c4e3dSmrg	echo hppa1.1-stratus-sysv4
12138650bb69Smrg	exit ;;
12142c7c4e3dSmrg    *:*:*:FTX*)
12152c7c4e3dSmrg	# From seanf@swdc.stratus.com.
12162c7c4e3dSmrg	echo i860-stratus-sysv4
12178650bb69Smrg	exit ;;
12188650bb69Smrg    i*86:VOS:*:*)
12198650bb69Smrg	# From Paul.Green@stratus.com.
12208650bb69Smrg	echo ${UNAME_MACHINE}-stratus-vos
12218650bb69Smrg	exit ;;
12222c7c4e3dSmrg    *:VOS:*:*)
12232c7c4e3dSmrg	# From Paul.Green@stratus.com.
12242c7c4e3dSmrg	echo hppa1.1-stratus-vos
12258650bb69Smrg	exit ;;
12262c7c4e3dSmrg    mc68*:A/UX:*:*)
12272c7c4e3dSmrg	echo m68k-apple-aux${UNAME_RELEASE}
12288650bb69Smrg	exit ;;
12292c7c4e3dSmrg    news*:NEWS-OS:6*:*)
12302c7c4e3dSmrg	echo mips-sony-newsos6
12318650bb69Smrg	exit ;;
12322c7c4e3dSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12332c7c4e3dSmrg	if [ -d /usr/nec ]; then
12342c7c4e3dSmrg	        echo mips-nec-sysv${UNAME_RELEASE}
12352c7c4e3dSmrg	else
12362c7c4e3dSmrg	        echo mips-unknown-sysv${UNAME_RELEASE}
12372c7c4e3dSmrg	fi
12388650bb69Smrg        exit ;;
12392c7c4e3dSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
12402c7c4e3dSmrg	echo powerpc-be-beos
12418650bb69Smrg	exit ;;
12422c7c4e3dSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
12432c7c4e3dSmrg	echo powerpc-apple-beos
12448650bb69Smrg	exit ;;
12452c7c4e3dSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
12462c7c4e3dSmrg	echo i586-pc-beos
12478650bb69Smrg	exit ;;
12488650bb69Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
12498650bb69Smrg	echo i586-pc-haiku
12508650bb69Smrg	exit ;;
12512c7c4e3dSmrg    SX-4:SUPER-UX:*:*)
12522c7c4e3dSmrg	echo sx4-nec-superux${UNAME_RELEASE}
12538650bb69Smrg	exit ;;
12542c7c4e3dSmrg    SX-5:SUPER-UX:*:*)
12552c7c4e3dSmrg	echo sx5-nec-superux${UNAME_RELEASE}
12568650bb69Smrg	exit ;;
12572c7c4e3dSmrg    SX-6:SUPER-UX:*:*)
12582c7c4e3dSmrg	echo sx6-nec-superux${UNAME_RELEASE}
12598650bb69Smrg	exit ;;
12608650bb69Smrg    SX-7:SUPER-UX:*:*)
12618650bb69Smrg	echo sx7-nec-superux${UNAME_RELEASE}
12628650bb69Smrg	exit ;;
12638650bb69Smrg    SX-8:SUPER-UX:*:*)
12648650bb69Smrg	echo sx8-nec-superux${UNAME_RELEASE}
12658650bb69Smrg	exit ;;
12668650bb69Smrg    SX-8R:SUPER-UX:*:*)
12678650bb69Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
12688650bb69Smrg	exit ;;
12692c7c4e3dSmrg    Power*:Rhapsody:*:*)
12702c7c4e3dSmrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12718650bb69Smrg	exit ;;
12722c7c4e3dSmrg    *:Rhapsody:*:*)
12732c7c4e3dSmrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12748650bb69Smrg	exit ;;
12752c7c4e3dSmrg    *:Darwin:*:*)
12768650bb69Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12778650bb69Smrg	case $UNAME_PROCESSOR in
12788650bb69Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
12792c7c4e3dSmrg	esac
12802c7c4e3dSmrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12818650bb69Smrg	exit ;;
12822c7c4e3dSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
12832c7c4e3dSmrg	UNAME_PROCESSOR=`uname -p`
12842c7c4e3dSmrg	if test "$UNAME_PROCESSOR" = "x86"; then
12852c7c4e3dSmrg		UNAME_PROCESSOR=i386
12862c7c4e3dSmrg		UNAME_MACHINE=pc
12872c7c4e3dSmrg	fi
12882c7c4e3dSmrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
12898650bb69Smrg	exit ;;
12902c7c4e3dSmrg    *:QNX:*:4*)
12912c7c4e3dSmrg	echo i386-pc-qnx
12928650bb69Smrg	exit ;;
12938650bb69Smrg    NSE-?:NONSTOP_KERNEL:*:*)
12948650bb69Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
12958650bb69Smrg	exit ;;
12968650bb69Smrg    NSR-?:NONSTOP_KERNEL:*:*)
12972c7c4e3dSmrg	echo nsr-tandem-nsk${UNAME_RELEASE}
12988650bb69Smrg	exit ;;
12992c7c4e3dSmrg    *:NonStop-UX:*:*)
13002c7c4e3dSmrg	echo mips-compaq-nonstopux
13018650bb69Smrg	exit ;;
13022c7c4e3dSmrg    BS2000:POSIX*:*:*)
13032c7c4e3dSmrg	echo bs2000-siemens-sysv
13048650bb69Smrg	exit ;;
13052c7c4e3dSmrg    DS/*:UNIX_System_V:*:*)
13062c7c4e3dSmrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
13078650bb69Smrg	exit ;;
13082c7c4e3dSmrg    *:Plan9:*:*)
13092c7c4e3dSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
13102c7c4e3dSmrg	# is converted to i386 for consistency with other x86
13112c7c4e3dSmrg	# operating systems.
13122c7c4e3dSmrg	if test "$cputype" = "386"; then
13132c7c4e3dSmrg	    UNAME_MACHINE=i386
13142c7c4e3dSmrg	else
13152c7c4e3dSmrg	    UNAME_MACHINE="$cputype"
13162c7c4e3dSmrg	fi
13172c7c4e3dSmrg	echo ${UNAME_MACHINE}-unknown-plan9
13188650bb69Smrg	exit ;;
13192c7c4e3dSmrg    *:TOPS-10:*:*)
13202c7c4e3dSmrg	echo pdp10-unknown-tops10
13218650bb69Smrg	exit ;;
13222c7c4e3dSmrg    *:TENEX:*:*)
13232c7c4e3dSmrg	echo pdp10-unknown-tenex
13248650bb69Smrg	exit ;;
13252c7c4e3dSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
13262c7c4e3dSmrg	echo pdp10-dec-tops20
13278650bb69Smrg	exit ;;
13282c7c4e3dSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
13292c7c4e3dSmrg	echo pdp10-xkl-tops20
13308650bb69Smrg	exit ;;
13312c7c4e3dSmrg    *:TOPS-20:*:*)
13322c7c4e3dSmrg	echo pdp10-unknown-tops20
13338650bb69Smrg	exit ;;
13342c7c4e3dSmrg    *:ITS:*:*)
13352c7c4e3dSmrg	echo pdp10-unknown-its
13368650bb69Smrg	exit ;;
13372c7c4e3dSmrg    SEI:*:*:SEIUX)
13382c7c4e3dSmrg        echo mips-sei-seiux${UNAME_RELEASE}
13398650bb69Smrg	exit ;;
13408650bb69Smrg    *:DragonFly:*:*)
13418650bb69Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13428650bb69Smrg	exit ;;
13438650bb69Smrg    *:*VMS:*:*)
13448650bb69Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13458650bb69Smrg	case "${UNAME_MACHINE}" in
13468650bb69Smrg	    A*) echo alpha-dec-vms ; exit ;;
13478650bb69Smrg	    I*) echo ia64-dec-vms ; exit ;;
13488650bb69Smrg	    V*) echo vax-dec-vms ; exit ;;
13498650bb69Smrg	esac ;;
13508650bb69Smrg    *:XENIX:*:SysV)
13518650bb69Smrg	echo i386-pc-xenix
13528650bb69Smrg	exit ;;
13538650bb69Smrg    i*86:skyos:*:*)
13548650bb69Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13558650bb69Smrg	exit ;;
13568650bb69Smrg    i*86:rdos:*:*)
13578650bb69Smrg	echo ${UNAME_MACHINE}-pc-rdos
13588650bb69Smrg	exit ;;
13598650bb69Smrg    i*86:AROS:*:*)
13608650bb69Smrg	echo ${UNAME_MACHINE}-pc-aros
13618650bb69Smrg	exit ;;
13622c7c4e3dSmrgesac
13632c7c4e3dSmrg
13642c7c4e3dSmrg#echo '(No uname command or uname output not recognized.)' 1>&2
13652c7c4e3dSmrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
13662c7c4e3dSmrg
13672c7c4e3dSmrgeval $set_cc_for_build
13682c7c4e3dSmrgcat >$dummy.c <<EOF
13692c7c4e3dSmrg#ifdef _SEQUENT_
13702c7c4e3dSmrg# include <sys/types.h>
13712c7c4e3dSmrg# include <sys/utsname.h>
13722c7c4e3dSmrg#endif
13732c7c4e3dSmrgmain ()
13742c7c4e3dSmrg{
13752c7c4e3dSmrg#if defined (sony)
13762c7c4e3dSmrg#if defined (MIPSEB)
13772c7c4e3dSmrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
13782c7c4e3dSmrg     I don't know....  */
13792c7c4e3dSmrg  printf ("mips-sony-bsd\n"); exit (0);
13802c7c4e3dSmrg#else
13812c7c4e3dSmrg#include <sys/param.h>
13822c7c4e3dSmrg  printf ("m68k-sony-newsos%s\n",
13832c7c4e3dSmrg#ifdef NEWSOS4
13842c7c4e3dSmrg          "4"
13852c7c4e3dSmrg#else
13862c7c4e3dSmrg	  ""
13872c7c4e3dSmrg#endif
13882c7c4e3dSmrg         ); exit (0);
13892c7c4e3dSmrg#endif
13902c7c4e3dSmrg#endif
13912c7c4e3dSmrg
13922c7c4e3dSmrg#if defined (__arm) && defined (__acorn) && defined (__unix)
13938650bb69Smrg  printf ("arm-acorn-riscix\n"); exit (0);
13942c7c4e3dSmrg#endif
13952c7c4e3dSmrg
13962c7c4e3dSmrg#if defined (hp300) && !defined (hpux)
13972c7c4e3dSmrg  printf ("m68k-hp-bsd\n"); exit (0);
13982c7c4e3dSmrg#endif
13992c7c4e3dSmrg
14002c7c4e3dSmrg#if defined (NeXT)
14012c7c4e3dSmrg#if !defined (__ARCHITECTURE__)
14022c7c4e3dSmrg#define __ARCHITECTURE__ "m68k"
14032c7c4e3dSmrg#endif
14042c7c4e3dSmrg  int version;
14052c7c4e3dSmrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
14062c7c4e3dSmrg  if (version < 4)
14072c7c4e3dSmrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
14082c7c4e3dSmrg  else
14092c7c4e3dSmrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
14102c7c4e3dSmrg  exit (0);
14112c7c4e3dSmrg#endif
14122c7c4e3dSmrg
14132c7c4e3dSmrg#if defined (MULTIMAX) || defined (n16)
14142c7c4e3dSmrg#if defined (UMAXV)
14152c7c4e3dSmrg  printf ("ns32k-encore-sysv\n"); exit (0);
14162c7c4e3dSmrg#else
14172c7c4e3dSmrg#if defined (CMU)
14182c7c4e3dSmrg  printf ("ns32k-encore-mach\n"); exit (0);
14192c7c4e3dSmrg#else
14202c7c4e3dSmrg  printf ("ns32k-encore-bsd\n"); exit (0);
14212c7c4e3dSmrg#endif
14222c7c4e3dSmrg#endif
14232c7c4e3dSmrg#endif
14242c7c4e3dSmrg
14252c7c4e3dSmrg#if defined (__386BSD__)
14262c7c4e3dSmrg  printf ("i386-pc-bsd\n"); exit (0);
14272c7c4e3dSmrg#endif
14282c7c4e3dSmrg
14292c7c4e3dSmrg#if defined (sequent)
14302c7c4e3dSmrg#if defined (i386)
14312c7c4e3dSmrg  printf ("i386-sequent-dynix\n"); exit (0);
14322c7c4e3dSmrg#endif
14332c7c4e3dSmrg#if defined (ns32000)
14342c7c4e3dSmrg  printf ("ns32k-sequent-dynix\n"); exit (0);
14352c7c4e3dSmrg#endif
14362c7c4e3dSmrg#endif
14372c7c4e3dSmrg
14382c7c4e3dSmrg#if defined (_SEQUENT_)
14392c7c4e3dSmrg    struct utsname un;
14402c7c4e3dSmrg
14412c7c4e3dSmrg    uname(&un);
14422c7c4e3dSmrg
14432c7c4e3dSmrg    if (strncmp(un.version, "V2", 2) == 0) {
14442c7c4e3dSmrg	printf ("i386-sequent-ptx2\n"); exit (0);
14452c7c4e3dSmrg    }
14462c7c4e3dSmrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
14472c7c4e3dSmrg	printf ("i386-sequent-ptx1\n"); exit (0);
14482c7c4e3dSmrg    }
14492c7c4e3dSmrg    printf ("i386-sequent-ptx\n"); exit (0);
14502c7c4e3dSmrg
14512c7c4e3dSmrg#endif
14522c7c4e3dSmrg
14532c7c4e3dSmrg#if defined (vax)
14542c7c4e3dSmrg# if !defined (ultrix)
14552c7c4e3dSmrg#  include <sys/param.h>
14562c7c4e3dSmrg#  if defined (BSD)
14572c7c4e3dSmrg#   if BSD == 43
14582c7c4e3dSmrg      printf ("vax-dec-bsd4.3\n"); exit (0);
14592c7c4e3dSmrg#   else
14602c7c4e3dSmrg#    if BSD == 199006
14612c7c4e3dSmrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
14622c7c4e3dSmrg#    else
14632c7c4e3dSmrg      printf ("vax-dec-bsd\n"); exit (0);
14642c7c4e3dSmrg#    endif
14652c7c4e3dSmrg#   endif
14662c7c4e3dSmrg#  else
14672c7c4e3dSmrg    printf ("vax-dec-bsd\n"); exit (0);
14682c7c4e3dSmrg#  endif
14692c7c4e3dSmrg# else
14702c7c4e3dSmrg    printf ("vax-dec-ultrix\n"); exit (0);
14712c7c4e3dSmrg# endif
14722c7c4e3dSmrg#endif
14732c7c4e3dSmrg
14742c7c4e3dSmrg#if defined (alliant) && defined (i860)
14752c7c4e3dSmrg  printf ("i860-alliant-bsd\n"); exit (0);
14762c7c4e3dSmrg#endif
14772c7c4e3dSmrg
14782c7c4e3dSmrg  exit (1);
14792c7c4e3dSmrg}
14802c7c4e3dSmrgEOF
14812c7c4e3dSmrg
14828650bb69Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
14838650bb69Smrg	{ echo "$SYSTEM_NAME"; exit; }
14842c7c4e3dSmrg
14852c7c4e3dSmrg# Apollos put the system type in the environment.
14862c7c4e3dSmrg
14878650bb69Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
14882c7c4e3dSmrg
14892c7c4e3dSmrg# Convex versions that predate uname can use getsysinfo(1)
14902c7c4e3dSmrg
14912c7c4e3dSmrgif [ -x /usr/convex/getsysinfo ]
14922c7c4e3dSmrgthen
14932c7c4e3dSmrg    case `getsysinfo -f cpu_type` in
14942c7c4e3dSmrg    c1*)
14952c7c4e3dSmrg	echo c1-convex-bsd
14968650bb69Smrg	exit ;;
14972c7c4e3dSmrg    c2*)
14982c7c4e3dSmrg	if getsysinfo -f scalar_acc
14992c7c4e3dSmrg	then echo c32-convex-bsd
15002c7c4e3dSmrg	else echo c2-convex-bsd
15012c7c4e3dSmrg	fi
15028650bb69Smrg	exit ;;
15032c7c4e3dSmrg    c34*)
15042c7c4e3dSmrg	echo c34-convex-bsd
15058650bb69Smrg	exit ;;
15062c7c4e3dSmrg    c38*)
15072c7c4e3dSmrg	echo c38-convex-bsd
15088650bb69Smrg	exit ;;
15092c7c4e3dSmrg    c4*)
15102c7c4e3dSmrg	echo c4-convex-bsd
15118650bb69Smrg	exit ;;
15122c7c4e3dSmrg    esac
15132c7c4e3dSmrgfi
15142c7c4e3dSmrg
15152c7c4e3dSmrgcat >&2 <<EOF
15162c7c4e3dSmrg$0: unable to guess system type
15172c7c4e3dSmrg
15182c7c4e3dSmrgThis script, last modified $timestamp, has failed to recognize
15192c7c4e3dSmrgthe operating system you are using. It is advised that you
15202c7c4e3dSmrgdownload the most up to date version of the config scripts from
15212c7c4e3dSmrg
15228650bb69Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
15238650bb69Smrgand
15248650bb69Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
15252c7c4e3dSmrg
15262c7c4e3dSmrgIf the version you run ($0) is already up to date, please
15272c7c4e3dSmrgsend the following data and any information you think might be
15282c7c4e3dSmrgpertinent to <config-patches@gnu.org> in order to provide the needed
15292c7c4e3dSmrginformation to handle your system.
15302c7c4e3dSmrg
15312c7c4e3dSmrgconfig.guess timestamp = $timestamp
15322c7c4e3dSmrg
15332c7c4e3dSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
15342c7c4e3dSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
15352c7c4e3dSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
15362c7c4e3dSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
15372c7c4e3dSmrg
15382c7c4e3dSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
15392c7c4e3dSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
15402c7c4e3dSmrg
15412c7c4e3dSmrghostinfo               = `(hostinfo) 2>/dev/null`
15422c7c4e3dSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
15432c7c4e3dSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
15442c7c4e3dSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
15452c7c4e3dSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
15462c7c4e3dSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
15472c7c4e3dSmrg
15482c7c4e3dSmrgUNAME_MACHINE = ${UNAME_MACHINE}
15492c7c4e3dSmrgUNAME_RELEASE = ${UNAME_RELEASE}
15502c7c4e3dSmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
15512c7c4e3dSmrgUNAME_VERSION = ${UNAME_VERSION}
15522c7c4e3dSmrgEOF
15532c7c4e3dSmrg
15542c7c4e3dSmrgexit 1
15552c7c4e3dSmrg
15562c7c4e3dSmrg# Local variables:
15572c7c4e3dSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
15582c7c4e3dSmrg# time-stamp-start: "timestamp='"
15592c7c4e3dSmrg# time-stamp-format: "%:y-%02m-%02d"
15602c7c4e3dSmrg# time-stamp-end: "'"
15612c7c4e3dSmrg# End:
1562