144d7874bSmrg#! /bin/sh
244d7874bSmrg# Attempt to guess a canonical system name.
3e9feffd0Smrg#   Copyright 1992-2018 Free Software Foundation, Inc.
444d7874bSmrg
5e9feffd0Smrgtimestamp='2018-03-01'
644d7874bSmrg
744d7874bSmrg# This file is free software; you can redistribute it and/or modify it
844d7874bSmrg# under the terms of the GNU General Public License as published by
9e9feffd0Smrg# the Free Software Foundation; either version 3 of the License, or
1044d7874bSmrg# (at your option) any later version.
1144d7874bSmrg#
1244d7874bSmrg# This program is distributed in the hope that it will be useful, but
1344d7874bSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1444d7874bSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1544d7874bSmrg# General Public License for more details.
1644d7874bSmrg#
1744d7874bSmrg# You should have received a copy of the GNU General Public License
18e9feffd0Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
1944d7874bSmrg#
2044d7874bSmrg# As a special exception to the GNU General Public License, if you
2144d7874bSmrg# distribute this file as part of a program that contains a
2244d7874bSmrg# configuration script generated by Autoconf, you may include it under
23e9feffd0Smrg# the same distribution terms that you use for the rest of that
24e9feffd0Smrg# program.  This Exception is an additional permission under section 7
25e9feffd0Smrg# of the GNU General Public License, version 3 ("GPLv3").
2644d7874bSmrg#
27e9feffd0Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
2844d7874bSmrg#
292d861bc5Smrg# You can get the latest version of this script from:
30e9feffd0Smrg# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
31e9feffd0Smrg#
32e9feffd0Smrg# Please send patches to <config-patches@gnu.org>.
33e9feffd0Smrg
3444d7874bSmrg
3544d7874bSmrgme=`echo "$0" | sed -e 's,.*/,,'`
3644d7874bSmrg
3744d7874bSmrgusage="\
3844d7874bSmrgUsage: $0 [OPTION]
3944d7874bSmrg
4044d7874bSmrgOutput the configuration name of the system \`$me' is run on.
4144d7874bSmrg
42e9feffd0SmrgOptions:
4344d7874bSmrg  -h, --help         print this help, then exit
4444d7874bSmrg  -t, --time-stamp   print date of last modification, then exit
4544d7874bSmrg  -v, --version      print version number, then exit
4644d7874bSmrg
4744d7874bSmrgReport bugs and patches to <config-patches@gnu.org>."
4844d7874bSmrg
4944d7874bSmrgversion="\
5044d7874bSmrgGNU config.guess ($timestamp)
5144d7874bSmrg
5244d7874bSmrgOriginally written by Per Bothner.
53e9feffd0SmrgCopyright 1992-2018 Free Software Foundation, Inc.
5444d7874bSmrg
5544d7874bSmrgThis is free software; see the source for copying conditions.  There is NO
5644d7874bSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
5744d7874bSmrg
5844d7874bSmrghelp="
5944d7874bSmrgTry \`$me --help' for more information."
6044d7874bSmrg
6144d7874bSmrg# Parse command line
6244d7874bSmrgwhile test $# -gt 0 ; do
6344d7874bSmrg  case $1 in
6444d7874bSmrg    --time-stamp | --time* | -t )
6544d7874bSmrg       echo "$timestamp" ; exit ;;
6644d7874bSmrg    --version | -v )
6744d7874bSmrg       echo "$version" ; exit ;;
6844d7874bSmrg    --help | --h* | -h )
6944d7874bSmrg       echo "$usage"; exit ;;
7044d7874bSmrg    -- )     # Stop option processing
7144d7874bSmrg       shift; break ;;
7244d7874bSmrg    - )	# Use stdin as input.
7344d7874bSmrg       break ;;
7444d7874bSmrg    -* )
7544d7874bSmrg       echo "$me: invalid option $1$help" >&2
7644d7874bSmrg       exit 1 ;;
7744d7874bSmrg    * )
7844d7874bSmrg       break ;;
7944d7874bSmrg  esac
8044d7874bSmrgdone
8144d7874bSmrg
8244d7874bSmrgif test $# != 0; then
8344d7874bSmrg  echo "$me: too many arguments$help" >&2
8444d7874bSmrg  exit 1
8544d7874bSmrgfi
8644d7874bSmrg
87caec6540Smrgtrap 'exit 1' 1 2 15
8844d7874bSmrg
8944d7874bSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9044d7874bSmrg# compiler to aid in system detection is discouraged as it requires
9144d7874bSmrg# temporary files to be created and, as you can see below, it is a
9244d7874bSmrg# headache to deal with in a portable fashion.
9344d7874bSmrg
9444d7874bSmrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
9544d7874bSmrg# use `HOST_CC' if defined, but it is deprecated.
9644d7874bSmrg
9744d7874bSmrg# Portable tmp directory creation inspired by the Autoconf team.
9844d7874bSmrg
9944d7874bSmrgset_cc_for_build='
10044d7874bSmrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101caec6540Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
10244d7874bSmrg: ${TMPDIR=/tmp} ;
1032d861bc5Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
10444d7874bSmrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
10544d7874bSmrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
10644d7874bSmrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
10744d7874bSmrgdummy=$tmp/dummy ;
10844d7874bSmrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
10944d7874bSmrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
110e9feffd0Smrg ,,)    echo "int x;" > "$dummy.c" ;
11144d7874bSmrg	for c in cc gcc c89 c99 ; do
112e9feffd0Smrg	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
11344d7874bSmrg	     CC_FOR_BUILD="$c"; break ;
11444d7874bSmrg	  fi ;
11544d7874bSmrg	done ;
11644d7874bSmrg	if test x"$CC_FOR_BUILD" = x ; then
11744d7874bSmrg	  CC_FOR_BUILD=no_compiler_found ;
11844d7874bSmrg	fi
11944d7874bSmrg	;;
12044d7874bSmrg ,,*)   CC_FOR_BUILD=$CC ;;
12144d7874bSmrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
12244d7874bSmrgesac ; set_cc_for_build= ;'
12344d7874bSmrg
12444d7874bSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
12544d7874bSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
12644d7874bSmrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
12744d7874bSmrg	PATH=$PATH:/.attbin ; export PATH
12844d7874bSmrgfi
12944d7874bSmrg
13044d7874bSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13144d7874bSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
13244d7874bSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
13344d7874bSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
13444d7874bSmrg
135e9feffd0Smrgcase "$UNAME_SYSTEM" in
136e9feffd0SmrgLinux|GNU|GNU/*)
137e9feffd0Smrg	# If the system lacks a compiler, then just pick glibc.
138e9feffd0Smrg	# We could probably try harder.
139e9feffd0Smrg	LIBC=gnu
140e9feffd0Smrg
141e9feffd0Smrg	eval "$set_cc_for_build"
142e9feffd0Smrg	cat <<-EOF > "$dummy.c"
143e9feffd0Smrg	#include <features.h>
144e9feffd0Smrg	#if defined(__UCLIBC__)
145e9feffd0Smrg	LIBC=uclibc
146e9feffd0Smrg	#elif defined(__dietlibc__)
147e9feffd0Smrg	LIBC=dietlibc
148e9feffd0Smrg	#else
149e9feffd0Smrg	LIBC=gnu
150e9feffd0Smrg	#endif
151e9feffd0Smrg	EOF
152e9feffd0Smrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
153e9feffd0Smrg
154e9feffd0Smrg	# If ldd exists, use it to detect musl libc.
155e9feffd0Smrg	if command -v ldd >/dev/null && \
156e9feffd0Smrg		ldd --version 2>&1 | grep -q ^musl
157e9feffd0Smrg	then
158e9feffd0Smrg	    LIBC=musl
159e9feffd0Smrg	fi
160e9feffd0Smrg	;;
161e9feffd0Smrgesac
162e9feffd0Smrg
16344d7874bSmrg# Note: order is significant - the case branches are not exclusive.
16444d7874bSmrg
165e9feffd0Smrgcase "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
16644d7874bSmrg    *:NetBSD:*:*)
16744d7874bSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
168e9feffd0Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
16944d7874bSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
17044d7874bSmrg	# switched to ELF, *-*-netbsd* would select the old
17144d7874bSmrg	# object file format.  This provides both forward
17244d7874bSmrg	# compatibility and a consistent mechanism for selecting the
17344d7874bSmrg	# object file format.
17444d7874bSmrg	#
17544d7874bSmrg	# Note: NetBSD doesn't particularly care about the vendor
17644d7874bSmrg	# portion of the name.  We always set it to "unknown".
17744d7874bSmrg	sysctl="sysctl -n hw.machine_arch"
178e9feffd0Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
179e9feffd0Smrg	    "/sbin/$sysctl" 2>/dev/null || \
180e9feffd0Smrg	    "/usr/sbin/$sysctl" 2>/dev/null || \
181e9feffd0Smrg	    echo unknown)`
182e9feffd0Smrg	case "$UNAME_MACHINE_ARCH" in
18344d7874bSmrg	    armeb) machine=armeb-unknown ;;
18444d7874bSmrg	    arm*) machine=arm-unknown ;;
18544d7874bSmrg	    sh3el) machine=shl-unknown ;;
18644d7874bSmrg	    sh3eb) machine=sh-unknown ;;
1872d861bc5Smrg	    sh5el) machine=sh5le-unknown ;;
188e9feffd0Smrg	    earmv*)
189e9feffd0Smrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
190e9feffd0Smrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
191e9feffd0Smrg		machine="${arch}${endian}"-unknown
192e9feffd0Smrg		;;
193e9feffd0Smrg	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
19444d7874bSmrg	esac
19544d7874bSmrg	# The Operating System including object format, if it has switched
196e9feffd0Smrg	# to ELF recently (or will in the future) and ABI.
197e9feffd0Smrg	case "$UNAME_MACHINE_ARCH" in
198e9feffd0Smrg	    earm*)
199e9feffd0Smrg		os=netbsdelf
200e9feffd0Smrg		;;
20144d7874bSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
202e9feffd0Smrg		eval "$set_cc_for_build"
20344d7874bSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
2042d861bc5Smrg			| grep -q __ELF__
20544d7874bSmrg		then
20644d7874bSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
20744d7874bSmrg		    # Return netbsd for either.  FIX?
20844d7874bSmrg		    os=netbsd
20944d7874bSmrg		else
21044d7874bSmrg		    os=netbsdelf
21144d7874bSmrg		fi
21244d7874bSmrg		;;
21344d7874bSmrg	    *)
214caec6540Smrg		os=netbsd
21544d7874bSmrg		;;
21644d7874bSmrg	esac
217e9feffd0Smrg	# Determine ABI tags.
218e9feffd0Smrg	case "$UNAME_MACHINE_ARCH" in
219e9feffd0Smrg	    earm*)
220e9feffd0Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
221e9feffd0Smrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
222e9feffd0Smrg		;;
223e9feffd0Smrg	esac
22444d7874bSmrg	# The OS release
22544d7874bSmrg	# Debian GNU/NetBSD machines have a different userland, and
22644d7874bSmrg	# thus, need a distinct triplet. However, they do not need
22744d7874bSmrg	# kernel version information, so it can be replaced with a
22844d7874bSmrg	# suitable tag, in the style of linux-gnu.
229e9feffd0Smrg	case "$UNAME_VERSION" in
23044d7874bSmrg	    Debian*)
23144d7874bSmrg		release='-gnu'
23244d7874bSmrg		;;
23344d7874bSmrg	    *)
234e9feffd0Smrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
23544d7874bSmrg		;;
23644d7874bSmrg	esac
23744d7874bSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
23844d7874bSmrg	# contains redundant information, the shorter form:
23944d7874bSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
240e9feffd0Smrg	echo "$machine-${os}${release}${abi}"
241e9feffd0Smrg	exit ;;
242e9feffd0Smrg    *:Bitrig:*:*)
243e9feffd0Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
244e9feffd0Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
24544d7874bSmrg	exit ;;
24644d7874bSmrg    *:OpenBSD:*:*)
24744d7874bSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
248e9feffd0Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
249e9feffd0Smrg	exit ;;
250e9feffd0Smrg    *:LibertyBSD:*:*)
251e9feffd0Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
252e9feffd0Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
253e9feffd0Smrg	exit ;;
254e9feffd0Smrg    *:MidnightBSD:*:*)
255e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
25644d7874bSmrg	exit ;;
25744d7874bSmrg    *:ekkoBSD:*:*)
258e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
25944d7874bSmrg	exit ;;
2602d861bc5Smrg    *:SolidBSD:*:*)
261e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
2622d861bc5Smrg	exit ;;
26344d7874bSmrg    macppc:MirBSD:*:*)
264e9feffd0Smrg	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
26544d7874bSmrg	exit ;;
26644d7874bSmrg    *:MirBSD:*:*)
267e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
268e9feffd0Smrg	exit ;;
269e9feffd0Smrg    *:Sortix:*:*)
270e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-sortix
27144d7874bSmrg	exit ;;
272e9feffd0Smrg    *:Redox:*:*)
273e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-redox
274e9feffd0Smrg	exit ;;
275e9feffd0Smrg    mips:OSF1:*.*)
276e9feffd0Smrg        echo mips-dec-osf1
277e9feffd0Smrg        exit ;;
27844d7874bSmrg    alpha:OSF1:*:*)
27944d7874bSmrg	case $UNAME_RELEASE in
28044d7874bSmrg	*4.0)
28144d7874bSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
28244d7874bSmrg		;;
28344d7874bSmrg	*5.*)
284caec6540Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
28544d7874bSmrg		;;
28644d7874bSmrg	esac
28744d7874bSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
28844d7874bSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
28944d7874bSmrg	# covers most systems running today.  This code pipes the CPU
29044d7874bSmrg	# types through head -n 1, so we only detect the type of CPU 0.
29144d7874bSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
29244d7874bSmrg	case "$ALPHA_CPU_TYPE" in
29344d7874bSmrg	    "EV4 (21064)")
294e9feffd0Smrg		UNAME_MACHINE=alpha ;;
29544d7874bSmrg	    "EV4.5 (21064)")
296e9feffd0Smrg		UNAME_MACHINE=alpha ;;
29744d7874bSmrg	    "LCA4 (21066/21068)")
298e9feffd0Smrg		UNAME_MACHINE=alpha ;;
29944d7874bSmrg	    "EV5 (21164)")
300e9feffd0Smrg		UNAME_MACHINE=alphaev5 ;;
30144d7874bSmrg	    "EV5.6 (21164A)")
302e9feffd0Smrg		UNAME_MACHINE=alphaev56 ;;
30344d7874bSmrg	    "EV5.6 (21164PC)")
304e9feffd0Smrg		UNAME_MACHINE=alphapca56 ;;
30544d7874bSmrg	    "EV5.7 (21164PC)")
306e9feffd0Smrg		UNAME_MACHINE=alphapca57 ;;
30744d7874bSmrg	    "EV6 (21264)")
308e9feffd0Smrg		UNAME_MACHINE=alphaev6 ;;
30944d7874bSmrg	    "EV6.7 (21264A)")
310e9feffd0Smrg		UNAME_MACHINE=alphaev67 ;;
31144d7874bSmrg	    "EV6.8CB (21264C)")
312e9feffd0Smrg		UNAME_MACHINE=alphaev68 ;;
31344d7874bSmrg	    "EV6.8AL (21264B)")
314e9feffd0Smrg		UNAME_MACHINE=alphaev68 ;;
31544d7874bSmrg	    "EV6.8CX (21264D)")
316e9feffd0Smrg		UNAME_MACHINE=alphaev68 ;;
31744d7874bSmrg	    "EV6.9A (21264/EV69A)")
318e9feffd0Smrg		UNAME_MACHINE=alphaev69 ;;
31944d7874bSmrg	    "EV7 (21364)")
320e9feffd0Smrg		UNAME_MACHINE=alphaev7 ;;
32144d7874bSmrg	    "EV7.9 (21364A)")
322e9feffd0Smrg		UNAME_MACHINE=alphaev79 ;;
32344d7874bSmrg	esac
32444d7874bSmrg	# A Pn.n version is a patched version.
32544d7874bSmrg	# A Vn.n version is a released version.
32644d7874bSmrg	# A Tn.n version is a released field test version.
32744d7874bSmrg	# A Xn.n version is an unreleased experimental baselevel.
32844d7874bSmrg	# 1.2 uses "1.2" for uname -r.
329e9feffd0Smrg	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
330caec6540Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
331caec6540Smrg	exitcode=$?
332caec6540Smrg	trap '' 0
333caec6540Smrg	exit $exitcode ;;
33444d7874bSmrg    Amiga*:UNIX_System_V:4.0:*)
33544d7874bSmrg	echo m68k-unknown-sysv4
33644d7874bSmrg	exit ;;
33744d7874bSmrg    *:[Aa]miga[Oo][Ss]:*:*)
338e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-amigaos
33944d7874bSmrg	exit ;;
34044d7874bSmrg    *:[Mm]orph[Oo][Ss]:*:*)
341e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-morphos
34244d7874bSmrg	exit ;;
34344d7874bSmrg    *:OS/390:*:*)
34444d7874bSmrg	echo i370-ibm-openedition
34544d7874bSmrg	exit ;;
34644d7874bSmrg    *:z/VM:*:*)
34744d7874bSmrg	echo s390-ibm-zvmoe
34844d7874bSmrg	exit ;;
34944d7874bSmrg    *:OS400:*:*)
350caec6540Smrg	echo powerpc-ibm-os400
35144d7874bSmrg	exit ;;
35244d7874bSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
353e9feffd0Smrg	echo arm-acorn-riscix"$UNAME_RELEASE"
35444d7874bSmrg	exit ;;
355e9feffd0Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
35644d7874bSmrg	echo arm-unknown-riscos
35744d7874bSmrg	exit ;;
35844d7874bSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
35944d7874bSmrg	echo hppa1.1-hitachi-hiuxmpp
36044d7874bSmrg	exit ;;
36144d7874bSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
36244d7874bSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
36344d7874bSmrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
36444d7874bSmrg		echo pyramid-pyramid-sysv3
36544d7874bSmrg	else
36644d7874bSmrg		echo pyramid-pyramid-bsd
36744d7874bSmrg	fi
36844d7874bSmrg	exit ;;
36944d7874bSmrg    NILE*:*:*:dcosx)
37044d7874bSmrg	echo pyramid-pyramid-svr4
37144d7874bSmrg	exit ;;
37244d7874bSmrg    DRS?6000:unix:4.0:6*)
37344d7874bSmrg	echo sparc-icl-nx6
37444d7874bSmrg	exit ;;
37544d7874bSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
37644d7874bSmrg	case `/usr/bin/uname -p` in
37744d7874bSmrg	    sparc) echo sparc-icl-nx7; exit ;;
37844d7874bSmrg	esac ;;
3792d861bc5Smrg    s390x:SunOS:*:*)
380e9feffd0Smrg	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
3812d861bc5Smrg	exit ;;
38244d7874bSmrg    sun4H:SunOS:5.*:*)
383e9feffd0Smrg	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
38444d7874bSmrg	exit ;;
38544d7874bSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
386e9feffd0Smrg	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
38744d7874bSmrg	exit ;;
3882d861bc5Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
389e9feffd0Smrg	echo i386-pc-auroraux"$UNAME_RELEASE"
3902d861bc5Smrg	exit ;;
3912d861bc5Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
392e9feffd0Smrg	eval "$set_cc_for_build"
393e9feffd0Smrg	SUN_ARCH=i386
3942d861bc5Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
3952d861bc5Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
3962d861bc5Smrg	# This test works for both compilers.
397e9feffd0Smrg	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
3982d861bc5Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
399e9feffd0Smrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
4002d861bc5Smrg		grep IS_64BIT_ARCH >/dev/null
4012d861bc5Smrg	    then
402e9feffd0Smrg		SUN_ARCH=x86_64
4032d861bc5Smrg	    fi
4042d861bc5Smrg	fi
405e9feffd0Smrg	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
40644d7874bSmrg	exit ;;
40744d7874bSmrg    sun4*:SunOS:6*:*)
40844d7874bSmrg	# According to config.sub, this is the proper way to canonicalize
40944d7874bSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
41044d7874bSmrg	# it's likely to be more like Solaris than SunOS4.
411e9feffd0Smrg	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
41244d7874bSmrg	exit ;;
41344d7874bSmrg    sun4*:SunOS:*:*)
41444d7874bSmrg	case "`/usr/bin/arch -k`" in
41544d7874bSmrg	    Series*|S4*)
41644d7874bSmrg		UNAME_RELEASE=`uname -v`
41744d7874bSmrg		;;
41844d7874bSmrg	esac
41944d7874bSmrg	# Japanese Language versions have a version number like `4.1.3-JL'.
420e9feffd0Smrg	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
42144d7874bSmrg	exit ;;
42244d7874bSmrg    sun3*:SunOS:*:*)
423e9feffd0Smrg	echo m68k-sun-sunos"$UNAME_RELEASE"
42444d7874bSmrg	exit ;;
42544d7874bSmrg    sun*:*:4.2BSD:*)
42644d7874bSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
427e9feffd0Smrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
42844d7874bSmrg	case "`/bin/arch`" in
42944d7874bSmrg	    sun3)
430e9feffd0Smrg		echo m68k-sun-sunos"$UNAME_RELEASE"
43144d7874bSmrg		;;
43244d7874bSmrg	    sun4)
433e9feffd0Smrg		echo sparc-sun-sunos"$UNAME_RELEASE"
43444d7874bSmrg		;;
43544d7874bSmrg	esac
43644d7874bSmrg	exit ;;
43744d7874bSmrg    aushp:SunOS:*:*)
438e9feffd0Smrg	echo sparc-auspex-sunos"$UNAME_RELEASE"
43944d7874bSmrg	exit ;;
44044d7874bSmrg    # The situation for MiNT is a little confusing.  The machine name
44144d7874bSmrg    # can be virtually everything (everything which is not
44244d7874bSmrg    # "atarist" or "atariste" at least should have a processor
44344d7874bSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
44444d7874bSmrg    # to the lowercase version "mint" (or "freemint").  Finally
44544d7874bSmrg    # the system name "TOS" denotes a system which is actually not
44644d7874bSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
44744d7874bSmrg    # be no problem.
44844d7874bSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
449e9feffd0Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
45044d7874bSmrg	exit ;;
45144d7874bSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
452e9feffd0Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
453caec6540Smrg	exit ;;
45444d7874bSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
455e9feffd0Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
45644d7874bSmrg	exit ;;
45744d7874bSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
458e9feffd0Smrg	echo m68k-milan-mint"$UNAME_RELEASE"
459caec6540Smrg	exit ;;
46044d7874bSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
461e9feffd0Smrg	echo m68k-hades-mint"$UNAME_RELEASE"
462caec6540Smrg	exit ;;
46344d7874bSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
464e9feffd0Smrg	echo m68k-unknown-mint"$UNAME_RELEASE"
465caec6540Smrg	exit ;;
46644d7874bSmrg    m68k:machten:*:*)
467e9feffd0Smrg	echo m68k-apple-machten"$UNAME_RELEASE"
46844d7874bSmrg	exit ;;
46944d7874bSmrg    powerpc:machten:*:*)
470e9feffd0Smrg	echo powerpc-apple-machten"$UNAME_RELEASE"
47144d7874bSmrg	exit ;;
47244d7874bSmrg    RISC*:Mach:*:*)
47344d7874bSmrg	echo mips-dec-mach_bsd4.3
47444d7874bSmrg	exit ;;
47544d7874bSmrg    RISC*:ULTRIX:*:*)
476e9feffd0Smrg	echo mips-dec-ultrix"$UNAME_RELEASE"
47744d7874bSmrg	exit ;;
47844d7874bSmrg    VAX*:ULTRIX*:*:*)
479e9feffd0Smrg	echo vax-dec-ultrix"$UNAME_RELEASE"
48044d7874bSmrg	exit ;;
48144d7874bSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
482e9feffd0Smrg	echo clipper-intergraph-clix"$UNAME_RELEASE"
48344d7874bSmrg	exit ;;
48444d7874bSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
485e9feffd0Smrg	eval "$set_cc_for_build"
486e9feffd0Smrg	sed 's/^	//' << EOF > "$dummy.c"
48744d7874bSmrg#ifdef __cplusplus
48844d7874bSmrg#include <stdio.h>  /* for printf() prototype */
48944d7874bSmrg	int main (int argc, char *argv[]) {
49044d7874bSmrg#else
49144d7874bSmrg	int main (argc, argv) int argc; char *argv[]; {
49244d7874bSmrg#endif
49344d7874bSmrg	#if defined (host_mips) && defined (MIPSEB)
49444d7874bSmrg	#if defined (SYSTYPE_SYSV)
495e9feffd0Smrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
49644d7874bSmrg	#endif
49744d7874bSmrg	#if defined (SYSTYPE_SVR4)
498e9feffd0Smrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
49944d7874bSmrg	#endif
50044d7874bSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
501e9feffd0Smrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
50244d7874bSmrg	#endif
50344d7874bSmrg	#endif
50444d7874bSmrg	  exit (-1);
50544d7874bSmrg	}
50644d7874bSmrgEOF
507e9feffd0Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
508e9feffd0Smrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
509e9feffd0Smrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
51044d7874bSmrg	    { echo "$SYSTEM_NAME"; exit; }
511e9feffd0Smrg	echo mips-mips-riscos"$UNAME_RELEASE"
51244d7874bSmrg	exit ;;
51344d7874bSmrg    Motorola:PowerMAX_OS:*:*)
51444d7874bSmrg	echo powerpc-motorola-powermax
51544d7874bSmrg	exit ;;
51644d7874bSmrg    Motorola:*:4.3:PL8-*)
51744d7874bSmrg	echo powerpc-harris-powermax
51844d7874bSmrg	exit ;;
51944d7874bSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
52044d7874bSmrg	echo powerpc-harris-powermax
52144d7874bSmrg	exit ;;
52244d7874bSmrg    Night_Hawk:Power_UNIX:*:*)
52344d7874bSmrg	echo powerpc-harris-powerunix
52444d7874bSmrg	exit ;;
52544d7874bSmrg    m88k:CX/UX:7*:*)
52644d7874bSmrg	echo m88k-harris-cxux7
52744d7874bSmrg	exit ;;
52844d7874bSmrg    m88k:*:4*:R4*)
52944d7874bSmrg	echo m88k-motorola-sysv4
53044d7874bSmrg	exit ;;
53144d7874bSmrg    m88k:*:3*:R3*)
53244d7874bSmrg	echo m88k-motorola-sysv3
53344d7874bSmrg	exit ;;
53444d7874bSmrg    AViiON:dgux:*:*)
535caec6540Smrg	# DG/UX returns AViiON for all architectures
536caec6540Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
537e9feffd0Smrg	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
53844d7874bSmrg	then
539e9feffd0Smrg	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
540e9feffd0Smrg	       [ "$TARGET_BINARY_INTERFACE"x = x ]
54144d7874bSmrg	    then
542e9feffd0Smrg		echo m88k-dg-dgux"$UNAME_RELEASE"
54344d7874bSmrg	    else
544e9feffd0Smrg		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
54544d7874bSmrg	    fi
54644d7874bSmrg	else
547e9feffd0Smrg	    echo i586-dg-dgux"$UNAME_RELEASE"
54844d7874bSmrg	fi
549caec6540Smrg	exit ;;
55044d7874bSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
55144d7874bSmrg	echo m88k-dolphin-sysv3
55244d7874bSmrg	exit ;;
55344d7874bSmrg    M88*:*:R3*:*)
55444d7874bSmrg	# Delta 88k system running SVR3
55544d7874bSmrg	echo m88k-motorola-sysv3
55644d7874bSmrg	exit ;;
55744d7874bSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
55844d7874bSmrg	echo m88k-tektronix-sysv3
55944d7874bSmrg	exit ;;
56044d7874bSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
56144d7874bSmrg	echo m68k-tektronix-bsd
56244d7874bSmrg	exit ;;
56344d7874bSmrg    *:IRIX*:*:*)
564e9feffd0Smrg	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
56544d7874bSmrg	exit ;;
56644d7874bSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
56744d7874bSmrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
56844d7874bSmrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
56944d7874bSmrg    i*86:AIX:*:*)
57044d7874bSmrg	echo i386-ibm-aix
57144d7874bSmrg	exit ;;
57244d7874bSmrg    ia64:AIX:*:*)
57344d7874bSmrg	if [ -x /usr/bin/oslevel ] ; then
57444d7874bSmrg		IBM_REV=`/usr/bin/oslevel`
57544d7874bSmrg	else
576e9feffd0Smrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
57744d7874bSmrg	fi
578e9feffd0Smrg	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
57944d7874bSmrg	exit ;;
58044d7874bSmrg    *:AIX:2:3)
58144d7874bSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
582e9feffd0Smrg		eval "$set_cc_for_build"
583e9feffd0Smrg		sed 's/^		//' << EOF > "$dummy.c"
58444d7874bSmrg		#include <sys/systemcfg.h>
58544d7874bSmrg
58644d7874bSmrg		main()
58744d7874bSmrg			{
58844d7874bSmrg			if (!__power_pc())
58944d7874bSmrg				exit(1);
59044d7874bSmrg			puts("powerpc-ibm-aix3.2.5");
59144d7874bSmrg			exit(0);
59244d7874bSmrg			}
59344d7874bSmrgEOF
594e9feffd0Smrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
59544d7874bSmrg		then
59644d7874bSmrg			echo "$SYSTEM_NAME"
59744d7874bSmrg		else
59844d7874bSmrg			echo rs6000-ibm-aix3.2.5
59944d7874bSmrg		fi
60044d7874bSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
60144d7874bSmrg		echo rs6000-ibm-aix3.2.4
60244d7874bSmrg	else
60344d7874bSmrg		echo rs6000-ibm-aix3.2
60444d7874bSmrg	fi
60544d7874bSmrg	exit ;;
6062d861bc5Smrg    *:AIX:*:[4567])
60744d7874bSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
608e9feffd0Smrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
60944d7874bSmrg		IBM_ARCH=rs6000
61044d7874bSmrg	else
61144d7874bSmrg		IBM_ARCH=powerpc
61244d7874bSmrg	fi
613e9feffd0Smrg	if [ -x /usr/bin/lslpp ] ; then
614e9feffd0Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
615e9feffd0Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
61644d7874bSmrg	else
617e9feffd0Smrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
61844d7874bSmrg	fi
619e9feffd0Smrg	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
62044d7874bSmrg	exit ;;
62144d7874bSmrg    *:AIX:*:*)
62244d7874bSmrg	echo rs6000-ibm-aix
62344d7874bSmrg	exit ;;
624e9feffd0Smrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
62544d7874bSmrg	echo romp-ibm-bsd4.4
62644d7874bSmrg	exit ;;
62744d7874bSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
628e9feffd0Smrg	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
62944d7874bSmrg	exit ;;                             # report: romp-ibm BSD 4.3
63044d7874bSmrg    *:BOSX:*:*)
63144d7874bSmrg	echo rs6000-bull-bosx
63244d7874bSmrg	exit ;;
63344d7874bSmrg    DPX/2?00:B.O.S.:*:*)
63444d7874bSmrg	echo m68k-bull-sysv3
63544d7874bSmrg	exit ;;
63644d7874bSmrg    9000/[34]??:4.3bsd:1.*:*)
63744d7874bSmrg	echo m68k-hp-bsd
63844d7874bSmrg	exit ;;
63944d7874bSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
64044d7874bSmrg	echo m68k-hp-bsd4.4
64144d7874bSmrg	exit ;;
64244d7874bSmrg    9000/[34678]??:HP-UX:*:*)
643e9feffd0Smrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
644e9feffd0Smrg	case "$UNAME_MACHINE" in
645e9feffd0Smrg	    9000/31?)            HP_ARCH=m68000 ;;
646e9feffd0Smrg	    9000/[34]??)         HP_ARCH=m68k ;;
64744d7874bSmrg	    9000/[678][0-9][0-9])
64844d7874bSmrg		if [ -x /usr/bin/getconf ]; then
64944d7874bSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
650caec6540Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
651e9feffd0Smrg		    case "$sc_cpu_version" in
652e9feffd0Smrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
653e9feffd0Smrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
654caec6540Smrg		      532)                      # CPU_PA_RISC2_0
655e9feffd0Smrg			case "$sc_kernel_bits" in
656e9feffd0Smrg			  32) HP_ARCH=hppa2.0n ;;
657e9feffd0Smrg			  64) HP_ARCH=hppa2.0w ;;
658e9feffd0Smrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
659caec6540Smrg			esac ;;
660caec6540Smrg		    esac
66144d7874bSmrg		fi
662e9feffd0Smrg		if [ "$HP_ARCH" = "" ]; then
663e9feffd0Smrg		    eval "$set_cc_for_build"
664e9feffd0Smrg		    sed 's/^		//' << EOF > "$dummy.c"
66544d7874bSmrg
666caec6540Smrg		#define _HPUX_SOURCE
667caec6540Smrg		#include <stdlib.h>
668caec6540Smrg		#include <unistd.h>
66944d7874bSmrg
670caec6540Smrg		int main ()
671caec6540Smrg		{
672caec6540Smrg		#if defined(_SC_KERNEL_BITS)
673caec6540Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
674caec6540Smrg		#endif
675caec6540Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
67644d7874bSmrg
677caec6540Smrg		    switch (cpu)
678caec6540Smrg			{
679caec6540Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
680caec6540Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
681caec6540Smrg			case CPU_PA_RISC2_0:
682caec6540Smrg		#if defined(_SC_KERNEL_BITS)
683caec6540Smrg			    switch (bits)
684caec6540Smrg				{
685caec6540Smrg				case 64: puts ("hppa2.0w"); break;
686caec6540Smrg				case 32: puts ("hppa2.0n"); break;
687caec6540Smrg				default: puts ("hppa2.0"); break;
688caec6540Smrg				} break;
689caec6540Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
690caec6540Smrg			    puts ("hppa2.0"); break;
691caec6540Smrg		#endif
692caec6540Smrg			default: puts ("hppa1.0"); break;
693caec6540Smrg			}
694caec6540Smrg		    exit (0);
695caec6540Smrg		}
69644d7874bSmrgEOF
697e9feffd0Smrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
69844d7874bSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
69944d7874bSmrg		fi ;;
70044d7874bSmrg	esac
701e9feffd0Smrg	if [ "$HP_ARCH" = hppa2.0w ]
70244d7874bSmrg	then
703e9feffd0Smrg	    eval "$set_cc_for_build"
70444d7874bSmrg
70544d7874bSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
70644d7874bSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
70744d7874bSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
70844d7874bSmrg	    #
70944d7874bSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
71044d7874bSmrg	    # => hppa2.0w-hp-hpux11.23
71144d7874bSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
71244d7874bSmrg	    # => hppa64-hp-hpux11.23
71344d7874bSmrg
714e9feffd0Smrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
7152d861bc5Smrg		grep -q __LP64__
71644d7874bSmrg	    then
717e9feffd0Smrg		HP_ARCH=hppa2.0w
71844d7874bSmrg	    else
719e9feffd0Smrg		HP_ARCH=hppa64
72044d7874bSmrg	    fi
72144d7874bSmrg	fi
722e9feffd0Smrg	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
72344d7874bSmrg	exit ;;
72444d7874bSmrg    ia64:HP-UX:*:*)
725e9feffd0Smrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
726e9feffd0Smrg	echo ia64-hp-hpux"$HPUX_REV"
72744d7874bSmrg	exit ;;
72844d7874bSmrg    3050*:HI-UX:*:*)
729e9feffd0Smrg	eval "$set_cc_for_build"
730e9feffd0Smrg	sed 's/^	//' << EOF > "$dummy.c"
73144d7874bSmrg	#include <unistd.h>
73244d7874bSmrg	int
73344d7874bSmrg	main ()
73444d7874bSmrg	{
73544d7874bSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
73644d7874bSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
73744d7874bSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
73844d7874bSmrg	     results, however.  */
73944d7874bSmrg	  if (CPU_IS_PA_RISC (cpu))
74044d7874bSmrg	    {
74144d7874bSmrg	      switch (cpu)
74244d7874bSmrg		{
74344d7874bSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
74444d7874bSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
74544d7874bSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
74644d7874bSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
74744d7874bSmrg		}
74844d7874bSmrg	    }
74944d7874bSmrg	  else if (CPU_IS_HP_MC68K (cpu))
75044d7874bSmrg	    puts ("m68k-hitachi-hiuxwe2");
75144d7874bSmrg	  else puts ("unknown-hitachi-hiuxwe2");
75244d7874bSmrg	  exit (0);
75344d7874bSmrg	}
75444d7874bSmrgEOF
755e9feffd0Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
75644d7874bSmrg		{ echo "$SYSTEM_NAME"; exit; }
75744d7874bSmrg	echo unknown-hitachi-hiuxwe2
75844d7874bSmrg	exit ;;
759e9feffd0Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
76044d7874bSmrg	echo hppa1.1-hp-bsd
76144d7874bSmrg	exit ;;
76244d7874bSmrg    9000/8??:4.3bsd:*:*)
76344d7874bSmrg	echo hppa1.0-hp-bsd
76444d7874bSmrg	exit ;;
76544d7874bSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
76644d7874bSmrg	echo hppa1.0-hp-mpeix
76744d7874bSmrg	exit ;;
768e9feffd0Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
76944d7874bSmrg	echo hppa1.1-hp-osf
77044d7874bSmrg	exit ;;
77144d7874bSmrg    hp8??:OSF1:*:*)
77244d7874bSmrg	echo hppa1.0-hp-osf
77344d7874bSmrg	exit ;;
77444d7874bSmrg    i*86:OSF1:*:*)
77544d7874bSmrg	if [ -x /usr/sbin/sysversion ] ; then
776e9feffd0Smrg	    echo "$UNAME_MACHINE"-unknown-osf1mk
77744d7874bSmrg	else
778e9feffd0Smrg	    echo "$UNAME_MACHINE"-unknown-osf1
77944d7874bSmrg	fi
78044d7874bSmrg	exit ;;
78144d7874bSmrg    parisc*:Lites*:*:*)
78244d7874bSmrg	echo hppa1.1-hp-lites
78344d7874bSmrg	exit ;;
78444d7874bSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
78544d7874bSmrg	echo c1-convex-bsd
786caec6540Smrg	exit ;;
78744d7874bSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
78844d7874bSmrg	if getsysinfo -f scalar_acc
78944d7874bSmrg	then echo c32-convex-bsd
79044d7874bSmrg	else echo c2-convex-bsd
79144d7874bSmrg	fi
792caec6540Smrg	exit ;;
79344d7874bSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
79444d7874bSmrg	echo c34-convex-bsd
795caec6540Smrg	exit ;;
79644d7874bSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
79744d7874bSmrg	echo c38-convex-bsd
798caec6540Smrg	exit ;;
79944d7874bSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
80044d7874bSmrg	echo c4-convex-bsd
801caec6540Smrg	exit ;;
80244d7874bSmrg    CRAY*Y-MP:*:*:*)
803e9feffd0Smrg	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
80444d7874bSmrg	exit ;;
80544d7874bSmrg    CRAY*[A-Z]90:*:*:*)
806e9feffd0Smrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
80744d7874bSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
80844d7874bSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
80944d7874bSmrg	      -e 's/\.[^.]*$/.X/'
81044d7874bSmrg	exit ;;
81144d7874bSmrg    CRAY*TS:*:*:*)
812e9feffd0Smrg	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
81344d7874bSmrg	exit ;;
81444d7874bSmrg    CRAY*T3E:*:*:*)
815e9feffd0Smrg	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
81644d7874bSmrg	exit ;;
81744d7874bSmrg    CRAY*SV1:*:*:*)
818e9feffd0Smrg	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
81944d7874bSmrg	exit ;;
82044d7874bSmrg    *:UNICOS/mp:*:*)
821e9feffd0Smrg	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
82244d7874bSmrg	exit ;;
82344d7874bSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
824e9feffd0Smrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
825e9feffd0Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
826e9feffd0Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
827caec6540Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
828caec6540Smrg	exit ;;
82944d7874bSmrg    5000:UNIX_System_V:4.*:*)
830e9feffd0Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
831e9feffd0Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
832caec6540Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
83344d7874bSmrg	exit ;;
83444d7874bSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
835e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
83644d7874bSmrg	exit ;;
83744d7874bSmrg    sparc*:BSD/OS:*:*)
838e9feffd0Smrg	echo sparc-unknown-bsdi"$UNAME_RELEASE"
83944d7874bSmrg	exit ;;
84044d7874bSmrg    *:BSD/OS:*:*)
841e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
84244d7874bSmrg	exit ;;
84344d7874bSmrg    *:FreeBSD:*:*)
844caec6540Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
845e9feffd0Smrg	case "$UNAME_PROCESSOR" in
8462d861bc5Smrg	    amd64)
847e9feffd0Smrg		UNAME_PROCESSOR=x86_64 ;;
848e9feffd0Smrg	    i386)
849e9feffd0Smrg		UNAME_PROCESSOR=i586 ;;
8502d861bc5Smrg	esac
851e9feffd0Smrg	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
85244d7874bSmrg	exit ;;
85344d7874bSmrg    i*:CYGWIN*:*)
854e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-cygwin
85544d7874bSmrg	exit ;;
856e9feffd0Smrg    *:MINGW64*:*)
857e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-mingw64
85844d7874bSmrg	exit ;;
859e9feffd0Smrg    *:MINGW*:*)
860e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-mingw32
861caec6540Smrg	exit ;;
862e9feffd0Smrg    *:MSYS*:*)
863e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-msys
86444d7874bSmrg	exit ;;
86544d7874bSmrg    i*:PW*:*)
866e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-pw32
86744d7874bSmrg	exit ;;
8682d861bc5Smrg    *:Interix*:*)
869e9feffd0Smrg	case "$UNAME_MACHINE" in
8702d861bc5Smrg	    x86)
871e9feffd0Smrg		echo i586-pc-interix"$UNAME_RELEASE"
8722d861bc5Smrg		exit ;;
8732d861bc5Smrg	    authenticamd | genuineintel | EM64T)
874e9feffd0Smrg		echo x86_64-unknown-interix"$UNAME_RELEASE"
8752d861bc5Smrg		exit ;;
8762d861bc5Smrg	    IA64)
877e9feffd0Smrg		echo ia64-unknown-interix"$UNAME_RELEASE"
8782d861bc5Smrg		exit ;;
8792d861bc5Smrg	esac ;;
88044d7874bSmrg    i*:UWIN*:*)
881e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-uwin
88244d7874bSmrg	exit ;;
8832d861bc5Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
88444d7874bSmrg	echo x86_64-unknown-cygwin
88544d7874bSmrg	exit ;;
88644d7874bSmrg    prep*:SunOS:5.*:*)
887e9feffd0Smrg	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
88844d7874bSmrg	exit ;;
88944d7874bSmrg    *:GNU:*:*)
89044d7874bSmrg	# the GNU system
891e9feffd0Smrg	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
89244d7874bSmrg	exit ;;
89344d7874bSmrg    *:GNU/*:*:*)
89444d7874bSmrg	# other systems with GNU libc and userland
895e9feffd0Smrg	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
89644d7874bSmrg	exit ;;
89744d7874bSmrg    i*86:Minix:*:*)
898e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-minix
899e9feffd0Smrg	exit ;;
900e9feffd0Smrg    aarch64:Linux:*:*)
901e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
902e9feffd0Smrg	exit ;;
903e9feffd0Smrg    aarch64_be:Linux:*:*)
904e9feffd0Smrg	UNAME_MACHINE=aarch64_be
905e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
90644d7874bSmrg	exit ;;
9072d861bc5Smrg    alpha:Linux:*:*)
9082d861bc5Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
9092d861bc5Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
9102d861bc5Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
9112d861bc5Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
9122d861bc5Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
9132d861bc5Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
9142d861bc5Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
9152d861bc5Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
916caec6540Smrg	esac
9172d861bc5Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
918e9feffd0Smrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
919e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
920e9feffd0Smrg	exit ;;
921e9feffd0Smrg    arc:Linux:*:* | arceb:Linux:*:*)
922e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9232d861bc5Smrg	exit ;;
92444d7874bSmrg    arm*:Linux:*:*)
925e9feffd0Smrg	eval "$set_cc_for_build"
9262d861bc5Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
9272d861bc5Smrg	    | grep -q __ARM_EABI__
9282d861bc5Smrg	then
929e9feffd0Smrg	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9302d861bc5Smrg	else
931caec6540Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
932caec6540Smrg		| grep -q __ARM_PCS_VFP
933caec6540Smrg	    then
934e9feffd0Smrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
935caec6540Smrg	    else
936e9feffd0Smrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
937caec6540Smrg	    fi
9382d861bc5Smrg	fi
9392d861bc5Smrg	exit ;;
9402d861bc5Smrg    avr32*:Linux:*:*)
941e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
94244d7874bSmrg	exit ;;
94344d7874bSmrg    cris:Linux:*:*)
944e9feffd0Smrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
94544d7874bSmrg	exit ;;
94644d7874bSmrg    crisv32:Linux:*:*)
947e9feffd0Smrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
948e9feffd0Smrg	exit ;;
949e9feffd0Smrg    e2k:Linux:*:*)
950e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
95144d7874bSmrg	exit ;;
95244d7874bSmrg    frv:Linux:*:*)
953e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
954caec6540Smrg	exit ;;
955caec6540Smrg    hexagon:Linux:*:*)
956e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
95744d7874bSmrg	exit ;;
9582d861bc5Smrg    i*86:Linux:*:*)
959e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
9602d861bc5Smrg	exit ;;
96144d7874bSmrg    ia64:Linux:*:*)
962e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
963e9feffd0Smrg	exit ;;
964e9feffd0Smrg    k1om:Linux:*:*)
965e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
96644d7874bSmrg	exit ;;
96744d7874bSmrg    m32r*:Linux:*:*)
968e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
96944d7874bSmrg	exit ;;
97044d7874bSmrg    m68*:Linux:*:*)
971e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
97244d7874bSmrg	exit ;;
9732d861bc5Smrg    mips:Linux:*:* | mips64:Linux:*:*)
974e9feffd0Smrg	eval "$set_cc_for_build"
975e9feffd0Smrg	sed 's/^	//' << EOF > "$dummy.c"
97644d7874bSmrg	#undef CPU
9772d861bc5Smrg	#undef ${UNAME_MACHINE}
9782d861bc5Smrg	#undef ${UNAME_MACHINE}el
97944d7874bSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
9802d861bc5Smrg	CPU=${UNAME_MACHINE}el
98144d7874bSmrg	#else
98244d7874bSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9832d861bc5Smrg	CPU=${UNAME_MACHINE}
98444d7874bSmrg	#else
98544d7874bSmrg	CPU=
98644d7874bSmrg	#endif
98744d7874bSmrg	#endif
98844d7874bSmrgEOF
989e9feffd0Smrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
990e9feffd0Smrg	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
99144d7874bSmrg	;;
992e9feffd0Smrg    mips64el:Linux:*:*)
993e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
994e9feffd0Smrg	exit ;;
995e9feffd0Smrg    openrisc*:Linux:*:*)
996e9feffd0Smrg	echo or1k-unknown-linux-"$LIBC"
997e9feffd0Smrg	exit ;;
998e9feffd0Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
999e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
100044d7874bSmrg	exit ;;
10012d861bc5Smrg    padre:Linux:*:*)
1002e9feffd0Smrg	echo sparc-unknown-linux-"$LIBC"
100344d7874bSmrg	exit ;;
10042d861bc5Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
1005e9feffd0Smrg	echo hppa64-unknown-linux-"$LIBC"
100644d7874bSmrg	exit ;;
100744d7874bSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
100844d7874bSmrg	# Look for CPU level
100944d7874bSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1010e9feffd0Smrg	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1011e9feffd0Smrg	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1012e9feffd0Smrg	  *)    echo hppa-unknown-linux-"$LIBC" ;;
101344d7874bSmrg	esac
101444d7874bSmrg	exit ;;
10152d861bc5Smrg    ppc64:Linux:*:*)
1016e9feffd0Smrg	echo powerpc64-unknown-linux-"$LIBC"
10172d861bc5Smrg	exit ;;
10182d861bc5Smrg    ppc:Linux:*:*)
1019e9feffd0Smrg	echo powerpc-unknown-linux-"$LIBC"
1020e9feffd0Smrg	exit ;;
1021e9feffd0Smrg    ppc64le:Linux:*:*)
1022e9feffd0Smrg	echo powerpc64le-unknown-linux-"$LIBC"
1023e9feffd0Smrg	exit ;;
1024e9feffd0Smrg    ppcle:Linux:*:*)
1025e9feffd0Smrg	echo powerpcle-unknown-linux-"$LIBC"
1026e9feffd0Smrg	exit ;;
1027e9feffd0Smrg    riscv32:Linux:*:* | riscv64:Linux:*:*)
1028e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
102944d7874bSmrg	exit ;;
103044d7874bSmrg    s390:Linux:*:* | s390x:Linux:*:*)
1031e9feffd0Smrg	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
103244d7874bSmrg	exit ;;
103344d7874bSmrg    sh64*:Linux:*:*)
1034e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
103544d7874bSmrg	exit ;;
103644d7874bSmrg    sh*:Linux:*:*)
1037e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
103844d7874bSmrg	exit ;;
103944d7874bSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
1040e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
104144d7874bSmrg	exit ;;
10422d861bc5Smrg    tile*:Linux:*:*)
1043e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10442d861bc5Smrg	exit ;;
10452d861bc5Smrg    vax:Linux:*:*)
1046e9feffd0Smrg	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
10472d861bc5Smrg	exit ;;
104844d7874bSmrg    x86_64:Linux:*:*)
1049e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
105044d7874bSmrg	exit ;;
10512d861bc5Smrg    xtensa*:Linux:*:*)
1052e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10532d861bc5Smrg	exit ;;
105444d7874bSmrg    i*86:DYNIX/ptx:4*:*)
105544d7874bSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
105644d7874bSmrg	# earlier versions are messed up and put the nodename in both
105744d7874bSmrg	# sysname and nodename.
105844d7874bSmrg	echo i386-sequent-sysv4
105944d7874bSmrg	exit ;;
106044d7874bSmrg    i*86:UNIX_SV:4.2MP:2.*)
1061caec6540Smrg	# Unixware is an offshoot of SVR4, but it has its own version
1062caec6540Smrg	# number series starting with 2...
1063caec6540Smrg	# I am not positive that other SVR4 systems won't match this,
106444d7874bSmrg	# I just have to hope.  -- rms.
1065caec6540Smrg	# Use sysv4.2uw... so that sysv4* matches it.
1066e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
106744d7874bSmrg	exit ;;
106844d7874bSmrg    i*86:OS/2:*:*)
106944d7874bSmrg	# If we were able to find `uname', then EMX Unix compatibility
107044d7874bSmrg	# is probably installed.
1071e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-os2-emx
107244d7874bSmrg	exit ;;
107344d7874bSmrg    i*86:XTS-300:*:STOP)
1074e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-stop
107544d7874bSmrg	exit ;;
107644d7874bSmrg    i*86:atheos:*:*)
1077e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-atheos
107844d7874bSmrg	exit ;;
107944d7874bSmrg    i*86:syllable:*:*)
1080e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-syllable
108144d7874bSmrg	exit ;;
10822d861bc5Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1083e9feffd0Smrg	echo i386-unknown-lynxos"$UNAME_RELEASE"
108444d7874bSmrg	exit ;;
108544d7874bSmrg    i*86:*DOS:*:*)
1086e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-msdosdjgpp
108744d7874bSmrg	exit ;;
1088e9feffd0Smrg    i*86:*:4.*:*)
1089e9feffd0Smrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
109044d7874bSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1091e9feffd0Smrg		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
109244d7874bSmrg	else
1093e9feffd0Smrg		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
109444d7874bSmrg	fi
109544d7874bSmrg	exit ;;
109644d7874bSmrg    i*86:*:5:[678]*)
1097caec6540Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
109844d7874bSmrg	case `/bin/uname -X | grep "^Machine"` in
109944d7874bSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
110044d7874bSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
110144d7874bSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
110244d7874bSmrg	esac
1103e9feffd0Smrg	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
110444d7874bSmrg	exit ;;
110544d7874bSmrg    i*86:*:3.2:*)
110644d7874bSmrg	if test -f /usr/options/cb.name; then
110744d7874bSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1108e9feffd0Smrg		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
110944d7874bSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
111044d7874bSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
111144d7874bSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
111244d7874bSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
111344d7874bSmrg			&& UNAME_MACHINE=i586
111444d7874bSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
111544d7874bSmrg			&& UNAME_MACHINE=i686
111644d7874bSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
111744d7874bSmrg			&& UNAME_MACHINE=i686
1118e9feffd0Smrg		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
111944d7874bSmrg	else
1120e9feffd0Smrg		echo "$UNAME_MACHINE"-pc-sysv32
112144d7874bSmrg	fi
112244d7874bSmrg	exit ;;
112344d7874bSmrg    pc:*:*:*)
112444d7874bSmrg	# Left here for compatibility:
1125caec6540Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1126caec6540Smrg	# the processor, so we play safe by assuming i586.
11272d861bc5Smrg	# Note: whatever this is, it MUST be the same as what config.sub
1128e9feffd0Smrg	# prints for the "djgpp" host, or else GDB configure will decide that
11292d861bc5Smrg	# this is a cross-build.
11302d861bc5Smrg	echo i586-pc-msdosdjgpp
1131caec6540Smrg	exit ;;
113244d7874bSmrg    Intel:Mach:3*:*)
113344d7874bSmrg	echo i386-pc-mach3
113444d7874bSmrg	exit ;;
113544d7874bSmrg    paragon:*:*:*)
113644d7874bSmrg	echo i860-intel-osf1
113744d7874bSmrg	exit ;;
113844d7874bSmrg    i860:*:4.*:*) # i860-SVR4
113944d7874bSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1140e9feffd0Smrg	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
114144d7874bSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
1142e9feffd0Smrg	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
114344d7874bSmrg	fi
114444d7874bSmrg	exit ;;
114544d7874bSmrg    mini*:CTIX:SYS*5:*)
114644d7874bSmrg	# "miniframe"
114744d7874bSmrg	echo m68010-convergent-sysv
114844d7874bSmrg	exit ;;
114944d7874bSmrg    mc68k:UNIX:SYSTEM5:3.51m)
115044d7874bSmrg	echo m68k-convergent-sysv
115144d7874bSmrg	exit ;;
115244d7874bSmrg    M680?0:D-NIX:5.3:*)
115344d7874bSmrg	echo m68k-diab-dnix
115444d7874bSmrg	exit ;;
115544d7874bSmrg    M68*:*:R3V[5678]*:*)
115644d7874bSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
115744d7874bSmrg    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)
115844d7874bSmrg	OS_REL=''
115944d7874bSmrg	test -r /etc/.relid \
116044d7874bSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
116144d7874bSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1162e9feffd0Smrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
116344d7874bSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1164e9feffd0Smrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
116544d7874bSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1166caec6540Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1167caec6540Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
11682d861bc5Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
11692d861bc5Smrg	OS_REL='.3'
11702d861bc5Smrg	test -r /etc/.relid \
11712d861bc5Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11722d861bc5Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1173e9feffd0Smrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11742d861bc5Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1175e9feffd0Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
11762d861bc5Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1177e9feffd0Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
117844d7874bSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1179e9feffd0Smrg	echo m68k-unknown-lynxos"$UNAME_RELEASE"
118044d7874bSmrg	exit ;;
118144d7874bSmrg    mc68030:UNIX_System_V:4.*:*)
118244d7874bSmrg	echo m68k-atari-sysv4
118344d7874bSmrg	exit ;;
118444d7874bSmrg    TSUNAMI:LynxOS:2.*:*)
1185e9feffd0Smrg	echo sparc-unknown-lynxos"$UNAME_RELEASE"
118644d7874bSmrg	exit ;;
118744d7874bSmrg    rs6000:LynxOS:2.*:*)
1188e9feffd0Smrg	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
118944d7874bSmrg	exit ;;
11902d861bc5Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1191e9feffd0Smrg	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
119244d7874bSmrg	exit ;;
119344d7874bSmrg    SM[BE]S:UNIX_SV:*:*)
1194e9feffd0Smrg	echo mips-dde-sysv"$UNAME_RELEASE"
119544d7874bSmrg	exit ;;
119644d7874bSmrg    RM*:ReliantUNIX-*:*:*)
119744d7874bSmrg	echo mips-sni-sysv4
119844d7874bSmrg	exit ;;
119944d7874bSmrg    RM*:SINIX-*:*:*)
120044d7874bSmrg	echo mips-sni-sysv4
120144d7874bSmrg	exit ;;
120244d7874bSmrg    *:SINIX-*:*:*)
120344d7874bSmrg	if uname -p 2>/dev/null >/dev/null ; then
120444d7874bSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1205e9feffd0Smrg		echo "$UNAME_MACHINE"-sni-sysv4
120644d7874bSmrg	else
120744d7874bSmrg		echo ns32k-sni-sysv
120844d7874bSmrg	fi
120944d7874bSmrg	exit ;;
1210caec6540Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1211caec6540Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
1212caec6540Smrg	echo i586-unisys-sysv4
1213caec6540Smrg	exit ;;
121444d7874bSmrg    *:UNIX_System_V:4*:FTX*)
121544d7874bSmrg	# From Gerald Hewes <hewes@openmarket.com>.
121644d7874bSmrg	# How about differentiating between stratus architectures? -djm
121744d7874bSmrg	echo hppa1.1-stratus-sysv4
121844d7874bSmrg	exit ;;
121944d7874bSmrg    *:*:*:FTX*)
122044d7874bSmrg	# From seanf@swdc.stratus.com.
122144d7874bSmrg	echo i860-stratus-sysv4
122244d7874bSmrg	exit ;;
122344d7874bSmrg    i*86:VOS:*:*)
122444d7874bSmrg	# From Paul.Green@stratus.com.
1225e9feffd0Smrg	echo "$UNAME_MACHINE"-stratus-vos
122644d7874bSmrg	exit ;;
122744d7874bSmrg    *:VOS:*:*)
122844d7874bSmrg	# From Paul.Green@stratus.com.
122944d7874bSmrg	echo hppa1.1-stratus-vos
123044d7874bSmrg	exit ;;
123144d7874bSmrg    mc68*:A/UX:*:*)
1232e9feffd0Smrg	echo m68k-apple-aux"$UNAME_RELEASE"
123344d7874bSmrg	exit ;;
123444d7874bSmrg    news*:NEWS-OS:6*:*)
123544d7874bSmrg	echo mips-sony-newsos6
123644d7874bSmrg	exit ;;
123744d7874bSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
123844d7874bSmrg	if [ -d /usr/nec ]; then
1239e9feffd0Smrg		echo mips-nec-sysv"$UNAME_RELEASE"
124044d7874bSmrg	else
1241e9feffd0Smrg		echo mips-unknown-sysv"$UNAME_RELEASE"
124244d7874bSmrg	fi
1243caec6540Smrg	exit ;;
124444d7874bSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
124544d7874bSmrg	echo powerpc-be-beos
124644d7874bSmrg	exit ;;
124744d7874bSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
124844d7874bSmrg	echo powerpc-apple-beos
124944d7874bSmrg	exit ;;
125044d7874bSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
125144d7874bSmrg	echo i586-pc-beos
125244d7874bSmrg	exit ;;
12532d861bc5Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
12542d861bc5Smrg	echo i586-pc-haiku
12552d861bc5Smrg	exit ;;
1256e9feffd0Smrg    x86_64:Haiku:*:*)
1257e9feffd0Smrg	echo x86_64-unknown-haiku
1258e9feffd0Smrg	exit ;;
125944d7874bSmrg    SX-4:SUPER-UX:*:*)
1260e9feffd0Smrg	echo sx4-nec-superux"$UNAME_RELEASE"
126144d7874bSmrg	exit ;;
126244d7874bSmrg    SX-5:SUPER-UX:*:*)
1263e9feffd0Smrg	echo sx5-nec-superux"$UNAME_RELEASE"
126444d7874bSmrg	exit ;;
126544d7874bSmrg    SX-6:SUPER-UX:*:*)
1266e9feffd0Smrg	echo sx6-nec-superux"$UNAME_RELEASE"
126744d7874bSmrg	exit ;;
12682d861bc5Smrg    SX-7:SUPER-UX:*:*)
1269e9feffd0Smrg	echo sx7-nec-superux"$UNAME_RELEASE"
12702d861bc5Smrg	exit ;;
12712d861bc5Smrg    SX-8:SUPER-UX:*:*)
1272e9feffd0Smrg	echo sx8-nec-superux"$UNAME_RELEASE"
12732d861bc5Smrg	exit ;;
12742d861bc5Smrg    SX-8R:SUPER-UX:*:*)
1275e9feffd0Smrg	echo sx8r-nec-superux"$UNAME_RELEASE"
1276e9feffd0Smrg	exit ;;
1277e9feffd0Smrg    SX-ACE:SUPER-UX:*:*)
1278e9feffd0Smrg	echo sxace-nec-superux"$UNAME_RELEASE"
12792d861bc5Smrg	exit ;;
128044d7874bSmrg    Power*:Rhapsody:*:*)
1281e9feffd0Smrg	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
128244d7874bSmrg	exit ;;
128344d7874bSmrg    *:Rhapsody:*:*)
1284e9feffd0Smrg	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
128544d7874bSmrg	exit ;;
128644d7874bSmrg    *:Darwin:*:*)
128744d7874bSmrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1288e9feffd0Smrg	eval "$set_cc_for_build"
1289e9feffd0Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
1290e9feffd0Smrg	    UNAME_PROCESSOR=powerpc
1291e9feffd0Smrg	fi
1292e9feffd0Smrg	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
1293e9feffd0Smrg	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1294e9feffd0Smrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1295e9feffd0Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1296e9feffd0Smrg		       grep IS_64BIT_ARCH >/dev/null
1297e9feffd0Smrg		then
1298e9feffd0Smrg		    case $UNAME_PROCESSOR in
1299e9feffd0Smrg			i386) UNAME_PROCESSOR=x86_64 ;;
1300e9feffd0Smrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
1301e9feffd0Smrg		    esac
1302e9feffd0Smrg		fi
1303e9feffd0Smrg		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1304e9feffd0Smrg		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1305e9feffd0Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1306e9feffd0Smrg		       grep IS_PPC >/dev/null
1307e9feffd0Smrg		then
1308e9feffd0Smrg		    UNAME_PROCESSOR=powerpc
1309e9feffd0Smrg		fi
1310e9feffd0Smrg	    fi
1311e9feffd0Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
1312e9feffd0Smrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
1313e9feffd0Smrg	    # that puts up a graphical alert prompting to install
1314e9feffd0Smrg	    # developer tools.  Any system running Mac OS X 10.7 or
1315e9feffd0Smrg	    # later (Darwin 11 and later) is required to have a 64-bit
1316e9feffd0Smrg	    # processor. This is not true of the ARM version of Darwin
1317e9feffd0Smrg	    # that Apple uses in portable devices.
1318e9feffd0Smrg	    UNAME_PROCESSOR=x86_64
1319e9feffd0Smrg	fi
1320e9feffd0Smrg	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
132144d7874bSmrg	exit ;;
132244d7874bSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
132344d7874bSmrg	UNAME_PROCESSOR=`uname -p`
1324e9feffd0Smrg	if test "$UNAME_PROCESSOR" = x86; then
132544d7874bSmrg		UNAME_PROCESSOR=i386
132644d7874bSmrg		UNAME_MACHINE=pc
132744d7874bSmrg	fi
1328e9feffd0Smrg	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
132944d7874bSmrg	exit ;;
133044d7874bSmrg    *:QNX:*:4*)
133144d7874bSmrg	echo i386-pc-qnx
133244d7874bSmrg	exit ;;
1333e9feffd0Smrg    NEO-*:NONSTOP_KERNEL:*:*)
1334e9feffd0Smrg	echo neo-tandem-nsk"$UNAME_RELEASE"
1335e9feffd0Smrg	exit ;;
1336e9feffd0Smrg    NSE-*:NONSTOP_KERNEL:*:*)
1337e9feffd0Smrg	echo nse-tandem-nsk"$UNAME_RELEASE"
1338e9feffd0Smrg	exit ;;
1339e9feffd0Smrg    NSR-*:NONSTOP_KERNEL:*:*)
1340e9feffd0Smrg	echo nsr-tandem-nsk"$UNAME_RELEASE"
1341caec6540Smrg	exit ;;
1342e9feffd0Smrg    NSV-*:NONSTOP_KERNEL:*:*)
1343e9feffd0Smrg	echo nsv-tandem-nsk"$UNAME_RELEASE"
134444d7874bSmrg	exit ;;
1345e9feffd0Smrg    NSX-*:NONSTOP_KERNEL:*:*)
1346e9feffd0Smrg	echo nsx-tandem-nsk"$UNAME_RELEASE"
134744d7874bSmrg	exit ;;
134844d7874bSmrg    *:NonStop-UX:*:*)
134944d7874bSmrg	echo mips-compaq-nonstopux
135044d7874bSmrg	exit ;;
135144d7874bSmrg    BS2000:POSIX*:*:*)
135244d7874bSmrg	echo bs2000-siemens-sysv
135344d7874bSmrg	exit ;;
135444d7874bSmrg    DS/*:UNIX_System_V:*:*)
1355e9feffd0Smrg	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
135644d7874bSmrg	exit ;;
135744d7874bSmrg    *:Plan9:*:*)
135844d7874bSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
135944d7874bSmrg	# is converted to i386 for consistency with other x86
136044d7874bSmrg	# operating systems.
1361e9feffd0Smrg	if test "$cputype" = 386; then
136244d7874bSmrg	    UNAME_MACHINE=i386
136344d7874bSmrg	else
136444d7874bSmrg	    UNAME_MACHINE="$cputype"
136544d7874bSmrg	fi
1366e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-plan9
136744d7874bSmrg	exit ;;
136844d7874bSmrg    *:TOPS-10:*:*)
136944d7874bSmrg	echo pdp10-unknown-tops10
137044d7874bSmrg	exit ;;
137144d7874bSmrg    *:TENEX:*:*)
137244d7874bSmrg	echo pdp10-unknown-tenex
137344d7874bSmrg	exit ;;
137444d7874bSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
137544d7874bSmrg	echo pdp10-dec-tops20
137644d7874bSmrg	exit ;;
137744d7874bSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
137844d7874bSmrg	echo pdp10-xkl-tops20
137944d7874bSmrg	exit ;;
138044d7874bSmrg    *:TOPS-20:*:*)
138144d7874bSmrg	echo pdp10-unknown-tops20
138244d7874bSmrg	exit ;;
138344d7874bSmrg    *:ITS:*:*)
138444d7874bSmrg	echo pdp10-unknown-its
138544d7874bSmrg	exit ;;
138644d7874bSmrg    SEI:*:*:SEIUX)
1387e9feffd0Smrg	echo mips-sei-seiux"$UNAME_RELEASE"
138844d7874bSmrg	exit ;;
138944d7874bSmrg    *:DragonFly:*:*)
1390e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
139144d7874bSmrg	exit ;;
139244d7874bSmrg    *:*VMS:*:*)
1393caec6540Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1394e9feffd0Smrg	case "$UNAME_MACHINE" in
139544d7874bSmrg	    A*) echo alpha-dec-vms ; exit ;;
139644d7874bSmrg	    I*) echo ia64-dec-vms ; exit ;;
139744d7874bSmrg	    V*) echo vax-dec-vms ; exit ;;
139844d7874bSmrg	esac ;;
139944d7874bSmrg    *:XENIX:*:SysV)
140044d7874bSmrg	echo i386-pc-xenix
140144d7874bSmrg	exit ;;
140244d7874bSmrg    i*86:skyos:*:*)
1403e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
140444d7874bSmrg	exit ;;
14052d861bc5Smrg    i*86:rdos:*:*)
1406e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-rdos
14072d861bc5Smrg	exit ;;
14082d861bc5Smrg    i*86:AROS:*:*)
1409e9feffd0Smrg	echo "$UNAME_MACHINE"-pc-aros
1410e9feffd0Smrg	exit ;;
1411e9feffd0Smrg    x86_64:VMkernel:*:*)
1412e9feffd0Smrg	echo "$UNAME_MACHINE"-unknown-esx
1413e9feffd0Smrg	exit ;;
1414e9feffd0Smrg    amd64:Isilon\ OneFS:*:*)
1415e9feffd0Smrg	echo x86_64-unknown-onefs
14162d861bc5Smrg	exit ;;
141744d7874bSmrgesac
141844d7874bSmrg
1419e9feffd0Smrgecho "$0: unable to guess system type" >&2
142044d7874bSmrg
1421e9feffd0Smrgcase "$UNAME_MACHINE:$UNAME_SYSTEM" in
1422e9feffd0Smrg    mips:Linux | mips64:Linux)
1423e9feffd0Smrg	# If we got here on MIPS GNU/Linux, output extra information.
1424e9feffd0Smrg	cat >&2 <<EOF
142544d7874bSmrg
1426e9feffd0SmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1427e9feffd0Smrgthe system type. Please install a C compiler and try again.
142844d7874bSmrgEOF
1429e9feffd0Smrg	;;
1430e9feffd0Smrgesac
143144d7874bSmrg
143244d7874bSmrgcat >&2 <<EOF
143344d7874bSmrg
1434e9feffd0SmrgThis script (version $timestamp), has failed to recognize the
1435e9feffd0Smrgoperating system you are using. If your script is old, overwrite *all*
1436e9feffd0Smrgcopies of config.guess and config.sub with the latest versions from:
143744d7874bSmrg
1438e9feffd0Smrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
143944d7874bSmrgand
1440e9feffd0Smrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
144144d7874bSmrg
1442e9feffd0SmrgIf $0 has already been updated, send the following data and any
1443e9feffd0Smrginformation you think might be pertinent to config-patches@gnu.org to
1444e9feffd0Smrgprovide the necessary information to handle your system.
144544d7874bSmrg
144644d7874bSmrgconfig.guess timestamp = $timestamp
144744d7874bSmrg
144844d7874bSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
144944d7874bSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
145044d7874bSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
145144d7874bSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
145244d7874bSmrg
145344d7874bSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
145444d7874bSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
145544d7874bSmrg
145644d7874bSmrghostinfo               = `(hostinfo) 2>/dev/null`
145744d7874bSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
145844d7874bSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
145944d7874bSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
146044d7874bSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
146144d7874bSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
146244d7874bSmrg
1463e9feffd0SmrgUNAME_MACHINE = "$UNAME_MACHINE"
1464e9feffd0SmrgUNAME_RELEASE = "$UNAME_RELEASE"
1465e9feffd0SmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
1466e9feffd0SmrgUNAME_VERSION = "$UNAME_VERSION"
146744d7874bSmrgEOF
146844d7874bSmrg
146944d7874bSmrgexit 1
147044d7874bSmrg
147144d7874bSmrg# Local variables:
1472e9feffd0Smrg# eval: (add-hook 'write-file-functions 'time-stamp)
147344d7874bSmrg# time-stamp-start: "timestamp='"
147444d7874bSmrg# time-stamp-format: "%:y-%02m-%02d"
147544d7874bSmrg# time-stamp-end: "'"
147644d7874bSmrg# End:
1477