1bccedf53Smrg#! /bin/sh
2bccedf53Smrg# Attempt to guess a canonical system name.
3a2394c98Smrg#   Copyright 1992-2024 Free Software Foundation, Inc.
4bccedf53Smrg
5ec318dbfSmrg# shellcheck disable=SC2006,SC2268 # see below for rationale
6ec318dbfSmrg
7a2394c98Smrgtimestamp='2024-01-01'
8bccedf53Smrg
9bccedf53Smrg# This file is free software; you can redistribute it and/or modify it
10bccedf53Smrg# under the terms of the GNU General Public License as published by
11a2394c98Smrg# the Free Software Foundation, either version 3 of the License, or
12bccedf53Smrg# (at your option) any later version.
13bccedf53Smrg#
14bccedf53Smrg# This program is distributed in the hope that it will be useful, but
15bccedf53Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16bccedf53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17bccedf53Smrg# General Public License for more details.
18bccedf53Smrg#
19bccedf53Smrg# You should have received a copy of the GNU General Public License
2089afc689Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
21bccedf53Smrg#
22bccedf53Smrg# As a special exception to the GNU General Public License, if you
23bccedf53Smrg# distribute this file as part of a program that contains a
24bccedf53Smrg# configuration script generated by Autoconf, you may include it under
2589afc689Smrg# the same distribution terms that you use for the rest of that
2689afc689Smrg# program.  This Exception is an additional permission under section 7
2789afc689Smrg# of the GNU General Public License, version 3 ("GPLv3").
28bccedf53Smrg#
2989afc689Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
30bccedf53Smrg#
31f7ada8ddSmrg# You can get the latest version of this script from:
32ec318dbfSmrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
3389afc689Smrg#
3489afc689Smrg# Please send patches to <config-patches@gnu.org>.
3589afc689Smrg
36bccedf53Smrg
37ec318dbfSmrg# The "shellcheck disable" line above the timestamp inhibits complaints
38ec318dbfSmrg# about features and limitations of the classic Bourne shell that were
39ec318dbfSmrg# superseded or lifted in POSIX.  However, this script identifies a wide
40ec318dbfSmrg# variety of pre-POSIX systems that do not have POSIX shells at all, and
41ec318dbfSmrg# even some reasonably current systems (Solaris 10 as case-in-point) still
42ec318dbfSmrg# have a pre-POSIX /bin/sh.
43ec318dbfSmrg
44ec318dbfSmrg
45bccedf53Smrgme=`echo "$0" | sed -e 's,.*/,,'`
46bccedf53Smrg
47bccedf53Smrgusage="\
48bccedf53SmrgUsage: $0 [OPTION]
49bccedf53Smrg
50a2394c98SmrgOutput the configuration name of the system '$me' is run on.
51bccedf53Smrg
5289afc689SmrgOptions:
53bccedf53Smrg  -h, --help         print this help, then exit
54bccedf53Smrg  -t, --time-stamp   print date of last modification, then exit
55bccedf53Smrg  -v, --version      print version number, then exit
56bccedf53Smrg
57bccedf53SmrgReport bugs and patches to <config-patches@gnu.org>."
58bccedf53Smrg
59bccedf53Smrgversion="\
60bccedf53SmrgGNU config.guess ($timestamp)
61bccedf53Smrg
62bccedf53SmrgOriginally written by Per Bothner.
63a2394c98SmrgCopyright 1992-2024 Free Software Foundation, Inc.
64bccedf53Smrg
65bccedf53SmrgThis is free software; see the source for copying conditions.  There is NO
66bccedf53Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
67bccedf53Smrg
68bccedf53Smrghelp="
69a2394c98SmrgTry '$me --help' for more information."
70bccedf53Smrg
71bccedf53Smrg# Parse command line
72bccedf53Smrgwhile test $# -gt 0 ; do
73bccedf53Smrg  case $1 in
74bccedf53Smrg    --time-stamp | --time* | -t )
757c5f6000Smrg       echo "$timestamp" ; exit ;;
76bccedf53Smrg    --version | -v )
777c5f6000Smrg       echo "$version" ; exit ;;
78bccedf53Smrg    --help | --h* | -h )
797c5f6000Smrg       echo "$usage"; exit ;;
80bccedf53Smrg    -- )     # Stop option processing
81bccedf53Smrg       shift; break ;;
82bccedf53Smrg    - )	# Use stdin as input.
83bccedf53Smrg       break ;;
84bccedf53Smrg    -* )
85bccedf53Smrg       echo "$me: invalid option $1$help" >&2
86bccedf53Smrg       exit 1 ;;
87bccedf53Smrg    * )
88bccedf53Smrg       break ;;
89bccedf53Smrg  esac
90bccedf53Smrgdone
91bccedf53Smrg
92bccedf53Smrgif test $# != 0; then
93bccedf53Smrg  echo "$me: too many arguments$help" >&2
94bccedf53Smrg  exit 1
95bccedf53Smrgfi
96bccedf53Smrg
97ec318dbfSmrg# Just in case it came from the environment.
98ec318dbfSmrgGUESS=
99bccedf53Smrg
100bccedf53Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
101bccedf53Smrg# compiler to aid in system detection is discouraged as it requires
102bccedf53Smrg# temporary files to be created and, as you can see below, it is a
103bccedf53Smrg# headache to deal with in a portable fashion.
104bccedf53Smrg
105a2394c98Smrg# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
106a2394c98Smrg# use 'HOST_CC' if defined, but it is deprecated.
107bccedf53Smrg
108bccedf53Smrg# Portable tmp directory creation inspired by the Autoconf team.
109bccedf53Smrg
110ec318dbfSmrgtmp=
111ec318dbfSmrg# shellcheck disable=SC2172
112ec318dbfSmrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
113ec318dbfSmrg
114ec318dbfSmrgset_cc_for_build() {
115ec318dbfSmrg    # prevent multiple calls if $tmp is already set
116ec318dbfSmrg    test "$tmp" && return 0
117ec318dbfSmrg    : "${TMPDIR=/tmp}"
118ec318dbfSmrg    # shellcheck disable=SC2039,SC3028
119ec318dbfSmrg    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
120ec318dbfSmrg	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
121ec318dbfSmrg	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
122ec318dbfSmrg	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
123ec318dbfSmrg    dummy=$tmp/dummy
124ec318dbfSmrg    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
125ec318dbfSmrg	,,)    echo "int x;" > "$dummy.c"
126ec318dbfSmrg	       for driver in cc gcc c89 c99 ; do
127ec318dbfSmrg		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
128ec318dbfSmrg		       CC_FOR_BUILD=$driver
129ec318dbfSmrg		       break
130ec318dbfSmrg		   fi
131ec318dbfSmrg	       done
132ec318dbfSmrg	       if test x"$CC_FOR_BUILD" = x ; then
133ec318dbfSmrg		   CC_FOR_BUILD=no_compiler_found
134ec318dbfSmrg	       fi
135ec318dbfSmrg	       ;;
136ec318dbfSmrg	,,*)   CC_FOR_BUILD=$CC ;;
137ec318dbfSmrg	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
138ec318dbfSmrg    esac
139ec318dbfSmrg}
140bccedf53Smrg
141bccedf53Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
142bccedf53Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
143ec318dbfSmrgif test -f /.attbin/uname ; then
144bccedf53Smrg	PATH=$PATH:/.attbin ; export PATH
145bccedf53Smrgfi
146bccedf53Smrg
147bccedf53SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
148bccedf53SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
149ec318dbfSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
150bccedf53SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
151bccedf53Smrg
152ec318dbfSmrgcase $UNAME_SYSTEM in
15389afc689SmrgLinux|GNU|GNU/*)
154ec318dbfSmrg	LIBC=unknown
15589afc689Smrg
156ec318dbfSmrg	set_cc_for_build
15789afc689Smrg	cat <<-EOF > "$dummy.c"
158a2394c98Smrg	#if defined(__ANDROID__)
159a2394c98Smrg	LIBC=android
160a2394c98Smrg	#else
16189afc689Smrg	#include <features.h>
16289afc689Smrg	#if defined(__UCLIBC__)
16389afc689Smrg	LIBC=uclibc
16489afc689Smrg	#elif defined(__dietlibc__)
16589afc689Smrg	LIBC=dietlibc
166ec318dbfSmrg	#elif defined(__GLIBC__)
16789afc689Smrg	LIBC=gnu
168a2394c98Smrg	#elif defined(__LLVM_LIBC__)
169a2394c98Smrg	LIBC=llvm
170ec318dbfSmrg	#else
171ec318dbfSmrg	#include <stdarg.h>
172ec318dbfSmrg	/* First heuristic to detect musl libc.  */
173ec318dbfSmrg	#ifdef __DEFINED_va_list
174ec318dbfSmrg	LIBC=musl
175ec318dbfSmrg	#endif
17689afc689Smrg	#endif
177a2394c98Smrg	#endif
17889afc689Smrg	EOF
179ec318dbfSmrg	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
180ec318dbfSmrg	eval "$cc_set_libc"
18189afc689Smrg
182ec318dbfSmrg	# Second heuristic to detect musl libc.
183ec318dbfSmrg	if [ "$LIBC" = unknown ] &&
184ec318dbfSmrg	   command -v ldd >/dev/null &&
185ec318dbfSmrg	   ldd --version 2>&1 | grep -q ^musl; then
186ec318dbfSmrg		LIBC=musl
187ec318dbfSmrg	fi
188ec318dbfSmrg
189ec318dbfSmrg	# If the system lacks a compiler, then just pick glibc.
190ec318dbfSmrg	# We could probably try harder.
191ec318dbfSmrg	if [ "$LIBC" = unknown ]; then
192ec318dbfSmrg		LIBC=gnu
19389afc689Smrg	fi
19489afc689Smrg	;;
19589afc689Smrgesac
19689afc689Smrg
197bccedf53Smrg# Note: order is significant - the case branches are not exclusive.
198bccedf53Smrg
199ec318dbfSmrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
200bccedf53Smrg    *:NetBSD:*:*)
201bccedf53Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
20289afc689Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
203bccedf53Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
204bccedf53Smrg	# switched to ELF, *-*-netbsd* would select the old
205bccedf53Smrg	# object file format.  This provides both forward
206bccedf53Smrg	# compatibility and a consistent mechanism for selecting the
207bccedf53Smrg	# object file format.
208bccedf53Smrg	#
209bccedf53Smrg	# Note: NetBSD doesn't particularly care about the vendor
210bccedf53Smrg	# portion of the name.  We always set it to "unknown".
21189afc689Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
212ec318dbfSmrg	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
213ec318dbfSmrg	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
21489afc689Smrg	    echo unknown)`
215ec318dbfSmrg	case $UNAME_MACHINE_ARCH in
216ec318dbfSmrg	    aarch64eb) machine=aarch64_be-unknown ;;
217bccedf53Smrg	    armeb) machine=armeb-unknown ;;
218bccedf53Smrg	    arm*) machine=arm-unknown ;;
219bccedf53Smrg	    sh3el) machine=shl-unknown ;;
220bccedf53Smrg	    sh3eb) machine=sh-unknown ;;
2217c5f6000Smrg	    sh5el) machine=sh5le-unknown ;;
22289afc689Smrg	    earmv*)
22389afc689Smrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
22489afc689Smrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
225ec318dbfSmrg		machine=${arch}${endian}-unknown
22689afc689Smrg		;;
227ec318dbfSmrg	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
228bccedf53Smrg	esac
229bccedf53Smrg	# The Operating System including object format, if it has switched
23089afc689Smrg	# to ELF recently (or will in the future) and ABI.
231ec318dbfSmrg	case $UNAME_MACHINE_ARCH in
23289afc689Smrg	    earm*)
23389afc689Smrg		os=netbsdelf
23489afc689Smrg		;;
235bccedf53Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
236ec318dbfSmrg		set_cc_for_build
237bccedf53Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
238f7ada8ddSmrg			| grep -q __ELF__
239bccedf53Smrg		then
240bccedf53Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
241bccedf53Smrg		    # Return netbsd for either.  FIX?
242bccedf53Smrg		    os=netbsd
243bccedf53Smrg		else
244bccedf53Smrg		    os=netbsdelf
245bccedf53Smrg		fi
246bccedf53Smrg		;;
247bccedf53Smrg	    *)
2481b1389eeSmrg		os=netbsd
249bccedf53Smrg		;;
250bccedf53Smrg	esac
25189afc689Smrg	# Determine ABI tags.
252ec318dbfSmrg	case $UNAME_MACHINE_ARCH in
25389afc689Smrg	    earm*)
25489afc689Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
25589afc689Smrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
25689afc689Smrg		;;
25789afc689Smrg	esac
258bccedf53Smrg	# The OS release
259bccedf53Smrg	# Debian GNU/NetBSD machines have a different userland, and
260bccedf53Smrg	# thus, need a distinct triplet. However, they do not need
261bccedf53Smrg	# kernel version information, so it can be replaced with a
262bccedf53Smrg	# suitable tag, in the style of linux-gnu.
263ec318dbfSmrg	case $UNAME_VERSION in
264bccedf53Smrg	    Debian*)
265bccedf53Smrg		release='-gnu'
266bccedf53Smrg		;;
267bccedf53Smrg	    *)
26889afc689Smrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
269bccedf53Smrg		;;
270bccedf53Smrg	esac
271bccedf53Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
272bccedf53Smrg	# contains redundant information, the shorter form:
273bccedf53Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
274ec318dbfSmrg	GUESS=$machine-${os}${release}${abi-}
275ec318dbfSmrg	;;
27689afc689Smrg    *:Bitrig:*:*)
27789afc689Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
278ec318dbfSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
279ec318dbfSmrg	;;
280bccedf53Smrg    *:OpenBSD:*:*)
2817c5f6000Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
282ec318dbfSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
283ec318dbfSmrg	;;
284ec318dbfSmrg    *:SecBSD:*:*)
285ec318dbfSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
286ec318dbfSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
287ec318dbfSmrg	;;
28889afc689Smrg    *:LibertyBSD:*:*)
28989afc689Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
290ec318dbfSmrg	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
291ec318dbfSmrg	;;
29289afc689Smrg    *:MidnightBSD:*:*)
293ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
294ec318dbfSmrg	;;
2957c5f6000Smrg    *:ekkoBSD:*:*)
296ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
297ec318dbfSmrg	;;
2987c5f6000Smrg    *:SolidBSD:*:*)
299ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
300ec318dbfSmrg	;;
301ec318dbfSmrg    *:OS108:*:*)
302ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
303ec318dbfSmrg	;;
3047c5f6000Smrg    macppc:MirBSD:*:*)
305ec318dbfSmrg	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
306ec318dbfSmrg	;;
3077c5f6000Smrg    *:MirBSD:*:*)
308ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
309ec318dbfSmrg	;;
31089afc689Smrg    *:Sortix:*:*)
311ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-sortix
312ec318dbfSmrg	;;
313ec318dbfSmrg    *:Twizzler:*:*)
314ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-twizzler
315ec318dbfSmrg	;;
31689afc689Smrg    *:Redox:*:*)
317ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-redox
318ec318dbfSmrg	;;
31989afc689Smrg    mips:OSF1:*.*)
320ec318dbfSmrg	GUESS=mips-dec-osf1
321ec318dbfSmrg	;;
322bccedf53Smrg    alpha:OSF1:*:*)
323ec318dbfSmrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
324ec318dbfSmrg	trap '' 0
3257c5f6000Smrg	case $UNAME_RELEASE in
3267c5f6000Smrg	*4.0)
327bccedf53Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
3287c5f6000Smrg		;;
3297c5f6000Smrg	*5.*)
3301b1389eeSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
3317c5f6000Smrg		;;
3327c5f6000Smrg	esac
333bccedf53Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
334bccedf53Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
335bccedf53Smrg	# covers most systems running today.  This code pipes the CPU
336bccedf53Smrg	# types through head -n 1, so we only detect the type of CPU 0.
337bccedf53Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
338ec318dbfSmrg	case $ALPHA_CPU_TYPE in
339bccedf53Smrg	    "EV4 (21064)")
34089afc689Smrg		UNAME_MACHINE=alpha ;;
341bccedf53Smrg	    "EV4.5 (21064)")
34289afc689Smrg		UNAME_MACHINE=alpha ;;
343bccedf53Smrg	    "LCA4 (21066/21068)")
34489afc689Smrg		UNAME_MACHINE=alpha ;;
345bccedf53Smrg	    "EV5 (21164)")
34689afc689Smrg		UNAME_MACHINE=alphaev5 ;;
347bccedf53Smrg	    "EV5.6 (21164A)")
34889afc689Smrg		UNAME_MACHINE=alphaev56 ;;
349bccedf53Smrg	    "EV5.6 (21164PC)")
35089afc689Smrg		UNAME_MACHINE=alphapca56 ;;
351bccedf53Smrg	    "EV5.7 (21164PC)")
35289afc689Smrg		UNAME_MACHINE=alphapca57 ;;
353bccedf53Smrg	    "EV6 (21264)")
35489afc689Smrg		UNAME_MACHINE=alphaev6 ;;
355bccedf53Smrg	    "EV6.7 (21264A)")
35689afc689Smrg		UNAME_MACHINE=alphaev67 ;;
357bccedf53Smrg	    "EV6.8CB (21264C)")
35889afc689Smrg		UNAME_MACHINE=alphaev68 ;;
359bccedf53Smrg	    "EV6.8AL (21264B)")
36089afc689Smrg		UNAME_MACHINE=alphaev68 ;;
361bccedf53Smrg	    "EV6.8CX (21264D)")
36289afc689Smrg		UNAME_MACHINE=alphaev68 ;;
363bccedf53Smrg	    "EV6.9A (21264/EV69A)")
36489afc689Smrg		UNAME_MACHINE=alphaev69 ;;
365bccedf53Smrg	    "EV7 (21364)")
36689afc689Smrg		UNAME_MACHINE=alphaev7 ;;
367bccedf53Smrg	    "EV7.9 (21364A)")
36889afc689Smrg		UNAME_MACHINE=alphaev79 ;;
369bccedf53Smrg	esac
3707c5f6000Smrg	# A Pn.n version is a patched version.
371bccedf53Smrg	# A Vn.n version is a released version.
372bccedf53Smrg	# A Tn.n version is a released field test version.
373bccedf53Smrg	# A Xn.n version is an unreleased experimental baselevel.
374bccedf53Smrg	# 1.2 uses "1.2" for uname -r.
375ec318dbfSmrg	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
376ec318dbfSmrg	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
377ec318dbfSmrg	;;
378bccedf53Smrg    Amiga*:UNIX_System_V:4.0:*)
379ec318dbfSmrg	GUESS=m68k-unknown-sysv4
380ec318dbfSmrg	;;
381bccedf53Smrg    *:[Aa]miga[Oo][Ss]:*:*)
382ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-amigaos
383ec318dbfSmrg	;;
384bccedf53Smrg    *:[Mm]orph[Oo][Ss]:*:*)
385ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-morphos
386ec318dbfSmrg	;;
387bccedf53Smrg    *:OS/390:*:*)
388ec318dbfSmrg	GUESS=i370-ibm-openedition
389ec318dbfSmrg	;;
3907c5f6000Smrg    *:z/VM:*:*)
391ec318dbfSmrg	GUESS=s390-ibm-zvmoe
392ec318dbfSmrg	;;
3937c5f6000Smrg    *:OS400:*:*)
394ec318dbfSmrg	GUESS=powerpc-ibm-os400
395ec318dbfSmrg	;;
396bccedf53Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
397ec318dbfSmrg	GUESS=arm-acorn-riscix$UNAME_RELEASE
398ec318dbfSmrg	;;
39989afc689Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
400ec318dbfSmrg	GUESS=arm-unknown-riscos
401ec318dbfSmrg	;;
402bccedf53Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
403ec318dbfSmrg	GUESS=hppa1.1-hitachi-hiuxmpp
404ec318dbfSmrg	;;
405bccedf53Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
406bccedf53Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
407ec318dbfSmrg	case `(/bin/universe) 2>/dev/null` in
408ec318dbfSmrg	    att) GUESS=pyramid-pyramid-sysv3 ;;
409ec318dbfSmrg	    *)   GUESS=pyramid-pyramid-bsd   ;;
410ec318dbfSmrg	esac
411ec318dbfSmrg	;;
412bccedf53Smrg    NILE*:*:*:dcosx)
413ec318dbfSmrg	GUESS=pyramid-pyramid-svr4
414ec318dbfSmrg	;;
415bccedf53Smrg    DRS?6000:unix:4.0:6*)
416ec318dbfSmrg	GUESS=sparc-icl-nx6
417ec318dbfSmrg	;;
4187c5f6000Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
419bccedf53Smrg	case `/usr/bin/uname -p` in
420ec318dbfSmrg	    sparc) GUESS=sparc-icl-nx7 ;;
421ec318dbfSmrg	esac
422ec318dbfSmrg	;;
4237c5f6000Smrg    s390x:SunOS:*:*)
424ec318dbfSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
425ec318dbfSmrg	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
426ec318dbfSmrg	;;
427bccedf53Smrg    sun4H:SunOS:5.*:*)
428ec318dbfSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
429ec318dbfSmrg	GUESS=sparc-hal-solaris2$SUN_REL
430ec318dbfSmrg	;;
431bccedf53Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
432ec318dbfSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
433ec318dbfSmrg	GUESS=sparc-sun-solaris2$SUN_REL
434ec318dbfSmrg	;;
435f7ada8ddSmrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
436ec318dbfSmrg	GUESS=i386-pc-auroraux$UNAME_RELEASE
437ec318dbfSmrg	;;
4387c5f6000Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
439ec318dbfSmrg	set_cc_for_build
44089afc689Smrg	SUN_ARCH=i386
4417c5f6000Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
4427c5f6000Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
4437c5f6000Smrg	# This test works for both compilers.
444ec318dbfSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
4457c5f6000Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
446a2394c98Smrg		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
4477c5f6000Smrg		grep IS_64BIT_ARCH >/dev/null
4487c5f6000Smrg	    then
44989afc689Smrg		SUN_ARCH=x86_64
4507c5f6000Smrg	    fi
4517c5f6000Smrg	fi
452ec318dbfSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
453ec318dbfSmrg	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
454ec318dbfSmrg	;;
455bccedf53Smrg    sun4*:SunOS:6*:*)
456bccedf53Smrg	# According to config.sub, this is the proper way to canonicalize
457bccedf53Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
458bccedf53Smrg	# it's likely to be more like Solaris than SunOS4.
459ec318dbfSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
460ec318dbfSmrg	GUESS=sparc-sun-solaris3$SUN_REL
461ec318dbfSmrg	;;
462bccedf53Smrg    sun4*:SunOS:*:*)
463ec318dbfSmrg	case `/usr/bin/arch -k` in
464bccedf53Smrg	    Series*|S4*)
465bccedf53Smrg		UNAME_RELEASE=`uname -v`
466bccedf53Smrg		;;
467bccedf53Smrg	esac
468a2394c98Smrg	# Japanese Language versions have a version number like '4.1.3-JL'.
469ec318dbfSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
470ec318dbfSmrg	GUESS=sparc-sun-sunos$SUN_REL
471ec318dbfSmrg	;;
472bccedf53Smrg    sun3*:SunOS:*:*)
473ec318dbfSmrg	GUESS=m68k-sun-sunos$UNAME_RELEASE
474ec318dbfSmrg	;;
475bccedf53Smrg    sun*:*:4.2BSD:*)
476bccedf53Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
47789afc689Smrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
478ec318dbfSmrg	case `/bin/arch` in
479bccedf53Smrg	    sun3)
480ec318dbfSmrg		GUESS=m68k-sun-sunos$UNAME_RELEASE
481bccedf53Smrg		;;
482bccedf53Smrg	    sun4)
483ec318dbfSmrg		GUESS=sparc-sun-sunos$UNAME_RELEASE
484bccedf53Smrg		;;
485bccedf53Smrg	esac
486ec318dbfSmrg	;;
487bccedf53Smrg    aushp:SunOS:*:*)
488ec318dbfSmrg	GUESS=sparc-auspex-sunos$UNAME_RELEASE
489ec318dbfSmrg	;;
490bccedf53Smrg    # The situation for MiNT is a little confusing.  The machine name
491bccedf53Smrg    # can be virtually everything (everything which is not
492bccedf53Smrg    # "atarist" or "atariste" at least should have a processor
493bccedf53Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
494bccedf53Smrg    # to the lowercase version "mint" (or "freemint").  Finally
495bccedf53Smrg    # the system name "TOS" denotes a system which is actually not
496bccedf53Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
497bccedf53Smrg    # be no problem.
498bccedf53Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
499ec318dbfSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
500ec318dbfSmrg	;;
501bccedf53Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
502ec318dbfSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
503ec318dbfSmrg	;;
504bccedf53Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
505ec318dbfSmrg	GUESS=m68k-atari-mint$UNAME_RELEASE
506ec318dbfSmrg	;;
507bccedf53Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
508ec318dbfSmrg	GUESS=m68k-milan-mint$UNAME_RELEASE
509ec318dbfSmrg	;;
510bccedf53Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
511ec318dbfSmrg	GUESS=m68k-hades-mint$UNAME_RELEASE
512ec318dbfSmrg	;;
513bccedf53Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
514ec318dbfSmrg	GUESS=m68k-unknown-mint$UNAME_RELEASE
515ec318dbfSmrg	;;
5167c5f6000Smrg    m68k:machten:*:*)
517ec318dbfSmrg	GUESS=m68k-apple-machten$UNAME_RELEASE
518ec318dbfSmrg	;;
519bccedf53Smrg    powerpc:machten:*:*)
520ec318dbfSmrg	GUESS=powerpc-apple-machten$UNAME_RELEASE
521ec318dbfSmrg	;;
522bccedf53Smrg    RISC*:Mach:*:*)
523ec318dbfSmrg	GUESS=mips-dec-mach_bsd4.3
524ec318dbfSmrg	;;
525bccedf53Smrg    RISC*:ULTRIX:*:*)
526ec318dbfSmrg	GUESS=mips-dec-ultrix$UNAME_RELEASE
527ec318dbfSmrg	;;
528bccedf53Smrg    VAX*:ULTRIX*:*:*)
529ec318dbfSmrg	GUESS=vax-dec-ultrix$UNAME_RELEASE
530ec318dbfSmrg	;;
531bccedf53Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
532ec318dbfSmrg	GUESS=clipper-intergraph-clix$UNAME_RELEASE
533ec318dbfSmrg	;;
534bccedf53Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
535ec318dbfSmrg	set_cc_for_build
53689afc689Smrg	sed 's/^	//' << EOF > "$dummy.c"
537bccedf53Smrg#ifdef __cplusplus
538bccedf53Smrg#include <stdio.h>  /* for printf() prototype */
539bccedf53Smrg	int main (int argc, char *argv[]) {
540bccedf53Smrg#else
541bccedf53Smrg	int main (argc, argv) int argc; char *argv[]; {
542bccedf53Smrg#endif
543bccedf53Smrg	#if defined (host_mips) && defined (MIPSEB)
544bccedf53Smrg	#if defined (SYSTYPE_SYSV)
54589afc689Smrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
546bccedf53Smrg	#endif
547bccedf53Smrg	#if defined (SYSTYPE_SVR4)
54889afc689Smrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
549bccedf53Smrg	#endif
550bccedf53Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
55189afc689Smrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
552bccedf53Smrg	#endif
553bccedf53Smrg	#endif
554bccedf53Smrg	  exit (-1);
555bccedf53Smrg	}
556bccedf53SmrgEOF
55789afc689Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
55889afc689Smrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
55989afc689Smrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
5607c5f6000Smrg	    { echo "$SYSTEM_NAME"; exit; }
561ec318dbfSmrg	GUESS=mips-mips-riscos$UNAME_RELEASE
562ec318dbfSmrg	;;
563bccedf53Smrg    Motorola:PowerMAX_OS:*:*)
564ec318dbfSmrg	GUESS=powerpc-motorola-powermax
565ec318dbfSmrg	;;
566bccedf53Smrg    Motorola:*:4.3:PL8-*)
567ec318dbfSmrg	GUESS=powerpc-harris-powermax
568ec318dbfSmrg	;;
569bccedf53Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
570ec318dbfSmrg	GUESS=powerpc-harris-powermax
571ec318dbfSmrg	;;
572bccedf53Smrg    Night_Hawk:Power_UNIX:*:*)
573ec318dbfSmrg	GUESS=powerpc-harris-powerunix
574ec318dbfSmrg	;;
575bccedf53Smrg    m88k:CX/UX:7*:*)
576ec318dbfSmrg	GUESS=m88k-harris-cxux7
577ec318dbfSmrg	;;
578bccedf53Smrg    m88k:*:4*:R4*)
579ec318dbfSmrg	GUESS=m88k-motorola-sysv4
580ec318dbfSmrg	;;
581bccedf53Smrg    m88k:*:3*:R3*)
582ec318dbfSmrg	GUESS=m88k-motorola-sysv3
583ec318dbfSmrg	;;
584bccedf53Smrg    AViiON:dgux:*:*)
5851b1389eeSmrg	# DG/UX returns AViiON for all architectures
5861b1389eeSmrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
587ec318dbfSmrg	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
588bccedf53Smrg	then
589ec318dbfSmrg	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
590ec318dbfSmrg	       test "$TARGET_BINARY_INTERFACE"x = x
591bccedf53Smrg	    then
592ec318dbfSmrg		GUESS=m88k-dg-dgux$UNAME_RELEASE
593bccedf53Smrg	    else
594ec318dbfSmrg		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
595bccedf53Smrg	    fi
596bccedf53Smrg	else
597ec318dbfSmrg	    GUESS=i586-dg-dgux$UNAME_RELEASE
598bccedf53Smrg	fi
599ec318dbfSmrg	;;
600bccedf53Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
601ec318dbfSmrg	GUESS=m88k-dolphin-sysv3
602ec318dbfSmrg	;;
603bccedf53Smrg    M88*:*:R3*:*)
604bccedf53Smrg	# Delta 88k system running SVR3
605ec318dbfSmrg	GUESS=m88k-motorola-sysv3
606ec318dbfSmrg	;;
607bccedf53Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
608ec318dbfSmrg	GUESS=m88k-tektronix-sysv3
609ec318dbfSmrg	;;
610bccedf53Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
611ec318dbfSmrg	GUESS=m68k-tektronix-bsd
612ec318dbfSmrg	;;
613bccedf53Smrg    *:IRIX*:*:*)
614ec318dbfSmrg	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
615ec318dbfSmrg	GUESS=mips-sgi-irix$IRIX_REL
616ec318dbfSmrg	;;
617bccedf53Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
618ec318dbfSmrg	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
619ec318dbfSmrg	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
620bccedf53Smrg    i*86:AIX:*:*)
621ec318dbfSmrg	GUESS=i386-ibm-aix
622ec318dbfSmrg	;;
623bccedf53Smrg    ia64:AIX:*:*)
624ec318dbfSmrg	if test -x /usr/bin/oslevel ; then
625bccedf53Smrg		IBM_REV=`/usr/bin/oslevel`
626bccedf53Smrg	else
627ec318dbfSmrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
628bccedf53Smrg	fi
629ec318dbfSmrg	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
630ec318dbfSmrg	;;
631bccedf53Smrg    *:AIX:2:3)
632bccedf53Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
633ec318dbfSmrg		set_cc_for_build
63489afc689Smrg		sed 's/^		//' << EOF > "$dummy.c"
635bccedf53Smrg		#include <sys/systemcfg.h>
636bccedf53Smrg
637bccedf53Smrg		main()
638bccedf53Smrg			{
639bccedf53Smrg			if (!__power_pc())
640bccedf53Smrg				exit(1);
641bccedf53Smrg			puts("powerpc-ibm-aix3.2.5");
642bccedf53Smrg			exit(0);
643bccedf53Smrg			}
644bccedf53SmrgEOF
64589afc689Smrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
6467c5f6000Smrg		then
647ec318dbfSmrg			GUESS=$SYSTEM_NAME
6487c5f6000Smrg		else
649ec318dbfSmrg			GUESS=rs6000-ibm-aix3.2.5
6507c5f6000Smrg		fi
651bccedf53Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
652ec318dbfSmrg		GUESS=rs6000-ibm-aix3.2.4
653bccedf53Smrg	else
654ec318dbfSmrg		GUESS=rs6000-ibm-aix3.2
655bccedf53Smrg	fi
656ec318dbfSmrg	;;
657f7ada8ddSmrg    *:AIX:*:[4567])
658bccedf53Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
65989afc689Smrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
660bccedf53Smrg		IBM_ARCH=rs6000
661bccedf53Smrg	else
662bccedf53Smrg		IBM_ARCH=powerpc
663bccedf53Smrg	fi
664ec318dbfSmrg	if test -x /usr/bin/lslpp ; then
665ec318dbfSmrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
66689afc689Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
667bccedf53Smrg	else
668ec318dbfSmrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
669bccedf53Smrg	fi
670ec318dbfSmrg	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
671ec318dbfSmrg	;;
672bccedf53Smrg    *:AIX:*:*)
673ec318dbfSmrg	GUESS=rs6000-ibm-aix
674ec318dbfSmrg	;;
67589afc689Smrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
676ec318dbfSmrg	GUESS=romp-ibm-bsd4.4
677ec318dbfSmrg	;;
678bccedf53Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
679ec318dbfSmrg	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
680ec318dbfSmrg	;;                                  # report: romp-ibm BSD 4.3
681bccedf53Smrg    *:BOSX:*:*)
682ec318dbfSmrg	GUESS=rs6000-bull-bosx
683ec318dbfSmrg	;;
684bccedf53Smrg    DPX/2?00:B.O.S.:*:*)
685ec318dbfSmrg	GUESS=m68k-bull-sysv3
686ec318dbfSmrg	;;
687bccedf53Smrg    9000/[34]??:4.3bsd:1.*:*)
688ec318dbfSmrg	GUESS=m68k-hp-bsd
689ec318dbfSmrg	;;
690bccedf53Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
691ec318dbfSmrg	GUESS=m68k-hp-bsd4.4
692ec318dbfSmrg	;;
693bccedf53Smrg    9000/[34678]??:HP-UX:*:*)
694ec318dbfSmrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
695ec318dbfSmrg	case $UNAME_MACHINE in
69689afc689Smrg	    9000/31?)            HP_ARCH=m68000 ;;
69789afc689Smrg	    9000/[34]??)         HP_ARCH=m68k ;;
698bccedf53Smrg	    9000/[678][0-9][0-9])
699ec318dbfSmrg		if test -x /usr/bin/getconf; then
700bccedf53Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
7011b1389eeSmrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
702ec318dbfSmrg		    case $sc_cpu_version in
70389afc689Smrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
70489afc689Smrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
7051b1389eeSmrg		      532)                      # CPU_PA_RISC2_0
706ec318dbfSmrg			case $sc_kernel_bits in
70789afc689Smrg			  32) HP_ARCH=hppa2.0n ;;
70889afc689Smrg			  64) HP_ARCH=hppa2.0w ;;
70989afc689Smrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
7101b1389eeSmrg			esac ;;
7111b1389eeSmrg		    esac
712bccedf53Smrg		fi
713ec318dbfSmrg		if test "$HP_ARCH" = ""; then
714ec318dbfSmrg		    set_cc_for_build
71589afc689Smrg		    sed 's/^		//' << EOF > "$dummy.c"
716bccedf53Smrg
7171b1389eeSmrg		#define _HPUX_SOURCE
7181b1389eeSmrg		#include <stdlib.h>
7191b1389eeSmrg		#include <unistd.h>
720bccedf53Smrg
7211b1389eeSmrg		int main ()
7221b1389eeSmrg		{
7231b1389eeSmrg		#if defined(_SC_KERNEL_BITS)
7241b1389eeSmrg		    long bits = sysconf(_SC_KERNEL_BITS);
7251b1389eeSmrg		#endif
7261b1389eeSmrg		    long cpu  = sysconf (_SC_CPU_VERSION);
727bccedf53Smrg
7281b1389eeSmrg		    switch (cpu)
7291b1389eeSmrg			{
7301b1389eeSmrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
7311b1389eeSmrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
7321b1389eeSmrg			case CPU_PA_RISC2_0:
7331b1389eeSmrg		#if defined(_SC_KERNEL_BITS)
7341b1389eeSmrg			    switch (bits)
7351b1389eeSmrg				{
7361b1389eeSmrg				case 64: puts ("hppa2.0w"); break;
7371b1389eeSmrg				case 32: puts ("hppa2.0n"); break;
7381b1389eeSmrg				default: puts ("hppa2.0"); break;
7391b1389eeSmrg				} break;
7401b1389eeSmrg		#else  /* !defined(_SC_KERNEL_BITS) */
7411b1389eeSmrg			    puts ("hppa2.0"); break;
7421b1389eeSmrg		#endif
7431b1389eeSmrg			default: puts ("hppa1.0"); break;
7441b1389eeSmrg			}
7451b1389eeSmrg		    exit (0);
7461b1389eeSmrg		}
747bccedf53SmrgEOF
74889afc689Smrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
749bccedf53Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
750bccedf53Smrg		fi ;;
751bccedf53Smrg	esac
752ec318dbfSmrg	if test "$HP_ARCH" = hppa2.0w
753bccedf53Smrg	then
754ec318dbfSmrg	    set_cc_for_build
7557c5f6000Smrg
7567c5f6000Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
7577c5f6000Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
7587c5f6000Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
7597c5f6000Smrg	    #
7607c5f6000Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
7617c5f6000Smrg	    # => hppa2.0w-hp-hpux11.23
7627c5f6000Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
7637c5f6000Smrg	    # => hppa64-hp-hpux11.23
7647c5f6000Smrg
76589afc689Smrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
766f7ada8ddSmrg		grep -q __LP64__
767bccedf53Smrg	    then
76889afc689Smrg		HP_ARCH=hppa2.0w
769bccedf53Smrg	    else
77089afc689Smrg		HP_ARCH=hppa64
771bccedf53Smrg	    fi
772bccedf53Smrg	fi
773ec318dbfSmrg	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
774ec318dbfSmrg	;;
775bccedf53Smrg    ia64:HP-UX:*:*)
776ec318dbfSmrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
777ec318dbfSmrg	GUESS=ia64-hp-hpux$HPUX_REV
778ec318dbfSmrg	;;
779bccedf53Smrg    3050*:HI-UX:*:*)
780ec318dbfSmrg	set_cc_for_build
78189afc689Smrg	sed 's/^	//' << EOF > "$dummy.c"
782bccedf53Smrg	#include <unistd.h>
783bccedf53Smrg	int
784bccedf53Smrg	main ()
785bccedf53Smrg	{
786bccedf53Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
787bccedf53Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
788bccedf53Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
789bccedf53Smrg	     results, however.  */
790bccedf53Smrg	  if (CPU_IS_PA_RISC (cpu))
791bccedf53Smrg	    {
792bccedf53Smrg	      switch (cpu)
793bccedf53Smrg		{
794bccedf53Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
795bccedf53Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
796bccedf53Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
797bccedf53Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
798bccedf53Smrg		}
799bccedf53Smrg	    }
800bccedf53Smrg	  else if (CPU_IS_HP_MC68K (cpu))
801bccedf53Smrg	    puts ("m68k-hitachi-hiuxwe2");
802bccedf53Smrg	  else puts ("unknown-hitachi-hiuxwe2");
803bccedf53Smrg	  exit (0);
804bccedf53Smrg	}
805bccedf53SmrgEOF
80689afc689Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
8077c5f6000Smrg		{ echo "$SYSTEM_NAME"; exit; }
808ec318dbfSmrg	GUESS=unknown-hitachi-hiuxwe2
809ec318dbfSmrg	;;
81089afc689Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
811ec318dbfSmrg	GUESS=hppa1.1-hp-bsd
812ec318dbfSmrg	;;
813bccedf53Smrg    9000/8??:4.3bsd:*:*)
814ec318dbfSmrg	GUESS=hppa1.0-hp-bsd
815ec318dbfSmrg	;;
816bccedf53Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
817ec318dbfSmrg	GUESS=hppa1.0-hp-mpeix
818ec318dbfSmrg	;;
81989afc689Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
820ec318dbfSmrg	GUESS=hppa1.1-hp-osf
821ec318dbfSmrg	;;
822bccedf53Smrg    hp8??:OSF1:*:*)
823ec318dbfSmrg	GUESS=hppa1.0-hp-osf
824ec318dbfSmrg	;;
825bccedf53Smrg    i*86:OSF1:*:*)
826ec318dbfSmrg	if test -x /usr/sbin/sysversion ; then
827ec318dbfSmrg	    GUESS=$UNAME_MACHINE-unknown-osf1mk
828bccedf53Smrg	else
829ec318dbfSmrg	    GUESS=$UNAME_MACHINE-unknown-osf1
830bccedf53Smrg	fi
831ec318dbfSmrg	;;
832bccedf53Smrg    parisc*:Lites*:*:*)
833ec318dbfSmrg	GUESS=hppa1.1-hp-lites
834ec318dbfSmrg	;;
835bccedf53Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
836ec318dbfSmrg	GUESS=c1-convex-bsd
837ec318dbfSmrg	;;
838bccedf53Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
839bccedf53Smrg	if getsysinfo -f scalar_acc
840bccedf53Smrg	then echo c32-convex-bsd
841bccedf53Smrg	else echo c2-convex-bsd
842bccedf53Smrg	fi
8431b1389eeSmrg	exit ;;
844bccedf53Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
845ec318dbfSmrg	GUESS=c34-convex-bsd
846ec318dbfSmrg	;;
847bccedf53Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
848ec318dbfSmrg	GUESS=c38-convex-bsd
849ec318dbfSmrg	;;
850bccedf53Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
851ec318dbfSmrg	GUESS=c4-convex-bsd
852ec318dbfSmrg	;;
853bccedf53Smrg    CRAY*Y-MP:*:*:*)
854ec318dbfSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
855ec318dbfSmrg	GUESS=ymp-cray-unicos$CRAY_REL
856ec318dbfSmrg	;;
857bccedf53Smrg    CRAY*[A-Z]90:*:*:*)
85889afc689Smrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
859bccedf53Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
860bccedf53Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
861bccedf53Smrg	      -e 's/\.[^.]*$/.X/'
8627c5f6000Smrg	exit ;;
863bccedf53Smrg    CRAY*TS:*:*:*)
864ec318dbfSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
865ec318dbfSmrg	GUESS=t90-cray-unicos$CRAY_REL
866ec318dbfSmrg	;;
867bccedf53Smrg    CRAY*T3E:*:*:*)
868ec318dbfSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
869ec318dbfSmrg	GUESS=alphaev5-cray-unicosmk$CRAY_REL
870ec318dbfSmrg	;;
871bccedf53Smrg    CRAY*SV1:*:*:*)
872ec318dbfSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
873ec318dbfSmrg	GUESS=sv1-cray-unicos$CRAY_REL
874ec318dbfSmrg	;;
875bccedf53Smrg    *:UNICOS/mp:*:*)
876ec318dbfSmrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
877ec318dbfSmrg	GUESS=craynv-cray-unicosmp$CRAY_REL
878ec318dbfSmrg	;;
879bccedf53Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
88089afc689Smrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
88189afc689Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
88289afc689Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
883ec318dbfSmrg	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
884ec318dbfSmrg	;;
8857c5f6000Smrg    5000:UNIX_System_V:4.*:*)
88689afc689Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
88789afc689Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
888ec318dbfSmrg	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
889ec318dbfSmrg	;;
890bccedf53Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
891ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
892ec318dbfSmrg	;;
893bccedf53Smrg    sparc*:BSD/OS:*:*)
894ec318dbfSmrg	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
895ec318dbfSmrg	;;
896bccedf53Smrg    *:BSD/OS:*:*)
897ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
898ec318dbfSmrg	;;
899ec318dbfSmrg    arm:FreeBSD:*:*)
900ec318dbfSmrg	UNAME_PROCESSOR=`uname -p`
901ec318dbfSmrg	set_cc_for_build
902ec318dbfSmrg	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
903ec318dbfSmrg	    | grep -q __ARM_PCS_VFP
904ec318dbfSmrg	then
905ec318dbfSmrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
906ec318dbfSmrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
907ec318dbfSmrg	else
908ec318dbfSmrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
909ec318dbfSmrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
910ec318dbfSmrg	fi
911ec318dbfSmrg	;;
9127c5f6000Smrg    *:FreeBSD:*:*)
913a2394c98Smrg	UNAME_PROCESSOR=`uname -p`
914ec318dbfSmrg	case $UNAME_PROCESSOR in
9157c5f6000Smrg	    amd64)
91689afc689Smrg		UNAME_PROCESSOR=x86_64 ;;
91789afc689Smrg	    i386)
91889afc689Smrg		UNAME_PROCESSOR=i586 ;;
9197c5f6000Smrg	esac
920ec318dbfSmrg	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
921ec318dbfSmrg	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
922ec318dbfSmrg	;;
923bccedf53Smrg    i*:CYGWIN*:*)
924ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-cygwin
925ec318dbfSmrg	;;
92689afc689Smrg    *:MINGW64*:*)
927ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-mingw64
928ec318dbfSmrg	;;
92989afc689Smrg    *:MINGW*:*)
930ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-mingw32
931ec318dbfSmrg	;;
93289afc689Smrg    *:MSYS*:*)
933ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-msys
934ec318dbfSmrg	;;
935bccedf53Smrg    i*:PW*:*)
936ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-pw32
937ec318dbfSmrg	;;
938a2394c98Smrg    *:SerenityOS:*:*)
939a2394c98Smrg        GUESS=$UNAME_MACHINE-pc-serenity
940a2394c98Smrg        ;;
941f7ada8ddSmrg    *:Interix*:*)
942ec318dbfSmrg	case $UNAME_MACHINE in
9437c5f6000Smrg	    x86)
944ec318dbfSmrg		GUESS=i586-pc-interix$UNAME_RELEASE
945ec318dbfSmrg		;;
946f7ada8ddSmrg	    authenticamd | genuineintel | EM64T)
947ec318dbfSmrg		GUESS=x86_64-unknown-interix$UNAME_RELEASE
948ec318dbfSmrg		;;
9497c5f6000Smrg	    IA64)
950ec318dbfSmrg		GUESS=ia64-unknown-interix$UNAME_RELEASE
951ec318dbfSmrg		;;
9527c5f6000Smrg	esac ;;
953bccedf53Smrg    i*:UWIN*:*)
954ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-uwin
955ec318dbfSmrg	;;
9567c5f6000Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
957ec318dbfSmrg	GUESS=x86_64-pc-cygwin
958ec318dbfSmrg	;;
959bccedf53Smrg    prep*:SunOS:5.*:*)
960ec318dbfSmrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
961ec318dbfSmrg	GUESS=powerpcle-unknown-solaris2$SUN_REL
962ec318dbfSmrg	;;
963bccedf53Smrg    *:GNU:*:*)
9647c5f6000Smrg	# the GNU system
965ec318dbfSmrg	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
966ec318dbfSmrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
967ec318dbfSmrg	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
968ec318dbfSmrg	;;
9697c5f6000Smrg    *:GNU/*:*:*)
9707c5f6000Smrg	# other systems with GNU libc and userland
971ec318dbfSmrg	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
972ec318dbfSmrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
973ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
974ec318dbfSmrg	;;
975a2394c98Smrg    x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
976a2394c98Smrg	GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
977a2394c98Smrg	;;
978a2394c98Smrg    *:[Mm]anagarm:*:*)
979a2394c98Smrg	GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
980a2394c98Smrg	;;
981ec318dbfSmrg    *:Minix:*:*)
982ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-minix
983ec318dbfSmrg	;;
98489afc689Smrg    aarch64:Linux:*:*)
985a2394c98Smrg	set_cc_for_build
986a2394c98Smrg	CPU=$UNAME_MACHINE
987a2394c98Smrg	LIBCABI=$LIBC
988a2394c98Smrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
989a2394c98Smrg	    ABI=64
990a2394c98Smrg	    sed 's/^	    //' << EOF > "$dummy.c"
991a2394c98Smrg	    #ifdef __ARM_EABI__
992a2394c98Smrg	    #ifdef __ARM_PCS_VFP
993a2394c98Smrg	    ABI=eabihf
994a2394c98Smrg	    #else
995a2394c98Smrg	    ABI=eabi
996a2394c98Smrg	    #endif
997a2394c98Smrg	    #endif
998a2394c98SmrgEOF
999a2394c98Smrg	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1000a2394c98Smrg	    eval "$cc_set_abi"
1001a2394c98Smrg	    case $ABI in
1002a2394c98Smrg		eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
1003a2394c98Smrg	    esac
1004a2394c98Smrg	fi
1005a2394c98Smrg	GUESS=$CPU-unknown-linux-$LIBCABI
1006ec318dbfSmrg	;;
100789afc689Smrg    aarch64_be:Linux:*:*)
100889afc689Smrg	UNAME_MACHINE=aarch64_be
1009ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1010ec318dbfSmrg	;;
1011f7ada8ddSmrg    alpha:Linux:*:*)
1012ec318dbfSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
1013f7ada8ddSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
1014f7ada8ddSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
1015f7ada8ddSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
1016f7ada8ddSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
1017f7ada8ddSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
1018f7ada8ddSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
1019f7ada8ddSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
10201b1389eeSmrg	esac
1021f7ada8ddSmrg	objdump --private-headers /bin/sh | grep -q ld.so.1
102289afc689Smrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
1023ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1024ec318dbfSmrg	;;
1025ec318dbfSmrg    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
1026ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1027ec318dbfSmrg	;;
1028bccedf53Smrg    arm*:Linux:*:*)
1029ec318dbfSmrg	set_cc_for_build
10307c5f6000Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
10317c5f6000Smrg	    | grep -q __ARM_EABI__
10327c5f6000Smrg	then
1033ec318dbfSmrg	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10347c5f6000Smrg	else
10351b1389eeSmrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
10361b1389eeSmrg		| grep -q __ARM_PCS_VFP
10371b1389eeSmrg	    then
1038ec318dbfSmrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
10391b1389eeSmrg	    else
1040ec318dbfSmrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
10411b1389eeSmrg	    fi
10427c5f6000Smrg	fi
1043ec318dbfSmrg	;;
10447c5f6000Smrg    avr32*:Linux:*:*)
1045ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1046ec318dbfSmrg	;;
1047bccedf53Smrg    cris:Linux:*:*)
1048ec318dbfSmrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1049ec318dbfSmrg	;;
10507c5f6000Smrg    crisv32:Linux:*:*)
1051ec318dbfSmrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1052ec318dbfSmrg	;;
105389afc689Smrg    e2k:Linux:*:*)
1054ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1055ec318dbfSmrg	;;
10567c5f6000Smrg    frv:Linux:*:*)
1057ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1058ec318dbfSmrg	;;
10591b1389eeSmrg    hexagon:Linux:*:*)
1060ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1061ec318dbfSmrg	;;
1062f7ada8ddSmrg    i*86:Linux:*:*)
1063ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
1064ec318dbfSmrg	;;
1065bccedf53Smrg    ia64:Linux:*:*)
1066ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1067ec318dbfSmrg	;;
106889afc689Smrg    k1om:Linux:*:*)
1069ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1070ec318dbfSmrg	;;
1071a2394c98Smrg    kvx:Linux:*:*)
1072a2394c98Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1073a2394c98Smrg	;;
1074a2394c98Smrg    kvx:cos:*:*)
1075a2394c98Smrg	GUESS=$UNAME_MACHINE-unknown-cos
1076a2394c98Smrg	;;
1077a2394c98Smrg    kvx:mbr:*:*)
1078a2394c98Smrg	GUESS=$UNAME_MACHINE-unknown-mbr
1079a2394c98Smrg	;;
1080a2394c98Smrg    loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1081ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1082ec318dbfSmrg	;;
10837c5f6000Smrg    m32r*:Linux:*:*)
1084ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1085ec318dbfSmrg	;;
1086bccedf53Smrg    m68*:Linux:*:*)
1087ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1088ec318dbfSmrg	;;
1089f7ada8ddSmrg    mips:Linux:*:* | mips64:Linux:*:*)
1090ec318dbfSmrg	set_cc_for_build
1091ec318dbfSmrg	IS_GLIBC=0
1092ec318dbfSmrg	test x"${LIBC}" = xgnu && IS_GLIBC=1
109389afc689Smrg	sed 's/^	//' << EOF > "$dummy.c"
1094bccedf53Smrg	#undef CPU
1095ec318dbfSmrg	#undef mips
1096ec318dbfSmrg	#undef mipsel
1097ec318dbfSmrg	#undef mips64
1098ec318dbfSmrg	#undef mips64el
1099ec318dbfSmrg	#if ${IS_GLIBC} && defined(_ABI64)
1100ec318dbfSmrg	LIBCABI=gnuabi64
1101ec318dbfSmrg	#else
1102ec318dbfSmrg	#if ${IS_GLIBC} && defined(_ABIN32)
1103ec318dbfSmrg	LIBCABI=gnuabin32
1104ec318dbfSmrg	#else
1105ec318dbfSmrg	LIBCABI=${LIBC}
1106ec318dbfSmrg	#endif
1107ec318dbfSmrg	#endif
1108ec318dbfSmrg
1109ec318dbfSmrg	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1110ec318dbfSmrg	CPU=mipsisa64r6
1111ec318dbfSmrg	#else
1112ec318dbfSmrg	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1113ec318dbfSmrg	CPU=mipsisa32r6
1114ec318dbfSmrg	#else
1115ec318dbfSmrg	#if defined(__mips64)
1116ec318dbfSmrg	CPU=mips64
1117ec318dbfSmrg	#else
1118ec318dbfSmrg	CPU=mips
1119ec318dbfSmrg	#endif
1120ec318dbfSmrg	#endif
1121ec318dbfSmrg	#endif
1122ec318dbfSmrg
1123bccedf53Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1124ec318dbfSmrg	MIPS_ENDIAN=el
1125bccedf53Smrg	#else
1126bccedf53Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1127ec318dbfSmrg	MIPS_ENDIAN=
1128bccedf53Smrg	#else
1129ec318dbfSmrg	MIPS_ENDIAN=
1130bccedf53Smrg	#endif
1131bccedf53Smrg	#endif
1132bccedf53SmrgEOF
1133ec318dbfSmrg	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
1134ec318dbfSmrg	eval "$cc_set_vars"
1135ec318dbfSmrg	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1136bccedf53Smrg	;;
113789afc689Smrg    mips64el:Linux:*:*)
1138ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1139ec318dbfSmrg	;;
114089afc689Smrg    openrisc*:Linux:*:*)
1141ec318dbfSmrg	GUESS=or1k-unknown-linux-$LIBC
1142ec318dbfSmrg	;;
114389afc689Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
1144ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1145ec318dbfSmrg	;;
11467c5f6000Smrg    padre:Linux:*:*)
1147ec318dbfSmrg	GUESS=sparc-unknown-linux-$LIBC
1148ec318dbfSmrg	;;
1149f7ada8ddSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
1150ec318dbfSmrg	GUESS=hppa64-unknown-linux-$LIBC
1151ec318dbfSmrg	;;
1152bccedf53Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
1153bccedf53Smrg	# Look for CPU level
1154bccedf53Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1155ec318dbfSmrg	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
1156ec318dbfSmrg	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
1157ec318dbfSmrg	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
1158bccedf53Smrg	esac
1159ec318dbfSmrg	;;
1160f7ada8ddSmrg    ppc64:Linux:*:*)
1161ec318dbfSmrg	GUESS=powerpc64-unknown-linux-$LIBC
1162ec318dbfSmrg	;;
1163f7ada8ddSmrg    ppc:Linux:*:*)
1164ec318dbfSmrg	GUESS=powerpc-unknown-linux-$LIBC
1165ec318dbfSmrg	;;
116689afc689Smrg    ppc64le:Linux:*:*)
1167ec318dbfSmrg	GUESS=powerpc64le-unknown-linux-$LIBC
1168ec318dbfSmrg	;;
116989afc689Smrg    ppcle:Linux:*:*)
1170ec318dbfSmrg	GUESS=powerpcle-unknown-linux-$LIBC
1171ec318dbfSmrg	;;
1172ec318dbfSmrg    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1173ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1174ec318dbfSmrg	;;
1175bccedf53Smrg    s390:Linux:*:* | s390x:Linux:*:*)
1176ec318dbfSmrg	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
1177ec318dbfSmrg	;;
1178bccedf53Smrg    sh64*:Linux:*:*)
1179ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1180ec318dbfSmrg	;;
1181bccedf53Smrg    sh*:Linux:*:*)
1182ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1183ec318dbfSmrg	;;
1184bccedf53Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
1185ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1186ec318dbfSmrg	;;
1187f7ada8ddSmrg    tile*:Linux:*:*)
1188ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1189ec318dbfSmrg	;;
11907c5f6000Smrg    vax:Linux:*:*)
1191ec318dbfSmrg	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
1192ec318dbfSmrg	;;
1193bccedf53Smrg    x86_64:Linux:*:*)
1194ec318dbfSmrg	set_cc_for_build
1195a2394c98Smrg	CPU=$UNAME_MACHINE
1196ec318dbfSmrg	LIBCABI=$LIBC
1197ec318dbfSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
1198a2394c98Smrg	    ABI=64
1199a2394c98Smrg	    sed 's/^	    //' << EOF > "$dummy.c"
1200a2394c98Smrg	    #ifdef __i386__
1201a2394c98Smrg	    ABI=x86
1202a2394c98Smrg	    #else
1203a2394c98Smrg	    #ifdef __ILP32__
1204a2394c98Smrg	    ABI=x32
1205a2394c98Smrg	    #endif
1206a2394c98Smrg	    #endif
1207a2394c98SmrgEOF
1208a2394c98Smrg	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1209a2394c98Smrg	    eval "$cc_set_abi"
1210a2394c98Smrg	    case $ABI in
1211a2394c98Smrg		x86) CPU=i686 ;;
1212a2394c98Smrg		x32) LIBCABI=${LIBC}x32 ;;
1213a2394c98Smrg	    esac
1214ec318dbfSmrg	fi
1215a2394c98Smrg	GUESS=$CPU-pc-linux-$LIBCABI
1216ec318dbfSmrg	;;
12177c5f6000Smrg    xtensa*:Linux:*:*)
1218ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1219ec318dbfSmrg	;;
1220bccedf53Smrg    i*86:DYNIX/ptx:4*:*)
1221bccedf53Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1222bccedf53Smrg	# earlier versions are messed up and put the nodename in both
1223bccedf53Smrg	# sysname and nodename.
1224ec318dbfSmrg	GUESS=i386-sequent-sysv4
1225ec318dbfSmrg	;;
1226bccedf53Smrg    i*86:UNIX_SV:4.2MP:2.*)
12271b1389eeSmrg	# Unixware is an offshoot of SVR4, but it has its own version
12281b1389eeSmrg	# number series starting with 2...
12291b1389eeSmrg	# I am not positive that other SVR4 systems won't match this,
1230bccedf53Smrg	# I just have to hope.  -- rms.
12311b1389eeSmrg	# Use sysv4.2uw... so that sysv4* matches it.
1232ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
1233ec318dbfSmrg	;;
1234bccedf53Smrg    i*86:OS/2:*:*)
1235a2394c98Smrg	# If we were able to find 'uname', then EMX Unix compatibility
1236bccedf53Smrg	# is probably installed.
1237ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-os2-emx
1238ec318dbfSmrg	;;
1239bccedf53Smrg    i*86:XTS-300:*:STOP)
1240ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-stop
1241ec318dbfSmrg	;;
1242bccedf53Smrg    i*86:atheos:*:*)
1243ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-atheos
1244ec318dbfSmrg	;;
12457c5f6000Smrg    i*86:syllable:*:*)
1246ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-syllable
1247ec318dbfSmrg	;;
1248f7ada8ddSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1249ec318dbfSmrg	GUESS=i386-unknown-lynxos$UNAME_RELEASE
1250ec318dbfSmrg	;;
1251bccedf53Smrg    i*86:*DOS:*:*)
1252ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
1253ec318dbfSmrg	;;
125489afc689Smrg    i*86:*:4.*:*)
125589afc689Smrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1256bccedf53Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1257ec318dbfSmrg		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
1258bccedf53Smrg	else
1259ec318dbfSmrg		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
1260bccedf53Smrg	fi
1261ec318dbfSmrg	;;
12627c5f6000Smrg    i*86:*:5:[678]*)
12631b1389eeSmrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1264bccedf53Smrg	case `/bin/uname -X | grep "^Machine"` in
1265bccedf53Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
1266bccedf53Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1267bccedf53Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1268bccedf53Smrg	esac
1269ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1270ec318dbfSmrg	;;
1271bccedf53Smrg    i*86:*:3.2:*)
1272bccedf53Smrg	if test -f /usr/options/cb.name; then
1273bccedf53Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1274ec318dbfSmrg		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
1275bccedf53Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1276bccedf53Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1277bccedf53Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1278bccedf53Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1279bccedf53Smrg			&& UNAME_MACHINE=i586
1280bccedf53Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1281bccedf53Smrg			&& UNAME_MACHINE=i686
1282bccedf53Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1283bccedf53Smrg			&& UNAME_MACHINE=i686
1284ec318dbfSmrg		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
1285bccedf53Smrg	else
1286ec318dbfSmrg		GUESS=$UNAME_MACHINE-pc-sysv32
1287bccedf53Smrg	fi
1288ec318dbfSmrg	;;
1289bccedf53Smrg    pc:*:*:*)
1290bccedf53Smrg	# Left here for compatibility:
12911b1389eeSmrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
12921b1389eeSmrg	# the processor, so we play safe by assuming i586.
12937c5f6000Smrg	# Note: whatever this is, it MUST be the same as what config.sub
129489afc689Smrg	# prints for the "djgpp" host, or else GDB configure will decide that
12957c5f6000Smrg	# this is a cross-build.
1296ec318dbfSmrg	GUESS=i586-pc-msdosdjgpp
1297ec318dbfSmrg	;;
1298bccedf53Smrg    Intel:Mach:3*:*)
1299ec318dbfSmrg	GUESS=i386-pc-mach3
1300ec318dbfSmrg	;;
1301bccedf53Smrg    paragon:*:*:*)
1302ec318dbfSmrg	GUESS=i860-intel-osf1
1303ec318dbfSmrg	;;
1304bccedf53Smrg    i860:*:4.*:*) # i860-SVR4
1305bccedf53Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1306ec318dbfSmrg	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
1307bccedf53Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
1308ec318dbfSmrg	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
1309bccedf53Smrg	fi
1310ec318dbfSmrg	;;
1311bccedf53Smrg    mini*:CTIX:SYS*5:*)
1312bccedf53Smrg	# "miniframe"
1313ec318dbfSmrg	GUESS=m68010-convergent-sysv
1314ec318dbfSmrg	;;
1315bccedf53Smrg    mc68k:UNIX:SYSTEM5:3.51m)
1316ec318dbfSmrg	GUESS=m68k-convergent-sysv
1317ec318dbfSmrg	;;
1318bccedf53Smrg    M680?0:D-NIX:5.3:*)
1319ec318dbfSmrg	GUESS=m68k-diab-dnix
1320ec318dbfSmrg	;;
13217c5f6000Smrg    M68*:*:R3V[5678]*:*)
13227c5f6000Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
13237c5f6000Smrg    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)
1324bccedf53Smrg	OS_REL=''
1325bccedf53Smrg	test -r /etc/.relid \
1326bccedf53Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1327bccedf53Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
132889afc689Smrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1329bccedf53Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
133089afc689Smrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1331bccedf53Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
13321b1389eeSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
13331b1389eeSmrg	  && { echo i486-ncr-sysv4; exit; } ;;
13347c5f6000Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
13357c5f6000Smrg	OS_REL='.3'
13367c5f6000Smrg	test -r /etc/.relid \
13377c5f6000Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
13387c5f6000Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
133989afc689Smrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
13407c5f6000Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
134189afc689Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
13427c5f6000Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
134389afc689Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1344bccedf53Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1345ec318dbfSmrg	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
1346ec318dbfSmrg	;;
1347bccedf53Smrg    mc68030:UNIX_System_V:4.*:*)
1348ec318dbfSmrg	GUESS=m68k-atari-sysv4
1349ec318dbfSmrg	;;
1350bccedf53Smrg    TSUNAMI:LynxOS:2.*:*)
1351ec318dbfSmrg	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
1352ec318dbfSmrg	;;
1353bccedf53Smrg    rs6000:LynxOS:2.*:*)
1354ec318dbfSmrg	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
1355ec318dbfSmrg	;;
1356f7ada8ddSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1357ec318dbfSmrg	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
1358ec318dbfSmrg	;;
1359bccedf53Smrg    SM[BE]S:UNIX_SV:*:*)
1360ec318dbfSmrg	GUESS=mips-dde-sysv$UNAME_RELEASE
1361ec318dbfSmrg	;;
1362bccedf53Smrg    RM*:ReliantUNIX-*:*:*)
1363ec318dbfSmrg	GUESS=mips-sni-sysv4
1364ec318dbfSmrg	;;
1365bccedf53Smrg    RM*:SINIX-*:*:*)
1366ec318dbfSmrg	GUESS=mips-sni-sysv4
1367ec318dbfSmrg	;;
1368bccedf53Smrg    *:SINIX-*:*:*)
1369bccedf53Smrg	if uname -p 2>/dev/null >/dev/null ; then
1370bccedf53Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1371ec318dbfSmrg		GUESS=$UNAME_MACHINE-sni-sysv4
1372bccedf53Smrg	else
1373ec318dbfSmrg		GUESS=ns32k-sni-sysv
1374bccedf53Smrg	fi
1375ec318dbfSmrg	;;
1376a2394c98Smrg    PENTIUM:*:4.0*:*)	# Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
13771b1389eeSmrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
1378ec318dbfSmrg	GUESS=i586-unisys-sysv4
1379ec318dbfSmrg	;;
1380bccedf53Smrg    *:UNIX_System_V:4*:FTX*)
1381bccedf53Smrg	# From Gerald Hewes <hewes@openmarket.com>.
1382bccedf53Smrg	# How about differentiating between stratus architectures? -djm
1383ec318dbfSmrg	GUESS=hppa1.1-stratus-sysv4
1384ec318dbfSmrg	;;
1385bccedf53Smrg    *:*:*:FTX*)
1386bccedf53Smrg	# From seanf@swdc.stratus.com.
1387ec318dbfSmrg	GUESS=i860-stratus-sysv4
1388ec318dbfSmrg	;;
13897c5f6000Smrg    i*86:VOS:*:*)
13907c5f6000Smrg	# From Paul.Green@stratus.com.
1391ec318dbfSmrg	GUESS=$UNAME_MACHINE-stratus-vos
1392ec318dbfSmrg	;;
1393bccedf53Smrg    *:VOS:*:*)
1394bccedf53Smrg	# From Paul.Green@stratus.com.
1395ec318dbfSmrg	GUESS=hppa1.1-stratus-vos
1396ec318dbfSmrg	;;
1397bccedf53Smrg    mc68*:A/UX:*:*)
1398ec318dbfSmrg	GUESS=m68k-apple-aux$UNAME_RELEASE
1399ec318dbfSmrg	;;
1400bccedf53Smrg    news*:NEWS-OS:6*:*)
1401ec318dbfSmrg	GUESS=mips-sony-newsos6
1402ec318dbfSmrg	;;
1403bccedf53Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1404ec318dbfSmrg	if test -d /usr/nec; then
1405ec318dbfSmrg		GUESS=mips-nec-sysv$UNAME_RELEASE
1406bccedf53Smrg	else
1407ec318dbfSmrg		GUESS=mips-unknown-sysv$UNAME_RELEASE
1408bccedf53Smrg	fi
1409ec318dbfSmrg	;;
1410bccedf53Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1411ec318dbfSmrg	GUESS=powerpc-be-beos
1412ec318dbfSmrg	;;
1413bccedf53Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1414ec318dbfSmrg	GUESS=powerpc-apple-beos
1415ec318dbfSmrg	;;
1416bccedf53Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1417ec318dbfSmrg	GUESS=i586-pc-beos
1418ec318dbfSmrg	;;
14197c5f6000Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1420ec318dbfSmrg	GUESS=i586-pc-haiku
1421ec318dbfSmrg	;;
1422a2394c98Smrg    ppc:Haiku:*:*)	# Haiku running on Apple PowerPC
1423a2394c98Smrg	GUESS=powerpc-apple-haiku
1424a2394c98Smrg	;;
1425a2394c98Smrg    *:Haiku:*:*)	# Haiku modern gcc (not bound by BeOS compat)
1426a2394c98Smrg	GUESS=$UNAME_MACHINE-unknown-haiku
1427ec318dbfSmrg	;;
1428bccedf53Smrg    SX-4:SUPER-UX:*:*)
1429ec318dbfSmrg	GUESS=sx4-nec-superux$UNAME_RELEASE
1430ec318dbfSmrg	;;
1431bccedf53Smrg    SX-5:SUPER-UX:*:*)
1432ec318dbfSmrg	GUESS=sx5-nec-superux$UNAME_RELEASE
1433ec318dbfSmrg	;;
1434bccedf53Smrg    SX-6:SUPER-UX:*:*)
1435ec318dbfSmrg	GUESS=sx6-nec-superux$UNAME_RELEASE
1436ec318dbfSmrg	;;
14377c5f6000Smrg    SX-7:SUPER-UX:*:*)
1438ec318dbfSmrg	GUESS=sx7-nec-superux$UNAME_RELEASE
1439ec318dbfSmrg	;;
14407c5f6000Smrg    SX-8:SUPER-UX:*:*)
1441ec318dbfSmrg	GUESS=sx8-nec-superux$UNAME_RELEASE
1442ec318dbfSmrg	;;
14437c5f6000Smrg    SX-8R:SUPER-UX:*:*)
1444ec318dbfSmrg	GUESS=sx8r-nec-superux$UNAME_RELEASE
1445ec318dbfSmrg	;;
144689afc689Smrg    SX-ACE:SUPER-UX:*:*)
1447ec318dbfSmrg	GUESS=sxace-nec-superux$UNAME_RELEASE
1448ec318dbfSmrg	;;
1449bccedf53Smrg    Power*:Rhapsody:*:*)
1450ec318dbfSmrg	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
1451ec318dbfSmrg	;;
1452bccedf53Smrg    *:Rhapsody:*:*)
1453ec318dbfSmrg	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
1454ec318dbfSmrg	;;
1455ec318dbfSmrg    arm64:Darwin:*:*)
1456ec318dbfSmrg	GUESS=aarch64-apple-darwin$UNAME_RELEASE
1457ec318dbfSmrg	;;
1458bccedf53Smrg    *:Darwin:*:*)
1459ec318dbfSmrg	UNAME_PROCESSOR=`uname -p`
1460ec318dbfSmrg	case $UNAME_PROCESSOR in
1461ec318dbfSmrg	    unknown) UNAME_PROCESSOR=powerpc ;;
1462ec318dbfSmrg	esac
1463ec318dbfSmrg	if command -v xcode-select > /dev/null 2> /dev/null && \
1464ec318dbfSmrg		! xcode-select --print-path > /dev/null 2> /dev/null ; then
1465ec318dbfSmrg	    # Avoid executing cc if there is no toolchain installed as
1466ec318dbfSmrg	    # cc will be a stub that puts up a graphical alert
1467ec318dbfSmrg	    # prompting the user to install developer tools.
1468ec318dbfSmrg	    CC_FOR_BUILD=no_compiler_found
1469ec318dbfSmrg	else
1470ec318dbfSmrg	    set_cc_for_build
147189afc689Smrg	fi
1472ec318dbfSmrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
1473ec318dbfSmrg	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1474ec318dbfSmrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1475ec318dbfSmrg		   grep IS_64BIT_ARCH >/dev/null
1476ec318dbfSmrg	    then
1477ec318dbfSmrg		case $UNAME_PROCESSOR in
1478ec318dbfSmrg		    i386) UNAME_PROCESSOR=x86_64 ;;
1479ec318dbfSmrg		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1480ec318dbfSmrg		esac
1481ec318dbfSmrg	    fi
1482ec318dbfSmrg	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1483ec318dbfSmrg	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1484ec318dbfSmrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1485ec318dbfSmrg		   grep IS_PPC >/dev/null
1486ec318dbfSmrg	    then
1487ec318dbfSmrg		UNAME_PROCESSOR=powerpc
148889afc689Smrg	    fi
148989afc689Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
1490ec318dbfSmrg	    # uname -m returns i386 or x86_64
1491ec318dbfSmrg	    UNAME_PROCESSOR=$UNAME_MACHINE
149289afc689Smrg	fi
1493ec318dbfSmrg	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
1494ec318dbfSmrg	;;
1495bccedf53Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1496bccedf53Smrg	UNAME_PROCESSOR=`uname -p`
149789afc689Smrg	if test "$UNAME_PROCESSOR" = x86; then
1498bccedf53Smrg		UNAME_PROCESSOR=i386
1499bccedf53Smrg		UNAME_MACHINE=pc
1500bccedf53Smrg	fi
1501ec318dbfSmrg	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
1502ec318dbfSmrg	;;
1503bccedf53Smrg    *:QNX:*:4*)
1504ec318dbfSmrg	GUESS=i386-pc-qnx
1505ec318dbfSmrg	;;
150689afc689Smrg    NEO-*:NONSTOP_KERNEL:*:*)
1507ec318dbfSmrg	GUESS=neo-tandem-nsk$UNAME_RELEASE
1508ec318dbfSmrg	;;
150989afc689Smrg    NSE-*:NONSTOP_KERNEL:*:*)
1510ec318dbfSmrg	GUESS=nse-tandem-nsk$UNAME_RELEASE
1511ec318dbfSmrg	;;
151289afc689Smrg    NSR-*:NONSTOP_KERNEL:*:*)
1513ec318dbfSmrg	GUESS=nsr-tandem-nsk$UNAME_RELEASE
1514ec318dbfSmrg	;;
151589afc689Smrg    NSV-*:NONSTOP_KERNEL:*:*)
1516ec318dbfSmrg	GUESS=nsv-tandem-nsk$UNAME_RELEASE
1517ec318dbfSmrg	;;
151889afc689Smrg    NSX-*:NONSTOP_KERNEL:*:*)
1519ec318dbfSmrg	GUESS=nsx-tandem-nsk$UNAME_RELEASE
1520ec318dbfSmrg	;;
1521bccedf53Smrg    *:NonStop-UX:*:*)
1522ec318dbfSmrg	GUESS=mips-compaq-nonstopux
1523ec318dbfSmrg	;;
1524bccedf53Smrg    BS2000:POSIX*:*:*)
1525ec318dbfSmrg	GUESS=bs2000-siemens-sysv
1526ec318dbfSmrg	;;
1527bccedf53Smrg    DS/*:UNIX_System_V:*:*)
1528ec318dbfSmrg	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
1529ec318dbfSmrg	;;
1530bccedf53Smrg    *:Plan9:*:*)
1531bccedf53Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
1532bccedf53Smrg	# is converted to i386 for consistency with other x86
1533bccedf53Smrg	# operating systems.
1534ec318dbfSmrg	if test "${cputype-}" = 386; then
1535bccedf53Smrg	    UNAME_MACHINE=i386
1536ec318dbfSmrg	elif test "x${cputype-}" != x; then
1537ec318dbfSmrg	    UNAME_MACHINE=$cputype
1538bccedf53Smrg	fi
1539ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-plan9
1540ec318dbfSmrg	;;
1541bccedf53Smrg    *:TOPS-10:*:*)
1542ec318dbfSmrg	GUESS=pdp10-unknown-tops10
1543ec318dbfSmrg	;;
1544bccedf53Smrg    *:TENEX:*:*)
1545ec318dbfSmrg	GUESS=pdp10-unknown-tenex
1546ec318dbfSmrg	;;
1547bccedf53Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1548ec318dbfSmrg	GUESS=pdp10-dec-tops20
1549ec318dbfSmrg	;;
1550bccedf53Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1551ec318dbfSmrg	GUESS=pdp10-xkl-tops20
1552ec318dbfSmrg	;;
1553bccedf53Smrg    *:TOPS-20:*:*)
1554ec318dbfSmrg	GUESS=pdp10-unknown-tops20
1555ec318dbfSmrg	;;
1556bccedf53Smrg    *:ITS:*:*)
1557ec318dbfSmrg	GUESS=pdp10-unknown-its
1558ec318dbfSmrg	;;
1559bccedf53Smrg    SEI:*:*:SEIUX)
1560ec318dbfSmrg	GUESS=mips-sei-seiux$UNAME_RELEASE
1561ec318dbfSmrg	;;
15627c5f6000Smrg    *:DragonFly:*:*)
1563ec318dbfSmrg	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
1564ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
1565ec318dbfSmrg	;;
15667c5f6000Smrg    *:*VMS:*:*)
15671b1389eeSmrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1568ec318dbfSmrg	case $UNAME_MACHINE in
1569ec318dbfSmrg	    A*) GUESS=alpha-dec-vms ;;
1570ec318dbfSmrg	    I*) GUESS=ia64-dec-vms ;;
1571ec318dbfSmrg	    V*) GUESS=vax-dec-vms ;;
15727c5f6000Smrg	esac ;;
15737c5f6000Smrg    *:XENIX:*:SysV)
1574ec318dbfSmrg	GUESS=i386-pc-xenix
1575ec318dbfSmrg	;;
15767c5f6000Smrg    i*86:skyos:*:*)
1577ec318dbfSmrg	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
1578ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
1579ec318dbfSmrg	;;
15807c5f6000Smrg    i*86:rdos:*:*)
1581ec318dbfSmrg	GUESS=$UNAME_MACHINE-pc-rdos
1582ec318dbfSmrg	;;
1583a2394c98Smrg    i*86:Fiwix:*:*)
1584a2394c98Smrg	GUESS=$UNAME_MACHINE-pc-fiwix
1585a2394c98Smrg	;;
1586ec318dbfSmrg    *:AROS:*:*)
1587ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-aros
1588ec318dbfSmrg	;;
158989afc689Smrg    x86_64:VMkernel:*:*)
1590ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-esx
1591ec318dbfSmrg	;;
159289afc689Smrg    amd64:Isilon\ OneFS:*:*)
1593ec318dbfSmrg	GUESS=x86_64-unknown-onefs
1594ec318dbfSmrg	;;
1595ec318dbfSmrg    *:Unleashed:*:*)
1596ec318dbfSmrg	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
1597ec318dbfSmrg	;;
1598a2394c98Smrg    *:Ironclad:*:*)
1599a2394c98Smrg	GUESS=$UNAME_MACHINE-unknown-ironclad
1600a2394c98Smrg	;;
1601bccedf53Smrgesac
1602bccedf53Smrg
1603ec318dbfSmrg# Do we have a guess based on uname results?
1604ec318dbfSmrgif test "x$GUESS" != x; then
1605ec318dbfSmrg    echo "$GUESS"
1606ec318dbfSmrg    exit
1607ec318dbfSmrgfi
1608ec318dbfSmrg
1609ec318dbfSmrg# No uname command or uname output not recognized.
1610ec318dbfSmrgset_cc_for_build
1611ec318dbfSmrgcat > "$dummy.c" <<EOF
1612ec318dbfSmrg#ifdef _SEQUENT_
1613ec318dbfSmrg#include <sys/types.h>
1614ec318dbfSmrg#include <sys/utsname.h>
1615ec318dbfSmrg#endif
1616ec318dbfSmrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1617ec318dbfSmrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1618ec318dbfSmrg#include <signal.h>
1619ec318dbfSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1620ec318dbfSmrg#include <sys/utsname.h>
1621ec318dbfSmrg#endif
1622ec318dbfSmrg#endif
1623ec318dbfSmrg#endif
1624ec318dbfSmrgmain ()
1625ec318dbfSmrg{
1626ec318dbfSmrg#if defined (sony)
1627ec318dbfSmrg#if defined (MIPSEB)
1628ec318dbfSmrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1629ec318dbfSmrg     I don't know....  */
1630ec318dbfSmrg  printf ("mips-sony-bsd\n"); exit (0);
1631ec318dbfSmrg#else
1632ec318dbfSmrg#include <sys/param.h>
1633ec318dbfSmrg  printf ("m68k-sony-newsos%s\n",
1634ec318dbfSmrg#ifdef NEWSOS4
1635ec318dbfSmrg  "4"
1636ec318dbfSmrg#else
1637ec318dbfSmrg  ""
1638ec318dbfSmrg#endif
1639ec318dbfSmrg  ); exit (0);
1640ec318dbfSmrg#endif
1641ec318dbfSmrg#endif
1642ec318dbfSmrg
1643ec318dbfSmrg#if defined (NeXT)
1644ec318dbfSmrg#if !defined (__ARCHITECTURE__)
1645ec318dbfSmrg#define __ARCHITECTURE__ "m68k"
1646ec318dbfSmrg#endif
1647ec318dbfSmrg  int version;
1648ec318dbfSmrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1649ec318dbfSmrg  if (version < 4)
1650ec318dbfSmrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1651ec318dbfSmrg  else
1652ec318dbfSmrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1653ec318dbfSmrg  exit (0);
1654ec318dbfSmrg#endif
1655ec318dbfSmrg
1656ec318dbfSmrg#if defined (MULTIMAX) || defined (n16)
1657ec318dbfSmrg#if defined (UMAXV)
1658ec318dbfSmrg  printf ("ns32k-encore-sysv\n"); exit (0);
1659ec318dbfSmrg#else
1660ec318dbfSmrg#if defined (CMU)
1661ec318dbfSmrg  printf ("ns32k-encore-mach\n"); exit (0);
1662ec318dbfSmrg#else
1663ec318dbfSmrg  printf ("ns32k-encore-bsd\n"); exit (0);
1664ec318dbfSmrg#endif
1665ec318dbfSmrg#endif
1666ec318dbfSmrg#endif
1667ec318dbfSmrg
1668ec318dbfSmrg#if defined (__386BSD__)
1669ec318dbfSmrg  printf ("i386-pc-bsd\n"); exit (0);
1670ec318dbfSmrg#endif
1671ec318dbfSmrg
1672ec318dbfSmrg#if defined (sequent)
1673ec318dbfSmrg#if defined (i386)
1674ec318dbfSmrg  printf ("i386-sequent-dynix\n"); exit (0);
1675ec318dbfSmrg#endif
1676ec318dbfSmrg#if defined (ns32000)
1677ec318dbfSmrg  printf ("ns32k-sequent-dynix\n"); exit (0);
1678ec318dbfSmrg#endif
1679ec318dbfSmrg#endif
1680ec318dbfSmrg
1681ec318dbfSmrg#if defined (_SEQUENT_)
1682ec318dbfSmrg  struct utsname un;
1683ec318dbfSmrg
1684ec318dbfSmrg  uname(&un);
1685ec318dbfSmrg  if (strncmp(un.version, "V2", 2) == 0) {
1686ec318dbfSmrg    printf ("i386-sequent-ptx2\n"); exit (0);
1687ec318dbfSmrg  }
1688ec318dbfSmrg  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1689ec318dbfSmrg    printf ("i386-sequent-ptx1\n"); exit (0);
1690ec318dbfSmrg  }
1691ec318dbfSmrg  printf ("i386-sequent-ptx\n"); exit (0);
1692ec318dbfSmrg#endif
1693ec318dbfSmrg
1694ec318dbfSmrg#if defined (vax)
1695ec318dbfSmrg#if !defined (ultrix)
1696ec318dbfSmrg#include <sys/param.h>
1697ec318dbfSmrg#if defined (BSD)
1698ec318dbfSmrg#if BSD == 43
1699ec318dbfSmrg  printf ("vax-dec-bsd4.3\n"); exit (0);
1700ec318dbfSmrg#else
1701ec318dbfSmrg#if BSD == 199006
1702ec318dbfSmrg  printf ("vax-dec-bsd4.3reno\n"); exit (0);
1703ec318dbfSmrg#else
1704ec318dbfSmrg  printf ("vax-dec-bsd\n"); exit (0);
1705ec318dbfSmrg#endif
1706ec318dbfSmrg#endif
1707ec318dbfSmrg#else
1708ec318dbfSmrg  printf ("vax-dec-bsd\n"); exit (0);
1709ec318dbfSmrg#endif
1710ec318dbfSmrg#else
1711ec318dbfSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1712ec318dbfSmrg  struct utsname un;
1713ec318dbfSmrg  uname (&un);
1714ec318dbfSmrg  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1715ec318dbfSmrg#else
1716ec318dbfSmrg  printf ("vax-dec-ultrix\n"); exit (0);
1717ec318dbfSmrg#endif
1718ec318dbfSmrg#endif
1719ec318dbfSmrg#endif
1720ec318dbfSmrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1721ec318dbfSmrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1722ec318dbfSmrg#if defined(_SIZE_T_) || defined(SIGLOST)
1723ec318dbfSmrg  struct utsname *un;
1724ec318dbfSmrg  uname (&un);
1725ec318dbfSmrg  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1726ec318dbfSmrg#else
1727ec318dbfSmrg  printf ("mips-dec-ultrix\n"); exit (0);
1728ec318dbfSmrg#endif
1729ec318dbfSmrg#endif
1730ec318dbfSmrg#endif
1731ec318dbfSmrg
1732ec318dbfSmrg#if defined (alliant) && defined (i860)
1733ec318dbfSmrg  printf ("i860-alliant-bsd\n"); exit (0);
1734ec318dbfSmrg#endif
1735ec318dbfSmrg
1736ec318dbfSmrg  exit (1);
1737ec318dbfSmrg}
1738ec318dbfSmrgEOF
1739ec318dbfSmrg
1740ec318dbfSmrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
1741ec318dbfSmrg	{ echo "$SYSTEM_NAME"; exit; }
1742ec318dbfSmrg
1743ec318dbfSmrg# Apollos put the system type in the environment.
1744ec318dbfSmrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1745ec318dbfSmrg
174689afc689Smrgecho "$0: unable to guess system type" >&2
1747bccedf53Smrg
1748ec318dbfSmrgcase $UNAME_MACHINE:$UNAME_SYSTEM in
174989afc689Smrg    mips:Linux | mips64:Linux)
175089afc689Smrg	# If we got here on MIPS GNU/Linux, output extra information.
175189afc689Smrg	cat >&2 <<EOF
1752bccedf53Smrg
175389afc689SmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
175489afc689Smrgthe system type. Please install a C compiler and try again.
1755bccedf53SmrgEOF
175689afc689Smrg	;;
175789afc689Smrgesac
1758bccedf53Smrg
1759bccedf53Smrgcat >&2 <<EOF
1760bccedf53Smrg
176189afc689SmrgThis script (version $timestamp), has failed to recognize the
176289afc689Smrgoperating system you are using. If your script is old, overwrite *all*
176389afc689Smrgcopies of config.guess and config.sub with the latest versions from:
1764bccedf53Smrg
1765ec318dbfSmrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
17667c5f6000Smrgand
1767ec318dbfSmrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1768ec318dbfSmrgEOF
1769ec318dbfSmrg
1770ec318dbfSmrgour_year=`echo $timestamp | sed 's,-.*,,'`
1771ec318dbfSmrgthisyear=`date +%Y`
1772ec318dbfSmrg# shellcheck disable=SC2003
1773ec318dbfSmrgscript_age=`expr "$thisyear" - "$our_year"`
1774ec318dbfSmrgif test "$script_age" -lt 3 ; then
1775ec318dbfSmrg   cat >&2 <<EOF
1776bccedf53Smrg
177789afc689SmrgIf $0 has already been updated, send the following data and any
177889afc689Smrginformation you think might be pertinent to config-patches@gnu.org to
177989afc689Smrgprovide the necessary information to handle your system.
1780bccedf53Smrg
1781bccedf53Smrgconfig.guess timestamp = $timestamp
1782bccedf53Smrg
1783bccedf53Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1784bccedf53Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1785bccedf53Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1786bccedf53Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1787bccedf53Smrg
1788bccedf53Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1789bccedf53Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1790bccedf53Smrg
1791bccedf53Smrghostinfo               = `(hostinfo) 2>/dev/null`
1792bccedf53Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1793bccedf53Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1794bccedf53Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1795bccedf53Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1796bccedf53Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1797bccedf53Smrg
179889afc689SmrgUNAME_MACHINE = "$UNAME_MACHINE"
179989afc689SmrgUNAME_RELEASE = "$UNAME_RELEASE"
180089afc689SmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
180189afc689SmrgUNAME_VERSION = "$UNAME_VERSION"
1802bccedf53SmrgEOF
1803ec318dbfSmrgfi
1804bccedf53Smrg
1805bccedf53Smrgexit 1
1806bccedf53Smrg
1807bccedf53Smrg# Local variables:
1808ec318dbfSmrg# eval: (add-hook 'before-save-hook 'time-stamp)
1809bccedf53Smrg# time-stamp-start: "timestamp='"
1810bccedf53Smrg# time-stamp-format: "%:y-%02m-%02d"
1811bccedf53Smrg# time-stamp-end: "'"
1812bccedf53Smrg# End:
1813