1b8f75c19Smrg#! /bin/sh
2b8f75c19Smrg# Attempt to guess a canonical system name.
38832ea4aSmrg#   Copyright 1992-2014 Free Software Foundation, Inc.
4b8f75c19Smrg
58832ea4aSmrgtimestamp='2014-11-04'
6b8f75c19Smrg
7b8f75c19Smrg# This file is free software; you can redistribute it and/or modify it
8b8f75c19Smrg# under the terms of the GNU General Public License as published by
98e4923e5Smrg# the Free Software Foundation; either version 3 of the License, or
10b8f75c19Smrg# (at your option) any later version.
11b8f75c19Smrg#
12b8f75c19Smrg# This program is distributed in the hope that it will be useful, but
13b8f75c19Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
14b8f75c19Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15b8f75c19Smrg# General Public License for more details.
16b8f75c19Smrg#
17b8f75c19Smrg# You should have received a copy of the GNU General Public License
188e4923e5Smrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
19b8f75c19Smrg#
20b8f75c19Smrg# As a special exception to the GNU General Public License, if you
21b8f75c19Smrg# distribute this file as part of a program that contains a
22b8f75c19Smrg# configuration script generated by Autoconf, you may include it under
238e4923e5Smrg# the same distribution terms that you use for the rest of that
248e4923e5Smrg# program.  This Exception is an additional permission under section 7
258e4923e5Smrg# of the GNU General Public License, version 3 ("GPLv3").
26b8f75c19Smrg#
278832ea4aSmrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
28b8f75c19Smrg#
297e4fd55aSmrg# You can get the latest version of this script from:
307e4fd55aSmrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
318e4923e5Smrg#
328832ea4aSmrg# Please send patches to <config-patches@gnu.org>.
338e4923e5Smrg
34b8f75c19Smrg
35b8f75c19Smrgme=`echo "$0" | sed -e 's,.*/,,'`
36b8f75c19Smrg
37b8f75c19Smrgusage="\
38b8f75c19SmrgUsage: $0 [OPTION]
39b8f75c19Smrg
40b8f75c19SmrgOutput the configuration name of the system \`$me' is run on.
41b8f75c19Smrg
42b8f75c19SmrgOperation modes:
43b8f75c19Smrg  -h, --help         print this help, then exit
44b8f75c19Smrg  -t, --time-stamp   print date of last modification, then exit
45b8f75c19Smrg  -v, --version      print version number, then exit
46b8f75c19Smrg
47b8f75c19SmrgReport bugs and patches to <config-patches@gnu.org>."
48b8f75c19Smrg
49b8f75c19Smrgversion="\
50b8f75c19SmrgGNU config.guess ($timestamp)
51b8f75c19Smrg
52b8f75c19SmrgOriginally written by Per Bothner.
538832ea4aSmrgCopyright 1992-2014 Free Software Foundation, Inc.
54b8f75c19Smrg
55b8f75c19SmrgThis is free software; see the source for copying conditions.  There is NO
56b8f75c19Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57b8f75c19Smrg
58b8f75c19Smrghelp="
59b8f75c19SmrgTry \`$me --help' for more information."
60b8f75c19Smrg
61b8f75c19Smrg# Parse command line
62b8f75c19Smrgwhile test $# -gt 0 ; do
63b8f75c19Smrg  case $1 in
64b8f75c19Smrg    --time-stamp | --time* | -t )
657e4fd55aSmrg       echo "$timestamp" ; exit ;;
66b8f75c19Smrg    --version | -v )
677e4fd55aSmrg       echo "$version" ; exit ;;
68b8f75c19Smrg    --help | --h* | -h )
697e4fd55aSmrg       echo "$usage"; exit ;;
70b8f75c19Smrg    -- )     # Stop option processing
71b8f75c19Smrg       shift; break ;;
72b8f75c19Smrg    - )	# Use stdin as input.
73b8f75c19Smrg       break ;;
74b8f75c19Smrg    -* )
75b8f75c19Smrg       echo "$me: invalid option $1$help" >&2
76b8f75c19Smrg       exit 1 ;;
77b8f75c19Smrg    * )
78b8f75c19Smrg       break ;;
79b8f75c19Smrg  esac
80b8f75c19Smrgdone
81b8f75c19Smrg
82b8f75c19Smrgif test $# != 0; then
83b8f75c19Smrg  echo "$me: too many arguments$help" >&2
84b8f75c19Smrg  exit 1
85b8f75c19Smrgfi
86b8f75c19Smrg
878e4923e5Smrgtrap 'exit 1' 1 2 15
88b8f75c19Smrg
89b8f75c19Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90b8f75c19Smrg# compiler to aid in system detection is discouraged as it requires
91b8f75c19Smrg# temporary files to be created and, as you can see below, it is a
92b8f75c19Smrg# headache to deal with in a portable fashion.
93b8f75c19Smrg
94b8f75c19Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
95b8f75c19Smrg# use `HOST_CC' if defined, but it is deprecated.
96b8f75c19Smrg
97b8f75c19Smrg# Portable tmp directory creation inspired by the Autoconf team.
98b8f75c19Smrg
99b8f75c19Smrgset_cc_for_build='
100b8f75c19Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1018e4923e5Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102b8f75c19Smrg: ${TMPDIR=/tmp} ;
1037e4fd55aSmrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104b8f75c19Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105b8f75c19Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106b8f75c19Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107b8f75c19Smrgdummy=$tmp/dummy ;
108b8f75c19Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109b8f75c19Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
110b8f75c19Smrg ,,)    echo "int x;" > $dummy.c ;
111b8f75c19Smrg	for c in cc gcc c89 c99 ; do
112b8f75c19Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
113b8f75c19Smrg	     CC_FOR_BUILD="$c"; break ;
114b8f75c19Smrg	  fi ;
115b8f75c19Smrg	done ;
116b8f75c19Smrg	if test x"$CC_FOR_BUILD" = x ; then
117b8f75c19Smrg	  CC_FOR_BUILD=no_compiler_found ;
118b8f75c19Smrg	fi
119b8f75c19Smrg	;;
120b8f75c19Smrg ,,*)   CC_FOR_BUILD=$CC ;;
121b8f75c19Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1227e4fd55aSmrgesac ; set_cc_for_build= ;'
123b8f75c19Smrg
124b8f75c19Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125b8f75c19Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
126b8f75c19Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
127b8f75c19Smrg	PATH=$PATH:/.attbin ; export PATH
128b8f75c19Smrgfi
129b8f75c19Smrg
130b8f75c19SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
131b8f75c19SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132b8f75c19SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
133b8f75c19SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134b8f75c19Smrg
1358e4923e5Smrgcase "${UNAME_SYSTEM}" in
1368e4923e5SmrgLinux|GNU|GNU/*)
1378e4923e5Smrg	# If the system lacks a compiler, then just pick glibc.
1388e4923e5Smrg	# We could probably try harder.
1398e4923e5Smrg	LIBC=gnu
1408e4923e5Smrg
1418e4923e5Smrg	eval $set_cc_for_build
1428e4923e5Smrg	cat <<-EOF > $dummy.c
1438e4923e5Smrg	#include <features.h>
1448e4923e5Smrg	#if defined(__UCLIBC__)
1458e4923e5Smrg	LIBC=uclibc
1468e4923e5Smrg	#elif defined(__dietlibc__)
1478e4923e5Smrg	LIBC=dietlibc
1488e4923e5Smrg	#else
1498e4923e5Smrg	LIBC=gnu
1508e4923e5Smrg	#endif
1518e4923e5Smrg	EOF
1528832ea4aSmrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
1538e4923e5Smrg	;;
1548e4923e5Smrgesac
1558e4923e5Smrg
156b8f75c19Smrg# Note: order is significant - the case branches are not exclusive.
157b8f75c19Smrg
158b8f75c19Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
159b8f75c19Smrg    *:NetBSD:*:*)
160b8f75c19Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
1618e4923e5Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
162b8f75c19Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
163b8f75c19Smrg	# switched to ELF, *-*-netbsd* would select the old
164b8f75c19Smrg	# object file format.  This provides both forward
165b8f75c19Smrg	# compatibility and a consistent mechanism for selecting the
166b8f75c19Smrg	# object file format.
167b8f75c19Smrg	#
168b8f75c19Smrg	# Note: NetBSD doesn't particularly care about the vendor
169b8f75c19Smrg	# portion of the name.  We always set it to "unknown".
170b8f75c19Smrg	sysctl="sysctl -n hw.machine_arch"
171b8f75c19Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
172b8f75c19Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
173b8f75c19Smrg	case "${UNAME_MACHINE_ARCH}" in
174b8f75c19Smrg	    armeb) machine=armeb-unknown ;;
175b8f75c19Smrg	    arm*) machine=arm-unknown ;;
176b8f75c19Smrg	    sh3el) machine=shl-unknown ;;
177b8f75c19Smrg	    sh3eb) machine=sh-unknown ;;
1787e4fd55aSmrg	    sh5el) machine=sh5le-unknown ;;
179b8f75c19Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
180b8f75c19Smrg	esac
181b8f75c19Smrg	# The Operating System including object format, if it has switched
182b8f75c19Smrg	# to ELF recently, or will in the future.
183b8f75c19Smrg	case "${UNAME_MACHINE_ARCH}" in
184b8f75c19Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
185b8f75c19Smrg		eval $set_cc_for_build
186b8f75c19Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1877e4fd55aSmrg			| grep -q __ELF__
188b8f75c19Smrg		then
189b8f75c19Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
190b8f75c19Smrg		    # Return netbsd for either.  FIX?
191b8f75c19Smrg		    os=netbsd
192b8f75c19Smrg		else
193b8f75c19Smrg		    os=netbsdelf
194b8f75c19Smrg		fi
195b8f75c19Smrg		;;
196b8f75c19Smrg	    *)
1978e4923e5Smrg		os=netbsd
198b8f75c19Smrg		;;
199b8f75c19Smrg	esac
200b8f75c19Smrg	# The OS release
201b8f75c19Smrg	# Debian GNU/NetBSD machines have a different userland, and
202b8f75c19Smrg	# thus, need a distinct triplet. However, they do not need
203b8f75c19Smrg	# kernel version information, so it can be replaced with a
204b8f75c19Smrg	# suitable tag, in the style of linux-gnu.
205b8f75c19Smrg	case "${UNAME_VERSION}" in
206b8f75c19Smrg	    Debian*)
207b8f75c19Smrg		release='-gnu'
208b8f75c19Smrg		;;
209b8f75c19Smrg	    *)
210b8f75c19Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
211b8f75c19Smrg		;;
212b8f75c19Smrg	esac
213b8f75c19Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
214b8f75c19Smrg	# contains redundant information, the shorter form:
215b8f75c19Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
216b8f75c19Smrg	echo "${machine}-${os}${release}"
2177e4fd55aSmrg	exit ;;
2188e4923e5Smrg    *:Bitrig:*:*)
2198e4923e5Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
2208e4923e5Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
2218e4923e5Smrg	exit ;;
222b8f75c19Smrg    *:OpenBSD:*:*)
2237e4fd55aSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2247e4fd55aSmrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2257e4fd55aSmrg	exit ;;
2267e4fd55aSmrg    *:ekkoBSD:*:*)
2277e4fd55aSmrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2287e4fd55aSmrg	exit ;;
2297e4fd55aSmrg    *:SolidBSD:*:*)
2307e4fd55aSmrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2317e4fd55aSmrg	exit ;;
2327e4fd55aSmrg    macppc:MirBSD:*:*)
2337e4fd55aSmrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2347e4fd55aSmrg	exit ;;
2357e4fd55aSmrg    *:MirBSD:*:*)
2367e4fd55aSmrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2377e4fd55aSmrg	exit ;;
238b8f75c19Smrg    alpha:OSF1:*:*)
2397e4fd55aSmrg	case $UNAME_RELEASE in
2407e4fd55aSmrg	*4.0)
241b8f75c19Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2427e4fd55aSmrg		;;
2437e4fd55aSmrg	*5.*)
2448e4923e5Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2457e4fd55aSmrg		;;
2467e4fd55aSmrg	esac
247b8f75c19Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
248b8f75c19Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
249b8f75c19Smrg	# covers most systems running today.  This code pipes the CPU
250b8f75c19Smrg	# types through head -n 1, so we only detect the type of CPU 0.
251b8f75c19Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
252b8f75c19Smrg	case "$ALPHA_CPU_TYPE" in
253b8f75c19Smrg	    "EV4 (21064)")
254b8f75c19Smrg		UNAME_MACHINE="alpha" ;;
255b8f75c19Smrg	    "EV4.5 (21064)")
256b8f75c19Smrg		UNAME_MACHINE="alpha" ;;
257b8f75c19Smrg	    "LCA4 (21066/21068)")
258b8f75c19Smrg		UNAME_MACHINE="alpha" ;;
259b8f75c19Smrg	    "EV5 (21164)")
260b8f75c19Smrg		UNAME_MACHINE="alphaev5" ;;
261b8f75c19Smrg	    "EV5.6 (21164A)")
262b8f75c19Smrg		UNAME_MACHINE="alphaev56" ;;
263b8f75c19Smrg	    "EV5.6 (21164PC)")
264b8f75c19Smrg		UNAME_MACHINE="alphapca56" ;;
265b8f75c19Smrg	    "EV5.7 (21164PC)")
266b8f75c19Smrg		UNAME_MACHINE="alphapca57" ;;
267b8f75c19Smrg	    "EV6 (21264)")
268b8f75c19Smrg		UNAME_MACHINE="alphaev6" ;;
269b8f75c19Smrg	    "EV6.7 (21264A)")
270b8f75c19Smrg		UNAME_MACHINE="alphaev67" ;;
271b8f75c19Smrg	    "EV6.8CB (21264C)")
272b8f75c19Smrg		UNAME_MACHINE="alphaev68" ;;
273b8f75c19Smrg	    "EV6.8AL (21264B)")
274b8f75c19Smrg		UNAME_MACHINE="alphaev68" ;;
275b8f75c19Smrg	    "EV6.8CX (21264D)")
276b8f75c19Smrg		UNAME_MACHINE="alphaev68" ;;
277b8f75c19Smrg	    "EV6.9A (21264/EV69A)")
278b8f75c19Smrg		UNAME_MACHINE="alphaev69" ;;
279b8f75c19Smrg	    "EV7 (21364)")
280b8f75c19Smrg		UNAME_MACHINE="alphaev7" ;;
281b8f75c19Smrg	    "EV7.9 (21364A)")
282b8f75c19Smrg		UNAME_MACHINE="alphaev79" ;;
283b8f75c19Smrg	esac
2847e4fd55aSmrg	# A Pn.n version is a patched version.
285b8f75c19Smrg	# A Vn.n version is a released version.
286b8f75c19Smrg	# A Tn.n version is a released field test version.
287b8f75c19Smrg	# A Xn.n version is an unreleased experimental baselevel.
288b8f75c19Smrg	# 1.2 uses "1.2" for uname -r.
2897e4fd55aSmrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
2908e4923e5Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
2918e4923e5Smrg	exitcode=$?
2928e4923e5Smrg	trap '' 0
2938e4923e5Smrg	exit $exitcode ;;
294b8f75c19Smrg    Alpha\ *:Windows_NT*:*)
295b8f75c19Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
296b8f75c19Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
297b8f75c19Smrg	# of the specific Alpha model?
298b8f75c19Smrg	echo alpha-pc-interix
2997e4fd55aSmrg	exit ;;
300b8f75c19Smrg    21064:Windows_NT:50:3)
301b8f75c19Smrg	echo alpha-dec-winnt3.5
3027e4fd55aSmrg	exit ;;
303b8f75c19Smrg    Amiga*:UNIX_System_V:4.0:*)
304b8f75c19Smrg	echo m68k-unknown-sysv4
3057e4fd55aSmrg	exit ;;
306b8f75c19Smrg    *:[Aa]miga[Oo][Ss]:*:*)
307b8f75c19Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
3087e4fd55aSmrg	exit ;;
309b8f75c19Smrg    *:[Mm]orph[Oo][Ss]:*:*)
310b8f75c19Smrg	echo ${UNAME_MACHINE}-unknown-morphos
3117e4fd55aSmrg	exit ;;
312b8f75c19Smrg    *:OS/390:*:*)
313b8f75c19Smrg	echo i370-ibm-openedition
3147e4fd55aSmrg	exit ;;
3157e4fd55aSmrg    *:z/VM:*:*)
3167e4fd55aSmrg	echo s390-ibm-zvmoe
3177e4fd55aSmrg	exit ;;
3187e4fd55aSmrg    *:OS400:*:*)
3198e4923e5Smrg	echo powerpc-ibm-os400
3207e4fd55aSmrg	exit ;;
321b8f75c19Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
322b8f75c19Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
3237e4fd55aSmrg	exit ;;
3248e4923e5Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
3257e4fd55aSmrg	echo arm-unknown-riscos
3267e4fd55aSmrg	exit ;;
327b8f75c19Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
328b8f75c19Smrg	echo hppa1.1-hitachi-hiuxmpp
3297e4fd55aSmrg	exit ;;
330b8f75c19Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
331b8f75c19Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
332b8f75c19Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
333b8f75c19Smrg		echo pyramid-pyramid-sysv3
334b8f75c19Smrg	else
335b8f75c19Smrg		echo pyramid-pyramid-bsd
336b8f75c19Smrg	fi
3377e4fd55aSmrg	exit ;;
338b8f75c19Smrg    NILE*:*:*:dcosx)
339b8f75c19Smrg	echo pyramid-pyramid-svr4
3407e4fd55aSmrg	exit ;;
341b8f75c19Smrg    DRS?6000:unix:4.0:6*)
342b8f75c19Smrg	echo sparc-icl-nx6
3437e4fd55aSmrg	exit ;;
3447e4fd55aSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
345b8f75c19Smrg	case `/usr/bin/uname -p` in
3467e4fd55aSmrg	    sparc) echo sparc-icl-nx7; exit ;;
347b8f75c19Smrg	esac ;;
3487e4fd55aSmrg    s390x:SunOS:*:*)
3497e4fd55aSmrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3507e4fd55aSmrg	exit ;;
351b8f75c19Smrg    sun4H:SunOS:5.*:*)
352b8f75c19Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3537e4fd55aSmrg	exit ;;
354b8f75c19Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
355b8f75c19Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3567e4fd55aSmrg	exit ;;
3577e4fd55aSmrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
3587e4fd55aSmrg	echo i386-pc-auroraux${UNAME_RELEASE}
3597e4fd55aSmrg	exit ;;
3607e4fd55aSmrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3617e4fd55aSmrg	eval $set_cc_for_build
3627e4fd55aSmrg	SUN_ARCH="i386"
3637e4fd55aSmrg	# If there is a compiler, see if it is configured for 64-bit objects.
3647e4fd55aSmrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
3657e4fd55aSmrg	# This test works for both compilers.
3667e4fd55aSmrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
3677e4fd55aSmrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
3687e4fd55aSmrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
3697e4fd55aSmrg		grep IS_64BIT_ARCH >/dev/null
3707e4fd55aSmrg	    then
3717e4fd55aSmrg		SUN_ARCH="x86_64"
3727e4fd55aSmrg	    fi
3737e4fd55aSmrg	fi
3747e4fd55aSmrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3757e4fd55aSmrg	exit ;;
376b8f75c19Smrg    sun4*:SunOS:6*:*)
377b8f75c19Smrg	# According to config.sub, this is the proper way to canonicalize
378b8f75c19Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
379b8f75c19Smrg	# it's likely to be more like Solaris than SunOS4.
380b8f75c19Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3817e4fd55aSmrg	exit ;;
382b8f75c19Smrg    sun4*:SunOS:*:*)
383b8f75c19Smrg	case "`/usr/bin/arch -k`" in
384b8f75c19Smrg	    Series*|S4*)
385b8f75c19Smrg		UNAME_RELEASE=`uname -v`
386b8f75c19Smrg		;;
387b8f75c19Smrg	esac
388b8f75c19Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
389b8f75c19Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3907e4fd55aSmrg	exit ;;
391b8f75c19Smrg    sun3*:SunOS:*:*)
392b8f75c19Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
3937e4fd55aSmrg	exit ;;
394b8f75c19Smrg    sun*:*:4.2BSD:*)
395b8f75c19Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
396b8f75c19Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
397b8f75c19Smrg	case "`/bin/arch`" in
398b8f75c19Smrg	    sun3)
399b8f75c19Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
400b8f75c19Smrg		;;
401b8f75c19Smrg	    sun4)
402b8f75c19Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
403b8f75c19Smrg		;;
404b8f75c19Smrg	esac
4057e4fd55aSmrg	exit ;;
406b8f75c19Smrg    aushp:SunOS:*:*)
407b8f75c19Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
4087e4fd55aSmrg	exit ;;
409b8f75c19Smrg    # The situation for MiNT is a little confusing.  The machine name
410b8f75c19Smrg    # can be virtually everything (everything which is not
411b8f75c19Smrg    # "atarist" or "atariste" at least should have a processor
412b8f75c19Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
413b8f75c19Smrg    # to the lowercase version "mint" (or "freemint").  Finally
414b8f75c19Smrg    # the system name "TOS" denotes a system which is actually not
415b8f75c19Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
416b8f75c19Smrg    # be no problem.
417b8f75c19Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4188e4923e5Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4197e4fd55aSmrg	exit ;;
420b8f75c19Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
421b8f75c19Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4228e4923e5Smrg	exit ;;
423b8f75c19Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4248e4923e5Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4257e4fd55aSmrg	exit ;;
426b8f75c19Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4278e4923e5Smrg	echo m68k-milan-mint${UNAME_RELEASE}
4288e4923e5Smrg	exit ;;
429b8f75c19Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4308e4923e5Smrg	echo m68k-hades-mint${UNAME_RELEASE}
4318e4923e5Smrg	exit ;;
432b8f75c19Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4338e4923e5Smrg	echo m68k-unknown-mint${UNAME_RELEASE}
4348e4923e5Smrg	exit ;;
4357e4fd55aSmrg    m68k:machten:*:*)
4367e4fd55aSmrg	echo m68k-apple-machten${UNAME_RELEASE}
4377e4fd55aSmrg	exit ;;
438b8f75c19Smrg    powerpc:machten:*:*)
439b8f75c19Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
4407e4fd55aSmrg	exit ;;
441b8f75c19Smrg    RISC*:Mach:*:*)
442b8f75c19Smrg	echo mips-dec-mach_bsd4.3
4437e4fd55aSmrg	exit ;;
444b8f75c19Smrg    RISC*:ULTRIX:*:*)
445b8f75c19Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
4467e4fd55aSmrg	exit ;;
447b8f75c19Smrg    VAX*:ULTRIX*:*:*)
448b8f75c19Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
4497e4fd55aSmrg	exit ;;
450b8f75c19Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
451b8f75c19Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4527e4fd55aSmrg	exit ;;
453b8f75c19Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
454b8f75c19Smrg	eval $set_cc_for_build
455b8f75c19Smrg	sed 's/^	//' << EOF >$dummy.c
456b8f75c19Smrg#ifdef __cplusplus
457b8f75c19Smrg#include <stdio.h>  /* for printf() prototype */
458b8f75c19Smrg	int main (int argc, char *argv[]) {
459b8f75c19Smrg#else
460b8f75c19Smrg	int main (argc, argv) int argc; char *argv[]; {
461b8f75c19Smrg#endif
462b8f75c19Smrg	#if defined (host_mips) && defined (MIPSEB)
463b8f75c19Smrg	#if defined (SYSTYPE_SYSV)
464b8f75c19Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
465b8f75c19Smrg	#endif
466b8f75c19Smrg	#if defined (SYSTYPE_SVR4)
467b8f75c19Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
468b8f75c19Smrg	#endif
469b8f75c19Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
470b8f75c19Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
471b8f75c19Smrg	#endif
472b8f75c19Smrg	#endif
473b8f75c19Smrg	  exit (-1);
474b8f75c19Smrg	}
475b8f75c19SmrgEOF
4767e4fd55aSmrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4777e4fd55aSmrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4787e4fd55aSmrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4797e4fd55aSmrg	    { echo "$SYSTEM_NAME"; exit; }
480b8f75c19Smrg	echo mips-mips-riscos${UNAME_RELEASE}
4817e4fd55aSmrg	exit ;;
482b8f75c19Smrg    Motorola:PowerMAX_OS:*:*)
483b8f75c19Smrg	echo powerpc-motorola-powermax
4847e4fd55aSmrg	exit ;;
485b8f75c19Smrg    Motorola:*:4.3:PL8-*)
486b8f75c19Smrg	echo powerpc-harris-powermax
4877e4fd55aSmrg	exit ;;
488b8f75c19Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
489b8f75c19Smrg	echo powerpc-harris-powermax
4907e4fd55aSmrg	exit ;;
491b8f75c19Smrg    Night_Hawk:Power_UNIX:*:*)
492b8f75c19Smrg	echo powerpc-harris-powerunix
4937e4fd55aSmrg	exit ;;
494b8f75c19Smrg    m88k:CX/UX:7*:*)
495b8f75c19Smrg	echo m88k-harris-cxux7
4967e4fd55aSmrg	exit ;;
497b8f75c19Smrg    m88k:*:4*:R4*)
498b8f75c19Smrg	echo m88k-motorola-sysv4
4997e4fd55aSmrg	exit ;;
500b8f75c19Smrg    m88k:*:3*:R3*)
501b8f75c19Smrg	echo m88k-motorola-sysv3
5027e4fd55aSmrg	exit ;;
503b8f75c19Smrg    AViiON:dgux:*:*)
5048e4923e5Smrg	# DG/UX returns AViiON for all architectures
5058e4923e5Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
506b8f75c19Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
507b8f75c19Smrg	then
508b8f75c19Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
509b8f75c19Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
510b8f75c19Smrg	    then
511b8f75c19Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
512b8f75c19Smrg	    else
513b8f75c19Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
514b8f75c19Smrg	    fi
515b8f75c19Smrg	else
516b8f75c19Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
517b8f75c19Smrg	fi
5188e4923e5Smrg	exit ;;
519b8f75c19Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
520b8f75c19Smrg	echo m88k-dolphin-sysv3
5217e4fd55aSmrg	exit ;;
522b8f75c19Smrg    M88*:*:R3*:*)
523b8f75c19Smrg	# Delta 88k system running SVR3
524b8f75c19Smrg	echo m88k-motorola-sysv3
5257e4fd55aSmrg	exit ;;
526b8f75c19Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
527b8f75c19Smrg	echo m88k-tektronix-sysv3
5287e4fd55aSmrg	exit ;;
529b8f75c19Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
530b8f75c19Smrg	echo m68k-tektronix-bsd
5317e4fd55aSmrg	exit ;;
532b8f75c19Smrg    *:IRIX*:*:*)
533b8f75c19Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5347e4fd55aSmrg	exit ;;
535b8f75c19Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5367e4fd55aSmrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5377e4fd55aSmrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
538b8f75c19Smrg    i*86:AIX:*:*)
539b8f75c19Smrg	echo i386-ibm-aix
5407e4fd55aSmrg	exit ;;
541b8f75c19Smrg    ia64:AIX:*:*)
542b8f75c19Smrg	if [ -x /usr/bin/oslevel ] ; then
543b8f75c19Smrg		IBM_REV=`/usr/bin/oslevel`
544b8f75c19Smrg	else
545b8f75c19Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
546b8f75c19Smrg	fi
547b8f75c19Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5487e4fd55aSmrg	exit ;;
549b8f75c19Smrg    *:AIX:2:3)
550b8f75c19Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
551b8f75c19Smrg		eval $set_cc_for_build
552b8f75c19Smrg		sed 's/^		//' << EOF >$dummy.c
553b8f75c19Smrg		#include <sys/systemcfg.h>
554b8f75c19Smrg
555b8f75c19Smrg		main()
556b8f75c19Smrg			{
557b8f75c19Smrg			if (!__power_pc())
558b8f75c19Smrg				exit(1);
559b8f75c19Smrg			puts("powerpc-ibm-aix3.2.5");
560b8f75c19Smrg			exit(0);
561b8f75c19Smrg			}
562b8f75c19SmrgEOF
5637e4fd55aSmrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5647e4fd55aSmrg		then
5657e4fd55aSmrg			echo "$SYSTEM_NAME"
5667e4fd55aSmrg		else
5677e4fd55aSmrg			echo rs6000-ibm-aix3.2.5
5687e4fd55aSmrg		fi
569b8f75c19Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
570b8f75c19Smrg		echo rs6000-ibm-aix3.2.4
571b8f75c19Smrg	else
572b8f75c19Smrg		echo rs6000-ibm-aix3.2
573b8f75c19Smrg	fi
5747e4fd55aSmrg	exit ;;
5757e4fd55aSmrg    *:AIX:*:[4567])
576b8f75c19Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
577b8f75c19Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
578b8f75c19Smrg		IBM_ARCH=rs6000
579b8f75c19Smrg	else
580b8f75c19Smrg		IBM_ARCH=powerpc
581b8f75c19Smrg	fi
5828832ea4aSmrg	if [ -x /usr/bin/lslpp ] ; then
5838832ea4aSmrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
5848832ea4aSmrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
585b8f75c19Smrg	else
586b8f75c19Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
587b8f75c19Smrg	fi
588b8f75c19Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5897e4fd55aSmrg	exit ;;
590b8f75c19Smrg    *:AIX:*:*)
591b8f75c19Smrg	echo rs6000-ibm-aix
5927e4fd55aSmrg	exit ;;
593b8f75c19Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
594b8f75c19Smrg	echo romp-ibm-bsd4.4
5957e4fd55aSmrg	exit ;;
596b8f75c19Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
597b8f75c19Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5987e4fd55aSmrg	exit ;;                             # report: romp-ibm BSD 4.3
599b8f75c19Smrg    *:BOSX:*:*)
600b8f75c19Smrg	echo rs6000-bull-bosx
6017e4fd55aSmrg	exit ;;
602b8f75c19Smrg    DPX/2?00:B.O.S.:*:*)
603b8f75c19Smrg	echo m68k-bull-sysv3
6047e4fd55aSmrg	exit ;;
605b8f75c19Smrg    9000/[34]??:4.3bsd:1.*:*)
606b8f75c19Smrg	echo m68k-hp-bsd
6077e4fd55aSmrg	exit ;;
608b8f75c19Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
609b8f75c19Smrg	echo m68k-hp-bsd4.4
6107e4fd55aSmrg	exit ;;
611b8f75c19Smrg    9000/[34678]??:HP-UX:*:*)
612b8f75c19Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
613b8f75c19Smrg	case "${UNAME_MACHINE}" in
614b8f75c19Smrg	    9000/31? )            HP_ARCH=m68000 ;;
615b8f75c19Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
616b8f75c19Smrg	    9000/[678][0-9][0-9])
617b8f75c19Smrg		if [ -x /usr/bin/getconf ]; then
618b8f75c19Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
6198e4923e5Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
6208e4923e5Smrg		    case "${sc_cpu_version}" in
6218e4923e5Smrg		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
6228e4923e5Smrg		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
6238e4923e5Smrg		      532)                      # CPU_PA_RISC2_0
6248e4923e5Smrg			case "${sc_kernel_bits}" in
6258e4923e5Smrg			  32) HP_ARCH="hppa2.0n" ;;
6268e4923e5Smrg			  64) HP_ARCH="hppa2.0w" ;;
627b8f75c19Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
6288e4923e5Smrg			esac ;;
6298e4923e5Smrg		    esac
630b8f75c19Smrg		fi
631b8f75c19Smrg		if [ "${HP_ARCH}" = "" ]; then
632b8f75c19Smrg		    eval $set_cc_for_build
6338e4923e5Smrg		    sed 's/^		//' << EOF >$dummy.c
634b8f75c19Smrg
6358e4923e5Smrg		#define _HPUX_SOURCE
6368e4923e5Smrg		#include <stdlib.h>
6378e4923e5Smrg		#include <unistd.h>
638b8f75c19Smrg
6398e4923e5Smrg		int main ()
6408e4923e5Smrg		{
6418e4923e5Smrg		#if defined(_SC_KERNEL_BITS)
6428e4923e5Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
6438e4923e5Smrg		#endif
6448e4923e5Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
645b8f75c19Smrg
6468e4923e5Smrg		    switch (cpu)
6478e4923e5Smrg			{
6488e4923e5Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6498e4923e5Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6508e4923e5Smrg			case CPU_PA_RISC2_0:
6518e4923e5Smrg		#if defined(_SC_KERNEL_BITS)
6528e4923e5Smrg			    switch (bits)
6538e4923e5Smrg				{
6548e4923e5Smrg				case 64: puts ("hppa2.0w"); break;
6558e4923e5Smrg				case 32: puts ("hppa2.0n"); break;
6568e4923e5Smrg				default: puts ("hppa2.0"); break;
6578e4923e5Smrg				} break;
6588e4923e5Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
6598e4923e5Smrg			    puts ("hppa2.0"); break;
6608e4923e5Smrg		#endif
6618e4923e5Smrg			default: puts ("hppa1.0"); break;
6628e4923e5Smrg			}
6638e4923e5Smrg		    exit (0);
6648e4923e5Smrg		}
665b8f75c19SmrgEOF
666b8f75c19Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
667b8f75c19Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
668b8f75c19Smrg		fi ;;
669b8f75c19Smrg	esac
670b8f75c19Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
671b8f75c19Smrg	then
6727e4fd55aSmrg	    eval $set_cc_for_build
6737e4fd55aSmrg
6747e4fd55aSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6757e4fd55aSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6767e4fd55aSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6777e4fd55aSmrg	    #
6787e4fd55aSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
6797e4fd55aSmrg	    # => hppa2.0w-hp-hpux11.23
6807e4fd55aSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6817e4fd55aSmrg	    # => hppa64-hp-hpux11.23
6827e4fd55aSmrg
6837e4fd55aSmrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
6847e4fd55aSmrg		grep -q __LP64__
685b8f75c19Smrg	    then
686b8f75c19Smrg		HP_ARCH="hppa2.0w"
687b8f75c19Smrg	    else
688b8f75c19Smrg		HP_ARCH="hppa64"
689b8f75c19Smrg	    fi
690b8f75c19Smrg	fi
691b8f75c19Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6927e4fd55aSmrg	exit ;;
693b8f75c19Smrg    ia64:HP-UX:*:*)
694b8f75c19Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
695b8f75c19Smrg	echo ia64-hp-hpux${HPUX_REV}
6967e4fd55aSmrg	exit ;;
697b8f75c19Smrg    3050*:HI-UX:*:*)
698b8f75c19Smrg	eval $set_cc_for_build
699b8f75c19Smrg	sed 's/^	//' << EOF >$dummy.c
700b8f75c19Smrg	#include <unistd.h>
701b8f75c19Smrg	int
702b8f75c19Smrg	main ()
703b8f75c19Smrg	{
704b8f75c19Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
705b8f75c19Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
706b8f75c19Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
707b8f75c19Smrg	     results, however.  */
708b8f75c19Smrg	  if (CPU_IS_PA_RISC (cpu))
709b8f75c19Smrg	    {
710b8f75c19Smrg	      switch (cpu)
711b8f75c19Smrg		{
712b8f75c19Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
713b8f75c19Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
714b8f75c19Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
715b8f75c19Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
716b8f75c19Smrg		}
717b8f75c19Smrg	    }
718b8f75c19Smrg	  else if (CPU_IS_HP_MC68K (cpu))
719b8f75c19Smrg	    puts ("m68k-hitachi-hiuxwe2");
720b8f75c19Smrg	  else puts ("unknown-hitachi-hiuxwe2");
721b8f75c19Smrg	  exit (0);
722b8f75c19Smrg	}
723b8f75c19SmrgEOF
7247e4fd55aSmrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7257e4fd55aSmrg		{ echo "$SYSTEM_NAME"; exit; }
726b8f75c19Smrg	echo unknown-hitachi-hiuxwe2
7277e4fd55aSmrg	exit ;;
728b8f75c19Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
729b8f75c19Smrg	echo hppa1.1-hp-bsd
7307e4fd55aSmrg	exit ;;
731b8f75c19Smrg    9000/8??:4.3bsd:*:*)
732b8f75c19Smrg	echo hppa1.0-hp-bsd
7337e4fd55aSmrg	exit ;;
734b8f75c19Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
735b8f75c19Smrg	echo hppa1.0-hp-mpeix
7367e4fd55aSmrg	exit ;;
737b8f75c19Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
738b8f75c19Smrg	echo hppa1.1-hp-osf
7397e4fd55aSmrg	exit ;;
740b8f75c19Smrg    hp8??:OSF1:*:*)
741b8f75c19Smrg	echo hppa1.0-hp-osf
7427e4fd55aSmrg	exit ;;
743b8f75c19Smrg    i*86:OSF1:*:*)
744b8f75c19Smrg	if [ -x /usr/sbin/sysversion ] ; then
745b8f75c19Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
746b8f75c19Smrg	else
747b8f75c19Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
748b8f75c19Smrg	fi
7497e4fd55aSmrg	exit ;;
750b8f75c19Smrg    parisc*:Lites*:*:*)
751b8f75c19Smrg	echo hppa1.1-hp-lites
7527e4fd55aSmrg	exit ;;
753b8f75c19Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
754b8f75c19Smrg	echo c1-convex-bsd
7558e4923e5Smrg	exit ;;
756b8f75c19Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
757b8f75c19Smrg	if getsysinfo -f scalar_acc
758b8f75c19Smrg	then echo c32-convex-bsd
759b8f75c19Smrg	else echo c2-convex-bsd
760b8f75c19Smrg	fi
7618e4923e5Smrg	exit ;;
762b8f75c19Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
763b8f75c19Smrg	echo c34-convex-bsd
7648e4923e5Smrg	exit ;;
765b8f75c19Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
766b8f75c19Smrg	echo c38-convex-bsd
7678e4923e5Smrg	exit ;;
768b8f75c19Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
769b8f75c19Smrg	echo c4-convex-bsd
7708e4923e5Smrg	exit ;;
771b8f75c19Smrg    CRAY*Y-MP:*:*:*)
772b8f75c19Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7737e4fd55aSmrg	exit ;;
774b8f75c19Smrg    CRAY*[A-Z]90:*:*:*)
775b8f75c19Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
776b8f75c19Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
777b8f75c19Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
778b8f75c19Smrg	      -e 's/\.[^.]*$/.X/'
7797e4fd55aSmrg	exit ;;
780b8f75c19Smrg    CRAY*TS:*:*:*)
781b8f75c19Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7827e4fd55aSmrg	exit ;;
783b8f75c19Smrg    CRAY*T3E:*:*:*)
784b8f75c19Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7857e4fd55aSmrg	exit ;;
786b8f75c19Smrg    CRAY*SV1:*:*:*)
787b8f75c19Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7887e4fd55aSmrg	exit ;;
789b8f75c19Smrg    *:UNICOS/mp:*:*)
7907e4fd55aSmrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7917e4fd55aSmrg	exit ;;
792b8f75c19Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
793b8f75c19Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7948e4923e5Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7958e4923e5Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7968e4923e5Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7978e4923e5Smrg	exit ;;
7987e4fd55aSmrg    5000:UNIX_System_V:4.*:*)
7998e4923e5Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
8008e4923e5Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
8018e4923e5Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
8027e4fd55aSmrg	exit ;;
803b8f75c19Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
804b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
8057e4fd55aSmrg	exit ;;
806b8f75c19Smrg    sparc*:BSD/OS:*:*)
807b8f75c19Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
8087e4fd55aSmrg	exit ;;
809b8f75c19Smrg    *:BSD/OS:*:*)
810b8f75c19Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
8117e4fd55aSmrg	exit ;;
8127e4fd55aSmrg    *:FreeBSD:*:*)
8138e4923e5Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
8148e4923e5Smrg	case ${UNAME_PROCESSOR} in
8157e4fd55aSmrg	    amd64)
8167e4fd55aSmrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8177e4fd55aSmrg	    *)
8188e4923e5Smrg		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8197e4fd55aSmrg	esac
8207e4fd55aSmrg	exit ;;
821b8f75c19Smrg    i*:CYGWIN*:*)
822b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-cygwin
8237e4fd55aSmrg	exit ;;
8248e4923e5Smrg    *:MINGW64*:*)
8258e4923e5Smrg	echo ${UNAME_MACHINE}-pc-mingw64
8268e4923e5Smrg	exit ;;
8277e4fd55aSmrg    *:MINGW*:*)
828b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-mingw32
8297e4fd55aSmrg	exit ;;
8308832ea4aSmrg    *:MSYS*:*)
8318e4923e5Smrg	echo ${UNAME_MACHINE}-pc-msys
8328e4923e5Smrg	exit ;;
8337e4fd55aSmrg    i*:windows32*:*)
8348e4923e5Smrg	# uname -m includes "-pc" on this system.
8358e4923e5Smrg	echo ${UNAME_MACHINE}-mingw32
8367e4fd55aSmrg	exit ;;
837b8f75c19Smrg    i*:PW*:*)
838b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-pw32
8397e4fd55aSmrg	exit ;;
8407e4fd55aSmrg    *:Interix*:*)
8418e4923e5Smrg	case ${UNAME_MACHINE} in
8427e4fd55aSmrg	    x86)
8437e4fd55aSmrg		echo i586-pc-interix${UNAME_RELEASE}
8447e4fd55aSmrg		exit ;;
8457e4fd55aSmrg	    authenticamd | genuineintel | EM64T)
8467e4fd55aSmrg		echo x86_64-unknown-interix${UNAME_RELEASE}
8477e4fd55aSmrg		exit ;;
8487e4fd55aSmrg	    IA64)
8497e4fd55aSmrg		echo ia64-unknown-interix${UNAME_RELEASE}
8507e4fd55aSmrg		exit ;;
8517e4fd55aSmrg	esac ;;
852b8f75c19Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
853b8f75c19Smrg	echo i${UNAME_MACHINE}-pc-mks
8547e4fd55aSmrg	exit ;;
8557e4fd55aSmrg    8664:Windows_NT:*)
8567e4fd55aSmrg	echo x86_64-pc-mks
8577e4fd55aSmrg	exit ;;
858b8f75c19Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
859b8f75c19Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
860b8f75c19Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
861b8f75c19Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
862b8f75c19Smrg	echo i586-pc-interix
8637e4fd55aSmrg	exit ;;
864b8f75c19Smrg    i*:UWIN*:*)
865b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-uwin
8667e4fd55aSmrg	exit ;;
8677e4fd55aSmrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8687e4fd55aSmrg	echo x86_64-unknown-cygwin
8697e4fd55aSmrg	exit ;;
870b8f75c19Smrg    p*:CYGWIN*:*)
871b8f75c19Smrg	echo powerpcle-unknown-cygwin
8727e4fd55aSmrg	exit ;;
873b8f75c19Smrg    prep*:SunOS:5.*:*)
874b8f75c19Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8757e4fd55aSmrg	exit ;;
876b8f75c19Smrg    *:GNU:*:*)
8777e4fd55aSmrg	# the GNU system
8788e4923e5Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8797e4fd55aSmrg	exit ;;
8807e4fd55aSmrg    *:GNU/*:*:*)
8817e4fd55aSmrg	# other systems with GNU libc and userland
8828e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
8837e4fd55aSmrg	exit ;;
884b8f75c19Smrg    i*86:Minix:*:*)
885b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-minix
8867e4fd55aSmrg	exit ;;
8878e4923e5Smrg    aarch64:Linux:*:*)
8888e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
8898e4923e5Smrg	exit ;;
8908e4923e5Smrg    aarch64_be:Linux:*:*)
8918e4923e5Smrg	UNAME_MACHINE=aarch64_be
8928e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
8938e4923e5Smrg	exit ;;
8947e4fd55aSmrg    alpha:Linux:*:*)
8957e4fd55aSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
8967e4fd55aSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
8977e4fd55aSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
8987e4fd55aSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
8997e4fd55aSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
9007e4fd55aSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
9017e4fd55aSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
9027e4fd55aSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
9038e4923e5Smrg	esac
9047e4fd55aSmrg	objdump --private-headers /bin/sh | grep -q ld.so.1
9058e4923e5Smrg	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
9068e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9078e4923e5Smrg	exit ;;
9088e4923e5Smrg    arc:Linux:*:* | arceb:Linux:*:*)
9098e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9107e4fd55aSmrg	exit ;;
911b8f75c19Smrg    arm*:Linux:*:*)
9127e4fd55aSmrg	eval $set_cc_for_build
9137e4fd55aSmrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
9147e4fd55aSmrg	    | grep -q __ARM_EABI__
9157e4fd55aSmrg	then
9168e4923e5Smrg	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9177e4fd55aSmrg	else
9188e4923e5Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
9198e4923e5Smrg		| grep -q __ARM_PCS_VFP
9208e4923e5Smrg	    then
9218e4923e5Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
9228e4923e5Smrg	    else
9238e4923e5Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
9248e4923e5Smrg	    fi
9257e4fd55aSmrg	fi
9267e4fd55aSmrg	exit ;;
9277e4fd55aSmrg    avr32*:Linux:*:*)
9288e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9297e4fd55aSmrg	exit ;;
930b8f75c19Smrg    cris:Linux:*:*)
9318e4923e5Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
9327e4fd55aSmrg	exit ;;
9337e4fd55aSmrg    crisv32:Linux:*:*)
9348e4923e5Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
9357e4fd55aSmrg	exit ;;
9367e4fd55aSmrg    frv:Linux:*:*)
9378e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9388e4923e5Smrg	exit ;;
9398e4923e5Smrg    hexagon:Linux:*:*)
9408e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9417e4fd55aSmrg	exit ;;
9427e4fd55aSmrg    i*86:Linux:*:*)
9438e4923e5Smrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
9447e4fd55aSmrg	exit ;;
9457e4fd55aSmrg    ia64:Linux:*:*)
9468e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9477e4fd55aSmrg	exit ;;
9487e4fd55aSmrg    m32r*:Linux:*:*)
9498e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9507e4fd55aSmrg	exit ;;
9517e4fd55aSmrg    m68*:Linux:*:*)
9528e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9537e4fd55aSmrg	exit ;;
9547e4fd55aSmrg    mips:Linux:*:* | mips64:Linux:*:*)
955b8f75c19Smrg	eval $set_cc_for_build
956b8f75c19Smrg	sed 's/^	//' << EOF >$dummy.c
957b8f75c19Smrg	#undef CPU
9587e4fd55aSmrg	#undef ${UNAME_MACHINE}
9597e4fd55aSmrg	#undef ${UNAME_MACHINE}el
960b8f75c19Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
9617e4fd55aSmrg	CPU=${UNAME_MACHINE}el
962b8f75c19Smrg	#else
963b8f75c19Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
9647e4fd55aSmrg	CPU=${UNAME_MACHINE}
965b8f75c19Smrg	#else
966b8f75c19Smrg	CPU=
967b8f75c19Smrg	#endif
968b8f75c19Smrg	#endif
969b8f75c19SmrgEOF
9707e4fd55aSmrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
9718e4923e5Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
972b8f75c19Smrg	;;
9738832ea4aSmrg    openrisc*:Linux:*:*)
9748832ea4aSmrg	echo or1k-unknown-linux-${LIBC}
9758e4923e5Smrg	exit ;;
9768832ea4aSmrg    or32:Linux:*:* | or1k*:Linux:*:*)
9778e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
9787e4fd55aSmrg	exit ;;
9797e4fd55aSmrg    padre:Linux:*:*)
9808e4923e5Smrg	echo sparc-unknown-linux-${LIBC}
9817e4fd55aSmrg	exit ;;
9827e4fd55aSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
9838e4923e5Smrg	echo hppa64-unknown-linux-${LIBC}
9847e4fd55aSmrg	exit ;;
985b8f75c19Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
986b8f75c19Smrg	# Look for CPU level
987b8f75c19Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9888e4923e5Smrg	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
9898e4923e5Smrg	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
9908e4923e5Smrg	  *)    echo hppa-unknown-linux-${LIBC} ;;
991b8f75c19Smrg	esac
9927e4fd55aSmrg	exit ;;
9937e4fd55aSmrg    ppc64:Linux:*:*)
9948e4923e5Smrg	echo powerpc64-unknown-linux-${LIBC}
9957e4fd55aSmrg	exit ;;
9967e4fd55aSmrg    ppc:Linux:*:*)
9978e4923e5Smrg	echo powerpc-unknown-linux-${LIBC}
9988e4923e5Smrg	exit ;;
9998e4923e5Smrg    ppc64le:Linux:*:*)
10008e4923e5Smrg	echo powerpc64le-unknown-linux-${LIBC}
10018e4923e5Smrg	exit ;;
10028e4923e5Smrg    ppcle:Linux:*:*)
10038e4923e5Smrg	echo powerpcle-unknown-linux-${LIBC}
10047e4fd55aSmrg	exit ;;
1005b8f75c19Smrg    s390:Linux:*:* | s390x:Linux:*:*)
10068e4923e5Smrg	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
10077e4fd55aSmrg	exit ;;
1008b8f75c19Smrg    sh64*:Linux:*:*)
10098e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10107e4fd55aSmrg	exit ;;
1011b8f75c19Smrg    sh*:Linux:*:*)
10128e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10137e4fd55aSmrg	exit ;;
1014b8f75c19Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
10158e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10167e4fd55aSmrg	exit ;;
10177e4fd55aSmrg    tile*:Linux:*:*)
10188e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10197e4fd55aSmrg	exit ;;
10207e4fd55aSmrg    vax:Linux:*:*)
10218e4923e5Smrg	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
10227e4fd55aSmrg	exit ;;
1023b8f75c19Smrg    x86_64:Linux:*:*)
10248e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10257e4fd55aSmrg	exit ;;
10267e4fd55aSmrg    xtensa*:Linux:*:*)
10278e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
10287e4fd55aSmrg	exit ;;
1029b8f75c19Smrg    i*86:DYNIX/ptx:4*:*)
1030b8f75c19Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1031b8f75c19Smrg	# earlier versions are messed up and put the nodename in both
1032b8f75c19Smrg	# sysname and nodename.
1033b8f75c19Smrg	echo i386-sequent-sysv4
10347e4fd55aSmrg	exit ;;
1035b8f75c19Smrg    i*86:UNIX_SV:4.2MP:2.*)
10368e4923e5Smrg	# Unixware is an offshoot of SVR4, but it has its own version
10378e4923e5Smrg	# number series starting with 2...
10388e4923e5Smrg	# I am not positive that other SVR4 systems won't match this,
1039b8f75c19Smrg	# I just have to hope.  -- rms.
10408e4923e5Smrg	# Use sysv4.2uw... so that sysv4* matches it.
1041b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10427e4fd55aSmrg	exit ;;
1043b8f75c19Smrg    i*86:OS/2:*:*)
1044b8f75c19Smrg	# If we were able to find `uname', then EMX Unix compatibility
1045b8f75c19Smrg	# is probably installed.
1046b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
10477e4fd55aSmrg	exit ;;
1048b8f75c19Smrg    i*86:XTS-300:*:STOP)
1049b8f75c19Smrg	echo ${UNAME_MACHINE}-unknown-stop
10507e4fd55aSmrg	exit ;;
1051b8f75c19Smrg    i*86:atheos:*:*)
1052b8f75c19Smrg	echo ${UNAME_MACHINE}-unknown-atheos
10537e4fd55aSmrg	exit ;;
10547e4fd55aSmrg    i*86:syllable:*:*)
10557e4fd55aSmrg	echo ${UNAME_MACHINE}-pc-syllable
10567e4fd55aSmrg	exit ;;
10577e4fd55aSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1058b8f75c19Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10597e4fd55aSmrg	exit ;;
1060b8f75c19Smrg    i*86:*DOS:*:*)
1061b8f75c19Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10627e4fd55aSmrg	exit ;;
1063b8f75c19Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1064b8f75c19Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1065b8f75c19Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1066b8f75c19Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1067b8f75c19Smrg	else
1068b8f75c19Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1069b8f75c19Smrg	fi
10707e4fd55aSmrg	exit ;;
10717e4fd55aSmrg    i*86:*:5:[678]*)
10728e4923e5Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1073b8f75c19Smrg	case `/bin/uname -X | grep "^Machine"` in
1074b8f75c19Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
1075b8f75c19Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1076b8f75c19Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1077b8f75c19Smrg	esac
1078b8f75c19Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10797e4fd55aSmrg	exit ;;
1080b8f75c19Smrg    i*86:*:3.2:*)
1081b8f75c19Smrg	if test -f /usr/options/cb.name; then
1082b8f75c19Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1083b8f75c19Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1084b8f75c19Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1085b8f75c19Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1086b8f75c19Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1087b8f75c19Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1088b8f75c19Smrg			&& UNAME_MACHINE=i586
1089b8f75c19Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1090b8f75c19Smrg			&& UNAME_MACHINE=i686
1091b8f75c19Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1092b8f75c19Smrg			&& UNAME_MACHINE=i686
1093b8f75c19Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1094b8f75c19Smrg	else
1095b8f75c19Smrg		echo ${UNAME_MACHINE}-pc-sysv32
1096b8f75c19Smrg	fi
10977e4fd55aSmrg	exit ;;
1098b8f75c19Smrg    pc:*:*:*)
1099b8f75c19Smrg	# Left here for compatibility:
11008e4923e5Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
11018e4923e5Smrg	# the processor, so we play safe by assuming i586.
11027e4fd55aSmrg	# Note: whatever this is, it MUST be the same as what config.sub
11037e4fd55aSmrg	# prints for the "djgpp" host, or else GDB configury will decide that
11047e4fd55aSmrg	# this is a cross-build.
11057e4fd55aSmrg	echo i586-pc-msdosdjgpp
11068e4923e5Smrg	exit ;;
1107b8f75c19Smrg    Intel:Mach:3*:*)
1108b8f75c19Smrg	echo i386-pc-mach3
11097e4fd55aSmrg	exit ;;
1110b8f75c19Smrg    paragon:*:*:*)
1111b8f75c19Smrg	echo i860-intel-osf1
11127e4fd55aSmrg	exit ;;
1113b8f75c19Smrg    i860:*:4.*:*) # i860-SVR4
1114b8f75c19Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1115b8f75c19Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1116b8f75c19Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
1117b8f75c19Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1118b8f75c19Smrg	fi
11197e4fd55aSmrg	exit ;;
1120b8f75c19Smrg    mini*:CTIX:SYS*5:*)
1121b8f75c19Smrg	# "miniframe"
1122b8f75c19Smrg	echo m68010-convergent-sysv
11237e4fd55aSmrg	exit ;;
1124b8f75c19Smrg    mc68k:UNIX:SYSTEM5:3.51m)
1125b8f75c19Smrg	echo m68k-convergent-sysv
11267e4fd55aSmrg	exit ;;
1127b8f75c19Smrg    M680?0:D-NIX:5.3:*)
1128b8f75c19Smrg	echo m68k-diab-dnix
11297e4fd55aSmrg	exit ;;
11307e4fd55aSmrg    M68*:*:R3V[5678]*:*)
11317e4fd55aSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11327e4fd55aSmrg    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)
1133b8f75c19Smrg	OS_REL=''
1134b8f75c19Smrg	test -r /etc/.relid \
1135b8f75c19Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1136b8f75c19Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11377e4fd55aSmrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1138b8f75c19Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11397e4fd55aSmrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1140b8f75c19Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
11418e4923e5Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11428e4923e5Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
11437e4fd55aSmrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
11447e4fd55aSmrg	OS_REL='.3'
11457e4fd55aSmrg	test -r /etc/.relid \
11467e4fd55aSmrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11477e4fd55aSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11487e4fd55aSmrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11497e4fd55aSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11507e4fd55aSmrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
11517e4fd55aSmrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
11527e4fd55aSmrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1153b8f75c19Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1154b8f75c19Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11557e4fd55aSmrg	exit ;;
1156b8f75c19Smrg    mc68030:UNIX_System_V:4.*:*)
1157b8f75c19Smrg	echo m68k-atari-sysv4
11587e4fd55aSmrg	exit ;;
1159b8f75c19Smrg    TSUNAMI:LynxOS:2.*:*)
1160b8f75c19Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11617e4fd55aSmrg	exit ;;
1162b8f75c19Smrg    rs6000:LynxOS:2.*:*)
1163b8f75c19Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11647e4fd55aSmrg	exit ;;
11657e4fd55aSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1166b8f75c19Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11677e4fd55aSmrg	exit ;;
1168b8f75c19Smrg    SM[BE]S:UNIX_SV:*:*)
1169b8f75c19Smrg	echo mips-dde-sysv${UNAME_RELEASE}
11707e4fd55aSmrg	exit ;;
1171b8f75c19Smrg    RM*:ReliantUNIX-*:*:*)
1172b8f75c19Smrg	echo mips-sni-sysv4
11737e4fd55aSmrg	exit ;;
1174b8f75c19Smrg    RM*:SINIX-*:*:*)
1175b8f75c19Smrg	echo mips-sni-sysv4
11767e4fd55aSmrg	exit ;;
1177b8f75c19Smrg    *:SINIX-*:*:*)
1178b8f75c19Smrg	if uname -p 2>/dev/null >/dev/null ; then
1179b8f75c19Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1180b8f75c19Smrg		echo ${UNAME_MACHINE}-sni-sysv4
1181b8f75c19Smrg	else
1182b8f75c19Smrg		echo ns32k-sni-sysv
1183b8f75c19Smrg	fi
11847e4fd55aSmrg	exit ;;
11858e4923e5Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
11868e4923e5Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
11878e4923e5Smrg	echo i586-unisys-sysv4
11888e4923e5Smrg	exit ;;
1189b8f75c19Smrg    *:UNIX_System_V:4*:FTX*)
1190b8f75c19Smrg	# From Gerald Hewes <hewes@openmarket.com>.
1191b8f75c19Smrg	# How about differentiating between stratus architectures? -djm
1192b8f75c19Smrg	echo hppa1.1-stratus-sysv4
11937e4fd55aSmrg	exit ;;
1194b8f75c19Smrg    *:*:*:FTX*)
1195b8f75c19Smrg	# From seanf@swdc.stratus.com.
1196b8f75c19Smrg	echo i860-stratus-sysv4
11977e4fd55aSmrg	exit ;;
11987e4fd55aSmrg    i*86:VOS:*:*)
11997e4fd55aSmrg	# From Paul.Green@stratus.com.
12007e4fd55aSmrg	echo ${UNAME_MACHINE}-stratus-vos
12017e4fd55aSmrg	exit ;;
1202b8f75c19Smrg    *:VOS:*:*)
1203b8f75c19Smrg	# From Paul.Green@stratus.com.
1204b8f75c19Smrg	echo hppa1.1-stratus-vos
12057e4fd55aSmrg	exit ;;
1206b8f75c19Smrg    mc68*:A/UX:*:*)
1207b8f75c19Smrg	echo m68k-apple-aux${UNAME_RELEASE}
12087e4fd55aSmrg	exit ;;
1209b8f75c19Smrg    news*:NEWS-OS:6*:*)
1210b8f75c19Smrg	echo mips-sony-newsos6
12117e4fd55aSmrg	exit ;;
1212b8f75c19Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1213b8f75c19Smrg	if [ -d /usr/nec ]; then
12148e4923e5Smrg		echo mips-nec-sysv${UNAME_RELEASE}
1215b8f75c19Smrg	else
12168e4923e5Smrg		echo mips-unknown-sysv${UNAME_RELEASE}
1217b8f75c19Smrg	fi
12188e4923e5Smrg	exit ;;
1219b8f75c19Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1220b8f75c19Smrg	echo powerpc-be-beos
12217e4fd55aSmrg	exit ;;
1222b8f75c19Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1223b8f75c19Smrg	echo powerpc-apple-beos
12247e4fd55aSmrg	exit ;;
1225b8f75c19Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1226b8f75c19Smrg	echo i586-pc-beos
12277e4fd55aSmrg	exit ;;
12287e4fd55aSmrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
12297e4fd55aSmrg	echo i586-pc-haiku
12307e4fd55aSmrg	exit ;;
12318e4923e5Smrg    x86_64:Haiku:*:*)
12328e4923e5Smrg	echo x86_64-unknown-haiku
12338e4923e5Smrg	exit ;;
1234b8f75c19Smrg    SX-4:SUPER-UX:*:*)
1235b8f75c19Smrg	echo sx4-nec-superux${UNAME_RELEASE}
12367e4fd55aSmrg	exit ;;
1237b8f75c19Smrg    SX-5:SUPER-UX:*:*)
1238b8f75c19Smrg	echo sx5-nec-superux${UNAME_RELEASE}
12397e4fd55aSmrg	exit ;;
1240b8f75c19Smrg    SX-6:SUPER-UX:*:*)
1241b8f75c19Smrg	echo sx6-nec-superux${UNAME_RELEASE}
12427e4fd55aSmrg	exit ;;
12437e4fd55aSmrg    SX-7:SUPER-UX:*:*)
12447e4fd55aSmrg	echo sx7-nec-superux${UNAME_RELEASE}
12457e4fd55aSmrg	exit ;;
12467e4fd55aSmrg    SX-8:SUPER-UX:*:*)
12477e4fd55aSmrg	echo sx8-nec-superux${UNAME_RELEASE}
12487e4fd55aSmrg	exit ;;
12497e4fd55aSmrg    SX-8R:SUPER-UX:*:*)
12507e4fd55aSmrg	echo sx8r-nec-superux${UNAME_RELEASE}
12517e4fd55aSmrg	exit ;;
1252b8f75c19Smrg    Power*:Rhapsody:*:*)
1253b8f75c19Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12547e4fd55aSmrg	exit ;;
1255b8f75c19Smrg    *:Rhapsody:*:*)
1256b8f75c19Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12577e4fd55aSmrg	exit ;;
1258b8f75c19Smrg    *:Darwin:*:*)
12597e4fd55aSmrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12608e4923e5Smrg	eval $set_cc_for_build
12618e4923e5Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
12628e4923e5Smrg	    UNAME_PROCESSOR=powerpc
12638e4923e5Smrg	fi
12648832ea4aSmrg	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
12658832ea4aSmrg	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
12668832ea4aSmrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
12678832ea4aSmrg		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
12688832ea4aSmrg		    grep IS_64BIT_ARCH >/dev/null
12698832ea4aSmrg		then
12708832ea4aSmrg		    case $UNAME_PROCESSOR in
12718832ea4aSmrg			i386) UNAME_PROCESSOR=x86_64 ;;
12728832ea4aSmrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
12738832ea4aSmrg		    esac
12748832ea4aSmrg		fi
12758e4923e5Smrg	    fi
12768832ea4aSmrg	elif test "$UNAME_PROCESSOR" = i386 ; then
12778832ea4aSmrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
12788832ea4aSmrg	    # that puts up a graphical alert prompting to install
12798832ea4aSmrg	    # developer tools.  Any system running Mac OS X 10.7 or
12808832ea4aSmrg	    # later (Darwin 11 and later) is required to have a 64-bit
12818832ea4aSmrg	    # processor. This is not true of the ARM version of Darwin
12828832ea4aSmrg	    # that Apple uses in portable devices.
12838832ea4aSmrg	    UNAME_PROCESSOR=x86_64
12848e4923e5Smrg	fi
1285b8f75c19Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12867e4fd55aSmrg	exit ;;
1287b8f75c19Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1288b8f75c19Smrg	UNAME_PROCESSOR=`uname -p`
1289b8f75c19Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
1290b8f75c19Smrg		UNAME_PROCESSOR=i386
1291b8f75c19Smrg		UNAME_MACHINE=pc
1292b8f75c19Smrg	fi
1293b8f75c19Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
12947e4fd55aSmrg	exit ;;
1295b8f75c19Smrg    *:QNX:*:4*)
1296b8f75c19Smrg	echo i386-pc-qnx
12977e4fd55aSmrg	exit ;;
12988e4923e5Smrg    NEO-?:NONSTOP_KERNEL:*:*)
12998e4923e5Smrg	echo neo-tandem-nsk${UNAME_RELEASE}
13008e4923e5Smrg	exit ;;
13018e4923e5Smrg    NSE-*:NONSTOP_KERNEL:*:*)
13027e4fd55aSmrg	echo nse-tandem-nsk${UNAME_RELEASE}
13037e4fd55aSmrg	exit ;;
13047e4fd55aSmrg    NSR-?:NONSTOP_KERNEL:*:*)
1305b8f75c19Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
13067e4fd55aSmrg	exit ;;
1307b8f75c19Smrg    *:NonStop-UX:*:*)
1308b8f75c19Smrg	echo mips-compaq-nonstopux
13097e4fd55aSmrg	exit ;;
1310b8f75c19Smrg    BS2000:POSIX*:*:*)
1311b8f75c19Smrg	echo bs2000-siemens-sysv
13127e4fd55aSmrg	exit ;;
1313b8f75c19Smrg    DS/*:UNIX_System_V:*:*)
1314b8f75c19Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
13157e4fd55aSmrg	exit ;;
1316b8f75c19Smrg    *:Plan9:*:*)
1317b8f75c19Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
1318b8f75c19Smrg	# is converted to i386 for consistency with other x86
1319b8f75c19Smrg	# operating systems.
1320b8f75c19Smrg	if test "$cputype" = "386"; then
1321b8f75c19Smrg	    UNAME_MACHINE=i386
1322b8f75c19Smrg	else
1323b8f75c19Smrg	    UNAME_MACHINE="$cputype"
1324b8f75c19Smrg	fi
1325b8f75c19Smrg	echo ${UNAME_MACHINE}-unknown-plan9
13267e4fd55aSmrg	exit ;;
1327b8f75c19Smrg    *:TOPS-10:*:*)
1328b8f75c19Smrg	echo pdp10-unknown-tops10
13297e4fd55aSmrg	exit ;;
1330b8f75c19Smrg    *:TENEX:*:*)
1331b8f75c19Smrg	echo pdp10-unknown-tenex
13327e4fd55aSmrg	exit ;;
1333b8f75c19Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1334b8f75c19Smrg	echo pdp10-dec-tops20
13357e4fd55aSmrg	exit ;;
1336b8f75c19Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1337b8f75c19Smrg	echo pdp10-xkl-tops20
13387e4fd55aSmrg	exit ;;
1339b8f75c19Smrg    *:TOPS-20:*:*)
1340b8f75c19Smrg	echo pdp10-unknown-tops20
13417e4fd55aSmrg	exit ;;
1342b8f75c19Smrg    *:ITS:*:*)
1343b8f75c19Smrg	echo pdp10-unknown-its
13447e4fd55aSmrg	exit ;;
1345b8f75c19Smrg    SEI:*:*:SEIUX)
13468e4923e5Smrg	echo mips-sei-seiux${UNAME_RELEASE}
13477e4fd55aSmrg	exit ;;
13487e4fd55aSmrg    *:DragonFly:*:*)
13497e4fd55aSmrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13507e4fd55aSmrg	exit ;;
13517e4fd55aSmrg    *:*VMS:*:*)
13528e4923e5Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13537e4fd55aSmrg	case "${UNAME_MACHINE}" in
13547e4fd55aSmrg	    A*) echo alpha-dec-vms ; exit ;;
13557e4fd55aSmrg	    I*) echo ia64-dec-vms ; exit ;;
13567e4fd55aSmrg	    V*) echo vax-dec-vms ; exit ;;
13577e4fd55aSmrg	esac ;;
13587e4fd55aSmrg    *:XENIX:*:SysV)
13597e4fd55aSmrg	echo i386-pc-xenix
13607e4fd55aSmrg	exit ;;
13617e4fd55aSmrg    i*86:skyos:*:*)
13627e4fd55aSmrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13637e4fd55aSmrg	exit ;;
13647e4fd55aSmrg    i*86:rdos:*:*)
13657e4fd55aSmrg	echo ${UNAME_MACHINE}-pc-rdos
13667e4fd55aSmrg	exit ;;
13677e4fd55aSmrg    i*86:AROS:*:*)
13687e4fd55aSmrg	echo ${UNAME_MACHINE}-pc-aros
13697e4fd55aSmrg	exit ;;
13708e4923e5Smrg    x86_64:VMkernel:*:*)
13718e4923e5Smrg	echo ${UNAME_MACHINE}-unknown-esx
13728e4923e5Smrg	exit ;;
1373b8f75c19Smrgesac
1374b8f75c19Smrg
1375b8f75c19Smrgcat >&2 <<EOF
1376b8f75c19Smrg$0: unable to guess system type
1377b8f75c19Smrg
1378b8f75c19SmrgThis script, last modified $timestamp, has failed to recognize
1379b8f75c19Smrgthe operating system you are using. It is advised that you
1380b8f75c19Smrgdownload the most up to date version of the config scripts from
1381b8f75c19Smrg
13827e4fd55aSmrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
13837e4fd55aSmrgand
13847e4fd55aSmrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1385b8f75c19Smrg
1386b8f75c19SmrgIf the version you run ($0) is already up to date, please
1387b8f75c19Smrgsend the following data and any information you think might be
1388b8f75c19Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
1389b8f75c19Smrginformation to handle your system.
1390b8f75c19Smrg
1391b8f75c19Smrgconfig.guess timestamp = $timestamp
1392b8f75c19Smrg
1393b8f75c19Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1394b8f75c19Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1395b8f75c19Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1396b8f75c19Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1397b8f75c19Smrg
1398b8f75c19Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1399b8f75c19Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1400b8f75c19Smrg
1401b8f75c19Smrghostinfo               = `(hostinfo) 2>/dev/null`
1402b8f75c19Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1403b8f75c19Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1404b8f75c19Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1405b8f75c19Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1406b8f75c19Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1407b8f75c19Smrg
1408b8f75c19SmrgUNAME_MACHINE = ${UNAME_MACHINE}
1409b8f75c19SmrgUNAME_RELEASE = ${UNAME_RELEASE}
1410b8f75c19SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
1411b8f75c19SmrgUNAME_VERSION = ${UNAME_VERSION}
1412b8f75c19SmrgEOF
1413b8f75c19Smrg
1414b8f75c19Smrgexit 1
1415b8f75c19Smrg
1416b8f75c19Smrg# Local variables:
1417b8f75c19Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
1418b8f75c19Smrg# time-stamp-start: "timestamp='"
1419b8f75c19Smrg# time-stamp-format: "%:y-%02m-%02d"
1420b8f75c19Smrg# time-stamp-end: "'"
1421b8f75c19Smrg# End:
1422