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