config.guess revision 63165362
10eb10989Smrg#! /bin/sh
20eb10989Smrg# Attempt to guess a canonical system name.
30eb10989Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
463165362Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
563165362Smrg#   Free Software Foundation, Inc.
60eb10989Smrg
763165362Smrgtimestamp='2009-04-27'
80eb10989Smrg
90eb10989Smrg# This file is free software; you can redistribute it and/or modify it
100eb10989Smrg# under the terms of the GNU General Public License as published by
110eb10989Smrg# the Free Software Foundation; either version 2 of the License, or
120eb10989Smrg# (at your option) any later version.
130eb10989Smrg#
140eb10989Smrg# This program is distributed in the hope that it will be useful, but
150eb10989Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
160eb10989Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
170eb10989Smrg# General Public License for more details.
180eb10989Smrg#
190eb10989Smrg# You should have received a copy of the GNU General Public License
200eb10989Smrg# along with this program; if not, write to the Free Software
2163165362Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2263165362Smrg# 02110-1301, USA.
230eb10989Smrg#
240eb10989Smrg# As a special exception to the GNU General Public License, if you
250eb10989Smrg# distribute this file as part of a program that contains a
260eb10989Smrg# configuration script generated by Autoconf, you may include it under
270eb10989Smrg# the same distribution terms that you use for the rest of that program.
280eb10989Smrg
2963165362Smrg
300eb10989Smrg# Originally written by Per Bothner <per@bothner.com>.
310eb10989Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
320eb10989Smrg# diff and a properly formatted ChangeLog entry.
330eb10989Smrg#
340eb10989Smrg# This script attempts to guess a canonical system name similar to
350eb10989Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
360eb10989Smrg# exits with 0.  Otherwise, it exits with 1.
370eb10989Smrg#
380eb10989Smrg# The plan is that this can be called by configure scripts if you
390eb10989Smrg# don't specify an explicit build system type.
400eb10989Smrg
410eb10989Smrgme=`echo "$0" | sed -e 's,.*/,,'`
420eb10989Smrg
430eb10989Smrgusage="\
440eb10989SmrgUsage: $0 [OPTION]
450eb10989Smrg
460eb10989SmrgOutput the configuration name of the system \`$me' is run on.
470eb10989Smrg
480eb10989SmrgOperation modes:
490eb10989Smrg  -h, --help         print this help, then exit
500eb10989Smrg  -t, --time-stamp   print date of last modification, then exit
510eb10989Smrg  -v, --version      print version number, then exit
520eb10989Smrg
530eb10989SmrgReport bugs and patches to <config-patches@gnu.org>."
540eb10989Smrg
550eb10989Smrgversion="\
560eb10989SmrgGNU config.guess ($timestamp)
570eb10989Smrg
580eb10989SmrgOriginally written by Per Bothner.
5963165362SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
6063165362Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
610eb10989Smrg
620eb10989SmrgThis is free software; see the source for copying conditions.  There is NO
630eb10989Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
640eb10989Smrg
650eb10989Smrghelp="
660eb10989SmrgTry \`$me --help' for more information."
670eb10989Smrg
680eb10989Smrg# Parse command line
690eb10989Smrgwhile test $# -gt 0 ; do
700eb10989Smrg  case $1 in
710eb10989Smrg    --time-stamp | --time* | -t )
7263165362Smrg       echo "$timestamp" ; exit ;;
730eb10989Smrg    --version | -v )
7463165362Smrg       echo "$version" ; exit ;;
750eb10989Smrg    --help | --h* | -h )
7663165362Smrg       echo "$usage"; exit ;;
770eb10989Smrg    -- )     # Stop option processing
780eb10989Smrg       shift; break ;;
790eb10989Smrg    - )	# Use stdin as input.
800eb10989Smrg       break ;;
810eb10989Smrg    -* )
820eb10989Smrg       echo "$me: invalid option $1$help" >&2
830eb10989Smrg       exit 1 ;;
840eb10989Smrg    * )
850eb10989Smrg       break ;;
860eb10989Smrg  esac
870eb10989Smrgdone
880eb10989Smrg
890eb10989Smrgif test $# != 0; then
900eb10989Smrg  echo "$me: too many arguments$help" >&2
910eb10989Smrg  exit 1
920eb10989Smrgfi
930eb10989Smrg
940eb10989Smrgtrap 'exit 1' 1 2 15
950eb10989Smrg
960eb10989Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
970eb10989Smrg# compiler to aid in system detection is discouraged as it requires
980eb10989Smrg# temporary files to be created and, as you can see below, it is a
990eb10989Smrg# headache to deal with in a portable fashion.
1000eb10989Smrg
1010eb10989Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
1020eb10989Smrg# use `HOST_CC' if defined, but it is deprecated.
1030eb10989Smrg
1040eb10989Smrg# Portable tmp directory creation inspired by the Autoconf team.
1050eb10989Smrg
1060eb10989Smrgset_cc_for_build='
1070eb10989Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1080eb10989Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1090eb10989Smrg: ${TMPDIR=/tmp} ;
11063165362Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1110eb10989Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1120eb10989Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1130eb10989Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1140eb10989Smrgdummy=$tmp/dummy ;
1150eb10989Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1160eb10989Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1170eb10989Smrg ,,)    echo "int x;" > $dummy.c ;
1180eb10989Smrg	for c in cc gcc c89 c99 ; do
1190eb10989Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1200eb10989Smrg	     CC_FOR_BUILD="$c"; break ;
1210eb10989Smrg	  fi ;
1220eb10989Smrg	done ;
1230eb10989Smrg	if test x"$CC_FOR_BUILD" = x ; then
1240eb10989Smrg	  CC_FOR_BUILD=no_compiler_found ;
1250eb10989Smrg	fi
1260eb10989Smrg	;;
1270eb10989Smrg ,,*)   CC_FOR_BUILD=$CC ;;
1280eb10989Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
12963165362Smrgesac ; set_cc_for_build= ;'
1300eb10989Smrg
1310eb10989Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1320eb10989Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
1330eb10989Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1340eb10989Smrg	PATH=$PATH:/.attbin ; export PATH
1350eb10989Smrgfi
1360eb10989Smrg
1370eb10989SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1380eb10989SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1390eb10989SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1400eb10989SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1410eb10989Smrg
1420eb10989Smrg# Note: order is significant - the case branches are not exclusive.
1430eb10989Smrg
1440eb10989Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1450eb10989Smrg    *:NetBSD:*:*)
1460eb10989Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
1470eb10989Smrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
1480eb10989Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1490eb10989Smrg	# switched to ELF, *-*-netbsd* would select the old
1500eb10989Smrg	# object file format.  This provides both forward
1510eb10989Smrg	# compatibility and a consistent mechanism for selecting the
1520eb10989Smrg	# object file format.
1530eb10989Smrg	#
1540eb10989Smrg	# Note: NetBSD doesn't particularly care about the vendor
1550eb10989Smrg	# portion of the name.  We always set it to "unknown".
1560eb10989Smrg	sysctl="sysctl -n hw.machine_arch"
1570eb10989Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1580eb10989Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1590eb10989Smrg	case "${UNAME_MACHINE_ARCH}" in
1600eb10989Smrg	    armeb) machine=armeb-unknown ;;
1610eb10989Smrg	    arm*) machine=arm-unknown ;;
1620eb10989Smrg	    sh3el) machine=shl-unknown ;;
1630eb10989Smrg	    sh3eb) machine=sh-unknown ;;
1640eb10989Smrg	    sh5el) machine=sh5le-unknown ;;
1650eb10989Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1660eb10989Smrg	esac
1670eb10989Smrg	# The Operating System including object format, if it has switched
1680eb10989Smrg	# to ELF recently, or will in the future.
1690eb10989Smrg	case "${UNAME_MACHINE_ARCH}" in
1700eb10989Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1710eb10989Smrg		eval $set_cc_for_build
1720eb10989Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1730eb10989Smrg			| grep __ELF__ >/dev/null
1740eb10989Smrg		then
1750eb10989Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1760eb10989Smrg		    # Return netbsd for either.  FIX?
1770eb10989Smrg		    os=netbsd
1780eb10989Smrg		else
1790eb10989Smrg		    os=netbsdelf
1800eb10989Smrg		fi
1810eb10989Smrg		;;
1820eb10989Smrg	    *)
1830eb10989Smrg	        os=netbsd
1840eb10989Smrg		;;
1850eb10989Smrg	esac
1860eb10989Smrg	# The OS release
1870eb10989Smrg	# Debian GNU/NetBSD machines have a different userland, and
1880eb10989Smrg	# thus, need a distinct triplet. However, they do not need
1890eb10989Smrg	# kernel version information, so it can be replaced with a
1900eb10989Smrg	# suitable tag, in the style of linux-gnu.
1910eb10989Smrg	case "${UNAME_VERSION}" in
1920eb10989Smrg	    Debian*)
1930eb10989Smrg		release='-gnu'
1940eb10989Smrg		;;
1950eb10989Smrg	    *)
1960eb10989Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
1970eb10989Smrg		;;
1980eb10989Smrg	esac
1990eb10989Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2000eb10989Smrg	# contains redundant information, the shorter form:
2010eb10989Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2020eb10989Smrg	echo "${machine}-${os}${release}"
20363165362Smrg	exit ;;
2040eb10989Smrg    *:OpenBSD:*:*)
20563165362Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
20663165362Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
20763165362Smrg	exit ;;
2080eb10989Smrg    *:ekkoBSD:*:*)
2090eb10989Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
21063165362Smrg	exit ;;
21163165362Smrg    *:SolidBSD:*:*)
21263165362Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
21363165362Smrg	exit ;;
2140eb10989Smrg    macppc:MirBSD:*:*)
21563165362Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
21663165362Smrg	exit ;;
2170eb10989Smrg    *:MirBSD:*:*)
2180eb10989Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
21963165362Smrg	exit ;;
2200eb10989Smrg    alpha:OSF1:*:*)
2210eb10989Smrg	case $UNAME_RELEASE in
2220eb10989Smrg	*4.0)
2230eb10989Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2240eb10989Smrg		;;
2250eb10989Smrg	*5.*)
2260eb10989Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2270eb10989Smrg		;;
2280eb10989Smrg	esac
2290eb10989Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2300eb10989Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2310eb10989Smrg	# covers most systems running today.  This code pipes the CPU
2320eb10989Smrg	# types through head -n 1, so we only detect the type of CPU 0.
2330eb10989Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2340eb10989Smrg	case "$ALPHA_CPU_TYPE" in
2350eb10989Smrg	    "EV4 (21064)")
2360eb10989Smrg		UNAME_MACHINE="alpha" ;;
2370eb10989Smrg	    "EV4.5 (21064)")
2380eb10989Smrg		UNAME_MACHINE="alpha" ;;
2390eb10989Smrg	    "LCA4 (21066/21068)")
2400eb10989Smrg		UNAME_MACHINE="alpha" ;;
2410eb10989Smrg	    "EV5 (21164)")
2420eb10989Smrg		UNAME_MACHINE="alphaev5" ;;
2430eb10989Smrg	    "EV5.6 (21164A)")
2440eb10989Smrg		UNAME_MACHINE="alphaev56" ;;
2450eb10989Smrg	    "EV5.6 (21164PC)")
2460eb10989Smrg		UNAME_MACHINE="alphapca56" ;;
2470eb10989Smrg	    "EV5.7 (21164PC)")
2480eb10989Smrg		UNAME_MACHINE="alphapca57" ;;
2490eb10989Smrg	    "EV6 (21264)")
2500eb10989Smrg		UNAME_MACHINE="alphaev6" ;;
2510eb10989Smrg	    "EV6.7 (21264A)")
2520eb10989Smrg		UNAME_MACHINE="alphaev67" ;;
2530eb10989Smrg	    "EV6.8CB (21264C)")
2540eb10989Smrg		UNAME_MACHINE="alphaev68" ;;
2550eb10989Smrg	    "EV6.8AL (21264B)")
2560eb10989Smrg		UNAME_MACHINE="alphaev68" ;;
2570eb10989Smrg	    "EV6.8CX (21264D)")
2580eb10989Smrg		UNAME_MACHINE="alphaev68" ;;
2590eb10989Smrg	    "EV6.9A (21264/EV69A)")
2600eb10989Smrg		UNAME_MACHINE="alphaev69" ;;
2610eb10989Smrg	    "EV7 (21364)")
2620eb10989Smrg		UNAME_MACHINE="alphaev7" ;;
2630eb10989Smrg	    "EV7.9 (21364A)")
2640eb10989Smrg		UNAME_MACHINE="alphaev79" ;;
2650eb10989Smrg	esac
2660eb10989Smrg	# A Pn.n version is a patched version.
2670eb10989Smrg	# A Vn.n version is a released version.
2680eb10989Smrg	# A Tn.n version is a released field test version.
2690eb10989Smrg	# A Xn.n version is an unreleased experimental baselevel.
2700eb10989Smrg	# 1.2 uses "1.2" for uname -r.
2710eb10989Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
27263165362Smrg	exit ;;
2730eb10989Smrg    Alpha\ *:Windows_NT*:*)
2740eb10989Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
2750eb10989Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
2760eb10989Smrg	# of the specific Alpha model?
2770eb10989Smrg	echo alpha-pc-interix
27863165362Smrg	exit ;;
2790eb10989Smrg    21064:Windows_NT:50:3)
2800eb10989Smrg	echo alpha-dec-winnt3.5
28163165362Smrg	exit ;;
2820eb10989Smrg    Amiga*:UNIX_System_V:4.0:*)
2830eb10989Smrg	echo m68k-unknown-sysv4
28463165362Smrg	exit ;;
2850eb10989Smrg    *:[Aa]miga[Oo][Ss]:*:*)
2860eb10989Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
28763165362Smrg	exit ;;
2880eb10989Smrg    *:[Mm]orph[Oo][Ss]:*:*)
2890eb10989Smrg	echo ${UNAME_MACHINE}-unknown-morphos
29063165362Smrg	exit ;;
2910eb10989Smrg    *:OS/390:*:*)
2920eb10989Smrg	echo i370-ibm-openedition
29363165362Smrg	exit ;;
29463165362Smrg    *:z/VM:*:*)
29563165362Smrg	echo s390-ibm-zvmoe
29663165362Smrg	exit ;;
2970eb10989Smrg    *:OS400:*:*)
2980eb10989Smrg        echo powerpc-ibm-os400
29963165362Smrg	exit ;;
3000eb10989Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3010eb10989Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
30263165362Smrg	exit ;;
30363165362Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
30463165362Smrg	echo arm-unknown-riscos
30563165362Smrg	exit ;;
3060eb10989Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3070eb10989Smrg	echo hppa1.1-hitachi-hiuxmpp
30863165362Smrg	exit ;;
3090eb10989Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3100eb10989Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3110eb10989Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3120eb10989Smrg		echo pyramid-pyramid-sysv3
3130eb10989Smrg	else
3140eb10989Smrg		echo pyramid-pyramid-bsd
3150eb10989Smrg	fi
31663165362Smrg	exit ;;
3170eb10989Smrg    NILE*:*:*:dcosx)
3180eb10989Smrg	echo pyramid-pyramid-svr4
31963165362Smrg	exit ;;
3200eb10989Smrg    DRS?6000:unix:4.0:6*)
3210eb10989Smrg	echo sparc-icl-nx6
32263165362Smrg	exit ;;
32363165362Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3240eb10989Smrg	case `/usr/bin/uname -p` in
32563165362Smrg	    sparc) echo sparc-icl-nx7; exit ;;
3260eb10989Smrg	esac ;;
32763165362Smrg    s390x:SunOS:*:*)
32863165362Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
32963165362Smrg	exit ;;
3300eb10989Smrg    sun4H:SunOS:5.*:*)
3310eb10989Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
33263165362Smrg	exit ;;
3330eb10989Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3340eb10989Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
33563165362Smrg	exit ;;
33663165362Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
33763165362Smrg	eval $set_cc_for_build
33863165362Smrg	SUN_ARCH="i386"
33963165362Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
34063165362Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
34163165362Smrg	# This test works for both compilers.
34263165362Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
34363165362Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
34463165362Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
34563165362Smrg		grep IS_64BIT_ARCH >/dev/null
34663165362Smrg	    then
34763165362Smrg		SUN_ARCH="x86_64"
34863165362Smrg	    fi
34963165362Smrg	fi
35063165362Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
35163165362Smrg	exit ;;
3520eb10989Smrg    sun4*:SunOS:6*:*)
3530eb10989Smrg	# According to config.sub, this is the proper way to canonicalize
3540eb10989Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3550eb10989Smrg	# it's likely to be more like Solaris than SunOS4.
3560eb10989Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
35763165362Smrg	exit ;;
3580eb10989Smrg    sun4*:SunOS:*:*)
3590eb10989Smrg	case "`/usr/bin/arch -k`" in
3600eb10989Smrg	    Series*|S4*)
3610eb10989Smrg		UNAME_RELEASE=`uname -v`
3620eb10989Smrg		;;
3630eb10989Smrg	esac
3640eb10989Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
3650eb10989Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
36663165362Smrg	exit ;;
3670eb10989Smrg    sun3*:SunOS:*:*)
3680eb10989Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
36963165362Smrg	exit ;;
3700eb10989Smrg    sun*:*:4.2BSD:*)
3710eb10989Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3720eb10989Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
3730eb10989Smrg	case "`/bin/arch`" in
3740eb10989Smrg	    sun3)
3750eb10989Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
3760eb10989Smrg		;;
3770eb10989Smrg	    sun4)
3780eb10989Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
3790eb10989Smrg		;;
3800eb10989Smrg	esac
38163165362Smrg	exit ;;
3820eb10989Smrg    aushp:SunOS:*:*)
3830eb10989Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
38463165362Smrg	exit ;;
3850eb10989Smrg    # The situation for MiNT is a little confusing.  The machine name
3860eb10989Smrg    # can be virtually everything (everything which is not
3870eb10989Smrg    # "atarist" or "atariste" at least should have a processor
3880eb10989Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
3890eb10989Smrg    # to the lowercase version "mint" (or "freemint").  Finally
3900eb10989Smrg    # the system name "TOS" denotes a system which is actually not
3910eb10989Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
3920eb10989Smrg    # be no problem.
3930eb10989Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
3940eb10989Smrg        echo m68k-atari-mint${UNAME_RELEASE}
39563165362Smrg	exit ;;
3960eb10989Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
3970eb10989Smrg	echo m68k-atari-mint${UNAME_RELEASE}
39863165362Smrg        exit ;;
3990eb10989Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4000eb10989Smrg        echo m68k-atari-mint${UNAME_RELEASE}
40163165362Smrg	exit ;;
4020eb10989Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4030eb10989Smrg        echo m68k-milan-mint${UNAME_RELEASE}
40463165362Smrg        exit ;;
4050eb10989Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4060eb10989Smrg        echo m68k-hades-mint${UNAME_RELEASE}
40763165362Smrg        exit ;;
4080eb10989Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4090eb10989Smrg        echo m68k-unknown-mint${UNAME_RELEASE}
41063165362Smrg        exit ;;
4110eb10989Smrg    m68k:machten:*:*)
4120eb10989Smrg	echo m68k-apple-machten${UNAME_RELEASE}
41363165362Smrg	exit ;;
4140eb10989Smrg    powerpc:machten:*:*)
4150eb10989Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
41663165362Smrg	exit ;;
4170eb10989Smrg    RISC*:Mach:*:*)
4180eb10989Smrg	echo mips-dec-mach_bsd4.3
41963165362Smrg	exit ;;
4200eb10989Smrg    RISC*:ULTRIX:*:*)
4210eb10989Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
42263165362Smrg	exit ;;
4230eb10989Smrg    VAX*:ULTRIX*:*:*)
4240eb10989Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
42563165362Smrg	exit ;;
4260eb10989Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4270eb10989Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
42863165362Smrg	exit ;;
4290eb10989Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4300eb10989Smrg	eval $set_cc_for_build
4310eb10989Smrg	sed 's/^	//' << EOF >$dummy.c
4320eb10989Smrg#ifdef __cplusplus
4330eb10989Smrg#include <stdio.h>  /* for printf() prototype */
4340eb10989Smrg	int main (int argc, char *argv[]) {
4350eb10989Smrg#else
4360eb10989Smrg	int main (argc, argv) int argc; char *argv[]; {
4370eb10989Smrg#endif
4380eb10989Smrg	#if defined (host_mips) && defined (MIPSEB)
4390eb10989Smrg	#if defined (SYSTYPE_SYSV)
4400eb10989Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4410eb10989Smrg	#endif
4420eb10989Smrg	#if defined (SYSTYPE_SVR4)
4430eb10989Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4440eb10989Smrg	#endif
4450eb10989Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4460eb10989Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4470eb10989Smrg	#endif
4480eb10989Smrg	#endif
4490eb10989Smrg	  exit (-1);
4500eb10989Smrg	}
4510eb10989SmrgEOF
45263165362Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
45363165362Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
45463165362Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
45563165362Smrg	    { echo "$SYSTEM_NAME"; exit; }
4560eb10989Smrg	echo mips-mips-riscos${UNAME_RELEASE}
45763165362Smrg	exit ;;
4580eb10989Smrg    Motorola:PowerMAX_OS:*:*)
4590eb10989Smrg	echo powerpc-motorola-powermax
46063165362Smrg	exit ;;
4610eb10989Smrg    Motorola:*:4.3:PL8-*)
4620eb10989Smrg	echo powerpc-harris-powermax
46363165362Smrg	exit ;;
4640eb10989Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4650eb10989Smrg	echo powerpc-harris-powermax
46663165362Smrg	exit ;;
4670eb10989Smrg    Night_Hawk:Power_UNIX:*:*)
4680eb10989Smrg	echo powerpc-harris-powerunix
46963165362Smrg	exit ;;
4700eb10989Smrg    m88k:CX/UX:7*:*)
4710eb10989Smrg	echo m88k-harris-cxux7
47263165362Smrg	exit ;;
4730eb10989Smrg    m88k:*:4*:R4*)
4740eb10989Smrg	echo m88k-motorola-sysv4
47563165362Smrg	exit ;;
4760eb10989Smrg    m88k:*:3*:R3*)
4770eb10989Smrg	echo m88k-motorola-sysv3
47863165362Smrg	exit ;;
4790eb10989Smrg    AViiON:dgux:*:*)
4800eb10989Smrg        # DG/UX returns AViiON for all architectures
4810eb10989Smrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
4820eb10989Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
4830eb10989Smrg	then
4840eb10989Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
4850eb10989Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
4860eb10989Smrg	    then
4870eb10989Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
4880eb10989Smrg	    else
4890eb10989Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
4900eb10989Smrg	    fi
4910eb10989Smrg	else
4920eb10989Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
4930eb10989Smrg	fi
49463165362Smrg 	exit ;;
4950eb10989Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
4960eb10989Smrg	echo m88k-dolphin-sysv3
49763165362Smrg	exit ;;
4980eb10989Smrg    M88*:*:R3*:*)
4990eb10989Smrg	# Delta 88k system running SVR3
5000eb10989Smrg	echo m88k-motorola-sysv3
50163165362Smrg	exit ;;
5020eb10989Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5030eb10989Smrg	echo m88k-tektronix-sysv3
50463165362Smrg	exit ;;
5050eb10989Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5060eb10989Smrg	echo m68k-tektronix-bsd
50763165362Smrg	exit ;;
5080eb10989Smrg    *:IRIX*:*:*)
5090eb10989Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
51063165362Smrg	exit ;;
5110eb10989Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
51263165362Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
51363165362Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5140eb10989Smrg    i*86:AIX:*:*)
5150eb10989Smrg	echo i386-ibm-aix
51663165362Smrg	exit ;;
5170eb10989Smrg    ia64:AIX:*:*)
5180eb10989Smrg	if [ -x /usr/bin/oslevel ] ; then
5190eb10989Smrg		IBM_REV=`/usr/bin/oslevel`
5200eb10989Smrg	else
5210eb10989Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5220eb10989Smrg	fi
5230eb10989Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
52463165362Smrg	exit ;;
5250eb10989Smrg    *:AIX:2:3)
5260eb10989Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5270eb10989Smrg		eval $set_cc_for_build
5280eb10989Smrg		sed 's/^		//' << EOF >$dummy.c
5290eb10989Smrg		#include <sys/systemcfg.h>
5300eb10989Smrg
5310eb10989Smrg		main()
5320eb10989Smrg			{
5330eb10989Smrg			if (!__power_pc())
5340eb10989Smrg				exit(1);
5350eb10989Smrg			puts("powerpc-ibm-aix3.2.5");
5360eb10989Smrg			exit(0);
5370eb10989Smrg			}
5380eb10989SmrgEOF
53963165362Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
54063165362Smrg		then
54163165362Smrg			echo "$SYSTEM_NAME"
54263165362Smrg		else
54363165362Smrg			echo rs6000-ibm-aix3.2.5
54463165362Smrg		fi
5450eb10989Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5460eb10989Smrg		echo rs6000-ibm-aix3.2.4
5470eb10989Smrg	else
5480eb10989Smrg		echo rs6000-ibm-aix3.2
5490eb10989Smrg	fi
55063165362Smrg	exit ;;
55163165362Smrg    *:AIX:*:[456])
5520eb10989Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5530eb10989Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5540eb10989Smrg		IBM_ARCH=rs6000
5550eb10989Smrg	else
5560eb10989Smrg		IBM_ARCH=powerpc
5570eb10989Smrg	fi
5580eb10989Smrg	if [ -x /usr/bin/oslevel ] ; then
5590eb10989Smrg		IBM_REV=`/usr/bin/oslevel`
5600eb10989Smrg	else
5610eb10989Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5620eb10989Smrg	fi
5630eb10989Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
56463165362Smrg	exit ;;
5650eb10989Smrg    *:AIX:*:*)
5660eb10989Smrg	echo rs6000-ibm-aix
56763165362Smrg	exit ;;
5680eb10989Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5690eb10989Smrg	echo romp-ibm-bsd4.4
57063165362Smrg	exit ;;
5710eb10989Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5720eb10989Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
57363165362Smrg	exit ;;                             # report: romp-ibm BSD 4.3
5740eb10989Smrg    *:BOSX:*:*)
5750eb10989Smrg	echo rs6000-bull-bosx
57663165362Smrg	exit ;;
5770eb10989Smrg    DPX/2?00:B.O.S.:*:*)
5780eb10989Smrg	echo m68k-bull-sysv3
57963165362Smrg	exit ;;
5800eb10989Smrg    9000/[34]??:4.3bsd:1.*:*)
5810eb10989Smrg	echo m68k-hp-bsd
58263165362Smrg	exit ;;
5830eb10989Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
5840eb10989Smrg	echo m68k-hp-bsd4.4
58563165362Smrg	exit ;;
5860eb10989Smrg    9000/[34678]??:HP-UX:*:*)
5870eb10989Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
5880eb10989Smrg	case "${UNAME_MACHINE}" in
5890eb10989Smrg	    9000/31? )            HP_ARCH=m68000 ;;
5900eb10989Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
5910eb10989Smrg	    9000/[678][0-9][0-9])
5920eb10989Smrg		if [ -x /usr/bin/getconf ]; then
5930eb10989Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
5940eb10989Smrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
5950eb10989Smrg                    case "${sc_cpu_version}" in
5960eb10989Smrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
5970eb10989Smrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
5980eb10989Smrg                      532)                      # CPU_PA_RISC2_0
5990eb10989Smrg                        case "${sc_kernel_bits}" in
6000eb10989Smrg                          32) HP_ARCH="hppa2.0n" ;;
6010eb10989Smrg                          64) HP_ARCH="hppa2.0w" ;;
6020eb10989Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
6030eb10989Smrg                        esac ;;
6040eb10989Smrg                    esac
6050eb10989Smrg		fi
6060eb10989Smrg		if [ "${HP_ARCH}" = "" ]; then
6070eb10989Smrg		    eval $set_cc_for_build
6080eb10989Smrg		    sed 's/^              //' << EOF >$dummy.c
6090eb10989Smrg
6100eb10989Smrg              #define _HPUX_SOURCE
6110eb10989Smrg              #include <stdlib.h>
6120eb10989Smrg              #include <unistd.h>
6130eb10989Smrg
6140eb10989Smrg              int main ()
6150eb10989Smrg              {
6160eb10989Smrg              #if defined(_SC_KERNEL_BITS)
6170eb10989Smrg                  long bits = sysconf(_SC_KERNEL_BITS);
6180eb10989Smrg              #endif
6190eb10989Smrg                  long cpu  = sysconf (_SC_CPU_VERSION);
6200eb10989Smrg
6210eb10989Smrg                  switch (cpu)
6220eb10989Smrg              	{
6230eb10989Smrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6240eb10989Smrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6250eb10989Smrg              	case CPU_PA_RISC2_0:
6260eb10989Smrg              #if defined(_SC_KERNEL_BITS)
6270eb10989Smrg              	    switch (bits)
6280eb10989Smrg              		{
6290eb10989Smrg              		case 64: puts ("hppa2.0w"); break;
6300eb10989Smrg              		case 32: puts ("hppa2.0n"); break;
6310eb10989Smrg              		default: puts ("hppa2.0"); break;
6320eb10989Smrg              		} break;
6330eb10989Smrg              #else  /* !defined(_SC_KERNEL_BITS) */
6340eb10989Smrg              	    puts ("hppa2.0"); break;
6350eb10989Smrg              #endif
6360eb10989Smrg              	default: puts ("hppa1.0"); break;
6370eb10989Smrg              	}
6380eb10989Smrg                  exit (0);
6390eb10989Smrg              }
6400eb10989SmrgEOF
6410eb10989Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6420eb10989Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6430eb10989Smrg		fi ;;
6440eb10989Smrg	esac
6450eb10989Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
6460eb10989Smrg	then
64763165362Smrg	    eval $set_cc_for_build
64863165362Smrg
64963165362Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
65063165362Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
65163165362Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
65263165362Smrg	    #
65363165362Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
65463165362Smrg	    # => hppa2.0w-hp-hpux11.23
65563165362Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
65663165362Smrg	    # => hppa64-hp-hpux11.23
65763165362Smrg
65863165362Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
65963165362Smrg		grep __LP64__ >/dev/null
6600eb10989Smrg	    then
6610eb10989Smrg		HP_ARCH="hppa2.0w"
6620eb10989Smrg	    else
6630eb10989Smrg		HP_ARCH="hppa64"
6640eb10989Smrg	    fi
6650eb10989Smrg	fi
6660eb10989Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
66763165362Smrg	exit ;;
6680eb10989Smrg    ia64:HP-UX:*:*)
6690eb10989Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6700eb10989Smrg	echo ia64-hp-hpux${HPUX_REV}
67163165362Smrg	exit ;;
6720eb10989Smrg    3050*:HI-UX:*:*)
6730eb10989Smrg	eval $set_cc_for_build
6740eb10989Smrg	sed 's/^	//' << EOF >$dummy.c
6750eb10989Smrg	#include <unistd.h>
6760eb10989Smrg	int
6770eb10989Smrg	main ()
6780eb10989Smrg	{
6790eb10989Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
6800eb10989Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
6810eb10989Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
6820eb10989Smrg	     results, however.  */
6830eb10989Smrg	  if (CPU_IS_PA_RISC (cpu))
6840eb10989Smrg	    {
6850eb10989Smrg	      switch (cpu)
6860eb10989Smrg		{
6870eb10989Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
6880eb10989Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
6890eb10989Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
6900eb10989Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
6910eb10989Smrg		}
6920eb10989Smrg	    }
6930eb10989Smrg	  else if (CPU_IS_HP_MC68K (cpu))
6940eb10989Smrg	    puts ("m68k-hitachi-hiuxwe2");
6950eb10989Smrg	  else puts ("unknown-hitachi-hiuxwe2");
6960eb10989Smrg	  exit (0);
6970eb10989Smrg	}
6980eb10989SmrgEOF
69963165362Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
70063165362Smrg		{ echo "$SYSTEM_NAME"; exit; }
7010eb10989Smrg	echo unknown-hitachi-hiuxwe2
70263165362Smrg	exit ;;
7030eb10989Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
7040eb10989Smrg	echo hppa1.1-hp-bsd
70563165362Smrg	exit ;;
7060eb10989Smrg    9000/8??:4.3bsd:*:*)
7070eb10989Smrg	echo hppa1.0-hp-bsd
70863165362Smrg	exit ;;
7090eb10989Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7100eb10989Smrg	echo hppa1.0-hp-mpeix
71163165362Smrg	exit ;;
7120eb10989Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7130eb10989Smrg	echo hppa1.1-hp-osf
71463165362Smrg	exit ;;
7150eb10989Smrg    hp8??:OSF1:*:*)
7160eb10989Smrg	echo hppa1.0-hp-osf
71763165362Smrg	exit ;;
7180eb10989Smrg    i*86:OSF1:*:*)
7190eb10989Smrg	if [ -x /usr/sbin/sysversion ] ; then
7200eb10989Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
7210eb10989Smrg	else
7220eb10989Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
7230eb10989Smrg	fi
72463165362Smrg	exit ;;
7250eb10989Smrg    parisc*:Lites*:*:*)
7260eb10989Smrg	echo hppa1.1-hp-lites
72763165362Smrg	exit ;;
7280eb10989Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7290eb10989Smrg	echo c1-convex-bsd
73063165362Smrg        exit ;;
7310eb10989Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7320eb10989Smrg	if getsysinfo -f scalar_acc
7330eb10989Smrg	then echo c32-convex-bsd
7340eb10989Smrg	else echo c2-convex-bsd
7350eb10989Smrg	fi
73663165362Smrg        exit ;;
7370eb10989Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7380eb10989Smrg	echo c34-convex-bsd
73963165362Smrg        exit ;;
7400eb10989Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7410eb10989Smrg	echo c38-convex-bsd
74263165362Smrg        exit ;;
7430eb10989Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7440eb10989Smrg	echo c4-convex-bsd
74563165362Smrg        exit ;;
7460eb10989Smrg    CRAY*Y-MP:*:*:*)
7470eb10989Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
74863165362Smrg	exit ;;
7490eb10989Smrg    CRAY*[A-Z]90:*:*:*)
7500eb10989Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7510eb10989Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7520eb10989Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7530eb10989Smrg	      -e 's/\.[^.]*$/.X/'
75463165362Smrg	exit ;;
7550eb10989Smrg    CRAY*TS:*:*:*)
7560eb10989Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
75763165362Smrg	exit ;;
7580eb10989Smrg    CRAY*T3E:*:*:*)
7590eb10989Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
76063165362Smrg	exit ;;
7610eb10989Smrg    CRAY*SV1:*:*:*)
7620eb10989Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
76363165362Smrg	exit ;;
7640eb10989Smrg    *:UNICOS/mp:*:*)
76563165362Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
76663165362Smrg	exit ;;
7670eb10989Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7680eb10989Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7690eb10989Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7700eb10989Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7710eb10989Smrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
77263165362Smrg        exit ;;
7730eb10989Smrg    5000:UNIX_System_V:4.*:*)
7740eb10989Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7750eb10989Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
7760eb10989Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
77763165362Smrg	exit ;;
7780eb10989Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
7790eb10989Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
78063165362Smrg	exit ;;
7810eb10989Smrg    sparc*:BSD/OS:*:*)
7820eb10989Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
78363165362Smrg	exit ;;
7840eb10989Smrg    *:BSD/OS:*:*)
7850eb10989Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
78663165362Smrg	exit ;;
7870eb10989Smrg    *:FreeBSD:*:*)
78863165362Smrg	case ${UNAME_MACHINE} in
78963165362Smrg	    pc98)
79063165362Smrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
79163165362Smrg	    amd64)
79263165362Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
79363165362Smrg	    *)
79463165362Smrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
79563165362Smrg	esac
79663165362Smrg	exit ;;
7970eb10989Smrg    i*:CYGWIN*:*)
7980eb10989Smrg	echo ${UNAME_MACHINE}-pc-cygwin
79963165362Smrg	exit ;;
80063165362Smrg    *:MINGW*:*)
8010eb10989Smrg	echo ${UNAME_MACHINE}-pc-mingw32
80263165362Smrg	exit ;;
80363165362Smrg    i*:windows32*:*)
80463165362Smrg    	# uname -m includes "-pc" on this system.
80563165362Smrg    	echo ${UNAME_MACHINE}-mingw32
80663165362Smrg	exit ;;
8070eb10989Smrg    i*:PW*:*)
8080eb10989Smrg	echo ${UNAME_MACHINE}-pc-pw32
80963165362Smrg	exit ;;
81063165362Smrg    *:Interix*:[3456]*)
81163165362Smrg    	case ${UNAME_MACHINE} in
81263165362Smrg	    x86)
81363165362Smrg		echo i586-pc-interix${UNAME_RELEASE}
81463165362Smrg		exit ;;
81563165362Smrg	    EM64T | authenticamd | genuineintel)
81663165362Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
81763165362Smrg		exit ;;
81863165362Smrg	    IA64)
81963165362Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
82063165362Smrg		exit ;;
82163165362Smrg	esac ;;
8220eb10989Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
8230eb10989Smrg	echo i${UNAME_MACHINE}-pc-mks
82463165362Smrg	exit ;;
8250eb10989Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
8260eb10989Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
8270eb10989Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8280eb10989Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
8290eb10989Smrg	echo i586-pc-interix
83063165362Smrg	exit ;;
8310eb10989Smrg    i*:UWIN*:*)
8320eb10989Smrg	echo ${UNAME_MACHINE}-pc-uwin
83363165362Smrg	exit ;;
83463165362Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
83563165362Smrg	echo x86_64-unknown-cygwin
83663165362Smrg	exit ;;
8370eb10989Smrg    p*:CYGWIN*:*)
8380eb10989Smrg	echo powerpcle-unknown-cygwin
83963165362Smrg	exit ;;
8400eb10989Smrg    prep*:SunOS:5.*:*)
8410eb10989Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
84263165362Smrg	exit ;;
8430eb10989Smrg    *:GNU:*:*)
8440eb10989Smrg	# the GNU system
8450eb10989Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
84663165362Smrg	exit ;;
8470eb10989Smrg    *:GNU/*:*:*)
8480eb10989Smrg	# other systems with GNU libc and userland
8490eb10989Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
85063165362Smrg	exit ;;
8510eb10989Smrg    i*86:Minix:*:*)
8520eb10989Smrg	echo ${UNAME_MACHINE}-pc-minix
85363165362Smrg	exit ;;
8540eb10989Smrg    arm*:Linux:*:*)
85563165362Smrg	eval $set_cc_for_build
85663165362Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
85763165362Smrg	    | grep -q __ARM_EABI__
85863165362Smrg	then
85963165362Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
86063165362Smrg	else
86163165362Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
86263165362Smrg	fi
86363165362Smrg	exit ;;
86463165362Smrg    avr32*:Linux:*:*)
8650eb10989Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
86663165362Smrg	exit ;;
8670eb10989Smrg    cris:Linux:*:*)
8680eb10989Smrg	echo cris-axis-linux-gnu
86963165362Smrg	exit ;;
87063165362Smrg    crisv32:Linux:*:*)
87163165362Smrg	echo crisv32-axis-linux-gnu
87263165362Smrg	exit ;;
87363165362Smrg    frv:Linux:*:*)
87463165362Smrg    	echo frv-unknown-linux-gnu
87563165362Smrg	exit ;;
8760eb10989Smrg    ia64:Linux:*:*)
8770eb10989Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
87863165362Smrg	exit ;;
8790eb10989Smrg    m32r*:Linux:*:*)
8800eb10989Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
88163165362Smrg	exit ;;
8820eb10989Smrg    m68*:Linux:*:*)
8830eb10989Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
88463165362Smrg	exit ;;
8850eb10989Smrg    mips:Linux:*:*)
8860eb10989Smrg	eval $set_cc_for_build
8870eb10989Smrg	sed 's/^	//' << EOF >$dummy.c
8880eb10989Smrg	#undef CPU
8890eb10989Smrg	#undef mips
8900eb10989Smrg	#undef mipsel
8910eb10989Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
8920eb10989Smrg	CPU=mipsel
8930eb10989Smrg	#else
8940eb10989Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
8950eb10989Smrg	CPU=mips
8960eb10989Smrg	#else
8970eb10989Smrg	CPU=
8980eb10989Smrg	#endif
8990eb10989Smrg	#endif
9000eb10989SmrgEOF
90163165362Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
90263165362Smrg	    /^CPU/{
90363165362Smrg		s: ::g
90463165362Smrg		p
90563165362Smrg	    }'`"
90663165362Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
9070eb10989Smrg	;;
9080eb10989Smrg    mips64:Linux:*:*)
9090eb10989Smrg	eval $set_cc_for_build
9100eb10989Smrg	sed 's/^	//' << EOF >$dummy.c
9110eb10989Smrg	#undef CPU
9120eb10989Smrg	#undef mips64
9130eb10989Smrg	#undef mips64el
9140eb10989Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
9150eb10989Smrg	CPU=mips64el
9160eb10989Smrg	#else
9170eb10989Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9180eb10989Smrg	CPU=mips64
9190eb10989Smrg	#else
9200eb10989Smrg	CPU=
9210eb10989Smrg	#endif
9220eb10989Smrg	#endif
9230eb10989SmrgEOF
92463165362Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
92563165362Smrg	    /^CPU/{
92663165362Smrg		s: ::g
92763165362Smrg		p
92863165362Smrg	    }'`"
92963165362Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
9300eb10989Smrg	;;
93163165362Smrg    or32:Linux:*:*)
93263165362Smrg	echo or32-unknown-linux-gnu
93363165362Smrg	exit ;;
9340eb10989Smrg    ppc:Linux:*:*)
9350eb10989Smrg	echo powerpc-unknown-linux-gnu
93663165362Smrg	exit ;;
9370eb10989Smrg    ppc64:Linux:*:*)
9380eb10989Smrg	echo powerpc64-unknown-linux-gnu
93963165362Smrg	exit ;;
9400eb10989Smrg    alpha:Linux:*:*)
9410eb10989Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
9420eb10989Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
9430eb10989Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
9440eb10989Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
9450eb10989Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
9460eb10989Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
9470eb10989Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
9480eb10989Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
9490eb10989Smrg        esac
9500eb10989Smrg	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
9510eb10989Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
9520eb10989Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
95363165362Smrg	exit ;;
95463165362Smrg    padre:Linux:*:*)
95563165362Smrg	echo sparc-unknown-linux-gnu
95663165362Smrg	exit ;;
9570eb10989Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
9580eb10989Smrg	# Look for CPU level
9590eb10989Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9600eb10989Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
9610eb10989Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
9620eb10989Smrg	  *)    echo hppa-unknown-linux-gnu ;;
9630eb10989Smrg	esac
96463165362Smrg	exit ;;
9650eb10989Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
9660eb10989Smrg	echo hppa64-unknown-linux-gnu
96763165362Smrg	exit ;;
9680eb10989Smrg    s390:Linux:*:* | s390x:Linux:*:*)
9690eb10989Smrg	echo ${UNAME_MACHINE}-ibm-linux
97063165362Smrg	exit ;;
9710eb10989Smrg    sh64*:Linux:*:*)
9720eb10989Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
97363165362Smrg	exit ;;
9740eb10989Smrg    sh*:Linux:*:*)
9750eb10989Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
97663165362Smrg	exit ;;
9770eb10989Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
9780eb10989Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
97963165362Smrg	exit ;;
98063165362Smrg    vax:Linux:*:*)
98163165362Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
98263165362Smrg	exit ;;
9830eb10989Smrg    x86_64:Linux:*:*)
9840eb10989Smrg	echo x86_64-unknown-linux-gnu
98563165362Smrg	exit ;;
98663165362Smrg    xtensa*:Linux:*:*)
98763165362Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
98863165362Smrg	exit ;;
9890eb10989Smrg    i*86:Linux:*:*)
9900eb10989Smrg	# The BFD linker knows what the default object file format is, so
9910eb10989Smrg	# first see if it will tell us. cd to the root directory to prevent
9920eb10989Smrg	# problems with other programs or directories called `ld' in the path.
9930eb10989Smrg	# Set LC_ALL=C to ensure ld outputs messages in English.
9940eb10989Smrg	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
9950eb10989Smrg			 | sed -ne '/supported targets:/!d
9960eb10989Smrg				    s/[ 	][ 	]*/ /g
9970eb10989Smrg				    s/.*supported targets: *//
9980eb10989Smrg				    s/ .*//
9990eb10989Smrg				    p'`
10000eb10989Smrg        case "$ld_supported_targets" in
10010eb10989Smrg	  elf32-i386)
10020eb10989Smrg		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
10030eb10989Smrg		;;
10040eb10989Smrg	  a.out-i386-linux)
10050eb10989Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
100663165362Smrg		exit ;;
10070eb10989Smrg	  "")
10080eb10989Smrg		# Either a pre-BFD a.out linker (linux-gnuoldld) or
10090eb10989Smrg		# one that does not give us useful --help.
10100eb10989Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
101163165362Smrg		exit ;;
10120eb10989Smrg	esac
10130eb10989Smrg	# Determine whether the default compiler is a.out or elf
10140eb10989Smrg	eval $set_cc_for_build
10150eb10989Smrg	sed 's/^	//' << EOF >$dummy.c
10160eb10989Smrg	#include <features.h>
10170eb10989Smrg	#ifdef __ELF__
10180eb10989Smrg	# ifdef __GLIBC__
10190eb10989Smrg	#  if __GLIBC__ >= 2
10200eb10989Smrg	LIBC=gnu
10210eb10989Smrg	#  else
10220eb10989Smrg	LIBC=gnulibc1
10230eb10989Smrg	#  endif
10240eb10989Smrg	# else
10250eb10989Smrg	LIBC=gnulibc1
10260eb10989Smrg	# endif
10270eb10989Smrg	#else
102863165362Smrg	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
10290eb10989Smrg	LIBC=gnu
10300eb10989Smrg	#else
10310eb10989Smrg	LIBC=gnuaout
10320eb10989Smrg	#endif
10330eb10989Smrg	#endif
10340eb10989Smrg	#ifdef __dietlibc__
10350eb10989Smrg	LIBC=dietlibc
10360eb10989Smrg	#endif
10370eb10989SmrgEOF
103863165362Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
103963165362Smrg	    /^LIBC/{
104063165362Smrg		s: ::g
104163165362Smrg		p
104263165362Smrg	    }'`"
104363165362Smrg	test x"${LIBC}" != x && {
104463165362Smrg		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
104563165362Smrg		exit
104663165362Smrg	}
104763165362Smrg	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
10480eb10989Smrg	;;
10490eb10989Smrg    i*86:DYNIX/ptx:4*:*)
10500eb10989Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10510eb10989Smrg	# earlier versions are messed up and put the nodename in both
10520eb10989Smrg	# sysname and nodename.
10530eb10989Smrg	echo i386-sequent-sysv4
105463165362Smrg	exit ;;
10550eb10989Smrg    i*86:UNIX_SV:4.2MP:2.*)
10560eb10989Smrg        # Unixware is an offshoot of SVR4, but it has its own version
10570eb10989Smrg        # number series starting with 2...
10580eb10989Smrg        # I am not positive that other SVR4 systems won't match this,
10590eb10989Smrg	# I just have to hope.  -- rms.
10600eb10989Smrg        # Use sysv4.2uw... so that sysv4* matches it.
10610eb10989Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
106263165362Smrg	exit ;;
10630eb10989Smrg    i*86:OS/2:*:*)
10640eb10989Smrg	# If we were able to find `uname', then EMX Unix compatibility
10650eb10989Smrg	# is probably installed.
10660eb10989Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
106763165362Smrg	exit ;;
10680eb10989Smrg    i*86:XTS-300:*:STOP)
10690eb10989Smrg	echo ${UNAME_MACHINE}-unknown-stop
107063165362Smrg	exit ;;
10710eb10989Smrg    i*86:atheos:*:*)
10720eb10989Smrg	echo ${UNAME_MACHINE}-unknown-atheos
107363165362Smrg	exit ;;
107463165362Smrg    i*86:syllable:*:*)
10750eb10989Smrg	echo ${UNAME_MACHINE}-pc-syllable
107663165362Smrg	exit ;;
10770eb10989Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
10780eb10989Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
107963165362Smrg	exit ;;
10800eb10989Smrg    i*86:*DOS:*:*)
10810eb10989Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
108263165362Smrg	exit ;;
10830eb10989Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10840eb10989Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10850eb10989Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10860eb10989Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10870eb10989Smrg	else
10880eb10989Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10890eb10989Smrg	fi
109063165362Smrg	exit ;;
109163165362Smrg    i*86:*:5:[678]*)
109263165362Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10930eb10989Smrg	case `/bin/uname -X | grep "^Machine"` in
10940eb10989Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
10950eb10989Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
10960eb10989Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10970eb10989Smrg	esac
10980eb10989Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
109963165362Smrg	exit ;;
11000eb10989Smrg    i*86:*:3.2:*)
11010eb10989Smrg	if test -f /usr/options/cb.name; then
11020eb10989Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
11030eb10989Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
11040eb10989Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
11050eb10989Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
11060eb10989Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
11070eb10989Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
11080eb10989Smrg			&& UNAME_MACHINE=i586
11090eb10989Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
11100eb10989Smrg			&& UNAME_MACHINE=i686
11110eb10989Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
11120eb10989Smrg			&& UNAME_MACHINE=i686
11130eb10989Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
11140eb10989Smrg	else
11150eb10989Smrg		echo ${UNAME_MACHINE}-pc-sysv32
11160eb10989Smrg	fi
111763165362Smrg	exit ;;
11180eb10989Smrg    pc:*:*:*)
11190eb10989Smrg	# Left here for compatibility:
11200eb10989Smrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
112163165362Smrg        # the processor, so we play safe by assuming i586.
112263165362Smrg	# Note: whatever this is, it MUST be the same as what config.sub
112363165362Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
112463165362Smrg	# this is a cross-build.
112563165362Smrg	echo i586-pc-msdosdjgpp
112663165362Smrg        exit ;;
11270eb10989Smrg    Intel:Mach:3*:*)
11280eb10989Smrg	echo i386-pc-mach3
112963165362Smrg	exit ;;
11300eb10989Smrg    paragon:*:*:*)
11310eb10989Smrg	echo i860-intel-osf1
113263165362Smrg	exit ;;
11330eb10989Smrg    i860:*:4.*:*) # i860-SVR4
11340eb10989Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
11350eb10989Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
11360eb10989Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
11370eb10989Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
11380eb10989Smrg	fi
113963165362Smrg	exit ;;
11400eb10989Smrg    mini*:CTIX:SYS*5:*)
11410eb10989Smrg	# "miniframe"
11420eb10989Smrg	echo m68010-convergent-sysv
114363165362Smrg	exit ;;
11440eb10989Smrg    mc68k:UNIX:SYSTEM5:3.51m)
11450eb10989Smrg	echo m68k-convergent-sysv
114663165362Smrg	exit ;;
11470eb10989Smrg    M680?0:D-NIX:5.3:*)
11480eb10989Smrg	echo m68k-diab-dnix
114963165362Smrg	exit ;;
11500eb10989Smrg    M68*:*:R3V[5678]*:*)
115163165362Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
115263165362Smrg    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)
11530eb10989Smrg	OS_REL=''
11540eb10989Smrg	test -r /etc/.relid \
11550eb10989Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11560eb10989Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
115763165362Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11580eb10989Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
115963165362Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11600eb10989Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11610eb10989Smrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
116263165362Smrg          && { echo i486-ncr-sysv4; exit; } ;;
116363165362Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
116463165362Smrg	OS_REL='.3'
116563165362Smrg	test -r /etc/.relid \
116663165362Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
116763165362Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
116863165362Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
116963165362Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
117063165362Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
117163165362Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
117263165362Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11730eb10989Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11740eb10989Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
117563165362Smrg	exit ;;
11760eb10989Smrg    mc68030:UNIX_System_V:4.*:*)
11770eb10989Smrg	echo m68k-atari-sysv4
117863165362Smrg	exit ;;
11790eb10989Smrg    TSUNAMI:LynxOS:2.*:*)
11800eb10989Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
118163165362Smrg	exit ;;
11820eb10989Smrg    rs6000:LynxOS:2.*:*)
11830eb10989Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
118463165362Smrg	exit ;;
11850eb10989Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
11860eb10989Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
118763165362Smrg	exit ;;
11880eb10989Smrg    SM[BE]S:UNIX_SV:*:*)
11890eb10989Smrg	echo mips-dde-sysv${UNAME_RELEASE}
119063165362Smrg	exit ;;
11910eb10989Smrg    RM*:ReliantUNIX-*:*:*)
11920eb10989Smrg	echo mips-sni-sysv4
119363165362Smrg	exit ;;
11940eb10989Smrg    RM*:SINIX-*:*:*)
11950eb10989Smrg	echo mips-sni-sysv4
119663165362Smrg	exit ;;
11970eb10989Smrg    *:SINIX-*:*:*)
11980eb10989Smrg	if uname -p 2>/dev/null >/dev/null ; then
11990eb10989Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
12000eb10989Smrg		echo ${UNAME_MACHINE}-sni-sysv4
12010eb10989Smrg	else
12020eb10989Smrg		echo ns32k-sni-sysv
12030eb10989Smrg	fi
120463165362Smrg	exit ;;
12050eb10989Smrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
12060eb10989Smrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
12070eb10989Smrg        echo i586-unisys-sysv4
120863165362Smrg        exit ;;
12090eb10989Smrg    *:UNIX_System_V:4*:FTX*)
12100eb10989Smrg	# From Gerald Hewes <hewes@openmarket.com>.
12110eb10989Smrg	# How about differentiating between stratus architectures? -djm
12120eb10989Smrg	echo hppa1.1-stratus-sysv4
121363165362Smrg	exit ;;
12140eb10989Smrg    *:*:*:FTX*)
12150eb10989Smrg	# From seanf@swdc.stratus.com.
12160eb10989Smrg	echo i860-stratus-sysv4
121763165362Smrg	exit ;;
121863165362Smrg    i*86:VOS:*:*)
121963165362Smrg	# From Paul.Green@stratus.com.
122063165362Smrg	echo ${UNAME_MACHINE}-stratus-vos
122163165362Smrg	exit ;;
12220eb10989Smrg    *:VOS:*:*)
12230eb10989Smrg	# From Paul.Green@stratus.com.
12240eb10989Smrg	echo hppa1.1-stratus-vos
122563165362Smrg	exit ;;
12260eb10989Smrg    mc68*:A/UX:*:*)
12270eb10989Smrg	echo m68k-apple-aux${UNAME_RELEASE}
122863165362Smrg	exit ;;
12290eb10989Smrg    news*:NEWS-OS:6*:*)
12300eb10989Smrg	echo mips-sony-newsos6
123163165362Smrg	exit ;;
12320eb10989Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12330eb10989Smrg	if [ -d /usr/nec ]; then
12340eb10989Smrg	        echo mips-nec-sysv${UNAME_RELEASE}
12350eb10989Smrg	else
12360eb10989Smrg	        echo mips-unknown-sysv${UNAME_RELEASE}
12370eb10989Smrg	fi
123863165362Smrg        exit ;;
12390eb10989Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
12400eb10989Smrg	echo powerpc-be-beos
124163165362Smrg	exit ;;
12420eb10989Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
12430eb10989Smrg	echo powerpc-apple-beos
124463165362Smrg	exit ;;
12450eb10989Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
12460eb10989Smrg	echo i586-pc-beos
124763165362Smrg	exit ;;
124863165362Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
124963165362Smrg	echo i586-pc-haiku
125063165362Smrg	exit ;;
12510eb10989Smrg    SX-4:SUPER-UX:*:*)
12520eb10989Smrg	echo sx4-nec-superux${UNAME_RELEASE}
125363165362Smrg	exit ;;
12540eb10989Smrg    SX-5:SUPER-UX:*:*)
12550eb10989Smrg	echo sx5-nec-superux${UNAME_RELEASE}
125663165362Smrg	exit ;;
12570eb10989Smrg    SX-6:SUPER-UX:*:*)
12580eb10989Smrg	echo sx6-nec-superux${UNAME_RELEASE}
125963165362Smrg	exit ;;
126063165362Smrg    SX-7:SUPER-UX:*:*)
126163165362Smrg	echo sx7-nec-superux${UNAME_RELEASE}
126263165362Smrg	exit ;;
126363165362Smrg    SX-8:SUPER-UX:*:*)
126463165362Smrg	echo sx8-nec-superux${UNAME_RELEASE}
126563165362Smrg	exit ;;
126663165362Smrg    SX-8R:SUPER-UX:*:*)
126763165362Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
126863165362Smrg	exit ;;
12690eb10989Smrg    Power*:Rhapsody:*:*)
12700eb10989Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
127163165362Smrg	exit ;;
12720eb10989Smrg    *:Rhapsody:*:*)
12730eb10989Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
127463165362Smrg	exit ;;
12750eb10989Smrg    *:Darwin:*:*)
127663165362Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
127763165362Smrg	case $UNAME_PROCESSOR in
127863165362Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
12790eb10989Smrg	esac
12800eb10989Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
128163165362Smrg	exit ;;
12820eb10989Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
12830eb10989Smrg	UNAME_PROCESSOR=`uname -p`
12840eb10989Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
12850eb10989Smrg		UNAME_PROCESSOR=i386
12860eb10989Smrg		UNAME_MACHINE=pc
12870eb10989Smrg	fi
12880eb10989Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
128963165362Smrg	exit ;;
12900eb10989Smrg    *:QNX:*:4*)
12910eb10989Smrg	echo i386-pc-qnx
129263165362Smrg	exit ;;
129363165362Smrg    NSE-?:NONSTOP_KERNEL:*:*)
129463165362Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
129563165362Smrg	exit ;;
12960eb10989Smrg    NSR-?:NONSTOP_KERNEL:*:*)
12970eb10989Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
129863165362Smrg	exit ;;
12990eb10989Smrg    *:NonStop-UX:*:*)
13000eb10989Smrg	echo mips-compaq-nonstopux
130163165362Smrg	exit ;;
13020eb10989Smrg    BS2000:POSIX*:*:*)
13030eb10989Smrg	echo bs2000-siemens-sysv
130463165362Smrg	exit ;;
13050eb10989Smrg    DS/*:UNIX_System_V:*:*)
13060eb10989Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
130763165362Smrg	exit ;;
13080eb10989Smrg    *:Plan9:*:*)
13090eb10989Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
13100eb10989Smrg	# is converted to i386 for consistency with other x86
13110eb10989Smrg	# operating systems.
13120eb10989Smrg	if test "$cputype" = "386"; then
13130eb10989Smrg	    UNAME_MACHINE=i386
13140eb10989Smrg	else
13150eb10989Smrg	    UNAME_MACHINE="$cputype"
13160eb10989Smrg	fi
13170eb10989Smrg	echo ${UNAME_MACHINE}-unknown-plan9
131863165362Smrg	exit ;;
13190eb10989Smrg    *:TOPS-10:*:*)
13200eb10989Smrg	echo pdp10-unknown-tops10
132163165362Smrg	exit ;;
13220eb10989Smrg    *:TENEX:*:*)
13230eb10989Smrg	echo pdp10-unknown-tenex
132463165362Smrg	exit ;;
13250eb10989Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
13260eb10989Smrg	echo pdp10-dec-tops20
132763165362Smrg	exit ;;
13280eb10989Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
13290eb10989Smrg	echo pdp10-xkl-tops20
133063165362Smrg	exit ;;
13310eb10989Smrg    *:TOPS-20:*:*)
13320eb10989Smrg	echo pdp10-unknown-tops20
133363165362Smrg	exit ;;
13340eb10989Smrg    *:ITS:*:*)
13350eb10989Smrg	echo pdp10-unknown-its
133663165362Smrg	exit ;;
13370eb10989Smrg    SEI:*:*:SEIUX)
13380eb10989Smrg        echo mips-sei-seiux${UNAME_RELEASE}
133963165362Smrg	exit ;;
13400eb10989Smrg    *:DragonFly:*:*)
13410eb10989Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
134263165362Smrg	exit ;;
134363165362Smrg    *:*VMS:*:*)
134463165362Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
134563165362Smrg	case "${UNAME_MACHINE}" in
134663165362Smrg	    A*) echo alpha-dec-vms ; exit ;;
134763165362Smrg	    I*) echo ia64-dec-vms ; exit ;;
134863165362Smrg	    V*) echo vax-dec-vms ; exit ;;
134963165362Smrg	esac ;;
135063165362Smrg    *:XENIX:*:SysV)
135163165362Smrg	echo i386-pc-xenix
135263165362Smrg	exit ;;
135363165362Smrg    i*86:skyos:*:*)
135463165362Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
135563165362Smrg	exit ;;
135663165362Smrg    i*86:rdos:*:*)
135763165362Smrg	echo ${UNAME_MACHINE}-pc-rdos
135863165362Smrg	exit ;;
135963165362Smrg    i*86:AROS:*:*)
136063165362Smrg	echo ${UNAME_MACHINE}-pc-aros
136163165362Smrg	exit ;;
13620eb10989Smrgesac
13630eb10989Smrg
13640eb10989Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
13650eb10989Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
13660eb10989Smrg
13670eb10989Smrgeval $set_cc_for_build
13680eb10989Smrgcat >$dummy.c <<EOF
13690eb10989Smrg#ifdef _SEQUENT_
13700eb10989Smrg# include <sys/types.h>
13710eb10989Smrg# include <sys/utsname.h>
13720eb10989Smrg#endif
13730eb10989Smrgmain ()
13740eb10989Smrg{
13750eb10989Smrg#if defined (sony)
13760eb10989Smrg#if defined (MIPSEB)
13770eb10989Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
13780eb10989Smrg     I don't know....  */
13790eb10989Smrg  printf ("mips-sony-bsd\n"); exit (0);
13800eb10989Smrg#else
13810eb10989Smrg#include <sys/param.h>
13820eb10989Smrg  printf ("m68k-sony-newsos%s\n",
13830eb10989Smrg#ifdef NEWSOS4
13840eb10989Smrg          "4"
13850eb10989Smrg#else
13860eb10989Smrg	  ""
13870eb10989Smrg#endif
13880eb10989Smrg         ); exit (0);
13890eb10989Smrg#endif
13900eb10989Smrg#endif
13910eb10989Smrg
13920eb10989Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
139363165362Smrg  printf ("arm-acorn-riscix\n"); exit (0);
13940eb10989Smrg#endif
13950eb10989Smrg
13960eb10989Smrg#if defined (hp300) && !defined (hpux)
13970eb10989Smrg  printf ("m68k-hp-bsd\n"); exit (0);
13980eb10989Smrg#endif
13990eb10989Smrg
14000eb10989Smrg#if defined (NeXT)
14010eb10989Smrg#if !defined (__ARCHITECTURE__)
14020eb10989Smrg#define __ARCHITECTURE__ "m68k"
14030eb10989Smrg#endif
14040eb10989Smrg  int version;
14050eb10989Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
14060eb10989Smrg  if (version < 4)
14070eb10989Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
14080eb10989Smrg  else
14090eb10989Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
14100eb10989Smrg  exit (0);
14110eb10989Smrg#endif
14120eb10989Smrg
14130eb10989Smrg#if defined (MULTIMAX) || defined (n16)
14140eb10989Smrg#if defined (UMAXV)
14150eb10989Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
14160eb10989Smrg#else
14170eb10989Smrg#if defined (CMU)
14180eb10989Smrg  printf ("ns32k-encore-mach\n"); exit (0);
14190eb10989Smrg#else
14200eb10989Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
14210eb10989Smrg#endif
14220eb10989Smrg#endif
14230eb10989Smrg#endif
14240eb10989Smrg
14250eb10989Smrg#if defined (__386BSD__)
14260eb10989Smrg  printf ("i386-pc-bsd\n"); exit (0);
14270eb10989Smrg#endif
14280eb10989Smrg
14290eb10989Smrg#if defined (sequent)
14300eb10989Smrg#if defined (i386)
14310eb10989Smrg  printf ("i386-sequent-dynix\n"); exit (0);
14320eb10989Smrg#endif
14330eb10989Smrg#if defined (ns32000)
14340eb10989Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
14350eb10989Smrg#endif
14360eb10989Smrg#endif
14370eb10989Smrg
14380eb10989Smrg#if defined (_SEQUENT_)
14390eb10989Smrg    struct utsname un;
14400eb10989Smrg
14410eb10989Smrg    uname(&un);
14420eb10989Smrg
14430eb10989Smrg    if (strncmp(un.version, "V2", 2) == 0) {
14440eb10989Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
14450eb10989Smrg    }
14460eb10989Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
14470eb10989Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
14480eb10989Smrg    }
14490eb10989Smrg    printf ("i386-sequent-ptx\n"); exit (0);
14500eb10989Smrg
14510eb10989Smrg#endif
14520eb10989Smrg
14530eb10989Smrg#if defined (vax)
14540eb10989Smrg# if !defined (ultrix)
14550eb10989Smrg#  include <sys/param.h>
14560eb10989Smrg#  if defined (BSD)
14570eb10989Smrg#   if BSD == 43
14580eb10989Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
14590eb10989Smrg#   else
14600eb10989Smrg#    if BSD == 199006
14610eb10989Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
14620eb10989Smrg#    else
14630eb10989Smrg      printf ("vax-dec-bsd\n"); exit (0);
14640eb10989Smrg#    endif
14650eb10989Smrg#   endif
14660eb10989Smrg#  else
14670eb10989Smrg    printf ("vax-dec-bsd\n"); exit (0);
14680eb10989Smrg#  endif
14690eb10989Smrg# else
14700eb10989Smrg    printf ("vax-dec-ultrix\n"); exit (0);
14710eb10989Smrg# endif
14720eb10989Smrg#endif
14730eb10989Smrg
14740eb10989Smrg#if defined (alliant) && defined (i860)
14750eb10989Smrg  printf ("i860-alliant-bsd\n"); exit (0);
14760eb10989Smrg#endif
14770eb10989Smrg
14780eb10989Smrg  exit (1);
14790eb10989Smrg}
14800eb10989SmrgEOF
14810eb10989Smrg
148263165362Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
148363165362Smrg	{ echo "$SYSTEM_NAME"; exit; }
14840eb10989Smrg
14850eb10989Smrg# Apollos put the system type in the environment.
14860eb10989Smrg
148763165362Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
14880eb10989Smrg
14890eb10989Smrg# Convex versions that predate uname can use getsysinfo(1)
14900eb10989Smrg
14910eb10989Smrgif [ -x /usr/convex/getsysinfo ]
14920eb10989Smrgthen
14930eb10989Smrg    case `getsysinfo -f cpu_type` in
14940eb10989Smrg    c1*)
14950eb10989Smrg	echo c1-convex-bsd
149663165362Smrg	exit ;;
14970eb10989Smrg    c2*)
14980eb10989Smrg	if getsysinfo -f scalar_acc
14990eb10989Smrg	then echo c32-convex-bsd
15000eb10989Smrg	else echo c2-convex-bsd
15010eb10989Smrg	fi
150263165362Smrg	exit ;;
15030eb10989Smrg    c34*)
15040eb10989Smrg	echo c34-convex-bsd
150563165362Smrg	exit ;;
15060eb10989Smrg    c38*)
15070eb10989Smrg	echo c38-convex-bsd
150863165362Smrg	exit ;;
15090eb10989Smrg    c4*)
15100eb10989Smrg	echo c4-convex-bsd
151163165362Smrg	exit ;;
15120eb10989Smrg    esac
15130eb10989Smrgfi
15140eb10989Smrg
15150eb10989Smrgcat >&2 <<EOF
15160eb10989Smrg$0: unable to guess system type
15170eb10989Smrg
15180eb10989SmrgThis script, last modified $timestamp, has failed to recognize
15190eb10989Smrgthe operating system you are using. It is advised that you
15200eb10989Smrgdownload the most up to date version of the config scripts from
15210eb10989Smrg
152263165362Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
152363165362Smrgand
152463165362Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
15250eb10989Smrg
15260eb10989SmrgIf the version you run ($0) is already up to date, please
15270eb10989Smrgsend the following data and any information you think might be
15280eb10989Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
15290eb10989Smrginformation to handle your system.
15300eb10989Smrg
15310eb10989Smrgconfig.guess timestamp = $timestamp
15320eb10989Smrg
15330eb10989Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
15340eb10989Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
15350eb10989Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
15360eb10989Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
15370eb10989Smrg
15380eb10989Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
15390eb10989Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
15400eb10989Smrg
15410eb10989Smrghostinfo               = `(hostinfo) 2>/dev/null`
15420eb10989Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
15430eb10989Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
15440eb10989Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
15450eb10989Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
15460eb10989Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
15470eb10989Smrg
15480eb10989SmrgUNAME_MACHINE = ${UNAME_MACHINE}
15490eb10989SmrgUNAME_RELEASE = ${UNAME_RELEASE}
15500eb10989SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
15510eb10989SmrgUNAME_VERSION = ${UNAME_VERSION}
15520eb10989SmrgEOF
15530eb10989Smrg
15540eb10989Smrgexit 1
15550eb10989Smrg
15560eb10989Smrg# Local variables:
15570eb10989Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
15580eb10989Smrg# time-stamp-start: "timestamp='"
15590eb10989Smrg# time-stamp-format: "%:y-%02m-%02d"
15600eb10989Smrg# time-stamp-end: "'"
15610eb10989Smrg# End:
1562