191a17321Smrg#! /bin/sh
291a17321Smrg# Attempt to guess a canonical system name.
391a17321Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
491a17321Smrg#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
591a17321Smrg
691a17321Smrgtimestamp='2005-08-03'
791a17321Smrg
891a17321Smrg# This file is free software; you can redistribute it and/or modify it
991a17321Smrg# under the terms of the GNU General Public License as published by
1091a17321Smrg# the Free Software Foundation; either version 2 of the License, or
1191a17321Smrg# (at your option) any later version.
1291a17321Smrg#
1391a17321Smrg# This program is distributed in the hope that it will be useful, but
1491a17321Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1591a17321Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1691a17321Smrg# General Public License for more details.
1791a17321Smrg#
1891a17321Smrg# You should have received a copy of the GNU General Public License
1991a17321Smrg# along with this program; if not, write to the Free Software
2091a17321Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2191a17321Smrg# 02110-1301, USA.
2291a17321Smrg#
2391a17321Smrg# As a special exception to the GNU General Public License, if you
2491a17321Smrg# distribute this file as part of a program that contains a
2591a17321Smrg# configuration script generated by Autoconf, you may include it under
2691a17321Smrg# the same distribution terms that you use for the rest of that program.
2791a17321Smrg
2891a17321Smrg
2991a17321Smrg# Originally written by Per Bothner <per@bothner.com>.
3091a17321Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
3191a17321Smrg# diff and a properly formatted ChangeLog entry.
3291a17321Smrg#
3391a17321Smrg# This script attempts to guess a canonical system name similar to
3491a17321Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
3591a17321Smrg# exits with 0.  Otherwise, it exits with 1.
3691a17321Smrg#
3791a17321Smrg# The plan is that this can be called by configure scripts if you
3891a17321Smrg# don't specify an explicit build system type.
3991a17321Smrg
4091a17321Smrgme=`echo "$0" | sed -e 's,.*/,,'`
4191a17321Smrg
4291a17321Smrgusage="\
4391a17321SmrgUsage: $0 [OPTION]
4491a17321Smrg
4591a17321SmrgOutput the configuration name of the system \`$me' is run on.
4691a17321Smrg
4791a17321SmrgOperation modes:
4891a17321Smrg  -h, --help         print this help, then exit
4991a17321Smrg  -t, --time-stamp   print date of last modification, then exit
5091a17321Smrg  -v, --version      print version number, then exit
5191a17321Smrg
5291a17321SmrgReport bugs and patches to <config-patches@gnu.org>."
5391a17321Smrg
5491a17321Smrgversion="\
5591a17321SmrgGNU config.guess ($timestamp)
5691a17321Smrg
5791a17321SmrgOriginally written by Per Bothner.
5891a17321SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
5991a17321SmrgFree Software Foundation, Inc.
6091a17321Smrg
6191a17321SmrgThis is free software; see the source for copying conditions.  There is NO
6291a17321Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6391a17321Smrg
6491a17321Smrghelp="
6591a17321SmrgTry \`$me --help' for more information."
6691a17321Smrg
6791a17321Smrg# Parse command line
6891a17321Smrgwhile test $# -gt 0 ; do
6991a17321Smrg  case $1 in
7091a17321Smrg    --time-stamp | --time* | -t )
7191a17321Smrg       echo "$timestamp" ; exit ;;
7291a17321Smrg    --version | -v )
7391a17321Smrg       echo "$version" ; exit ;;
7491a17321Smrg    --help | --h* | -h )
7591a17321Smrg       echo "$usage"; exit ;;
7691a17321Smrg    -- )     # Stop option processing
7791a17321Smrg       shift; break ;;
7891a17321Smrg    - )	# Use stdin as input.
7991a17321Smrg       break ;;
8091a17321Smrg    -* )
8191a17321Smrg       echo "$me: invalid option $1$help" >&2
8291a17321Smrg       exit 1 ;;
8391a17321Smrg    * )
8491a17321Smrg       break ;;
8591a17321Smrg  esac
8691a17321Smrgdone
8791a17321Smrg
8891a17321Smrgif test $# != 0; then
8991a17321Smrg  echo "$me: too many arguments$help" >&2
9091a17321Smrg  exit 1
9191a17321Smrgfi
9291a17321Smrg
9391a17321Smrgtrap 'exit 1' 1 2 15
9491a17321Smrg
9591a17321Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9691a17321Smrg# compiler to aid in system detection is discouraged as it requires
9791a17321Smrg# temporary files to be created and, as you can see below, it is a
9891a17321Smrg# headache to deal with in a portable fashion.
9991a17321Smrg
10091a17321Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
10191a17321Smrg# use `HOST_CC' if defined, but it is deprecated.
10291a17321Smrg
10391a17321Smrg# Portable tmp directory creation inspired by the Autoconf team.
10491a17321Smrg
10591a17321Smrgset_cc_for_build='
10691a17321Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
10791a17321Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
10891a17321Smrg: ${TMPDIR=/tmp} ;
10991a17321Smrg { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
11091a17321Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
11191a17321Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
11291a17321Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
11391a17321Smrgdummy=$tmp/dummy ;
11491a17321Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
11591a17321Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
11691a17321Smrg ,,)    echo "int x;" > $dummy.c ;
11791a17321Smrg	for c in cc gcc c89 c99 ; do
11891a17321Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
11991a17321Smrg	     CC_FOR_BUILD="$c"; break ;
12091a17321Smrg	  fi ;
12191a17321Smrg	done ;
12291a17321Smrg	if test x"$CC_FOR_BUILD" = x ; then
12391a17321Smrg	  CC_FOR_BUILD=no_compiler_found ;
12491a17321Smrg	fi
12591a17321Smrg	;;
12691a17321Smrg ,,*)   CC_FOR_BUILD=$CC ;;
12791a17321Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
12891a17321Smrgesac ; set_cc_for_build= ;'
12991a17321Smrg
13091a17321Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
13191a17321Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
13291a17321Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
13391a17321Smrg	PATH=$PATH:/.attbin ; export PATH
13491a17321Smrgfi
13591a17321Smrg
13691a17321SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13791a17321SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
13891a17321SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
13991a17321SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
14091a17321Smrg
14191a17321Smrg# Note: order is significant - the case branches are not exclusive.
14291a17321Smrg
14391a17321Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
14491a17321Smrg    *:NetBSD:*:*)
14591a17321Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
14691a17321Smrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
14791a17321Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
14891a17321Smrg	# switched to ELF, *-*-netbsd* would select the old
14991a17321Smrg	# object file format.  This provides both forward
15091a17321Smrg	# compatibility and a consistent mechanism for selecting the
15191a17321Smrg	# object file format.
15291a17321Smrg	#
15391a17321Smrg	# Note: NetBSD doesn't particularly care about the vendor
15491a17321Smrg	# portion of the name.  We always set it to "unknown".
15591a17321Smrg	sysctl="sysctl -n hw.machine_arch"
15691a17321Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
15791a17321Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
15891a17321Smrg	case "${UNAME_MACHINE_ARCH}" in
15991a17321Smrg	    armeb) machine=armeb-unknown ;;
16091a17321Smrg	    arm*) machine=arm-unknown ;;
16191a17321Smrg	    sh3el) machine=shl-unknown ;;
16291a17321Smrg	    sh3eb) machine=sh-unknown ;;
16391a17321Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
16491a17321Smrg	esac
16591a17321Smrg	# The Operating System including object format, if it has switched
16691a17321Smrg	# to ELF recently, or will in the future.
16791a17321Smrg	case "${UNAME_MACHINE_ARCH}" in
16891a17321Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
16991a17321Smrg		eval $set_cc_for_build
17091a17321Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
17191a17321Smrg			| grep __ELF__ >/dev/null
17291a17321Smrg		then
17391a17321Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
17491a17321Smrg		    # Return netbsd for either.  FIX?
17591a17321Smrg		    os=netbsd
17691a17321Smrg		else
17791a17321Smrg		    os=netbsdelf
17891a17321Smrg		fi
17991a17321Smrg		;;
18091a17321Smrg	    *)
18191a17321Smrg	        os=netbsd
18291a17321Smrg		;;
18391a17321Smrg	esac
18491a17321Smrg	# The OS release
18591a17321Smrg	# Debian GNU/NetBSD machines have a different userland, and
18691a17321Smrg	# thus, need a distinct triplet. However, they do not need
18791a17321Smrg	# kernel version information, so it can be replaced with a
18891a17321Smrg	# suitable tag, in the style of linux-gnu.
18991a17321Smrg	case "${UNAME_VERSION}" in
19091a17321Smrg	    Debian*)
19191a17321Smrg		release='-gnu'
19291a17321Smrg		;;
19391a17321Smrg	    *)
19491a17321Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19591a17321Smrg		;;
19691a17321Smrg	esac
19791a17321Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
19891a17321Smrg	# contains redundant information, the shorter form:
19991a17321Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
20091a17321Smrg	echo "${machine}-${os}${release}"
20191a17321Smrg	exit ;;
20291a17321Smrg    *:OpenBSD:*:*)
20391a17321Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
20491a17321Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
20591a17321Smrg	exit ;;
20691a17321Smrg    *:ekkoBSD:*:*)
20791a17321Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
20891a17321Smrg	exit ;;
20991a17321Smrg    macppc:MirBSD:*:*)
21091a17321Smrg	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
21191a17321Smrg	exit ;;
21291a17321Smrg    *:MirBSD:*:*)
21391a17321Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
21491a17321Smrg	exit ;;
21591a17321Smrg    alpha:OSF1:*:*)
21691a17321Smrg	case $UNAME_RELEASE in
21791a17321Smrg	*4.0)
21891a17321Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
21991a17321Smrg		;;
22091a17321Smrg	*5.*)
22191a17321Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
22291a17321Smrg		;;
22391a17321Smrg	esac
22491a17321Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
22591a17321Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
22691a17321Smrg	# covers most systems running today.  This code pipes the CPU
22791a17321Smrg	# types through head -n 1, so we only detect the type of CPU 0.
22891a17321Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
22991a17321Smrg	case "$ALPHA_CPU_TYPE" in
23091a17321Smrg	    "EV4 (21064)")
23191a17321Smrg		UNAME_MACHINE="alpha" ;;
23291a17321Smrg	    "EV4.5 (21064)")
23391a17321Smrg		UNAME_MACHINE="alpha" ;;
23491a17321Smrg	    "LCA4 (21066/21068)")
23591a17321Smrg		UNAME_MACHINE="alpha" ;;
23691a17321Smrg	    "EV5 (21164)")
23791a17321Smrg		UNAME_MACHINE="alphaev5" ;;
23891a17321Smrg	    "EV5.6 (21164A)")
23991a17321Smrg		UNAME_MACHINE="alphaev56" ;;
24091a17321Smrg	    "EV5.6 (21164PC)")
24191a17321Smrg		UNAME_MACHINE="alphapca56" ;;
24291a17321Smrg	    "EV5.7 (21164PC)")
24391a17321Smrg		UNAME_MACHINE="alphapca57" ;;
24491a17321Smrg	    "EV6 (21264)")
24591a17321Smrg		UNAME_MACHINE="alphaev6" ;;
24691a17321Smrg	    "EV6.7 (21264A)")
24791a17321Smrg		UNAME_MACHINE="alphaev67" ;;
24891a17321Smrg	    "EV6.8CB (21264C)")
24991a17321Smrg		UNAME_MACHINE="alphaev68" ;;
25091a17321Smrg	    "EV6.8AL (21264B)")
25191a17321Smrg		UNAME_MACHINE="alphaev68" ;;
25291a17321Smrg	    "EV6.8CX (21264D)")
25391a17321Smrg		UNAME_MACHINE="alphaev68" ;;
25491a17321Smrg	    "EV6.9A (21264/EV69A)")
25591a17321Smrg		UNAME_MACHINE="alphaev69" ;;
25691a17321Smrg	    "EV7 (21364)")
25791a17321Smrg		UNAME_MACHINE="alphaev7" ;;
25891a17321Smrg	    "EV7.9 (21364A)")
25991a17321Smrg		UNAME_MACHINE="alphaev79" ;;
26091a17321Smrg	esac
26191a17321Smrg	# A Pn.n version is a patched version.
26291a17321Smrg	# A Vn.n version is a released version.
26391a17321Smrg	# A Tn.n version is a released field test version.
26491a17321Smrg	# A Xn.n version is an unreleased experimental baselevel.
26591a17321Smrg	# 1.2 uses "1.2" for uname -r.
26691a17321Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
26791a17321Smrg	exit ;;
26891a17321Smrg    Alpha\ *:Windows_NT*:*)
26991a17321Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
27091a17321Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
27191a17321Smrg	# of the specific Alpha model?
27291a17321Smrg	echo alpha-pc-interix
27391a17321Smrg	exit ;;
27491a17321Smrg    21064:Windows_NT:50:3)
27591a17321Smrg	echo alpha-dec-winnt3.5
27691a17321Smrg	exit ;;
27791a17321Smrg    Amiga*:UNIX_System_V:4.0:*)
27891a17321Smrg	echo m68k-unknown-sysv4
27991a17321Smrg	exit ;;
28091a17321Smrg    *:[Aa]miga[Oo][Ss]:*:*)
28191a17321Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
28291a17321Smrg	exit ;;
28391a17321Smrg    *:[Mm]orph[Oo][Ss]:*:*)
28491a17321Smrg	echo ${UNAME_MACHINE}-unknown-morphos
28591a17321Smrg	exit ;;
28691a17321Smrg    *:OS/390:*:*)
28791a17321Smrg	echo i370-ibm-openedition
28891a17321Smrg	exit ;;
28991a17321Smrg    *:z/VM:*:*)
29091a17321Smrg	echo s390-ibm-zvmoe
29191a17321Smrg	exit ;;
29291a17321Smrg    *:OS400:*:*)
29391a17321Smrg        echo powerpc-ibm-os400
29491a17321Smrg	exit ;;
29591a17321Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
29691a17321Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
29791a17321Smrg	exit ;;
29891a17321Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
29991a17321Smrg	echo arm-unknown-riscos
30091a17321Smrg	exit ;;
30191a17321Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
30291a17321Smrg	echo hppa1.1-hitachi-hiuxmpp
30391a17321Smrg	exit ;;
30491a17321Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
30591a17321Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
30691a17321Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
30791a17321Smrg		echo pyramid-pyramid-sysv3
30891a17321Smrg	else
30991a17321Smrg		echo pyramid-pyramid-bsd
31091a17321Smrg	fi
31191a17321Smrg	exit ;;
31291a17321Smrg    NILE*:*:*:dcosx)
31391a17321Smrg	echo pyramid-pyramid-svr4
31491a17321Smrg	exit ;;
31591a17321Smrg    DRS?6000:unix:4.0:6*)
31691a17321Smrg	echo sparc-icl-nx6
31791a17321Smrg	exit ;;
31891a17321Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
31991a17321Smrg	case `/usr/bin/uname -p` in
32091a17321Smrg	    sparc) echo sparc-icl-nx7; exit ;;
32191a17321Smrg	esac ;;
32291a17321Smrg    sun4H:SunOS:5.*:*)
32391a17321Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
32491a17321Smrg	exit ;;
32591a17321Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
32691a17321Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
32791a17321Smrg	exit ;;
32891a17321Smrg    i86pc:SunOS:5.*:*)
32991a17321Smrg	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
33091a17321Smrg	exit ;;
33191a17321Smrg    sun4*:SunOS:6*:*)
33291a17321Smrg	# According to config.sub, this is the proper way to canonicalize
33391a17321Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
33491a17321Smrg	# it's likely to be more like Solaris than SunOS4.
33591a17321Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
33691a17321Smrg	exit ;;
33791a17321Smrg    sun4*:SunOS:*:*)
33891a17321Smrg	case "`/usr/bin/arch -k`" in
33991a17321Smrg	    Series*|S4*)
34091a17321Smrg		UNAME_RELEASE=`uname -v`
34191a17321Smrg		;;
34291a17321Smrg	esac
34391a17321Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
34491a17321Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
34591a17321Smrg	exit ;;
34691a17321Smrg    sun3*:SunOS:*:*)
34791a17321Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
34891a17321Smrg	exit ;;
34991a17321Smrg    sun*:*:4.2BSD:*)
35091a17321Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
35191a17321Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
35291a17321Smrg	case "`/bin/arch`" in
35391a17321Smrg	    sun3)
35491a17321Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
35591a17321Smrg		;;
35691a17321Smrg	    sun4)
35791a17321Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
35891a17321Smrg		;;
35991a17321Smrg	esac
36091a17321Smrg	exit ;;
36191a17321Smrg    aushp:SunOS:*:*)
36291a17321Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
36391a17321Smrg	exit ;;
36491a17321Smrg    # The situation for MiNT is a little confusing.  The machine name
36591a17321Smrg    # can be virtually everything (everything which is not
36691a17321Smrg    # "atarist" or "atariste" at least should have a processor
36791a17321Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
36891a17321Smrg    # to the lowercase version "mint" (or "freemint").  Finally
36991a17321Smrg    # the system name "TOS" denotes a system which is actually not
37091a17321Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
37191a17321Smrg    # be no problem.
37291a17321Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
37391a17321Smrg        echo m68k-atari-mint${UNAME_RELEASE}
37491a17321Smrg	exit ;;
37591a17321Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
37691a17321Smrg	echo m68k-atari-mint${UNAME_RELEASE}
37791a17321Smrg        exit ;;
37891a17321Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
37991a17321Smrg        echo m68k-atari-mint${UNAME_RELEASE}
38091a17321Smrg	exit ;;
38191a17321Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
38291a17321Smrg        echo m68k-milan-mint${UNAME_RELEASE}
38391a17321Smrg        exit ;;
38491a17321Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
38591a17321Smrg        echo m68k-hades-mint${UNAME_RELEASE}
38691a17321Smrg        exit ;;
38791a17321Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
38891a17321Smrg        echo m68k-unknown-mint${UNAME_RELEASE}
38991a17321Smrg        exit ;;
39091a17321Smrg    m68k:machten:*:*)
39191a17321Smrg	echo m68k-apple-machten${UNAME_RELEASE}
39291a17321Smrg	exit ;;
39391a17321Smrg    powerpc:machten:*:*)
39491a17321Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
39591a17321Smrg	exit ;;
39691a17321Smrg    RISC*:Mach:*:*)
39791a17321Smrg	echo mips-dec-mach_bsd4.3
39891a17321Smrg	exit ;;
39991a17321Smrg    RISC*:ULTRIX:*:*)
40091a17321Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
40191a17321Smrg	exit ;;
40291a17321Smrg    VAX*:ULTRIX*:*:*)
40391a17321Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
40491a17321Smrg	exit ;;
40591a17321Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
40691a17321Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
40791a17321Smrg	exit ;;
40891a17321Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
40991a17321Smrg	eval $set_cc_for_build
41091a17321Smrg	sed 's/^	//' << EOF >$dummy.c
41191a17321Smrg#ifdef __cplusplus
41291a17321Smrg#include <stdio.h>  /* for printf() prototype */
41391a17321Smrg	int main (int argc, char *argv[]) {
41491a17321Smrg#else
41591a17321Smrg	int main (argc, argv) int argc; char *argv[]; {
41691a17321Smrg#endif
41791a17321Smrg	#if defined (host_mips) && defined (MIPSEB)
41891a17321Smrg	#if defined (SYSTYPE_SYSV)
41991a17321Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
42091a17321Smrg	#endif
42191a17321Smrg	#if defined (SYSTYPE_SVR4)
42291a17321Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
42391a17321Smrg	#endif
42491a17321Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
42591a17321Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
42691a17321Smrg	#endif
42791a17321Smrg	#endif
42891a17321Smrg	  exit (-1);
42991a17321Smrg	}
43091a17321SmrgEOF
43191a17321Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
43291a17321Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
43391a17321Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
43491a17321Smrg	    { echo "$SYSTEM_NAME"; exit; }
43591a17321Smrg	echo mips-mips-riscos${UNAME_RELEASE}
43691a17321Smrg	exit ;;
43791a17321Smrg    Motorola:PowerMAX_OS:*:*)
43891a17321Smrg	echo powerpc-motorola-powermax
43991a17321Smrg	exit ;;
44091a17321Smrg    Motorola:*:4.3:PL8-*)
44191a17321Smrg	echo powerpc-harris-powermax
44291a17321Smrg	exit ;;
44391a17321Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
44491a17321Smrg	echo powerpc-harris-powermax
44591a17321Smrg	exit ;;
44691a17321Smrg    Night_Hawk:Power_UNIX:*:*)
44791a17321Smrg	echo powerpc-harris-powerunix
44891a17321Smrg	exit ;;
44991a17321Smrg    m88k:CX/UX:7*:*)
45091a17321Smrg	echo m88k-harris-cxux7
45191a17321Smrg	exit ;;
45291a17321Smrg    m88k:*:4*:R4*)
45391a17321Smrg	echo m88k-motorola-sysv4
45491a17321Smrg	exit ;;
45591a17321Smrg    m88k:*:3*:R3*)
45691a17321Smrg	echo m88k-motorola-sysv3
45791a17321Smrg	exit ;;
45891a17321Smrg    AViiON:dgux:*:*)
45991a17321Smrg        # DG/UX returns AViiON for all architectures
46091a17321Smrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
46191a17321Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
46291a17321Smrg	then
46391a17321Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
46491a17321Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
46591a17321Smrg	    then
46691a17321Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
46791a17321Smrg	    else
46891a17321Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
46991a17321Smrg	    fi
47091a17321Smrg	else
47191a17321Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
47291a17321Smrg	fi
47391a17321Smrg 	exit ;;
47491a17321Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
47591a17321Smrg	echo m88k-dolphin-sysv3
47691a17321Smrg	exit ;;
47791a17321Smrg    M88*:*:R3*:*)
47891a17321Smrg	# Delta 88k system running SVR3
47991a17321Smrg	echo m88k-motorola-sysv3
48091a17321Smrg	exit ;;
48191a17321Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
48291a17321Smrg	echo m88k-tektronix-sysv3
48391a17321Smrg	exit ;;
48491a17321Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
48591a17321Smrg	echo m68k-tektronix-bsd
48691a17321Smrg	exit ;;
48791a17321Smrg    *:IRIX*:*:*)
48891a17321Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
48991a17321Smrg	exit ;;
49091a17321Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
49191a17321Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
49291a17321Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
49391a17321Smrg    i*86:AIX:*:*)
49491a17321Smrg	echo i386-ibm-aix
49591a17321Smrg	exit ;;
49691a17321Smrg    ia64:AIX:*:*)
49791a17321Smrg	if [ -x /usr/bin/oslevel ] ; then
49891a17321Smrg		IBM_REV=`/usr/bin/oslevel`
49991a17321Smrg	else
50091a17321Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
50191a17321Smrg	fi
50291a17321Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
50391a17321Smrg	exit ;;
50491a17321Smrg    *:AIX:2:3)
50591a17321Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
50691a17321Smrg		eval $set_cc_for_build
50791a17321Smrg		sed 's/^		//' << EOF >$dummy.c
50891a17321Smrg		#include <sys/systemcfg.h>
50991a17321Smrg
51091a17321Smrg		main()
51191a17321Smrg			{
51291a17321Smrg			if (!__power_pc())
51391a17321Smrg				exit(1);
51491a17321Smrg			puts("powerpc-ibm-aix3.2.5");
51591a17321Smrg			exit(0);
51691a17321Smrg			}
51791a17321SmrgEOF
51891a17321Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
51991a17321Smrg		then
52091a17321Smrg			echo "$SYSTEM_NAME"
52191a17321Smrg		else
52291a17321Smrg			echo rs6000-ibm-aix3.2.5
52391a17321Smrg		fi
52491a17321Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
52591a17321Smrg		echo rs6000-ibm-aix3.2.4
52691a17321Smrg	else
52791a17321Smrg		echo rs6000-ibm-aix3.2
52891a17321Smrg	fi
52991a17321Smrg	exit ;;
53091a17321Smrg    *:AIX:*:[45])
53191a17321Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
53291a17321Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
53391a17321Smrg		IBM_ARCH=rs6000
53491a17321Smrg	else
53591a17321Smrg		IBM_ARCH=powerpc
53691a17321Smrg	fi
53791a17321Smrg	if [ -x /usr/bin/oslevel ] ; then
53891a17321Smrg		IBM_REV=`/usr/bin/oslevel`
53991a17321Smrg	else
54091a17321Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
54191a17321Smrg	fi
54291a17321Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
54391a17321Smrg	exit ;;
54491a17321Smrg    *:AIX:*:*)
54591a17321Smrg	echo rs6000-ibm-aix
54691a17321Smrg	exit ;;
54791a17321Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
54891a17321Smrg	echo romp-ibm-bsd4.4
54991a17321Smrg	exit ;;
55091a17321Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
55191a17321Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
55291a17321Smrg	exit ;;                             # report: romp-ibm BSD 4.3
55391a17321Smrg    *:BOSX:*:*)
55491a17321Smrg	echo rs6000-bull-bosx
55591a17321Smrg	exit ;;
55691a17321Smrg    DPX/2?00:B.O.S.:*:*)
55791a17321Smrg	echo m68k-bull-sysv3
55891a17321Smrg	exit ;;
55991a17321Smrg    9000/[34]??:4.3bsd:1.*:*)
56091a17321Smrg	echo m68k-hp-bsd
56191a17321Smrg	exit ;;
56291a17321Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
56391a17321Smrg	echo m68k-hp-bsd4.4
56491a17321Smrg	exit ;;
56591a17321Smrg    9000/[34678]??:HP-UX:*:*)
56691a17321Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
56791a17321Smrg	case "${UNAME_MACHINE}" in
56891a17321Smrg	    9000/31? )            HP_ARCH=m68000 ;;
56991a17321Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
57091a17321Smrg	    9000/[678][0-9][0-9])
57191a17321Smrg		if [ -x /usr/bin/getconf ]; then
57291a17321Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
57391a17321Smrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
57491a17321Smrg                    case "${sc_cpu_version}" in
57591a17321Smrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
57691a17321Smrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
57791a17321Smrg                      532)                      # CPU_PA_RISC2_0
57891a17321Smrg                        case "${sc_kernel_bits}" in
57991a17321Smrg                          32) HP_ARCH="hppa2.0n" ;;
58091a17321Smrg                          64) HP_ARCH="hppa2.0w" ;;
58191a17321Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
58291a17321Smrg                        esac ;;
58391a17321Smrg                    esac
58491a17321Smrg		fi
58591a17321Smrg		if [ "${HP_ARCH}" = "" ]; then
58691a17321Smrg		    eval $set_cc_for_build
58791a17321Smrg		    sed 's/^              //' << EOF >$dummy.c
58891a17321Smrg
58991a17321Smrg              #define _HPUX_SOURCE
59091a17321Smrg              #include <stdlib.h>
59191a17321Smrg              #include <unistd.h>
59291a17321Smrg
59391a17321Smrg              int main ()
59491a17321Smrg              {
59591a17321Smrg              #if defined(_SC_KERNEL_BITS)
59691a17321Smrg                  long bits = sysconf(_SC_KERNEL_BITS);
59791a17321Smrg              #endif
59891a17321Smrg                  long cpu  = sysconf (_SC_CPU_VERSION);
59991a17321Smrg
60091a17321Smrg                  switch (cpu)
60191a17321Smrg              	{
60291a17321Smrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
60391a17321Smrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
60491a17321Smrg              	case CPU_PA_RISC2_0:
60591a17321Smrg              #if defined(_SC_KERNEL_BITS)
60691a17321Smrg              	    switch (bits)
60791a17321Smrg              		{
60891a17321Smrg              		case 64: puts ("hppa2.0w"); break;
60991a17321Smrg              		case 32: puts ("hppa2.0n"); break;
61091a17321Smrg              		default: puts ("hppa2.0"); break;
61191a17321Smrg              		} break;
61291a17321Smrg              #else  /* !defined(_SC_KERNEL_BITS) */
61391a17321Smrg              	    puts ("hppa2.0"); break;
61491a17321Smrg              #endif
61591a17321Smrg              	default: puts ("hppa1.0"); break;
61691a17321Smrg              	}
61791a17321Smrg                  exit (0);
61891a17321Smrg              }
61991a17321SmrgEOF
62091a17321Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
62191a17321Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
62291a17321Smrg		fi ;;
62391a17321Smrg	esac
62491a17321Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
62591a17321Smrg	then
62691a17321Smrg	    eval $set_cc_for_build
62791a17321Smrg
62891a17321Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
62991a17321Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
63091a17321Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
63191a17321Smrg	    #
63291a17321Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
63391a17321Smrg	    # => hppa2.0w-hp-hpux11.23
63491a17321Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
63591a17321Smrg	    # => hppa64-hp-hpux11.23
63691a17321Smrg
63791a17321Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
63891a17321Smrg		grep __LP64__ >/dev/null
63991a17321Smrg	    then
64091a17321Smrg		HP_ARCH="hppa2.0w"
64191a17321Smrg	    else
64291a17321Smrg		HP_ARCH="hppa64"
64391a17321Smrg	    fi
64491a17321Smrg	fi
64591a17321Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
64691a17321Smrg	exit ;;
64791a17321Smrg    ia64:HP-UX:*:*)
64891a17321Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
64991a17321Smrg	echo ia64-hp-hpux${HPUX_REV}
65091a17321Smrg	exit ;;
65191a17321Smrg    3050*:HI-UX:*:*)
65291a17321Smrg	eval $set_cc_for_build
65391a17321Smrg	sed 's/^	//' << EOF >$dummy.c
65491a17321Smrg	#include <unistd.h>
65591a17321Smrg	int
65691a17321Smrg	main ()
65791a17321Smrg	{
65891a17321Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
65991a17321Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
66091a17321Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
66191a17321Smrg	     results, however.  */
66291a17321Smrg	  if (CPU_IS_PA_RISC (cpu))
66391a17321Smrg	    {
66491a17321Smrg	      switch (cpu)
66591a17321Smrg		{
66691a17321Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
66791a17321Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
66891a17321Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
66991a17321Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
67091a17321Smrg		}
67191a17321Smrg	    }
67291a17321Smrg	  else if (CPU_IS_HP_MC68K (cpu))
67391a17321Smrg	    puts ("m68k-hitachi-hiuxwe2");
67491a17321Smrg	  else puts ("unknown-hitachi-hiuxwe2");
67591a17321Smrg	  exit (0);
67691a17321Smrg	}
67791a17321SmrgEOF
67891a17321Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
67991a17321Smrg		{ echo "$SYSTEM_NAME"; exit; }
68091a17321Smrg	echo unknown-hitachi-hiuxwe2
68191a17321Smrg	exit ;;
68291a17321Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
68391a17321Smrg	echo hppa1.1-hp-bsd
68491a17321Smrg	exit ;;
68591a17321Smrg    9000/8??:4.3bsd:*:*)
68691a17321Smrg	echo hppa1.0-hp-bsd
68791a17321Smrg	exit ;;
68891a17321Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
68991a17321Smrg	echo hppa1.0-hp-mpeix
69091a17321Smrg	exit ;;
69191a17321Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
69291a17321Smrg	echo hppa1.1-hp-osf
69391a17321Smrg	exit ;;
69491a17321Smrg    hp8??:OSF1:*:*)
69591a17321Smrg	echo hppa1.0-hp-osf
69691a17321Smrg	exit ;;
69791a17321Smrg    i*86:OSF1:*:*)
69891a17321Smrg	if [ -x /usr/sbin/sysversion ] ; then
69991a17321Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
70091a17321Smrg	else
70191a17321Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
70291a17321Smrg	fi
70391a17321Smrg	exit ;;
70491a17321Smrg    parisc*:Lites*:*:*)
70591a17321Smrg	echo hppa1.1-hp-lites
70691a17321Smrg	exit ;;
70791a17321Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
70891a17321Smrg	echo c1-convex-bsd
70991a17321Smrg        exit ;;
71091a17321Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
71191a17321Smrg	if getsysinfo -f scalar_acc
71291a17321Smrg	then echo c32-convex-bsd
71391a17321Smrg	else echo c2-convex-bsd
71491a17321Smrg	fi
71591a17321Smrg        exit ;;
71691a17321Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
71791a17321Smrg	echo c34-convex-bsd
71891a17321Smrg        exit ;;
71991a17321Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
72091a17321Smrg	echo c38-convex-bsd
72191a17321Smrg        exit ;;
72291a17321Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
72391a17321Smrg	echo c4-convex-bsd
72491a17321Smrg        exit ;;
72591a17321Smrg    CRAY*Y-MP:*:*:*)
72691a17321Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
72791a17321Smrg	exit ;;
72891a17321Smrg    CRAY*[A-Z]90:*:*:*)
72991a17321Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
73091a17321Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
73191a17321Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
73291a17321Smrg	      -e 's/\.[^.]*$/.X/'
73391a17321Smrg	exit ;;
73491a17321Smrg    CRAY*TS:*:*:*)
73591a17321Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
73691a17321Smrg	exit ;;
73791a17321Smrg    CRAY*T3E:*:*:*)
73891a17321Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
73991a17321Smrg	exit ;;
74091a17321Smrg    CRAY*SV1:*:*:*)
74191a17321Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
74291a17321Smrg	exit ;;
74391a17321Smrg    *:UNICOS/mp:*:*)
74491a17321Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
74591a17321Smrg	exit ;;
74691a17321Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
74791a17321Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
74891a17321Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
74991a17321Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
75091a17321Smrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
75191a17321Smrg        exit ;;
75291a17321Smrg    5000:UNIX_System_V:4.*:*)
75391a17321Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
75491a17321Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
75591a17321Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
75691a17321Smrg	exit ;;
75791a17321Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
75891a17321Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
75991a17321Smrg	exit ;;
76091a17321Smrg    sparc*:BSD/OS:*:*)
76191a17321Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
76291a17321Smrg	exit ;;
76391a17321Smrg    *:BSD/OS:*:*)
76491a17321Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
76591a17321Smrg	exit ;;
76691a17321Smrg    *:FreeBSD:*:*)
76791a17321Smrg	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
76891a17321Smrg	exit ;;
76991a17321Smrg    i*:CYGWIN*:*)
77091a17321Smrg	echo ${UNAME_MACHINE}-pc-cygwin
77191a17321Smrg	exit ;;
77291a17321Smrg    i*:MINGW*:*)
77391a17321Smrg	echo ${UNAME_MACHINE}-pc-mingw32
77491a17321Smrg	exit ;;
77591a17321Smrg    i*:windows32*:*)
77691a17321Smrg    	# uname -m includes "-pc" on this system.
77791a17321Smrg    	echo ${UNAME_MACHINE}-mingw32
77891a17321Smrg	exit ;;
77991a17321Smrg    i*:PW*:*)
78091a17321Smrg	echo ${UNAME_MACHINE}-pc-pw32
78191a17321Smrg	exit ;;
78291a17321Smrg    x86:Interix*:[34]*)
78391a17321Smrg	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
78491a17321Smrg	exit ;;
78591a17321Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
78691a17321Smrg	echo i${UNAME_MACHINE}-pc-mks
78791a17321Smrg	exit ;;
78891a17321Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
78991a17321Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
79091a17321Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
79191a17321Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
79291a17321Smrg	echo i586-pc-interix
79391a17321Smrg	exit ;;
79491a17321Smrg    i*:UWIN*:*)
79591a17321Smrg	echo ${UNAME_MACHINE}-pc-uwin
79691a17321Smrg	exit ;;
79791a17321Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
79891a17321Smrg	echo x86_64-unknown-cygwin
79991a17321Smrg	exit ;;
80091a17321Smrg    p*:CYGWIN*:*)
80191a17321Smrg	echo powerpcle-unknown-cygwin
80291a17321Smrg	exit ;;
80391a17321Smrg    prep*:SunOS:5.*:*)
80491a17321Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
80591a17321Smrg	exit ;;
80691a17321Smrg    *:GNU:*:*)
80791a17321Smrg	# the GNU system
80891a17321Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
80991a17321Smrg	exit ;;
81091a17321Smrg    *:GNU/*:*:*)
81191a17321Smrg	# other systems with GNU libc and userland
81291a17321Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
81391a17321Smrg	exit ;;
81491a17321Smrg    i*86:Minix:*:*)
81591a17321Smrg	echo ${UNAME_MACHINE}-pc-minix
81691a17321Smrg	exit ;;
81791a17321Smrg    arm*:Linux:*:*)
81891a17321Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
81991a17321Smrg	exit ;;
82091a17321Smrg    cris:Linux:*:*)
82191a17321Smrg	echo cris-axis-linux-gnu
82291a17321Smrg	exit ;;
82391a17321Smrg    crisv32:Linux:*:*)
82491a17321Smrg	echo crisv32-axis-linux-gnu
82591a17321Smrg	exit ;;
82691a17321Smrg    frv:Linux:*:*)
82791a17321Smrg    	echo frv-unknown-linux-gnu
82891a17321Smrg	exit ;;
82991a17321Smrg    ia64:Linux:*:*)
83091a17321Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
83191a17321Smrg	exit ;;
83291a17321Smrg    m32r*:Linux:*:*)
83391a17321Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
83491a17321Smrg	exit ;;
83591a17321Smrg    m68*:Linux:*:*)
83691a17321Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
83791a17321Smrg	exit ;;
83891a17321Smrg    mips:Linux:*:*)
83991a17321Smrg	eval $set_cc_for_build
84091a17321Smrg	sed 's/^	//' << EOF >$dummy.c
84191a17321Smrg	#undef CPU
84291a17321Smrg	#undef mips
84391a17321Smrg	#undef mipsel
84491a17321Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
84591a17321Smrg	CPU=mipsel
84691a17321Smrg	#else
84791a17321Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
84891a17321Smrg	CPU=mips
84991a17321Smrg	#else
85091a17321Smrg	CPU=
85191a17321Smrg	#endif
85291a17321Smrg	#endif
85391a17321SmrgEOF
85491a17321Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
85591a17321Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
85691a17321Smrg	;;
85791a17321Smrg    mips64:Linux:*:*)
85891a17321Smrg	eval $set_cc_for_build
85991a17321Smrg	sed 's/^	//' << EOF >$dummy.c
86091a17321Smrg	#undef CPU
86191a17321Smrg	#undef mips64
86291a17321Smrg	#undef mips64el
86391a17321Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
86491a17321Smrg	CPU=mips64el
86591a17321Smrg	#else
86691a17321Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
86791a17321Smrg	CPU=mips64
86891a17321Smrg	#else
86991a17321Smrg	CPU=
87091a17321Smrg	#endif
87191a17321Smrg	#endif
87291a17321SmrgEOF
87391a17321Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
87491a17321Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
87591a17321Smrg	;;
87691a17321Smrg    or32:Linux:*:*)
87791a17321Smrg	echo or32-unknown-linux-gnu
87891a17321Smrg	exit ;;
87991a17321Smrg    ppc:Linux:*:*)
88091a17321Smrg	echo powerpc-unknown-linux-gnu
88191a17321Smrg	exit ;;
88291a17321Smrg    ppc64:Linux:*:*)
88391a17321Smrg	echo powerpc64-unknown-linux-gnu
88491a17321Smrg	exit ;;
88591a17321Smrg    alpha:Linux:*:*)
88691a17321Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
88791a17321Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
88891a17321Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
88991a17321Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
89091a17321Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
89191a17321Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
89291a17321Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
89391a17321Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
89491a17321Smrg        esac
89591a17321Smrg	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
89691a17321Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
89791a17321Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
89891a17321Smrg	exit ;;
89991a17321Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
90091a17321Smrg	# Look for CPU level
90191a17321Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
90291a17321Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
90391a17321Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
90491a17321Smrg	  *)    echo hppa-unknown-linux-gnu ;;
90591a17321Smrg	esac
90691a17321Smrg	exit ;;
90791a17321Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
90891a17321Smrg	echo hppa64-unknown-linux-gnu
90991a17321Smrg	exit ;;
91091a17321Smrg    s390:Linux:*:* | s390x:Linux:*:*)
91191a17321Smrg	echo ${UNAME_MACHINE}-ibm-linux
91291a17321Smrg	exit ;;
91391a17321Smrg    sh64*:Linux:*:*)
91491a17321Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
91591a17321Smrg	exit ;;
91691a17321Smrg    sh*:Linux:*:*)
91791a17321Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
91891a17321Smrg	exit ;;
91991a17321Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
92091a17321Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
92191a17321Smrg	exit ;;
92291a17321Smrg    x86_64:Linux:*:*)
92391a17321Smrg	echo x86_64-unknown-linux-gnu
92491a17321Smrg	exit ;;
92591a17321Smrg    i*86:Linux:*:*)
92691a17321Smrg	# The BFD linker knows what the default object file format is, so
92791a17321Smrg	# first see if it will tell us. cd to the root directory to prevent
92891a17321Smrg	# problems with other programs or directories called `ld' in the path.
92991a17321Smrg	# Set LC_ALL=C to ensure ld outputs messages in English.
93091a17321Smrg	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
93191a17321Smrg			 | sed -ne '/supported targets:/!d
93291a17321Smrg				    s/[ 	][ 	]*/ /g
93391a17321Smrg				    s/.*supported targets: *//
93491a17321Smrg				    s/ .*//
93591a17321Smrg				    p'`
93691a17321Smrg        case "$ld_supported_targets" in
93791a17321Smrg	  elf32-i386)
93891a17321Smrg		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
93991a17321Smrg		;;
94091a17321Smrg	  a.out-i386-linux)
94191a17321Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
94291a17321Smrg		exit ;;
94391a17321Smrg	  coff-i386)
94491a17321Smrg		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
94591a17321Smrg		exit ;;
94691a17321Smrg	  "")
94791a17321Smrg		# Either a pre-BFD a.out linker (linux-gnuoldld) or
94891a17321Smrg		# one that does not give us useful --help.
94991a17321Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
95091a17321Smrg		exit ;;
95191a17321Smrg	esac
95291a17321Smrg	# Determine whether the default compiler is a.out or elf
95391a17321Smrg	eval $set_cc_for_build
95491a17321Smrg	sed 's/^	//' << EOF >$dummy.c
95591a17321Smrg	#include <features.h>
95691a17321Smrg	#ifdef __ELF__
95791a17321Smrg	# ifdef __GLIBC__
95891a17321Smrg	#  if __GLIBC__ >= 2
95991a17321Smrg	LIBC=gnu
96091a17321Smrg	#  else
96191a17321Smrg	LIBC=gnulibc1
96291a17321Smrg	#  endif
96391a17321Smrg	# else
96491a17321Smrg	LIBC=gnulibc1
96591a17321Smrg	# endif
96691a17321Smrg	#else
96791a17321Smrg	#ifdef __INTEL_COMPILER
96891a17321Smrg	LIBC=gnu
96991a17321Smrg	#else
97091a17321Smrg	LIBC=gnuaout
97191a17321Smrg	#endif
97291a17321Smrg	#endif
97391a17321Smrg	#ifdef __dietlibc__
97491a17321Smrg	LIBC=dietlibc
97591a17321Smrg	#endif
97691a17321SmrgEOF
97791a17321Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
97891a17321Smrg	test x"${LIBC}" != x && {
97991a17321Smrg		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
98091a17321Smrg		exit
98191a17321Smrg	}
98291a17321Smrg	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
98391a17321Smrg	;;
98491a17321Smrg    i*86:DYNIX/ptx:4*:*)
98591a17321Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
98691a17321Smrg	# earlier versions are messed up and put the nodename in both
98791a17321Smrg	# sysname and nodename.
98891a17321Smrg	echo i386-sequent-sysv4
98991a17321Smrg	exit ;;
99091a17321Smrg    i*86:UNIX_SV:4.2MP:2.*)
99191a17321Smrg        # Unixware is an offshoot of SVR4, but it has its own version
99291a17321Smrg        # number series starting with 2...
99391a17321Smrg        # I am not positive that other SVR4 systems won't match this,
99491a17321Smrg	# I just have to hope.  -- rms.
99591a17321Smrg        # Use sysv4.2uw... so that sysv4* matches it.
99691a17321Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
99791a17321Smrg	exit ;;
99891a17321Smrg    i*86:OS/2:*:*)
99991a17321Smrg	# If we were able to find `uname', then EMX Unix compatibility
100091a17321Smrg	# is probably installed.
100191a17321Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
100291a17321Smrg	exit ;;
100391a17321Smrg    i*86:XTS-300:*:STOP)
100491a17321Smrg	echo ${UNAME_MACHINE}-unknown-stop
100591a17321Smrg	exit ;;
100691a17321Smrg    i*86:atheos:*:*)
100791a17321Smrg	echo ${UNAME_MACHINE}-unknown-atheos
100891a17321Smrg	exit ;;
100991a17321Smrg    i*86:syllable:*:*)
101091a17321Smrg	echo ${UNAME_MACHINE}-pc-syllable
101191a17321Smrg	exit ;;
101291a17321Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
101391a17321Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
101491a17321Smrg	exit ;;
101591a17321Smrg    i*86:*DOS:*:*)
101691a17321Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
101791a17321Smrg	exit ;;
101891a17321Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
101991a17321Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
102091a17321Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
102191a17321Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
102291a17321Smrg	else
102391a17321Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
102491a17321Smrg	fi
102591a17321Smrg	exit ;;
102691a17321Smrg    i*86:*:5:[678]*)
102791a17321Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
102891a17321Smrg	case `/bin/uname -X | grep "^Machine"` in
102991a17321Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
103091a17321Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
103191a17321Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
103291a17321Smrg	esac
103391a17321Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
103491a17321Smrg	exit ;;
103591a17321Smrg    i*86:*:3.2:*)
103691a17321Smrg	if test -f /usr/options/cb.name; then
103791a17321Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
103891a17321Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
103991a17321Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
104091a17321Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
104191a17321Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
104291a17321Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
104391a17321Smrg			&& UNAME_MACHINE=i586
104491a17321Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
104591a17321Smrg			&& UNAME_MACHINE=i686
104691a17321Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
104791a17321Smrg			&& UNAME_MACHINE=i686
104891a17321Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
104991a17321Smrg	else
105091a17321Smrg		echo ${UNAME_MACHINE}-pc-sysv32
105191a17321Smrg	fi
105291a17321Smrg	exit ;;
105391a17321Smrg    pc:*:*:*)
105491a17321Smrg	# Left here for compatibility:
105591a17321Smrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
105691a17321Smrg        # the processor, so we play safe by assuming i386.
105791a17321Smrg	echo i386-pc-msdosdjgpp
105891a17321Smrg        exit ;;
105991a17321Smrg    Intel:Mach:3*:*)
106091a17321Smrg	echo i386-pc-mach3
106191a17321Smrg	exit ;;
106291a17321Smrg    paragon:*:*:*)
106391a17321Smrg	echo i860-intel-osf1
106491a17321Smrg	exit ;;
106591a17321Smrg    i860:*:4.*:*) # i860-SVR4
106691a17321Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
106791a17321Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
106891a17321Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
106991a17321Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
107091a17321Smrg	fi
107191a17321Smrg	exit ;;
107291a17321Smrg    mini*:CTIX:SYS*5:*)
107391a17321Smrg	# "miniframe"
107491a17321Smrg	echo m68010-convergent-sysv
107591a17321Smrg	exit ;;
107691a17321Smrg    mc68k:UNIX:SYSTEM5:3.51m)
107791a17321Smrg	echo m68k-convergent-sysv
107891a17321Smrg	exit ;;
107991a17321Smrg    M680?0:D-NIX:5.3:*)
108091a17321Smrg	echo m68k-diab-dnix
108191a17321Smrg	exit ;;
108291a17321Smrg    M68*:*:R3V[5678]*:*)
108391a17321Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
108491a17321Smrg    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)
108591a17321Smrg	OS_REL=''
108691a17321Smrg	test -r /etc/.relid \
108791a17321Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
108891a17321Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
108991a17321Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
109091a17321Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
109191a17321Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
109291a17321Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
109391a17321Smrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
109491a17321Smrg          && { echo i486-ncr-sysv4; exit; } ;;
109591a17321Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
109691a17321Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
109791a17321Smrg	exit ;;
109891a17321Smrg    mc68030:UNIX_System_V:4.*:*)
109991a17321Smrg	echo m68k-atari-sysv4
110091a17321Smrg	exit ;;
110191a17321Smrg    TSUNAMI:LynxOS:2.*:*)
110291a17321Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
110391a17321Smrg	exit ;;
110491a17321Smrg    rs6000:LynxOS:2.*:*)
110591a17321Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
110691a17321Smrg	exit ;;
110791a17321Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
110891a17321Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
110991a17321Smrg	exit ;;
111091a17321Smrg    SM[BE]S:UNIX_SV:*:*)
111191a17321Smrg	echo mips-dde-sysv${UNAME_RELEASE}
111291a17321Smrg	exit ;;
111391a17321Smrg    RM*:ReliantUNIX-*:*:*)
111491a17321Smrg	echo mips-sni-sysv4
111591a17321Smrg	exit ;;
111691a17321Smrg    RM*:SINIX-*:*:*)
111791a17321Smrg	echo mips-sni-sysv4
111891a17321Smrg	exit ;;
111991a17321Smrg    *:SINIX-*:*:*)
112091a17321Smrg	if uname -p 2>/dev/null >/dev/null ; then
112191a17321Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
112291a17321Smrg		echo ${UNAME_MACHINE}-sni-sysv4
112391a17321Smrg	else
112491a17321Smrg		echo ns32k-sni-sysv
112591a17321Smrg	fi
112691a17321Smrg	exit ;;
112791a17321Smrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
112891a17321Smrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
112991a17321Smrg        echo i586-unisys-sysv4
113091a17321Smrg        exit ;;
113191a17321Smrg    *:UNIX_System_V:4*:FTX*)
113291a17321Smrg	# From Gerald Hewes <hewes@openmarket.com>.
113391a17321Smrg	# How about differentiating between stratus architectures? -djm
113491a17321Smrg	echo hppa1.1-stratus-sysv4
113591a17321Smrg	exit ;;
113691a17321Smrg    *:*:*:FTX*)
113791a17321Smrg	# From seanf@swdc.stratus.com.
113891a17321Smrg	echo i860-stratus-sysv4
113991a17321Smrg	exit ;;
114091a17321Smrg    i*86:VOS:*:*)
114191a17321Smrg	# From Paul.Green@stratus.com.
114291a17321Smrg	echo ${UNAME_MACHINE}-stratus-vos
114391a17321Smrg	exit ;;
114491a17321Smrg    *:VOS:*:*)
114591a17321Smrg	# From Paul.Green@stratus.com.
114691a17321Smrg	echo hppa1.1-stratus-vos
114791a17321Smrg	exit ;;
114891a17321Smrg    mc68*:A/UX:*:*)
114991a17321Smrg	echo m68k-apple-aux${UNAME_RELEASE}
115091a17321Smrg	exit ;;
115191a17321Smrg    news*:NEWS-OS:6*:*)
115291a17321Smrg	echo mips-sony-newsos6
115391a17321Smrg	exit ;;
115491a17321Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
115591a17321Smrg	if [ -d /usr/nec ]; then
115691a17321Smrg	        echo mips-nec-sysv${UNAME_RELEASE}
115791a17321Smrg	else
115891a17321Smrg	        echo mips-unknown-sysv${UNAME_RELEASE}
115991a17321Smrg	fi
116091a17321Smrg        exit ;;
116191a17321Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
116291a17321Smrg	echo powerpc-be-beos
116391a17321Smrg	exit ;;
116491a17321Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
116591a17321Smrg	echo powerpc-apple-beos
116691a17321Smrg	exit ;;
116791a17321Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
116891a17321Smrg	echo i586-pc-beos
116991a17321Smrg	exit ;;
117091a17321Smrg    SX-4:SUPER-UX:*:*)
117191a17321Smrg	echo sx4-nec-superux${UNAME_RELEASE}
117291a17321Smrg	exit ;;
117391a17321Smrg    SX-5:SUPER-UX:*:*)
117491a17321Smrg	echo sx5-nec-superux${UNAME_RELEASE}
117591a17321Smrg	exit ;;
117691a17321Smrg    SX-6:SUPER-UX:*:*)
117791a17321Smrg	echo sx6-nec-superux${UNAME_RELEASE}
117891a17321Smrg	exit ;;
117991a17321Smrg    Power*:Rhapsody:*:*)
118091a17321Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
118191a17321Smrg	exit ;;
118291a17321Smrg    *:Rhapsody:*:*)
118391a17321Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
118491a17321Smrg	exit ;;
118591a17321Smrg    *:Darwin:*:*)
118691a17321Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
118791a17321Smrg	case $UNAME_PROCESSOR in
118891a17321Smrg	    *86) UNAME_PROCESSOR=i686 ;;
118991a17321Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
119091a17321Smrg	esac
119191a17321Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
119291a17321Smrg	exit ;;
119391a17321Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
119491a17321Smrg	UNAME_PROCESSOR=`uname -p`
119591a17321Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
119691a17321Smrg		UNAME_PROCESSOR=i386
119791a17321Smrg		UNAME_MACHINE=pc
119891a17321Smrg	fi
119991a17321Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
120091a17321Smrg	exit ;;
120191a17321Smrg    *:QNX:*:4*)
120291a17321Smrg	echo i386-pc-qnx
120391a17321Smrg	exit ;;
120491a17321Smrg    NSE-?:NONSTOP_KERNEL:*:*)
120591a17321Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
120691a17321Smrg	exit ;;
120791a17321Smrg    NSR-?:NONSTOP_KERNEL:*:*)
120891a17321Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
120991a17321Smrg	exit ;;
121091a17321Smrg    *:NonStop-UX:*:*)
121191a17321Smrg	echo mips-compaq-nonstopux
121291a17321Smrg	exit ;;
121391a17321Smrg    BS2000:POSIX*:*:*)
121491a17321Smrg	echo bs2000-siemens-sysv
121591a17321Smrg	exit ;;
121691a17321Smrg    DS/*:UNIX_System_V:*:*)
121791a17321Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
121891a17321Smrg	exit ;;
121991a17321Smrg    *:Plan9:*:*)
122091a17321Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
122191a17321Smrg	# is converted to i386 for consistency with other x86
122291a17321Smrg	# operating systems.
122391a17321Smrg	if test "$cputype" = "386"; then
122491a17321Smrg	    UNAME_MACHINE=i386
122591a17321Smrg	else
122691a17321Smrg	    UNAME_MACHINE="$cputype"
122791a17321Smrg	fi
122891a17321Smrg	echo ${UNAME_MACHINE}-unknown-plan9
122991a17321Smrg	exit ;;
123091a17321Smrg    *:TOPS-10:*:*)
123191a17321Smrg	echo pdp10-unknown-tops10
123291a17321Smrg	exit ;;
123391a17321Smrg    *:TENEX:*:*)
123491a17321Smrg	echo pdp10-unknown-tenex
123591a17321Smrg	exit ;;
123691a17321Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
123791a17321Smrg	echo pdp10-dec-tops20
123891a17321Smrg	exit ;;
123991a17321Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
124091a17321Smrg	echo pdp10-xkl-tops20
124191a17321Smrg	exit ;;
124291a17321Smrg    *:TOPS-20:*:*)
124391a17321Smrg	echo pdp10-unknown-tops20
124491a17321Smrg	exit ;;
124591a17321Smrg    *:ITS:*:*)
124691a17321Smrg	echo pdp10-unknown-its
124791a17321Smrg	exit ;;
124891a17321Smrg    SEI:*:*:SEIUX)
124991a17321Smrg        echo mips-sei-seiux${UNAME_RELEASE}
125091a17321Smrg	exit ;;
125191a17321Smrg    *:DragonFly:*:*)
125291a17321Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
125391a17321Smrg	exit ;;
125491a17321Smrg    *:*VMS:*:*)
125591a17321Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
125691a17321Smrg	case "${UNAME_MACHINE}" in
125791a17321Smrg	    A*) echo alpha-dec-vms ; exit ;;
125891a17321Smrg	    I*) echo ia64-dec-vms ; exit ;;
125991a17321Smrg	    V*) echo vax-dec-vms ; exit ;;
126091a17321Smrg	esac ;;
126191a17321Smrg    *:XENIX:*:SysV)
126291a17321Smrg	echo i386-pc-xenix
126391a17321Smrg	exit ;;
126491a17321Smrg    i*86:skyos:*:*)
126591a17321Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
126691a17321Smrg	exit ;;
126791a17321Smrgesac
126891a17321Smrg
126991a17321Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
127091a17321Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
127191a17321Smrg
127291a17321Smrgeval $set_cc_for_build
127391a17321Smrgcat >$dummy.c <<EOF
127491a17321Smrg#ifdef _SEQUENT_
127591a17321Smrg# include <sys/types.h>
127691a17321Smrg# include <sys/utsname.h>
127791a17321Smrg#endif
127891a17321Smrgmain ()
127991a17321Smrg{
128091a17321Smrg#if defined (sony)
128191a17321Smrg#if defined (MIPSEB)
128291a17321Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
128391a17321Smrg     I don't know....  */
128491a17321Smrg  printf ("mips-sony-bsd\n"); exit (0);
128591a17321Smrg#else
128691a17321Smrg#include <sys/param.h>
128791a17321Smrg  printf ("m68k-sony-newsos%s\n",
128891a17321Smrg#ifdef NEWSOS4
128991a17321Smrg          "4"
129091a17321Smrg#else
129191a17321Smrg	  ""
129291a17321Smrg#endif
129391a17321Smrg         ); exit (0);
129491a17321Smrg#endif
129591a17321Smrg#endif
129691a17321Smrg
129791a17321Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
129891a17321Smrg  printf ("arm-acorn-riscix\n"); exit (0);
129991a17321Smrg#endif
130091a17321Smrg
130191a17321Smrg#if defined (hp300) && !defined (hpux)
130291a17321Smrg  printf ("m68k-hp-bsd\n"); exit (0);
130391a17321Smrg#endif
130491a17321Smrg
130591a17321Smrg#if defined (NeXT)
130691a17321Smrg#if !defined (__ARCHITECTURE__)
130791a17321Smrg#define __ARCHITECTURE__ "m68k"
130891a17321Smrg#endif
130991a17321Smrg  int version;
131091a17321Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
131191a17321Smrg  if (version < 4)
131291a17321Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
131391a17321Smrg  else
131491a17321Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
131591a17321Smrg  exit (0);
131691a17321Smrg#endif
131791a17321Smrg
131891a17321Smrg#if defined (MULTIMAX) || defined (n16)
131991a17321Smrg#if defined (UMAXV)
132091a17321Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
132191a17321Smrg#else
132291a17321Smrg#if defined (CMU)
132391a17321Smrg  printf ("ns32k-encore-mach\n"); exit (0);
132491a17321Smrg#else
132591a17321Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
132691a17321Smrg#endif
132791a17321Smrg#endif
132891a17321Smrg#endif
132991a17321Smrg
133091a17321Smrg#if defined (__386BSD__)
133191a17321Smrg  printf ("i386-pc-bsd\n"); exit (0);
133291a17321Smrg#endif
133391a17321Smrg
133491a17321Smrg#if defined (sequent)
133591a17321Smrg#if defined (i386)
133691a17321Smrg  printf ("i386-sequent-dynix\n"); exit (0);
133791a17321Smrg#endif
133891a17321Smrg#if defined (ns32000)
133991a17321Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
134091a17321Smrg#endif
134191a17321Smrg#endif
134291a17321Smrg
134391a17321Smrg#if defined (_SEQUENT_)
134491a17321Smrg    struct utsname un;
134591a17321Smrg
134691a17321Smrg    uname(&un);
134791a17321Smrg
134891a17321Smrg    if (strncmp(un.version, "V2", 2) == 0) {
134991a17321Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
135091a17321Smrg    }
135191a17321Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
135291a17321Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
135391a17321Smrg    }
135491a17321Smrg    printf ("i386-sequent-ptx\n"); exit (0);
135591a17321Smrg
135691a17321Smrg#endif
135791a17321Smrg
135891a17321Smrg#if defined (vax)
135991a17321Smrg# if !defined (ultrix)
136091a17321Smrg#  include <sys/param.h>
136191a17321Smrg#  if defined (BSD)
136291a17321Smrg#   if BSD == 43
136391a17321Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
136491a17321Smrg#   else
136591a17321Smrg#    if BSD == 199006
136691a17321Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
136791a17321Smrg#    else
136891a17321Smrg      printf ("vax-dec-bsd\n"); exit (0);
136991a17321Smrg#    endif
137091a17321Smrg#   endif
137191a17321Smrg#  else
137291a17321Smrg    printf ("vax-dec-bsd\n"); exit (0);
137391a17321Smrg#  endif
137491a17321Smrg# else
137591a17321Smrg    printf ("vax-dec-ultrix\n"); exit (0);
137691a17321Smrg# endif
137791a17321Smrg#endif
137891a17321Smrg
137991a17321Smrg#if defined (alliant) && defined (i860)
138091a17321Smrg  printf ("i860-alliant-bsd\n"); exit (0);
138191a17321Smrg#endif
138291a17321Smrg
138391a17321Smrg  exit (1);
138491a17321Smrg}
138591a17321SmrgEOF
138691a17321Smrg
138791a17321Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
138891a17321Smrg	{ echo "$SYSTEM_NAME"; exit; }
138991a17321Smrg
139091a17321Smrg# Apollos put the system type in the environment.
139191a17321Smrg
139291a17321Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
139391a17321Smrg
139491a17321Smrg# Convex versions that predate uname can use getsysinfo(1)
139591a17321Smrg
139691a17321Smrgif [ -x /usr/convex/getsysinfo ]
139791a17321Smrgthen
139891a17321Smrg    case `getsysinfo -f cpu_type` in
139991a17321Smrg    c1*)
140091a17321Smrg	echo c1-convex-bsd
140191a17321Smrg	exit ;;
140291a17321Smrg    c2*)
140391a17321Smrg	if getsysinfo -f scalar_acc
140491a17321Smrg	then echo c32-convex-bsd
140591a17321Smrg	else echo c2-convex-bsd
140691a17321Smrg	fi
140791a17321Smrg	exit ;;
140891a17321Smrg    c34*)
140991a17321Smrg	echo c34-convex-bsd
141091a17321Smrg	exit ;;
141191a17321Smrg    c38*)
141291a17321Smrg	echo c38-convex-bsd
141391a17321Smrg	exit ;;
141491a17321Smrg    c4*)
141591a17321Smrg	echo c4-convex-bsd
141691a17321Smrg	exit ;;
141791a17321Smrg    esac
141891a17321Smrgfi
141991a17321Smrg
142091a17321Smrgcat >&2 <<EOF
142191a17321Smrg$0: unable to guess system type
142291a17321Smrg
142391a17321SmrgThis script, last modified $timestamp, has failed to recognize
142491a17321Smrgthe operating system you are using. It is advised that you
142591a17321Smrgdownload the most up to date version of the config scripts from
142691a17321Smrg
142791a17321Smrg  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
142891a17321Smrgand
142991a17321Smrg  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
143091a17321Smrg
143191a17321SmrgIf the version you run ($0) is already up to date, please
143291a17321Smrgsend the following data and any information you think might be
143391a17321Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
143491a17321Smrginformation to handle your system.
143591a17321Smrg
143691a17321Smrgconfig.guess timestamp = $timestamp
143791a17321Smrg
143891a17321Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
143991a17321Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
144091a17321Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
144191a17321Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
144291a17321Smrg
144391a17321Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
144491a17321Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
144591a17321Smrg
144691a17321Smrghostinfo               = `(hostinfo) 2>/dev/null`
144791a17321Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
144891a17321Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
144991a17321Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
145091a17321Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
145191a17321Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
145291a17321Smrg
145391a17321SmrgUNAME_MACHINE = ${UNAME_MACHINE}
145491a17321SmrgUNAME_RELEASE = ${UNAME_RELEASE}
145591a17321SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
145691a17321SmrgUNAME_VERSION = ${UNAME_VERSION}
145791a17321SmrgEOF
145891a17321Smrg
145991a17321Smrgexit 1
146091a17321Smrg
146191a17321Smrg# Local variables:
146291a17321Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
146391a17321Smrg# time-stamp-start: "timestamp='"
146491a17321Smrg# time-stamp-format: "%:y-%02m-%02d"
146591a17321Smrg# time-stamp-end: "'"
146691a17321Smrg# End:
1467