config.guess revision 576bae58
114c0a534Smrg#! /bin/sh
214c0a534Smrg# Attempt to guess a canonical system name.
314c0a534Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4576bae58Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5bf2eeab3Smrg#   Free Software Foundation, Inc.
614c0a534Smrg
7576bae58Smrgtimestamp='2010-08-21'
814c0a534Smrg
914c0a534Smrg# This file is free software; you can redistribute it and/or modify it
1014c0a534Smrg# under the terms of the GNU General Public License as published by
1114c0a534Smrg# the Free Software Foundation; either version 2 of the License, or
1214c0a534Smrg# (at your option) any later version.
1314c0a534Smrg#
1414c0a534Smrg# This program is distributed in the hope that it will be useful, but
1514c0a534Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1614c0a534Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1714c0a534Smrg# General Public License for more details.
1814c0a534Smrg#
1914c0a534Smrg# You should have received a copy of the GNU General Public License
2014c0a534Smrg# along with this program; if not, write to the Free Software
2114c0a534Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2214c0a534Smrg# 02110-1301, USA.
2314c0a534Smrg#
2414c0a534Smrg# As a special exception to the GNU General Public License, if you
2514c0a534Smrg# distribute this file as part of a program that contains a
2614c0a534Smrg# configuration script generated by Autoconf, you may include it under
2714c0a534Smrg# the same distribution terms that you use for the rest of that program.
2814c0a534Smrg
2914c0a534Smrg
30576bae58Smrg# Originally written by Per Bothner.  Please send patches (context
31576bae58Smrg# diff format) to <config-patches@gnu.org> and include a ChangeLog
32576bae58Smrg# entry.
3314c0a534Smrg#
3414c0a534Smrg# This script attempts to guess a canonical system name similar to
3514c0a534Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
3614c0a534Smrg# exits with 0.  Otherwise, it exits with 1.
3714c0a534Smrg#
38576bae58Smrg# You can get the latest version of this script from:
39576bae58Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
4014c0a534Smrg
4114c0a534Smrgme=`echo "$0" | sed -e 's,.*/,,'`
4214c0a534Smrg
4314c0a534Smrgusage="\
4414c0a534SmrgUsage: $0 [OPTION]
4514c0a534Smrg
4614c0a534SmrgOutput the configuration name of the system \`$me' is run on.
4714c0a534Smrg
4814c0a534SmrgOperation modes:
4914c0a534Smrg  -h, --help         print this help, then exit
5014c0a534Smrg  -t, --time-stamp   print date of last modification, then exit
5114c0a534Smrg  -v, --version      print version number, then exit
5214c0a534Smrg
5314c0a534SmrgReport bugs and patches to <config-patches@gnu.org>."
5414c0a534Smrg
5514c0a534Smrgversion="\
5614c0a534SmrgGNU config.guess ($timestamp)
5714c0a534Smrg
5814c0a534SmrgOriginally written by Per Bothner.
59576bae58SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60576bae58Smrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61576bae58SmrgSoftware Foundation, Inc.
6214c0a534Smrg
6314c0a534SmrgThis is free software; see the source for copying conditions.  There is NO
6414c0a534Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6514c0a534Smrg
6614c0a534Smrghelp="
6714c0a534SmrgTry \`$me --help' for more information."
6814c0a534Smrg
6914c0a534Smrg# Parse command line
7014c0a534Smrgwhile test $# -gt 0 ; do
7114c0a534Smrg  case $1 in
7214c0a534Smrg    --time-stamp | --time* | -t )
7314c0a534Smrg       echo "$timestamp" ; exit ;;
7414c0a534Smrg    --version | -v )
7514c0a534Smrg       echo "$version" ; exit ;;
7614c0a534Smrg    --help | --h* | -h )
7714c0a534Smrg       echo "$usage"; exit ;;
7814c0a534Smrg    -- )     # Stop option processing
7914c0a534Smrg       shift; break ;;
8014c0a534Smrg    - )	# Use stdin as input.
8114c0a534Smrg       break ;;
8214c0a534Smrg    -* )
8314c0a534Smrg       echo "$me: invalid option $1$help" >&2
8414c0a534Smrg       exit 1 ;;
8514c0a534Smrg    * )
8614c0a534Smrg       break ;;
8714c0a534Smrg  esac
8814c0a534Smrgdone
8914c0a534Smrg
9014c0a534Smrgif test $# != 0; then
9114c0a534Smrg  echo "$me: too many arguments$help" >&2
9214c0a534Smrg  exit 1
9314c0a534Smrgfi
9414c0a534Smrg
95576bae58Smrgtrap 'exit 1' HUP INT TERM
9614c0a534Smrg
9714c0a534Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9814c0a534Smrg# compiler to aid in system detection is discouraged as it requires
9914c0a534Smrg# temporary files to be created and, as you can see below, it is a
10014c0a534Smrg# headache to deal with in a portable fashion.
10114c0a534Smrg
10214c0a534Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
10314c0a534Smrg# use `HOST_CC' if defined, but it is deprecated.
10414c0a534Smrg
10514c0a534Smrg# Portable tmp directory creation inspired by the Autoconf team.
10614c0a534Smrg
10714c0a534Smrgset_cc_for_build='
10814c0a534Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109576bae58Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
11014c0a534Smrg: ${TMPDIR=/tmp} ;
111bf2eeab3Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
11214c0a534Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
11314c0a534Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
11414c0a534Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
11514c0a534Smrgdummy=$tmp/dummy ;
11614c0a534Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
11714c0a534Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
11814c0a534Smrg ,,)    echo "int x;" > $dummy.c ;
11914c0a534Smrg	for c in cc gcc c89 c99 ; do
12014c0a534Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
12114c0a534Smrg	     CC_FOR_BUILD="$c"; break ;
12214c0a534Smrg	  fi ;
12314c0a534Smrg	done ;
12414c0a534Smrg	if test x"$CC_FOR_BUILD" = x ; then
12514c0a534Smrg	  CC_FOR_BUILD=no_compiler_found ;
12614c0a534Smrg	fi
12714c0a534Smrg	;;
12814c0a534Smrg ,,*)   CC_FOR_BUILD=$CC ;;
12914c0a534Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
13014c0a534Smrgesac ; set_cc_for_build= ;'
13114c0a534Smrg
13214c0a534Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
13314c0a534Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
13414c0a534Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
13514c0a534Smrg	PATH=$PATH:/.attbin ; export PATH
13614c0a534Smrgfi
13714c0a534Smrg
13814c0a534SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13914c0a534SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
14014c0a534SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
14114c0a534SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
14214c0a534Smrg
14314c0a534Smrg# Note: order is significant - the case branches are not exclusive.
14414c0a534Smrg
14514c0a534Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
14614c0a534Smrg    *:NetBSD:*:*)
14714c0a534Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
14814c0a534Smrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
14914c0a534Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
15014c0a534Smrg	# switched to ELF, *-*-netbsd* would select the old
15114c0a534Smrg	# object file format.  This provides both forward
15214c0a534Smrg	# compatibility and a consistent mechanism for selecting the
15314c0a534Smrg	# object file format.
15414c0a534Smrg	#
15514c0a534Smrg	# Note: NetBSD doesn't particularly care about the vendor
15614c0a534Smrg	# portion of the name.  We always set it to "unknown".
15714c0a534Smrg	sysctl="sysctl -n hw.machine_arch"
15814c0a534Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
15914c0a534Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
16014c0a534Smrg	case "${UNAME_MACHINE_ARCH}" in
16114c0a534Smrg	    armeb) machine=armeb-unknown ;;
16214c0a534Smrg	    arm*) machine=arm-unknown ;;
16314c0a534Smrg	    sh3el) machine=shl-unknown ;;
16414c0a534Smrg	    sh3eb) machine=sh-unknown ;;
165bf2eeab3Smrg	    sh5el) machine=sh5le-unknown ;;
16614c0a534Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
16714c0a534Smrg	esac
16814c0a534Smrg	# The Operating System including object format, if it has switched
16914c0a534Smrg	# to ELF recently, or will in the future.
17014c0a534Smrg	case "${UNAME_MACHINE_ARCH}" in
17114c0a534Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
17214c0a534Smrg		eval $set_cc_for_build
17314c0a534Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174576bae58Smrg			| grep -q __ELF__
17514c0a534Smrg		then
17614c0a534Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
17714c0a534Smrg		    # Return netbsd for either.  FIX?
17814c0a534Smrg		    os=netbsd
17914c0a534Smrg		else
18014c0a534Smrg		    os=netbsdelf
18114c0a534Smrg		fi
18214c0a534Smrg		;;
18314c0a534Smrg	    *)
18414c0a534Smrg	        os=netbsd
18514c0a534Smrg		;;
18614c0a534Smrg	esac
18714c0a534Smrg	# The OS release
18814c0a534Smrg	# Debian GNU/NetBSD machines have a different userland, and
18914c0a534Smrg	# thus, need a distinct triplet. However, they do not need
19014c0a534Smrg	# kernel version information, so it can be replaced with a
19114c0a534Smrg	# suitable tag, in the style of linux-gnu.
19214c0a534Smrg	case "${UNAME_VERSION}" in
19314c0a534Smrg	    Debian*)
19414c0a534Smrg		release='-gnu'
19514c0a534Smrg		;;
19614c0a534Smrg	    *)
19714c0a534Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19814c0a534Smrg		;;
19914c0a534Smrg	esac
20014c0a534Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
20114c0a534Smrg	# contains redundant information, the shorter form:
20214c0a534Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
20314c0a534Smrg	echo "${machine}-${os}${release}"
20414c0a534Smrg	exit ;;
20514c0a534Smrg    *:OpenBSD:*:*)
20614c0a534Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
20714c0a534Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
20814c0a534Smrg	exit ;;
20914c0a534Smrg    *:ekkoBSD:*:*)
21014c0a534Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
21114c0a534Smrg	exit ;;
212bf2eeab3Smrg    *:SolidBSD:*:*)
213bf2eeab3Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
214bf2eeab3Smrg	exit ;;
21514c0a534Smrg    macppc:MirBSD:*:*)
216bf2eeab3Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
21714c0a534Smrg	exit ;;
21814c0a534Smrg    *:MirBSD:*:*)
21914c0a534Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
22014c0a534Smrg	exit ;;
22114c0a534Smrg    alpha:OSF1:*:*)
22214c0a534Smrg	case $UNAME_RELEASE in
22314c0a534Smrg	*4.0)
22414c0a534Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
22514c0a534Smrg		;;
22614c0a534Smrg	*5.*)
22714c0a534Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
22814c0a534Smrg		;;
22914c0a534Smrg	esac
23014c0a534Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
23114c0a534Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
23214c0a534Smrg	# covers most systems running today.  This code pipes the CPU
23314c0a534Smrg	# types through head -n 1, so we only detect the type of CPU 0.
23414c0a534Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
23514c0a534Smrg	case "$ALPHA_CPU_TYPE" in
23614c0a534Smrg	    "EV4 (21064)")
23714c0a534Smrg		UNAME_MACHINE="alpha" ;;
23814c0a534Smrg	    "EV4.5 (21064)")
23914c0a534Smrg		UNAME_MACHINE="alpha" ;;
24014c0a534Smrg	    "LCA4 (21066/21068)")
24114c0a534Smrg		UNAME_MACHINE="alpha" ;;
24214c0a534Smrg	    "EV5 (21164)")
24314c0a534Smrg		UNAME_MACHINE="alphaev5" ;;
24414c0a534Smrg	    "EV5.6 (21164A)")
24514c0a534Smrg		UNAME_MACHINE="alphaev56" ;;
24614c0a534Smrg	    "EV5.6 (21164PC)")
24714c0a534Smrg		UNAME_MACHINE="alphapca56" ;;
24814c0a534Smrg	    "EV5.7 (21164PC)")
24914c0a534Smrg		UNAME_MACHINE="alphapca57" ;;
25014c0a534Smrg	    "EV6 (21264)")
25114c0a534Smrg		UNAME_MACHINE="alphaev6" ;;
25214c0a534Smrg	    "EV6.7 (21264A)")
25314c0a534Smrg		UNAME_MACHINE="alphaev67" ;;
25414c0a534Smrg	    "EV6.8CB (21264C)")
25514c0a534Smrg		UNAME_MACHINE="alphaev68" ;;
25614c0a534Smrg	    "EV6.8AL (21264B)")
25714c0a534Smrg		UNAME_MACHINE="alphaev68" ;;
25814c0a534Smrg	    "EV6.8CX (21264D)")
25914c0a534Smrg		UNAME_MACHINE="alphaev68" ;;
26014c0a534Smrg	    "EV6.9A (21264/EV69A)")
26114c0a534Smrg		UNAME_MACHINE="alphaev69" ;;
26214c0a534Smrg	    "EV7 (21364)")
26314c0a534Smrg		UNAME_MACHINE="alphaev7" ;;
26414c0a534Smrg	    "EV7.9 (21364A)")
26514c0a534Smrg		UNAME_MACHINE="alphaev79" ;;
26614c0a534Smrg	esac
26714c0a534Smrg	# A Pn.n version is a patched version.
26814c0a534Smrg	# A Vn.n version is a released version.
26914c0a534Smrg	# A Tn.n version is a released field test version.
27014c0a534Smrg	# A Xn.n version is an unreleased experimental baselevel.
27114c0a534Smrg	# 1.2 uses "1.2" for uname -r.
27214c0a534Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
27314c0a534Smrg	exit ;;
27414c0a534Smrg    Alpha\ *:Windows_NT*:*)
27514c0a534Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
27614c0a534Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
27714c0a534Smrg	# of the specific Alpha model?
27814c0a534Smrg	echo alpha-pc-interix
27914c0a534Smrg	exit ;;
28014c0a534Smrg    21064:Windows_NT:50:3)
28114c0a534Smrg	echo alpha-dec-winnt3.5
28214c0a534Smrg	exit ;;
28314c0a534Smrg    Amiga*:UNIX_System_V:4.0:*)
28414c0a534Smrg	echo m68k-unknown-sysv4
28514c0a534Smrg	exit ;;
28614c0a534Smrg    *:[Aa]miga[Oo][Ss]:*:*)
28714c0a534Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
28814c0a534Smrg	exit ;;
28914c0a534Smrg    *:[Mm]orph[Oo][Ss]:*:*)
29014c0a534Smrg	echo ${UNAME_MACHINE}-unknown-morphos
29114c0a534Smrg	exit ;;
29214c0a534Smrg    *:OS/390:*:*)
29314c0a534Smrg	echo i370-ibm-openedition
29414c0a534Smrg	exit ;;
29514c0a534Smrg    *:z/VM:*:*)
29614c0a534Smrg	echo s390-ibm-zvmoe
29714c0a534Smrg	exit ;;
29814c0a534Smrg    *:OS400:*:*)
29914c0a534Smrg        echo powerpc-ibm-os400
30014c0a534Smrg	exit ;;
30114c0a534Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
30214c0a534Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
30314c0a534Smrg	exit ;;
30414c0a534Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
30514c0a534Smrg	echo arm-unknown-riscos
30614c0a534Smrg	exit ;;
30714c0a534Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
30814c0a534Smrg	echo hppa1.1-hitachi-hiuxmpp
30914c0a534Smrg	exit ;;
31014c0a534Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
31114c0a534Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
31214c0a534Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
31314c0a534Smrg		echo pyramid-pyramid-sysv3
31414c0a534Smrg	else
31514c0a534Smrg		echo pyramid-pyramid-bsd
31614c0a534Smrg	fi
31714c0a534Smrg	exit ;;
31814c0a534Smrg    NILE*:*:*:dcosx)
31914c0a534Smrg	echo pyramid-pyramid-svr4
32014c0a534Smrg	exit ;;
32114c0a534Smrg    DRS?6000:unix:4.0:6*)
32214c0a534Smrg	echo sparc-icl-nx6
32314c0a534Smrg	exit ;;
32414c0a534Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
32514c0a534Smrg	case `/usr/bin/uname -p` in
32614c0a534Smrg	    sparc) echo sparc-icl-nx7; exit ;;
32714c0a534Smrg	esac ;;
328bf2eeab3Smrg    s390x:SunOS:*:*)
329bf2eeab3Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
330bf2eeab3Smrg	exit ;;
33114c0a534Smrg    sun4H:SunOS:5.*:*)
33214c0a534Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
33314c0a534Smrg	exit ;;
33414c0a534Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
33514c0a534Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
33614c0a534Smrg	exit ;;
337576bae58Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
338576bae58Smrg	echo i386-pc-auroraux${UNAME_RELEASE}
339576bae58Smrg	exit ;;
340bf2eeab3Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
341bf2eeab3Smrg	eval $set_cc_for_build
342bf2eeab3Smrg	SUN_ARCH="i386"
343bf2eeab3Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
344bf2eeab3Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
345bf2eeab3Smrg	# This test works for both compilers.
346bf2eeab3Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
347bf2eeab3Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
348bf2eeab3Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
349bf2eeab3Smrg		grep IS_64BIT_ARCH >/dev/null
350bf2eeab3Smrg	    then
351bf2eeab3Smrg		SUN_ARCH="x86_64"
352bf2eeab3Smrg	    fi
353bf2eeab3Smrg	fi
354bf2eeab3Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
35514c0a534Smrg	exit ;;
35614c0a534Smrg    sun4*:SunOS:6*:*)
35714c0a534Smrg	# According to config.sub, this is the proper way to canonicalize
35814c0a534Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
35914c0a534Smrg	# it's likely to be more like Solaris than SunOS4.
36014c0a534Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
36114c0a534Smrg	exit ;;
36214c0a534Smrg    sun4*:SunOS:*:*)
36314c0a534Smrg	case "`/usr/bin/arch -k`" in
36414c0a534Smrg	    Series*|S4*)
36514c0a534Smrg		UNAME_RELEASE=`uname -v`
36614c0a534Smrg		;;
36714c0a534Smrg	esac
36814c0a534Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
36914c0a534Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
37014c0a534Smrg	exit ;;
37114c0a534Smrg    sun3*:SunOS:*:*)
37214c0a534Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
37314c0a534Smrg	exit ;;
37414c0a534Smrg    sun*:*:4.2BSD:*)
37514c0a534Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
37614c0a534Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
37714c0a534Smrg	case "`/bin/arch`" in
37814c0a534Smrg	    sun3)
37914c0a534Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
38014c0a534Smrg		;;
38114c0a534Smrg	    sun4)
38214c0a534Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
38314c0a534Smrg		;;
38414c0a534Smrg	esac
38514c0a534Smrg	exit ;;
38614c0a534Smrg    aushp:SunOS:*:*)
38714c0a534Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
38814c0a534Smrg	exit ;;
38914c0a534Smrg    # The situation for MiNT is a little confusing.  The machine name
39014c0a534Smrg    # can be virtually everything (everything which is not
39114c0a534Smrg    # "atarist" or "atariste" at least should have a processor
39214c0a534Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
39314c0a534Smrg    # to the lowercase version "mint" (or "freemint").  Finally
39414c0a534Smrg    # the system name "TOS" denotes a system which is actually not
39514c0a534Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
39614c0a534Smrg    # be no problem.
39714c0a534Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
39814c0a534Smrg        echo m68k-atari-mint${UNAME_RELEASE}
39914c0a534Smrg	exit ;;
40014c0a534Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
40114c0a534Smrg	echo m68k-atari-mint${UNAME_RELEASE}
40214c0a534Smrg        exit ;;
40314c0a534Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
40414c0a534Smrg        echo m68k-atari-mint${UNAME_RELEASE}
40514c0a534Smrg	exit ;;
40614c0a534Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
40714c0a534Smrg        echo m68k-milan-mint${UNAME_RELEASE}
40814c0a534Smrg        exit ;;
40914c0a534Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
41014c0a534Smrg        echo m68k-hades-mint${UNAME_RELEASE}
41114c0a534Smrg        exit ;;
41214c0a534Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
41314c0a534Smrg        echo m68k-unknown-mint${UNAME_RELEASE}
41414c0a534Smrg        exit ;;
41514c0a534Smrg    m68k:machten:*:*)
41614c0a534Smrg	echo m68k-apple-machten${UNAME_RELEASE}
41714c0a534Smrg	exit ;;
41814c0a534Smrg    powerpc:machten:*:*)
41914c0a534Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
42014c0a534Smrg	exit ;;
42114c0a534Smrg    RISC*:Mach:*:*)
42214c0a534Smrg	echo mips-dec-mach_bsd4.3
42314c0a534Smrg	exit ;;
42414c0a534Smrg    RISC*:ULTRIX:*:*)
42514c0a534Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
42614c0a534Smrg	exit ;;
42714c0a534Smrg    VAX*:ULTRIX*:*:*)
42814c0a534Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
42914c0a534Smrg	exit ;;
43014c0a534Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
43114c0a534Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
43214c0a534Smrg	exit ;;
43314c0a534Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
43414c0a534Smrg	eval $set_cc_for_build
43514c0a534Smrg	sed 's/^	//' << EOF >$dummy.c
43614c0a534Smrg#ifdef __cplusplus
43714c0a534Smrg#include <stdio.h>  /* for printf() prototype */
43814c0a534Smrg	int main (int argc, char *argv[]) {
43914c0a534Smrg#else
44014c0a534Smrg	int main (argc, argv) int argc; char *argv[]; {
44114c0a534Smrg#endif
44214c0a534Smrg	#if defined (host_mips) && defined (MIPSEB)
44314c0a534Smrg	#if defined (SYSTYPE_SYSV)
44414c0a534Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
44514c0a534Smrg	#endif
44614c0a534Smrg	#if defined (SYSTYPE_SVR4)
44714c0a534Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
44814c0a534Smrg	#endif
44914c0a534Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
45014c0a534Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
45114c0a534Smrg	#endif
45214c0a534Smrg	#endif
45314c0a534Smrg	  exit (-1);
45414c0a534Smrg	}
45514c0a534SmrgEOF
45614c0a534Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
45714c0a534Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
45814c0a534Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
45914c0a534Smrg	    { echo "$SYSTEM_NAME"; exit; }
46014c0a534Smrg	echo mips-mips-riscos${UNAME_RELEASE}
46114c0a534Smrg	exit ;;
46214c0a534Smrg    Motorola:PowerMAX_OS:*:*)
46314c0a534Smrg	echo powerpc-motorola-powermax
46414c0a534Smrg	exit ;;
46514c0a534Smrg    Motorola:*:4.3:PL8-*)
46614c0a534Smrg	echo powerpc-harris-powermax
46714c0a534Smrg	exit ;;
46814c0a534Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
46914c0a534Smrg	echo powerpc-harris-powermax
47014c0a534Smrg	exit ;;
47114c0a534Smrg    Night_Hawk:Power_UNIX:*:*)
47214c0a534Smrg	echo powerpc-harris-powerunix
47314c0a534Smrg	exit ;;
47414c0a534Smrg    m88k:CX/UX:7*:*)
47514c0a534Smrg	echo m88k-harris-cxux7
47614c0a534Smrg	exit ;;
47714c0a534Smrg    m88k:*:4*:R4*)
47814c0a534Smrg	echo m88k-motorola-sysv4
47914c0a534Smrg	exit ;;
48014c0a534Smrg    m88k:*:3*:R3*)
48114c0a534Smrg	echo m88k-motorola-sysv3
48214c0a534Smrg	exit ;;
48314c0a534Smrg    AViiON:dgux:*:*)
48414c0a534Smrg        # DG/UX returns AViiON for all architectures
48514c0a534Smrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
48614c0a534Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
48714c0a534Smrg	then
48814c0a534Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
48914c0a534Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
49014c0a534Smrg	    then
49114c0a534Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
49214c0a534Smrg	    else
49314c0a534Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
49414c0a534Smrg	    fi
49514c0a534Smrg	else
49614c0a534Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
49714c0a534Smrg	fi
49814c0a534Smrg 	exit ;;
49914c0a534Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
50014c0a534Smrg	echo m88k-dolphin-sysv3
50114c0a534Smrg	exit ;;
50214c0a534Smrg    M88*:*:R3*:*)
50314c0a534Smrg	# Delta 88k system running SVR3
50414c0a534Smrg	echo m88k-motorola-sysv3
50514c0a534Smrg	exit ;;
50614c0a534Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
50714c0a534Smrg	echo m88k-tektronix-sysv3
50814c0a534Smrg	exit ;;
50914c0a534Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
51014c0a534Smrg	echo m68k-tektronix-bsd
51114c0a534Smrg	exit ;;
51214c0a534Smrg    *:IRIX*:*:*)
51314c0a534Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
51414c0a534Smrg	exit ;;
51514c0a534Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
51614c0a534Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
51714c0a534Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
51814c0a534Smrg    i*86:AIX:*:*)
51914c0a534Smrg	echo i386-ibm-aix
52014c0a534Smrg	exit ;;
52114c0a534Smrg    ia64:AIX:*:*)
52214c0a534Smrg	if [ -x /usr/bin/oslevel ] ; then
52314c0a534Smrg		IBM_REV=`/usr/bin/oslevel`
52414c0a534Smrg	else
52514c0a534Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
52614c0a534Smrg	fi
52714c0a534Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
52814c0a534Smrg	exit ;;
52914c0a534Smrg    *:AIX:2:3)
53014c0a534Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
53114c0a534Smrg		eval $set_cc_for_build
53214c0a534Smrg		sed 's/^		//' << EOF >$dummy.c
53314c0a534Smrg		#include <sys/systemcfg.h>
53414c0a534Smrg
53514c0a534Smrg		main()
53614c0a534Smrg			{
53714c0a534Smrg			if (!__power_pc())
53814c0a534Smrg				exit(1);
53914c0a534Smrg			puts("powerpc-ibm-aix3.2.5");
54014c0a534Smrg			exit(0);
54114c0a534Smrg			}
54214c0a534SmrgEOF
54314c0a534Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
54414c0a534Smrg		then
54514c0a534Smrg			echo "$SYSTEM_NAME"
54614c0a534Smrg		else
54714c0a534Smrg			echo rs6000-ibm-aix3.2.5
54814c0a534Smrg		fi
54914c0a534Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
55014c0a534Smrg		echo rs6000-ibm-aix3.2.4
55114c0a534Smrg	else
55214c0a534Smrg		echo rs6000-ibm-aix3.2
55314c0a534Smrg	fi
55414c0a534Smrg	exit ;;
555576bae58Smrg    *:AIX:*:[4567])
55614c0a534Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
55714c0a534Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
55814c0a534Smrg		IBM_ARCH=rs6000
55914c0a534Smrg	else
56014c0a534Smrg		IBM_ARCH=powerpc
56114c0a534Smrg	fi
56214c0a534Smrg	if [ -x /usr/bin/oslevel ] ; then
56314c0a534Smrg		IBM_REV=`/usr/bin/oslevel`
56414c0a534Smrg	else
56514c0a534Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
56614c0a534Smrg	fi
56714c0a534Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
56814c0a534Smrg	exit ;;
56914c0a534Smrg    *:AIX:*:*)
57014c0a534Smrg	echo rs6000-ibm-aix
57114c0a534Smrg	exit ;;
57214c0a534Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
57314c0a534Smrg	echo romp-ibm-bsd4.4
57414c0a534Smrg	exit ;;
57514c0a534Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
57614c0a534Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
57714c0a534Smrg	exit ;;                             # report: romp-ibm BSD 4.3
57814c0a534Smrg    *:BOSX:*:*)
57914c0a534Smrg	echo rs6000-bull-bosx
58014c0a534Smrg	exit ;;
58114c0a534Smrg    DPX/2?00:B.O.S.:*:*)
58214c0a534Smrg	echo m68k-bull-sysv3
58314c0a534Smrg	exit ;;
58414c0a534Smrg    9000/[34]??:4.3bsd:1.*:*)
58514c0a534Smrg	echo m68k-hp-bsd
58614c0a534Smrg	exit ;;
58714c0a534Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
58814c0a534Smrg	echo m68k-hp-bsd4.4
58914c0a534Smrg	exit ;;
59014c0a534Smrg    9000/[34678]??:HP-UX:*:*)
59114c0a534Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
59214c0a534Smrg	case "${UNAME_MACHINE}" in
59314c0a534Smrg	    9000/31? )            HP_ARCH=m68000 ;;
59414c0a534Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
59514c0a534Smrg	    9000/[678][0-9][0-9])
59614c0a534Smrg		if [ -x /usr/bin/getconf ]; then
59714c0a534Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
59814c0a534Smrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
59914c0a534Smrg                    case "${sc_cpu_version}" in
60014c0a534Smrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
60114c0a534Smrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
60214c0a534Smrg                      532)                      # CPU_PA_RISC2_0
60314c0a534Smrg                        case "${sc_kernel_bits}" in
60414c0a534Smrg                          32) HP_ARCH="hppa2.0n" ;;
60514c0a534Smrg                          64) HP_ARCH="hppa2.0w" ;;
60614c0a534Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
60714c0a534Smrg                        esac ;;
60814c0a534Smrg                    esac
60914c0a534Smrg		fi
61014c0a534Smrg		if [ "${HP_ARCH}" = "" ]; then
61114c0a534Smrg		    eval $set_cc_for_build
61214c0a534Smrg		    sed 's/^              //' << EOF >$dummy.c
61314c0a534Smrg
61414c0a534Smrg              #define _HPUX_SOURCE
61514c0a534Smrg              #include <stdlib.h>
61614c0a534Smrg              #include <unistd.h>
61714c0a534Smrg
61814c0a534Smrg              int main ()
61914c0a534Smrg              {
62014c0a534Smrg              #if defined(_SC_KERNEL_BITS)
62114c0a534Smrg                  long bits = sysconf(_SC_KERNEL_BITS);
62214c0a534Smrg              #endif
62314c0a534Smrg                  long cpu  = sysconf (_SC_CPU_VERSION);
62414c0a534Smrg
62514c0a534Smrg                  switch (cpu)
62614c0a534Smrg              	{
62714c0a534Smrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
62814c0a534Smrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
62914c0a534Smrg              	case CPU_PA_RISC2_0:
63014c0a534Smrg              #if defined(_SC_KERNEL_BITS)
63114c0a534Smrg              	    switch (bits)
63214c0a534Smrg              		{
63314c0a534Smrg              		case 64: puts ("hppa2.0w"); break;
63414c0a534Smrg              		case 32: puts ("hppa2.0n"); break;
63514c0a534Smrg              		default: puts ("hppa2.0"); break;
63614c0a534Smrg              		} break;
63714c0a534Smrg              #else  /* !defined(_SC_KERNEL_BITS) */
63814c0a534Smrg              	    puts ("hppa2.0"); break;
63914c0a534Smrg              #endif
64014c0a534Smrg              	default: puts ("hppa1.0"); break;
64114c0a534Smrg              	}
64214c0a534Smrg                  exit (0);
64314c0a534Smrg              }
64414c0a534SmrgEOF
64514c0a534Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
64614c0a534Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
64714c0a534Smrg		fi ;;
64814c0a534Smrg	esac
64914c0a534Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
65014c0a534Smrg	then
65114c0a534Smrg	    eval $set_cc_for_build
65214c0a534Smrg
65314c0a534Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
65414c0a534Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
65514c0a534Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
65614c0a534Smrg	    #
65714c0a534Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
65814c0a534Smrg	    # => hppa2.0w-hp-hpux11.23
65914c0a534Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
66014c0a534Smrg	    # => hppa64-hp-hpux11.23
66114c0a534Smrg
66214c0a534Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
663576bae58Smrg		grep -q __LP64__
66414c0a534Smrg	    then
66514c0a534Smrg		HP_ARCH="hppa2.0w"
66614c0a534Smrg	    else
66714c0a534Smrg		HP_ARCH="hppa64"
66814c0a534Smrg	    fi
66914c0a534Smrg	fi
67014c0a534Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
67114c0a534Smrg	exit ;;
67214c0a534Smrg    ia64:HP-UX:*:*)
67314c0a534Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
67414c0a534Smrg	echo ia64-hp-hpux${HPUX_REV}
67514c0a534Smrg	exit ;;
67614c0a534Smrg    3050*:HI-UX:*:*)
67714c0a534Smrg	eval $set_cc_for_build
67814c0a534Smrg	sed 's/^	//' << EOF >$dummy.c
67914c0a534Smrg	#include <unistd.h>
68014c0a534Smrg	int
68114c0a534Smrg	main ()
68214c0a534Smrg	{
68314c0a534Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
68414c0a534Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
68514c0a534Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
68614c0a534Smrg	     results, however.  */
68714c0a534Smrg	  if (CPU_IS_PA_RISC (cpu))
68814c0a534Smrg	    {
68914c0a534Smrg	      switch (cpu)
69014c0a534Smrg		{
69114c0a534Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
69214c0a534Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
69314c0a534Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
69414c0a534Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
69514c0a534Smrg		}
69614c0a534Smrg	    }
69714c0a534Smrg	  else if (CPU_IS_HP_MC68K (cpu))
69814c0a534Smrg	    puts ("m68k-hitachi-hiuxwe2");
69914c0a534Smrg	  else puts ("unknown-hitachi-hiuxwe2");
70014c0a534Smrg	  exit (0);
70114c0a534Smrg	}
70214c0a534SmrgEOF
70314c0a534Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
70414c0a534Smrg		{ echo "$SYSTEM_NAME"; exit; }
70514c0a534Smrg	echo unknown-hitachi-hiuxwe2
70614c0a534Smrg	exit ;;
70714c0a534Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
70814c0a534Smrg	echo hppa1.1-hp-bsd
70914c0a534Smrg	exit ;;
71014c0a534Smrg    9000/8??:4.3bsd:*:*)
71114c0a534Smrg	echo hppa1.0-hp-bsd
71214c0a534Smrg	exit ;;
71314c0a534Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
71414c0a534Smrg	echo hppa1.0-hp-mpeix
71514c0a534Smrg	exit ;;
71614c0a534Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
71714c0a534Smrg	echo hppa1.1-hp-osf
71814c0a534Smrg	exit ;;
71914c0a534Smrg    hp8??:OSF1:*:*)
72014c0a534Smrg	echo hppa1.0-hp-osf
72114c0a534Smrg	exit ;;
72214c0a534Smrg    i*86:OSF1:*:*)
72314c0a534Smrg	if [ -x /usr/sbin/sysversion ] ; then
72414c0a534Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
72514c0a534Smrg	else
72614c0a534Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
72714c0a534Smrg	fi
72814c0a534Smrg	exit ;;
72914c0a534Smrg    parisc*:Lites*:*:*)
73014c0a534Smrg	echo hppa1.1-hp-lites
73114c0a534Smrg	exit ;;
73214c0a534Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
73314c0a534Smrg	echo c1-convex-bsd
73414c0a534Smrg        exit ;;
73514c0a534Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
73614c0a534Smrg	if getsysinfo -f scalar_acc
73714c0a534Smrg	then echo c32-convex-bsd
73814c0a534Smrg	else echo c2-convex-bsd
73914c0a534Smrg	fi
74014c0a534Smrg        exit ;;
74114c0a534Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
74214c0a534Smrg	echo c34-convex-bsd
74314c0a534Smrg        exit ;;
74414c0a534Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
74514c0a534Smrg	echo c38-convex-bsd
74614c0a534Smrg        exit ;;
74714c0a534Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
74814c0a534Smrg	echo c4-convex-bsd
74914c0a534Smrg        exit ;;
75014c0a534Smrg    CRAY*Y-MP:*:*:*)
75114c0a534Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
75214c0a534Smrg	exit ;;
75314c0a534Smrg    CRAY*[A-Z]90:*:*:*)
75414c0a534Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
75514c0a534Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
75614c0a534Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
75714c0a534Smrg	      -e 's/\.[^.]*$/.X/'
75814c0a534Smrg	exit ;;
75914c0a534Smrg    CRAY*TS:*:*:*)
76014c0a534Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
76114c0a534Smrg	exit ;;
76214c0a534Smrg    CRAY*T3E:*:*:*)
76314c0a534Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
76414c0a534Smrg	exit ;;
76514c0a534Smrg    CRAY*SV1:*:*:*)
76614c0a534Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
76714c0a534Smrg	exit ;;
76814c0a534Smrg    *:UNICOS/mp:*:*)
76914c0a534Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
77014c0a534Smrg	exit ;;
77114c0a534Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
77214c0a534Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
77314c0a534Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
77414c0a534Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
77514c0a534Smrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
77614c0a534Smrg        exit ;;
77714c0a534Smrg    5000:UNIX_System_V:4.*:*)
77814c0a534Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
77914c0a534Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
78014c0a534Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
78114c0a534Smrg	exit ;;
78214c0a534Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
78314c0a534Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
78414c0a534Smrg	exit ;;
78514c0a534Smrg    sparc*:BSD/OS:*:*)
78614c0a534Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
78714c0a534Smrg	exit ;;
78814c0a534Smrg    *:BSD/OS:*:*)
78914c0a534Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
79014c0a534Smrg	exit ;;
79114c0a534Smrg    *:FreeBSD:*:*)
792bf2eeab3Smrg	case ${UNAME_MACHINE} in
793bf2eeab3Smrg	    pc98)
794bf2eeab3Smrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795bf2eeab3Smrg	    amd64)
796bf2eeab3Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797bf2eeab3Smrg	    *)
798bf2eeab3Smrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799bf2eeab3Smrg	esac
80014c0a534Smrg	exit ;;
80114c0a534Smrg    i*:CYGWIN*:*)
80214c0a534Smrg	echo ${UNAME_MACHINE}-pc-cygwin
80314c0a534Smrg	exit ;;
804bf2eeab3Smrg    *:MINGW*:*)
80514c0a534Smrg	echo ${UNAME_MACHINE}-pc-mingw32
80614c0a534Smrg	exit ;;
80714c0a534Smrg    i*:windows32*:*)
80814c0a534Smrg    	# uname -m includes "-pc" on this system.
80914c0a534Smrg    	echo ${UNAME_MACHINE}-mingw32
81014c0a534Smrg	exit ;;
81114c0a534Smrg    i*:PW*:*)
81214c0a534Smrg	echo ${UNAME_MACHINE}-pc-pw32
81314c0a534Smrg	exit ;;
814576bae58Smrg    *:Interix*:*)
815bf2eeab3Smrg    	case ${UNAME_MACHINE} in
816bf2eeab3Smrg	    x86)
817bf2eeab3Smrg		echo i586-pc-interix${UNAME_RELEASE}
818bf2eeab3Smrg		exit ;;
819576bae58Smrg	    authenticamd | genuineintel | EM64T)
820bf2eeab3Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
821bf2eeab3Smrg		exit ;;
822bf2eeab3Smrg	    IA64)
823bf2eeab3Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
824bf2eeab3Smrg		exit ;;
825bf2eeab3Smrg	esac ;;
82614c0a534Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
82714c0a534Smrg	echo i${UNAME_MACHINE}-pc-mks
82814c0a534Smrg	exit ;;
829576bae58Smrg    8664:Windows_NT:*)
830576bae58Smrg	echo x86_64-pc-mks
831576bae58Smrg	exit ;;
83214c0a534Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
83314c0a534Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
83414c0a534Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
83514c0a534Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
83614c0a534Smrg	echo i586-pc-interix
83714c0a534Smrg	exit ;;
83814c0a534Smrg    i*:UWIN*:*)
83914c0a534Smrg	echo ${UNAME_MACHINE}-pc-uwin
84014c0a534Smrg	exit ;;
841bf2eeab3Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
84214c0a534Smrg	echo x86_64-unknown-cygwin
84314c0a534Smrg	exit ;;
84414c0a534Smrg    p*:CYGWIN*:*)
84514c0a534Smrg	echo powerpcle-unknown-cygwin
84614c0a534Smrg	exit ;;
84714c0a534Smrg    prep*:SunOS:5.*:*)
84814c0a534Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
84914c0a534Smrg	exit ;;
85014c0a534Smrg    *:GNU:*:*)
85114c0a534Smrg	# the GNU system
85214c0a534Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
85314c0a534Smrg	exit ;;
85414c0a534Smrg    *:GNU/*:*:*)
85514c0a534Smrg	# other systems with GNU libc and userland
85614c0a534Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
85714c0a534Smrg	exit ;;
85814c0a534Smrg    i*86:Minix:*:*)
85914c0a534Smrg	echo ${UNAME_MACHINE}-pc-minix
86014c0a534Smrg	exit ;;
861576bae58Smrg    alpha:Linux:*:*)
862576bae58Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
863576bae58Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
864576bae58Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
865576bae58Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
866576bae58Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
867576bae58Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
868576bae58Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
869576bae58Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
870576bae58Smrg        esac
871576bae58Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
872576bae58Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
873576bae58Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
874576bae58Smrg	exit ;;
87514c0a534Smrg    arm*:Linux:*:*)
876bf2eeab3Smrg	eval $set_cc_for_build
877bf2eeab3Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
878bf2eeab3Smrg	    | grep -q __ARM_EABI__
879bf2eeab3Smrg	then
880bf2eeab3Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
881bf2eeab3Smrg	else
882bf2eeab3Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
883bf2eeab3Smrg	fi
884bf2eeab3Smrg	exit ;;
885bf2eeab3Smrg    avr32*:Linux:*:*)
88614c0a534Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
88714c0a534Smrg	exit ;;
88814c0a534Smrg    cris:Linux:*:*)
88914c0a534Smrg	echo cris-axis-linux-gnu
89014c0a534Smrg	exit ;;
89114c0a534Smrg    crisv32:Linux:*:*)
89214c0a534Smrg	echo crisv32-axis-linux-gnu
89314c0a534Smrg	exit ;;
89414c0a534Smrg    frv:Linux:*:*)
89514c0a534Smrg    	echo frv-unknown-linux-gnu
89614c0a534Smrg	exit ;;
897576bae58Smrg    i*86:Linux:*:*)
898576bae58Smrg	LIBC=gnu
899576bae58Smrg	eval $set_cc_for_build
900576bae58Smrg	sed 's/^	//' << EOF >$dummy.c
901576bae58Smrg	#ifdef __dietlibc__
902576bae58Smrg	LIBC=dietlibc
903576bae58Smrg	#endif
904576bae58SmrgEOF
905576bae58Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
906576bae58Smrg	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
907576bae58Smrg	exit ;;
90814c0a534Smrg    ia64:Linux:*:*)
90914c0a534Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
91014c0a534Smrg	exit ;;
91114c0a534Smrg    m32r*:Linux:*:*)
91214c0a534Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
91314c0a534Smrg	exit ;;
91414c0a534Smrg    m68*:Linux:*:*)
91514c0a534Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
91614c0a534Smrg	exit ;;
917576bae58Smrg    mips:Linux:*:* | mips64:Linux:*:*)
91814c0a534Smrg	eval $set_cc_for_build
91914c0a534Smrg	sed 's/^	//' << EOF >$dummy.c
92014c0a534Smrg	#undef CPU
921576bae58Smrg	#undef ${UNAME_MACHINE}
922576bae58Smrg	#undef ${UNAME_MACHINE}el
92314c0a534Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
924576bae58Smrg	CPU=${UNAME_MACHINE}el
92514c0a534Smrg	#else
92614c0a534Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
927576bae58Smrg	CPU=${UNAME_MACHINE}
92814c0a534Smrg	#else
92914c0a534Smrg	CPU=
93014c0a534Smrg	#endif
93114c0a534Smrg	#endif
93214c0a534SmrgEOF
933576bae58Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
93414c0a534Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
93514c0a534Smrg	;;
936bf2eeab3Smrg    or32:Linux:*:*)
937bf2eeab3Smrg	echo or32-unknown-linux-gnu
938bf2eeab3Smrg	exit ;;
939bf2eeab3Smrg    padre:Linux:*:*)
940bf2eeab3Smrg	echo sparc-unknown-linux-gnu
941bf2eeab3Smrg	exit ;;
942576bae58Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
943576bae58Smrg	echo hppa64-unknown-linux-gnu
944576bae58Smrg	exit ;;
94514c0a534Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
94614c0a534Smrg	# Look for CPU level
94714c0a534Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
94814c0a534Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
94914c0a534Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
95014c0a534Smrg	  *)    echo hppa-unknown-linux-gnu ;;
95114c0a534Smrg	esac
95214c0a534Smrg	exit ;;
953576bae58Smrg    ppc64:Linux:*:*)
954576bae58Smrg	echo powerpc64-unknown-linux-gnu
955576bae58Smrg	exit ;;
956576bae58Smrg    ppc:Linux:*:*)
957576bae58Smrg	echo powerpc-unknown-linux-gnu
95814c0a534Smrg	exit ;;
95914c0a534Smrg    s390:Linux:*:* | s390x:Linux:*:*)
96014c0a534Smrg	echo ${UNAME_MACHINE}-ibm-linux
96114c0a534Smrg	exit ;;
96214c0a534Smrg    sh64*:Linux:*:*)
96314c0a534Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
96414c0a534Smrg	exit ;;
96514c0a534Smrg    sh*:Linux:*:*)
96614c0a534Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
96714c0a534Smrg	exit ;;
96814c0a534Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
96914c0a534Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
97014c0a534Smrg	exit ;;
971576bae58Smrg    tile*:Linux:*:*)
972576bae58Smrg	echo ${UNAME_MACHINE}-tilera-linux-gnu
973576bae58Smrg	exit ;;
974bf2eeab3Smrg    vax:Linux:*:*)
975bf2eeab3Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
976bf2eeab3Smrg	exit ;;
97714c0a534Smrg    x86_64:Linux:*:*)
97814c0a534Smrg	echo x86_64-unknown-linux-gnu
97914c0a534Smrg	exit ;;
980bf2eeab3Smrg    xtensa*:Linux:*:*)
981bf2eeab3Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
982bf2eeab3Smrg	exit ;;
98314c0a534Smrg    i*86:DYNIX/ptx:4*:*)
98414c0a534Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
98514c0a534Smrg	# earlier versions are messed up and put the nodename in both
98614c0a534Smrg	# sysname and nodename.
98714c0a534Smrg	echo i386-sequent-sysv4
98814c0a534Smrg	exit ;;
98914c0a534Smrg    i*86:UNIX_SV:4.2MP:2.*)
99014c0a534Smrg        # Unixware is an offshoot of SVR4, but it has its own version
99114c0a534Smrg        # number series starting with 2...
99214c0a534Smrg        # I am not positive that other SVR4 systems won't match this,
99314c0a534Smrg	# I just have to hope.  -- rms.
99414c0a534Smrg        # Use sysv4.2uw... so that sysv4* matches it.
99514c0a534Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
99614c0a534Smrg	exit ;;
99714c0a534Smrg    i*86:OS/2:*:*)
99814c0a534Smrg	# If we were able to find `uname', then EMX Unix compatibility
99914c0a534Smrg	# is probably installed.
100014c0a534Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
100114c0a534Smrg	exit ;;
100214c0a534Smrg    i*86:XTS-300:*:STOP)
100314c0a534Smrg	echo ${UNAME_MACHINE}-unknown-stop
100414c0a534Smrg	exit ;;
100514c0a534Smrg    i*86:atheos:*:*)
100614c0a534Smrg	echo ${UNAME_MACHINE}-unknown-atheos
100714c0a534Smrg	exit ;;
100814c0a534Smrg    i*86:syllable:*:*)
100914c0a534Smrg	echo ${UNAME_MACHINE}-pc-syllable
101014c0a534Smrg	exit ;;
1011576bae58Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
101214c0a534Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
101314c0a534Smrg	exit ;;
101414c0a534Smrg    i*86:*DOS:*:*)
101514c0a534Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
101614c0a534Smrg	exit ;;
101714c0a534Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
101814c0a534Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
101914c0a534Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
102014c0a534Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
102114c0a534Smrg	else
102214c0a534Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
102314c0a534Smrg	fi
102414c0a534Smrg	exit ;;
102514c0a534Smrg    i*86:*:5:[678]*)
102614c0a534Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
102714c0a534Smrg	case `/bin/uname -X | grep "^Machine"` in
102814c0a534Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
102914c0a534Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
103014c0a534Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
103114c0a534Smrg	esac
103214c0a534Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
103314c0a534Smrg	exit ;;
103414c0a534Smrg    i*86:*:3.2:*)
103514c0a534Smrg	if test -f /usr/options/cb.name; then
103614c0a534Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
103714c0a534Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
103814c0a534Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
103914c0a534Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
104014c0a534Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
104114c0a534Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
104214c0a534Smrg			&& UNAME_MACHINE=i586
104314c0a534Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
104414c0a534Smrg			&& UNAME_MACHINE=i686
104514c0a534Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
104614c0a534Smrg			&& UNAME_MACHINE=i686
104714c0a534Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
104814c0a534Smrg	else
104914c0a534Smrg		echo ${UNAME_MACHINE}-pc-sysv32
105014c0a534Smrg	fi
105114c0a534Smrg	exit ;;
105214c0a534Smrg    pc:*:*:*)
105314c0a534Smrg	# Left here for compatibility:
105414c0a534Smrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1055bf2eeab3Smrg        # the processor, so we play safe by assuming i586.
1056bf2eeab3Smrg	# Note: whatever this is, it MUST be the same as what config.sub
1057bf2eeab3Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
1058bf2eeab3Smrg	# this is a cross-build.
1059bf2eeab3Smrg	echo i586-pc-msdosdjgpp
106014c0a534Smrg        exit ;;
106114c0a534Smrg    Intel:Mach:3*:*)
106214c0a534Smrg	echo i386-pc-mach3
106314c0a534Smrg	exit ;;
106414c0a534Smrg    paragon:*:*:*)
106514c0a534Smrg	echo i860-intel-osf1
106614c0a534Smrg	exit ;;
106714c0a534Smrg    i860:*:4.*:*) # i860-SVR4
106814c0a534Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
106914c0a534Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
107014c0a534Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
107114c0a534Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
107214c0a534Smrg	fi
107314c0a534Smrg	exit ;;
107414c0a534Smrg    mini*:CTIX:SYS*5:*)
107514c0a534Smrg	# "miniframe"
107614c0a534Smrg	echo m68010-convergent-sysv
107714c0a534Smrg	exit ;;
107814c0a534Smrg    mc68k:UNIX:SYSTEM5:3.51m)
107914c0a534Smrg	echo m68k-convergent-sysv
108014c0a534Smrg	exit ;;
108114c0a534Smrg    M680?0:D-NIX:5.3:*)
108214c0a534Smrg	echo m68k-diab-dnix
108314c0a534Smrg	exit ;;
108414c0a534Smrg    M68*:*:R3V[5678]*:*)
108514c0a534Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
108614c0a534Smrg    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)
108714c0a534Smrg	OS_REL=''
108814c0a534Smrg	test -r /etc/.relid \
108914c0a534Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
109014c0a534Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
109114c0a534Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
109214c0a534Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
109314c0a534Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
109414c0a534Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
109514c0a534Smrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
109614c0a534Smrg          && { echo i486-ncr-sysv4; exit; } ;;
1097bf2eeab3Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1098bf2eeab3Smrg	OS_REL='.3'
1099bf2eeab3Smrg	test -r /etc/.relid \
1100bf2eeab3Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1101bf2eeab3Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1102bf2eeab3Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1103bf2eeab3Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1104bf2eeab3Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1105bf2eeab3Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1106bf2eeab3Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
110714c0a534Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
110814c0a534Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
110914c0a534Smrg	exit ;;
111014c0a534Smrg    mc68030:UNIX_System_V:4.*:*)
111114c0a534Smrg	echo m68k-atari-sysv4
111214c0a534Smrg	exit ;;
111314c0a534Smrg    TSUNAMI:LynxOS:2.*:*)
111414c0a534Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
111514c0a534Smrg	exit ;;
111614c0a534Smrg    rs6000:LynxOS:2.*:*)
111714c0a534Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
111814c0a534Smrg	exit ;;
1119576bae58Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
112014c0a534Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
112114c0a534Smrg	exit ;;
112214c0a534Smrg    SM[BE]S:UNIX_SV:*:*)
112314c0a534Smrg	echo mips-dde-sysv${UNAME_RELEASE}
112414c0a534Smrg	exit ;;
112514c0a534Smrg    RM*:ReliantUNIX-*:*:*)
112614c0a534Smrg	echo mips-sni-sysv4
112714c0a534Smrg	exit ;;
112814c0a534Smrg    RM*:SINIX-*:*:*)
112914c0a534Smrg	echo mips-sni-sysv4
113014c0a534Smrg	exit ;;
113114c0a534Smrg    *:SINIX-*:*:*)
113214c0a534Smrg	if uname -p 2>/dev/null >/dev/null ; then
113314c0a534Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
113414c0a534Smrg		echo ${UNAME_MACHINE}-sni-sysv4
113514c0a534Smrg	else
113614c0a534Smrg		echo ns32k-sni-sysv
113714c0a534Smrg	fi
113814c0a534Smrg	exit ;;
113914c0a534Smrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
114014c0a534Smrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
114114c0a534Smrg        echo i586-unisys-sysv4
114214c0a534Smrg        exit ;;
114314c0a534Smrg    *:UNIX_System_V:4*:FTX*)
114414c0a534Smrg	# From Gerald Hewes <hewes@openmarket.com>.
114514c0a534Smrg	# How about differentiating between stratus architectures? -djm
114614c0a534Smrg	echo hppa1.1-stratus-sysv4
114714c0a534Smrg	exit ;;
114814c0a534Smrg    *:*:*:FTX*)
114914c0a534Smrg	# From seanf@swdc.stratus.com.
115014c0a534Smrg	echo i860-stratus-sysv4
115114c0a534Smrg	exit ;;
115214c0a534Smrg    i*86:VOS:*:*)
115314c0a534Smrg	# From Paul.Green@stratus.com.
115414c0a534Smrg	echo ${UNAME_MACHINE}-stratus-vos
115514c0a534Smrg	exit ;;
115614c0a534Smrg    *:VOS:*:*)
115714c0a534Smrg	# From Paul.Green@stratus.com.
115814c0a534Smrg	echo hppa1.1-stratus-vos
115914c0a534Smrg	exit ;;
116014c0a534Smrg    mc68*:A/UX:*:*)
116114c0a534Smrg	echo m68k-apple-aux${UNAME_RELEASE}
116214c0a534Smrg	exit ;;
116314c0a534Smrg    news*:NEWS-OS:6*:*)
116414c0a534Smrg	echo mips-sony-newsos6
116514c0a534Smrg	exit ;;
116614c0a534Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
116714c0a534Smrg	if [ -d /usr/nec ]; then
116814c0a534Smrg	        echo mips-nec-sysv${UNAME_RELEASE}
116914c0a534Smrg	else
117014c0a534Smrg	        echo mips-unknown-sysv${UNAME_RELEASE}
117114c0a534Smrg	fi
117214c0a534Smrg        exit ;;
117314c0a534Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
117414c0a534Smrg	echo powerpc-be-beos
117514c0a534Smrg	exit ;;
117614c0a534Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
117714c0a534Smrg	echo powerpc-apple-beos
117814c0a534Smrg	exit ;;
117914c0a534Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
118014c0a534Smrg	echo i586-pc-beos
118114c0a534Smrg	exit ;;
1182bf2eeab3Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1183bf2eeab3Smrg	echo i586-pc-haiku
1184bf2eeab3Smrg	exit ;;
118514c0a534Smrg    SX-4:SUPER-UX:*:*)
118614c0a534Smrg	echo sx4-nec-superux${UNAME_RELEASE}
118714c0a534Smrg	exit ;;
118814c0a534Smrg    SX-5:SUPER-UX:*:*)
118914c0a534Smrg	echo sx5-nec-superux${UNAME_RELEASE}
119014c0a534Smrg	exit ;;
119114c0a534Smrg    SX-6:SUPER-UX:*:*)
119214c0a534Smrg	echo sx6-nec-superux${UNAME_RELEASE}
119314c0a534Smrg	exit ;;
1194bf2eeab3Smrg    SX-7:SUPER-UX:*:*)
1195bf2eeab3Smrg	echo sx7-nec-superux${UNAME_RELEASE}
1196bf2eeab3Smrg	exit ;;
1197bf2eeab3Smrg    SX-8:SUPER-UX:*:*)
1198bf2eeab3Smrg	echo sx8-nec-superux${UNAME_RELEASE}
1199bf2eeab3Smrg	exit ;;
1200bf2eeab3Smrg    SX-8R:SUPER-UX:*:*)
1201bf2eeab3Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
1202bf2eeab3Smrg	exit ;;
120314c0a534Smrg    Power*:Rhapsody:*:*)
120414c0a534Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
120514c0a534Smrg	exit ;;
120614c0a534Smrg    *:Rhapsody:*:*)
120714c0a534Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
120814c0a534Smrg	exit ;;
120914c0a534Smrg    *:Darwin:*:*)
121014c0a534Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
121114c0a534Smrg	case $UNAME_PROCESSOR in
1212576bae58Smrg	    i386)
1213576bae58Smrg		eval $set_cc_for_build
1214576bae58Smrg		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1215576bae58Smrg		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1216576bae58Smrg		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1217576bae58Smrg		      grep IS_64BIT_ARCH >/dev/null
1218576bae58Smrg		  then
1219576bae58Smrg		      UNAME_PROCESSOR="x86_64"
1220576bae58Smrg		  fi
1221576bae58Smrg		fi ;;
122214c0a534Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
122314c0a534Smrg	esac
122414c0a534Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
122514c0a534Smrg	exit ;;
122614c0a534Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
122714c0a534Smrg	UNAME_PROCESSOR=`uname -p`
122814c0a534Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
122914c0a534Smrg		UNAME_PROCESSOR=i386
123014c0a534Smrg		UNAME_MACHINE=pc
123114c0a534Smrg	fi
123214c0a534Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
123314c0a534Smrg	exit ;;
123414c0a534Smrg    *:QNX:*:4*)
123514c0a534Smrg	echo i386-pc-qnx
123614c0a534Smrg	exit ;;
123714c0a534Smrg    NSE-?:NONSTOP_KERNEL:*:*)
123814c0a534Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
123914c0a534Smrg	exit ;;
124014c0a534Smrg    NSR-?:NONSTOP_KERNEL:*:*)
124114c0a534Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
124214c0a534Smrg	exit ;;
124314c0a534Smrg    *:NonStop-UX:*:*)
124414c0a534Smrg	echo mips-compaq-nonstopux
124514c0a534Smrg	exit ;;
124614c0a534Smrg    BS2000:POSIX*:*:*)
124714c0a534Smrg	echo bs2000-siemens-sysv
124814c0a534Smrg	exit ;;
124914c0a534Smrg    DS/*:UNIX_System_V:*:*)
125014c0a534Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
125114c0a534Smrg	exit ;;
125214c0a534Smrg    *:Plan9:*:*)
125314c0a534Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
125414c0a534Smrg	# is converted to i386 for consistency with other x86
125514c0a534Smrg	# operating systems.
125614c0a534Smrg	if test "$cputype" = "386"; then
125714c0a534Smrg	    UNAME_MACHINE=i386
125814c0a534Smrg	else
125914c0a534Smrg	    UNAME_MACHINE="$cputype"
126014c0a534Smrg	fi
126114c0a534Smrg	echo ${UNAME_MACHINE}-unknown-plan9
126214c0a534Smrg	exit ;;
126314c0a534Smrg    *:TOPS-10:*:*)
126414c0a534Smrg	echo pdp10-unknown-tops10
126514c0a534Smrg	exit ;;
126614c0a534Smrg    *:TENEX:*:*)
126714c0a534Smrg	echo pdp10-unknown-tenex
126814c0a534Smrg	exit ;;
126914c0a534Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
127014c0a534Smrg	echo pdp10-dec-tops20
127114c0a534Smrg	exit ;;
127214c0a534Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
127314c0a534Smrg	echo pdp10-xkl-tops20
127414c0a534Smrg	exit ;;
127514c0a534Smrg    *:TOPS-20:*:*)
127614c0a534Smrg	echo pdp10-unknown-tops20
127714c0a534Smrg	exit ;;
127814c0a534Smrg    *:ITS:*:*)
127914c0a534Smrg	echo pdp10-unknown-its
128014c0a534Smrg	exit ;;
128114c0a534Smrg    SEI:*:*:SEIUX)
128214c0a534Smrg        echo mips-sei-seiux${UNAME_RELEASE}
128314c0a534Smrg	exit ;;
128414c0a534Smrg    *:DragonFly:*:*)
128514c0a534Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
128614c0a534Smrg	exit ;;
128714c0a534Smrg    *:*VMS:*:*)
128814c0a534Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
128914c0a534Smrg	case "${UNAME_MACHINE}" in
129014c0a534Smrg	    A*) echo alpha-dec-vms ; exit ;;
129114c0a534Smrg	    I*) echo ia64-dec-vms ; exit ;;
129214c0a534Smrg	    V*) echo vax-dec-vms ; exit ;;
129314c0a534Smrg	esac ;;
129414c0a534Smrg    *:XENIX:*:SysV)
129514c0a534Smrg	echo i386-pc-xenix
129614c0a534Smrg	exit ;;
129714c0a534Smrg    i*86:skyos:*:*)
129814c0a534Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
129914c0a534Smrg	exit ;;
1300bf2eeab3Smrg    i*86:rdos:*:*)
1301bf2eeab3Smrg	echo ${UNAME_MACHINE}-pc-rdos
1302bf2eeab3Smrg	exit ;;
1303bf2eeab3Smrg    i*86:AROS:*:*)
1304bf2eeab3Smrg	echo ${UNAME_MACHINE}-pc-aros
1305bf2eeab3Smrg	exit ;;
130614c0a534Smrgesac
130714c0a534Smrg
130814c0a534Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
130914c0a534Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
131014c0a534Smrg
131114c0a534Smrgeval $set_cc_for_build
131214c0a534Smrgcat >$dummy.c <<EOF
131314c0a534Smrg#ifdef _SEQUENT_
131414c0a534Smrg# include <sys/types.h>
131514c0a534Smrg# include <sys/utsname.h>
131614c0a534Smrg#endif
131714c0a534Smrgmain ()
131814c0a534Smrg{
131914c0a534Smrg#if defined (sony)
132014c0a534Smrg#if defined (MIPSEB)
132114c0a534Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
132214c0a534Smrg     I don't know....  */
132314c0a534Smrg  printf ("mips-sony-bsd\n"); exit (0);
132414c0a534Smrg#else
132514c0a534Smrg#include <sys/param.h>
132614c0a534Smrg  printf ("m68k-sony-newsos%s\n",
132714c0a534Smrg#ifdef NEWSOS4
132814c0a534Smrg          "4"
132914c0a534Smrg#else
133014c0a534Smrg	  ""
133114c0a534Smrg#endif
133214c0a534Smrg         ); exit (0);
133314c0a534Smrg#endif
133414c0a534Smrg#endif
133514c0a534Smrg
133614c0a534Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
133714c0a534Smrg  printf ("arm-acorn-riscix\n"); exit (0);
133814c0a534Smrg#endif
133914c0a534Smrg
134014c0a534Smrg#if defined (hp300) && !defined (hpux)
134114c0a534Smrg  printf ("m68k-hp-bsd\n"); exit (0);
134214c0a534Smrg#endif
134314c0a534Smrg
134414c0a534Smrg#if defined (NeXT)
134514c0a534Smrg#if !defined (__ARCHITECTURE__)
134614c0a534Smrg#define __ARCHITECTURE__ "m68k"
134714c0a534Smrg#endif
134814c0a534Smrg  int version;
134914c0a534Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
135014c0a534Smrg  if (version < 4)
135114c0a534Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
135214c0a534Smrg  else
135314c0a534Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
135414c0a534Smrg  exit (0);
135514c0a534Smrg#endif
135614c0a534Smrg
135714c0a534Smrg#if defined (MULTIMAX) || defined (n16)
135814c0a534Smrg#if defined (UMAXV)
135914c0a534Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
136014c0a534Smrg#else
136114c0a534Smrg#if defined (CMU)
136214c0a534Smrg  printf ("ns32k-encore-mach\n"); exit (0);
136314c0a534Smrg#else
136414c0a534Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
136514c0a534Smrg#endif
136614c0a534Smrg#endif
136714c0a534Smrg#endif
136814c0a534Smrg
136914c0a534Smrg#if defined (__386BSD__)
137014c0a534Smrg  printf ("i386-pc-bsd\n"); exit (0);
137114c0a534Smrg#endif
137214c0a534Smrg
137314c0a534Smrg#if defined (sequent)
137414c0a534Smrg#if defined (i386)
137514c0a534Smrg  printf ("i386-sequent-dynix\n"); exit (0);
137614c0a534Smrg#endif
137714c0a534Smrg#if defined (ns32000)
137814c0a534Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
137914c0a534Smrg#endif
138014c0a534Smrg#endif
138114c0a534Smrg
138214c0a534Smrg#if defined (_SEQUENT_)
138314c0a534Smrg    struct utsname un;
138414c0a534Smrg
138514c0a534Smrg    uname(&un);
138614c0a534Smrg
138714c0a534Smrg    if (strncmp(un.version, "V2", 2) == 0) {
138814c0a534Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
138914c0a534Smrg    }
139014c0a534Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
139114c0a534Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
139214c0a534Smrg    }
139314c0a534Smrg    printf ("i386-sequent-ptx\n"); exit (0);
139414c0a534Smrg
139514c0a534Smrg#endif
139614c0a534Smrg
139714c0a534Smrg#if defined (vax)
139814c0a534Smrg# if !defined (ultrix)
139914c0a534Smrg#  include <sys/param.h>
140014c0a534Smrg#  if defined (BSD)
140114c0a534Smrg#   if BSD == 43
140214c0a534Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
140314c0a534Smrg#   else
140414c0a534Smrg#    if BSD == 199006
140514c0a534Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
140614c0a534Smrg#    else
140714c0a534Smrg      printf ("vax-dec-bsd\n"); exit (0);
140814c0a534Smrg#    endif
140914c0a534Smrg#   endif
141014c0a534Smrg#  else
141114c0a534Smrg    printf ("vax-dec-bsd\n"); exit (0);
141214c0a534Smrg#  endif
141314c0a534Smrg# else
141414c0a534Smrg    printf ("vax-dec-ultrix\n"); exit (0);
141514c0a534Smrg# endif
141614c0a534Smrg#endif
141714c0a534Smrg
141814c0a534Smrg#if defined (alliant) && defined (i860)
141914c0a534Smrg  printf ("i860-alliant-bsd\n"); exit (0);
142014c0a534Smrg#endif
142114c0a534Smrg
142214c0a534Smrg  exit (1);
142314c0a534Smrg}
142414c0a534SmrgEOF
142514c0a534Smrg
142614c0a534Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
142714c0a534Smrg	{ echo "$SYSTEM_NAME"; exit; }
142814c0a534Smrg
142914c0a534Smrg# Apollos put the system type in the environment.
143014c0a534Smrg
143114c0a534Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
143214c0a534Smrg
143314c0a534Smrg# Convex versions that predate uname can use getsysinfo(1)
143414c0a534Smrg
143514c0a534Smrgif [ -x /usr/convex/getsysinfo ]
143614c0a534Smrgthen
143714c0a534Smrg    case `getsysinfo -f cpu_type` in
143814c0a534Smrg    c1*)
143914c0a534Smrg	echo c1-convex-bsd
144014c0a534Smrg	exit ;;
144114c0a534Smrg    c2*)
144214c0a534Smrg	if getsysinfo -f scalar_acc
144314c0a534Smrg	then echo c32-convex-bsd
144414c0a534Smrg	else echo c2-convex-bsd
144514c0a534Smrg	fi
144614c0a534Smrg	exit ;;
144714c0a534Smrg    c34*)
144814c0a534Smrg	echo c34-convex-bsd
144914c0a534Smrg	exit ;;
145014c0a534Smrg    c38*)
145114c0a534Smrg	echo c38-convex-bsd
145214c0a534Smrg	exit ;;
145314c0a534Smrg    c4*)
145414c0a534Smrg	echo c4-convex-bsd
145514c0a534Smrg	exit ;;
145614c0a534Smrg    esac
145714c0a534Smrgfi
145814c0a534Smrg
145914c0a534Smrgcat >&2 <<EOF
146014c0a534Smrg$0: unable to guess system type
146114c0a534Smrg
146214c0a534SmrgThis script, last modified $timestamp, has failed to recognize
146314c0a534Smrgthe operating system you are using. It is advised that you
146414c0a534Smrgdownload the most up to date version of the config scripts from
146514c0a534Smrg
1466bf2eeab3Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
146714c0a534Smrgand
1468bf2eeab3Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
146914c0a534Smrg
147014c0a534SmrgIf the version you run ($0) is already up to date, please
147114c0a534Smrgsend the following data and any information you think might be
147214c0a534Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
147314c0a534Smrginformation to handle your system.
147414c0a534Smrg
147514c0a534Smrgconfig.guess timestamp = $timestamp
147614c0a534Smrg
147714c0a534Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
147814c0a534Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
147914c0a534Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
148014c0a534Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
148114c0a534Smrg
148214c0a534Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
148314c0a534Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
148414c0a534Smrg
148514c0a534Smrghostinfo               = `(hostinfo) 2>/dev/null`
148614c0a534Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
148714c0a534Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
148814c0a534Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
148914c0a534Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
149014c0a534Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
149114c0a534Smrg
149214c0a534SmrgUNAME_MACHINE = ${UNAME_MACHINE}
149314c0a534SmrgUNAME_RELEASE = ${UNAME_RELEASE}
149414c0a534SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
149514c0a534SmrgUNAME_VERSION = ${UNAME_VERSION}
149614c0a534SmrgEOF
149714c0a534Smrg
149814c0a534Smrgexit 1
149914c0a534Smrg
150014c0a534Smrg# Local variables:
150114c0a534Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
150214c0a534Smrg# time-stamp-start: "timestamp='"
150314c0a534Smrg# time-stamp-format: "%:y-%02m-%02d"
150414c0a534Smrg# time-stamp-end: "'"
150514c0a534Smrg# End:
1506