xref: /freebsd/contrib/libpcap/config.guess (revision 6f9cba8f8b5efd16249633e52483ea351876b67b)
18cf6c252SPaul Traina#! /bin/sh
28cf6c252SPaul Traina# Attempt to guess a canonical system name.
3*6f9cba8fSJoseph Mingrone#   Copyright 1992-2022 Free Software Foundation, Inc.
4dc2c7305SBill Fenner
5*6f9cba8fSJoseph Mingrone# shellcheck disable=SC2006,SC2268 # see below for rationale
6*6f9cba8fSJoseph Mingrone
7*6f9cba8fSJoseph Mingronetimestamp='2022-08-01'
8dc2c7305SBill Fenner
98cf6c252SPaul Traina# This file is free software; you can redistribute it and/or modify it
108cf6c252SPaul Traina# under the terms of the GNU General Public License as published by
11*6f9cba8fSJoseph Mingrone# the Free Software Foundation, either version 3 of the License, or
128cf6c252SPaul Traina# (at your option) any later version.
138cf6c252SPaul Traina#
148cf6c252SPaul Traina# This program is distributed in the hope that it will be useful, but
158cf6c252SPaul Traina# WITHOUT ANY WARRANTY; without even the implied warranty of
168cf6c252SPaul Traina# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
178cf6c252SPaul Traina# General Public License for more details.
188cf6c252SPaul Traina#
198cf6c252SPaul Traina# You should have received a copy of the GNU General Public License
2057e22627SCy Schubert# along with this program; if not, see <https://www.gnu.org/licenses/>.
218cf6c252SPaul Traina#
228cf6c252SPaul Traina# As a special exception to the GNU General Public License, if you
238cf6c252SPaul Traina# distribute this file as part of a program that contains a
248cf6c252SPaul Traina# configuration script generated by Autoconf, you may include it under
25ada6f083SXin LI# the same distribution terms that you use for the rest of that
26ada6f083SXin LI# program.  This Exception is an additional permission under section 7
27ada6f083SXin LI# of the GNU General Public License, version 3 ("GPLv3").
288cf6c252SPaul Traina#
29ada6f083SXin LI# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
308cf6c252SPaul Traina#
31a0ee43a1SRui Paulo# You can get the latest version of this script from:
32*6f9cba8fSJoseph Mingrone# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
33ada6f083SXin LI#
34ada6f083SXin LI# Please send patches to <config-patches@gnu.org>.
35ada6f083SXin LI
368cf6c252SPaul Traina
37*6f9cba8fSJoseph Mingrone# The "shellcheck disable" line above the timestamp inhibits complaints
38*6f9cba8fSJoseph Mingrone# about features and limitations of the classic Bourne shell that were
39*6f9cba8fSJoseph Mingrone# superseded or lifted in POSIX.  However, this script identifies a wide
40*6f9cba8fSJoseph Mingrone# variety of pre-POSIX systems that do not have POSIX shells at all, and
41*6f9cba8fSJoseph Mingrone# even some reasonably current systems (Solaris 10 as case-in-point) still
42*6f9cba8fSJoseph Mingrone# have a pre-POSIX /bin/sh.
43*6f9cba8fSJoseph Mingrone
44*6f9cba8fSJoseph Mingrone
45dc2c7305SBill Fennerme=`echo "$0" | sed -e 's,.*/,,'`
46dc2c7305SBill Fenner
47dc2c7305SBill Fennerusage="\
48dc2c7305SBill FennerUsage: $0 [OPTION]
49dc2c7305SBill Fenner
50dc2c7305SBill FennerOutput the configuration name of the system \`$me' is run on.
51dc2c7305SBill Fenner
5257e22627SCy SchubertOptions:
53dc2c7305SBill Fenner  -h, --help         print this help, then exit
54dc2c7305SBill Fenner  -t, --time-stamp   print date of last modification, then exit
55dc2c7305SBill Fenner  -v, --version      print version number, then exit
56dc2c7305SBill Fenner
57dc2c7305SBill FennerReport bugs and patches to <config-patches@gnu.org>."
58dc2c7305SBill Fenner
59dc2c7305SBill Fennerversion="\
60dc2c7305SBill FennerGNU config.guess ($timestamp)
61dc2c7305SBill Fenner
62dc2c7305SBill FennerOriginally written by Per Bothner.
63*6f9cba8fSJoseph MingroneCopyright 1992-2022 Free Software Foundation, Inc.
64dc2c7305SBill Fenner
65dc2c7305SBill FennerThis is free software; see the source for copying conditions.  There is NO
66dc2c7305SBill Fennerwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
67dc2c7305SBill Fenner
68dc2c7305SBill Fennerhelp="
69dc2c7305SBill FennerTry \`$me --help' for more information."
70dc2c7305SBill Fenner
71dc2c7305SBill Fenner# Parse command line
72dc2c7305SBill Fennerwhile test $# -gt 0 ; do
73dc2c7305SBill Fenner  case $1 in
74dc2c7305SBill Fenner    --time-stamp | --time* | -t )
75a0ee43a1SRui Paulo       echo "$timestamp" ; exit ;;
76dc2c7305SBill Fenner    --version | -v )
77a0ee43a1SRui Paulo       echo "$version" ; exit ;;
78dc2c7305SBill Fenner    --help | --h* | -h )
79a0ee43a1SRui Paulo       echo "$usage"; exit ;;
80dc2c7305SBill Fenner    -- )     # Stop option processing
81dc2c7305SBill Fenner       shift; break ;;
82dc2c7305SBill Fenner    - )	# Use stdin as input.
83dc2c7305SBill Fenner       break ;;
84dc2c7305SBill Fenner    -* )
85dc2c7305SBill Fenner       echo "$me: invalid option $1$help" >&2
86dc2c7305SBill Fenner       exit 1 ;;
87dc2c7305SBill Fenner    * )
88dc2c7305SBill Fenner       break ;;
89dc2c7305SBill Fenner  esac
90dc2c7305SBill Fennerdone
91dc2c7305SBill Fenner
92dc2c7305SBill Fennerif test $# != 0; then
93dc2c7305SBill Fenner  echo "$me: too many arguments$help" >&2
94dc2c7305SBill Fenner  exit 1
95dc2c7305SBill Fennerfi
96dc2c7305SBill Fenner
97*6f9cba8fSJoseph Mingrone# Just in case it came from the environment.
98*6f9cba8fSJoseph MingroneGUESS=
99dc2c7305SBill Fenner
100feb4ecdbSBruce M Simpson# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
101feb4ecdbSBruce M Simpson# compiler to aid in system detection is discouraged as it requires
102feb4ecdbSBruce M Simpson# temporary files to be created and, as you can see below, it is a
103feb4ecdbSBruce M Simpson# headache to deal with in a portable fashion.
104dc2c7305SBill Fenner
105dc2c7305SBill Fenner# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
106dc2c7305SBill Fenner# use `HOST_CC' if defined, but it is deprecated.
107dc2c7305SBill Fenner
108feb4ecdbSBruce M Simpson# Portable tmp directory creation inspired by the Autoconf team.
109feb4ecdbSBruce M Simpson
110*6f9cba8fSJoseph Mingronetmp=
111*6f9cba8fSJoseph Mingrone# shellcheck disable=SC2172
112*6f9cba8fSJoseph Mingronetrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
113*6f9cba8fSJoseph Mingrone
114*6f9cba8fSJoseph Mingroneset_cc_for_build() {
115*6f9cba8fSJoseph Mingrone    # prevent multiple calls if $tmp is already set
116*6f9cba8fSJoseph Mingrone    test "$tmp" && return 0
117*6f9cba8fSJoseph Mingrone    : "${TMPDIR=/tmp}"
118*6f9cba8fSJoseph Mingrone    # shellcheck disable=SC2039,SC3028
119a0ee43a1SRui Paulo    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
120*6f9cba8fSJoseph Mingrone	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
121*6f9cba8fSJoseph Mingrone	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
122*6f9cba8fSJoseph Mingrone	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
123*6f9cba8fSJoseph Mingrone    dummy=$tmp/dummy
12457e22627SCy Schubert    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
125*6f9cba8fSJoseph Mingrone	,,)    echo "int x;" > "$dummy.c"
126*6f9cba8fSJoseph Mingrone	       for driver in cc gcc c89 c99 ; do
127*6f9cba8fSJoseph Mingrone		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
128*6f9cba8fSJoseph Mingrone		       CC_FOR_BUILD=$driver
129*6f9cba8fSJoseph Mingrone		       break
130*6f9cba8fSJoseph Mingrone		   fi
131*6f9cba8fSJoseph Mingrone	       done
132dc2c7305SBill Fenner	       if test x"$CC_FOR_BUILD" = x ; then
133*6f9cba8fSJoseph Mingrone		   CC_FOR_BUILD=no_compiler_found
134dc2c7305SBill Fenner	       fi
135dc2c7305SBill Fenner	       ;;
136dc2c7305SBill Fenner	,,*)   CC_FOR_BUILD=$CC ;;
137dc2c7305SBill Fenner	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
138*6f9cba8fSJoseph Mingrone    esac
139*6f9cba8fSJoseph Mingrone}
140dc2c7305SBill Fenner
1418cf6c252SPaul Traina# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
142feb4ecdbSBruce M Simpson# (ghazi@noc.rutgers.edu 1994-08-24)
143*6f9cba8fSJoseph Mingroneif test -f /.attbin/uname ; then
1448cf6c252SPaul Traina	PATH=$PATH:/.attbin ; export PATH
1458cf6c252SPaul Trainafi
1468cf6c252SPaul Traina
1478cf6c252SPaul TrainaUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1488cf6c252SPaul TrainaUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1498cf6c252SPaul TrainaUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
1508cf6c252SPaul TrainaUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1518cf6c252SPaul Traina
152*6f9cba8fSJoseph Mingronecase $UNAME_SYSTEM in
153ada6f083SXin LILinux|GNU|GNU/*)
154*6f9cba8fSJoseph Mingrone	LIBC=unknown
155ada6f083SXin LI
156*6f9cba8fSJoseph Mingrone	set_cc_for_build
15757e22627SCy Schubert	cat <<-EOF > "$dummy.c"
158ada6f083SXin LI	#include <features.h>
159ada6f083SXin LI	#if defined(__UCLIBC__)
160ada6f083SXin LI	LIBC=uclibc
161ada6f083SXin LI	#elif defined(__dietlibc__)
162ada6f083SXin LI	LIBC=dietlibc
163*6f9cba8fSJoseph Mingrone	#elif defined(__GLIBC__)
164ada6f083SXin LI	LIBC=gnu
165*6f9cba8fSJoseph Mingrone	#else
166*6f9cba8fSJoseph Mingrone	#include <stdarg.h>
167*6f9cba8fSJoseph Mingrone	/* First heuristic to detect musl libc.  */
168*6f9cba8fSJoseph Mingrone	#ifdef __DEFINED_va_list
169*6f9cba8fSJoseph Mingrone	LIBC=musl
170*6f9cba8fSJoseph Mingrone	#endif
171ada6f083SXin LI	#endif
172ada6f083SXin LI	EOF
173*6f9cba8fSJoseph Mingrone	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
174*6f9cba8fSJoseph Mingrone	eval "$cc_set_libc"
17557e22627SCy Schubert
176*6f9cba8fSJoseph Mingrone	# Second heuristic to detect musl libc.
177*6f9cba8fSJoseph Mingrone	if [ "$LIBC" = unknown ] &&
178*6f9cba8fSJoseph Mingrone	   command -v ldd >/dev/null &&
179*6f9cba8fSJoseph Mingrone	   ldd --version 2>&1 | grep -q ^musl; then
18057e22627SCy Schubert		LIBC=musl
18157e22627SCy Schubert	fi
182*6f9cba8fSJoseph Mingrone
183*6f9cba8fSJoseph Mingrone	# If the system lacks a compiler, then just pick glibc.
184*6f9cba8fSJoseph Mingrone	# We could probably try harder.
185*6f9cba8fSJoseph Mingrone	if [ "$LIBC" = unknown ]; then
186*6f9cba8fSJoseph Mingrone		LIBC=gnu
187*6f9cba8fSJoseph Mingrone	fi
188ada6f083SXin LI	;;
189ada6f083SXin LIesac
190ada6f083SXin LI
1918cf6c252SPaul Traina# Note: order is significant - the case branches are not exclusive.
1928cf6c252SPaul Traina
193*6f9cba8fSJoseph Mingronecase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
194dc2c7305SBill Fenner    *:NetBSD:*:*)
195feb4ecdbSBruce M Simpson	# NetBSD (nbsd) targets should (where applicable) match one or
196681ed54cSXin LI	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
197dc2c7305SBill Fenner	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
198dc2c7305SBill Fenner	# switched to ELF, *-*-netbsd* would select the old
199dc2c7305SBill Fenner	# object file format.  This provides both forward
200dc2c7305SBill Fenner	# compatibility and a consistent mechanism for selecting the
201dc2c7305SBill Fenner	# object file format.
202feb4ecdbSBruce M Simpson	#
203feb4ecdbSBruce M Simpson	# Note: NetBSD doesn't particularly care about the vendor
204feb4ecdbSBruce M Simpson	# portion of the name.  We always set it to "unknown".
205ada6f083SXin LI	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
206*6f9cba8fSJoseph Mingrone	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
207*6f9cba8fSJoseph Mingrone	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
208ada6f083SXin LI	    echo unknown)`
209*6f9cba8fSJoseph Mingrone	case $UNAME_MACHINE_ARCH in
210*6f9cba8fSJoseph Mingrone	    aarch64eb) machine=aarch64_be-unknown ;;
211feb4ecdbSBruce M Simpson	    armeb) machine=armeb-unknown ;;
212feb4ecdbSBruce M Simpson	    arm*) machine=arm-unknown ;;
213feb4ecdbSBruce M Simpson	    sh3el) machine=shl-unknown ;;
214feb4ecdbSBruce M Simpson	    sh3eb) machine=sh-unknown ;;
215a0ee43a1SRui Paulo	    sh5el) machine=sh5le-unknown ;;
216ada6f083SXin LI	    earmv*)
21757e22627SCy Schubert		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
21857e22627SCy Schubert		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
219*6f9cba8fSJoseph Mingrone		machine=${arch}${endian}-unknown
220ada6f083SXin LI		;;
221*6f9cba8fSJoseph Mingrone	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
222dc2c7305SBill Fenner	esac
223dc2c7305SBill Fenner	# The Operating System including object format, if it has switched
22457e22627SCy Schubert	# to ELF recently (or will in the future) and ABI.
225*6f9cba8fSJoseph Mingrone	case $UNAME_MACHINE_ARCH in
22657e22627SCy Schubert	    earm*)
22757e22627SCy Schubert		os=netbsdelf
22857e22627SCy Schubert		;;
22957e22627SCy Schubert	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
230*6f9cba8fSJoseph Mingrone		set_cc_for_build
231dc2c7305SBill Fenner		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
232a0ee43a1SRui Paulo			| grep -q __ELF__
233dc2c7305SBill Fenner		then
234dc2c7305SBill Fenner		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
235dc2c7305SBill Fenner		    # Return netbsd for either.  FIX?
236dc2c7305SBill Fenner		    os=netbsd
237dc2c7305SBill Fenner		else
238dc2c7305SBill Fenner		    os=netbsdelf
239dc2c7305SBill Fenner		fi
240dc2c7305SBill Fenner		;;
241dc2c7305SBill Fenner	    *)
242dc2c7305SBill Fenner		os=netbsd
243dc2c7305SBill Fenner		;;
244dc2c7305SBill Fenner	esac
245ada6f083SXin LI	# Determine ABI tags.
246*6f9cba8fSJoseph Mingrone	case $UNAME_MACHINE_ARCH in
247ada6f083SXin LI	    earm*)
248ada6f083SXin LI		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
24957e22627SCy Schubert		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
250ada6f083SXin LI		;;
251ada6f083SXin LI	esac
252dc2c7305SBill Fenner	# The OS release
253feb4ecdbSBruce M Simpson	# Debian GNU/NetBSD machines have a different userland, and
254feb4ecdbSBruce M Simpson	# thus, need a distinct triplet. However, they do not need
255feb4ecdbSBruce M Simpson	# kernel version information, so it can be replaced with a
256feb4ecdbSBruce M Simpson	# suitable tag, in the style of linux-gnu.
257*6f9cba8fSJoseph Mingrone	case $UNAME_VERSION in
258feb4ecdbSBruce M Simpson	    Debian*)
259feb4ecdbSBruce M Simpson		release='-gnu'
260feb4ecdbSBruce M Simpson		;;
261feb4ecdbSBruce M Simpson	    *)
26257e22627SCy Schubert		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
263feb4ecdbSBruce M Simpson		;;
264feb4ecdbSBruce M Simpson	esac
265dc2c7305SBill Fenner	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
266dc2c7305SBill Fenner	# contains redundant information, the shorter form:
267dc2c7305SBill Fenner	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
268*6f9cba8fSJoseph Mingrone	GUESS=$machine-${os}${release}${abi-}
269*6f9cba8fSJoseph Mingrone	;;
270ada6f083SXin LI    *:Bitrig:*:*)
271ada6f083SXin LI	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
272*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
273*6f9cba8fSJoseph Mingrone	;;
274feb4ecdbSBruce M Simpson    *:OpenBSD:*:*)
275a0ee43a1SRui Paulo	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
276*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
277*6f9cba8fSJoseph Mingrone	;;
278*6f9cba8fSJoseph Mingrone    *:SecBSD:*:*)
279*6f9cba8fSJoseph Mingrone	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
280*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
281*6f9cba8fSJoseph Mingrone	;;
28257e22627SCy Schubert    *:LibertyBSD:*:*)
28357e22627SCy Schubert	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
284*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
285*6f9cba8fSJoseph Mingrone	;;
28657e22627SCy Schubert    *:MidnightBSD:*:*)
287*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
288*6f9cba8fSJoseph Mingrone	;;
289a0ee43a1SRui Paulo    *:ekkoBSD:*:*)
290*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
291*6f9cba8fSJoseph Mingrone	;;
292a0ee43a1SRui Paulo    *:SolidBSD:*:*)
293*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
294*6f9cba8fSJoseph Mingrone	;;
295*6f9cba8fSJoseph Mingrone    *:OS108:*:*)
296*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
297*6f9cba8fSJoseph Mingrone	;;
298a0ee43a1SRui Paulo    macppc:MirBSD:*:*)
299*6f9cba8fSJoseph Mingrone	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
300*6f9cba8fSJoseph Mingrone	;;
301a0ee43a1SRui Paulo    *:MirBSD:*:*)
302*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
303*6f9cba8fSJoseph Mingrone	;;
30457e22627SCy Schubert    *:Sortix:*:*)
305*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-sortix
306*6f9cba8fSJoseph Mingrone	;;
307*6f9cba8fSJoseph Mingrone    *:Twizzler:*:*)
308*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-twizzler
309*6f9cba8fSJoseph Mingrone	;;
31057e22627SCy Schubert    *:Redox:*:*)
311*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-redox
312*6f9cba8fSJoseph Mingrone	;;
31357e22627SCy Schubert    mips:OSF1:*.*)
314*6f9cba8fSJoseph Mingrone	GUESS=mips-dec-osf1
315*6f9cba8fSJoseph Mingrone	;;
3168cf6c252SPaul Traina    alpha:OSF1:*:*)
317*6f9cba8fSJoseph Mingrone	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
318*6f9cba8fSJoseph Mingrone	trap '' 0
319a0ee43a1SRui Paulo	case $UNAME_RELEASE in
320a0ee43a1SRui Paulo	*4.0)
321dc2c7305SBill Fenner		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
322a0ee43a1SRui Paulo		;;
323a0ee43a1SRui Paulo	*5.*)
324a0ee43a1SRui Paulo		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
325a0ee43a1SRui Paulo		;;
326a0ee43a1SRui Paulo	esac
327feb4ecdbSBruce M Simpson	# According to Compaq, /usr/sbin/psrinfo has been available on
328feb4ecdbSBruce M Simpson	# OSF/1 and Tru64 systems produced since 1995.  I hope that
329feb4ecdbSBruce M Simpson	# covers most systems running today.  This code pipes the CPU
330feb4ecdbSBruce M Simpson	# types through head -n 1, so we only detect the type of CPU 0.
331feb4ecdbSBruce M Simpson	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
332*6f9cba8fSJoseph Mingrone	case $ALPHA_CPU_TYPE in
333feb4ecdbSBruce M Simpson	    "EV4 (21064)")
33457e22627SCy Schubert		UNAME_MACHINE=alpha ;;
335feb4ecdbSBruce M Simpson	    "EV4.5 (21064)")
33657e22627SCy Schubert		UNAME_MACHINE=alpha ;;
337feb4ecdbSBruce M Simpson	    "LCA4 (21066/21068)")
33857e22627SCy Schubert		UNAME_MACHINE=alpha ;;
339feb4ecdbSBruce M Simpson	    "EV5 (21164)")
34057e22627SCy Schubert		UNAME_MACHINE=alphaev5 ;;
341feb4ecdbSBruce M Simpson	    "EV5.6 (21164A)")
34257e22627SCy Schubert		UNAME_MACHINE=alphaev56 ;;
343feb4ecdbSBruce M Simpson	    "EV5.6 (21164PC)")
34457e22627SCy Schubert		UNAME_MACHINE=alphapca56 ;;
345feb4ecdbSBruce M Simpson	    "EV5.7 (21164PC)")
34657e22627SCy Schubert		UNAME_MACHINE=alphapca57 ;;
347feb4ecdbSBruce M Simpson	    "EV6 (21264)")
34857e22627SCy Schubert		UNAME_MACHINE=alphaev6 ;;
349feb4ecdbSBruce M Simpson	    "EV6.7 (21264A)")
35057e22627SCy Schubert		UNAME_MACHINE=alphaev67 ;;
351feb4ecdbSBruce M Simpson	    "EV6.8CB (21264C)")
35257e22627SCy Schubert		UNAME_MACHINE=alphaev68 ;;
353feb4ecdbSBruce M Simpson	    "EV6.8AL (21264B)")
35457e22627SCy Schubert		UNAME_MACHINE=alphaev68 ;;
355feb4ecdbSBruce M Simpson	    "EV6.8CX (21264D)")
35657e22627SCy Schubert		UNAME_MACHINE=alphaev68 ;;
357feb4ecdbSBruce M Simpson	    "EV6.9A (21264/EV69A)")
35857e22627SCy Schubert		UNAME_MACHINE=alphaev69 ;;
359feb4ecdbSBruce M Simpson	    "EV7 (21364)")
36057e22627SCy Schubert		UNAME_MACHINE=alphaev7 ;;
361feb4ecdbSBruce M Simpson	    "EV7.9 (21364A)")
36257e22627SCy Schubert		UNAME_MACHINE=alphaev79 ;;
363feb4ecdbSBruce M Simpson	esac
364a0ee43a1SRui Paulo	# A Pn.n version is a patched version.
3658cf6c252SPaul Traina	# A Vn.n version is a released version.
3668cf6c252SPaul Traina	# A Tn.n version is a released field test version.
3678cf6c252SPaul Traina	# A Xn.n version is an unreleased experimental baselevel.
3688cf6c252SPaul Traina	# 1.2 uses "1.2" for uname -r.
369*6f9cba8fSJoseph Mingrone	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
370*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
371*6f9cba8fSJoseph Mingrone	;;
3728cf6c252SPaul Traina    Amiga*:UNIX_System_V:4.0:*)
373*6f9cba8fSJoseph Mingrone	GUESS=m68k-unknown-sysv4
374*6f9cba8fSJoseph Mingrone	;;
375dc2c7305SBill Fenner    *:[Aa]miga[Oo][Ss]:*:*)
376*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-amigaos
377*6f9cba8fSJoseph Mingrone	;;
378feb4ecdbSBruce M Simpson    *:[Mm]orph[Oo][Ss]:*:*)
379*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-morphos
380*6f9cba8fSJoseph Mingrone	;;
381dc2c7305SBill Fenner    *:OS/390:*:*)
382*6f9cba8fSJoseph Mingrone	GUESS=i370-ibm-openedition
383*6f9cba8fSJoseph Mingrone	;;
384a0ee43a1SRui Paulo    *:z/VM:*:*)
385*6f9cba8fSJoseph Mingrone	GUESS=s390-ibm-zvmoe
386*6f9cba8fSJoseph Mingrone	;;
387feb4ecdbSBruce M Simpson    *:OS400:*:*)
388*6f9cba8fSJoseph Mingrone	GUESS=powerpc-ibm-os400
389*6f9cba8fSJoseph Mingrone	;;
3908cf6c252SPaul Traina    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
391*6f9cba8fSJoseph Mingrone	GUESS=arm-acorn-riscix$UNAME_RELEASE
392*6f9cba8fSJoseph Mingrone	;;
393ada6f083SXin LI    arm*:riscos:*:*|arm*:RISCOS:*:*)
394*6f9cba8fSJoseph Mingrone	GUESS=arm-unknown-riscos
395*6f9cba8fSJoseph Mingrone	;;
3960a94d38fSBill Fenner    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
397*6f9cba8fSJoseph Mingrone	GUESS=hppa1.1-hitachi-hiuxmpp
398*6f9cba8fSJoseph Mingrone	;;
399dc2c7305SBill Fenner    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
4003052b236SBill Fenner	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
401*6f9cba8fSJoseph Mingrone	case `(/bin/universe) 2>/dev/null` in
402*6f9cba8fSJoseph Mingrone	    att) GUESS=pyramid-pyramid-sysv3 ;;
403*6f9cba8fSJoseph Mingrone	    *)   GUESS=pyramid-pyramid-bsd   ;;
404*6f9cba8fSJoseph Mingrone	esac
405*6f9cba8fSJoseph Mingrone	;;
406dc2c7305SBill Fenner    NILE*:*:*:dcosx)
407*6f9cba8fSJoseph Mingrone	GUESS=pyramid-pyramid-svr4
408*6f9cba8fSJoseph Mingrone	;;
409feb4ecdbSBruce M Simpson    DRS?6000:unix:4.0:6*)
410*6f9cba8fSJoseph Mingrone	GUESS=sparc-icl-nx6
411*6f9cba8fSJoseph Mingrone	;;
412a0ee43a1SRui Paulo    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
413feb4ecdbSBruce M Simpson	case `/usr/bin/uname -p` in
414*6f9cba8fSJoseph Mingrone	    sparc) GUESS=sparc-icl-nx7 ;;
415*6f9cba8fSJoseph Mingrone	esac
416*6f9cba8fSJoseph Mingrone	;;
417a0ee43a1SRui Paulo    s390x:SunOS:*:*)
418*6f9cba8fSJoseph Mingrone	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
419*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
420*6f9cba8fSJoseph Mingrone	;;
421dc2c7305SBill Fenner    sun4H:SunOS:5.*:*)
422*6f9cba8fSJoseph Mingrone	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
423*6f9cba8fSJoseph Mingrone	GUESS=sparc-hal-solaris2$SUN_REL
424*6f9cba8fSJoseph Mingrone	;;
4253052b236SBill Fenner    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
426*6f9cba8fSJoseph Mingrone	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
427*6f9cba8fSJoseph Mingrone	GUESS=sparc-sun-solaris2$SUN_REL
428*6f9cba8fSJoseph Mingrone	;;
429a0ee43a1SRui Paulo    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
430*6f9cba8fSJoseph Mingrone	GUESS=i386-pc-auroraux$UNAME_RELEASE
431*6f9cba8fSJoseph Mingrone	;;
432a0ee43a1SRui Paulo    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
433*6f9cba8fSJoseph Mingrone	set_cc_for_build
43457e22627SCy Schubert	SUN_ARCH=i386
435a0ee43a1SRui Paulo	# If there is a compiler, see if it is configured for 64-bit objects.
436a0ee43a1SRui Paulo	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
437a0ee43a1SRui Paulo	# This test works for both compilers.
438*6f9cba8fSJoseph Mingrone	if test "$CC_FOR_BUILD" != no_compiler_found; then
439a0ee43a1SRui Paulo	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
440*6f9cba8fSJoseph Mingrone		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
441a0ee43a1SRui Paulo		grep IS_64BIT_ARCH >/dev/null
442a0ee43a1SRui Paulo	    then
44357e22627SCy Schubert		SUN_ARCH=x86_64
444a0ee43a1SRui Paulo	    fi
445a0ee43a1SRui Paulo	fi
446*6f9cba8fSJoseph Mingrone	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
447*6f9cba8fSJoseph Mingrone	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
448*6f9cba8fSJoseph Mingrone	;;
4498cf6c252SPaul Traina    sun4*:SunOS:6*:*)
4508cf6c252SPaul Traina	# According to config.sub, this is the proper way to canonicalize
4518cf6c252SPaul Traina	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
4528cf6c252SPaul Traina	# it's likely to be more like Solaris than SunOS4.
453*6f9cba8fSJoseph Mingrone	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
454*6f9cba8fSJoseph Mingrone	GUESS=sparc-sun-solaris3$SUN_REL
455*6f9cba8fSJoseph Mingrone	;;
4568cf6c252SPaul Traina    sun4*:SunOS:*:*)
457*6f9cba8fSJoseph Mingrone	case `/usr/bin/arch -k` in
4588cf6c252SPaul Traina	    Series*|S4*)
4598cf6c252SPaul Traina		UNAME_RELEASE=`uname -v`
4608cf6c252SPaul Traina		;;
4618cf6c252SPaul Traina	esac
4628cf6c252SPaul Traina	# Japanese Language versions have a version number like `4.1.3-JL'.
463*6f9cba8fSJoseph Mingrone	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
464*6f9cba8fSJoseph Mingrone	GUESS=sparc-sun-sunos$SUN_REL
465*6f9cba8fSJoseph Mingrone	;;
4668cf6c252SPaul Traina    sun3*:SunOS:*:*)
467*6f9cba8fSJoseph Mingrone	GUESS=m68k-sun-sunos$UNAME_RELEASE
468*6f9cba8fSJoseph Mingrone	;;
469dc2c7305SBill Fenner    sun*:*:4.2BSD:*)
470feb4ecdbSBruce M Simpson	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
47157e22627SCy Schubert	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
472*6f9cba8fSJoseph Mingrone	case `/bin/arch` in
473dc2c7305SBill Fenner	    sun3)
474*6f9cba8fSJoseph Mingrone		GUESS=m68k-sun-sunos$UNAME_RELEASE
475dc2c7305SBill Fenner		;;
476dc2c7305SBill Fenner	    sun4)
477*6f9cba8fSJoseph Mingrone		GUESS=sparc-sun-sunos$UNAME_RELEASE
478dc2c7305SBill Fenner		;;
479dc2c7305SBill Fenner	esac
480*6f9cba8fSJoseph Mingrone	;;
4813052b236SBill Fenner    aushp:SunOS:*:*)
482*6f9cba8fSJoseph Mingrone	GUESS=sparc-auspex-sunos$UNAME_RELEASE
483*6f9cba8fSJoseph Mingrone	;;
484dc2c7305SBill Fenner    # The situation for MiNT is a little confusing.  The machine name
485dc2c7305SBill Fenner    # can be virtually everything (everything which is not
486dc2c7305SBill Fenner    # "atarist" or "atariste" at least should have a processor
487dc2c7305SBill Fenner    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
488dc2c7305SBill Fenner    # to the lowercase version "mint" (or "freemint").  Finally
489dc2c7305SBill Fenner    # the system name "TOS" denotes a system which is actually not
490dc2c7305SBill Fenner    # MiNT.  But MiNT is downward compatible to TOS, so this should
491dc2c7305SBill Fenner    # be no problem.
492dc2c7305SBill Fenner    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
493*6f9cba8fSJoseph Mingrone	GUESS=m68k-atari-mint$UNAME_RELEASE
494*6f9cba8fSJoseph Mingrone	;;
495dc2c7305SBill Fenner    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
496*6f9cba8fSJoseph Mingrone	GUESS=m68k-atari-mint$UNAME_RELEASE
497*6f9cba8fSJoseph Mingrone	;;
498dc2c7305SBill Fenner    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
499*6f9cba8fSJoseph Mingrone	GUESS=m68k-atari-mint$UNAME_RELEASE
500*6f9cba8fSJoseph Mingrone	;;
501dc2c7305SBill Fenner    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
502*6f9cba8fSJoseph Mingrone	GUESS=m68k-milan-mint$UNAME_RELEASE
503*6f9cba8fSJoseph Mingrone	;;
504dc2c7305SBill Fenner    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
505*6f9cba8fSJoseph Mingrone	GUESS=m68k-hades-mint$UNAME_RELEASE
506*6f9cba8fSJoseph Mingrone	;;
507dc2c7305SBill Fenner    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
508*6f9cba8fSJoseph Mingrone	GUESS=m68k-unknown-mint$UNAME_RELEASE
509*6f9cba8fSJoseph Mingrone	;;
510a0ee43a1SRui Paulo    m68k:machten:*:*)
511*6f9cba8fSJoseph Mingrone	GUESS=m68k-apple-machten$UNAME_RELEASE
512*6f9cba8fSJoseph Mingrone	;;
5133052b236SBill Fenner    powerpc:machten:*:*)
514*6f9cba8fSJoseph Mingrone	GUESS=powerpc-apple-machten$UNAME_RELEASE
515*6f9cba8fSJoseph Mingrone	;;
5163052b236SBill Fenner    RISC*:Mach:*:*)
517*6f9cba8fSJoseph Mingrone	GUESS=mips-dec-mach_bsd4.3
518*6f9cba8fSJoseph Mingrone	;;
5198cf6c252SPaul Traina    RISC*:ULTRIX:*:*)
520*6f9cba8fSJoseph Mingrone	GUESS=mips-dec-ultrix$UNAME_RELEASE
521*6f9cba8fSJoseph Mingrone	;;
5228cf6c252SPaul Traina    VAX*:ULTRIX*:*:*)
523*6f9cba8fSJoseph Mingrone	GUESS=vax-dec-ultrix$UNAME_RELEASE
524*6f9cba8fSJoseph Mingrone	;;
525dc2c7305SBill Fenner    2020:CLIX:*:* | 2430:CLIX:*:*)
526*6f9cba8fSJoseph Mingrone	GUESS=clipper-intergraph-clix$UNAME_RELEASE
527*6f9cba8fSJoseph Mingrone	;;
5283052b236SBill Fenner    mips:*:*:UMIPS | mips:*:*:RISCos)
529*6f9cba8fSJoseph Mingrone	set_cc_for_build
53057e22627SCy Schubert	sed 's/^	//' << EOF > "$dummy.c"
531dc2c7305SBill Fenner#ifdef __cplusplus
532dc2c7305SBill Fenner#include <stdio.h>  /* for printf() prototype */
533dc2c7305SBill Fenner	int main (int argc, char *argv[]) {
534dc2c7305SBill Fenner#else
535dc2c7305SBill Fenner	int main (argc, argv) int argc; char *argv[]; {
536dc2c7305SBill Fenner#endif
5373052b236SBill Fenner	#if defined (host_mips) && defined (MIPSEB)
5383052b236SBill Fenner	#if defined (SYSTYPE_SYSV)
53957e22627SCy Schubert	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
5403052b236SBill Fenner	#endif
5413052b236SBill Fenner	#if defined (SYSTYPE_SVR4)
54257e22627SCy Schubert	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
5433052b236SBill Fenner	#endif
5443052b236SBill Fenner	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
54557e22627SCy Schubert	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
5463052b236SBill Fenner	#endif
5473052b236SBill Fenner	#endif
5483052b236SBill Fenner	  exit (-1);
5493052b236SBill Fenner	}
5503052b236SBill FennerEOF
55157e22627SCy Schubert	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
55257e22627SCy Schubert	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
55357e22627SCy Schubert	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
554a0ee43a1SRui Paulo	    { echo "$SYSTEM_NAME"; exit; }
555*6f9cba8fSJoseph Mingrone	GUESS=mips-mips-riscos$UNAME_RELEASE
556*6f9cba8fSJoseph Mingrone	;;
5570a94d38fSBill Fenner    Motorola:PowerMAX_OS:*:*)
558*6f9cba8fSJoseph Mingrone	GUESS=powerpc-motorola-powermax
559*6f9cba8fSJoseph Mingrone	;;
560feb4ecdbSBruce M Simpson    Motorola:*:4.3:PL8-*)
561*6f9cba8fSJoseph Mingrone	GUESS=powerpc-harris-powermax
562*6f9cba8fSJoseph Mingrone	;;
563feb4ecdbSBruce M Simpson    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
564*6f9cba8fSJoseph Mingrone	GUESS=powerpc-harris-powermax
565*6f9cba8fSJoseph Mingrone	;;
5668cf6c252SPaul Traina    Night_Hawk:Power_UNIX:*:*)
567*6f9cba8fSJoseph Mingrone	GUESS=powerpc-harris-powerunix
568*6f9cba8fSJoseph Mingrone	;;
5698cf6c252SPaul Traina    m88k:CX/UX:7*:*)
570*6f9cba8fSJoseph Mingrone	GUESS=m88k-harris-cxux7
571*6f9cba8fSJoseph Mingrone	;;
5728cf6c252SPaul Traina    m88k:*:4*:R4*)
573*6f9cba8fSJoseph Mingrone	GUESS=m88k-motorola-sysv4
574*6f9cba8fSJoseph Mingrone	;;
5758cf6c252SPaul Traina    m88k:*:3*:R3*)
576*6f9cba8fSJoseph Mingrone	GUESS=m88k-motorola-sysv3
577*6f9cba8fSJoseph Mingrone	;;
5788cf6c252SPaul Traina    AViiON:dgux:*:*)
5798cf6c252SPaul Traina	# DG/UX returns AViiON for all architectures
5808cf6c252SPaul Traina	UNAME_PROCESSOR=`/usr/bin/uname -p`
581*6f9cba8fSJoseph Mingrone	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
582dc2c7305SBill Fenner	then
583*6f9cba8fSJoseph Mingrone	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
584*6f9cba8fSJoseph Mingrone	       test "$TARGET_BINARY_INTERFACE"x = x
585dc2c7305SBill Fenner	    then
586*6f9cba8fSJoseph Mingrone		GUESS=m88k-dg-dgux$UNAME_RELEASE
5878cf6c252SPaul Traina	    else
588*6f9cba8fSJoseph Mingrone		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
5898cf6c252SPaul Traina	    fi
590dc2c7305SBill Fenner	else
591*6f9cba8fSJoseph Mingrone	    GUESS=i586-dg-dgux$UNAME_RELEASE
5928cf6c252SPaul Traina	fi
593*6f9cba8fSJoseph Mingrone	;;
5948cf6c252SPaul Traina    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
595*6f9cba8fSJoseph Mingrone	GUESS=m88k-dolphin-sysv3
596*6f9cba8fSJoseph Mingrone	;;
5978cf6c252SPaul Traina    M88*:*:R3*:*)
5988cf6c252SPaul Traina	# Delta 88k system running SVR3
599*6f9cba8fSJoseph Mingrone	GUESS=m88k-motorola-sysv3
600*6f9cba8fSJoseph Mingrone	;;
6018cf6c252SPaul Traina    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
602*6f9cba8fSJoseph Mingrone	GUESS=m88k-tektronix-sysv3
603*6f9cba8fSJoseph Mingrone	;;
6048cf6c252SPaul Traina    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
605*6f9cba8fSJoseph Mingrone	GUESS=m68k-tektronix-bsd
606*6f9cba8fSJoseph Mingrone	;;
6078cf6c252SPaul Traina    *:IRIX*:*:*)
608*6f9cba8fSJoseph Mingrone	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
609*6f9cba8fSJoseph Mingrone	GUESS=mips-sgi-irix$IRIX_REL
610*6f9cba8fSJoseph Mingrone	;;
6118cf6c252SPaul Traina    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
612*6f9cba8fSJoseph Mingrone	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
613*6f9cba8fSJoseph Mingrone	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
6140a94d38fSBill Fenner    i*86:AIX:*:*)
615*6f9cba8fSJoseph Mingrone	GUESS=i386-ibm-aix
616*6f9cba8fSJoseph Mingrone	;;
6170a94d38fSBill Fenner    ia64:AIX:*:*)
618*6f9cba8fSJoseph Mingrone	if test -x /usr/bin/oslevel ; then
6190a94d38fSBill Fenner		IBM_REV=`/usr/bin/oslevel`
6200a94d38fSBill Fenner	else
621*6f9cba8fSJoseph Mingrone		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
6220a94d38fSBill Fenner	fi
623*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
624*6f9cba8fSJoseph Mingrone	;;
6258cf6c252SPaul Traina    *:AIX:2:3)
6268cf6c252SPaul Traina	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
627*6f9cba8fSJoseph Mingrone		set_cc_for_build
62857e22627SCy Schubert		sed 's/^		//' << EOF > "$dummy.c"
6298cf6c252SPaul Traina		#include <sys/systemcfg.h>
6308cf6c252SPaul Traina
6318cf6c252SPaul Traina		main()
6328cf6c252SPaul Traina			{
6338cf6c252SPaul Traina			if (!__power_pc())
6348cf6c252SPaul Traina				exit(1);
6358cf6c252SPaul Traina			puts("powerpc-ibm-aix3.2.5");
6368cf6c252SPaul Traina			exit(0);
6378cf6c252SPaul Traina			}
6388cf6c252SPaul TrainaEOF
63957e22627SCy Schubert		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
640a0ee43a1SRui Paulo		then
641*6f9cba8fSJoseph Mingrone			GUESS=$SYSTEM_NAME
642a0ee43a1SRui Paulo		else
643*6f9cba8fSJoseph Mingrone			GUESS=rs6000-ibm-aix3.2.5
644a0ee43a1SRui Paulo		fi
6458cf6c252SPaul Traina	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
646*6f9cba8fSJoseph Mingrone		GUESS=rs6000-ibm-aix3.2.4
6478cf6c252SPaul Traina	else
648*6f9cba8fSJoseph Mingrone		GUESS=rs6000-ibm-aix3.2
6498cf6c252SPaul Traina	fi
650*6f9cba8fSJoseph Mingrone	;;
651681ed54cSXin LI    *:AIX:*:[4567])
652feb4ecdbSBruce M Simpson	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
65357e22627SCy Schubert	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
6548cf6c252SPaul Traina		IBM_ARCH=rs6000
6558cf6c252SPaul Traina	else
6568cf6c252SPaul Traina		IBM_ARCH=powerpc
6578cf6c252SPaul Traina	fi
658*6f9cba8fSJoseph Mingrone	if test -x /usr/bin/lslpp ; then
659*6f9cba8fSJoseph Mingrone		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
660ada6f083SXin LI			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
6618cf6c252SPaul Traina	else
662*6f9cba8fSJoseph Mingrone		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
6638cf6c252SPaul Traina	fi
664*6f9cba8fSJoseph Mingrone	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
665*6f9cba8fSJoseph Mingrone	;;
6668cf6c252SPaul Traina    *:AIX:*:*)
667*6f9cba8fSJoseph Mingrone	GUESS=rs6000-ibm-aix
668*6f9cba8fSJoseph Mingrone	;;
66957e22627SCy Schubert    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
670*6f9cba8fSJoseph Mingrone	GUESS=romp-ibm-bsd4.4
671*6f9cba8fSJoseph Mingrone	;;
672dc2c7305SBill Fenner    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
673*6f9cba8fSJoseph Mingrone	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
674*6f9cba8fSJoseph Mingrone	;;                                  # report: romp-ibm BSD 4.3
6758cf6c252SPaul Traina    *:BOSX:*:*)
676*6f9cba8fSJoseph Mingrone	GUESS=rs6000-bull-bosx
677*6f9cba8fSJoseph Mingrone	;;
6788cf6c252SPaul Traina    DPX/2?00:B.O.S.:*:*)
679*6f9cba8fSJoseph Mingrone	GUESS=m68k-bull-sysv3
680*6f9cba8fSJoseph Mingrone	;;
6818cf6c252SPaul Traina    9000/[34]??:4.3bsd:1.*:*)
682*6f9cba8fSJoseph Mingrone	GUESS=m68k-hp-bsd
683*6f9cba8fSJoseph Mingrone	;;
6848cf6c252SPaul Traina    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
685*6f9cba8fSJoseph Mingrone	GUESS=m68k-hp-bsd4.4
686*6f9cba8fSJoseph Mingrone	;;
687dc2c7305SBill Fenner    9000/[34678]??:HP-UX:*:*)
68857e22627SCy Schubert	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
689*6f9cba8fSJoseph Mingrone	case $UNAME_MACHINE in
6908cf6c252SPaul Traina	    9000/31?)            HP_ARCH=m68000 ;;
6918cf6c252SPaul Traina	    9000/[34]??)         HP_ARCH=m68k ;;
692dc2c7305SBill Fenner	    9000/[678][0-9][0-9])
693*6f9cba8fSJoseph Mingrone		if test -x /usr/bin/getconf; then
694dc2c7305SBill Fenner		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
695dc2c7305SBill Fenner		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
696*6f9cba8fSJoseph Mingrone		    case $sc_cpu_version in
69757e22627SCy Schubert		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
69857e22627SCy Schubert		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
699dc2c7305SBill Fenner		      532)                      # CPU_PA_RISC2_0
700*6f9cba8fSJoseph Mingrone			case $sc_kernel_bits in
70157e22627SCy Schubert			  32) HP_ARCH=hppa2.0n ;;
70257e22627SCy Schubert			  64) HP_ARCH=hppa2.0w ;;
70357e22627SCy Schubert			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
704dc2c7305SBill Fenner			esac ;;
7058cf6c252SPaul Traina		    esac
706feb4ecdbSBruce M Simpson		fi
707*6f9cba8fSJoseph Mingrone		if test "$HP_ARCH" = ""; then
708*6f9cba8fSJoseph Mingrone		    set_cc_for_build
70957e22627SCy Schubert		    sed 's/^		//' << EOF > "$dummy.c"
710dc2c7305SBill Fenner
711dc2c7305SBill Fenner		#define _HPUX_SOURCE
712dc2c7305SBill Fenner		#include <stdlib.h>
713dc2c7305SBill Fenner		#include <unistd.h>
714dc2c7305SBill Fenner
715dc2c7305SBill Fenner		int main ()
716dc2c7305SBill Fenner		{
717dc2c7305SBill Fenner		#if defined(_SC_KERNEL_BITS)
718dc2c7305SBill Fenner		    long bits = sysconf(_SC_KERNEL_BITS);
719dc2c7305SBill Fenner		#endif
720dc2c7305SBill Fenner		    long cpu  = sysconf (_SC_CPU_VERSION);
721dc2c7305SBill Fenner
722dc2c7305SBill Fenner		    switch (cpu)
723dc2c7305SBill Fenner			{
724dc2c7305SBill Fenner			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
725dc2c7305SBill Fenner			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
726dc2c7305SBill Fenner			case CPU_PA_RISC2_0:
727dc2c7305SBill Fenner		#if defined(_SC_KERNEL_BITS)
728dc2c7305SBill Fenner			    switch (bits)
729dc2c7305SBill Fenner				{
730dc2c7305SBill Fenner				case 64: puts ("hppa2.0w"); break;
731dc2c7305SBill Fenner				case 32: puts ("hppa2.0n"); break;
732dc2c7305SBill Fenner				default: puts ("hppa2.0"); break;
733dc2c7305SBill Fenner				} break;
734dc2c7305SBill Fenner		#else  /* !defined(_SC_KERNEL_BITS) */
735dc2c7305SBill Fenner			    puts ("hppa2.0"); break;
736dc2c7305SBill Fenner		#endif
737dc2c7305SBill Fenner			default: puts ("hppa1.0"); break;
738dc2c7305SBill Fenner			}
739dc2c7305SBill Fenner		    exit (0);
740dc2c7305SBill Fenner		}
741dc2c7305SBill FennerEOF
74257e22627SCy Schubert		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
743feb4ecdbSBruce M Simpson		    test -z "$HP_ARCH" && HP_ARCH=hppa
744dc2c7305SBill Fenner		fi ;;
745dc2c7305SBill Fenner	esac
746*6f9cba8fSJoseph Mingrone	if test "$HP_ARCH" = hppa2.0w
747feb4ecdbSBruce M Simpson	then
748*6f9cba8fSJoseph Mingrone	    set_cc_for_build
749a0ee43a1SRui Paulo
750a0ee43a1SRui Paulo	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
751a0ee43a1SRui Paulo	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
752a0ee43a1SRui Paulo	    # generating 64-bit code.  GNU and HP use different nomenclature:
753a0ee43a1SRui Paulo	    #
754a0ee43a1SRui Paulo	    # $ CC_FOR_BUILD=cc ./config.guess
755a0ee43a1SRui Paulo	    # => hppa2.0w-hp-hpux11.23
756a0ee43a1SRui Paulo	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
757a0ee43a1SRui Paulo	    # => hppa64-hp-hpux11.23
758a0ee43a1SRui Paulo
75957e22627SCy Schubert	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
760a0ee43a1SRui Paulo		grep -q __LP64__
761feb4ecdbSBruce M Simpson	    then
76257e22627SCy Schubert		HP_ARCH=hppa2.0w
763feb4ecdbSBruce M Simpson	    else
76457e22627SCy Schubert		HP_ARCH=hppa64
765feb4ecdbSBruce M Simpson	    fi
766feb4ecdbSBruce M Simpson	fi
767*6f9cba8fSJoseph Mingrone	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
768*6f9cba8fSJoseph Mingrone	;;
7690a94d38fSBill Fenner    ia64:HP-UX:*:*)
77057e22627SCy Schubert	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
771*6f9cba8fSJoseph Mingrone	GUESS=ia64-hp-hpux$HPUX_REV
772*6f9cba8fSJoseph Mingrone	;;
7738cf6c252SPaul Traina    3050*:HI-UX:*:*)
774*6f9cba8fSJoseph Mingrone	set_cc_for_build
77557e22627SCy Schubert	sed 's/^	//' << EOF > "$dummy.c"
7768cf6c252SPaul Traina	#include <unistd.h>
7778cf6c252SPaul Traina	int
7788cf6c252SPaul Traina	main ()
7798cf6c252SPaul Traina	{
7808cf6c252SPaul Traina	  long cpu = sysconf (_SC_CPU_VERSION);
7818cf6c252SPaul Traina	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7828cf6c252SPaul Traina	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7838cf6c252SPaul Traina	     results, however.  */
7848cf6c252SPaul Traina	  if (CPU_IS_PA_RISC (cpu))
7858cf6c252SPaul Traina	    {
7868cf6c252SPaul Traina	      switch (cpu)
7878cf6c252SPaul Traina		{
7888cf6c252SPaul Traina		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7898cf6c252SPaul Traina		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7908cf6c252SPaul Traina		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7918cf6c252SPaul Traina		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7928cf6c252SPaul Traina		}
7938cf6c252SPaul Traina	    }
7948cf6c252SPaul Traina	  else if (CPU_IS_HP_MC68K (cpu))
7958cf6c252SPaul Traina	    puts ("m68k-hitachi-hiuxwe2");
7968cf6c252SPaul Traina	  else puts ("unknown-hitachi-hiuxwe2");
7978cf6c252SPaul Traina	  exit (0);
7988cf6c252SPaul Traina	}
7998cf6c252SPaul TrainaEOF
80057e22627SCy Schubert	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
801a0ee43a1SRui Paulo		{ echo "$SYSTEM_NAME"; exit; }
802*6f9cba8fSJoseph Mingrone	GUESS=unknown-hitachi-hiuxwe2
803*6f9cba8fSJoseph Mingrone	;;
8048cf6c252SPaul Traina    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
805*6f9cba8fSJoseph Mingrone	GUESS=hppa1.1-hp-bsd
806*6f9cba8fSJoseph Mingrone	;;
8078cf6c252SPaul Traina    9000/8??:4.3bsd:*:*)
808*6f9cba8fSJoseph Mingrone	GUESS=hppa1.0-hp-bsd
809*6f9cba8fSJoseph Mingrone	;;
810feb4ecdbSBruce M Simpson    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
811*6f9cba8fSJoseph Mingrone	GUESS=hppa1.0-hp-mpeix
812*6f9cba8fSJoseph Mingrone	;;
8138cf6c252SPaul Traina    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
814*6f9cba8fSJoseph Mingrone	GUESS=hppa1.1-hp-osf
815*6f9cba8fSJoseph Mingrone	;;
8168cf6c252SPaul Traina    hp8??:OSF1:*:*)
817*6f9cba8fSJoseph Mingrone	GUESS=hppa1.0-hp-osf
818*6f9cba8fSJoseph Mingrone	;;
8190a94d38fSBill Fenner    i*86:OSF1:*:*)
820*6f9cba8fSJoseph Mingrone	if test -x /usr/sbin/sysversion ; then
821*6f9cba8fSJoseph Mingrone	    GUESS=$UNAME_MACHINE-unknown-osf1mk
8223052b236SBill Fenner	else
823*6f9cba8fSJoseph Mingrone	    GUESS=$UNAME_MACHINE-unknown-osf1
8243052b236SBill Fenner	fi
825*6f9cba8fSJoseph Mingrone	;;
8268cf6c252SPaul Traina    parisc*:Lites*:*:*)
827*6f9cba8fSJoseph Mingrone	GUESS=hppa1.1-hp-lites
828*6f9cba8fSJoseph Mingrone	;;
8298cf6c252SPaul Traina    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
830*6f9cba8fSJoseph Mingrone	GUESS=c1-convex-bsd
831*6f9cba8fSJoseph Mingrone	;;
8328cf6c252SPaul Traina    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
8338cf6c252SPaul Traina	if getsysinfo -f scalar_acc
8348cf6c252SPaul Traina	then echo c32-convex-bsd
8358cf6c252SPaul Traina	else echo c2-convex-bsd
8368cf6c252SPaul Traina	fi
837a0ee43a1SRui Paulo	exit ;;
8388cf6c252SPaul Traina    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
839*6f9cba8fSJoseph Mingrone	GUESS=c34-convex-bsd
840*6f9cba8fSJoseph Mingrone	;;
8418cf6c252SPaul Traina    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
842*6f9cba8fSJoseph Mingrone	GUESS=c38-convex-bsd
843*6f9cba8fSJoseph Mingrone	;;
8448cf6c252SPaul Traina    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
845*6f9cba8fSJoseph Mingrone	GUESS=c4-convex-bsd
846*6f9cba8fSJoseph Mingrone	;;
8478cf6c252SPaul Traina    CRAY*Y-MP:*:*:*)
848*6f9cba8fSJoseph Mingrone	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
849*6f9cba8fSJoseph Mingrone	GUESS=ymp-cray-unicos$CRAY_REL
850*6f9cba8fSJoseph Mingrone	;;
8513052b236SBill Fenner    CRAY*[A-Z]90:*:*:*)
85257e22627SCy Schubert	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
8533052b236SBill Fenner	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
854feb4ecdbSBruce M Simpson	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
855feb4ecdbSBruce M Simpson	      -e 's/\.[^.]*$/.X/'
856a0ee43a1SRui Paulo	exit ;;
8573052b236SBill Fenner    CRAY*TS:*:*:*)
858*6f9cba8fSJoseph Mingrone	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
859*6f9cba8fSJoseph Mingrone	GUESS=t90-cray-unicos$CRAY_REL
860*6f9cba8fSJoseph Mingrone	;;
861dc2c7305SBill Fenner    CRAY*T3E:*:*:*)
862*6f9cba8fSJoseph Mingrone	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
863*6f9cba8fSJoseph Mingrone	GUESS=alphaev5-cray-unicosmk$CRAY_REL
864*6f9cba8fSJoseph Mingrone	;;
865dc2c7305SBill Fenner    CRAY*SV1:*:*:*)
866*6f9cba8fSJoseph Mingrone	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
867*6f9cba8fSJoseph Mingrone	GUESS=sv1-cray-unicos$CRAY_REL
868*6f9cba8fSJoseph Mingrone	;;
869feb4ecdbSBruce M Simpson    *:UNICOS/mp:*:*)
870*6f9cba8fSJoseph Mingrone	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
871*6f9cba8fSJoseph Mingrone	GUESS=craynv-cray-unicosmp$CRAY_REL
872*6f9cba8fSJoseph Mingrone	;;
8730a94d38fSBill Fenner    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
87457e22627SCy Schubert	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
87557e22627SCy Schubert	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
87657e22627SCy Schubert	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
877*6f9cba8fSJoseph Mingrone	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
878*6f9cba8fSJoseph Mingrone	;;
879feb4ecdbSBruce M Simpson    5000:UNIX_System_V:4.*:*)
88057e22627SCy Schubert	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
88157e22627SCy Schubert	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
882*6f9cba8fSJoseph Mingrone	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
883*6f9cba8fSJoseph Mingrone	;;
8840a94d38fSBill Fenner    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
885*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
886*6f9cba8fSJoseph Mingrone	;;
887dc2c7305SBill Fenner    sparc*:BSD/OS:*:*)
888*6f9cba8fSJoseph Mingrone	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
889*6f9cba8fSJoseph Mingrone	;;
890dc2c7305SBill Fenner    *:BSD/OS:*:*)
891*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
892*6f9cba8fSJoseph Mingrone	;;
893*6f9cba8fSJoseph Mingrone    arm:FreeBSD:*:*)
894*6f9cba8fSJoseph Mingrone	UNAME_PROCESSOR=`uname -p`
895*6f9cba8fSJoseph Mingrone	set_cc_for_build
896*6f9cba8fSJoseph Mingrone	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
897*6f9cba8fSJoseph Mingrone	    | grep -q __ARM_PCS_VFP
898*6f9cba8fSJoseph Mingrone	then
899*6f9cba8fSJoseph Mingrone	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
900*6f9cba8fSJoseph Mingrone	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
901*6f9cba8fSJoseph Mingrone	else
902*6f9cba8fSJoseph Mingrone	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
903*6f9cba8fSJoseph Mingrone	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
904*6f9cba8fSJoseph Mingrone	fi
905*6f9cba8fSJoseph Mingrone	;;
9068cf6c252SPaul Traina    *:FreeBSD:*:*)
907681ed54cSXin LI	UNAME_PROCESSOR=`/usr/bin/uname -p`
908*6f9cba8fSJoseph Mingrone	case $UNAME_PROCESSOR in
909a0ee43a1SRui Paulo	    amd64)
91057e22627SCy Schubert		UNAME_PROCESSOR=x86_64 ;;
91157e22627SCy Schubert	    i386)
91257e22627SCy Schubert		UNAME_PROCESSOR=i586 ;;
913a0ee43a1SRui Paulo	esac
914*6f9cba8fSJoseph Mingrone	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
915*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
916*6f9cba8fSJoseph Mingrone	;;
9178cf6c252SPaul Traina    i*:CYGWIN*:*)
918*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-cygwin
919*6f9cba8fSJoseph Mingrone	;;
920ada6f083SXin LI    *:MINGW64*:*)
921*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-mingw64
922*6f9cba8fSJoseph Mingrone	;;
923a0ee43a1SRui Paulo    *:MINGW*:*)
924*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-mingw32
925*6f9cba8fSJoseph Mingrone	;;
926ada6f083SXin LI    *:MSYS*:*)
927*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-msys
928*6f9cba8fSJoseph Mingrone	;;
929dc2c7305SBill Fenner    i*:PW*:*)
930*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-pw32
931*6f9cba8fSJoseph Mingrone	;;
932*6f9cba8fSJoseph Mingrone    *:SerenityOS:*:*)
933*6f9cba8fSJoseph Mingrone        GUESS=$UNAME_MACHINE-pc-serenity
934*6f9cba8fSJoseph Mingrone        ;;
935a0ee43a1SRui Paulo    *:Interix*:*)
936*6f9cba8fSJoseph Mingrone	case $UNAME_MACHINE in
937a0ee43a1SRui Paulo	    x86)
938*6f9cba8fSJoseph Mingrone		GUESS=i586-pc-interix$UNAME_RELEASE
939*6f9cba8fSJoseph Mingrone		;;
940a0ee43a1SRui Paulo	    authenticamd | genuineintel | EM64T)
941*6f9cba8fSJoseph Mingrone		GUESS=x86_64-unknown-interix$UNAME_RELEASE
942*6f9cba8fSJoseph Mingrone		;;
943a0ee43a1SRui Paulo	    IA64)
944*6f9cba8fSJoseph Mingrone		GUESS=ia64-unknown-interix$UNAME_RELEASE
945*6f9cba8fSJoseph Mingrone		;;
946a0ee43a1SRui Paulo	esac ;;
947dc2c7305SBill Fenner    i*:UWIN*:*)
948*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-uwin
949*6f9cba8fSJoseph Mingrone	;;
950a0ee43a1SRui Paulo    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
951*6f9cba8fSJoseph Mingrone	GUESS=x86_64-pc-cygwin
952*6f9cba8fSJoseph Mingrone	;;
9538cf6c252SPaul Traina    prep*:SunOS:5.*:*)
954*6f9cba8fSJoseph Mingrone	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
955*6f9cba8fSJoseph Mingrone	GUESS=powerpcle-unknown-solaris2$SUN_REL
956*6f9cba8fSJoseph Mingrone	;;
9578cf6c252SPaul Traina    *:GNU:*:*)
958feb4ecdbSBruce M Simpson	# the GNU system
959*6f9cba8fSJoseph Mingrone	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
960*6f9cba8fSJoseph Mingrone	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
961*6f9cba8fSJoseph Mingrone	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
962*6f9cba8fSJoseph Mingrone	;;
963feb4ecdbSBruce M Simpson    *:GNU/*:*:*)
964feb4ecdbSBruce M Simpson	# other systems with GNU libc and userland
965*6f9cba8fSJoseph Mingrone	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
966*6f9cba8fSJoseph Mingrone	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
967*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
968*6f9cba8fSJoseph Mingrone	;;
96957e22627SCy Schubert    *:Minix:*:*)
970*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-minix
971*6f9cba8fSJoseph Mingrone	;;
972681ed54cSXin LI    aarch64:Linux:*:*)
973*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
974*6f9cba8fSJoseph Mingrone	;;
975681ed54cSXin LI    aarch64_be:Linux:*:*)
976681ed54cSXin LI	UNAME_MACHINE=aarch64_be
977*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
978*6f9cba8fSJoseph Mingrone	;;
9790a94d38fSBill Fenner    alpha:Linux:*:*)
980*6f9cba8fSJoseph Mingrone	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
981feb4ecdbSBruce M Simpson	  EV5)   UNAME_MACHINE=alphaev5 ;;
982feb4ecdbSBruce M Simpson	  EV56)  UNAME_MACHINE=alphaev56 ;;
983feb4ecdbSBruce M Simpson	  PCA56) UNAME_MACHINE=alphapca56 ;;
984feb4ecdbSBruce M Simpson	  PCA57) UNAME_MACHINE=alphapca56 ;;
985feb4ecdbSBruce M Simpson	  EV6)   UNAME_MACHINE=alphaev6 ;;
986feb4ecdbSBruce M Simpson	  EV67)  UNAME_MACHINE=alphaev67 ;;
987feb4ecdbSBruce M Simpson	  EV68*) UNAME_MACHINE=alphaev68 ;;
988dc2c7305SBill Fenner	esac
989a0ee43a1SRui Paulo	objdump --private-headers /bin/sh | grep -q ld.so.1
99057e22627SCy Schubert	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
991*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
992*6f9cba8fSJoseph Mingrone	;;
993*6f9cba8fSJoseph Mingrone    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
994*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
995*6f9cba8fSJoseph Mingrone	;;
996a0ee43a1SRui Paulo    arm*:Linux:*:*)
997*6f9cba8fSJoseph Mingrone	set_cc_for_build
998a0ee43a1SRui Paulo	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
999a0ee43a1SRui Paulo	    | grep -q __ARM_EABI__
1000a0ee43a1SRui Paulo	then
1001*6f9cba8fSJoseph Mingrone	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1002a0ee43a1SRui Paulo	else
1003681ed54cSXin LI	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
1004681ed54cSXin LI		| grep -q __ARM_PCS_VFP
1005681ed54cSXin LI	    then
1006*6f9cba8fSJoseph Mingrone		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
1007681ed54cSXin LI	    else
1008*6f9cba8fSJoseph Mingrone		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
1009681ed54cSXin LI	    fi
1010a0ee43a1SRui Paulo	fi
1011*6f9cba8fSJoseph Mingrone	;;
1012a0ee43a1SRui Paulo    avr32*:Linux:*:*)
1013*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1014*6f9cba8fSJoseph Mingrone	;;
1015a0ee43a1SRui Paulo    cris:Linux:*:*)
1016*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1017*6f9cba8fSJoseph Mingrone	;;
1018a0ee43a1SRui Paulo    crisv32:Linux:*:*)
1019*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1020*6f9cba8fSJoseph Mingrone	;;
102157e22627SCy Schubert    e2k:Linux:*:*)
1022*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1023*6f9cba8fSJoseph Mingrone	;;
1024a0ee43a1SRui Paulo    frv:Linux:*:*)
1025*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1026*6f9cba8fSJoseph Mingrone	;;
1027681ed54cSXin LI    hexagon:Linux:*:*)
1028*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1029*6f9cba8fSJoseph Mingrone	;;
1030a0ee43a1SRui Paulo    i*86:Linux:*:*)
1031*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
1032*6f9cba8fSJoseph Mingrone	;;
1033a0ee43a1SRui Paulo    ia64:Linux:*:*)
1034*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1035*6f9cba8fSJoseph Mingrone	;;
103657e22627SCy Schubert    k1om:Linux:*:*)
1037*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1038*6f9cba8fSJoseph Mingrone	;;
1039*6f9cba8fSJoseph Mingrone    loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1040*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1041*6f9cba8fSJoseph Mingrone	;;
1042a0ee43a1SRui Paulo    m32r*:Linux:*:*)
1043*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1044*6f9cba8fSJoseph Mingrone	;;
1045a0ee43a1SRui Paulo    m68*:Linux:*:*)
1046*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1047*6f9cba8fSJoseph Mingrone	;;
1048a0ee43a1SRui Paulo    mips:Linux:*:* | mips64:Linux:*:*)
1049*6f9cba8fSJoseph Mingrone	set_cc_for_build
1050*6f9cba8fSJoseph Mingrone	IS_GLIBC=0
1051*6f9cba8fSJoseph Mingrone	test x"${LIBC}" = xgnu && IS_GLIBC=1
105257e22627SCy Schubert	sed 's/^	//' << EOF > "$dummy.c"
1053a0ee43a1SRui Paulo	#undef CPU
1054*6f9cba8fSJoseph Mingrone	#undef mips
1055*6f9cba8fSJoseph Mingrone	#undef mipsel
1056*6f9cba8fSJoseph Mingrone	#undef mips64
1057*6f9cba8fSJoseph Mingrone	#undef mips64el
1058*6f9cba8fSJoseph Mingrone	#if ${IS_GLIBC} && defined(_ABI64)
1059*6f9cba8fSJoseph Mingrone	LIBCABI=gnuabi64
1060*6f9cba8fSJoseph Mingrone	#else
1061*6f9cba8fSJoseph Mingrone	#if ${IS_GLIBC} && defined(_ABIN32)
1062*6f9cba8fSJoseph Mingrone	LIBCABI=gnuabin32
1063*6f9cba8fSJoseph Mingrone	#else
1064*6f9cba8fSJoseph Mingrone	LIBCABI=${LIBC}
1065*6f9cba8fSJoseph Mingrone	#endif
1066*6f9cba8fSJoseph Mingrone	#endif
1067*6f9cba8fSJoseph Mingrone
1068*6f9cba8fSJoseph Mingrone	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1069*6f9cba8fSJoseph Mingrone	CPU=mipsisa64r6
1070*6f9cba8fSJoseph Mingrone	#else
1071*6f9cba8fSJoseph Mingrone	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1072*6f9cba8fSJoseph Mingrone	CPU=mipsisa32r6
1073*6f9cba8fSJoseph Mingrone	#else
1074*6f9cba8fSJoseph Mingrone	#if defined(__mips64)
1075*6f9cba8fSJoseph Mingrone	CPU=mips64
1076*6f9cba8fSJoseph Mingrone	#else
1077*6f9cba8fSJoseph Mingrone	CPU=mips
1078*6f9cba8fSJoseph Mingrone	#endif
1079*6f9cba8fSJoseph Mingrone	#endif
1080*6f9cba8fSJoseph Mingrone	#endif
1081*6f9cba8fSJoseph Mingrone
1082a0ee43a1SRui Paulo	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1083*6f9cba8fSJoseph Mingrone	MIPS_ENDIAN=el
1084a0ee43a1SRui Paulo	#else
1085a0ee43a1SRui Paulo	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1086*6f9cba8fSJoseph Mingrone	MIPS_ENDIAN=
1087a0ee43a1SRui Paulo	#else
1088*6f9cba8fSJoseph Mingrone	MIPS_ENDIAN=
1089a0ee43a1SRui Paulo	#endif
1090a0ee43a1SRui Paulo	#endif
1091a0ee43a1SRui PauloEOF
1092*6f9cba8fSJoseph Mingrone	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
1093*6f9cba8fSJoseph Mingrone	eval "$cc_set_vars"
1094*6f9cba8fSJoseph Mingrone	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1095a0ee43a1SRui Paulo	;;
109657e22627SCy Schubert    mips64el:Linux:*:*)
1097*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1098*6f9cba8fSJoseph Mingrone	;;
1099ada6f083SXin LI    openrisc*:Linux:*:*)
1100*6f9cba8fSJoseph Mingrone	GUESS=or1k-unknown-linux-$LIBC
1101*6f9cba8fSJoseph Mingrone	;;
1102ada6f083SXin LI    or32:Linux:*:* | or1k*:Linux:*:*)
1103*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1104*6f9cba8fSJoseph Mingrone	;;
1105a0ee43a1SRui Paulo    padre:Linux:*:*)
1106*6f9cba8fSJoseph Mingrone	GUESS=sparc-unknown-linux-$LIBC
1107*6f9cba8fSJoseph Mingrone	;;
1108a0ee43a1SRui Paulo    parisc64:Linux:*:* | hppa64:Linux:*:*)
1109*6f9cba8fSJoseph Mingrone	GUESS=hppa64-unknown-linux-$LIBC
1110*6f9cba8fSJoseph Mingrone	;;
11110a94d38fSBill Fenner    parisc:Linux:*:* | hppa:Linux:*:*)
1112dc2c7305SBill Fenner	# Look for CPU level
1113dc2c7305SBill Fenner	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1114*6f9cba8fSJoseph Mingrone	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
1115*6f9cba8fSJoseph Mingrone	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
1116*6f9cba8fSJoseph Mingrone	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
11170a94d38fSBill Fenner	esac
1118*6f9cba8fSJoseph Mingrone	;;
1119a0ee43a1SRui Paulo    ppc64:Linux:*:*)
1120*6f9cba8fSJoseph Mingrone	GUESS=powerpc64-unknown-linux-$LIBC
1121*6f9cba8fSJoseph Mingrone	;;
1122a0ee43a1SRui Paulo    ppc:Linux:*:*)
1123*6f9cba8fSJoseph Mingrone	GUESS=powerpc-unknown-linux-$LIBC
1124*6f9cba8fSJoseph Mingrone	;;
1125ada6f083SXin LI    ppc64le:Linux:*:*)
1126*6f9cba8fSJoseph Mingrone	GUESS=powerpc64le-unknown-linux-$LIBC
1127*6f9cba8fSJoseph Mingrone	;;
1128ada6f083SXin LI    ppcle:Linux:*:*)
1129*6f9cba8fSJoseph Mingrone	GUESS=powerpcle-unknown-linux-$LIBC
1130*6f9cba8fSJoseph Mingrone	;;
1131*6f9cba8fSJoseph Mingrone    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1132*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1133*6f9cba8fSJoseph Mingrone	;;
11340a94d38fSBill Fenner    s390:Linux:*:* | s390x:Linux:*:*)
1135*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
1136*6f9cba8fSJoseph Mingrone	;;
1137feb4ecdbSBruce M Simpson    sh64*:Linux:*:*)
1138*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1139*6f9cba8fSJoseph Mingrone	;;
11400a94d38fSBill Fenner    sh*:Linux:*:*)
1141*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1142*6f9cba8fSJoseph Mingrone	;;
11430a94d38fSBill Fenner    sparc:Linux:*:* | sparc64:Linux:*:*)
1144*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1145*6f9cba8fSJoseph Mingrone	;;
1146681ed54cSXin LI    tile*:Linux:*:*)
1147*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1148*6f9cba8fSJoseph Mingrone	;;
1149a0ee43a1SRui Paulo    vax:Linux:*:*)
1150*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
1151*6f9cba8fSJoseph Mingrone	;;
11520a94d38fSBill Fenner    x86_64:Linux:*:*)
1153*6f9cba8fSJoseph Mingrone	set_cc_for_build
1154*6f9cba8fSJoseph Mingrone	CPU=$UNAME_MACHINE
1155*6f9cba8fSJoseph Mingrone	LIBCABI=$LIBC
1156*6f9cba8fSJoseph Mingrone	if test "$CC_FOR_BUILD" != no_compiler_found; then
1157*6f9cba8fSJoseph Mingrone	    ABI=64
1158*6f9cba8fSJoseph Mingrone	    sed 's/^	    //' << EOF > "$dummy.c"
1159*6f9cba8fSJoseph Mingrone	    #ifdef __i386__
1160*6f9cba8fSJoseph Mingrone	    ABI=x86
1161*6f9cba8fSJoseph Mingrone	    #else
1162*6f9cba8fSJoseph Mingrone	    #ifdef __ILP32__
1163*6f9cba8fSJoseph Mingrone	    ABI=x32
1164*6f9cba8fSJoseph Mingrone	    #endif
1165*6f9cba8fSJoseph Mingrone	    #endif
1166*6f9cba8fSJoseph MingroneEOF
1167*6f9cba8fSJoseph Mingrone	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1168*6f9cba8fSJoseph Mingrone	    eval "$cc_set_abi"
1169*6f9cba8fSJoseph Mingrone	    case $ABI in
1170*6f9cba8fSJoseph Mingrone		x86) CPU=i686 ;;
1171*6f9cba8fSJoseph Mingrone		x32) LIBCABI=${LIBC}x32 ;;
1172*6f9cba8fSJoseph Mingrone	    esac
1173*6f9cba8fSJoseph Mingrone	fi
1174*6f9cba8fSJoseph Mingrone	GUESS=$CPU-pc-linux-$LIBCABI
1175*6f9cba8fSJoseph Mingrone	;;
1176a0ee43a1SRui Paulo    xtensa*:Linux:*:*)
1177*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
1178*6f9cba8fSJoseph Mingrone	;;
11790a94d38fSBill Fenner    i*86:DYNIX/ptx:4*:*)
1180feb4ecdbSBruce M Simpson	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1181feb4ecdbSBruce M Simpson	# earlier versions are messed up and put the nodename in both
1182feb4ecdbSBruce M Simpson	# sysname and nodename.
1183*6f9cba8fSJoseph Mingrone	GUESS=i386-sequent-sysv4
1184*6f9cba8fSJoseph Mingrone	;;
11850a94d38fSBill Fenner    i*86:UNIX_SV:4.2MP:2.*)
1186dc2c7305SBill Fenner	# Unixware is an offshoot of SVR4, but it has its own version
1187dc2c7305SBill Fenner	# number series starting with 2...
1188dc2c7305SBill Fenner	# I am not positive that other SVR4 systems won't match this,
1189dc2c7305SBill Fenner	# I just have to hope.  -- rms.
1190dc2c7305SBill Fenner	# Use sysv4.2uw... so that sysv4* matches it.
1191*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
1192*6f9cba8fSJoseph Mingrone	;;
1193feb4ecdbSBruce M Simpson    i*86:OS/2:*:*)
1194feb4ecdbSBruce M Simpson	# If we were able to find `uname', then EMX Unix compatibility
1195feb4ecdbSBruce M Simpson	# is probably installed.
1196*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-os2-emx
1197*6f9cba8fSJoseph Mingrone	;;
1198feb4ecdbSBruce M Simpson    i*86:XTS-300:*:STOP)
1199*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-stop
1200*6f9cba8fSJoseph Mingrone	;;
1201feb4ecdbSBruce M Simpson    i*86:atheos:*:*)
1202*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-atheos
1203*6f9cba8fSJoseph Mingrone	;;
1204a0ee43a1SRui Paulo    i*86:syllable:*:*)
1205*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-syllable
1206*6f9cba8fSJoseph Mingrone	;;
1207a0ee43a1SRui Paulo    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1208*6f9cba8fSJoseph Mingrone	GUESS=i386-unknown-lynxos$UNAME_RELEASE
1209*6f9cba8fSJoseph Mingrone	;;
1210feb4ecdbSBruce M Simpson    i*86:*DOS:*:*)
1211*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
1212*6f9cba8fSJoseph Mingrone	;;
121357e22627SCy Schubert    i*86:*:4.*:*)
121457e22627SCy Schubert	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
12158cf6c252SPaul Traina	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1216*6f9cba8fSJoseph Mingrone		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
1217dc2c7305SBill Fenner	else
1218*6f9cba8fSJoseph Mingrone		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
1219dc2c7305SBill Fenner	fi
1220*6f9cba8fSJoseph Mingrone	;;
1221a0ee43a1SRui Paulo    i*86:*:5:[678]*)
1222a0ee43a1SRui Paulo	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1223feb4ecdbSBruce M Simpson	case `/bin/uname -X | grep "^Machine"` in
1224feb4ecdbSBruce M Simpson	    *486*)	     UNAME_MACHINE=i486 ;;
1225feb4ecdbSBruce M Simpson	    *Pentium)	     UNAME_MACHINE=i586 ;;
1226feb4ecdbSBruce M Simpson	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1227feb4ecdbSBruce M Simpson	esac
1228*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1229*6f9cba8fSJoseph Mingrone	;;
12300a94d38fSBill Fenner    i*86:*:3.2:*)
12318cf6c252SPaul Traina	if test -f /usr/options/cb.name; then
12328cf6c252SPaul Traina		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1233*6f9cba8fSJoseph Mingrone		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
12348cf6c252SPaul Traina	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1235feb4ecdbSBruce M Simpson		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1236feb4ecdbSBruce M Simpson		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1237feb4ecdbSBruce M Simpson		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
12388cf6c252SPaul Traina			&& UNAME_MACHINE=i586
1239feb4ecdbSBruce M Simpson		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1240dc2c7305SBill Fenner			&& UNAME_MACHINE=i686
1241feb4ecdbSBruce M Simpson		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1242dc2c7305SBill Fenner			&& UNAME_MACHINE=i686
1243*6f9cba8fSJoseph Mingrone		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
12448cf6c252SPaul Traina	else
1245*6f9cba8fSJoseph Mingrone		GUESS=$UNAME_MACHINE-pc-sysv32
12468cf6c252SPaul Traina	fi
1247*6f9cba8fSJoseph Mingrone	;;
1248dc2c7305SBill Fenner    pc:*:*:*)
1249dc2c7305SBill Fenner	# Left here for compatibility:
1250dc2c7305SBill Fenner	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1251a0ee43a1SRui Paulo	# the processor, so we play safe by assuming i586.
1252a0ee43a1SRui Paulo	# Note: whatever this is, it MUST be the same as what config.sub
125357e22627SCy Schubert	# prints for the "djgpp" host, or else GDB configure will decide that
1254a0ee43a1SRui Paulo	# this is a cross-build.
1255*6f9cba8fSJoseph Mingrone	GUESS=i586-pc-msdosdjgpp
1256*6f9cba8fSJoseph Mingrone	;;
12578cf6c252SPaul Traina    Intel:Mach:3*:*)
1258*6f9cba8fSJoseph Mingrone	GUESS=i386-pc-mach3
1259*6f9cba8fSJoseph Mingrone	;;
12608cf6c252SPaul Traina    paragon:*:*:*)
1261*6f9cba8fSJoseph Mingrone	GUESS=i860-intel-osf1
1262*6f9cba8fSJoseph Mingrone	;;
12638cf6c252SPaul Traina    i860:*:4.*:*) # i860-SVR4
12648cf6c252SPaul Traina	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1265*6f9cba8fSJoseph Mingrone	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
12668cf6c252SPaul Traina	else # Add other i860-SVR4 vendors below as they are discovered.
1267*6f9cba8fSJoseph Mingrone	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
12688cf6c252SPaul Traina	fi
1269*6f9cba8fSJoseph Mingrone	;;
12708cf6c252SPaul Traina    mini*:CTIX:SYS*5:*)
12718cf6c252SPaul Traina	# "miniframe"
1272*6f9cba8fSJoseph Mingrone	GUESS=m68010-convergent-sysv
1273*6f9cba8fSJoseph Mingrone	;;
1274feb4ecdbSBruce M Simpson    mc68k:UNIX:SYSTEM5:3.51m)
1275*6f9cba8fSJoseph Mingrone	GUESS=m68k-convergent-sysv
1276*6f9cba8fSJoseph Mingrone	;;
1277feb4ecdbSBruce M Simpson    M680?0:D-NIX:5.3:*)
1278*6f9cba8fSJoseph Mingrone	GUESS=m68k-diab-dnix
1279*6f9cba8fSJoseph Mingrone	;;
1280a0ee43a1SRui Paulo    M68*:*:R3V[5678]*:*)
1281a0ee43a1SRui Paulo	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1282a0ee43a1SRui Paulo    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)
12833052b236SBill Fenner	OS_REL=''
12843052b236SBill Fenner	test -r /etc/.relid \
12853052b236SBill Fenner	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
12863052b236SBill Fenner	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
128757e22627SCy Schubert	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
12883052b236SBill Fenner	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
128957e22627SCy Schubert	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
12908cf6c252SPaul Traina    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
12913052b236SBill Fenner	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1292a0ee43a1SRui Paulo	  && { echo i486-ncr-sysv4; exit; } ;;
1293a0ee43a1SRui Paulo    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1294a0ee43a1SRui Paulo	OS_REL='.3'
1295a0ee43a1SRui Paulo	test -r /etc/.relid \
1296a0ee43a1SRui Paulo	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1297a0ee43a1SRui Paulo	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
129857e22627SCy Schubert	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1299a0ee43a1SRui Paulo	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
130057e22627SCy Schubert	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1301a0ee43a1SRui Paulo	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
130257e22627SCy Schubert	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
13030a94d38fSBill Fenner    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1304*6f9cba8fSJoseph Mingrone	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
1305*6f9cba8fSJoseph Mingrone	;;
13068cf6c252SPaul Traina    mc68030:UNIX_System_V:4.*:*)
1307*6f9cba8fSJoseph Mingrone	GUESS=m68k-atari-sysv4
1308*6f9cba8fSJoseph Mingrone	;;
13093052b236SBill Fenner    TSUNAMI:LynxOS:2.*:*)
1310*6f9cba8fSJoseph Mingrone	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
1311*6f9cba8fSJoseph Mingrone	;;
13120a94d38fSBill Fenner    rs6000:LynxOS:2.*:*)
1313*6f9cba8fSJoseph Mingrone	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
1314*6f9cba8fSJoseph Mingrone	;;
1315a0ee43a1SRui Paulo    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1316*6f9cba8fSJoseph Mingrone	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
1317*6f9cba8fSJoseph Mingrone	;;
13183052b236SBill Fenner    SM[BE]S:UNIX_SV:*:*)
1319*6f9cba8fSJoseph Mingrone	GUESS=mips-dde-sysv$UNAME_RELEASE
1320*6f9cba8fSJoseph Mingrone	;;
1321dc2c7305SBill Fenner    RM*:ReliantUNIX-*:*:*)
1322*6f9cba8fSJoseph Mingrone	GUESS=mips-sni-sysv4
1323*6f9cba8fSJoseph Mingrone	;;
13248cf6c252SPaul Traina    RM*:SINIX-*:*:*)
1325*6f9cba8fSJoseph Mingrone	GUESS=mips-sni-sysv4
1326*6f9cba8fSJoseph Mingrone	;;
13278cf6c252SPaul Traina    *:SINIX-*:*:*)
13288cf6c252SPaul Traina	if uname -p 2>/dev/null >/dev/null ; then
13298cf6c252SPaul Traina		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1330*6f9cba8fSJoseph Mingrone		GUESS=$UNAME_MACHINE-sni-sysv4
13318cf6c252SPaul Traina	else
1332*6f9cba8fSJoseph Mingrone		GUESS=ns32k-sni-sysv
13338cf6c252SPaul Traina	fi
1334*6f9cba8fSJoseph Mingrone	;;
1335feb4ecdbSBruce M Simpson    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1336dc2c7305SBill Fenner			# says <Richard.M.Bartel@ccMail.Census.GOV>
1337*6f9cba8fSJoseph Mingrone	GUESS=i586-unisys-sysv4
1338*6f9cba8fSJoseph Mingrone	;;
13393052b236SBill Fenner    *:UNIX_System_V:4*:FTX*)
13403052b236SBill Fenner	# From Gerald Hewes <hewes@openmarket.com>.
13413052b236SBill Fenner	# How about differentiating between stratus architectures? -djm
1342*6f9cba8fSJoseph Mingrone	GUESS=hppa1.1-stratus-sysv4
1343*6f9cba8fSJoseph Mingrone	;;
13443052b236SBill Fenner    *:*:*:FTX*)
13453052b236SBill Fenner	# From seanf@swdc.stratus.com.
1346*6f9cba8fSJoseph Mingrone	GUESS=i860-stratus-sysv4
1347*6f9cba8fSJoseph Mingrone	;;
1348a0ee43a1SRui Paulo    i*86:VOS:*:*)
1349a0ee43a1SRui Paulo	# From Paul.Green@stratus.com.
1350*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-stratus-vos
1351*6f9cba8fSJoseph Mingrone	;;
1352feb4ecdbSBruce M Simpson    *:VOS:*:*)
1353feb4ecdbSBruce M Simpson	# From Paul.Green@stratus.com.
1354*6f9cba8fSJoseph Mingrone	GUESS=hppa1.1-stratus-vos
1355*6f9cba8fSJoseph Mingrone	;;
13568cf6c252SPaul Traina    mc68*:A/UX:*:*)
1357*6f9cba8fSJoseph Mingrone	GUESS=m68k-apple-aux$UNAME_RELEASE
1358*6f9cba8fSJoseph Mingrone	;;
1359dc2c7305SBill Fenner    news*:NEWS-OS:6*:*)
1360*6f9cba8fSJoseph Mingrone	GUESS=mips-sony-newsos6
1361*6f9cba8fSJoseph Mingrone	;;
1362dc2c7305SBill Fenner    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1363*6f9cba8fSJoseph Mingrone	if test -d /usr/nec; then
1364*6f9cba8fSJoseph Mingrone		GUESS=mips-nec-sysv$UNAME_RELEASE
13658cf6c252SPaul Traina	else
1366*6f9cba8fSJoseph Mingrone		GUESS=mips-unknown-sysv$UNAME_RELEASE
13678cf6c252SPaul Traina	fi
1368*6f9cba8fSJoseph Mingrone	;;
1369dc2c7305SBill Fenner    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1370*6f9cba8fSJoseph Mingrone	GUESS=powerpc-be-beos
1371*6f9cba8fSJoseph Mingrone	;;
1372dc2c7305SBill Fenner    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1373*6f9cba8fSJoseph Mingrone	GUESS=powerpc-apple-beos
1374*6f9cba8fSJoseph Mingrone	;;
1375dc2c7305SBill Fenner    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1376*6f9cba8fSJoseph Mingrone	GUESS=i586-pc-beos
1377*6f9cba8fSJoseph Mingrone	;;
1378a0ee43a1SRui Paulo    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1379*6f9cba8fSJoseph Mingrone	GUESS=i586-pc-haiku
1380*6f9cba8fSJoseph Mingrone	;;
1381*6f9cba8fSJoseph Mingrone    ppc:Haiku:*:*)	# Haiku running on Apple PowerPC
1382*6f9cba8fSJoseph Mingrone	GUESS=powerpc-apple-haiku
1383*6f9cba8fSJoseph Mingrone	;;
1384*6f9cba8fSJoseph Mingrone    *:Haiku:*:*)	# Haiku modern gcc (not bound by BeOS compat)
1385*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-haiku
1386*6f9cba8fSJoseph Mingrone	;;
1387dc2c7305SBill Fenner    SX-4:SUPER-UX:*:*)
1388*6f9cba8fSJoseph Mingrone	GUESS=sx4-nec-superux$UNAME_RELEASE
1389*6f9cba8fSJoseph Mingrone	;;
1390dc2c7305SBill Fenner    SX-5:SUPER-UX:*:*)
1391*6f9cba8fSJoseph Mingrone	GUESS=sx5-nec-superux$UNAME_RELEASE
1392*6f9cba8fSJoseph Mingrone	;;
1393feb4ecdbSBruce M Simpson    SX-6:SUPER-UX:*:*)
1394*6f9cba8fSJoseph Mingrone	GUESS=sx6-nec-superux$UNAME_RELEASE
1395*6f9cba8fSJoseph Mingrone	;;
1396a0ee43a1SRui Paulo    SX-7:SUPER-UX:*:*)
1397*6f9cba8fSJoseph Mingrone	GUESS=sx7-nec-superux$UNAME_RELEASE
1398*6f9cba8fSJoseph Mingrone	;;
1399a0ee43a1SRui Paulo    SX-8:SUPER-UX:*:*)
1400*6f9cba8fSJoseph Mingrone	GUESS=sx8-nec-superux$UNAME_RELEASE
1401*6f9cba8fSJoseph Mingrone	;;
1402a0ee43a1SRui Paulo    SX-8R:SUPER-UX:*:*)
1403*6f9cba8fSJoseph Mingrone	GUESS=sx8r-nec-superux$UNAME_RELEASE
1404*6f9cba8fSJoseph Mingrone	;;
140557e22627SCy Schubert    SX-ACE:SUPER-UX:*:*)
1406*6f9cba8fSJoseph Mingrone	GUESS=sxace-nec-superux$UNAME_RELEASE
1407*6f9cba8fSJoseph Mingrone	;;
1408dc2c7305SBill Fenner    Power*:Rhapsody:*:*)
1409*6f9cba8fSJoseph Mingrone	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
1410*6f9cba8fSJoseph Mingrone	;;
1411dc2c7305SBill Fenner    *:Rhapsody:*:*)
1412*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
1413*6f9cba8fSJoseph Mingrone	;;
1414*6f9cba8fSJoseph Mingrone    arm64:Darwin:*:*)
1415*6f9cba8fSJoseph Mingrone	GUESS=aarch64-apple-darwin$UNAME_RELEASE
1416*6f9cba8fSJoseph Mingrone	;;
1417dc2c7305SBill Fenner    *:Darwin:*:*)
1418*6f9cba8fSJoseph Mingrone	UNAME_PROCESSOR=`uname -p`
1419*6f9cba8fSJoseph Mingrone	case $UNAME_PROCESSOR in
1420*6f9cba8fSJoseph Mingrone	    unknown) UNAME_PROCESSOR=powerpc ;;
1421*6f9cba8fSJoseph Mingrone	esac
1422*6f9cba8fSJoseph Mingrone	if command -v xcode-select > /dev/null 2> /dev/null && \
1423*6f9cba8fSJoseph Mingrone		! xcode-select --print-path > /dev/null 2> /dev/null ; then
1424*6f9cba8fSJoseph Mingrone	    # Avoid executing cc if there is no toolchain installed as
1425*6f9cba8fSJoseph Mingrone	    # cc will be a stub that puts up a graphical alert
1426*6f9cba8fSJoseph Mingrone	    # prompting the user to install developer tools.
1427*6f9cba8fSJoseph Mingrone	    CC_FOR_BUILD=no_compiler_found
1428*6f9cba8fSJoseph Mingrone	else
1429*6f9cba8fSJoseph Mingrone	    set_cc_for_build
1430ada6f083SXin LI	fi
1431*6f9cba8fSJoseph Mingrone	if test "$CC_FOR_BUILD" != no_compiler_found; then
1432a0ee43a1SRui Paulo	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
143357e22627SCy Schubert		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1434a0ee43a1SRui Paulo		   grep IS_64BIT_ARCH >/dev/null
1435a0ee43a1SRui Paulo	    then
1436ada6f083SXin LI		case $UNAME_PROCESSOR in
1437ada6f083SXin LI		    i386) UNAME_PROCESSOR=x86_64 ;;
1438ada6f083SXin LI		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1439feb4ecdbSBruce M Simpson		esac
1440ada6f083SXin LI	    fi
144157e22627SCy Schubert	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
144257e22627SCy Schubert	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
144357e22627SCy Schubert		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
144457e22627SCy Schubert		   grep IS_PPC >/dev/null
144557e22627SCy Schubert	    then
144657e22627SCy Schubert		UNAME_PROCESSOR=powerpc
144757e22627SCy Schubert	    fi
1448ada6f083SXin LI	elif test "$UNAME_PROCESSOR" = i386 ; then
1449*6f9cba8fSJoseph Mingrone	    # uname -m returns i386 or x86_64
1450*6f9cba8fSJoseph Mingrone	    UNAME_PROCESSOR=$UNAME_MACHINE
1451ada6f083SXin LI	fi
1452*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
1453*6f9cba8fSJoseph Mingrone	;;
1454dc2c7305SBill Fenner    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1455feb4ecdbSBruce M Simpson	UNAME_PROCESSOR=`uname -p`
145657e22627SCy Schubert	if test "$UNAME_PROCESSOR" = x86; then
1457feb4ecdbSBruce M Simpson		UNAME_PROCESSOR=i386
1458dc2c7305SBill Fenner		UNAME_MACHINE=pc
1459dc2c7305SBill Fenner	fi
1460*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
1461*6f9cba8fSJoseph Mingrone	;;
1462dc2c7305SBill Fenner    *:QNX:*:4*)
1463*6f9cba8fSJoseph Mingrone	GUESS=i386-pc-qnx
1464*6f9cba8fSJoseph Mingrone	;;
146557e22627SCy Schubert    NEO-*:NONSTOP_KERNEL:*:*)
1466*6f9cba8fSJoseph Mingrone	GUESS=neo-tandem-nsk$UNAME_RELEASE
1467*6f9cba8fSJoseph Mingrone	;;
1468ada6f083SXin LI    NSE-*:NONSTOP_KERNEL:*:*)
1469*6f9cba8fSJoseph Mingrone	GUESS=nse-tandem-nsk$UNAME_RELEASE
1470*6f9cba8fSJoseph Mingrone	;;
147157e22627SCy Schubert    NSR-*:NONSTOP_KERNEL:*:*)
1472*6f9cba8fSJoseph Mingrone	GUESS=nsr-tandem-nsk$UNAME_RELEASE
1473*6f9cba8fSJoseph Mingrone	;;
147457e22627SCy Schubert    NSV-*:NONSTOP_KERNEL:*:*)
1475*6f9cba8fSJoseph Mingrone	GUESS=nsv-tandem-nsk$UNAME_RELEASE
1476*6f9cba8fSJoseph Mingrone	;;
147757e22627SCy Schubert    NSX-*:NONSTOP_KERNEL:*:*)
1478*6f9cba8fSJoseph Mingrone	GUESS=nsx-tandem-nsk$UNAME_RELEASE
1479*6f9cba8fSJoseph Mingrone	;;
1480dc2c7305SBill Fenner    *:NonStop-UX:*:*)
1481*6f9cba8fSJoseph Mingrone	GUESS=mips-compaq-nonstopux
1482*6f9cba8fSJoseph Mingrone	;;
1483dc2c7305SBill Fenner    BS2000:POSIX*:*:*)
1484*6f9cba8fSJoseph Mingrone	GUESS=bs2000-siemens-sysv
1485*6f9cba8fSJoseph Mingrone	;;
1486dc2c7305SBill Fenner    DS/*:UNIX_System_V:*:*)
1487*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
1488*6f9cba8fSJoseph Mingrone	;;
1489dc2c7305SBill Fenner    *:Plan9:*:*)
1490dc2c7305SBill Fenner	# "uname -m" is not consistent, so use $cputype instead. 386
1491dc2c7305SBill Fenner	# is converted to i386 for consistency with other x86
1492dc2c7305SBill Fenner	# operating systems.
1493*6f9cba8fSJoseph Mingrone	if test "${cputype-}" = 386; then
1494dc2c7305SBill Fenner	    UNAME_MACHINE=i386
1495*6f9cba8fSJoseph Mingrone	elif test "x${cputype-}" != x; then
1496*6f9cba8fSJoseph Mingrone	    UNAME_MACHINE=$cputype
1497dc2c7305SBill Fenner	fi
1498*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-plan9
1499*6f9cba8fSJoseph Mingrone	;;
15000a94d38fSBill Fenner    *:TOPS-10:*:*)
1501*6f9cba8fSJoseph Mingrone	GUESS=pdp10-unknown-tops10
1502*6f9cba8fSJoseph Mingrone	;;
15030a94d38fSBill Fenner    *:TENEX:*:*)
1504*6f9cba8fSJoseph Mingrone	GUESS=pdp10-unknown-tenex
1505*6f9cba8fSJoseph Mingrone	;;
15060a94d38fSBill Fenner    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1507*6f9cba8fSJoseph Mingrone	GUESS=pdp10-dec-tops20
1508*6f9cba8fSJoseph Mingrone	;;
15090a94d38fSBill Fenner    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1510*6f9cba8fSJoseph Mingrone	GUESS=pdp10-xkl-tops20
1511*6f9cba8fSJoseph Mingrone	;;
15120a94d38fSBill Fenner    *:TOPS-20:*:*)
1513*6f9cba8fSJoseph Mingrone	GUESS=pdp10-unknown-tops20
1514*6f9cba8fSJoseph Mingrone	;;
15150a94d38fSBill Fenner    *:ITS:*:*)
1516*6f9cba8fSJoseph Mingrone	GUESS=pdp10-unknown-its
1517*6f9cba8fSJoseph Mingrone	;;
1518feb4ecdbSBruce M Simpson    SEI:*:*:SEIUX)
1519*6f9cba8fSJoseph Mingrone	GUESS=mips-sei-seiux$UNAME_RELEASE
1520*6f9cba8fSJoseph Mingrone	;;
1521a0ee43a1SRui Paulo    *:DragonFly:*:*)
1522*6f9cba8fSJoseph Mingrone	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
1523*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
1524*6f9cba8fSJoseph Mingrone	;;
1525a0ee43a1SRui Paulo    *:*VMS:*:*)
1526a0ee43a1SRui Paulo	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1527*6f9cba8fSJoseph Mingrone	case $UNAME_MACHINE in
1528*6f9cba8fSJoseph Mingrone	    A*) GUESS=alpha-dec-vms ;;
1529*6f9cba8fSJoseph Mingrone	    I*) GUESS=ia64-dec-vms ;;
1530*6f9cba8fSJoseph Mingrone	    V*) GUESS=vax-dec-vms ;;
1531a0ee43a1SRui Paulo	esac ;;
1532a0ee43a1SRui Paulo    *:XENIX:*:SysV)
1533*6f9cba8fSJoseph Mingrone	GUESS=i386-pc-xenix
1534*6f9cba8fSJoseph Mingrone	;;
1535a0ee43a1SRui Paulo    i*86:skyos:*:*)
1536*6f9cba8fSJoseph Mingrone	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
1537*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
1538*6f9cba8fSJoseph Mingrone	;;
1539a0ee43a1SRui Paulo    i*86:rdos:*:*)
1540*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-rdos
1541*6f9cba8fSJoseph Mingrone	;;
1542*6f9cba8fSJoseph Mingrone    i*86:Fiwix:*:*)
1543*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-pc-fiwix
1544*6f9cba8fSJoseph Mingrone	;;
1545*6f9cba8fSJoseph Mingrone    *:AROS:*:*)
1546*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-aros
1547*6f9cba8fSJoseph Mingrone	;;
1548681ed54cSXin LI    x86_64:VMkernel:*:*)
1549*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-esx
1550*6f9cba8fSJoseph Mingrone	;;
155157e22627SCy Schubert    amd64:Isilon\ OneFS:*:*)
1552*6f9cba8fSJoseph Mingrone	GUESS=x86_64-unknown-onefs
1553*6f9cba8fSJoseph Mingrone	;;
1554*6f9cba8fSJoseph Mingrone    *:Unleashed:*:*)
1555*6f9cba8fSJoseph Mingrone	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
1556*6f9cba8fSJoseph Mingrone	;;
15578cf6c252SPaul Trainaesac
15588cf6c252SPaul Traina
1559*6f9cba8fSJoseph Mingrone# Do we have a guess based on uname results?
1560*6f9cba8fSJoseph Mingroneif test "x$GUESS" != x; then
1561*6f9cba8fSJoseph Mingrone    echo "$GUESS"
1562*6f9cba8fSJoseph Mingrone    exit
1563*6f9cba8fSJoseph Mingronefi
1564*6f9cba8fSJoseph Mingrone
1565*6f9cba8fSJoseph Mingrone# No uname command or uname output not recognized.
1566*6f9cba8fSJoseph Mingroneset_cc_for_build
1567*6f9cba8fSJoseph Mingronecat > "$dummy.c" <<EOF
1568*6f9cba8fSJoseph Mingrone#ifdef _SEQUENT_
1569*6f9cba8fSJoseph Mingrone#include <sys/types.h>
1570*6f9cba8fSJoseph Mingrone#include <sys/utsname.h>
1571*6f9cba8fSJoseph Mingrone#endif
1572*6f9cba8fSJoseph Mingrone#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1573*6f9cba8fSJoseph Mingrone#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1574*6f9cba8fSJoseph Mingrone#include <signal.h>
1575*6f9cba8fSJoseph Mingrone#if defined(_SIZE_T_) || defined(SIGLOST)
1576*6f9cba8fSJoseph Mingrone#include <sys/utsname.h>
1577*6f9cba8fSJoseph Mingrone#endif
1578*6f9cba8fSJoseph Mingrone#endif
1579*6f9cba8fSJoseph Mingrone#endif
1580*6f9cba8fSJoseph Mingronemain ()
1581*6f9cba8fSJoseph Mingrone{
1582*6f9cba8fSJoseph Mingrone#if defined (sony)
1583*6f9cba8fSJoseph Mingrone#if defined (MIPSEB)
1584*6f9cba8fSJoseph Mingrone  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1585*6f9cba8fSJoseph Mingrone     I don't know....  */
1586*6f9cba8fSJoseph Mingrone  printf ("mips-sony-bsd\n"); exit (0);
1587*6f9cba8fSJoseph Mingrone#else
1588*6f9cba8fSJoseph Mingrone#include <sys/param.h>
1589*6f9cba8fSJoseph Mingrone  printf ("m68k-sony-newsos%s\n",
1590*6f9cba8fSJoseph Mingrone#ifdef NEWSOS4
1591*6f9cba8fSJoseph Mingrone  "4"
1592*6f9cba8fSJoseph Mingrone#else
1593*6f9cba8fSJoseph Mingrone  ""
1594*6f9cba8fSJoseph Mingrone#endif
1595*6f9cba8fSJoseph Mingrone  ); exit (0);
1596*6f9cba8fSJoseph Mingrone#endif
1597*6f9cba8fSJoseph Mingrone#endif
1598*6f9cba8fSJoseph Mingrone
1599*6f9cba8fSJoseph Mingrone#if defined (NeXT)
1600*6f9cba8fSJoseph Mingrone#if !defined (__ARCHITECTURE__)
1601*6f9cba8fSJoseph Mingrone#define __ARCHITECTURE__ "m68k"
1602*6f9cba8fSJoseph Mingrone#endif
1603*6f9cba8fSJoseph Mingrone  int version;
1604*6f9cba8fSJoseph Mingrone  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1605*6f9cba8fSJoseph Mingrone  if (version < 4)
1606*6f9cba8fSJoseph Mingrone    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1607*6f9cba8fSJoseph Mingrone  else
1608*6f9cba8fSJoseph Mingrone    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1609*6f9cba8fSJoseph Mingrone  exit (0);
1610*6f9cba8fSJoseph Mingrone#endif
1611*6f9cba8fSJoseph Mingrone
1612*6f9cba8fSJoseph Mingrone#if defined (MULTIMAX) || defined (n16)
1613*6f9cba8fSJoseph Mingrone#if defined (UMAXV)
1614*6f9cba8fSJoseph Mingrone  printf ("ns32k-encore-sysv\n"); exit (0);
1615*6f9cba8fSJoseph Mingrone#else
1616*6f9cba8fSJoseph Mingrone#if defined (CMU)
1617*6f9cba8fSJoseph Mingrone  printf ("ns32k-encore-mach\n"); exit (0);
1618*6f9cba8fSJoseph Mingrone#else
1619*6f9cba8fSJoseph Mingrone  printf ("ns32k-encore-bsd\n"); exit (0);
1620*6f9cba8fSJoseph Mingrone#endif
1621*6f9cba8fSJoseph Mingrone#endif
1622*6f9cba8fSJoseph Mingrone#endif
1623*6f9cba8fSJoseph Mingrone
1624*6f9cba8fSJoseph Mingrone#if defined (__386BSD__)
1625*6f9cba8fSJoseph Mingrone  printf ("i386-pc-bsd\n"); exit (0);
1626*6f9cba8fSJoseph Mingrone#endif
1627*6f9cba8fSJoseph Mingrone
1628*6f9cba8fSJoseph Mingrone#if defined (sequent)
1629*6f9cba8fSJoseph Mingrone#if defined (i386)
1630*6f9cba8fSJoseph Mingrone  printf ("i386-sequent-dynix\n"); exit (0);
1631*6f9cba8fSJoseph Mingrone#endif
1632*6f9cba8fSJoseph Mingrone#if defined (ns32000)
1633*6f9cba8fSJoseph Mingrone  printf ("ns32k-sequent-dynix\n"); exit (0);
1634*6f9cba8fSJoseph Mingrone#endif
1635*6f9cba8fSJoseph Mingrone#endif
1636*6f9cba8fSJoseph Mingrone
1637*6f9cba8fSJoseph Mingrone#if defined (_SEQUENT_)
1638*6f9cba8fSJoseph Mingrone  struct utsname un;
1639*6f9cba8fSJoseph Mingrone
1640*6f9cba8fSJoseph Mingrone  uname(&un);
1641*6f9cba8fSJoseph Mingrone  if (strncmp(un.version, "V2", 2) == 0) {
1642*6f9cba8fSJoseph Mingrone    printf ("i386-sequent-ptx2\n"); exit (0);
1643*6f9cba8fSJoseph Mingrone  }
1644*6f9cba8fSJoseph Mingrone  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1645*6f9cba8fSJoseph Mingrone    printf ("i386-sequent-ptx1\n"); exit (0);
1646*6f9cba8fSJoseph Mingrone  }
1647*6f9cba8fSJoseph Mingrone  printf ("i386-sequent-ptx\n"); exit (0);
1648*6f9cba8fSJoseph Mingrone#endif
1649*6f9cba8fSJoseph Mingrone
1650*6f9cba8fSJoseph Mingrone#if defined (vax)
1651*6f9cba8fSJoseph Mingrone#if !defined (ultrix)
1652*6f9cba8fSJoseph Mingrone#include <sys/param.h>
1653*6f9cba8fSJoseph Mingrone#if defined (BSD)
1654*6f9cba8fSJoseph Mingrone#if BSD == 43
1655*6f9cba8fSJoseph Mingrone  printf ("vax-dec-bsd4.3\n"); exit (0);
1656*6f9cba8fSJoseph Mingrone#else
1657*6f9cba8fSJoseph Mingrone#if BSD == 199006
1658*6f9cba8fSJoseph Mingrone  printf ("vax-dec-bsd4.3reno\n"); exit (0);
1659*6f9cba8fSJoseph Mingrone#else
1660*6f9cba8fSJoseph Mingrone  printf ("vax-dec-bsd\n"); exit (0);
1661*6f9cba8fSJoseph Mingrone#endif
1662*6f9cba8fSJoseph Mingrone#endif
1663*6f9cba8fSJoseph Mingrone#else
1664*6f9cba8fSJoseph Mingrone  printf ("vax-dec-bsd\n"); exit (0);
1665*6f9cba8fSJoseph Mingrone#endif
1666*6f9cba8fSJoseph Mingrone#else
1667*6f9cba8fSJoseph Mingrone#if defined(_SIZE_T_) || defined(SIGLOST)
1668*6f9cba8fSJoseph Mingrone  struct utsname un;
1669*6f9cba8fSJoseph Mingrone  uname (&un);
1670*6f9cba8fSJoseph Mingrone  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1671*6f9cba8fSJoseph Mingrone#else
1672*6f9cba8fSJoseph Mingrone  printf ("vax-dec-ultrix\n"); exit (0);
1673*6f9cba8fSJoseph Mingrone#endif
1674*6f9cba8fSJoseph Mingrone#endif
1675*6f9cba8fSJoseph Mingrone#endif
1676*6f9cba8fSJoseph Mingrone#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1677*6f9cba8fSJoseph Mingrone#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1678*6f9cba8fSJoseph Mingrone#if defined(_SIZE_T_) || defined(SIGLOST)
1679*6f9cba8fSJoseph Mingrone  struct utsname *un;
1680*6f9cba8fSJoseph Mingrone  uname (&un);
1681*6f9cba8fSJoseph Mingrone  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1682*6f9cba8fSJoseph Mingrone#else
1683*6f9cba8fSJoseph Mingrone  printf ("mips-dec-ultrix\n"); exit (0);
1684*6f9cba8fSJoseph Mingrone#endif
1685*6f9cba8fSJoseph Mingrone#endif
1686*6f9cba8fSJoseph Mingrone#endif
1687*6f9cba8fSJoseph Mingrone
1688*6f9cba8fSJoseph Mingrone#if defined (alliant) && defined (i860)
1689*6f9cba8fSJoseph Mingrone  printf ("i860-alliant-bsd\n"); exit (0);
1690*6f9cba8fSJoseph Mingrone#endif
1691*6f9cba8fSJoseph Mingrone
1692*6f9cba8fSJoseph Mingrone  exit (1);
1693*6f9cba8fSJoseph Mingrone}
1694*6f9cba8fSJoseph MingroneEOF
1695*6f9cba8fSJoseph Mingrone
1696*6f9cba8fSJoseph Mingrone$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
1697*6f9cba8fSJoseph Mingrone	{ echo "$SYSTEM_NAME"; exit; }
1698*6f9cba8fSJoseph Mingrone
1699*6f9cba8fSJoseph Mingrone# Apollos put the system type in the environment.
1700*6f9cba8fSJoseph Mingronetest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1701*6f9cba8fSJoseph Mingrone
170257e22627SCy Schubertecho "$0: unable to guess system type" >&2
170357e22627SCy Schubert
1704*6f9cba8fSJoseph Mingronecase $UNAME_MACHINE:$UNAME_SYSTEM in
170557e22627SCy Schubert    mips:Linux | mips64:Linux)
170657e22627SCy Schubert	# If we got here on MIPS GNU/Linux, output extra information.
1707dc2c7305SBill Fenner	cat >&2 <<EOF
1708dc2c7305SBill Fenner
170957e22627SCy SchubertNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
171057e22627SCy Schubertthe system type. Please install a C compiler and try again.
171157e22627SCy SchubertEOF
171257e22627SCy Schubert	;;
171357e22627SCy Schubertesac
1714dc2c7305SBill Fenner
171557e22627SCy Schubertcat >&2 <<EOF
171657e22627SCy Schubert
171757e22627SCy SchubertThis script (version $timestamp), has failed to recognize the
171857e22627SCy Schubertoperating system you are using. If your script is old, overwrite *all*
171957e22627SCy Schubertcopies of config.guess and config.sub with the latest versions from:
172057e22627SCy Schubert
1721*6f9cba8fSJoseph Mingrone  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
1722a0ee43a1SRui Pauloand
1723*6f9cba8fSJoseph Mingrone  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1724*6f9cba8fSJoseph MingroneEOF
1725*6f9cba8fSJoseph Mingrone
1726*6f9cba8fSJoseph Mingroneour_year=`echo $timestamp | sed 's,-.*,,'`
1727*6f9cba8fSJoseph Mingronethisyear=`date +%Y`
1728*6f9cba8fSJoseph Mingrone# shellcheck disable=SC2003
1729*6f9cba8fSJoseph Mingronescript_age=`expr "$thisyear" - "$our_year"`
1730*6f9cba8fSJoseph Mingroneif test "$script_age" -lt 3 ; then
1731*6f9cba8fSJoseph Mingrone   cat >&2 <<EOF
1732dc2c7305SBill Fenner
173357e22627SCy SchubertIf $0 has already been updated, send the following data and any
173457e22627SCy Schubertinformation you think might be pertinent to config-patches@gnu.org to
173557e22627SCy Schubertprovide the necessary information to handle your system.
1736dc2c7305SBill Fenner
17370a94d38fSBill Fennerconfig.guess timestamp = $timestamp
1738dc2c7305SBill Fenner
1739dc2c7305SBill Fenneruname -m = `(uname -m) 2>/dev/null || echo unknown`
1740dc2c7305SBill Fenneruname -r = `(uname -r) 2>/dev/null || echo unknown`
1741dc2c7305SBill Fenneruname -s = `(uname -s) 2>/dev/null || echo unknown`
1742dc2c7305SBill Fenneruname -v = `(uname -v) 2>/dev/null || echo unknown`
1743dc2c7305SBill Fenner
1744dc2c7305SBill Fenner/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1745dc2c7305SBill Fenner/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1746dc2c7305SBill Fenner
1747dc2c7305SBill Fennerhostinfo               = `(hostinfo) 2>/dev/null`
1748dc2c7305SBill Fenner/bin/universe          = `(/bin/universe) 2>/dev/null`
1749dc2c7305SBill Fenner/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1750dc2c7305SBill Fenner/bin/arch              = `(/bin/arch) 2>/dev/null`
1751dc2c7305SBill Fenner/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1752dc2c7305SBill Fenner/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1753dc2c7305SBill Fenner
175457e22627SCy SchubertUNAME_MACHINE = "$UNAME_MACHINE"
175557e22627SCy SchubertUNAME_RELEASE = "$UNAME_RELEASE"
175657e22627SCy SchubertUNAME_SYSTEM  = "$UNAME_SYSTEM"
175757e22627SCy SchubertUNAME_VERSION = "$UNAME_VERSION"
1758dc2c7305SBill FennerEOF
1759*6f9cba8fSJoseph Mingronefi
17608cf6c252SPaul Traina
17618cf6c252SPaul Trainaexit 1
1762dc2c7305SBill Fenner
1763dc2c7305SBill Fenner# Local variables:
176457e22627SCy Schubert# eval: (add-hook 'before-save-hook 'time-stamp)
1765dc2c7305SBill Fenner# time-stamp-start: "timestamp='"
1766dc2c7305SBill Fenner# time-stamp-format: "%:y-%02m-%02d"
1767dc2c7305SBill Fenner# time-stamp-end: "'"
1768dc2c7305SBill Fenner# End:
1769