config.guess revision fc51f767
167f05d30Smrg#! /bin/sh
267f05d30Smrg# Attempt to guess a canonical system name.
367f05d30Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4fc51f767Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5fffe5102Smrg#   Free Software Foundation, Inc.
667f05d30Smrg
7fc51f767Smrgtimestamp='2010-08-21'
867f05d30Smrg
967f05d30Smrg# This file is free software; you can redistribute it and/or modify it
1067f05d30Smrg# under the terms of the GNU General Public License as published by
1167f05d30Smrg# the Free Software Foundation; either version 2 of the License, or
1267f05d30Smrg# (at your option) any later version.
1367f05d30Smrg#
1467f05d30Smrg# This program is distributed in the hope that it will be useful, but
1567f05d30Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1667f05d30Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1767f05d30Smrg# General Public License for more details.
1867f05d30Smrg#
1967f05d30Smrg# You should have received a copy of the GNU General Public License
2067f05d30Smrg# along with this program; if not, write to the Free Software
21fffe5102Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22fffe5102Smrg# 02110-1301, USA.
2367f05d30Smrg#
2467f05d30Smrg# As a special exception to the GNU General Public License, if you
2567f05d30Smrg# distribute this file as part of a program that contains a
2667f05d30Smrg# configuration script generated by Autoconf, you may include it under
2767f05d30Smrg# the same distribution terms that you use for the rest of that program.
2867f05d30Smrg
29fffe5102Smrg
30fffe5102Smrg# Originally written by Per Bothner.  Please send patches (context
31fffe5102Smrg# diff format) to <config-patches@gnu.org> and include a ChangeLog
32fffe5102Smrg# entry.
3367f05d30Smrg#
3467f05d30Smrg# This script attempts to guess a canonical system name similar to
3567f05d30Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
3667f05d30Smrg# exits with 0.  Otherwise, it exits with 1.
3767f05d30Smrg#
38fffe5102Smrg# You can get the latest version of this script from:
39fffe5102Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
4067f05d30Smrg
4167f05d30Smrgme=`echo "$0" | sed -e 's,.*/,,'`
4267f05d30Smrg
4367f05d30Smrgusage="\
4467f05d30SmrgUsage: $0 [OPTION]
4567f05d30Smrg
4667f05d30SmrgOutput the configuration name of the system \`$me' is run on.
4767f05d30Smrg
4867f05d30SmrgOperation modes:
4967f05d30Smrg  -h, --help         print this help, then exit
5067f05d30Smrg  -t, --time-stamp   print date of last modification, then exit
5167f05d30Smrg  -v, --version      print version number, then exit
5267f05d30Smrg
5367f05d30SmrgReport bugs and patches to <config-patches@gnu.org>."
5467f05d30Smrg
5567f05d30Smrgversion="\
5667f05d30SmrgGNU config.guess ($timestamp)
5767f05d30Smrg
5867f05d30SmrgOriginally written by Per Bothner.
59fc51f767SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60fc51f767Smrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61fc51f767SmrgSoftware Foundation, Inc.
6267f05d30Smrg
6367f05d30SmrgThis is free software; see the source for copying conditions.  There is NO
6467f05d30Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6567f05d30Smrg
6667f05d30Smrghelp="
6767f05d30SmrgTry \`$me --help' for more information."
6867f05d30Smrg
6967f05d30Smrg# Parse command line
7067f05d30Smrgwhile test $# -gt 0 ; do
7167f05d30Smrg  case $1 in
7267f05d30Smrg    --time-stamp | --time* | -t )
73fffe5102Smrg       echo "$timestamp" ; exit ;;
7467f05d30Smrg    --version | -v )
75fffe5102Smrg       echo "$version" ; exit ;;
7667f05d30Smrg    --help | --h* | -h )
77fffe5102Smrg       echo "$usage"; exit ;;
7867f05d30Smrg    -- )     # Stop option processing
7967f05d30Smrg       shift; break ;;
8067f05d30Smrg    - )	# Use stdin as input.
8167f05d30Smrg       break ;;
8267f05d30Smrg    -* )
8367f05d30Smrg       echo "$me: invalid option $1$help" >&2
8467f05d30Smrg       exit 1 ;;
8567f05d30Smrg    * )
8667f05d30Smrg       break ;;
8767f05d30Smrg  esac
8867f05d30Smrgdone
8967f05d30Smrg
9067f05d30Smrgif test $# != 0; then
9167f05d30Smrg  echo "$me: too many arguments$help" >&2
9267f05d30Smrg  exit 1
9367f05d30Smrgfi
9467f05d30Smrg
95fc51f767Smrgtrap 'exit 1' HUP INT TERM
9667f05d30Smrg
9767f05d30Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9867f05d30Smrg# compiler to aid in system detection is discouraged as it requires
9967f05d30Smrg# temporary files to be created and, as you can see below, it is a
10067f05d30Smrg# headache to deal with in a portable fashion.
10167f05d30Smrg
10267f05d30Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
10367f05d30Smrg# use `HOST_CC' if defined, but it is deprecated.
10467f05d30Smrg
10567f05d30Smrg# Portable tmp directory creation inspired by the Autoconf team.
10667f05d30Smrg
10767f05d30Smrgset_cc_for_build='
10867f05d30Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109fc51f767Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
11067f05d30Smrg: ${TMPDIR=/tmp} ;
111fffe5102Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
11267f05d30Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
11367f05d30Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
11467f05d30Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
11567f05d30Smrgdummy=$tmp/dummy ;
11667f05d30Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
11767f05d30Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
11867f05d30Smrg ,,)    echo "int x;" > $dummy.c ;
11967f05d30Smrg	for c in cc gcc c89 c99 ; do
12067f05d30Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
12167f05d30Smrg	     CC_FOR_BUILD="$c"; break ;
12267f05d30Smrg	  fi ;
12367f05d30Smrg	done ;
12467f05d30Smrg	if test x"$CC_FOR_BUILD" = x ; then
12567f05d30Smrg	  CC_FOR_BUILD=no_compiler_found ;
12667f05d30Smrg	fi
12767f05d30Smrg	;;
12867f05d30Smrg ,,*)   CC_FOR_BUILD=$CC ;;
12967f05d30Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
130fffe5102Smrgesac ; set_cc_for_build= ;'
13167f05d30Smrg
13267f05d30Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
13367f05d30Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
13467f05d30Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
13567f05d30Smrg	PATH=$PATH:/.attbin ; export PATH
13667f05d30Smrgfi
13767f05d30Smrg
13867f05d30SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13967f05d30SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
14067f05d30SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
14167f05d30SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
14267f05d30Smrg
14367f05d30Smrg# Note: order is significant - the case branches are not exclusive.
14467f05d30Smrg
14567f05d30Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
14667f05d30Smrg    *:NetBSD:*:*)
14767f05d30Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
14867f05d30Smrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
14967f05d30Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
15067f05d30Smrg	# switched to ELF, *-*-netbsd* would select the old
15167f05d30Smrg	# object file format.  This provides both forward
15267f05d30Smrg	# compatibility and a consistent mechanism for selecting the
15367f05d30Smrg	# object file format.
15467f05d30Smrg	#
15567f05d30Smrg	# Note: NetBSD doesn't particularly care about the vendor
15667f05d30Smrg	# portion of the name.  We always set it to "unknown".
15767f05d30Smrg	sysctl="sysctl -n hw.machine_arch"
15867f05d30Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
15967f05d30Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
16067f05d30Smrg	case "${UNAME_MACHINE_ARCH}" in
16167f05d30Smrg	    armeb) machine=armeb-unknown ;;
16267f05d30Smrg	    arm*) machine=arm-unknown ;;
16367f05d30Smrg	    sh3el) machine=shl-unknown ;;
16467f05d30Smrg	    sh3eb) machine=sh-unknown ;;
165fffe5102Smrg	    sh5el) machine=sh5le-unknown ;;
16667f05d30Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
16767f05d30Smrg	esac
16867f05d30Smrg	# The Operating System including object format, if it has switched
16967f05d30Smrg	# to ELF recently, or will in the future.
17067f05d30Smrg	case "${UNAME_MACHINE_ARCH}" in
17167f05d30Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
17267f05d30Smrg		eval $set_cc_for_build
17367f05d30Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174fffe5102Smrg			| grep -q __ELF__
17567f05d30Smrg		then
17667f05d30Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
17767f05d30Smrg		    # Return netbsd for either.  FIX?
17867f05d30Smrg		    os=netbsd
17967f05d30Smrg		else
18067f05d30Smrg		    os=netbsdelf
18167f05d30Smrg		fi
18267f05d30Smrg		;;
18367f05d30Smrg	    *)
18467f05d30Smrg	        os=netbsd
18567f05d30Smrg		;;
18667f05d30Smrg	esac
18767f05d30Smrg	# The OS release
18867f05d30Smrg	# Debian GNU/NetBSD machines have a different userland, and
18967f05d30Smrg	# thus, need a distinct triplet. However, they do not need
19067f05d30Smrg	# kernel version information, so it can be replaced with a
19167f05d30Smrg	# suitable tag, in the style of linux-gnu.
19267f05d30Smrg	case "${UNAME_VERSION}" in
19367f05d30Smrg	    Debian*)
19467f05d30Smrg		release='-gnu'
19567f05d30Smrg		;;
19667f05d30Smrg	    *)
19767f05d30Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19867f05d30Smrg		;;
19967f05d30Smrg	esac
20067f05d30Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
20167f05d30Smrg	# contains redundant information, the shorter form:
20267f05d30Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
20367f05d30Smrg	echo "${machine}-${os}${release}"
204fffe5102Smrg	exit ;;
20567f05d30Smrg    *:OpenBSD:*:*)
206fffe5102Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
207fffe5102Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
208fffe5102Smrg	exit ;;
209fffe5102Smrg    *:ekkoBSD:*:*)
210fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
211fffe5102Smrg	exit ;;
212fffe5102Smrg    *:SolidBSD:*:*)
213fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
214fffe5102Smrg	exit ;;
215fffe5102Smrg    macppc:MirBSD:*:*)
216fffe5102Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
217fffe5102Smrg	exit ;;
218fffe5102Smrg    *:MirBSD:*:*)
219fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
220fffe5102Smrg	exit ;;
22167f05d30Smrg    alpha:OSF1:*:*)
222fffe5102Smrg	case $UNAME_RELEASE in
223fffe5102Smrg	*4.0)
22467f05d30Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225fffe5102Smrg		;;
226fffe5102Smrg	*5.*)
227fffe5102Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228fffe5102Smrg		;;
229fffe5102Smrg	esac
23067f05d30Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
23167f05d30Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
23267f05d30Smrg	# covers most systems running today.  This code pipes the CPU
23367f05d30Smrg	# types through head -n 1, so we only detect the type of CPU 0.
23467f05d30Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
23567f05d30Smrg	case "$ALPHA_CPU_TYPE" in
23667f05d30Smrg	    "EV4 (21064)")
23767f05d30Smrg		UNAME_MACHINE="alpha" ;;
23867f05d30Smrg	    "EV4.5 (21064)")
23967f05d30Smrg		UNAME_MACHINE="alpha" ;;
24067f05d30Smrg	    "LCA4 (21066/21068)")
24167f05d30Smrg		UNAME_MACHINE="alpha" ;;
24267f05d30Smrg	    "EV5 (21164)")
24367f05d30Smrg		UNAME_MACHINE="alphaev5" ;;
24467f05d30Smrg	    "EV5.6 (21164A)")
24567f05d30Smrg		UNAME_MACHINE="alphaev56" ;;
24667f05d30Smrg	    "EV5.6 (21164PC)")
24767f05d30Smrg		UNAME_MACHINE="alphapca56" ;;
24867f05d30Smrg	    "EV5.7 (21164PC)")
24967f05d30Smrg		UNAME_MACHINE="alphapca57" ;;
25067f05d30Smrg	    "EV6 (21264)")
25167f05d30Smrg		UNAME_MACHINE="alphaev6" ;;
25267f05d30Smrg	    "EV6.7 (21264A)")
25367f05d30Smrg		UNAME_MACHINE="alphaev67" ;;
25467f05d30Smrg	    "EV6.8CB (21264C)")
25567f05d30Smrg		UNAME_MACHINE="alphaev68" ;;
25667f05d30Smrg	    "EV6.8AL (21264B)")
25767f05d30Smrg		UNAME_MACHINE="alphaev68" ;;
25867f05d30Smrg	    "EV6.8CX (21264D)")
25967f05d30Smrg		UNAME_MACHINE="alphaev68" ;;
26067f05d30Smrg	    "EV6.9A (21264/EV69A)")
26167f05d30Smrg		UNAME_MACHINE="alphaev69" ;;
26267f05d30Smrg	    "EV7 (21364)")
26367f05d30Smrg		UNAME_MACHINE="alphaev7" ;;
26467f05d30Smrg	    "EV7.9 (21364A)")
26567f05d30Smrg		UNAME_MACHINE="alphaev79" ;;
26667f05d30Smrg	esac
267fffe5102Smrg	# A Pn.n version is a patched version.
26867f05d30Smrg	# A Vn.n version is a released version.
26967f05d30Smrg	# A Tn.n version is a released field test version.
27067f05d30Smrg	# A Xn.n version is an unreleased experimental baselevel.
27167f05d30Smrg	# 1.2 uses "1.2" for uname -r.
272fffe5102Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273fffe5102Smrg	exit ;;
27467f05d30Smrg    Alpha\ *:Windows_NT*:*)
27567f05d30Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
27667f05d30Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
27767f05d30Smrg	# of the specific Alpha model?
27867f05d30Smrg	echo alpha-pc-interix
279fffe5102Smrg	exit ;;
28067f05d30Smrg    21064:Windows_NT:50:3)
28167f05d30Smrg	echo alpha-dec-winnt3.5
282fffe5102Smrg	exit ;;
28367f05d30Smrg    Amiga*:UNIX_System_V:4.0:*)
28467f05d30Smrg	echo m68k-unknown-sysv4
285fffe5102Smrg	exit ;;
28667f05d30Smrg    *:[Aa]miga[Oo][Ss]:*:*)
28767f05d30Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
288fffe5102Smrg	exit ;;
28967f05d30Smrg    *:[Mm]orph[Oo][Ss]:*:*)
29067f05d30Smrg	echo ${UNAME_MACHINE}-unknown-morphos
291fffe5102Smrg	exit ;;
29267f05d30Smrg    *:OS/390:*:*)
29367f05d30Smrg	echo i370-ibm-openedition
294fffe5102Smrg	exit ;;
295fffe5102Smrg    *:z/VM:*:*)
296fffe5102Smrg	echo s390-ibm-zvmoe
297fffe5102Smrg	exit ;;
298fffe5102Smrg    *:OS400:*:*)
299fffe5102Smrg        echo powerpc-ibm-os400
300fffe5102Smrg	exit ;;
30167f05d30Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
30267f05d30Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
303fffe5102Smrg	exit ;;
304fffe5102Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
305fffe5102Smrg	echo arm-unknown-riscos
306fffe5102Smrg	exit ;;
30767f05d30Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
30867f05d30Smrg	echo hppa1.1-hitachi-hiuxmpp
309fffe5102Smrg	exit ;;
31067f05d30Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
31167f05d30Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
31267f05d30Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
31367f05d30Smrg		echo pyramid-pyramid-sysv3
31467f05d30Smrg	else
31567f05d30Smrg		echo pyramid-pyramid-bsd
31667f05d30Smrg	fi
317fffe5102Smrg	exit ;;
31867f05d30Smrg    NILE*:*:*:dcosx)
31967f05d30Smrg	echo pyramid-pyramid-svr4
320fffe5102Smrg	exit ;;
32167f05d30Smrg    DRS?6000:unix:4.0:6*)
32267f05d30Smrg	echo sparc-icl-nx6
323fffe5102Smrg	exit ;;
324fffe5102Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
32567f05d30Smrg	case `/usr/bin/uname -p` in
326fffe5102Smrg	    sparc) echo sparc-icl-nx7; exit ;;
32767f05d30Smrg	esac ;;
328fffe5102Smrg    s390x:SunOS:*:*)
329fffe5102Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
330fffe5102Smrg	exit ;;
33167f05d30Smrg    sun4H:SunOS:5.*:*)
33267f05d30Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333fffe5102Smrg	exit ;;
33467f05d30Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
33567f05d30Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
336fffe5102Smrg	exit ;;
337fffe5102Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
338fffe5102Smrg	echo i386-pc-auroraux${UNAME_RELEASE}
339fffe5102Smrg	exit ;;
340fffe5102Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
341fffe5102Smrg	eval $set_cc_for_build
342fffe5102Smrg	SUN_ARCH="i386"
343fffe5102Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
344fffe5102Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
345fffe5102Smrg	# This test works for both compilers.
346fffe5102Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
347fffe5102Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
348fffe5102Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
349fffe5102Smrg		grep IS_64BIT_ARCH >/dev/null
350fffe5102Smrg	    then
351fffe5102Smrg		SUN_ARCH="x86_64"
352fffe5102Smrg	    fi
353fffe5102Smrg	fi
354fffe5102Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
355fffe5102Smrg	exit ;;
35667f05d30Smrg    sun4*:SunOS:6*:*)
35767f05d30Smrg	# According to config.sub, this is the proper way to canonicalize
35867f05d30Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
35967f05d30Smrg	# it's likely to be more like Solaris than SunOS4.
36067f05d30Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
361fffe5102Smrg	exit ;;
36267f05d30Smrg    sun4*:SunOS:*:*)
36367f05d30Smrg	case "`/usr/bin/arch -k`" in
36467f05d30Smrg	    Series*|S4*)
36567f05d30Smrg		UNAME_RELEASE=`uname -v`
36667f05d30Smrg		;;
36767f05d30Smrg	esac
36867f05d30Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
36967f05d30Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
370fffe5102Smrg	exit ;;
37167f05d30Smrg    sun3*:SunOS:*:*)
37267f05d30Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
373fffe5102Smrg	exit ;;
37467f05d30Smrg    sun*:*:4.2BSD:*)
37567f05d30Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
37667f05d30Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
37767f05d30Smrg	case "`/bin/arch`" in
37867f05d30Smrg	    sun3)
37967f05d30Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
38067f05d30Smrg		;;
38167f05d30Smrg	    sun4)
38267f05d30Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
38367f05d30Smrg		;;
38467f05d30Smrg	esac
385fffe5102Smrg	exit ;;
38667f05d30Smrg    aushp:SunOS:*:*)
38767f05d30Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
388fffe5102Smrg	exit ;;
38967f05d30Smrg    # The situation for MiNT is a little confusing.  The machine name
39067f05d30Smrg    # can be virtually everything (everything which is not
39167f05d30Smrg    # "atarist" or "atariste" at least should have a processor
39267f05d30Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
39367f05d30Smrg    # to the lowercase version "mint" (or "freemint").  Finally
39467f05d30Smrg    # the system name "TOS" denotes a system which is actually not
39567f05d30Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
39667f05d30Smrg    # be no problem.
39767f05d30Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
39867f05d30Smrg        echo m68k-atari-mint${UNAME_RELEASE}
399fffe5102Smrg	exit ;;
40067f05d30Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
40167f05d30Smrg	echo m68k-atari-mint${UNAME_RELEASE}
402fffe5102Smrg        exit ;;
40367f05d30Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
40467f05d30Smrg        echo m68k-atari-mint${UNAME_RELEASE}
405fffe5102Smrg	exit ;;
40667f05d30Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
40767f05d30Smrg        echo m68k-milan-mint${UNAME_RELEASE}
408fffe5102Smrg        exit ;;
40967f05d30Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
41067f05d30Smrg        echo m68k-hades-mint${UNAME_RELEASE}
411fffe5102Smrg        exit ;;
41267f05d30Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
41367f05d30Smrg        echo m68k-unknown-mint${UNAME_RELEASE}
414fffe5102Smrg        exit ;;
415fffe5102Smrg    m68k:machten:*:*)
416fffe5102Smrg	echo m68k-apple-machten${UNAME_RELEASE}
417fffe5102Smrg	exit ;;
41867f05d30Smrg    powerpc:machten:*:*)
41967f05d30Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
420fffe5102Smrg	exit ;;
42167f05d30Smrg    RISC*:Mach:*:*)
42267f05d30Smrg	echo mips-dec-mach_bsd4.3
423fffe5102Smrg	exit ;;
42467f05d30Smrg    RISC*:ULTRIX:*:*)
42567f05d30Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
426fffe5102Smrg	exit ;;
42767f05d30Smrg    VAX*:ULTRIX*:*:*)
42867f05d30Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
429fffe5102Smrg	exit ;;
43067f05d30Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
43167f05d30Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
432fffe5102Smrg	exit ;;
43367f05d30Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
43467f05d30Smrg	eval $set_cc_for_build
43567f05d30Smrg	sed 's/^	//' << EOF >$dummy.c
43667f05d30Smrg#ifdef __cplusplus
43767f05d30Smrg#include <stdio.h>  /* for printf() prototype */
43867f05d30Smrg	int main (int argc, char *argv[]) {
43967f05d30Smrg#else
44067f05d30Smrg	int main (argc, argv) int argc; char *argv[]; {
44167f05d30Smrg#endif
44267f05d30Smrg	#if defined (host_mips) && defined (MIPSEB)
44367f05d30Smrg	#if defined (SYSTYPE_SYSV)
44467f05d30Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
44567f05d30Smrg	#endif
44667f05d30Smrg	#if defined (SYSTYPE_SVR4)
44767f05d30Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
44867f05d30Smrg	#endif
44967f05d30Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
45067f05d30Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
45167f05d30Smrg	#endif
45267f05d30Smrg	#endif
45367f05d30Smrg	  exit (-1);
45467f05d30Smrg	}
45567f05d30SmrgEOF
456fffe5102Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
457fffe5102Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
458fffe5102Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
459fffe5102Smrg	    { echo "$SYSTEM_NAME"; exit; }
46067f05d30Smrg	echo mips-mips-riscos${UNAME_RELEASE}
461fffe5102Smrg	exit ;;
46267f05d30Smrg    Motorola:PowerMAX_OS:*:*)
46367f05d30Smrg	echo powerpc-motorola-powermax
464fffe5102Smrg	exit ;;
46567f05d30Smrg    Motorola:*:4.3:PL8-*)
46667f05d30Smrg	echo powerpc-harris-powermax
467fffe5102Smrg	exit ;;
46867f05d30Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
46967f05d30Smrg	echo powerpc-harris-powermax
470fffe5102Smrg	exit ;;
47167f05d30Smrg    Night_Hawk:Power_UNIX:*:*)
47267f05d30Smrg	echo powerpc-harris-powerunix
473fffe5102Smrg	exit ;;
47467f05d30Smrg    m88k:CX/UX:7*:*)
47567f05d30Smrg	echo m88k-harris-cxux7
476fffe5102Smrg	exit ;;
47767f05d30Smrg    m88k:*:4*:R4*)
47867f05d30Smrg	echo m88k-motorola-sysv4
479fffe5102Smrg	exit ;;
48067f05d30Smrg    m88k:*:3*:R3*)
48167f05d30Smrg	echo m88k-motorola-sysv3
482fffe5102Smrg	exit ;;
48367f05d30Smrg    AViiON:dgux:*:*)
48467f05d30Smrg        # DG/UX returns AViiON for all architectures
48567f05d30Smrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
48667f05d30Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
48767f05d30Smrg	then
48867f05d30Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
48967f05d30Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
49067f05d30Smrg	    then
49167f05d30Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
49267f05d30Smrg	    else
49367f05d30Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
49467f05d30Smrg	    fi
49567f05d30Smrg	else
49667f05d30Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
49767f05d30Smrg	fi
498fffe5102Smrg 	exit ;;
49967f05d30Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
50067f05d30Smrg	echo m88k-dolphin-sysv3
501fffe5102Smrg	exit ;;
50267f05d30Smrg    M88*:*:R3*:*)
50367f05d30Smrg	# Delta 88k system running SVR3
50467f05d30Smrg	echo m88k-motorola-sysv3
505fffe5102Smrg	exit ;;
50667f05d30Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
50767f05d30Smrg	echo m88k-tektronix-sysv3
508fffe5102Smrg	exit ;;
50967f05d30Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
51067f05d30Smrg	echo m68k-tektronix-bsd
511fffe5102Smrg	exit ;;
51267f05d30Smrg    *:IRIX*:*:*)
51367f05d30Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
514fffe5102Smrg	exit ;;
51567f05d30Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
516fffe5102Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
517fffe5102Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
51867f05d30Smrg    i*86:AIX:*:*)
51967f05d30Smrg	echo i386-ibm-aix
520fffe5102Smrg	exit ;;
52167f05d30Smrg    ia64:AIX:*:*)
52267f05d30Smrg	if [ -x /usr/bin/oslevel ] ; then
52367f05d30Smrg		IBM_REV=`/usr/bin/oslevel`
52467f05d30Smrg	else
52567f05d30Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
52667f05d30Smrg	fi
52767f05d30Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
528fffe5102Smrg	exit ;;
52967f05d30Smrg    *:AIX:2:3)
53067f05d30Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
53167f05d30Smrg		eval $set_cc_for_build
53267f05d30Smrg		sed 's/^		//' << EOF >$dummy.c
53367f05d30Smrg		#include <sys/systemcfg.h>
53467f05d30Smrg
53567f05d30Smrg		main()
53667f05d30Smrg			{
53767f05d30Smrg			if (!__power_pc())
53867f05d30Smrg				exit(1);
53967f05d30Smrg			puts("powerpc-ibm-aix3.2.5");
54067f05d30Smrg			exit(0);
54167f05d30Smrg			}
54267f05d30SmrgEOF
543fffe5102Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
544fffe5102Smrg		then
545fffe5102Smrg			echo "$SYSTEM_NAME"
546fffe5102Smrg		else
547fffe5102Smrg			echo rs6000-ibm-aix3.2.5
548fffe5102Smrg		fi
54967f05d30Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
55067f05d30Smrg		echo rs6000-ibm-aix3.2.4
55167f05d30Smrg	else
55267f05d30Smrg		echo rs6000-ibm-aix3.2
55367f05d30Smrg	fi
554fffe5102Smrg	exit ;;
555fc51f767Smrg    *:AIX:*:[4567])
55667f05d30Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
55767f05d30Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
55867f05d30Smrg		IBM_ARCH=rs6000
55967f05d30Smrg	else
56067f05d30Smrg		IBM_ARCH=powerpc
56167f05d30Smrg	fi
56267f05d30Smrg	if [ -x /usr/bin/oslevel ] ; then
56367f05d30Smrg		IBM_REV=`/usr/bin/oslevel`
56467f05d30Smrg	else
56567f05d30Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
56667f05d30Smrg	fi
56767f05d30Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
568fffe5102Smrg	exit ;;
56967f05d30Smrg    *:AIX:*:*)
57067f05d30Smrg	echo rs6000-ibm-aix
571fffe5102Smrg	exit ;;
57267f05d30Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
57367f05d30Smrg	echo romp-ibm-bsd4.4
574fffe5102Smrg	exit ;;
57567f05d30Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
57667f05d30Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
577fffe5102Smrg	exit ;;                             # report: romp-ibm BSD 4.3
57867f05d30Smrg    *:BOSX:*:*)
57967f05d30Smrg	echo rs6000-bull-bosx
580fffe5102Smrg	exit ;;
58167f05d30Smrg    DPX/2?00:B.O.S.:*:*)
58267f05d30Smrg	echo m68k-bull-sysv3
583fffe5102Smrg	exit ;;
58467f05d30Smrg    9000/[34]??:4.3bsd:1.*:*)
58567f05d30Smrg	echo m68k-hp-bsd
586fffe5102Smrg	exit ;;
58767f05d30Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
58867f05d30Smrg	echo m68k-hp-bsd4.4
589fffe5102Smrg	exit ;;
59067f05d30Smrg    9000/[34678]??:HP-UX:*:*)
59167f05d30Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
59267f05d30Smrg	case "${UNAME_MACHINE}" in
59367f05d30Smrg	    9000/31? )            HP_ARCH=m68000 ;;
59467f05d30Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
59567f05d30Smrg	    9000/[678][0-9][0-9])
59667f05d30Smrg		if [ -x /usr/bin/getconf ]; then
59767f05d30Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
59867f05d30Smrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
59967f05d30Smrg                    case "${sc_cpu_version}" in
60067f05d30Smrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
60167f05d30Smrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
60267f05d30Smrg                      532)                      # CPU_PA_RISC2_0
60367f05d30Smrg                        case "${sc_kernel_bits}" in
60467f05d30Smrg                          32) HP_ARCH="hppa2.0n" ;;
60567f05d30Smrg                          64) HP_ARCH="hppa2.0w" ;;
60667f05d30Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
60767f05d30Smrg                        esac ;;
60867f05d30Smrg                    esac
60967f05d30Smrg		fi
61067f05d30Smrg		if [ "${HP_ARCH}" = "" ]; then
61167f05d30Smrg		    eval $set_cc_for_build
61267f05d30Smrg		    sed 's/^              //' << EOF >$dummy.c
61367f05d30Smrg
61467f05d30Smrg              #define _HPUX_SOURCE
61567f05d30Smrg              #include <stdlib.h>
61667f05d30Smrg              #include <unistd.h>
61767f05d30Smrg
61867f05d30Smrg              int main ()
61967f05d30Smrg              {
62067f05d30Smrg              #if defined(_SC_KERNEL_BITS)
62167f05d30Smrg                  long bits = sysconf(_SC_KERNEL_BITS);
62267f05d30Smrg              #endif
62367f05d30Smrg                  long cpu  = sysconf (_SC_CPU_VERSION);
62467f05d30Smrg
62567f05d30Smrg                  switch (cpu)
62667f05d30Smrg              	{
62767f05d30Smrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
62867f05d30Smrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
62967f05d30Smrg              	case CPU_PA_RISC2_0:
63067f05d30Smrg              #if defined(_SC_KERNEL_BITS)
63167f05d30Smrg              	    switch (bits)
63267f05d30Smrg              		{
63367f05d30Smrg              		case 64: puts ("hppa2.0w"); break;
63467f05d30Smrg              		case 32: puts ("hppa2.0n"); break;
63567f05d30Smrg              		default: puts ("hppa2.0"); break;
63667f05d30Smrg              		} break;
63767f05d30Smrg              #else  /* !defined(_SC_KERNEL_BITS) */
63867f05d30Smrg              	    puts ("hppa2.0"); break;
63967f05d30Smrg              #endif
64067f05d30Smrg              	default: puts ("hppa1.0"); break;
64167f05d30Smrg              	}
64267f05d30Smrg                  exit (0);
64367f05d30Smrg              }
64467f05d30SmrgEOF
64567f05d30Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
64667f05d30Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
64767f05d30Smrg		fi ;;
64867f05d30Smrg	esac
64967f05d30Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
65067f05d30Smrg	then
651fffe5102Smrg	    eval $set_cc_for_build
652fffe5102Smrg
653fffe5102Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
654fffe5102Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
655fffe5102Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
656fffe5102Smrg	    #
657fffe5102Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
658fffe5102Smrg	    # => hppa2.0w-hp-hpux11.23
659fffe5102Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
660fffe5102Smrg	    # => hppa64-hp-hpux11.23
661fffe5102Smrg
662fffe5102Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
663fffe5102Smrg		grep -q __LP64__
66467f05d30Smrg	    then
66567f05d30Smrg		HP_ARCH="hppa2.0w"
66667f05d30Smrg	    else
66767f05d30Smrg		HP_ARCH="hppa64"
66867f05d30Smrg	    fi
66967f05d30Smrg	fi
67067f05d30Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
671fffe5102Smrg	exit ;;
67267f05d30Smrg    ia64:HP-UX:*:*)
67367f05d30Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
67467f05d30Smrg	echo ia64-hp-hpux${HPUX_REV}
675fffe5102Smrg	exit ;;
67667f05d30Smrg    3050*:HI-UX:*:*)
67767f05d30Smrg	eval $set_cc_for_build
67867f05d30Smrg	sed 's/^	//' << EOF >$dummy.c
67967f05d30Smrg	#include <unistd.h>
68067f05d30Smrg	int
68167f05d30Smrg	main ()
68267f05d30Smrg	{
68367f05d30Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
68467f05d30Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
68567f05d30Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
68667f05d30Smrg	     results, however.  */
68767f05d30Smrg	  if (CPU_IS_PA_RISC (cpu))
68867f05d30Smrg	    {
68967f05d30Smrg	      switch (cpu)
69067f05d30Smrg		{
69167f05d30Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
69267f05d30Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
69367f05d30Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
69467f05d30Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
69567f05d30Smrg		}
69667f05d30Smrg	    }
69767f05d30Smrg	  else if (CPU_IS_HP_MC68K (cpu))
69867f05d30Smrg	    puts ("m68k-hitachi-hiuxwe2");
69967f05d30Smrg	  else puts ("unknown-hitachi-hiuxwe2");
70067f05d30Smrg	  exit (0);
70167f05d30Smrg	}
70267f05d30SmrgEOF
703fffe5102Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
704fffe5102Smrg		{ echo "$SYSTEM_NAME"; exit; }
70567f05d30Smrg	echo unknown-hitachi-hiuxwe2
706fffe5102Smrg	exit ;;
70767f05d30Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
70867f05d30Smrg	echo hppa1.1-hp-bsd
709fffe5102Smrg	exit ;;
71067f05d30Smrg    9000/8??:4.3bsd:*:*)
71167f05d30Smrg	echo hppa1.0-hp-bsd
712fffe5102Smrg	exit ;;
71367f05d30Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
71467f05d30Smrg	echo hppa1.0-hp-mpeix
715fffe5102Smrg	exit ;;
71667f05d30Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
71767f05d30Smrg	echo hppa1.1-hp-osf
718fffe5102Smrg	exit ;;
71967f05d30Smrg    hp8??:OSF1:*:*)
72067f05d30Smrg	echo hppa1.0-hp-osf
721fffe5102Smrg	exit ;;
72267f05d30Smrg    i*86:OSF1:*:*)
72367f05d30Smrg	if [ -x /usr/sbin/sysversion ] ; then
72467f05d30Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
72567f05d30Smrg	else
72667f05d30Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
72767f05d30Smrg	fi
728fffe5102Smrg	exit ;;
72967f05d30Smrg    parisc*:Lites*:*:*)
73067f05d30Smrg	echo hppa1.1-hp-lites
731fffe5102Smrg	exit ;;
73267f05d30Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
73367f05d30Smrg	echo c1-convex-bsd
734fffe5102Smrg        exit ;;
73567f05d30Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
73667f05d30Smrg	if getsysinfo -f scalar_acc
73767f05d30Smrg	then echo c32-convex-bsd
73867f05d30Smrg	else echo c2-convex-bsd
73967f05d30Smrg	fi
740fffe5102Smrg        exit ;;
74167f05d30Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
74267f05d30Smrg	echo c34-convex-bsd
743fffe5102Smrg        exit ;;
74467f05d30Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
74567f05d30Smrg	echo c38-convex-bsd
746fffe5102Smrg        exit ;;
74767f05d30Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
74867f05d30Smrg	echo c4-convex-bsd
749fffe5102Smrg        exit ;;
75067f05d30Smrg    CRAY*Y-MP:*:*:*)
75167f05d30Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
752fffe5102Smrg	exit ;;
75367f05d30Smrg    CRAY*[A-Z]90:*:*:*)
75467f05d30Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
75567f05d30Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
75667f05d30Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
75767f05d30Smrg	      -e 's/\.[^.]*$/.X/'
758fffe5102Smrg	exit ;;
75967f05d30Smrg    CRAY*TS:*:*:*)
76067f05d30Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
761fffe5102Smrg	exit ;;
76267f05d30Smrg    CRAY*T3E:*:*:*)
76367f05d30Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
764fffe5102Smrg	exit ;;
76567f05d30Smrg    CRAY*SV1:*:*:*)
76667f05d30Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
767fffe5102Smrg	exit ;;
76867f05d30Smrg    *:UNICOS/mp:*:*)
769fffe5102Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
770fffe5102Smrg	exit ;;
77167f05d30Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
77267f05d30Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
77367f05d30Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
77467f05d30Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
77567f05d30Smrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
776fffe5102Smrg        exit ;;
777fffe5102Smrg    5000:UNIX_System_V:4.*:*)
778fffe5102Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
779fffe5102Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
780fffe5102Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
781fffe5102Smrg	exit ;;
78267f05d30Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
78367f05d30Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
784fffe5102Smrg	exit ;;
78567f05d30Smrg    sparc*:BSD/OS:*:*)
78667f05d30Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
787fffe5102Smrg	exit ;;
78867f05d30Smrg    *:BSD/OS:*:*)
78967f05d30Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
790fffe5102Smrg	exit ;;
791fffe5102Smrg    *:FreeBSD:*:*)
792fffe5102Smrg	case ${UNAME_MACHINE} in
793fffe5102Smrg	    pc98)
794fffe5102Smrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795fffe5102Smrg	    amd64)
796fffe5102Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797fffe5102Smrg	    *)
798fffe5102Smrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799fffe5102Smrg	esac
800fffe5102Smrg	exit ;;
80167f05d30Smrg    i*:CYGWIN*:*)
80267f05d30Smrg	echo ${UNAME_MACHINE}-pc-cygwin
803fffe5102Smrg	exit ;;
804fffe5102Smrg    *:MINGW*:*)
80567f05d30Smrg	echo ${UNAME_MACHINE}-pc-mingw32
806fffe5102Smrg	exit ;;
807fffe5102Smrg    i*:windows32*:*)
808fffe5102Smrg    	# uname -m includes "-pc" on this system.
809fffe5102Smrg    	echo ${UNAME_MACHINE}-mingw32
810fffe5102Smrg	exit ;;
81167f05d30Smrg    i*:PW*:*)
81267f05d30Smrg	echo ${UNAME_MACHINE}-pc-pw32
813fffe5102Smrg	exit ;;
814fffe5102Smrg    *:Interix*:*)
815fffe5102Smrg    	case ${UNAME_MACHINE} in
816fffe5102Smrg	    x86)
817fffe5102Smrg		echo i586-pc-interix${UNAME_RELEASE}
818fffe5102Smrg		exit ;;
819fffe5102Smrg	    authenticamd | genuineintel | EM64T)
820fffe5102Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
821fffe5102Smrg		exit ;;
822fffe5102Smrg	    IA64)
823fffe5102Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
824fffe5102Smrg		exit ;;
825fffe5102Smrg	esac ;;
82667f05d30Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
82767f05d30Smrg	echo i${UNAME_MACHINE}-pc-mks
828fffe5102Smrg	exit ;;
829fffe5102Smrg    8664:Windows_NT:*)
830fffe5102Smrg	echo x86_64-pc-mks
831fffe5102Smrg	exit ;;
83267f05d30Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
83367f05d30Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
83467f05d30Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
83567f05d30Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
83667f05d30Smrg	echo i586-pc-interix
837fffe5102Smrg	exit ;;
83867f05d30Smrg    i*:UWIN*:*)
83967f05d30Smrg	echo ${UNAME_MACHINE}-pc-uwin
840fffe5102Smrg	exit ;;
841fffe5102Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
842fffe5102Smrg	echo x86_64-unknown-cygwin
843fffe5102Smrg	exit ;;
84467f05d30Smrg    p*:CYGWIN*:*)
84567f05d30Smrg	echo powerpcle-unknown-cygwin
846fffe5102Smrg	exit ;;
84767f05d30Smrg    prep*:SunOS:5.*:*)
84867f05d30Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
849fffe5102Smrg	exit ;;
85067f05d30Smrg    *:GNU:*:*)
851fffe5102Smrg	# the GNU system
85267f05d30Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
853fffe5102Smrg	exit ;;
854fffe5102Smrg    *:GNU/*:*:*)
855fffe5102Smrg	# other systems with GNU libc and userland
856fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
857fffe5102Smrg	exit ;;
85867f05d30Smrg    i*86:Minix:*:*)
85967f05d30Smrg	echo ${UNAME_MACHINE}-pc-minix
860fffe5102Smrg	exit ;;
861fffe5102Smrg    alpha:Linux:*:*)
862fffe5102Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
863fffe5102Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
864fffe5102Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
865fffe5102Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
866fffe5102Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
867fffe5102Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
868fffe5102Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
869fffe5102Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
870fffe5102Smrg        esac
871fffe5102Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
872fffe5102Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
873fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
874fffe5102Smrg	exit ;;
87567f05d30Smrg    arm*:Linux:*:*)
876fffe5102Smrg	eval $set_cc_for_build
877fffe5102Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
878fffe5102Smrg	    | grep -q __ARM_EABI__
879fffe5102Smrg	then
880fffe5102Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
881fffe5102Smrg	else
882fffe5102Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
883fffe5102Smrg	fi
884fffe5102Smrg	exit ;;
885fffe5102Smrg    avr32*:Linux:*:*)
88667f05d30Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
887fffe5102Smrg	exit ;;
88867f05d30Smrg    cris:Linux:*:*)
88967f05d30Smrg	echo cris-axis-linux-gnu
890fffe5102Smrg	exit ;;
891fffe5102Smrg    crisv32:Linux:*:*)
892fffe5102Smrg	echo crisv32-axis-linux-gnu
893fffe5102Smrg	exit ;;
894fffe5102Smrg    frv:Linux:*:*)
895fffe5102Smrg    	echo frv-unknown-linux-gnu
896fffe5102Smrg	exit ;;
897fffe5102Smrg    i*86:Linux:*:*)
898fffe5102Smrg	LIBC=gnu
89967f05d30Smrg	eval $set_cc_for_build
90067f05d30Smrg	sed 's/^	//' << EOF >$dummy.c
901fffe5102Smrg	#ifdef __dietlibc__
902fffe5102Smrg	LIBC=dietlibc
90367f05d30Smrg	#endif
90467f05d30SmrgEOF
905fffe5102Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
906fffe5102Smrg	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
907fffe5102Smrg	exit ;;
908fffe5102Smrg    ia64:Linux:*:*)
909fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
910fffe5102Smrg	exit ;;
911fffe5102Smrg    m32r*:Linux:*:*)
912fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
913fffe5102Smrg	exit ;;
914fffe5102Smrg    m68*:Linux:*:*)
915fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
916fffe5102Smrg	exit ;;
917fffe5102Smrg    mips:Linux:*:* | mips64:Linux:*:*)
91867f05d30Smrg	eval $set_cc_for_build
91967f05d30Smrg	sed 's/^	//' << EOF >$dummy.c
92067f05d30Smrg	#undef CPU
921fffe5102Smrg	#undef ${UNAME_MACHINE}
922fffe5102Smrg	#undef ${UNAME_MACHINE}el
92367f05d30Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
924fffe5102Smrg	CPU=${UNAME_MACHINE}el
92567f05d30Smrg	#else
92667f05d30Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
927fffe5102Smrg	CPU=${UNAME_MACHINE}
92867f05d30Smrg	#else
92967f05d30Smrg	CPU=
93067f05d30Smrg	#endif
93167f05d30Smrg	#endif
93267f05d30SmrgEOF
933fffe5102Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
934fffe5102Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
93567f05d30Smrg	;;
936fffe5102Smrg    or32:Linux:*:*)
937fffe5102Smrg	echo or32-unknown-linux-gnu
938fffe5102Smrg	exit ;;
939fffe5102Smrg    padre:Linux:*:*)
940fffe5102Smrg	echo sparc-unknown-linux-gnu
941fffe5102Smrg	exit ;;
942fffe5102Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
943fffe5102Smrg	echo hppa64-unknown-linux-gnu
944fffe5102Smrg	exit ;;
94567f05d30Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
94667f05d30Smrg	# Look for CPU level
94767f05d30Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
94867f05d30Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
94967f05d30Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
95067f05d30Smrg	  *)    echo hppa-unknown-linux-gnu ;;
95167f05d30Smrg	esac
952fffe5102Smrg	exit ;;
953fffe5102Smrg    ppc64:Linux:*:*)
954fffe5102Smrg	echo powerpc64-unknown-linux-gnu
955fffe5102Smrg	exit ;;
956fffe5102Smrg    ppc:Linux:*:*)
957fffe5102Smrg	echo powerpc-unknown-linux-gnu
958fffe5102Smrg	exit ;;
95967f05d30Smrg    s390:Linux:*:* | s390x:Linux:*:*)
960fffe5102Smrg	echo ${UNAME_MACHINE}-ibm-linux
961fffe5102Smrg	exit ;;
96267f05d30Smrg    sh64*:Linux:*:*)
96367f05d30Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
964fffe5102Smrg	exit ;;
96567f05d30Smrg    sh*:Linux:*:*)
96667f05d30Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
967fffe5102Smrg	exit ;;
96867f05d30Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
96967f05d30Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
970fffe5102Smrg	exit ;;
971fc51f767Smrg    tile*:Linux:*:*)
972fc51f767Smrg	echo ${UNAME_MACHINE}-tilera-linux-gnu
973fc51f767Smrg	exit ;;
974fffe5102Smrg    vax:Linux:*:*)
975fffe5102Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
976fffe5102Smrg	exit ;;
97767f05d30Smrg    x86_64:Linux:*:*)
978fffe5102Smrg	echo x86_64-unknown-linux-gnu
979fffe5102Smrg	exit ;;
980fffe5102Smrg    xtensa*:Linux:*:*)
981fffe5102Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
982fffe5102Smrg	exit ;;
98367f05d30Smrg    i*86:DYNIX/ptx:4*:*)
98467f05d30Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
98567f05d30Smrg	# earlier versions are messed up and put the nodename in both
98667f05d30Smrg	# sysname and nodename.
98767f05d30Smrg	echo i386-sequent-sysv4
988fffe5102Smrg	exit ;;
98967f05d30Smrg    i*86:UNIX_SV:4.2MP:2.*)
99067f05d30Smrg        # Unixware is an offshoot of SVR4, but it has its own version
99167f05d30Smrg        # number series starting with 2...
99267f05d30Smrg        # I am not positive that other SVR4 systems won't match this,
99367f05d30Smrg	# I just have to hope.  -- rms.
99467f05d30Smrg        # Use sysv4.2uw... so that sysv4* matches it.
99567f05d30Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
996fffe5102Smrg	exit ;;
99767f05d30Smrg    i*86:OS/2:*:*)
99867f05d30Smrg	# If we were able to find `uname', then EMX Unix compatibility
99967f05d30Smrg	# is probably installed.
100067f05d30Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
1001fffe5102Smrg	exit ;;
100267f05d30Smrg    i*86:XTS-300:*:STOP)
100367f05d30Smrg	echo ${UNAME_MACHINE}-unknown-stop
1004fffe5102Smrg	exit ;;
100567f05d30Smrg    i*86:atheos:*:*)
100667f05d30Smrg	echo ${UNAME_MACHINE}-unknown-atheos
1007fffe5102Smrg	exit ;;
1008fffe5102Smrg    i*86:syllable:*:*)
1009fffe5102Smrg	echo ${UNAME_MACHINE}-pc-syllable
1010fffe5102Smrg	exit ;;
1011fffe5102Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
101267f05d30Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
1013fffe5102Smrg	exit ;;
101467f05d30Smrg    i*86:*DOS:*:*)
101567f05d30Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1016fffe5102Smrg	exit ;;
101767f05d30Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
101867f05d30Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
101967f05d30Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
102067f05d30Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
102167f05d30Smrg	else
102267f05d30Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
102367f05d30Smrg	fi
1024fffe5102Smrg	exit ;;
1025fffe5102Smrg    i*86:*:5:[678]*)
1026fffe5102Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
102767f05d30Smrg	case `/bin/uname -X | grep "^Machine"` in
102867f05d30Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
102967f05d30Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
103067f05d30Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
103167f05d30Smrg	esac
103267f05d30Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1033fffe5102Smrg	exit ;;
103467f05d30Smrg    i*86:*:3.2:*)
103567f05d30Smrg	if test -f /usr/options/cb.name; then
103667f05d30Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
103767f05d30Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
103867f05d30Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
103967f05d30Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
104067f05d30Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
104167f05d30Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
104267f05d30Smrg			&& UNAME_MACHINE=i586
104367f05d30Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
104467f05d30Smrg			&& UNAME_MACHINE=i686
104567f05d30Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
104667f05d30Smrg			&& UNAME_MACHINE=i686
104767f05d30Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
104867f05d30Smrg	else
104967f05d30Smrg		echo ${UNAME_MACHINE}-pc-sysv32
105067f05d30Smrg	fi
1051fffe5102Smrg	exit ;;
105267f05d30Smrg    pc:*:*:*)
105367f05d30Smrg	# Left here for compatibility:
105467f05d30Smrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1055fffe5102Smrg        # the processor, so we play safe by assuming i586.
1056fffe5102Smrg	# Note: whatever this is, it MUST be the same as what config.sub
1057fffe5102Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
1058fffe5102Smrg	# this is a cross-build.
1059fffe5102Smrg	echo i586-pc-msdosdjgpp
1060fffe5102Smrg        exit ;;
106167f05d30Smrg    Intel:Mach:3*:*)
106267f05d30Smrg	echo i386-pc-mach3
1063fffe5102Smrg	exit ;;
106467f05d30Smrg    paragon:*:*:*)
106567f05d30Smrg	echo i860-intel-osf1
1066fffe5102Smrg	exit ;;
106767f05d30Smrg    i860:*:4.*:*) # i860-SVR4
106867f05d30Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
106967f05d30Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
107067f05d30Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
107167f05d30Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
107267f05d30Smrg	fi
1073fffe5102Smrg	exit ;;
107467f05d30Smrg    mini*:CTIX:SYS*5:*)
107567f05d30Smrg	# "miniframe"
107667f05d30Smrg	echo m68010-convergent-sysv
1077fffe5102Smrg	exit ;;
107867f05d30Smrg    mc68k:UNIX:SYSTEM5:3.51m)
107967f05d30Smrg	echo m68k-convergent-sysv
1080fffe5102Smrg	exit ;;
108167f05d30Smrg    M680?0:D-NIX:5.3:*)
108267f05d30Smrg	echo m68k-diab-dnix
1083fffe5102Smrg	exit ;;
1084fffe5102Smrg    M68*:*:R3V[5678]*:*)
1085fffe5102Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1086fffe5102Smrg    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)
108767f05d30Smrg	OS_REL=''
108867f05d30Smrg	test -r /etc/.relid \
108967f05d30Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
109067f05d30Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1091fffe5102Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
109267f05d30Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1093fffe5102Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
109467f05d30Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
109567f05d30Smrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1096fffe5102Smrg          && { echo i486-ncr-sysv4; exit; } ;;
1097fffe5102Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1098fffe5102Smrg	OS_REL='.3'
1099fffe5102Smrg	test -r /etc/.relid \
1100fffe5102Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1101fffe5102Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1102fffe5102Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1103fffe5102Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1104fffe5102Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1105fffe5102Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1106fffe5102Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
110767f05d30Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
110867f05d30Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
1109fffe5102Smrg	exit ;;
111067f05d30Smrg    mc68030:UNIX_System_V:4.*:*)
111167f05d30Smrg	echo m68k-atari-sysv4
1112fffe5102Smrg	exit ;;
111367f05d30Smrg    TSUNAMI:LynxOS:2.*:*)
111467f05d30Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
1115fffe5102Smrg	exit ;;
111667f05d30Smrg    rs6000:LynxOS:2.*:*)
111767f05d30Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1118fffe5102Smrg	exit ;;
1119fffe5102Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
112067f05d30Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1121fffe5102Smrg	exit ;;
112267f05d30Smrg    SM[BE]S:UNIX_SV:*:*)
112367f05d30Smrg	echo mips-dde-sysv${UNAME_RELEASE}
1124fffe5102Smrg	exit ;;
112567f05d30Smrg    RM*:ReliantUNIX-*:*:*)
112667f05d30Smrg	echo mips-sni-sysv4
1127fffe5102Smrg	exit ;;
112867f05d30Smrg    RM*:SINIX-*:*:*)
112967f05d30Smrg	echo mips-sni-sysv4
1130fffe5102Smrg	exit ;;
113167f05d30Smrg    *:SINIX-*:*:*)
113267f05d30Smrg	if uname -p 2>/dev/null >/dev/null ; then
113367f05d30Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
113467f05d30Smrg		echo ${UNAME_MACHINE}-sni-sysv4
113567f05d30Smrg	else
113667f05d30Smrg		echo ns32k-sni-sysv
113767f05d30Smrg	fi
1138fffe5102Smrg	exit ;;
113967f05d30Smrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
114067f05d30Smrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
114167f05d30Smrg        echo i586-unisys-sysv4
1142fffe5102Smrg        exit ;;
114367f05d30Smrg    *:UNIX_System_V:4*:FTX*)
114467f05d30Smrg	# From Gerald Hewes <hewes@openmarket.com>.
114567f05d30Smrg	# How about differentiating between stratus architectures? -djm
114667f05d30Smrg	echo hppa1.1-stratus-sysv4
1147fffe5102Smrg	exit ;;
114867f05d30Smrg    *:*:*:FTX*)
114967f05d30Smrg	# From seanf@swdc.stratus.com.
115067f05d30Smrg	echo i860-stratus-sysv4
1151fffe5102Smrg	exit ;;
1152fffe5102Smrg    i*86:VOS:*:*)
1153fffe5102Smrg	# From Paul.Green@stratus.com.
1154fffe5102Smrg	echo ${UNAME_MACHINE}-stratus-vos
1155fffe5102Smrg	exit ;;
115667f05d30Smrg    *:VOS:*:*)
115767f05d30Smrg	# From Paul.Green@stratus.com.
115867f05d30Smrg	echo hppa1.1-stratus-vos
1159fffe5102Smrg	exit ;;
116067f05d30Smrg    mc68*:A/UX:*:*)
116167f05d30Smrg	echo m68k-apple-aux${UNAME_RELEASE}
1162fffe5102Smrg	exit ;;
116367f05d30Smrg    news*:NEWS-OS:6*:*)
116467f05d30Smrg	echo mips-sony-newsos6
1165fffe5102Smrg	exit ;;
116667f05d30Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
116767f05d30Smrg	if [ -d /usr/nec ]; then
116867f05d30Smrg	        echo mips-nec-sysv${UNAME_RELEASE}
116967f05d30Smrg	else
117067f05d30Smrg	        echo mips-unknown-sysv${UNAME_RELEASE}
117167f05d30Smrg	fi
1172fffe5102Smrg        exit ;;
117367f05d30Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
117467f05d30Smrg	echo powerpc-be-beos
1175fffe5102Smrg	exit ;;
117667f05d30Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
117767f05d30Smrg	echo powerpc-apple-beos
1178fffe5102Smrg	exit ;;
117967f05d30Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
118067f05d30Smrg	echo i586-pc-beos
1181fffe5102Smrg	exit ;;
1182fffe5102Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1183fffe5102Smrg	echo i586-pc-haiku
1184fffe5102Smrg	exit ;;
118567f05d30Smrg    SX-4:SUPER-UX:*:*)
118667f05d30Smrg	echo sx4-nec-superux${UNAME_RELEASE}
1187fffe5102Smrg	exit ;;
118867f05d30Smrg    SX-5:SUPER-UX:*:*)
118967f05d30Smrg	echo sx5-nec-superux${UNAME_RELEASE}
1190fffe5102Smrg	exit ;;
119167f05d30Smrg    SX-6:SUPER-UX:*:*)
119267f05d30Smrg	echo sx6-nec-superux${UNAME_RELEASE}
1193fffe5102Smrg	exit ;;
1194fffe5102Smrg    SX-7:SUPER-UX:*:*)
1195fffe5102Smrg	echo sx7-nec-superux${UNAME_RELEASE}
1196fffe5102Smrg	exit ;;
1197fffe5102Smrg    SX-8:SUPER-UX:*:*)
1198fffe5102Smrg	echo sx8-nec-superux${UNAME_RELEASE}
1199fffe5102Smrg	exit ;;
1200fffe5102Smrg    SX-8R:SUPER-UX:*:*)
1201fffe5102Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
1202fffe5102Smrg	exit ;;
120367f05d30Smrg    Power*:Rhapsody:*:*)
120467f05d30Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1205fffe5102Smrg	exit ;;
120667f05d30Smrg    *:Rhapsody:*:*)
120767f05d30Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1208fffe5102Smrg	exit ;;
120967f05d30Smrg    *:Darwin:*:*)
1210fffe5102Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1211fffe5102Smrg	case $UNAME_PROCESSOR in
1212fffe5102Smrg	    i386)
1213fffe5102Smrg		eval $set_cc_for_build
1214fffe5102Smrg		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1215fffe5102Smrg		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1216fffe5102Smrg		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1217fffe5102Smrg		      grep IS_64BIT_ARCH >/dev/null
1218fffe5102Smrg		  then
1219fffe5102Smrg		      UNAME_PROCESSOR="x86_64"
1220fffe5102Smrg		  fi
1221fffe5102Smrg		fi ;;
1222fffe5102Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
122367f05d30Smrg	esac
122467f05d30Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1225fffe5102Smrg	exit ;;
122667f05d30Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
122767f05d30Smrg	UNAME_PROCESSOR=`uname -p`
122867f05d30Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
122967f05d30Smrg		UNAME_PROCESSOR=i386
123067f05d30Smrg		UNAME_MACHINE=pc
123167f05d30Smrg	fi
123267f05d30Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1233fffe5102Smrg	exit ;;
123467f05d30Smrg    *:QNX:*:4*)
123567f05d30Smrg	echo i386-pc-qnx
1236fffe5102Smrg	exit ;;
1237fffe5102Smrg    NSE-?:NONSTOP_KERNEL:*:*)
1238fffe5102Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
1239fffe5102Smrg	exit ;;
1240fffe5102Smrg    NSR-?:NONSTOP_KERNEL:*:*)
124167f05d30Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
1242fffe5102Smrg	exit ;;
124367f05d30Smrg    *:NonStop-UX:*:*)
124467f05d30Smrg	echo mips-compaq-nonstopux
1245fffe5102Smrg	exit ;;
124667f05d30Smrg    BS2000:POSIX*:*:*)
124767f05d30Smrg	echo bs2000-siemens-sysv
1248fffe5102Smrg	exit ;;
124967f05d30Smrg    DS/*:UNIX_System_V:*:*)
125067f05d30Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1251fffe5102Smrg	exit ;;
125267f05d30Smrg    *:Plan9:*:*)
125367f05d30Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
125467f05d30Smrg	# is converted to i386 for consistency with other x86
125567f05d30Smrg	# operating systems.
125667f05d30Smrg	if test "$cputype" = "386"; then
125767f05d30Smrg	    UNAME_MACHINE=i386
125867f05d30Smrg	else
125967f05d30Smrg	    UNAME_MACHINE="$cputype"
126067f05d30Smrg	fi
126167f05d30Smrg	echo ${UNAME_MACHINE}-unknown-plan9
1262fffe5102Smrg	exit ;;
126367f05d30Smrg    *:TOPS-10:*:*)
126467f05d30Smrg	echo pdp10-unknown-tops10
1265fffe5102Smrg	exit ;;
126667f05d30Smrg    *:TENEX:*:*)
126767f05d30Smrg	echo pdp10-unknown-tenex
1268fffe5102Smrg	exit ;;
126967f05d30Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
127067f05d30Smrg	echo pdp10-dec-tops20
1271fffe5102Smrg	exit ;;
127267f05d30Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
127367f05d30Smrg	echo pdp10-xkl-tops20
1274fffe5102Smrg	exit ;;
127567f05d30Smrg    *:TOPS-20:*:*)
127667f05d30Smrg	echo pdp10-unknown-tops20
1277fffe5102Smrg	exit ;;
127867f05d30Smrg    *:ITS:*:*)
127967f05d30Smrg	echo pdp10-unknown-its
1280fffe5102Smrg	exit ;;
128167f05d30Smrg    SEI:*:*:SEIUX)
128267f05d30Smrg        echo mips-sei-seiux${UNAME_RELEASE}
1283fffe5102Smrg	exit ;;
1284fffe5102Smrg    *:DragonFly:*:*)
1285fffe5102Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1286fffe5102Smrg	exit ;;
1287fffe5102Smrg    *:*VMS:*:*)
1288fffe5102Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1289fffe5102Smrg	case "${UNAME_MACHINE}" in
1290fffe5102Smrg	    A*) echo alpha-dec-vms ; exit ;;
1291fffe5102Smrg	    I*) echo ia64-dec-vms ; exit ;;
1292fffe5102Smrg	    V*) echo vax-dec-vms ; exit ;;
1293fffe5102Smrg	esac ;;
1294fffe5102Smrg    *:XENIX:*:SysV)
1295fffe5102Smrg	echo i386-pc-xenix
1296fffe5102Smrg	exit ;;
1297fffe5102Smrg    i*86:skyos:*:*)
1298fffe5102Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1299fffe5102Smrg	exit ;;
1300fffe5102Smrg    i*86:rdos:*:*)
1301fffe5102Smrg	echo ${UNAME_MACHINE}-pc-rdos
1302fffe5102Smrg	exit ;;
1303fffe5102Smrg    i*86:AROS:*:*)
1304fffe5102Smrg	echo ${UNAME_MACHINE}-pc-aros
1305fffe5102Smrg	exit ;;
130667f05d30Smrgesac
130767f05d30Smrg
130867f05d30Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
130967f05d30Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
131067f05d30Smrg
131167f05d30Smrgeval $set_cc_for_build
131267f05d30Smrgcat >$dummy.c <<EOF
131367f05d30Smrg#ifdef _SEQUENT_
131467f05d30Smrg# include <sys/types.h>
131567f05d30Smrg# include <sys/utsname.h>
131667f05d30Smrg#endif
131767f05d30Smrgmain ()
131867f05d30Smrg{
131967f05d30Smrg#if defined (sony)
132067f05d30Smrg#if defined (MIPSEB)
132167f05d30Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
132267f05d30Smrg     I don't know....  */
132367f05d30Smrg  printf ("mips-sony-bsd\n"); exit (0);
132467f05d30Smrg#else
132567f05d30Smrg#include <sys/param.h>
132667f05d30Smrg  printf ("m68k-sony-newsos%s\n",
132767f05d30Smrg#ifdef NEWSOS4
132867f05d30Smrg          "4"
132967f05d30Smrg#else
133067f05d30Smrg	  ""
133167f05d30Smrg#endif
133267f05d30Smrg         ); exit (0);
133367f05d30Smrg#endif
133467f05d30Smrg#endif
133567f05d30Smrg
133667f05d30Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
1337fffe5102Smrg  printf ("arm-acorn-riscix\n"); exit (0);
133867f05d30Smrg#endif
133967f05d30Smrg
134067f05d30Smrg#if defined (hp300) && !defined (hpux)
134167f05d30Smrg  printf ("m68k-hp-bsd\n"); exit (0);
134267f05d30Smrg#endif
134367f05d30Smrg
134467f05d30Smrg#if defined (NeXT)
134567f05d30Smrg#if !defined (__ARCHITECTURE__)
134667f05d30Smrg#define __ARCHITECTURE__ "m68k"
134767f05d30Smrg#endif
134867f05d30Smrg  int version;
134967f05d30Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
135067f05d30Smrg  if (version < 4)
135167f05d30Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
135267f05d30Smrg  else
135367f05d30Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
135467f05d30Smrg  exit (0);
135567f05d30Smrg#endif
135667f05d30Smrg
135767f05d30Smrg#if defined (MULTIMAX) || defined (n16)
135867f05d30Smrg#if defined (UMAXV)
135967f05d30Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
136067f05d30Smrg#else
136167f05d30Smrg#if defined (CMU)
136267f05d30Smrg  printf ("ns32k-encore-mach\n"); exit (0);
136367f05d30Smrg#else
136467f05d30Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
136567f05d30Smrg#endif
136667f05d30Smrg#endif
136767f05d30Smrg#endif
136867f05d30Smrg
136967f05d30Smrg#if defined (__386BSD__)
137067f05d30Smrg  printf ("i386-pc-bsd\n"); exit (0);
137167f05d30Smrg#endif
137267f05d30Smrg
137367f05d30Smrg#if defined (sequent)
137467f05d30Smrg#if defined (i386)
137567f05d30Smrg  printf ("i386-sequent-dynix\n"); exit (0);
137667f05d30Smrg#endif
137767f05d30Smrg#if defined (ns32000)
137867f05d30Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
137967f05d30Smrg#endif
138067f05d30Smrg#endif
138167f05d30Smrg
138267f05d30Smrg#if defined (_SEQUENT_)
138367f05d30Smrg    struct utsname un;
138467f05d30Smrg
138567f05d30Smrg    uname(&un);
138667f05d30Smrg
138767f05d30Smrg    if (strncmp(un.version, "V2", 2) == 0) {
138867f05d30Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
138967f05d30Smrg    }
139067f05d30Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
139167f05d30Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
139267f05d30Smrg    }
139367f05d30Smrg    printf ("i386-sequent-ptx\n"); exit (0);
139467f05d30Smrg
139567f05d30Smrg#endif
139667f05d30Smrg
139767f05d30Smrg#if defined (vax)
139867f05d30Smrg# if !defined (ultrix)
139967f05d30Smrg#  include <sys/param.h>
140067f05d30Smrg#  if defined (BSD)
140167f05d30Smrg#   if BSD == 43
140267f05d30Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
140367f05d30Smrg#   else
140467f05d30Smrg#    if BSD == 199006
140567f05d30Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
140667f05d30Smrg#    else
140767f05d30Smrg      printf ("vax-dec-bsd\n"); exit (0);
140867f05d30Smrg#    endif
140967f05d30Smrg#   endif
141067f05d30Smrg#  else
141167f05d30Smrg    printf ("vax-dec-bsd\n"); exit (0);
141267f05d30Smrg#  endif
141367f05d30Smrg# else
141467f05d30Smrg    printf ("vax-dec-ultrix\n"); exit (0);
141567f05d30Smrg# endif
141667f05d30Smrg#endif
141767f05d30Smrg
141867f05d30Smrg#if defined (alliant) && defined (i860)
141967f05d30Smrg  printf ("i860-alliant-bsd\n"); exit (0);
142067f05d30Smrg#endif
142167f05d30Smrg
142267f05d30Smrg  exit (1);
142367f05d30Smrg}
142467f05d30SmrgEOF
142567f05d30Smrg
1426fffe5102Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1427fffe5102Smrg	{ echo "$SYSTEM_NAME"; exit; }
142867f05d30Smrg
142967f05d30Smrg# Apollos put the system type in the environment.
143067f05d30Smrg
1431fffe5102Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
143267f05d30Smrg
143367f05d30Smrg# Convex versions that predate uname can use getsysinfo(1)
143467f05d30Smrg
143567f05d30Smrgif [ -x /usr/convex/getsysinfo ]
143667f05d30Smrgthen
143767f05d30Smrg    case `getsysinfo -f cpu_type` in
143867f05d30Smrg    c1*)
143967f05d30Smrg	echo c1-convex-bsd
1440fffe5102Smrg	exit ;;
144167f05d30Smrg    c2*)
144267f05d30Smrg	if getsysinfo -f scalar_acc
144367f05d30Smrg	then echo c32-convex-bsd
144467f05d30Smrg	else echo c2-convex-bsd
144567f05d30Smrg	fi
1446fffe5102Smrg	exit ;;
144767f05d30Smrg    c34*)
144867f05d30Smrg	echo c34-convex-bsd
1449fffe5102Smrg	exit ;;
145067f05d30Smrg    c38*)
145167f05d30Smrg	echo c38-convex-bsd
1452fffe5102Smrg	exit ;;
145367f05d30Smrg    c4*)
145467f05d30Smrg	echo c4-convex-bsd
1455fffe5102Smrg	exit ;;
145667f05d30Smrg    esac
145767f05d30Smrgfi
145867f05d30Smrg
145967f05d30Smrgcat >&2 <<EOF
146067f05d30Smrg$0: unable to guess system type
146167f05d30Smrg
146267f05d30SmrgThis script, last modified $timestamp, has failed to recognize
146367f05d30Smrgthe operating system you are using. It is advised that you
146467f05d30Smrgdownload the most up to date version of the config scripts from
146567f05d30Smrg
1466fffe5102Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1467fffe5102Smrgand
1468fffe5102Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
146967f05d30Smrg
147067f05d30SmrgIf the version you run ($0) is already up to date, please
147167f05d30Smrgsend the following data and any information you think might be
147267f05d30Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
147367f05d30Smrginformation to handle your system.
147467f05d30Smrg
147567f05d30Smrgconfig.guess timestamp = $timestamp
147667f05d30Smrg
147767f05d30Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
147867f05d30Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
147967f05d30Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
148067f05d30Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
148167f05d30Smrg
148267f05d30Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
148367f05d30Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
148467f05d30Smrg
148567f05d30Smrghostinfo               = `(hostinfo) 2>/dev/null`
148667f05d30Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
148767f05d30Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
148867f05d30Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
148967f05d30Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
149067f05d30Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
149167f05d30Smrg
149267f05d30SmrgUNAME_MACHINE = ${UNAME_MACHINE}
149367f05d30SmrgUNAME_RELEASE = ${UNAME_RELEASE}
149467f05d30SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
149567f05d30SmrgUNAME_VERSION = ${UNAME_VERSION}
149667f05d30SmrgEOF
149767f05d30Smrg
149867f05d30Smrgexit 1
149967f05d30Smrg
150067f05d30Smrg# Local variables:
150167f05d30Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
150267f05d30Smrg# time-stamp-start: "timestamp='"
150367f05d30Smrg# time-stamp-format: "%:y-%02m-%02d"
150467f05d30Smrg# time-stamp-end: "'"
150567f05d30Smrg# End:
1506