config.guess revision 4e411241
18c9fbc29Smrg#! /bin/sh
28c9fbc29Smrg# Attempt to guess a canonical system name.
38c9fbc29Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
44e411241Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
54e411241Smrg#   Free Software Foundation, Inc.
68c9fbc29Smrg
74e411241Smrgtimestamp='2008-01-23'
88c9fbc29Smrg
98c9fbc29Smrg# This file is free software; you can redistribute it and/or modify it
108c9fbc29Smrg# under the terms of the GNU General Public License as published by
118c9fbc29Smrg# the Free Software Foundation; either version 2 of the License, or
128c9fbc29Smrg# (at your option) any later version.
138c9fbc29Smrg#
148c9fbc29Smrg# This program is distributed in the hope that it will be useful, but
158c9fbc29Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
168c9fbc29Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
178c9fbc29Smrg# General Public License for more details.
188c9fbc29Smrg#
198c9fbc29Smrg# You should have received a copy of the GNU General Public License
208c9fbc29Smrg# along with this program; if not, write to the Free Software
218c9fbc29Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
228c9fbc29Smrg# 02110-1301, USA.
238c9fbc29Smrg#
248c9fbc29Smrg# As a special exception to the GNU General Public License, if you
258c9fbc29Smrg# distribute this file as part of a program that contains a
268c9fbc29Smrg# configuration script generated by Autoconf, you may include it under
278c9fbc29Smrg# the same distribution terms that you use for the rest of that program.
288c9fbc29Smrg
298c9fbc29Smrg
308c9fbc29Smrg# Originally written by Per Bothner <per@bothner.com>.
318c9fbc29Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
328c9fbc29Smrg# diff and a properly formatted ChangeLog entry.
338c9fbc29Smrg#
348c9fbc29Smrg# This script attempts to guess a canonical system name similar to
358c9fbc29Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
368c9fbc29Smrg# exits with 0.  Otherwise, it exits with 1.
378c9fbc29Smrg#
388c9fbc29Smrg# The plan is that this can be called by configure scripts if you
398c9fbc29Smrg# don't specify an explicit build system type.
408c9fbc29Smrg
418c9fbc29Smrgme=`echo "$0" | sed -e 's,.*/,,'`
428c9fbc29Smrg
438c9fbc29Smrgusage="\
448c9fbc29SmrgUsage: $0 [OPTION]
458c9fbc29Smrg
468c9fbc29SmrgOutput the configuration name of the system \`$me' is run on.
478c9fbc29Smrg
488c9fbc29SmrgOperation modes:
498c9fbc29Smrg  -h, --help         print this help, then exit
508c9fbc29Smrg  -t, --time-stamp   print date of last modification, then exit
518c9fbc29Smrg  -v, --version      print version number, then exit
528c9fbc29Smrg
538c9fbc29SmrgReport bugs and patches to <config-patches@gnu.org>."
548c9fbc29Smrg
558c9fbc29Smrgversion="\
568c9fbc29SmrgGNU config.guess ($timestamp)
578c9fbc29Smrg
588c9fbc29SmrgOriginally written by Per Bothner.
594e411241SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
604e411241Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
618c9fbc29Smrg
628c9fbc29SmrgThis is free software; see the source for copying conditions.  There is NO
638c9fbc29Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
648c9fbc29Smrg
658c9fbc29Smrghelp="
668c9fbc29SmrgTry \`$me --help' for more information."
678c9fbc29Smrg
688c9fbc29Smrg# Parse command line
698c9fbc29Smrgwhile test $# -gt 0 ; do
708c9fbc29Smrg  case $1 in
718c9fbc29Smrg    --time-stamp | --time* | -t )
728c9fbc29Smrg       echo "$timestamp" ; exit ;;
738c9fbc29Smrg    --version | -v )
748c9fbc29Smrg       echo "$version" ; exit ;;
758c9fbc29Smrg    --help | --h* | -h )
768c9fbc29Smrg       echo "$usage"; exit ;;
778c9fbc29Smrg    -- )     # Stop option processing
788c9fbc29Smrg       shift; break ;;
798c9fbc29Smrg    - )	# Use stdin as input.
808c9fbc29Smrg       break ;;
818c9fbc29Smrg    -* )
828c9fbc29Smrg       echo "$me: invalid option $1$help" >&2
838c9fbc29Smrg       exit 1 ;;
848c9fbc29Smrg    * )
858c9fbc29Smrg       break ;;
868c9fbc29Smrg  esac
878c9fbc29Smrgdone
888c9fbc29Smrg
898c9fbc29Smrgif test $# != 0; then
908c9fbc29Smrg  echo "$me: too many arguments$help" >&2
918c9fbc29Smrg  exit 1
928c9fbc29Smrgfi
938c9fbc29Smrg
948c9fbc29Smrgtrap 'exit 1' 1 2 15
958c9fbc29Smrg
968c9fbc29Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
978c9fbc29Smrg# compiler to aid in system detection is discouraged as it requires
988c9fbc29Smrg# temporary files to be created and, as you can see below, it is a
998c9fbc29Smrg# headache to deal with in a portable fashion.
1008c9fbc29Smrg
1018c9fbc29Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
1028c9fbc29Smrg# use `HOST_CC' if defined, but it is deprecated.
1038c9fbc29Smrg
1048c9fbc29Smrg# Portable tmp directory creation inspired by the Autoconf team.
1058c9fbc29Smrg
1068c9fbc29Smrgset_cc_for_build='
1078c9fbc29Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1088c9fbc29Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1098c9fbc29Smrg: ${TMPDIR=/tmp} ;
1104e411241Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1118c9fbc29Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1128c9fbc29Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1138c9fbc29Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1148c9fbc29Smrgdummy=$tmp/dummy ;
1158c9fbc29Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1168c9fbc29Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1178c9fbc29Smrg ,,)    echo "int x;" > $dummy.c ;
1188c9fbc29Smrg	for c in cc gcc c89 c99 ; do
1198c9fbc29Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1208c9fbc29Smrg	     CC_FOR_BUILD="$c"; break ;
1218c9fbc29Smrg	  fi ;
1228c9fbc29Smrg	done ;
1238c9fbc29Smrg	if test x"$CC_FOR_BUILD" = x ; then
1248c9fbc29Smrg	  CC_FOR_BUILD=no_compiler_found ;
1258c9fbc29Smrg	fi
1268c9fbc29Smrg	;;
1278c9fbc29Smrg ,,*)   CC_FOR_BUILD=$CC ;;
1288c9fbc29Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1298c9fbc29Smrgesac ; set_cc_for_build= ;'
1308c9fbc29Smrg
1318c9fbc29Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1328c9fbc29Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
1338c9fbc29Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1348c9fbc29Smrg	PATH=$PATH:/.attbin ; export PATH
1358c9fbc29Smrgfi
1368c9fbc29Smrg
1378c9fbc29SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1388c9fbc29SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1398c9fbc29SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1408c9fbc29SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1418c9fbc29Smrg
1428c9fbc29Smrg# Note: order is significant - the case branches are not exclusive.
1438c9fbc29Smrg
1448c9fbc29Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1458c9fbc29Smrg    *:NetBSD:*:*)
1468c9fbc29Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
1478c9fbc29Smrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
1488c9fbc29Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1498c9fbc29Smrg	# switched to ELF, *-*-netbsd* would select the old
1508c9fbc29Smrg	# object file format.  This provides both forward
1518c9fbc29Smrg	# compatibility and a consistent mechanism for selecting the
1528c9fbc29Smrg	# object file format.
1538c9fbc29Smrg	#
1548c9fbc29Smrg	# Note: NetBSD doesn't particularly care about the vendor
1558c9fbc29Smrg	# portion of the name.  We always set it to "unknown".
1568c9fbc29Smrg	sysctl="sysctl -n hw.machine_arch"
1578c9fbc29Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1588c9fbc29Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1598c9fbc29Smrg	case "${UNAME_MACHINE_ARCH}" in
1608c9fbc29Smrg	    armeb) machine=armeb-unknown ;;
1618c9fbc29Smrg	    arm*) machine=arm-unknown ;;
1628c9fbc29Smrg	    sh3el) machine=shl-unknown ;;
1638c9fbc29Smrg	    sh3eb) machine=sh-unknown ;;
1644e411241Smrg	    sh5el) machine=sh5le-unknown ;;
1658c9fbc29Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1668c9fbc29Smrg	esac
1678c9fbc29Smrg	# The Operating System including object format, if it has switched
1688c9fbc29Smrg	# to ELF recently, or will in the future.
1698c9fbc29Smrg	case "${UNAME_MACHINE_ARCH}" in
1708c9fbc29Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1718c9fbc29Smrg		eval $set_cc_for_build
1728c9fbc29Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1738c9fbc29Smrg			| grep __ELF__ >/dev/null
1748c9fbc29Smrg		then
1758c9fbc29Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1768c9fbc29Smrg		    # Return netbsd for either.  FIX?
1778c9fbc29Smrg		    os=netbsd
1788c9fbc29Smrg		else
1798c9fbc29Smrg		    os=netbsdelf
1808c9fbc29Smrg		fi
1818c9fbc29Smrg		;;
1828c9fbc29Smrg	    *)
1838c9fbc29Smrg	        os=netbsd
1848c9fbc29Smrg		;;
1858c9fbc29Smrg	esac
1868c9fbc29Smrg	# The OS release
1878c9fbc29Smrg	# Debian GNU/NetBSD machines have a different userland, and
1888c9fbc29Smrg	# thus, need a distinct triplet. However, they do not need
1898c9fbc29Smrg	# kernel version information, so it can be replaced with a
1908c9fbc29Smrg	# suitable tag, in the style of linux-gnu.
1918c9fbc29Smrg	case "${UNAME_VERSION}" in
1928c9fbc29Smrg	    Debian*)
1938c9fbc29Smrg		release='-gnu'
1948c9fbc29Smrg		;;
1958c9fbc29Smrg	    *)
1968c9fbc29Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
1978c9fbc29Smrg		;;
1988c9fbc29Smrg	esac
1998c9fbc29Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2008c9fbc29Smrg	# contains redundant information, the shorter form:
2018c9fbc29Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2028c9fbc29Smrg	echo "${machine}-${os}${release}"
2038c9fbc29Smrg	exit ;;
2048c9fbc29Smrg    *:OpenBSD:*:*)
2058c9fbc29Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2068c9fbc29Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2078c9fbc29Smrg	exit ;;
2088c9fbc29Smrg    *:ekkoBSD:*:*)
2098c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2108c9fbc29Smrg	exit ;;
2114e411241Smrg    *:SolidBSD:*:*)
2124e411241Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2134e411241Smrg	exit ;;
2148c9fbc29Smrg    macppc:MirBSD:*:*)
2154e411241Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2168c9fbc29Smrg	exit ;;
2178c9fbc29Smrg    *:MirBSD:*:*)
2188c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2198c9fbc29Smrg	exit ;;
2208c9fbc29Smrg    alpha:OSF1:*:*)
2218c9fbc29Smrg	case $UNAME_RELEASE in
2228c9fbc29Smrg	*4.0)
2238c9fbc29Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2248c9fbc29Smrg		;;
2258c9fbc29Smrg	*5.*)
2268c9fbc29Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2278c9fbc29Smrg		;;
2288c9fbc29Smrg	esac
2298c9fbc29Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2308c9fbc29Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2318c9fbc29Smrg	# covers most systems running today.  This code pipes the CPU
2328c9fbc29Smrg	# types through head -n 1, so we only detect the type of CPU 0.
2338c9fbc29Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2348c9fbc29Smrg	case "$ALPHA_CPU_TYPE" in
2358c9fbc29Smrg	    "EV4 (21064)")
2368c9fbc29Smrg		UNAME_MACHINE="alpha" ;;
2378c9fbc29Smrg	    "EV4.5 (21064)")
2388c9fbc29Smrg		UNAME_MACHINE="alpha" ;;
2398c9fbc29Smrg	    "LCA4 (21066/21068)")
2408c9fbc29Smrg		UNAME_MACHINE="alpha" ;;
2418c9fbc29Smrg	    "EV5 (21164)")
2428c9fbc29Smrg		UNAME_MACHINE="alphaev5" ;;
2438c9fbc29Smrg	    "EV5.6 (21164A)")
2448c9fbc29Smrg		UNAME_MACHINE="alphaev56" ;;
2458c9fbc29Smrg	    "EV5.6 (21164PC)")
2468c9fbc29Smrg		UNAME_MACHINE="alphapca56" ;;
2478c9fbc29Smrg	    "EV5.7 (21164PC)")
2488c9fbc29Smrg		UNAME_MACHINE="alphapca57" ;;
2498c9fbc29Smrg	    "EV6 (21264)")
2508c9fbc29Smrg		UNAME_MACHINE="alphaev6" ;;
2518c9fbc29Smrg	    "EV6.7 (21264A)")
2528c9fbc29Smrg		UNAME_MACHINE="alphaev67" ;;
2538c9fbc29Smrg	    "EV6.8CB (21264C)")
2548c9fbc29Smrg		UNAME_MACHINE="alphaev68" ;;
2558c9fbc29Smrg	    "EV6.8AL (21264B)")
2568c9fbc29Smrg		UNAME_MACHINE="alphaev68" ;;
2578c9fbc29Smrg	    "EV6.8CX (21264D)")
2588c9fbc29Smrg		UNAME_MACHINE="alphaev68" ;;
2598c9fbc29Smrg	    "EV6.9A (21264/EV69A)")
2608c9fbc29Smrg		UNAME_MACHINE="alphaev69" ;;
2618c9fbc29Smrg	    "EV7 (21364)")
2628c9fbc29Smrg		UNAME_MACHINE="alphaev7" ;;
2638c9fbc29Smrg	    "EV7.9 (21364A)")
2648c9fbc29Smrg		UNAME_MACHINE="alphaev79" ;;
2658c9fbc29Smrg	esac
2668c9fbc29Smrg	# A Pn.n version is a patched version.
2678c9fbc29Smrg	# A Vn.n version is a released version.
2688c9fbc29Smrg	# A Tn.n version is a released field test version.
2698c9fbc29Smrg	# A Xn.n version is an unreleased experimental baselevel.
2708c9fbc29Smrg	# 1.2 uses "1.2" for uname -r.
2718c9fbc29Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2728c9fbc29Smrg	exit ;;
2738c9fbc29Smrg    Alpha\ *:Windows_NT*:*)
2748c9fbc29Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
2758c9fbc29Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
2768c9fbc29Smrg	# of the specific Alpha model?
2778c9fbc29Smrg	echo alpha-pc-interix
2788c9fbc29Smrg	exit ;;
2798c9fbc29Smrg    21064:Windows_NT:50:3)
2808c9fbc29Smrg	echo alpha-dec-winnt3.5
2818c9fbc29Smrg	exit ;;
2828c9fbc29Smrg    Amiga*:UNIX_System_V:4.0:*)
2838c9fbc29Smrg	echo m68k-unknown-sysv4
2848c9fbc29Smrg	exit ;;
2858c9fbc29Smrg    *:[Aa]miga[Oo][Ss]:*:*)
2868c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
2878c9fbc29Smrg	exit ;;
2888c9fbc29Smrg    *:[Mm]orph[Oo][Ss]:*:*)
2898c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-morphos
2908c9fbc29Smrg	exit ;;
2918c9fbc29Smrg    *:OS/390:*:*)
2928c9fbc29Smrg	echo i370-ibm-openedition
2938c9fbc29Smrg	exit ;;
2948c9fbc29Smrg    *:z/VM:*:*)
2958c9fbc29Smrg	echo s390-ibm-zvmoe
2968c9fbc29Smrg	exit ;;
2978c9fbc29Smrg    *:OS400:*:*)
2988c9fbc29Smrg        echo powerpc-ibm-os400
2998c9fbc29Smrg	exit ;;
3008c9fbc29Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3018c9fbc29Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
3028c9fbc29Smrg	exit ;;
3038c9fbc29Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
3048c9fbc29Smrg	echo arm-unknown-riscos
3058c9fbc29Smrg	exit ;;
3068c9fbc29Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3078c9fbc29Smrg	echo hppa1.1-hitachi-hiuxmpp
3088c9fbc29Smrg	exit ;;
3098c9fbc29Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3108c9fbc29Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3118c9fbc29Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3128c9fbc29Smrg		echo pyramid-pyramid-sysv3
3138c9fbc29Smrg	else
3148c9fbc29Smrg		echo pyramid-pyramid-bsd
3158c9fbc29Smrg	fi
3168c9fbc29Smrg	exit ;;
3178c9fbc29Smrg    NILE*:*:*:dcosx)
3188c9fbc29Smrg	echo pyramid-pyramid-svr4
3198c9fbc29Smrg	exit ;;
3208c9fbc29Smrg    DRS?6000:unix:4.0:6*)
3218c9fbc29Smrg	echo sparc-icl-nx6
3228c9fbc29Smrg	exit ;;
3238c9fbc29Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3248c9fbc29Smrg	case `/usr/bin/uname -p` in
3258c9fbc29Smrg	    sparc) echo sparc-icl-nx7; exit ;;
3268c9fbc29Smrg	esac ;;
3278c9fbc29Smrg    sun4H:SunOS:5.*:*)
3288c9fbc29Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3298c9fbc29Smrg	exit ;;
3308c9fbc29Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3318c9fbc29Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3328c9fbc29Smrg	exit ;;
3334e411241Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3348c9fbc29Smrg	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3358c9fbc29Smrg	exit ;;
3368c9fbc29Smrg    sun4*:SunOS:6*:*)
3378c9fbc29Smrg	# According to config.sub, this is the proper way to canonicalize
3388c9fbc29Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3398c9fbc29Smrg	# it's likely to be more like Solaris than SunOS4.
3408c9fbc29Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3418c9fbc29Smrg	exit ;;
3428c9fbc29Smrg    sun4*:SunOS:*:*)
3438c9fbc29Smrg	case "`/usr/bin/arch -k`" in
3448c9fbc29Smrg	    Series*|S4*)
3458c9fbc29Smrg		UNAME_RELEASE=`uname -v`
3468c9fbc29Smrg		;;
3478c9fbc29Smrg	esac
3488c9fbc29Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
3498c9fbc29Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3508c9fbc29Smrg	exit ;;
3518c9fbc29Smrg    sun3*:SunOS:*:*)
3528c9fbc29Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
3538c9fbc29Smrg	exit ;;
3548c9fbc29Smrg    sun*:*:4.2BSD:*)
3558c9fbc29Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3568c9fbc29Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
3578c9fbc29Smrg	case "`/bin/arch`" in
3588c9fbc29Smrg	    sun3)
3598c9fbc29Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
3608c9fbc29Smrg		;;
3618c9fbc29Smrg	    sun4)
3628c9fbc29Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
3638c9fbc29Smrg		;;
3648c9fbc29Smrg	esac
3658c9fbc29Smrg	exit ;;
3668c9fbc29Smrg    aushp:SunOS:*:*)
3678c9fbc29Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
3688c9fbc29Smrg	exit ;;
3698c9fbc29Smrg    # The situation for MiNT is a little confusing.  The machine name
3708c9fbc29Smrg    # can be virtually everything (everything which is not
3718c9fbc29Smrg    # "atarist" or "atariste" at least should have a processor
3728c9fbc29Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
3738c9fbc29Smrg    # to the lowercase version "mint" (or "freemint").  Finally
3748c9fbc29Smrg    # the system name "TOS" denotes a system which is actually not
3758c9fbc29Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
3768c9fbc29Smrg    # be no problem.
3778c9fbc29Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
3788c9fbc29Smrg        echo m68k-atari-mint${UNAME_RELEASE}
3798c9fbc29Smrg	exit ;;
3808c9fbc29Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
3818c9fbc29Smrg	echo m68k-atari-mint${UNAME_RELEASE}
3828c9fbc29Smrg        exit ;;
3838c9fbc29Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
3848c9fbc29Smrg        echo m68k-atari-mint${UNAME_RELEASE}
3858c9fbc29Smrg	exit ;;
3868c9fbc29Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
3878c9fbc29Smrg        echo m68k-milan-mint${UNAME_RELEASE}
3888c9fbc29Smrg        exit ;;
3898c9fbc29Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
3908c9fbc29Smrg        echo m68k-hades-mint${UNAME_RELEASE}
3918c9fbc29Smrg        exit ;;
3928c9fbc29Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
3938c9fbc29Smrg        echo m68k-unknown-mint${UNAME_RELEASE}
3948c9fbc29Smrg        exit ;;
3958c9fbc29Smrg    m68k:machten:*:*)
3968c9fbc29Smrg	echo m68k-apple-machten${UNAME_RELEASE}
3978c9fbc29Smrg	exit ;;
3988c9fbc29Smrg    powerpc:machten:*:*)
3998c9fbc29Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
4008c9fbc29Smrg	exit ;;
4018c9fbc29Smrg    RISC*:Mach:*:*)
4028c9fbc29Smrg	echo mips-dec-mach_bsd4.3
4038c9fbc29Smrg	exit ;;
4048c9fbc29Smrg    RISC*:ULTRIX:*:*)
4058c9fbc29Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
4068c9fbc29Smrg	exit ;;
4078c9fbc29Smrg    VAX*:ULTRIX*:*:*)
4088c9fbc29Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
4098c9fbc29Smrg	exit ;;
4108c9fbc29Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4118c9fbc29Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4128c9fbc29Smrg	exit ;;
4138c9fbc29Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4148c9fbc29Smrg	eval $set_cc_for_build
4158c9fbc29Smrg	sed 's/^	//' << EOF >$dummy.c
4168c9fbc29Smrg#ifdef __cplusplus
4178c9fbc29Smrg#include <stdio.h>  /* for printf() prototype */
4188c9fbc29Smrg	int main (int argc, char *argv[]) {
4198c9fbc29Smrg#else
4208c9fbc29Smrg	int main (argc, argv) int argc; char *argv[]; {
4218c9fbc29Smrg#endif
4228c9fbc29Smrg	#if defined (host_mips) && defined (MIPSEB)
4238c9fbc29Smrg	#if defined (SYSTYPE_SYSV)
4248c9fbc29Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4258c9fbc29Smrg	#endif
4268c9fbc29Smrg	#if defined (SYSTYPE_SVR4)
4278c9fbc29Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4288c9fbc29Smrg	#endif
4298c9fbc29Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4308c9fbc29Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4318c9fbc29Smrg	#endif
4328c9fbc29Smrg	#endif
4338c9fbc29Smrg	  exit (-1);
4348c9fbc29Smrg	}
4358c9fbc29SmrgEOF
4368c9fbc29Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4378c9fbc29Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4388c9fbc29Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4398c9fbc29Smrg	    { echo "$SYSTEM_NAME"; exit; }
4408c9fbc29Smrg	echo mips-mips-riscos${UNAME_RELEASE}
4418c9fbc29Smrg	exit ;;
4428c9fbc29Smrg    Motorola:PowerMAX_OS:*:*)
4438c9fbc29Smrg	echo powerpc-motorola-powermax
4448c9fbc29Smrg	exit ;;
4458c9fbc29Smrg    Motorola:*:4.3:PL8-*)
4468c9fbc29Smrg	echo powerpc-harris-powermax
4478c9fbc29Smrg	exit ;;
4488c9fbc29Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4498c9fbc29Smrg	echo powerpc-harris-powermax
4508c9fbc29Smrg	exit ;;
4518c9fbc29Smrg    Night_Hawk:Power_UNIX:*:*)
4528c9fbc29Smrg	echo powerpc-harris-powerunix
4538c9fbc29Smrg	exit ;;
4548c9fbc29Smrg    m88k:CX/UX:7*:*)
4558c9fbc29Smrg	echo m88k-harris-cxux7
4568c9fbc29Smrg	exit ;;
4578c9fbc29Smrg    m88k:*:4*:R4*)
4588c9fbc29Smrg	echo m88k-motorola-sysv4
4598c9fbc29Smrg	exit ;;
4608c9fbc29Smrg    m88k:*:3*:R3*)
4618c9fbc29Smrg	echo m88k-motorola-sysv3
4628c9fbc29Smrg	exit ;;
4638c9fbc29Smrg    AViiON:dgux:*:*)
4648c9fbc29Smrg        # DG/UX returns AViiON for all architectures
4658c9fbc29Smrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
4668c9fbc29Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
4678c9fbc29Smrg	then
4688c9fbc29Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
4698c9fbc29Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
4708c9fbc29Smrg	    then
4718c9fbc29Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
4728c9fbc29Smrg	    else
4738c9fbc29Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
4748c9fbc29Smrg	    fi
4758c9fbc29Smrg	else
4768c9fbc29Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
4778c9fbc29Smrg	fi
4788c9fbc29Smrg 	exit ;;
4798c9fbc29Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
4808c9fbc29Smrg	echo m88k-dolphin-sysv3
4818c9fbc29Smrg	exit ;;
4828c9fbc29Smrg    M88*:*:R3*:*)
4838c9fbc29Smrg	# Delta 88k system running SVR3
4848c9fbc29Smrg	echo m88k-motorola-sysv3
4858c9fbc29Smrg	exit ;;
4868c9fbc29Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
4878c9fbc29Smrg	echo m88k-tektronix-sysv3
4888c9fbc29Smrg	exit ;;
4898c9fbc29Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
4908c9fbc29Smrg	echo m68k-tektronix-bsd
4918c9fbc29Smrg	exit ;;
4928c9fbc29Smrg    *:IRIX*:*:*)
4938c9fbc29Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
4948c9fbc29Smrg	exit ;;
4958c9fbc29Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
4968c9fbc29Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
4978c9fbc29Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
4988c9fbc29Smrg    i*86:AIX:*:*)
4998c9fbc29Smrg	echo i386-ibm-aix
5008c9fbc29Smrg	exit ;;
5018c9fbc29Smrg    ia64:AIX:*:*)
5028c9fbc29Smrg	if [ -x /usr/bin/oslevel ] ; then
5038c9fbc29Smrg		IBM_REV=`/usr/bin/oslevel`
5048c9fbc29Smrg	else
5058c9fbc29Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5068c9fbc29Smrg	fi
5078c9fbc29Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5088c9fbc29Smrg	exit ;;
5098c9fbc29Smrg    *:AIX:2:3)
5108c9fbc29Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5118c9fbc29Smrg		eval $set_cc_for_build
5128c9fbc29Smrg		sed 's/^		//' << EOF >$dummy.c
5138c9fbc29Smrg		#include <sys/systemcfg.h>
5148c9fbc29Smrg
5158c9fbc29Smrg		main()
5168c9fbc29Smrg			{
5178c9fbc29Smrg			if (!__power_pc())
5188c9fbc29Smrg				exit(1);
5198c9fbc29Smrg			puts("powerpc-ibm-aix3.2.5");
5208c9fbc29Smrg			exit(0);
5218c9fbc29Smrg			}
5228c9fbc29SmrgEOF
5238c9fbc29Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5248c9fbc29Smrg		then
5258c9fbc29Smrg			echo "$SYSTEM_NAME"
5268c9fbc29Smrg		else
5278c9fbc29Smrg			echo rs6000-ibm-aix3.2.5
5288c9fbc29Smrg		fi
5298c9fbc29Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5308c9fbc29Smrg		echo rs6000-ibm-aix3.2.4
5318c9fbc29Smrg	else
5328c9fbc29Smrg		echo rs6000-ibm-aix3.2
5338c9fbc29Smrg	fi
5348c9fbc29Smrg	exit ;;
5354e411241Smrg    *:AIX:*:[456])
5368c9fbc29Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5378c9fbc29Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5388c9fbc29Smrg		IBM_ARCH=rs6000
5398c9fbc29Smrg	else
5408c9fbc29Smrg		IBM_ARCH=powerpc
5418c9fbc29Smrg	fi
5428c9fbc29Smrg	if [ -x /usr/bin/oslevel ] ; then
5438c9fbc29Smrg		IBM_REV=`/usr/bin/oslevel`
5448c9fbc29Smrg	else
5458c9fbc29Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5468c9fbc29Smrg	fi
5478c9fbc29Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5488c9fbc29Smrg	exit ;;
5498c9fbc29Smrg    *:AIX:*:*)
5508c9fbc29Smrg	echo rs6000-ibm-aix
5518c9fbc29Smrg	exit ;;
5528c9fbc29Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5538c9fbc29Smrg	echo romp-ibm-bsd4.4
5548c9fbc29Smrg	exit ;;
5558c9fbc29Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5568c9fbc29Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5578c9fbc29Smrg	exit ;;                             # report: romp-ibm BSD 4.3
5588c9fbc29Smrg    *:BOSX:*:*)
5598c9fbc29Smrg	echo rs6000-bull-bosx
5608c9fbc29Smrg	exit ;;
5618c9fbc29Smrg    DPX/2?00:B.O.S.:*:*)
5628c9fbc29Smrg	echo m68k-bull-sysv3
5638c9fbc29Smrg	exit ;;
5648c9fbc29Smrg    9000/[34]??:4.3bsd:1.*:*)
5658c9fbc29Smrg	echo m68k-hp-bsd
5668c9fbc29Smrg	exit ;;
5678c9fbc29Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
5688c9fbc29Smrg	echo m68k-hp-bsd4.4
5698c9fbc29Smrg	exit ;;
5708c9fbc29Smrg    9000/[34678]??:HP-UX:*:*)
5718c9fbc29Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
5728c9fbc29Smrg	case "${UNAME_MACHINE}" in
5738c9fbc29Smrg	    9000/31? )            HP_ARCH=m68000 ;;
5748c9fbc29Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
5758c9fbc29Smrg	    9000/[678][0-9][0-9])
5768c9fbc29Smrg		if [ -x /usr/bin/getconf ]; then
5778c9fbc29Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
5788c9fbc29Smrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
5798c9fbc29Smrg                    case "${sc_cpu_version}" in
5808c9fbc29Smrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
5818c9fbc29Smrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
5828c9fbc29Smrg                      532)                      # CPU_PA_RISC2_0
5838c9fbc29Smrg                        case "${sc_kernel_bits}" in
5848c9fbc29Smrg                          32) HP_ARCH="hppa2.0n" ;;
5858c9fbc29Smrg                          64) HP_ARCH="hppa2.0w" ;;
5868c9fbc29Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
5878c9fbc29Smrg                        esac ;;
5888c9fbc29Smrg                    esac
5898c9fbc29Smrg		fi
5908c9fbc29Smrg		if [ "${HP_ARCH}" = "" ]; then
5918c9fbc29Smrg		    eval $set_cc_for_build
5928c9fbc29Smrg		    sed 's/^              //' << EOF >$dummy.c
5938c9fbc29Smrg
5948c9fbc29Smrg              #define _HPUX_SOURCE
5958c9fbc29Smrg              #include <stdlib.h>
5968c9fbc29Smrg              #include <unistd.h>
5978c9fbc29Smrg
5988c9fbc29Smrg              int main ()
5998c9fbc29Smrg              {
6008c9fbc29Smrg              #if defined(_SC_KERNEL_BITS)
6018c9fbc29Smrg                  long bits = sysconf(_SC_KERNEL_BITS);
6028c9fbc29Smrg              #endif
6038c9fbc29Smrg                  long cpu  = sysconf (_SC_CPU_VERSION);
6048c9fbc29Smrg
6058c9fbc29Smrg                  switch (cpu)
6068c9fbc29Smrg              	{
6078c9fbc29Smrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6088c9fbc29Smrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6098c9fbc29Smrg              	case CPU_PA_RISC2_0:
6108c9fbc29Smrg              #if defined(_SC_KERNEL_BITS)
6118c9fbc29Smrg              	    switch (bits)
6128c9fbc29Smrg              		{
6138c9fbc29Smrg              		case 64: puts ("hppa2.0w"); break;
6148c9fbc29Smrg              		case 32: puts ("hppa2.0n"); break;
6158c9fbc29Smrg              		default: puts ("hppa2.0"); break;
6168c9fbc29Smrg              		} break;
6178c9fbc29Smrg              #else  /* !defined(_SC_KERNEL_BITS) */
6188c9fbc29Smrg              	    puts ("hppa2.0"); break;
6198c9fbc29Smrg              #endif
6208c9fbc29Smrg              	default: puts ("hppa1.0"); break;
6218c9fbc29Smrg              	}
6228c9fbc29Smrg                  exit (0);
6238c9fbc29Smrg              }
6248c9fbc29SmrgEOF
6258c9fbc29Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6268c9fbc29Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6278c9fbc29Smrg		fi ;;
6288c9fbc29Smrg	esac
6298c9fbc29Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
6308c9fbc29Smrg	then
6318c9fbc29Smrg	    eval $set_cc_for_build
6328c9fbc29Smrg
6338c9fbc29Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6348c9fbc29Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6358c9fbc29Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6368c9fbc29Smrg	    #
6378c9fbc29Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
6388c9fbc29Smrg	    # => hppa2.0w-hp-hpux11.23
6398c9fbc29Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6408c9fbc29Smrg	    # => hppa64-hp-hpux11.23
6418c9fbc29Smrg
6428c9fbc29Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
6438c9fbc29Smrg		grep __LP64__ >/dev/null
6448c9fbc29Smrg	    then
6458c9fbc29Smrg		HP_ARCH="hppa2.0w"
6468c9fbc29Smrg	    else
6478c9fbc29Smrg		HP_ARCH="hppa64"
6488c9fbc29Smrg	    fi
6498c9fbc29Smrg	fi
6508c9fbc29Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6518c9fbc29Smrg	exit ;;
6528c9fbc29Smrg    ia64:HP-UX:*:*)
6538c9fbc29Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6548c9fbc29Smrg	echo ia64-hp-hpux${HPUX_REV}
6558c9fbc29Smrg	exit ;;
6568c9fbc29Smrg    3050*:HI-UX:*:*)
6578c9fbc29Smrg	eval $set_cc_for_build
6588c9fbc29Smrg	sed 's/^	//' << EOF >$dummy.c
6598c9fbc29Smrg	#include <unistd.h>
6608c9fbc29Smrg	int
6618c9fbc29Smrg	main ()
6628c9fbc29Smrg	{
6638c9fbc29Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
6648c9fbc29Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
6658c9fbc29Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
6668c9fbc29Smrg	     results, however.  */
6678c9fbc29Smrg	  if (CPU_IS_PA_RISC (cpu))
6688c9fbc29Smrg	    {
6698c9fbc29Smrg	      switch (cpu)
6708c9fbc29Smrg		{
6718c9fbc29Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
6728c9fbc29Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
6738c9fbc29Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
6748c9fbc29Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
6758c9fbc29Smrg		}
6768c9fbc29Smrg	    }
6778c9fbc29Smrg	  else if (CPU_IS_HP_MC68K (cpu))
6788c9fbc29Smrg	    puts ("m68k-hitachi-hiuxwe2");
6798c9fbc29Smrg	  else puts ("unknown-hitachi-hiuxwe2");
6808c9fbc29Smrg	  exit (0);
6818c9fbc29Smrg	}
6828c9fbc29SmrgEOF
6838c9fbc29Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
6848c9fbc29Smrg		{ echo "$SYSTEM_NAME"; exit; }
6858c9fbc29Smrg	echo unknown-hitachi-hiuxwe2
6868c9fbc29Smrg	exit ;;
6878c9fbc29Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
6888c9fbc29Smrg	echo hppa1.1-hp-bsd
6898c9fbc29Smrg	exit ;;
6908c9fbc29Smrg    9000/8??:4.3bsd:*:*)
6918c9fbc29Smrg	echo hppa1.0-hp-bsd
6928c9fbc29Smrg	exit ;;
6938c9fbc29Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
6948c9fbc29Smrg	echo hppa1.0-hp-mpeix
6958c9fbc29Smrg	exit ;;
6968c9fbc29Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
6978c9fbc29Smrg	echo hppa1.1-hp-osf
6988c9fbc29Smrg	exit ;;
6998c9fbc29Smrg    hp8??:OSF1:*:*)
7008c9fbc29Smrg	echo hppa1.0-hp-osf
7018c9fbc29Smrg	exit ;;
7028c9fbc29Smrg    i*86:OSF1:*:*)
7038c9fbc29Smrg	if [ -x /usr/sbin/sysversion ] ; then
7048c9fbc29Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
7058c9fbc29Smrg	else
7068c9fbc29Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
7078c9fbc29Smrg	fi
7088c9fbc29Smrg	exit ;;
7098c9fbc29Smrg    parisc*:Lites*:*:*)
7108c9fbc29Smrg	echo hppa1.1-hp-lites
7118c9fbc29Smrg	exit ;;
7128c9fbc29Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7138c9fbc29Smrg	echo c1-convex-bsd
7148c9fbc29Smrg        exit ;;
7158c9fbc29Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7168c9fbc29Smrg	if getsysinfo -f scalar_acc
7178c9fbc29Smrg	then echo c32-convex-bsd
7188c9fbc29Smrg	else echo c2-convex-bsd
7198c9fbc29Smrg	fi
7208c9fbc29Smrg        exit ;;
7218c9fbc29Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7228c9fbc29Smrg	echo c34-convex-bsd
7238c9fbc29Smrg        exit ;;
7248c9fbc29Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7258c9fbc29Smrg	echo c38-convex-bsd
7268c9fbc29Smrg        exit ;;
7278c9fbc29Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7288c9fbc29Smrg	echo c4-convex-bsd
7298c9fbc29Smrg        exit ;;
7308c9fbc29Smrg    CRAY*Y-MP:*:*:*)
7318c9fbc29Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7328c9fbc29Smrg	exit ;;
7338c9fbc29Smrg    CRAY*[A-Z]90:*:*:*)
7348c9fbc29Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7358c9fbc29Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7368c9fbc29Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7378c9fbc29Smrg	      -e 's/\.[^.]*$/.X/'
7388c9fbc29Smrg	exit ;;
7398c9fbc29Smrg    CRAY*TS:*:*:*)
7408c9fbc29Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7418c9fbc29Smrg	exit ;;
7428c9fbc29Smrg    CRAY*T3E:*:*:*)
7438c9fbc29Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7448c9fbc29Smrg	exit ;;
7458c9fbc29Smrg    CRAY*SV1:*:*:*)
7468c9fbc29Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7478c9fbc29Smrg	exit ;;
7488c9fbc29Smrg    *:UNICOS/mp:*:*)
7498c9fbc29Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7508c9fbc29Smrg	exit ;;
7518c9fbc29Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7528c9fbc29Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7538c9fbc29Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7548c9fbc29Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7558c9fbc29Smrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7568c9fbc29Smrg        exit ;;
7578c9fbc29Smrg    5000:UNIX_System_V:4.*:*)
7588c9fbc29Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7598c9fbc29Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
7608c9fbc29Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7618c9fbc29Smrg	exit ;;
7628c9fbc29Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
7638c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
7648c9fbc29Smrg	exit ;;
7658c9fbc29Smrg    sparc*:BSD/OS:*:*)
7668c9fbc29Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
7678c9fbc29Smrg	exit ;;
7688c9fbc29Smrg    *:BSD/OS:*:*)
7698c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
7708c9fbc29Smrg	exit ;;
7718c9fbc29Smrg    *:FreeBSD:*:*)
7724e411241Smrg	case ${UNAME_MACHINE} in
7734e411241Smrg	    pc98)
7744e411241Smrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7754e411241Smrg	    amd64)
7764e411241Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7774e411241Smrg	    *)
7784e411241Smrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7794e411241Smrg	esac
7808c9fbc29Smrg	exit ;;
7818c9fbc29Smrg    i*:CYGWIN*:*)
7828c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-cygwin
7838c9fbc29Smrg	exit ;;
7844e411241Smrg    *:MINGW*:*)
7858c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-mingw32
7868c9fbc29Smrg	exit ;;
7878c9fbc29Smrg    i*:windows32*:*)
7888c9fbc29Smrg    	# uname -m includes "-pc" on this system.
7898c9fbc29Smrg    	echo ${UNAME_MACHINE}-mingw32
7908c9fbc29Smrg	exit ;;
7918c9fbc29Smrg    i*:PW*:*)
7928c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-pw32
7938c9fbc29Smrg	exit ;;
7944e411241Smrg    *:Interix*:[3456]*)
7954e411241Smrg    	case ${UNAME_MACHINE} in
7964e411241Smrg	    x86)
7974e411241Smrg		echo i586-pc-interix${UNAME_RELEASE}
7984e411241Smrg		exit ;;
7994e411241Smrg	    EM64T | authenticamd)
8004e411241Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
8014e411241Smrg		exit ;;
8024e411241Smrg	    IA64)
8034e411241Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
8044e411241Smrg		exit ;;
8054e411241Smrg	esac ;;
8068c9fbc29Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
8078c9fbc29Smrg	echo i${UNAME_MACHINE}-pc-mks
8088c9fbc29Smrg	exit ;;
8098c9fbc29Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
8108c9fbc29Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
8118c9fbc29Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8128c9fbc29Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
8138c9fbc29Smrg	echo i586-pc-interix
8148c9fbc29Smrg	exit ;;
8158c9fbc29Smrg    i*:UWIN*:*)
8168c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-uwin
8178c9fbc29Smrg	exit ;;
8188c9fbc29Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8198c9fbc29Smrg	echo x86_64-unknown-cygwin
8208c9fbc29Smrg	exit ;;
8218c9fbc29Smrg    p*:CYGWIN*:*)
8228c9fbc29Smrg	echo powerpcle-unknown-cygwin
8238c9fbc29Smrg	exit ;;
8248c9fbc29Smrg    prep*:SunOS:5.*:*)
8258c9fbc29Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8268c9fbc29Smrg	exit ;;
8278c9fbc29Smrg    *:GNU:*:*)
8288c9fbc29Smrg	# the GNU system
8298c9fbc29Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8308c9fbc29Smrg	exit ;;
8318c9fbc29Smrg    *:GNU/*:*:*)
8328c9fbc29Smrg	# other systems with GNU libc and userland
8338c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
8348c9fbc29Smrg	exit ;;
8358c9fbc29Smrg    i*86:Minix:*:*)
8368c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-minix
8378c9fbc29Smrg	exit ;;
8388c9fbc29Smrg    arm*:Linux:*:*)
8394e411241Smrg	eval $set_cc_for_build
8404e411241Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
8414e411241Smrg	    | grep -q __ARM_EABI__
8424e411241Smrg	then
8434e411241Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
8444e411241Smrg	else
8454e411241Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
8464e411241Smrg	fi
8474e411241Smrg	exit ;;
8484e411241Smrg    avr32*:Linux:*:*)
8498c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8508c9fbc29Smrg	exit ;;
8518c9fbc29Smrg    cris:Linux:*:*)
8528c9fbc29Smrg	echo cris-axis-linux-gnu
8538c9fbc29Smrg	exit ;;
8548c9fbc29Smrg    crisv32:Linux:*:*)
8558c9fbc29Smrg	echo crisv32-axis-linux-gnu
8568c9fbc29Smrg	exit ;;
8578c9fbc29Smrg    frv:Linux:*:*)
8588c9fbc29Smrg    	echo frv-unknown-linux-gnu
8598c9fbc29Smrg	exit ;;
8608c9fbc29Smrg    ia64:Linux:*:*)
8618c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8628c9fbc29Smrg	exit ;;
8638c9fbc29Smrg    m32r*:Linux:*:*)
8648c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8658c9fbc29Smrg	exit ;;
8668c9fbc29Smrg    m68*:Linux:*:*)
8678c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8688c9fbc29Smrg	exit ;;
8698c9fbc29Smrg    mips:Linux:*:*)
8708c9fbc29Smrg	eval $set_cc_for_build
8718c9fbc29Smrg	sed 's/^	//' << EOF >$dummy.c
8728c9fbc29Smrg	#undef CPU
8738c9fbc29Smrg	#undef mips
8748c9fbc29Smrg	#undef mipsel
8758c9fbc29Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
8768c9fbc29Smrg	CPU=mipsel
8778c9fbc29Smrg	#else
8788c9fbc29Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
8798c9fbc29Smrg	CPU=mips
8808c9fbc29Smrg	#else
8818c9fbc29Smrg	CPU=
8828c9fbc29Smrg	#endif
8838c9fbc29Smrg	#endif
8848c9fbc29SmrgEOF
8854e411241Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
8864e411241Smrg	    /^CPU/{
8874e411241Smrg		s: ::g
8884e411241Smrg		p
8894e411241Smrg	    }'`"
8908c9fbc29Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
8918c9fbc29Smrg	;;
8928c9fbc29Smrg    mips64:Linux:*:*)
8938c9fbc29Smrg	eval $set_cc_for_build
8948c9fbc29Smrg	sed 's/^	//' << EOF >$dummy.c
8958c9fbc29Smrg	#undef CPU
8968c9fbc29Smrg	#undef mips64
8978c9fbc29Smrg	#undef mips64el
8988c9fbc29Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
8998c9fbc29Smrg	CPU=mips64el
9008c9fbc29Smrg	#else
9018c9fbc29Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9028c9fbc29Smrg	CPU=mips64
9038c9fbc29Smrg	#else
9048c9fbc29Smrg	CPU=
9058c9fbc29Smrg	#endif
9068c9fbc29Smrg	#endif
9078c9fbc29SmrgEOF
9084e411241Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
9094e411241Smrg	    /^CPU/{
9104e411241Smrg		s: ::g
9114e411241Smrg		p
9124e411241Smrg	    }'`"
9138c9fbc29Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
9148c9fbc29Smrg	;;
9158c9fbc29Smrg    or32:Linux:*:*)
9168c9fbc29Smrg	echo or32-unknown-linux-gnu
9178c9fbc29Smrg	exit ;;
9188c9fbc29Smrg    ppc:Linux:*:*)
9198c9fbc29Smrg	echo powerpc-unknown-linux-gnu
9208c9fbc29Smrg	exit ;;
9218c9fbc29Smrg    ppc64:Linux:*:*)
9228c9fbc29Smrg	echo powerpc64-unknown-linux-gnu
9238c9fbc29Smrg	exit ;;
9248c9fbc29Smrg    alpha:Linux:*:*)
9258c9fbc29Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
9268c9fbc29Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
9278c9fbc29Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
9288c9fbc29Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
9298c9fbc29Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
9308c9fbc29Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
9318c9fbc29Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
9328c9fbc29Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
9338c9fbc29Smrg        esac
9348c9fbc29Smrg	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
9358c9fbc29Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
9368c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
9378c9fbc29Smrg	exit ;;
9388c9fbc29Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
9398c9fbc29Smrg	# Look for CPU level
9408c9fbc29Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9418c9fbc29Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
9428c9fbc29Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
9438c9fbc29Smrg	  *)    echo hppa-unknown-linux-gnu ;;
9448c9fbc29Smrg	esac
9458c9fbc29Smrg	exit ;;
9468c9fbc29Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
9478c9fbc29Smrg	echo hppa64-unknown-linux-gnu
9488c9fbc29Smrg	exit ;;
9498c9fbc29Smrg    s390:Linux:*:* | s390x:Linux:*:*)
9508c9fbc29Smrg	echo ${UNAME_MACHINE}-ibm-linux
9518c9fbc29Smrg	exit ;;
9528c9fbc29Smrg    sh64*:Linux:*:*)
9538c9fbc29Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
9548c9fbc29Smrg	exit ;;
9558c9fbc29Smrg    sh*:Linux:*:*)
9568c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9578c9fbc29Smrg	exit ;;
9588c9fbc29Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
9598c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9608c9fbc29Smrg	exit ;;
9618c9fbc29Smrg    vax:Linux:*:*)
9628c9fbc29Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
9638c9fbc29Smrg	exit ;;
9648c9fbc29Smrg    x86_64:Linux:*:*)
9658c9fbc29Smrg	echo x86_64-unknown-linux-gnu
9668c9fbc29Smrg	exit ;;
9674e411241Smrg    xtensa*:Linux:*:*)
9684e411241Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
9694e411241Smrg	exit ;;
9708c9fbc29Smrg    i*86:Linux:*:*)
9718c9fbc29Smrg	# The BFD linker knows what the default object file format is, so
9728c9fbc29Smrg	# first see if it will tell us. cd to the root directory to prevent
9738c9fbc29Smrg	# problems with other programs or directories called `ld' in the path.
9748c9fbc29Smrg	# Set LC_ALL=C to ensure ld outputs messages in English.
9758c9fbc29Smrg	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
9768c9fbc29Smrg			 | sed -ne '/supported targets:/!d
9778c9fbc29Smrg				    s/[ 	][ 	]*/ /g
9788c9fbc29Smrg				    s/.*supported targets: *//
9798c9fbc29Smrg				    s/ .*//
9808c9fbc29Smrg				    p'`
9818c9fbc29Smrg        case "$ld_supported_targets" in
9828c9fbc29Smrg	  elf32-i386)
9838c9fbc29Smrg		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
9848c9fbc29Smrg		;;
9858c9fbc29Smrg	  a.out-i386-linux)
9868c9fbc29Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
9878c9fbc29Smrg		exit ;;
9888c9fbc29Smrg	  coff-i386)
9898c9fbc29Smrg		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
9908c9fbc29Smrg		exit ;;
9918c9fbc29Smrg	  "")
9928c9fbc29Smrg		# Either a pre-BFD a.out linker (linux-gnuoldld) or
9938c9fbc29Smrg		# one that does not give us useful --help.
9948c9fbc29Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
9958c9fbc29Smrg		exit ;;
9968c9fbc29Smrg	esac
9978c9fbc29Smrg	# Determine whether the default compiler is a.out or elf
9988c9fbc29Smrg	eval $set_cc_for_build
9998c9fbc29Smrg	sed 's/^	//' << EOF >$dummy.c
10008c9fbc29Smrg	#include <features.h>
10018c9fbc29Smrg	#ifdef __ELF__
10028c9fbc29Smrg	# ifdef __GLIBC__
10038c9fbc29Smrg	#  if __GLIBC__ >= 2
10048c9fbc29Smrg	LIBC=gnu
10058c9fbc29Smrg	#  else
10068c9fbc29Smrg	LIBC=gnulibc1
10078c9fbc29Smrg	#  endif
10088c9fbc29Smrg	# else
10098c9fbc29Smrg	LIBC=gnulibc1
10108c9fbc29Smrg	# endif
10118c9fbc29Smrg	#else
10124e411241Smrg	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
10138c9fbc29Smrg	LIBC=gnu
10148c9fbc29Smrg	#else
10158c9fbc29Smrg	LIBC=gnuaout
10168c9fbc29Smrg	#endif
10178c9fbc29Smrg	#endif
10188c9fbc29Smrg	#ifdef __dietlibc__
10198c9fbc29Smrg	LIBC=dietlibc
10208c9fbc29Smrg	#endif
10218c9fbc29SmrgEOF
10224e411241Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
10234e411241Smrg	    /^LIBC/{
10244e411241Smrg		s: ::g
10254e411241Smrg		p
10264e411241Smrg	    }'`"
10278c9fbc29Smrg	test x"${LIBC}" != x && {
10288c9fbc29Smrg		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
10298c9fbc29Smrg		exit
10308c9fbc29Smrg	}
10318c9fbc29Smrg	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
10328c9fbc29Smrg	;;
10338c9fbc29Smrg    i*86:DYNIX/ptx:4*:*)
10348c9fbc29Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10358c9fbc29Smrg	# earlier versions are messed up and put the nodename in both
10368c9fbc29Smrg	# sysname and nodename.
10378c9fbc29Smrg	echo i386-sequent-sysv4
10388c9fbc29Smrg	exit ;;
10398c9fbc29Smrg    i*86:UNIX_SV:4.2MP:2.*)
10408c9fbc29Smrg        # Unixware is an offshoot of SVR4, but it has its own version
10418c9fbc29Smrg        # number series starting with 2...
10428c9fbc29Smrg        # I am not positive that other SVR4 systems won't match this,
10438c9fbc29Smrg	# I just have to hope.  -- rms.
10448c9fbc29Smrg        # Use sysv4.2uw... so that sysv4* matches it.
10458c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10468c9fbc29Smrg	exit ;;
10478c9fbc29Smrg    i*86:OS/2:*:*)
10488c9fbc29Smrg	# If we were able to find `uname', then EMX Unix compatibility
10498c9fbc29Smrg	# is probably installed.
10508c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
10518c9fbc29Smrg	exit ;;
10528c9fbc29Smrg    i*86:XTS-300:*:STOP)
10538c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-stop
10548c9fbc29Smrg	exit ;;
10558c9fbc29Smrg    i*86:atheos:*:*)
10568c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-atheos
10578c9fbc29Smrg	exit ;;
10588c9fbc29Smrg    i*86:syllable:*:*)
10598c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-syllable
10608c9fbc29Smrg	exit ;;
10618c9fbc29Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
10628c9fbc29Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10638c9fbc29Smrg	exit ;;
10648c9fbc29Smrg    i*86:*DOS:*:*)
10658c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10668c9fbc29Smrg	exit ;;
10678c9fbc29Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10688c9fbc29Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10698c9fbc29Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10708c9fbc29Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10718c9fbc29Smrg	else
10728c9fbc29Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10738c9fbc29Smrg	fi
10748c9fbc29Smrg	exit ;;
10758c9fbc29Smrg    i*86:*:5:[678]*)
10768c9fbc29Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10778c9fbc29Smrg	case `/bin/uname -X | grep "^Machine"` in
10788c9fbc29Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
10798c9fbc29Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
10808c9fbc29Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10818c9fbc29Smrg	esac
10828c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10838c9fbc29Smrg	exit ;;
10848c9fbc29Smrg    i*86:*:3.2:*)
10858c9fbc29Smrg	if test -f /usr/options/cb.name; then
10868c9fbc29Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
10878c9fbc29Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
10888c9fbc29Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
10898c9fbc29Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10908c9fbc29Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10918c9fbc29Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
10928c9fbc29Smrg			&& UNAME_MACHINE=i586
10938c9fbc29Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
10948c9fbc29Smrg			&& UNAME_MACHINE=i686
10958c9fbc29Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10968c9fbc29Smrg			&& UNAME_MACHINE=i686
10978c9fbc29Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
10988c9fbc29Smrg	else
10998c9fbc29Smrg		echo ${UNAME_MACHINE}-pc-sysv32
11008c9fbc29Smrg	fi
11018c9fbc29Smrg	exit ;;
11028c9fbc29Smrg    pc:*:*:*)
11038c9fbc29Smrg	# Left here for compatibility:
11048c9fbc29Smrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
11058c9fbc29Smrg        # the processor, so we play safe by assuming i386.
11068c9fbc29Smrg	echo i386-pc-msdosdjgpp
11078c9fbc29Smrg        exit ;;
11088c9fbc29Smrg    Intel:Mach:3*:*)
11098c9fbc29Smrg	echo i386-pc-mach3
11108c9fbc29Smrg	exit ;;
11118c9fbc29Smrg    paragon:*:*:*)
11128c9fbc29Smrg	echo i860-intel-osf1
11138c9fbc29Smrg	exit ;;
11148c9fbc29Smrg    i860:*:4.*:*) # i860-SVR4
11158c9fbc29Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
11168c9fbc29Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
11178c9fbc29Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
11188c9fbc29Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
11198c9fbc29Smrg	fi
11208c9fbc29Smrg	exit ;;
11218c9fbc29Smrg    mini*:CTIX:SYS*5:*)
11228c9fbc29Smrg	# "miniframe"
11238c9fbc29Smrg	echo m68010-convergent-sysv
11248c9fbc29Smrg	exit ;;
11258c9fbc29Smrg    mc68k:UNIX:SYSTEM5:3.51m)
11268c9fbc29Smrg	echo m68k-convergent-sysv
11278c9fbc29Smrg	exit ;;
11288c9fbc29Smrg    M680?0:D-NIX:5.3:*)
11298c9fbc29Smrg	echo m68k-diab-dnix
11308c9fbc29Smrg	exit ;;
11318c9fbc29Smrg    M68*:*:R3V[5678]*:*)
11328c9fbc29Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11338c9fbc29Smrg    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)
11348c9fbc29Smrg	OS_REL=''
11358c9fbc29Smrg	test -r /etc/.relid \
11368c9fbc29Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11378c9fbc29Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11388c9fbc29Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11398c9fbc29Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11408c9fbc29Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11418c9fbc29Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11428c9fbc29Smrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11438c9fbc29Smrg          && { echo i486-ncr-sysv4; exit; } ;;
11448c9fbc29Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11458c9fbc29Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11468c9fbc29Smrg	exit ;;
11478c9fbc29Smrg    mc68030:UNIX_System_V:4.*:*)
11488c9fbc29Smrg	echo m68k-atari-sysv4
11498c9fbc29Smrg	exit ;;
11508c9fbc29Smrg    TSUNAMI:LynxOS:2.*:*)
11518c9fbc29Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11528c9fbc29Smrg	exit ;;
11538c9fbc29Smrg    rs6000:LynxOS:2.*:*)
11548c9fbc29Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11558c9fbc29Smrg	exit ;;
11568c9fbc29Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
11578c9fbc29Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11588c9fbc29Smrg	exit ;;
11598c9fbc29Smrg    SM[BE]S:UNIX_SV:*:*)
11608c9fbc29Smrg	echo mips-dde-sysv${UNAME_RELEASE}
11618c9fbc29Smrg	exit ;;
11628c9fbc29Smrg    RM*:ReliantUNIX-*:*:*)
11638c9fbc29Smrg	echo mips-sni-sysv4
11648c9fbc29Smrg	exit ;;
11658c9fbc29Smrg    RM*:SINIX-*:*:*)
11668c9fbc29Smrg	echo mips-sni-sysv4
11678c9fbc29Smrg	exit ;;
11688c9fbc29Smrg    *:SINIX-*:*:*)
11698c9fbc29Smrg	if uname -p 2>/dev/null >/dev/null ; then
11708c9fbc29Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
11718c9fbc29Smrg		echo ${UNAME_MACHINE}-sni-sysv4
11728c9fbc29Smrg	else
11738c9fbc29Smrg		echo ns32k-sni-sysv
11748c9fbc29Smrg	fi
11758c9fbc29Smrg	exit ;;
11768c9fbc29Smrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
11778c9fbc29Smrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
11788c9fbc29Smrg        echo i586-unisys-sysv4
11798c9fbc29Smrg        exit ;;
11808c9fbc29Smrg    *:UNIX_System_V:4*:FTX*)
11818c9fbc29Smrg	# From Gerald Hewes <hewes@openmarket.com>.
11828c9fbc29Smrg	# How about differentiating between stratus architectures? -djm
11838c9fbc29Smrg	echo hppa1.1-stratus-sysv4
11848c9fbc29Smrg	exit ;;
11858c9fbc29Smrg    *:*:*:FTX*)
11868c9fbc29Smrg	# From seanf@swdc.stratus.com.
11878c9fbc29Smrg	echo i860-stratus-sysv4
11888c9fbc29Smrg	exit ;;
11898c9fbc29Smrg    i*86:VOS:*:*)
11908c9fbc29Smrg	# From Paul.Green@stratus.com.
11918c9fbc29Smrg	echo ${UNAME_MACHINE}-stratus-vos
11928c9fbc29Smrg	exit ;;
11938c9fbc29Smrg    *:VOS:*:*)
11948c9fbc29Smrg	# From Paul.Green@stratus.com.
11958c9fbc29Smrg	echo hppa1.1-stratus-vos
11968c9fbc29Smrg	exit ;;
11978c9fbc29Smrg    mc68*:A/UX:*:*)
11988c9fbc29Smrg	echo m68k-apple-aux${UNAME_RELEASE}
11998c9fbc29Smrg	exit ;;
12008c9fbc29Smrg    news*:NEWS-OS:6*:*)
12018c9fbc29Smrg	echo mips-sony-newsos6
12028c9fbc29Smrg	exit ;;
12038c9fbc29Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12048c9fbc29Smrg	if [ -d /usr/nec ]; then
12058c9fbc29Smrg	        echo mips-nec-sysv${UNAME_RELEASE}
12068c9fbc29Smrg	else
12078c9fbc29Smrg	        echo mips-unknown-sysv${UNAME_RELEASE}
12088c9fbc29Smrg	fi
12098c9fbc29Smrg        exit ;;
12108c9fbc29Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
12118c9fbc29Smrg	echo powerpc-be-beos
12128c9fbc29Smrg	exit ;;
12138c9fbc29Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
12148c9fbc29Smrg	echo powerpc-apple-beos
12158c9fbc29Smrg	exit ;;
12168c9fbc29Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
12178c9fbc29Smrg	echo i586-pc-beos
12188c9fbc29Smrg	exit ;;
12198c9fbc29Smrg    SX-4:SUPER-UX:*:*)
12208c9fbc29Smrg	echo sx4-nec-superux${UNAME_RELEASE}
12218c9fbc29Smrg	exit ;;
12228c9fbc29Smrg    SX-5:SUPER-UX:*:*)
12238c9fbc29Smrg	echo sx5-nec-superux${UNAME_RELEASE}
12248c9fbc29Smrg	exit ;;
12258c9fbc29Smrg    SX-6:SUPER-UX:*:*)
12268c9fbc29Smrg	echo sx6-nec-superux${UNAME_RELEASE}
12278c9fbc29Smrg	exit ;;
12284e411241Smrg    SX-7:SUPER-UX:*:*)
12294e411241Smrg	echo sx7-nec-superux${UNAME_RELEASE}
12304e411241Smrg	exit ;;
12314e411241Smrg    SX-8:SUPER-UX:*:*)
12324e411241Smrg	echo sx8-nec-superux${UNAME_RELEASE}
12334e411241Smrg	exit ;;
12344e411241Smrg    SX-8R:SUPER-UX:*:*)
12354e411241Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
12364e411241Smrg	exit ;;
12378c9fbc29Smrg    Power*:Rhapsody:*:*)
12388c9fbc29Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12398c9fbc29Smrg	exit ;;
12408c9fbc29Smrg    *:Rhapsody:*:*)
12418c9fbc29Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12428c9fbc29Smrg	exit ;;
12438c9fbc29Smrg    *:Darwin:*:*)
12448c9fbc29Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12458c9fbc29Smrg	case $UNAME_PROCESSOR in
12468c9fbc29Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
12478c9fbc29Smrg	esac
12488c9fbc29Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12498c9fbc29Smrg	exit ;;
12508c9fbc29Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
12518c9fbc29Smrg	UNAME_PROCESSOR=`uname -p`
12528c9fbc29Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
12538c9fbc29Smrg		UNAME_PROCESSOR=i386
12548c9fbc29Smrg		UNAME_MACHINE=pc
12558c9fbc29Smrg	fi
12568c9fbc29Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
12578c9fbc29Smrg	exit ;;
12588c9fbc29Smrg    *:QNX:*:4*)
12598c9fbc29Smrg	echo i386-pc-qnx
12608c9fbc29Smrg	exit ;;
12618c9fbc29Smrg    NSE-?:NONSTOP_KERNEL:*:*)
12628c9fbc29Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
12638c9fbc29Smrg	exit ;;
12648c9fbc29Smrg    NSR-?:NONSTOP_KERNEL:*:*)
12658c9fbc29Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
12668c9fbc29Smrg	exit ;;
12678c9fbc29Smrg    *:NonStop-UX:*:*)
12688c9fbc29Smrg	echo mips-compaq-nonstopux
12698c9fbc29Smrg	exit ;;
12708c9fbc29Smrg    BS2000:POSIX*:*:*)
12718c9fbc29Smrg	echo bs2000-siemens-sysv
12728c9fbc29Smrg	exit ;;
12738c9fbc29Smrg    DS/*:UNIX_System_V:*:*)
12748c9fbc29Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
12758c9fbc29Smrg	exit ;;
12768c9fbc29Smrg    *:Plan9:*:*)
12778c9fbc29Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
12788c9fbc29Smrg	# is converted to i386 for consistency with other x86
12798c9fbc29Smrg	# operating systems.
12808c9fbc29Smrg	if test "$cputype" = "386"; then
12818c9fbc29Smrg	    UNAME_MACHINE=i386
12828c9fbc29Smrg	else
12838c9fbc29Smrg	    UNAME_MACHINE="$cputype"
12848c9fbc29Smrg	fi
12858c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-plan9
12868c9fbc29Smrg	exit ;;
12878c9fbc29Smrg    *:TOPS-10:*:*)
12888c9fbc29Smrg	echo pdp10-unknown-tops10
12898c9fbc29Smrg	exit ;;
12908c9fbc29Smrg    *:TENEX:*:*)
12918c9fbc29Smrg	echo pdp10-unknown-tenex
12928c9fbc29Smrg	exit ;;
12938c9fbc29Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
12948c9fbc29Smrg	echo pdp10-dec-tops20
12958c9fbc29Smrg	exit ;;
12968c9fbc29Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
12978c9fbc29Smrg	echo pdp10-xkl-tops20
12988c9fbc29Smrg	exit ;;
12998c9fbc29Smrg    *:TOPS-20:*:*)
13008c9fbc29Smrg	echo pdp10-unknown-tops20
13018c9fbc29Smrg	exit ;;
13028c9fbc29Smrg    *:ITS:*:*)
13038c9fbc29Smrg	echo pdp10-unknown-its
13048c9fbc29Smrg	exit ;;
13058c9fbc29Smrg    SEI:*:*:SEIUX)
13068c9fbc29Smrg        echo mips-sei-seiux${UNAME_RELEASE}
13078c9fbc29Smrg	exit ;;
13088c9fbc29Smrg    *:DragonFly:*:*)
13098c9fbc29Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13108c9fbc29Smrg	exit ;;
13118c9fbc29Smrg    *:*VMS:*:*)
13128c9fbc29Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13138c9fbc29Smrg	case "${UNAME_MACHINE}" in
13148c9fbc29Smrg	    A*) echo alpha-dec-vms ; exit ;;
13158c9fbc29Smrg	    I*) echo ia64-dec-vms ; exit ;;
13168c9fbc29Smrg	    V*) echo vax-dec-vms ; exit ;;
13178c9fbc29Smrg	esac ;;
13188c9fbc29Smrg    *:XENIX:*:SysV)
13198c9fbc29Smrg	echo i386-pc-xenix
13208c9fbc29Smrg	exit ;;
13218c9fbc29Smrg    i*86:skyos:*:*)
13228c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13238c9fbc29Smrg	exit ;;
13248c9fbc29Smrg    i*86:rdos:*:*)
13258c9fbc29Smrg	echo ${UNAME_MACHINE}-pc-rdos
13268c9fbc29Smrg	exit ;;
13278c9fbc29Smrgesac
13288c9fbc29Smrg
13298c9fbc29Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
13308c9fbc29Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
13318c9fbc29Smrg
13328c9fbc29Smrgeval $set_cc_for_build
13338c9fbc29Smrgcat >$dummy.c <<EOF
13348c9fbc29Smrg#ifdef _SEQUENT_
13358c9fbc29Smrg# include <sys/types.h>
13368c9fbc29Smrg# include <sys/utsname.h>
13378c9fbc29Smrg#endif
13388c9fbc29Smrgmain ()
13398c9fbc29Smrg{
13408c9fbc29Smrg#if defined (sony)
13418c9fbc29Smrg#if defined (MIPSEB)
13428c9fbc29Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
13438c9fbc29Smrg     I don't know....  */
13448c9fbc29Smrg  printf ("mips-sony-bsd\n"); exit (0);
13458c9fbc29Smrg#else
13468c9fbc29Smrg#include <sys/param.h>
13478c9fbc29Smrg  printf ("m68k-sony-newsos%s\n",
13488c9fbc29Smrg#ifdef NEWSOS4
13498c9fbc29Smrg          "4"
13508c9fbc29Smrg#else
13518c9fbc29Smrg	  ""
13528c9fbc29Smrg#endif
13538c9fbc29Smrg         ); exit (0);
13548c9fbc29Smrg#endif
13558c9fbc29Smrg#endif
13568c9fbc29Smrg
13578c9fbc29Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
13588c9fbc29Smrg  printf ("arm-acorn-riscix\n"); exit (0);
13598c9fbc29Smrg#endif
13608c9fbc29Smrg
13618c9fbc29Smrg#if defined (hp300) && !defined (hpux)
13628c9fbc29Smrg  printf ("m68k-hp-bsd\n"); exit (0);
13638c9fbc29Smrg#endif
13648c9fbc29Smrg
13658c9fbc29Smrg#if defined (NeXT)
13668c9fbc29Smrg#if !defined (__ARCHITECTURE__)
13678c9fbc29Smrg#define __ARCHITECTURE__ "m68k"
13688c9fbc29Smrg#endif
13698c9fbc29Smrg  int version;
13708c9fbc29Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
13718c9fbc29Smrg  if (version < 4)
13728c9fbc29Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
13738c9fbc29Smrg  else
13748c9fbc29Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
13758c9fbc29Smrg  exit (0);
13768c9fbc29Smrg#endif
13778c9fbc29Smrg
13788c9fbc29Smrg#if defined (MULTIMAX) || defined (n16)
13798c9fbc29Smrg#if defined (UMAXV)
13808c9fbc29Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
13818c9fbc29Smrg#else
13828c9fbc29Smrg#if defined (CMU)
13838c9fbc29Smrg  printf ("ns32k-encore-mach\n"); exit (0);
13848c9fbc29Smrg#else
13858c9fbc29Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
13868c9fbc29Smrg#endif
13878c9fbc29Smrg#endif
13888c9fbc29Smrg#endif
13898c9fbc29Smrg
13908c9fbc29Smrg#if defined (__386BSD__)
13918c9fbc29Smrg  printf ("i386-pc-bsd\n"); exit (0);
13928c9fbc29Smrg#endif
13938c9fbc29Smrg
13948c9fbc29Smrg#if defined (sequent)
13958c9fbc29Smrg#if defined (i386)
13968c9fbc29Smrg  printf ("i386-sequent-dynix\n"); exit (0);
13978c9fbc29Smrg#endif
13988c9fbc29Smrg#if defined (ns32000)
13998c9fbc29Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
14008c9fbc29Smrg#endif
14018c9fbc29Smrg#endif
14028c9fbc29Smrg
14038c9fbc29Smrg#if defined (_SEQUENT_)
14048c9fbc29Smrg    struct utsname un;
14058c9fbc29Smrg
14068c9fbc29Smrg    uname(&un);
14078c9fbc29Smrg
14088c9fbc29Smrg    if (strncmp(un.version, "V2", 2) == 0) {
14098c9fbc29Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
14108c9fbc29Smrg    }
14118c9fbc29Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
14128c9fbc29Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
14138c9fbc29Smrg    }
14148c9fbc29Smrg    printf ("i386-sequent-ptx\n"); exit (0);
14158c9fbc29Smrg
14168c9fbc29Smrg#endif
14178c9fbc29Smrg
14188c9fbc29Smrg#if defined (vax)
14198c9fbc29Smrg# if !defined (ultrix)
14208c9fbc29Smrg#  include <sys/param.h>
14218c9fbc29Smrg#  if defined (BSD)
14228c9fbc29Smrg#   if BSD == 43
14238c9fbc29Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
14248c9fbc29Smrg#   else
14258c9fbc29Smrg#    if BSD == 199006
14268c9fbc29Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
14278c9fbc29Smrg#    else
14288c9fbc29Smrg      printf ("vax-dec-bsd\n"); exit (0);
14298c9fbc29Smrg#    endif
14308c9fbc29Smrg#   endif
14318c9fbc29Smrg#  else
14328c9fbc29Smrg    printf ("vax-dec-bsd\n"); exit (0);
14338c9fbc29Smrg#  endif
14348c9fbc29Smrg# else
14358c9fbc29Smrg    printf ("vax-dec-ultrix\n"); exit (0);
14368c9fbc29Smrg# endif
14378c9fbc29Smrg#endif
14388c9fbc29Smrg
14398c9fbc29Smrg#if defined (alliant) && defined (i860)
14408c9fbc29Smrg  printf ("i860-alliant-bsd\n"); exit (0);
14418c9fbc29Smrg#endif
14428c9fbc29Smrg
14438c9fbc29Smrg  exit (1);
14448c9fbc29Smrg}
14458c9fbc29SmrgEOF
14468c9fbc29Smrg
14478c9fbc29Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
14488c9fbc29Smrg	{ echo "$SYSTEM_NAME"; exit; }
14498c9fbc29Smrg
14508c9fbc29Smrg# Apollos put the system type in the environment.
14518c9fbc29Smrg
14528c9fbc29Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
14538c9fbc29Smrg
14548c9fbc29Smrg# Convex versions that predate uname can use getsysinfo(1)
14558c9fbc29Smrg
14568c9fbc29Smrgif [ -x /usr/convex/getsysinfo ]
14578c9fbc29Smrgthen
14588c9fbc29Smrg    case `getsysinfo -f cpu_type` in
14598c9fbc29Smrg    c1*)
14608c9fbc29Smrg	echo c1-convex-bsd
14618c9fbc29Smrg	exit ;;
14628c9fbc29Smrg    c2*)
14638c9fbc29Smrg	if getsysinfo -f scalar_acc
14648c9fbc29Smrg	then echo c32-convex-bsd
14658c9fbc29Smrg	else echo c2-convex-bsd
14668c9fbc29Smrg	fi
14678c9fbc29Smrg	exit ;;
14688c9fbc29Smrg    c34*)
14698c9fbc29Smrg	echo c34-convex-bsd
14708c9fbc29Smrg	exit ;;
14718c9fbc29Smrg    c38*)
14728c9fbc29Smrg	echo c38-convex-bsd
14738c9fbc29Smrg	exit ;;
14748c9fbc29Smrg    c4*)
14758c9fbc29Smrg	echo c4-convex-bsd
14768c9fbc29Smrg	exit ;;
14778c9fbc29Smrg    esac
14788c9fbc29Smrgfi
14798c9fbc29Smrg
14808c9fbc29Smrgcat >&2 <<EOF
14818c9fbc29Smrg$0: unable to guess system type
14828c9fbc29Smrg
14838c9fbc29SmrgThis script, last modified $timestamp, has failed to recognize
14848c9fbc29Smrgthe operating system you are using. It is advised that you
14858c9fbc29Smrgdownload the most up to date version of the config scripts from
14868c9fbc29Smrg
14874e411241Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
14888c9fbc29Smrgand
14894e411241Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
14908c9fbc29Smrg
14918c9fbc29SmrgIf the version you run ($0) is already up to date, please
14928c9fbc29Smrgsend the following data and any information you think might be
14938c9fbc29Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
14948c9fbc29Smrginformation to handle your system.
14958c9fbc29Smrg
14968c9fbc29Smrgconfig.guess timestamp = $timestamp
14978c9fbc29Smrg
14988c9fbc29Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
14998c9fbc29Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
15008c9fbc29Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
15018c9fbc29Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
15028c9fbc29Smrg
15038c9fbc29Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
15048c9fbc29Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
15058c9fbc29Smrg
15068c9fbc29Smrghostinfo               = `(hostinfo) 2>/dev/null`
15078c9fbc29Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
15088c9fbc29Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
15098c9fbc29Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
15108c9fbc29Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
15118c9fbc29Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
15128c9fbc29Smrg
15138c9fbc29SmrgUNAME_MACHINE = ${UNAME_MACHINE}
15148c9fbc29SmrgUNAME_RELEASE = ${UNAME_RELEASE}
15158c9fbc29SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
15168c9fbc29SmrgUNAME_VERSION = ${UNAME_VERSION}
15178c9fbc29SmrgEOF
15188c9fbc29Smrg
15198c9fbc29Smrgexit 1
15208c9fbc29Smrg
15218c9fbc29Smrg# Local variables:
15228c9fbc29Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
15238c9fbc29Smrg# time-stamp-start: "timestamp='"
15248c9fbc29Smrg# time-stamp-format: "%:y-%02m-%02d"
15258c9fbc29Smrg# time-stamp-end: "'"
15268c9fbc29Smrg# End:
1527