1a253d6aeSmrg#! /bin/sh
2a253d6aeSmrg# Attempt to guess a canonical system name.
310f94802Smrg#   Copyright 1992-2024 Free Software Foundation, Inc.
4a253d6aeSmrg
5b41a30aaSmrg# shellcheck disable=SC2006,SC2268 # see below for rationale
6b41a30aaSmrg
710f94802Smrgtimestamp='2024-01-01'
8a253d6aeSmrg
9a253d6aeSmrg# This file is free software; you can redistribute it and/or modify it
10a253d6aeSmrg# under the terms of the GNU General Public License as published by
1110f94802Smrg# the Free Software Foundation, either version 3 of the License, or
12a253d6aeSmrg# (at your option) any later version.
13a253d6aeSmrg#
14a253d6aeSmrg# This program is distributed in the hope that it will be useful, but
15a253d6aeSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16a253d6aeSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17a253d6aeSmrg# General Public License for more details.
18a253d6aeSmrg#
19a253d6aeSmrg# You should have received a copy of the GNU General Public License
20b41a30aaSmrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
21a253d6aeSmrg#
22a253d6aeSmrg# As a special exception to the GNU General Public License, if you
23a253d6aeSmrg# distribute this file as part of a program that contains a
24a253d6aeSmrg# configuration script generated by Autoconf, you may include it under
2557ee1794Smrg# the same distribution terms that you use for the rest of that
2657ee1794Smrg# program.  This Exception is an additional permission under section 7
2757ee1794Smrg# of the GNU General Public License, version 3 ("GPLv3").
28a253d6aeSmrg#
29b41a30aaSmrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
30a253d6aeSmrg#
3125b89263Smrg# You can get the latest version of this script from:
32b41a30aaSmrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
3357ee1794Smrg#
34b41a30aaSmrg# Please send patches to <config-patches@gnu.org>.
35b41a30aaSmrg
36b41a30aaSmrg
37b41a30aaSmrg# The "shellcheck disable" line above the timestamp inhibits complaints
38b41a30aaSmrg# about features and limitations of the classic Bourne shell that were
39b41a30aaSmrg# superseded or lifted in POSIX.  However, this script identifies a wide
40b41a30aaSmrg# variety of pre-POSIX systems that do not have POSIX shells at all, and
41b41a30aaSmrg# even some reasonably current systems (Solaris 10 as case-in-point) still
42b41a30aaSmrg# have a pre-POSIX /bin/sh.
4357ee1794Smrg
44a253d6aeSmrg
45a253d6aeSmrgme=`echo "$0" | sed -e 's,.*/,,'`
46a253d6aeSmrg
47a253d6aeSmrgusage="\
48a253d6aeSmrgUsage: $0 [OPTION]
49a253d6aeSmrg
5010f94802SmrgOutput the configuration name of the system '$me' is run on.
51a253d6aeSmrg
52b41a30aaSmrgOptions:
53a253d6aeSmrg  -h, --help         print this help, then exit
54a253d6aeSmrg  -t, --time-stamp   print date of last modification, then exit
55a253d6aeSmrg  -v, --version      print version number, then exit
56a253d6aeSmrg
57a253d6aeSmrgReport bugs and patches to <config-patches@gnu.org>."
58a253d6aeSmrg
59a253d6aeSmrgversion="\
60a253d6aeSmrgGNU config.guess ($timestamp)
61a253d6aeSmrg
62a253d6aeSmrgOriginally written by Per Bothner.
6310f94802SmrgCopyright 1992-2024 Free Software Foundation, Inc.
64a253d6aeSmrg
65a253d6aeSmrgThis is free software; see the source for copying conditions.  There is NO
66a253d6aeSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
67a253d6aeSmrg
68a253d6aeSmrghelp="
6910f94802SmrgTry '$me --help' for more information."
70a253d6aeSmrg
71a253d6aeSmrg# Parse command line
72a253d6aeSmrgwhile test $# -gt 0 ; do
73a253d6aeSmrg  case $1 in
74a253d6aeSmrg    --time-stamp | --time* | -t )
75a253d6aeSmrg       echo "$timestamp" ; exit ;;
76a253d6aeSmrg    --version | -v )
77a253d6aeSmrg       echo "$version" ; exit ;;
78a253d6aeSmrg    --help | --h* | -h )
79a253d6aeSmrg       echo "$usage"; exit ;;
80a253d6aeSmrg    -- )     # Stop option processing
81a253d6aeSmrg       shift; break ;;
82a253d6aeSmrg    - )	# Use stdin as input.
83a253d6aeSmrg       break ;;
84a253d6aeSmrg    -* )
85a253d6aeSmrg       echo "$me: invalid option $1$help" >&2
86a253d6aeSmrg       exit 1 ;;
87a253d6aeSmrg    * )
88a253d6aeSmrg       break ;;
89a253d6aeSmrg  esac
90a253d6aeSmrgdone
91a253d6aeSmrg
92a253d6aeSmrgif test $# != 0; then
93a253d6aeSmrg  echo "$me: too many arguments$help" >&2
94a253d6aeSmrg  exit 1
95a253d6aeSmrgfi
96a253d6aeSmrg
97b41a30aaSmrg# Just in case it came from the environment.
98b41a30aaSmrgGUESS=
99a253d6aeSmrg
100a253d6aeSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
101a253d6aeSmrg# compiler to aid in system detection is discouraged as it requires
102a253d6aeSmrg# temporary files to be created and, as you can see below, it is a
103a253d6aeSmrg# headache to deal with in a portable fashion.
104a253d6aeSmrg
10510f94802Smrg# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
10610f94802Smrg# use 'HOST_CC' if defined, but it is deprecated.
107a253d6aeSmrg
108a253d6aeSmrg# Portable tmp directory creation inspired by the Autoconf team.
109a253d6aeSmrg
110b41a30aaSmrgtmp=
111b41a30aaSmrg# shellcheck disable=SC2172
112b41a30aaSmrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
113b41a30aaSmrg
114b41a30aaSmrgset_cc_for_build() {
115b41a30aaSmrg    # prevent multiple calls if $tmp is already set
116b41a30aaSmrg    test "$tmp" && return 0
117b41a30aaSmrg    : "${TMPDIR=/tmp}"
118b41a30aaSmrg    # shellcheck disable=SC2039,SC3028
119b41a30aaSmrg    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
120b41a30aaSmrg	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
121b41a30aaSmrg	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
122b41a30aaSmrg	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
123b41a30aaSmrg    dummy=$tmp/dummy
124b41a30aaSmrg    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
125b41a30aaSmrg	,,)    echo "int x;" > "$dummy.c"
126b41a30aaSmrg	       for driver in cc gcc c89 c99 ; do
127b41a30aaSmrg		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
128b41a30aaSmrg		       CC_FOR_BUILD=$driver
129b41a30aaSmrg		       break
130b41a30aaSmrg		   fi
131b41a30aaSmrg	       done
132b41a30aaSmrg	       if test x"$CC_FOR_BUILD" = x ; then
133b41a30aaSmrg		   CC_FOR_BUILD=no_compiler_found
134b41a30aaSmrg	       fi
135b41a30aaSmrg	       ;;
136b41a30aaSmrg	,,*)   CC_FOR_BUILD=$CC ;;
137b41a30aaSmrg	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
138b41a30aaSmrg    esac
139b41a30aaSmrg}
140a253d6aeSmrg
141a253d6aeSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
142a253d6aeSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
143b41a30aaSmrgif test -f /.attbin/uname ; then
144a253d6aeSmrg	PATH=$PATH:/.attbin ; export PATH
145a253d6aeSmrgfi
146a253d6aeSmrg
147a253d6aeSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
148a253d6aeSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
149b41a30aaSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
150a253d6aeSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
151a253d6aeSmrg
152b41a30aaSmrgcase $UNAME_SYSTEM in
15331637056SmrgLinux|GNU|GNU/*)
154b41a30aaSmrg	LIBC=unknown
15531637056Smrg
156b41a30aaSmrg	set_cc_for_build
157b41a30aaSmrg	cat <<-EOF > "$dummy.c"
15810f94802Smrg	#if defined(__ANDROID__)
15910f94802Smrg	LIBC=android
16010f94802Smrg	#else
16131637056Smrg	#include <features.h>
16231637056Smrg	#if defined(__UCLIBC__)
16331637056Smrg	LIBC=uclibc
16431637056Smrg	#elif defined(__dietlibc__)
16531637056Smrg	LIBC=dietlibc
166b41a30aaSmrg	#elif defined(__GLIBC__)
16731637056Smrg	LIBC=gnu
16810f94802Smrg	#elif defined(__LLVM_LIBC__)
16910f94802Smrg	LIBC=llvm
170b41a30aaSmrg	#else
171b41a30aaSmrg	#include <stdarg.h>
172b41a30aaSmrg	/* First heuristic to detect musl libc.  */
173b41a30aaSmrg	#ifdef __DEFINED_va_list
174b41a30aaSmrg	LIBC=musl
175b41a30aaSmrg	#endif
17631637056Smrg	#endif
17710f94802Smrg	#endif
17831637056Smrg	EOF
179b41a30aaSmrg	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
180b41a30aaSmrg	eval "$cc_set_libc"
181b41a30aaSmrg
182b41a30aaSmrg	# Second heuristic to detect musl libc.
183b41a30aaSmrg	if [ "$LIBC" = unknown ] &&
184b41a30aaSmrg	   command -v ldd >/dev/null &&
185b41a30aaSmrg	   ldd --version 2>&1 | grep -q ^musl; then
186b41a30aaSmrg		LIBC=musl
187b41a30aaSmrg	fi
188b41a30aaSmrg
189b41a30aaSmrg	# If the system lacks a compiler, then just pick glibc.
190b41a30aaSmrg	# We could probably try harder.
191b41a30aaSmrg	if [ "$LIBC" = unknown ]; then
192b41a30aaSmrg		LIBC=gnu
193b41a30aaSmrg	fi
19431637056Smrg	;;
19531637056Smrgesac
19631637056Smrg
197a253d6aeSmrg# Note: order is significant - the case branches are not exclusive.
198a253d6aeSmrg
199b41a30aaSmrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
200a253d6aeSmrg    *:NetBSD:*:*)
201a253d6aeSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
20257ee1794Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
203a253d6aeSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
204a253d6aeSmrg	# switched to ELF, *-*-netbsd* would select the old
205a253d6aeSmrg	# object file format.  This provides both forward
206a253d6aeSmrg	# compatibility and a consistent mechanism for selecting the
207a253d6aeSmrg	# object file format.
208a253d6aeSmrg	#
209a253d6aeSmrg	# Note: NetBSD doesn't particularly care about the vendor
210a253d6aeSmrg	# portion of the name.  We always set it to "unknown".
211b41a30aaSmrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
212b41a30aaSmrg	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
213b41a30aaSmrg	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
214b41a30aaSmrg	    echo unknown)`
215b41a30aaSmrg	case $UNAME_MACHINE_ARCH in
216b41a30aaSmrg	    aarch64eb) machine=aarch64_be-unknown ;;
217a253d6aeSmrg	    armeb) machine=armeb-unknown ;;
218a253d6aeSmrg	    arm*) machine=arm-unknown ;;
219a253d6aeSmrg	    sh3el) machine=shl-unknown ;;
220a253d6aeSmrg	    sh3eb) machine=sh-unknown ;;
221ea133fd7Smrg	    sh5el) machine=sh5le-unknown ;;
222b41a30aaSmrg	    earmv*)
223b41a30aaSmrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
224b41a30aaSmrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
225b41a30aaSmrg		machine=${arch}${endian}-unknown
226b41a30aaSmrg		;;
227b41a30aaSmrg	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
228a253d6aeSmrg	esac
229a253d6aeSmrg	# The Operating System including object format, if it has switched
230b41a30aaSmrg	# to ELF recently (or will in the future) and ABI.
231b41a30aaSmrg	case $UNAME_MACHINE_ARCH in
232b41a30aaSmrg	    earm*)
233b41a30aaSmrg		os=netbsdelf
234b41a30aaSmrg		;;
235a253d6aeSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
236b41a30aaSmrg		set_cc_for_build
237a253d6aeSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
23825b89263Smrg			| grep -q __ELF__
239a253d6aeSmrg		then
240a253d6aeSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
241a253d6aeSmrg		    # Return netbsd for either.  FIX?
242a253d6aeSmrg		    os=netbsd
243a253d6aeSmrg		else
244a253d6aeSmrg		    os=netbsdelf
245a253d6aeSmrg		fi
246a253d6aeSmrg		;;
247a253d6aeSmrg	    *)
24857ee1794Smrg		os=netbsd
249a253d6aeSmrg		;;
250a253d6aeSmrg	esac
251b41a30aaSmrg	# Determine ABI tags.
252b41a30aaSmrg	case $UNAME_MACHINE_ARCH in
253b41a30aaSmrg	    earm*)
254b41a30aaSmrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
255b41a30aaSmrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
256b41a30aaSmrg		;;
257b41a30aaSmrg	esac
258a253d6aeSmrg	# The OS release
259a253d6aeSmrg	# Debian GNU/NetBSD machines have a different userland, and
260a253d6aeSmrg	# thus, need a distinct triplet. However, they do not need
261a253d6aeSmrg	# kernel version information, so it can be replaced with a
262a253d6aeSmrg	# suitable tag, in the style of linux-gnu.
263b41a30aaSmrg	case $UNAME_VERSION in
264a253d6aeSmrg	    Debian*)
265a253d6aeSmrg		release='-gnu'
266a253d6aeSmrg		;;
267a253d6aeSmrg	    *)
268b41a30aaSmrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
269a253d6aeSmrg		;;
270a253d6aeSmrg	esac
271a253d6aeSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
272a253d6aeSmrg	# contains redundant information, the shorter form:
273a253d6aeSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
274b41a30aaSmrg	GUESS=$machine-${os}${release}${abi-}
275b41a30aaSmrg	;;
27657ee1794Smrg    *:Bitrig:*:*)
27757ee1794Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
278b41a30aaSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
279b41a30aaSmrg	;;
280a253d6aeSmrg    *:OpenBSD:*:*)
281a253d6aeSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
282b41a30aaSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
283b41a30aaSmrg	;;
284b41a30aaSmrg    *:SecBSD:*:*)
285b41a30aaSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
286b41a30aaSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
287b41a30aaSmrg	;;
288b41a30aaSmrg    *:LibertyBSD:*:*)
289b41a30aaSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
290b41a30aaSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
291b41a30aaSmrg	;;
292b41a30aaSmrg    *:MidnightBSD:*:*)
293b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
294b41a30aaSmrg	;;
295a253d6aeSmrg    *:ekkoBSD:*:*)
296b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
297b41a30aaSmrg	;;
298ea133fd7Smrg    *:SolidBSD:*:*)
299b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
300b41a30aaSmrg	;;
301b41a30aaSmrg    *:OS108:*:*)
302b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
303b41a30aaSmrg	;;
304a253d6aeSmrg    macppc:MirBSD:*:*)
305b41a30aaSmrg	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
306b41a30aaSmrg	;;
307a253d6aeSmrg    *:MirBSD:*:*)
308b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
309b41a30aaSmrg	;;
310b41a30aaSmrg    *:Sortix:*:*)
311b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-sortix
312b41a30aaSmrg	;;
313b41a30aaSmrg    *:Twizzler:*:*)
314b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-twizzler
315b41a30aaSmrg	;;
316b41a30aaSmrg    *:Redox:*:*)
317b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-redox
318b41a30aaSmrg	;;
319b41a30aaSmrg    mips:OSF1:*.*)
320b41a30aaSmrg	GUESS=mips-dec-osf1
321b41a30aaSmrg	;;
322a253d6aeSmrg    alpha:OSF1:*:*)
323b41a30aaSmrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
324b41a30aaSmrg	trap '' 0
325a253d6aeSmrg	case $UNAME_RELEASE in
326a253d6aeSmrg	*4.0)
327a253d6aeSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
328a253d6aeSmrg		;;
329a253d6aeSmrg	*5.*)
33057ee1794Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
331a253d6aeSmrg		;;
332a253d6aeSmrg	esac
333a253d6aeSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
334a253d6aeSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
335a253d6aeSmrg	# covers most systems running today.  This code pipes the CPU
336a253d6aeSmrg	# types through head -n 1, so we only detect the type of CPU 0.
337a253d6aeSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
338b41a30aaSmrg	case $ALPHA_CPU_TYPE in
339a253d6aeSmrg	    "EV4 (21064)")
340b41a30aaSmrg		UNAME_MACHINE=alpha ;;
341a253d6aeSmrg	    "EV4.5 (21064)")
342b41a30aaSmrg		UNAME_MACHINE=alpha ;;
343a253d6aeSmrg	    "LCA4 (21066/21068)")
344b41a30aaSmrg		UNAME_MACHINE=alpha ;;
345a253d6aeSmrg	    "EV5 (21164)")
346b41a30aaSmrg		UNAME_MACHINE=alphaev5 ;;
347a253d6aeSmrg	    "EV5.6 (21164A)")
348b41a30aaSmrg		UNAME_MACHINE=alphaev56 ;;
349a253d6aeSmrg	    "EV5.6 (21164PC)")
350b41a30aaSmrg		UNAME_MACHINE=alphapca56 ;;
351a253d6aeSmrg	    "EV5.7 (21164PC)")
352b41a30aaSmrg		UNAME_MACHINE=alphapca57 ;;
353a253d6aeSmrg	    "EV6 (21264)")
354b41a30aaSmrg		UNAME_MACHINE=alphaev6 ;;
355a253d6aeSmrg	    "EV6.7 (21264A)")
356b41a30aaSmrg		UNAME_MACHINE=alphaev67 ;;
357a253d6aeSmrg	    "EV6.8CB (21264C)")
358b41a30aaSmrg		UNAME_MACHINE=alphaev68 ;;
359a253d6aeSmrg	    "EV6.8AL (21264B)")
360b41a30aaSmrg		UNAME_MACHINE=alphaev68 ;;
361a253d6aeSmrg	    "EV6.8CX (21264D)")
362b41a30aaSmrg		UNAME_MACHINE=alphaev68 ;;
363a253d6aeSmrg	    "EV6.9A (21264/EV69A)")
364b41a30aaSmrg		UNAME_MACHINE=alphaev69 ;;
365a253d6aeSmrg	    "EV7 (21364)")
366b41a30aaSmrg		UNAME_MACHINE=alphaev7 ;;
367a253d6aeSmrg	    "EV7.9 (21364A)")
368b41a30aaSmrg		UNAME_MACHINE=alphaev79 ;;
369a253d6aeSmrg	esac
370a253d6aeSmrg	# A Pn.n version is a patched version.
371a253d6aeSmrg	# A Vn.n version is a released version.
372a253d6aeSmrg	# A Tn.n version is a released field test version.
373a253d6aeSmrg	# A Xn.n version is an unreleased experimental baselevel.
374a253d6aeSmrg	# 1.2 uses "1.2" for uname -r.
375b41a30aaSmrg	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
376b41a30aaSmrg	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
377b41a30aaSmrg	;;
378a253d6aeSmrg    Amiga*:UNIX_System_V:4.0:*)
379b41a30aaSmrg	GUESS=m68k-unknown-sysv4
380b41a30aaSmrg	;;
381a253d6aeSmrg    *:[Aa]miga[Oo][Ss]:*:*)
382b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-amigaos
383b41a30aaSmrg	;;
384a253d6aeSmrg    *:[Mm]orph[Oo][Ss]:*:*)
385b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-morphos
386b41a30aaSmrg	;;
387a253d6aeSmrg    *:OS/390:*:*)
388b41a30aaSmrg	GUESS=i370-ibm-openedition
389b41a30aaSmrg	;;
390a253d6aeSmrg    *:z/VM:*:*)
391b41a30aaSmrg	GUESS=s390-ibm-zvmoe
392b41a30aaSmrg	;;
393a253d6aeSmrg    *:OS400:*:*)
394b41a30aaSmrg	GUESS=powerpc-ibm-os400
395b41a30aaSmrg	;;
396a253d6aeSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
397b41a30aaSmrg	GUESS=arm-acorn-riscix$UNAME_RELEASE
398b41a30aaSmrg	;;
39957ee1794Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
400b41a30aaSmrg	GUESS=arm-unknown-riscos
401b41a30aaSmrg	;;
402a253d6aeSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
403b41a30aaSmrg	GUESS=hppa1.1-hitachi-hiuxmpp
404b41a30aaSmrg	;;
405a253d6aeSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
406a253d6aeSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
407b41a30aaSmrg	case `(/bin/universe) 2>/dev/null` in
408b41a30aaSmrg	    att) GUESS=pyramid-pyramid-sysv3 ;;
409b41a30aaSmrg	    *)   GUESS=pyramid-pyramid-bsd   ;;
410b41a30aaSmrg	esac
411b41a30aaSmrg	;;
412a253d6aeSmrg    NILE*:*:*:dcosx)
413b41a30aaSmrg	GUESS=pyramid-pyramid-svr4
414b41a30aaSmrg	;;
415a253d6aeSmrg    DRS?6000:unix:4.0:6*)
416b41a30aaSmrg	GUESS=sparc-icl-nx6
417b41a30aaSmrg	;;
418a253d6aeSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
419a253d6aeSmrg	case `/usr/bin/uname -p` in
420b41a30aaSmrg	    sparc) GUESS=sparc-icl-nx7 ;;
421b41a30aaSmrg	esac
422b41a30aaSmrg	;;
42325b89263Smrg    s390x:SunOS:*:*)
424b41a30aaSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
425b41a30aaSmrg	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
426b41a30aaSmrg	;;
427a253d6aeSmrg    sun4H:SunOS:5.*:*)
428b41a30aaSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
429b41a30aaSmrg	GUESS=sparc-hal-solaris2$SUN_REL
430b41a30aaSmrg	;;
431a253d6aeSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
432b41a30aaSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
433b41a30aaSmrg	GUESS=sparc-sun-solaris2$SUN_REL
434b41a30aaSmrg	;;
43525b89263Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
436b41a30aaSmrg	GUESS=i386-pc-auroraux$UNAME_RELEASE
437b41a30aaSmrg	;;
438ea133fd7Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
439b41a30aaSmrg	set_cc_for_build
440b41a30aaSmrg	SUN_ARCH=i386
44125b89263Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
44225b89263Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
44325b89263Smrg	# This test works for both compilers.
444b41a30aaSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
44525b89263Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
44610f94802Smrg		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
44725b89263Smrg		grep IS_64BIT_ARCH >/dev/null
44825b89263Smrg	    then
449b41a30aaSmrg		SUN_ARCH=x86_64
45025b89263Smrg	    fi
45125b89263Smrg	fi
452b41a30aaSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
453b41a30aaSmrg	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
454b41a30aaSmrg	;;
455a253d6aeSmrg    sun4*:SunOS:6*:*)
456a253d6aeSmrg	# According to config.sub, this is the proper way to canonicalize
457a253d6aeSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
458a253d6aeSmrg	# it's likely to be more like Solaris than SunOS4.
459b41a30aaSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
460b41a30aaSmrg	GUESS=sparc-sun-solaris3$SUN_REL
461b41a30aaSmrg	;;
462a253d6aeSmrg    sun4*:SunOS:*:*)
463b41a30aaSmrg	case `/usr/bin/arch -k` in
464a253d6aeSmrg	    Series*|S4*)
465a253d6aeSmrg		UNAME_RELEASE=`uname -v`
466a253d6aeSmrg		;;
467a253d6aeSmrg	esac
46810f94802Smrg	# Japanese Language versions have a version number like '4.1.3-JL'.
469b41a30aaSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
470b41a30aaSmrg	GUESS=sparc-sun-sunos$SUN_REL
471b41a30aaSmrg	;;
472a253d6aeSmrg    sun3*:SunOS:*:*)
473b41a30aaSmrg	GUESS=m68k-sun-sunos$UNAME_RELEASE
474b41a30aaSmrg	;;
475a253d6aeSmrg    sun*:*:4.2BSD:*)
476a253d6aeSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
477b41a30aaSmrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
478b41a30aaSmrg	case `/bin/arch` in
479a253d6aeSmrg	    sun3)
480b41a30aaSmrg		GUESS=m68k-sun-sunos$UNAME_RELEASE
481a253d6aeSmrg		;;
482a253d6aeSmrg	    sun4)
483b41a30aaSmrg		GUESS=sparc-sun-sunos$UNAME_RELEASE
484a253d6aeSmrg		;;
485a253d6aeSmrg	esac
486b41a30aaSmrg	;;
487a253d6aeSmrg    aushp:SunOS:*:*)
488b41a30aaSmrg	GUESS=sparc-auspex-sunos$UNAME_RELEASE
489b41a30aaSmrg	;;
490a253d6aeSmrg    # The situation for MiNT is a little confusing.  The machine name
491a253d6aeSmrg    # can be virtually everything (everything which is not
492a253d6aeSmrg    # "atarist" or "atariste" at least should have a processor
493a253d6aeSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
494a253d6aeSmrg    # to the lowercase version "mint" (or "freemint").  Finally
495a253d6aeSmrg    # the system name "TOS" denotes a system which is actually not
496a253d6aeSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
497a253d6aeSmrg    # be no problem.
498a253d6aeSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
499b41a30aaSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
500b41a30aaSmrg	;;
501a253d6aeSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
502b41a30aaSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
503b41a30aaSmrg	;;
504a253d6aeSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
505b41a30aaSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
506b41a30aaSmrg	;;
507a253d6aeSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
508b41a30aaSmrg	GUESS=m68k-milan-mint$UNAME_RELEASE
509b41a30aaSmrg	;;
510a253d6aeSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
511b41a30aaSmrg	GUESS=m68k-hades-mint$UNAME_RELEASE
512b41a30aaSmrg	;;
513a253d6aeSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
514b41a30aaSmrg	GUESS=m68k-unknown-mint$UNAME_RELEASE
515b41a30aaSmrg	;;
516a253d6aeSmrg    m68k:machten:*:*)
517b41a30aaSmrg	GUESS=m68k-apple-machten$UNAME_RELEASE
518b41a30aaSmrg	;;
519a253d6aeSmrg    powerpc:machten:*:*)
520b41a30aaSmrg	GUESS=powerpc-apple-machten$UNAME_RELEASE
521b41a30aaSmrg	;;
522a253d6aeSmrg    RISC*:Mach:*:*)
523b41a30aaSmrg	GUESS=mips-dec-mach_bsd4.3
524b41a30aaSmrg	;;
525a253d6aeSmrg    RISC*:ULTRIX:*:*)
526b41a30aaSmrg	GUESS=mips-dec-ultrix$UNAME_RELEASE
527b41a30aaSmrg	;;
528a253d6aeSmrg    VAX*:ULTRIX*:*:*)
529b41a30aaSmrg	GUESS=vax-dec-ultrix$UNAME_RELEASE
530b41a30aaSmrg	;;
531a253d6aeSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
532b41a30aaSmrg	GUESS=clipper-intergraph-clix$UNAME_RELEASE
533b41a30aaSmrg	;;
534a253d6aeSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
535b41a30aaSmrg	set_cc_for_build
536b41a30aaSmrg	sed 's/^	//' << EOF > "$dummy.c"
537a253d6aeSmrg#ifdef __cplusplus
538a253d6aeSmrg#include <stdio.h>  /* for printf() prototype */
539a253d6aeSmrg	int main (int argc, char *argv[]) {
540a253d6aeSmrg#else
541a253d6aeSmrg	int main (argc, argv) int argc; char *argv[]; {
542a253d6aeSmrg#endif
543a253d6aeSmrg	#if defined (host_mips) && defined (MIPSEB)
544a253d6aeSmrg	#if defined (SYSTYPE_SYSV)
545b41a30aaSmrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
546a253d6aeSmrg	#endif
547a253d6aeSmrg	#if defined (SYSTYPE_SVR4)
548b41a30aaSmrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
549a253d6aeSmrg	#endif
550a253d6aeSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
551b41a30aaSmrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
552a253d6aeSmrg	#endif
553a253d6aeSmrg	#endif
554a253d6aeSmrg	  exit (-1);
555a253d6aeSmrg	}
556a253d6aeSmrgEOF
557b41a30aaSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
558b41a30aaSmrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
559b41a30aaSmrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
560a253d6aeSmrg	    { echo "$SYSTEM_NAME"; exit; }
561b41a30aaSmrg	GUESS=mips-mips-riscos$UNAME_RELEASE
562b41a30aaSmrg	;;
563a253d6aeSmrg    Motorola:PowerMAX_OS:*:*)
564b41a30aaSmrg	GUESS=powerpc-motorola-powermax
565b41a30aaSmrg	;;
566a253d6aeSmrg    Motorola:*:4.3:PL8-*)
567b41a30aaSmrg	GUESS=powerpc-harris-powermax
568b41a30aaSmrg	;;
569a253d6aeSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
570b41a30aaSmrg	GUESS=powerpc-harris-powermax
571b41a30aaSmrg	;;
572a253d6aeSmrg    Night_Hawk:Power_UNIX:*:*)
573b41a30aaSmrg	GUESS=powerpc-harris-powerunix
574b41a30aaSmrg	;;
575a253d6aeSmrg    m88k:CX/UX:7*:*)
576b41a30aaSmrg	GUESS=m88k-harris-cxux7
577b41a30aaSmrg	;;
578a253d6aeSmrg    m88k:*:4*:R4*)
579b41a30aaSmrg	GUESS=m88k-motorola-sysv4
580b41a30aaSmrg	;;
581a253d6aeSmrg    m88k:*:3*:R3*)
582b41a30aaSmrg	GUESS=m88k-motorola-sysv3
583b41a30aaSmrg	;;
584a253d6aeSmrg    AViiON:dgux:*:*)
58557ee1794Smrg	# DG/UX returns AViiON for all architectures
58657ee1794Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
587b41a30aaSmrg	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
588a253d6aeSmrg	then
589b41a30aaSmrg	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
590b41a30aaSmrg	       test "$TARGET_BINARY_INTERFACE"x = x
591a253d6aeSmrg	    then
592b41a30aaSmrg		GUESS=m88k-dg-dgux$UNAME_RELEASE
593a253d6aeSmrg	    else
594b41a30aaSmrg		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
595a253d6aeSmrg	    fi
596a253d6aeSmrg	else
597b41a30aaSmrg	    GUESS=i586-dg-dgux$UNAME_RELEASE
598a253d6aeSmrg	fi
599b41a30aaSmrg	;;
600a253d6aeSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
601b41a30aaSmrg	GUESS=m88k-dolphin-sysv3
602b41a30aaSmrg	;;
603a253d6aeSmrg    M88*:*:R3*:*)
604a253d6aeSmrg	# Delta 88k system running SVR3
605b41a30aaSmrg	GUESS=m88k-motorola-sysv3
606b41a30aaSmrg	;;
607a253d6aeSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
608b41a30aaSmrg	GUESS=m88k-tektronix-sysv3
609b41a30aaSmrg	;;
610a253d6aeSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
611b41a30aaSmrg	GUESS=m68k-tektronix-bsd
612b41a30aaSmrg	;;
613a253d6aeSmrg    *:IRIX*:*:*)
614b41a30aaSmrg	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
615b41a30aaSmrg	GUESS=mips-sgi-irix$IRIX_REL
616b41a30aaSmrg	;;
617a253d6aeSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
618b41a30aaSmrg	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
619b41a30aaSmrg	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
620a253d6aeSmrg    i*86:AIX:*:*)
621b41a30aaSmrg	GUESS=i386-ibm-aix
622b41a30aaSmrg	;;
623a253d6aeSmrg    ia64:AIX:*:*)
624b41a30aaSmrg	if test -x /usr/bin/oslevel ; then
625a253d6aeSmrg		IBM_REV=`/usr/bin/oslevel`
626a253d6aeSmrg	else
627b41a30aaSmrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
628a253d6aeSmrg	fi
629b41a30aaSmrg	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
630b41a30aaSmrg	;;
631a253d6aeSmrg    *:AIX:2:3)
632a253d6aeSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
633b41a30aaSmrg		set_cc_for_build
634b41a30aaSmrg		sed 's/^		//' << EOF > "$dummy.c"
635a253d6aeSmrg		#include <sys/systemcfg.h>
636a253d6aeSmrg
637a253d6aeSmrg		main()
638a253d6aeSmrg			{
639a253d6aeSmrg			if (!__power_pc())
640a253d6aeSmrg				exit(1);
641a253d6aeSmrg			puts("powerpc-ibm-aix3.2.5");
642a253d6aeSmrg			exit(0);
643a253d6aeSmrg			}
644a253d6aeSmrgEOF
645b41a30aaSmrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
646a253d6aeSmrg		then
647b41a30aaSmrg			GUESS=$SYSTEM_NAME
648a253d6aeSmrg		else
649b41a30aaSmrg			GUESS=rs6000-ibm-aix3.2.5
650a253d6aeSmrg		fi
651a253d6aeSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
652b41a30aaSmrg		GUESS=rs6000-ibm-aix3.2.4
653a253d6aeSmrg	else
654b41a30aaSmrg		GUESS=rs6000-ibm-aix3.2
655a253d6aeSmrg	fi
656b41a30aaSmrg	;;
65725b89263Smrg    *:AIX:*:[4567])
658a253d6aeSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
659b41a30aaSmrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
660a253d6aeSmrg		IBM_ARCH=rs6000
661a253d6aeSmrg	else
662a253d6aeSmrg		IBM_ARCH=powerpc
663a253d6aeSmrg	fi
664b41a30aaSmrg	if test -x /usr/bin/lslpp ; then
665b41a30aaSmrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
666b41a30aaSmrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
667a253d6aeSmrg	else
668b41a30aaSmrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
669a253d6aeSmrg	fi
670b41a30aaSmrg	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
671b41a30aaSmrg	;;
672a253d6aeSmrg    *:AIX:*:*)
673b41a30aaSmrg	GUESS=rs6000-ibm-aix
674b41a30aaSmrg	;;
675b41a30aaSmrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
676b41a30aaSmrg	GUESS=romp-ibm-bsd4.4
677b41a30aaSmrg	;;
678a253d6aeSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
679b41a30aaSmrg	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
680b41a30aaSmrg	;;                                  # report: romp-ibm BSD 4.3
681a253d6aeSmrg    *:BOSX:*:*)
682b41a30aaSmrg	GUESS=rs6000-bull-bosx
683b41a30aaSmrg	;;
684a253d6aeSmrg    DPX/2?00:B.O.S.:*:*)
685b41a30aaSmrg	GUESS=m68k-bull-sysv3
686b41a30aaSmrg	;;
687a253d6aeSmrg    9000/[34]??:4.3bsd:1.*:*)
688b41a30aaSmrg	GUESS=m68k-hp-bsd
689b41a30aaSmrg	;;
690a253d6aeSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
691b41a30aaSmrg	GUESS=m68k-hp-bsd4.4
692b41a30aaSmrg	;;
693a253d6aeSmrg    9000/[34678]??:HP-UX:*:*)
694b41a30aaSmrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
695b41a30aaSmrg	case $UNAME_MACHINE in
696b41a30aaSmrg	    9000/31?)            HP_ARCH=m68000 ;;
697b41a30aaSmrg	    9000/[34]??)         HP_ARCH=m68k ;;
698a253d6aeSmrg	    9000/[678][0-9][0-9])
699b41a30aaSmrg		if test -x /usr/bin/getconf; then
700a253d6aeSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
70157ee1794Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
702b41a30aaSmrg		    case $sc_cpu_version in
703b41a30aaSmrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
704b41a30aaSmrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
70557ee1794Smrg		      532)                      # CPU_PA_RISC2_0
706b41a30aaSmrg			case $sc_kernel_bits in
707b41a30aaSmrg			  32) HP_ARCH=hppa2.0n ;;
708b41a30aaSmrg			  64) HP_ARCH=hppa2.0w ;;
709b41a30aaSmrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
71057ee1794Smrg			esac ;;
71157ee1794Smrg		    esac
712a253d6aeSmrg		fi
713b41a30aaSmrg		if test "$HP_ARCH" = ""; then
714b41a30aaSmrg		    set_cc_for_build
715b41a30aaSmrg		    sed 's/^		//' << EOF > "$dummy.c"
716a253d6aeSmrg
71757ee1794Smrg		#define _HPUX_SOURCE
71857ee1794Smrg		#include <stdlib.h>
71957ee1794Smrg		#include <unistd.h>
720a253d6aeSmrg
72157ee1794Smrg		int main ()
72257ee1794Smrg		{
72357ee1794Smrg		#if defined(_SC_KERNEL_BITS)
72457ee1794Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
72557ee1794Smrg		#endif
72657ee1794Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
727a253d6aeSmrg
72857ee1794Smrg		    switch (cpu)
72957ee1794Smrg			{
73057ee1794Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
73157ee1794Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
73257ee1794Smrg			case CPU_PA_RISC2_0:
73357ee1794Smrg		#if defined(_SC_KERNEL_BITS)
73457ee1794Smrg			    switch (bits)
73557ee1794Smrg				{
73657ee1794Smrg				case 64: puts ("hppa2.0w"); break;
73757ee1794Smrg				case 32: puts ("hppa2.0n"); break;
73857ee1794Smrg				default: puts ("hppa2.0"); break;
73957ee1794Smrg				} break;
74057ee1794Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
74157ee1794Smrg			    puts ("hppa2.0"); break;
74257ee1794Smrg		#endif
74357ee1794Smrg			default: puts ("hppa1.0"); break;
74457ee1794Smrg			}
74557ee1794Smrg		    exit (0);
74657ee1794Smrg		}
747a253d6aeSmrgEOF
748b41a30aaSmrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
749a253d6aeSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
750a253d6aeSmrg		fi ;;
751a253d6aeSmrg	esac
752b41a30aaSmrg	if test "$HP_ARCH" = hppa2.0w
753a253d6aeSmrg	then
754b41a30aaSmrg	    set_cc_for_build
755a253d6aeSmrg
756a253d6aeSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
757a253d6aeSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
758a253d6aeSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
759a253d6aeSmrg	    #
760a253d6aeSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
761a253d6aeSmrg	    # => hppa2.0w-hp-hpux11.23
762a253d6aeSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
763a253d6aeSmrg	    # => hppa64-hp-hpux11.23
764a253d6aeSmrg
765b41a30aaSmrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
76625b89263Smrg		grep -q __LP64__
767a253d6aeSmrg	    then
768b41a30aaSmrg		HP_ARCH=hppa2.0w
769a253d6aeSmrg	    else
770b41a30aaSmrg		HP_ARCH=hppa64
771a253d6aeSmrg	    fi
772a253d6aeSmrg	fi
773b41a30aaSmrg	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
774b41a30aaSmrg	;;
775a253d6aeSmrg    ia64:HP-UX:*:*)
776b41a30aaSmrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
777b41a30aaSmrg	GUESS=ia64-hp-hpux$HPUX_REV
778b41a30aaSmrg	;;
779a253d6aeSmrg    3050*:HI-UX:*:*)
780b41a30aaSmrg	set_cc_for_build
781b41a30aaSmrg	sed 's/^	//' << EOF > "$dummy.c"
782a253d6aeSmrg	#include <unistd.h>
783a253d6aeSmrg	int
784a253d6aeSmrg	main ()
785a253d6aeSmrg	{
786a253d6aeSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
787a253d6aeSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
788a253d6aeSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
789a253d6aeSmrg	     results, however.  */
790a253d6aeSmrg	  if (CPU_IS_PA_RISC (cpu))
791a253d6aeSmrg	    {
792a253d6aeSmrg	      switch (cpu)
793a253d6aeSmrg		{
794a253d6aeSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
795a253d6aeSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
796a253d6aeSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
797a253d6aeSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
798a253d6aeSmrg		}
799a253d6aeSmrg	    }
800a253d6aeSmrg	  else if (CPU_IS_HP_MC68K (cpu))
801a253d6aeSmrg	    puts ("m68k-hitachi-hiuxwe2");
802a253d6aeSmrg	  else puts ("unknown-hitachi-hiuxwe2");
803a253d6aeSmrg	  exit (0);
804a253d6aeSmrg	}
805a253d6aeSmrgEOF
806b41a30aaSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
807a253d6aeSmrg		{ echo "$SYSTEM_NAME"; exit; }
808b41a30aaSmrg	GUESS=unknown-hitachi-hiuxwe2
809b41a30aaSmrg	;;
810b41a30aaSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
811b41a30aaSmrg	GUESS=hppa1.1-hp-bsd
812b41a30aaSmrg	;;
813a253d6aeSmrg    9000/8??:4.3bsd:*:*)
814b41a30aaSmrg	GUESS=hppa1.0-hp-bsd
815b41a30aaSmrg	;;
816a253d6aeSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
817b41a30aaSmrg	GUESS=hppa1.0-hp-mpeix
818b41a30aaSmrg	;;
819b41a30aaSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
820b41a30aaSmrg	GUESS=hppa1.1-hp-osf
821b41a30aaSmrg	;;
822a253d6aeSmrg    hp8??:OSF1:*:*)
823b41a30aaSmrg	GUESS=hppa1.0-hp-osf
824b41a30aaSmrg	;;
825a253d6aeSmrg    i*86:OSF1:*:*)
826b41a30aaSmrg	if test -x /usr/sbin/sysversion ; then
827b41a30aaSmrg	    GUESS=$UNAME_MACHINE-unknown-osf1mk
828a253d6aeSmrg	else
829b41a30aaSmrg	    GUESS=$UNAME_MACHINE-unknown-osf1
830a253d6aeSmrg	fi
831b41a30aaSmrg	;;
832a253d6aeSmrg    parisc*:Lites*:*:*)
833b41a30aaSmrg	GUESS=hppa1.1-hp-lites
834b41a30aaSmrg	;;
835a253d6aeSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
836b41a30aaSmrg	GUESS=c1-convex-bsd
837b41a30aaSmrg	;;
838a253d6aeSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
839a253d6aeSmrg	if getsysinfo -f scalar_acc
840a253d6aeSmrg	then echo c32-convex-bsd
841a253d6aeSmrg	else echo c2-convex-bsd
842a253d6aeSmrg	fi
84357ee1794Smrg	exit ;;
844a253d6aeSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
845b41a30aaSmrg	GUESS=c34-convex-bsd
846b41a30aaSmrg	;;
847a253d6aeSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
848b41a30aaSmrg	GUESS=c38-convex-bsd
849b41a30aaSmrg	;;
850a253d6aeSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
851b41a30aaSmrg	GUESS=c4-convex-bsd
852b41a30aaSmrg	;;
853a253d6aeSmrg    CRAY*Y-MP:*:*:*)
854b41a30aaSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
855b41a30aaSmrg	GUESS=ymp-cray-unicos$CRAY_REL
856b41a30aaSmrg	;;
857a253d6aeSmrg    CRAY*[A-Z]90:*:*:*)
858b41a30aaSmrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
859a253d6aeSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
860a253d6aeSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
861a253d6aeSmrg	      -e 's/\.[^.]*$/.X/'
862a253d6aeSmrg	exit ;;
863a253d6aeSmrg    CRAY*TS:*:*:*)
864b41a30aaSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
865b41a30aaSmrg	GUESS=t90-cray-unicos$CRAY_REL
866b41a30aaSmrg	;;
867a253d6aeSmrg    CRAY*T3E:*:*:*)
868b41a30aaSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
869b41a30aaSmrg	GUESS=alphaev5-cray-unicosmk$CRAY_REL
870b41a30aaSmrg	;;
871a253d6aeSmrg    CRAY*SV1:*:*:*)
872b41a30aaSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
873b41a30aaSmrg	GUESS=sv1-cray-unicos$CRAY_REL
874b41a30aaSmrg	;;
875a253d6aeSmrg    *:UNICOS/mp:*:*)
876b41a30aaSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
877b41a30aaSmrg	GUESS=craynv-cray-unicosmp$CRAY_REL
878b41a30aaSmrg	;;
879a253d6aeSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
880b41a30aaSmrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
881b41a30aaSmrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
882b41a30aaSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
883b41a30aaSmrg	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
884b41a30aaSmrg	;;
885a253d6aeSmrg    5000:UNIX_System_V:4.*:*)
886b41a30aaSmrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
887b41a30aaSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
888b41a30aaSmrg	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
889b41a30aaSmrg	;;
890a253d6aeSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
891b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
892b41a30aaSmrg	;;
893a253d6aeSmrg    sparc*:BSD/OS:*:*)
894b41a30aaSmrg	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
895b41a30aaSmrg	;;
896a253d6aeSmrg    *:BSD/OS:*:*)
897b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
898b41a30aaSmrg	;;
899b41a30aaSmrg    arm:FreeBSD:*:*)
900b41a30aaSmrg	UNAME_PROCESSOR=`uname -p`
901b41a30aaSmrg	set_cc_for_build
902b41a30aaSmrg	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
903b41a30aaSmrg	    | grep -q __ARM_PCS_VFP
904b41a30aaSmrg	then
905b41a30aaSmrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
906b41a30aaSmrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
907b41a30aaSmrg	else
908b41a30aaSmrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
909b41a30aaSmrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
910b41a30aaSmrg	fi
911b41a30aaSmrg	;;
912a253d6aeSmrg    *:FreeBSD:*:*)
91310f94802Smrg	UNAME_PROCESSOR=`uname -p`
914b41a30aaSmrg	case $UNAME_PROCESSOR in
915ea133fd7Smrg	    amd64)
916b41a30aaSmrg		UNAME_PROCESSOR=x86_64 ;;
917b41a30aaSmrg	    i386)
918b41a30aaSmrg		UNAME_PROCESSOR=i586 ;;
919ea133fd7Smrg	esac
920b41a30aaSmrg	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
921b41a30aaSmrg	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
922b41a30aaSmrg	;;
923a253d6aeSmrg    i*:CYGWIN*:*)
924b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-cygwin
925b41a30aaSmrg	;;
92657ee1794Smrg    *:MINGW64*:*)
927b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-mingw64
928b41a30aaSmrg	;;
929ea133fd7Smrg    *:MINGW*:*)
930b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-mingw32
931b41a30aaSmrg	;;
932b41a30aaSmrg    *:MSYS*:*)
933b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-msys
934b41a30aaSmrg	;;
935a253d6aeSmrg    i*:PW*:*)
936b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-pw32
937b41a30aaSmrg	;;
93810f94802Smrg    *:SerenityOS:*:*)
93910f94802Smrg        GUESS=$UNAME_MACHINE-pc-serenity
94010f94802Smrg        ;;
94125b89263Smrg    *:Interix*:*)
942b41a30aaSmrg	case $UNAME_MACHINE in
943ea133fd7Smrg	    x86)
944b41a30aaSmrg		GUESS=i586-pc-interix$UNAME_RELEASE
945b41a30aaSmrg		;;
94625b89263Smrg	    authenticamd | genuineintel | EM64T)
947b41a30aaSmrg		GUESS=x86_64-unknown-interix$UNAME_RELEASE
948b41a30aaSmrg		;;
949ea133fd7Smrg	    IA64)
950b41a30aaSmrg		GUESS=ia64-unknown-interix$UNAME_RELEASE
951b41a30aaSmrg		;;
952ea133fd7Smrg	esac ;;
953a253d6aeSmrg    i*:UWIN*:*)
954b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-uwin
955b41a30aaSmrg	;;
956a253d6aeSmrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
957b41a30aaSmrg	GUESS=x86_64-pc-cygwin
958b41a30aaSmrg	;;
959a253d6aeSmrg    prep*:SunOS:5.*:*)
960b41a30aaSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
961b41a30aaSmrg	GUESS=powerpcle-unknown-solaris2$SUN_REL
962b41a30aaSmrg	;;
963a253d6aeSmrg    *:GNU:*:*)
964a253d6aeSmrg	# the GNU system
965b41a30aaSmrg	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
966b41a30aaSmrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
967b41a30aaSmrg	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
968b41a30aaSmrg	;;
969a253d6aeSmrg    *:GNU/*:*:*)
970a253d6aeSmrg	# other systems with GNU libc and userland
971b41a30aaSmrg	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
972b41a30aaSmrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
973b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
974b41a30aaSmrg	;;
97510f94802Smrg    x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
97610f94802Smrg	GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
97710f94802Smrg	;;
97810f94802Smrg    *:[Mm]anagarm:*:*)
97910f94802Smrg	GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
98010f94802Smrg	;;
981b41a30aaSmrg    *:Minix:*:*)
982b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-minix
983b41a30aaSmrg	;;
98457ee1794Smrg    aarch64:Linux:*:*)
98510f94802Smrg	set_cc_for_build
98610f94802Smrg	CPU=$UNAME_MACHINE
98710f94802Smrg	LIBCABI=$LIBC
98810f94802Smrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
98910f94802Smrg	    ABI=64
99010f94802Smrg	    sed 's/^	    //' << EOF > "$dummy.c"
99110f94802Smrg	    #ifdef __ARM_EABI__
99210f94802Smrg	    #ifdef __ARM_PCS_VFP
99310f94802Smrg	    ABI=eabihf
99410f94802Smrg	    #else
99510f94802Smrg	    ABI=eabi
99610f94802Smrg	    #endif
99710f94802Smrg	    #endif
99810f94802SmrgEOF
99910f94802Smrg	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
100010f94802Smrg	    eval "$cc_set_abi"
100110f94802Smrg	    case $ABI in
100210f94802Smrg		eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
100310f94802Smrg	    esac
100410f94802Smrg	fi
100510f94802Smrg	GUESS=$CPU-unknown-linux-$LIBCABI
1006b41a30aaSmrg	;;
100757ee1794Smrg    aarch64_be:Linux:*:*)
100857ee1794Smrg	UNAME_MACHINE=aarch64_be
1009b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1010b41a30aaSmrg	;;
101125b89263Smrg    alpha:Linux:*:*)
1012b41a30aaSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
101325b89263Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
101425b89263Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
101525b89263Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
101625b89263Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
101725b89263Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
101825b89263Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
101925b89263Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
102057ee1794Smrg	esac
102125b89263Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
1022b41a30aaSmrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
1023b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1024b41a30aaSmrg	;;
1025b41a30aaSmrg    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
1026b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1027b41a30aaSmrg	;;
1028a253d6aeSmrg    arm*:Linux:*:*)
1029b41a30aaSmrg	set_cc_for_build
1030ea133fd7Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
1031ea133fd7Smrg	    | grep -q __ARM_EABI__
1032ea133fd7Smrg	then
1033b41a30aaSmrg	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1034ea133fd7Smrg	else
103557ee1794Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
103657ee1794Smrg		| grep -q __ARM_PCS_VFP
103757ee1794Smrg	    then
1038b41a30aaSmrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
103957ee1794Smrg	    else
1040b41a30aaSmrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
104157ee1794Smrg	    fi
1042ea133fd7Smrg	fi
1043b41a30aaSmrg	;;
1044ea133fd7Smrg    avr32*:Linux:*:*)
1045b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1046b41a30aaSmrg	;;
1047a253d6aeSmrg    cris:Linux:*:*)
1048b41a30aaSmrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1049b41a30aaSmrg	;;
1050a253d6aeSmrg    crisv32:Linux:*:*)
1051b41a30aaSmrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1052b41a30aaSmrg	;;
1053b41a30aaSmrg    e2k:Linux:*:*)
1054b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1055b41a30aaSmrg	;;
1056a253d6aeSmrg    frv:Linux:*:*)
1057b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1058b41a30aaSmrg	;;
105957ee1794Smrg    hexagon:Linux:*:*)
1060b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1061b41a30aaSmrg	;;
106225b89263Smrg    i*86:Linux:*:*)
1063b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
1064b41a30aaSmrg	;;
1065a253d6aeSmrg    ia64:Linux:*:*)
1066b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1067b41a30aaSmrg	;;
1068b41a30aaSmrg    k1om:Linux:*:*)
1069b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1070b41a30aaSmrg	;;
107110f94802Smrg    kvx:Linux:*:*)
107210f94802Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
107310f94802Smrg	;;
107410f94802Smrg    kvx:cos:*:*)
107510f94802Smrg	GUESS=$UNAME_MACHINE-unknown-cos
107610f94802Smrg	;;
107710f94802Smrg    kvx:mbr:*:*)
107810f94802Smrg	GUESS=$UNAME_MACHINE-unknown-mbr
107910f94802Smrg	;;
108010f94802Smrg    loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1081b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1082b41a30aaSmrg	;;
1083a253d6aeSmrg    m32r*:Linux:*:*)
1084b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1085b41a30aaSmrg	;;
1086a253d6aeSmrg    m68*:Linux:*:*)
1087b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1088b41a30aaSmrg	;;
108925b89263Smrg    mips:Linux:*:* | mips64:Linux:*:*)
1090b41a30aaSmrg	set_cc_for_build
1091b41a30aaSmrg	IS_GLIBC=0
1092b41a30aaSmrg	test x"${LIBC}" = xgnu && IS_GLIBC=1
1093b41a30aaSmrg	sed 's/^	//' << EOF > "$dummy.c"
1094a253d6aeSmrg	#undef CPU
1095b41a30aaSmrg	#undef mips
1096b41a30aaSmrg	#undef mipsel
1097b41a30aaSmrg	#undef mips64
1098b41a30aaSmrg	#undef mips64el
1099b41a30aaSmrg	#if ${IS_GLIBC} && defined(_ABI64)
1100b41a30aaSmrg	LIBCABI=gnuabi64
1101b41a30aaSmrg	#else
1102b41a30aaSmrg	#if ${IS_GLIBC} && defined(_ABIN32)
1103b41a30aaSmrg	LIBCABI=gnuabin32
1104b41a30aaSmrg	#else
1105b41a30aaSmrg	LIBCABI=${LIBC}
1106b41a30aaSmrg	#endif
1107b41a30aaSmrg	#endif
1108b41a30aaSmrg
1109b41a30aaSmrg	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1110b41a30aaSmrg	CPU=mipsisa64r6
1111b41a30aaSmrg	#else
1112b41a30aaSmrg	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1113b41a30aaSmrg	CPU=mipsisa32r6
1114b41a30aaSmrg	#else
1115b41a30aaSmrg	#if defined(__mips64)
1116b41a30aaSmrg	CPU=mips64
1117b41a30aaSmrg	#else
1118b41a30aaSmrg	CPU=mips
1119b41a30aaSmrg	#endif
1120b41a30aaSmrg	#endif
1121b41a30aaSmrg	#endif
1122b41a30aaSmrg
1123a253d6aeSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1124b41a30aaSmrg	MIPS_ENDIAN=el
1125a253d6aeSmrg	#else
1126a253d6aeSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1127b41a30aaSmrg	MIPS_ENDIAN=
1128a253d6aeSmrg	#else
1129b41a30aaSmrg	MIPS_ENDIAN=
1130a253d6aeSmrg	#endif
1131a253d6aeSmrg	#endif
1132a253d6aeSmrgEOF
1133b41a30aaSmrg	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
1134b41a30aaSmrg	eval "$cc_set_vars"
1135b41a30aaSmrg	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1136b41a30aaSmrg	;;
1137b41a30aaSmrg    mips64el:Linux:*:*)
1138b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1139b41a30aaSmrg	;;
1140b41a30aaSmrg    openrisc*:Linux:*:*)
1141b41a30aaSmrg	GUESS=or1k-unknown-linux-$LIBC
1142b41a30aaSmrg	;;
1143b41a30aaSmrg    or32:Linux:*:* | or1k*:Linux:*:*)
1144b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1145a253d6aeSmrg	;;
114625b89263Smrg    padre:Linux:*:*)
1147b41a30aaSmrg	GUESS=sparc-unknown-linux-$LIBC
1148b41a30aaSmrg	;;
114925b89263Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
1150b41a30aaSmrg	GUESS=hppa64-unknown-linux-$LIBC
1151b41a30aaSmrg	;;
1152a253d6aeSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
1153a253d6aeSmrg	# Look for CPU level
1154a253d6aeSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1155b41a30aaSmrg	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
1156b41a30aaSmrg	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
1157b41a30aaSmrg	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
1158a253d6aeSmrg	esac
1159b41a30aaSmrg	;;
116025b89263Smrg    ppc64:Linux:*:*)
1161b41a30aaSmrg	GUESS=powerpc64-unknown-linux-$LIBC
1162b41a30aaSmrg	;;
116325b89263Smrg    ppc:Linux:*:*)
1164b41a30aaSmrg	GUESS=powerpc-unknown-linux-$LIBC
1165b41a30aaSmrg	;;
116631637056Smrg    ppc64le:Linux:*:*)
1167b41a30aaSmrg	GUESS=powerpc64le-unknown-linux-$LIBC
1168b41a30aaSmrg	;;
116931637056Smrg    ppcle:Linux:*:*)
1170b41a30aaSmrg	GUESS=powerpcle-unknown-linux-$LIBC
1171b41a30aaSmrg	;;
1172b41a30aaSmrg    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1173b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1174b41a30aaSmrg	;;
1175a253d6aeSmrg    s390:Linux:*:* | s390x:Linux:*:*)
1176b41a30aaSmrg	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
1177b41a30aaSmrg	;;
1178a253d6aeSmrg    sh64*:Linux:*:*)
1179b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1180b41a30aaSmrg	;;
1181a253d6aeSmrg    sh*:Linux:*:*)
1182b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1183b41a30aaSmrg	;;
1184a253d6aeSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
1185b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1186b41a30aaSmrg	;;
118725b89263Smrg    tile*:Linux:*:*)
1188b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1189b41a30aaSmrg	;;
1190a253d6aeSmrg    vax:Linux:*:*)
1191b41a30aaSmrg	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
1192b41a30aaSmrg	;;
1193a253d6aeSmrg    x86_64:Linux:*:*)
1194b41a30aaSmrg	set_cc_for_build
119510f94802Smrg	CPU=$UNAME_MACHINE
1196b41a30aaSmrg	LIBCABI=$LIBC
1197b41a30aaSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
119810f94802Smrg	    ABI=64
119910f94802Smrg	    sed 's/^	    //' << EOF > "$dummy.c"
120010f94802Smrg	    #ifdef __i386__
120110f94802Smrg	    ABI=x86
120210f94802Smrg	    #else
120310f94802Smrg	    #ifdef __ILP32__
120410f94802Smrg	    ABI=x32
120510f94802Smrg	    #endif
120610f94802Smrg	    #endif
120710f94802SmrgEOF
120810f94802Smrg	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
120910f94802Smrg	    eval "$cc_set_abi"
121010f94802Smrg	    case $ABI in
121110f94802Smrg		x86) CPU=i686 ;;
121210f94802Smrg		x32) LIBCABI=${LIBC}x32 ;;
121310f94802Smrg	    esac
1214b41a30aaSmrg	fi
121510f94802Smrg	GUESS=$CPU-pc-linux-$LIBCABI
1216b41a30aaSmrg	;;
1217ea133fd7Smrg    xtensa*:Linux:*:*)
1218b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1219b41a30aaSmrg	;;
1220a253d6aeSmrg    i*86:DYNIX/ptx:4*:*)
1221a253d6aeSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1222a253d6aeSmrg	# earlier versions are messed up and put the nodename in both
1223a253d6aeSmrg	# sysname and nodename.
1224b41a30aaSmrg	GUESS=i386-sequent-sysv4
1225b41a30aaSmrg	;;
1226a253d6aeSmrg    i*86:UNIX_SV:4.2MP:2.*)
122757ee1794Smrg	# Unixware is an offshoot of SVR4, but it has its own version
122857ee1794Smrg	# number series starting with 2...
122957ee1794Smrg	# I am not positive that other SVR4 systems won't match this,
1230a253d6aeSmrg	# I just have to hope.  -- rms.
123157ee1794Smrg	# Use sysv4.2uw... so that sysv4* matches it.
1232b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
1233b41a30aaSmrg	;;
1234a253d6aeSmrg    i*86:OS/2:*:*)
123510f94802Smrg	# If we were able to find 'uname', then EMX Unix compatibility
1236a253d6aeSmrg	# is probably installed.
1237b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-os2-emx
1238b41a30aaSmrg	;;
1239a253d6aeSmrg    i*86:XTS-300:*:STOP)
1240b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-stop
1241b41a30aaSmrg	;;
1242a253d6aeSmrg    i*86:atheos:*:*)
1243b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-atheos
1244b41a30aaSmrg	;;
1245a253d6aeSmrg    i*86:syllable:*:*)
1246b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-syllable
1247b41a30aaSmrg	;;
124825b89263Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1249b41a30aaSmrg	GUESS=i386-unknown-lynxos$UNAME_RELEASE
1250b41a30aaSmrg	;;
1251a253d6aeSmrg    i*86:*DOS:*:*)
1252b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
1253b41a30aaSmrg	;;
1254b41a30aaSmrg    i*86:*:4.*:*)
1255b41a30aaSmrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1256a253d6aeSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1257b41a30aaSmrg		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
1258a253d6aeSmrg	else
1259b41a30aaSmrg		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
1260a253d6aeSmrg	fi
1261b41a30aaSmrg	;;
1262a253d6aeSmrg    i*86:*:5:[678]*)
126357ee1794Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1264a253d6aeSmrg	case `/bin/uname -X | grep "^Machine"` in
1265a253d6aeSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
1266a253d6aeSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1267a253d6aeSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1268a253d6aeSmrg	esac
1269b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1270b41a30aaSmrg	;;
1271a253d6aeSmrg    i*86:*:3.2:*)
1272a253d6aeSmrg	if test -f /usr/options/cb.name; then
1273a253d6aeSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1274b41a30aaSmrg		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
1275a253d6aeSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1276a253d6aeSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1277a253d6aeSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1278a253d6aeSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1279a253d6aeSmrg			&& UNAME_MACHINE=i586
1280a253d6aeSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1281a253d6aeSmrg			&& UNAME_MACHINE=i686
1282a253d6aeSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1283a253d6aeSmrg			&& UNAME_MACHINE=i686
1284b41a30aaSmrg		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
1285a253d6aeSmrg	else
1286b41a30aaSmrg		GUESS=$UNAME_MACHINE-pc-sysv32
1287a253d6aeSmrg	fi
1288b41a30aaSmrg	;;
1289a253d6aeSmrg    pc:*:*:*)
1290a253d6aeSmrg	# Left here for compatibility:
129157ee1794Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
129257ee1794Smrg	# the processor, so we play safe by assuming i586.
129325b89263Smrg	# Note: whatever this is, it MUST be the same as what config.sub
1294b41a30aaSmrg	# prints for the "djgpp" host, or else GDB configure will decide that
129525b89263Smrg	# this is a cross-build.
1296b41a30aaSmrg	GUESS=i586-pc-msdosdjgpp
1297b41a30aaSmrg	;;
1298a253d6aeSmrg    Intel:Mach:3*:*)
1299b41a30aaSmrg	GUESS=i386-pc-mach3
1300b41a30aaSmrg	;;
1301a253d6aeSmrg    paragon:*:*:*)
1302b41a30aaSmrg	GUESS=i860-intel-osf1
1303b41a30aaSmrg	;;
1304a253d6aeSmrg    i860:*:4.*:*) # i860-SVR4
1305a253d6aeSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1306b41a30aaSmrg	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
1307a253d6aeSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
1308b41a30aaSmrg	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
1309a253d6aeSmrg	fi
1310b41a30aaSmrg	;;
1311a253d6aeSmrg    mini*:CTIX:SYS*5:*)
1312a253d6aeSmrg	# "miniframe"
1313b41a30aaSmrg	GUESS=m68010-convergent-sysv
1314b41a30aaSmrg	;;
1315a253d6aeSmrg    mc68k:UNIX:SYSTEM5:3.51m)
1316b41a30aaSmrg	GUESS=m68k-convergent-sysv
1317b41a30aaSmrg	;;
1318a253d6aeSmrg    M680?0:D-NIX:5.3:*)
1319b41a30aaSmrg	GUESS=m68k-diab-dnix
1320b41a30aaSmrg	;;
1321a253d6aeSmrg    M68*:*:R3V[5678]*:*)
1322a253d6aeSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1323a253d6aeSmrg    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)
1324a253d6aeSmrg	OS_REL=''
1325a253d6aeSmrg	test -r /etc/.relid \
1326a253d6aeSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1327a253d6aeSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1328b41a30aaSmrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1329a253d6aeSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1330b41a30aaSmrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1331a253d6aeSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
133257ee1794Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
133357ee1794Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
133425b89263Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
133525b89263Smrg	OS_REL='.3'
133625b89263Smrg	test -r /etc/.relid \
133725b89263Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
133825b89263Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1339b41a30aaSmrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
134025b89263Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1341b41a30aaSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
134225b89263Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1343b41a30aaSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1344a253d6aeSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1345b41a30aaSmrg	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
1346b41a30aaSmrg	;;
1347a253d6aeSmrg    mc68030:UNIX_System_V:4.*:*)
1348b41a30aaSmrg	GUESS=m68k-atari-sysv4
1349b41a30aaSmrg	;;
1350a253d6aeSmrg    TSUNAMI:LynxOS:2.*:*)
1351b41a30aaSmrg	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
1352b41a30aaSmrg	;;
1353a253d6aeSmrg    rs6000:LynxOS:2.*:*)
1354b41a30aaSmrg	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
1355b41a30aaSmrg	;;
135625b89263Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1357b41a30aaSmrg	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
1358b41a30aaSmrg	;;
1359a253d6aeSmrg    SM[BE]S:UNIX_SV:*:*)
1360b41a30aaSmrg	GUESS=mips-dde-sysv$UNAME_RELEASE
1361b41a30aaSmrg	;;
1362a253d6aeSmrg    RM*:ReliantUNIX-*:*:*)
1363b41a30aaSmrg	GUESS=mips-sni-sysv4
1364b41a30aaSmrg	;;
1365a253d6aeSmrg    RM*:SINIX-*:*:*)
1366b41a30aaSmrg	GUESS=mips-sni-sysv4
1367b41a30aaSmrg	;;
1368a253d6aeSmrg    *:SINIX-*:*:*)
1369a253d6aeSmrg	if uname -p 2>/dev/null >/dev/null ; then
1370a253d6aeSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1371b41a30aaSmrg		GUESS=$UNAME_MACHINE-sni-sysv4
1372a253d6aeSmrg	else
1373b41a30aaSmrg		GUESS=ns32k-sni-sysv
1374a253d6aeSmrg	fi
1375b41a30aaSmrg	;;
137610f94802Smrg    PENTIUM:*:4.0*:*)	# Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
137757ee1794Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
1378b41a30aaSmrg	GUESS=i586-unisys-sysv4
1379b41a30aaSmrg	;;
1380a253d6aeSmrg    *:UNIX_System_V:4*:FTX*)
1381a253d6aeSmrg	# From Gerald Hewes <hewes@openmarket.com>.
1382a253d6aeSmrg	# How about differentiating between stratus architectures? -djm
1383b41a30aaSmrg	GUESS=hppa1.1-stratus-sysv4
1384b41a30aaSmrg	;;
1385a253d6aeSmrg    *:*:*:FTX*)
1386a253d6aeSmrg	# From seanf@swdc.stratus.com.
1387b41a30aaSmrg	GUESS=i860-stratus-sysv4
1388b41a30aaSmrg	;;
1389a253d6aeSmrg    i*86:VOS:*:*)
1390a253d6aeSmrg	# From Paul.Green@stratus.com.
1391b41a30aaSmrg	GUESS=$UNAME_MACHINE-stratus-vos
1392b41a30aaSmrg	;;
1393a253d6aeSmrg    *:VOS:*:*)
1394a253d6aeSmrg	# From Paul.Green@stratus.com.
1395b41a30aaSmrg	GUESS=hppa1.1-stratus-vos
1396b41a30aaSmrg	;;
1397a253d6aeSmrg    mc68*:A/UX:*:*)
1398b41a30aaSmrg	GUESS=m68k-apple-aux$UNAME_RELEASE
1399b41a30aaSmrg	;;
1400a253d6aeSmrg    news*:NEWS-OS:6*:*)
1401b41a30aaSmrg	GUESS=mips-sony-newsos6
1402b41a30aaSmrg	;;
1403a253d6aeSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1404b41a30aaSmrg	if test -d /usr/nec; then
1405b41a30aaSmrg		GUESS=mips-nec-sysv$UNAME_RELEASE
1406a253d6aeSmrg	else
1407b41a30aaSmrg		GUESS=mips-unknown-sysv$UNAME_RELEASE
1408a253d6aeSmrg	fi
1409b41a30aaSmrg	;;
1410a253d6aeSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1411b41a30aaSmrg	GUESS=powerpc-be-beos
1412b41a30aaSmrg	;;
1413a253d6aeSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1414b41a30aaSmrg	GUESS=powerpc-apple-beos
1415b41a30aaSmrg	;;
1416a253d6aeSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1417b41a30aaSmrg	GUESS=i586-pc-beos
1418b41a30aaSmrg	;;
141925b89263Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1420b41a30aaSmrg	GUESS=i586-pc-haiku
1421b41a30aaSmrg	;;
142210f94802Smrg    ppc:Haiku:*:*)	# Haiku running on Apple PowerPC
142310f94802Smrg	GUESS=powerpc-apple-haiku
142410f94802Smrg	;;
142510f94802Smrg    *:Haiku:*:*)	# Haiku modern gcc (not bound by BeOS compat)
142610f94802Smrg	GUESS=$UNAME_MACHINE-unknown-haiku
1427b41a30aaSmrg	;;
1428a253d6aeSmrg    SX-4:SUPER-UX:*:*)
1429b41a30aaSmrg	GUESS=sx4-nec-superux$UNAME_RELEASE
1430b41a30aaSmrg	;;
1431a253d6aeSmrg    SX-5:SUPER-UX:*:*)
1432b41a30aaSmrg	GUESS=sx5-nec-superux$UNAME_RELEASE
1433b41a30aaSmrg	;;
1434a253d6aeSmrg    SX-6:SUPER-UX:*:*)
1435b41a30aaSmrg	GUESS=sx6-nec-superux$UNAME_RELEASE
1436b41a30aaSmrg	;;
1437ea133fd7Smrg    SX-7:SUPER-UX:*:*)
1438b41a30aaSmrg	GUESS=sx7-nec-superux$UNAME_RELEASE
1439b41a30aaSmrg	;;
1440ea133fd7Smrg    SX-8:SUPER-UX:*:*)
1441b41a30aaSmrg	GUESS=sx8-nec-superux$UNAME_RELEASE
1442b41a30aaSmrg	;;
1443ea133fd7Smrg    SX-8R:SUPER-UX:*:*)
1444b41a30aaSmrg	GUESS=sx8r-nec-superux$UNAME_RELEASE
1445b41a30aaSmrg	;;
1446b41a30aaSmrg    SX-ACE:SUPER-UX:*:*)
1447b41a30aaSmrg	GUESS=sxace-nec-superux$UNAME_RELEASE
1448b41a30aaSmrg	;;
1449a253d6aeSmrg    Power*:Rhapsody:*:*)
1450b41a30aaSmrg	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
1451b41a30aaSmrg	;;
1452a253d6aeSmrg    *:Rhapsody:*:*)
1453b41a30aaSmrg	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
1454b41a30aaSmrg	;;
1455b41a30aaSmrg    arm64:Darwin:*:*)
1456b41a30aaSmrg	GUESS=aarch64-apple-darwin$UNAME_RELEASE
1457b41a30aaSmrg	;;
1458a253d6aeSmrg    *:Darwin:*:*)
1459b41a30aaSmrg	UNAME_PROCESSOR=`uname -p`
1460b41a30aaSmrg	case $UNAME_PROCESSOR in
1461b41a30aaSmrg	    unknown) UNAME_PROCESSOR=powerpc ;;
1462b41a30aaSmrg	esac
1463b41a30aaSmrg	if command -v xcode-select > /dev/null 2> /dev/null && \
1464b41a30aaSmrg		! xcode-select --print-path > /dev/null 2> /dev/null ; then
1465b41a30aaSmrg	    # Avoid executing cc if there is no toolchain installed as
1466b41a30aaSmrg	    # cc will be a stub that puts up a graphical alert
1467b41a30aaSmrg	    # prompting the user to install developer tools.
1468b41a30aaSmrg	    CC_FOR_BUILD=no_compiler_found
1469b41a30aaSmrg	else
1470b41a30aaSmrg	    set_cc_for_build
147131637056Smrg	fi
1472b41a30aaSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
147331637056Smrg	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1474b41a30aaSmrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1475b41a30aaSmrg		   grep IS_64BIT_ARCH >/dev/null
147631637056Smrg	    then
147731637056Smrg		case $UNAME_PROCESSOR in
147831637056Smrg		    i386) UNAME_PROCESSOR=x86_64 ;;
147931637056Smrg		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
148031637056Smrg		esac
148131637056Smrg	    fi
1482b41a30aaSmrg	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1483b41a30aaSmrg	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1484b41a30aaSmrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1485b41a30aaSmrg		   grep IS_PPC >/dev/null
1486b41a30aaSmrg	    then
1487b41a30aaSmrg		UNAME_PROCESSOR=powerpc
1488b41a30aaSmrg	    fi
1489b41a30aaSmrg	elif test "$UNAME_PROCESSOR" = i386 ; then
1490b41a30aaSmrg	    # uname -m returns i386 or x86_64
1491b41a30aaSmrg	    UNAME_PROCESSOR=$UNAME_MACHINE
149231637056Smrg	fi
1493b41a30aaSmrg	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
1494b41a30aaSmrg	;;
1495a253d6aeSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1496a253d6aeSmrg	UNAME_PROCESSOR=`uname -p`
1497b41a30aaSmrg	if test "$UNAME_PROCESSOR" = x86; then
1498a253d6aeSmrg		UNAME_PROCESSOR=i386
1499a253d6aeSmrg		UNAME_MACHINE=pc
1500a253d6aeSmrg	fi
1501b41a30aaSmrg	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
1502b41a30aaSmrg	;;
1503a253d6aeSmrg    *:QNX:*:4*)
1504b41a30aaSmrg	GUESS=i386-pc-qnx
1505b41a30aaSmrg	;;
1506b41a30aaSmrg    NEO-*:NONSTOP_KERNEL:*:*)
1507b41a30aaSmrg	GUESS=neo-tandem-nsk$UNAME_RELEASE
1508b41a30aaSmrg	;;
150957ee1794Smrg    NSE-*:NONSTOP_KERNEL:*:*)
1510b41a30aaSmrg	GUESS=nse-tandem-nsk$UNAME_RELEASE
1511b41a30aaSmrg	;;
1512b41a30aaSmrg    NSR-*:NONSTOP_KERNEL:*:*)
1513b41a30aaSmrg	GUESS=nsr-tandem-nsk$UNAME_RELEASE
1514b41a30aaSmrg	;;
1515b41a30aaSmrg    NSV-*:NONSTOP_KERNEL:*:*)
1516b41a30aaSmrg	GUESS=nsv-tandem-nsk$UNAME_RELEASE
1517b41a30aaSmrg	;;
1518b41a30aaSmrg    NSX-*:NONSTOP_KERNEL:*:*)
1519b41a30aaSmrg	GUESS=nsx-tandem-nsk$UNAME_RELEASE
1520b41a30aaSmrg	;;
1521a253d6aeSmrg    *:NonStop-UX:*:*)
1522b41a30aaSmrg	GUESS=mips-compaq-nonstopux
1523b41a30aaSmrg	;;
1524a253d6aeSmrg    BS2000:POSIX*:*:*)
1525b41a30aaSmrg	GUESS=bs2000-siemens-sysv
1526b41a30aaSmrg	;;
1527a253d6aeSmrg    DS/*:UNIX_System_V:*:*)
1528b41a30aaSmrg	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
1529b41a30aaSmrg	;;
1530a253d6aeSmrg    *:Plan9:*:*)
1531a253d6aeSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
1532a253d6aeSmrg	# is converted to i386 for consistency with other x86
1533a253d6aeSmrg	# operating systems.
1534b41a30aaSmrg	if test "${cputype-}" = 386; then
1535a253d6aeSmrg	    UNAME_MACHINE=i386
1536b41a30aaSmrg	elif test "x${cputype-}" != x; then
1537b41a30aaSmrg	    UNAME_MACHINE=$cputype
1538a253d6aeSmrg	fi
1539b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-plan9
1540b41a30aaSmrg	;;
1541a253d6aeSmrg    *:TOPS-10:*:*)
1542b41a30aaSmrg	GUESS=pdp10-unknown-tops10
1543b41a30aaSmrg	;;
1544a253d6aeSmrg    *:TENEX:*:*)
1545b41a30aaSmrg	GUESS=pdp10-unknown-tenex
1546b41a30aaSmrg	;;
1547a253d6aeSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1548b41a30aaSmrg	GUESS=pdp10-dec-tops20
1549b41a30aaSmrg	;;
1550a253d6aeSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1551b41a30aaSmrg	GUESS=pdp10-xkl-tops20
1552b41a30aaSmrg	;;
1553a253d6aeSmrg    *:TOPS-20:*:*)
1554b41a30aaSmrg	GUESS=pdp10-unknown-tops20
1555b41a30aaSmrg	;;
1556a253d6aeSmrg    *:ITS:*:*)
1557b41a30aaSmrg	GUESS=pdp10-unknown-its
1558b41a30aaSmrg	;;
1559a253d6aeSmrg    SEI:*:*:SEIUX)
1560b41a30aaSmrg	GUESS=mips-sei-seiux$UNAME_RELEASE
1561b41a30aaSmrg	;;
1562a253d6aeSmrg    *:DragonFly:*:*)
1563b41a30aaSmrg	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
1564b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
1565b41a30aaSmrg	;;
1566a253d6aeSmrg    *:*VMS:*:*)
156757ee1794Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1568b41a30aaSmrg	case $UNAME_MACHINE in
1569b41a30aaSmrg	    A*) GUESS=alpha-dec-vms ;;
1570b41a30aaSmrg	    I*) GUESS=ia64-dec-vms ;;
1571b41a30aaSmrg	    V*) GUESS=vax-dec-vms ;;
1572a253d6aeSmrg	esac ;;
1573a253d6aeSmrg    *:XENIX:*:SysV)
1574b41a30aaSmrg	GUESS=i386-pc-xenix
1575b41a30aaSmrg	;;
1576a253d6aeSmrg    i*86:skyos:*:*)
1577b41a30aaSmrg	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
1578b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
1579b41a30aaSmrg	;;
1580a253d6aeSmrg    i*86:rdos:*:*)
1581b41a30aaSmrg	GUESS=$UNAME_MACHINE-pc-rdos
1582b41a30aaSmrg	;;
158310f94802Smrg    i*86:Fiwix:*:*)
158410f94802Smrg	GUESS=$UNAME_MACHINE-pc-fiwix
158510f94802Smrg	;;
1586b41a30aaSmrg    *:AROS:*:*)
1587b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-aros
1588b41a30aaSmrg	;;
158957ee1794Smrg    x86_64:VMkernel:*:*)
1590b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-esx
1591b41a30aaSmrg	;;
1592b41a30aaSmrg    amd64:Isilon\ OneFS:*:*)
1593b41a30aaSmrg	GUESS=x86_64-unknown-onefs
1594b41a30aaSmrg	;;
1595b41a30aaSmrg    *:Unleashed:*:*)
1596b41a30aaSmrg	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
1597b41a30aaSmrg	;;
159810f94802Smrg    *:Ironclad:*:*)
159910f94802Smrg	GUESS=$UNAME_MACHINE-unknown-ironclad
160010f94802Smrg	;;
1601a253d6aeSmrgesac
1602a253d6aeSmrg
1603b41a30aaSmrg# Do we have a guess based on uname results?
1604b41a30aaSmrgif test "x$GUESS" != x; then
1605b41a30aaSmrg    echo "$GUESS"
1606b41a30aaSmrg    exit
1607b41a30aaSmrgfi
1608b41a30aaSmrg
1609b41a30aaSmrg# No uname command or uname output not recognized.
1610b41a30aaSmrgset_cc_for_build
1611b41a30aaSmrgcat > "$dummy.c" <<EOF
1612a253d6aeSmrg#ifdef _SEQUENT_
1613b41a30aaSmrg#include <sys/types.h>
1614b41a30aaSmrg#include <sys/utsname.h>
1615b41a30aaSmrg#endif
1616b41a30aaSmrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1617b41a30aaSmrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1618b41a30aaSmrg#include <signal.h>
1619b41a30aaSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1620b41a30aaSmrg#include <sys/utsname.h>
1621b41a30aaSmrg#endif
1622b41a30aaSmrg#endif
1623a253d6aeSmrg#endif
1624a253d6aeSmrgmain ()
1625a253d6aeSmrg{
1626a253d6aeSmrg#if defined (sony)
1627a253d6aeSmrg#if defined (MIPSEB)
1628a253d6aeSmrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1629a253d6aeSmrg     I don't know....  */
1630a253d6aeSmrg  printf ("mips-sony-bsd\n"); exit (0);
1631a253d6aeSmrg#else
1632a253d6aeSmrg#include <sys/param.h>
1633a253d6aeSmrg  printf ("m68k-sony-newsos%s\n",
1634a253d6aeSmrg#ifdef NEWSOS4
1635b41a30aaSmrg  "4"
1636a253d6aeSmrg#else
1637b41a30aaSmrg  ""
1638a253d6aeSmrg#endif
1639b41a30aaSmrg  ); exit (0);
1640a253d6aeSmrg#endif
1641a253d6aeSmrg#endif
1642a253d6aeSmrg
1643a253d6aeSmrg#if defined (NeXT)
1644a253d6aeSmrg#if !defined (__ARCHITECTURE__)
1645a253d6aeSmrg#define __ARCHITECTURE__ "m68k"
1646a253d6aeSmrg#endif
1647a253d6aeSmrg  int version;
1648a253d6aeSmrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1649a253d6aeSmrg  if (version < 4)
1650a253d6aeSmrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1651a253d6aeSmrg  else
1652a253d6aeSmrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1653a253d6aeSmrg  exit (0);
1654a253d6aeSmrg#endif
1655a253d6aeSmrg
1656a253d6aeSmrg#if defined (MULTIMAX) || defined (n16)
1657a253d6aeSmrg#if defined (UMAXV)
1658a253d6aeSmrg  printf ("ns32k-encore-sysv\n"); exit (0);
1659a253d6aeSmrg#else
1660a253d6aeSmrg#if defined (CMU)
1661a253d6aeSmrg  printf ("ns32k-encore-mach\n"); exit (0);
1662a253d6aeSmrg#else
1663a253d6aeSmrg  printf ("ns32k-encore-bsd\n"); exit (0);
1664a253d6aeSmrg#endif
1665a253d6aeSmrg#endif
1666a253d6aeSmrg#endif
1667a253d6aeSmrg
1668a253d6aeSmrg#if defined (__386BSD__)
1669a253d6aeSmrg  printf ("i386-pc-bsd\n"); exit (0);
1670a253d6aeSmrg#endif
1671a253d6aeSmrg
1672a253d6aeSmrg#if defined (sequent)
1673a253d6aeSmrg#if defined (i386)
1674a253d6aeSmrg  printf ("i386-sequent-dynix\n"); exit (0);
1675a253d6aeSmrg#endif
1676a253d6aeSmrg#if defined (ns32000)
1677a253d6aeSmrg  printf ("ns32k-sequent-dynix\n"); exit (0);
1678a253d6aeSmrg#endif
1679a253d6aeSmrg#endif
1680a253d6aeSmrg
1681a253d6aeSmrg#if defined (_SEQUENT_)
1682b41a30aaSmrg  struct utsname un;
1683a253d6aeSmrg
1684b41a30aaSmrg  uname(&un);
1685b41a30aaSmrg  if (strncmp(un.version, "V2", 2) == 0) {
1686b41a30aaSmrg    printf ("i386-sequent-ptx2\n"); exit (0);
1687b41a30aaSmrg  }
1688b41a30aaSmrg  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1689b41a30aaSmrg    printf ("i386-sequent-ptx1\n"); exit (0);
1690b41a30aaSmrg  }
1691b41a30aaSmrg  printf ("i386-sequent-ptx\n"); exit (0);
1692a253d6aeSmrg#endif
1693a253d6aeSmrg
1694a253d6aeSmrg#if defined (vax)
1695b41a30aaSmrg#if !defined (ultrix)
1696b41a30aaSmrg#include <sys/param.h>
1697b41a30aaSmrg#if defined (BSD)
1698b41a30aaSmrg#if BSD == 43
1699b41a30aaSmrg  printf ("vax-dec-bsd4.3\n"); exit (0);
1700b41a30aaSmrg#else
1701b41a30aaSmrg#if BSD == 199006
1702b41a30aaSmrg  printf ("vax-dec-bsd4.3reno\n"); exit (0);
1703b41a30aaSmrg#else
1704b41a30aaSmrg  printf ("vax-dec-bsd\n"); exit (0);
1705b41a30aaSmrg#endif
1706b41a30aaSmrg#endif
1707b41a30aaSmrg#else
1708b41a30aaSmrg  printf ("vax-dec-bsd\n"); exit (0);
1709b41a30aaSmrg#endif
1710b41a30aaSmrg#else
1711b41a30aaSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1712b41a30aaSmrg  struct utsname un;
1713b41a30aaSmrg  uname (&un);
1714b41a30aaSmrg  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1715b41a30aaSmrg#else
1716b41a30aaSmrg  printf ("vax-dec-ultrix\n"); exit (0);
1717b41a30aaSmrg#endif
1718b41a30aaSmrg#endif
1719b41a30aaSmrg#endif
1720b41a30aaSmrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1721b41a30aaSmrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1722b41a30aaSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1723b41a30aaSmrg  struct utsname *un;
1724b41a30aaSmrg  uname (&un);
1725b41a30aaSmrg  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1726b41a30aaSmrg#else
1727b41a30aaSmrg  printf ("mips-dec-ultrix\n"); exit (0);
1728b41a30aaSmrg#endif
1729b41a30aaSmrg#endif
1730a253d6aeSmrg#endif
1731a253d6aeSmrg
1732a253d6aeSmrg#if defined (alliant) && defined (i860)
1733a253d6aeSmrg  printf ("i860-alliant-bsd\n"); exit (0);
1734a253d6aeSmrg#endif
1735a253d6aeSmrg
1736a253d6aeSmrg  exit (1);
1737a253d6aeSmrg}
1738a253d6aeSmrgEOF
1739a253d6aeSmrg
1740b41a30aaSmrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
1741a253d6aeSmrg	{ echo "$SYSTEM_NAME"; exit; }
1742a253d6aeSmrg
1743a253d6aeSmrg# Apollos put the system type in the environment.
1744b41a30aaSmrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1745a253d6aeSmrg
1746b41a30aaSmrgecho "$0: unable to guess system type" >&2
1747a253d6aeSmrg
1748b41a30aaSmrgcase $UNAME_MACHINE:$UNAME_SYSTEM in
1749b41a30aaSmrg    mips:Linux | mips64:Linux)
1750b41a30aaSmrg	# If we got here on MIPS GNU/Linux, output extra information.
1751b41a30aaSmrg	cat >&2 <<EOF
1752a253d6aeSmrg
1753b41a30aaSmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1754b41a30aaSmrgthe system type. Please install a C compiler and try again.
1755b41a30aaSmrgEOF
1756b41a30aaSmrg	;;
1757b41a30aaSmrgesac
1758a253d6aeSmrg
1759a253d6aeSmrgcat >&2 <<EOF
1760a253d6aeSmrg
1761b41a30aaSmrgThis script (version $timestamp), has failed to recognize the
1762b41a30aaSmrgoperating system you are using. If your script is old, overwrite *all*
1763b41a30aaSmrgcopies of config.guess and config.sub with the latest versions from:
1764a253d6aeSmrg
1765b41a30aaSmrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
1766a253d6aeSmrgand
1767b41a30aaSmrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1768b41a30aaSmrgEOF
1769a253d6aeSmrg
1770b41a30aaSmrgour_year=`echo $timestamp | sed 's,-.*,,'`
1771b41a30aaSmrgthisyear=`date +%Y`
1772b41a30aaSmrg# shellcheck disable=SC2003
1773b41a30aaSmrgscript_age=`expr "$thisyear" - "$our_year"`
1774b41a30aaSmrgif test "$script_age" -lt 3 ; then
1775b41a30aaSmrg   cat >&2 <<EOF
1776b41a30aaSmrg
1777b41a30aaSmrgIf $0 has already been updated, send the following data and any
1778b41a30aaSmrginformation you think might be pertinent to config-patches@gnu.org to
1779b41a30aaSmrgprovide the necessary information to handle your system.
1780a253d6aeSmrg
1781a253d6aeSmrgconfig.guess timestamp = $timestamp
1782a253d6aeSmrg
1783a253d6aeSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1784a253d6aeSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1785a253d6aeSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1786a253d6aeSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1787a253d6aeSmrg
1788a253d6aeSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1789a253d6aeSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1790a253d6aeSmrg
1791a253d6aeSmrghostinfo               = `(hostinfo) 2>/dev/null`
1792a253d6aeSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1793a253d6aeSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1794a253d6aeSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1795a253d6aeSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1796a253d6aeSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1797a253d6aeSmrg
1798b41a30aaSmrgUNAME_MACHINE = "$UNAME_MACHINE"
1799b41a30aaSmrgUNAME_RELEASE = "$UNAME_RELEASE"
1800b41a30aaSmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
1801b41a30aaSmrgUNAME_VERSION = "$UNAME_VERSION"
1802a253d6aeSmrgEOF
1803b41a30aaSmrgfi
1804a253d6aeSmrg
1805a253d6aeSmrgexit 1
1806a253d6aeSmrg
1807a253d6aeSmrg# Local variables:
1808b41a30aaSmrg# eval: (add-hook 'before-save-hook 'time-stamp)
1809a253d6aeSmrg# time-stamp-start: "timestamp='"
1810a253d6aeSmrg# time-stamp-format: "%:y-%02m-%02d"
1811a253d6aeSmrg# time-stamp-end: "'"
1812a253d6aeSmrg# End:
1813