config.guess revision 48f45e26
1ea6ae205Smrg#! /bin/sh
2ea6ae205Smrg# Attempt to guess a canonical system name.
348f45e26Smrg#   Copyright 1992-2014 Free Software Foundation, Inc.
4ea6ae205Smrg
548f45e26Smrgtimestamp='2014-11-04'
6ea6ae205Smrg
7ea6ae205Smrg# This file is free software; you can redistribute it and/or modify it
8ea6ae205Smrg# under the terms of the GNU General Public License as published by
987aef7c3Smrg# the Free Software Foundation; either version 3 of the License, or
10ea6ae205Smrg# (at your option) any later version.
11ea6ae205Smrg#
12ea6ae205Smrg# This program is distributed in the hope that it will be useful, but
13ea6ae205Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
14ea6ae205Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15ea6ae205Smrg# General Public License for more details.
16ea6ae205Smrg#
17ea6ae205Smrg# You should have received a copy of the GNU General Public License
1887aef7c3Smrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
19ea6ae205Smrg#
20ea6ae205Smrg# As a special exception to the GNU General Public License, if you
21ea6ae205Smrg# distribute this file as part of a program that contains a
22ea6ae205Smrg# configuration script generated by Autoconf, you may include it under
2387aef7c3Smrg# the same distribution terms that you use for the rest of that
2487aef7c3Smrg# program.  This Exception is an additional permission under section 7
2587aef7c3Smrg# of the GNU General Public License, version 3 ("GPLv3").
26ea6ae205Smrg#
2748f45e26Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
28ea6ae205Smrg#
29b6f2c9ccSmrg# You can get the latest version of this script from:
30b6f2c9ccSmrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
3187aef7c3Smrg#
3248f45e26Smrg# Please send patches to <config-patches@gnu.org>.
3387aef7c3Smrg
34ea6ae205Smrg
35ea6ae205Smrgme=`echo "$0" | sed -e 's,.*/,,'`
36ea6ae205Smrg
37ea6ae205Smrgusage="\
38ea6ae205SmrgUsage: $0 [OPTION]
39ea6ae205Smrg
40ea6ae205SmrgOutput the configuration name of the system \`$me' is run on.
41ea6ae205Smrg
42ea6ae205SmrgOperation modes:
43ea6ae205Smrg  -h, --help         print this help, then exit
44ea6ae205Smrg  -t, --time-stamp   print date of last modification, then exit
45ea6ae205Smrg  -v, --version      print version number, then exit
46ea6ae205Smrg
47ea6ae205SmrgReport bugs and patches to <config-patches@gnu.org>."
48ea6ae205Smrg
49ea6ae205Smrgversion="\
50ea6ae205SmrgGNU config.guess ($timestamp)
51ea6ae205Smrg
52ea6ae205SmrgOriginally written by Per Bothner.
5348f45e26SmrgCopyright 1992-2014 Free Software Foundation, Inc.
54ea6ae205Smrg
55ea6ae205SmrgThis is free software; see the source for copying conditions.  There is NO
56ea6ae205Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57ea6ae205Smrg
58ea6ae205Smrghelp="
59ea6ae205SmrgTry \`$me --help' for more information."
60ea6ae205Smrg
61ea6ae205Smrg# Parse command line
62ea6ae205Smrgwhile test $# -gt 0 ; do
63ea6ae205Smrg  case $1 in
64ea6ae205Smrg    --time-stamp | --time* | -t )
65ea6ae205Smrg       echo "$timestamp" ; exit ;;
66ea6ae205Smrg    --version | -v )
67ea6ae205Smrg       echo "$version" ; exit ;;
68ea6ae205Smrg    --help | --h* | -h )
69ea6ae205Smrg       echo "$usage"; exit ;;
70ea6ae205Smrg    -- )     # Stop option processing
71ea6ae205Smrg       shift; break ;;
72ea6ae205Smrg    - )	# Use stdin as input.
73ea6ae205Smrg       break ;;
74ea6ae205Smrg    -* )
75ea6ae205Smrg       echo "$me: invalid option $1$help" >&2
76ea6ae205Smrg       exit 1 ;;
77ea6ae205Smrg    * )
78ea6ae205Smrg       break ;;
79ea6ae205Smrg  esac
80ea6ae205Smrgdone
81ea6ae205Smrg
82ea6ae205Smrgif test $# != 0; then
83ea6ae205Smrg  echo "$me: too many arguments$help" >&2
84ea6ae205Smrg  exit 1
85ea6ae205Smrgfi
86ea6ae205Smrg
8787aef7c3Smrgtrap 'exit 1' 1 2 15
88ea6ae205Smrg
89ea6ae205Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90ea6ae205Smrg# compiler to aid in system detection is discouraged as it requires
91ea6ae205Smrg# temporary files to be created and, as you can see below, it is a
92ea6ae205Smrg# headache to deal with in a portable fashion.
93ea6ae205Smrg
94ea6ae205Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
95ea6ae205Smrg# use `HOST_CC' if defined, but it is deprecated.
96ea6ae205Smrg
97ea6ae205Smrg# Portable tmp directory creation inspired by the Autoconf team.
98ea6ae205Smrg
99ea6ae205Smrgset_cc_for_build='
100ea6ae205Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
10187aef7c3Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102ea6ae205Smrg: ${TMPDIR=/tmp} ;
103ea6ae205Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104ea6ae205Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105ea6ae205Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106ea6ae205Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107ea6ae205Smrgdummy=$tmp/dummy ;
108ea6ae205Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109ea6ae205Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
110ea6ae205Smrg ,,)    echo "int x;" > $dummy.c ;
111ea6ae205Smrg	for c in cc gcc c89 c99 ; do
112ea6ae205Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
113ea6ae205Smrg	     CC_FOR_BUILD="$c"; break ;
114ea6ae205Smrg	  fi ;
115ea6ae205Smrg	done ;
116ea6ae205Smrg	if test x"$CC_FOR_BUILD" = x ; then
117ea6ae205Smrg	  CC_FOR_BUILD=no_compiler_found ;
118ea6ae205Smrg	fi
119ea6ae205Smrg	;;
120ea6ae205Smrg ,,*)   CC_FOR_BUILD=$CC ;;
121ea6ae205Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
122ea6ae205Smrgesac ; set_cc_for_build= ;'
123ea6ae205Smrg
124ea6ae205Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125ea6ae205Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
126ea6ae205Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
127ea6ae205Smrg	PATH=$PATH:/.attbin ; export PATH
128ea6ae205Smrgfi
129ea6ae205Smrg
130ea6ae205SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
131ea6ae205SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132ea6ae205SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
133ea6ae205SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134ea6ae205Smrg
13587aef7c3Smrgcase "${UNAME_SYSTEM}" in
13687aef7c3SmrgLinux|GNU|GNU/*)
13787aef7c3Smrg	# If the system lacks a compiler, then just pick glibc.
13887aef7c3Smrg	# We could probably try harder.
13987aef7c3Smrg	LIBC=gnu
14087aef7c3Smrg
14187aef7c3Smrg	eval $set_cc_for_build
14287aef7c3Smrg	cat <<-EOF > $dummy.c
14387aef7c3Smrg	#include <features.h>
14487aef7c3Smrg	#if defined(__UCLIBC__)
14587aef7c3Smrg	LIBC=uclibc
14687aef7c3Smrg	#elif defined(__dietlibc__)
14787aef7c3Smrg	LIBC=dietlibc
14887aef7c3Smrg	#else
14987aef7c3Smrg	LIBC=gnu
15087aef7c3Smrg	#endif
15187aef7c3Smrg	EOF
15248f45e26Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
15387aef7c3Smrg	;;
15487aef7c3Smrgesac
15587aef7c3Smrg
156ea6ae205Smrg# Note: order is significant - the case branches are not exclusive.
157ea6ae205Smrg
158ea6ae205Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
159ea6ae205Smrg    *:NetBSD:*:*)
160ea6ae205Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
16187aef7c3Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
162ea6ae205Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
163ea6ae205Smrg	# switched to ELF, *-*-netbsd* would select the old
164ea6ae205Smrg	# object file format.  This provides both forward
165ea6ae205Smrg	# compatibility and a consistent mechanism for selecting the
166ea6ae205Smrg	# object file format.
167ea6ae205Smrg	#
168ea6ae205Smrg	# Note: NetBSD doesn't particularly care about the vendor
169ea6ae205Smrg	# portion of the name.  We always set it to "unknown".
170ea6ae205Smrg	sysctl="sysctl -n hw.machine_arch"
171ea6ae205Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
172ea6ae205Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
173ea6ae205Smrg	case "${UNAME_MACHINE_ARCH}" in
174ea6ae205Smrg	    armeb) machine=armeb-unknown ;;
175ea6ae205Smrg	    arm*) machine=arm-unknown ;;
176ea6ae205Smrg	    sh3el) machine=shl-unknown ;;
177ea6ae205Smrg	    sh3eb) machine=sh-unknown ;;
178ea6ae205Smrg	    sh5el) machine=sh5le-unknown ;;
179ea6ae205Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
180ea6ae205Smrg	esac
181ea6ae205Smrg	# The Operating System including object format, if it has switched
182ea6ae205Smrg	# to ELF recently, or will in the future.
183ea6ae205Smrg	case "${UNAME_MACHINE_ARCH}" in
184ea6ae205Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
185ea6ae205Smrg		eval $set_cc_for_build
186ea6ae205Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
187b6f2c9ccSmrg			| grep -q __ELF__
188ea6ae205Smrg		then
189ea6ae205Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
190ea6ae205Smrg		    # Return netbsd for either.  FIX?
191ea6ae205Smrg		    os=netbsd
192ea6ae205Smrg		else
193ea6ae205Smrg		    os=netbsdelf
194ea6ae205Smrg		fi
195ea6ae205Smrg		;;
196ea6ae205Smrg	    *)
19787aef7c3Smrg		os=netbsd
198ea6ae205Smrg		;;
199ea6ae205Smrg	esac
200ea6ae205Smrg	# The OS release
201ea6ae205Smrg	# Debian GNU/NetBSD machines have a different userland, and
202ea6ae205Smrg	# thus, need a distinct triplet. However, they do not need
203ea6ae205Smrg	# kernel version information, so it can be replaced with a
204ea6ae205Smrg	# suitable tag, in the style of linux-gnu.
205ea6ae205Smrg	case "${UNAME_VERSION}" in
206ea6ae205Smrg	    Debian*)
207ea6ae205Smrg		release='-gnu'
208ea6ae205Smrg		;;
209ea6ae205Smrg	    *)
210ea6ae205Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
211ea6ae205Smrg		;;
212ea6ae205Smrg	esac
213ea6ae205Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
214ea6ae205Smrg	# contains redundant information, the shorter form:
215ea6ae205Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
216ea6ae205Smrg	echo "${machine}-${os}${release}"
217ea6ae205Smrg	exit ;;
21887aef7c3Smrg    *:Bitrig:*:*)
21987aef7c3Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
22087aef7c3Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
22187aef7c3Smrg	exit ;;
222ea6ae205Smrg    *:OpenBSD:*:*)
223ea6ae205Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
224ea6ae205Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
225ea6ae205Smrg	exit ;;
226ea6ae205Smrg    *:ekkoBSD:*:*)
227ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
228ea6ae205Smrg	exit ;;
229ea6ae205Smrg    *:SolidBSD:*:*)
230ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
231ea6ae205Smrg	exit ;;
232ea6ae205Smrg    macppc:MirBSD:*:*)
233ea6ae205Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
234ea6ae205Smrg	exit ;;
235ea6ae205Smrg    *:MirBSD:*:*)
236ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
237ea6ae205Smrg	exit ;;
238ea6ae205Smrg    alpha:OSF1:*:*)
239ea6ae205Smrg	case $UNAME_RELEASE in
240ea6ae205Smrg	*4.0)
241ea6ae205Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
242ea6ae205Smrg		;;
243ea6ae205Smrg	*5.*)
24487aef7c3Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
245ea6ae205Smrg		;;
246ea6ae205Smrg	esac
247ea6ae205Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
248ea6ae205Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
249ea6ae205Smrg	# covers most systems running today.  This code pipes the CPU
250ea6ae205Smrg	# types through head -n 1, so we only detect the type of CPU 0.
251ea6ae205Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
252ea6ae205Smrg	case "$ALPHA_CPU_TYPE" in
253ea6ae205Smrg	    "EV4 (21064)")
254ea6ae205Smrg		UNAME_MACHINE="alpha" ;;
255ea6ae205Smrg	    "EV4.5 (21064)")
256ea6ae205Smrg		UNAME_MACHINE="alpha" ;;
257ea6ae205Smrg	    "LCA4 (21066/21068)")
258ea6ae205Smrg		UNAME_MACHINE="alpha" ;;
259ea6ae205Smrg	    "EV5 (21164)")
260ea6ae205Smrg		UNAME_MACHINE="alphaev5" ;;
261ea6ae205Smrg	    "EV5.6 (21164A)")
262ea6ae205Smrg		UNAME_MACHINE="alphaev56" ;;
263ea6ae205Smrg	    "EV5.6 (21164PC)")
264ea6ae205Smrg		UNAME_MACHINE="alphapca56" ;;
265ea6ae205Smrg	    "EV5.7 (21164PC)")
266ea6ae205Smrg		UNAME_MACHINE="alphapca57" ;;
267ea6ae205Smrg	    "EV6 (21264)")
268ea6ae205Smrg		UNAME_MACHINE="alphaev6" ;;
269ea6ae205Smrg	    "EV6.7 (21264A)")
270ea6ae205Smrg		UNAME_MACHINE="alphaev67" ;;
271ea6ae205Smrg	    "EV6.8CB (21264C)")
272ea6ae205Smrg		UNAME_MACHINE="alphaev68" ;;
273ea6ae205Smrg	    "EV6.8AL (21264B)")
274ea6ae205Smrg		UNAME_MACHINE="alphaev68" ;;
275ea6ae205Smrg	    "EV6.8CX (21264D)")
276ea6ae205Smrg		UNAME_MACHINE="alphaev68" ;;
277ea6ae205Smrg	    "EV6.9A (21264/EV69A)")
278ea6ae205Smrg		UNAME_MACHINE="alphaev69" ;;
279ea6ae205Smrg	    "EV7 (21364)")
280ea6ae205Smrg		UNAME_MACHINE="alphaev7" ;;
281ea6ae205Smrg	    "EV7.9 (21364A)")
282ea6ae205Smrg		UNAME_MACHINE="alphaev79" ;;
283ea6ae205Smrg	esac
284ea6ae205Smrg	# A Pn.n version is a patched version.
285ea6ae205Smrg	# A Vn.n version is a released version.
286ea6ae205Smrg	# A Tn.n version is a released field test version.
287ea6ae205Smrg	# A Xn.n version is an unreleased experimental baselevel.
288ea6ae205Smrg	# 1.2 uses "1.2" for uname -r.
289ea6ae205Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
29087aef7c3Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
29187aef7c3Smrg	exitcode=$?
29287aef7c3Smrg	trap '' 0
29387aef7c3Smrg	exit $exitcode ;;
294ea6ae205Smrg    Alpha\ *:Windows_NT*:*)
295ea6ae205Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
296ea6ae205Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
297ea6ae205Smrg	# of the specific Alpha model?
298ea6ae205Smrg	echo alpha-pc-interix
299ea6ae205Smrg	exit ;;
300ea6ae205Smrg    21064:Windows_NT:50:3)
301ea6ae205Smrg	echo alpha-dec-winnt3.5
302ea6ae205Smrg	exit ;;
303ea6ae205Smrg    Amiga*:UNIX_System_V:4.0:*)
304ea6ae205Smrg	echo m68k-unknown-sysv4
305ea6ae205Smrg	exit ;;
306ea6ae205Smrg    *:[Aa]miga[Oo][Ss]:*:*)
307ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
308ea6ae205Smrg	exit ;;
309ea6ae205Smrg    *:[Mm]orph[Oo][Ss]:*:*)
310ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-morphos
311ea6ae205Smrg	exit ;;
312ea6ae205Smrg    *:OS/390:*:*)
313ea6ae205Smrg	echo i370-ibm-openedition
314ea6ae205Smrg	exit ;;
315ea6ae205Smrg    *:z/VM:*:*)
316ea6ae205Smrg	echo s390-ibm-zvmoe
317ea6ae205Smrg	exit ;;
318ea6ae205Smrg    *:OS400:*:*)
31987aef7c3Smrg	echo powerpc-ibm-os400
320ea6ae205Smrg	exit ;;
321ea6ae205Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
322ea6ae205Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
323ea6ae205Smrg	exit ;;
32487aef7c3Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
325ea6ae205Smrg	echo arm-unknown-riscos
326ea6ae205Smrg	exit ;;
327ea6ae205Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
328ea6ae205Smrg	echo hppa1.1-hitachi-hiuxmpp
329ea6ae205Smrg	exit ;;
330ea6ae205Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
331ea6ae205Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
332ea6ae205Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
333ea6ae205Smrg		echo pyramid-pyramid-sysv3
334ea6ae205Smrg	else
335ea6ae205Smrg		echo pyramid-pyramid-bsd
336ea6ae205Smrg	fi
337ea6ae205Smrg	exit ;;
338ea6ae205Smrg    NILE*:*:*:dcosx)
339ea6ae205Smrg	echo pyramid-pyramid-svr4
340ea6ae205Smrg	exit ;;
341ea6ae205Smrg    DRS?6000:unix:4.0:6*)
342ea6ae205Smrg	echo sparc-icl-nx6
343ea6ae205Smrg	exit ;;
344ea6ae205Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
345ea6ae205Smrg	case `/usr/bin/uname -p` in
346ea6ae205Smrg	    sparc) echo sparc-icl-nx7; exit ;;
347ea6ae205Smrg	esac ;;
348e83ac88aSmrg    s390x:SunOS:*:*)
349e83ac88aSmrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
350e83ac88aSmrg	exit ;;
351ea6ae205Smrg    sun4H:SunOS:5.*:*)
352ea6ae205Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
353ea6ae205Smrg	exit ;;
354ea6ae205Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
355ea6ae205Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356ea6ae205Smrg	exit ;;
357b6f2c9ccSmrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
358b6f2c9ccSmrg	echo i386-pc-auroraux${UNAME_RELEASE}
359b6f2c9ccSmrg	exit ;;
360ea6ae205Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
361e83ac88aSmrg	eval $set_cc_for_build
362e83ac88aSmrg	SUN_ARCH="i386"
363e83ac88aSmrg	# If there is a compiler, see if it is configured for 64-bit objects.
364e83ac88aSmrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
365e83ac88aSmrg	# This test works for both compilers.
366e83ac88aSmrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
367e83ac88aSmrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
368e83ac88aSmrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
369e83ac88aSmrg		grep IS_64BIT_ARCH >/dev/null
370e83ac88aSmrg	    then
371e83ac88aSmrg		SUN_ARCH="x86_64"
372e83ac88aSmrg	    fi
373e83ac88aSmrg	fi
374e83ac88aSmrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
375ea6ae205Smrg	exit ;;
376ea6ae205Smrg    sun4*:SunOS:6*:*)
377ea6ae205Smrg	# According to config.sub, this is the proper way to canonicalize
378ea6ae205Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
379ea6ae205Smrg	# it's likely to be more like Solaris than SunOS4.
380ea6ae205Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
381ea6ae205Smrg	exit ;;
382ea6ae205Smrg    sun4*:SunOS:*:*)
383ea6ae205Smrg	case "`/usr/bin/arch -k`" in
384ea6ae205Smrg	    Series*|S4*)
385ea6ae205Smrg		UNAME_RELEASE=`uname -v`
386ea6ae205Smrg		;;
387ea6ae205Smrg	esac
388ea6ae205Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
389ea6ae205Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
390ea6ae205Smrg	exit ;;
391ea6ae205Smrg    sun3*:SunOS:*:*)
392ea6ae205Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
393ea6ae205Smrg	exit ;;
394ea6ae205Smrg    sun*:*:4.2BSD:*)
395ea6ae205Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
396ea6ae205Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
397ea6ae205Smrg	case "`/bin/arch`" in
398ea6ae205Smrg	    sun3)
399ea6ae205Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
400ea6ae205Smrg		;;
401ea6ae205Smrg	    sun4)
402ea6ae205Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
403ea6ae205Smrg		;;
404ea6ae205Smrg	esac
405ea6ae205Smrg	exit ;;
406ea6ae205Smrg    aushp:SunOS:*:*)
407ea6ae205Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
408ea6ae205Smrg	exit ;;
409ea6ae205Smrg    # The situation for MiNT is a little confusing.  The machine name
410ea6ae205Smrg    # can be virtually everything (everything which is not
411ea6ae205Smrg    # "atarist" or "atariste" at least should have a processor
412ea6ae205Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
413ea6ae205Smrg    # to the lowercase version "mint" (or "freemint").  Finally
414ea6ae205Smrg    # the system name "TOS" denotes a system which is actually not
415ea6ae205Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
416ea6ae205Smrg    # be no problem.
417ea6ae205Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
41887aef7c3Smrg	echo m68k-atari-mint${UNAME_RELEASE}
419ea6ae205Smrg	exit ;;
420ea6ae205Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
421ea6ae205Smrg	echo m68k-atari-mint${UNAME_RELEASE}
42287aef7c3Smrg	exit ;;
423ea6ae205Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
42487aef7c3Smrg	echo m68k-atari-mint${UNAME_RELEASE}
425ea6ae205Smrg	exit ;;
426ea6ae205Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
42787aef7c3Smrg	echo m68k-milan-mint${UNAME_RELEASE}
42887aef7c3Smrg	exit ;;
429ea6ae205Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
43087aef7c3Smrg	echo m68k-hades-mint${UNAME_RELEASE}
43187aef7c3Smrg	exit ;;
432ea6ae205Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
43387aef7c3Smrg	echo m68k-unknown-mint${UNAME_RELEASE}
43487aef7c3Smrg	exit ;;
435ea6ae205Smrg    m68k:machten:*:*)
436ea6ae205Smrg	echo m68k-apple-machten${UNAME_RELEASE}
437ea6ae205Smrg	exit ;;
438ea6ae205Smrg    powerpc:machten:*:*)
439ea6ae205Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
440ea6ae205Smrg	exit ;;
441ea6ae205Smrg    RISC*:Mach:*:*)
442ea6ae205Smrg	echo mips-dec-mach_bsd4.3
443ea6ae205Smrg	exit ;;
444ea6ae205Smrg    RISC*:ULTRIX:*:*)
445ea6ae205Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
446ea6ae205Smrg	exit ;;
447ea6ae205Smrg    VAX*:ULTRIX*:*:*)
448ea6ae205Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
449ea6ae205Smrg	exit ;;
450ea6ae205Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
451ea6ae205Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
452ea6ae205Smrg	exit ;;
453ea6ae205Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
454ea6ae205Smrg	eval $set_cc_for_build
455ea6ae205Smrg	sed 's/^	//' << EOF >$dummy.c
456ea6ae205Smrg#ifdef __cplusplus
457ea6ae205Smrg#include <stdio.h>  /* for printf() prototype */
458ea6ae205Smrg	int main (int argc, char *argv[]) {
459ea6ae205Smrg#else
460ea6ae205Smrg	int main (argc, argv) int argc; char *argv[]; {
461ea6ae205Smrg#endif
462ea6ae205Smrg	#if defined (host_mips) && defined (MIPSEB)
463ea6ae205Smrg	#if defined (SYSTYPE_SYSV)
464ea6ae205Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
465ea6ae205Smrg	#endif
466ea6ae205Smrg	#if defined (SYSTYPE_SVR4)
467ea6ae205Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
468ea6ae205Smrg	#endif
469ea6ae205Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
470ea6ae205Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
471ea6ae205Smrg	#endif
472ea6ae205Smrg	#endif
473ea6ae205Smrg	  exit (-1);
474ea6ae205Smrg	}
475ea6ae205SmrgEOF
476ea6ae205Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
477ea6ae205Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
478ea6ae205Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
479ea6ae205Smrg	    { echo "$SYSTEM_NAME"; exit; }
480ea6ae205Smrg	echo mips-mips-riscos${UNAME_RELEASE}
481ea6ae205Smrg	exit ;;
482ea6ae205Smrg    Motorola:PowerMAX_OS:*:*)
483ea6ae205Smrg	echo powerpc-motorola-powermax
484ea6ae205Smrg	exit ;;
485ea6ae205Smrg    Motorola:*:4.3:PL8-*)
486ea6ae205Smrg	echo powerpc-harris-powermax
487ea6ae205Smrg	exit ;;
488ea6ae205Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
489ea6ae205Smrg	echo powerpc-harris-powermax
490ea6ae205Smrg	exit ;;
491ea6ae205Smrg    Night_Hawk:Power_UNIX:*:*)
492ea6ae205Smrg	echo powerpc-harris-powerunix
493ea6ae205Smrg	exit ;;
494ea6ae205Smrg    m88k:CX/UX:7*:*)
495ea6ae205Smrg	echo m88k-harris-cxux7
496ea6ae205Smrg	exit ;;
497ea6ae205Smrg    m88k:*:4*:R4*)
498ea6ae205Smrg	echo m88k-motorola-sysv4
499ea6ae205Smrg	exit ;;
500ea6ae205Smrg    m88k:*:3*:R3*)
501ea6ae205Smrg	echo m88k-motorola-sysv3
502ea6ae205Smrg	exit ;;
503ea6ae205Smrg    AViiON:dgux:*:*)
50487aef7c3Smrg	# DG/UX returns AViiON for all architectures
50587aef7c3Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
506ea6ae205Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
507ea6ae205Smrg	then
508ea6ae205Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
509ea6ae205Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
510ea6ae205Smrg	    then
511ea6ae205Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
512ea6ae205Smrg	    else
513ea6ae205Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
514ea6ae205Smrg	    fi
515ea6ae205Smrg	else
516ea6ae205Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
517ea6ae205Smrg	fi
51887aef7c3Smrg	exit ;;
519ea6ae205Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
520ea6ae205Smrg	echo m88k-dolphin-sysv3
521ea6ae205Smrg	exit ;;
522ea6ae205Smrg    M88*:*:R3*:*)
523ea6ae205Smrg	# Delta 88k system running SVR3
524ea6ae205Smrg	echo m88k-motorola-sysv3
525ea6ae205Smrg	exit ;;
526ea6ae205Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
527ea6ae205Smrg	echo m88k-tektronix-sysv3
528ea6ae205Smrg	exit ;;
529ea6ae205Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
530ea6ae205Smrg	echo m68k-tektronix-bsd
531ea6ae205Smrg	exit ;;
532ea6ae205Smrg    *:IRIX*:*:*)
533ea6ae205Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
534ea6ae205Smrg	exit ;;
535ea6ae205Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
536ea6ae205Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
537ea6ae205Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
538ea6ae205Smrg    i*86:AIX:*:*)
539ea6ae205Smrg	echo i386-ibm-aix
540ea6ae205Smrg	exit ;;
541ea6ae205Smrg    ia64:AIX:*:*)
542ea6ae205Smrg	if [ -x /usr/bin/oslevel ] ; then
543ea6ae205Smrg		IBM_REV=`/usr/bin/oslevel`
544ea6ae205Smrg	else
545ea6ae205Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
546ea6ae205Smrg	fi
547ea6ae205Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
548ea6ae205Smrg	exit ;;
549ea6ae205Smrg    *:AIX:2:3)
550ea6ae205Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
551ea6ae205Smrg		eval $set_cc_for_build
552ea6ae205Smrg		sed 's/^		//' << EOF >$dummy.c
553ea6ae205Smrg		#include <sys/systemcfg.h>
554ea6ae205Smrg
555ea6ae205Smrg		main()
556ea6ae205Smrg			{
557ea6ae205Smrg			if (!__power_pc())
558ea6ae205Smrg				exit(1);
559ea6ae205Smrg			puts("powerpc-ibm-aix3.2.5");
560ea6ae205Smrg			exit(0);
561ea6ae205Smrg			}
562ea6ae205SmrgEOF
563ea6ae205Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
564ea6ae205Smrg		then
565ea6ae205Smrg			echo "$SYSTEM_NAME"
566ea6ae205Smrg		else
567ea6ae205Smrg			echo rs6000-ibm-aix3.2.5
568ea6ae205Smrg		fi
569ea6ae205Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
570ea6ae205Smrg		echo rs6000-ibm-aix3.2.4
571ea6ae205Smrg	else
572ea6ae205Smrg		echo rs6000-ibm-aix3.2
573ea6ae205Smrg	fi
574ea6ae205Smrg	exit ;;
575b6f2c9ccSmrg    *:AIX:*:[4567])
576ea6ae205Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
577ea6ae205Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
578ea6ae205Smrg		IBM_ARCH=rs6000
579ea6ae205Smrg	else
580ea6ae205Smrg		IBM_ARCH=powerpc
581ea6ae205Smrg	fi
58248f45e26Smrg	if [ -x /usr/bin/lslpp ] ; then
58348f45e26Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
58448f45e26Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
585ea6ae205Smrg	else
586ea6ae205Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
587ea6ae205Smrg	fi
588ea6ae205Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
589ea6ae205Smrg	exit ;;
590ea6ae205Smrg    *:AIX:*:*)
591ea6ae205Smrg	echo rs6000-ibm-aix
592ea6ae205Smrg	exit ;;
593ea6ae205Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
594ea6ae205Smrg	echo romp-ibm-bsd4.4
595ea6ae205Smrg	exit ;;
596ea6ae205Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
597ea6ae205Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
598ea6ae205Smrg	exit ;;                             # report: romp-ibm BSD 4.3
599ea6ae205Smrg    *:BOSX:*:*)
600ea6ae205Smrg	echo rs6000-bull-bosx
601ea6ae205Smrg	exit ;;
602ea6ae205Smrg    DPX/2?00:B.O.S.:*:*)
603ea6ae205Smrg	echo m68k-bull-sysv3
604ea6ae205Smrg	exit ;;
605ea6ae205Smrg    9000/[34]??:4.3bsd:1.*:*)
606ea6ae205Smrg	echo m68k-hp-bsd
607ea6ae205Smrg	exit ;;
608ea6ae205Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
609ea6ae205Smrg	echo m68k-hp-bsd4.4
610ea6ae205Smrg	exit ;;
611ea6ae205Smrg    9000/[34678]??:HP-UX:*:*)
612ea6ae205Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
613ea6ae205Smrg	case "${UNAME_MACHINE}" in
614ea6ae205Smrg	    9000/31? )            HP_ARCH=m68000 ;;
615ea6ae205Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
616ea6ae205Smrg	    9000/[678][0-9][0-9])
617ea6ae205Smrg		if [ -x /usr/bin/getconf ]; then
618ea6ae205Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
61987aef7c3Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
62087aef7c3Smrg		    case "${sc_cpu_version}" in
62187aef7c3Smrg		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
62287aef7c3Smrg		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
62387aef7c3Smrg		      532)                      # CPU_PA_RISC2_0
62487aef7c3Smrg			case "${sc_kernel_bits}" in
62587aef7c3Smrg			  32) HP_ARCH="hppa2.0n" ;;
62687aef7c3Smrg			  64) HP_ARCH="hppa2.0w" ;;
627ea6ae205Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
62887aef7c3Smrg			esac ;;
62987aef7c3Smrg		    esac
630ea6ae205Smrg		fi
631ea6ae205Smrg		if [ "${HP_ARCH}" = "" ]; then
632ea6ae205Smrg		    eval $set_cc_for_build
63387aef7c3Smrg		    sed 's/^		//' << EOF >$dummy.c
634ea6ae205Smrg
63587aef7c3Smrg		#define _HPUX_SOURCE
63687aef7c3Smrg		#include <stdlib.h>
63787aef7c3Smrg		#include <unistd.h>
638ea6ae205Smrg
63987aef7c3Smrg		int main ()
64087aef7c3Smrg		{
64187aef7c3Smrg		#if defined(_SC_KERNEL_BITS)
64287aef7c3Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
64387aef7c3Smrg		#endif
64487aef7c3Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
645ea6ae205Smrg
64687aef7c3Smrg		    switch (cpu)
64787aef7c3Smrg			{
64887aef7c3Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
64987aef7c3Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
65087aef7c3Smrg			case CPU_PA_RISC2_0:
65187aef7c3Smrg		#if defined(_SC_KERNEL_BITS)
65287aef7c3Smrg			    switch (bits)
65387aef7c3Smrg				{
65487aef7c3Smrg				case 64: puts ("hppa2.0w"); break;
65587aef7c3Smrg				case 32: puts ("hppa2.0n"); break;
65687aef7c3Smrg				default: puts ("hppa2.0"); break;
65787aef7c3Smrg				} break;
65887aef7c3Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
65987aef7c3Smrg			    puts ("hppa2.0"); break;
66087aef7c3Smrg		#endif
66187aef7c3Smrg			default: puts ("hppa1.0"); break;
66287aef7c3Smrg			}
66387aef7c3Smrg		    exit (0);
66487aef7c3Smrg		}
665ea6ae205SmrgEOF
666ea6ae205Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
667ea6ae205Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
668ea6ae205Smrg		fi ;;
669ea6ae205Smrg	esac
670ea6ae205Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
671ea6ae205Smrg	then
672ea6ae205Smrg	    eval $set_cc_for_build
673ea6ae205Smrg
674ea6ae205Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
675ea6ae205Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
676ea6ae205Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
677ea6ae205Smrg	    #
678ea6ae205Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
679ea6ae205Smrg	    # => hppa2.0w-hp-hpux11.23
680ea6ae205Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
681ea6ae205Smrg	    # => hppa64-hp-hpux11.23
682ea6ae205Smrg
683ea6ae205Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
684b6f2c9ccSmrg		grep -q __LP64__
685ea6ae205Smrg	    then
686ea6ae205Smrg		HP_ARCH="hppa2.0w"
687ea6ae205Smrg	    else
688ea6ae205Smrg		HP_ARCH="hppa64"
689ea6ae205Smrg	    fi
690ea6ae205Smrg	fi
691ea6ae205Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
692ea6ae205Smrg	exit ;;
693ea6ae205Smrg    ia64:HP-UX:*:*)
694ea6ae205Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
695ea6ae205Smrg	echo ia64-hp-hpux${HPUX_REV}
696ea6ae205Smrg	exit ;;
697ea6ae205Smrg    3050*:HI-UX:*:*)
698ea6ae205Smrg	eval $set_cc_for_build
699ea6ae205Smrg	sed 's/^	//' << EOF >$dummy.c
700ea6ae205Smrg	#include <unistd.h>
701ea6ae205Smrg	int
702ea6ae205Smrg	main ()
703ea6ae205Smrg	{
704ea6ae205Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
705ea6ae205Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
706ea6ae205Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
707ea6ae205Smrg	     results, however.  */
708ea6ae205Smrg	  if (CPU_IS_PA_RISC (cpu))
709ea6ae205Smrg	    {
710ea6ae205Smrg	      switch (cpu)
711ea6ae205Smrg		{
712ea6ae205Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
713ea6ae205Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
714ea6ae205Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
715ea6ae205Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
716ea6ae205Smrg		}
717ea6ae205Smrg	    }
718ea6ae205Smrg	  else if (CPU_IS_HP_MC68K (cpu))
719ea6ae205Smrg	    puts ("m68k-hitachi-hiuxwe2");
720ea6ae205Smrg	  else puts ("unknown-hitachi-hiuxwe2");
721ea6ae205Smrg	  exit (0);
722ea6ae205Smrg	}
723ea6ae205SmrgEOF
724ea6ae205Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
725ea6ae205Smrg		{ echo "$SYSTEM_NAME"; exit; }
726ea6ae205Smrg	echo unknown-hitachi-hiuxwe2
727ea6ae205Smrg	exit ;;
728ea6ae205Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
729ea6ae205Smrg	echo hppa1.1-hp-bsd
730ea6ae205Smrg	exit ;;
731ea6ae205Smrg    9000/8??:4.3bsd:*:*)
732ea6ae205Smrg	echo hppa1.0-hp-bsd
733ea6ae205Smrg	exit ;;
734ea6ae205Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
735ea6ae205Smrg	echo hppa1.0-hp-mpeix
736ea6ae205Smrg	exit ;;
737ea6ae205Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
738ea6ae205Smrg	echo hppa1.1-hp-osf
739ea6ae205Smrg	exit ;;
740ea6ae205Smrg    hp8??:OSF1:*:*)
741ea6ae205Smrg	echo hppa1.0-hp-osf
742ea6ae205Smrg	exit ;;
743ea6ae205Smrg    i*86:OSF1:*:*)
744ea6ae205Smrg	if [ -x /usr/sbin/sysversion ] ; then
745ea6ae205Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
746ea6ae205Smrg	else
747ea6ae205Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
748ea6ae205Smrg	fi
749ea6ae205Smrg	exit ;;
750ea6ae205Smrg    parisc*:Lites*:*:*)
751ea6ae205Smrg	echo hppa1.1-hp-lites
752ea6ae205Smrg	exit ;;
753ea6ae205Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
754ea6ae205Smrg	echo c1-convex-bsd
75587aef7c3Smrg	exit ;;
756ea6ae205Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
757ea6ae205Smrg	if getsysinfo -f scalar_acc
758ea6ae205Smrg	then echo c32-convex-bsd
759ea6ae205Smrg	else echo c2-convex-bsd
760ea6ae205Smrg	fi
76187aef7c3Smrg	exit ;;
762ea6ae205Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
763ea6ae205Smrg	echo c34-convex-bsd
76487aef7c3Smrg	exit ;;
765ea6ae205Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
766ea6ae205Smrg	echo c38-convex-bsd
76787aef7c3Smrg	exit ;;
768ea6ae205Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
769ea6ae205Smrg	echo c4-convex-bsd
77087aef7c3Smrg	exit ;;
771ea6ae205Smrg    CRAY*Y-MP:*:*:*)
772ea6ae205Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
773ea6ae205Smrg	exit ;;
774ea6ae205Smrg    CRAY*[A-Z]90:*:*:*)
775ea6ae205Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
776ea6ae205Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
777ea6ae205Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
778ea6ae205Smrg	      -e 's/\.[^.]*$/.X/'
779ea6ae205Smrg	exit ;;
780ea6ae205Smrg    CRAY*TS:*:*:*)
781ea6ae205Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
782ea6ae205Smrg	exit ;;
783ea6ae205Smrg    CRAY*T3E:*:*:*)
784ea6ae205Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
785ea6ae205Smrg	exit ;;
786ea6ae205Smrg    CRAY*SV1:*:*:*)
787ea6ae205Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
788ea6ae205Smrg	exit ;;
789ea6ae205Smrg    *:UNICOS/mp:*:*)
790ea6ae205Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
791ea6ae205Smrg	exit ;;
792ea6ae205Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
793ea6ae205Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
79487aef7c3Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
79587aef7c3Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
79687aef7c3Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
79787aef7c3Smrg	exit ;;
798ea6ae205Smrg    5000:UNIX_System_V:4.*:*)
79987aef7c3Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
80087aef7c3Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
80187aef7c3Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
802ea6ae205Smrg	exit ;;
803ea6ae205Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
804ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
805ea6ae205Smrg	exit ;;
806ea6ae205Smrg    sparc*:BSD/OS:*:*)
807ea6ae205Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
808ea6ae205Smrg	exit ;;
809ea6ae205Smrg    *:BSD/OS:*:*)
810ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
811ea6ae205Smrg	exit ;;
812ea6ae205Smrg    *:FreeBSD:*:*)
81387aef7c3Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
81487aef7c3Smrg	case ${UNAME_PROCESSOR} in
815ea6ae205Smrg	    amd64)
816ea6ae205Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
817ea6ae205Smrg	    *)
81887aef7c3Smrg		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
819ea6ae205Smrg	esac
820ea6ae205Smrg	exit ;;
821ea6ae205Smrg    i*:CYGWIN*:*)
822ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-cygwin
823ea6ae205Smrg	exit ;;
82487aef7c3Smrg    *:MINGW64*:*)
82587aef7c3Smrg	echo ${UNAME_MACHINE}-pc-mingw64
82687aef7c3Smrg	exit ;;
827ea6ae205Smrg    *:MINGW*:*)
828ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-mingw32
829ea6ae205Smrg	exit ;;
83048f45e26Smrg    *:MSYS*:*)
83187aef7c3Smrg	echo ${UNAME_MACHINE}-pc-msys
83287aef7c3Smrg	exit ;;
833ea6ae205Smrg    i*:windows32*:*)
83487aef7c3Smrg	# uname -m includes "-pc" on this system.
83587aef7c3Smrg	echo ${UNAME_MACHINE}-mingw32
836ea6ae205Smrg	exit ;;
837ea6ae205Smrg    i*:PW*:*)
838ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-pw32
839ea6ae205Smrg	exit ;;
840b6f2c9ccSmrg    *:Interix*:*)
84187aef7c3Smrg	case ${UNAME_MACHINE} in
842ea6ae205Smrg	    x86)
843ea6ae205Smrg		echo i586-pc-interix${UNAME_RELEASE}
844ea6ae205Smrg		exit ;;
845b6f2c9ccSmrg	    authenticamd | genuineintel | EM64T)
846ea6ae205Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
847ea6ae205Smrg		exit ;;
848ea6ae205Smrg	    IA64)
849ea6ae205Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
850ea6ae205Smrg		exit ;;
851ea6ae205Smrg	esac ;;
852ea6ae205Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
853ea6ae205Smrg	echo i${UNAME_MACHINE}-pc-mks
854ea6ae205Smrg	exit ;;
855b6f2c9ccSmrg    8664:Windows_NT:*)
856b6f2c9ccSmrg	echo x86_64-pc-mks
857b6f2c9ccSmrg	exit ;;
858ea6ae205Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
859ea6ae205Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
860ea6ae205Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
861ea6ae205Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
862ea6ae205Smrg	echo i586-pc-interix
863ea6ae205Smrg	exit ;;
864ea6ae205Smrg    i*:UWIN*:*)
865ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-uwin
866ea6ae205Smrg	exit ;;
867ea6ae205Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
868ea6ae205Smrg	echo x86_64-unknown-cygwin
869ea6ae205Smrg	exit ;;
870ea6ae205Smrg    p*:CYGWIN*:*)
871ea6ae205Smrg	echo powerpcle-unknown-cygwin
872ea6ae205Smrg	exit ;;
873ea6ae205Smrg    prep*:SunOS:5.*:*)
874ea6ae205Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
875ea6ae205Smrg	exit ;;
876ea6ae205Smrg    *:GNU:*:*)
877ea6ae205Smrg	# the GNU system
87887aef7c3Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
879ea6ae205Smrg	exit ;;
880ea6ae205Smrg    *:GNU/*:*:*)
881ea6ae205Smrg	# other systems with GNU libc and userland
88287aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
883ea6ae205Smrg	exit ;;
884ea6ae205Smrg    i*86:Minix:*:*)
885ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-minix
886ea6ae205Smrg	exit ;;
88787aef7c3Smrg    aarch64:Linux:*:*)
88887aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
88987aef7c3Smrg	exit ;;
89087aef7c3Smrg    aarch64_be:Linux:*:*)
89187aef7c3Smrg	UNAME_MACHINE=aarch64_be
89287aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
89387aef7c3Smrg	exit ;;
894b6f2c9ccSmrg    alpha:Linux:*:*)
895b6f2c9ccSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
896b6f2c9ccSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
897b6f2c9ccSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
898b6f2c9ccSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
899b6f2c9ccSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
900b6f2c9ccSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
901b6f2c9ccSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
902b6f2c9ccSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
90387aef7c3Smrg	esac
904b6f2c9ccSmrg	objdump --private-headers /bin/sh | grep -q ld.so.1
90587aef7c3Smrg	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
90687aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
90787aef7c3Smrg	exit ;;
90887aef7c3Smrg    arc:Linux:*:* | arceb:Linux:*:*)
90987aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
910b6f2c9ccSmrg	exit ;;
911ea6ae205Smrg    arm*:Linux:*:*)
912ea6ae205Smrg	eval $set_cc_for_build
913ea6ae205Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
914ea6ae205Smrg	    | grep -q __ARM_EABI__
915ea6ae205Smrg	then
91687aef7c3Smrg	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
917ea6ae205Smrg	else
91887aef7c3Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
91987aef7c3Smrg		| grep -q __ARM_PCS_VFP
92087aef7c3Smrg	    then
92187aef7c3Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
92287aef7c3Smrg	    else
92387aef7c3Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
92487aef7c3Smrg	    fi
925ea6ae205Smrg	fi
926ea6ae205Smrg	exit ;;
927ea6ae205Smrg    avr32*:Linux:*:*)
92887aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
929ea6ae205Smrg	exit ;;
930ea6ae205Smrg    cris:Linux:*:*)
93187aef7c3Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
932ea6ae205Smrg	exit ;;
933ea6ae205Smrg    crisv32:Linux:*:*)
93487aef7c3Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
935ea6ae205Smrg	exit ;;
936ea6ae205Smrg    frv:Linux:*:*)
93787aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
93887aef7c3Smrg	exit ;;
93987aef7c3Smrg    hexagon:Linux:*:*)
94087aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
941ea6ae205Smrg	exit ;;
942b6f2c9ccSmrg    i*86:Linux:*:*)
94387aef7c3Smrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
944b6f2c9ccSmrg	exit ;;
945ea6ae205Smrg    ia64:Linux:*:*)
94687aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
947ea6ae205Smrg	exit ;;
948ea6ae205Smrg    m32r*:Linux:*:*)
94987aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
950ea6ae205Smrg	exit ;;
951ea6ae205Smrg    m68*:Linux:*:*)
95287aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
953ea6ae205Smrg	exit ;;
954b6f2c9ccSmrg    mips:Linux:*:* | mips64:Linux:*:*)
955ea6ae205Smrg	eval $set_cc_for_build
956ea6ae205Smrg	sed 's/^	//' << EOF >$dummy.c
957ea6ae205Smrg	#undef CPU
958b6f2c9ccSmrg	#undef ${UNAME_MACHINE}
959b6f2c9ccSmrg	#undef ${UNAME_MACHINE}el
960ea6ae205Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
961b6f2c9ccSmrg	CPU=${UNAME_MACHINE}el
962ea6ae205Smrg	#else
963ea6ae205Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
964b6f2c9ccSmrg	CPU=${UNAME_MACHINE}
965ea6ae205Smrg	#else
966ea6ae205Smrg	CPU=
967ea6ae205Smrg	#endif
968ea6ae205Smrg	#endif
969ea6ae205SmrgEOF
970b6f2c9ccSmrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
97187aef7c3Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
972ea6ae205Smrg	;;
97348f45e26Smrg    openrisc*:Linux:*:*)
97448f45e26Smrg	echo or1k-unknown-linux-${LIBC}
97587aef7c3Smrg	exit ;;
97648f45e26Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
97787aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
978ea6ae205Smrg	exit ;;
979e83ac88aSmrg    padre:Linux:*:*)
98087aef7c3Smrg	echo sparc-unknown-linux-${LIBC}
981e83ac88aSmrg	exit ;;
982b6f2c9ccSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
98387aef7c3Smrg	echo hppa64-unknown-linux-${LIBC}
984b6f2c9ccSmrg	exit ;;
985ea6ae205Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
986ea6ae205Smrg	# Look for CPU level
987ea6ae205Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
98887aef7c3Smrg	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
98987aef7c3Smrg	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
99087aef7c3Smrg	  *)    echo hppa-unknown-linux-${LIBC} ;;
991ea6ae205Smrg	esac
992ea6ae205Smrg	exit ;;
993b6f2c9ccSmrg    ppc64:Linux:*:*)
99487aef7c3Smrg	echo powerpc64-unknown-linux-${LIBC}
995b6f2c9ccSmrg	exit ;;
996b6f2c9ccSmrg    ppc:Linux:*:*)
99787aef7c3Smrg	echo powerpc-unknown-linux-${LIBC}
99887aef7c3Smrg	exit ;;
99987aef7c3Smrg    ppc64le:Linux:*:*)
100087aef7c3Smrg	echo powerpc64le-unknown-linux-${LIBC}
100187aef7c3Smrg	exit ;;
100287aef7c3Smrg    ppcle:Linux:*:*)
100387aef7c3Smrg	echo powerpcle-unknown-linux-${LIBC}
1004ea6ae205Smrg	exit ;;
1005ea6ae205Smrg    s390:Linux:*:* | s390x:Linux:*:*)
100687aef7c3Smrg	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
1007ea6ae205Smrg	exit ;;
1008ea6ae205Smrg    sh64*:Linux:*:*)
100987aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1010ea6ae205Smrg	exit ;;
1011ea6ae205Smrg    sh*:Linux:*:*)
101287aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1013ea6ae205Smrg	exit ;;
1014ea6ae205Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
101587aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1016ea6ae205Smrg	exit ;;
1017b6f2c9ccSmrg    tile*:Linux:*:*)
101887aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1019b6f2c9ccSmrg	exit ;;
1020ea6ae205Smrg    vax:Linux:*:*)
102187aef7c3Smrg	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1022ea6ae205Smrg	exit ;;
1023ea6ae205Smrg    x86_64:Linux:*:*)
102487aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1025ea6ae205Smrg	exit ;;
1026ea6ae205Smrg    xtensa*:Linux:*:*)
102787aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1028ea6ae205Smrg	exit ;;
1029ea6ae205Smrg    i*86:DYNIX/ptx:4*:*)
1030ea6ae205Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1031ea6ae205Smrg	# earlier versions are messed up and put the nodename in both
1032ea6ae205Smrg	# sysname and nodename.
1033ea6ae205Smrg	echo i386-sequent-sysv4
1034ea6ae205Smrg	exit ;;
1035ea6ae205Smrg    i*86:UNIX_SV:4.2MP:2.*)
103687aef7c3Smrg	# Unixware is an offshoot of SVR4, but it has its own version
103787aef7c3Smrg	# number series starting with 2...
103887aef7c3Smrg	# I am not positive that other SVR4 systems won't match this,
1039ea6ae205Smrg	# I just have to hope.  -- rms.
104087aef7c3Smrg	# Use sysv4.2uw... so that sysv4* matches it.
1041ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1042ea6ae205Smrg	exit ;;
1043ea6ae205Smrg    i*86:OS/2:*:*)
1044ea6ae205Smrg	# If we were able to find `uname', then EMX Unix compatibility
1045ea6ae205Smrg	# is probably installed.
1046ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
1047ea6ae205Smrg	exit ;;
1048ea6ae205Smrg    i*86:XTS-300:*:STOP)
1049ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-stop
1050ea6ae205Smrg	exit ;;
1051ea6ae205Smrg    i*86:atheos:*:*)
1052ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-atheos
1053ea6ae205Smrg	exit ;;
1054ea6ae205Smrg    i*86:syllable:*:*)
1055ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-syllable
1056ea6ae205Smrg	exit ;;
1057b6f2c9ccSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1058ea6ae205Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
1059ea6ae205Smrg	exit ;;
1060ea6ae205Smrg    i*86:*DOS:*:*)
1061ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1062ea6ae205Smrg	exit ;;
1063ea6ae205Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1064ea6ae205Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1065ea6ae205Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1066ea6ae205Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1067ea6ae205Smrg	else
1068ea6ae205Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1069ea6ae205Smrg	fi
1070ea6ae205Smrg	exit ;;
1071ea6ae205Smrg    i*86:*:5:[678]*)
107287aef7c3Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1073ea6ae205Smrg	case `/bin/uname -X | grep "^Machine"` in
1074ea6ae205Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
1075ea6ae205Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1076ea6ae205Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1077ea6ae205Smrg	esac
1078ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1079ea6ae205Smrg	exit ;;
1080ea6ae205Smrg    i*86:*:3.2:*)
1081ea6ae205Smrg	if test -f /usr/options/cb.name; then
1082ea6ae205Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1083ea6ae205Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1084ea6ae205Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1085ea6ae205Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1086ea6ae205Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1087ea6ae205Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1088ea6ae205Smrg			&& UNAME_MACHINE=i586
1089ea6ae205Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1090ea6ae205Smrg			&& UNAME_MACHINE=i686
1091ea6ae205Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1092ea6ae205Smrg			&& UNAME_MACHINE=i686
1093ea6ae205Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1094ea6ae205Smrg	else
1095ea6ae205Smrg		echo ${UNAME_MACHINE}-pc-sysv32
1096ea6ae205Smrg	fi
1097ea6ae205Smrg	exit ;;
1098ea6ae205Smrg    pc:*:*:*)
1099ea6ae205Smrg	# Left here for compatibility:
110087aef7c3Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
110187aef7c3Smrg	# the processor, so we play safe by assuming i586.
1102e83ac88aSmrg	# Note: whatever this is, it MUST be the same as what config.sub
1103e83ac88aSmrg	# prints for the "djgpp" host, or else GDB configury will decide that
1104e83ac88aSmrg	# this is a cross-build.
1105e83ac88aSmrg	echo i586-pc-msdosdjgpp
110687aef7c3Smrg	exit ;;
1107ea6ae205Smrg    Intel:Mach:3*:*)
1108ea6ae205Smrg	echo i386-pc-mach3
1109ea6ae205Smrg	exit ;;
1110ea6ae205Smrg    paragon:*:*:*)
1111ea6ae205Smrg	echo i860-intel-osf1
1112ea6ae205Smrg	exit ;;
1113ea6ae205Smrg    i860:*:4.*:*) # i860-SVR4
1114ea6ae205Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1115ea6ae205Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1116ea6ae205Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
1117ea6ae205Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1118ea6ae205Smrg	fi
1119ea6ae205Smrg	exit ;;
1120ea6ae205Smrg    mini*:CTIX:SYS*5:*)
1121ea6ae205Smrg	# "miniframe"
1122ea6ae205Smrg	echo m68010-convergent-sysv
1123ea6ae205Smrg	exit ;;
1124ea6ae205Smrg    mc68k:UNIX:SYSTEM5:3.51m)
1125ea6ae205Smrg	echo m68k-convergent-sysv
1126ea6ae205Smrg	exit ;;
1127ea6ae205Smrg    M680?0:D-NIX:5.3:*)
1128ea6ae205Smrg	echo m68k-diab-dnix
1129ea6ae205Smrg	exit ;;
1130ea6ae205Smrg    M68*:*:R3V[5678]*:*)
1131ea6ae205Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1132ea6ae205Smrg    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)
1133ea6ae205Smrg	OS_REL=''
1134ea6ae205Smrg	test -r /etc/.relid \
1135ea6ae205Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1136ea6ae205Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1137ea6ae205Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1138ea6ae205Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1139ea6ae205Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1140ea6ae205Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
114187aef7c3Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
114287aef7c3Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
1143e83ac88aSmrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1144e83ac88aSmrg	OS_REL='.3'
1145e83ac88aSmrg	test -r /etc/.relid \
1146e83ac88aSmrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1147e83ac88aSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1148e83ac88aSmrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1149e83ac88aSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1150e83ac88aSmrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1151e83ac88aSmrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1152e83ac88aSmrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1153ea6ae205Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1154ea6ae205Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
1155ea6ae205Smrg	exit ;;
1156ea6ae205Smrg    mc68030:UNIX_System_V:4.*:*)
1157ea6ae205Smrg	echo m68k-atari-sysv4
1158ea6ae205Smrg	exit ;;
1159ea6ae205Smrg    TSUNAMI:LynxOS:2.*:*)
1160ea6ae205Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
1161ea6ae205Smrg	exit ;;
1162ea6ae205Smrg    rs6000:LynxOS:2.*:*)
1163ea6ae205Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1164ea6ae205Smrg	exit ;;
1165b6f2c9ccSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1166ea6ae205Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1167ea6ae205Smrg	exit ;;
1168ea6ae205Smrg    SM[BE]S:UNIX_SV:*:*)
1169ea6ae205Smrg	echo mips-dde-sysv${UNAME_RELEASE}
1170ea6ae205Smrg	exit ;;
1171ea6ae205Smrg    RM*:ReliantUNIX-*:*:*)
1172ea6ae205Smrg	echo mips-sni-sysv4
1173ea6ae205Smrg	exit ;;
1174ea6ae205Smrg    RM*:SINIX-*:*:*)
1175ea6ae205Smrg	echo mips-sni-sysv4
1176ea6ae205Smrg	exit ;;
1177ea6ae205Smrg    *:SINIX-*:*:*)
1178ea6ae205Smrg	if uname -p 2>/dev/null >/dev/null ; then
1179ea6ae205Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1180ea6ae205Smrg		echo ${UNAME_MACHINE}-sni-sysv4
1181ea6ae205Smrg	else
1182ea6ae205Smrg		echo ns32k-sni-sysv
1183ea6ae205Smrg	fi
1184ea6ae205Smrg	exit ;;
118587aef7c3Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
118687aef7c3Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
118787aef7c3Smrg	echo i586-unisys-sysv4
118887aef7c3Smrg	exit ;;
1189ea6ae205Smrg    *:UNIX_System_V:4*:FTX*)
1190ea6ae205Smrg	# From Gerald Hewes <hewes@openmarket.com>.
1191ea6ae205Smrg	# How about differentiating between stratus architectures? -djm
1192ea6ae205Smrg	echo hppa1.1-stratus-sysv4
1193ea6ae205Smrg	exit ;;
1194ea6ae205Smrg    *:*:*:FTX*)
1195ea6ae205Smrg	# From seanf@swdc.stratus.com.
1196ea6ae205Smrg	echo i860-stratus-sysv4
1197ea6ae205Smrg	exit ;;
1198ea6ae205Smrg    i*86:VOS:*:*)
1199ea6ae205Smrg	# From Paul.Green@stratus.com.
1200ea6ae205Smrg	echo ${UNAME_MACHINE}-stratus-vos
1201ea6ae205Smrg	exit ;;
1202ea6ae205Smrg    *:VOS:*:*)
1203ea6ae205Smrg	# From Paul.Green@stratus.com.
1204ea6ae205Smrg	echo hppa1.1-stratus-vos
1205ea6ae205Smrg	exit ;;
1206ea6ae205Smrg    mc68*:A/UX:*:*)
1207ea6ae205Smrg	echo m68k-apple-aux${UNAME_RELEASE}
1208ea6ae205Smrg	exit ;;
1209ea6ae205Smrg    news*:NEWS-OS:6*:*)
1210ea6ae205Smrg	echo mips-sony-newsos6
1211ea6ae205Smrg	exit ;;
1212ea6ae205Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1213ea6ae205Smrg	if [ -d /usr/nec ]; then
121487aef7c3Smrg		echo mips-nec-sysv${UNAME_RELEASE}
1215ea6ae205Smrg	else
121687aef7c3Smrg		echo mips-unknown-sysv${UNAME_RELEASE}
1217ea6ae205Smrg	fi
121887aef7c3Smrg	exit ;;
1219ea6ae205Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1220ea6ae205Smrg	echo powerpc-be-beos
1221ea6ae205Smrg	exit ;;
1222ea6ae205Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1223ea6ae205Smrg	echo powerpc-apple-beos
1224ea6ae205Smrg	exit ;;
1225ea6ae205Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1226ea6ae205Smrg	echo i586-pc-beos
1227ea6ae205Smrg	exit ;;
1228e83ac88aSmrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1229e83ac88aSmrg	echo i586-pc-haiku
1230e83ac88aSmrg	exit ;;
123187aef7c3Smrg    x86_64:Haiku:*:*)
123287aef7c3Smrg	echo x86_64-unknown-haiku
123387aef7c3Smrg	exit ;;
1234ea6ae205Smrg    SX-4:SUPER-UX:*:*)
1235ea6ae205Smrg	echo sx4-nec-superux${UNAME_RELEASE}
1236ea6ae205Smrg	exit ;;
1237ea6ae205Smrg    SX-5:SUPER-UX:*:*)
1238ea6ae205Smrg	echo sx5-nec-superux${UNAME_RELEASE}
1239ea6ae205Smrg	exit ;;
1240ea6ae205Smrg    SX-6:SUPER-UX:*:*)
1241ea6ae205Smrg	echo sx6-nec-superux${UNAME_RELEASE}
1242ea6ae205Smrg	exit ;;
1243ea6ae205Smrg    SX-7:SUPER-UX:*:*)
1244ea6ae205Smrg	echo sx7-nec-superux${UNAME_RELEASE}
1245ea6ae205Smrg	exit ;;
1246ea6ae205Smrg    SX-8:SUPER-UX:*:*)
1247ea6ae205Smrg	echo sx8-nec-superux${UNAME_RELEASE}
1248ea6ae205Smrg	exit ;;
1249ea6ae205Smrg    SX-8R:SUPER-UX:*:*)
1250ea6ae205Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
1251ea6ae205Smrg	exit ;;
1252ea6ae205Smrg    Power*:Rhapsody:*:*)
1253ea6ae205Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1254ea6ae205Smrg	exit ;;
1255ea6ae205Smrg    *:Rhapsody:*:*)
1256ea6ae205Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1257ea6ae205Smrg	exit ;;
1258ea6ae205Smrg    *:Darwin:*:*)
1259ea6ae205Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
126087aef7c3Smrg	eval $set_cc_for_build
126187aef7c3Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
126287aef7c3Smrg	    UNAME_PROCESSOR=powerpc
126387aef7c3Smrg	fi
126448f45e26Smrg	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
126548f45e26Smrg	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
126648f45e26Smrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
126748f45e26Smrg		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
126848f45e26Smrg		    grep IS_64BIT_ARCH >/dev/null
126948f45e26Smrg		then
127048f45e26Smrg		    case $UNAME_PROCESSOR in
127148f45e26Smrg			i386) UNAME_PROCESSOR=x86_64 ;;
127248f45e26Smrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
127348f45e26Smrg		    esac
127448f45e26Smrg		fi
127587aef7c3Smrg	    fi
127648f45e26Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
127748f45e26Smrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
127848f45e26Smrg	    # that puts up a graphical alert prompting to install
127948f45e26Smrg	    # developer tools.  Any system running Mac OS X 10.7 or
128048f45e26Smrg	    # later (Darwin 11 and later) is required to have a 64-bit
128148f45e26Smrg	    # processor. This is not true of the ARM version of Darwin
128248f45e26Smrg	    # that Apple uses in portable devices.
128348f45e26Smrg	    UNAME_PROCESSOR=x86_64
128487aef7c3Smrg	fi
1285ea6ae205Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1286ea6ae205Smrg	exit ;;
1287ea6ae205Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1288ea6ae205Smrg	UNAME_PROCESSOR=`uname -p`
1289ea6ae205Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
1290ea6ae205Smrg		UNAME_PROCESSOR=i386
1291ea6ae205Smrg		UNAME_MACHINE=pc
1292ea6ae205Smrg	fi
1293ea6ae205Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1294ea6ae205Smrg	exit ;;
1295ea6ae205Smrg    *:QNX:*:4*)
1296ea6ae205Smrg	echo i386-pc-qnx
1297ea6ae205Smrg	exit ;;
129887aef7c3Smrg    NEO-?:NONSTOP_KERNEL:*:*)
129987aef7c3Smrg	echo neo-tandem-nsk${UNAME_RELEASE}
130087aef7c3Smrg	exit ;;
130187aef7c3Smrg    NSE-*:NONSTOP_KERNEL:*:*)
1302ea6ae205Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
1303ea6ae205Smrg	exit ;;
1304ea6ae205Smrg    NSR-?:NONSTOP_KERNEL:*:*)
1305ea6ae205Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
1306ea6ae205Smrg	exit ;;
1307ea6ae205Smrg    *:NonStop-UX:*:*)
1308ea6ae205Smrg	echo mips-compaq-nonstopux
1309ea6ae205Smrg	exit ;;
1310ea6ae205Smrg    BS2000:POSIX*:*:*)
1311ea6ae205Smrg	echo bs2000-siemens-sysv
1312ea6ae205Smrg	exit ;;
1313ea6ae205Smrg    DS/*:UNIX_System_V:*:*)
1314ea6ae205Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1315ea6ae205Smrg	exit ;;
1316ea6ae205Smrg    *:Plan9:*:*)
1317ea6ae205Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
1318ea6ae205Smrg	# is converted to i386 for consistency with other x86
1319ea6ae205Smrg	# operating systems.
1320ea6ae205Smrg	if test "$cputype" = "386"; then
1321ea6ae205Smrg	    UNAME_MACHINE=i386
1322ea6ae205Smrg	else
1323ea6ae205Smrg	    UNAME_MACHINE="$cputype"
1324ea6ae205Smrg	fi
1325ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-plan9
1326ea6ae205Smrg	exit ;;
1327ea6ae205Smrg    *:TOPS-10:*:*)
1328ea6ae205Smrg	echo pdp10-unknown-tops10
1329ea6ae205Smrg	exit ;;
1330ea6ae205Smrg    *:TENEX:*:*)
1331ea6ae205Smrg	echo pdp10-unknown-tenex
1332ea6ae205Smrg	exit ;;
1333ea6ae205Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1334ea6ae205Smrg	echo pdp10-dec-tops20
1335ea6ae205Smrg	exit ;;
1336ea6ae205Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1337ea6ae205Smrg	echo pdp10-xkl-tops20
1338ea6ae205Smrg	exit ;;
1339ea6ae205Smrg    *:TOPS-20:*:*)
1340ea6ae205Smrg	echo pdp10-unknown-tops20
1341ea6ae205Smrg	exit ;;
1342ea6ae205Smrg    *:ITS:*:*)
1343ea6ae205Smrg	echo pdp10-unknown-its
1344ea6ae205Smrg	exit ;;
1345ea6ae205Smrg    SEI:*:*:SEIUX)
134687aef7c3Smrg	echo mips-sei-seiux${UNAME_RELEASE}
1347ea6ae205Smrg	exit ;;
1348ea6ae205Smrg    *:DragonFly:*:*)
1349ea6ae205Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1350ea6ae205Smrg	exit ;;
1351ea6ae205Smrg    *:*VMS:*:*)
135287aef7c3Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1353ea6ae205Smrg	case "${UNAME_MACHINE}" in
1354ea6ae205Smrg	    A*) echo alpha-dec-vms ; exit ;;
1355ea6ae205Smrg	    I*) echo ia64-dec-vms ; exit ;;
1356ea6ae205Smrg	    V*) echo vax-dec-vms ; exit ;;
1357ea6ae205Smrg	esac ;;
1358ea6ae205Smrg    *:XENIX:*:SysV)
1359ea6ae205Smrg	echo i386-pc-xenix
1360ea6ae205Smrg	exit ;;
1361ea6ae205Smrg    i*86:skyos:*:*)
1362ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1363ea6ae205Smrg	exit ;;
1364ea6ae205Smrg    i*86:rdos:*:*)
1365ea6ae205Smrg	echo ${UNAME_MACHINE}-pc-rdos
1366ea6ae205Smrg	exit ;;
1367e83ac88aSmrg    i*86:AROS:*:*)
1368e83ac88aSmrg	echo ${UNAME_MACHINE}-pc-aros
1369e83ac88aSmrg	exit ;;
137087aef7c3Smrg    x86_64:VMkernel:*:*)
137187aef7c3Smrg	echo ${UNAME_MACHINE}-unknown-esx
137287aef7c3Smrg	exit ;;
1373ea6ae205Smrgesac
1374ea6ae205Smrg
1375ea6ae205Smrgcat >&2 <<EOF
1376ea6ae205Smrg$0: unable to guess system type
1377ea6ae205Smrg
1378ea6ae205SmrgThis script, last modified $timestamp, has failed to recognize
1379ea6ae205Smrgthe operating system you are using. It is advised that you
1380ea6ae205Smrgdownload the most up to date version of the config scripts from
1381ea6ae205Smrg
1382e83ac88aSmrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1383ea6ae205Smrgand
1384e83ac88aSmrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1385ea6ae205Smrg
1386ea6ae205SmrgIf the version you run ($0) is already up to date, please
1387ea6ae205Smrgsend the following data and any information you think might be
1388ea6ae205Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
1389ea6ae205Smrginformation to handle your system.
1390ea6ae205Smrg
1391ea6ae205Smrgconfig.guess timestamp = $timestamp
1392ea6ae205Smrg
1393ea6ae205Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1394ea6ae205Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1395ea6ae205Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1396ea6ae205Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1397ea6ae205Smrg
1398ea6ae205Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1399ea6ae205Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1400ea6ae205Smrg
1401ea6ae205Smrghostinfo               = `(hostinfo) 2>/dev/null`
1402ea6ae205Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1403ea6ae205Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1404ea6ae205Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1405ea6ae205Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1406ea6ae205Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1407ea6ae205Smrg
1408ea6ae205SmrgUNAME_MACHINE = ${UNAME_MACHINE}
1409ea6ae205SmrgUNAME_RELEASE = ${UNAME_RELEASE}
1410ea6ae205SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
1411ea6ae205SmrgUNAME_VERSION = ${UNAME_VERSION}
1412ea6ae205SmrgEOF
1413ea6ae205Smrg
1414ea6ae205Smrgexit 1
1415ea6ae205Smrg
1416ea6ae205Smrg# Local variables:
1417ea6ae205Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
1418ea6ae205Smrg# time-stamp-start: "timestamp='"
1419ea6ae205Smrg# time-stamp-format: "%:y-%02m-%02d"
1420ea6ae205Smrg# time-stamp-end: "'"
1421ea6ae205Smrg# End:
1422