xref: /openbsd/usr.sbin/unbound/config.guess (revision d896b962)
1a3167c07Ssthen#! /bin/sh
2933707f3Ssthen# Attempt to guess a canonical system name.
3*d896b962Ssthen#   Copyright 1992-2024 Free Software Foundation, Inc.
4933707f3Ssthen
5191f22c6Ssthen# shellcheck disable=SC2006,SC2268 # see below for rationale
6191f22c6Ssthen
7*d896b962Ssthentimestamp='2024-01-01'
8933707f3Ssthen
9933707f3Ssthen# This file is free software; you can redistribute it and/or modify it
10933707f3Ssthen# under the terms of the GNU General Public License as published by
11e21c60efSsthen# the Free Software Foundation, either version 3 of the License, or
12933707f3Ssthen# (at your option) any later version.
13933707f3Ssthen#
14933707f3Ssthen# This program is distributed in the hope that it will be useful, but
15933707f3Ssthen# WITHOUT ANY WARRANTY; without even the implied warranty of
16933707f3Ssthen# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17933707f3Ssthen# General Public License for more details.
18933707f3Ssthen#
19933707f3Ssthen# You should have received a copy of the GNU General Public License
20a3167c07Ssthen# along with this program; if not, see <https://www.gnu.org/licenses/>.
21933707f3Ssthen#
22933707f3Ssthen# As a special exception to the GNU General Public License, if you
23933707f3Ssthen# distribute this file as part of a program that contains a
24933707f3Ssthen# configuration script generated by Autoconf, you may include it under
2598f3ca02Sbrad# the same distribution terms that you use for the rest of that
2698f3ca02Sbrad# program.  This Exception is an additional permission under section 7
2798f3ca02Sbrad# of the GNU General Public License, version 3 ("GPLv3").
28933707f3Ssthen#
290990ddf5Ssthen# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
30933707f3Ssthen#
31933707f3Ssthen# You can get the latest version of this script from:
32eba819a2Ssthen# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
3398f3ca02Sbrad#
340990ddf5Ssthen# Please send patches to <config-patches@gnu.org>.
3598f3ca02Sbrad
36933707f3Ssthen
37191f22c6Ssthen# The "shellcheck disable" line above the timestamp inhibits complaints
38191f22c6Ssthen# about features and limitations of the classic Bourne shell that were
39191f22c6Ssthen# superseded or lifted in POSIX.  However, this script identifies a wide
40191f22c6Ssthen# variety of pre-POSIX systems that do not have POSIX shells at all, and
41191f22c6Ssthen# even some reasonably current systems (Solaris 10 as case-in-point) still
42191f22c6Ssthen# have a pre-POSIX /bin/sh.
43191f22c6Ssthen
44191f22c6Ssthen
45191f22c6Ssthenme=`echo "$0" | sed -e 's,.*/,,'`
46933707f3Ssthen
47933707f3Ssthenusage="\
48933707f3SsthenUsage: $0 [OPTION]
49933707f3Ssthen
508b7325afSsthenOutput the configuration name of the system '$me' is run on.
51933707f3Ssthen
52a3167c07SsthenOptions:
53933707f3Ssthen  -h, --help         print this help, then exit
54933707f3Ssthen  -t, --time-stamp   print date of last modification, then exit
55933707f3Ssthen  -v, --version      print version number, then exit
56933707f3Ssthen
57933707f3SsthenReport bugs and patches to <config-patches@gnu.org>."
58933707f3Ssthen
59933707f3Ssthenversion="\
60933707f3SsthenGNU config.guess ($timestamp)
61933707f3Ssthen
62933707f3SsthenOriginally written by Per Bothner.
63*d896b962SsthenCopyright 1992-2024 Free Software Foundation, Inc.
64933707f3Ssthen
65933707f3SsthenThis is free software; see the source for copying conditions.  There is NO
66933707f3Ssthenwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
67933707f3Ssthen
68933707f3Ssthenhelp="
698b7325afSsthenTry '$me --help' for more information."
70933707f3Ssthen
71933707f3Ssthen# Parse command line
72933707f3Ssthenwhile test $# -gt 0 ; do
73933707f3Ssthen  case $1 in
74933707f3Ssthen    --time-stamp | --time* | -t )
75933707f3Ssthen       echo "$timestamp" ; exit ;;
76933707f3Ssthen    --version | -v )
77933707f3Ssthen       echo "$version" ; exit ;;
78933707f3Ssthen    --help | --h* | -h )
79933707f3Ssthen       echo "$usage"; exit ;;
80933707f3Ssthen    -- )     # Stop option processing
81933707f3Ssthen       shift; break ;;
82933707f3Ssthen    - )	# Use stdin as input.
83933707f3Ssthen       break ;;
84933707f3Ssthen    -* )
85933707f3Ssthen       echo "$me: invalid option $1$help" >&2
86933707f3Ssthen       exit 1 ;;
87933707f3Ssthen    * )
88933707f3Ssthen       break ;;
89933707f3Ssthen  esac
90933707f3Ssthendone
91933707f3Ssthen
92933707f3Ssthenif test $# != 0; then
93933707f3Ssthen  echo "$me: too many arguments$help" >&2
94933707f3Ssthen  exit 1
95933707f3Ssthenfi
96933707f3Ssthen
97191f22c6Ssthen# Just in case it came from the environment.
98191f22c6SsthenGUESS=
99191f22c6Ssthen
100933707f3Ssthen# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
101933707f3Ssthen# compiler to aid in system detection is discouraged as it requires
102933707f3Ssthen# temporary files to be created and, as you can see below, it is a
103933707f3Ssthen# headache to deal with in a portable fashion.
104933707f3Ssthen
1058b7325afSsthen# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
1068b7325afSsthen# use 'HOST_CC' if defined, but it is deprecated.
107933707f3Ssthen
108933707f3Ssthen# Portable tmp directory creation inspired by the Autoconf team.
109933707f3Ssthen
110a3167c07Ssthentmp=
111a3167c07Ssthen# shellcheck disable=SC2172
112a3167c07Ssthentrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
113a3167c07Ssthen
114a3167c07Ssthenset_cc_for_build() {
115a3167c07Ssthen    # prevent multiple calls if $tmp is already set
116a3167c07Ssthen    test "$tmp" && return 0
117a3167c07Ssthen    : "${TMPDIR=/tmp}"
118191f22c6Ssthen    # shellcheck disable=SC2039,SC3028
119191f22c6Ssthen    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
120a3167c07Ssthen	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
121a3167c07Ssthen	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
122a3167c07Ssthen	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
123a3167c07Ssthen    dummy=$tmp/dummy
124a3167c07Ssthen    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
125a3167c07Ssthen	,,)    echo "int x;" > "$dummy.c"
126a3167c07Ssthen	       for driver in cc gcc c89 c99 ; do
127a3167c07Ssthen		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
128191f22c6Ssthen		       CC_FOR_BUILD=$driver
129a3167c07Ssthen		       break
130a3167c07Ssthen		   fi
131a3167c07Ssthen	       done
132933707f3Ssthen	       if test x"$CC_FOR_BUILD" = x ; then
133a3167c07Ssthen		   CC_FOR_BUILD=no_compiler_found
134933707f3Ssthen	       fi
135933707f3Ssthen	       ;;
136933707f3Ssthen	,,*)   CC_FOR_BUILD=$CC ;;
137933707f3Ssthen	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
138a3167c07Ssthen    esac
139a3167c07Ssthen}
140933707f3Ssthen
141933707f3Ssthen# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
142933707f3Ssthen# (ghazi@noc.rutgers.edu 1994-08-24)
143a3167c07Ssthenif test -f /.attbin/uname ; then
144933707f3Ssthen	PATH=$PATH:/.attbin ; export PATH
145933707f3Ssthenfi
146933707f3Ssthen
147191f22c6SsthenUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
148191f22c6SsthenUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
149191f22c6SsthenUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
150191f22c6SsthenUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
151933707f3Ssthen
152191f22c6Ssthencase $UNAME_SYSTEM in
15398f3ca02SbradLinux|GNU|GNU/*)
154eba819a2Ssthen	LIBC=unknown
15598f3ca02Sbrad
156a3167c07Ssthen	set_cc_for_build
157a3167c07Ssthen	cat <<-EOF > "$dummy.c"
158*d896b962Ssthen	#if defined(__ANDROID__)
159*d896b962Ssthen	LIBC=android
160*d896b962Ssthen	#else
16198f3ca02Sbrad	#include <features.h>
16298f3ca02Sbrad	#if defined(__UCLIBC__)
16398f3ca02Sbrad	LIBC=uclibc
16498f3ca02Sbrad	#elif defined(__dietlibc__)
16598f3ca02Sbrad	LIBC=dietlibc
166eba819a2Ssthen	#elif defined(__GLIBC__)
167eba819a2Ssthen	LIBC=gnu
168*d896b962Ssthen	#elif defined(__LLVM_LIBC__)
169*d896b962Ssthen	LIBC=llvm
17098f3ca02Sbrad	#else
1712c144df0Ssthen	#include <stdarg.h>
172eba819a2Ssthen	/* First heuristic to detect musl libc.  */
1732c144df0Ssthen	#ifdef __DEFINED_va_list
1742c144df0Ssthen	LIBC=musl
17598f3ca02Sbrad	#endif
1762c144df0Ssthen	#endif
177*d896b962Ssthen	#endif
17898f3ca02Sbrad	EOF
179191f22c6Ssthen	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
180191f22c6Ssthen	eval "$cc_set_libc"
181eba819a2Ssthen
182eba819a2Ssthen	# Second heuristic to detect musl libc.
183eba819a2Ssthen	if [ "$LIBC" = unknown ] &&
184eba819a2Ssthen	   command -v ldd >/dev/null &&
185eba819a2Ssthen	   ldd --version 2>&1 | grep -q ^musl; then
186eba819a2Ssthen		LIBC=musl
187eba819a2Ssthen	fi
188eba819a2Ssthen
189eba819a2Ssthen	# If the system lacks a compiler, then just pick glibc.
190eba819a2Ssthen	# We could probably try harder.
191eba819a2Ssthen	if [ "$LIBC" = unknown ]; then
192eba819a2Ssthen		LIBC=gnu
193eba819a2Ssthen	fi
19498f3ca02Sbrad	;;
19598f3ca02Sbradesac
19698f3ca02Sbrad
197933707f3Ssthen# Note: order is significant - the case branches are not exclusive.
198933707f3Ssthen
199191f22c6Ssthencase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
200933707f3Ssthen    *:NetBSD:*:*)
201933707f3Ssthen	# NetBSD (nbsd) targets should (where applicable) match one or
202229e174cSsthen	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
203933707f3Ssthen	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
204933707f3Ssthen	# switched to ELF, *-*-netbsd* would select the old
205933707f3Ssthen	# object file format.  This provides both forward
206933707f3Ssthen	# compatibility and a consistent mechanism for selecting the
207933707f3Ssthen	# object file format.
208933707f3Ssthen	#
209933707f3Ssthen	# Note: NetBSD doesn't particularly care about the vendor
210933707f3Ssthen	# portion of the name.  We always set it to "unknown".
211191f22c6Ssthen	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
2129982a05dSsthen	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
2139982a05dSsthen	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
214191f22c6Ssthen	    echo unknown)`
215191f22c6Ssthen	case $UNAME_MACHINE_ARCH in
216eba819a2Ssthen	    aarch64eb) machine=aarch64_be-unknown ;;
217933707f3Ssthen	    armeb) machine=armeb-unknown ;;
218933707f3Ssthen	    arm*) machine=arm-unknown ;;
219933707f3Ssthen	    sh3el) machine=shl-unknown ;;
220933707f3Ssthen	    sh3eb) machine=sh-unknown ;;
221933707f3Ssthen	    sh5el) machine=sh5le-unknown ;;
2220990ddf5Ssthen	    earmv*)
223191f22c6Ssthen		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
224191f22c6Ssthen		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
225191f22c6Ssthen		machine=${arch}${endian}-unknown
2260990ddf5Ssthen		;;
227191f22c6Ssthen	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
228933707f3Ssthen	esac
229933707f3Ssthen	# The Operating System including object format, if it has switched
2300990ddf5Ssthen	# to ELF recently (or will in the future) and ABI.
231191f22c6Ssthen	case $UNAME_MACHINE_ARCH in
2320990ddf5Ssthen	    earm*)
2330990ddf5Ssthen		os=netbsdelf
2340990ddf5Ssthen		;;
235933707f3Ssthen	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
236a3167c07Ssthen		set_cc_for_build
237933707f3Ssthen		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
238933707f3Ssthen			| grep -q __ELF__
239933707f3Ssthen		then
240933707f3Ssthen		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
241933707f3Ssthen		    # Return netbsd for either.  FIX?
242933707f3Ssthen		    os=netbsd
243933707f3Ssthen		else
244933707f3Ssthen		    os=netbsdelf
245933707f3Ssthen		fi
246933707f3Ssthen		;;
247933707f3Ssthen	    *)
248933707f3Ssthen		os=netbsd
249933707f3Ssthen		;;
250933707f3Ssthen	esac
2510990ddf5Ssthen	# Determine ABI tags.
252191f22c6Ssthen	case $UNAME_MACHINE_ARCH in
2530990ddf5Ssthen	    earm*)
2540990ddf5Ssthen		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
255191f22c6Ssthen		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
2560990ddf5Ssthen		;;
2570990ddf5Ssthen	esac
258933707f3Ssthen	# The OS release
259933707f3Ssthen	# Debian GNU/NetBSD machines have a different userland, and
260933707f3Ssthen	# thus, need a distinct triplet. However, they do not need
261933707f3Ssthen	# kernel version information, so it can be replaced with a
262933707f3Ssthen	# suitable tag, in the style of linux-gnu.
263191f22c6Ssthen	case $UNAME_VERSION in
264933707f3Ssthen	    Debian*)
265933707f3Ssthen		release='-gnu'
266933707f3Ssthen		;;
267933707f3Ssthen	    *)
268191f22c6Ssthen		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
269933707f3Ssthen		;;
270933707f3Ssthen	esac
271933707f3Ssthen	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
272933707f3Ssthen	# contains redundant information, the shorter form:
273933707f3Ssthen	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
274191f22c6Ssthen	GUESS=$machine-${os}${release}${abi-}
275191f22c6Ssthen	;;
27698f3ca02Sbrad    *:Bitrig:*:*)
277191f22c6Ssthen	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
278191f22c6Ssthen	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
279191f22c6Ssthen	;;
280933707f3Ssthen    *:OpenBSD:*:*)
281191f22c6Ssthen	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
282191f22c6Ssthen	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
283191f22c6Ssthen	;;
284191f22c6Ssthen    *:SecBSD:*:*)
285191f22c6Ssthen	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
286191f22c6Ssthen	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
287191f22c6Ssthen	;;
2880990ddf5Ssthen    *:LibertyBSD:*:*)
289191f22c6Ssthen	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
290191f22c6Ssthen	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
291191f22c6Ssthen	;;
292a3167c07Ssthen    *:MidnightBSD:*:*)
293191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
294191f22c6Ssthen	;;
295933707f3Ssthen    *:ekkoBSD:*:*)
296191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
297191f22c6Ssthen	;;
298933707f3Ssthen    *:SolidBSD:*:*)
299191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
300191f22c6Ssthen	;;
301a3167c07Ssthen    *:OS108:*:*)
302191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
303191f22c6Ssthen	;;
304933707f3Ssthen    macppc:MirBSD:*:*)
305191f22c6Ssthen	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
306191f22c6Ssthen	;;
307933707f3Ssthen    *:MirBSD:*:*)
308191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
309191f22c6Ssthen	;;
3100990ddf5Ssthen    *:Sortix:*:*)
311191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-sortix
312191f22c6Ssthen	;;
313a3167c07Ssthen    *:Twizzler:*:*)
314191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-twizzler
315191f22c6Ssthen	;;
316a3167c07Ssthen    *:Redox:*:*)
317191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-redox
318191f22c6Ssthen	;;
319a3167c07Ssthen    mips:OSF1:*.*)
320191f22c6Ssthen	GUESS=mips-dec-osf1
321191f22c6Ssthen	;;
322933707f3Ssthen    alpha:OSF1:*:*)
323191f22c6Ssthen	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
324191f22c6Ssthen	trap '' 0
325933707f3Ssthen	case $UNAME_RELEASE in
326933707f3Ssthen	*4.0)
327191f22c6Ssthen		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
328933707f3Ssthen		;;
329933707f3Ssthen	*5.*)
330191f22c6Ssthen		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
331933707f3Ssthen		;;
332933707f3Ssthen	esac
333933707f3Ssthen	# According to Compaq, /usr/sbin/psrinfo has been available on
334933707f3Ssthen	# OSF/1 and Tru64 systems produced since 1995.  I hope that
335933707f3Ssthen	# covers most systems running today.  This code pipes the CPU
336933707f3Ssthen	# types through head -n 1, so we only detect the type of CPU 0.
337191f22c6Ssthen	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
338191f22c6Ssthen	case $ALPHA_CPU_TYPE in
339933707f3Ssthen	    "EV4 (21064)")
3400990ddf5Ssthen		UNAME_MACHINE=alpha ;;
341933707f3Ssthen	    "EV4.5 (21064)")
3420990ddf5Ssthen		UNAME_MACHINE=alpha ;;
343933707f3Ssthen	    "LCA4 (21066/21068)")
3440990ddf5Ssthen		UNAME_MACHINE=alpha ;;
345933707f3Ssthen	    "EV5 (21164)")
3460990ddf5Ssthen		UNAME_MACHINE=alphaev5 ;;
347933707f3Ssthen	    "EV5.6 (21164A)")
3480990ddf5Ssthen		UNAME_MACHINE=alphaev56 ;;
349933707f3Ssthen	    "EV5.6 (21164PC)")
3500990ddf5Ssthen		UNAME_MACHINE=alphapca56 ;;
351933707f3Ssthen	    "EV5.7 (21164PC)")
3520990ddf5Ssthen		UNAME_MACHINE=alphapca57 ;;
353933707f3Ssthen	    "EV6 (21264)")
3540990ddf5Ssthen		UNAME_MACHINE=alphaev6 ;;
355933707f3Ssthen	    "EV6.7 (21264A)")
3560990ddf5Ssthen		UNAME_MACHINE=alphaev67 ;;
357933707f3Ssthen	    "EV6.8CB (21264C)")
3580990ddf5Ssthen		UNAME_MACHINE=alphaev68 ;;
359933707f3Ssthen	    "EV6.8AL (21264B)")
3600990ddf5Ssthen		UNAME_MACHINE=alphaev68 ;;
361933707f3Ssthen	    "EV6.8CX (21264D)")
3620990ddf5Ssthen		UNAME_MACHINE=alphaev68 ;;
363933707f3Ssthen	    "EV6.9A (21264/EV69A)")
3640990ddf5Ssthen		UNAME_MACHINE=alphaev69 ;;
365933707f3Ssthen	    "EV7 (21364)")
3660990ddf5Ssthen		UNAME_MACHINE=alphaev7 ;;
367933707f3Ssthen	    "EV7.9 (21364A)")
3680990ddf5Ssthen		UNAME_MACHINE=alphaev79 ;;
369933707f3Ssthen	esac
370933707f3Ssthen	# A Pn.n version is a patched version.
371933707f3Ssthen	# A Vn.n version is a released version.
372933707f3Ssthen	# A Tn.n version is a released field test version.
373933707f3Ssthen	# A Xn.n version is an unreleased experimental baselevel.
374933707f3Ssthen	# 1.2 uses "1.2" for uname -r.
375191f22c6Ssthen	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
376191f22c6Ssthen	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
377191f22c6Ssthen	;;
378933707f3Ssthen    Amiga*:UNIX_System_V:4.0:*)
379191f22c6Ssthen	GUESS=m68k-unknown-sysv4
380191f22c6Ssthen	;;
381933707f3Ssthen    *:[Aa]miga[Oo][Ss]:*:*)
382191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-amigaos
383191f22c6Ssthen	;;
384933707f3Ssthen    *:[Mm]orph[Oo][Ss]:*:*)
385191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-morphos
386191f22c6Ssthen	;;
387933707f3Ssthen    *:OS/390:*:*)
388191f22c6Ssthen	GUESS=i370-ibm-openedition
389191f22c6Ssthen	;;
390933707f3Ssthen    *:z/VM:*:*)
391191f22c6Ssthen	GUESS=s390-ibm-zvmoe
392191f22c6Ssthen	;;
393933707f3Ssthen    *:OS400:*:*)
394191f22c6Ssthen	GUESS=powerpc-ibm-os400
395191f22c6Ssthen	;;
396933707f3Ssthen    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
397191f22c6Ssthen	GUESS=arm-acorn-riscix$UNAME_RELEASE
398191f22c6Ssthen	;;
39998f3ca02Sbrad    arm*:riscos:*:*|arm*:RISCOS:*:*)
400191f22c6Ssthen	GUESS=arm-unknown-riscos
401191f22c6Ssthen	;;
402933707f3Ssthen    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
403191f22c6Ssthen	GUESS=hppa1.1-hitachi-hiuxmpp
404191f22c6Ssthen	;;
405933707f3Ssthen    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
406933707f3Ssthen	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
407191f22c6Ssthen	case `(/bin/universe) 2>/dev/null` in
408191f22c6Ssthen	    att) GUESS=pyramid-pyramid-sysv3 ;;
409191f22c6Ssthen	    *)   GUESS=pyramid-pyramid-bsd   ;;
410191f22c6Ssthen	esac
411191f22c6Ssthen	;;
412933707f3Ssthen    NILE*:*:*:dcosx)
413191f22c6Ssthen	GUESS=pyramid-pyramid-svr4
414191f22c6Ssthen	;;
415933707f3Ssthen    DRS?6000:unix:4.0:6*)
416191f22c6Ssthen	GUESS=sparc-icl-nx6
417191f22c6Ssthen	;;
418933707f3Ssthen    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
419191f22c6Ssthen	case `/usr/bin/uname -p` in
420191f22c6Ssthen	    sparc) GUESS=sparc-icl-nx7 ;;
421191f22c6Ssthen	esac
422191f22c6Ssthen	;;
423933707f3Ssthen    s390x:SunOS:*:*)
424191f22c6Ssthen	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
425191f22c6Ssthen	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
426191f22c6Ssthen	;;
427933707f3Ssthen    sun4H:SunOS:5.*:*)
428191f22c6Ssthen	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
429191f22c6Ssthen	GUESS=sparc-hal-solaris2$SUN_REL
430191f22c6Ssthen	;;
431933707f3Ssthen    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
432191f22c6Ssthen	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
433191f22c6Ssthen	GUESS=sparc-sun-solaris2$SUN_REL
434191f22c6Ssthen	;;
435933707f3Ssthen    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
436191f22c6Ssthen	GUESS=i386-pc-auroraux$UNAME_RELEASE
437191f22c6Ssthen	;;
438933707f3Ssthen    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
439a3167c07Ssthen	set_cc_for_build
4400990ddf5Ssthen	SUN_ARCH=i386
441933707f3Ssthen	# If there is a compiler, see if it is configured for 64-bit objects.
442933707f3Ssthen	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
443933707f3Ssthen	# This test works for both compilers.
4442c144df0Ssthen	if test "$CC_FOR_BUILD" != no_compiler_found; then
445933707f3Ssthen	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
446e21c60efSsthen		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
447933707f3Ssthen		grep IS_64BIT_ARCH >/dev/null
448933707f3Ssthen	    then
4490990ddf5Ssthen		SUN_ARCH=x86_64
450933707f3Ssthen	    fi
451933707f3Ssthen	fi
452191f22c6Ssthen	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
453191f22c6Ssthen	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
454191f22c6Ssthen	;;
455933707f3Ssthen    sun4*:SunOS:6*:*)
456933707f3Ssthen	# According to config.sub, this is the proper way to canonicalize
457933707f3Ssthen	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
458933707f3Ssthen	# it's likely to be more like Solaris than SunOS4.
459191f22c6Ssthen	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
460191f22c6Ssthen	GUESS=sparc-sun-solaris3$SUN_REL
461191f22c6Ssthen	;;
462933707f3Ssthen    sun4*:SunOS:*:*)
463191f22c6Ssthen	case `/usr/bin/arch -k` in
464933707f3Ssthen	    Series*|S4*)
465191f22c6Ssthen		UNAME_RELEASE=`uname -v`
466933707f3Ssthen		;;
467933707f3Ssthen	esac
4688b7325afSsthen	# Japanese Language versions have a version number like '4.1.3-JL'.
469191f22c6Ssthen	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
470191f22c6Ssthen	GUESS=sparc-sun-sunos$SUN_REL
471191f22c6Ssthen	;;
472933707f3Ssthen    sun3*:SunOS:*:*)
473191f22c6Ssthen	GUESS=m68k-sun-sunos$UNAME_RELEASE
474191f22c6Ssthen	;;
475933707f3Ssthen    sun*:*:4.2BSD:*)
476191f22c6Ssthen	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
477a3167c07Ssthen	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
478191f22c6Ssthen	case `/bin/arch` in
479933707f3Ssthen	    sun3)
480191f22c6Ssthen		GUESS=m68k-sun-sunos$UNAME_RELEASE
481933707f3Ssthen		;;
482933707f3Ssthen	    sun4)
483191f22c6Ssthen		GUESS=sparc-sun-sunos$UNAME_RELEASE
484933707f3Ssthen		;;
485933707f3Ssthen	esac
486191f22c6Ssthen	;;
487933707f3Ssthen    aushp:SunOS:*:*)
488191f22c6Ssthen	GUESS=sparc-auspex-sunos$UNAME_RELEASE
489191f22c6Ssthen	;;
490933707f3Ssthen    # The situation for MiNT is a little confusing.  The machine name
491933707f3Ssthen    # can be virtually everything (everything which is not
492933707f3Ssthen    # "atarist" or "atariste" at least should have a processor
493933707f3Ssthen    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
494933707f3Ssthen    # to the lowercase version "mint" (or "freemint").  Finally
495933707f3Ssthen    # the system name "TOS" denotes a system which is actually not
496933707f3Ssthen    # MiNT.  But MiNT is downward compatible to TOS, so this should
497933707f3Ssthen    # be no problem.
498933707f3Ssthen    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
499191f22c6Ssthen	GUESS=m68k-atari-mint$UNAME_RELEASE
500191f22c6Ssthen	;;
501933707f3Ssthen    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
502191f22c6Ssthen	GUESS=m68k-atari-mint$UNAME_RELEASE
503191f22c6Ssthen	;;
504933707f3Ssthen    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
505191f22c6Ssthen	GUESS=m68k-atari-mint$UNAME_RELEASE
506191f22c6Ssthen	;;
507933707f3Ssthen    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
508191f22c6Ssthen	GUESS=m68k-milan-mint$UNAME_RELEASE
509191f22c6Ssthen	;;
510933707f3Ssthen    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
511191f22c6Ssthen	GUESS=m68k-hades-mint$UNAME_RELEASE
512191f22c6Ssthen	;;
513933707f3Ssthen    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
514191f22c6Ssthen	GUESS=m68k-unknown-mint$UNAME_RELEASE
515191f22c6Ssthen	;;
516933707f3Ssthen    m68k:machten:*:*)
517191f22c6Ssthen	GUESS=m68k-apple-machten$UNAME_RELEASE
518191f22c6Ssthen	;;
519933707f3Ssthen    powerpc:machten:*:*)
520191f22c6Ssthen	GUESS=powerpc-apple-machten$UNAME_RELEASE
521191f22c6Ssthen	;;
522933707f3Ssthen    RISC*:Mach:*:*)
523191f22c6Ssthen	GUESS=mips-dec-mach_bsd4.3
524191f22c6Ssthen	;;
525933707f3Ssthen    RISC*:ULTRIX:*:*)
526191f22c6Ssthen	GUESS=mips-dec-ultrix$UNAME_RELEASE
527191f22c6Ssthen	;;
528933707f3Ssthen    VAX*:ULTRIX*:*:*)
529191f22c6Ssthen	GUESS=vax-dec-ultrix$UNAME_RELEASE
530191f22c6Ssthen	;;
531933707f3Ssthen    2020:CLIX:*:* | 2430:CLIX:*:*)
532191f22c6Ssthen	GUESS=clipper-intergraph-clix$UNAME_RELEASE
533191f22c6Ssthen	;;
534933707f3Ssthen    mips:*:*:UMIPS | mips:*:*:RISCos)
535a3167c07Ssthen	set_cc_for_build
536a3167c07Ssthen	sed 's/^	//' << EOF > "$dummy.c"
537933707f3Ssthen#ifdef __cplusplus
538933707f3Ssthen#include <stdio.h>  /* for printf() prototype */
539933707f3Ssthen	int main (int argc, char *argv[]) {
540933707f3Ssthen#else
541933707f3Ssthen	int main (argc, argv) int argc; char *argv[]; {
542933707f3Ssthen#endif
543933707f3Ssthen	#if defined (host_mips) && defined (MIPSEB)
544933707f3Ssthen	#if defined (SYSTYPE_SYSV)
545a3167c07Ssthen	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
546933707f3Ssthen	#endif
547933707f3Ssthen	#if defined (SYSTYPE_SVR4)
548a3167c07Ssthen	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
549933707f3Ssthen	#endif
550933707f3Ssthen	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
551a3167c07Ssthen	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
552933707f3Ssthen	#endif
553933707f3Ssthen	#endif
554933707f3Ssthen	  exit (-1);
555933707f3Ssthen	}
556933707f3SsthenEOF
557a3167c07Ssthen	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
558191f22c6Ssthen	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
559191f22c6Ssthen	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
560933707f3Ssthen	    { echo "$SYSTEM_NAME"; exit; }
561191f22c6Ssthen	GUESS=mips-mips-riscos$UNAME_RELEASE
562191f22c6Ssthen	;;
563933707f3Ssthen    Motorola:PowerMAX_OS:*:*)
564191f22c6Ssthen	GUESS=powerpc-motorola-powermax
565191f22c6Ssthen	;;
566933707f3Ssthen    Motorola:*:4.3:PL8-*)
567191f22c6Ssthen	GUESS=powerpc-harris-powermax
568191f22c6Ssthen	;;
569933707f3Ssthen    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
570191f22c6Ssthen	GUESS=powerpc-harris-powermax
571191f22c6Ssthen	;;
572933707f3Ssthen    Night_Hawk:Power_UNIX:*:*)
573191f22c6Ssthen	GUESS=powerpc-harris-powerunix
574191f22c6Ssthen	;;
575933707f3Ssthen    m88k:CX/UX:7*:*)
576191f22c6Ssthen	GUESS=m88k-harris-cxux7
577191f22c6Ssthen	;;
578933707f3Ssthen    m88k:*:4*:R4*)
579191f22c6Ssthen	GUESS=m88k-motorola-sysv4
580191f22c6Ssthen	;;
581933707f3Ssthen    m88k:*:3*:R3*)
582191f22c6Ssthen	GUESS=m88k-motorola-sysv3
583191f22c6Ssthen	;;
584933707f3Ssthen    AViiON:dgux:*:*)
585933707f3Ssthen	# DG/UX returns AViiON for all architectures
586191f22c6Ssthen	UNAME_PROCESSOR=`/usr/bin/uname -p`
5872c144df0Ssthen	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
588933707f3Ssthen	then
5892c144df0Ssthen	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
5902c144df0Ssthen	       test "$TARGET_BINARY_INTERFACE"x = x
591933707f3Ssthen	    then
592191f22c6Ssthen		GUESS=m88k-dg-dgux$UNAME_RELEASE
593933707f3Ssthen	    else
594191f22c6Ssthen		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
595933707f3Ssthen	    fi
596933707f3Ssthen	else
597191f22c6Ssthen	    GUESS=i586-dg-dgux$UNAME_RELEASE
598933707f3Ssthen	fi
599191f22c6Ssthen	;;
600933707f3Ssthen    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
601191f22c6Ssthen	GUESS=m88k-dolphin-sysv3
602191f22c6Ssthen	;;
603933707f3Ssthen    M88*:*:R3*:*)
604933707f3Ssthen	# Delta 88k system running SVR3
605191f22c6Ssthen	GUESS=m88k-motorola-sysv3
606191f22c6Ssthen	;;
607933707f3Ssthen    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
608191f22c6Ssthen	GUESS=m88k-tektronix-sysv3
609191f22c6Ssthen	;;
610933707f3Ssthen    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
611191f22c6Ssthen	GUESS=m68k-tektronix-bsd
612191f22c6Ssthen	;;
613933707f3Ssthen    *:IRIX*:*:*)
614191f22c6Ssthen	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
615191f22c6Ssthen	GUESS=mips-sgi-irix$IRIX_REL
616191f22c6Ssthen	;;
617933707f3Ssthen    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
618191f22c6Ssthen	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
619191f22c6Ssthen	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
620933707f3Ssthen    i*86:AIX:*:*)
621191f22c6Ssthen	GUESS=i386-ibm-aix
622191f22c6Ssthen	;;
623933707f3Ssthen    ia64:AIX:*:*)
6242c144df0Ssthen	if test -x /usr/bin/oslevel ; then
625191f22c6Ssthen		IBM_REV=`/usr/bin/oslevel`
626933707f3Ssthen	else
627191f22c6Ssthen		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
628933707f3Ssthen	fi
629191f22c6Ssthen	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
630191f22c6Ssthen	;;
631933707f3Ssthen    *:AIX:2:3)
632933707f3Ssthen	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
633a3167c07Ssthen		set_cc_for_build
634a3167c07Ssthen		sed 's/^		//' << EOF > "$dummy.c"
635933707f3Ssthen		#include <sys/systemcfg.h>
636933707f3Ssthen
637933707f3Ssthen		main()
638933707f3Ssthen			{
639933707f3Ssthen			if (!__power_pc())
640933707f3Ssthen				exit(1);
641933707f3Ssthen			puts("powerpc-ibm-aix3.2.5");
642933707f3Ssthen			exit(0);
643933707f3Ssthen			}
644933707f3SsthenEOF
645191f22c6Ssthen		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
646933707f3Ssthen		then
647191f22c6Ssthen			GUESS=$SYSTEM_NAME
648933707f3Ssthen		else
649191f22c6Ssthen			GUESS=rs6000-ibm-aix3.2.5
650933707f3Ssthen		fi
651933707f3Ssthen	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
652191f22c6Ssthen		GUESS=rs6000-ibm-aix3.2.4
653933707f3Ssthen	else
654191f22c6Ssthen		GUESS=rs6000-ibm-aix3.2
655933707f3Ssthen	fi
656191f22c6Ssthen	;;
657229e174cSsthen    *:AIX:*:[4567])
658191f22c6Ssthen	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
659a3167c07Ssthen	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
660933707f3Ssthen		IBM_ARCH=rs6000
661933707f3Ssthen	else
662933707f3Ssthen		IBM_ARCH=powerpc
663933707f3Ssthen	fi
6642c144df0Ssthen	if test -x /usr/bin/lslpp ; then
665191f22c6Ssthen		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
666191f22c6Ssthen			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
667933707f3Ssthen	else
668191f22c6Ssthen		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
669933707f3Ssthen	fi
670191f22c6Ssthen	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
671191f22c6Ssthen	;;
672933707f3Ssthen    *:AIX:*:*)
673191f22c6Ssthen	GUESS=rs6000-ibm-aix
674191f22c6Ssthen	;;
675a3167c07Ssthen    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
676191f22c6Ssthen	GUESS=romp-ibm-bsd4.4
677191f22c6Ssthen	;;
678933707f3Ssthen    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
679191f22c6Ssthen	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
680191f22c6Ssthen	;;                                  # report: romp-ibm BSD 4.3
681933707f3Ssthen    *:BOSX:*:*)
682191f22c6Ssthen	GUESS=rs6000-bull-bosx
683191f22c6Ssthen	;;
684933707f3Ssthen    DPX/2?00:B.O.S.:*:*)
685191f22c6Ssthen	GUESS=m68k-bull-sysv3
686191f22c6Ssthen	;;
687933707f3Ssthen    9000/[34]??:4.3bsd:1.*:*)
688191f22c6Ssthen	GUESS=m68k-hp-bsd
689191f22c6Ssthen	;;
690933707f3Ssthen    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
691191f22c6Ssthen	GUESS=m68k-hp-bsd4.4
692191f22c6Ssthen	;;
693933707f3Ssthen    9000/[34678]??:HP-UX:*:*)
694191f22c6Ssthen	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
695191f22c6Ssthen	case $UNAME_MACHINE in
696933707f3Ssthen	    9000/31?)            HP_ARCH=m68000 ;;
697933707f3Ssthen	    9000/[34]??)         HP_ARCH=m68k ;;
698933707f3Ssthen	    9000/[678][0-9][0-9])
6992c144df0Ssthen		if test -x /usr/bin/getconf; then
700191f22c6Ssthen		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
701191f22c6Ssthen		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
702191f22c6Ssthen		    case $sc_cpu_version in
7030990ddf5Ssthen		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
7040990ddf5Ssthen		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
705933707f3Ssthen		      532)                      # CPU_PA_RISC2_0
706191f22c6Ssthen			case $sc_kernel_bits in
7070990ddf5Ssthen			  32) HP_ARCH=hppa2.0n ;;
7080990ddf5Ssthen			  64) HP_ARCH=hppa2.0w ;;
7090990ddf5Ssthen			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
710933707f3Ssthen			esac ;;
711933707f3Ssthen		    esac
712933707f3Ssthen		fi
7132c144df0Ssthen		if test "$HP_ARCH" = ""; then
714a3167c07Ssthen		    set_cc_for_build
715a3167c07Ssthen		    sed 's/^		//' << EOF > "$dummy.c"
716933707f3Ssthen
717933707f3Ssthen		#define _HPUX_SOURCE
718933707f3Ssthen		#include <stdlib.h>
719933707f3Ssthen		#include <unistd.h>
720933707f3Ssthen
721933707f3Ssthen		int main ()
722933707f3Ssthen		{
723933707f3Ssthen		#if defined(_SC_KERNEL_BITS)
724933707f3Ssthen		    long bits = sysconf(_SC_KERNEL_BITS);
725933707f3Ssthen		#endif
726933707f3Ssthen		    long cpu  = sysconf (_SC_CPU_VERSION);
727933707f3Ssthen
728933707f3Ssthen		    switch (cpu)
729933707f3Ssthen			{
730933707f3Ssthen			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
731933707f3Ssthen			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
732933707f3Ssthen			case CPU_PA_RISC2_0:
733933707f3Ssthen		#if defined(_SC_KERNEL_BITS)
734933707f3Ssthen			    switch (bits)
735933707f3Ssthen				{
736933707f3Ssthen				case 64: puts ("hppa2.0w"); break;
737933707f3Ssthen				case 32: puts ("hppa2.0n"); break;
738933707f3Ssthen				default: puts ("hppa2.0"); break;
739933707f3Ssthen				} break;
740933707f3Ssthen		#else  /* !defined(_SC_KERNEL_BITS) */
741933707f3Ssthen			    puts ("hppa2.0"); break;
742933707f3Ssthen		#endif
743933707f3Ssthen			default: puts ("hppa1.0"); break;
744933707f3Ssthen			}
745933707f3Ssthen		    exit (0);
746933707f3Ssthen		}
747933707f3SsthenEOF
748191f22c6Ssthen		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
749933707f3Ssthen		    test -z "$HP_ARCH" && HP_ARCH=hppa
750933707f3Ssthen		fi ;;
751933707f3Ssthen	esac
7522c144df0Ssthen	if test "$HP_ARCH" = hppa2.0w
753933707f3Ssthen	then
754a3167c07Ssthen	    set_cc_for_build
755933707f3Ssthen
756933707f3Ssthen	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
757933707f3Ssthen	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
758933707f3Ssthen	    # generating 64-bit code.  GNU and HP use different nomenclature:
759933707f3Ssthen	    #
760933707f3Ssthen	    # $ CC_FOR_BUILD=cc ./config.guess
761933707f3Ssthen	    # => hppa2.0w-hp-hpux11.23
762933707f3Ssthen	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
763933707f3Ssthen	    # => hppa64-hp-hpux11.23
764933707f3Ssthen
7650990ddf5Ssthen	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
766933707f3Ssthen		grep -q __LP64__
767933707f3Ssthen	    then
7680990ddf5Ssthen		HP_ARCH=hppa2.0w
769933707f3Ssthen	    else
7700990ddf5Ssthen		HP_ARCH=hppa64
771933707f3Ssthen	    fi
772933707f3Ssthen	fi
773191f22c6Ssthen	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
774191f22c6Ssthen	;;
775933707f3Ssthen    ia64:HP-UX:*:*)
776191f22c6Ssthen	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
777191f22c6Ssthen	GUESS=ia64-hp-hpux$HPUX_REV
778191f22c6Ssthen	;;
779933707f3Ssthen    3050*:HI-UX:*:*)
780a3167c07Ssthen	set_cc_for_build
781a3167c07Ssthen	sed 's/^	//' << EOF > "$dummy.c"
782933707f3Ssthen	#include <unistd.h>
783933707f3Ssthen	int
784933707f3Ssthen	main ()
785933707f3Ssthen	{
786933707f3Ssthen	  long cpu = sysconf (_SC_CPU_VERSION);
787933707f3Ssthen	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
788933707f3Ssthen	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
789933707f3Ssthen	     results, however.  */
790933707f3Ssthen	  if (CPU_IS_PA_RISC (cpu))
791933707f3Ssthen	    {
792933707f3Ssthen	      switch (cpu)
793933707f3Ssthen		{
794933707f3Ssthen		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
795933707f3Ssthen		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
796933707f3Ssthen		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
797933707f3Ssthen		  default: puts ("hppa-hitachi-hiuxwe2"); break;
798933707f3Ssthen		}
799933707f3Ssthen	    }
800933707f3Ssthen	  else if (CPU_IS_HP_MC68K (cpu))
801933707f3Ssthen	    puts ("m68k-hitachi-hiuxwe2");
802933707f3Ssthen	  else puts ("unknown-hitachi-hiuxwe2");
803933707f3Ssthen	  exit (0);
804933707f3Ssthen	}
805933707f3SsthenEOF
806191f22c6Ssthen	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
807933707f3Ssthen		{ echo "$SYSTEM_NAME"; exit; }
808191f22c6Ssthen	GUESS=unknown-hitachi-hiuxwe2
809191f22c6Ssthen	;;
810933707f3Ssthen    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
811191f22c6Ssthen	GUESS=hppa1.1-hp-bsd
812191f22c6Ssthen	;;
813933707f3Ssthen    9000/8??:4.3bsd:*:*)
814191f22c6Ssthen	GUESS=hppa1.0-hp-bsd
815191f22c6Ssthen	;;
816933707f3Ssthen    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
817191f22c6Ssthen	GUESS=hppa1.0-hp-mpeix
818191f22c6Ssthen	;;
819933707f3Ssthen    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
820191f22c6Ssthen	GUESS=hppa1.1-hp-osf
821191f22c6Ssthen	;;
822933707f3Ssthen    hp8??:OSF1:*:*)
823191f22c6Ssthen	GUESS=hppa1.0-hp-osf
824191f22c6Ssthen	;;
825933707f3Ssthen    i*86:OSF1:*:*)
8262c144df0Ssthen	if test -x /usr/sbin/sysversion ; then
827191f22c6Ssthen	    GUESS=$UNAME_MACHINE-unknown-osf1mk
828933707f3Ssthen	else
829191f22c6Ssthen	    GUESS=$UNAME_MACHINE-unknown-osf1
830933707f3Ssthen	fi
831191f22c6Ssthen	;;
832933707f3Ssthen    parisc*:Lites*:*:*)
833191f22c6Ssthen	GUESS=hppa1.1-hp-lites
834191f22c6Ssthen	;;
835933707f3Ssthen    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
836191f22c6Ssthen	GUESS=c1-convex-bsd
837191f22c6Ssthen	;;
838933707f3Ssthen    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
839933707f3Ssthen	if getsysinfo -f scalar_acc
840933707f3Ssthen	then echo c32-convex-bsd
841933707f3Ssthen	else echo c2-convex-bsd
842933707f3Ssthen	fi
843933707f3Ssthen	exit ;;
844933707f3Ssthen    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
845191f22c6Ssthen	GUESS=c34-convex-bsd
846191f22c6Ssthen	;;
847933707f3Ssthen    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
848191f22c6Ssthen	GUESS=c38-convex-bsd
849191f22c6Ssthen	;;
850933707f3Ssthen    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
851191f22c6Ssthen	GUESS=c4-convex-bsd
852191f22c6Ssthen	;;
853933707f3Ssthen    CRAY*Y-MP:*:*:*)
854191f22c6Ssthen	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
855191f22c6Ssthen	GUESS=ymp-cray-unicos$CRAY_REL
856191f22c6Ssthen	;;
857933707f3Ssthen    CRAY*[A-Z]90:*:*:*)
858a3167c07Ssthen	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
859933707f3Ssthen	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
860933707f3Ssthen	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
861933707f3Ssthen	      -e 's/\.[^.]*$/.X/'
862933707f3Ssthen	exit ;;
863933707f3Ssthen    CRAY*TS:*:*:*)
864191f22c6Ssthen	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
865191f22c6Ssthen	GUESS=t90-cray-unicos$CRAY_REL
866191f22c6Ssthen	;;
867933707f3Ssthen    CRAY*T3E:*:*:*)
868191f22c6Ssthen	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
869191f22c6Ssthen	GUESS=alphaev5-cray-unicosmk$CRAY_REL
870191f22c6Ssthen	;;
871933707f3Ssthen    CRAY*SV1:*:*:*)
872191f22c6Ssthen	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
873191f22c6Ssthen	GUESS=sv1-cray-unicos$CRAY_REL
874191f22c6Ssthen	;;
875933707f3Ssthen    *:UNICOS/mp:*:*)
876191f22c6Ssthen	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
877191f22c6Ssthen	GUESS=craynv-cray-unicosmp$CRAY_REL
878191f22c6Ssthen	;;
879933707f3Ssthen    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
880191f22c6Ssthen	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
881191f22c6Ssthen	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
882191f22c6Ssthen	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
883191f22c6Ssthen	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
884191f22c6Ssthen	;;
885933707f3Ssthen    5000:UNIX_System_V:4.*:*)
886191f22c6Ssthen	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
887191f22c6Ssthen	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
888191f22c6Ssthen	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
889191f22c6Ssthen	;;
890933707f3Ssthen    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
891191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
892191f22c6Ssthen	;;
893933707f3Ssthen    sparc*:BSD/OS:*:*)
894191f22c6Ssthen	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
895191f22c6Ssthen	;;
896933707f3Ssthen    *:BSD/OS:*:*)
897191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
898191f22c6Ssthen	;;
899a3167c07Ssthen    arm:FreeBSD:*:*)
900191f22c6Ssthen	UNAME_PROCESSOR=`uname -p`
901a3167c07Ssthen	set_cc_for_build
902a3167c07Ssthen	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
903a3167c07Ssthen	    | grep -q __ARM_PCS_VFP
904a3167c07Ssthen	then
905191f22c6Ssthen	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
906191f22c6Ssthen	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
907a3167c07Ssthen	else
908191f22c6Ssthen	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
909191f22c6Ssthen	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
910a3167c07Ssthen	fi
911191f22c6Ssthen	;;
912933707f3Ssthen    *:FreeBSD:*:*)
913*d896b962Ssthen	UNAME_PROCESSOR=`uname -p`
914191f22c6Ssthen	case $UNAME_PROCESSOR in
915933707f3Ssthen	    amd64)
916a3167c07Ssthen		UNAME_PROCESSOR=x86_64 ;;
917a3167c07Ssthen	    i386)
918a3167c07Ssthen		UNAME_PROCESSOR=i586 ;;
919933707f3Ssthen	esac
920191f22c6Ssthen	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
921191f22c6Ssthen	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
922191f22c6Ssthen	;;
923933707f3Ssthen    i*:CYGWIN*:*)
924191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-cygwin
925191f22c6Ssthen	;;
92698f3ca02Sbrad    *:MINGW64*:*)
927191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-mingw64
928191f22c6Ssthen	;;
929933707f3Ssthen    *:MINGW*:*)
930191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-mingw32
931191f22c6Ssthen	;;
9320990ddf5Ssthen    *:MSYS*:*)
933191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-msys
934191f22c6Ssthen	;;
935933707f3Ssthen    i*:PW*:*)
936191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-pw32
937191f22c6Ssthen	;;
938e21c60efSsthen    *:SerenityOS:*:*)
939e21c60efSsthen        GUESS=$UNAME_MACHINE-pc-serenity
940e21c60efSsthen        ;;
941933707f3Ssthen    *:Interix*:*)
942191f22c6Ssthen	case $UNAME_MACHINE in
943933707f3Ssthen	    x86)
944191f22c6Ssthen		GUESS=i586-pc-interix$UNAME_RELEASE
945191f22c6Ssthen		;;
946933707f3Ssthen	    authenticamd | genuineintel | EM64T)
947191f22c6Ssthen		GUESS=x86_64-unknown-interix$UNAME_RELEASE
948191f22c6Ssthen		;;
949933707f3Ssthen	    IA64)
950191f22c6Ssthen		GUESS=ia64-unknown-interix$UNAME_RELEASE
951191f22c6Ssthen		;;
952933707f3Ssthen	esac ;;
953933707f3Ssthen    i*:UWIN*:*)
954191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-uwin
955191f22c6Ssthen	;;
956933707f3Ssthen    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
957191f22c6Ssthen	GUESS=x86_64-pc-cygwin
958191f22c6Ssthen	;;
959933707f3Ssthen    prep*:SunOS:5.*:*)
960191f22c6Ssthen	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
961191f22c6Ssthen	GUESS=powerpcle-unknown-solaris2$SUN_REL
962191f22c6Ssthen	;;
963933707f3Ssthen    *:GNU:*:*)
964933707f3Ssthen	# the GNU system
965191f22c6Ssthen	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
966191f22c6Ssthen	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
967191f22c6Ssthen	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
968191f22c6Ssthen	;;
969933707f3Ssthen    *:GNU/*:*:*)
970933707f3Ssthen	# other systems with GNU libc and userland
971191f22c6Ssthen	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
972191f22c6Ssthen	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
973191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
974191f22c6Ssthen	;;
97545872187Ssthen    x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
97645872187Ssthen	GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
97745872187Ssthen	;;
97845872187Ssthen    *:[Mm]anagarm:*:*)
97945872187Ssthen	GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
98045872187Ssthen	;;
981a3167c07Ssthen    *:Minix:*:*)
982191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-minix
983191f22c6Ssthen	;;
984229e174cSsthen    aarch64:Linux:*:*)
9858b7325afSsthen	set_cc_for_build
9868b7325afSsthen	CPU=$UNAME_MACHINE
9878b7325afSsthen	LIBCABI=$LIBC
9888b7325afSsthen	if test "$CC_FOR_BUILD" != no_compiler_found; then
9898b7325afSsthen	    ABI=64
9908b7325afSsthen	    sed 's/^	    //' << EOF > "$dummy.c"
9918b7325afSsthen	    #ifdef __ARM_EABI__
9928b7325afSsthen	    #ifdef __ARM_PCS_VFP
9938b7325afSsthen	    ABI=eabihf
9948b7325afSsthen	    #else
9958b7325afSsthen	    ABI=eabi
9968b7325afSsthen	    #endif
9978b7325afSsthen	    #endif
9988b7325afSsthenEOF
9998b7325afSsthen	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
10008b7325afSsthen	    eval "$cc_set_abi"
10018b7325afSsthen	    case $ABI in
10028b7325afSsthen		eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
10038b7325afSsthen	    esac
10048b7325afSsthen	fi
10058b7325afSsthen	GUESS=$CPU-unknown-linux-$LIBCABI
1006191f22c6Ssthen	;;
1007229e174cSsthen    aarch64_be:Linux:*:*)
1008229e174cSsthen	UNAME_MACHINE=aarch64_be
1009191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1010191f22c6Ssthen	;;
1011933707f3Ssthen    alpha:Linux:*:*)
1012191f22c6Ssthen	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
1013933707f3Ssthen	  EV5)   UNAME_MACHINE=alphaev5 ;;
1014933707f3Ssthen	  EV56)  UNAME_MACHINE=alphaev56 ;;
1015933707f3Ssthen	  PCA56) UNAME_MACHINE=alphapca56 ;;
1016933707f3Ssthen	  PCA57) UNAME_MACHINE=alphapca56 ;;
1017933707f3Ssthen	  EV6)   UNAME_MACHINE=alphaev6 ;;
1018933707f3Ssthen	  EV67)  UNAME_MACHINE=alphaev67 ;;
1019933707f3Ssthen	  EV68*) UNAME_MACHINE=alphaev68 ;;
1020933707f3Ssthen	esac
1021933707f3Ssthen	objdump --private-headers /bin/sh | grep -q ld.so.1
10220990ddf5Ssthen	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
1023191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1024191f22c6Ssthen	;;
1025191f22c6Ssthen    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
1026191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1027191f22c6Ssthen	;;
1028933707f3Ssthen    arm*:Linux:*:*)
1029a3167c07Ssthen	set_cc_for_build
1030933707f3Ssthen	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
1031933707f3Ssthen	    | grep -q __ARM_EABI__
1032933707f3Ssthen	then
1033191f22c6Ssthen	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1034933707f3Ssthen	else
1035229e174cSsthen	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
1036229e174cSsthen		| grep -q __ARM_PCS_VFP
1037229e174cSsthen	    then
1038191f22c6Ssthen		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
1039229e174cSsthen	    else
1040191f22c6Ssthen		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
1041229e174cSsthen	    fi
1042933707f3Ssthen	fi
1043191f22c6Ssthen	;;
1044933707f3Ssthen    avr32*:Linux:*:*)
1045191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1046191f22c6Ssthen	;;
1047933707f3Ssthen    cris:Linux:*:*)
1048191f22c6Ssthen	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1049191f22c6Ssthen	;;
1050933707f3Ssthen    crisv32:Linux:*:*)
1051191f22c6Ssthen	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1052191f22c6Ssthen	;;
10530990ddf5Ssthen    e2k:Linux:*:*)
1054191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1055191f22c6Ssthen	;;
1056933707f3Ssthen    frv:Linux:*:*)
1057191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1058191f22c6Ssthen	;;
1059229e174cSsthen    hexagon:Linux:*:*)
1060191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1061191f22c6Ssthen	;;
1062933707f3Ssthen    i*86:Linux:*:*)
1063191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
1064191f22c6Ssthen	;;
1065933707f3Ssthen    ia64:Linux:*:*)
1066191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1067191f22c6Ssthen	;;
10680990ddf5Ssthen    k1om:Linux:*:*)
1069191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1070191f22c6Ssthen	;;
10718b7325afSsthen    kvx:Linux:*:*)
10728b7325afSsthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10738b7325afSsthen	;;
10748b7325afSsthen    kvx:cos:*:*)
10758b7325afSsthen	GUESS=$UNAME_MACHINE-unknown-cos
10768b7325afSsthen	;;
10778b7325afSsthen    kvx:mbr:*:*)
10788b7325afSsthen	GUESS=$UNAME_MACHINE-unknown-mbr
10798b7325afSsthen	;;
10807dd170e2Ssthen    loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1081191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1082191f22c6Ssthen	;;
1083933707f3Ssthen    m32r*:Linux:*:*)
1084191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1085191f22c6Ssthen	;;
1086933707f3Ssthen    m68*:Linux:*:*)
1087191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1088191f22c6Ssthen	;;
1089933707f3Ssthen    mips:Linux:*:* | mips64:Linux:*:*)
1090a3167c07Ssthen	set_cc_for_build
1091a3167c07Ssthen	IS_GLIBC=0
1092a3167c07Ssthen	test x"${LIBC}" = xgnu && IS_GLIBC=1
1093a3167c07Ssthen	sed 's/^	//' << EOF > "$dummy.c"
1094933707f3Ssthen	#undef CPU
1095a3167c07Ssthen	#undef mips
1096a3167c07Ssthen	#undef mipsel
1097a3167c07Ssthen	#undef mips64
1098a3167c07Ssthen	#undef mips64el
1099a3167c07Ssthen	#if ${IS_GLIBC} && defined(_ABI64)
1100a3167c07Ssthen	LIBCABI=gnuabi64
1101a3167c07Ssthen	#else
1102a3167c07Ssthen	#if ${IS_GLIBC} && defined(_ABIN32)
1103a3167c07Ssthen	LIBCABI=gnuabin32
1104a3167c07Ssthen	#else
1105a3167c07Ssthen	LIBCABI=${LIBC}
1106a3167c07Ssthen	#endif
1107a3167c07Ssthen	#endif
1108a3167c07Ssthen
1109a3167c07Ssthen	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1110a3167c07Ssthen	CPU=mipsisa64r6
1111a3167c07Ssthen	#else
1112a3167c07Ssthen	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1113a3167c07Ssthen	CPU=mipsisa32r6
1114a3167c07Ssthen	#else
1115a3167c07Ssthen	#if defined(__mips64)
1116a3167c07Ssthen	CPU=mips64
1117a3167c07Ssthen	#else
1118a3167c07Ssthen	CPU=mips
1119a3167c07Ssthen	#endif
1120a3167c07Ssthen	#endif
1121a3167c07Ssthen	#endif
1122a3167c07Ssthen
1123933707f3Ssthen	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1124a3167c07Ssthen	MIPS_ENDIAN=el
1125933707f3Ssthen	#else
1126933707f3Ssthen	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1127a3167c07Ssthen	MIPS_ENDIAN=
1128933707f3Ssthen	#else
1129a3167c07Ssthen	MIPS_ENDIAN=
1130933707f3Ssthen	#endif
1131933707f3Ssthen	#endif
1132933707f3SsthenEOF
1133191f22c6Ssthen	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
1134191f22c6Ssthen	eval "$cc_set_vars"
1135a3167c07Ssthen	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1136933707f3Ssthen	;;
11370990ddf5Ssthen    mips64el:Linux:*:*)
1138191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1139191f22c6Ssthen	;;
11400990ddf5Ssthen    openrisc*:Linux:*:*)
1141191f22c6Ssthen	GUESS=or1k-unknown-linux-$LIBC
1142191f22c6Ssthen	;;
11430990ddf5Ssthen    or32:Linux:*:* | or1k*:Linux:*:*)
1144191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1145191f22c6Ssthen	;;
1146933707f3Ssthen    padre:Linux:*:*)
1147191f22c6Ssthen	GUESS=sparc-unknown-linux-$LIBC
1148191f22c6Ssthen	;;
1149933707f3Ssthen    parisc64:Linux:*:* | hppa64:Linux:*:*)
1150191f22c6Ssthen	GUESS=hppa64-unknown-linux-$LIBC
1151191f22c6Ssthen	;;
1152933707f3Ssthen    parisc:Linux:*:* | hppa:Linux:*:*)
1153933707f3Ssthen	# Look for CPU level
1154191f22c6Ssthen	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1155191f22c6Ssthen	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
1156191f22c6Ssthen	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
1157191f22c6Ssthen	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
1158933707f3Ssthen	esac
1159191f22c6Ssthen	;;
1160933707f3Ssthen    ppc64:Linux:*:*)
1161191f22c6Ssthen	GUESS=powerpc64-unknown-linux-$LIBC
1162191f22c6Ssthen	;;
1163933707f3Ssthen    ppc:Linux:*:*)
1164191f22c6Ssthen	GUESS=powerpc-unknown-linux-$LIBC
1165191f22c6Ssthen	;;
116698f3ca02Sbrad    ppc64le:Linux:*:*)
1167191f22c6Ssthen	GUESS=powerpc64le-unknown-linux-$LIBC
1168191f22c6Ssthen	;;
116998f3ca02Sbrad    ppcle:Linux:*:*)
1170191f22c6Ssthen	GUESS=powerpcle-unknown-linux-$LIBC
1171191f22c6Ssthen	;;
11729982a05dSsthen    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1173191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1174191f22c6Ssthen	;;
1175933707f3Ssthen    s390:Linux:*:* | s390x:Linux:*:*)
1176191f22c6Ssthen	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
1177191f22c6Ssthen	;;
1178933707f3Ssthen    sh64*:Linux:*:*)
1179191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1180191f22c6Ssthen	;;
1181933707f3Ssthen    sh*:Linux:*:*)
1182191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1183191f22c6Ssthen	;;
1184933707f3Ssthen    sparc:Linux:*:* | sparc64:Linux:*:*)
1185191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1186191f22c6Ssthen	;;
1187229e174cSsthen    tile*:Linux:*:*)
1188191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1189191f22c6Ssthen	;;
1190933707f3Ssthen    vax:Linux:*:*)
1191191f22c6Ssthen	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
1192191f22c6Ssthen	;;
1193933707f3Ssthen    x86_64:Linux:*:*)
1194a3167c07Ssthen	set_cc_for_build
11950bdb4f62Ssthen	CPU=$UNAME_MACHINE
1196a3167c07Ssthen	LIBCABI=$LIBC
11972c144df0Ssthen	if test "$CC_FOR_BUILD" != no_compiler_found; then
11980bdb4f62Ssthen	    ABI=64
11990bdb4f62Ssthen	    sed 's/^	    //' << EOF > "$dummy.c"
12000bdb4f62Ssthen	    #ifdef __i386__
12010bdb4f62Ssthen	    ABI=x86
12020bdb4f62Ssthen	    #else
12030bdb4f62Ssthen	    #ifdef __ILP32__
12040bdb4f62Ssthen	    ABI=x32
12050bdb4f62Ssthen	    #endif
12060bdb4f62Ssthen	    #endif
12070bdb4f62SsthenEOF
12080bdb4f62Ssthen	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
12090bdb4f62Ssthen	    eval "$cc_set_abi"
12100bdb4f62Ssthen	    case $ABI in
12110bdb4f62Ssthen		x86) CPU=i686 ;;
12120bdb4f62Ssthen		x32) LIBCABI=${LIBC}x32 ;;
12130bdb4f62Ssthen	    esac
1214a3167c07Ssthen	fi
12150bdb4f62Ssthen	GUESS=$CPU-pc-linux-$LIBCABI
1216191f22c6Ssthen	;;
1217933707f3Ssthen    xtensa*:Linux:*:*)
1218191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1219191f22c6Ssthen	;;
1220933707f3Ssthen    i*86:DYNIX/ptx:4*:*)
1221933707f3Ssthen	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1222933707f3Ssthen	# earlier versions are messed up and put the nodename in both
1223933707f3Ssthen	# sysname and nodename.
1224191f22c6Ssthen	GUESS=i386-sequent-sysv4
1225191f22c6Ssthen	;;
1226933707f3Ssthen    i*86:UNIX_SV:4.2MP:2.*)
1227933707f3Ssthen	# Unixware is an offshoot of SVR4, but it has its own version
1228933707f3Ssthen	# number series starting with 2...
1229933707f3Ssthen	# I am not positive that other SVR4 systems won't match this,
1230933707f3Ssthen	# I just have to hope.  -- rms.
1231933707f3Ssthen	# Use sysv4.2uw... so that sysv4* matches it.
1232191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
1233191f22c6Ssthen	;;
1234933707f3Ssthen    i*86:OS/2:*:*)
12358b7325afSsthen	# If we were able to find 'uname', then EMX Unix compatibility
1236933707f3Ssthen	# is probably installed.
1237191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-os2-emx
1238191f22c6Ssthen	;;
1239933707f3Ssthen    i*86:XTS-300:*:STOP)
1240191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-stop
1241191f22c6Ssthen	;;
1242933707f3Ssthen    i*86:atheos:*:*)
1243191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-atheos
1244191f22c6Ssthen	;;
1245933707f3Ssthen    i*86:syllable:*:*)
1246191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-syllable
1247191f22c6Ssthen	;;
1248933707f3Ssthen    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1249191f22c6Ssthen	GUESS=i386-unknown-lynxos$UNAME_RELEASE
1250191f22c6Ssthen	;;
1251933707f3Ssthen    i*86:*DOS:*:*)
1252191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
1253191f22c6Ssthen	;;
1254a3167c07Ssthen    i*86:*:4.*:*)
1255191f22c6Ssthen	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1256933707f3Ssthen	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1257191f22c6Ssthen		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
1258933707f3Ssthen	else
1259191f22c6Ssthen		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
1260933707f3Ssthen	fi
1261191f22c6Ssthen	;;
1262933707f3Ssthen    i*86:*:5:[678]*)
1263933707f3Ssthen	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1264191f22c6Ssthen	case `/bin/uname -X | grep "^Machine"` in
1265933707f3Ssthen	    *486*)	     UNAME_MACHINE=i486 ;;
1266933707f3Ssthen	    *Pentium)	     UNAME_MACHINE=i586 ;;
1267933707f3Ssthen	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1268933707f3Ssthen	esac
1269191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1270191f22c6Ssthen	;;
1271933707f3Ssthen    i*86:*:3.2:*)
1272933707f3Ssthen	if test -f /usr/options/cb.name; then
1273191f22c6Ssthen		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1274191f22c6Ssthen		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
1275933707f3Ssthen	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1276191f22c6Ssthen		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1277933707f3Ssthen		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1278933707f3Ssthen		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1279933707f3Ssthen			&& UNAME_MACHINE=i586
1280933707f3Ssthen		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1281933707f3Ssthen			&& UNAME_MACHINE=i686
1282933707f3Ssthen		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1283933707f3Ssthen			&& UNAME_MACHINE=i686
1284191f22c6Ssthen		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
1285933707f3Ssthen	else
1286191f22c6Ssthen		GUESS=$UNAME_MACHINE-pc-sysv32
1287933707f3Ssthen	fi
1288191f22c6Ssthen	;;
1289933707f3Ssthen    pc:*:*:*)
1290933707f3Ssthen	# Left here for compatibility:
1291933707f3Ssthen	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1292933707f3Ssthen	# the processor, so we play safe by assuming i586.
1293933707f3Ssthen	# Note: whatever this is, it MUST be the same as what config.sub
12940990ddf5Ssthen	# prints for the "djgpp" host, or else GDB configure will decide that
1295933707f3Ssthen	# this is a cross-build.
1296191f22c6Ssthen	GUESS=i586-pc-msdosdjgpp
1297191f22c6Ssthen	;;
1298933707f3Ssthen    Intel:Mach:3*:*)
1299191f22c6Ssthen	GUESS=i386-pc-mach3
1300191f22c6Ssthen	;;
1301933707f3Ssthen    paragon:*:*:*)
1302191f22c6Ssthen	GUESS=i860-intel-osf1
1303191f22c6Ssthen	;;
1304933707f3Ssthen    i860:*:4.*:*) # i860-SVR4
1305933707f3Ssthen	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1306191f22c6Ssthen	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
1307933707f3Ssthen	else # Add other i860-SVR4 vendors below as they are discovered.
1308191f22c6Ssthen	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
1309933707f3Ssthen	fi
1310191f22c6Ssthen	;;
1311933707f3Ssthen    mini*:CTIX:SYS*5:*)
1312933707f3Ssthen	# "miniframe"
1313191f22c6Ssthen	GUESS=m68010-convergent-sysv
1314191f22c6Ssthen	;;
1315933707f3Ssthen    mc68k:UNIX:SYSTEM5:3.51m)
1316191f22c6Ssthen	GUESS=m68k-convergent-sysv
1317191f22c6Ssthen	;;
1318933707f3Ssthen    M680?0:D-NIX:5.3:*)
1319191f22c6Ssthen	GUESS=m68k-diab-dnix
1320191f22c6Ssthen	;;
1321933707f3Ssthen    M68*:*:R3V[5678]*:*)
1322933707f3Ssthen	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1323933707f3Ssthen    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)
1324933707f3Ssthen	OS_REL=''
1325933707f3Ssthen	test -r /etc/.relid \
1326191f22c6Ssthen	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1327933707f3Ssthen	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1328a3167c07Ssthen	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1329933707f3Ssthen	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1330a3167c07Ssthen	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1331933707f3Ssthen    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1332933707f3Ssthen	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1333933707f3Ssthen	  && { echo i486-ncr-sysv4; exit; } ;;
1334933707f3Ssthen    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1335933707f3Ssthen	OS_REL='.3'
1336933707f3Ssthen	test -r /etc/.relid \
1337191f22c6Ssthen	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1338933707f3Ssthen	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1339a3167c07Ssthen	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1340933707f3Ssthen	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1341a3167c07Ssthen	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1342933707f3Ssthen	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1343a3167c07Ssthen	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1344933707f3Ssthen    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1345191f22c6Ssthen	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
1346191f22c6Ssthen	;;
1347933707f3Ssthen    mc68030:UNIX_System_V:4.*:*)
1348191f22c6Ssthen	GUESS=m68k-atari-sysv4
1349191f22c6Ssthen	;;
1350933707f3Ssthen    TSUNAMI:LynxOS:2.*:*)
1351191f22c6Ssthen	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
1352191f22c6Ssthen	;;
1353933707f3Ssthen    rs6000:LynxOS:2.*:*)
1354191f22c6Ssthen	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
1355191f22c6Ssthen	;;
1356933707f3Ssthen    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1357191f22c6Ssthen	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
1358191f22c6Ssthen	;;
1359933707f3Ssthen    SM[BE]S:UNIX_SV:*:*)
1360191f22c6Ssthen	GUESS=mips-dde-sysv$UNAME_RELEASE
1361191f22c6Ssthen	;;
1362933707f3Ssthen    RM*:ReliantUNIX-*:*:*)
1363191f22c6Ssthen	GUESS=mips-sni-sysv4
1364191f22c6Ssthen	;;
1365933707f3Ssthen    RM*:SINIX-*:*:*)
1366191f22c6Ssthen	GUESS=mips-sni-sysv4
1367191f22c6Ssthen	;;
1368933707f3Ssthen    *:SINIX-*:*:*)
1369933707f3Ssthen	if uname -p 2>/dev/null >/dev/null ; then
1370191f22c6Ssthen		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1371191f22c6Ssthen		GUESS=$UNAME_MACHINE-sni-sysv4
1372933707f3Ssthen	else
1373191f22c6Ssthen		GUESS=ns32k-sni-sysv
1374933707f3Ssthen	fi
1375191f22c6Ssthen	;;
13768b7325afSsthen    PENTIUM:*:4.0*:*)	# Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
1377933707f3Ssthen			# says <Richard.M.Bartel@ccMail.Census.GOV>
1378191f22c6Ssthen	GUESS=i586-unisys-sysv4
1379191f22c6Ssthen	;;
1380933707f3Ssthen    *:UNIX_System_V:4*:FTX*)
1381933707f3Ssthen	# From Gerald Hewes <hewes@openmarket.com>.
1382933707f3Ssthen	# How about differentiating between stratus architectures? -djm
1383191f22c6Ssthen	GUESS=hppa1.1-stratus-sysv4
1384191f22c6Ssthen	;;
1385933707f3Ssthen    *:*:*:FTX*)
1386933707f3Ssthen	# From seanf@swdc.stratus.com.
1387191f22c6Ssthen	GUESS=i860-stratus-sysv4
1388191f22c6Ssthen	;;
1389933707f3Ssthen    i*86:VOS:*:*)
1390933707f3Ssthen	# From Paul.Green@stratus.com.
1391191f22c6Ssthen	GUESS=$UNAME_MACHINE-stratus-vos
1392191f22c6Ssthen	;;
1393933707f3Ssthen    *:VOS:*:*)
1394933707f3Ssthen	# From Paul.Green@stratus.com.
1395191f22c6Ssthen	GUESS=hppa1.1-stratus-vos
1396191f22c6Ssthen	;;
1397933707f3Ssthen    mc68*:A/UX:*:*)
1398191f22c6Ssthen	GUESS=m68k-apple-aux$UNAME_RELEASE
1399191f22c6Ssthen	;;
1400933707f3Ssthen    news*:NEWS-OS:6*:*)
1401191f22c6Ssthen	GUESS=mips-sony-newsos6
1402191f22c6Ssthen	;;
1403933707f3Ssthen    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
14042c144df0Ssthen	if test -d /usr/nec; then
1405191f22c6Ssthen		GUESS=mips-nec-sysv$UNAME_RELEASE
1406933707f3Ssthen	else
1407191f22c6Ssthen		GUESS=mips-unknown-sysv$UNAME_RELEASE
1408933707f3Ssthen	fi
1409191f22c6Ssthen	;;
1410933707f3Ssthen    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1411191f22c6Ssthen	GUESS=powerpc-be-beos
1412191f22c6Ssthen	;;
1413933707f3Ssthen    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1414191f22c6Ssthen	GUESS=powerpc-apple-beos
1415191f22c6Ssthen	;;
1416933707f3Ssthen    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1417191f22c6Ssthen	GUESS=i586-pc-beos
1418191f22c6Ssthen	;;
1419933707f3Ssthen    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1420191f22c6Ssthen	GUESS=i586-pc-haiku
1421191f22c6Ssthen	;;
14220bdb4f62Ssthen    ppc:Haiku:*:*)	# Haiku running on Apple PowerPC
14230bdb4f62Ssthen	GUESS=powerpc-apple-haiku
14240bdb4f62Ssthen	;;
14250bdb4f62Ssthen    *:Haiku:*:*)	# Haiku modern gcc (not bound by BeOS compat)
14260bdb4f62Ssthen	GUESS=$UNAME_MACHINE-unknown-haiku
1427191f22c6Ssthen	;;
1428933707f3Ssthen    SX-4:SUPER-UX:*:*)
1429191f22c6Ssthen	GUESS=sx4-nec-superux$UNAME_RELEASE
1430191f22c6Ssthen	;;
1431933707f3Ssthen    SX-5:SUPER-UX:*:*)
1432191f22c6Ssthen	GUESS=sx5-nec-superux$UNAME_RELEASE
1433191f22c6Ssthen	;;
1434933707f3Ssthen    SX-6:SUPER-UX:*:*)
1435191f22c6Ssthen	GUESS=sx6-nec-superux$UNAME_RELEASE
1436191f22c6Ssthen	;;
1437933707f3Ssthen    SX-7:SUPER-UX:*:*)
1438191f22c6Ssthen	GUESS=sx7-nec-superux$UNAME_RELEASE
1439191f22c6Ssthen	;;
1440933707f3Ssthen    SX-8:SUPER-UX:*:*)
1441191f22c6Ssthen	GUESS=sx8-nec-superux$UNAME_RELEASE
1442191f22c6Ssthen	;;
1443933707f3Ssthen    SX-8R:SUPER-UX:*:*)
1444191f22c6Ssthen	GUESS=sx8r-nec-superux$UNAME_RELEASE
1445191f22c6Ssthen	;;
14460990ddf5Ssthen    SX-ACE:SUPER-UX:*:*)
1447191f22c6Ssthen	GUESS=sxace-nec-superux$UNAME_RELEASE
1448191f22c6Ssthen	;;
1449933707f3Ssthen    Power*:Rhapsody:*:*)
1450191f22c6Ssthen	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
1451191f22c6Ssthen	;;
1452933707f3Ssthen    *:Rhapsody:*:*)
1453191f22c6Ssthen	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
1454191f22c6Ssthen	;;
1455a3167c07Ssthen    arm64:Darwin:*:*)
1456191f22c6Ssthen	GUESS=aarch64-apple-darwin$UNAME_RELEASE
1457191f22c6Ssthen	;;
1458933707f3Ssthen    *:Darwin:*:*)
1459191f22c6Ssthen	UNAME_PROCESSOR=`uname -p`
1460a3167c07Ssthen	case $UNAME_PROCESSOR in
1461a3167c07Ssthen	    unknown) UNAME_PROCESSOR=powerpc ;;
1462a3167c07Ssthen	esac
1463a3167c07Ssthen	if command -v xcode-select > /dev/null 2> /dev/null && \
1464a3167c07Ssthen		! xcode-select --print-path > /dev/null 2> /dev/null ; then
1465a3167c07Ssthen	    # Avoid executing cc if there is no toolchain installed as
1466a3167c07Ssthen	    # cc will be a stub that puts up a graphical alert
1467a3167c07Ssthen	    # prompting the user to install developer tools.
1468a3167c07Ssthen	    CC_FOR_BUILD=no_compiler_found
1469a3167c07Ssthen	else
1470a3167c07Ssthen	    set_cc_for_build
147198f3ca02Sbrad	fi
14722c144df0Ssthen	if test "$CC_FOR_BUILD" != no_compiler_found; then
1473933707f3Ssthen	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
14740990ddf5Ssthen		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1475933707f3Ssthen		   grep IS_64BIT_ARCH >/dev/null
1476933707f3Ssthen	    then
147798f3ca02Sbrad		case $UNAME_PROCESSOR in
147898f3ca02Sbrad		    i386) UNAME_PROCESSOR=x86_64 ;;
147998f3ca02Sbrad		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1480933707f3Ssthen		esac
148198f3ca02Sbrad	    fi
1482a3167c07Ssthen	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1483a3167c07Ssthen	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1484a3167c07Ssthen		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1485a3167c07Ssthen		   grep IS_PPC >/dev/null
1486a3167c07Ssthen	    then
1487a3167c07Ssthen		UNAME_PROCESSOR=powerpc
148898f3ca02Sbrad	    fi
14890990ddf5Ssthen	elif test "$UNAME_PROCESSOR" = i386 ; then
1490a3167c07Ssthen	    # uname -m returns i386 or x86_64
1491a3167c07Ssthen	    UNAME_PROCESSOR=$UNAME_MACHINE
14920990ddf5Ssthen	fi
1493191f22c6Ssthen	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
1494191f22c6Ssthen	;;
1495933707f3Ssthen    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1496191f22c6Ssthen	UNAME_PROCESSOR=`uname -p`
14970990ddf5Ssthen	if test "$UNAME_PROCESSOR" = x86; then
1498933707f3Ssthen		UNAME_PROCESSOR=i386
1499933707f3Ssthen		UNAME_MACHINE=pc
1500933707f3Ssthen	fi
1501191f22c6Ssthen	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
1502191f22c6Ssthen	;;
1503933707f3Ssthen    *:QNX:*:4*)
1504191f22c6Ssthen	GUESS=i386-pc-qnx
1505191f22c6Ssthen	;;
1506a3167c07Ssthen    NEO-*:NONSTOP_KERNEL:*:*)
1507191f22c6Ssthen	GUESS=neo-tandem-nsk$UNAME_RELEASE
1508191f22c6Ssthen	;;
1509229e174cSsthen    NSE-*:NONSTOP_KERNEL:*:*)
1510191f22c6Ssthen	GUESS=nse-tandem-nsk$UNAME_RELEASE
1511191f22c6Ssthen	;;
1512a3167c07Ssthen    NSR-*:NONSTOP_KERNEL:*:*)
1513191f22c6Ssthen	GUESS=nsr-tandem-nsk$UNAME_RELEASE
1514191f22c6Ssthen	;;
1515a3167c07Ssthen    NSV-*:NONSTOP_KERNEL:*:*)
1516191f22c6Ssthen	GUESS=nsv-tandem-nsk$UNAME_RELEASE
1517191f22c6Ssthen	;;
1518a3167c07Ssthen    NSX-*:NONSTOP_KERNEL:*:*)
1519191f22c6Ssthen	GUESS=nsx-tandem-nsk$UNAME_RELEASE
1520191f22c6Ssthen	;;
1521933707f3Ssthen    *:NonStop-UX:*:*)
1522191f22c6Ssthen	GUESS=mips-compaq-nonstopux
1523191f22c6Ssthen	;;
1524933707f3Ssthen    BS2000:POSIX*:*:*)
1525191f22c6Ssthen	GUESS=bs2000-siemens-sysv
1526191f22c6Ssthen	;;
1527933707f3Ssthen    DS/*:UNIX_System_V:*:*)
1528191f22c6Ssthen	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
1529191f22c6Ssthen	;;
1530933707f3Ssthen    *:Plan9:*:*)
1531933707f3Ssthen	# "uname -m" is not consistent, so use $cputype instead. 386
1532933707f3Ssthen	# is converted to i386 for consistency with other x86
1533933707f3Ssthen	# operating systems.
1534191f22c6Ssthen	if test "${cputype-}" = 386; then
1535933707f3Ssthen	    UNAME_MACHINE=i386
1536191f22c6Ssthen	elif test "x${cputype-}" != x; then
1537191f22c6Ssthen	    UNAME_MACHINE=$cputype
1538933707f3Ssthen	fi
1539191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-plan9
1540191f22c6Ssthen	;;
1541933707f3Ssthen    *:TOPS-10:*:*)
1542191f22c6Ssthen	GUESS=pdp10-unknown-tops10
1543191f22c6Ssthen	;;
1544933707f3Ssthen    *:TENEX:*:*)
1545191f22c6Ssthen	GUESS=pdp10-unknown-tenex
1546191f22c6Ssthen	;;
1547933707f3Ssthen    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1548191f22c6Ssthen	GUESS=pdp10-dec-tops20
1549191f22c6Ssthen	;;
1550933707f3Ssthen    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1551191f22c6Ssthen	GUESS=pdp10-xkl-tops20
1552191f22c6Ssthen	;;
1553933707f3Ssthen    *:TOPS-20:*:*)
1554191f22c6Ssthen	GUESS=pdp10-unknown-tops20
1555191f22c6Ssthen	;;
1556933707f3Ssthen    *:ITS:*:*)
1557191f22c6Ssthen	GUESS=pdp10-unknown-its
1558191f22c6Ssthen	;;
1559933707f3Ssthen    SEI:*:*:SEIUX)
1560191f22c6Ssthen	GUESS=mips-sei-seiux$UNAME_RELEASE
1561191f22c6Ssthen	;;
1562933707f3Ssthen    *:DragonFly:*:*)
1563191f22c6Ssthen	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
1564191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
1565191f22c6Ssthen	;;
1566933707f3Ssthen    *:*VMS:*:*)
1567191f22c6Ssthen	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1568191f22c6Ssthen	case $UNAME_MACHINE in
1569191f22c6Ssthen	    A*) GUESS=alpha-dec-vms ;;
1570191f22c6Ssthen	    I*) GUESS=ia64-dec-vms ;;
1571191f22c6Ssthen	    V*) GUESS=vax-dec-vms ;;
1572933707f3Ssthen	esac ;;
1573933707f3Ssthen    *:XENIX:*:SysV)
1574191f22c6Ssthen	GUESS=i386-pc-xenix
1575191f22c6Ssthen	;;
1576933707f3Ssthen    i*86:skyos:*:*)
1577191f22c6Ssthen	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
1578191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
1579191f22c6Ssthen	;;
1580933707f3Ssthen    i*86:rdos:*:*)
1581191f22c6Ssthen	GUESS=$UNAME_MACHINE-pc-rdos
1582191f22c6Ssthen	;;
1583e21c60efSsthen    i*86:Fiwix:*:*)
1584e21c60efSsthen	GUESS=$UNAME_MACHINE-pc-fiwix
1585e21c60efSsthen	;;
15869982a05dSsthen    *:AROS:*:*)
1587191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-aros
1588191f22c6Ssthen	;;
1589229e174cSsthen    x86_64:VMkernel:*:*)
1590191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-esx
1591191f22c6Ssthen	;;
15920990ddf5Ssthen    amd64:Isilon\ OneFS:*:*)
1593191f22c6Ssthen	GUESS=x86_64-unknown-onefs
1594191f22c6Ssthen	;;
1595a3167c07Ssthen    *:Unleashed:*:*)
1596191f22c6Ssthen	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
1597191f22c6Ssthen	;;
1598*d896b962Ssthen    *:Ironclad:*:*)
1599*d896b962Ssthen	GUESS=$UNAME_MACHINE-unknown-ironclad
1600*d896b962Ssthen	;;
1601a3167c07Ssthenesac
1602a3167c07Ssthen
1603191f22c6Ssthen# Do we have a guess based on uname results?
1604191f22c6Ssthenif test "x$GUESS" != x; then
1605191f22c6Ssthen    echo "$GUESS"
1606191f22c6Ssthen    exit
1607191f22c6Ssthenfi
1608191f22c6Ssthen
1609a3167c07Ssthen# No uname command or uname output not recognized.
1610a3167c07Ssthenset_cc_for_build
1611a3167c07Ssthencat > "$dummy.c" <<EOF
1612a3167c07Ssthen#ifdef _SEQUENT_
1613a3167c07Ssthen#include <sys/types.h>
1614a3167c07Ssthen#include <sys/utsname.h>
1615a3167c07Ssthen#endif
1616a3167c07Ssthen#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1617a3167c07Ssthen#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1618a3167c07Ssthen#include <signal.h>
1619a3167c07Ssthen#if defined(_SIZE_T_) || defined(SIGLOST)
1620a3167c07Ssthen#include <sys/utsname.h>
1621a3167c07Ssthen#endif
1622a3167c07Ssthen#endif
1623a3167c07Ssthen#endif
1624a3167c07Ssthenmain ()
1625a3167c07Ssthen{
1626a3167c07Ssthen#if defined (sony)
1627a3167c07Ssthen#if defined (MIPSEB)
1628a3167c07Ssthen  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1629a3167c07Ssthen     I don't know....  */
1630a3167c07Ssthen  printf ("mips-sony-bsd\n"); exit (0);
1631a3167c07Ssthen#else
1632a3167c07Ssthen#include <sys/param.h>
1633a3167c07Ssthen  printf ("m68k-sony-newsos%s\n",
1634a3167c07Ssthen#ifdef NEWSOS4
1635a3167c07Ssthen  "4"
1636a3167c07Ssthen#else
1637a3167c07Ssthen  ""
1638a3167c07Ssthen#endif
1639a3167c07Ssthen  ); exit (0);
1640a3167c07Ssthen#endif
1641a3167c07Ssthen#endif
1642a3167c07Ssthen
1643a3167c07Ssthen#if defined (NeXT)
1644a3167c07Ssthen#if !defined (__ARCHITECTURE__)
1645a3167c07Ssthen#define __ARCHITECTURE__ "m68k"
1646a3167c07Ssthen#endif
1647a3167c07Ssthen  int version;
1648191f22c6Ssthen  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1649a3167c07Ssthen  if (version < 4)
1650a3167c07Ssthen    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1651a3167c07Ssthen  else
1652a3167c07Ssthen    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1653a3167c07Ssthen  exit (0);
1654a3167c07Ssthen#endif
1655a3167c07Ssthen
1656a3167c07Ssthen#if defined (MULTIMAX) || defined (n16)
1657a3167c07Ssthen#if defined (UMAXV)
1658a3167c07Ssthen  printf ("ns32k-encore-sysv\n"); exit (0);
1659a3167c07Ssthen#else
1660a3167c07Ssthen#if defined (CMU)
1661a3167c07Ssthen  printf ("ns32k-encore-mach\n"); exit (0);
1662a3167c07Ssthen#else
1663a3167c07Ssthen  printf ("ns32k-encore-bsd\n"); exit (0);
1664a3167c07Ssthen#endif
1665a3167c07Ssthen#endif
1666a3167c07Ssthen#endif
1667a3167c07Ssthen
1668a3167c07Ssthen#if defined (__386BSD__)
1669a3167c07Ssthen  printf ("i386-pc-bsd\n"); exit (0);
1670a3167c07Ssthen#endif
1671a3167c07Ssthen
1672a3167c07Ssthen#if defined (sequent)
1673a3167c07Ssthen#if defined (i386)
1674a3167c07Ssthen  printf ("i386-sequent-dynix\n"); exit (0);
1675a3167c07Ssthen#endif
1676a3167c07Ssthen#if defined (ns32000)
1677a3167c07Ssthen  printf ("ns32k-sequent-dynix\n"); exit (0);
1678a3167c07Ssthen#endif
1679a3167c07Ssthen#endif
1680a3167c07Ssthen
1681a3167c07Ssthen#if defined (_SEQUENT_)
1682a3167c07Ssthen  struct utsname un;
1683a3167c07Ssthen
1684a3167c07Ssthen  uname(&un);
1685a3167c07Ssthen  if (strncmp(un.version, "V2", 2) == 0) {
1686a3167c07Ssthen    printf ("i386-sequent-ptx2\n"); exit (0);
1687a3167c07Ssthen  }
1688a3167c07Ssthen  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1689a3167c07Ssthen    printf ("i386-sequent-ptx1\n"); exit (0);
1690a3167c07Ssthen  }
1691a3167c07Ssthen  printf ("i386-sequent-ptx\n"); exit (0);
1692a3167c07Ssthen#endif
1693a3167c07Ssthen
1694a3167c07Ssthen#if defined (vax)
1695a3167c07Ssthen#if !defined (ultrix)
1696a3167c07Ssthen#include <sys/param.h>
1697a3167c07Ssthen#if defined (BSD)
1698a3167c07Ssthen#if BSD == 43
1699a3167c07Ssthen  printf ("vax-dec-bsd4.3\n"); exit (0);
1700a3167c07Ssthen#else
1701a3167c07Ssthen#if BSD == 199006
1702a3167c07Ssthen  printf ("vax-dec-bsd4.3reno\n"); exit (0);
1703a3167c07Ssthen#else
1704a3167c07Ssthen  printf ("vax-dec-bsd\n"); exit (0);
1705a3167c07Ssthen#endif
1706a3167c07Ssthen#endif
1707a3167c07Ssthen#else
1708a3167c07Ssthen  printf ("vax-dec-bsd\n"); exit (0);
1709a3167c07Ssthen#endif
1710a3167c07Ssthen#else
1711a3167c07Ssthen#if defined(_SIZE_T_) || defined(SIGLOST)
1712a3167c07Ssthen  struct utsname un;
1713a3167c07Ssthen  uname (&un);
1714a3167c07Ssthen  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1715a3167c07Ssthen#else
1716a3167c07Ssthen  printf ("vax-dec-ultrix\n"); exit (0);
1717a3167c07Ssthen#endif
1718a3167c07Ssthen#endif
1719a3167c07Ssthen#endif
1720a3167c07Ssthen#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1721a3167c07Ssthen#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1722a3167c07Ssthen#if defined(_SIZE_T_) || defined(SIGLOST)
1723a3167c07Ssthen  struct utsname *un;
1724a3167c07Ssthen  uname (&un);
1725a3167c07Ssthen  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1726a3167c07Ssthen#else
1727a3167c07Ssthen  printf ("mips-dec-ultrix\n"); exit (0);
1728a3167c07Ssthen#endif
1729a3167c07Ssthen#endif
1730a3167c07Ssthen#endif
1731a3167c07Ssthen
1732a3167c07Ssthen#if defined (alliant) && defined (i860)
1733a3167c07Ssthen  printf ("i860-alliant-bsd\n"); exit (0);
1734a3167c07Ssthen#endif
1735a3167c07Ssthen
1736a3167c07Ssthen  exit (1);
1737a3167c07Ssthen}
1738a3167c07SsthenEOF
1739a3167c07Ssthen
1740191f22c6Ssthen$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
1741a3167c07Ssthen	{ echo "$SYSTEM_NAME"; exit; }
1742a3167c07Ssthen
1743a3167c07Ssthen# Apollos put the system type in the environment.
1744a3167c07Ssthentest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1745a3167c07Ssthen
1746a3167c07Ssthenecho "$0: unable to guess system type" >&2
1747a3167c07Ssthen
1748191f22c6Ssthencase $UNAME_MACHINE:$UNAME_SYSTEM in
1749a3167c07Ssthen    mips:Linux | mips64:Linux)
1750a3167c07Ssthen	# If we got here on MIPS GNU/Linux, output extra information.
1751a3167c07Ssthen	cat >&2 <<EOF
1752a3167c07Ssthen
1753a3167c07SsthenNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1754a3167c07Ssthenthe system type. Please install a C compiler and try again.
1755a3167c07SsthenEOF
1756a3167c07Ssthen	;;
1757933707f3Ssthenesac
1758933707f3Ssthen
1759933707f3Ssthencat >&2 <<EOF
1760933707f3Ssthen
17610990ddf5SsthenThis script (version $timestamp), has failed to recognize the
1762a3167c07Ssthenoperating system you are using. If your script is old, overwrite *all*
1763a3167c07Ssthencopies of config.guess and config.sub with the latest versions from:
1764933707f3Ssthen
1765eba819a2Ssthen  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
1766933707f3Ssthenand
1767eba819a2Ssthen  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1768a3167c07SsthenEOF
1769a3167c07Ssthen
1770191f22c6Ssthenour_year=`echo $timestamp | sed 's,-.*,,'`
1771191f22c6Ssthenthisyear=`date +%Y`
1772a3167c07Ssthen# shellcheck disable=SC2003
1773191f22c6Ssthenscript_age=`expr "$thisyear" - "$our_year"`
1774191f22c6Ssthenif test "$script_age" -lt 3 ; then
1775a3167c07Ssthen   cat >&2 <<EOF
1776933707f3Ssthen
17770990ddf5SsthenIf $0 has already been updated, send the following data and any
17780990ddf5Sstheninformation you think might be pertinent to config-patches@gnu.org to
17790990ddf5Ssthenprovide the necessary information to handle your system.
1780933707f3Ssthen
1781933707f3Ssthenconfig.guess timestamp = $timestamp
1782933707f3Ssthen
1783191f22c6Ssthenuname -m = `(uname -m) 2>/dev/null || echo unknown`
1784191f22c6Ssthenuname -r = `(uname -r) 2>/dev/null || echo unknown`
1785191f22c6Ssthenuname -s = `(uname -s) 2>/dev/null || echo unknown`
1786191f22c6Ssthenuname -v = `(uname -v) 2>/dev/null || echo unknown`
1787933707f3Ssthen
1788191f22c6Ssthen/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1789191f22c6Ssthen/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1790933707f3Ssthen
1791191f22c6Ssthenhostinfo               = `(hostinfo) 2>/dev/null`
1792191f22c6Ssthen/bin/universe          = `(/bin/universe) 2>/dev/null`
1793191f22c6Ssthen/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1794191f22c6Ssthen/bin/arch              = `(/bin/arch) 2>/dev/null`
1795191f22c6Ssthen/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1796191f22c6Ssthen/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1797933707f3Ssthen
1798a3167c07SsthenUNAME_MACHINE = "$UNAME_MACHINE"
1799a3167c07SsthenUNAME_RELEASE = "$UNAME_RELEASE"
1800a3167c07SsthenUNAME_SYSTEM  = "$UNAME_SYSTEM"
1801a3167c07SsthenUNAME_VERSION = "$UNAME_VERSION"
1802933707f3SsthenEOF
1803a3167c07Ssthenfi
1804933707f3Ssthen
1805933707f3Ssthenexit 1
1806933707f3Ssthen
1807933707f3Ssthen# Local variables:
1808a3167c07Ssthen# eval: (add-hook 'before-save-hook 'time-stamp)
1809933707f3Ssthen# time-stamp-start: "timestamp='"
1810933707f3Ssthen# time-stamp-format: "%:y-%02m-%02d"
1811933707f3Ssthen# time-stamp-end: "'"
1812933707f3Ssthen# End:
1813