config.guess revision b7fb5eac
11a30de1fSmrg#! /bin/sh
21a30de1fSmrg# Attempt to guess a canonical system name.
31a30de1fSmrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4b7fb5eacSmrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5b7fb5eacSmrg#   Free Software Foundation, Inc.
61a30de1fSmrg
7b7fb5eacSmrgtimestamp='2009-04-27'
81a30de1fSmrg
91a30de1fSmrg# This file is free software; you can redistribute it and/or modify it
101a30de1fSmrg# under the terms of the GNU General Public License as published by
111a30de1fSmrg# the Free Software Foundation; either version 2 of the License, or
121a30de1fSmrg# (at your option) any later version.
131a30de1fSmrg#
141a30de1fSmrg# This program is distributed in the hope that it will be useful, but
151a30de1fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
161a30de1fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
171a30de1fSmrg# General Public License for more details.
181a30de1fSmrg#
191a30de1fSmrg# You should have received a copy of the GNU General Public License
201a30de1fSmrg# along with this program; if not, write to the Free Software
211a30de1fSmrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
221a30de1fSmrg# 02110-1301, USA.
231a30de1fSmrg#
241a30de1fSmrg# As a special exception to the GNU General Public License, if you
251a30de1fSmrg# distribute this file as part of a program that contains a
261a30de1fSmrg# configuration script generated by Autoconf, you may include it under
271a30de1fSmrg# the same distribution terms that you use for the rest of that program.
281a30de1fSmrg
291a30de1fSmrg
301a30de1fSmrg# Originally written by Per Bothner <per@bothner.com>.
311a30de1fSmrg# Please send patches to <config-patches@gnu.org>.  Submit a context
321a30de1fSmrg# diff and a properly formatted ChangeLog entry.
331a30de1fSmrg#
341a30de1fSmrg# This script attempts to guess a canonical system name similar to
351a30de1fSmrg# config.sub.  If it succeeds, it prints the system name on stdout, and
361a30de1fSmrg# exits with 0.  Otherwise, it exits with 1.
371a30de1fSmrg#
381a30de1fSmrg# The plan is that this can be called by configure scripts if you
391a30de1fSmrg# don't specify an explicit build system type.
401a30de1fSmrg
411a30de1fSmrgme=`echo "$0" | sed -e 's,.*/,,'`
421a30de1fSmrg
431a30de1fSmrgusage="\
441a30de1fSmrgUsage: $0 [OPTION]
451a30de1fSmrg
461a30de1fSmrgOutput the configuration name of the system \`$me' is run on.
471a30de1fSmrg
481a30de1fSmrgOperation modes:
491a30de1fSmrg  -h, --help         print this help, then exit
501a30de1fSmrg  -t, --time-stamp   print date of last modification, then exit
511a30de1fSmrg  -v, --version      print version number, then exit
521a30de1fSmrg
531a30de1fSmrgReport bugs and patches to <config-patches@gnu.org>."
541a30de1fSmrg
551a30de1fSmrgversion="\
561a30de1fSmrgGNU config.guess ($timestamp)
571a30de1fSmrg
581a30de1fSmrgOriginally written by Per Bothner.
59b7fb5eacSmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
60b7fb5eacSmrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
611a30de1fSmrg
621a30de1fSmrgThis is free software; see the source for copying conditions.  There is NO
631a30de1fSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
641a30de1fSmrg
651a30de1fSmrghelp="
661a30de1fSmrgTry \`$me --help' for more information."
671a30de1fSmrg
681a30de1fSmrg# Parse command line
691a30de1fSmrgwhile test $# -gt 0 ; do
701a30de1fSmrg  case $1 in
711a30de1fSmrg    --time-stamp | --time* | -t )
721a30de1fSmrg       echo "$timestamp" ; exit ;;
731a30de1fSmrg    --version | -v )
741a30de1fSmrg       echo "$version" ; exit ;;
751a30de1fSmrg    --help | --h* | -h )
761a30de1fSmrg       echo "$usage"; exit ;;
771a30de1fSmrg    -- )     # Stop option processing
781a30de1fSmrg       shift; break ;;
791a30de1fSmrg    - )	# Use stdin as input.
801a30de1fSmrg       break ;;
811a30de1fSmrg    -* )
821a30de1fSmrg       echo "$me: invalid option $1$help" >&2
831a30de1fSmrg       exit 1 ;;
841a30de1fSmrg    * )
851a30de1fSmrg       break ;;
861a30de1fSmrg  esac
871a30de1fSmrgdone
881a30de1fSmrg
891a30de1fSmrgif test $# != 0; then
901a30de1fSmrg  echo "$me: too many arguments$help" >&2
911a30de1fSmrg  exit 1
921a30de1fSmrgfi
931a30de1fSmrg
941a30de1fSmrgtrap 'exit 1' 1 2 15
951a30de1fSmrg
961a30de1fSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
971a30de1fSmrg# compiler to aid in system detection is discouraged as it requires
981a30de1fSmrg# temporary files to be created and, as you can see below, it is a
991a30de1fSmrg# headache to deal with in a portable fashion.
1001a30de1fSmrg
1011a30de1fSmrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
1021a30de1fSmrg# use `HOST_CC' if defined, but it is deprecated.
1031a30de1fSmrg
1041a30de1fSmrg# Portable tmp directory creation inspired by the Autoconf team.
1051a30de1fSmrg
1061a30de1fSmrgset_cc_for_build='
1071a30de1fSmrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1081a30de1fSmrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1091a30de1fSmrg: ${TMPDIR=/tmp} ;
1101a30de1fSmrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1111a30de1fSmrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1121a30de1fSmrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1131a30de1fSmrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1141a30de1fSmrgdummy=$tmp/dummy ;
1151a30de1fSmrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1161a30de1fSmrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1171a30de1fSmrg ,,)    echo "int x;" > $dummy.c ;
1181a30de1fSmrg	for c in cc gcc c89 c99 ; do
1191a30de1fSmrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1201a30de1fSmrg	     CC_FOR_BUILD="$c"; break ;
1211a30de1fSmrg	  fi ;
1221a30de1fSmrg	done ;
1231a30de1fSmrg	if test x"$CC_FOR_BUILD" = x ; then
1241a30de1fSmrg	  CC_FOR_BUILD=no_compiler_found ;
1251a30de1fSmrg	fi
1261a30de1fSmrg	;;
1271a30de1fSmrg ,,*)   CC_FOR_BUILD=$CC ;;
1281a30de1fSmrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1291a30de1fSmrgesac ; set_cc_for_build= ;'
1301a30de1fSmrg
1311a30de1fSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1321a30de1fSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
1331a30de1fSmrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1341a30de1fSmrg	PATH=$PATH:/.attbin ; export PATH
1351a30de1fSmrgfi
1361a30de1fSmrg
1371a30de1fSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1381a30de1fSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1391a30de1fSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1401a30de1fSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1411a30de1fSmrg
1421a30de1fSmrg# Note: order is significant - the case branches are not exclusive.
1431a30de1fSmrg
1441a30de1fSmrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1451a30de1fSmrg    *:NetBSD:*:*)
1461a30de1fSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
1471a30de1fSmrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
1481a30de1fSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1491a30de1fSmrg	# switched to ELF, *-*-netbsd* would select the old
1501a30de1fSmrg	# object file format.  This provides both forward
1511a30de1fSmrg	# compatibility and a consistent mechanism for selecting the
1521a30de1fSmrg	# object file format.
1531a30de1fSmrg	#
1541a30de1fSmrg	# Note: NetBSD doesn't particularly care about the vendor
1551a30de1fSmrg	# portion of the name.  We always set it to "unknown".
1561a30de1fSmrg	sysctl="sysctl -n hw.machine_arch"
1571a30de1fSmrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1581a30de1fSmrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1591a30de1fSmrg	case "${UNAME_MACHINE_ARCH}" in
1601a30de1fSmrg	    armeb) machine=armeb-unknown ;;
1611a30de1fSmrg	    arm*) machine=arm-unknown ;;
1621a30de1fSmrg	    sh3el) machine=shl-unknown ;;
1631a30de1fSmrg	    sh3eb) machine=sh-unknown ;;
164b7fb5eacSmrg	    sh5el) machine=sh5le-unknown ;;
1651a30de1fSmrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1661a30de1fSmrg	esac
1671a30de1fSmrg	# The Operating System including object format, if it has switched
1681a30de1fSmrg	# to ELF recently, or will in the future.
1691a30de1fSmrg	case "${UNAME_MACHINE_ARCH}" in
1701a30de1fSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1711a30de1fSmrg		eval $set_cc_for_build
1721a30de1fSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1731a30de1fSmrg			| grep __ELF__ >/dev/null
1741a30de1fSmrg		then
1751a30de1fSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1761a30de1fSmrg		    # Return netbsd for either.  FIX?
1771a30de1fSmrg		    os=netbsd
1781a30de1fSmrg		else
1791a30de1fSmrg		    os=netbsdelf
1801a30de1fSmrg		fi
1811a30de1fSmrg		;;
1821a30de1fSmrg	    *)
1831a30de1fSmrg	        os=netbsd
1841a30de1fSmrg		;;
1851a30de1fSmrg	esac
1861a30de1fSmrg	# The OS release
1871a30de1fSmrg	# Debian GNU/NetBSD machines have a different userland, and
1881a30de1fSmrg	# thus, need a distinct triplet. However, they do not need
1891a30de1fSmrg	# kernel version information, so it can be replaced with a
1901a30de1fSmrg	# suitable tag, in the style of linux-gnu.
1911a30de1fSmrg	case "${UNAME_VERSION}" in
1921a30de1fSmrg	    Debian*)
1931a30de1fSmrg		release='-gnu'
1941a30de1fSmrg		;;
1951a30de1fSmrg	    *)
1961a30de1fSmrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
1971a30de1fSmrg		;;
1981a30de1fSmrg	esac
1991a30de1fSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2001a30de1fSmrg	# contains redundant information, the shorter form:
2011a30de1fSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2021a30de1fSmrg	echo "${machine}-${os}${release}"
2031a30de1fSmrg	exit ;;
2041a30de1fSmrg    *:OpenBSD:*:*)
2051a30de1fSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2061a30de1fSmrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2071a30de1fSmrg	exit ;;
2081a30de1fSmrg    *:ekkoBSD:*:*)
2091a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2101a30de1fSmrg	exit ;;
2111a30de1fSmrg    *:SolidBSD:*:*)
2121a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2131a30de1fSmrg	exit ;;
2141a30de1fSmrg    macppc:MirBSD:*:*)
2151a30de1fSmrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2161a30de1fSmrg	exit ;;
2171a30de1fSmrg    *:MirBSD:*:*)
2181a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2191a30de1fSmrg	exit ;;
2201a30de1fSmrg    alpha:OSF1:*:*)
2211a30de1fSmrg	case $UNAME_RELEASE in
2221a30de1fSmrg	*4.0)
2231a30de1fSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2241a30de1fSmrg		;;
2251a30de1fSmrg	*5.*)
2261a30de1fSmrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2271a30de1fSmrg		;;
2281a30de1fSmrg	esac
2291a30de1fSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2301a30de1fSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2311a30de1fSmrg	# covers most systems running today.  This code pipes the CPU
2321a30de1fSmrg	# types through head -n 1, so we only detect the type of CPU 0.
2331a30de1fSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2341a30de1fSmrg	case "$ALPHA_CPU_TYPE" in
2351a30de1fSmrg	    "EV4 (21064)")
2361a30de1fSmrg		UNAME_MACHINE="alpha" ;;
2371a30de1fSmrg	    "EV4.5 (21064)")
2381a30de1fSmrg		UNAME_MACHINE="alpha" ;;
2391a30de1fSmrg	    "LCA4 (21066/21068)")
2401a30de1fSmrg		UNAME_MACHINE="alpha" ;;
2411a30de1fSmrg	    "EV5 (21164)")
2421a30de1fSmrg		UNAME_MACHINE="alphaev5" ;;
2431a30de1fSmrg	    "EV5.6 (21164A)")
2441a30de1fSmrg		UNAME_MACHINE="alphaev56" ;;
2451a30de1fSmrg	    "EV5.6 (21164PC)")
2461a30de1fSmrg		UNAME_MACHINE="alphapca56" ;;
2471a30de1fSmrg	    "EV5.7 (21164PC)")
2481a30de1fSmrg		UNAME_MACHINE="alphapca57" ;;
2491a30de1fSmrg	    "EV6 (21264)")
2501a30de1fSmrg		UNAME_MACHINE="alphaev6" ;;
2511a30de1fSmrg	    "EV6.7 (21264A)")
2521a30de1fSmrg		UNAME_MACHINE="alphaev67" ;;
2531a30de1fSmrg	    "EV6.8CB (21264C)")
2541a30de1fSmrg		UNAME_MACHINE="alphaev68" ;;
2551a30de1fSmrg	    "EV6.8AL (21264B)")
2561a30de1fSmrg		UNAME_MACHINE="alphaev68" ;;
2571a30de1fSmrg	    "EV6.8CX (21264D)")
2581a30de1fSmrg		UNAME_MACHINE="alphaev68" ;;
2591a30de1fSmrg	    "EV6.9A (21264/EV69A)")
2601a30de1fSmrg		UNAME_MACHINE="alphaev69" ;;
2611a30de1fSmrg	    "EV7 (21364)")
2621a30de1fSmrg		UNAME_MACHINE="alphaev7" ;;
2631a30de1fSmrg	    "EV7.9 (21364A)")
2641a30de1fSmrg		UNAME_MACHINE="alphaev79" ;;
2651a30de1fSmrg	esac
2661a30de1fSmrg	# A Pn.n version is a patched version.
2671a30de1fSmrg	# A Vn.n version is a released version.
2681a30de1fSmrg	# A Tn.n version is a released field test version.
2691a30de1fSmrg	# A Xn.n version is an unreleased experimental baselevel.
2701a30de1fSmrg	# 1.2 uses "1.2" for uname -r.
2711a30de1fSmrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2721a30de1fSmrg	exit ;;
2731a30de1fSmrg    Alpha\ *:Windows_NT*:*)
2741a30de1fSmrg	# How do we know it's Interix rather than the generic POSIX subsystem?
2751a30de1fSmrg	# Should we change UNAME_MACHINE based on the output of uname instead
2761a30de1fSmrg	# of the specific Alpha model?
2771a30de1fSmrg	echo alpha-pc-interix
2781a30de1fSmrg	exit ;;
2791a30de1fSmrg    21064:Windows_NT:50:3)
2801a30de1fSmrg	echo alpha-dec-winnt3.5
2811a30de1fSmrg	exit ;;
2821a30de1fSmrg    Amiga*:UNIX_System_V:4.0:*)
2831a30de1fSmrg	echo m68k-unknown-sysv4
2841a30de1fSmrg	exit ;;
2851a30de1fSmrg    *:[Aa]miga[Oo][Ss]:*:*)
2861a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-amigaos
2871a30de1fSmrg	exit ;;
2881a30de1fSmrg    *:[Mm]orph[Oo][Ss]:*:*)
2891a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-morphos
2901a30de1fSmrg	exit ;;
2911a30de1fSmrg    *:OS/390:*:*)
2921a30de1fSmrg	echo i370-ibm-openedition
2931a30de1fSmrg	exit ;;
2941a30de1fSmrg    *:z/VM:*:*)
2951a30de1fSmrg	echo s390-ibm-zvmoe
2961a30de1fSmrg	exit ;;
2971a30de1fSmrg    *:OS400:*:*)
2981a30de1fSmrg        echo powerpc-ibm-os400
2991a30de1fSmrg	exit ;;
3001a30de1fSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3011a30de1fSmrg	echo arm-acorn-riscix${UNAME_RELEASE}
3021a30de1fSmrg	exit ;;
3031a30de1fSmrg    arm:riscos:*:*|arm:RISCOS:*:*)
3041a30de1fSmrg	echo arm-unknown-riscos
3051a30de1fSmrg	exit ;;
3061a30de1fSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3071a30de1fSmrg	echo hppa1.1-hitachi-hiuxmpp
3081a30de1fSmrg	exit ;;
3091a30de1fSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3101a30de1fSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3111a30de1fSmrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3121a30de1fSmrg		echo pyramid-pyramid-sysv3
3131a30de1fSmrg	else
3141a30de1fSmrg		echo pyramid-pyramid-bsd
3151a30de1fSmrg	fi
3161a30de1fSmrg	exit ;;
3171a30de1fSmrg    NILE*:*:*:dcosx)
3181a30de1fSmrg	echo pyramid-pyramid-svr4
3191a30de1fSmrg	exit ;;
3201a30de1fSmrg    DRS?6000:unix:4.0:6*)
3211a30de1fSmrg	echo sparc-icl-nx6
3221a30de1fSmrg	exit ;;
3231a30de1fSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3241a30de1fSmrg	case `/usr/bin/uname -p` in
3251a30de1fSmrg	    sparc) echo sparc-icl-nx7; exit ;;
3261a30de1fSmrg	esac ;;
327b7fb5eacSmrg    s390x:SunOS:*:*)
328b7fb5eacSmrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329b7fb5eacSmrg	exit ;;
3301a30de1fSmrg    sun4H:SunOS:5.*:*)
3311a30de1fSmrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3321a30de1fSmrg	exit ;;
3331a30de1fSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3341a30de1fSmrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3351a30de1fSmrg	exit ;;
336b7fb5eacSmrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
337b7fb5eacSmrg	eval $set_cc_for_build
338b7fb5eacSmrg	SUN_ARCH="i386"
339b7fb5eacSmrg	# If there is a compiler, see if it is configured for 64-bit objects.
340b7fb5eacSmrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
341b7fb5eacSmrg	# This test works for both compilers.
342b7fb5eacSmrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
343b7fb5eacSmrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
344b7fb5eacSmrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
345b7fb5eacSmrg		grep IS_64BIT_ARCH >/dev/null
346b7fb5eacSmrg	    then
347b7fb5eacSmrg		SUN_ARCH="x86_64"
348b7fb5eacSmrg	    fi
349b7fb5eacSmrg	fi
350b7fb5eacSmrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3511a30de1fSmrg	exit ;;
3521a30de1fSmrg    sun4*:SunOS:6*:*)
3531a30de1fSmrg	# According to config.sub, this is the proper way to canonicalize
3541a30de1fSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3551a30de1fSmrg	# it's likely to be more like Solaris than SunOS4.
3561a30de1fSmrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3571a30de1fSmrg	exit ;;
3581a30de1fSmrg    sun4*:SunOS:*:*)
3591a30de1fSmrg	case "`/usr/bin/arch -k`" in
3601a30de1fSmrg	    Series*|S4*)
3611a30de1fSmrg		UNAME_RELEASE=`uname -v`
3621a30de1fSmrg		;;
3631a30de1fSmrg	esac
3641a30de1fSmrg	# Japanese Language versions have a version number like `4.1.3-JL'.
3651a30de1fSmrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3661a30de1fSmrg	exit ;;
3671a30de1fSmrg    sun3*:SunOS:*:*)
3681a30de1fSmrg	echo m68k-sun-sunos${UNAME_RELEASE}
3691a30de1fSmrg	exit ;;
3701a30de1fSmrg    sun*:*:4.2BSD:*)
3711a30de1fSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3721a30de1fSmrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
3731a30de1fSmrg	case "`/bin/arch`" in
3741a30de1fSmrg	    sun3)
3751a30de1fSmrg		echo m68k-sun-sunos${UNAME_RELEASE}
3761a30de1fSmrg		;;
3771a30de1fSmrg	    sun4)
3781a30de1fSmrg		echo sparc-sun-sunos${UNAME_RELEASE}
3791a30de1fSmrg		;;
3801a30de1fSmrg	esac
3811a30de1fSmrg	exit ;;
3821a30de1fSmrg    aushp:SunOS:*:*)
3831a30de1fSmrg	echo sparc-auspex-sunos${UNAME_RELEASE}
3841a30de1fSmrg	exit ;;
3851a30de1fSmrg    # The situation for MiNT is a little confusing.  The machine name
3861a30de1fSmrg    # can be virtually everything (everything which is not
3871a30de1fSmrg    # "atarist" or "atariste" at least should have a processor
3881a30de1fSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
3891a30de1fSmrg    # to the lowercase version "mint" (or "freemint").  Finally
3901a30de1fSmrg    # the system name "TOS" denotes a system which is actually not
3911a30de1fSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
3921a30de1fSmrg    # be no problem.
3931a30de1fSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
3941a30de1fSmrg        echo m68k-atari-mint${UNAME_RELEASE}
3951a30de1fSmrg	exit ;;
3961a30de1fSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
3971a30de1fSmrg	echo m68k-atari-mint${UNAME_RELEASE}
3981a30de1fSmrg        exit ;;
3991a30de1fSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4001a30de1fSmrg        echo m68k-atari-mint${UNAME_RELEASE}
4011a30de1fSmrg	exit ;;
4021a30de1fSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4031a30de1fSmrg        echo m68k-milan-mint${UNAME_RELEASE}
4041a30de1fSmrg        exit ;;
4051a30de1fSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4061a30de1fSmrg        echo m68k-hades-mint${UNAME_RELEASE}
4071a30de1fSmrg        exit ;;
4081a30de1fSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4091a30de1fSmrg        echo m68k-unknown-mint${UNAME_RELEASE}
4101a30de1fSmrg        exit ;;
4111a30de1fSmrg    m68k:machten:*:*)
4121a30de1fSmrg	echo m68k-apple-machten${UNAME_RELEASE}
4131a30de1fSmrg	exit ;;
4141a30de1fSmrg    powerpc:machten:*:*)
4151a30de1fSmrg	echo powerpc-apple-machten${UNAME_RELEASE}
4161a30de1fSmrg	exit ;;
4171a30de1fSmrg    RISC*:Mach:*:*)
4181a30de1fSmrg	echo mips-dec-mach_bsd4.3
4191a30de1fSmrg	exit ;;
4201a30de1fSmrg    RISC*:ULTRIX:*:*)
4211a30de1fSmrg	echo mips-dec-ultrix${UNAME_RELEASE}
4221a30de1fSmrg	exit ;;
4231a30de1fSmrg    VAX*:ULTRIX*:*:*)
4241a30de1fSmrg	echo vax-dec-ultrix${UNAME_RELEASE}
4251a30de1fSmrg	exit ;;
4261a30de1fSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4271a30de1fSmrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4281a30de1fSmrg	exit ;;
4291a30de1fSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4301a30de1fSmrg	eval $set_cc_for_build
4311a30de1fSmrg	sed 's/^	//' << EOF >$dummy.c
4321a30de1fSmrg#ifdef __cplusplus
4331a30de1fSmrg#include <stdio.h>  /* for printf() prototype */
4341a30de1fSmrg	int main (int argc, char *argv[]) {
4351a30de1fSmrg#else
4361a30de1fSmrg	int main (argc, argv) int argc; char *argv[]; {
4371a30de1fSmrg#endif
4381a30de1fSmrg	#if defined (host_mips) && defined (MIPSEB)
4391a30de1fSmrg	#if defined (SYSTYPE_SYSV)
4401a30de1fSmrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4411a30de1fSmrg	#endif
4421a30de1fSmrg	#if defined (SYSTYPE_SVR4)
4431a30de1fSmrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4441a30de1fSmrg	#endif
4451a30de1fSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4461a30de1fSmrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4471a30de1fSmrg	#endif
4481a30de1fSmrg	#endif
4491a30de1fSmrg	  exit (-1);
4501a30de1fSmrg	}
4511a30de1fSmrgEOF
4521a30de1fSmrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4531a30de1fSmrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4541a30de1fSmrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4551a30de1fSmrg	    { echo "$SYSTEM_NAME"; exit; }
4561a30de1fSmrg	echo mips-mips-riscos${UNAME_RELEASE}
4571a30de1fSmrg	exit ;;
4581a30de1fSmrg    Motorola:PowerMAX_OS:*:*)
4591a30de1fSmrg	echo powerpc-motorola-powermax
4601a30de1fSmrg	exit ;;
4611a30de1fSmrg    Motorola:*:4.3:PL8-*)
4621a30de1fSmrg	echo powerpc-harris-powermax
4631a30de1fSmrg	exit ;;
4641a30de1fSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4651a30de1fSmrg	echo powerpc-harris-powermax
4661a30de1fSmrg	exit ;;
4671a30de1fSmrg    Night_Hawk:Power_UNIX:*:*)
4681a30de1fSmrg	echo powerpc-harris-powerunix
4691a30de1fSmrg	exit ;;
4701a30de1fSmrg    m88k:CX/UX:7*:*)
4711a30de1fSmrg	echo m88k-harris-cxux7
4721a30de1fSmrg	exit ;;
4731a30de1fSmrg    m88k:*:4*:R4*)
4741a30de1fSmrg	echo m88k-motorola-sysv4
4751a30de1fSmrg	exit ;;
4761a30de1fSmrg    m88k:*:3*:R3*)
4771a30de1fSmrg	echo m88k-motorola-sysv3
4781a30de1fSmrg	exit ;;
4791a30de1fSmrg    AViiON:dgux:*:*)
4801a30de1fSmrg        # DG/UX returns AViiON for all architectures
4811a30de1fSmrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
4821a30de1fSmrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
4831a30de1fSmrg	then
4841a30de1fSmrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
4851a30de1fSmrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
4861a30de1fSmrg	    then
4871a30de1fSmrg		echo m88k-dg-dgux${UNAME_RELEASE}
4881a30de1fSmrg	    else
4891a30de1fSmrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
4901a30de1fSmrg	    fi
4911a30de1fSmrg	else
4921a30de1fSmrg	    echo i586-dg-dgux${UNAME_RELEASE}
4931a30de1fSmrg	fi
4941a30de1fSmrg 	exit ;;
4951a30de1fSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
4961a30de1fSmrg	echo m88k-dolphin-sysv3
4971a30de1fSmrg	exit ;;
4981a30de1fSmrg    M88*:*:R3*:*)
4991a30de1fSmrg	# Delta 88k system running SVR3
5001a30de1fSmrg	echo m88k-motorola-sysv3
5011a30de1fSmrg	exit ;;
5021a30de1fSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5031a30de1fSmrg	echo m88k-tektronix-sysv3
5041a30de1fSmrg	exit ;;
5051a30de1fSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5061a30de1fSmrg	echo m68k-tektronix-bsd
5071a30de1fSmrg	exit ;;
5081a30de1fSmrg    *:IRIX*:*:*)
5091a30de1fSmrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5101a30de1fSmrg	exit ;;
5111a30de1fSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5121a30de1fSmrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5131a30de1fSmrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5141a30de1fSmrg    i*86:AIX:*:*)
5151a30de1fSmrg	echo i386-ibm-aix
5161a30de1fSmrg	exit ;;
5171a30de1fSmrg    ia64:AIX:*:*)
5181a30de1fSmrg	if [ -x /usr/bin/oslevel ] ; then
5191a30de1fSmrg		IBM_REV=`/usr/bin/oslevel`
5201a30de1fSmrg	else
5211a30de1fSmrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5221a30de1fSmrg	fi
5231a30de1fSmrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5241a30de1fSmrg	exit ;;
5251a30de1fSmrg    *:AIX:2:3)
5261a30de1fSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5271a30de1fSmrg		eval $set_cc_for_build
5281a30de1fSmrg		sed 's/^		//' << EOF >$dummy.c
5291a30de1fSmrg		#include <sys/systemcfg.h>
5301a30de1fSmrg
5311a30de1fSmrg		main()
5321a30de1fSmrg			{
5331a30de1fSmrg			if (!__power_pc())
5341a30de1fSmrg				exit(1);
5351a30de1fSmrg			puts("powerpc-ibm-aix3.2.5");
5361a30de1fSmrg			exit(0);
5371a30de1fSmrg			}
5381a30de1fSmrgEOF
5391a30de1fSmrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5401a30de1fSmrg		then
5411a30de1fSmrg			echo "$SYSTEM_NAME"
5421a30de1fSmrg		else
5431a30de1fSmrg			echo rs6000-ibm-aix3.2.5
5441a30de1fSmrg		fi
5451a30de1fSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5461a30de1fSmrg		echo rs6000-ibm-aix3.2.4
5471a30de1fSmrg	else
5481a30de1fSmrg		echo rs6000-ibm-aix3.2
5491a30de1fSmrg	fi
5501a30de1fSmrg	exit ;;
551b7fb5eacSmrg    *:AIX:*:[456])
5521a30de1fSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5531a30de1fSmrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5541a30de1fSmrg		IBM_ARCH=rs6000
5551a30de1fSmrg	else
5561a30de1fSmrg		IBM_ARCH=powerpc
5571a30de1fSmrg	fi
5581a30de1fSmrg	if [ -x /usr/bin/oslevel ] ; then
5591a30de1fSmrg		IBM_REV=`/usr/bin/oslevel`
5601a30de1fSmrg	else
5611a30de1fSmrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5621a30de1fSmrg	fi
5631a30de1fSmrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5641a30de1fSmrg	exit ;;
5651a30de1fSmrg    *:AIX:*:*)
5661a30de1fSmrg	echo rs6000-ibm-aix
5671a30de1fSmrg	exit ;;
5681a30de1fSmrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5691a30de1fSmrg	echo romp-ibm-bsd4.4
5701a30de1fSmrg	exit ;;
5711a30de1fSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5721a30de1fSmrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5731a30de1fSmrg	exit ;;                             # report: romp-ibm BSD 4.3
5741a30de1fSmrg    *:BOSX:*:*)
5751a30de1fSmrg	echo rs6000-bull-bosx
5761a30de1fSmrg	exit ;;
5771a30de1fSmrg    DPX/2?00:B.O.S.:*:*)
5781a30de1fSmrg	echo m68k-bull-sysv3
5791a30de1fSmrg	exit ;;
5801a30de1fSmrg    9000/[34]??:4.3bsd:1.*:*)
5811a30de1fSmrg	echo m68k-hp-bsd
5821a30de1fSmrg	exit ;;
5831a30de1fSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
5841a30de1fSmrg	echo m68k-hp-bsd4.4
5851a30de1fSmrg	exit ;;
5861a30de1fSmrg    9000/[34678]??:HP-UX:*:*)
5871a30de1fSmrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
5881a30de1fSmrg	case "${UNAME_MACHINE}" in
5891a30de1fSmrg	    9000/31? )            HP_ARCH=m68000 ;;
5901a30de1fSmrg	    9000/[34]?? )         HP_ARCH=m68k ;;
5911a30de1fSmrg	    9000/[678][0-9][0-9])
5921a30de1fSmrg		if [ -x /usr/bin/getconf ]; then
5931a30de1fSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
5941a30de1fSmrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
5951a30de1fSmrg                    case "${sc_cpu_version}" in
5961a30de1fSmrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
5971a30de1fSmrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
5981a30de1fSmrg                      532)                      # CPU_PA_RISC2_0
5991a30de1fSmrg                        case "${sc_kernel_bits}" in
6001a30de1fSmrg                          32) HP_ARCH="hppa2.0n" ;;
6011a30de1fSmrg                          64) HP_ARCH="hppa2.0w" ;;
6021a30de1fSmrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
6031a30de1fSmrg                        esac ;;
6041a30de1fSmrg                    esac
6051a30de1fSmrg		fi
6061a30de1fSmrg		if [ "${HP_ARCH}" = "" ]; then
6071a30de1fSmrg		    eval $set_cc_for_build
6081a30de1fSmrg		    sed 's/^              //' << EOF >$dummy.c
6091a30de1fSmrg
6101a30de1fSmrg              #define _HPUX_SOURCE
6111a30de1fSmrg              #include <stdlib.h>
6121a30de1fSmrg              #include <unistd.h>
6131a30de1fSmrg
6141a30de1fSmrg              int main ()
6151a30de1fSmrg              {
6161a30de1fSmrg              #if defined(_SC_KERNEL_BITS)
6171a30de1fSmrg                  long bits = sysconf(_SC_KERNEL_BITS);
6181a30de1fSmrg              #endif
6191a30de1fSmrg                  long cpu  = sysconf (_SC_CPU_VERSION);
6201a30de1fSmrg
6211a30de1fSmrg                  switch (cpu)
6221a30de1fSmrg              	{
6231a30de1fSmrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6241a30de1fSmrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6251a30de1fSmrg              	case CPU_PA_RISC2_0:
6261a30de1fSmrg              #if defined(_SC_KERNEL_BITS)
6271a30de1fSmrg              	    switch (bits)
6281a30de1fSmrg              		{
6291a30de1fSmrg              		case 64: puts ("hppa2.0w"); break;
6301a30de1fSmrg              		case 32: puts ("hppa2.0n"); break;
6311a30de1fSmrg              		default: puts ("hppa2.0"); break;
6321a30de1fSmrg              		} break;
6331a30de1fSmrg              #else  /* !defined(_SC_KERNEL_BITS) */
6341a30de1fSmrg              	    puts ("hppa2.0"); break;
6351a30de1fSmrg              #endif
6361a30de1fSmrg              	default: puts ("hppa1.0"); break;
6371a30de1fSmrg              	}
6381a30de1fSmrg                  exit (0);
6391a30de1fSmrg              }
6401a30de1fSmrgEOF
6411a30de1fSmrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6421a30de1fSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6431a30de1fSmrg		fi ;;
6441a30de1fSmrg	esac
6451a30de1fSmrg	if [ ${HP_ARCH} = "hppa2.0w" ]
6461a30de1fSmrg	then
6471a30de1fSmrg	    eval $set_cc_for_build
6481a30de1fSmrg
6491a30de1fSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6501a30de1fSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6511a30de1fSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6521a30de1fSmrg	    #
6531a30de1fSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
6541a30de1fSmrg	    # => hppa2.0w-hp-hpux11.23
6551a30de1fSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6561a30de1fSmrg	    # => hppa64-hp-hpux11.23
6571a30de1fSmrg
6581a30de1fSmrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
6591a30de1fSmrg		grep __LP64__ >/dev/null
6601a30de1fSmrg	    then
6611a30de1fSmrg		HP_ARCH="hppa2.0w"
6621a30de1fSmrg	    else
6631a30de1fSmrg		HP_ARCH="hppa64"
6641a30de1fSmrg	    fi
6651a30de1fSmrg	fi
6661a30de1fSmrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6671a30de1fSmrg	exit ;;
6681a30de1fSmrg    ia64:HP-UX:*:*)
6691a30de1fSmrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6701a30de1fSmrg	echo ia64-hp-hpux${HPUX_REV}
6711a30de1fSmrg	exit ;;
6721a30de1fSmrg    3050*:HI-UX:*:*)
6731a30de1fSmrg	eval $set_cc_for_build
6741a30de1fSmrg	sed 's/^	//' << EOF >$dummy.c
6751a30de1fSmrg	#include <unistd.h>
6761a30de1fSmrg	int
6771a30de1fSmrg	main ()
6781a30de1fSmrg	{
6791a30de1fSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
6801a30de1fSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
6811a30de1fSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
6821a30de1fSmrg	     results, however.  */
6831a30de1fSmrg	  if (CPU_IS_PA_RISC (cpu))
6841a30de1fSmrg	    {
6851a30de1fSmrg	      switch (cpu)
6861a30de1fSmrg		{
6871a30de1fSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
6881a30de1fSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
6891a30de1fSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
6901a30de1fSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
6911a30de1fSmrg		}
6921a30de1fSmrg	    }
6931a30de1fSmrg	  else if (CPU_IS_HP_MC68K (cpu))
6941a30de1fSmrg	    puts ("m68k-hitachi-hiuxwe2");
6951a30de1fSmrg	  else puts ("unknown-hitachi-hiuxwe2");
6961a30de1fSmrg	  exit (0);
6971a30de1fSmrg	}
6981a30de1fSmrgEOF
6991a30de1fSmrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7001a30de1fSmrg		{ echo "$SYSTEM_NAME"; exit; }
7011a30de1fSmrg	echo unknown-hitachi-hiuxwe2
7021a30de1fSmrg	exit ;;
7031a30de1fSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
7041a30de1fSmrg	echo hppa1.1-hp-bsd
7051a30de1fSmrg	exit ;;
7061a30de1fSmrg    9000/8??:4.3bsd:*:*)
7071a30de1fSmrg	echo hppa1.0-hp-bsd
7081a30de1fSmrg	exit ;;
7091a30de1fSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7101a30de1fSmrg	echo hppa1.0-hp-mpeix
7111a30de1fSmrg	exit ;;
7121a30de1fSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7131a30de1fSmrg	echo hppa1.1-hp-osf
7141a30de1fSmrg	exit ;;
7151a30de1fSmrg    hp8??:OSF1:*:*)
7161a30de1fSmrg	echo hppa1.0-hp-osf
7171a30de1fSmrg	exit ;;
7181a30de1fSmrg    i*86:OSF1:*:*)
7191a30de1fSmrg	if [ -x /usr/sbin/sysversion ] ; then
7201a30de1fSmrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
7211a30de1fSmrg	else
7221a30de1fSmrg	    echo ${UNAME_MACHINE}-unknown-osf1
7231a30de1fSmrg	fi
7241a30de1fSmrg	exit ;;
7251a30de1fSmrg    parisc*:Lites*:*:*)
7261a30de1fSmrg	echo hppa1.1-hp-lites
7271a30de1fSmrg	exit ;;
7281a30de1fSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7291a30de1fSmrg	echo c1-convex-bsd
7301a30de1fSmrg        exit ;;
7311a30de1fSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7321a30de1fSmrg	if getsysinfo -f scalar_acc
7331a30de1fSmrg	then echo c32-convex-bsd
7341a30de1fSmrg	else echo c2-convex-bsd
7351a30de1fSmrg	fi
7361a30de1fSmrg        exit ;;
7371a30de1fSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7381a30de1fSmrg	echo c34-convex-bsd
7391a30de1fSmrg        exit ;;
7401a30de1fSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7411a30de1fSmrg	echo c38-convex-bsd
7421a30de1fSmrg        exit ;;
7431a30de1fSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7441a30de1fSmrg	echo c4-convex-bsd
7451a30de1fSmrg        exit ;;
7461a30de1fSmrg    CRAY*Y-MP:*:*:*)
7471a30de1fSmrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7481a30de1fSmrg	exit ;;
7491a30de1fSmrg    CRAY*[A-Z]90:*:*:*)
7501a30de1fSmrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7511a30de1fSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7521a30de1fSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7531a30de1fSmrg	      -e 's/\.[^.]*$/.X/'
7541a30de1fSmrg	exit ;;
7551a30de1fSmrg    CRAY*TS:*:*:*)
7561a30de1fSmrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7571a30de1fSmrg	exit ;;
7581a30de1fSmrg    CRAY*T3E:*:*:*)
7591a30de1fSmrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7601a30de1fSmrg	exit ;;
7611a30de1fSmrg    CRAY*SV1:*:*:*)
7621a30de1fSmrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7631a30de1fSmrg	exit ;;
7641a30de1fSmrg    *:UNICOS/mp:*:*)
7651a30de1fSmrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7661a30de1fSmrg	exit ;;
7671a30de1fSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7681a30de1fSmrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7691a30de1fSmrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7701a30de1fSmrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7711a30de1fSmrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7721a30de1fSmrg        exit ;;
7731a30de1fSmrg    5000:UNIX_System_V:4.*:*)
7741a30de1fSmrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7751a30de1fSmrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
7761a30de1fSmrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7771a30de1fSmrg	exit ;;
7781a30de1fSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
7791a30de1fSmrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
7801a30de1fSmrg	exit ;;
7811a30de1fSmrg    sparc*:BSD/OS:*:*)
7821a30de1fSmrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
7831a30de1fSmrg	exit ;;
7841a30de1fSmrg    *:BSD/OS:*:*)
7851a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
7861a30de1fSmrg	exit ;;
7871a30de1fSmrg    *:FreeBSD:*:*)
7881a30de1fSmrg	case ${UNAME_MACHINE} in
7891a30de1fSmrg	    pc98)
7901a30de1fSmrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7911a30de1fSmrg	    amd64)
7921a30de1fSmrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7931a30de1fSmrg	    *)
7941a30de1fSmrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7951a30de1fSmrg	esac
7961a30de1fSmrg	exit ;;
7971a30de1fSmrg    i*:CYGWIN*:*)
7981a30de1fSmrg	echo ${UNAME_MACHINE}-pc-cygwin
7991a30de1fSmrg	exit ;;
800b7fb5eacSmrg    *:MINGW*:*)
8011a30de1fSmrg	echo ${UNAME_MACHINE}-pc-mingw32
8021a30de1fSmrg	exit ;;
8031a30de1fSmrg    i*:windows32*:*)
8041a30de1fSmrg    	# uname -m includes "-pc" on this system.
8051a30de1fSmrg    	echo ${UNAME_MACHINE}-mingw32
8061a30de1fSmrg	exit ;;
8071a30de1fSmrg    i*:PW*:*)
8081a30de1fSmrg	echo ${UNAME_MACHINE}-pc-pw32
8091a30de1fSmrg	exit ;;
810b7fb5eacSmrg    *:Interix*:[3456]*)
811b7fb5eacSmrg    	case ${UNAME_MACHINE} in
812b7fb5eacSmrg	    x86)
813b7fb5eacSmrg		echo i586-pc-interix${UNAME_RELEASE}
814b7fb5eacSmrg		exit ;;
815b7fb5eacSmrg	    EM64T | authenticamd | genuineintel)
816b7fb5eacSmrg		echo x86_64-unknown-interix${UNAME_RELEASE}
817b7fb5eacSmrg		exit ;;
818b7fb5eacSmrg	    IA64)
819b7fb5eacSmrg		echo ia64-unknown-interix${UNAME_RELEASE}
820b7fb5eacSmrg		exit ;;
821b7fb5eacSmrg	esac ;;
8221a30de1fSmrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
8231a30de1fSmrg	echo i${UNAME_MACHINE}-pc-mks
8241a30de1fSmrg	exit ;;
8251a30de1fSmrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
8261a30de1fSmrg	# How do we know it's Interix rather than the generic POSIX subsystem?
8271a30de1fSmrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8281a30de1fSmrg	# UNAME_MACHINE based on the output of uname instead of i386?
8291a30de1fSmrg	echo i586-pc-interix
8301a30de1fSmrg	exit ;;
8311a30de1fSmrg    i*:UWIN*:*)
8321a30de1fSmrg	echo ${UNAME_MACHINE}-pc-uwin
8331a30de1fSmrg	exit ;;
8341a30de1fSmrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8351a30de1fSmrg	echo x86_64-unknown-cygwin
8361a30de1fSmrg	exit ;;
8371a30de1fSmrg    p*:CYGWIN*:*)
8381a30de1fSmrg	echo powerpcle-unknown-cygwin
8391a30de1fSmrg	exit ;;
8401a30de1fSmrg    prep*:SunOS:5.*:*)
8411a30de1fSmrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8421a30de1fSmrg	exit ;;
8431a30de1fSmrg    *:GNU:*:*)
8441a30de1fSmrg	# the GNU system
8451a30de1fSmrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8461a30de1fSmrg	exit ;;
8471a30de1fSmrg    *:GNU/*:*:*)
8481a30de1fSmrg	# other systems with GNU libc and userland
8491a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
8501a30de1fSmrg	exit ;;
8511a30de1fSmrg    i*86:Minix:*:*)
8521a30de1fSmrg	echo ${UNAME_MACHINE}-pc-minix
8531a30de1fSmrg	exit ;;
8541a30de1fSmrg    arm*:Linux:*:*)
855b7fb5eacSmrg	eval $set_cc_for_build
856b7fb5eacSmrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
857b7fb5eacSmrg	    | grep -q __ARM_EABI__
858b7fb5eacSmrg	then
859b7fb5eacSmrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
860b7fb5eacSmrg	else
861b7fb5eacSmrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
862b7fb5eacSmrg	fi
8631a30de1fSmrg	exit ;;
8641a30de1fSmrg    avr32*:Linux:*:*)
8651a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8661a30de1fSmrg	exit ;;
8671a30de1fSmrg    cris:Linux:*:*)
8681a30de1fSmrg	echo cris-axis-linux-gnu
8691a30de1fSmrg	exit ;;
8701a30de1fSmrg    crisv32:Linux:*:*)
8711a30de1fSmrg	echo crisv32-axis-linux-gnu
8721a30de1fSmrg	exit ;;
8731a30de1fSmrg    frv:Linux:*:*)
8741a30de1fSmrg    	echo frv-unknown-linux-gnu
8751a30de1fSmrg	exit ;;
8761a30de1fSmrg    ia64:Linux:*:*)
8771a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8781a30de1fSmrg	exit ;;
8791a30de1fSmrg    m32r*:Linux:*:*)
8801a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8811a30de1fSmrg	exit ;;
8821a30de1fSmrg    m68*:Linux:*:*)
8831a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8841a30de1fSmrg	exit ;;
8851a30de1fSmrg    mips:Linux:*:*)
8861a30de1fSmrg	eval $set_cc_for_build
8871a30de1fSmrg	sed 's/^	//' << EOF >$dummy.c
8881a30de1fSmrg	#undef CPU
8891a30de1fSmrg	#undef mips
8901a30de1fSmrg	#undef mipsel
8911a30de1fSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
8921a30de1fSmrg	CPU=mipsel
8931a30de1fSmrg	#else
8941a30de1fSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
8951a30de1fSmrg	CPU=mips
8961a30de1fSmrg	#else
8971a30de1fSmrg	CPU=
8981a30de1fSmrg	#endif
8991a30de1fSmrg	#endif
9001a30de1fSmrgEOF
9011a30de1fSmrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
9021a30de1fSmrg	    /^CPU/{
9031a30de1fSmrg		s: ::g
9041a30de1fSmrg		p
9051a30de1fSmrg	    }'`"
9061a30de1fSmrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
9071a30de1fSmrg	;;
9081a30de1fSmrg    mips64:Linux:*:*)
9091a30de1fSmrg	eval $set_cc_for_build
9101a30de1fSmrg	sed 's/^	//' << EOF >$dummy.c
9111a30de1fSmrg	#undef CPU
9121a30de1fSmrg	#undef mips64
9131a30de1fSmrg	#undef mips64el
9141a30de1fSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
9151a30de1fSmrg	CPU=mips64el
9161a30de1fSmrg	#else
9171a30de1fSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9181a30de1fSmrg	CPU=mips64
9191a30de1fSmrg	#else
9201a30de1fSmrg	CPU=
9211a30de1fSmrg	#endif
9221a30de1fSmrg	#endif
9231a30de1fSmrgEOF
9241a30de1fSmrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
9251a30de1fSmrg	    /^CPU/{
9261a30de1fSmrg		s: ::g
9271a30de1fSmrg		p
9281a30de1fSmrg	    }'`"
9291a30de1fSmrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
9301a30de1fSmrg	;;
9311a30de1fSmrg    or32:Linux:*:*)
9321a30de1fSmrg	echo or32-unknown-linux-gnu
9331a30de1fSmrg	exit ;;
9341a30de1fSmrg    ppc:Linux:*:*)
9351a30de1fSmrg	echo powerpc-unknown-linux-gnu
9361a30de1fSmrg	exit ;;
9371a30de1fSmrg    ppc64:Linux:*:*)
9381a30de1fSmrg	echo powerpc64-unknown-linux-gnu
9391a30de1fSmrg	exit ;;
9401a30de1fSmrg    alpha:Linux:*:*)
9411a30de1fSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
9421a30de1fSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
9431a30de1fSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
9441a30de1fSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
9451a30de1fSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
9461a30de1fSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
9471a30de1fSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
9481a30de1fSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
9491a30de1fSmrg        esac
9501a30de1fSmrg	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
9511a30de1fSmrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
9521a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
9531a30de1fSmrg	exit ;;
954b7fb5eacSmrg    padre:Linux:*:*)
955b7fb5eacSmrg	echo sparc-unknown-linux-gnu
956b7fb5eacSmrg	exit ;;
9571a30de1fSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
9581a30de1fSmrg	# Look for CPU level
9591a30de1fSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9601a30de1fSmrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
9611a30de1fSmrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
9621a30de1fSmrg	  *)    echo hppa-unknown-linux-gnu ;;
9631a30de1fSmrg	esac
9641a30de1fSmrg	exit ;;
9651a30de1fSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
9661a30de1fSmrg	echo hppa64-unknown-linux-gnu
9671a30de1fSmrg	exit ;;
9681a30de1fSmrg    s390:Linux:*:* | s390x:Linux:*:*)
9691a30de1fSmrg	echo ${UNAME_MACHINE}-ibm-linux
9701a30de1fSmrg	exit ;;
9711a30de1fSmrg    sh64*:Linux:*:*)
9721a30de1fSmrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
9731a30de1fSmrg	exit ;;
9741a30de1fSmrg    sh*:Linux:*:*)
9751a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9761a30de1fSmrg	exit ;;
9771a30de1fSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
9781a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9791a30de1fSmrg	exit ;;
9801a30de1fSmrg    vax:Linux:*:*)
9811a30de1fSmrg	echo ${UNAME_MACHINE}-dec-linux-gnu
9821a30de1fSmrg	exit ;;
9831a30de1fSmrg    x86_64:Linux:*:*)
9841a30de1fSmrg	echo x86_64-unknown-linux-gnu
9851a30de1fSmrg	exit ;;
986b7fb5eacSmrg    xtensa*:Linux:*:*)
987b7fb5eacSmrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
988b7fb5eacSmrg	exit ;;
9891a30de1fSmrg    i*86:Linux:*:*)
9901a30de1fSmrg	# The BFD linker knows what the default object file format is, so
9911a30de1fSmrg	# first see if it will tell us. cd to the root directory to prevent
9921a30de1fSmrg	# problems with other programs or directories called `ld' in the path.
9931a30de1fSmrg	# Set LC_ALL=C to ensure ld outputs messages in English.
9941a30de1fSmrg	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
9951a30de1fSmrg			 | sed -ne '/supported targets:/!d
9961a30de1fSmrg				    s/[ 	][ 	]*/ /g
9971a30de1fSmrg				    s/.*supported targets: *//
9981a30de1fSmrg				    s/ .*//
9991a30de1fSmrg				    p'`
10001a30de1fSmrg        case "$ld_supported_targets" in
10011a30de1fSmrg	  elf32-i386)
10021a30de1fSmrg		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
10031a30de1fSmrg		;;
10041a30de1fSmrg	  a.out-i386-linux)
10051a30de1fSmrg		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
10061a30de1fSmrg		exit ;;
10071a30de1fSmrg	  "")
10081a30de1fSmrg		# Either a pre-BFD a.out linker (linux-gnuoldld) or
10091a30de1fSmrg		# one that does not give us useful --help.
10101a30de1fSmrg		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
10111a30de1fSmrg		exit ;;
10121a30de1fSmrg	esac
10131a30de1fSmrg	# Determine whether the default compiler is a.out or elf
10141a30de1fSmrg	eval $set_cc_for_build
10151a30de1fSmrg	sed 's/^	//' << EOF >$dummy.c
10161a30de1fSmrg	#include <features.h>
10171a30de1fSmrg	#ifdef __ELF__
10181a30de1fSmrg	# ifdef __GLIBC__
10191a30de1fSmrg	#  if __GLIBC__ >= 2
10201a30de1fSmrg	LIBC=gnu
10211a30de1fSmrg	#  else
10221a30de1fSmrg	LIBC=gnulibc1
10231a30de1fSmrg	#  endif
10241a30de1fSmrg	# else
10251a30de1fSmrg	LIBC=gnulibc1
10261a30de1fSmrg	# endif
10271a30de1fSmrg	#else
10281a30de1fSmrg	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
10291a30de1fSmrg	LIBC=gnu
10301a30de1fSmrg	#else
10311a30de1fSmrg	LIBC=gnuaout
10321a30de1fSmrg	#endif
10331a30de1fSmrg	#endif
10341a30de1fSmrg	#ifdef __dietlibc__
10351a30de1fSmrg	LIBC=dietlibc
10361a30de1fSmrg	#endif
10371a30de1fSmrgEOF
10381a30de1fSmrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
10391a30de1fSmrg	    /^LIBC/{
10401a30de1fSmrg		s: ::g
10411a30de1fSmrg		p
10421a30de1fSmrg	    }'`"
10431a30de1fSmrg	test x"${LIBC}" != x && {
10441a30de1fSmrg		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
10451a30de1fSmrg		exit
10461a30de1fSmrg	}
10471a30de1fSmrg	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
10481a30de1fSmrg	;;
10491a30de1fSmrg    i*86:DYNIX/ptx:4*:*)
10501a30de1fSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10511a30de1fSmrg	# earlier versions are messed up and put the nodename in both
10521a30de1fSmrg	# sysname and nodename.
10531a30de1fSmrg	echo i386-sequent-sysv4
10541a30de1fSmrg	exit ;;
10551a30de1fSmrg    i*86:UNIX_SV:4.2MP:2.*)
10561a30de1fSmrg        # Unixware is an offshoot of SVR4, but it has its own version
10571a30de1fSmrg        # number series starting with 2...
10581a30de1fSmrg        # I am not positive that other SVR4 systems won't match this,
10591a30de1fSmrg	# I just have to hope.  -- rms.
10601a30de1fSmrg        # Use sysv4.2uw... so that sysv4* matches it.
10611a30de1fSmrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10621a30de1fSmrg	exit ;;
10631a30de1fSmrg    i*86:OS/2:*:*)
10641a30de1fSmrg	# If we were able to find `uname', then EMX Unix compatibility
10651a30de1fSmrg	# is probably installed.
10661a30de1fSmrg	echo ${UNAME_MACHINE}-pc-os2-emx
10671a30de1fSmrg	exit ;;
10681a30de1fSmrg    i*86:XTS-300:*:STOP)
10691a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-stop
10701a30de1fSmrg	exit ;;
10711a30de1fSmrg    i*86:atheos:*:*)
10721a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-atheos
10731a30de1fSmrg	exit ;;
10741a30de1fSmrg    i*86:syllable:*:*)
10751a30de1fSmrg	echo ${UNAME_MACHINE}-pc-syllable
10761a30de1fSmrg	exit ;;
10771a30de1fSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
10781a30de1fSmrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10791a30de1fSmrg	exit ;;
10801a30de1fSmrg    i*86:*DOS:*:*)
10811a30de1fSmrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10821a30de1fSmrg	exit ;;
10831a30de1fSmrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10841a30de1fSmrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10851a30de1fSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10861a30de1fSmrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10871a30de1fSmrg	else
10881a30de1fSmrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10891a30de1fSmrg	fi
10901a30de1fSmrg	exit ;;
10911a30de1fSmrg    i*86:*:5:[678]*)
10921a30de1fSmrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10931a30de1fSmrg	case `/bin/uname -X | grep "^Machine"` in
10941a30de1fSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
10951a30de1fSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
10961a30de1fSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10971a30de1fSmrg	esac
10981a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10991a30de1fSmrg	exit ;;
11001a30de1fSmrg    i*86:*:3.2:*)
11011a30de1fSmrg	if test -f /usr/options/cb.name; then
11021a30de1fSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
11031a30de1fSmrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
11041a30de1fSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
11051a30de1fSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
11061a30de1fSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
11071a30de1fSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
11081a30de1fSmrg			&& UNAME_MACHINE=i586
11091a30de1fSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
11101a30de1fSmrg			&& UNAME_MACHINE=i686
11111a30de1fSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
11121a30de1fSmrg			&& UNAME_MACHINE=i686
11131a30de1fSmrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
11141a30de1fSmrg	else
11151a30de1fSmrg		echo ${UNAME_MACHINE}-pc-sysv32
11161a30de1fSmrg	fi
11171a30de1fSmrg	exit ;;
11181a30de1fSmrg    pc:*:*:*)
11191a30de1fSmrg	# Left here for compatibility:
11201a30de1fSmrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1121b7fb5eacSmrg        # the processor, so we play safe by assuming i586.
1122b7fb5eacSmrg	# Note: whatever this is, it MUST be the same as what config.sub
1123b7fb5eacSmrg	# prints for the "djgpp" host, or else GDB configury will decide that
1124b7fb5eacSmrg	# this is a cross-build.
1125b7fb5eacSmrg	echo i586-pc-msdosdjgpp
11261a30de1fSmrg        exit ;;
11271a30de1fSmrg    Intel:Mach:3*:*)
11281a30de1fSmrg	echo i386-pc-mach3
11291a30de1fSmrg	exit ;;
11301a30de1fSmrg    paragon:*:*:*)
11311a30de1fSmrg	echo i860-intel-osf1
11321a30de1fSmrg	exit ;;
11331a30de1fSmrg    i860:*:4.*:*) # i860-SVR4
11341a30de1fSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
11351a30de1fSmrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
11361a30de1fSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
11371a30de1fSmrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
11381a30de1fSmrg	fi
11391a30de1fSmrg	exit ;;
11401a30de1fSmrg    mini*:CTIX:SYS*5:*)
11411a30de1fSmrg	# "miniframe"
11421a30de1fSmrg	echo m68010-convergent-sysv
11431a30de1fSmrg	exit ;;
11441a30de1fSmrg    mc68k:UNIX:SYSTEM5:3.51m)
11451a30de1fSmrg	echo m68k-convergent-sysv
11461a30de1fSmrg	exit ;;
11471a30de1fSmrg    M680?0:D-NIX:5.3:*)
11481a30de1fSmrg	echo m68k-diab-dnix
11491a30de1fSmrg	exit ;;
11501a30de1fSmrg    M68*:*:R3V[5678]*:*)
11511a30de1fSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11521a30de1fSmrg    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)
11531a30de1fSmrg	OS_REL=''
11541a30de1fSmrg	test -r /etc/.relid \
11551a30de1fSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11561a30de1fSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11571a30de1fSmrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11581a30de1fSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11591a30de1fSmrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11601a30de1fSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11611a30de1fSmrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11621a30de1fSmrg          && { echo i486-ncr-sysv4; exit; } ;;
1163b7fb5eacSmrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1164b7fb5eacSmrg	OS_REL='.3'
1165b7fb5eacSmrg	test -r /etc/.relid \
1166b7fb5eacSmrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1167b7fb5eacSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1168b7fb5eacSmrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1169b7fb5eacSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1170b7fb5eacSmrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1171b7fb5eacSmrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1172b7fb5eacSmrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11731a30de1fSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11741a30de1fSmrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11751a30de1fSmrg	exit ;;
11761a30de1fSmrg    mc68030:UNIX_System_V:4.*:*)
11771a30de1fSmrg	echo m68k-atari-sysv4
11781a30de1fSmrg	exit ;;
11791a30de1fSmrg    TSUNAMI:LynxOS:2.*:*)
11801a30de1fSmrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11811a30de1fSmrg	exit ;;
11821a30de1fSmrg    rs6000:LynxOS:2.*:*)
11831a30de1fSmrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11841a30de1fSmrg	exit ;;
11851a30de1fSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
11861a30de1fSmrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11871a30de1fSmrg	exit ;;
11881a30de1fSmrg    SM[BE]S:UNIX_SV:*:*)
11891a30de1fSmrg	echo mips-dde-sysv${UNAME_RELEASE}
11901a30de1fSmrg	exit ;;
11911a30de1fSmrg    RM*:ReliantUNIX-*:*:*)
11921a30de1fSmrg	echo mips-sni-sysv4
11931a30de1fSmrg	exit ;;
11941a30de1fSmrg    RM*:SINIX-*:*:*)
11951a30de1fSmrg	echo mips-sni-sysv4
11961a30de1fSmrg	exit ;;
11971a30de1fSmrg    *:SINIX-*:*:*)
11981a30de1fSmrg	if uname -p 2>/dev/null >/dev/null ; then
11991a30de1fSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
12001a30de1fSmrg		echo ${UNAME_MACHINE}-sni-sysv4
12011a30de1fSmrg	else
12021a30de1fSmrg		echo ns32k-sni-sysv
12031a30de1fSmrg	fi
12041a30de1fSmrg	exit ;;
12051a30de1fSmrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
12061a30de1fSmrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
12071a30de1fSmrg        echo i586-unisys-sysv4
12081a30de1fSmrg        exit ;;
12091a30de1fSmrg    *:UNIX_System_V:4*:FTX*)
12101a30de1fSmrg	# From Gerald Hewes <hewes@openmarket.com>.
12111a30de1fSmrg	# How about differentiating between stratus architectures? -djm
12121a30de1fSmrg	echo hppa1.1-stratus-sysv4
12131a30de1fSmrg	exit ;;
12141a30de1fSmrg    *:*:*:FTX*)
12151a30de1fSmrg	# From seanf@swdc.stratus.com.
12161a30de1fSmrg	echo i860-stratus-sysv4
12171a30de1fSmrg	exit ;;
12181a30de1fSmrg    i*86:VOS:*:*)
12191a30de1fSmrg	# From Paul.Green@stratus.com.
12201a30de1fSmrg	echo ${UNAME_MACHINE}-stratus-vos
12211a30de1fSmrg	exit ;;
12221a30de1fSmrg    *:VOS:*:*)
12231a30de1fSmrg	# From Paul.Green@stratus.com.
12241a30de1fSmrg	echo hppa1.1-stratus-vos
12251a30de1fSmrg	exit ;;
12261a30de1fSmrg    mc68*:A/UX:*:*)
12271a30de1fSmrg	echo m68k-apple-aux${UNAME_RELEASE}
12281a30de1fSmrg	exit ;;
12291a30de1fSmrg    news*:NEWS-OS:6*:*)
12301a30de1fSmrg	echo mips-sony-newsos6
12311a30de1fSmrg	exit ;;
12321a30de1fSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12331a30de1fSmrg	if [ -d /usr/nec ]; then
12341a30de1fSmrg	        echo mips-nec-sysv${UNAME_RELEASE}
12351a30de1fSmrg	else
12361a30de1fSmrg	        echo mips-unknown-sysv${UNAME_RELEASE}
12371a30de1fSmrg	fi
12381a30de1fSmrg        exit ;;
12391a30de1fSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
12401a30de1fSmrg	echo powerpc-be-beos
12411a30de1fSmrg	exit ;;
12421a30de1fSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
12431a30de1fSmrg	echo powerpc-apple-beos
12441a30de1fSmrg	exit ;;
12451a30de1fSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
12461a30de1fSmrg	echo i586-pc-beos
12471a30de1fSmrg	exit ;;
1248b7fb5eacSmrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1249b7fb5eacSmrg	echo i586-pc-haiku
1250b7fb5eacSmrg	exit ;;
12511a30de1fSmrg    SX-4:SUPER-UX:*:*)
12521a30de1fSmrg	echo sx4-nec-superux${UNAME_RELEASE}
12531a30de1fSmrg	exit ;;
12541a30de1fSmrg    SX-5:SUPER-UX:*:*)
12551a30de1fSmrg	echo sx5-nec-superux${UNAME_RELEASE}
12561a30de1fSmrg	exit ;;
12571a30de1fSmrg    SX-6:SUPER-UX:*:*)
12581a30de1fSmrg	echo sx6-nec-superux${UNAME_RELEASE}
12591a30de1fSmrg	exit ;;
1260b7fb5eacSmrg    SX-7:SUPER-UX:*:*)
1261b7fb5eacSmrg	echo sx7-nec-superux${UNAME_RELEASE}
1262b7fb5eacSmrg	exit ;;
1263b7fb5eacSmrg    SX-8:SUPER-UX:*:*)
1264b7fb5eacSmrg	echo sx8-nec-superux${UNAME_RELEASE}
1265b7fb5eacSmrg	exit ;;
1266b7fb5eacSmrg    SX-8R:SUPER-UX:*:*)
1267b7fb5eacSmrg	echo sx8r-nec-superux${UNAME_RELEASE}
1268b7fb5eacSmrg	exit ;;
12691a30de1fSmrg    Power*:Rhapsody:*:*)
12701a30de1fSmrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12711a30de1fSmrg	exit ;;
12721a30de1fSmrg    *:Rhapsody:*:*)
12731a30de1fSmrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12741a30de1fSmrg	exit ;;
12751a30de1fSmrg    *:Darwin:*:*)
12761a30de1fSmrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12771a30de1fSmrg	case $UNAME_PROCESSOR in
12781a30de1fSmrg	    unknown) UNAME_PROCESSOR=powerpc ;;
12791a30de1fSmrg	esac
12801a30de1fSmrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12811a30de1fSmrg	exit ;;
12821a30de1fSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
12831a30de1fSmrg	UNAME_PROCESSOR=`uname -p`
12841a30de1fSmrg	if test "$UNAME_PROCESSOR" = "x86"; then
12851a30de1fSmrg		UNAME_PROCESSOR=i386
12861a30de1fSmrg		UNAME_MACHINE=pc
12871a30de1fSmrg	fi
12881a30de1fSmrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
12891a30de1fSmrg	exit ;;
12901a30de1fSmrg    *:QNX:*:4*)
12911a30de1fSmrg	echo i386-pc-qnx
12921a30de1fSmrg	exit ;;
12931a30de1fSmrg    NSE-?:NONSTOP_KERNEL:*:*)
12941a30de1fSmrg	echo nse-tandem-nsk${UNAME_RELEASE}
12951a30de1fSmrg	exit ;;
12961a30de1fSmrg    NSR-?:NONSTOP_KERNEL:*:*)
12971a30de1fSmrg	echo nsr-tandem-nsk${UNAME_RELEASE}
12981a30de1fSmrg	exit ;;
12991a30de1fSmrg    *:NonStop-UX:*:*)
13001a30de1fSmrg	echo mips-compaq-nonstopux
13011a30de1fSmrg	exit ;;
13021a30de1fSmrg    BS2000:POSIX*:*:*)
13031a30de1fSmrg	echo bs2000-siemens-sysv
13041a30de1fSmrg	exit ;;
13051a30de1fSmrg    DS/*:UNIX_System_V:*:*)
13061a30de1fSmrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
13071a30de1fSmrg	exit ;;
13081a30de1fSmrg    *:Plan9:*:*)
13091a30de1fSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
13101a30de1fSmrg	# is converted to i386 for consistency with other x86
13111a30de1fSmrg	# operating systems.
13121a30de1fSmrg	if test "$cputype" = "386"; then
13131a30de1fSmrg	    UNAME_MACHINE=i386
13141a30de1fSmrg	else
13151a30de1fSmrg	    UNAME_MACHINE="$cputype"
13161a30de1fSmrg	fi
13171a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-plan9
13181a30de1fSmrg	exit ;;
13191a30de1fSmrg    *:TOPS-10:*:*)
13201a30de1fSmrg	echo pdp10-unknown-tops10
13211a30de1fSmrg	exit ;;
13221a30de1fSmrg    *:TENEX:*:*)
13231a30de1fSmrg	echo pdp10-unknown-tenex
13241a30de1fSmrg	exit ;;
13251a30de1fSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
13261a30de1fSmrg	echo pdp10-dec-tops20
13271a30de1fSmrg	exit ;;
13281a30de1fSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
13291a30de1fSmrg	echo pdp10-xkl-tops20
13301a30de1fSmrg	exit ;;
13311a30de1fSmrg    *:TOPS-20:*:*)
13321a30de1fSmrg	echo pdp10-unknown-tops20
13331a30de1fSmrg	exit ;;
13341a30de1fSmrg    *:ITS:*:*)
13351a30de1fSmrg	echo pdp10-unknown-its
13361a30de1fSmrg	exit ;;
13371a30de1fSmrg    SEI:*:*:SEIUX)
13381a30de1fSmrg        echo mips-sei-seiux${UNAME_RELEASE}
13391a30de1fSmrg	exit ;;
13401a30de1fSmrg    *:DragonFly:*:*)
13411a30de1fSmrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13421a30de1fSmrg	exit ;;
13431a30de1fSmrg    *:*VMS:*:*)
13441a30de1fSmrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13451a30de1fSmrg	case "${UNAME_MACHINE}" in
13461a30de1fSmrg	    A*) echo alpha-dec-vms ; exit ;;
13471a30de1fSmrg	    I*) echo ia64-dec-vms ; exit ;;
13481a30de1fSmrg	    V*) echo vax-dec-vms ; exit ;;
13491a30de1fSmrg	esac ;;
13501a30de1fSmrg    *:XENIX:*:SysV)
13511a30de1fSmrg	echo i386-pc-xenix
13521a30de1fSmrg	exit ;;
13531a30de1fSmrg    i*86:skyos:*:*)
13541a30de1fSmrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13551a30de1fSmrg	exit ;;
13561a30de1fSmrg    i*86:rdos:*:*)
13571a30de1fSmrg	echo ${UNAME_MACHINE}-pc-rdos
13581a30de1fSmrg	exit ;;
1359b7fb5eacSmrg    i*86:AROS:*:*)
1360b7fb5eacSmrg	echo ${UNAME_MACHINE}-pc-aros
1361b7fb5eacSmrg	exit ;;
13621a30de1fSmrgesac
13631a30de1fSmrg
13641a30de1fSmrg#echo '(No uname command or uname output not recognized.)' 1>&2
13651a30de1fSmrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
13661a30de1fSmrg
13671a30de1fSmrgeval $set_cc_for_build
13681a30de1fSmrgcat >$dummy.c <<EOF
13691a30de1fSmrg#ifdef _SEQUENT_
13701a30de1fSmrg# include <sys/types.h>
13711a30de1fSmrg# include <sys/utsname.h>
13721a30de1fSmrg#endif
13731a30de1fSmrgmain ()
13741a30de1fSmrg{
13751a30de1fSmrg#if defined (sony)
13761a30de1fSmrg#if defined (MIPSEB)
13771a30de1fSmrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
13781a30de1fSmrg     I don't know....  */
13791a30de1fSmrg  printf ("mips-sony-bsd\n"); exit (0);
13801a30de1fSmrg#else
13811a30de1fSmrg#include <sys/param.h>
13821a30de1fSmrg  printf ("m68k-sony-newsos%s\n",
13831a30de1fSmrg#ifdef NEWSOS4
13841a30de1fSmrg          "4"
13851a30de1fSmrg#else
13861a30de1fSmrg	  ""
13871a30de1fSmrg#endif
13881a30de1fSmrg         ); exit (0);
13891a30de1fSmrg#endif
13901a30de1fSmrg#endif
13911a30de1fSmrg
13921a30de1fSmrg#if defined (__arm) && defined (__acorn) && defined (__unix)
13931a30de1fSmrg  printf ("arm-acorn-riscix\n"); exit (0);
13941a30de1fSmrg#endif
13951a30de1fSmrg
13961a30de1fSmrg#if defined (hp300) && !defined (hpux)
13971a30de1fSmrg  printf ("m68k-hp-bsd\n"); exit (0);
13981a30de1fSmrg#endif
13991a30de1fSmrg
14001a30de1fSmrg#if defined (NeXT)
14011a30de1fSmrg#if !defined (__ARCHITECTURE__)
14021a30de1fSmrg#define __ARCHITECTURE__ "m68k"
14031a30de1fSmrg#endif
14041a30de1fSmrg  int version;
14051a30de1fSmrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
14061a30de1fSmrg  if (version < 4)
14071a30de1fSmrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
14081a30de1fSmrg  else
14091a30de1fSmrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
14101a30de1fSmrg  exit (0);
14111a30de1fSmrg#endif
14121a30de1fSmrg
14131a30de1fSmrg#if defined (MULTIMAX) || defined (n16)
14141a30de1fSmrg#if defined (UMAXV)
14151a30de1fSmrg  printf ("ns32k-encore-sysv\n"); exit (0);
14161a30de1fSmrg#else
14171a30de1fSmrg#if defined (CMU)
14181a30de1fSmrg  printf ("ns32k-encore-mach\n"); exit (0);
14191a30de1fSmrg#else
14201a30de1fSmrg  printf ("ns32k-encore-bsd\n"); exit (0);
14211a30de1fSmrg#endif
14221a30de1fSmrg#endif
14231a30de1fSmrg#endif
14241a30de1fSmrg
14251a30de1fSmrg#if defined (__386BSD__)
14261a30de1fSmrg  printf ("i386-pc-bsd\n"); exit (0);
14271a30de1fSmrg#endif
14281a30de1fSmrg
14291a30de1fSmrg#if defined (sequent)
14301a30de1fSmrg#if defined (i386)
14311a30de1fSmrg  printf ("i386-sequent-dynix\n"); exit (0);
14321a30de1fSmrg#endif
14331a30de1fSmrg#if defined (ns32000)
14341a30de1fSmrg  printf ("ns32k-sequent-dynix\n"); exit (0);
14351a30de1fSmrg#endif
14361a30de1fSmrg#endif
14371a30de1fSmrg
14381a30de1fSmrg#if defined (_SEQUENT_)
14391a30de1fSmrg    struct utsname un;
14401a30de1fSmrg
14411a30de1fSmrg    uname(&un);
14421a30de1fSmrg
14431a30de1fSmrg    if (strncmp(un.version, "V2", 2) == 0) {
14441a30de1fSmrg	printf ("i386-sequent-ptx2\n"); exit (0);
14451a30de1fSmrg    }
14461a30de1fSmrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
14471a30de1fSmrg	printf ("i386-sequent-ptx1\n"); exit (0);
14481a30de1fSmrg    }
14491a30de1fSmrg    printf ("i386-sequent-ptx\n"); exit (0);
14501a30de1fSmrg
14511a30de1fSmrg#endif
14521a30de1fSmrg
14531a30de1fSmrg#if defined (vax)
14541a30de1fSmrg# if !defined (ultrix)
14551a30de1fSmrg#  include <sys/param.h>
14561a30de1fSmrg#  if defined (BSD)
14571a30de1fSmrg#   if BSD == 43
14581a30de1fSmrg      printf ("vax-dec-bsd4.3\n"); exit (0);
14591a30de1fSmrg#   else
14601a30de1fSmrg#    if BSD == 199006
14611a30de1fSmrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
14621a30de1fSmrg#    else
14631a30de1fSmrg      printf ("vax-dec-bsd\n"); exit (0);
14641a30de1fSmrg#    endif
14651a30de1fSmrg#   endif
14661a30de1fSmrg#  else
14671a30de1fSmrg    printf ("vax-dec-bsd\n"); exit (0);
14681a30de1fSmrg#  endif
14691a30de1fSmrg# else
14701a30de1fSmrg    printf ("vax-dec-ultrix\n"); exit (0);
14711a30de1fSmrg# endif
14721a30de1fSmrg#endif
14731a30de1fSmrg
14741a30de1fSmrg#if defined (alliant) && defined (i860)
14751a30de1fSmrg  printf ("i860-alliant-bsd\n"); exit (0);
14761a30de1fSmrg#endif
14771a30de1fSmrg
14781a30de1fSmrg  exit (1);
14791a30de1fSmrg}
14801a30de1fSmrgEOF
14811a30de1fSmrg
14821a30de1fSmrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
14831a30de1fSmrg	{ echo "$SYSTEM_NAME"; exit; }
14841a30de1fSmrg
14851a30de1fSmrg# Apollos put the system type in the environment.
14861a30de1fSmrg
14871a30de1fSmrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
14881a30de1fSmrg
14891a30de1fSmrg# Convex versions that predate uname can use getsysinfo(1)
14901a30de1fSmrg
14911a30de1fSmrgif [ -x /usr/convex/getsysinfo ]
14921a30de1fSmrgthen
14931a30de1fSmrg    case `getsysinfo -f cpu_type` in
14941a30de1fSmrg    c1*)
14951a30de1fSmrg	echo c1-convex-bsd
14961a30de1fSmrg	exit ;;
14971a30de1fSmrg    c2*)
14981a30de1fSmrg	if getsysinfo -f scalar_acc
14991a30de1fSmrg	then echo c32-convex-bsd
15001a30de1fSmrg	else echo c2-convex-bsd
15011a30de1fSmrg	fi
15021a30de1fSmrg	exit ;;
15031a30de1fSmrg    c34*)
15041a30de1fSmrg	echo c34-convex-bsd
15051a30de1fSmrg	exit ;;
15061a30de1fSmrg    c38*)
15071a30de1fSmrg	echo c38-convex-bsd
15081a30de1fSmrg	exit ;;
15091a30de1fSmrg    c4*)
15101a30de1fSmrg	echo c4-convex-bsd
15111a30de1fSmrg	exit ;;
15121a30de1fSmrg    esac
15131a30de1fSmrgfi
15141a30de1fSmrg
15151a30de1fSmrgcat >&2 <<EOF
15161a30de1fSmrg$0: unable to guess system type
15171a30de1fSmrg
15181a30de1fSmrgThis script, last modified $timestamp, has failed to recognize
15191a30de1fSmrgthe operating system you are using. It is advised that you
15201a30de1fSmrgdownload the most up to date version of the config scripts from
15211a30de1fSmrg
1522b7fb5eacSmrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
15231a30de1fSmrgand
1524b7fb5eacSmrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
15251a30de1fSmrg
15261a30de1fSmrgIf the version you run ($0) is already up to date, please
15271a30de1fSmrgsend the following data and any information you think might be
15281a30de1fSmrgpertinent to <config-patches@gnu.org> in order to provide the needed
15291a30de1fSmrginformation to handle your system.
15301a30de1fSmrg
15311a30de1fSmrgconfig.guess timestamp = $timestamp
15321a30de1fSmrg
15331a30de1fSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
15341a30de1fSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
15351a30de1fSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
15361a30de1fSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
15371a30de1fSmrg
15381a30de1fSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
15391a30de1fSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
15401a30de1fSmrg
15411a30de1fSmrghostinfo               = `(hostinfo) 2>/dev/null`
15421a30de1fSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
15431a30de1fSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
15441a30de1fSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
15451a30de1fSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
15461a30de1fSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
15471a30de1fSmrg
15481a30de1fSmrgUNAME_MACHINE = ${UNAME_MACHINE}
15491a30de1fSmrgUNAME_RELEASE = ${UNAME_RELEASE}
15501a30de1fSmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
15511a30de1fSmrgUNAME_VERSION = ${UNAME_VERSION}
15521a30de1fSmrgEOF
15531a30de1fSmrg
15541a30de1fSmrgexit 1
15551a30de1fSmrg
15561a30de1fSmrg# Local variables:
15571a30de1fSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
15581a30de1fSmrg# time-stamp-start: "timestamp='"
15591a30de1fSmrg# time-stamp-format: "%:y-%02m-%02d"
15601a30de1fSmrg# time-stamp-end: "'"
15611a30de1fSmrg# End:
1562