config.guess revision 198e4c3c
16c321187Smrg#! /bin/sh
26c321187Smrg# Attempt to guess a canonical system name.
3198e4c3cSmrg#   Copyright 1992-2018 Free Software Foundation, Inc.
46c321187Smrg
5198e4c3cSmrgtimestamp='2018-03-01'
66c321187Smrg
76c321187Smrg# This file is free software; you can redistribute it and/or modify it
86c321187Smrg# under the terms of the GNU General Public License as published by
99d0b5e55Smrg# the Free Software Foundation; either version 3 of the License, or
106c321187Smrg# (at your option) any later version.
116c321187Smrg#
126c321187Smrg# This program is distributed in the hope that it will be useful, but
136c321187Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
146c321187Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
156c321187Smrg# General Public License for more details.
166c321187Smrg#
176c321187Smrg# You should have received a copy of the GNU General Public License
18198e4c3cSmrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
196c321187Smrg#
206c321187Smrg# As a special exception to the GNU General Public License, if you
216c321187Smrg# distribute this file as part of a program that contains a
226c321187Smrg# configuration script generated by Autoconf, you may include it under
239d0b5e55Smrg# the same distribution terms that you use for the rest of that
249d0b5e55Smrg# program.  This Exception is an additional permission under section 7
259d0b5e55Smrg# of the GNU General Public License, version 3 ("GPLv3").
266c321187Smrg#
27198e4c3cSmrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
286c321187Smrg#
29e120bd27Smrg# You can get the latest version of this script from:
30198e4c3cSmrg# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
319d0b5e55Smrg#
32198e4c3cSmrg# Please send patches to <config-patches@gnu.org>.
339d0b5e55Smrg
346c321187Smrg
356c321187Smrgme=`echo "$0" | sed -e 's,.*/,,'`
366c321187Smrg
376c321187Smrgusage="\
386c321187SmrgUsage: $0 [OPTION]
396c321187Smrg
406c321187SmrgOutput the configuration name of the system \`$me' is run on.
416c321187Smrg
42198e4c3cSmrgOptions:
436c321187Smrg  -h, --help         print this help, then exit
446c321187Smrg  -t, --time-stamp   print date of last modification, then exit
456c321187Smrg  -v, --version      print version number, then exit
466c321187Smrg
476c321187SmrgReport bugs and patches to <config-patches@gnu.org>."
486c321187Smrg
496c321187Smrgversion="\
506c321187SmrgGNU config.guess ($timestamp)
516c321187Smrg
526c321187SmrgOriginally written by Per Bothner.
53198e4c3cSmrgCopyright 1992-2018 Free Software Foundation, Inc.
546c321187Smrg
556c321187SmrgThis is free software; see the source for copying conditions.  There is NO
566c321187Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
576c321187Smrg
586c321187Smrghelp="
596c321187SmrgTry \`$me --help' for more information."
606c321187Smrg
616c321187Smrg# Parse command line
626c321187Smrgwhile test $# -gt 0 ; do
636c321187Smrg  case $1 in
646c321187Smrg    --time-stamp | --time* | -t )
656c321187Smrg       echo "$timestamp" ; exit ;;
666c321187Smrg    --version | -v )
676c321187Smrg       echo "$version" ; exit ;;
686c321187Smrg    --help | --h* | -h )
696c321187Smrg       echo "$usage"; exit ;;
706c321187Smrg    -- )     # Stop option processing
716c321187Smrg       shift; break ;;
726c321187Smrg    - )	# Use stdin as input.
736c321187Smrg       break ;;
746c321187Smrg    -* )
756c321187Smrg       echo "$me: invalid option $1$help" >&2
766c321187Smrg       exit 1 ;;
776c321187Smrg    * )
786c321187Smrg       break ;;
796c321187Smrg  esac
806c321187Smrgdone
816c321187Smrg
826c321187Smrgif test $# != 0; then
836c321187Smrg  echo "$me: too many arguments$help" >&2
846c321187Smrg  exit 1
856c321187Smrgfi
866c321187Smrg
879d0b5e55Smrgtrap 'exit 1' 1 2 15
886c321187Smrg
896c321187Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
906c321187Smrg# compiler to aid in system detection is discouraged as it requires
916c321187Smrg# temporary files to be created and, as you can see below, it is a
926c321187Smrg# headache to deal with in a portable fashion.
936c321187Smrg
946c321187Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
956c321187Smrg# use `HOST_CC' if defined, but it is deprecated.
966c321187Smrg
976c321187Smrg# Portable tmp directory creation inspired by the Autoconf team.
986c321187Smrg
996c321187Smrgset_cc_for_build='
1006c321187Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1019d0b5e55Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1026c321187Smrg: ${TMPDIR=/tmp} ;
10393493779Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1046c321187Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1056c321187Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1066c321187Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1076c321187Smrgdummy=$tmp/dummy ;
1086c321187Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1096c321187Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
110198e4c3cSmrg ,,)    echo "int x;" > "$dummy.c" ;
1116c321187Smrg	for c in cc gcc c89 c99 ; do
112198e4c3cSmrg	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
1136c321187Smrg	     CC_FOR_BUILD="$c"; break ;
1146c321187Smrg	  fi ;
1156c321187Smrg	done ;
1166c321187Smrg	if test x"$CC_FOR_BUILD" = x ; then
1176c321187Smrg	  CC_FOR_BUILD=no_compiler_found ;
1186c321187Smrg	fi
1196c321187Smrg	;;
1206c321187Smrg ,,*)   CC_FOR_BUILD=$CC ;;
1216c321187Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1226c321187Smrgesac ; set_cc_for_build= ;'
1236c321187Smrg
1246c321187Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1256c321187Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
1266c321187Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1276c321187Smrg	PATH=$PATH:/.attbin ; export PATH
1286c321187Smrgfi
1296c321187Smrg
1306c321187SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1316c321187SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1326c321187SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1336c321187SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1346c321187Smrg
135198e4c3cSmrgcase "$UNAME_SYSTEM" in
1369d0b5e55SmrgLinux|GNU|GNU/*)
1379d0b5e55Smrg	# If the system lacks a compiler, then just pick glibc.
1389d0b5e55Smrg	# We could probably try harder.
1399d0b5e55Smrg	LIBC=gnu
1409d0b5e55Smrg
141198e4c3cSmrg	eval "$set_cc_for_build"
142198e4c3cSmrg	cat <<-EOF > "$dummy.c"
1439d0b5e55Smrg	#include <features.h>
1449d0b5e55Smrg	#if defined(__UCLIBC__)
1459d0b5e55Smrg	LIBC=uclibc
1469d0b5e55Smrg	#elif defined(__dietlibc__)
1479d0b5e55Smrg	LIBC=dietlibc
1489d0b5e55Smrg	#else
1499d0b5e55Smrg	LIBC=gnu
1509d0b5e55Smrg	#endif
1519d0b5e55Smrg	EOF
152198e4c3cSmrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
153198e4c3cSmrg
154198e4c3cSmrg	# If ldd exists, use it to detect musl libc.
155198e4c3cSmrg	if command -v ldd >/dev/null && \
156198e4c3cSmrg		ldd --version 2>&1 | grep -q ^musl
157198e4c3cSmrg	then
158198e4c3cSmrg	    LIBC=musl
159198e4c3cSmrg	fi
1609d0b5e55Smrg	;;
1619d0b5e55Smrgesac
1629d0b5e55Smrg
1636c321187Smrg# Note: order is significant - the case branches are not exclusive.
1646c321187Smrg
165198e4c3cSmrgcase "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
1666c321187Smrg    *:NetBSD:*:*)
1676c321187Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
1689d0b5e55Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
1696c321187Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1706c321187Smrg	# switched to ELF, *-*-netbsd* would select the old
1716c321187Smrg	# object file format.  This provides both forward
1726c321187Smrg	# compatibility and a consistent mechanism for selecting the
1736c321187Smrg	# object file format.
1746c321187Smrg	#
1756c321187Smrg	# Note: NetBSD doesn't particularly care about the vendor
1766c321187Smrg	# portion of the name.  We always set it to "unknown".
1776c321187Smrg	sysctl="sysctl -n hw.machine_arch"
178198e4c3cSmrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
179198e4c3cSmrg	    "/sbin/$sysctl" 2>/dev/null || \
180198e4c3cSmrg	    "/usr/sbin/$sysctl" 2>/dev/null || \
181198e4c3cSmrg	    echo unknown)`
182198e4c3cSmrg	case "$UNAME_MACHINE_ARCH" in
1836c321187Smrg	    armeb) machine=armeb-unknown ;;
1846c321187Smrg	    arm*) machine=arm-unknown ;;
1856c321187Smrg	    sh3el) machine=shl-unknown ;;
1866c321187Smrg	    sh3eb) machine=sh-unknown ;;
18793493779Smrg	    sh5el) machine=sh5le-unknown ;;
188198e4c3cSmrg	    earmv*)
189198e4c3cSmrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
190198e4c3cSmrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
191198e4c3cSmrg		machine="${arch}${endian}"-unknown
192198e4c3cSmrg		;;
193198e4c3cSmrg	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
1946c321187Smrg	esac
1956c321187Smrg	# The Operating System including object format, if it has switched
196198e4c3cSmrg	# to ELF recently (or will in the future) and ABI.
197198e4c3cSmrg	case "$UNAME_MACHINE_ARCH" in
198198e4c3cSmrg	    earm*)
199198e4c3cSmrg		os=netbsdelf
200198e4c3cSmrg		;;
2016c321187Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
202198e4c3cSmrg		eval "$set_cc_for_build"
2036c321187Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
204e120bd27Smrg			| grep -q __ELF__
2056c321187Smrg		then
2066c321187Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
2076c321187Smrg		    # Return netbsd for either.  FIX?
2086c321187Smrg		    os=netbsd
2096c321187Smrg		else
2106c321187Smrg		    os=netbsdelf
2116c321187Smrg		fi
2126c321187Smrg		;;
2136c321187Smrg	    *)
2149d0b5e55Smrg		os=netbsd
2156c321187Smrg		;;
2166c321187Smrg	esac
217198e4c3cSmrg	# Determine ABI tags.
218198e4c3cSmrg	case "$UNAME_MACHINE_ARCH" in
219198e4c3cSmrg	    earm*)
220198e4c3cSmrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
221198e4c3cSmrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
222198e4c3cSmrg		;;
223198e4c3cSmrg	esac
2246c321187Smrg	# The OS release
2256c321187Smrg	# Debian GNU/NetBSD machines have a different userland, and
2266c321187Smrg	# thus, need a distinct triplet. However, they do not need
2276c321187Smrg	# kernel version information, so it can be replaced with a
2286c321187Smrg	# suitable tag, in the style of linux-gnu.
229198e4c3cSmrg	case "$UNAME_VERSION" in
2306c321187Smrg	    Debian*)
2316c321187Smrg		release='-gnu'
2326c321187Smrg		;;
2336c321187Smrg	    *)
234198e4c3cSmrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
2356c321187Smrg		;;
2366c321187Smrg	esac
2376c321187Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2386c321187Smrg	# contains redundant information, the shorter form:
2396c321187Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
240198e4c3cSmrg	echo "$machine-${os}${release}${abi}"
2416c321187Smrg	exit ;;
2429d0b5e55Smrg    *:Bitrig:*:*)
2439d0b5e55Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
244198e4c3cSmrg	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
2459d0b5e55Smrg	exit ;;
2466c321187Smrg    *:OpenBSD:*:*)
2476c321187Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
248198e4c3cSmrg	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
249198e4c3cSmrg	exit ;;
250198e4c3cSmrg    *:LibertyBSD:*:*)
251198e4c3cSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
252198e4c3cSmrg	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
253198e4c3cSmrg	exit ;;
254198e4c3cSmrg    *:MidnightBSD:*:*)
255198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
2566c321187Smrg	exit ;;
2576c321187Smrg    *:ekkoBSD:*:*)
258198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
2596c321187Smrg	exit ;;
26093493779Smrg    *:SolidBSD:*:*)
261198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
26293493779Smrg	exit ;;
2636c321187Smrg    macppc:MirBSD:*:*)
264198e4c3cSmrg	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
2656c321187Smrg	exit ;;
2666c321187Smrg    *:MirBSD:*:*)
267198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
2686c321187Smrg	exit ;;
269198e4c3cSmrg    *:Sortix:*:*)
270198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-sortix
271198e4c3cSmrg	exit ;;
272198e4c3cSmrg    *:Redox:*:*)
273198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-redox
274198e4c3cSmrg	exit ;;
275198e4c3cSmrg    mips:OSF1:*.*)
276198e4c3cSmrg        echo mips-dec-osf1
277198e4c3cSmrg        exit ;;
2786c321187Smrg    alpha:OSF1:*:*)
2796c321187Smrg	case $UNAME_RELEASE in
2806c321187Smrg	*4.0)
2816c321187Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2826c321187Smrg		;;
2836c321187Smrg	*5.*)
2849d0b5e55Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2856c321187Smrg		;;
2866c321187Smrg	esac
2876c321187Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2886c321187Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2896c321187Smrg	# covers most systems running today.  This code pipes the CPU
2906c321187Smrg	# types through head -n 1, so we only detect the type of CPU 0.
2916c321187Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2926c321187Smrg	case "$ALPHA_CPU_TYPE" in
2936c321187Smrg	    "EV4 (21064)")
294198e4c3cSmrg		UNAME_MACHINE=alpha ;;
2956c321187Smrg	    "EV4.5 (21064)")
296198e4c3cSmrg		UNAME_MACHINE=alpha ;;
2976c321187Smrg	    "LCA4 (21066/21068)")
298198e4c3cSmrg		UNAME_MACHINE=alpha ;;
2996c321187Smrg	    "EV5 (21164)")
300198e4c3cSmrg		UNAME_MACHINE=alphaev5 ;;
3016c321187Smrg	    "EV5.6 (21164A)")
302198e4c3cSmrg		UNAME_MACHINE=alphaev56 ;;
3036c321187Smrg	    "EV5.6 (21164PC)")
304198e4c3cSmrg		UNAME_MACHINE=alphapca56 ;;
3056c321187Smrg	    "EV5.7 (21164PC)")
306198e4c3cSmrg		UNAME_MACHINE=alphapca57 ;;
3076c321187Smrg	    "EV6 (21264)")
308198e4c3cSmrg		UNAME_MACHINE=alphaev6 ;;
3096c321187Smrg	    "EV6.7 (21264A)")
310198e4c3cSmrg		UNAME_MACHINE=alphaev67 ;;
3116c321187Smrg	    "EV6.8CB (21264C)")
312198e4c3cSmrg		UNAME_MACHINE=alphaev68 ;;
3136c321187Smrg	    "EV6.8AL (21264B)")
314198e4c3cSmrg		UNAME_MACHINE=alphaev68 ;;
3156c321187Smrg	    "EV6.8CX (21264D)")
316198e4c3cSmrg		UNAME_MACHINE=alphaev68 ;;
3176c321187Smrg	    "EV6.9A (21264/EV69A)")
318198e4c3cSmrg		UNAME_MACHINE=alphaev69 ;;
3196c321187Smrg	    "EV7 (21364)")
320198e4c3cSmrg		UNAME_MACHINE=alphaev7 ;;
3216c321187Smrg	    "EV7.9 (21364A)")
322198e4c3cSmrg		UNAME_MACHINE=alphaev79 ;;
3236c321187Smrg	esac
3246c321187Smrg	# A Pn.n version is a patched version.
3256c321187Smrg	# A Vn.n version is a released version.
3266c321187Smrg	# A Tn.n version is a released field test version.
3276c321187Smrg	# A Xn.n version is an unreleased experimental baselevel.
3286c321187Smrg	# 1.2 uses "1.2" for uname -r.
329198e4c3cSmrg	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
3309d0b5e55Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
3319d0b5e55Smrg	exitcode=$?
3329d0b5e55Smrg	trap '' 0
3339d0b5e55Smrg	exit $exitcode ;;
3346c321187Smrg    Amiga*:UNIX_System_V:4.0:*)
3356c321187Smrg	echo m68k-unknown-sysv4
3366c321187Smrg	exit ;;
3376c321187Smrg    *:[Aa]miga[Oo][Ss]:*:*)
338198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-amigaos
3396c321187Smrg	exit ;;
3406c321187Smrg    *:[Mm]orph[Oo][Ss]:*:*)
341198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-morphos
3426c321187Smrg	exit ;;
3436c321187Smrg    *:OS/390:*:*)
3446c321187Smrg	echo i370-ibm-openedition
3456c321187Smrg	exit ;;
3466c321187Smrg    *:z/VM:*:*)
3476c321187Smrg	echo s390-ibm-zvmoe
3486c321187Smrg	exit ;;
3496c321187Smrg    *:OS400:*:*)
3509d0b5e55Smrg	echo powerpc-ibm-os400
3516c321187Smrg	exit ;;
3526c321187Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
353198e4c3cSmrg	echo arm-acorn-riscix"$UNAME_RELEASE"
3546c321187Smrg	exit ;;
3559d0b5e55Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
3566c321187Smrg	echo arm-unknown-riscos
3576c321187Smrg	exit ;;
3586c321187Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3596c321187Smrg	echo hppa1.1-hitachi-hiuxmpp
3606c321187Smrg	exit ;;
3616c321187Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3626c321187Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3636c321187Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3646c321187Smrg		echo pyramid-pyramid-sysv3
3656c321187Smrg	else
3666c321187Smrg		echo pyramid-pyramid-bsd
3676c321187Smrg	fi
3686c321187Smrg	exit ;;
3696c321187Smrg    NILE*:*:*:dcosx)
3706c321187Smrg	echo pyramid-pyramid-svr4
3716c321187Smrg	exit ;;
3726c321187Smrg    DRS?6000:unix:4.0:6*)
3736c321187Smrg	echo sparc-icl-nx6
3746c321187Smrg	exit ;;
3756c321187Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3766c321187Smrg	case `/usr/bin/uname -p` in
3776c321187Smrg	    sparc) echo sparc-icl-nx7; exit ;;
3786c321187Smrg	esac ;;
379e120bd27Smrg    s390x:SunOS:*:*)
380198e4c3cSmrg	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
381e120bd27Smrg	exit ;;
3826c321187Smrg    sun4H:SunOS:5.*:*)
383198e4c3cSmrg	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
3846c321187Smrg	exit ;;
3856c321187Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
386198e4c3cSmrg	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
3876c321187Smrg	exit ;;
388e120bd27Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
389198e4c3cSmrg	echo i386-pc-auroraux"$UNAME_RELEASE"
390e120bd27Smrg	exit ;;
39193493779Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
392198e4c3cSmrg	eval "$set_cc_for_build"
393198e4c3cSmrg	SUN_ARCH=i386
394e120bd27Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
395e120bd27Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
396e120bd27Smrg	# This test works for both compilers.
397198e4c3cSmrg	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
398e120bd27Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
399198e4c3cSmrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
400e120bd27Smrg		grep IS_64BIT_ARCH >/dev/null
401e120bd27Smrg	    then
402198e4c3cSmrg		SUN_ARCH=x86_64
403e120bd27Smrg	    fi
404e120bd27Smrg	fi
405198e4c3cSmrg	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
4066c321187Smrg	exit ;;
4076c321187Smrg    sun4*:SunOS:6*:*)
4086c321187Smrg	# According to config.sub, this is the proper way to canonicalize
4096c321187Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
4106c321187Smrg	# it's likely to be more like Solaris than SunOS4.
411198e4c3cSmrg	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
4126c321187Smrg	exit ;;
4136c321187Smrg    sun4*:SunOS:*:*)
4146c321187Smrg	case "`/usr/bin/arch -k`" in
4156c321187Smrg	    Series*|S4*)
4166c321187Smrg		UNAME_RELEASE=`uname -v`
4176c321187Smrg		;;
4186c321187Smrg	esac
4196c321187Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
420198e4c3cSmrg	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
4216c321187Smrg	exit ;;
4226c321187Smrg    sun3*:SunOS:*:*)
423198e4c3cSmrg	echo m68k-sun-sunos"$UNAME_RELEASE"
4246c321187Smrg	exit ;;
4256c321187Smrg    sun*:*:4.2BSD:*)
4266c321187Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
427198e4c3cSmrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
4286c321187Smrg	case "`/bin/arch`" in
4296c321187Smrg	    sun3)
430198e4c3cSmrg		echo m68k-sun-sunos"$UNAME_RELEASE"
4316c321187Smrg		;;
4326c321187Smrg	    sun4)
433198e4c3cSmrg		echo sparc-sun-sunos"$UNAME_RELEASE"
4346c321187Smrg		;;
4356c321187Smrg	esac
4366c321187Smrg	exit ;;
4376c321187Smrg    aushp:SunOS:*:*)
438198e4c3cSmrg	echo sparc-auspex-sunos"$UNAME_RELEASE"
4396c321187Smrg	exit ;;
4406c321187Smrg    # The situation for MiNT is a little confusing.  The machine name
4416c321187Smrg    # can be virtually everything (everything which is not
4426c321187Smrg    # "atarist" or "atariste" at least should have a processor
4436c321187Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
4446c321187Smrg    # to the lowercase version "mint" (or "freemint").  Finally
4456c321187Smrg    # the system name "TOS" denotes a system which is actually not
4466c321187Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
4476c321187Smrg    # be no problem.
4486c321187Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
449198e4c3cSmrg	echo m68k-atari-mint"$UNAME_RELEASE"
4506c321187Smrg	exit ;;
4516c321187Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
452198e4c3cSmrg	echo m68k-atari-mint"$UNAME_RELEASE"
4539d0b5e55Smrg	exit ;;
4546c321187Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
455198e4c3cSmrg	echo m68k-atari-mint"$UNAME_RELEASE"
4566c321187Smrg	exit ;;
4576c321187Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
458198e4c3cSmrg	echo m68k-milan-mint"$UNAME_RELEASE"
4599d0b5e55Smrg	exit ;;
4606c321187Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
461198e4c3cSmrg	echo m68k-hades-mint"$UNAME_RELEASE"
4629d0b5e55Smrg	exit ;;
4636c321187Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
464198e4c3cSmrg	echo m68k-unknown-mint"$UNAME_RELEASE"
4659d0b5e55Smrg	exit ;;
4666c321187Smrg    m68k:machten:*:*)
467198e4c3cSmrg	echo m68k-apple-machten"$UNAME_RELEASE"
4686c321187Smrg	exit ;;
4696c321187Smrg    powerpc:machten:*:*)
470198e4c3cSmrg	echo powerpc-apple-machten"$UNAME_RELEASE"
4716c321187Smrg	exit ;;
4726c321187Smrg    RISC*:Mach:*:*)
4736c321187Smrg	echo mips-dec-mach_bsd4.3
4746c321187Smrg	exit ;;
4756c321187Smrg    RISC*:ULTRIX:*:*)
476198e4c3cSmrg	echo mips-dec-ultrix"$UNAME_RELEASE"
4776c321187Smrg	exit ;;
4786c321187Smrg    VAX*:ULTRIX*:*:*)
479198e4c3cSmrg	echo vax-dec-ultrix"$UNAME_RELEASE"
4806c321187Smrg	exit ;;
4816c321187Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
482198e4c3cSmrg	echo clipper-intergraph-clix"$UNAME_RELEASE"
4836c321187Smrg	exit ;;
4846c321187Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
485198e4c3cSmrg	eval "$set_cc_for_build"
486198e4c3cSmrg	sed 's/^	//' << EOF > "$dummy.c"
4876c321187Smrg#ifdef __cplusplus
4886c321187Smrg#include <stdio.h>  /* for printf() prototype */
4896c321187Smrg	int main (int argc, char *argv[]) {
4906c321187Smrg#else
4916c321187Smrg	int main (argc, argv) int argc; char *argv[]; {
4926c321187Smrg#endif
4936c321187Smrg	#if defined (host_mips) && defined (MIPSEB)
4946c321187Smrg	#if defined (SYSTYPE_SYSV)
495198e4c3cSmrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
4966c321187Smrg	#endif
4976c321187Smrg	#if defined (SYSTYPE_SVR4)
498198e4c3cSmrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
4996c321187Smrg	#endif
5006c321187Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
501198e4c3cSmrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
5026c321187Smrg	#endif
5036c321187Smrg	#endif
5046c321187Smrg	  exit (-1);
5056c321187Smrg	}
5066c321187SmrgEOF
507198e4c3cSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
508198e4c3cSmrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
509198e4c3cSmrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
5106c321187Smrg	    { echo "$SYSTEM_NAME"; exit; }
511198e4c3cSmrg	echo mips-mips-riscos"$UNAME_RELEASE"
5126c321187Smrg	exit ;;
5136c321187Smrg    Motorola:PowerMAX_OS:*:*)
5146c321187Smrg	echo powerpc-motorola-powermax
5156c321187Smrg	exit ;;
5166c321187Smrg    Motorola:*:4.3:PL8-*)
5176c321187Smrg	echo powerpc-harris-powermax
5186c321187Smrg	exit ;;
5196c321187Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
5206c321187Smrg	echo powerpc-harris-powermax
5216c321187Smrg	exit ;;
5226c321187Smrg    Night_Hawk:Power_UNIX:*:*)
5236c321187Smrg	echo powerpc-harris-powerunix
5246c321187Smrg	exit ;;
5256c321187Smrg    m88k:CX/UX:7*:*)
5266c321187Smrg	echo m88k-harris-cxux7
5276c321187Smrg	exit ;;
5286c321187Smrg    m88k:*:4*:R4*)
5296c321187Smrg	echo m88k-motorola-sysv4
5306c321187Smrg	exit ;;
5316c321187Smrg    m88k:*:3*:R3*)
5326c321187Smrg	echo m88k-motorola-sysv3
5336c321187Smrg	exit ;;
5346c321187Smrg    AViiON:dgux:*:*)
5359d0b5e55Smrg	# DG/UX returns AViiON for all architectures
5369d0b5e55Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
537198e4c3cSmrg	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
5386c321187Smrg	then
539198e4c3cSmrg	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
540198e4c3cSmrg	       [ "$TARGET_BINARY_INTERFACE"x = x ]
5416c321187Smrg	    then
542198e4c3cSmrg		echo m88k-dg-dgux"$UNAME_RELEASE"
5436c321187Smrg	    else
544198e4c3cSmrg		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
5456c321187Smrg	    fi
5466c321187Smrg	else
547198e4c3cSmrg	    echo i586-dg-dgux"$UNAME_RELEASE"
5486c321187Smrg	fi
5499d0b5e55Smrg	exit ;;
5506c321187Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
5516c321187Smrg	echo m88k-dolphin-sysv3
5526c321187Smrg	exit ;;
5536c321187Smrg    M88*:*:R3*:*)
5546c321187Smrg	# Delta 88k system running SVR3
5556c321187Smrg	echo m88k-motorola-sysv3
5566c321187Smrg	exit ;;
5576c321187Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5586c321187Smrg	echo m88k-tektronix-sysv3
5596c321187Smrg	exit ;;
5606c321187Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5616c321187Smrg	echo m68k-tektronix-bsd
5626c321187Smrg	exit ;;
5636c321187Smrg    *:IRIX*:*:*)
564198e4c3cSmrg	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
5656c321187Smrg	exit ;;
5666c321187Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5676c321187Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5686c321187Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5696c321187Smrg    i*86:AIX:*:*)
5706c321187Smrg	echo i386-ibm-aix
5716c321187Smrg	exit ;;
5726c321187Smrg    ia64:AIX:*:*)
5736c321187Smrg	if [ -x /usr/bin/oslevel ] ; then
5746c321187Smrg		IBM_REV=`/usr/bin/oslevel`
5756c321187Smrg	else
576198e4c3cSmrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
5776c321187Smrg	fi
578198e4c3cSmrg	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
5796c321187Smrg	exit ;;
5806c321187Smrg    *:AIX:2:3)
5816c321187Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
582198e4c3cSmrg		eval "$set_cc_for_build"
583198e4c3cSmrg		sed 's/^		//' << EOF > "$dummy.c"
5846c321187Smrg		#include <sys/systemcfg.h>
5856c321187Smrg
5866c321187Smrg		main()
5876c321187Smrg			{
5886c321187Smrg			if (!__power_pc())
5896c321187Smrg				exit(1);
5906c321187Smrg			puts("powerpc-ibm-aix3.2.5");
5916c321187Smrg			exit(0);
5926c321187Smrg			}
5936c321187SmrgEOF
594198e4c3cSmrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
5956c321187Smrg		then
5966c321187Smrg			echo "$SYSTEM_NAME"
5976c321187Smrg		else
5986c321187Smrg			echo rs6000-ibm-aix3.2.5
5996c321187Smrg		fi
6006c321187Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
6016c321187Smrg		echo rs6000-ibm-aix3.2.4
6026c321187Smrg	else
6036c321187Smrg		echo rs6000-ibm-aix3.2
6046c321187Smrg	fi
6056c321187Smrg	exit ;;
606e120bd27Smrg    *:AIX:*:[4567])
6076c321187Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
608198e4c3cSmrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
6096c321187Smrg		IBM_ARCH=rs6000
6106c321187Smrg	else
6116c321187Smrg		IBM_ARCH=powerpc
6126c321187Smrg	fi
613198e4c3cSmrg	if [ -x /usr/bin/lslpp ] ; then
614198e4c3cSmrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
615198e4c3cSmrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
6166c321187Smrg	else
617198e4c3cSmrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
6186c321187Smrg	fi
619198e4c3cSmrg	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
6206c321187Smrg	exit ;;
6216c321187Smrg    *:AIX:*:*)
6226c321187Smrg	echo rs6000-ibm-aix
6236c321187Smrg	exit ;;
624198e4c3cSmrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
6256c321187Smrg	echo romp-ibm-bsd4.4
6266c321187Smrg	exit ;;
6276c321187Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
628198e4c3cSmrg	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
6296c321187Smrg	exit ;;                             # report: romp-ibm BSD 4.3
6306c321187Smrg    *:BOSX:*:*)
6316c321187Smrg	echo rs6000-bull-bosx
6326c321187Smrg	exit ;;
6336c321187Smrg    DPX/2?00:B.O.S.:*:*)
6346c321187Smrg	echo m68k-bull-sysv3
6356c321187Smrg	exit ;;
6366c321187Smrg    9000/[34]??:4.3bsd:1.*:*)
6376c321187Smrg	echo m68k-hp-bsd
6386c321187Smrg	exit ;;
6396c321187Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
6406c321187Smrg	echo m68k-hp-bsd4.4
6416c321187Smrg	exit ;;
6426c321187Smrg    9000/[34678]??:HP-UX:*:*)
643198e4c3cSmrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
644198e4c3cSmrg	case "$UNAME_MACHINE" in
645198e4c3cSmrg	    9000/31?)            HP_ARCH=m68000 ;;
646198e4c3cSmrg	    9000/[34]??)         HP_ARCH=m68k ;;
6476c321187Smrg	    9000/[678][0-9][0-9])
6486c321187Smrg		if [ -x /usr/bin/getconf ]; then
6496c321187Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
6509d0b5e55Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
651198e4c3cSmrg		    case "$sc_cpu_version" in
652198e4c3cSmrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
653198e4c3cSmrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
6549d0b5e55Smrg		      532)                      # CPU_PA_RISC2_0
655198e4c3cSmrg			case "$sc_kernel_bits" in
656198e4c3cSmrg			  32) HP_ARCH=hppa2.0n ;;
657198e4c3cSmrg			  64) HP_ARCH=hppa2.0w ;;
658198e4c3cSmrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
6599d0b5e55Smrg			esac ;;
6609d0b5e55Smrg		    esac
6616c321187Smrg		fi
662198e4c3cSmrg		if [ "$HP_ARCH" = "" ]; then
663198e4c3cSmrg		    eval "$set_cc_for_build"
664198e4c3cSmrg		    sed 's/^		//' << EOF > "$dummy.c"
6656c321187Smrg
6669d0b5e55Smrg		#define _HPUX_SOURCE
6679d0b5e55Smrg		#include <stdlib.h>
6689d0b5e55Smrg		#include <unistd.h>
6696c321187Smrg
6709d0b5e55Smrg		int main ()
6719d0b5e55Smrg		{
6729d0b5e55Smrg		#if defined(_SC_KERNEL_BITS)
6739d0b5e55Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
6749d0b5e55Smrg		#endif
6759d0b5e55Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
6766c321187Smrg
6779d0b5e55Smrg		    switch (cpu)
6789d0b5e55Smrg			{
6799d0b5e55Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6809d0b5e55Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6819d0b5e55Smrg			case CPU_PA_RISC2_0:
6829d0b5e55Smrg		#if defined(_SC_KERNEL_BITS)
6839d0b5e55Smrg			    switch (bits)
6849d0b5e55Smrg				{
6859d0b5e55Smrg				case 64: puts ("hppa2.0w"); break;
6869d0b5e55Smrg				case 32: puts ("hppa2.0n"); break;
6879d0b5e55Smrg				default: puts ("hppa2.0"); break;
6889d0b5e55Smrg				} break;
6899d0b5e55Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
6909d0b5e55Smrg			    puts ("hppa2.0"); break;
6919d0b5e55Smrg		#endif
6929d0b5e55Smrg			default: puts ("hppa1.0"); break;
6939d0b5e55Smrg			}
6949d0b5e55Smrg		    exit (0);
6959d0b5e55Smrg		}
6966c321187SmrgEOF
697198e4c3cSmrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
6986c321187Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6996c321187Smrg		fi ;;
7006c321187Smrg	esac
701198e4c3cSmrg	if [ "$HP_ARCH" = hppa2.0w ]
7026c321187Smrg	then
703198e4c3cSmrg	    eval "$set_cc_for_build"
7046c321187Smrg
7056c321187Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
7066c321187Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
7076c321187Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
7086c321187Smrg	    #
7096c321187Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
7106c321187Smrg	    # => hppa2.0w-hp-hpux11.23
7116c321187Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
7126c321187Smrg	    # => hppa64-hp-hpux11.23
7136c321187Smrg
714198e4c3cSmrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
715e120bd27Smrg		grep -q __LP64__
7166c321187Smrg	    then
717198e4c3cSmrg		HP_ARCH=hppa2.0w
7186c321187Smrg	    else
719198e4c3cSmrg		HP_ARCH=hppa64
7206c321187Smrg	    fi
7216c321187Smrg	fi
722198e4c3cSmrg	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
7236c321187Smrg	exit ;;
7246c321187Smrg    ia64:HP-UX:*:*)
725198e4c3cSmrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
726198e4c3cSmrg	echo ia64-hp-hpux"$HPUX_REV"
7276c321187Smrg	exit ;;
7286c321187Smrg    3050*:HI-UX:*:*)
729198e4c3cSmrg	eval "$set_cc_for_build"
730198e4c3cSmrg	sed 's/^	//' << EOF > "$dummy.c"
7316c321187Smrg	#include <unistd.h>
7326c321187Smrg	int
7336c321187Smrg	main ()
7346c321187Smrg	{
7356c321187Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
7366c321187Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7376c321187Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7386c321187Smrg	     results, however.  */
7396c321187Smrg	  if (CPU_IS_PA_RISC (cpu))
7406c321187Smrg	    {
7416c321187Smrg	      switch (cpu)
7426c321187Smrg		{
7436c321187Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7446c321187Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7456c321187Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7466c321187Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7476c321187Smrg		}
7486c321187Smrg	    }
7496c321187Smrg	  else if (CPU_IS_HP_MC68K (cpu))
7506c321187Smrg	    puts ("m68k-hitachi-hiuxwe2");
7516c321187Smrg	  else puts ("unknown-hitachi-hiuxwe2");
7526c321187Smrg	  exit (0);
7536c321187Smrg	}
7546c321187SmrgEOF
755198e4c3cSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
7566c321187Smrg		{ echo "$SYSTEM_NAME"; exit; }
7576c321187Smrg	echo unknown-hitachi-hiuxwe2
7586c321187Smrg	exit ;;
759198e4c3cSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
7606c321187Smrg	echo hppa1.1-hp-bsd
7616c321187Smrg	exit ;;
7626c321187Smrg    9000/8??:4.3bsd:*:*)
7636c321187Smrg	echo hppa1.0-hp-bsd
7646c321187Smrg	exit ;;
7656c321187Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7666c321187Smrg	echo hppa1.0-hp-mpeix
7676c321187Smrg	exit ;;
768198e4c3cSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
7696c321187Smrg	echo hppa1.1-hp-osf
7706c321187Smrg	exit ;;
7716c321187Smrg    hp8??:OSF1:*:*)
7726c321187Smrg	echo hppa1.0-hp-osf
7736c321187Smrg	exit ;;
7746c321187Smrg    i*86:OSF1:*:*)
7756c321187Smrg	if [ -x /usr/sbin/sysversion ] ; then
776198e4c3cSmrg	    echo "$UNAME_MACHINE"-unknown-osf1mk
7776c321187Smrg	else
778198e4c3cSmrg	    echo "$UNAME_MACHINE"-unknown-osf1
7796c321187Smrg	fi
7806c321187Smrg	exit ;;
7816c321187Smrg    parisc*:Lites*:*:*)
7826c321187Smrg	echo hppa1.1-hp-lites
7836c321187Smrg	exit ;;
7846c321187Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7856c321187Smrg	echo c1-convex-bsd
7869d0b5e55Smrg	exit ;;
7876c321187Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7886c321187Smrg	if getsysinfo -f scalar_acc
7896c321187Smrg	then echo c32-convex-bsd
7906c321187Smrg	else echo c2-convex-bsd
7916c321187Smrg	fi
7929d0b5e55Smrg	exit ;;
7936c321187Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7946c321187Smrg	echo c34-convex-bsd
7959d0b5e55Smrg	exit ;;
7966c321187Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7976c321187Smrg	echo c38-convex-bsd
7989d0b5e55Smrg	exit ;;
7996c321187Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
8006c321187Smrg	echo c4-convex-bsd
8019d0b5e55Smrg	exit ;;
8026c321187Smrg    CRAY*Y-MP:*:*:*)
803198e4c3cSmrg	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8046c321187Smrg	exit ;;
8056c321187Smrg    CRAY*[A-Z]90:*:*:*)
806198e4c3cSmrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
8076c321187Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
8086c321187Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
8096c321187Smrg	      -e 's/\.[^.]*$/.X/'
8106c321187Smrg	exit ;;
8116c321187Smrg    CRAY*TS:*:*:*)
812198e4c3cSmrg	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8136c321187Smrg	exit ;;
8146c321187Smrg    CRAY*T3E:*:*:*)
815198e4c3cSmrg	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8166c321187Smrg	exit ;;
8176c321187Smrg    CRAY*SV1:*:*:*)
818198e4c3cSmrg	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8196c321187Smrg	exit ;;
8206c321187Smrg    *:UNICOS/mp:*:*)
821198e4c3cSmrg	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8226c321187Smrg	exit ;;
8236c321187Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
824198e4c3cSmrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
825198e4c3cSmrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
826198e4c3cSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
8279d0b5e55Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
8289d0b5e55Smrg	exit ;;
8296c321187Smrg    5000:UNIX_System_V:4.*:*)
830198e4c3cSmrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
831198e4c3cSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
8329d0b5e55Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
8336c321187Smrg	exit ;;
8346c321187Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
835198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
8366c321187Smrg	exit ;;
8376c321187Smrg    sparc*:BSD/OS:*:*)
838198e4c3cSmrg	echo sparc-unknown-bsdi"$UNAME_RELEASE"
8396c321187Smrg	exit ;;
8406c321187Smrg    *:BSD/OS:*:*)
841198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
8426c321187Smrg	exit ;;
8436c321187Smrg    *:FreeBSD:*:*)
8449d0b5e55Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
845198e4c3cSmrg	case "$UNAME_PROCESSOR" in
84693493779Smrg	    amd64)
847198e4c3cSmrg		UNAME_PROCESSOR=x86_64 ;;
848198e4c3cSmrg	    i386)
849198e4c3cSmrg		UNAME_PROCESSOR=i586 ;;
85093493779Smrg	esac
851198e4c3cSmrg	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
8526c321187Smrg	exit ;;
8536c321187Smrg    i*:CYGWIN*:*)
854198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-cygwin
8556c321187Smrg	exit ;;
8569d0b5e55Smrg    *:MINGW64*:*)
857198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-mingw64
8589d0b5e55Smrg	exit ;;
85993493779Smrg    *:MINGW*:*)
860198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-mingw32
8619d0b5e55Smrg	exit ;;
862198e4c3cSmrg    *:MSYS*:*)
863198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-msys
8646c321187Smrg	exit ;;
8656c321187Smrg    i*:PW*:*)
866198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-pw32
8676c321187Smrg	exit ;;
868e120bd27Smrg    *:Interix*:*)
869198e4c3cSmrg	case "$UNAME_MACHINE" in
87093493779Smrg	    x86)
871198e4c3cSmrg		echo i586-pc-interix"$UNAME_RELEASE"
87293493779Smrg		exit ;;
873e120bd27Smrg	    authenticamd | genuineintel | EM64T)
874198e4c3cSmrg		echo x86_64-unknown-interix"$UNAME_RELEASE"
87593493779Smrg		exit ;;
87693493779Smrg	    IA64)
877198e4c3cSmrg		echo ia64-unknown-interix"$UNAME_RELEASE"
87893493779Smrg		exit ;;
87993493779Smrg	esac ;;
8806c321187Smrg    i*:UWIN*:*)
881198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-uwin
8826c321187Smrg	exit ;;
8836c321187Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8846c321187Smrg	echo x86_64-unknown-cygwin
8856c321187Smrg	exit ;;
8866c321187Smrg    prep*:SunOS:5.*:*)
887198e4c3cSmrg	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
8886c321187Smrg	exit ;;
8896c321187Smrg    *:GNU:*:*)
8906c321187Smrg	# the GNU system
891198e4c3cSmrg	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
8926c321187Smrg	exit ;;
8936c321187Smrg    *:GNU/*:*:*)
8946c321187Smrg	# other systems with GNU libc and userland
895198e4c3cSmrg	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
8966c321187Smrg	exit ;;
8976c321187Smrg    i*86:Minix:*:*)
898198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-minix
8996c321187Smrg	exit ;;
9009d0b5e55Smrg    aarch64:Linux:*:*)
901198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9029d0b5e55Smrg	exit ;;
9039d0b5e55Smrg    aarch64_be:Linux:*:*)
9049d0b5e55Smrg	UNAME_MACHINE=aarch64_be
905198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9069d0b5e55Smrg	exit ;;
907e120bd27Smrg    alpha:Linux:*:*)
908e120bd27Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
909e120bd27Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
910e120bd27Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
911e120bd27Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
912e120bd27Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
913e120bd27Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
914e120bd27Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
915e120bd27Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
9169d0b5e55Smrg	esac
917e120bd27Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
918198e4c3cSmrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
919198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9209d0b5e55Smrg	exit ;;
9219d0b5e55Smrg    arc:Linux:*:* | arceb:Linux:*:*)
922198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
923e120bd27Smrg	exit ;;
9246c321187Smrg    arm*:Linux:*:*)
925198e4c3cSmrg	eval "$set_cc_for_build"
92693493779Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
92793493779Smrg	    | grep -q __ARM_EABI__
92893493779Smrg	then
929198e4c3cSmrg	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
93093493779Smrg	else
9319d0b5e55Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
9329d0b5e55Smrg		| grep -q __ARM_PCS_VFP
9339d0b5e55Smrg	    then
934198e4c3cSmrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
9359d0b5e55Smrg	    else
936198e4c3cSmrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
9379d0b5e55Smrg	    fi
93893493779Smrg	fi
93993493779Smrg	exit ;;
94093493779Smrg    avr32*:Linux:*:*)
941198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9426c321187Smrg	exit ;;
9436c321187Smrg    cris:Linux:*:*)
944198e4c3cSmrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
9456c321187Smrg	exit ;;
9466c321187Smrg    crisv32:Linux:*:*)
947198e4c3cSmrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
948198e4c3cSmrg	exit ;;
949198e4c3cSmrg    e2k:Linux:*:*)
950198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9516c321187Smrg	exit ;;
9526c321187Smrg    frv:Linux:*:*)
953198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9549d0b5e55Smrg	exit ;;
9559d0b5e55Smrg    hexagon:Linux:*:*)
956198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9576c321187Smrg	exit ;;
958e120bd27Smrg    i*86:Linux:*:*)
959198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
960e120bd27Smrg	exit ;;
9616c321187Smrg    ia64:Linux:*:*)
962198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
963198e4c3cSmrg	exit ;;
964198e4c3cSmrg    k1om:Linux:*:*)
965198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9666c321187Smrg	exit ;;
9676c321187Smrg    m32r*:Linux:*:*)
968198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9696c321187Smrg	exit ;;
9706c321187Smrg    m68*:Linux:*:*)
971198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9726c321187Smrg	exit ;;
973e120bd27Smrg    mips:Linux:*:* | mips64:Linux:*:*)
974198e4c3cSmrg	eval "$set_cc_for_build"
975198e4c3cSmrg	sed 's/^	//' << EOF > "$dummy.c"
9766c321187Smrg	#undef CPU
977e120bd27Smrg	#undef ${UNAME_MACHINE}
978e120bd27Smrg	#undef ${UNAME_MACHINE}el
9796c321187Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
980e120bd27Smrg	CPU=${UNAME_MACHINE}el
9816c321187Smrg	#else
9826c321187Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
983e120bd27Smrg	CPU=${UNAME_MACHINE}
9846c321187Smrg	#else
9856c321187Smrg	CPU=
9866c321187Smrg	#endif
9876c321187Smrg	#endif
9886c321187SmrgEOF
989198e4c3cSmrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
990198e4c3cSmrg	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
9916c321187Smrg	;;
992198e4c3cSmrg    mips64el:Linux:*:*)
993198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9949d0b5e55Smrg	exit ;;
995198e4c3cSmrg    openrisc*:Linux:*:*)
996198e4c3cSmrg	echo or1k-unknown-linux-"$LIBC"
997198e4c3cSmrg	exit ;;
998198e4c3cSmrg    or32:Linux:*:* | or1k*:Linux:*:*)
999198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10006c321187Smrg	exit ;;
1001e120bd27Smrg    padre:Linux:*:*)
1002198e4c3cSmrg	echo sparc-unknown-linux-"$LIBC"
10036c321187Smrg	exit ;;
1004e120bd27Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
1005198e4c3cSmrg	echo hppa64-unknown-linux-"$LIBC"
10066c321187Smrg	exit ;;
10076c321187Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
10086c321187Smrg	# Look for CPU level
10096c321187Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1010198e4c3cSmrg	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1011198e4c3cSmrg	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1012198e4c3cSmrg	  *)    echo hppa-unknown-linux-"$LIBC" ;;
10136c321187Smrg	esac
10146c321187Smrg	exit ;;
1015e120bd27Smrg    ppc64:Linux:*:*)
1016198e4c3cSmrg	echo powerpc64-unknown-linux-"$LIBC"
1017e120bd27Smrg	exit ;;
1018e120bd27Smrg    ppc:Linux:*:*)
1019198e4c3cSmrg	echo powerpc-unknown-linux-"$LIBC"
10209d0b5e55Smrg	exit ;;
10219d0b5e55Smrg    ppc64le:Linux:*:*)
1022198e4c3cSmrg	echo powerpc64le-unknown-linux-"$LIBC"
10239d0b5e55Smrg	exit ;;
10249d0b5e55Smrg    ppcle:Linux:*:*)
1025198e4c3cSmrg	echo powerpcle-unknown-linux-"$LIBC"
1026198e4c3cSmrg	exit ;;
1027198e4c3cSmrg    riscv32:Linux:*:* | riscv64:Linux:*:*)
1028198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10296c321187Smrg	exit ;;
10306c321187Smrg    s390:Linux:*:* | s390x:Linux:*:*)
1031198e4c3cSmrg	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
10326c321187Smrg	exit ;;
10336c321187Smrg    sh64*:Linux:*:*)
1034198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10356c321187Smrg	exit ;;
10366c321187Smrg    sh*:Linux:*:*)
1037198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10386c321187Smrg	exit ;;
10396c321187Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
1040198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10416c321187Smrg	exit ;;
1042e120bd27Smrg    tile*:Linux:*:*)
1043198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1044e120bd27Smrg	exit ;;
10456c321187Smrg    vax:Linux:*:*)
1046198e4c3cSmrg	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
10476c321187Smrg	exit ;;
10486c321187Smrg    x86_64:Linux:*:*)
1049198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
10506c321187Smrg	exit ;;
105193493779Smrg    xtensa*:Linux:*:*)
1052198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
105393493779Smrg	exit ;;
10546c321187Smrg    i*86:DYNIX/ptx:4*:*)
10556c321187Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10566c321187Smrg	# earlier versions are messed up and put the nodename in both
10576c321187Smrg	# sysname and nodename.
10586c321187Smrg	echo i386-sequent-sysv4
10596c321187Smrg	exit ;;
10606c321187Smrg    i*86:UNIX_SV:4.2MP:2.*)
10619d0b5e55Smrg	# Unixware is an offshoot of SVR4, but it has its own version
10629d0b5e55Smrg	# number series starting with 2...
10639d0b5e55Smrg	# I am not positive that other SVR4 systems won't match this,
10646c321187Smrg	# I just have to hope.  -- rms.
10659d0b5e55Smrg	# Use sysv4.2uw... so that sysv4* matches it.
1066198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
10676c321187Smrg	exit ;;
10686c321187Smrg    i*86:OS/2:*:*)
10696c321187Smrg	# If we were able to find `uname', then EMX Unix compatibility
10706c321187Smrg	# is probably installed.
1071198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-os2-emx
10726c321187Smrg	exit ;;
10736c321187Smrg    i*86:XTS-300:*:STOP)
1074198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-stop
10756c321187Smrg	exit ;;
10766c321187Smrg    i*86:atheos:*:*)
1077198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-atheos
10786c321187Smrg	exit ;;
10796c321187Smrg    i*86:syllable:*:*)
1080198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-syllable
10816c321187Smrg	exit ;;
1082e120bd27Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1083198e4c3cSmrg	echo i386-unknown-lynxos"$UNAME_RELEASE"
10846c321187Smrg	exit ;;
10856c321187Smrg    i*86:*DOS:*:*)
1086198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-msdosdjgpp
10876c321187Smrg	exit ;;
1088198e4c3cSmrg    i*86:*:4.*:*)
1089198e4c3cSmrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
10906c321187Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1091198e4c3cSmrg		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
10926c321187Smrg	else
1093198e4c3cSmrg		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
10946c321187Smrg	fi
10956c321187Smrg	exit ;;
10966c321187Smrg    i*86:*:5:[678]*)
10979d0b5e55Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10986c321187Smrg	case `/bin/uname -X | grep "^Machine"` in
10996c321187Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
11006c321187Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
11016c321187Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
11026c321187Smrg	esac
1103198e4c3cSmrg	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
11046c321187Smrg	exit ;;
11056c321187Smrg    i*86:*:3.2:*)
11066c321187Smrg	if test -f /usr/options/cb.name; then
11076c321187Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1108198e4c3cSmrg		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
11096c321187Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
11106c321187Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
11116c321187Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
11126c321187Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
11136c321187Smrg			&& UNAME_MACHINE=i586
11146c321187Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
11156c321187Smrg			&& UNAME_MACHINE=i686
11166c321187Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
11176c321187Smrg			&& UNAME_MACHINE=i686
1118198e4c3cSmrg		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
11196c321187Smrg	else
1120198e4c3cSmrg		echo "$UNAME_MACHINE"-pc-sysv32
11216c321187Smrg	fi
11226c321187Smrg	exit ;;
11236c321187Smrg    pc:*:*:*)
11246c321187Smrg	# Left here for compatibility:
11259d0b5e55Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
11269d0b5e55Smrg	# the processor, so we play safe by assuming i586.
1127e120bd27Smrg	# Note: whatever this is, it MUST be the same as what config.sub
1128198e4c3cSmrg	# prints for the "djgpp" host, or else GDB configure will decide that
1129e120bd27Smrg	# this is a cross-build.
1130e120bd27Smrg	echo i586-pc-msdosdjgpp
11319d0b5e55Smrg	exit ;;
11326c321187Smrg    Intel:Mach:3*:*)
11336c321187Smrg	echo i386-pc-mach3
11346c321187Smrg	exit ;;
11356c321187Smrg    paragon:*:*:*)
11366c321187Smrg	echo i860-intel-osf1
11376c321187Smrg	exit ;;
11386c321187Smrg    i860:*:4.*:*) # i860-SVR4
11396c321187Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1140198e4c3cSmrg	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
11416c321187Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
1142198e4c3cSmrg	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
11436c321187Smrg	fi
11446c321187Smrg	exit ;;
11456c321187Smrg    mini*:CTIX:SYS*5:*)
11466c321187Smrg	# "miniframe"
11476c321187Smrg	echo m68010-convergent-sysv
11486c321187Smrg	exit ;;
11496c321187Smrg    mc68k:UNIX:SYSTEM5:3.51m)
11506c321187Smrg	echo m68k-convergent-sysv
11516c321187Smrg	exit ;;
11526c321187Smrg    M680?0:D-NIX:5.3:*)
11536c321187Smrg	echo m68k-diab-dnix
11546c321187Smrg	exit ;;
11556c321187Smrg    M68*:*:R3V[5678]*:*)
11566c321187Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11576c321187Smrg    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)
11586c321187Smrg	OS_REL=''
11596c321187Smrg	test -r /etc/.relid \
11606c321187Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11616c321187Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1162198e4c3cSmrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11636c321187Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1164198e4c3cSmrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11656c321187Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11669d0b5e55Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11679d0b5e55Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
1168e120bd27Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1169e120bd27Smrg	OS_REL='.3'
1170e120bd27Smrg	test -r /etc/.relid \
1171e120bd27Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1172e120bd27Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1173198e4c3cSmrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1174e120bd27Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1175198e4c3cSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1176e120bd27Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1177198e4c3cSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11786c321187Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1179198e4c3cSmrg	echo m68k-unknown-lynxos"$UNAME_RELEASE"
11806c321187Smrg	exit ;;
11816c321187Smrg    mc68030:UNIX_System_V:4.*:*)
11826c321187Smrg	echo m68k-atari-sysv4
11836c321187Smrg	exit ;;
11846c321187Smrg    TSUNAMI:LynxOS:2.*:*)
1185198e4c3cSmrg	echo sparc-unknown-lynxos"$UNAME_RELEASE"
11866c321187Smrg	exit ;;
11876c321187Smrg    rs6000:LynxOS:2.*:*)
1188198e4c3cSmrg	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
11896c321187Smrg	exit ;;
1190e120bd27Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1191198e4c3cSmrg	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
11926c321187Smrg	exit ;;
11936c321187Smrg    SM[BE]S:UNIX_SV:*:*)
1194198e4c3cSmrg	echo mips-dde-sysv"$UNAME_RELEASE"
11956c321187Smrg	exit ;;
11966c321187Smrg    RM*:ReliantUNIX-*:*:*)
11976c321187Smrg	echo mips-sni-sysv4
11986c321187Smrg	exit ;;
11996c321187Smrg    RM*:SINIX-*:*:*)
12006c321187Smrg	echo mips-sni-sysv4
12016c321187Smrg	exit ;;
12026c321187Smrg    *:SINIX-*:*:*)
12036c321187Smrg	if uname -p 2>/dev/null >/dev/null ; then
12046c321187Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1205198e4c3cSmrg		echo "$UNAME_MACHINE"-sni-sysv4
12066c321187Smrg	else
12076c321187Smrg		echo ns32k-sni-sysv
12086c321187Smrg	fi
12096c321187Smrg	exit ;;
12109d0b5e55Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
12119d0b5e55Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
12129d0b5e55Smrg	echo i586-unisys-sysv4
12139d0b5e55Smrg	exit ;;
12146c321187Smrg    *:UNIX_System_V:4*:FTX*)
12156c321187Smrg	# From Gerald Hewes <hewes@openmarket.com>.
12166c321187Smrg	# How about differentiating between stratus architectures? -djm
12176c321187Smrg	echo hppa1.1-stratus-sysv4
12186c321187Smrg	exit ;;
12196c321187Smrg    *:*:*:FTX*)
12206c321187Smrg	# From seanf@swdc.stratus.com.
12216c321187Smrg	echo i860-stratus-sysv4
12226c321187Smrg	exit ;;
12236c321187Smrg    i*86:VOS:*:*)
12246c321187Smrg	# From Paul.Green@stratus.com.
1225198e4c3cSmrg	echo "$UNAME_MACHINE"-stratus-vos
12266c321187Smrg	exit ;;
12276c321187Smrg    *:VOS:*:*)
12286c321187Smrg	# From Paul.Green@stratus.com.
12296c321187Smrg	echo hppa1.1-stratus-vos
12306c321187Smrg	exit ;;
12316c321187Smrg    mc68*:A/UX:*:*)
1232198e4c3cSmrg	echo m68k-apple-aux"$UNAME_RELEASE"
12336c321187Smrg	exit ;;
12346c321187Smrg    news*:NEWS-OS:6*:*)
12356c321187Smrg	echo mips-sony-newsos6
12366c321187Smrg	exit ;;
12376c321187Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12386c321187Smrg	if [ -d /usr/nec ]; then
1239198e4c3cSmrg		echo mips-nec-sysv"$UNAME_RELEASE"
12406c321187Smrg	else
1241198e4c3cSmrg		echo mips-unknown-sysv"$UNAME_RELEASE"
12426c321187Smrg	fi
12439d0b5e55Smrg	exit ;;
12446c321187Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
12456c321187Smrg	echo powerpc-be-beos
12466c321187Smrg	exit ;;
12476c321187Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
12486c321187Smrg	echo powerpc-apple-beos
12496c321187Smrg	exit ;;
12506c321187Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
12516c321187Smrg	echo i586-pc-beos
12526c321187Smrg	exit ;;
1253e120bd27Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1254e120bd27Smrg	echo i586-pc-haiku
1255e120bd27Smrg	exit ;;
12569d0b5e55Smrg    x86_64:Haiku:*:*)
12579d0b5e55Smrg	echo x86_64-unknown-haiku
12589d0b5e55Smrg	exit ;;
12596c321187Smrg    SX-4:SUPER-UX:*:*)
1260198e4c3cSmrg	echo sx4-nec-superux"$UNAME_RELEASE"
12616c321187Smrg	exit ;;
12626c321187Smrg    SX-5:SUPER-UX:*:*)
1263198e4c3cSmrg	echo sx5-nec-superux"$UNAME_RELEASE"
12646c321187Smrg	exit ;;
12656c321187Smrg    SX-6:SUPER-UX:*:*)
1266198e4c3cSmrg	echo sx6-nec-superux"$UNAME_RELEASE"
12676c321187Smrg	exit ;;
126893493779Smrg    SX-7:SUPER-UX:*:*)
1269198e4c3cSmrg	echo sx7-nec-superux"$UNAME_RELEASE"
127093493779Smrg	exit ;;
127193493779Smrg    SX-8:SUPER-UX:*:*)
1272198e4c3cSmrg	echo sx8-nec-superux"$UNAME_RELEASE"
127393493779Smrg	exit ;;
127493493779Smrg    SX-8R:SUPER-UX:*:*)
1275198e4c3cSmrg	echo sx8r-nec-superux"$UNAME_RELEASE"
1276198e4c3cSmrg	exit ;;
1277198e4c3cSmrg    SX-ACE:SUPER-UX:*:*)
1278198e4c3cSmrg	echo sxace-nec-superux"$UNAME_RELEASE"
127993493779Smrg	exit ;;
12806c321187Smrg    Power*:Rhapsody:*:*)
1281198e4c3cSmrg	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
12826c321187Smrg	exit ;;
12836c321187Smrg    *:Rhapsody:*:*)
1284198e4c3cSmrg	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
12856c321187Smrg	exit ;;
12866c321187Smrg    *:Darwin:*:*)
12876c321187Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1288198e4c3cSmrg	eval "$set_cc_for_build"
12899d0b5e55Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
12909d0b5e55Smrg	    UNAME_PROCESSOR=powerpc
12919d0b5e55Smrg	fi
1292198e4c3cSmrg	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
1293198e4c3cSmrg	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
1294198e4c3cSmrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1295198e4c3cSmrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1296198e4c3cSmrg		       grep IS_64BIT_ARCH >/dev/null
1297198e4c3cSmrg		then
1298198e4c3cSmrg		    case $UNAME_PROCESSOR in
1299198e4c3cSmrg			i386) UNAME_PROCESSOR=x86_64 ;;
1300198e4c3cSmrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
1301198e4c3cSmrg		    esac
1302198e4c3cSmrg		fi
1303198e4c3cSmrg		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1304198e4c3cSmrg		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1305198e4c3cSmrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1306198e4c3cSmrg		       grep IS_PPC >/dev/null
1307198e4c3cSmrg		then
1308198e4c3cSmrg		    UNAME_PROCESSOR=powerpc
1309198e4c3cSmrg		fi
13109d0b5e55Smrg	    fi
1311198e4c3cSmrg	elif test "$UNAME_PROCESSOR" = i386 ; then
1312198e4c3cSmrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
1313198e4c3cSmrg	    # that puts up a graphical alert prompting to install
1314198e4c3cSmrg	    # developer tools.  Any system running Mac OS X 10.7 or
1315198e4c3cSmrg	    # later (Darwin 11 and later) is required to have a 64-bit
1316198e4c3cSmrg	    # processor. This is not true of the ARM version of Darwin
1317198e4c3cSmrg	    # that Apple uses in portable devices.
1318198e4c3cSmrg	    UNAME_PROCESSOR=x86_64
13199d0b5e55Smrg	fi
1320198e4c3cSmrg	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
13216c321187Smrg	exit ;;
13226c321187Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
13236c321187Smrg	UNAME_PROCESSOR=`uname -p`
1324198e4c3cSmrg	if test "$UNAME_PROCESSOR" = x86; then
13256c321187Smrg		UNAME_PROCESSOR=i386
13266c321187Smrg		UNAME_MACHINE=pc
13276c321187Smrg	fi
1328198e4c3cSmrg	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
13296c321187Smrg	exit ;;
13306c321187Smrg    *:QNX:*:4*)
13316c321187Smrg	echo i386-pc-qnx
13326c321187Smrg	exit ;;
1333198e4c3cSmrg    NEO-*:NONSTOP_KERNEL:*:*)
1334198e4c3cSmrg	echo neo-tandem-nsk"$UNAME_RELEASE"
13359d0b5e55Smrg	exit ;;
13369d0b5e55Smrg    NSE-*:NONSTOP_KERNEL:*:*)
1337198e4c3cSmrg	echo nse-tandem-nsk"$UNAME_RELEASE"
1338198e4c3cSmrg	exit ;;
1339198e4c3cSmrg    NSR-*:NONSTOP_KERNEL:*:*)
1340198e4c3cSmrg	echo nsr-tandem-nsk"$UNAME_RELEASE"
13416c321187Smrg	exit ;;
1342198e4c3cSmrg    NSV-*:NONSTOP_KERNEL:*:*)
1343198e4c3cSmrg	echo nsv-tandem-nsk"$UNAME_RELEASE"
1344198e4c3cSmrg	exit ;;
1345198e4c3cSmrg    NSX-*:NONSTOP_KERNEL:*:*)
1346198e4c3cSmrg	echo nsx-tandem-nsk"$UNAME_RELEASE"
13476c321187Smrg	exit ;;
13486c321187Smrg    *:NonStop-UX:*:*)
13496c321187Smrg	echo mips-compaq-nonstopux
13506c321187Smrg	exit ;;
13516c321187Smrg    BS2000:POSIX*:*:*)
13526c321187Smrg	echo bs2000-siemens-sysv
13536c321187Smrg	exit ;;
13546c321187Smrg    DS/*:UNIX_System_V:*:*)
1355198e4c3cSmrg	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
13566c321187Smrg	exit ;;
13576c321187Smrg    *:Plan9:*:*)
13586c321187Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
13596c321187Smrg	# is converted to i386 for consistency with other x86
13606c321187Smrg	# operating systems.
1361198e4c3cSmrg	if test "$cputype" = 386; then
13626c321187Smrg	    UNAME_MACHINE=i386
13636c321187Smrg	else
13646c321187Smrg	    UNAME_MACHINE="$cputype"
13656c321187Smrg	fi
1366198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-plan9
13676c321187Smrg	exit ;;
13686c321187Smrg    *:TOPS-10:*:*)
13696c321187Smrg	echo pdp10-unknown-tops10
13706c321187Smrg	exit ;;
13716c321187Smrg    *:TENEX:*:*)
13726c321187Smrg	echo pdp10-unknown-tenex
13736c321187Smrg	exit ;;
13746c321187Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
13756c321187Smrg	echo pdp10-dec-tops20
13766c321187Smrg	exit ;;
13776c321187Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
13786c321187Smrg	echo pdp10-xkl-tops20
13796c321187Smrg	exit ;;
13806c321187Smrg    *:TOPS-20:*:*)
13816c321187Smrg	echo pdp10-unknown-tops20
13826c321187Smrg	exit ;;
13836c321187Smrg    *:ITS:*:*)
13846c321187Smrg	echo pdp10-unknown-its
13856c321187Smrg	exit ;;
13866c321187Smrg    SEI:*:*:SEIUX)
1387198e4c3cSmrg	echo mips-sei-seiux"$UNAME_RELEASE"
13886c321187Smrg	exit ;;
13896c321187Smrg    *:DragonFly:*:*)
1390198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
13916c321187Smrg	exit ;;
13926c321187Smrg    *:*VMS:*:*)
13939d0b5e55Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1394198e4c3cSmrg	case "$UNAME_MACHINE" in
13956c321187Smrg	    A*) echo alpha-dec-vms ; exit ;;
13966c321187Smrg	    I*) echo ia64-dec-vms ; exit ;;
13976c321187Smrg	    V*) echo vax-dec-vms ; exit ;;
13986c321187Smrg	esac ;;
13996c321187Smrg    *:XENIX:*:SysV)
14006c321187Smrg	echo i386-pc-xenix
14016c321187Smrg	exit ;;
14026c321187Smrg    i*86:skyos:*:*)
1403198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
14046c321187Smrg	exit ;;
14056c321187Smrg    i*86:rdos:*:*)
1406198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-rdos
14076c321187Smrg	exit ;;
1408e120bd27Smrg    i*86:AROS:*:*)
1409198e4c3cSmrg	echo "$UNAME_MACHINE"-pc-aros
1410e120bd27Smrg	exit ;;
14119d0b5e55Smrg    x86_64:VMkernel:*:*)
1412198e4c3cSmrg	echo "$UNAME_MACHINE"-unknown-esx
1413198e4c3cSmrg	exit ;;
1414198e4c3cSmrg    amd64:Isilon\ OneFS:*:*)
1415198e4c3cSmrg	echo x86_64-unknown-onefs
14169d0b5e55Smrg	exit ;;
14176c321187Smrgesac
14186c321187Smrg
1419198e4c3cSmrgecho "$0: unable to guess system type" >&2
14206c321187Smrg
1421198e4c3cSmrgcase "$UNAME_MACHINE:$UNAME_SYSTEM" in
1422198e4c3cSmrg    mips:Linux | mips64:Linux)
1423198e4c3cSmrg	# If we got here on MIPS GNU/Linux, output extra information.
1424198e4c3cSmrg	cat >&2 <<EOF
14256c321187Smrg
1426198e4c3cSmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1427198e4c3cSmrgthe system type. Please install a C compiler and try again.
14286c321187SmrgEOF
1429198e4c3cSmrg	;;
1430198e4c3cSmrgesac
14316c321187Smrg
14326c321187Smrgcat >&2 <<EOF
14336c321187Smrg
1434198e4c3cSmrgThis script (version $timestamp), has failed to recognize the
1435198e4c3cSmrgoperating system you are using. If your script is old, overwrite *all*
1436198e4c3cSmrgcopies of config.guess and config.sub with the latest versions from:
14376c321187Smrg
1438198e4c3cSmrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
14396c321187Smrgand
1440198e4c3cSmrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
14416c321187Smrg
1442198e4c3cSmrgIf $0 has already been updated, send the following data and any
1443198e4c3cSmrginformation you think might be pertinent to config-patches@gnu.org to
1444198e4c3cSmrgprovide the necessary information to handle your system.
14456c321187Smrg
14466c321187Smrgconfig.guess timestamp = $timestamp
14476c321187Smrg
14486c321187Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
14496c321187Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
14506c321187Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
14516c321187Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
14526c321187Smrg
14536c321187Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
14546c321187Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
14556c321187Smrg
14566c321187Smrghostinfo               = `(hostinfo) 2>/dev/null`
14576c321187Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
14586c321187Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
14596c321187Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
14606c321187Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
14616c321187Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
14626c321187Smrg
1463198e4c3cSmrgUNAME_MACHINE = "$UNAME_MACHINE"
1464198e4c3cSmrgUNAME_RELEASE = "$UNAME_RELEASE"
1465198e4c3cSmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
1466198e4c3cSmrgUNAME_VERSION = "$UNAME_VERSION"
14676c321187SmrgEOF
14686c321187Smrg
14696c321187Smrgexit 1
14706c321187Smrg
14716c321187Smrg# Local variables:
1472198e4c3cSmrg# eval: (add-hook 'write-file-functions 'time-stamp)
14736c321187Smrg# time-stamp-start: "timestamp='"
14746c321187Smrg# time-stamp-format: "%:y-%02m-%02d"
14756c321187Smrg# time-stamp-end: "'"
14766c321187Smrg# End:
1477