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