config.guess revision 1ae1b5e8
176888252Smrg#! /bin/sh
276888252Smrg# Attempt to guess a canonical system name.
376888252Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
41ae1b5e8Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
51ae1b5e8Smrg#   Free Software Foundation, Inc.
676888252Smrg
71ae1b5e8Smrgtimestamp='2009-02-03'
876888252Smrg
976888252Smrg# This file is free software; you can redistribute it and/or modify it
1076888252Smrg# under the terms of the GNU General Public License as published by
1176888252Smrg# the Free Software Foundation; either version 2 of the License, or
1276888252Smrg# (at your option) any later version.
1376888252Smrg#
1476888252Smrg# This program is distributed in the hope that it will be useful, but
1576888252Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1676888252Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1776888252Smrg# General Public License for more details.
1876888252Smrg#
1976888252Smrg# You should have received a copy of the GNU General Public License
2076888252Smrg# along with this program; if not, write to the Free Software
211ae1b5e8Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
221ae1b5e8Smrg# 02110-1301, USA.
2376888252Smrg#
2476888252Smrg# As a special exception to the GNU General Public License, if you
2576888252Smrg# distribute this file as part of a program that contains a
2676888252Smrg# configuration script generated by Autoconf, you may include it under
2776888252Smrg# the same distribution terms that you use for the rest of that program.
2876888252Smrg
291ae1b5e8Smrg
3076888252Smrg# Originally written by Per Bothner <per@bothner.com>.
3176888252Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
3276888252Smrg# diff and a properly formatted ChangeLog entry.
3376888252Smrg#
3476888252Smrg# This script attempts to guess a canonical system name similar to
3576888252Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
3676888252Smrg# exits with 0.  Otherwise, it exits with 1.
3776888252Smrg#
3876888252Smrg# The plan is that this can be called by configure scripts if you
3976888252Smrg# don't specify an explicit build system type.
4076888252Smrg
4176888252Smrgme=`echo "$0" | sed -e 's,.*/,,'`
4276888252Smrg
4376888252Smrgusage="\
4476888252SmrgUsage: $0 [OPTION]
4576888252Smrg
4676888252SmrgOutput the configuration name of the system \`$me' is run on.
4776888252Smrg
4876888252SmrgOperation modes:
4976888252Smrg  -h, --help         print this help, then exit
5076888252Smrg  -t, --time-stamp   print date of last modification, then exit
5176888252Smrg  -v, --version      print version number, then exit
5276888252Smrg
5376888252SmrgReport bugs and patches to <config-patches@gnu.org>."
5476888252Smrg
5576888252Smrgversion="\
5676888252SmrgGNU config.guess ($timestamp)
5776888252Smrg
5876888252SmrgOriginally written by Per Bothner.
591ae1b5e8SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
601ae1b5e8Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6176888252Smrg
6276888252SmrgThis is free software; see the source for copying conditions.  There is NO
6376888252Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6476888252Smrg
6576888252Smrghelp="
6676888252SmrgTry \`$me --help' for more information."
6776888252Smrg
6876888252Smrg# Parse command line
6976888252Smrgwhile test $# -gt 0 ; do
7076888252Smrg  case $1 in
7176888252Smrg    --time-stamp | --time* | -t )
721ae1b5e8Smrg       echo "$timestamp" ; exit ;;
7376888252Smrg    --version | -v )
741ae1b5e8Smrg       echo "$version" ; exit ;;
7576888252Smrg    --help | --h* | -h )
761ae1b5e8Smrg       echo "$usage"; exit ;;
7776888252Smrg    -- )     # Stop option processing
7876888252Smrg       shift; break ;;
7976888252Smrg    - )	# Use stdin as input.
8076888252Smrg       break ;;
8176888252Smrg    -* )
8276888252Smrg       echo "$me: invalid option $1$help" >&2
8376888252Smrg       exit 1 ;;
8476888252Smrg    * )
8576888252Smrg       break ;;
8676888252Smrg  esac
8776888252Smrgdone
8876888252Smrg
8976888252Smrgif test $# != 0; then
9076888252Smrg  echo "$me: too many arguments$help" >&2
9176888252Smrg  exit 1
9276888252Smrgfi
9376888252Smrg
9476888252Smrgtrap 'exit 1' 1 2 15
9576888252Smrg
9676888252Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9776888252Smrg# compiler to aid in system detection is discouraged as it requires
9876888252Smrg# temporary files to be created and, as you can see below, it is a
9976888252Smrg# headache to deal with in a portable fashion.
10076888252Smrg
10176888252Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
10276888252Smrg# use `HOST_CC' if defined, but it is deprecated.
10376888252Smrg
10476888252Smrg# Portable tmp directory creation inspired by the Autoconf team.
10576888252Smrg
10676888252Smrgset_cc_for_build='
10776888252Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
10876888252Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
10976888252Smrg: ${TMPDIR=/tmp} ;
1101ae1b5e8Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
11176888252Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
11276888252Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
11376888252Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
11476888252Smrgdummy=$tmp/dummy ;
11576888252Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
11676888252Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
11776888252Smrg ,,)    echo "int x;" > $dummy.c ;
11876888252Smrg	for c in cc gcc c89 c99 ; do
11976888252Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
12076888252Smrg	     CC_FOR_BUILD="$c"; break ;
12176888252Smrg	  fi ;
12276888252Smrg	done ;
12376888252Smrg	if test x"$CC_FOR_BUILD" = x ; then
12476888252Smrg	  CC_FOR_BUILD=no_compiler_found ;
12576888252Smrg	fi
12676888252Smrg	;;
12776888252Smrg ,,*)   CC_FOR_BUILD=$CC ;;
12876888252Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1291ae1b5e8Smrgesac ; set_cc_for_build= ;'
13076888252Smrg
13176888252Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
13276888252Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
13376888252Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
13476888252Smrg	PATH=$PATH:/.attbin ; export PATH
13576888252Smrgfi
13676888252Smrg
13776888252SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13876888252SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
13976888252SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
14076888252SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
14176888252Smrg
14276888252Smrg# Note: order is significant - the case branches are not exclusive.
14376888252Smrg
14476888252Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
14576888252Smrg    *:NetBSD:*:*)
14676888252Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
14776888252Smrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
14876888252Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
14976888252Smrg	# switched to ELF, *-*-netbsd* would select the old
15076888252Smrg	# object file format.  This provides both forward
15176888252Smrg	# compatibility and a consistent mechanism for selecting the
15276888252Smrg	# object file format.
15376888252Smrg	#
15476888252Smrg	# Note: NetBSD doesn't particularly care about the vendor
15576888252Smrg	# portion of the name.  We always set it to "unknown".
15676888252Smrg	sysctl="sysctl -n hw.machine_arch"
15776888252Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
15876888252Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
15976888252Smrg	case "${UNAME_MACHINE_ARCH}" in
16076888252Smrg	    armeb) machine=armeb-unknown ;;
16176888252Smrg	    arm*) machine=arm-unknown ;;
16276888252Smrg	    sh3el) machine=shl-unknown ;;
16376888252Smrg	    sh3eb) machine=sh-unknown ;;
1641ae1b5e8Smrg	    sh5el) machine=sh5le-unknown ;;
16576888252Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
16676888252Smrg	esac
16776888252Smrg	# The Operating System including object format, if it has switched
16876888252Smrg	# to ELF recently, or will in the future.
16976888252Smrg	case "${UNAME_MACHINE_ARCH}" in
17076888252Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
17176888252Smrg		eval $set_cc_for_build
17276888252Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
17376888252Smrg			| grep __ELF__ >/dev/null
17476888252Smrg		then
17576888252Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
17676888252Smrg		    # Return netbsd for either.  FIX?
17776888252Smrg		    os=netbsd
17876888252Smrg		else
17976888252Smrg		    os=netbsdelf
18076888252Smrg		fi
18176888252Smrg		;;
18276888252Smrg	    *)
18376888252Smrg	        os=netbsd
18476888252Smrg		;;
18576888252Smrg	esac
18676888252Smrg	# The OS release
18776888252Smrg	# Debian GNU/NetBSD machines have a different userland, and
18876888252Smrg	# thus, need a distinct triplet. However, they do not need
18976888252Smrg	# kernel version information, so it can be replaced with a
19076888252Smrg	# suitable tag, in the style of linux-gnu.
19176888252Smrg	case "${UNAME_VERSION}" in
19276888252Smrg	    Debian*)
19376888252Smrg		release='-gnu'
19476888252Smrg		;;
19576888252Smrg	    *)
19676888252Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19776888252Smrg		;;
19876888252Smrg	esac
19976888252Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
20076888252Smrg	# contains redundant information, the shorter form:
20176888252Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
20276888252Smrg	echo "${machine}-${os}${release}"
2031ae1b5e8Smrg	exit ;;
20476888252Smrg    *:OpenBSD:*:*)
2051ae1b5e8Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2061ae1b5e8Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2071ae1b5e8Smrg	exit ;;
2081ae1b5e8Smrg    *:ekkoBSD:*:*)
2091ae1b5e8Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2101ae1b5e8Smrg	exit ;;
2111ae1b5e8Smrg    *:SolidBSD:*:*)
2121ae1b5e8Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2131ae1b5e8Smrg	exit ;;
2141ae1b5e8Smrg    macppc:MirBSD:*:*)
2151ae1b5e8Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2161ae1b5e8Smrg	exit ;;
2171ae1b5e8Smrg    *:MirBSD:*:*)
2181ae1b5e8Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2191ae1b5e8Smrg	exit ;;
22076888252Smrg    alpha:OSF1:*:*)
2211ae1b5e8Smrg	case $UNAME_RELEASE in
2221ae1b5e8Smrg	*4.0)
22376888252Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2241ae1b5e8Smrg		;;
2251ae1b5e8Smrg	*5.*)
2261ae1b5e8Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2271ae1b5e8Smrg		;;
2281ae1b5e8Smrg	esac
22976888252Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
23076888252Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
23176888252Smrg	# covers most systems running today.  This code pipes the CPU
23276888252Smrg	# types through head -n 1, so we only detect the type of CPU 0.
23376888252Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
23476888252Smrg	case "$ALPHA_CPU_TYPE" in
23576888252Smrg	    "EV4 (21064)")
23676888252Smrg		UNAME_MACHINE="alpha" ;;
23776888252Smrg	    "EV4.5 (21064)")
23876888252Smrg		UNAME_MACHINE="alpha" ;;
23976888252Smrg	    "LCA4 (21066/21068)")
24076888252Smrg		UNAME_MACHINE="alpha" ;;
24176888252Smrg	    "EV5 (21164)")
24276888252Smrg		UNAME_MACHINE="alphaev5" ;;
24376888252Smrg	    "EV5.6 (21164A)")
24476888252Smrg		UNAME_MACHINE="alphaev56" ;;
24576888252Smrg	    "EV5.6 (21164PC)")
24676888252Smrg		UNAME_MACHINE="alphapca56" ;;
24776888252Smrg	    "EV5.7 (21164PC)")
24876888252Smrg		UNAME_MACHINE="alphapca57" ;;
24976888252Smrg	    "EV6 (21264)")
25076888252Smrg		UNAME_MACHINE="alphaev6" ;;
25176888252Smrg	    "EV6.7 (21264A)")
25276888252Smrg		UNAME_MACHINE="alphaev67" ;;
25376888252Smrg	    "EV6.8CB (21264C)")
25476888252Smrg		UNAME_MACHINE="alphaev68" ;;
25576888252Smrg	    "EV6.8AL (21264B)")
25676888252Smrg		UNAME_MACHINE="alphaev68" ;;
25776888252Smrg	    "EV6.8CX (21264D)")
25876888252Smrg		UNAME_MACHINE="alphaev68" ;;
25976888252Smrg	    "EV6.9A (21264/EV69A)")
26076888252Smrg		UNAME_MACHINE="alphaev69" ;;
26176888252Smrg	    "EV7 (21364)")
26276888252Smrg		UNAME_MACHINE="alphaev7" ;;
26376888252Smrg	    "EV7.9 (21364A)")
26476888252Smrg		UNAME_MACHINE="alphaev79" ;;
26576888252Smrg	esac
2661ae1b5e8Smrg	# A Pn.n version is a patched version.
26776888252Smrg	# A Vn.n version is a released version.
26876888252Smrg	# A Tn.n version is a released field test version.
26976888252Smrg	# A Xn.n version is an unreleased experimental baselevel.
27076888252Smrg	# 1.2 uses "1.2" for uname -r.
2711ae1b5e8Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2721ae1b5e8Smrg	exit ;;
27376888252Smrg    Alpha\ *:Windows_NT*:*)
27476888252Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
27576888252Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
27676888252Smrg	# of the specific Alpha model?
27776888252Smrg	echo alpha-pc-interix
2781ae1b5e8Smrg	exit ;;
27976888252Smrg    21064:Windows_NT:50:3)
28076888252Smrg	echo alpha-dec-winnt3.5
2811ae1b5e8Smrg	exit ;;
28276888252Smrg    Amiga*:UNIX_System_V:4.0:*)
28376888252Smrg	echo m68k-unknown-sysv4
2841ae1b5e8Smrg	exit ;;
28576888252Smrg    *:[Aa]miga[Oo][Ss]:*:*)
28676888252Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
2871ae1b5e8Smrg	exit ;;
28876888252Smrg    *:[Mm]orph[Oo][Ss]:*:*)
28976888252Smrg	echo ${UNAME_MACHINE}-unknown-morphos
2901ae1b5e8Smrg	exit ;;
29176888252Smrg    *:OS/390:*:*)
29276888252Smrg	echo i370-ibm-openedition
2931ae1b5e8Smrg	exit ;;
2941ae1b5e8Smrg    *:z/VM:*:*)
2951ae1b5e8Smrg	echo s390-ibm-zvmoe
2961ae1b5e8Smrg	exit ;;
2971ae1b5e8Smrg    *:OS400:*:*)
2981ae1b5e8Smrg        echo powerpc-ibm-os400
2991ae1b5e8Smrg	exit ;;
30076888252Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
30176888252Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
3021ae1b5e8Smrg	exit ;;
3031ae1b5e8Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
3041ae1b5e8Smrg	echo arm-unknown-riscos
3051ae1b5e8Smrg	exit ;;
30676888252Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
30776888252Smrg	echo hppa1.1-hitachi-hiuxmpp
3081ae1b5e8Smrg	exit ;;
30976888252Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
31076888252Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
31176888252Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
31276888252Smrg		echo pyramid-pyramid-sysv3
31376888252Smrg	else
31476888252Smrg		echo pyramid-pyramid-bsd
31576888252Smrg	fi
3161ae1b5e8Smrg	exit ;;
31776888252Smrg    NILE*:*:*:dcosx)
31876888252Smrg	echo pyramid-pyramid-svr4
3191ae1b5e8Smrg	exit ;;
32076888252Smrg    DRS?6000:unix:4.0:6*)
32176888252Smrg	echo sparc-icl-nx6
3221ae1b5e8Smrg	exit ;;
3231ae1b5e8Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
32476888252Smrg	case `/usr/bin/uname -p` in
3251ae1b5e8Smrg	    sparc) echo sparc-icl-nx7; exit ;;
32676888252Smrg	esac ;;
32776888252Smrg    sun4H:SunOS:5.*:*)
32876888252Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3291ae1b5e8Smrg	exit ;;
33076888252Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
33176888252Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3321ae1b5e8Smrg	exit ;;
3331ae1b5e8Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3341ae1b5e8Smrg	eval $set_cc_for_build
3351ae1b5e8Smrg	SUN_ARCH="i386"
3361ae1b5e8Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
3371ae1b5e8Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
3381ae1b5e8Smrg	# This test works for both compilers.
3391ae1b5e8Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
3401ae1b5e8Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
3411ae1b5e8Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
3421ae1b5e8Smrg		grep IS_64BIT_ARCH >/dev/null
3431ae1b5e8Smrg	    then
3441ae1b5e8Smrg		SUN_ARCH="x86_64"
3451ae1b5e8Smrg	    fi
3461ae1b5e8Smrg	fi
3471ae1b5e8Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3481ae1b5e8Smrg	exit ;;
34976888252Smrg    sun4*:SunOS:6*:*)
35076888252Smrg	# According to config.sub, this is the proper way to canonicalize
35176888252Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
35276888252Smrg	# it's likely to be more like Solaris than SunOS4.
35376888252Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3541ae1b5e8Smrg	exit ;;
35576888252Smrg    sun4*:SunOS:*:*)
35676888252Smrg	case "`/usr/bin/arch -k`" in
35776888252Smrg	    Series*|S4*)
35876888252Smrg		UNAME_RELEASE=`uname -v`
35976888252Smrg		;;
36076888252Smrg	esac
36176888252Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
36276888252Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3631ae1b5e8Smrg	exit ;;
36476888252Smrg    sun3*:SunOS:*:*)
36576888252Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
3661ae1b5e8Smrg	exit ;;
36776888252Smrg    sun*:*:4.2BSD:*)
36876888252Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
36976888252Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
37076888252Smrg	case "`/bin/arch`" in
37176888252Smrg	    sun3)
37276888252Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
37376888252Smrg		;;
37476888252Smrg	    sun4)
37576888252Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
37676888252Smrg		;;
37776888252Smrg	esac
3781ae1b5e8Smrg	exit ;;
37976888252Smrg    aushp:SunOS:*:*)
38076888252Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
3811ae1b5e8Smrg	exit ;;
38276888252Smrg    # The situation for MiNT is a little confusing.  The machine name
38376888252Smrg    # can be virtually everything (everything which is not
38476888252Smrg    # "atarist" or "atariste" at least should have a processor
38576888252Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
38676888252Smrg    # to the lowercase version "mint" (or "freemint").  Finally
38776888252Smrg    # the system name "TOS" denotes a system which is actually not
38876888252Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
38976888252Smrg    # be no problem.
39076888252Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
39176888252Smrg        echo m68k-atari-mint${UNAME_RELEASE}
3921ae1b5e8Smrg	exit ;;
39376888252Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
39476888252Smrg	echo m68k-atari-mint${UNAME_RELEASE}
3951ae1b5e8Smrg        exit ;;
39676888252Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
39776888252Smrg        echo m68k-atari-mint${UNAME_RELEASE}
3981ae1b5e8Smrg	exit ;;
39976888252Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
40076888252Smrg        echo m68k-milan-mint${UNAME_RELEASE}
4011ae1b5e8Smrg        exit ;;
40276888252Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
40376888252Smrg        echo m68k-hades-mint${UNAME_RELEASE}
4041ae1b5e8Smrg        exit ;;
40576888252Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
40676888252Smrg        echo m68k-unknown-mint${UNAME_RELEASE}
4071ae1b5e8Smrg        exit ;;
4081ae1b5e8Smrg    m68k:machten:*:*)
4091ae1b5e8Smrg	echo m68k-apple-machten${UNAME_RELEASE}
4101ae1b5e8Smrg	exit ;;
41176888252Smrg    powerpc:machten:*:*)
41276888252Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
4131ae1b5e8Smrg	exit ;;
41476888252Smrg    RISC*:Mach:*:*)
41576888252Smrg	echo mips-dec-mach_bsd4.3
4161ae1b5e8Smrg	exit ;;
41776888252Smrg    RISC*:ULTRIX:*:*)
41876888252Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
4191ae1b5e8Smrg	exit ;;
42076888252Smrg    VAX*:ULTRIX*:*:*)
42176888252Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
4221ae1b5e8Smrg	exit ;;
42376888252Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
42476888252Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4251ae1b5e8Smrg	exit ;;
42676888252Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
42776888252Smrg	eval $set_cc_for_build
42876888252Smrg	sed 's/^	//' << EOF >$dummy.c
42976888252Smrg#ifdef __cplusplus
43076888252Smrg#include <stdio.h>  /* for printf() prototype */
43176888252Smrg	int main (int argc, char *argv[]) {
43276888252Smrg#else
43376888252Smrg	int main (argc, argv) int argc; char *argv[]; {
43476888252Smrg#endif
43576888252Smrg	#if defined (host_mips) && defined (MIPSEB)
43676888252Smrg	#if defined (SYSTYPE_SYSV)
43776888252Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
43876888252Smrg	#endif
43976888252Smrg	#if defined (SYSTYPE_SVR4)
44076888252Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
44176888252Smrg	#endif
44276888252Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
44376888252Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
44476888252Smrg	#endif
44576888252Smrg	#endif
44676888252Smrg	  exit (-1);
44776888252Smrg	}
44876888252SmrgEOF
4491ae1b5e8Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4501ae1b5e8Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4511ae1b5e8Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4521ae1b5e8Smrg	    { echo "$SYSTEM_NAME"; exit; }
45376888252Smrg	echo mips-mips-riscos${UNAME_RELEASE}
4541ae1b5e8Smrg	exit ;;
45576888252Smrg    Motorola:PowerMAX_OS:*:*)
45676888252Smrg	echo powerpc-motorola-powermax
4571ae1b5e8Smrg	exit ;;
45876888252Smrg    Motorola:*:4.3:PL8-*)
45976888252Smrg	echo powerpc-harris-powermax
4601ae1b5e8Smrg	exit ;;
46176888252Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
46276888252Smrg	echo powerpc-harris-powermax
4631ae1b5e8Smrg	exit ;;
46476888252Smrg    Night_Hawk:Power_UNIX:*:*)
46576888252Smrg	echo powerpc-harris-powerunix
4661ae1b5e8Smrg	exit ;;
46776888252Smrg    m88k:CX/UX:7*:*)
46876888252Smrg	echo m88k-harris-cxux7
4691ae1b5e8Smrg	exit ;;
47076888252Smrg    m88k:*:4*:R4*)
47176888252Smrg	echo m88k-motorola-sysv4
4721ae1b5e8Smrg	exit ;;
47376888252Smrg    m88k:*:3*:R3*)
47476888252Smrg	echo m88k-motorola-sysv3
4751ae1b5e8Smrg	exit ;;
47676888252Smrg    AViiON:dgux:*:*)
47776888252Smrg        # DG/UX returns AViiON for all architectures
47876888252Smrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
47976888252Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
48076888252Smrg	then
48176888252Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
48276888252Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
48376888252Smrg	    then
48476888252Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
48576888252Smrg	    else
48676888252Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
48776888252Smrg	    fi
48876888252Smrg	else
48976888252Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
49076888252Smrg	fi
4911ae1b5e8Smrg 	exit ;;
49276888252Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
49376888252Smrg	echo m88k-dolphin-sysv3
4941ae1b5e8Smrg	exit ;;
49576888252Smrg    M88*:*:R3*:*)
49676888252Smrg	# Delta 88k system running SVR3
49776888252Smrg	echo m88k-motorola-sysv3
4981ae1b5e8Smrg	exit ;;
49976888252Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
50076888252Smrg	echo m88k-tektronix-sysv3
5011ae1b5e8Smrg	exit ;;
50276888252Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
50376888252Smrg	echo m68k-tektronix-bsd
5041ae1b5e8Smrg	exit ;;
50576888252Smrg    *:IRIX*:*:*)
50676888252Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5071ae1b5e8Smrg	exit ;;
50876888252Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5091ae1b5e8Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5101ae1b5e8Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
51176888252Smrg    i*86:AIX:*:*)
51276888252Smrg	echo i386-ibm-aix
5131ae1b5e8Smrg	exit ;;
51476888252Smrg    ia64:AIX:*:*)
51576888252Smrg	if [ -x /usr/bin/oslevel ] ; then
51676888252Smrg		IBM_REV=`/usr/bin/oslevel`
51776888252Smrg	else
51876888252Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
51976888252Smrg	fi
52076888252Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5211ae1b5e8Smrg	exit ;;
52276888252Smrg    *:AIX:2:3)
52376888252Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
52476888252Smrg		eval $set_cc_for_build
52576888252Smrg		sed 's/^		//' << EOF >$dummy.c
52676888252Smrg		#include <sys/systemcfg.h>
52776888252Smrg
52876888252Smrg		main()
52976888252Smrg			{
53076888252Smrg			if (!__power_pc())
53176888252Smrg				exit(1);
53276888252Smrg			puts("powerpc-ibm-aix3.2.5");
53376888252Smrg			exit(0);
53476888252Smrg			}
53576888252SmrgEOF
5361ae1b5e8Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5371ae1b5e8Smrg		then
5381ae1b5e8Smrg			echo "$SYSTEM_NAME"
5391ae1b5e8Smrg		else
5401ae1b5e8Smrg			echo rs6000-ibm-aix3.2.5
5411ae1b5e8Smrg		fi
54276888252Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
54376888252Smrg		echo rs6000-ibm-aix3.2.4
54476888252Smrg	else
54576888252Smrg		echo rs6000-ibm-aix3.2
54676888252Smrg	fi
5471ae1b5e8Smrg	exit ;;
5481ae1b5e8Smrg    *:AIX:*:[456])
54976888252Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
55076888252Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
55176888252Smrg		IBM_ARCH=rs6000
55276888252Smrg	else
55376888252Smrg		IBM_ARCH=powerpc
55476888252Smrg	fi
55576888252Smrg	if [ -x /usr/bin/oslevel ] ; then
55676888252Smrg		IBM_REV=`/usr/bin/oslevel`
55776888252Smrg	else
55876888252Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
55976888252Smrg	fi
56076888252Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5611ae1b5e8Smrg	exit ;;
56276888252Smrg    *:AIX:*:*)
56376888252Smrg	echo rs6000-ibm-aix
5641ae1b5e8Smrg	exit ;;
56576888252Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
56676888252Smrg	echo romp-ibm-bsd4.4
5671ae1b5e8Smrg	exit ;;
56876888252Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
56976888252Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5701ae1b5e8Smrg	exit ;;                             # report: romp-ibm BSD 4.3
57176888252Smrg    *:BOSX:*:*)
57276888252Smrg	echo rs6000-bull-bosx
5731ae1b5e8Smrg	exit ;;
57476888252Smrg    DPX/2?00:B.O.S.:*:*)
57576888252Smrg	echo m68k-bull-sysv3
5761ae1b5e8Smrg	exit ;;
57776888252Smrg    9000/[34]??:4.3bsd:1.*:*)
57876888252Smrg	echo m68k-hp-bsd
5791ae1b5e8Smrg	exit ;;
58076888252Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
58176888252Smrg	echo m68k-hp-bsd4.4
5821ae1b5e8Smrg	exit ;;
58376888252Smrg    9000/[34678]??:HP-UX:*:*)
58476888252Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
58576888252Smrg	case "${UNAME_MACHINE}" in
58676888252Smrg	    9000/31? )            HP_ARCH=m68000 ;;
58776888252Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
58876888252Smrg	    9000/[678][0-9][0-9])
58976888252Smrg		if [ -x /usr/bin/getconf ]; then
59076888252Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
59176888252Smrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
59276888252Smrg                    case "${sc_cpu_version}" in
59376888252Smrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
59476888252Smrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
59576888252Smrg                      532)                      # CPU_PA_RISC2_0
59676888252Smrg                        case "${sc_kernel_bits}" in
59776888252Smrg                          32) HP_ARCH="hppa2.0n" ;;
59876888252Smrg                          64) HP_ARCH="hppa2.0w" ;;
59976888252Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
60076888252Smrg                        esac ;;
60176888252Smrg                    esac
60276888252Smrg		fi
60376888252Smrg		if [ "${HP_ARCH}" = "" ]; then
60476888252Smrg		    eval $set_cc_for_build
60576888252Smrg		    sed 's/^              //' << EOF >$dummy.c
60676888252Smrg
60776888252Smrg              #define _HPUX_SOURCE
60876888252Smrg              #include <stdlib.h>
60976888252Smrg              #include <unistd.h>
61076888252Smrg
61176888252Smrg              int main ()
61276888252Smrg              {
61376888252Smrg              #if defined(_SC_KERNEL_BITS)
61476888252Smrg                  long bits = sysconf(_SC_KERNEL_BITS);
61576888252Smrg              #endif
61676888252Smrg                  long cpu  = sysconf (_SC_CPU_VERSION);
61776888252Smrg
61876888252Smrg                  switch (cpu)
61976888252Smrg              	{
62076888252Smrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
62176888252Smrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
62276888252Smrg              	case CPU_PA_RISC2_0:
62376888252Smrg              #if defined(_SC_KERNEL_BITS)
62476888252Smrg              	    switch (bits)
62576888252Smrg              		{
62676888252Smrg              		case 64: puts ("hppa2.0w"); break;
62776888252Smrg              		case 32: puts ("hppa2.0n"); break;
62876888252Smrg              		default: puts ("hppa2.0"); break;
62976888252Smrg              		} break;
63076888252Smrg              #else  /* !defined(_SC_KERNEL_BITS) */
63176888252Smrg              	    puts ("hppa2.0"); break;
63276888252Smrg              #endif
63376888252Smrg              	default: puts ("hppa1.0"); break;
63476888252Smrg              	}
63576888252Smrg                  exit (0);
63676888252Smrg              }
63776888252SmrgEOF
63876888252Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
63976888252Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
64076888252Smrg		fi ;;
64176888252Smrg	esac
64276888252Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
64376888252Smrg	then
6441ae1b5e8Smrg	    eval $set_cc_for_build
6451ae1b5e8Smrg
6461ae1b5e8Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6471ae1b5e8Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6481ae1b5e8Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6491ae1b5e8Smrg	    #
6501ae1b5e8Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
6511ae1b5e8Smrg	    # => hppa2.0w-hp-hpux11.23
6521ae1b5e8Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6531ae1b5e8Smrg	    # => hppa64-hp-hpux11.23
6541ae1b5e8Smrg
6551ae1b5e8Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
6561ae1b5e8Smrg		grep __LP64__ >/dev/null
65776888252Smrg	    then
65876888252Smrg		HP_ARCH="hppa2.0w"
65976888252Smrg	    else
66076888252Smrg		HP_ARCH="hppa64"
66176888252Smrg	    fi
66276888252Smrg	fi
66376888252Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6641ae1b5e8Smrg	exit ;;
66576888252Smrg    ia64:HP-UX:*:*)
66676888252Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
66776888252Smrg	echo ia64-hp-hpux${HPUX_REV}
6681ae1b5e8Smrg	exit ;;
66976888252Smrg    3050*:HI-UX:*:*)
67076888252Smrg	eval $set_cc_for_build
67176888252Smrg	sed 's/^	//' << EOF >$dummy.c
67276888252Smrg	#include <unistd.h>
67376888252Smrg	int
67476888252Smrg	main ()
67576888252Smrg	{
67676888252Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
67776888252Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
67876888252Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
67976888252Smrg	     results, however.  */
68076888252Smrg	  if (CPU_IS_PA_RISC (cpu))
68176888252Smrg	    {
68276888252Smrg	      switch (cpu)
68376888252Smrg		{
68476888252Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
68576888252Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
68676888252Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
68776888252Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
68876888252Smrg		}
68976888252Smrg	    }
69076888252Smrg	  else if (CPU_IS_HP_MC68K (cpu))
69176888252Smrg	    puts ("m68k-hitachi-hiuxwe2");
69276888252Smrg	  else puts ("unknown-hitachi-hiuxwe2");
69376888252Smrg	  exit (0);
69476888252Smrg	}
69576888252SmrgEOF
6961ae1b5e8Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
6971ae1b5e8Smrg		{ echo "$SYSTEM_NAME"; exit; }
69876888252Smrg	echo unknown-hitachi-hiuxwe2
6991ae1b5e8Smrg	exit ;;
70076888252Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
70176888252Smrg	echo hppa1.1-hp-bsd
7021ae1b5e8Smrg	exit ;;
70376888252Smrg    9000/8??:4.3bsd:*:*)
70476888252Smrg	echo hppa1.0-hp-bsd
7051ae1b5e8Smrg	exit ;;
70676888252Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
70776888252Smrg	echo hppa1.0-hp-mpeix
7081ae1b5e8Smrg	exit ;;
70976888252Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
71076888252Smrg	echo hppa1.1-hp-osf
7111ae1b5e8Smrg	exit ;;
71276888252Smrg    hp8??:OSF1:*:*)
71376888252Smrg	echo hppa1.0-hp-osf
7141ae1b5e8Smrg	exit ;;
71576888252Smrg    i*86:OSF1:*:*)
71676888252Smrg	if [ -x /usr/sbin/sysversion ] ; then
71776888252Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
71876888252Smrg	else
71976888252Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
72076888252Smrg	fi
7211ae1b5e8Smrg	exit ;;
72276888252Smrg    parisc*:Lites*:*:*)
72376888252Smrg	echo hppa1.1-hp-lites
7241ae1b5e8Smrg	exit ;;
72576888252Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
72676888252Smrg	echo c1-convex-bsd
7271ae1b5e8Smrg        exit ;;
72876888252Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
72976888252Smrg	if getsysinfo -f scalar_acc
73076888252Smrg	then echo c32-convex-bsd
73176888252Smrg	else echo c2-convex-bsd
73276888252Smrg	fi
7331ae1b5e8Smrg        exit ;;
73476888252Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
73576888252Smrg	echo c34-convex-bsd
7361ae1b5e8Smrg        exit ;;
73776888252Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
73876888252Smrg	echo c38-convex-bsd
7391ae1b5e8Smrg        exit ;;
74076888252Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
74176888252Smrg	echo c4-convex-bsd
7421ae1b5e8Smrg        exit ;;
74376888252Smrg    CRAY*Y-MP:*:*:*)
74476888252Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7451ae1b5e8Smrg	exit ;;
74676888252Smrg    CRAY*[A-Z]90:*:*:*)
74776888252Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
74876888252Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
74976888252Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
75076888252Smrg	      -e 's/\.[^.]*$/.X/'
7511ae1b5e8Smrg	exit ;;
75276888252Smrg    CRAY*TS:*:*:*)
75376888252Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7541ae1b5e8Smrg	exit ;;
75576888252Smrg    CRAY*T3E:*:*:*)
75676888252Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7571ae1b5e8Smrg	exit ;;
75876888252Smrg    CRAY*SV1:*:*:*)
75976888252Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7601ae1b5e8Smrg	exit ;;
76176888252Smrg    *:UNICOS/mp:*:*)
7621ae1b5e8Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7631ae1b5e8Smrg	exit ;;
76476888252Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
76576888252Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
76676888252Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
76776888252Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
76876888252Smrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7691ae1b5e8Smrg        exit ;;
7701ae1b5e8Smrg    5000:UNIX_System_V:4.*:*)
7711ae1b5e8Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7721ae1b5e8Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
7731ae1b5e8Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7741ae1b5e8Smrg	exit ;;
77576888252Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
77676888252Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
7771ae1b5e8Smrg	exit ;;
77876888252Smrg    sparc*:BSD/OS:*:*)
77976888252Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
7801ae1b5e8Smrg	exit ;;
78176888252Smrg    *:BSD/OS:*:*)
78276888252Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
7831ae1b5e8Smrg	exit ;;
7841ae1b5e8Smrg    *:FreeBSD:*:*)
7851ae1b5e8Smrg	case ${UNAME_MACHINE} in
7861ae1b5e8Smrg	    pc98)
7871ae1b5e8Smrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7881ae1b5e8Smrg	    amd64)
7891ae1b5e8Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7901ae1b5e8Smrg	    *)
7911ae1b5e8Smrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7921ae1b5e8Smrg	esac
7931ae1b5e8Smrg	exit ;;
79476888252Smrg    i*:CYGWIN*:*)
79576888252Smrg	echo ${UNAME_MACHINE}-pc-cygwin
7961ae1b5e8Smrg	exit ;;
7971ae1b5e8Smrg    *:MINGW*:*)
79876888252Smrg	echo ${UNAME_MACHINE}-pc-mingw32
7991ae1b5e8Smrg	exit ;;
8001ae1b5e8Smrg    i*:windows32*:*)
8011ae1b5e8Smrg    	# uname -m includes "-pc" on this system.
8021ae1b5e8Smrg    	echo ${UNAME_MACHINE}-mingw32
8031ae1b5e8Smrg	exit ;;
80476888252Smrg    i*:PW*:*)
80576888252Smrg	echo ${UNAME_MACHINE}-pc-pw32
8061ae1b5e8Smrg	exit ;;
8071ae1b5e8Smrg    *:Interix*:[3456]*)
8081ae1b5e8Smrg    	case ${UNAME_MACHINE} in
8091ae1b5e8Smrg	    x86)
8101ae1b5e8Smrg		echo i586-pc-interix${UNAME_RELEASE}
8111ae1b5e8Smrg		exit ;;
8121ae1b5e8Smrg	    EM64T | authenticamd | genuineintel)
8131ae1b5e8Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
8141ae1b5e8Smrg		exit ;;
8151ae1b5e8Smrg	    IA64)
8161ae1b5e8Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
8171ae1b5e8Smrg		exit ;;
8181ae1b5e8Smrg	esac ;;
81976888252Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
82076888252Smrg	echo i${UNAME_MACHINE}-pc-mks
8211ae1b5e8Smrg	exit ;;
82276888252Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
82376888252Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
82476888252Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
82576888252Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
82676888252Smrg	echo i586-pc-interix
8271ae1b5e8Smrg	exit ;;
82876888252Smrg    i*:UWIN*:*)
82976888252Smrg	echo ${UNAME_MACHINE}-pc-uwin
8301ae1b5e8Smrg	exit ;;
8311ae1b5e8Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8321ae1b5e8Smrg	echo x86_64-unknown-cygwin
8331ae1b5e8Smrg	exit ;;
83476888252Smrg    p*:CYGWIN*:*)
83576888252Smrg	echo powerpcle-unknown-cygwin
8361ae1b5e8Smrg	exit ;;
83776888252Smrg    prep*:SunOS:5.*:*)
83876888252Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8391ae1b5e8Smrg	exit ;;
84076888252Smrg    *:GNU:*:*)
8411ae1b5e8Smrg	# the GNU system
84276888252Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8431ae1b5e8Smrg	exit ;;
8441ae1b5e8Smrg    *:GNU/*:*:*)
8451ae1b5e8Smrg	# other systems with GNU libc and userland
8461ae1b5e8Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
8471ae1b5e8Smrg	exit ;;
84876888252Smrg    i*86:Minix:*:*)
84976888252Smrg	echo ${UNAME_MACHINE}-pc-minix
8501ae1b5e8Smrg	exit ;;
85176888252Smrg    arm*:Linux:*:*)
8521ae1b5e8Smrg	eval $set_cc_for_build
8531ae1b5e8Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
8541ae1b5e8Smrg	    | grep -q __ARM_EABI__
8551ae1b5e8Smrg	then
8561ae1b5e8Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
8571ae1b5e8Smrg	else
8581ae1b5e8Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
8591ae1b5e8Smrg	fi
8601ae1b5e8Smrg	exit ;;
8611ae1b5e8Smrg    avr32*:Linux:*:*)
86276888252Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8631ae1b5e8Smrg	exit ;;
86476888252Smrg    cris:Linux:*:*)
86576888252Smrg	echo cris-axis-linux-gnu
8661ae1b5e8Smrg	exit ;;
8671ae1b5e8Smrg    crisv32:Linux:*:*)
8681ae1b5e8Smrg	echo crisv32-axis-linux-gnu
8691ae1b5e8Smrg	exit ;;
8701ae1b5e8Smrg    frv:Linux:*:*)
8711ae1b5e8Smrg    	echo frv-unknown-linux-gnu
8721ae1b5e8Smrg	exit ;;
87376888252Smrg    ia64:Linux:*:*)
8741ae1b5e8Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8751ae1b5e8Smrg	exit ;;
8761ae1b5e8Smrg    m32r*:Linux:*:*)
8771ae1b5e8Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8781ae1b5e8Smrg	exit ;;
87976888252Smrg    m68*:Linux:*:*)
88076888252Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8811ae1b5e8Smrg	exit ;;
88276888252Smrg    mips:Linux:*:*)
88376888252Smrg	eval $set_cc_for_build
88476888252Smrg	sed 's/^	//' << EOF >$dummy.c
88576888252Smrg	#undef CPU
88676888252Smrg	#undef mips
88776888252Smrg	#undef mipsel
88876888252Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
88976888252Smrg	CPU=mipsel
89076888252Smrg	#else
89176888252Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
89276888252Smrg	CPU=mips
89376888252Smrg	#else
89476888252Smrg	CPU=
89576888252Smrg	#endif
89676888252Smrg	#endif
89776888252SmrgEOF
8981ae1b5e8Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
8991ae1b5e8Smrg	    /^CPU/{
9001ae1b5e8Smrg		s: ::g
9011ae1b5e8Smrg		p
9021ae1b5e8Smrg	    }'`"
9031ae1b5e8Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
90476888252Smrg	;;
90576888252Smrg    mips64:Linux:*:*)
90676888252Smrg	eval $set_cc_for_build
90776888252Smrg	sed 's/^	//' << EOF >$dummy.c
90876888252Smrg	#undef CPU
90976888252Smrg	#undef mips64
91076888252Smrg	#undef mips64el
91176888252Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
91276888252Smrg	CPU=mips64el
91376888252Smrg	#else
91476888252Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
91576888252Smrg	CPU=mips64
91676888252Smrg	#else
91776888252Smrg	CPU=
91876888252Smrg	#endif
91976888252Smrg	#endif
92076888252SmrgEOF
9211ae1b5e8Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
9221ae1b5e8Smrg	    /^CPU/{
9231ae1b5e8Smrg		s: ::g
9241ae1b5e8Smrg		p
9251ae1b5e8Smrg	    }'`"
9261ae1b5e8Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
92776888252Smrg	;;
9281ae1b5e8Smrg    or32:Linux:*:*)
9291ae1b5e8Smrg	echo or32-unknown-linux-gnu
9301ae1b5e8Smrg	exit ;;
93176888252Smrg    ppc:Linux:*:*)
9321ae1b5e8Smrg	echo powerpc-unknown-linux-gnu
9331ae1b5e8Smrg	exit ;;
93476888252Smrg    ppc64:Linux:*:*)
9351ae1b5e8Smrg	echo powerpc64-unknown-linux-gnu
9361ae1b5e8Smrg	exit ;;
93776888252Smrg    alpha:Linux:*:*)
93876888252Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
93976888252Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
94076888252Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
94176888252Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
94276888252Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
94376888252Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
94476888252Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
94576888252Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
94676888252Smrg        esac
94776888252Smrg	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
94876888252Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
94976888252Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
9501ae1b5e8Smrg	exit ;;
9511ae1b5e8Smrg    padre:Linux:*:*)
9521ae1b5e8Smrg	echo sparc-unknown-linux-gnu
9531ae1b5e8Smrg	exit ;;
95476888252Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
95576888252Smrg	# Look for CPU level
95676888252Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
95776888252Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
95876888252Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
95976888252Smrg	  *)    echo hppa-unknown-linux-gnu ;;
96076888252Smrg	esac
9611ae1b5e8Smrg	exit ;;
96276888252Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
96376888252Smrg	echo hppa64-unknown-linux-gnu
9641ae1b5e8Smrg	exit ;;
96576888252Smrg    s390:Linux:*:* | s390x:Linux:*:*)
9661ae1b5e8Smrg	echo ${UNAME_MACHINE}-ibm-linux
9671ae1b5e8Smrg	exit ;;
96876888252Smrg    sh64*:Linux:*:*)
96976888252Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
9701ae1b5e8Smrg	exit ;;
97176888252Smrg    sh*:Linux:*:*)
97276888252Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9731ae1b5e8Smrg	exit ;;
97476888252Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
97576888252Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9761ae1b5e8Smrg	exit ;;
9771ae1b5e8Smrg    vax:Linux:*:*)
9781ae1b5e8Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
9791ae1b5e8Smrg	exit ;;
98076888252Smrg    x86_64:Linux:*:*)
9811ae1b5e8Smrg	echo x86_64-unknown-linux-gnu
9821ae1b5e8Smrg	exit ;;
9831ae1b5e8Smrg    xtensa*:Linux:*:*)
9841ae1b5e8Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
9851ae1b5e8Smrg	exit ;;
98676888252Smrg    i*86:Linux:*:*)
98776888252Smrg	# The BFD linker knows what the default object file format is, so
98876888252Smrg	# first see if it will tell us. cd to the root directory to prevent
98976888252Smrg	# problems with other programs or directories called `ld' in the path.
99076888252Smrg	# Set LC_ALL=C to ensure ld outputs messages in English.
99176888252Smrg	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
99276888252Smrg			 | sed -ne '/supported targets:/!d
99376888252Smrg				    s/[ 	][ 	]*/ /g
99476888252Smrg				    s/.*supported targets: *//
99576888252Smrg				    s/ .*//
99676888252Smrg				    p'`
99776888252Smrg        case "$ld_supported_targets" in
99876888252Smrg	  elf32-i386)
99976888252Smrg		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
100076888252Smrg		;;
100176888252Smrg	  a.out-i386-linux)
100276888252Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
10031ae1b5e8Smrg		exit ;;
100476888252Smrg	  "")
100576888252Smrg		# Either a pre-BFD a.out linker (linux-gnuoldld) or
100676888252Smrg		# one that does not give us useful --help.
100776888252Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
10081ae1b5e8Smrg		exit ;;
100976888252Smrg	esac
101076888252Smrg	# Determine whether the default compiler is a.out or elf
101176888252Smrg	eval $set_cc_for_build
101276888252Smrg	sed 's/^	//' << EOF >$dummy.c
101376888252Smrg	#include <features.h>
101476888252Smrg	#ifdef __ELF__
101576888252Smrg	# ifdef __GLIBC__
101676888252Smrg	#  if __GLIBC__ >= 2
101776888252Smrg	LIBC=gnu
101876888252Smrg	#  else
101976888252Smrg	LIBC=gnulibc1
102076888252Smrg	#  endif
102176888252Smrg	# else
102276888252Smrg	LIBC=gnulibc1
102376888252Smrg	# endif
102476888252Smrg	#else
10251ae1b5e8Smrg	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
102676888252Smrg	LIBC=gnu
102776888252Smrg	#else
102876888252Smrg	LIBC=gnuaout
102976888252Smrg	#endif
103076888252Smrg	#endif
10311ae1b5e8Smrg	#ifdef __dietlibc__
10321ae1b5e8Smrg	LIBC=dietlibc
10331ae1b5e8Smrg	#endif
103476888252SmrgEOF
10351ae1b5e8Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
10361ae1b5e8Smrg	    /^LIBC/{
10371ae1b5e8Smrg		s: ::g
10381ae1b5e8Smrg		p
10391ae1b5e8Smrg	    }'`"
10401ae1b5e8Smrg	test x"${LIBC}" != x && {
10411ae1b5e8Smrg		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
10421ae1b5e8Smrg		exit
10431ae1b5e8Smrg	}
10441ae1b5e8Smrg	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
104576888252Smrg	;;
104676888252Smrg    i*86:DYNIX/ptx:4*:*)
104776888252Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
104876888252Smrg	# earlier versions are messed up and put the nodename in both
104976888252Smrg	# sysname and nodename.
105076888252Smrg	echo i386-sequent-sysv4
10511ae1b5e8Smrg	exit ;;
105276888252Smrg    i*86:UNIX_SV:4.2MP:2.*)
105376888252Smrg        # Unixware is an offshoot of SVR4, but it has its own version
105476888252Smrg        # number series starting with 2...
105576888252Smrg        # I am not positive that other SVR4 systems won't match this,
105676888252Smrg	# I just have to hope.  -- rms.
105776888252Smrg        # Use sysv4.2uw... so that sysv4* matches it.
105876888252Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10591ae1b5e8Smrg	exit ;;
106076888252Smrg    i*86:OS/2:*:*)
106176888252Smrg	# If we were able to find `uname', then EMX Unix compatibility
106276888252Smrg	# is probably installed.
106376888252Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
10641ae1b5e8Smrg	exit ;;
106576888252Smrg    i*86:XTS-300:*:STOP)
106676888252Smrg	echo ${UNAME_MACHINE}-unknown-stop
10671ae1b5e8Smrg	exit ;;
106876888252Smrg    i*86:atheos:*:*)
106976888252Smrg	echo ${UNAME_MACHINE}-unknown-atheos
10701ae1b5e8Smrg	exit ;;
10711ae1b5e8Smrg    i*86:syllable:*:*)
10721ae1b5e8Smrg	echo ${UNAME_MACHINE}-pc-syllable
10731ae1b5e8Smrg	exit ;;
107476888252Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
107576888252Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10761ae1b5e8Smrg	exit ;;
107776888252Smrg    i*86:*DOS:*:*)
107876888252Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10791ae1b5e8Smrg	exit ;;
108076888252Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
108176888252Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
108276888252Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
108376888252Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
108476888252Smrg	else
108576888252Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
108676888252Smrg	fi
10871ae1b5e8Smrg	exit ;;
10881ae1b5e8Smrg    i*86:*:5:[678]*)
10891ae1b5e8Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
109076888252Smrg	case `/bin/uname -X | grep "^Machine"` in
109176888252Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
109276888252Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
109376888252Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
109476888252Smrg	esac
109576888252Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10961ae1b5e8Smrg	exit ;;
109776888252Smrg    i*86:*:3.2:*)
109876888252Smrg	if test -f /usr/options/cb.name; then
109976888252Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
110076888252Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
110176888252Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
110276888252Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
110376888252Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
110476888252Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
110576888252Smrg			&& UNAME_MACHINE=i586
110676888252Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
110776888252Smrg			&& UNAME_MACHINE=i686
110876888252Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
110976888252Smrg			&& UNAME_MACHINE=i686
111076888252Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
111176888252Smrg	else
111276888252Smrg		echo ${UNAME_MACHINE}-pc-sysv32
111376888252Smrg	fi
11141ae1b5e8Smrg	exit ;;
111576888252Smrg    pc:*:*:*)
111676888252Smrg	# Left here for compatibility:
111776888252Smrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
111876888252Smrg        # the processor, so we play safe by assuming i386.
111976888252Smrg	echo i386-pc-msdosdjgpp
11201ae1b5e8Smrg        exit ;;
112176888252Smrg    Intel:Mach:3*:*)
112276888252Smrg	echo i386-pc-mach3
11231ae1b5e8Smrg	exit ;;
112476888252Smrg    paragon:*:*:*)
112576888252Smrg	echo i860-intel-osf1
11261ae1b5e8Smrg	exit ;;
112776888252Smrg    i860:*:4.*:*) # i860-SVR4
112876888252Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
112976888252Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
113076888252Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
113176888252Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
113276888252Smrg	fi
11331ae1b5e8Smrg	exit ;;
113476888252Smrg    mini*:CTIX:SYS*5:*)
113576888252Smrg	# "miniframe"
113676888252Smrg	echo m68010-convergent-sysv
11371ae1b5e8Smrg	exit ;;
113876888252Smrg    mc68k:UNIX:SYSTEM5:3.51m)
113976888252Smrg	echo m68k-convergent-sysv
11401ae1b5e8Smrg	exit ;;
114176888252Smrg    M680?0:D-NIX:5.3:*)
114276888252Smrg	echo m68k-diab-dnix
11431ae1b5e8Smrg	exit ;;
11441ae1b5e8Smrg    M68*:*:R3V[5678]*:*)
11451ae1b5e8Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11461ae1b5e8Smrg    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)
114776888252Smrg	OS_REL=''
114876888252Smrg	test -r /etc/.relid \
114976888252Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
115076888252Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11511ae1b5e8Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
115276888252Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11531ae1b5e8Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
115476888252Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
115576888252Smrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11561ae1b5e8Smrg          && { echo i486-ncr-sysv4; exit; } ;;
11571ae1b5e8Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
11581ae1b5e8Smrg	OS_REL='.3'
11591ae1b5e8Smrg	test -r /etc/.relid \
11601ae1b5e8Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11611ae1b5e8Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11621ae1b5e8Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11631ae1b5e8Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11641ae1b5e8Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
11651ae1b5e8Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
11661ae1b5e8Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
116776888252Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
116876888252Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11691ae1b5e8Smrg	exit ;;
117076888252Smrg    mc68030:UNIX_System_V:4.*:*)
117176888252Smrg	echo m68k-atari-sysv4
11721ae1b5e8Smrg	exit ;;
117376888252Smrg    TSUNAMI:LynxOS:2.*:*)
117476888252Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11751ae1b5e8Smrg	exit ;;
117676888252Smrg    rs6000:LynxOS:2.*:*)
117776888252Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11781ae1b5e8Smrg	exit ;;
117976888252Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
118076888252Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11811ae1b5e8Smrg	exit ;;
118276888252Smrg    SM[BE]S:UNIX_SV:*:*)
118376888252Smrg	echo mips-dde-sysv${UNAME_RELEASE}
11841ae1b5e8Smrg	exit ;;
118576888252Smrg    RM*:ReliantUNIX-*:*:*)
118676888252Smrg	echo mips-sni-sysv4
11871ae1b5e8Smrg	exit ;;
118876888252Smrg    RM*:SINIX-*:*:*)
118976888252Smrg	echo mips-sni-sysv4
11901ae1b5e8Smrg	exit ;;
119176888252Smrg    *:SINIX-*:*:*)
119276888252Smrg	if uname -p 2>/dev/null >/dev/null ; then
119376888252Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
119476888252Smrg		echo ${UNAME_MACHINE}-sni-sysv4
119576888252Smrg	else
119676888252Smrg		echo ns32k-sni-sysv
119776888252Smrg	fi
11981ae1b5e8Smrg	exit ;;
119976888252Smrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
120076888252Smrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
120176888252Smrg        echo i586-unisys-sysv4
12021ae1b5e8Smrg        exit ;;
120376888252Smrg    *:UNIX_System_V:4*:FTX*)
120476888252Smrg	# From Gerald Hewes <hewes@openmarket.com>.
120576888252Smrg	# How about differentiating between stratus architectures? -djm
120676888252Smrg	echo hppa1.1-stratus-sysv4
12071ae1b5e8Smrg	exit ;;
120876888252Smrg    *:*:*:FTX*)
120976888252Smrg	# From seanf@swdc.stratus.com.
121076888252Smrg	echo i860-stratus-sysv4
12111ae1b5e8Smrg	exit ;;
12121ae1b5e8Smrg    i*86:VOS:*:*)
12131ae1b5e8Smrg	# From Paul.Green@stratus.com.
12141ae1b5e8Smrg	echo ${UNAME_MACHINE}-stratus-vos
12151ae1b5e8Smrg	exit ;;
121676888252Smrg    *:VOS:*:*)
121776888252Smrg	# From Paul.Green@stratus.com.
121876888252Smrg	echo hppa1.1-stratus-vos
12191ae1b5e8Smrg	exit ;;
122076888252Smrg    mc68*:A/UX:*:*)
122176888252Smrg	echo m68k-apple-aux${UNAME_RELEASE}
12221ae1b5e8Smrg	exit ;;
122376888252Smrg    news*:NEWS-OS:6*:*)
122476888252Smrg	echo mips-sony-newsos6
12251ae1b5e8Smrg	exit ;;
122676888252Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
122776888252Smrg	if [ -d /usr/nec ]; then
122876888252Smrg	        echo mips-nec-sysv${UNAME_RELEASE}
122976888252Smrg	else
123076888252Smrg	        echo mips-unknown-sysv${UNAME_RELEASE}
123176888252Smrg	fi
12321ae1b5e8Smrg        exit ;;
123376888252Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
123476888252Smrg	echo powerpc-be-beos
12351ae1b5e8Smrg	exit ;;
123676888252Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
123776888252Smrg	echo powerpc-apple-beos
12381ae1b5e8Smrg	exit ;;
123976888252Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
124076888252Smrg	echo i586-pc-beos
12411ae1b5e8Smrg	exit ;;
12421ae1b5e8Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
12431ae1b5e8Smrg	echo i586-pc-haiku
12441ae1b5e8Smrg	exit ;;
124576888252Smrg    SX-4:SUPER-UX:*:*)
124676888252Smrg	echo sx4-nec-superux${UNAME_RELEASE}
12471ae1b5e8Smrg	exit ;;
124876888252Smrg    SX-5:SUPER-UX:*:*)
124976888252Smrg	echo sx5-nec-superux${UNAME_RELEASE}
12501ae1b5e8Smrg	exit ;;
125176888252Smrg    SX-6:SUPER-UX:*:*)
125276888252Smrg	echo sx6-nec-superux${UNAME_RELEASE}
12531ae1b5e8Smrg	exit ;;
12541ae1b5e8Smrg    SX-7:SUPER-UX:*:*)
12551ae1b5e8Smrg	echo sx7-nec-superux${UNAME_RELEASE}
12561ae1b5e8Smrg	exit ;;
12571ae1b5e8Smrg    SX-8:SUPER-UX:*:*)
12581ae1b5e8Smrg	echo sx8-nec-superux${UNAME_RELEASE}
12591ae1b5e8Smrg	exit ;;
12601ae1b5e8Smrg    SX-8R:SUPER-UX:*:*)
12611ae1b5e8Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
12621ae1b5e8Smrg	exit ;;
126376888252Smrg    Power*:Rhapsody:*:*)
126476888252Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12651ae1b5e8Smrg	exit ;;
126676888252Smrg    *:Rhapsody:*:*)
126776888252Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12681ae1b5e8Smrg	exit ;;
126976888252Smrg    *:Darwin:*:*)
12701ae1b5e8Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12711ae1b5e8Smrg	case $UNAME_PROCESSOR in
12721ae1b5e8Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
127376888252Smrg	esac
127476888252Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12751ae1b5e8Smrg	exit ;;
127676888252Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
127776888252Smrg	UNAME_PROCESSOR=`uname -p`
127876888252Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
127976888252Smrg		UNAME_PROCESSOR=i386
128076888252Smrg		UNAME_MACHINE=pc
128176888252Smrg	fi
128276888252Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
12831ae1b5e8Smrg	exit ;;
128476888252Smrg    *:QNX:*:4*)
128576888252Smrg	echo i386-pc-qnx
12861ae1b5e8Smrg	exit ;;
12871ae1b5e8Smrg    NSE-?:NONSTOP_KERNEL:*:*)
12881ae1b5e8Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
12891ae1b5e8Smrg	exit ;;
12901ae1b5e8Smrg    NSR-?:NONSTOP_KERNEL:*:*)
129176888252Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
12921ae1b5e8Smrg	exit ;;
129376888252Smrg    *:NonStop-UX:*:*)
129476888252Smrg	echo mips-compaq-nonstopux
12951ae1b5e8Smrg	exit ;;
129676888252Smrg    BS2000:POSIX*:*:*)
129776888252Smrg	echo bs2000-siemens-sysv
12981ae1b5e8Smrg	exit ;;
129976888252Smrg    DS/*:UNIX_System_V:*:*)
130076888252Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
13011ae1b5e8Smrg	exit ;;
130276888252Smrg    *:Plan9:*:*)
130376888252Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
130476888252Smrg	# is converted to i386 for consistency with other x86
130576888252Smrg	# operating systems.
130676888252Smrg	if test "$cputype" = "386"; then
130776888252Smrg	    UNAME_MACHINE=i386
130876888252Smrg	else
130976888252Smrg	    UNAME_MACHINE="$cputype"
131076888252Smrg	fi
131176888252Smrg	echo ${UNAME_MACHINE}-unknown-plan9
13121ae1b5e8Smrg	exit ;;
131376888252Smrg    *:TOPS-10:*:*)
131476888252Smrg	echo pdp10-unknown-tops10
13151ae1b5e8Smrg	exit ;;
131676888252Smrg    *:TENEX:*:*)
131776888252Smrg	echo pdp10-unknown-tenex
13181ae1b5e8Smrg	exit ;;
131976888252Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
132076888252Smrg	echo pdp10-dec-tops20
13211ae1b5e8Smrg	exit ;;
132276888252Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
132376888252Smrg	echo pdp10-xkl-tops20
13241ae1b5e8Smrg	exit ;;
132576888252Smrg    *:TOPS-20:*:*)
132676888252Smrg	echo pdp10-unknown-tops20
13271ae1b5e8Smrg	exit ;;
132876888252Smrg    *:ITS:*:*)
132976888252Smrg	echo pdp10-unknown-its
13301ae1b5e8Smrg	exit ;;
133176888252Smrg    SEI:*:*:SEIUX)
133276888252Smrg        echo mips-sei-seiux${UNAME_RELEASE}
13331ae1b5e8Smrg	exit ;;
13341ae1b5e8Smrg    *:DragonFly:*:*)
13351ae1b5e8Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13361ae1b5e8Smrg	exit ;;
13371ae1b5e8Smrg    *:*VMS:*:*)
13381ae1b5e8Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13391ae1b5e8Smrg	case "${UNAME_MACHINE}" in
13401ae1b5e8Smrg	    A*) echo alpha-dec-vms ; exit ;;
13411ae1b5e8Smrg	    I*) echo ia64-dec-vms ; exit ;;
13421ae1b5e8Smrg	    V*) echo vax-dec-vms ; exit ;;
13431ae1b5e8Smrg	esac ;;
13441ae1b5e8Smrg    *:XENIX:*:SysV)
13451ae1b5e8Smrg	echo i386-pc-xenix
13461ae1b5e8Smrg	exit ;;
13471ae1b5e8Smrg    i*86:skyos:*:*)
13481ae1b5e8Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13491ae1b5e8Smrg	exit ;;
13501ae1b5e8Smrg    i*86:rdos:*:*)
13511ae1b5e8Smrg	echo ${UNAME_MACHINE}-pc-rdos
13521ae1b5e8Smrg	exit ;;
13531ae1b5e8Smrg    i*86:AROS:*:*)
13541ae1b5e8Smrg	echo ${UNAME_MACHINE}-pc-aros
13551ae1b5e8Smrg	exit ;;
135676888252Smrgesac
135776888252Smrg
135876888252Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
135976888252Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
136076888252Smrg
136176888252Smrgeval $set_cc_for_build
136276888252Smrgcat >$dummy.c <<EOF
136376888252Smrg#ifdef _SEQUENT_
136476888252Smrg# include <sys/types.h>
136576888252Smrg# include <sys/utsname.h>
136676888252Smrg#endif
136776888252Smrgmain ()
136876888252Smrg{
136976888252Smrg#if defined (sony)
137076888252Smrg#if defined (MIPSEB)
137176888252Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
137276888252Smrg     I don't know....  */
137376888252Smrg  printf ("mips-sony-bsd\n"); exit (0);
137476888252Smrg#else
137576888252Smrg#include <sys/param.h>
137676888252Smrg  printf ("m68k-sony-newsos%s\n",
137776888252Smrg#ifdef NEWSOS4
137876888252Smrg          "4"
137976888252Smrg#else
138076888252Smrg	  ""
138176888252Smrg#endif
138276888252Smrg         ); exit (0);
138376888252Smrg#endif
138476888252Smrg#endif
138576888252Smrg
138676888252Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
13871ae1b5e8Smrg  printf ("arm-acorn-riscix\n"); exit (0);
138876888252Smrg#endif
138976888252Smrg
139076888252Smrg#if defined (hp300) && !defined (hpux)
139176888252Smrg  printf ("m68k-hp-bsd\n"); exit (0);
139276888252Smrg#endif
139376888252Smrg
139476888252Smrg#if defined (NeXT)
139576888252Smrg#if !defined (__ARCHITECTURE__)
139676888252Smrg#define __ARCHITECTURE__ "m68k"
139776888252Smrg#endif
139876888252Smrg  int version;
139976888252Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
140076888252Smrg  if (version < 4)
140176888252Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
140276888252Smrg  else
140376888252Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
140476888252Smrg  exit (0);
140576888252Smrg#endif
140676888252Smrg
140776888252Smrg#if defined (MULTIMAX) || defined (n16)
140876888252Smrg#if defined (UMAXV)
140976888252Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
141076888252Smrg#else
141176888252Smrg#if defined (CMU)
141276888252Smrg  printf ("ns32k-encore-mach\n"); exit (0);
141376888252Smrg#else
141476888252Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
141576888252Smrg#endif
141676888252Smrg#endif
141776888252Smrg#endif
141876888252Smrg
141976888252Smrg#if defined (__386BSD__)
142076888252Smrg  printf ("i386-pc-bsd\n"); exit (0);
142176888252Smrg#endif
142276888252Smrg
142376888252Smrg#if defined (sequent)
142476888252Smrg#if defined (i386)
142576888252Smrg  printf ("i386-sequent-dynix\n"); exit (0);
142676888252Smrg#endif
142776888252Smrg#if defined (ns32000)
142876888252Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
142976888252Smrg#endif
143076888252Smrg#endif
143176888252Smrg
143276888252Smrg#if defined (_SEQUENT_)
143376888252Smrg    struct utsname un;
143476888252Smrg
143576888252Smrg    uname(&un);
143676888252Smrg
143776888252Smrg    if (strncmp(un.version, "V2", 2) == 0) {
143876888252Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
143976888252Smrg    }
144076888252Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
144176888252Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
144276888252Smrg    }
144376888252Smrg    printf ("i386-sequent-ptx\n"); exit (0);
144476888252Smrg
144576888252Smrg#endif
144676888252Smrg
144776888252Smrg#if defined (vax)
144876888252Smrg# if !defined (ultrix)
144976888252Smrg#  include <sys/param.h>
145076888252Smrg#  if defined (BSD)
145176888252Smrg#   if BSD == 43
145276888252Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
145376888252Smrg#   else
145476888252Smrg#    if BSD == 199006
145576888252Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
145676888252Smrg#    else
145776888252Smrg      printf ("vax-dec-bsd\n"); exit (0);
145876888252Smrg#    endif
145976888252Smrg#   endif
146076888252Smrg#  else
146176888252Smrg    printf ("vax-dec-bsd\n"); exit (0);
146276888252Smrg#  endif
146376888252Smrg# else
146476888252Smrg    printf ("vax-dec-ultrix\n"); exit (0);
146576888252Smrg# endif
146676888252Smrg#endif
146776888252Smrg
146876888252Smrg#if defined (alliant) && defined (i860)
146976888252Smrg  printf ("i860-alliant-bsd\n"); exit (0);
147076888252Smrg#endif
147176888252Smrg
147276888252Smrg  exit (1);
147376888252Smrg}
147476888252SmrgEOF
147576888252Smrg
14761ae1b5e8Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
14771ae1b5e8Smrg	{ echo "$SYSTEM_NAME"; exit; }
147876888252Smrg
147976888252Smrg# Apollos put the system type in the environment.
148076888252Smrg
14811ae1b5e8Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
148276888252Smrg
148376888252Smrg# Convex versions that predate uname can use getsysinfo(1)
148476888252Smrg
148576888252Smrgif [ -x /usr/convex/getsysinfo ]
148676888252Smrgthen
148776888252Smrg    case `getsysinfo -f cpu_type` in
148876888252Smrg    c1*)
148976888252Smrg	echo c1-convex-bsd
14901ae1b5e8Smrg	exit ;;
149176888252Smrg    c2*)
149276888252Smrg	if getsysinfo -f scalar_acc
149376888252Smrg	then echo c32-convex-bsd
149476888252Smrg	else echo c2-convex-bsd
149576888252Smrg	fi
14961ae1b5e8Smrg	exit ;;
149776888252Smrg    c34*)
149876888252Smrg	echo c34-convex-bsd
14991ae1b5e8Smrg	exit ;;
150076888252Smrg    c38*)
150176888252Smrg	echo c38-convex-bsd
15021ae1b5e8Smrg	exit ;;
150376888252Smrg    c4*)
150476888252Smrg	echo c4-convex-bsd
15051ae1b5e8Smrg	exit ;;
150676888252Smrg    esac
150776888252Smrgfi
150876888252Smrg
150976888252Smrgcat >&2 <<EOF
151076888252Smrg$0: unable to guess system type
151176888252Smrg
151276888252SmrgThis script, last modified $timestamp, has failed to recognize
151376888252Smrgthe operating system you are using. It is advised that you
151476888252Smrgdownload the most up to date version of the config scripts from
151576888252Smrg
15161ae1b5e8Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
15171ae1b5e8Smrgand
15181ae1b5e8Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
151976888252Smrg
152076888252SmrgIf the version you run ($0) is already up to date, please
152176888252Smrgsend the following data and any information you think might be
152276888252Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
152376888252Smrginformation to handle your system.
152476888252Smrg
152576888252Smrgconfig.guess timestamp = $timestamp
152676888252Smrg
152776888252Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
152876888252Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
152976888252Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
153076888252Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
153176888252Smrg
153276888252Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
153376888252Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
153476888252Smrg
153576888252Smrghostinfo               = `(hostinfo) 2>/dev/null`
153676888252Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
153776888252Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
153876888252Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
153976888252Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
154076888252Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
154176888252Smrg
154276888252SmrgUNAME_MACHINE = ${UNAME_MACHINE}
154376888252SmrgUNAME_RELEASE = ${UNAME_RELEASE}
154476888252SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
154576888252SmrgUNAME_VERSION = ${UNAME_VERSION}
154676888252SmrgEOF
154776888252Smrg
154876888252Smrgexit 1
154976888252Smrg
155076888252Smrg# Local variables:
155176888252Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
155276888252Smrg# time-stamp-start: "timestamp='"
155376888252Smrg# time-stamp-format: "%:y-%02m-%02d"
155476888252Smrg# time-stamp-end: "'"
155576888252Smrg# End:
1556