1a6d9b409Smrg#! /bin/sh
2a6d9b409Smrg# Attempt to guess a canonical system name.
3838f5b0bSmrg#   Copyright 1992-2024 Free Software Foundation, Inc.
4a6d9b409Smrg
592e95ad1Smrg# shellcheck disable=SC2006,SC2268 # see below for rationale
692e95ad1Smrg
7838f5b0bSmrgtimestamp='2024-01-01'
8a6d9b409Smrg
9a6d9b409Smrg# This file is free software; you can redistribute it and/or modify it
10a6d9b409Smrg# under the terms of the GNU General Public License as published by
11838f5b0bSmrg# the Free Software Foundation, either version 3 of the License, or
12a6d9b409Smrg# (at your option) any later version.
13a6d9b409Smrg#
14a6d9b409Smrg# This program is distributed in the hope that it will be useful, but
15a6d9b409Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16a6d9b409Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17a6d9b409Smrg# General Public License for more details.
18a6d9b409Smrg#
19a6d9b409Smrg# You should have received a copy of the GNU General Public License
208b8e729cSmrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
21a6d9b409Smrg#
22a6d9b409Smrg# As a special exception to the GNU General Public License, if you
23a6d9b409Smrg# distribute this file as part of a program that contains a
24a6d9b409Smrg# configuration script generated by Autoconf, you may include it under
25b91640d3Smrg# the same distribution terms that you use for the rest of that
26b91640d3Smrg# program.  This Exception is an additional permission under section 7
27b91640d3Smrg# of the GNU General Public License, version 3 ("GPLv3").
28a6d9b409Smrg#
29b91640d3Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
30a6d9b409Smrg#
311e5fa1c5Smrg# You can get the latest version of this script from:
3292e95ad1Smrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
33b91640d3Smrg#
34b91640d3Smrg# Please send patches to <config-patches@gnu.org>.
35b91640d3Smrg
36a6d9b409Smrg
3792e95ad1Smrg# The "shellcheck disable" line above the timestamp inhibits complaints
3892e95ad1Smrg# about features and limitations of the classic Bourne shell that were
3992e95ad1Smrg# superseded or lifted in POSIX.  However, this script identifies a wide
4092e95ad1Smrg# variety of pre-POSIX systems that do not have POSIX shells at all, and
4192e95ad1Smrg# even some reasonably current systems (Solaris 10 as case-in-point) still
4292e95ad1Smrg# have a pre-POSIX /bin/sh.
4392e95ad1Smrg
4492e95ad1Smrg
45a6d9b409Smrgme=`echo "$0" | sed -e 's,.*/,,'`
46a6d9b409Smrg
47a6d9b409Smrgusage="\
48a6d9b409SmrgUsage: $0 [OPTION]
49a6d9b409Smrg
50838f5b0bSmrgOutput the configuration name of the system '$me' is run on.
51a6d9b409Smrg
528b8e729cSmrgOptions:
53a6d9b409Smrg  -h, --help         print this help, then exit
54a6d9b409Smrg  -t, --time-stamp   print date of last modification, then exit
55a6d9b409Smrg  -v, --version      print version number, then exit
56a6d9b409Smrg
57a6d9b409SmrgReport bugs and patches to <config-patches@gnu.org>."
58a6d9b409Smrg
59a6d9b409Smrgversion="\
60a6d9b409SmrgGNU config.guess ($timestamp)
61a6d9b409Smrg
62a6d9b409SmrgOriginally written by Per Bothner.
63838f5b0bSmrgCopyright 1992-2024 Free Software Foundation, Inc.
64a6d9b409Smrg
65a6d9b409SmrgThis is free software; see the source for copying conditions.  There is NO
66a6d9b409Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
67a6d9b409Smrg
68a6d9b409Smrghelp="
69838f5b0bSmrgTry '$me --help' for more information."
70a6d9b409Smrg
71a6d9b409Smrg# Parse command line
72a6d9b409Smrgwhile test $# -gt 0 ; do
73a6d9b409Smrg  case $1 in
74a6d9b409Smrg    --time-stamp | --time* | -t )
75a6d9b409Smrg       echo "$timestamp" ; exit ;;
76a6d9b409Smrg    --version | -v )
77a6d9b409Smrg       echo "$version" ; exit ;;
78a6d9b409Smrg    --help | --h* | -h )
79a6d9b409Smrg       echo "$usage"; exit ;;
80a6d9b409Smrg    -- )     # Stop option processing
81a6d9b409Smrg       shift; break ;;
82a6d9b409Smrg    - )	# Use stdin as input.
83a6d9b409Smrg       break ;;
84a6d9b409Smrg    -* )
85a6d9b409Smrg       echo "$me: invalid option $1$help" >&2
86a6d9b409Smrg       exit 1 ;;
87a6d9b409Smrg    * )
88a6d9b409Smrg       break ;;
89a6d9b409Smrg  esac
90a6d9b409Smrgdone
91a6d9b409Smrg
92a6d9b409Smrgif test $# != 0; then
93a6d9b409Smrg  echo "$me: too many arguments$help" >&2
94a6d9b409Smrg  exit 1
95a6d9b409Smrgfi
96a6d9b409Smrg
9792e95ad1Smrg# Just in case it came from the environment.
9892e95ad1SmrgGUESS=
99a6d9b409Smrg
100a6d9b409Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
101a6d9b409Smrg# compiler to aid in system detection is discouraged as it requires
102a6d9b409Smrg# temporary files to be created and, as you can see below, it is a
103a6d9b409Smrg# headache to deal with in a portable fashion.
104a6d9b409Smrg
105838f5b0bSmrg# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
106838f5b0bSmrg# use 'HOST_CC' if defined, but it is deprecated.
107a6d9b409Smrg
108a6d9b409Smrg# Portable tmp directory creation inspired by the Autoconf team.
109a6d9b409Smrg
11092e95ad1Smrgtmp=
11192e95ad1Smrg# shellcheck disable=SC2172
11292e95ad1Smrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
11392e95ad1Smrg
11492e95ad1Smrgset_cc_for_build() {
11592e95ad1Smrg    # prevent multiple calls if $tmp is already set
11692e95ad1Smrg    test "$tmp" && return 0
11792e95ad1Smrg    : "${TMPDIR=/tmp}"
11892e95ad1Smrg    # shellcheck disable=SC2039,SC3028
11992e95ad1Smrg    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
12092e95ad1Smrg	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
12192e95ad1Smrg	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
12292e95ad1Smrg	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
12392e95ad1Smrg    dummy=$tmp/dummy
12492e95ad1Smrg    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
12592e95ad1Smrg	,,)    echo "int x;" > "$dummy.c"
12692e95ad1Smrg	       for driver in cc gcc c89 c99 ; do
12792e95ad1Smrg		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
12892e95ad1Smrg		       CC_FOR_BUILD=$driver
12992e95ad1Smrg		       break
13092e95ad1Smrg		   fi
13192e95ad1Smrg	       done
13292e95ad1Smrg	       if test x"$CC_FOR_BUILD" = x ; then
13392e95ad1Smrg		   CC_FOR_BUILD=no_compiler_found
13492e95ad1Smrg	       fi
13592e95ad1Smrg	       ;;
13692e95ad1Smrg	,,*)   CC_FOR_BUILD=$CC ;;
13792e95ad1Smrg	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
13892e95ad1Smrg    esac
13992e95ad1Smrg}
140a6d9b409Smrg
141a6d9b409Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
142a6d9b409Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
14392e95ad1Smrgif test -f /.attbin/uname ; then
144a6d9b409Smrg	PATH=$PATH:/.attbin ; export PATH
145a6d9b409Smrgfi
146a6d9b409Smrg
147a6d9b409SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
148a6d9b409SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
14992e95ad1SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
150a6d9b409SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
151a6d9b409Smrg
15292e95ad1Smrgcase $UNAME_SYSTEM in
153b91640d3SmrgLinux|GNU|GNU/*)
15492e95ad1Smrg	LIBC=unknown
155b91640d3Smrg
15692e95ad1Smrg	set_cc_for_build
1578b8e729cSmrg	cat <<-EOF > "$dummy.c"
158838f5b0bSmrg	#if defined(__ANDROID__)
159838f5b0bSmrg	LIBC=android
160838f5b0bSmrg	#else
161b91640d3Smrg	#include <features.h>
162b91640d3Smrg	#if defined(__UCLIBC__)
163b91640d3Smrg	LIBC=uclibc
164b91640d3Smrg	#elif defined(__dietlibc__)
165b91640d3Smrg	LIBC=dietlibc
16692e95ad1Smrg	#elif defined(__GLIBC__)
167b91640d3Smrg	LIBC=gnu
168838f5b0bSmrg	#elif defined(__LLVM_LIBC__)
169838f5b0bSmrg	LIBC=llvm
17092e95ad1Smrg	#else
17192e95ad1Smrg	#include <stdarg.h>
17292e95ad1Smrg	/* First heuristic to detect musl libc.  */
17392e95ad1Smrg	#ifdef __DEFINED_va_list
17492e95ad1Smrg	LIBC=musl
17592e95ad1Smrg	#endif
176b91640d3Smrg	#endif
177838f5b0bSmrg	#endif
178b91640d3Smrg	EOF
17992e95ad1Smrg	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
18092e95ad1Smrg	eval "$cc_set_libc"
1818b8e729cSmrg
18292e95ad1Smrg	# Second heuristic to detect musl libc.
18392e95ad1Smrg	if [ "$LIBC" = unknown ] &&
18492e95ad1Smrg	   command -v ldd >/dev/null &&
18592e95ad1Smrg	   ldd --version 2>&1 | grep -q ^musl; then
18692e95ad1Smrg		LIBC=musl
18792e95ad1Smrg	fi
18892e95ad1Smrg
18992e95ad1Smrg	# If the system lacks a compiler, then just pick glibc.
19092e95ad1Smrg	# We could probably try harder.
19192e95ad1Smrg	if [ "$LIBC" = unknown ]; then
19292e95ad1Smrg		LIBC=gnu
1938b8e729cSmrg	fi
194b91640d3Smrg	;;
195b91640d3Smrgesac
196b91640d3Smrg
197a6d9b409Smrg# Note: order is significant - the case branches are not exclusive.
198a6d9b409Smrg
19992e95ad1Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
200a6d9b409Smrg    *:NetBSD:*:*)
201a6d9b409Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
202b91640d3Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
203a6d9b409Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
204a6d9b409Smrg	# switched to ELF, *-*-netbsd* would select the old
205a6d9b409Smrg	# object file format.  This provides both forward
206a6d9b409Smrg	# compatibility and a consistent mechanism for selecting the
207a6d9b409Smrg	# object file format.
208a6d9b409Smrg	#
209a6d9b409Smrg	# Note: NetBSD doesn't particularly care about the vendor
210a6d9b409Smrg	# portion of the name.  We always set it to "unknown".
21111a95ff3Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
21292e95ad1Smrg	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
21392e95ad1Smrg	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
21411a95ff3Smrg	    echo unknown)`
21592e95ad1Smrg	case $UNAME_MACHINE_ARCH in
21692e95ad1Smrg	    aarch64eb) machine=aarch64_be-unknown ;;
217a6d9b409Smrg	    armeb) machine=armeb-unknown ;;
218a6d9b409Smrg	    arm*) machine=arm-unknown ;;
219a6d9b409Smrg	    sh3el) machine=shl-unknown ;;
220a6d9b409Smrg	    sh3eb) machine=sh-unknown ;;
221cae39615Smrg	    sh5el) machine=sh5le-unknown ;;
22211a95ff3Smrg	    earmv*)
2238b8e729cSmrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
2248b8e729cSmrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
22592e95ad1Smrg		machine=${arch}${endian}-unknown
22611a95ff3Smrg		;;
22792e95ad1Smrg	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
228a6d9b409Smrg	esac
229a6d9b409Smrg	# The Operating System including object format, if it has switched
2308b8e729cSmrg	# to ELF recently (or will in the future) and ABI.
23192e95ad1Smrg	case $UNAME_MACHINE_ARCH in
2328b8e729cSmrg	    earm*)
2338b8e729cSmrg		os=netbsdelf
2348b8e729cSmrg		;;
2358b8e729cSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
23692e95ad1Smrg		set_cc_for_build
237a6d9b409Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
2381e5fa1c5Smrg			| grep -q __ELF__
239a6d9b409Smrg		then
240a6d9b409Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
241a6d9b409Smrg		    # Return netbsd for either.  FIX?
242a6d9b409Smrg		    os=netbsd
243a6d9b409Smrg		else
244a6d9b409Smrg		    os=netbsdelf
245a6d9b409Smrg		fi
246a6d9b409Smrg		;;
247a6d9b409Smrg	    *)
248a097bd00Smrg		os=netbsd
249a6d9b409Smrg		;;
250a6d9b409Smrg	esac
25111a95ff3Smrg	# Determine ABI tags.
25292e95ad1Smrg	case $UNAME_MACHINE_ARCH in
25311a95ff3Smrg	    earm*)
25411a95ff3Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
2558b8e729cSmrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
25611a95ff3Smrg		;;
25711a95ff3Smrg	esac
258a6d9b409Smrg	# The OS release
259a6d9b409Smrg	# Debian GNU/NetBSD machines have a different userland, and
260a6d9b409Smrg	# thus, need a distinct triplet. However, they do not need
261a6d9b409Smrg	# kernel version information, so it can be replaced with a
262a6d9b409Smrg	# suitable tag, in the style of linux-gnu.
26392e95ad1Smrg	case $UNAME_VERSION in
264a6d9b409Smrg	    Debian*)
265a6d9b409Smrg		release='-gnu'
266a6d9b409Smrg		;;
267a6d9b409Smrg	    *)
2688b8e729cSmrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
269a6d9b409Smrg		;;
270a6d9b409Smrg	esac
271a6d9b409Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
272a6d9b409Smrg	# contains redundant information, the shorter form:
273a6d9b409Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
27492e95ad1Smrg	GUESS=$machine-${os}${release}${abi-}
27592e95ad1Smrg	;;
276b91640d3Smrg    *:Bitrig:*:*)
277b91640d3Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
27892e95ad1Smrg	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
27992e95ad1Smrg	;;
280a6d9b409Smrg    *:OpenBSD:*:*)
281a6d9b409Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
28292e95ad1Smrg	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
28392e95ad1Smrg	;;
28492e95ad1Smrg    *:SecBSD:*:*)
28592e95ad1Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
28692e95ad1Smrg	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
28792e95ad1Smrg	;;
28811a95ff3Smrg    *:LibertyBSD:*:*)
28911a95ff3Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
29092e95ad1Smrg	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
29192e95ad1Smrg	;;
2928b8e729cSmrg    *:MidnightBSD:*:*)
29392e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
29492e95ad1Smrg	;;
295a6d9b409Smrg    *:ekkoBSD:*:*)
29692e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
29792e95ad1Smrg	;;
298cae39615Smrg    *:SolidBSD:*:*)
29992e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
30092e95ad1Smrg	;;
30192e95ad1Smrg    *:OS108:*:*)
30292e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
30392e95ad1Smrg	;;
304a6d9b409Smrg    macppc:MirBSD:*:*)
30592e95ad1Smrg	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
30692e95ad1Smrg	;;
307a6d9b409Smrg    *:MirBSD:*:*)
30892e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
30992e95ad1Smrg	;;
31011a95ff3Smrg    *:Sortix:*:*)
31192e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-sortix
31292e95ad1Smrg	;;
31392e95ad1Smrg    *:Twizzler:*:*)
31492e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-twizzler
31592e95ad1Smrg	;;
3168b8e729cSmrg    *:Redox:*:*)
31792e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-redox
31892e95ad1Smrg	;;
3198b8e729cSmrg    mips:OSF1:*.*)
32092e95ad1Smrg	GUESS=mips-dec-osf1
32192e95ad1Smrg	;;
322a6d9b409Smrg    alpha:OSF1:*:*)
32392e95ad1Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
32492e95ad1Smrg	trap '' 0
325a6d9b409Smrg	case $UNAME_RELEASE in
326a6d9b409Smrg	*4.0)
327a6d9b409Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
328a6d9b409Smrg		;;
329a6d9b409Smrg	*5.*)
330a097bd00Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
331a6d9b409Smrg		;;
332a6d9b409Smrg	esac
333a6d9b409Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
334a6d9b409Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
335a6d9b409Smrg	# covers most systems running today.  This code pipes the CPU
336a6d9b409Smrg	# types through head -n 1, so we only detect the type of CPU 0.
337a6d9b409Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
33892e95ad1Smrg	case $ALPHA_CPU_TYPE in
339a6d9b409Smrg	    "EV4 (21064)")
34011a95ff3Smrg		UNAME_MACHINE=alpha ;;
341a6d9b409Smrg	    "EV4.5 (21064)")
34211a95ff3Smrg		UNAME_MACHINE=alpha ;;
343a6d9b409Smrg	    "LCA4 (21066/21068)")
34411a95ff3Smrg		UNAME_MACHINE=alpha ;;
345a6d9b409Smrg	    "EV5 (21164)")
34611a95ff3Smrg		UNAME_MACHINE=alphaev5 ;;
347a6d9b409Smrg	    "EV5.6 (21164A)")
34811a95ff3Smrg		UNAME_MACHINE=alphaev56 ;;
349a6d9b409Smrg	    "EV5.6 (21164PC)")
35011a95ff3Smrg		UNAME_MACHINE=alphapca56 ;;
351a6d9b409Smrg	    "EV5.7 (21164PC)")
35211a95ff3Smrg		UNAME_MACHINE=alphapca57 ;;
353a6d9b409Smrg	    "EV6 (21264)")
35411a95ff3Smrg		UNAME_MACHINE=alphaev6 ;;
355a6d9b409Smrg	    "EV6.7 (21264A)")
35611a95ff3Smrg		UNAME_MACHINE=alphaev67 ;;
357a6d9b409Smrg	    "EV6.8CB (21264C)")
35811a95ff3Smrg		UNAME_MACHINE=alphaev68 ;;
359a6d9b409Smrg	    "EV6.8AL (21264B)")
36011a95ff3Smrg		UNAME_MACHINE=alphaev68 ;;
361a6d9b409Smrg	    "EV6.8CX (21264D)")
36211a95ff3Smrg		UNAME_MACHINE=alphaev68 ;;
363a6d9b409Smrg	    "EV6.9A (21264/EV69A)")
36411a95ff3Smrg		UNAME_MACHINE=alphaev69 ;;
365a6d9b409Smrg	    "EV7 (21364)")
36611a95ff3Smrg		UNAME_MACHINE=alphaev7 ;;
367a6d9b409Smrg	    "EV7.9 (21364A)")
36811a95ff3Smrg		UNAME_MACHINE=alphaev79 ;;
369a6d9b409Smrg	esac
370a6d9b409Smrg	# A Pn.n version is a patched version.
371a6d9b409Smrg	# A Vn.n version is a released version.
372a6d9b409Smrg	# A Tn.n version is a released field test version.
373a6d9b409Smrg	# A Xn.n version is an unreleased experimental baselevel.
374a6d9b409Smrg	# 1.2 uses "1.2" for uname -r.
37592e95ad1Smrg	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
37692e95ad1Smrg	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
37792e95ad1Smrg	;;
378a6d9b409Smrg    Amiga*:UNIX_System_V:4.0:*)
37992e95ad1Smrg	GUESS=m68k-unknown-sysv4
38092e95ad1Smrg	;;
381a6d9b409Smrg    *:[Aa]miga[Oo][Ss]:*:*)
38292e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-amigaos
38392e95ad1Smrg	;;
384a6d9b409Smrg    *:[Mm]orph[Oo][Ss]:*:*)
38592e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-morphos
38692e95ad1Smrg	;;
387a6d9b409Smrg    *:OS/390:*:*)
38892e95ad1Smrg	GUESS=i370-ibm-openedition
38992e95ad1Smrg	;;
390a6d9b409Smrg    *:z/VM:*:*)
39192e95ad1Smrg	GUESS=s390-ibm-zvmoe
39292e95ad1Smrg	;;
393a6d9b409Smrg    *:OS400:*:*)
39492e95ad1Smrg	GUESS=powerpc-ibm-os400
39592e95ad1Smrg	;;
396a6d9b409Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
39792e95ad1Smrg	GUESS=arm-acorn-riscix$UNAME_RELEASE
39892e95ad1Smrg	;;
399b91640d3Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
40092e95ad1Smrg	GUESS=arm-unknown-riscos
40192e95ad1Smrg	;;
402a6d9b409Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
40392e95ad1Smrg	GUESS=hppa1.1-hitachi-hiuxmpp
40492e95ad1Smrg	;;
405a6d9b409Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
406a6d9b409Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
40792e95ad1Smrg	case `(/bin/universe) 2>/dev/null` in
40892e95ad1Smrg	    att) GUESS=pyramid-pyramid-sysv3 ;;
40992e95ad1Smrg	    *)   GUESS=pyramid-pyramid-bsd   ;;
41092e95ad1Smrg	esac
41192e95ad1Smrg	;;
412a6d9b409Smrg    NILE*:*:*:dcosx)
41392e95ad1Smrg	GUESS=pyramid-pyramid-svr4
41492e95ad1Smrg	;;
415a6d9b409Smrg    DRS?6000:unix:4.0:6*)
41692e95ad1Smrg	GUESS=sparc-icl-nx6
41792e95ad1Smrg	;;
418a6d9b409Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
419a6d9b409Smrg	case `/usr/bin/uname -p` in
42092e95ad1Smrg	    sparc) GUESS=sparc-icl-nx7 ;;
42192e95ad1Smrg	esac
42292e95ad1Smrg	;;
423efda2da8Smrg    s390x:SunOS:*:*)
42492e95ad1Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
42592e95ad1Smrg	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
42692e95ad1Smrg	;;
427a6d9b409Smrg    sun4H:SunOS:5.*:*)
42892e95ad1Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
42992e95ad1Smrg	GUESS=sparc-hal-solaris2$SUN_REL
43092e95ad1Smrg	;;
431a6d9b409Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
43292e95ad1Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
43392e95ad1Smrg	GUESS=sparc-sun-solaris2$SUN_REL
43492e95ad1Smrg	;;
4351e5fa1c5Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
43692e95ad1Smrg	GUESS=i386-pc-auroraux$UNAME_RELEASE
43792e95ad1Smrg	;;
438cae39615Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
43992e95ad1Smrg	set_cc_for_build
44011a95ff3Smrg	SUN_ARCH=i386
441efda2da8Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
442efda2da8Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
443efda2da8Smrg	# This test works for both compilers.
44492e95ad1Smrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
445efda2da8Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
446838f5b0bSmrg		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
447efda2da8Smrg		grep IS_64BIT_ARCH >/dev/null
448efda2da8Smrg	    then
44911a95ff3Smrg		SUN_ARCH=x86_64
450efda2da8Smrg	    fi
451efda2da8Smrg	fi
45292e95ad1Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
45392e95ad1Smrg	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
45492e95ad1Smrg	;;
455a6d9b409Smrg    sun4*:SunOS:6*:*)
456a6d9b409Smrg	# According to config.sub, this is the proper way to canonicalize
457a6d9b409Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
458a6d9b409Smrg	# it's likely to be more like Solaris than SunOS4.
45992e95ad1Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
46092e95ad1Smrg	GUESS=sparc-sun-solaris3$SUN_REL
46192e95ad1Smrg	;;
462a6d9b409Smrg    sun4*:SunOS:*:*)
46392e95ad1Smrg	case `/usr/bin/arch -k` in
464a6d9b409Smrg	    Series*|S4*)
465a6d9b409Smrg		UNAME_RELEASE=`uname -v`
466a6d9b409Smrg		;;
467a6d9b409Smrg	esac
468838f5b0bSmrg	# Japanese Language versions have a version number like '4.1.3-JL'.
46992e95ad1Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
47092e95ad1Smrg	GUESS=sparc-sun-sunos$SUN_REL
47192e95ad1Smrg	;;
472a6d9b409Smrg    sun3*:SunOS:*:*)
47392e95ad1Smrg	GUESS=m68k-sun-sunos$UNAME_RELEASE
47492e95ad1Smrg	;;
475a6d9b409Smrg    sun*:*:4.2BSD:*)
476a6d9b409Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
4778b8e729cSmrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
47892e95ad1Smrg	case `/bin/arch` in
479a6d9b409Smrg	    sun3)
48092e95ad1Smrg		GUESS=m68k-sun-sunos$UNAME_RELEASE
481a6d9b409Smrg		;;
482a6d9b409Smrg	    sun4)
48392e95ad1Smrg		GUESS=sparc-sun-sunos$UNAME_RELEASE
484a6d9b409Smrg		;;
485a6d9b409Smrg	esac
48692e95ad1Smrg	;;
487a6d9b409Smrg    aushp:SunOS:*:*)
48892e95ad1Smrg	GUESS=sparc-auspex-sunos$UNAME_RELEASE
48992e95ad1Smrg	;;
490a6d9b409Smrg    # The situation for MiNT is a little confusing.  The machine name
491a6d9b409Smrg    # can be virtually everything (everything which is not
492a6d9b409Smrg    # "atarist" or "atariste" at least should have a processor
493a6d9b409Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
494a6d9b409Smrg    # to the lowercase version "mint" (or "freemint").  Finally
495a6d9b409Smrg    # the system name "TOS" denotes a system which is actually not
496a6d9b409Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
497a6d9b409Smrg    # be no problem.
498a6d9b409Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
49992e95ad1Smrg	GUESS=m68k-atari-mint$UNAME_RELEASE
50092e95ad1Smrg	;;
501a6d9b409Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
50292e95ad1Smrg	GUESS=m68k-atari-mint$UNAME_RELEASE
50392e95ad1Smrg	;;
504a6d9b409Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
50592e95ad1Smrg	GUESS=m68k-atari-mint$UNAME_RELEASE
50692e95ad1Smrg	;;
507a6d9b409Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
50892e95ad1Smrg	GUESS=m68k-milan-mint$UNAME_RELEASE
50992e95ad1Smrg	;;
510a6d9b409Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
51192e95ad1Smrg	GUESS=m68k-hades-mint$UNAME_RELEASE
51292e95ad1Smrg	;;
513a6d9b409Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
51492e95ad1Smrg	GUESS=m68k-unknown-mint$UNAME_RELEASE
51592e95ad1Smrg	;;
516a6d9b409Smrg    m68k:machten:*:*)
51792e95ad1Smrg	GUESS=m68k-apple-machten$UNAME_RELEASE
51892e95ad1Smrg	;;
519a6d9b409Smrg    powerpc:machten:*:*)
52092e95ad1Smrg	GUESS=powerpc-apple-machten$UNAME_RELEASE
52192e95ad1Smrg	;;
522a6d9b409Smrg    RISC*:Mach:*:*)
52392e95ad1Smrg	GUESS=mips-dec-mach_bsd4.3
52492e95ad1Smrg	;;
525a6d9b409Smrg    RISC*:ULTRIX:*:*)
52692e95ad1Smrg	GUESS=mips-dec-ultrix$UNAME_RELEASE
52792e95ad1Smrg	;;
528a6d9b409Smrg    VAX*:ULTRIX*:*:*)
52992e95ad1Smrg	GUESS=vax-dec-ultrix$UNAME_RELEASE
53092e95ad1Smrg	;;
531a6d9b409Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
53292e95ad1Smrg	GUESS=clipper-intergraph-clix$UNAME_RELEASE
53392e95ad1Smrg	;;
534a6d9b409Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
53592e95ad1Smrg	set_cc_for_build
5368b8e729cSmrg	sed 's/^	//' << EOF > "$dummy.c"
537a6d9b409Smrg#ifdef __cplusplus
538a6d9b409Smrg#include <stdio.h>  /* for printf() prototype */
539a6d9b409Smrg	int main (int argc, char *argv[]) {
540a6d9b409Smrg#else
541a6d9b409Smrg	int main (argc, argv) int argc; char *argv[]; {
542a6d9b409Smrg#endif
543a6d9b409Smrg	#if defined (host_mips) && defined (MIPSEB)
544a6d9b409Smrg	#if defined (SYSTYPE_SYSV)
5458b8e729cSmrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
546a6d9b409Smrg	#endif
547a6d9b409Smrg	#if defined (SYSTYPE_SVR4)
5488b8e729cSmrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
549a6d9b409Smrg	#endif
550a6d9b409Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
5518b8e729cSmrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
552a6d9b409Smrg	#endif
553a6d9b409Smrg	#endif
554a6d9b409Smrg	  exit (-1);
555a6d9b409Smrg	}
556a6d9b409SmrgEOF
5578b8e729cSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
5588b8e729cSmrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
5598b8e729cSmrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
560a6d9b409Smrg	    { echo "$SYSTEM_NAME"; exit; }
56192e95ad1Smrg	GUESS=mips-mips-riscos$UNAME_RELEASE
56292e95ad1Smrg	;;
563a6d9b409Smrg    Motorola:PowerMAX_OS:*:*)
56492e95ad1Smrg	GUESS=powerpc-motorola-powermax
56592e95ad1Smrg	;;
566a6d9b409Smrg    Motorola:*:4.3:PL8-*)
56792e95ad1Smrg	GUESS=powerpc-harris-powermax
56892e95ad1Smrg	;;
569a6d9b409Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
57092e95ad1Smrg	GUESS=powerpc-harris-powermax
57192e95ad1Smrg	;;
572a6d9b409Smrg    Night_Hawk:Power_UNIX:*:*)
57392e95ad1Smrg	GUESS=powerpc-harris-powerunix
57492e95ad1Smrg	;;
575a6d9b409Smrg    m88k:CX/UX:7*:*)
57692e95ad1Smrg	GUESS=m88k-harris-cxux7
57792e95ad1Smrg	;;
578a6d9b409Smrg    m88k:*:4*:R4*)
57992e95ad1Smrg	GUESS=m88k-motorola-sysv4
58092e95ad1Smrg	;;
581a6d9b409Smrg    m88k:*:3*:R3*)
58292e95ad1Smrg	GUESS=m88k-motorola-sysv3
58392e95ad1Smrg	;;
584a6d9b409Smrg    AViiON:dgux:*:*)
585a097bd00Smrg	# DG/UX returns AViiON for all architectures
586a097bd00Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
58792e95ad1Smrg	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
588a6d9b409Smrg	then
58992e95ad1Smrg	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
59092e95ad1Smrg	       test "$TARGET_BINARY_INTERFACE"x = x
591a6d9b409Smrg	    then
59292e95ad1Smrg		GUESS=m88k-dg-dgux$UNAME_RELEASE
593a6d9b409Smrg	    else
59492e95ad1Smrg		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
595a6d9b409Smrg	    fi
596a6d9b409Smrg	else
59792e95ad1Smrg	    GUESS=i586-dg-dgux$UNAME_RELEASE
598a6d9b409Smrg	fi
59992e95ad1Smrg	;;
600a6d9b409Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
60192e95ad1Smrg	GUESS=m88k-dolphin-sysv3
60292e95ad1Smrg	;;
603a6d9b409Smrg    M88*:*:R3*:*)
604a6d9b409Smrg	# Delta 88k system running SVR3
60592e95ad1Smrg	GUESS=m88k-motorola-sysv3
60692e95ad1Smrg	;;
607a6d9b409Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
60892e95ad1Smrg	GUESS=m88k-tektronix-sysv3
60992e95ad1Smrg	;;
610a6d9b409Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
61192e95ad1Smrg	GUESS=m68k-tektronix-bsd
61292e95ad1Smrg	;;
613a6d9b409Smrg    *:IRIX*:*:*)
61492e95ad1Smrg	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
61592e95ad1Smrg	GUESS=mips-sgi-irix$IRIX_REL
61692e95ad1Smrg	;;
617a6d9b409Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
61892e95ad1Smrg	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
61992e95ad1Smrg	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
620a6d9b409Smrg    i*86:AIX:*:*)
62192e95ad1Smrg	GUESS=i386-ibm-aix
62292e95ad1Smrg	;;
623a6d9b409Smrg    ia64:AIX:*:*)
62492e95ad1Smrg	if test -x /usr/bin/oslevel ; then
625a6d9b409Smrg		IBM_REV=`/usr/bin/oslevel`
626a6d9b409Smrg	else
62792e95ad1Smrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
628a6d9b409Smrg	fi
62992e95ad1Smrg	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
63092e95ad1Smrg	;;
631a6d9b409Smrg    *:AIX:2:3)
632a6d9b409Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
63392e95ad1Smrg		set_cc_for_build
6348b8e729cSmrg		sed 's/^		//' << EOF > "$dummy.c"
635a6d9b409Smrg		#include <sys/systemcfg.h>
636a6d9b409Smrg
637a6d9b409Smrg		main()
638a6d9b409Smrg			{
639a6d9b409Smrg			if (!__power_pc())
640a6d9b409Smrg				exit(1);
641a6d9b409Smrg			puts("powerpc-ibm-aix3.2.5");
642a6d9b409Smrg			exit(0);
643a6d9b409Smrg			}
644a6d9b409SmrgEOF
6458b8e729cSmrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
646a6d9b409Smrg		then
64792e95ad1Smrg			GUESS=$SYSTEM_NAME
648a6d9b409Smrg		else
64992e95ad1Smrg			GUESS=rs6000-ibm-aix3.2.5
650a6d9b409Smrg		fi
651a6d9b409Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
65292e95ad1Smrg		GUESS=rs6000-ibm-aix3.2.4
653a6d9b409Smrg	else
65492e95ad1Smrg		GUESS=rs6000-ibm-aix3.2
655a6d9b409Smrg	fi
65692e95ad1Smrg	;;
657a097bd00Smrg    *:AIX:*:[4567])
658a6d9b409Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
6598b8e729cSmrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
660a6d9b409Smrg		IBM_ARCH=rs6000
661a6d9b409Smrg	else
662a6d9b409Smrg		IBM_ARCH=powerpc
663a6d9b409Smrg	fi
66492e95ad1Smrg	if test -x /usr/bin/lslpp ; then
66592e95ad1Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
666b91640d3Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
667a6d9b409Smrg	else
66892e95ad1Smrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
669a6d9b409Smrg	fi
67092e95ad1Smrg	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
67192e95ad1Smrg	;;
672a6d9b409Smrg    *:AIX:*:*)
67392e95ad1Smrg	GUESS=rs6000-ibm-aix
67492e95ad1Smrg	;;
6758b8e729cSmrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
67692e95ad1Smrg	GUESS=romp-ibm-bsd4.4
67792e95ad1Smrg	;;
678a6d9b409Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
67992e95ad1Smrg	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
68092e95ad1Smrg	;;                                  # report: romp-ibm BSD 4.3
681a6d9b409Smrg    *:BOSX:*:*)
68292e95ad1Smrg	GUESS=rs6000-bull-bosx
68392e95ad1Smrg	;;
684a6d9b409Smrg    DPX/2?00:B.O.S.:*:*)
68592e95ad1Smrg	GUESS=m68k-bull-sysv3
68692e95ad1Smrg	;;
687a6d9b409Smrg    9000/[34]??:4.3bsd:1.*:*)
68892e95ad1Smrg	GUESS=m68k-hp-bsd
68992e95ad1Smrg	;;
690a6d9b409Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
69192e95ad1Smrg	GUESS=m68k-hp-bsd4.4
69292e95ad1Smrg	;;
693a6d9b409Smrg    9000/[34678]??:HP-UX:*:*)
69492e95ad1Smrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
69592e95ad1Smrg	case $UNAME_MACHINE in
6968b8e729cSmrg	    9000/31?)            HP_ARCH=m68000 ;;
6978b8e729cSmrg	    9000/[34]??)         HP_ARCH=m68k ;;
698a6d9b409Smrg	    9000/[678][0-9][0-9])
69992e95ad1Smrg		if test -x /usr/bin/getconf; then
700a6d9b409Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
701a097bd00Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
70292e95ad1Smrg		    case $sc_cpu_version in
70311a95ff3Smrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
70411a95ff3Smrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
705a097bd00Smrg		      532)                      # CPU_PA_RISC2_0
70692e95ad1Smrg			case $sc_kernel_bits in
70711a95ff3Smrg			  32) HP_ARCH=hppa2.0n ;;
70811a95ff3Smrg			  64) HP_ARCH=hppa2.0w ;;
70911a95ff3Smrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
710a097bd00Smrg			esac ;;
711a097bd00Smrg		    esac
712a6d9b409Smrg		fi
71392e95ad1Smrg		if test "$HP_ARCH" = ""; then
71492e95ad1Smrg		    set_cc_for_build
7158b8e729cSmrg		    sed 's/^		//' << EOF > "$dummy.c"
716a6d9b409Smrg
717a097bd00Smrg		#define _HPUX_SOURCE
718a097bd00Smrg		#include <stdlib.h>
719a097bd00Smrg		#include <unistd.h>
720a6d9b409Smrg
721a097bd00Smrg		int main ()
722a097bd00Smrg		{
723a097bd00Smrg		#if defined(_SC_KERNEL_BITS)
724a097bd00Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
725a097bd00Smrg		#endif
726a097bd00Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
727a6d9b409Smrg
728a097bd00Smrg		    switch (cpu)
729a097bd00Smrg			{
730a097bd00Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
731a097bd00Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
732a097bd00Smrg			case CPU_PA_RISC2_0:
733a097bd00Smrg		#if defined(_SC_KERNEL_BITS)
734a097bd00Smrg			    switch (bits)
735a097bd00Smrg				{
736a097bd00Smrg				case 64: puts ("hppa2.0w"); break;
737a097bd00Smrg				case 32: puts ("hppa2.0n"); break;
738a097bd00Smrg				default: puts ("hppa2.0"); break;
739a097bd00Smrg				} break;
740a097bd00Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
741a097bd00Smrg			    puts ("hppa2.0"); break;
742a097bd00Smrg		#endif
743a097bd00Smrg			default: puts ("hppa1.0"); break;
744a097bd00Smrg			}
745a097bd00Smrg		    exit (0);
746a097bd00Smrg		}
747a6d9b409SmrgEOF
7488b8e729cSmrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
749a6d9b409Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
750a6d9b409Smrg		fi ;;
751a6d9b409Smrg	esac
75292e95ad1Smrg	if test "$HP_ARCH" = hppa2.0w
753a6d9b409Smrg	then
75492e95ad1Smrg	    set_cc_for_build
755a6d9b409Smrg
756a6d9b409Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
757a6d9b409Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
758a6d9b409Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
759a6d9b409Smrg	    #
760a6d9b409Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
761a6d9b409Smrg	    # => hppa2.0w-hp-hpux11.23
762a6d9b409Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
763a6d9b409Smrg	    # => hppa64-hp-hpux11.23
764a6d9b409Smrg
76511a95ff3Smrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
7661e5fa1c5Smrg		grep -q __LP64__
767a6d9b409Smrg	    then
76811a95ff3Smrg		HP_ARCH=hppa2.0w
769a6d9b409Smrg	    else
77011a95ff3Smrg		HP_ARCH=hppa64
771a6d9b409Smrg	    fi
772a6d9b409Smrg	fi
77392e95ad1Smrg	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
77492e95ad1Smrg	;;
775a6d9b409Smrg    ia64:HP-UX:*:*)
77692e95ad1Smrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
77792e95ad1Smrg	GUESS=ia64-hp-hpux$HPUX_REV
77892e95ad1Smrg	;;
779a6d9b409Smrg    3050*:HI-UX:*:*)
78092e95ad1Smrg	set_cc_for_build
7818b8e729cSmrg	sed 's/^	//' << EOF > "$dummy.c"
782a6d9b409Smrg	#include <unistd.h>
783a6d9b409Smrg	int
784a6d9b409Smrg	main ()
785a6d9b409Smrg	{
786a6d9b409Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
787a6d9b409Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
788a6d9b409Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
789a6d9b409Smrg	     results, however.  */
790a6d9b409Smrg	  if (CPU_IS_PA_RISC (cpu))
791a6d9b409Smrg	    {
792a6d9b409Smrg	      switch (cpu)
793a6d9b409Smrg		{
794a6d9b409Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
795a6d9b409Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
796a6d9b409Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
797a6d9b409Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
798a6d9b409Smrg		}
799a6d9b409Smrg	    }
800a6d9b409Smrg	  else if (CPU_IS_HP_MC68K (cpu))
801a6d9b409Smrg	    puts ("m68k-hitachi-hiuxwe2");
802a6d9b409Smrg	  else puts ("unknown-hitachi-hiuxwe2");
803a6d9b409Smrg	  exit (0);
804a6d9b409Smrg	}
805a6d9b409SmrgEOF
8068b8e729cSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
807a6d9b409Smrg		{ echo "$SYSTEM_NAME"; exit; }
80892e95ad1Smrg	GUESS=unknown-hitachi-hiuxwe2
80992e95ad1Smrg	;;
8108b8e729cSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
81192e95ad1Smrg	GUESS=hppa1.1-hp-bsd
81292e95ad1Smrg	;;
813a6d9b409Smrg    9000/8??:4.3bsd:*:*)
81492e95ad1Smrg	GUESS=hppa1.0-hp-bsd
81592e95ad1Smrg	;;
816a6d9b409Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
81792e95ad1Smrg	GUESS=hppa1.0-hp-mpeix
81892e95ad1Smrg	;;
8198b8e729cSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
82092e95ad1Smrg	GUESS=hppa1.1-hp-osf
82192e95ad1Smrg	;;
822a6d9b409Smrg    hp8??:OSF1:*:*)
82392e95ad1Smrg	GUESS=hppa1.0-hp-osf
82492e95ad1Smrg	;;
825a6d9b409Smrg    i*86:OSF1:*:*)
82692e95ad1Smrg	if test -x /usr/sbin/sysversion ; then
82792e95ad1Smrg	    GUESS=$UNAME_MACHINE-unknown-osf1mk
828a6d9b409Smrg	else
82992e95ad1Smrg	    GUESS=$UNAME_MACHINE-unknown-osf1
830a6d9b409Smrg	fi
83192e95ad1Smrg	;;
832a6d9b409Smrg    parisc*:Lites*:*:*)
83392e95ad1Smrg	GUESS=hppa1.1-hp-lites
83492e95ad1Smrg	;;
835a6d9b409Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
83692e95ad1Smrg	GUESS=c1-convex-bsd
83792e95ad1Smrg	;;
838a6d9b409Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
839a6d9b409Smrg	if getsysinfo -f scalar_acc
840a6d9b409Smrg	then echo c32-convex-bsd
841a6d9b409Smrg	else echo c2-convex-bsd
842a6d9b409Smrg	fi
843a097bd00Smrg	exit ;;
844a6d9b409Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
84592e95ad1Smrg	GUESS=c34-convex-bsd
84692e95ad1Smrg	;;
847a6d9b409Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
84892e95ad1Smrg	GUESS=c38-convex-bsd
84992e95ad1Smrg	;;
850a6d9b409Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
85192e95ad1Smrg	GUESS=c4-convex-bsd
85292e95ad1Smrg	;;
853a6d9b409Smrg    CRAY*Y-MP:*:*:*)
85492e95ad1Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
85592e95ad1Smrg	GUESS=ymp-cray-unicos$CRAY_REL
85692e95ad1Smrg	;;
857a6d9b409Smrg    CRAY*[A-Z]90:*:*:*)
8588b8e729cSmrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
859a6d9b409Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
860a6d9b409Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
861a6d9b409Smrg	      -e 's/\.[^.]*$/.X/'
862a6d9b409Smrg	exit ;;
863a6d9b409Smrg    CRAY*TS:*:*:*)
86492e95ad1Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
86592e95ad1Smrg	GUESS=t90-cray-unicos$CRAY_REL
86692e95ad1Smrg	;;
867a6d9b409Smrg    CRAY*T3E:*:*:*)
86892e95ad1Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
86992e95ad1Smrg	GUESS=alphaev5-cray-unicosmk$CRAY_REL
87092e95ad1Smrg	;;
871a6d9b409Smrg    CRAY*SV1:*:*:*)
87292e95ad1Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
87392e95ad1Smrg	GUESS=sv1-cray-unicos$CRAY_REL
87492e95ad1Smrg	;;
875a6d9b409Smrg    *:UNICOS/mp:*:*)
87692e95ad1Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
87792e95ad1Smrg	GUESS=craynv-cray-unicosmp$CRAY_REL
87892e95ad1Smrg	;;
879a6d9b409Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
88011a95ff3Smrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
88111a95ff3Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
8828b8e729cSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
88392e95ad1Smrg	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
88492e95ad1Smrg	;;
885a6d9b409Smrg    5000:UNIX_System_V:4.*:*)
88611a95ff3Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
8878b8e729cSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
88892e95ad1Smrg	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
88992e95ad1Smrg	;;
890a6d9b409Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
89192e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
89292e95ad1Smrg	;;
893a6d9b409Smrg    sparc*:BSD/OS:*:*)
89492e95ad1Smrg	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
89592e95ad1Smrg	;;
896a6d9b409Smrg    *:BSD/OS:*:*)
89792e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
89892e95ad1Smrg	;;
89992e95ad1Smrg    arm:FreeBSD:*:*)
90092e95ad1Smrg	UNAME_PROCESSOR=`uname -p`
90192e95ad1Smrg	set_cc_for_build
90292e95ad1Smrg	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
90392e95ad1Smrg	    | grep -q __ARM_PCS_VFP
90492e95ad1Smrg	then
90592e95ad1Smrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
90692e95ad1Smrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
90792e95ad1Smrg	else
90892e95ad1Smrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
90992e95ad1Smrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
91092e95ad1Smrg	fi
91192e95ad1Smrg	;;
912a6d9b409Smrg    *:FreeBSD:*:*)
913838f5b0bSmrg	UNAME_PROCESSOR=`uname -p`
91492e95ad1Smrg	case $UNAME_PROCESSOR in
915cae39615Smrg	    amd64)
9168b8e729cSmrg		UNAME_PROCESSOR=x86_64 ;;
9178b8e729cSmrg	    i386)
9188b8e729cSmrg		UNAME_PROCESSOR=i586 ;;
919cae39615Smrg	esac
92092e95ad1Smrg	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
92192e95ad1Smrg	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
92292e95ad1Smrg	;;
923a6d9b409Smrg    i*:CYGWIN*:*)
92492e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-cygwin
92592e95ad1Smrg	;;
926b91640d3Smrg    *:MINGW64*:*)
92792e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-mingw64
92892e95ad1Smrg	;;
929cae39615Smrg    *:MINGW*:*)
93092e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-mingw32
93192e95ad1Smrg	;;
932b91640d3Smrg    *:MSYS*:*)
93392e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-msys
93492e95ad1Smrg	;;
935a6d9b409Smrg    i*:PW*:*)
93692e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-pw32
93792e95ad1Smrg	;;
938838f5b0bSmrg    *:SerenityOS:*:*)
939838f5b0bSmrg        GUESS=$UNAME_MACHINE-pc-serenity
940838f5b0bSmrg        ;;
9411e5fa1c5Smrg    *:Interix*:*)
94292e95ad1Smrg	case $UNAME_MACHINE in
943cae39615Smrg	    x86)
94492e95ad1Smrg		GUESS=i586-pc-interix$UNAME_RELEASE
94592e95ad1Smrg		;;
9461e5fa1c5Smrg	    authenticamd | genuineintel | EM64T)
94792e95ad1Smrg		GUESS=x86_64-unknown-interix$UNAME_RELEASE
94892e95ad1Smrg		;;
949cae39615Smrg	    IA64)
95092e95ad1Smrg		GUESS=ia64-unknown-interix$UNAME_RELEASE
95192e95ad1Smrg		;;
952cae39615Smrg	esac ;;
953a6d9b409Smrg    i*:UWIN*:*)
95492e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-uwin
95592e95ad1Smrg	;;
956cae39615Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
95792e95ad1Smrg	GUESS=x86_64-pc-cygwin
95892e95ad1Smrg	;;
959a6d9b409Smrg    prep*:SunOS:5.*:*)
96092e95ad1Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
96192e95ad1Smrg	GUESS=powerpcle-unknown-solaris2$SUN_REL
96292e95ad1Smrg	;;
963a6d9b409Smrg    *:GNU:*:*)
964a6d9b409Smrg	# the GNU system
96592e95ad1Smrg	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
96692e95ad1Smrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
96792e95ad1Smrg	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
96892e95ad1Smrg	;;
969a6d9b409Smrg    *:GNU/*:*:*)
970a6d9b409Smrg	# other systems with GNU libc and userland
97192e95ad1Smrg	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
97292e95ad1Smrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
97392e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
97492e95ad1Smrg	;;
975838f5b0bSmrg    x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
976838f5b0bSmrg	GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
977838f5b0bSmrg	;;
978838f5b0bSmrg    *:[Mm]anagarm:*:*)
979838f5b0bSmrg	GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
980838f5b0bSmrg	;;
98192e95ad1Smrg    *:Minix:*:*)
98292e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-minix
98392e95ad1Smrg	;;
984b91640d3Smrg    aarch64:Linux:*:*)
985838f5b0bSmrg	set_cc_for_build
986838f5b0bSmrg	CPU=$UNAME_MACHINE
987838f5b0bSmrg	LIBCABI=$LIBC
988838f5b0bSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
989838f5b0bSmrg	    ABI=64
990838f5b0bSmrg	    sed 's/^	    //' << EOF > "$dummy.c"
991838f5b0bSmrg	    #ifdef __ARM_EABI__
992838f5b0bSmrg	    #ifdef __ARM_PCS_VFP
993838f5b0bSmrg	    ABI=eabihf
994838f5b0bSmrg	    #else
995838f5b0bSmrg	    ABI=eabi
996838f5b0bSmrg	    #endif
997838f5b0bSmrg	    #endif
998838f5b0bSmrgEOF
999838f5b0bSmrg	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1000838f5b0bSmrg	    eval "$cc_set_abi"
1001838f5b0bSmrg	    case $ABI in
1002838f5b0bSmrg		eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
1003838f5b0bSmrg	    esac
1004838f5b0bSmrg	fi
1005838f5b0bSmrg	GUESS=$CPU-unknown-linux-$LIBCABI
100692e95ad1Smrg	;;
1007b91640d3Smrg    aarch64_be:Linux:*:*)
1008b91640d3Smrg	UNAME_MACHINE=aarch64_be
100992e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
101092e95ad1Smrg	;;
10111e5fa1c5Smrg    alpha:Linux:*:*)
101292e95ad1Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
10131e5fa1c5Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
10141e5fa1c5Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
10151e5fa1c5Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
10161e5fa1c5Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
10171e5fa1c5Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
10181e5fa1c5Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
10191e5fa1c5Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
1020a097bd00Smrg	esac
10211e5fa1c5Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
102211a95ff3Smrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
102392e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
102492e95ad1Smrg	;;
102592e95ad1Smrg    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
102692e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
102792e95ad1Smrg	;;
1028a6d9b409Smrg    arm*:Linux:*:*)
102992e95ad1Smrg	set_cc_for_build
1030cae39615Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
1031cae39615Smrg	    | grep -q __ARM_EABI__
1032cae39615Smrg	then
103392e95ad1Smrg	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1034cae39615Smrg	else
1035a097bd00Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
1036a097bd00Smrg		| grep -q __ARM_PCS_VFP
1037a097bd00Smrg	    then
103892e95ad1Smrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
1039a097bd00Smrg	    else
104092e95ad1Smrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
1041a097bd00Smrg	    fi
1042cae39615Smrg	fi
104392e95ad1Smrg	;;
1044cae39615Smrg    avr32*:Linux:*:*)
104592e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
104692e95ad1Smrg	;;
1047a6d9b409Smrg    cris:Linux:*:*)
104892e95ad1Smrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
104992e95ad1Smrg	;;
1050a6d9b409Smrg    crisv32:Linux:*:*)
105192e95ad1Smrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
105292e95ad1Smrg	;;
105311a95ff3Smrg    e2k:Linux:*:*)
105492e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
105592e95ad1Smrg	;;
1056a6d9b409Smrg    frv:Linux:*:*)
105792e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
105892e95ad1Smrg	;;
1059a097bd00Smrg    hexagon:Linux:*:*)
106092e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
106192e95ad1Smrg	;;
10621e5fa1c5Smrg    i*86:Linux:*:*)
106392e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
106492e95ad1Smrg	;;
1065a6d9b409Smrg    ia64:Linux:*:*)
106692e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
106792e95ad1Smrg	;;
106811a95ff3Smrg    k1om:Linux:*:*)
106992e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
107092e95ad1Smrg	;;
1071838f5b0bSmrg    kvx:Linux:*:*)
1072838f5b0bSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1073838f5b0bSmrg	;;
1074838f5b0bSmrg    kvx:cos:*:*)
1075838f5b0bSmrg	GUESS=$UNAME_MACHINE-unknown-cos
1076838f5b0bSmrg	;;
1077838f5b0bSmrg    kvx:mbr:*:*)
1078838f5b0bSmrg	GUESS=$UNAME_MACHINE-unknown-mbr
1079838f5b0bSmrg	;;
1080838f5b0bSmrg    loongarch32:Linux:*:* | loongarch64:Linux:*:*)
108192e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
108292e95ad1Smrg	;;
1083a6d9b409Smrg    m32r*:Linux:*:*)
108492e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
108592e95ad1Smrg	;;
1086a6d9b409Smrg    m68*:Linux:*:*)
108792e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
108892e95ad1Smrg	;;
10891e5fa1c5Smrg    mips:Linux:*:* | mips64:Linux:*:*)
109092e95ad1Smrg	set_cc_for_build
109192e95ad1Smrg	IS_GLIBC=0
109292e95ad1Smrg	test x"${LIBC}" = xgnu && IS_GLIBC=1
10938b8e729cSmrg	sed 's/^	//' << EOF > "$dummy.c"
1094a6d9b409Smrg	#undef CPU
109592e95ad1Smrg	#undef mips
109692e95ad1Smrg	#undef mipsel
109792e95ad1Smrg	#undef mips64
109892e95ad1Smrg	#undef mips64el
109992e95ad1Smrg	#if ${IS_GLIBC} && defined(_ABI64)
110092e95ad1Smrg	LIBCABI=gnuabi64
110192e95ad1Smrg	#else
110292e95ad1Smrg	#if ${IS_GLIBC} && defined(_ABIN32)
110392e95ad1Smrg	LIBCABI=gnuabin32
110492e95ad1Smrg	#else
110592e95ad1Smrg	LIBCABI=${LIBC}
110692e95ad1Smrg	#endif
110792e95ad1Smrg	#endif
110892e95ad1Smrg
110992e95ad1Smrg	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
111092e95ad1Smrg	CPU=mipsisa64r6
111192e95ad1Smrg	#else
111292e95ad1Smrg	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
111392e95ad1Smrg	CPU=mipsisa32r6
111492e95ad1Smrg	#else
111592e95ad1Smrg	#if defined(__mips64)
111692e95ad1Smrg	CPU=mips64
111792e95ad1Smrg	#else
111892e95ad1Smrg	CPU=mips
111992e95ad1Smrg	#endif
112092e95ad1Smrg	#endif
112192e95ad1Smrg	#endif
112292e95ad1Smrg
1123a6d9b409Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
112492e95ad1Smrg	MIPS_ENDIAN=el
1125a6d9b409Smrg	#else
1126a6d9b409Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
112792e95ad1Smrg	MIPS_ENDIAN=
1128a6d9b409Smrg	#else
112992e95ad1Smrg	MIPS_ENDIAN=
1130a6d9b409Smrg	#endif
1131a6d9b409Smrg	#endif
1132a6d9b409SmrgEOF
113392e95ad1Smrg	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
113492e95ad1Smrg	eval "$cc_set_vars"
113592e95ad1Smrg	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1136a6d9b409Smrg	;;
11378b8e729cSmrg    mips64el:Linux:*:*)
113892e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
113992e95ad1Smrg	;;
1140b91640d3Smrg    openrisc*:Linux:*:*)
114192e95ad1Smrg	GUESS=or1k-unknown-linux-$LIBC
114292e95ad1Smrg	;;
1143b91640d3Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
114492e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
114592e95ad1Smrg	;;
1146efda2da8Smrg    padre:Linux:*:*)
114792e95ad1Smrg	GUESS=sparc-unknown-linux-$LIBC
114892e95ad1Smrg	;;
11491e5fa1c5Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
115092e95ad1Smrg	GUESS=hppa64-unknown-linux-$LIBC
115192e95ad1Smrg	;;
1152a6d9b409Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
1153a6d9b409Smrg	# Look for CPU level
1154a6d9b409Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
115592e95ad1Smrg	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
115692e95ad1Smrg	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
115792e95ad1Smrg	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
1158a6d9b409Smrg	esac
115992e95ad1Smrg	;;
11601e5fa1c5Smrg    ppc64:Linux:*:*)
116192e95ad1Smrg	GUESS=powerpc64-unknown-linux-$LIBC
116292e95ad1Smrg	;;
11631e5fa1c5Smrg    ppc:Linux:*:*)
116492e95ad1Smrg	GUESS=powerpc-unknown-linux-$LIBC
116592e95ad1Smrg	;;
1166b91640d3Smrg    ppc64le:Linux:*:*)
116792e95ad1Smrg	GUESS=powerpc64le-unknown-linux-$LIBC
116892e95ad1Smrg	;;
1169b91640d3Smrg    ppcle:Linux:*:*)
117092e95ad1Smrg	GUESS=powerpcle-unknown-linux-$LIBC
117192e95ad1Smrg	;;
117292e95ad1Smrg    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
117392e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
117492e95ad1Smrg	;;
1175a6d9b409Smrg    s390:Linux:*:* | s390x:Linux:*:*)
117692e95ad1Smrg	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
117792e95ad1Smrg	;;
1178a6d9b409Smrg    sh64*:Linux:*:*)
117992e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
118092e95ad1Smrg	;;
1181a6d9b409Smrg    sh*:Linux:*:*)
118292e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
118392e95ad1Smrg	;;
1184a6d9b409Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
118592e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
118692e95ad1Smrg	;;
1187a097bd00Smrg    tile*:Linux:*:*)
118892e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
118992e95ad1Smrg	;;
1190cae39615Smrg    vax:Linux:*:*)
119192e95ad1Smrg	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
119292e95ad1Smrg	;;
1193a6d9b409Smrg    x86_64:Linux:*:*)
119492e95ad1Smrg	set_cc_for_build
1195838f5b0bSmrg	CPU=$UNAME_MACHINE
119692e95ad1Smrg	LIBCABI=$LIBC
119792e95ad1Smrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
1198838f5b0bSmrg	    ABI=64
1199838f5b0bSmrg	    sed 's/^	    //' << EOF > "$dummy.c"
1200838f5b0bSmrg	    #ifdef __i386__
1201838f5b0bSmrg	    ABI=x86
1202838f5b0bSmrg	    #else
1203838f5b0bSmrg	    #ifdef __ILP32__
1204838f5b0bSmrg	    ABI=x32
1205838f5b0bSmrg	    #endif
1206838f5b0bSmrg	    #endif
1207838f5b0bSmrgEOF
1208838f5b0bSmrg	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1209838f5b0bSmrg	    eval "$cc_set_abi"
1210838f5b0bSmrg	    case $ABI in
1211838f5b0bSmrg		x86) CPU=i686 ;;
1212838f5b0bSmrg		x32) LIBCABI=${LIBC}x32 ;;
1213838f5b0bSmrg	    esac
121492e95ad1Smrg	fi
1215838f5b0bSmrg	GUESS=$CPU-pc-linux-$LIBCABI
121692e95ad1Smrg	;;
1217cae39615Smrg    xtensa*:Linux:*:*)
121892e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
121992e95ad1Smrg	;;
1220a6d9b409Smrg    i*86:DYNIX/ptx:4*:*)
1221a6d9b409Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1222a6d9b409Smrg	# earlier versions are messed up and put the nodename in both
1223a6d9b409Smrg	# sysname and nodename.
122492e95ad1Smrg	GUESS=i386-sequent-sysv4
122592e95ad1Smrg	;;
1226a6d9b409Smrg    i*86:UNIX_SV:4.2MP:2.*)
1227a097bd00Smrg	# Unixware is an offshoot of SVR4, but it has its own version
1228a097bd00Smrg	# number series starting with 2...
1229a097bd00Smrg	# I am not positive that other SVR4 systems won't match this,
1230a6d9b409Smrg	# I just have to hope.  -- rms.
1231a097bd00Smrg	# Use sysv4.2uw... so that sysv4* matches it.
123292e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
123392e95ad1Smrg	;;
1234a6d9b409Smrg    i*86:OS/2:*:*)
1235838f5b0bSmrg	# If we were able to find 'uname', then EMX Unix compatibility
1236a6d9b409Smrg	# is probably installed.
123792e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-os2-emx
123892e95ad1Smrg	;;
1239a6d9b409Smrg    i*86:XTS-300:*:STOP)
124092e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-stop
124192e95ad1Smrg	;;
1242a6d9b409Smrg    i*86:atheos:*:*)
124392e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-atheos
124492e95ad1Smrg	;;
1245a6d9b409Smrg    i*86:syllable:*:*)
124692e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-syllable
124792e95ad1Smrg	;;
12481e5fa1c5Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
124992e95ad1Smrg	GUESS=i386-unknown-lynxos$UNAME_RELEASE
125092e95ad1Smrg	;;
1251a6d9b409Smrg    i*86:*DOS:*:*)
125292e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
125392e95ad1Smrg	;;
12548b8e729cSmrg    i*86:*:4.*:*)
12558b8e729cSmrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1256a6d9b409Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
125792e95ad1Smrg		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
1258a6d9b409Smrg	else
125992e95ad1Smrg		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
1260a6d9b409Smrg	fi
126192e95ad1Smrg	;;
1262a6d9b409Smrg    i*86:*:5:[678]*)
1263a097bd00Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1264a6d9b409Smrg	case `/bin/uname -X | grep "^Machine"` in
1265a6d9b409Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
1266a6d9b409Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1267a6d9b409Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1268a6d9b409Smrg	esac
126992e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
127092e95ad1Smrg	;;
1271a6d9b409Smrg    i*86:*:3.2:*)
1272a6d9b409Smrg	if test -f /usr/options/cb.name; then
1273a6d9b409Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
127492e95ad1Smrg		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
1275a6d9b409Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1276a6d9b409Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1277a6d9b409Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1278a6d9b409Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1279a6d9b409Smrg			&& UNAME_MACHINE=i586
1280a6d9b409Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1281a6d9b409Smrg			&& UNAME_MACHINE=i686
1282a6d9b409Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1283a6d9b409Smrg			&& UNAME_MACHINE=i686
128492e95ad1Smrg		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
1285a6d9b409Smrg	else
128692e95ad1Smrg		GUESS=$UNAME_MACHINE-pc-sysv32
1287a6d9b409Smrg	fi
128892e95ad1Smrg	;;
1289a6d9b409Smrg    pc:*:*:*)
1290a6d9b409Smrg	# Left here for compatibility:
1291a097bd00Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1292a097bd00Smrg	# the processor, so we play safe by assuming i586.
1293efda2da8Smrg	# Note: whatever this is, it MUST be the same as what config.sub
129411a95ff3Smrg	# prints for the "djgpp" host, or else GDB configure will decide that
1295efda2da8Smrg	# this is a cross-build.
129692e95ad1Smrg	GUESS=i586-pc-msdosdjgpp
129792e95ad1Smrg	;;
1298a6d9b409Smrg    Intel:Mach:3*:*)
129992e95ad1Smrg	GUESS=i386-pc-mach3
130092e95ad1Smrg	;;
1301a6d9b409Smrg    paragon:*:*:*)
130292e95ad1Smrg	GUESS=i860-intel-osf1
130392e95ad1Smrg	;;
1304a6d9b409Smrg    i860:*:4.*:*) # i860-SVR4
1305a6d9b409Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
130692e95ad1Smrg	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
1307a6d9b409Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
130892e95ad1Smrg	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
1309a6d9b409Smrg	fi
131092e95ad1Smrg	;;
1311a6d9b409Smrg    mini*:CTIX:SYS*5:*)
1312a6d9b409Smrg	# "miniframe"
131392e95ad1Smrg	GUESS=m68010-convergent-sysv
131492e95ad1Smrg	;;
1315a6d9b409Smrg    mc68k:UNIX:SYSTEM5:3.51m)
131692e95ad1Smrg	GUESS=m68k-convergent-sysv
131792e95ad1Smrg	;;
1318a6d9b409Smrg    M680?0:D-NIX:5.3:*)
131992e95ad1Smrg	GUESS=m68k-diab-dnix
132092e95ad1Smrg	;;
1321a6d9b409Smrg    M68*:*:R3V[5678]*:*)
1322a6d9b409Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1323a6d9b409Smrg    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)
1324a6d9b409Smrg	OS_REL=''
1325a6d9b409Smrg	test -r /etc/.relid \
1326a6d9b409Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1327a6d9b409Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
13288b8e729cSmrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1329a6d9b409Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
13308b8e729cSmrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1331a6d9b409Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1332a097bd00Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1333a097bd00Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
1334efda2da8Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1335efda2da8Smrg	OS_REL='.3'
1336efda2da8Smrg	test -r /etc/.relid \
1337efda2da8Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1338efda2da8Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
13398b8e729cSmrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1340efda2da8Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
13418b8e729cSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1342efda2da8Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
13438b8e729cSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1344a6d9b409Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
134592e95ad1Smrg	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
134692e95ad1Smrg	;;
1347a6d9b409Smrg    mc68030:UNIX_System_V:4.*:*)
134892e95ad1Smrg	GUESS=m68k-atari-sysv4
134992e95ad1Smrg	;;
1350a6d9b409Smrg    TSUNAMI:LynxOS:2.*:*)
135192e95ad1Smrg	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
135292e95ad1Smrg	;;
1353a6d9b409Smrg    rs6000:LynxOS:2.*:*)
135492e95ad1Smrg	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
135592e95ad1Smrg	;;
13561e5fa1c5Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
135792e95ad1Smrg	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
135892e95ad1Smrg	;;
1359a6d9b409Smrg    SM[BE]S:UNIX_SV:*:*)
136092e95ad1Smrg	GUESS=mips-dde-sysv$UNAME_RELEASE
136192e95ad1Smrg	;;
1362a6d9b409Smrg    RM*:ReliantUNIX-*:*:*)
136392e95ad1Smrg	GUESS=mips-sni-sysv4
136492e95ad1Smrg	;;
1365a6d9b409Smrg    RM*:SINIX-*:*:*)
136692e95ad1Smrg	GUESS=mips-sni-sysv4
136792e95ad1Smrg	;;
1368a6d9b409Smrg    *:SINIX-*:*:*)
1369a6d9b409Smrg	if uname -p 2>/dev/null >/dev/null ; then
1370a6d9b409Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
137192e95ad1Smrg		GUESS=$UNAME_MACHINE-sni-sysv4
1372a6d9b409Smrg	else
137392e95ad1Smrg		GUESS=ns32k-sni-sysv
1374a6d9b409Smrg	fi
137592e95ad1Smrg	;;
1376838f5b0bSmrg    PENTIUM:*:4.0*:*)	# Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
1377a097bd00Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
137892e95ad1Smrg	GUESS=i586-unisys-sysv4
137992e95ad1Smrg	;;
1380a6d9b409Smrg    *:UNIX_System_V:4*:FTX*)
1381a6d9b409Smrg	# From Gerald Hewes <hewes@openmarket.com>.
1382a6d9b409Smrg	# How about differentiating between stratus architectures? -djm
138392e95ad1Smrg	GUESS=hppa1.1-stratus-sysv4
138492e95ad1Smrg	;;
1385a6d9b409Smrg    *:*:*:FTX*)
1386a6d9b409Smrg	# From seanf@swdc.stratus.com.
138792e95ad1Smrg	GUESS=i860-stratus-sysv4
138892e95ad1Smrg	;;
1389a6d9b409Smrg    i*86:VOS:*:*)
1390a6d9b409Smrg	# From Paul.Green@stratus.com.
139192e95ad1Smrg	GUESS=$UNAME_MACHINE-stratus-vos
139292e95ad1Smrg	;;
1393a6d9b409Smrg    *:VOS:*:*)
1394a6d9b409Smrg	# From Paul.Green@stratus.com.
139592e95ad1Smrg	GUESS=hppa1.1-stratus-vos
139692e95ad1Smrg	;;
1397a6d9b409Smrg    mc68*:A/UX:*:*)
139892e95ad1Smrg	GUESS=m68k-apple-aux$UNAME_RELEASE
139992e95ad1Smrg	;;
1400a6d9b409Smrg    news*:NEWS-OS:6*:*)
140192e95ad1Smrg	GUESS=mips-sony-newsos6
140292e95ad1Smrg	;;
1403a6d9b409Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
140492e95ad1Smrg	if test -d /usr/nec; then
140592e95ad1Smrg		GUESS=mips-nec-sysv$UNAME_RELEASE
1406a6d9b409Smrg	else
140792e95ad1Smrg		GUESS=mips-unknown-sysv$UNAME_RELEASE
1408a6d9b409Smrg	fi
140992e95ad1Smrg	;;
1410a6d9b409Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
141192e95ad1Smrg	GUESS=powerpc-be-beos
141292e95ad1Smrg	;;
1413a6d9b409Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
141492e95ad1Smrg	GUESS=powerpc-apple-beos
141592e95ad1Smrg	;;
1416a6d9b409Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
141792e95ad1Smrg	GUESS=i586-pc-beos
141892e95ad1Smrg	;;
1419efda2da8Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
142092e95ad1Smrg	GUESS=i586-pc-haiku
142192e95ad1Smrg	;;
1422838f5b0bSmrg    ppc:Haiku:*:*)	# Haiku running on Apple PowerPC
1423838f5b0bSmrg	GUESS=powerpc-apple-haiku
1424838f5b0bSmrg	;;
1425838f5b0bSmrg    *:Haiku:*:*)	# Haiku modern gcc (not bound by BeOS compat)
1426838f5b0bSmrg	GUESS=$UNAME_MACHINE-unknown-haiku
142792e95ad1Smrg	;;
1428a6d9b409Smrg    SX-4:SUPER-UX:*:*)
142992e95ad1Smrg	GUESS=sx4-nec-superux$UNAME_RELEASE
143092e95ad1Smrg	;;
1431a6d9b409Smrg    SX-5:SUPER-UX:*:*)
143292e95ad1Smrg	GUESS=sx5-nec-superux$UNAME_RELEASE
143392e95ad1Smrg	;;
1434a6d9b409Smrg    SX-6:SUPER-UX:*:*)
143592e95ad1Smrg	GUESS=sx6-nec-superux$UNAME_RELEASE
143692e95ad1Smrg	;;
1437cae39615Smrg    SX-7:SUPER-UX:*:*)
143892e95ad1Smrg	GUESS=sx7-nec-superux$UNAME_RELEASE
143992e95ad1Smrg	;;
1440cae39615Smrg    SX-8:SUPER-UX:*:*)
144192e95ad1Smrg	GUESS=sx8-nec-superux$UNAME_RELEASE
144292e95ad1Smrg	;;
1443cae39615Smrg    SX-8R:SUPER-UX:*:*)
144492e95ad1Smrg	GUESS=sx8r-nec-superux$UNAME_RELEASE
144592e95ad1Smrg	;;
144611a95ff3Smrg    SX-ACE:SUPER-UX:*:*)
144792e95ad1Smrg	GUESS=sxace-nec-superux$UNAME_RELEASE
144892e95ad1Smrg	;;
1449a6d9b409Smrg    Power*:Rhapsody:*:*)
145092e95ad1Smrg	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
145192e95ad1Smrg	;;
1452a6d9b409Smrg    *:Rhapsody:*:*)
145392e95ad1Smrg	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
145492e95ad1Smrg	;;
145592e95ad1Smrg    arm64:Darwin:*:*)
145692e95ad1Smrg	GUESS=aarch64-apple-darwin$UNAME_RELEASE
145792e95ad1Smrg	;;
1458a6d9b409Smrg    *:Darwin:*:*)
145992e95ad1Smrg	UNAME_PROCESSOR=`uname -p`
146092e95ad1Smrg	case $UNAME_PROCESSOR in
146192e95ad1Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
146292e95ad1Smrg	esac
146392e95ad1Smrg	if command -v xcode-select > /dev/null 2> /dev/null && \
146492e95ad1Smrg		! xcode-select --print-path > /dev/null 2> /dev/null ; then
146592e95ad1Smrg	    # Avoid executing cc if there is no toolchain installed as
146692e95ad1Smrg	    # cc will be a stub that puts up a graphical alert
146792e95ad1Smrg	    # prompting the user to install developer tools.
146892e95ad1Smrg	    CC_FOR_BUILD=no_compiler_found
146992e95ad1Smrg	else
147092e95ad1Smrg	    set_cc_for_build
1471b91640d3Smrg	fi
147292e95ad1Smrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
147392e95ad1Smrg	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
147492e95ad1Smrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
147592e95ad1Smrg		   grep IS_64BIT_ARCH >/dev/null
147692e95ad1Smrg	    then
147792e95ad1Smrg		case $UNAME_PROCESSOR in
147892e95ad1Smrg		    i386) UNAME_PROCESSOR=x86_64 ;;
147992e95ad1Smrg		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
148092e95ad1Smrg		esac
148192e95ad1Smrg	    fi
148292e95ad1Smrg	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
148392e95ad1Smrg	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
148492e95ad1Smrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
148592e95ad1Smrg		   grep IS_PPC >/dev/null
148692e95ad1Smrg	    then
148792e95ad1Smrg		UNAME_PROCESSOR=powerpc
1488b91640d3Smrg	    fi
1489b91640d3Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
149092e95ad1Smrg	    # uname -m returns i386 or x86_64
149192e95ad1Smrg	    UNAME_PROCESSOR=$UNAME_MACHINE
1492b91640d3Smrg	fi
149392e95ad1Smrg	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
149492e95ad1Smrg	;;
1495a6d9b409Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1496a6d9b409Smrg	UNAME_PROCESSOR=`uname -p`
149711a95ff3Smrg	if test "$UNAME_PROCESSOR" = x86; then
1498a6d9b409Smrg		UNAME_PROCESSOR=i386
1499a6d9b409Smrg		UNAME_MACHINE=pc
1500a6d9b409Smrg	fi
150192e95ad1Smrg	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
150292e95ad1Smrg	;;
1503a6d9b409Smrg    *:QNX:*:4*)
150492e95ad1Smrg	GUESS=i386-pc-qnx
150592e95ad1Smrg	;;
15068b8e729cSmrg    NEO-*:NONSTOP_KERNEL:*:*)
150792e95ad1Smrg	GUESS=neo-tandem-nsk$UNAME_RELEASE
150892e95ad1Smrg	;;
1509b91640d3Smrg    NSE-*:NONSTOP_KERNEL:*:*)
151092e95ad1Smrg	GUESS=nse-tandem-nsk$UNAME_RELEASE
151192e95ad1Smrg	;;
15128b8e729cSmrg    NSR-*:NONSTOP_KERNEL:*:*)
151392e95ad1Smrg	GUESS=nsr-tandem-nsk$UNAME_RELEASE
151492e95ad1Smrg	;;
15158b8e729cSmrg    NSV-*:NONSTOP_KERNEL:*:*)
151692e95ad1Smrg	GUESS=nsv-tandem-nsk$UNAME_RELEASE
151792e95ad1Smrg	;;
15188b8e729cSmrg    NSX-*:NONSTOP_KERNEL:*:*)
151992e95ad1Smrg	GUESS=nsx-tandem-nsk$UNAME_RELEASE
152092e95ad1Smrg	;;
1521a6d9b409Smrg    *:NonStop-UX:*:*)
152292e95ad1Smrg	GUESS=mips-compaq-nonstopux
152392e95ad1Smrg	;;
1524a6d9b409Smrg    BS2000:POSIX*:*:*)
152592e95ad1Smrg	GUESS=bs2000-siemens-sysv
152692e95ad1Smrg	;;
1527a6d9b409Smrg    DS/*:UNIX_System_V:*:*)
152892e95ad1Smrg	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
152992e95ad1Smrg	;;
1530a6d9b409Smrg    *:Plan9:*:*)
1531a6d9b409Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
1532a6d9b409Smrg	# is converted to i386 for consistency with other x86
1533a6d9b409Smrg	# operating systems.
153492e95ad1Smrg	if test "${cputype-}" = 386; then
1535a6d9b409Smrg	    UNAME_MACHINE=i386
153692e95ad1Smrg	elif test "x${cputype-}" != x; then
153792e95ad1Smrg	    UNAME_MACHINE=$cputype
1538a6d9b409Smrg	fi
153992e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-plan9
154092e95ad1Smrg	;;
1541a6d9b409Smrg    *:TOPS-10:*:*)
154292e95ad1Smrg	GUESS=pdp10-unknown-tops10
154392e95ad1Smrg	;;
1544a6d9b409Smrg    *:TENEX:*:*)
154592e95ad1Smrg	GUESS=pdp10-unknown-tenex
154692e95ad1Smrg	;;
1547a6d9b409Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
154892e95ad1Smrg	GUESS=pdp10-dec-tops20
154992e95ad1Smrg	;;
1550a6d9b409Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
155192e95ad1Smrg	GUESS=pdp10-xkl-tops20
155292e95ad1Smrg	;;
1553a6d9b409Smrg    *:TOPS-20:*:*)
155492e95ad1Smrg	GUESS=pdp10-unknown-tops20
155592e95ad1Smrg	;;
1556a6d9b409Smrg    *:ITS:*:*)
155792e95ad1Smrg	GUESS=pdp10-unknown-its
155892e95ad1Smrg	;;
1559a6d9b409Smrg    SEI:*:*:SEIUX)
156092e95ad1Smrg	GUESS=mips-sei-seiux$UNAME_RELEASE
156192e95ad1Smrg	;;
1562a6d9b409Smrg    *:DragonFly:*:*)
156392e95ad1Smrg	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
156492e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
156592e95ad1Smrg	;;
1566a6d9b409Smrg    *:*VMS:*:*)
1567a097bd00Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
156892e95ad1Smrg	case $UNAME_MACHINE in
156992e95ad1Smrg	    A*) GUESS=alpha-dec-vms ;;
157092e95ad1Smrg	    I*) GUESS=ia64-dec-vms ;;
157192e95ad1Smrg	    V*) GUESS=vax-dec-vms ;;
1572a6d9b409Smrg	esac ;;
1573a6d9b409Smrg    *:XENIX:*:SysV)
157492e95ad1Smrg	GUESS=i386-pc-xenix
157592e95ad1Smrg	;;
1576a6d9b409Smrg    i*86:skyos:*:*)
157792e95ad1Smrg	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
157892e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
157992e95ad1Smrg	;;
1580cae39615Smrg    i*86:rdos:*:*)
158192e95ad1Smrg	GUESS=$UNAME_MACHINE-pc-rdos
158292e95ad1Smrg	;;
1583838f5b0bSmrg    i*86:Fiwix:*:*)
1584838f5b0bSmrg	GUESS=$UNAME_MACHINE-pc-fiwix
1585838f5b0bSmrg	;;
158692e95ad1Smrg    *:AROS:*:*)
158792e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-aros
158892e95ad1Smrg	;;
1589b91640d3Smrg    x86_64:VMkernel:*:*)
159092e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-esx
159192e95ad1Smrg	;;
159211a95ff3Smrg    amd64:Isilon\ OneFS:*:*)
159392e95ad1Smrg	GUESS=x86_64-unknown-onefs
159492e95ad1Smrg	;;
159592e95ad1Smrg    *:Unleashed:*:*)
159692e95ad1Smrg	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
159792e95ad1Smrg	;;
1598838f5b0bSmrg    *:Ironclad:*:*)
1599838f5b0bSmrg	GUESS=$UNAME_MACHINE-unknown-ironclad
1600838f5b0bSmrg	;;
1601b91640d3Smrgesac
1602a6d9b409Smrg
160392e95ad1Smrg# Do we have a guess based on uname results?
160492e95ad1Smrgif test "x$GUESS" != x; then
160592e95ad1Smrg    echo "$GUESS"
160692e95ad1Smrg    exit
160792e95ad1Smrgfi
160892e95ad1Smrg
160992e95ad1Smrg# No uname command or uname output not recognized.
161092e95ad1Smrgset_cc_for_build
161192e95ad1Smrgcat > "$dummy.c" <<EOF
161292e95ad1Smrg#ifdef _SEQUENT_
161392e95ad1Smrg#include <sys/types.h>
161492e95ad1Smrg#include <sys/utsname.h>
161592e95ad1Smrg#endif
161692e95ad1Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
161792e95ad1Smrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
161892e95ad1Smrg#include <signal.h>
161992e95ad1Smrg#if defined(_SIZE_T_) || defined(SIGLOST)
162092e95ad1Smrg#include <sys/utsname.h>
162192e95ad1Smrg#endif
162292e95ad1Smrg#endif
162392e95ad1Smrg#endif
162492e95ad1Smrgmain ()
162592e95ad1Smrg{
162692e95ad1Smrg#if defined (sony)
162792e95ad1Smrg#if defined (MIPSEB)
162892e95ad1Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
162992e95ad1Smrg     I don't know....  */
163092e95ad1Smrg  printf ("mips-sony-bsd\n"); exit (0);
163192e95ad1Smrg#else
163292e95ad1Smrg#include <sys/param.h>
163392e95ad1Smrg  printf ("m68k-sony-newsos%s\n",
163492e95ad1Smrg#ifdef NEWSOS4
163592e95ad1Smrg  "4"
163692e95ad1Smrg#else
163792e95ad1Smrg  ""
163892e95ad1Smrg#endif
163992e95ad1Smrg  ); exit (0);
164092e95ad1Smrg#endif
164192e95ad1Smrg#endif
164292e95ad1Smrg
164392e95ad1Smrg#if defined (NeXT)
164492e95ad1Smrg#if !defined (__ARCHITECTURE__)
164592e95ad1Smrg#define __ARCHITECTURE__ "m68k"
164692e95ad1Smrg#endif
164792e95ad1Smrg  int version;
164892e95ad1Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
164992e95ad1Smrg  if (version < 4)
165092e95ad1Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
165192e95ad1Smrg  else
165292e95ad1Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
165392e95ad1Smrg  exit (0);
165492e95ad1Smrg#endif
165592e95ad1Smrg
165692e95ad1Smrg#if defined (MULTIMAX) || defined (n16)
165792e95ad1Smrg#if defined (UMAXV)
165892e95ad1Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
165992e95ad1Smrg#else
166092e95ad1Smrg#if defined (CMU)
166192e95ad1Smrg  printf ("ns32k-encore-mach\n"); exit (0);
166292e95ad1Smrg#else
166392e95ad1Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
166492e95ad1Smrg#endif
166592e95ad1Smrg#endif
166692e95ad1Smrg#endif
166792e95ad1Smrg
166892e95ad1Smrg#if defined (__386BSD__)
166992e95ad1Smrg  printf ("i386-pc-bsd\n"); exit (0);
167092e95ad1Smrg#endif
167192e95ad1Smrg
167292e95ad1Smrg#if defined (sequent)
167392e95ad1Smrg#if defined (i386)
167492e95ad1Smrg  printf ("i386-sequent-dynix\n"); exit (0);
167592e95ad1Smrg#endif
167692e95ad1Smrg#if defined (ns32000)
167792e95ad1Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
167892e95ad1Smrg#endif
167992e95ad1Smrg#endif
168092e95ad1Smrg
168192e95ad1Smrg#if defined (_SEQUENT_)
168292e95ad1Smrg  struct utsname un;
168392e95ad1Smrg
168492e95ad1Smrg  uname(&un);
168592e95ad1Smrg  if (strncmp(un.version, "V2", 2) == 0) {
168692e95ad1Smrg    printf ("i386-sequent-ptx2\n"); exit (0);
168792e95ad1Smrg  }
168892e95ad1Smrg  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
168992e95ad1Smrg    printf ("i386-sequent-ptx1\n"); exit (0);
169092e95ad1Smrg  }
169192e95ad1Smrg  printf ("i386-sequent-ptx\n"); exit (0);
169292e95ad1Smrg#endif
169392e95ad1Smrg
169492e95ad1Smrg#if defined (vax)
169592e95ad1Smrg#if !defined (ultrix)
169692e95ad1Smrg#include <sys/param.h>
169792e95ad1Smrg#if defined (BSD)
169892e95ad1Smrg#if BSD == 43
169992e95ad1Smrg  printf ("vax-dec-bsd4.3\n"); exit (0);
170092e95ad1Smrg#else
170192e95ad1Smrg#if BSD == 199006
170292e95ad1Smrg  printf ("vax-dec-bsd4.3reno\n"); exit (0);
170392e95ad1Smrg#else
170492e95ad1Smrg  printf ("vax-dec-bsd\n"); exit (0);
170592e95ad1Smrg#endif
170692e95ad1Smrg#endif
170792e95ad1Smrg#else
170892e95ad1Smrg  printf ("vax-dec-bsd\n"); exit (0);
170992e95ad1Smrg#endif
171092e95ad1Smrg#else
171192e95ad1Smrg#if defined(_SIZE_T_) || defined(SIGLOST)
171292e95ad1Smrg  struct utsname un;
171392e95ad1Smrg  uname (&un);
171492e95ad1Smrg  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
171592e95ad1Smrg#else
171692e95ad1Smrg  printf ("vax-dec-ultrix\n"); exit (0);
171792e95ad1Smrg#endif
171892e95ad1Smrg#endif
171992e95ad1Smrg#endif
172092e95ad1Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
172192e95ad1Smrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
172292e95ad1Smrg#if defined(_SIZE_T_) || defined(SIGLOST)
172392e95ad1Smrg  struct utsname *un;
172492e95ad1Smrg  uname (&un);
172592e95ad1Smrg  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
172692e95ad1Smrg#else
172792e95ad1Smrg  printf ("mips-dec-ultrix\n"); exit (0);
172892e95ad1Smrg#endif
172992e95ad1Smrg#endif
173092e95ad1Smrg#endif
173192e95ad1Smrg
173292e95ad1Smrg#if defined (alliant) && defined (i860)
173392e95ad1Smrg  printf ("i860-alliant-bsd\n"); exit (0);
173492e95ad1Smrg#endif
173592e95ad1Smrg
173692e95ad1Smrg  exit (1);
173792e95ad1Smrg}
173892e95ad1SmrgEOF
173992e95ad1Smrg
174092e95ad1Smrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
174192e95ad1Smrg	{ echo "$SYSTEM_NAME"; exit; }
174292e95ad1Smrg
174392e95ad1Smrg# Apollos put the system type in the environment.
174492e95ad1Smrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
174592e95ad1Smrg
17468b8e729cSmrgecho "$0: unable to guess system type" >&2
17478b8e729cSmrg
174892e95ad1Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM in
17498b8e729cSmrg    mips:Linux | mips64:Linux)
17508b8e729cSmrg	# If we got here on MIPS GNU/Linux, output extra information.
17518b8e729cSmrg	cat >&2 <<EOF
17528b8e729cSmrg
17538b8e729cSmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
17548b8e729cSmrgthe system type. Please install a C compiler and try again.
17558b8e729cSmrgEOF
17568b8e729cSmrg	;;
17578b8e729cSmrgesac
17588b8e729cSmrg
1759a6d9b409Smrgcat >&2 <<EOF
1760a6d9b409Smrg
17618b8e729cSmrgThis script (version $timestamp), has failed to recognize the
17628b8e729cSmrgoperating system you are using. If your script is old, overwrite *all*
17638b8e729cSmrgcopies of config.guess and config.sub with the latest versions from:
1764a6d9b409Smrg
176592e95ad1Smrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
1766a6d9b409Smrgand
176792e95ad1Smrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
176892e95ad1SmrgEOF
176992e95ad1Smrg
177092e95ad1Smrgour_year=`echo $timestamp | sed 's,-.*,,'`
177192e95ad1Smrgthisyear=`date +%Y`
177292e95ad1Smrg# shellcheck disable=SC2003
177392e95ad1Smrgscript_age=`expr "$thisyear" - "$our_year"`
177492e95ad1Smrgif test "$script_age" -lt 3 ; then
177592e95ad1Smrg   cat >&2 <<EOF
1776a6d9b409Smrg
17778b8e729cSmrgIf $0 has already been updated, send the following data and any
17788b8e729cSmrginformation you think might be pertinent to config-patches@gnu.org to
17798b8e729cSmrgprovide the necessary information to handle your system.
1780a6d9b409Smrg
1781a6d9b409Smrgconfig.guess timestamp = $timestamp
1782a6d9b409Smrg
1783a6d9b409Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1784a6d9b409Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1785a6d9b409Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1786a6d9b409Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1787a6d9b409Smrg
1788a6d9b409Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1789a6d9b409Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1790a6d9b409Smrg
1791a6d9b409Smrghostinfo               = `(hostinfo) 2>/dev/null`
1792a6d9b409Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1793a6d9b409Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1794a6d9b409Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1795a6d9b409Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1796a6d9b409Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1797a6d9b409Smrg
17988b8e729cSmrgUNAME_MACHINE = "$UNAME_MACHINE"
17998b8e729cSmrgUNAME_RELEASE = "$UNAME_RELEASE"
18008b8e729cSmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
18018b8e729cSmrgUNAME_VERSION = "$UNAME_VERSION"
1802a6d9b409SmrgEOF
180392e95ad1Smrgfi
1804a6d9b409Smrg
1805a6d9b409Smrgexit 1
1806a6d9b409Smrg
1807a6d9b409Smrg# Local variables:
180892e95ad1Smrg# eval: (add-hook 'before-save-hook 'time-stamp)
1809a6d9b409Smrg# time-stamp-start: "timestamp='"
1810a6d9b409Smrg# time-stamp-format: "%:y-%02m-%02d"
1811a6d9b409Smrg# time-stamp-end: "'"
1812a6d9b409Smrg# End:
1813