19aa228fdSmrg#! /bin/sh
29aa228fdSmrg# Attempt to guess a canonical system name.
346374b8dSmrg#   Copyright 1992-2024 Free Software Foundation, Inc.
49aa228fdSmrg
5e39ce84cSmrg# shellcheck disable=SC2006,SC2268 # see below for rationale
6e39ce84cSmrg
746374b8dSmrgtimestamp='2024-01-01'
89aa228fdSmrg
99aa228fdSmrg# This file is free software; you can redistribute it and/or modify it
109aa228fdSmrg# under the terms of the GNU General Public License as published by
1146374b8dSmrg# the Free Software Foundation, either version 3 of the License, or
129aa228fdSmrg# (at your option) any later version.
139aa228fdSmrg#
149aa228fdSmrg# This program is distributed in the hope that it will be useful, but
159aa228fdSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
169aa228fdSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
179aa228fdSmrg# General Public License for more details.
189aa228fdSmrg#
199aa228fdSmrg# You should have received a copy of the GNU General Public License
20e39ce84cSmrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
219aa228fdSmrg#
229aa228fdSmrg# As a special exception to the GNU General Public License, if you
239aa228fdSmrg# distribute this file as part of a program that contains a
249aa228fdSmrg# configuration script generated by Autoconf, you may include it under
250c7e83b2Smrg# the same distribution terms that you use for the rest of that
260c7e83b2Smrg# program.  This Exception is an additional permission under section 7
270c7e83b2Smrg# of the GNU General Public License, version 3 ("GPLv3").
289aa228fdSmrg#
290c7e83b2Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
309aa228fdSmrg#
318f65982aSmrg# You can get the latest version of this script from:
32e39ce84cSmrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
330c7e83b2Smrg#
340c7e83b2Smrg# Please send patches to <config-patches@gnu.org>.
350c7e83b2Smrg
369aa228fdSmrg
37e39ce84cSmrg# The "shellcheck disable" line above the timestamp inhibits complaints
38e39ce84cSmrg# about features and limitations of the classic Bourne shell that were
39e39ce84cSmrg# superseded or lifted in POSIX.  However, this script identifies a wide
40e39ce84cSmrg# variety of pre-POSIX systems that do not have POSIX shells at all, and
41e39ce84cSmrg# even some reasonably current systems (Solaris 10 as case-in-point) still
42e39ce84cSmrg# have a pre-POSIX /bin/sh.
43e39ce84cSmrg
44e39ce84cSmrg
459aa228fdSmrgme=`echo "$0" | sed -e 's,.*/,,'`
469aa228fdSmrg
479aa228fdSmrgusage="\
489aa228fdSmrgUsage: $0 [OPTION]
499aa228fdSmrg
5046374b8dSmrgOutput the configuration name of the system '$me' is run on.
519aa228fdSmrg
52e39ce84cSmrgOptions:
539aa228fdSmrg  -h, --help         print this help, then exit
549aa228fdSmrg  -t, --time-stamp   print date of last modification, then exit
559aa228fdSmrg  -v, --version      print version number, then exit
569aa228fdSmrg
579aa228fdSmrgReport bugs and patches to <config-patches@gnu.org>."
589aa228fdSmrg
599aa228fdSmrgversion="\
609aa228fdSmrgGNU config.guess ($timestamp)
619aa228fdSmrg
629aa228fdSmrgOriginally written by Per Bothner.
6346374b8dSmrgCopyright 1992-2024 Free Software Foundation, Inc.
649aa228fdSmrg
659aa228fdSmrgThis is free software; see the source for copying conditions.  There is NO
669aa228fdSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
679aa228fdSmrg
689aa228fdSmrghelp="
6946374b8dSmrgTry '$me --help' for more information."
709aa228fdSmrg
719aa228fdSmrg# Parse command line
729aa228fdSmrgwhile test $# -gt 0 ; do
739aa228fdSmrg  case $1 in
749aa228fdSmrg    --time-stamp | --time* | -t )
759aa228fdSmrg       echo "$timestamp" ; exit ;;
769aa228fdSmrg    --version | -v )
779aa228fdSmrg       echo "$version" ; exit ;;
789aa228fdSmrg    --help | --h* | -h )
799aa228fdSmrg       echo "$usage"; exit ;;
809aa228fdSmrg    -- )     # Stop option processing
819aa228fdSmrg       shift; break ;;
829aa228fdSmrg    - )	# Use stdin as input.
839aa228fdSmrg       break ;;
849aa228fdSmrg    -* )
859aa228fdSmrg       echo "$me: invalid option $1$help" >&2
869aa228fdSmrg       exit 1 ;;
879aa228fdSmrg    * )
889aa228fdSmrg       break ;;
899aa228fdSmrg  esac
909aa228fdSmrgdone
919aa228fdSmrg
929aa228fdSmrgif test $# != 0; then
939aa228fdSmrg  echo "$me: too many arguments$help" >&2
949aa228fdSmrg  exit 1
959aa228fdSmrgfi
969aa228fdSmrg
97e39ce84cSmrg# Just in case it came from the environment.
98e39ce84cSmrgGUESS=
999aa228fdSmrg
1009aa228fdSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
1019aa228fdSmrg# compiler to aid in system detection is discouraged as it requires
1029aa228fdSmrg# temporary files to be created and, as you can see below, it is a
1039aa228fdSmrg# headache to deal with in a portable fashion.
1049aa228fdSmrg
10546374b8dSmrg# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
10646374b8dSmrg# use 'HOST_CC' if defined, but it is deprecated.
1079aa228fdSmrg
1089aa228fdSmrg# Portable tmp directory creation inspired by the Autoconf team.
1099aa228fdSmrg
110e39ce84cSmrgtmp=
111e39ce84cSmrg# shellcheck disable=SC2172
112e39ce84cSmrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
113e39ce84cSmrg
114e39ce84cSmrgset_cc_for_build() {
115e39ce84cSmrg    # prevent multiple calls if $tmp is already set
116e39ce84cSmrg    test "$tmp" && return 0
117e39ce84cSmrg    : "${TMPDIR=/tmp}"
118e39ce84cSmrg    # shellcheck disable=SC2039,SC3028
119e39ce84cSmrg    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
120e39ce84cSmrg	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
121e39ce84cSmrg	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
122e39ce84cSmrg	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
123e39ce84cSmrg    dummy=$tmp/dummy
124e39ce84cSmrg    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
125e39ce84cSmrg	,,)    echo "int x;" > "$dummy.c"
126e39ce84cSmrg	       for driver in cc gcc c89 c99 ; do
127e39ce84cSmrg		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
128e39ce84cSmrg		       CC_FOR_BUILD=$driver
129e39ce84cSmrg		       break
130e39ce84cSmrg		   fi
131e39ce84cSmrg	       done
132e39ce84cSmrg	       if test x"$CC_FOR_BUILD" = x ; then
133e39ce84cSmrg		   CC_FOR_BUILD=no_compiler_found
134e39ce84cSmrg	       fi
135e39ce84cSmrg	       ;;
136e39ce84cSmrg	,,*)   CC_FOR_BUILD=$CC ;;
137e39ce84cSmrg	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
138e39ce84cSmrg    esac
139e39ce84cSmrg}
1409aa228fdSmrg
1419aa228fdSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1429aa228fdSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
143e39ce84cSmrgif test -f /.attbin/uname ; then
1449aa228fdSmrg	PATH=$PATH:/.attbin ; export PATH
1459aa228fdSmrgfi
1469aa228fdSmrg
1479aa228fdSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1489aa228fdSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
149e39ce84cSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
1509aa228fdSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1519aa228fdSmrg
152e39ce84cSmrgcase $UNAME_SYSTEM in
1530c7e83b2SmrgLinux|GNU|GNU/*)
154e39ce84cSmrg	LIBC=unknown
1550c7e83b2Smrg
156e39ce84cSmrg	set_cc_for_build
157e39ce84cSmrg	cat <<-EOF > "$dummy.c"
15846374b8dSmrg	#if defined(__ANDROID__)
15946374b8dSmrg	LIBC=android
16046374b8dSmrg	#else
1610c7e83b2Smrg	#include <features.h>
1620c7e83b2Smrg	#if defined(__UCLIBC__)
1630c7e83b2Smrg	LIBC=uclibc
1640c7e83b2Smrg	#elif defined(__dietlibc__)
1650c7e83b2Smrg	LIBC=dietlibc
166e39ce84cSmrg	#elif defined(__GLIBC__)
1670c7e83b2Smrg	LIBC=gnu
16846374b8dSmrg	#elif defined(__LLVM_LIBC__)
16946374b8dSmrg	LIBC=llvm
170e39ce84cSmrg	#else
171e39ce84cSmrg	#include <stdarg.h>
172e39ce84cSmrg	/* First heuristic to detect musl libc.  */
173e39ce84cSmrg	#ifdef __DEFINED_va_list
174e39ce84cSmrg	LIBC=musl
175e39ce84cSmrg	#endif
1760c7e83b2Smrg	#endif
17746374b8dSmrg	#endif
1780c7e83b2Smrg	EOF
179e39ce84cSmrg	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
180e39ce84cSmrg	eval "$cc_set_libc"
181e39ce84cSmrg
182e39ce84cSmrg	# Second heuristic to detect musl libc.
183e39ce84cSmrg	if [ "$LIBC" = unknown ] &&
184e39ce84cSmrg	   command -v ldd >/dev/null &&
185e39ce84cSmrg	   ldd --version 2>&1 | grep -q ^musl; then
186e39ce84cSmrg		LIBC=musl
187e39ce84cSmrg	fi
188e39ce84cSmrg
189e39ce84cSmrg	# If the system lacks a compiler, then just pick glibc.
190e39ce84cSmrg	# We could probably try harder.
191e39ce84cSmrg	if [ "$LIBC" = unknown ]; then
192e39ce84cSmrg		LIBC=gnu
193e39ce84cSmrg	fi
1940c7e83b2Smrg	;;
1950c7e83b2Smrgesac
1960c7e83b2Smrg
1979aa228fdSmrg# Note: order is significant - the case branches are not exclusive.
1989aa228fdSmrg
199e39ce84cSmrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
2009aa228fdSmrg    *:NetBSD:*:*)
2019aa228fdSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
2020c7e83b2Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
2039aa228fdSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
2049aa228fdSmrg	# switched to ELF, *-*-netbsd* would select the old
2059aa228fdSmrg	# object file format.  This provides both forward
2069aa228fdSmrg	# compatibility and a consistent mechanism for selecting the
2079aa228fdSmrg	# object file format.
2089aa228fdSmrg	#
2099aa228fdSmrg	# Note: NetBSD doesn't particularly care about the vendor
2109aa228fdSmrg	# portion of the name.  We always set it to "unknown".
211e39ce84cSmrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
212e39ce84cSmrg	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
213e39ce84cSmrg	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
214e39ce84cSmrg	    echo unknown)`
215e39ce84cSmrg	case $UNAME_MACHINE_ARCH in
216e39ce84cSmrg	    aarch64eb) machine=aarch64_be-unknown ;;
2179aa228fdSmrg	    armeb) machine=armeb-unknown ;;
2189aa228fdSmrg	    arm*) machine=arm-unknown ;;
2199aa228fdSmrg	    sh3el) machine=shl-unknown ;;
2209aa228fdSmrg	    sh3eb) machine=sh-unknown ;;
2218f65982aSmrg	    sh5el) machine=sh5le-unknown ;;
222e39ce84cSmrg	    earmv*)
223e39ce84cSmrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
224e39ce84cSmrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
225e39ce84cSmrg		machine=${arch}${endian}-unknown
226e39ce84cSmrg		;;
227e39ce84cSmrg	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
2289aa228fdSmrg	esac
2299aa228fdSmrg	# The Operating System including object format, if it has switched
230e39ce84cSmrg	# to ELF recently (or will in the future) and ABI.
231e39ce84cSmrg	case $UNAME_MACHINE_ARCH in
232e39ce84cSmrg	    earm*)
233e39ce84cSmrg		os=netbsdelf
234e39ce84cSmrg		;;
2359aa228fdSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
236e39ce84cSmrg		set_cc_for_build
2379aa228fdSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
2388f65982aSmrg			| grep -q __ELF__
2399aa228fdSmrg		then
2409aa228fdSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
2419aa228fdSmrg		    # Return netbsd for either.  FIX?
2429aa228fdSmrg		    os=netbsd
2439aa228fdSmrg		else
2449aa228fdSmrg		    os=netbsdelf
2459aa228fdSmrg		fi
2469aa228fdSmrg		;;
2479aa228fdSmrg	    *)
24880b026c6Smrg		os=netbsd
2499aa228fdSmrg		;;
2509aa228fdSmrg	esac
251e39ce84cSmrg	# Determine ABI tags.
252e39ce84cSmrg	case $UNAME_MACHINE_ARCH in
253e39ce84cSmrg	    earm*)
254e39ce84cSmrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
255e39ce84cSmrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
256e39ce84cSmrg		;;
257e39ce84cSmrg	esac
2589aa228fdSmrg	# The OS release
2599aa228fdSmrg	# Debian GNU/NetBSD machines have a different userland, and
2609aa228fdSmrg	# thus, need a distinct triplet. However, they do not need
2619aa228fdSmrg	# kernel version information, so it can be replaced with a
2629aa228fdSmrg	# suitable tag, in the style of linux-gnu.
263e39ce84cSmrg	case $UNAME_VERSION in
2649aa228fdSmrg	    Debian*)
2659aa228fdSmrg		release='-gnu'
2669aa228fdSmrg		;;
2679aa228fdSmrg	    *)
268e39ce84cSmrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
2699aa228fdSmrg		;;
2709aa228fdSmrg	esac
2719aa228fdSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2729aa228fdSmrg	# contains redundant information, the shorter form:
2739aa228fdSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
274e39ce84cSmrg	GUESS=$machine-${os}${release}${abi-}
275e39ce84cSmrg	;;
2760c7e83b2Smrg    *:Bitrig:*:*)
2770c7e83b2Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
278e39ce84cSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
279e39ce84cSmrg	;;
2809aa228fdSmrg    *:OpenBSD:*:*)
2819aa228fdSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
282e39ce84cSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
283e39ce84cSmrg	;;
284e39ce84cSmrg    *:SecBSD:*:*)
285e39ce84cSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
286e39ce84cSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
287e39ce84cSmrg	;;
288e39ce84cSmrg    *:LibertyBSD:*:*)
289e39ce84cSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
290e39ce84cSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
291e39ce84cSmrg	;;
292e39ce84cSmrg    *:MidnightBSD:*:*)
293e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
294e39ce84cSmrg	;;
2959aa228fdSmrg    *:ekkoBSD:*:*)
296e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
297e39ce84cSmrg	;;
2989aa228fdSmrg    *:SolidBSD:*:*)
299e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
300e39ce84cSmrg	;;
301e39ce84cSmrg    *:OS108:*:*)
302e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
303e39ce84cSmrg	;;
3049aa228fdSmrg    macppc:MirBSD:*:*)
305e39ce84cSmrg	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
306e39ce84cSmrg	;;
3079aa228fdSmrg    *:MirBSD:*:*)
308e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
309e39ce84cSmrg	;;
310e39ce84cSmrg    *:Sortix:*:*)
311e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-sortix
312e39ce84cSmrg	;;
313e39ce84cSmrg    *:Twizzler:*:*)
314e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-twizzler
315e39ce84cSmrg	;;
316e39ce84cSmrg    *:Redox:*:*)
317e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-redox
318e39ce84cSmrg	;;
319e39ce84cSmrg    mips:OSF1:*.*)
320e39ce84cSmrg	GUESS=mips-dec-osf1
321e39ce84cSmrg	;;
3229aa228fdSmrg    alpha:OSF1:*:*)
323e39ce84cSmrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
324e39ce84cSmrg	trap '' 0
3259aa228fdSmrg	case $UNAME_RELEASE in
3269aa228fdSmrg	*4.0)
3279aa228fdSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
3289aa228fdSmrg		;;
3299aa228fdSmrg	*5.*)
33080b026c6Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
3319aa228fdSmrg		;;
3329aa228fdSmrg	esac
3339aa228fdSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
3349aa228fdSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
3359aa228fdSmrg	# covers most systems running today.  This code pipes the CPU
3369aa228fdSmrg	# types through head -n 1, so we only detect the type of CPU 0.
3379aa228fdSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
338e39ce84cSmrg	case $ALPHA_CPU_TYPE in
3399aa228fdSmrg	    "EV4 (21064)")
340e39ce84cSmrg		UNAME_MACHINE=alpha ;;
3419aa228fdSmrg	    "EV4.5 (21064)")
342e39ce84cSmrg		UNAME_MACHINE=alpha ;;
3439aa228fdSmrg	    "LCA4 (21066/21068)")
344e39ce84cSmrg		UNAME_MACHINE=alpha ;;
3459aa228fdSmrg	    "EV5 (21164)")
346e39ce84cSmrg		UNAME_MACHINE=alphaev5 ;;
3479aa228fdSmrg	    "EV5.6 (21164A)")
348e39ce84cSmrg		UNAME_MACHINE=alphaev56 ;;
3499aa228fdSmrg	    "EV5.6 (21164PC)")
350e39ce84cSmrg		UNAME_MACHINE=alphapca56 ;;
3519aa228fdSmrg	    "EV5.7 (21164PC)")
352e39ce84cSmrg		UNAME_MACHINE=alphapca57 ;;
3539aa228fdSmrg	    "EV6 (21264)")
354e39ce84cSmrg		UNAME_MACHINE=alphaev6 ;;
3559aa228fdSmrg	    "EV6.7 (21264A)")
356e39ce84cSmrg		UNAME_MACHINE=alphaev67 ;;
3579aa228fdSmrg	    "EV6.8CB (21264C)")
358e39ce84cSmrg		UNAME_MACHINE=alphaev68 ;;
3599aa228fdSmrg	    "EV6.8AL (21264B)")
360e39ce84cSmrg		UNAME_MACHINE=alphaev68 ;;
3619aa228fdSmrg	    "EV6.8CX (21264D)")
362e39ce84cSmrg		UNAME_MACHINE=alphaev68 ;;
3639aa228fdSmrg	    "EV6.9A (21264/EV69A)")
364e39ce84cSmrg		UNAME_MACHINE=alphaev69 ;;
3659aa228fdSmrg	    "EV7 (21364)")
366e39ce84cSmrg		UNAME_MACHINE=alphaev7 ;;
3679aa228fdSmrg	    "EV7.9 (21364A)")
368e39ce84cSmrg		UNAME_MACHINE=alphaev79 ;;
3699aa228fdSmrg	esac
3709aa228fdSmrg	# A Pn.n version is a patched version.
3719aa228fdSmrg	# A Vn.n version is a released version.
3729aa228fdSmrg	# A Tn.n version is a released field test version.
3739aa228fdSmrg	# A Xn.n version is an unreleased experimental baselevel.
3749aa228fdSmrg	# 1.2 uses "1.2" for uname -r.
375e39ce84cSmrg	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
376e39ce84cSmrg	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
377e39ce84cSmrg	;;
3789aa228fdSmrg    Amiga*:UNIX_System_V:4.0:*)
379e39ce84cSmrg	GUESS=m68k-unknown-sysv4
380e39ce84cSmrg	;;
3819aa228fdSmrg    *:[Aa]miga[Oo][Ss]:*:*)
382e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-amigaos
383e39ce84cSmrg	;;
3849aa228fdSmrg    *:[Mm]orph[Oo][Ss]:*:*)
385e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-morphos
386e39ce84cSmrg	;;
3879aa228fdSmrg    *:OS/390:*:*)
388e39ce84cSmrg	GUESS=i370-ibm-openedition
389e39ce84cSmrg	;;
3909aa228fdSmrg    *:z/VM:*:*)
391e39ce84cSmrg	GUESS=s390-ibm-zvmoe
392e39ce84cSmrg	;;
3939aa228fdSmrg    *:OS400:*:*)
394e39ce84cSmrg	GUESS=powerpc-ibm-os400
395e39ce84cSmrg	;;
3969aa228fdSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
397e39ce84cSmrg	GUESS=arm-acorn-riscix$UNAME_RELEASE
398e39ce84cSmrg	;;
3990c7e83b2Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
400e39ce84cSmrg	GUESS=arm-unknown-riscos
401e39ce84cSmrg	;;
4029aa228fdSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
403e39ce84cSmrg	GUESS=hppa1.1-hitachi-hiuxmpp
404e39ce84cSmrg	;;
4059aa228fdSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
4069aa228fdSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
407e39ce84cSmrg	case `(/bin/universe) 2>/dev/null` in
408e39ce84cSmrg	    att) GUESS=pyramid-pyramid-sysv3 ;;
409e39ce84cSmrg	    *)   GUESS=pyramid-pyramid-bsd   ;;
410e39ce84cSmrg	esac
411e39ce84cSmrg	;;
4129aa228fdSmrg    NILE*:*:*:dcosx)
413e39ce84cSmrg	GUESS=pyramid-pyramid-svr4
414e39ce84cSmrg	;;
4159aa228fdSmrg    DRS?6000:unix:4.0:6*)
416e39ce84cSmrg	GUESS=sparc-icl-nx6
417e39ce84cSmrg	;;
4189aa228fdSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
4199aa228fdSmrg	case `/usr/bin/uname -p` in
420e39ce84cSmrg	    sparc) GUESS=sparc-icl-nx7 ;;
421e39ce84cSmrg	esac
422e39ce84cSmrg	;;
4238f65982aSmrg    s390x:SunOS:*:*)
424e39ce84cSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
425e39ce84cSmrg	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
426e39ce84cSmrg	;;
4279aa228fdSmrg    sun4H:SunOS:5.*:*)
428e39ce84cSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
429e39ce84cSmrg	GUESS=sparc-hal-solaris2$SUN_REL
430e39ce84cSmrg	;;
4319aa228fdSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
432e39ce84cSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
433e39ce84cSmrg	GUESS=sparc-sun-solaris2$SUN_REL
434e39ce84cSmrg	;;
4358f65982aSmrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
436e39ce84cSmrg	GUESS=i386-pc-auroraux$UNAME_RELEASE
437e39ce84cSmrg	;;
4388f65982aSmrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
439e39ce84cSmrg	set_cc_for_build
440e39ce84cSmrg	SUN_ARCH=i386
4418f65982aSmrg	# If there is a compiler, see if it is configured for 64-bit objects.
4428f65982aSmrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
4438f65982aSmrg	# This test works for both compilers.
444e39ce84cSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
4458f65982aSmrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
44646374b8dSmrg		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
4478f65982aSmrg		grep IS_64BIT_ARCH >/dev/null
4488f65982aSmrg	    then
449e39ce84cSmrg		SUN_ARCH=x86_64
4508f65982aSmrg	    fi
4518f65982aSmrg	fi
452e39ce84cSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
453e39ce84cSmrg	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
454e39ce84cSmrg	;;
4559aa228fdSmrg    sun4*:SunOS:6*:*)
4569aa228fdSmrg	# According to config.sub, this is the proper way to canonicalize
4579aa228fdSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
4589aa228fdSmrg	# it's likely to be more like Solaris than SunOS4.
459e39ce84cSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
460e39ce84cSmrg	GUESS=sparc-sun-solaris3$SUN_REL
461e39ce84cSmrg	;;
4629aa228fdSmrg    sun4*:SunOS:*:*)
463e39ce84cSmrg	case `/usr/bin/arch -k` in
4649aa228fdSmrg	    Series*|S4*)
4659aa228fdSmrg		UNAME_RELEASE=`uname -v`
4669aa228fdSmrg		;;
4679aa228fdSmrg	esac
46846374b8dSmrg	# Japanese Language versions have a version number like '4.1.3-JL'.
469e39ce84cSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
470e39ce84cSmrg	GUESS=sparc-sun-sunos$SUN_REL
471e39ce84cSmrg	;;
4729aa228fdSmrg    sun3*:SunOS:*:*)
473e39ce84cSmrg	GUESS=m68k-sun-sunos$UNAME_RELEASE
474e39ce84cSmrg	;;
4759aa228fdSmrg    sun*:*:4.2BSD:*)
4769aa228fdSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
477e39ce84cSmrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
478e39ce84cSmrg	case `/bin/arch` in
4799aa228fdSmrg	    sun3)
480e39ce84cSmrg		GUESS=m68k-sun-sunos$UNAME_RELEASE
4819aa228fdSmrg		;;
4829aa228fdSmrg	    sun4)
483e39ce84cSmrg		GUESS=sparc-sun-sunos$UNAME_RELEASE
4849aa228fdSmrg		;;
4859aa228fdSmrg	esac
486e39ce84cSmrg	;;
4879aa228fdSmrg    aushp:SunOS:*:*)
488e39ce84cSmrg	GUESS=sparc-auspex-sunos$UNAME_RELEASE
489e39ce84cSmrg	;;
4909aa228fdSmrg    # The situation for MiNT is a little confusing.  The machine name
4919aa228fdSmrg    # can be virtually everything (everything which is not
4929aa228fdSmrg    # "atarist" or "atariste" at least should have a processor
4939aa228fdSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
4949aa228fdSmrg    # to the lowercase version "mint" (or "freemint").  Finally
4959aa228fdSmrg    # the system name "TOS" denotes a system which is actually not
4969aa228fdSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
4979aa228fdSmrg    # be no problem.
4989aa228fdSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
499e39ce84cSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
500e39ce84cSmrg	;;
5019aa228fdSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
502e39ce84cSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
503e39ce84cSmrg	;;
5049aa228fdSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
505e39ce84cSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
506e39ce84cSmrg	;;
5079aa228fdSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
508e39ce84cSmrg	GUESS=m68k-milan-mint$UNAME_RELEASE
509e39ce84cSmrg	;;
5109aa228fdSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
511e39ce84cSmrg	GUESS=m68k-hades-mint$UNAME_RELEASE
512e39ce84cSmrg	;;
5139aa228fdSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
514e39ce84cSmrg	GUESS=m68k-unknown-mint$UNAME_RELEASE
515e39ce84cSmrg	;;
5169aa228fdSmrg    m68k:machten:*:*)
517e39ce84cSmrg	GUESS=m68k-apple-machten$UNAME_RELEASE
518e39ce84cSmrg	;;
5199aa228fdSmrg    powerpc:machten:*:*)
520e39ce84cSmrg	GUESS=powerpc-apple-machten$UNAME_RELEASE
521e39ce84cSmrg	;;
5229aa228fdSmrg    RISC*:Mach:*:*)
523e39ce84cSmrg	GUESS=mips-dec-mach_bsd4.3
524e39ce84cSmrg	;;
5259aa228fdSmrg    RISC*:ULTRIX:*:*)
526e39ce84cSmrg	GUESS=mips-dec-ultrix$UNAME_RELEASE
527e39ce84cSmrg	;;
5289aa228fdSmrg    VAX*:ULTRIX*:*:*)
529e39ce84cSmrg	GUESS=vax-dec-ultrix$UNAME_RELEASE
530e39ce84cSmrg	;;
5319aa228fdSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
532e39ce84cSmrg	GUESS=clipper-intergraph-clix$UNAME_RELEASE
533e39ce84cSmrg	;;
5349aa228fdSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
535e39ce84cSmrg	set_cc_for_build
536e39ce84cSmrg	sed 's/^	//' << EOF > "$dummy.c"
5379aa228fdSmrg#ifdef __cplusplus
5389aa228fdSmrg#include <stdio.h>  /* for printf() prototype */
5399aa228fdSmrg	int main (int argc, char *argv[]) {
5409aa228fdSmrg#else
5419aa228fdSmrg	int main (argc, argv) int argc; char *argv[]; {
5429aa228fdSmrg#endif
5439aa228fdSmrg	#if defined (host_mips) && defined (MIPSEB)
5449aa228fdSmrg	#if defined (SYSTYPE_SYSV)
545e39ce84cSmrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
5469aa228fdSmrg	#endif
5479aa228fdSmrg	#if defined (SYSTYPE_SVR4)
548e39ce84cSmrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
5499aa228fdSmrg	#endif
5509aa228fdSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
551e39ce84cSmrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
5529aa228fdSmrg	#endif
5539aa228fdSmrg	#endif
5549aa228fdSmrg	  exit (-1);
5559aa228fdSmrg	}
5569aa228fdSmrgEOF
557e39ce84cSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
558e39ce84cSmrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
559e39ce84cSmrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
5609aa228fdSmrg	    { echo "$SYSTEM_NAME"; exit; }
561e39ce84cSmrg	GUESS=mips-mips-riscos$UNAME_RELEASE
562e39ce84cSmrg	;;
5639aa228fdSmrg    Motorola:PowerMAX_OS:*:*)
564e39ce84cSmrg	GUESS=powerpc-motorola-powermax
565e39ce84cSmrg	;;
5669aa228fdSmrg    Motorola:*:4.3:PL8-*)
567e39ce84cSmrg	GUESS=powerpc-harris-powermax
568e39ce84cSmrg	;;
5699aa228fdSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
570e39ce84cSmrg	GUESS=powerpc-harris-powermax
571e39ce84cSmrg	;;
5729aa228fdSmrg    Night_Hawk:Power_UNIX:*:*)
573e39ce84cSmrg	GUESS=powerpc-harris-powerunix
574e39ce84cSmrg	;;
5759aa228fdSmrg    m88k:CX/UX:7*:*)
576e39ce84cSmrg	GUESS=m88k-harris-cxux7
577e39ce84cSmrg	;;
5789aa228fdSmrg    m88k:*:4*:R4*)
579e39ce84cSmrg	GUESS=m88k-motorola-sysv4
580e39ce84cSmrg	;;
5819aa228fdSmrg    m88k:*:3*:R3*)
582e39ce84cSmrg	GUESS=m88k-motorola-sysv3
583e39ce84cSmrg	;;
5849aa228fdSmrg    AViiON:dgux:*:*)
58580b026c6Smrg	# DG/UX returns AViiON for all architectures
58680b026c6Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
587e39ce84cSmrg	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
5889aa228fdSmrg	then
589e39ce84cSmrg	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
590e39ce84cSmrg	       test "$TARGET_BINARY_INTERFACE"x = x
5919aa228fdSmrg	    then
592e39ce84cSmrg		GUESS=m88k-dg-dgux$UNAME_RELEASE
5939aa228fdSmrg	    else
594e39ce84cSmrg		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
5959aa228fdSmrg	    fi
5969aa228fdSmrg	else
597e39ce84cSmrg	    GUESS=i586-dg-dgux$UNAME_RELEASE
5989aa228fdSmrg	fi
599e39ce84cSmrg	;;
6009aa228fdSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
601e39ce84cSmrg	GUESS=m88k-dolphin-sysv3
602e39ce84cSmrg	;;
6039aa228fdSmrg    M88*:*:R3*:*)
6049aa228fdSmrg	# Delta 88k system running SVR3
605e39ce84cSmrg	GUESS=m88k-motorola-sysv3
606e39ce84cSmrg	;;
6079aa228fdSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
608e39ce84cSmrg	GUESS=m88k-tektronix-sysv3
609e39ce84cSmrg	;;
6109aa228fdSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
611e39ce84cSmrg	GUESS=m68k-tektronix-bsd
612e39ce84cSmrg	;;
6139aa228fdSmrg    *:IRIX*:*:*)
614e39ce84cSmrg	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
615e39ce84cSmrg	GUESS=mips-sgi-irix$IRIX_REL
616e39ce84cSmrg	;;
6179aa228fdSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
618e39ce84cSmrg	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
619e39ce84cSmrg	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
6209aa228fdSmrg    i*86:AIX:*:*)
621e39ce84cSmrg	GUESS=i386-ibm-aix
622e39ce84cSmrg	;;
6239aa228fdSmrg    ia64:AIX:*:*)
624e39ce84cSmrg	if test -x /usr/bin/oslevel ; then
6259aa228fdSmrg		IBM_REV=`/usr/bin/oslevel`
6269aa228fdSmrg	else
627e39ce84cSmrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
6289aa228fdSmrg	fi
629e39ce84cSmrg	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
630e39ce84cSmrg	;;
6319aa228fdSmrg    *:AIX:2:3)
6329aa228fdSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
633e39ce84cSmrg		set_cc_for_build
634e39ce84cSmrg		sed 's/^		//' << EOF > "$dummy.c"
6359aa228fdSmrg		#include <sys/systemcfg.h>
6369aa228fdSmrg
6379aa228fdSmrg		main()
6389aa228fdSmrg			{
6399aa228fdSmrg			if (!__power_pc())
6409aa228fdSmrg				exit(1);
6419aa228fdSmrg			puts("powerpc-ibm-aix3.2.5");
6429aa228fdSmrg			exit(0);
6439aa228fdSmrg			}
6449aa228fdSmrgEOF
645e39ce84cSmrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
6469aa228fdSmrg		then
647e39ce84cSmrg			GUESS=$SYSTEM_NAME
6489aa228fdSmrg		else
649e39ce84cSmrg			GUESS=rs6000-ibm-aix3.2.5
6509aa228fdSmrg		fi
6519aa228fdSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
652e39ce84cSmrg		GUESS=rs6000-ibm-aix3.2.4
6539aa228fdSmrg	else
654e39ce84cSmrg		GUESS=rs6000-ibm-aix3.2
6559aa228fdSmrg	fi
656e39ce84cSmrg	;;
6578f65982aSmrg    *:AIX:*:[4567])
6589aa228fdSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
659e39ce84cSmrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
6609aa228fdSmrg		IBM_ARCH=rs6000
6619aa228fdSmrg	else
6629aa228fdSmrg		IBM_ARCH=powerpc
6639aa228fdSmrg	fi
664e39ce84cSmrg	if test -x /usr/bin/lslpp ; then
665e39ce84cSmrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
6660c7e83b2Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
6679aa228fdSmrg	else
668e39ce84cSmrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
6699aa228fdSmrg	fi
670e39ce84cSmrg	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
671e39ce84cSmrg	;;
6729aa228fdSmrg    *:AIX:*:*)
673e39ce84cSmrg	GUESS=rs6000-ibm-aix
674e39ce84cSmrg	;;
675e39ce84cSmrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
676e39ce84cSmrg	GUESS=romp-ibm-bsd4.4
677e39ce84cSmrg	;;
6789aa228fdSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
679e39ce84cSmrg	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
680e39ce84cSmrg	;;                                  # report: romp-ibm BSD 4.3
6819aa228fdSmrg    *:BOSX:*:*)
682e39ce84cSmrg	GUESS=rs6000-bull-bosx
683e39ce84cSmrg	;;
6849aa228fdSmrg    DPX/2?00:B.O.S.:*:*)
685e39ce84cSmrg	GUESS=m68k-bull-sysv3
686e39ce84cSmrg	;;
6879aa228fdSmrg    9000/[34]??:4.3bsd:1.*:*)
688e39ce84cSmrg	GUESS=m68k-hp-bsd
689e39ce84cSmrg	;;
6909aa228fdSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
691e39ce84cSmrg	GUESS=m68k-hp-bsd4.4
692e39ce84cSmrg	;;
6939aa228fdSmrg    9000/[34678]??:HP-UX:*:*)
694e39ce84cSmrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
695e39ce84cSmrg	case $UNAME_MACHINE in
696e39ce84cSmrg	    9000/31?)            HP_ARCH=m68000 ;;
697e39ce84cSmrg	    9000/[34]??)         HP_ARCH=m68k ;;
6989aa228fdSmrg	    9000/[678][0-9][0-9])
699e39ce84cSmrg		if test -x /usr/bin/getconf; then
7009aa228fdSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
70180b026c6Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
702e39ce84cSmrg		    case $sc_cpu_version in
703e39ce84cSmrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
704e39ce84cSmrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
70580b026c6Smrg		      532)                      # CPU_PA_RISC2_0
706e39ce84cSmrg			case $sc_kernel_bits in
707e39ce84cSmrg			  32) HP_ARCH=hppa2.0n ;;
708e39ce84cSmrg			  64) HP_ARCH=hppa2.0w ;;
709e39ce84cSmrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
71080b026c6Smrg			esac ;;
71180b026c6Smrg		    esac
7129aa228fdSmrg		fi
713e39ce84cSmrg		if test "$HP_ARCH" = ""; then
714e39ce84cSmrg		    set_cc_for_build
715e39ce84cSmrg		    sed 's/^		//' << EOF > "$dummy.c"
7169aa228fdSmrg
71780b026c6Smrg		#define _HPUX_SOURCE
71880b026c6Smrg		#include <stdlib.h>
71980b026c6Smrg		#include <unistd.h>
7209aa228fdSmrg
72180b026c6Smrg		int main ()
72280b026c6Smrg		{
72380b026c6Smrg		#if defined(_SC_KERNEL_BITS)
72480b026c6Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
72580b026c6Smrg		#endif
72680b026c6Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
7279aa228fdSmrg
72880b026c6Smrg		    switch (cpu)
72980b026c6Smrg			{
73080b026c6Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
73180b026c6Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
73280b026c6Smrg			case CPU_PA_RISC2_0:
73380b026c6Smrg		#if defined(_SC_KERNEL_BITS)
73480b026c6Smrg			    switch (bits)
73580b026c6Smrg				{
73680b026c6Smrg				case 64: puts ("hppa2.0w"); break;
73780b026c6Smrg				case 32: puts ("hppa2.0n"); break;
73880b026c6Smrg				default: puts ("hppa2.0"); break;
73980b026c6Smrg				} break;
74080b026c6Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
74180b026c6Smrg			    puts ("hppa2.0"); break;
74280b026c6Smrg		#endif
74380b026c6Smrg			default: puts ("hppa1.0"); break;
74480b026c6Smrg			}
74580b026c6Smrg		    exit (0);
74680b026c6Smrg		}
7479aa228fdSmrgEOF
748e39ce84cSmrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
7499aa228fdSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
7509aa228fdSmrg		fi ;;
7519aa228fdSmrg	esac
752e39ce84cSmrg	if test "$HP_ARCH" = hppa2.0w
7539aa228fdSmrg	then
754e39ce84cSmrg	    set_cc_for_build
7559aa228fdSmrg
7569aa228fdSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
7579aa228fdSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
7589aa228fdSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
7599aa228fdSmrg	    #
7609aa228fdSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
7619aa228fdSmrg	    # => hppa2.0w-hp-hpux11.23
7629aa228fdSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
7639aa228fdSmrg	    # => hppa64-hp-hpux11.23
7649aa228fdSmrg
765e39ce84cSmrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
7668f65982aSmrg		grep -q __LP64__
7679aa228fdSmrg	    then
768e39ce84cSmrg		HP_ARCH=hppa2.0w
7699aa228fdSmrg	    else
770e39ce84cSmrg		HP_ARCH=hppa64
7719aa228fdSmrg	    fi
7729aa228fdSmrg	fi
773e39ce84cSmrg	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
774e39ce84cSmrg	;;
7759aa228fdSmrg    ia64:HP-UX:*:*)
776e39ce84cSmrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
777e39ce84cSmrg	GUESS=ia64-hp-hpux$HPUX_REV
778e39ce84cSmrg	;;
7799aa228fdSmrg    3050*:HI-UX:*:*)
780e39ce84cSmrg	set_cc_for_build
781e39ce84cSmrg	sed 's/^	//' << EOF > "$dummy.c"
7829aa228fdSmrg	#include <unistd.h>
7839aa228fdSmrg	int
7849aa228fdSmrg	main ()
7859aa228fdSmrg	{
7869aa228fdSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
7879aa228fdSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7889aa228fdSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7899aa228fdSmrg	     results, however.  */
7909aa228fdSmrg	  if (CPU_IS_PA_RISC (cpu))
7919aa228fdSmrg	    {
7929aa228fdSmrg	      switch (cpu)
7939aa228fdSmrg		{
7949aa228fdSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7959aa228fdSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7969aa228fdSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7979aa228fdSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7989aa228fdSmrg		}
7999aa228fdSmrg	    }
8009aa228fdSmrg	  else if (CPU_IS_HP_MC68K (cpu))
8019aa228fdSmrg	    puts ("m68k-hitachi-hiuxwe2");
8029aa228fdSmrg	  else puts ("unknown-hitachi-hiuxwe2");
8039aa228fdSmrg	  exit (0);
8049aa228fdSmrg	}
8059aa228fdSmrgEOF
806e39ce84cSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
8079aa228fdSmrg		{ echo "$SYSTEM_NAME"; exit; }
808e39ce84cSmrg	GUESS=unknown-hitachi-hiuxwe2
809e39ce84cSmrg	;;
810e39ce84cSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
811e39ce84cSmrg	GUESS=hppa1.1-hp-bsd
812e39ce84cSmrg	;;
8139aa228fdSmrg    9000/8??:4.3bsd:*:*)
814e39ce84cSmrg	GUESS=hppa1.0-hp-bsd
815e39ce84cSmrg	;;
8169aa228fdSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
817e39ce84cSmrg	GUESS=hppa1.0-hp-mpeix
818e39ce84cSmrg	;;
819e39ce84cSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
820e39ce84cSmrg	GUESS=hppa1.1-hp-osf
821e39ce84cSmrg	;;
8229aa228fdSmrg    hp8??:OSF1:*:*)
823e39ce84cSmrg	GUESS=hppa1.0-hp-osf
824e39ce84cSmrg	;;
8259aa228fdSmrg    i*86:OSF1:*:*)
826e39ce84cSmrg	if test -x /usr/sbin/sysversion ; then
827e39ce84cSmrg	    GUESS=$UNAME_MACHINE-unknown-osf1mk
8289aa228fdSmrg	else
829e39ce84cSmrg	    GUESS=$UNAME_MACHINE-unknown-osf1
8309aa228fdSmrg	fi
831e39ce84cSmrg	;;
8329aa228fdSmrg    parisc*:Lites*:*:*)
833e39ce84cSmrg	GUESS=hppa1.1-hp-lites
834e39ce84cSmrg	;;
8359aa228fdSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
836e39ce84cSmrg	GUESS=c1-convex-bsd
837e39ce84cSmrg	;;
8389aa228fdSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
8399aa228fdSmrg	if getsysinfo -f scalar_acc
8409aa228fdSmrg	then echo c32-convex-bsd
8419aa228fdSmrg	else echo c2-convex-bsd
8429aa228fdSmrg	fi
84380b026c6Smrg	exit ;;
8449aa228fdSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
845e39ce84cSmrg	GUESS=c34-convex-bsd
846e39ce84cSmrg	;;
8479aa228fdSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
848e39ce84cSmrg	GUESS=c38-convex-bsd
849e39ce84cSmrg	;;
8509aa228fdSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
851e39ce84cSmrg	GUESS=c4-convex-bsd
852e39ce84cSmrg	;;
8539aa228fdSmrg    CRAY*Y-MP:*:*:*)
854e39ce84cSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
855e39ce84cSmrg	GUESS=ymp-cray-unicos$CRAY_REL
856e39ce84cSmrg	;;
8579aa228fdSmrg    CRAY*[A-Z]90:*:*:*)
858e39ce84cSmrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
8599aa228fdSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
8609aa228fdSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
8619aa228fdSmrg	      -e 's/\.[^.]*$/.X/'
8629aa228fdSmrg	exit ;;
8639aa228fdSmrg    CRAY*TS:*:*:*)
864e39ce84cSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
865e39ce84cSmrg	GUESS=t90-cray-unicos$CRAY_REL
866e39ce84cSmrg	;;
8679aa228fdSmrg    CRAY*T3E:*:*:*)
868e39ce84cSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
869e39ce84cSmrg	GUESS=alphaev5-cray-unicosmk$CRAY_REL
870e39ce84cSmrg	;;
8719aa228fdSmrg    CRAY*SV1:*:*:*)
872e39ce84cSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
873e39ce84cSmrg	GUESS=sv1-cray-unicos$CRAY_REL
874e39ce84cSmrg	;;
8759aa228fdSmrg    *:UNICOS/mp:*:*)
876e39ce84cSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
877e39ce84cSmrg	GUESS=craynv-cray-unicosmp$CRAY_REL
878e39ce84cSmrg	;;
8799aa228fdSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
880e39ce84cSmrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
881e39ce84cSmrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
882e39ce84cSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
883e39ce84cSmrg	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
884e39ce84cSmrg	;;
8859aa228fdSmrg    5000:UNIX_System_V:4.*:*)
886e39ce84cSmrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
887e39ce84cSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
888e39ce84cSmrg	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
889e39ce84cSmrg	;;
8909aa228fdSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
891e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
892e39ce84cSmrg	;;
8939aa228fdSmrg    sparc*:BSD/OS:*:*)
894e39ce84cSmrg	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
895e39ce84cSmrg	;;
8969aa228fdSmrg    *:BSD/OS:*:*)
897e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
898e39ce84cSmrg	;;
899e39ce84cSmrg    arm:FreeBSD:*:*)
900e39ce84cSmrg	UNAME_PROCESSOR=`uname -p`
901e39ce84cSmrg	set_cc_for_build
902e39ce84cSmrg	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
903e39ce84cSmrg	    | grep -q __ARM_PCS_VFP
904e39ce84cSmrg	then
905e39ce84cSmrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
906e39ce84cSmrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
907e39ce84cSmrg	else
908e39ce84cSmrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
909e39ce84cSmrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
910e39ce84cSmrg	fi
911e39ce84cSmrg	;;
9129aa228fdSmrg    *:FreeBSD:*:*)
91346374b8dSmrg	UNAME_PROCESSOR=`uname -p`
914e39ce84cSmrg	case $UNAME_PROCESSOR in
9159aa228fdSmrg	    amd64)
916e39ce84cSmrg		UNAME_PROCESSOR=x86_64 ;;
917e39ce84cSmrg	    i386)
918e39ce84cSmrg		UNAME_PROCESSOR=i586 ;;
9199aa228fdSmrg	esac
920e39ce84cSmrg	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
921e39ce84cSmrg	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
922e39ce84cSmrg	;;
9239aa228fdSmrg    i*:CYGWIN*:*)
924e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-cygwin
925e39ce84cSmrg	;;
9260c7e83b2Smrg    *:MINGW64*:*)
927e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-mingw64
928e39ce84cSmrg	;;
9298f65982aSmrg    *:MINGW*:*)
930e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-mingw32
931e39ce84cSmrg	;;
9320c7e83b2Smrg    *:MSYS*:*)
933e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-msys
934e39ce84cSmrg	;;
9359aa228fdSmrg    i*:PW*:*)
936e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-pw32
937e39ce84cSmrg	;;
93846374b8dSmrg    *:SerenityOS:*:*)
93946374b8dSmrg        GUESS=$UNAME_MACHINE-pc-serenity
94046374b8dSmrg        ;;
9418f65982aSmrg    *:Interix*:*)
942e39ce84cSmrg	case $UNAME_MACHINE in
9438f65982aSmrg	    x86)
944e39ce84cSmrg		GUESS=i586-pc-interix$UNAME_RELEASE
945e39ce84cSmrg		;;
9468f65982aSmrg	    authenticamd | genuineintel | EM64T)
947e39ce84cSmrg		GUESS=x86_64-unknown-interix$UNAME_RELEASE
948e39ce84cSmrg		;;
9498f65982aSmrg	    IA64)
950e39ce84cSmrg		GUESS=ia64-unknown-interix$UNAME_RELEASE
951e39ce84cSmrg		;;
9528f65982aSmrg	esac ;;
9539aa228fdSmrg    i*:UWIN*:*)
954e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-uwin
955e39ce84cSmrg	;;
9569aa228fdSmrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
957e39ce84cSmrg	GUESS=x86_64-pc-cygwin
958e39ce84cSmrg	;;
9599aa228fdSmrg    prep*:SunOS:5.*:*)
960e39ce84cSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
961e39ce84cSmrg	GUESS=powerpcle-unknown-solaris2$SUN_REL
962e39ce84cSmrg	;;
9639aa228fdSmrg    *:GNU:*:*)
9649aa228fdSmrg	# the GNU system
965e39ce84cSmrg	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
966e39ce84cSmrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
967e39ce84cSmrg	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
968e39ce84cSmrg	;;
9699aa228fdSmrg    *:GNU/*:*:*)
9709aa228fdSmrg	# other systems with GNU libc and userland
971e39ce84cSmrg	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
972e39ce84cSmrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
973e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
974e39ce84cSmrg	;;
97546374b8dSmrg    x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
97646374b8dSmrg	GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
97746374b8dSmrg	;;
97846374b8dSmrg    *:[Mm]anagarm:*:*)
97946374b8dSmrg	GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
98046374b8dSmrg	;;
981e39ce84cSmrg    *:Minix:*:*)
982e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-minix
983e39ce84cSmrg	;;
9840c7e83b2Smrg    aarch64:Linux:*:*)
98546374b8dSmrg	set_cc_for_build
98646374b8dSmrg	CPU=$UNAME_MACHINE
98746374b8dSmrg	LIBCABI=$LIBC
98846374b8dSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
98946374b8dSmrg	    ABI=64
99046374b8dSmrg	    sed 's/^	    //' << EOF > "$dummy.c"
99146374b8dSmrg	    #ifdef __ARM_EABI__
99246374b8dSmrg	    #ifdef __ARM_PCS_VFP
99346374b8dSmrg	    ABI=eabihf
99446374b8dSmrg	    #else
99546374b8dSmrg	    ABI=eabi
99646374b8dSmrg	    #endif
99746374b8dSmrg	    #endif
99846374b8dSmrgEOF
99946374b8dSmrg	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
100046374b8dSmrg	    eval "$cc_set_abi"
100146374b8dSmrg	    case $ABI in
100246374b8dSmrg		eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
100346374b8dSmrg	    esac
100446374b8dSmrg	fi
100546374b8dSmrg	GUESS=$CPU-unknown-linux-$LIBCABI
1006e39ce84cSmrg	;;
10070c7e83b2Smrg    aarch64_be:Linux:*:*)
10080c7e83b2Smrg	UNAME_MACHINE=aarch64_be
1009e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1010e39ce84cSmrg	;;
10118f65982aSmrg    alpha:Linux:*:*)
1012e39ce84cSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
10138f65982aSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
10148f65982aSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
10158f65982aSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
10168f65982aSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
10178f65982aSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
10188f65982aSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
10198f65982aSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
102080b026c6Smrg	esac
10218f65982aSmrg	objdump --private-headers /bin/sh | grep -q ld.so.1
1022e39ce84cSmrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
1023e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1024e39ce84cSmrg	;;
1025e39ce84cSmrg    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
1026e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1027e39ce84cSmrg	;;
10289aa228fdSmrg    arm*:Linux:*:*)
1029e39ce84cSmrg	set_cc_for_build
10308f65982aSmrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
10318f65982aSmrg	    | grep -q __ARM_EABI__
10328f65982aSmrg	then
1033e39ce84cSmrg	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10348f65982aSmrg	else
103580b026c6Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
103680b026c6Smrg		| grep -q __ARM_PCS_VFP
103780b026c6Smrg	    then
1038e39ce84cSmrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
103980b026c6Smrg	    else
1040e39ce84cSmrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
104180b026c6Smrg	    fi
10428f65982aSmrg	fi
1043e39ce84cSmrg	;;
10449aa228fdSmrg    avr32*:Linux:*:*)
1045e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1046e39ce84cSmrg	;;
10479aa228fdSmrg    cris:Linux:*:*)
1048e39ce84cSmrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1049e39ce84cSmrg	;;
10509aa228fdSmrg    crisv32:Linux:*:*)
1051e39ce84cSmrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1052e39ce84cSmrg	;;
1053e39ce84cSmrg    e2k:Linux:*:*)
1054e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1055e39ce84cSmrg	;;
10569aa228fdSmrg    frv:Linux:*:*)
1057e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1058e39ce84cSmrg	;;
105980b026c6Smrg    hexagon:Linux:*:*)
1060e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1061e39ce84cSmrg	;;
10628f65982aSmrg    i*86:Linux:*:*)
1063e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
1064e39ce84cSmrg	;;
10659aa228fdSmrg    ia64:Linux:*:*)
1066e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1067e39ce84cSmrg	;;
1068e39ce84cSmrg    k1om:Linux:*:*)
1069e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1070e39ce84cSmrg	;;
107146374b8dSmrg    kvx:Linux:*:*)
107246374b8dSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
107346374b8dSmrg	;;
107446374b8dSmrg    kvx:cos:*:*)
107546374b8dSmrg	GUESS=$UNAME_MACHINE-unknown-cos
107646374b8dSmrg	;;
107746374b8dSmrg    kvx:mbr:*:*)
107846374b8dSmrg	GUESS=$UNAME_MACHINE-unknown-mbr
107946374b8dSmrg	;;
108046374b8dSmrg    loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1081e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1082e39ce84cSmrg	;;
10839aa228fdSmrg    m32r*:Linux:*:*)
1084e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1085e39ce84cSmrg	;;
10869aa228fdSmrg    m68*:Linux:*:*)
1087e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1088e39ce84cSmrg	;;
10898f65982aSmrg    mips:Linux:*:* | mips64:Linux:*:*)
1090e39ce84cSmrg	set_cc_for_build
1091e39ce84cSmrg	IS_GLIBC=0
1092e39ce84cSmrg	test x"${LIBC}" = xgnu && IS_GLIBC=1
1093e39ce84cSmrg	sed 's/^	//' << EOF > "$dummy.c"
10949aa228fdSmrg	#undef CPU
1095e39ce84cSmrg	#undef mips
1096e39ce84cSmrg	#undef mipsel
1097e39ce84cSmrg	#undef mips64
1098e39ce84cSmrg	#undef mips64el
1099e39ce84cSmrg	#if ${IS_GLIBC} && defined(_ABI64)
1100e39ce84cSmrg	LIBCABI=gnuabi64
1101e39ce84cSmrg	#else
1102e39ce84cSmrg	#if ${IS_GLIBC} && defined(_ABIN32)
1103e39ce84cSmrg	LIBCABI=gnuabin32
1104e39ce84cSmrg	#else
1105e39ce84cSmrg	LIBCABI=${LIBC}
1106e39ce84cSmrg	#endif
1107e39ce84cSmrg	#endif
1108e39ce84cSmrg
1109e39ce84cSmrg	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1110e39ce84cSmrg	CPU=mipsisa64r6
1111e39ce84cSmrg	#else
1112e39ce84cSmrg	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1113e39ce84cSmrg	CPU=mipsisa32r6
1114e39ce84cSmrg	#else
1115e39ce84cSmrg	#if defined(__mips64)
1116e39ce84cSmrg	CPU=mips64
1117e39ce84cSmrg	#else
1118e39ce84cSmrg	CPU=mips
1119e39ce84cSmrg	#endif
1120e39ce84cSmrg	#endif
1121e39ce84cSmrg	#endif
1122e39ce84cSmrg
11239aa228fdSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1124e39ce84cSmrg	MIPS_ENDIAN=el
11259aa228fdSmrg	#else
11269aa228fdSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1127e39ce84cSmrg	MIPS_ENDIAN=
11289aa228fdSmrg	#else
1129e39ce84cSmrg	MIPS_ENDIAN=
11309aa228fdSmrg	#endif
11319aa228fdSmrg	#endif
11329aa228fdSmrgEOF
1133e39ce84cSmrg	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
1134e39ce84cSmrg	eval "$cc_set_vars"
1135e39ce84cSmrg	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1136e39ce84cSmrg	;;
1137e39ce84cSmrg    mips64el:Linux:*:*)
1138e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
11399aa228fdSmrg	;;
11400c7e83b2Smrg    openrisc*:Linux:*:*)
1141e39ce84cSmrg	GUESS=or1k-unknown-linux-$LIBC
1142e39ce84cSmrg	;;
11430c7e83b2Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
1144e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1145e39ce84cSmrg	;;
11468f65982aSmrg    padre:Linux:*:*)
1147e39ce84cSmrg	GUESS=sparc-unknown-linux-$LIBC
1148e39ce84cSmrg	;;
11498f65982aSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
1150e39ce84cSmrg	GUESS=hppa64-unknown-linux-$LIBC
1151e39ce84cSmrg	;;
11529aa228fdSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
11539aa228fdSmrg	# Look for CPU level
11549aa228fdSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1155e39ce84cSmrg	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
1156e39ce84cSmrg	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
1157e39ce84cSmrg	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
11589aa228fdSmrg	esac
1159e39ce84cSmrg	;;
11608f65982aSmrg    ppc64:Linux:*:*)
1161e39ce84cSmrg	GUESS=powerpc64-unknown-linux-$LIBC
1162e39ce84cSmrg	;;
11638f65982aSmrg    ppc:Linux:*:*)
1164e39ce84cSmrg	GUESS=powerpc-unknown-linux-$LIBC
1165e39ce84cSmrg	;;
11660c7e83b2Smrg    ppc64le:Linux:*:*)
1167e39ce84cSmrg	GUESS=powerpc64le-unknown-linux-$LIBC
1168e39ce84cSmrg	;;
11690c7e83b2Smrg    ppcle:Linux:*:*)
1170e39ce84cSmrg	GUESS=powerpcle-unknown-linux-$LIBC
1171e39ce84cSmrg	;;
1172e39ce84cSmrg    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1173e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1174e39ce84cSmrg	;;
11759aa228fdSmrg    s390:Linux:*:* | s390x:Linux:*:*)
1176e39ce84cSmrg	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
1177e39ce84cSmrg	;;
11789aa228fdSmrg    sh64*:Linux:*:*)
1179e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1180e39ce84cSmrg	;;
11819aa228fdSmrg    sh*:Linux:*:*)
1182e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1183e39ce84cSmrg	;;
11849aa228fdSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
1185e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1186e39ce84cSmrg	;;
11878f65982aSmrg    tile*:Linux:*:*)
1188e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1189e39ce84cSmrg	;;
11909aa228fdSmrg    vax:Linux:*:*)
1191e39ce84cSmrg	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
1192e39ce84cSmrg	;;
11939aa228fdSmrg    x86_64:Linux:*:*)
1194e39ce84cSmrg	set_cc_for_build
119546374b8dSmrg	CPU=$UNAME_MACHINE
1196e39ce84cSmrg	LIBCABI=$LIBC
1197e39ce84cSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
119846374b8dSmrg	    ABI=64
119946374b8dSmrg	    sed 's/^	    //' << EOF > "$dummy.c"
120046374b8dSmrg	    #ifdef __i386__
120146374b8dSmrg	    ABI=x86
120246374b8dSmrg	    #else
120346374b8dSmrg	    #ifdef __ILP32__
120446374b8dSmrg	    ABI=x32
120546374b8dSmrg	    #endif
120646374b8dSmrg	    #endif
120746374b8dSmrgEOF
120846374b8dSmrg	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
120946374b8dSmrg	    eval "$cc_set_abi"
121046374b8dSmrg	    case $ABI in
121146374b8dSmrg		x86) CPU=i686 ;;
121246374b8dSmrg		x32) LIBCABI=${LIBC}x32 ;;
121346374b8dSmrg	    esac
1214e39ce84cSmrg	fi
121546374b8dSmrg	GUESS=$CPU-pc-linux-$LIBCABI
1216e39ce84cSmrg	;;
12178f65982aSmrg    xtensa*:Linux:*:*)
1218e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1219e39ce84cSmrg	;;
12209aa228fdSmrg    i*86:DYNIX/ptx:4*:*)
12219aa228fdSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
12229aa228fdSmrg	# earlier versions are messed up and put the nodename in both
12239aa228fdSmrg	# sysname and nodename.
1224e39ce84cSmrg	GUESS=i386-sequent-sysv4
1225e39ce84cSmrg	;;
12269aa228fdSmrg    i*86:UNIX_SV:4.2MP:2.*)
122780b026c6Smrg	# Unixware is an offshoot of SVR4, but it has its own version
122880b026c6Smrg	# number series starting with 2...
122980b026c6Smrg	# I am not positive that other SVR4 systems won't match this,
12309aa228fdSmrg	# I just have to hope.  -- rms.
123180b026c6Smrg	# Use sysv4.2uw... so that sysv4* matches it.
1232e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
1233e39ce84cSmrg	;;
12349aa228fdSmrg    i*86:OS/2:*:*)
123546374b8dSmrg	# If we were able to find 'uname', then EMX Unix compatibility
12369aa228fdSmrg	# is probably installed.
1237e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-os2-emx
1238e39ce84cSmrg	;;
12399aa228fdSmrg    i*86:XTS-300:*:STOP)
1240e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-stop
1241e39ce84cSmrg	;;
12429aa228fdSmrg    i*86:atheos:*:*)
1243e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-atheos
1244e39ce84cSmrg	;;
12459aa228fdSmrg    i*86:syllable:*:*)
1246e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-syllable
1247e39ce84cSmrg	;;
12488f65982aSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1249e39ce84cSmrg	GUESS=i386-unknown-lynxos$UNAME_RELEASE
1250e39ce84cSmrg	;;
12519aa228fdSmrg    i*86:*DOS:*:*)
1252e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
1253e39ce84cSmrg	;;
1254e39ce84cSmrg    i*86:*:4.*:*)
1255e39ce84cSmrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
12569aa228fdSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1257e39ce84cSmrg		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
12589aa228fdSmrg	else
1259e39ce84cSmrg		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
12609aa228fdSmrg	fi
1261e39ce84cSmrg	;;
12629aa228fdSmrg    i*86:*:5:[678]*)
126380b026c6Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
12649aa228fdSmrg	case `/bin/uname -X | grep "^Machine"` in
12659aa228fdSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
12669aa228fdSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
12679aa228fdSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
12689aa228fdSmrg	esac
1269e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1270e39ce84cSmrg	;;
12719aa228fdSmrg    i*86:*:3.2:*)
12729aa228fdSmrg	if test -f /usr/options/cb.name; then
12739aa228fdSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1274e39ce84cSmrg		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
12759aa228fdSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
12769aa228fdSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
12779aa228fdSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
12789aa228fdSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
12799aa228fdSmrg			&& UNAME_MACHINE=i586
12809aa228fdSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
12819aa228fdSmrg			&& UNAME_MACHINE=i686
12829aa228fdSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
12839aa228fdSmrg			&& UNAME_MACHINE=i686
1284e39ce84cSmrg		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
12859aa228fdSmrg	else
1286e39ce84cSmrg		GUESS=$UNAME_MACHINE-pc-sysv32
12879aa228fdSmrg	fi
1288e39ce84cSmrg	;;
12899aa228fdSmrg    pc:*:*:*)
12909aa228fdSmrg	# Left here for compatibility:
129180b026c6Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
129280b026c6Smrg	# the processor, so we play safe by assuming i586.
12938f65982aSmrg	# Note: whatever this is, it MUST be the same as what config.sub
1294e39ce84cSmrg	# prints for the "djgpp" host, or else GDB configure will decide that
12958f65982aSmrg	# this is a cross-build.
1296e39ce84cSmrg	GUESS=i586-pc-msdosdjgpp
1297e39ce84cSmrg	;;
12989aa228fdSmrg    Intel:Mach:3*:*)
1299e39ce84cSmrg	GUESS=i386-pc-mach3
1300e39ce84cSmrg	;;
13019aa228fdSmrg    paragon:*:*:*)
1302e39ce84cSmrg	GUESS=i860-intel-osf1
1303e39ce84cSmrg	;;
13049aa228fdSmrg    i860:*:4.*:*) # i860-SVR4
13059aa228fdSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1306e39ce84cSmrg	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
13079aa228fdSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
1308e39ce84cSmrg	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
13099aa228fdSmrg	fi
1310e39ce84cSmrg	;;
13119aa228fdSmrg    mini*:CTIX:SYS*5:*)
13129aa228fdSmrg	# "miniframe"
1313e39ce84cSmrg	GUESS=m68010-convergent-sysv
1314e39ce84cSmrg	;;
13159aa228fdSmrg    mc68k:UNIX:SYSTEM5:3.51m)
1316e39ce84cSmrg	GUESS=m68k-convergent-sysv
1317e39ce84cSmrg	;;
13189aa228fdSmrg    M680?0:D-NIX:5.3:*)
1319e39ce84cSmrg	GUESS=m68k-diab-dnix
1320e39ce84cSmrg	;;
13219aa228fdSmrg    M68*:*:R3V[5678]*:*)
13229aa228fdSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
13239aa228fdSmrg    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)
13249aa228fdSmrg	OS_REL=''
13259aa228fdSmrg	test -r /etc/.relid \
13269aa228fdSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
13279aa228fdSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1328e39ce84cSmrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
13299aa228fdSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1330e39ce84cSmrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
13319aa228fdSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
133280b026c6Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
133380b026c6Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
13348f65982aSmrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
13358f65982aSmrg	OS_REL='.3'
13368f65982aSmrg	test -r /etc/.relid \
13378f65982aSmrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
13388f65982aSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1339e39ce84cSmrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
13408f65982aSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1341e39ce84cSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
13428f65982aSmrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1343e39ce84cSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
13449aa228fdSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1345e39ce84cSmrg	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
1346e39ce84cSmrg	;;
13479aa228fdSmrg    mc68030:UNIX_System_V:4.*:*)
1348e39ce84cSmrg	GUESS=m68k-atari-sysv4
1349e39ce84cSmrg	;;
13509aa228fdSmrg    TSUNAMI:LynxOS:2.*:*)
1351e39ce84cSmrg	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
1352e39ce84cSmrg	;;
13539aa228fdSmrg    rs6000:LynxOS:2.*:*)
1354e39ce84cSmrg	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
1355e39ce84cSmrg	;;
13568f65982aSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1357e39ce84cSmrg	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
1358e39ce84cSmrg	;;
13599aa228fdSmrg    SM[BE]S:UNIX_SV:*:*)
1360e39ce84cSmrg	GUESS=mips-dde-sysv$UNAME_RELEASE
1361e39ce84cSmrg	;;
13629aa228fdSmrg    RM*:ReliantUNIX-*:*:*)
1363e39ce84cSmrg	GUESS=mips-sni-sysv4
1364e39ce84cSmrg	;;
13659aa228fdSmrg    RM*:SINIX-*:*:*)
1366e39ce84cSmrg	GUESS=mips-sni-sysv4
1367e39ce84cSmrg	;;
13689aa228fdSmrg    *:SINIX-*:*:*)
13699aa228fdSmrg	if uname -p 2>/dev/null >/dev/null ; then
13709aa228fdSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1371e39ce84cSmrg		GUESS=$UNAME_MACHINE-sni-sysv4
13729aa228fdSmrg	else
1373e39ce84cSmrg		GUESS=ns32k-sni-sysv
13749aa228fdSmrg	fi
1375e39ce84cSmrg	;;
137646374b8dSmrg    PENTIUM:*:4.0*:*)	# Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
137780b026c6Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
1378e39ce84cSmrg	GUESS=i586-unisys-sysv4
1379e39ce84cSmrg	;;
13809aa228fdSmrg    *:UNIX_System_V:4*:FTX*)
13819aa228fdSmrg	# From Gerald Hewes <hewes@openmarket.com>.
13829aa228fdSmrg	# How about differentiating between stratus architectures? -djm
1383e39ce84cSmrg	GUESS=hppa1.1-stratus-sysv4
1384e39ce84cSmrg	;;
13859aa228fdSmrg    *:*:*:FTX*)
13869aa228fdSmrg	# From seanf@swdc.stratus.com.
1387e39ce84cSmrg	GUESS=i860-stratus-sysv4
1388e39ce84cSmrg	;;
13899aa228fdSmrg    i*86:VOS:*:*)
13909aa228fdSmrg	# From Paul.Green@stratus.com.
1391e39ce84cSmrg	GUESS=$UNAME_MACHINE-stratus-vos
1392e39ce84cSmrg	;;
13939aa228fdSmrg    *:VOS:*:*)
13949aa228fdSmrg	# From Paul.Green@stratus.com.
1395e39ce84cSmrg	GUESS=hppa1.1-stratus-vos
1396e39ce84cSmrg	;;
13979aa228fdSmrg    mc68*:A/UX:*:*)
1398e39ce84cSmrg	GUESS=m68k-apple-aux$UNAME_RELEASE
1399e39ce84cSmrg	;;
14009aa228fdSmrg    news*:NEWS-OS:6*:*)
1401e39ce84cSmrg	GUESS=mips-sony-newsos6
1402e39ce84cSmrg	;;
14039aa228fdSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1404e39ce84cSmrg	if test -d /usr/nec; then
1405e39ce84cSmrg		GUESS=mips-nec-sysv$UNAME_RELEASE
14069aa228fdSmrg	else
1407e39ce84cSmrg		GUESS=mips-unknown-sysv$UNAME_RELEASE
14089aa228fdSmrg	fi
1409e39ce84cSmrg	;;
14109aa228fdSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1411e39ce84cSmrg	GUESS=powerpc-be-beos
1412e39ce84cSmrg	;;
14139aa228fdSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1414e39ce84cSmrg	GUESS=powerpc-apple-beos
1415e39ce84cSmrg	;;
14169aa228fdSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1417e39ce84cSmrg	GUESS=i586-pc-beos
1418e39ce84cSmrg	;;
14198f65982aSmrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1420e39ce84cSmrg	GUESS=i586-pc-haiku
1421e39ce84cSmrg	;;
142246374b8dSmrg    ppc:Haiku:*:*)	# Haiku running on Apple PowerPC
142346374b8dSmrg	GUESS=powerpc-apple-haiku
142446374b8dSmrg	;;
142546374b8dSmrg    *:Haiku:*:*)	# Haiku modern gcc (not bound by BeOS compat)
142646374b8dSmrg	GUESS=$UNAME_MACHINE-unknown-haiku
1427e39ce84cSmrg	;;
14289aa228fdSmrg    SX-4:SUPER-UX:*:*)
1429e39ce84cSmrg	GUESS=sx4-nec-superux$UNAME_RELEASE
1430e39ce84cSmrg	;;
14319aa228fdSmrg    SX-5:SUPER-UX:*:*)
1432e39ce84cSmrg	GUESS=sx5-nec-superux$UNAME_RELEASE
1433e39ce84cSmrg	;;
14349aa228fdSmrg    SX-6:SUPER-UX:*:*)
1435e39ce84cSmrg	GUESS=sx6-nec-superux$UNAME_RELEASE
1436e39ce84cSmrg	;;
14378f65982aSmrg    SX-7:SUPER-UX:*:*)
1438e39ce84cSmrg	GUESS=sx7-nec-superux$UNAME_RELEASE
1439e39ce84cSmrg	;;
14408f65982aSmrg    SX-8:SUPER-UX:*:*)
1441e39ce84cSmrg	GUESS=sx8-nec-superux$UNAME_RELEASE
1442e39ce84cSmrg	;;
14438f65982aSmrg    SX-8R:SUPER-UX:*:*)
1444e39ce84cSmrg	GUESS=sx8r-nec-superux$UNAME_RELEASE
1445e39ce84cSmrg	;;
1446e39ce84cSmrg    SX-ACE:SUPER-UX:*:*)
1447e39ce84cSmrg	GUESS=sxace-nec-superux$UNAME_RELEASE
1448e39ce84cSmrg	;;
14499aa228fdSmrg    Power*:Rhapsody:*:*)
1450e39ce84cSmrg	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
1451e39ce84cSmrg	;;
14529aa228fdSmrg    *:Rhapsody:*:*)
1453e39ce84cSmrg	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
1454e39ce84cSmrg	;;
1455e39ce84cSmrg    arm64:Darwin:*:*)
1456e39ce84cSmrg	GUESS=aarch64-apple-darwin$UNAME_RELEASE
1457e39ce84cSmrg	;;
14589aa228fdSmrg    *:Darwin:*:*)
1459e39ce84cSmrg	UNAME_PROCESSOR=`uname -p`
1460e39ce84cSmrg	case $UNAME_PROCESSOR in
1461e39ce84cSmrg	    unknown) UNAME_PROCESSOR=powerpc ;;
1462e39ce84cSmrg	esac
1463e39ce84cSmrg	if command -v xcode-select > /dev/null 2> /dev/null && \
1464e39ce84cSmrg		! xcode-select --print-path > /dev/null 2> /dev/null ; then
1465e39ce84cSmrg	    # Avoid executing cc if there is no toolchain installed as
1466e39ce84cSmrg	    # cc will be a stub that puts up a graphical alert
1467e39ce84cSmrg	    # prompting the user to install developer tools.
1468e39ce84cSmrg	    CC_FOR_BUILD=no_compiler_found
1469e39ce84cSmrg	else
1470e39ce84cSmrg	    set_cc_for_build
14710c7e83b2Smrg	fi
1472e39ce84cSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
1473e39ce84cSmrg	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1474e39ce84cSmrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1475e39ce84cSmrg		   grep IS_64BIT_ARCH >/dev/null
1476e39ce84cSmrg	    then
1477e39ce84cSmrg		case $UNAME_PROCESSOR in
1478e39ce84cSmrg		    i386) UNAME_PROCESSOR=x86_64 ;;
1479e39ce84cSmrg		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1480e39ce84cSmrg		esac
1481e39ce84cSmrg	    fi
1482e39ce84cSmrg	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1483e39ce84cSmrg	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1484e39ce84cSmrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1485e39ce84cSmrg		   grep IS_PPC >/dev/null
1486e39ce84cSmrg	    then
1487e39ce84cSmrg		UNAME_PROCESSOR=powerpc
14880c7e83b2Smrg	    fi
14890c7e83b2Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
1490e39ce84cSmrg	    # uname -m returns i386 or x86_64
1491e39ce84cSmrg	    UNAME_PROCESSOR=$UNAME_MACHINE
14920c7e83b2Smrg	fi
1493e39ce84cSmrg	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
1494e39ce84cSmrg	;;
14959aa228fdSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
14969aa228fdSmrg	UNAME_PROCESSOR=`uname -p`
1497e39ce84cSmrg	if test "$UNAME_PROCESSOR" = x86; then
14989aa228fdSmrg		UNAME_PROCESSOR=i386
14999aa228fdSmrg		UNAME_MACHINE=pc
15009aa228fdSmrg	fi
1501e39ce84cSmrg	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
1502e39ce84cSmrg	;;
15039aa228fdSmrg    *:QNX:*:4*)
1504e39ce84cSmrg	GUESS=i386-pc-qnx
1505e39ce84cSmrg	;;
1506e39ce84cSmrg    NEO-*:NONSTOP_KERNEL:*:*)
1507e39ce84cSmrg	GUESS=neo-tandem-nsk$UNAME_RELEASE
1508e39ce84cSmrg	;;
15090c7e83b2Smrg    NSE-*:NONSTOP_KERNEL:*:*)
1510e39ce84cSmrg	GUESS=nse-tandem-nsk$UNAME_RELEASE
1511e39ce84cSmrg	;;
1512e39ce84cSmrg    NSR-*:NONSTOP_KERNEL:*:*)
1513e39ce84cSmrg	GUESS=nsr-tandem-nsk$UNAME_RELEASE
1514e39ce84cSmrg	;;
1515e39ce84cSmrg    NSV-*:NONSTOP_KERNEL:*:*)
1516e39ce84cSmrg	GUESS=nsv-tandem-nsk$UNAME_RELEASE
1517e39ce84cSmrg	;;
1518e39ce84cSmrg    NSX-*:NONSTOP_KERNEL:*:*)
1519e39ce84cSmrg	GUESS=nsx-tandem-nsk$UNAME_RELEASE
1520e39ce84cSmrg	;;
15219aa228fdSmrg    *:NonStop-UX:*:*)
1522e39ce84cSmrg	GUESS=mips-compaq-nonstopux
1523e39ce84cSmrg	;;
15249aa228fdSmrg    BS2000:POSIX*:*:*)
1525e39ce84cSmrg	GUESS=bs2000-siemens-sysv
1526e39ce84cSmrg	;;
15279aa228fdSmrg    DS/*:UNIX_System_V:*:*)
1528e39ce84cSmrg	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
1529e39ce84cSmrg	;;
15309aa228fdSmrg    *:Plan9:*:*)
15319aa228fdSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
15329aa228fdSmrg	# is converted to i386 for consistency with other x86
15339aa228fdSmrg	# operating systems.
1534e39ce84cSmrg	if test "${cputype-}" = 386; then
15359aa228fdSmrg	    UNAME_MACHINE=i386
1536e39ce84cSmrg	elif test "x${cputype-}" != x; then
1537e39ce84cSmrg	    UNAME_MACHINE=$cputype
15389aa228fdSmrg	fi
1539e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-plan9
1540e39ce84cSmrg	;;
15419aa228fdSmrg    *:TOPS-10:*:*)
1542e39ce84cSmrg	GUESS=pdp10-unknown-tops10
1543e39ce84cSmrg	;;
15449aa228fdSmrg    *:TENEX:*:*)
1545e39ce84cSmrg	GUESS=pdp10-unknown-tenex
1546e39ce84cSmrg	;;
15479aa228fdSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1548e39ce84cSmrg	GUESS=pdp10-dec-tops20
1549e39ce84cSmrg	;;
15509aa228fdSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1551e39ce84cSmrg	GUESS=pdp10-xkl-tops20
1552e39ce84cSmrg	;;
15539aa228fdSmrg    *:TOPS-20:*:*)
1554e39ce84cSmrg	GUESS=pdp10-unknown-tops20
1555e39ce84cSmrg	;;
15569aa228fdSmrg    *:ITS:*:*)
1557e39ce84cSmrg	GUESS=pdp10-unknown-its
1558e39ce84cSmrg	;;
15599aa228fdSmrg    SEI:*:*:SEIUX)
1560e39ce84cSmrg	GUESS=mips-sei-seiux$UNAME_RELEASE
1561e39ce84cSmrg	;;
15629aa228fdSmrg    *:DragonFly:*:*)
1563e39ce84cSmrg	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
1564e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
1565e39ce84cSmrg	;;
15669aa228fdSmrg    *:*VMS:*:*)
156780b026c6Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1568e39ce84cSmrg	case $UNAME_MACHINE in
1569e39ce84cSmrg	    A*) GUESS=alpha-dec-vms ;;
1570e39ce84cSmrg	    I*) GUESS=ia64-dec-vms ;;
1571e39ce84cSmrg	    V*) GUESS=vax-dec-vms ;;
15729aa228fdSmrg	esac ;;
15739aa228fdSmrg    *:XENIX:*:SysV)
1574e39ce84cSmrg	GUESS=i386-pc-xenix
1575e39ce84cSmrg	;;
15769aa228fdSmrg    i*86:skyos:*:*)
1577e39ce84cSmrg	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
1578e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
1579e39ce84cSmrg	;;
15809aa228fdSmrg    i*86:rdos:*:*)
1581e39ce84cSmrg	GUESS=$UNAME_MACHINE-pc-rdos
1582e39ce84cSmrg	;;
158346374b8dSmrg    i*86:Fiwix:*:*)
158446374b8dSmrg	GUESS=$UNAME_MACHINE-pc-fiwix
158546374b8dSmrg	;;
1586e39ce84cSmrg    *:AROS:*:*)
1587e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-aros
1588e39ce84cSmrg	;;
15890c7e83b2Smrg    x86_64:VMkernel:*:*)
1590e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-esx
1591e39ce84cSmrg	;;
1592e39ce84cSmrg    amd64:Isilon\ OneFS:*:*)
1593e39ce84cSmrg	GUESS=x86_64-unknown-onefs
1594e39ce84cSmrg	;;
1595e39ce84cSmrg    *:Unleashed:*:*)
1596e39ce84cSmrg	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
1597e39ce84cSmrg	;;
159846374b8dSmrg    *:Ironclad:*:*)
159946374b8dSmrg	GUESS=$UNAME_MACHINE-unknown-ironclad
160046374b8dSmrg	;;
1601e39ce84cSmrgesac
1602e39ce84cSmrg
1603e39ce84cSmrg# Do we have a guess based on uname results?
1604e39ce84cSmrgif test "x$GUESS" != x; then
1605e39ce84cSmrg    echo "$GUESS"
1606e39ce84cSmrg    exit
1607e39ce84cSmrgfi
1608e39ce84cSmrg
1609e39ce84cSmrg# No uname command or uname output not recognized.
1610e39ce84cSmrgset_cc_for_build
1611e39ce84cSmrgcat > "$dummy.c" <<EOF
1612e39ce84cSmrg#ifdef _SEQUENT_
1613e39ce84cSmrg#include <sys/types.h>
1614e39ce84cSmrg#include <sys/utsname.h>
1615e39ce84cSmrg#endif
1616e39ce84cSmrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1617e39ce84cSmrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1618e39ce84cSmrg#include <signal.h>
1619e39ce84cSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1620e39ce84cSmrg#include <sys/utsname.h>
1621e39ce84cSmrg#endif
1622e39ce84cSmrg#endif
1623e39ce84cSmrg#endif
1624e39ce84cSmrgmain ()
1625e39ce84cSmrg{
1626e39ce84cSmrg#if defined (sony)
1627e39ce84cSmrg#if defined (MIPSEB)
1628e39ce84cSmrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1629e39ce84cSmrg     I don't know....  */
1630e39ce84cSmrg  printf ("mips-sony-bsd\n"); exit (0);
1631e39ce84cSmrg#else
1632e39ce84cSmrg#include <sys/param.h>
1633e39ce84cSmrg  printf ("m68k-sony-newsos%s\n",
1634e39ce84cSmrg#ifdef NEWSOS4
1635e39ce84cSmrg  "4"
1636e39ce84cSmrg#else
1637e39ce84cSmrg  ""
1638e39ce84cSmrg#endif
1639e39ce84cSmrg  ); exit (0);
1640e39ce84cSmrg#endif
1641e39ce84cSmrg#endif
1642e39ce84cSmrg
1643e39ce84cSmrg#if defined (NeXT)
1644e39ce84cSmrg#if !defined (__ARCHITECTURE__)
1645e39ce84cSmrg#define __ARCHITECTURE__ "m68k"
1646e39ce84cSmrg#endif
1647e39ce84cSmrg  int version;
1648e39ce84cSmrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1649e39ce84cSmrg  if (version < 4)
1650e39ce84cSmrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1651e39ce84cSmrg  else
1652e39ce84cSmrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1653e39ce84cSmrg  exit (0);
1654e39ce84cSmrg#endif
1655e39ce84cSmrg
1656e39ce84cSmrg#if defined (MULTIMAX) || defined (n16)
1657e39ce84cSmrg#if defined (UMAXV)
1658e39ce84cSmrg  printf ("ns32k-encore-sysv\n"); exit (0);
1659e39ce84cSmrg#else
1660e39ce84cSmrg#if defined (CMU)
1661e39ce84cSmrg  printf ("ns32k-encore-mach\n"); exit (0);
1662e39ce84cSmrg#else
1663e39ce84cSmrg  printf ("ns32k-encore-bsd\n"); exit (0);
1664e39ce84cSmrg#endif
1665e39ce84cSmrg#endif
1666e39ce84cSmrg#endif
1667e39ce84cSmrg
1668e39ce84cSmrg#if defined (__386BSD__)
1669e39ce84cSmrg  printf ("i386-pc-bsd\n"); exit (0);
1670e39ce84cSmrg#endif
1671e39ce84cSmrg
1672e39ce84cSmrg#if defined (sequent)
1673e39ce84cSmrg#if defined (i386)
1674e39ce84cSmrg  printf ("i386-sequent-dynix\n"); exit (0);
1675e39ce84cSmrg#endif
1676e39ce84cSmrg#if defined (ns32000)
1677e39ce84cSmrg  printf ("ns32k-sequent-dynix\n"); exit (0);
1678e39ce84cSmrg#endif
1679e39ce84cSmrg#endif
1680e39ce84cSmrg
1681e39ce84cSmrg#if defined (_SEQUENT_)
1682e39ce84cSmrg  struct utsname un;
1683e39ce84cSmrg
1684e39ce84cSmrg  uname(&un);
1685e39ce84cSmrg  if (strncmp(un.version, "V2", 2) == 0) {
1686e39ce84cSmrg    printf ("i386-sequent-ptx2\n"); exit (0);
1687e39ce84cSmrg  }
1688e39ce84cSmrg  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1689e39ce84cSmrg    printf ("i386-sequent-ptx1\n"); exit (0);
1690e39ce84cSmrg  }
1691e39ce84cSmrg  printf ("i386-sequent-ptx\n"); exit (0);
1692e39ce84cSmrg#endif
1693e39ce84cSmrg
1694e39ce84cSmrg#if defined (vax)
1695e39ce84cSmrg#if !defined (ultrix)
1696e39ce84cSmrg#include <sys/param.h>
1697e39ce84cSmrg#if defined (BSD)
1698e39ce84cSmrg#if BSD == 43
1699e39ce84cSmrg  printf ("vax-dec-bsd4.3\n"); exit (0);
1700e39ce84cSmrg#else
1701e39ce84cSmrg#if BSD == 199006
1702e39ce84cSmrg  printf ("vax-dec-bsd4.3reno\n"); exit (0);
1703e39ce84cSmrg#else
1704e39ce84cSmrg  printf ("vax-dec-bsd\n"); exit (0);
1705e39ce84cSmrg#endif
1706e39ce84cSmrg#endif
1707e39ce84cSmrg#else
1708e39ce84cSmrg  printf ("vax-dec-bsd\n"); exit (0);
1709e39ce84cSmrg#endif
1710e39ce84cSmrg#else
1711e39ce84cSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1712e39ce84cSmrg  struct utsname un;
1713e39ce84cSmrg  uname (&un);
1714e39ce84cSmrg  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1715e39ce84cSmrg#else
1716e39ce84cSmrg  printf ("vax-dec-ultrix\n"); exit (0);
1717e39ce84cSmrg#endif
1718e39ce84cSmrg#endif
1719e39ce84cSmrg#endif
1720e39ce84cSmrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1721e39ce84cSmrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1722e39ce84cSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1723e39ce84cSmrg  struct utsname *un;
1724e39ce84cSmrg  uname (&un);
1725e39ce84cSmrg  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1726e39ce84cSmrg#else
1727e39ce84cSmrg  printf ("mips-dec-ultrix\n"); exit (0);
1728e39ce84cSmrg#endif
1729e39ce84cSmrg#endif
1730e39ce84cSmrg#endif
1731e39ce84cSmrg
1732e39ce84cSmrg#if defined (alliant) && defined (i860)
1733e39ce84cSmrg  printf ("i860-alliant-bsd\n"); exit (0);
1734e39ce84cSmrg#endif
1735e39ce84cSmrg
1736e39ce84cSmrg  exit (1);
1737e39ce84cSmrg}
1738e39ce84cSmrgEOF
1739e39ce84cSmrg
1740e39ce84cSmrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
1741e39ce84cSmrg	{ echo "$SYSTEM_NAME"; exit; }
1742e39ce84cSmrg
1743e39ce84cSmrg# Apollos put the system type in the environment.
1744e39ce84cSmrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1745e39ce84cSmrg
1746e39ce84cSmrgecho "$0: unable to guess system type" >&2
1747e39ce84cSmrg
1748e39ce84cSmrgcase $UNAME_MACHINE:$UNAME_SYSTEM in
1749e39ce84cSmrg    mips:Linux | mips64:Linux)
1750e39ce84cSmrg	# If we got here on MIPS GNU/Linux, output extra information.
1751e39ce84cSmrg	cat >&2 <<EOF
1752e39ce84cSmrg
1753e39ce84cSmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1754e39ce84cSmrgthe system type. Please install a C compiler and try again.
1755e39ce84cSmrgEOF
1756e39ce84cSmrg	;;
17570c7e83b2Smrgesac
17589aa228fdSmrg
17599aa228fdSmrgcat >&2 <<EOF
17609aa228fdSmrg
1761e39ce84cSmrgThis script (version $timestamp), has failed to recognize the
1762e39ce84cSmrgoperating system you are using. If your script is old, overwrite *all*
1763e39ce84cSmrgcopies of config.guess and config.sub with the latest versions from:
17649aa228fdSmrg
1765e39ce84cSmrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
17669aa228fdSmrgand
1767e39ce84cSmrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1768e39ce84cSmrgEOF
17699aa228fdSmrg
1770e39ce84cSmrgour_year=`echo $timestamp | sed 's,-.*,,'`
1771e39ce84cSmrgthisyear=`date +%Y`
1772e39ce84cSmrg# shellcheck disable=SC2003
1773e39ce84cSmrgscript_age=`expr "$thisyear" - "$our_year"`
1774e39ce84cSmrgif test "$script_age" -lt 3 ; then
1775e39ce84cSmrg   cat >&2 <<EOF
1776e39ce84cSmrg
1777e39ce84cSmrgIf $0 has already been updated, send the following data and any
1778e39ce84cSmrginformation you think might be pertinent to config-patches@gnu.org to
1779e39ce84cSmrgprovide the necessary information to handle your system.
17809aa228fdSmrg
17819aa228fdSmrgconfig.guess timestamp = $timestamp
17829aa228fdSmrg
17839aa228fdSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
17849aa228fdSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
17859aa228fdSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
17869aa228fdSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
17879aa228fdSmrg
17889aa228fdSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
17899aa228fdSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
17909aa228fdSmrg
17919aa228fdSmrghostinfo               = `(hostinfo) 2>/dev/null`
17929aa228fdSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
17939aa228fdSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
17949aa228fdSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
17959aa228fdSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
17969aa228fdSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
17979aa228fdSmrg
1798e39ce84cSmrgUNAME_MACHINE = "$UNAME_MACHINE"
1799e39ce84cSmrgUNAME_RELEASE = "$UNAME_RELEASE"
1800e39ce84cSmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
1801e39ce84cSmrgUNAME_VERSION = "$UNAME_VERSION"
18029aa228fdSmrgEOF
1803e39ce84cSmrgfi
18049aa228fdSmrg
18059aa228fdSmrgexit 1
18069aa228fdSmrg
18079aa228fdSmrg# Local variables:
1808e39ce84cSmrg# eval: (add-hook 'before-save-hook 'time-stamp)
18099aa228fdSmrg# time-stamp-start: "timestamp='"
18109aa228fdSmrg# time-stamp-format: "%:y-%02m-%02d"
18119aa228fdSmrg# time-stamp-end: "'"
18129aa228fdSmrg# End:
1813