config.guess revision 3458e6c2
12c7c4e3dSmrg#! /bin/sh
22c7c4e3dSmrg# Attempt to guess a canonical system name.
33458e6c2Smrg#   Copyright 1992-2021 Free Software Foundation, Inc.
42c7c4e3dSmrg
53458e6c2Smrg# shellcheck disable=SC2006,SC2268 # see below for rationale
63458e6c2Smrg
73458e6c2Smrgtimestamp='2021-06-03'
82c7c4e3dSmrg
92c7c4e3dSmrg# This file is free software; you can redistribute it and/or modify it
102c7c4e3dSmrg# under the terms of the GNU General Public License as published by
112becc446Smrg# the Free Software Foundation; either version 3 of the License, or
122c7c4e3dSmrg# (at your option) any later version.
132c7c4e3dSmrg#
142c7c4e3dSmrg# This program is distributed in the hope that it will be useful, but
152c7c4e3dSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
162c7c4e3dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
172c7c4e3dSmrg# General Public License for more details.
182c7c4e3dSmrg#
192c7c4e3dSmrg# You should have received a copy of the GNU General Public License
203458e6c2Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
212c7c4e3dSmrg#
222c7c4e3dSmrg# As a special exception to the GNU General Public License, if you
232c7c4e3dSmrg# distribute this file as part of a program that contains a
242c7c4e3dSmrg# configuration script generated by Autoconf, you may include it under
252becc446Smrg# the same distribution terms that you use for the rest of that
262becc446Smrg# program.  This Exception is an additional permission under section 7
272becc446Smrg# of the GNU General Public License, version 3 ("GPLv3").
282c7c4e3dSmrg#
292becc446Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
302c7c4e3dSmrg#
3116d7e2f1Smrg# You can get the latest version of this script from:
323458e6c2Smrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
332becc446Smrg#
342becc446Smrg# Please send patches to <config-patches@gnu.org>.
352becc446Smrg
362c7c4e3dSmrg
373458e6c2Smrg# The "shellcheck disable" line above the timestamp inhibits complaints
383458e6c2Smrg# about features and limitations of the classic Bourne shell that were
393458e6c2Smrg# superseded or lifted in POSIX.  However, this script identifies a wide
403458e6c2Smrg# variety of pre-POSIX systems that do not have POSIX shells at all, and
413458e6c2Smrg# even some reasonably current systems (Solaris 10 as case-in-point) still
423458e6c2Smrg# have a pre-POSIX /bin/sh.
433458e6c2Smrg
443458e6c2Smrg
452c7c4e3dSmrgme=`echo "$0" | sed -e 's,.*/,,'`
462c7c4e3dSmrg
472c7c4e3dSmrgusage="\
482c7c4e3dSmrgUsage: $0 [OPTION]
492c7c4e3dSmrg
502c7c4e3dSmrgOutput the configuration name of the system \`$me' is run on.
512c7c4e3dSmrg
523458e6c2SmrgOptions:
532c7c4e3dSmrg  -h, --help         print this help, then exit
542c7c4e3dSmrg  -t, --time-stamp   print date of last modification, then exit
552c7c4e3dSmrg  -v, --version      print version number, then exit
562c7c4e3dSmrg
572c7c4e3dSmrgReport bugs and patches to <config-patches@gnu.org>."
582c7c4e3dSmrg
592c7c4e3dSmrgversion="\
602c7c4e3dSmrgGNU config.guess ($timestamp)
612c7c4e3dSmrg
622c7c4e3dSmrgOriginally written by Per Bothner.
633458e6c2SmrgCopyright 1992-2021 Free Software Foundation, Inc.
642c7c4e3dSmrg
652c7c4e3dSmrgThis is free software; see the source for copying conditions.  There is NO
662c7c4e3dSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
672c7c4e3dSmrg
682c7c4e3dSmrghelp="
692c7c4e3dSmrgTry \`$me --help' for more information."
702c7c4e3dSmrg
712c7c4e3dSmrg# Parse command line
722c7c4e3dSmrgwhile test $# -gt 0 ; do
732c7c4e3dSmrg  case $1 in
742c7c4e3dSmrg    --time-stamp | --time* | -t )
758650bb69Smrg       echo "$timestamp" ; exit ;;
762c7c4e3dSmrg    --version | -v )
778650bb69Smrg       echo "$version" ; exit ;;
782c7c4e3dSmrg    --help | --h* | -h )
798650bb69Smrg       echo "$usage"; exit ;;
802c7c4e3dSmrg    -- )     # Stop option processing
812c7c4e3dSmrg       shift; break ;;
822c7c4e3dSmrg    - )	# Use stdin as input.
832c7c4e3dSmrg       break ;;
842c7c4e3dSmrg    -* )
852c7c4e3dSmrg       echo "$me: invalid option $1$help" >&2
862c7c4e3dSmrg       exit 1 ;;
872c7c4e3dSmrg    * )
882c7c4e3dSmrg       break ;;
892c7c4e3dSmrg  esac
902c7c4e3dSmrgdone
912c7c4e3dSmrg
922c7c4e3dSmrgif test $# != 0; then
932c7c4e3dSmrg  echo "$me: too many arguments$help" >&2
942c7c4e3dSmrg  exit 1
952c7c4e3dSmrgfi
962c7c4e3dSmrg
973458e6c2Smrg# Just in case it came from the environment.
983458e6c2SmrgGUESS=
992c7c4e3dSmrg
1002c7c4e3dSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
1012c7c4e3dSmrg# compiler to aid in system detection is discouraged as it requires
1022c7c4e3dSmrg# temporary files to be created and, as you can see below, it is a
1032c7c4e3dSmrg# headache to deal with in a portable fashion.
1042c7c4e3dSmrg
1052c7c4e3dSmrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
1062c7c4e3dSmrg# use `HOST_CC' if defined, but it is deprecated.
1072c7c4e3dSmrg
1082c7c4e3dSmrg# Portable tmp directory creation inspired by the Autoconf team.
1092c7c4e3dSmrg
1103458e6c2Smrgtmp=
1113458e6c2Smrg# shellcheck disable=SC2172
1123458e6c2Smrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
1133458e6c2Smrg
1143458e6c2Smrgset_cc_for_build() {
1153458e6c2Smrg    # prevent multiple calls if $tmp is already set
1163458e6c2Smrg    test "$tmp" && return 0
1173458e6c2Smrg    : "${TMPDIR=/tmp}"
1183458e6c2Smrg    # shellcheck disable=SC2039,SC3028
1193458e6c2Smrg    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1203458e6c2Smrg	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
1213458e6c2Smrg	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1223458e6c2Smrg	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
1233458e6c2Smrg    dummy=$tmp/dummy
1243458e6c2Smrg    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
1253458e6c2Smrg	,,)    echo "int x;" > "$dummy.c"
1263458e6c2Smrg	       for driver in cc gcc c89 c99 ; do
1273458e6c2Smrg		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
1283458e6c2Smrg		       CC_FOR_BUILD=$driver
1293458e6c2Smrg		       break
1303458e6c2Smrg		   fi
1313458e6c2Smrg	       done
1323458e6c2Smrg	       if test x"$CC_FOR_BUILD" = x ; then
1333458e6c2Smrg		   CC_FOR_BUILD=no_compiler_found
1343458e6c2Smrg	       fi
1353458e6c2Smrg	       ;;
1363458e6c2Smrg	,,*)   CC_FOR_BUILD=$CC ;;
1373458e6c2Smrg	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1383458e6c2Smrg    esac
1393458e6c2Smrg}
1402c7c4e3dSmrg
1412c7c4e3dSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1422c7c4e3dSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
1433458e6c2Smrgif test -f /.attbin/uname ; then
1442c7c4e3dSmrg	PATH=$PATH:/.attbin ; export PATH
1452c7c4e3dSmrgfi
1462c7c4e3dSmrg
1472c7c4e3dSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1482c7c4e3dSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1493458e6c2SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
1502c7c4e3dSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1512c7c4e3dSmrg
1523458e6c2Smrgcase $UNAME_SYSTEM in
1532becc446SmrgLinux|GNU|GNU/*)
1543458e6c2Smrg	LIBC=unknown
1552becc446Smrg
1563458e6c2Smrg	set_cc_for_build
1573458e6c2Smrg	cat <<-EOF > "$dummy.c"
1582becc446Smrg	#include <features.h>
1592becc446Smrg	#if defined(__UCLIBC__)
1602becc446Smrg	LIBC=uclibc
1612becc446Smrg	#elif defined(__dietlibc__)
1622becc446Smrg	LIBC=dietlibc
1633458e6c2Smrg	#elif defined(__GLIBC__)
1642becc446Smrg	LIBC=gnu
1653458e6c2Smrg	#else
1663458e6c2Smrg	#include <stdarg.h>
1673458e6c2Smrg	/* First heuristic to detect musl libc.  */
1683458e6c2Smrg	#ifdef __DEFINED_va_list
1693458e6c2Smrg	LIBC=musl
1703458e6c2Smrg	#endif
1712becc446Smrg	#endif
1722becc446Smrg	EOF
1733458e6c2Smrg	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
1743458e6c2Smrg	eval "$cc_set_libc"
1753458e6c2Smrg
1763458e6c2Smrg	# Second heuristic to detect musl libc.
1773458e6c2Smrg	if [ "$LIBC" = unknown ] &&
1783458e6c2Smrg	   command -v ldd >/dev/null &&
1793458e6c2Smrg	   ldd --version 2>&1 | grep -q ^musl; then
1803458e6c2Smrg		LIBC=musl
1813458e6c2Smrg	fi
1823458e6c2Smrg
1833458e6c2Smrg	# If the system lacks a compiler, then just pick glibc.
1843458e6c2Smrg	# We could probably try harder.
1853458e6c2Smrg	if [ "$LIBC" = unknown ]; then
1863458e6c2Smrg		LIBC=gnu
1873458e6c2Smrg	fi
1882becc446Smrg	;;
1892becc446Smrgesac
1902becc446Smrg
1912c7c4e3dSmrg# Note: order is significant - the case branches are not exclusive.
1922c7c4e3dSmrg
1933458e6c2Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
1942c7c4e3dSmrg    *:NetBSD:*:*)
1952c7c4e3dSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
1962becc446Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
1972c7c4e3dSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1982c7c4e3dSmrg	# switched to ELF, *-*-netbsd* would select the old
1992c7c4e3dSmrg	# object file format.  This provides both forward
2002c7c4e3dSmrg	# compatibility and a consistent mechanism for selecting the
2012c7c4e3dSmrg	# object file format.
2022c7c4e3dSmrg	#
2032c7c4e3dSmrg	# Note: NetBSD doesn't particularly care about the vendor
2042c7c4e3dSmrg	# portion of the name.  We always set it to "unknown".
2053458e6c2Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
2063458e6c2Smrg	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
2073458e6c2Smrg	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
2083458e6c2Smrg	    echo unknown)`
2093458e6c2Smrg	case $UNAME_MACHINE_ARCH in
2103458e6c2Smrg	    aarch64eb) machine=aarch64_be-unknown ;;
2112c7c4e3dSmrg	    armeb) machine=armeb-unknown ;;
2122c7c4e3dSmrg	    arm*) machine=arm-unknown ;;
2132c7c4e3dSmrg	    sh3el) machine=shl-unknown ;;
2142c7c4e3dSmrg	    sh3eb) machine=sh-unknown ;;
2158650bb69Smrg	    sh5el) machine=sh5le-unknown ;;
2163458e6c2Smrg	    earmv*)
2173458e6c2Smrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
2183458e6c2Smrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
2193458e6c2Smrg		machine=${arch}${endian}-unknown
2203458e6c2Smrg		;;
2213458e6c2Smrg	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
2222c7c4e3dSmrg	esac
2232c7c4e3dSmrg	# The Operating System including object format, if it has switched
2243458e6c2Smrg	# to ELF recently (or will in the future) and ABI.
2253458e6c2Smrg	case $UNAME_MACHINE_ARCH in
2263458e6c2Smrg	    earm*)
2273458e6c2Smrg		os=netbsdelf
2283458e6c2Smrg		;;
2292c7c4e3dSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
2303458e6c2Smrg		set_cc_for_build
2312c7c4e3dSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
23216d7e2f1Smrg			| grep -q __ELF__
2332c7c4e3dSmrg		then
2342c7c4e3dSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
2352c7c4e3dSmrg		    # Return netbsd for either.  FIX?
2362c7c4e3dSmrg		    os=netbsd
2372c7c4e3dSmrg		else
2382c7c4e3dSmrg		    os=netbsdelf
2392c7c4e3dSmrg		fi
2402c7c4e3dSmrg		;;
2412c7c4e3dSmrg	    *)
2422becc446Smrg		os=netbsd
2432c7c4e3dSmrg		;;
2442c7c4e3dSmrg	esac
2453458e6c2Smrg	# Determine ABI tags.
2463458e6c2Smrg	case $UNAME_MACHINE_ARCH in
2473458e6c2Smrg	    earm*)
2483458e6c2Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
2493458e6c2Smrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
2503458e6c2Smrg		;;
2513458e6c2Smrg	esac
2522c7c4e3dSmrg	# The OS release
2532c7c4e3dSmrg	# Debian GNU/NetBSD machines have a different userland, and
2542c7c4e3dSmrg	# thus, need a distinct triplet. However, they do not need
2552c7c4e3dSmrg	# kernel version information, so it can be replaced with a
2562c7c4e3dSmrg	# suitable tag, in the style of linux-gnu.
2573458e6c2Smrg	case $UNAME_VERSION in
2582c7c4e3dSmrg	    Debian*)
2592c7c4e3dSmrg		release='-gnu'
2602c7c4e3dSmrg		;;
2612c7c4e3dSmrg	    *)
2623458e6c2Smrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
2632c7c4e3dSmrg		;;
2642c7c4e3dSmrg	esac
2652c7c4e3dSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2662c7c4e3dSmrg	# contains redundant information, the shorter form:
2672c7c4e3dSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2683458e6c2Smrg	GUESS=$machine-${os}${release}${abi-}
2693458e6c2Smrg	;;
2702becc446Smrg    *:Bitrig:*:*)
2712becc446Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
2723458e6c2Smrg	GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
2733458e6c2Smrg	;;
2742c7c4e3dSmrg    *:OpenBSD:*:*)
2758650bb69Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2763458e6c2Smrg	GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
2773458e6c2Smrg	;;
2783458e6c2Smrg    *:SecBSD:*:*)
2793458e6c2Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
2803458e6c2Smrg	GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
2813458e6c2Smrg	;;
2823458e6c2Smrg    *:LibertyBSD:*:*)
2833458e6c2Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
2843458e6c2Smrg	GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
2853458e6c2Smrg	;;
2863458e6c2Smrg    *:MidnightBSD:*:*)
2873458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
2883458e6c2Smrg	;;
2898650bb69Smrg    *:ekkoBSD:*:*)
2903458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
2913458e6c2Smrg	;;
2928650bb69Smrg    *:SolidBSD:*:*)
2933458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
2943458e6c2Smrg	;;
2953458e6c2Smrg    *:OS108:*:*)
2963458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
2973458e6c2Smrg	;;
2988650bb69Smrg    macppc:MirBSD:*:*)
2993458e6c2Smrg	GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
3003458e6c2Smrg	;;
3018650bb69Smrg    *:MirBSD:*:*)
3023458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
3033458e6c2Smrg	;;
3043458e6c2Smrg    *:Sortix:*:*)
3053458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-sortix
3063458e6c2Smrg	;;
3073458e6c2Smrg    *:Twizzler:*:*)
3083458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-twizzler
3093458e6c2Smrg	;;
3103458e6c2Smrg    *:Redox:*:*)
3113458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-redox
3123458e6c2Smrg	;;
3133458e6c2Smrg    mips:OSF1:*.*)
3143458e6c2Smrg	GUESS=mips-dec-osf1
3153458e6c2Smrg	;;
3162c7c4e3dSmrg    alpha:OSF1:*:*)
3173458e6c2Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
3183458e6c2Smrg	trap '' 0
3198650bb69Smrg	case $UNAME_RELEASE in
3208650bb69Smrg	*4.0)
3212c7c4e3dSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
3228650bb69Smrg		;;
3238650bb69Smrg	*5.*)
3242becc446Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
3258650bb69Smrg		;;
3268650bb69Smrg	esac
3272c7c4e3dSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
3282c7c4e3dSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
3292c7c4e3dSmrg	# covers most systems running today.  This code pipes the CPU
3302c7c4e3dSmrg	# types through head -n 1, so we only detect the type of CPU 0.
3312c7c4e3dSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
3323458e6c2Smrg	case $ALPHA_CPU_TYPE in
3332c7c4e3dSmrg	    "EV4 (21064)")
3343458e6c2Smrg		UNAME_MACHINE=alpha ;;
3352c7c4e3dSmrg	    "EV4.5 (21064)")
3363458e6c2Smrg		UNAME_MACHINE=alpha ;;
3372c7c4e3dSmrg	    "LCA4 (21066/21068)")
3383458e6c2Smrg		UNAME_MACHINE=alpha ;;
3392c7c4e3dSmrg	    "EV5 (21164)")
3403458e6c2Smrg		UNAME_MACHINE=alphaev5 ;;
3412c7c4e3dSmrg	    "EV5.6 (21164A)")
3423458e6c2Smrg		UNAME_MACHINE=alphaev56 ;;
3432c7c4e3dSmrg	    "EV5.6 (21164PC)")
3443458e6c2Smrg		UNAME_MACHINE=alphapca56 ;;
3452c7c4e3dSmrg	    "EV5.7 (21164PC)")
3463458e6c2Smrg		UNAME_MACHINE=alphapca57 ;;
3472c7c4e3dSmrg	    "EV6 (21264)")
3483458e6c2Smrg		UNAME_MACHINE=alphaev6 ;;
3492c7c4e3dSmrg	    "EV6.7 (21264A)")
3503458e6c2Smrg		UNAME_MACHINE=alphaev67 ;;
3512c7c4e3dSmrg	    "EV6.8CB (21264C)")
3523458e6c2Smrg		UNAME_MACHINE=alphaev68 ;;
3532c7c4e3dSmrg	    "EV6.8AL (21264B)")
3543458e6c2Smrg		UNAME_MACHINE=alphaev68 ;;
3552c7c4e3dSmrg	    "EV6.8CX (21264D)")
3563458e6c2Smrg		UNAME_MACHINE=alphaev68 ;;
3572c7c4e3dSmrg	    "EV6.9A (21264/EV69A)")
3583458e6c2Smrg		UNAME_MACHINE=alphaev69 ;;
3592c7c4e3dSmrg	    "EV7 (21364)")
3603458e6c2Smrg		UNAME_MACHINE=alphaev7 ;;
3612c7c4e3dSmrg	    "EV7.9 (21364A)")
3623458e6c2Smrg		UNAME_MACHINE=alphaev79 ;;
3632c7c4e3dSmrg	esac
3648650bb69Smrg	# A Pn.n version is a patched version.
3652c7c4e3dSmrg	# A Vn.n version is a released version.
3662c7c4e3dSmrg	# A Tn.n version is a released field test version.
3672c7c4e3dSmrg	# A Xn.n version is an unreleased experimental baselevel.
3682c7c4e3dSmrg	# 1.2 uses "1.2" for uname -r.
3693458e6c2Smrg	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
3703458e6c2Smrg	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
3713458e6c2Smrg	;;
3722c7c4e3dSmrg    Amiga*:UNIX_System_V:4.0:*)
3733458e6c2Smrg	GUESS=m68k-unknown-sysv4
3743458e6c2Smrg	;;
3752c7c4e3dSmrg    *:[Aa]miga[Oo][Ss]:*:*)
3763458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-amigaos
3773458e6c2Smrg	;;
3782c7c4e3dSmrg    *:[Mm]orph[Oo][Ss]:*:*)
3793458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-morphos
3803458e6c2Smrg	;;
3812c7c4e3dSmrg    *:OS/390:*:*)
3823458e6c2Smrg	GUESS=i370-ibm-openedition
3833458e6c2Smrg	;;
3848650bb69Smrg    *:z/VM:*:*)
3853458e6c2Smrg	GUESS=s390-ibm-zvmoe
3863458e6c2Smrg	;;
3878650bb69Smrg    *:OS400:*:*)
3883458e6c2Smrg	GUESS=powerpc-ibm-os400
3893458e6c2Smrg	;;
3902c7c4e3dSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3913458e6c2Smrg	GUESS=arm-acorn-riscix$UNAME_RELEASE
3923458e6c2Smrg	;;
3932becc446Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
3943458e6c2Smrg	GUESS=arm-unknown-riscos
3953458e6c2Smrg	;;
3962c7c4e3dSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3973458e6c2Smrg	GUESS=hppa1.1-hitachi-hiuxmpp
3983458e6c2Smrg	;;
3992c7c4e3dSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
4002c7c4e3dSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
4013458e6c2Smrg	case `(/bin/universe) 2>/dev/null` in
4023458e6c2Smrg	    att) GUESS=pyramid-pyramid-sysv3 ;;
4033458e6c2Smrg	    *)   GUESS=pyramid-pyramid-bsd   ;;
4043458e6c2Smrg	esac
4053458e6c2Smrg	;;
4062c7c4e3dSmrg    NILE*:*:*:dcosx)
4073458e6c2Smrg	GUESS=pyramid-pyramid-svr4
4083458e6c2Smrg	;;
4092c7c4e3dSmrg    DRS?6000:unix:4.0:6*)
4103458e6c2Smrg	GUESS=sparc-icl-nx6
4113458e6c2Smrg	;;
4128650bb69Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
4132c7c4e3dSmrg	case `/usr/bin/uname -p` in
4143458e6c2Smrg	    sparc) GUESS=sparc-icl-nx7 ;;
4153458e6c2Smrg	esac
4163458e6c2Smrg	;;
4178650bb69Smrg    s390x:SunOS:*:*)
4183458e6c2Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
4193458e6c2Smrg	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
4203458e6c2Smrg	;;
4212c7c4e3dSmrg    sun4H:SunOS:5.*:*)
4223458e6c2Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
4233458e6c2Smrg	GUESS=sparc-hal-solaris2$SUN_REL
4243458e6c2Smrg	;;
4252c7c4e3dSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
4263458e6c2Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
4273458e6c2Smrg	GUESS=sparc-sun-solaris2$SUN_REL
4283458e6c2Smrg	;;
42916d7e2f1Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
4303458e6c2Smrg	GUESS=i386-pc-auroraux$UNAME_RELEASE
4313458e6c2Smrg	;;
4328650bb69Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
4333458e6c2Smrg	set_cc_for_build
4343458e6c2Smrg	SUN_ARCH=i386
4358650bb69Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
4368650bb69Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
4378650bb69Smrg	# This test works for both compilers.
4383458e6c2Smrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
4398650bb69Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
4403458e6c2Smrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
4418650bb69Smrg		grep IS_64BIT_ARCH >/dev/null
4428650bb69Smrg	    then
4433458e6c2Smrg		SUN_ARCH=x86_64
4448650bb69Smrg	    fi
4458650bb69Smrg	fi
4463458e6c2Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
4473458e6c2Smrg	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
4483458e6c2Smrg	;;
4492c7c4e3dSmrg    sun4*:SunOS:6*:*)
4502c7c4e3dSmrg	# According to config.sub, this is the proper way to canonicalize
4512c7c4e3dSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
4522c7c4e3dSmrg	# it's likely to be more like Solaris than SunOS4.
4533458e6c2Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
4543458e6c2Smrg	GUESS=sparc-sun-solaris3$SUN_REL
4553458e6c2Smrg	;;
4562c7c4e3dSmrg    sun4*:SunOS:*:*)
4573458e6c2Smrg	case `/usr/bin/arch -k` in
4582c7c4e3dSmrg	    Series*|S4*)
4592c7c4e3dSmrg		UNAME_RELEASE=`uname -v`
4602c7c4e3dSmrg		;;
4612c7c4e3dSmrg	esac
4622c7c4e3dSmrg	# Japanese Language versions have a version number like `4.1.3-JL'.
4633458e6c2Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
4643458e6c2Smrg	GUESS=sparc-sun-sunos$SUN_REL
4653458e6c2Smrg	;;
4662c7c4e3dSmrg    sun3*:SunOS:*:*)
4673458e6c2Smrg	GUESS=m68k-sun-sunos$UNAME_RELEASE
4683458e6c2Smrg	;;
4692c7c4e3dSmrg    sun*:*:4.2BSD:*)
4702c7c4e3dSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
4713458e6c2Smrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
4723458e6c2Smrg	case `/bin/arch` in
4732c7c4e3dSmrg	    sun3)
4743458e6c2Smrg		GUESS=m68k-sun-sunos$UNAME_RELEASE
4752c7c4e3dSmrg		;;
4762c7c4e3dSmrg	    sun4)
4773458e6c2Smrg		GUESS=sparc-sun-sunos$UNAME_RELEASE
4782c7c4e3dSmrg		;;
4792c7c4e3dSmrg	esac
4803458e6c2Smrg	;;
4812c7c4e3dSmrg    aushp:SunOS:*:*)
4823458e6c2Smrg	GUESS=sparc-auspex-sunos$UNAME_RELEASE
4833458e6c2Smrg	;;
4842c7c4e3dSmrg    # The situation for MiNT is a little confusing.  The machine name
4852c7c4e3dSmrg    # can be virtually everything (everything which is not
4862c7c4e3dSmrg    # "atarist" or "atariste" at least should have a processor
4872c7c4e3dSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
4882c7c4e3dSmrg    # to the lowercase version "mint" (or "freemint").  Finally
4892c7c4e3dSmrg    # the system name "TOS" denotes a system which is actually not
4902c7c4e3dSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
4912c7c4e3dSmrg    # be no problem.
4922c7c4e3dSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4933458e6c2Smrg	GUESS=m68k-atari-mint$UNAME_RELEASE
4943458e6c2Smrg	;;
4952c7c4e3dSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4963458e6c2Smrg	GUESS=m68k-atari-mint$UNAME_RELEASE
4973458e6c2Smrg	;;
4982c7c4e3dSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4993458e6c2Smrg	GUESS=m68k-atari-mint$UNAME_RELEASE
5003458e6c2Smrg	;;
5012c7c4e3dSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
5023458e6c2Smrg	GUESS=m68k-milan-mint$UNAME_RELEASE
5033458e6c2Smrg	;;
5042c7c4e3dSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
5053458e6c2Smrg	GUESS=m68k-hades-mint$UNAME_RELEASE
5063458e6c2Smrg	;;
5072c7c4e3dSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
5083458e6c2Smrg	GUESS=m68k-unknown-mint$UNAME_RELEASE
5093458e6c2Smrg	;;
5108650bb69Smrg    m68k:machten:*:*)
5113458e6c2Smrg	GUESS=m68k-apple-machten$UNAME_RELEASE
5123458e6c2Smrg	;;
5132c7c4e3dSmrg    powerpc:machten:*:*)
5143458e6c2Smrg	GUESS=powerpc-apple-machten$UNAME_RELEASE
5153458e6c2Smrg	;;
5162c7c4e3dSmrg    RISC*:Mach:*:*)
5173458e6c2Smrg	GUESS=mips-dec-mach_bsd4.3
5183458e6c2Smrg	;;
5192c7c4e3dSmrg    RISC*:ULTRIX:*:*)
5203458e6c2Smrg	GUESS=mips-dec-ultrix$UNAME_RELEASE
5213458e6c2Smrg	;;
5222c7c4e3dSmrg    VAX*:ULTRIX*:*:*)
5233458e6c2Smrg	GUESS=vax-dec-ultrix$UNAME_RELEASE
5243458e6c2Smrg	;;
5252c7c4e3dSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
5263458e6c2Smrg	GUESS=clipper-intergraph-clix$UNAME_RELEASE
5273458e6c2Smrg	;;
5282c7c4e3dSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
5293458e6c2Smrg	set_cc_for_build
5303458e6c2Smrg	sed 's/^	//' << EOF > "$dummy.c"
5312c7c4e3dSmrg#ifdef __cplusplus
5322c7c4e3dSmrg#include <stdio.h>  /* for printf() prototype */
5332c7c4e3dSmrg	int main (int argc, char *argv[]) {
5342c7c4e3dSmrg#else
5352c7c4e3dSmrg	int main (argc, argv) int argc; char *argv[]; {
5362c7c4e3dSmrg#endif
5372c7c4e3dSmrg	#if defined (host_mips) && defined (MIPSEB)
5382c7c4e3dSmrg	#if defined (SYSTYPE_SYSV)
5393458e6c2Smrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
5402c7c4e3dSmrg	#endif
5412c7c4e3dSmrg	#if defined (SYSTYPE_SVR4)
5423458e6c2Smrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
5432c7c4e3dSmrg	#endif
5442c7c4e3dSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
5453458e6c2Smrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
5462c7c4e3dSmrg	#endif
5472c7c4e3dSmrg	#endif
5482c7c4e3dSmrg	  exit (-1);
5492c7c4e3dSmrg	}
5502c7c4e3dSmrgEOF
5513458e6c2Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
5523458e6c2Smrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
5533458e6c2Smrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
5548650bb69Smrg	    { echo "$SYSTEM_NAME"; exit; }
5553458e6c2Smrg	GUESS=mips-mips-riscos$UNAME_RELEASE
5563458e6c2Smrg	;;
5572c7c4e3dSmrg    Motorola:PowerMAX_OS:*:*)
5583458e6c2Smrg	GUESS=powerpc-motorola-powermax
5593458e6c2Smrg	;;
5602c7c4e3dSmrg    Motorola:*:4.3:PL8-*)
5613458e6c2Smrg	GUESS=powerpc-harris-powermax
5623458e6c2Smrg	;;
5632c7c4e3dSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
5643458e6c2Smrg	GUESS=powerpc-harris-powermax
5653458e6c2Smrg	;;
5662c7c4e3dSmrg    Night_Hawk:Power_UNIX:*:*)
5673458e6c2Smrg	GUESS=powerpc-harris-powerunix
5683458e6c2Smrg	;;
5692c7c4e3dSmrg    m88k:CX/UX:7*:*)
5703458e6c2Smrg	GUESS=m88k-harris-cxux7
5713458e6c2Smrg	;;
5722c7c4e3dSmrg    m88k:*:4*:R4*)
5733458e6c2Smrg	GUESS=m88k-motorola-sysv4
5743458e6c2Smrg	;;
5752c7c4e3dSmrg    m88k:*:3*:R3*)
5763458e6c2Smrg	GUESS=m88k-motorola-sysv3
5773458e6c2Smrg	;;
5782c7c4e3dSmrg    AViiON:dgux:*:*)
5792becc446Smrg	# DG/UX returns AViiON for all architectures
5802becc446Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
5813458e6c2Smrg	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
5822c7c4e3dSmrg	then
5833458e6c2Smrg	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
5843458e6c2Smrg	       test "$TARGET_BINARY_INTERFACE"x = x
5852c7c4e3dSmrg	    then
5863458e6c2Smrg		GUESS=m88k-dg-dgux$UNAME_RELEASE
5872c7c4e3dSmrg	    else
5883458e6c2Smrg		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
5892c7c4e3dSmrg	    fi
5902c7c4e3dSmrg	else
5913458e6c2Smrg	    GUESS=i586-dg-dgux$UNAME_RELEASE
5922c7c4e3dSmrg	fi
5933458e6c2Smrg	;;
5942c7c4e3dSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
5953458e6c2Smrg	GUESS=m88k-dolphin-sysv3
5963458e6c2Smrg	;;
5972c7c4e3dSmrg    M88*:*:R3*:*)
5982c7c4e3dSmrg	# Delta 88k system running SVR3
5993458e6c2Smrg	GUESS=m88k-motorola-sysv3
6003458e6c2Smrg	;;
6012c7c4e3dSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
6023458e6c2Smrg	GUESS=m88k-tektronix-sysv3
6033458e6c2Smrg	;;
6042c7c4e3dSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
6053458e6c2Smrg	GUESS=m68k-tektronix-bsd
6063458e6c2Smrg	;;
6072c7c4e3dSmrg    *:IRIX*:*:*)
6083458e6c2Smrg	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
6093458e6c2Smrg	GUESS=mips-sgi-irix$IRIX_REL
6103458e6c2Smrg	;;
6112c7c4e3dSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
6123458e6c2Smrg	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
6133458e6c2Smrg	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
6142c7c4e3dSmrg    i*86:AIX:*:*)
6153458e6c2Smrg	GUESS=i386-ibm-aix
6163458e6c2Smrg	;;
6172c7c4e3dSmrg    ia64:AIX:*:*)
6183458e6c2Smrg	if test -x /usr/bin/oslevel ; then
6192c7c4e3dSmrg		IBM_REV=`/usr/bin/oslevel`
6202c7c4e3dSmrg	else
6213458e6c2Smrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
6222c7c4e3dSmrg	fi
6233458e6c2Smrg	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
6243458e6c2Smrg	;;
6252c7c4e3dSmrg    *:AIX:2:3)
6262c7c4e3dSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
6273458e6c2Smrg		set_cc_for_build
6283458e6c2Smrg		sed 's/^		//' << EOF > "$dummy.c"
6292c7c4e3dSmrg		#include <sys/systemcfg.h>
6302c7c4e3dSmrg
6312c7c4e3dSmrg		main()
6322c7c4e3dSmrg			{
6332c7c4e3dSmrg			if (!__power_pc())
6342c7c4e3dSmrg				exit(1);
6352c7c4e3dSmrg			puts("powerpc-ibm-aix3.2.5");
6362c7c4e3dSmrg			exit(0);
6372c7c4e3dSmrg			}
6382c7c4e3dSmrgEOF
6393458e6c2Smrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
6408650bb69Smrg		then
6413458e6c2Smrg			GUESS=$SYSTEM_NAME
6428650bb69Smrg		else
6433458e6c2Smrg			GUESS=rs6000-ibm-aix3.2.5
6448650bb69Smrg		fi
6452c7c4e3dSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
6463458e6c2Smrg		GUESS=rs6000-ibm-aix3.2.4
6472c7c4e3dSmrg	else
6483458e6c2Smrg		GUESS=rs6000-ibm-aix3.2
6492c7c4e3dSmrg	fi
6503458e6c2Smrg	;;
65116d7e2f1Smrg    *:AIX:*:[4567])
6522c7c4e3dSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
6533458e6c2Smrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
6542c7c4e3dSmrg		IBM_ARCH=rs6000
6552c7c4e3dSmrg	else
6562c7c4e3dSmrg		IBM_ARCH=powerpc
6572c7c4e3dSmrg	fi
6583458e6c2Smrg	if test -x /usr/bin/lslpp ; then
6593458e6c2Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
6602becc446Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
6612c7c4e3dSmrg	else
6623458e6c2Smrg		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
6632c7c4e3dSmrg	fi
6643458e6c2Smrg	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
6653458e6c2Smrg	;;
6662c7c4e3dSmrg    *:AIX:*:*)
6673458e6c2Smrg	GUESS=rs6000-ibm-aix
6683458e6c2Smrg	;;
6693458e6c2Smrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
6703458e6c2Smrg	GUESS=romp-ibm-bsd4.4
6713458e6c2Smrg	;;
6722c7c4e3dSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
6733458e6c2Smrg	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
6743458e6c2Smrg	;;                                  # report: romp-ibm BSD 4.3
6752c7c4e3dSmrg    *:BOSX:*:*)
6763458e6c2Smrg	GUESS=rs6000-bull-bosx
6773458e6c2Smrg	;;
6782c7c4e3dSmrg    DPX/2?00:B.O.S.:*:*)
6793458e6c2Smrg	GUESS=m68k-bull-sysv3
6803458e6c2Smrg	;;
6812c7c4e3dSmrg    9000/[34]??:4.3bsd:1.*:*)
6823458e6c2Smrg	GUESS=m68k-hp-bsd
6833458e6c2Smrg	;;
6842c7c4e3dSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
6853458e6c2Smrg	GUESS=m68k-hp-bsd4.4
6863458e6c2Smrg	;;
6872c7c4e3dSmrg    9000/[34678]??:HP-UX:*:*)
6883458e6c2Smrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
6893458e6c2Smrg	case $UNAME_MACHINE in
6903458e6c2Smrg	    9000/31?)            HP_ARCH=m68000 ;;
6913458e6c2Smrg	    9000/[34]??)         HP_ARCH=m68k ;;
6922c7c4e3dSmrg	    9000/[678][0-9][0-9])
6933458e6c2Smrg		if test -x /usr/bin/getconf; then
6942c7c4e3dSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
6952becc446Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
6963458e6c2Smrg		    case $sc_cpu_version in
6973458e6c2Smrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
6983458e6c2Smrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
6992becc446Smrg		      532)                      # CPU_PA_RISC2_0
7003458e6c2Smrg			case $sc_kernel_bits in
7013458e6c2Smrg			  32) HP_ARCH=hppa2.0n ;;
7023458e6c2Smrg			  64) HP_ARCH=hppa2.0w ;;
7033458e6c2Smrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
7042becc446Smrg			esac ;;
7052becc446Smrg		    esac
7062c7c4e3dSmrg		fi
7073458e6c2Smrg		if test "$HP_ARCH" = ""; then
7083458e6c2Smrg		    set_cc_for_build
7093458e6c2Smrg		    sed 's/^		//' << EOF > "$dummy.c"
7102c7c4e3dSmrg
7112becc446Smrg		#define _HPUX_SOURCE
7122becc446Smrg		#include <stdlib.h>
7132becc446Smrg		#include <unistd.h>
7142c7c4e3dSmrg
7152becc446Smrg		int main ()
7162becc446Smrg		{
7172becc446Smrg		#if defined(_SC_KERNEL_BITS)
7182becc446Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
7192becc446Smrg		#endif
7202becc446Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
7212c7c4e3dSmrg
7222becc446Smrg		    switch (cpu)
7232becc446Smrg			{
7242becc446Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
7252becc446Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
7262becc446Smrg			case CPU_PA_RISC2_0:
7272becc446Smrg		#if defined(_SC_KERNEL_BITS)
7282becc446Smrg			    switch (bits)
7292becc446Smrg				{
7302becc446Smrg				case 64: puts ("hppa2.0w"); break;
7312becc446Smrg				case 32: puts ("hppa2.0n"); break;
7322becc446Smrg				default: puts ("hppa2.0"); break;
7332becc446Smrg				} break;
7342becc446Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
7352becc446Smrg			    puts ("hppa2.0"); break;
7362becc446Smrg		#endif
7372becc446Smrg			default: puts ("hppa1.0"); break;
7382becc446Smrg			}
7392becc446Smrg		    exit (0);
7402becc446Smrg		}
7412c7c4e3dSmrgEOF
7423458e6c2Smrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
7432c7c4e3dSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
7442c7c4e3dSmrg		fi ;;
7452c7c4e3dSmrg	esac
7463458e6c2Smrg	if test "$HP_ARCH" = hppa2.0w
7472c7c4e3dSmrg	then
7483458e6c2Smrg	    set_cc_for_build
7498650bb69Smrg
7508650bb69Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
7518650bb69Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
7528650bb69Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
7538650bb69Smrg	    #
7548650bb69Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
7558650bb69Smrg	    # => hppa2.0w-hp-hpux11.23
7568650bb69Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
7578650bb69Smrg	    # => hppa64-hp-hpux11.23
7588650bb69Smrg
7593458e6c2Smrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
76016d7e2f1Smrg		grep -q __LP64__
7612c7c4e3dSmrg	    then
7623458e6c2Smrg		HP_ARCH=hppa2.0w
7632c7c4e3dSmrg	    else
7643458e6c2Smrg		HP_ARCH=hppa64
7652c7c4e3dSmrg	    fi
7662c7c4e3dSmrg	fi
7673458e6c2Smrg	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
7683458e6c2Smrg	;;
7692c7c4e3dSmrg    ia64:HP-UX:*:*)
7703458e6c2Smrg	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
7713458e6c2Smrg	GUESS=ia64-hp-hpux$HPUX_REV
7723458e6c2Smrg	;;
7732c7c4e3dSmrg    3050*:HI-UX:*:*)
7743458e6c2Smrg	set_cc_for_build
7753458e6c2Smrg	sed 's/^	//' << EOF > "$dummy.c"
7762c7c4e3dSmrg	#include <unistd.h>
7772c7c4e3dSmrg	int
7782c7c4e3dSmrg	main ()
7792c7c4e3dSmrg	{
7802c7c4e3dSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
7812c7c4e3dSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7822c7c4e3dSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7832c7c4e3dSmrg	     results, however.  */
7842c7c4e3dSmrg	  if (CPU_IS_PA_RISC (cpu))
7852c7c4e3dSmrg	    {
7862c7c4e3dSmrg	      switch (cpu)
7872c7c4e3dSmrg		{
7882c7c4e3dSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7892c7c4e3dSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7902c7c4e3dSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7912c7c4e3dSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7922c7c4e3dSmrg		}
7932c7c4e3dSmrg	    }
7942c7c4e3dSmrg	  else if (CPU_IS_HP_MC68K (cpu))
7952c7c4e3dSmrg	    puts ("m68k-hitachi-hiuxwe2");
7962c7c4e3dSmrg	  else puts ("unknown-hitachi-hiuxwe2");
7972c7c4e3dSmrg	  exit (0);
7982c7c4e3dSmrg	}
7992c7c4e3dSmrgEOF
8003458e6c2Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
8018650bb69Smrg		{ echo "$SYSTEM_NAME"; exit; }
8023458e6c2Smrg	GUESS=unknown-hitachi-hiuxwe2
8033458e6c2Smrg	;;
8043458e6c2Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
8053458e6c2Smrg	GUESS=hppa1.1-hp-bsd
8063458e6c2Smrg	;;
8072c7c4e3dSmrg    9000/8??:4.3bsd:*:*)
8083458e6c2Smrg	GUESS=hppa1.0-hp-bsd
8093458e6c2Smrg	;;
8102c7c4e3dSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
8113458e6c2Smrg	GUESS=hppa1.0-hp-mpeix
8123458e6c2Smrg	;;
8133458e6c2Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
8143458e6c2Smrg	GUESS=hppa1.1-hp-osf
8153458e6c2Smrg	;;
8162c7c4e3dSmrg    hp8??:OSF1:*:*)
8173458e6c2Smrg	GUESS=hppa1.0-hp-osf
8183458e6c2Smrg	;;
8192c7c4e3dSmrg    i*86:OSF1:*:*)
8203458e6c2Smrg	if test -x /usr/sbin/sysversion ; then
8213458e6c2Smrg	    GUESS=$UNAME_MACHINE-unknown-osf1mk
8222c7c4e3dSmrg	else
8233458e6c2Smrg	    GUESS=$UNAME_MACHINE-unknown-osf1
8242c7c4e3dSmrg	fi
8253458e6c2Smrg	;;
8262c7c4e3dSmrg    parisc*:Lites*:*:*)
8273458e6c2Smrg	GUESS=hppa1.1-hp-lites
8283458e6c2Smrg	;;
8292c7c4e3dSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
8303458e6c2Smrg	GUESS=c1-convex-bsd
8313458e6c2Smrg	;;
8322c7c4e3dSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
8332c7c4e3dSmrg	if getsysinfo -f scalar_acc
8342c7c4e3dSmrg	then echo c32-convex-bsd
8352c7c4e3dSmrg	else echo c2-convex-bsd
8362c7c4e3dSmrg	fi
8372becc446Smrg	exit ;;
8382c7c4e3dSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
8393458e6c2Smrg	GUESS=c34-convex-bsd
8403458e6c2Smrg	;;
8412c7c4e3dSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
8423458e6c2Smrg	GUESS=c38-convex-bsd
8433458e6c2Smrg	;;
8442c7c4e3dSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
8453458e6c2Smrg	GUESS=c4-convex-bsd
8463458e6c2Smrg	;;
8472c7c4e3dSmrg    CRAY*Y-MP:*:*:*)
8483458e6c2Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
8493458e6c2Smrg	GUESS=ymp-cray-unicos$CRAY_REL
8503458e6c2Smrg	;;
8512c7c4e3dSmrg    CRAY*[A-Z]90:*:*:*)
8523458e6c2Smrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
8532c7c4e3dSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
8542c7c4e3dSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
8552c7c4e3dSmrg	      -e 's/\.[^.]*$/.X/'
8568650bb69Smrg	exit ;;
8572c7c4e3dSmrg    CRAY*TS:*:*:*)
8583458e6c2Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
8593458e6c2Smrg	GUESS=t90-cray-unicos$CRAY_REL
8603458e6c2Smrg	;;
8612c7c4e3dSmrg    CRAY*T3E:*:*:*)
8623458e6c2Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
8633458e6c2Smrg	GUESS=alphaev5-cray-unicosmk$CRAY_REL
8643458e6c2Smrg	;;
8652c7c4e3dSmrg    CRAY*SV1:*:*:*)
8663458e6c2Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
8673458e6c2Smrg	GUESS=sv1-cray-unicos$CRAY_REL
8683458e6c2Smrg	;;
8692c7c4e3dSmrg    *:UNICOS/mp:*:*)
8703458e6c2Smrg	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
8713458e6c2Smrg	GUESS=craynv-cray-unicosmp$CRAY_REL
8723458e6c2Smrg	;;
8732c7c4e3dSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
8743458e6c2Smrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
8753458e6c2Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
8763458e6c2Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
8773458e6c2Smrg	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
8783458e6c2Smrg	;;
8798650bb69Smrg    5000:UNIX_System_V:4.*:*)
8803458e6c2Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
8813458e6c2Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
8823458e6c2Smrg	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
8833458e6c2Smrg	;;
8842c7c4e3dSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
8853458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
8863458e6c2Smrg	;;
8872c7c4e3dSmrg    sparc*:BSD/OS:*:*)
8883458e6c2Smrg	GUESS=sparc-unknown-bsdi$UNAME_RELEASE
8893458e6c2Smrg	;;
8902c7c4e3dSmrg    *:BSD/OS:*:*)
8913458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
8923458e6c2Smrg	;;
8933458e6c2Smrg    arm:FreeBSD:*:*)
8943458e6c2Smrg	UNAME_PROCESSOR=`uname -p`
8953458e6c2Smrg	set_cc_for_build
8963458e6c2Smrg	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
8973458e6c2Smrg	    | grep -q __ARM_PCS_VFP
8983458e6c2Smrg	then
8993458e6c2Smrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
9003458e6c2Smrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
9013458e6c2Smrg	else
9023458e6c2Smrg	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
9033458e6c2Smrg	    GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
9043458e6c2Smrg	fi
9053458e6c2Smrg	;;
9068650bb69Smrg    *:FreeBSD:*:*)
9072becc446Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
9083458e6c2Smrg	case $UNAME_PROCESSOR in
9098650bb69Smrg	    amd64)
9103458e6c2Smrg		UNAME_PROCESSOR=x86_64 ;;
9113458e6c2Smrg	    i386)
9123458e6c2Smrg		UNAME_PROCESSOR=i586 ;;
9138650bb69Smrg	esac
9143458e6c2Smrg	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
9153458e6c2Smrg	GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
9163458e6c2Smrg	;;
9172c7c4e3dSmrg    i*:CYGWIN*:*)
9183458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-cygwin
9193458e6c2Smrg	;;
9202becc446Smrg    *:MINGW64*:*)
9213458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-mingw64
9223458e6c2Smrg	;;
9238650bb69Smrg    *:MINGW*:*)
9243458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-mingw32
9253458e6c2Smrg	;;
9262becc446Smrg    *:MSYS*:*)
9273458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-msys
9283458e6c2Smrg	;;
9292c7c4e3dSmrg    i*:PW*:*)
9303458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-pw32
9313458e6c2Smrg	;;
93216d7e2f1Smrg    *:Interix*:*)
9333458e6c2Smrg	case $UNAME_MACHINE in
9348650bb69Smrg	    x86)
9353458e6c2Smrg		GUESS=i586-pc-interix$UNAME_RELEASE
9363458e6c2Smrg		;;
93716d7e2f1Smrg	    authenticamd | genuineintel | EM64T)
9383458e6c2Smrg		GUESS=x86_64-unknown-interix$UNAME_RELEASE
9393458e6c2Smrg		;;
9408650bb69Smrg	    IA64)
9413458e6c2Smrg		GUESS=ia64-unknown-interix$UNAME_RELEASE
9423458e6c2Smrg		;;
9438650bb69Smrg	esac ;;
9442c7c4e3dSmrg    i*:UWIN*:*)
9453458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-uwin
9463458e6c2Smrg	;;
9478650bb69Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
9483458e6c2Smrg	GUESS=x86_64-pc-cygwin
9493458e6c2Smrg	;;
9502c7c4e3dSmrg    prep*:SunOS:5.*:*)
9513458e6c2Smrg	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
9523458e6c2Smrg	GUESS=powerpcle-unknown-solaris2$SUN_REL
9533458e6c2Smrg	;;
9542c7c4e3dSmrg    *:GNU:*:*)
9558650bb69Smrg	# the GNU system
9563458e6c2Smrg	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
9573458e6c2Smrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
9583458e6c2Smrg	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
9593458e6c2Smrg	;;
9608650bb69Smrg    *:GNU/*:*:*)
9618650bb69Smrg	# other systems with GNU libc and userland
9623458e6c2Smrg	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
9633458e6c2Smrg	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
9643458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
9653458e6c2Smrg	;;
9663458e6c2Smrg    *:Minix:*:*)
9673458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-minix
9683458e6c2Smrg	;;
9692becc446Smrg    aarch64:Linux:*:*)
9703458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
9713458e6c2Smrg	;;
9722becc446Smrg    aarch64_be:Linux:*:*)
9732becc446Smrg	UNAME_MACHINE=aarch64_be
9743458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
9753458e6c2Smrg	;;
97616d7e2f1Smrg    alpha:Linux:*:*)
9773458e6c2Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
97816d7e2f1Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
97916d7e2f1Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
98016d7e2f1Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
98116d7e2f1Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
98216d7e2f1Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
98316d7e2f1Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
98416d7e2f1Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
9852becc446Smrg	esac
98616d7e2f1Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
9873458e6c2Smrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
9883458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
9893458e6c2Smrg	;;
9903458e6c2Smrg    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
9913458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
9923458e6c2Smrg	;;
9932c7c4e3dSmrg    arm*:Linux:*:*)
9943458e6c2Smrg	set_cc_for_build
9958650bb69Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
9968650bb69Smrg	    | grep -q __ARM_EABI__
9978650bb69Smrg	then
9983458e6c2Smrg	    GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
9998650bb69Smrg	else
10002becc446Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
10012becc446Smrg		| grep -q __ARM_PCS_VFP
10022becc446Smrg	    then
10033458e6c2Smrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
10042becc446Smrg	    else
10053458e6c2Smrg		GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
10062becc446Smrg	    fi
10078650bb69Smrg	fi
10083458e6c2Smrg	;;
10098650bb69Smrg    avr32*:Linux:*:*)
10103458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10113458e6c2Smrg	;;
10122c7c4e3dSmrg    cris:Linux:*:*)
10133458e6c2Smrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
10143458e6c2Smrg	;;
10158650bb69Smrg    crisv32:Linux:*:*)
10163458e6c2Smrg	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
10173458e6c2Smrg	;;
10183458e6c2Smrg    e2k:Linux:*:*)
10193458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10203458e6c2Smrg	;;
10218650bb69Smrg    frv:Linux:*:*)
10223458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10233458e6c2Smrg	;;
10242becc446Smrg    hexagon:Linux:*:*)
10253458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10263458e6c2Smrg	;;
102716d7e2f1Smrg    i*86:Linux:*:*)
10283458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
10293458e6c2Smrg	;;
10302c7c4e3dSmrg    ia64:Linux:*:*)
10313458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10323458e6c2Smrg	;;
10333458e6c2Smrg    k1om:Linux:*:*)
10343458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10353458e6c2Smrg	;;
10363458e6c2Smrg    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
10373458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10383458e6c2Smrg	;;
10398650bb69Smrg    m32r*:Linux:*:*)
10403458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10413458e6c2Smrg	;;
10422c7c4e3dSmrg    m68*:Linux:*:*)
10433458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10443458e6c2Smrg	;;
104516d7e2f1Smrg    mips:Linux:*:* | mips64:Linux:*:*)
10463458e6c2Smrg	set_cc_for_build
10473458e6c2Smrg	IS_GLIBC=0
10483458e6c2Smrg	test x"${LIBC}" = xgnu && IS_GLIBC=1
10493458e6c2Smrg	sed 's/^	//' << EOF > "$dummy.c"
10502c7c4e3dSmrg	#undef CPU
10513458e6c2Smrg	#undef mips
10523458e6c2Smrg	#undef mipsel
10533458e6c2Smrg	#undef mips64
10543458e6c2Smrg	#undef mips64el
10553458e6c2Smrg	#if ${IS_GLIBC} && defined(_ABI64)
10563458e6c2Smrg	LIBCABI=gnuabi64
10573458e6c2Smrg	#else
10583458e6c2Smrg	#if ${IS_GLIBC} && defined(_ABIN32)
10593458e6c2Smrg	LIBCABI=gnuabin32
10603458e6c2Smrg	#else
10613458e6c2Smrg	LIBCABI=${LIBC}
10623458e6c2Smrg	#endif
10633458e6c2Smrg	#endif
10643458e6c2Smrg
10653458e6c2Smrg	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
10663458e6c2Smrg	CPU=mipsisa64r6
10673458e6c2Smrg	#else
10683458e6c2Smrg	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
10693458e6c2Smrg	CPU=mipsisa32r6
10703458e6c2Smrg	#else
10713458e6c2Smrg	#if defined(__mips64)
10723458e6c2Smrg	CPU=mips64
10733458e6c2Smrg	#else
10743458e6c2Smrg	CPU=mips
10753458e6c2Smrg	#endif
10763458e6c2Smrg	#endif
10773458e6c2Smrg	#endif
10783458e6c2Smrg
10792c7c4e3dSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
10803458e6c2Smrg	MIPS_ENDIAN=el
10812c7c4e3dSmrg	#else
10822c7c4e3dSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
10833458e6c2Smrg	MIPS_ENDIAN=
10842c7c4e3dSmrg	#else
10853458e6c2Smrg	MIPS_ENDIAN=
10862c7c4e3dSmrg	#endif
10872c7c4e3dSmrg	#endif
10882c7c4e3dSmrgEOF
10893458e6c2Smrg	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
10903458e6c2Smrg	eval "$cc_set_vars"
10913458e6c2Smrg	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
10923458e6c2Smrg	;;
10933458e6c2Smrg    mips64el:Linux:*:*)
10943458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
10952c7c4e3dSmrg	;;
10962becc446Smrg    openrisc*:Linux:*:*)
10973458e6c2Smrg	GUESS=or1k-unknown-linux-$LIBC
10983458e6c2Smrg	;;
10992becc446Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
11003458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
11013458e6c2Smrg	;;
11028650bb69Smrg    padre:Linux:*:*)
11033458e6c2Smrg	GUESS=sparc-unknown-linux-$LIBC
11043458e6c2Smrg	;;
110516d7e2f1Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
11063458e6c2Smrg	GUESS=hppa64-unknown-linux-$LIBC
11073458e6c2Smrg	;;
11082c7c4e3dSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
11092c7c4e3dSmrg	# Look for CPU level
11102c7c4e3dSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
11113458e6c2Smrg	  PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
11123458e6c2Smrg	  PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
11133458e6c2Smrg	  *)    GUESS=hppa-unknown-linux-$LIBC ;;
11142c7c4e3dSmrg	esac
11153458e6c2Smrg	;;
111616d7e2f1Smrg    ppc64:Linux:*:*)
11173458e6c2Smrg	GUESS=powerpc64-unknown-linux-$LIBC
11183458e6c2Smrg	;;
111916d7e2f1Smrg    ppc:Linux:*:*)
11203458e6c2Smrg	GUESS=powerpc-unknown-linux-$LIBC
11213458e6c2Smrg	;;
11222becc446Smrg    ppc64le:Linux:*:*)
11233458e6c2Smrg	GUESS=powerpc64le-unknown-linux-$LIBC
11243458e6c2Smrg	;;
11252becc446Smrg    ppcle:Linux:*:*)
11263458e6c2Smrg	GUESS=powerpcle-unknown-linux-$LIBC
11273458e6c2Smrg	;;
11283458e6c2Smrg    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
11293458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
11303458e6c2Smrg	;;
11312c7c4e3dSmrg    s390:Linux:*:* | s390x:Linux:*:*)
11323458e6c2Smrg	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
11333458e6c2Smrg	;;
11342c7c4e3dSmrg    sh64*:Linux:*:*)
11353458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
11363458e6c2Smrg	;;
11372c7c4e3dSmrg    sh*:Linux:*:*)
11383458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
11393458e6c2Smrg	;;
11402c7c4e3dSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
11413458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
11423458e6c2Smrg	;;
114316d7e2f1Smrg    tile*:Linux:*:*)
11443458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
11453458e6c2Smrg	;;
11468650bb69Smrg    vax:Linux:*:*)
11473458e6c2Smrg	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
11483458e6c2Smrg	;;
11492c7c4e3dSmrg    x86_64:Linux:*:*)
11503458e6c2Smrg	set_cc_for_build
11513458e6c2Smrg	LIBCABI=$LIBC
11523458e6c2Smrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
11533458e6c2Smrg	    if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
11543458e6c2Smrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
11553458e6c2Smrg		grep IS_X32 >/dev/null
11563458e6c2Smrg	    then
11573458e6c2Smrg		LIBCABI=${LIBC}x32
11583458e6c2Smrg	    fi
11593458e6c2Smrg	fi
11603458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
11613458e6c2Smrg	;;
11628650bb69Smrg    xtensa*:Linux:*:*)
11633458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
11643458e6c2Smrg	;;
11652c7c4e3dSmrg    i*86:DYNIX/ptx:4*:*)
11662c7c4e3dSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
11672c7c4e3dSmrg	# earlier versions are messed up and put the nodename in both
11682c7c4e3dSmrg	# sysname and nodename.
11693458e6c2Smrg	GUESS=i386-sequent-sysv4
11703458e6c2Smrg	;;
11712c7c4e3dSmrg    i*86:UNIX_SV:4.2MP:2.*)
11722becc446Smrg	# Unixware is an offshoot of SVR4, but it has its own version
11732becc446Smrg	# number series starting with 2...
11742becc446Smrg	# I am not positive that other SVR4 systems won't match this,
11752c7c4e3dSmrg	# I just have to hope.  -- rms.
11762becc446Smrg	# Use sysv4.2uw... so that sysv4* matches it.
11773458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
11783458e6c2Smrg	;;
11792c7c4e3dSmrg    i*86:OS/2:*:*)
11802c7c4e3dSmrg	# If we were able to find `uname', then EMX Unix compatibility
11812c7c4e3dSmrg	# is probably installed.
11823458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-os2-emx
11833458e6c2Smrg	;;
11842c7c4e3dSmrg    i*86:XTS-300:*:STOP)
11853458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-stop
11863458e6c2Smrg	;;
11872c7c4e3dSmrg    i*86:atheos:*:*)
11883458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-atheos
11893458e6c2Smrg	;;
11908650bb69Smrg    i*86:syllable:*:*)
11913458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-syllable
11923458e6c2Smrg	;;
119316d7e2f1Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
11943458e6c2Smrg	GUESS=i386-unknown-lynxos$UNAME_RELEASE
11953458e6c2Smrg	;;
11962c7c4e3dSmrg    i*86:*DOS:*:*)
11973458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
11983458e6c2Smrg	;;
11993458e6c2Smrg    i*86:*:4.*:*)
12003458e6c2Smrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
12012c7c4e3dSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
12023458e6c2Smrg		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
12032c7c4e3dSmrg	else
12043458e6c2Smrg		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
12052c7c4e3dSmrg	fi
12063458e6c2Smrg	;;
12078650bb69Smrg    i*86:*:5:[678]*)
12082becc446Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
12092c7c4e3dSmrg	case `/bin/uname -X | grep "^Machine"` in
12102c7c4e3dSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
12112c7c4e3dSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
12122c7c4e3dSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
12132c7c4e3dSmrg	esac
12143458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
12153458e6c2Smrg	;;
12162c7c4e3dSmrg    i*86:*:3.2:*)
12172c7c4e3dSmrg	if test -f /usr/options/cb.name; then
12182c7c4e3dSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
12193458e6c2Smrg		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
12202c7c4e3dSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
12212c7c4e3dSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
12222c7c4e3dSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
12232c7c4e3dSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
12242c7c4e3dSmrg			&& UNAME_MACHINE=i586
12252c7c4e3dSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
12262c7c4e3dSmrg			&& UNAME_MACHINE=i686
12272c7c4e3dSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
12282c7c4e3dSmrg			&& UNAME_MACHINE=i686
12293458e6c2Smrg		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
12302c7c4e3dSmrg	else
12313458e6c2Smrg		GUESS=$UNAME_MACHINE-pc-sysv32
12322c7c4e3dSmrg	fi
12333458e6c2Smrg	;;
12342c7c4e3dSmrg    pc:*:*:*)
12352c7c4e3dSmrg	# Left here for compatibility:
12362becc446Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
12372becc446Smrg	# the processor, so we play safe by assuming i586.
12388650bb69Smrg	# Note: whatever this is, it MUST be the same as what config.sub
12393458e6c2Smrg	# prints for the "djgpp" host, or else GDB configure will decide that
12408650bb69Smrg	# this is a cross-build.
12413458e6c2Smrg	GUESS=i586-pc-msdosdjgpp
12423458e6c2Smrg	;;
12432c7c4e3dSmrg    Intel:Mach:3*:*)
12443458e6c2Smrg	GUESS=i386-pc-mach3
12453458e6c2Smrg	;;
12462c7c4e3dSmrg    paragon:*:*:*)
12473458e6c2Smrg	GUESS=i860-intel-osf1
12483458e6c2Smrg	;;
12492c7c4e3dSmrg    i860:*:4.*:*) # i860-SVR4
12502c7c4e3dSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
12513458e6c2Smrg	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
12522c7c4e3dSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
12533458e6c2Smrg	  GUESS=i860-unknown-sysv$UNAME_RELEASE     # Unknown i860-SVR4
12542c7c4e3dSmrg	fi
12553458e6c2Smrg	;;
12562c7c4e3dSmrg    mini*:CTIX:SYS*5:*)
12572c7c4e3dSmrg	# "miniframe"
12583458e6c2Smrg	GUESS=m68010-convergent-sysv
12593458e6c2Smrg	;;
12602c7c4e3dSmrg    mc68k:UNIX:SYSTEM5:3.51m)
12613458e6c2Smrg	GUESS=m68k-convergent-sysv
12623458e6c2Smrg	;;
12632c7c4e3dSmrg    M680?0:D-NIX:5.3:*)
12643458e6c2Smrg	GUESS=m68k-diab-dnix
12653458e6c2Smrg	;;
12668650bb69Smrg    M68*:*:R3V[5678]*:*)
12678650bb69Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
12688650bb69Smrg    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)
12692c7c4e3dSmrg	OS_REL=''
12702c7c4e3dSmrg	test -r /etc/.relid \
12712c7c4e3dSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
12722c7c4e3dSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
12733458e6c2Smrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
12742c7c4e3dSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
12753458e6c2Smrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
12762c7c4e3dSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
12772becc446Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
12782becc446Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
12798650bb69Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
12808650bb69Smrg	OS_REL='.3'
12818650bb69Smrg	test -r /etc/.relid \
12828650bb69Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
12838650bb69Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
12843458e6c2Smrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
12858650bb69Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
12863458e6c2Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
12878650bb69Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
12883458e6c2Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
12892c7c4e3dSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
12903458e6c2Smrg	GUESS=m68k-unknown-lynxos$UNAME_RELEASE
12913458e6c2Smrg	;;
12922c7c4e3dSmrg    mc68030:UNIX_System_V:4.*:*)
12933458e6c2Smrg	GUESS=m68k-atari-sysv4
12943458e6c2Smrg	;;
12952c7c4e3dSmrg    TSUNAMI:LynxOS:2.*:*)
12963458e6c2Smrg	GUESS=sparc-unknown-lynxos$UNAME_RELEASE
12973458e6c2Smrg	;;
12982c7c4e3dSmrg    rs6000:LynxOS:2.*:*)
12993458e6c2Smrg	GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
13003458e6c2Smrg	;;
130116d7e2f1Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
13023458e6c2Smrg	GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
13033458e6c2Smrg	;;
13042c7c4e3dSmrg    SM[BE]S:UNIX_SV:*:*)
13053458e6c2Smrg	GUESS=mips-dde-sysv$UNAME_RELEASE
13063458e6c2Smrg	;;
13072c7c4e3dSmrg    RM*:ReliantUNIX-*:*:*)
13083458e6c2Smrg	GUESS=mips-sni-sysv4
13093458e6c2Smrg	;;
13102c7c4e3dSmrg    RM*:SINIX-*:*:*)
13113458e6c2Smrg	GUESS=mips-sni-sysv4
13123458e6c2Smrg	;;
13132c7c4e3dSmrg    *:SINIX-*:*:*)
13142c7c4e3dSmrg	if uname -p 2>/dev/null >/dev/null ; then
13152c7c4e3dSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
13163458e6c2Smrg		GUESS=$UNAME_MACHINE-sni-sysv4
13172c7c4e3dSmrg	else
13183458e6c2Smrg		GUESS=ns32k-sni-sysv
13192c7c4e3dSmrg	fi
13203458e6c2Smrg	;;
13212becc446Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
13222becc446Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
13233458e6c2Smrg	GUESS=i586-unisys-sysv4
13243458e6c2Smrg	;;
13252c7c4e3dSmrg    *:UNIX_System_V:4*:FTX*)
13262c7c4e3dSmrg	# From Gerald Hewes <hewes@openmarket.com>.
13272c7c4e3dSmrg	# How about differentiating between stratus architectures? -djm
13283458e6c2Smrg	GUESS=hppa1.1-stratus-sysv4
13293458e6c2Smrg	;;
13302c7c4e3dSmrg    *:*:*:FTX*)
13312c7c4e3dSmrg	# From seanf@swdc.stratus.com.
13323458e6c2Smrg	GUESS=i860-stratus-sysv4
13333458e6c2Smrg	;;
13348650bb69Smrg    i*86:VOS:*:*)
13358650bb69Smrg	# From Paul.Green@stratus.com.
13363458e6c2Smrg	GUESS=$UNAME_MACHINE-stratus-vos
13373458e6c2Smrg	;;
13382c7c4e3dSmrg    *:VOS:*:*)
13392c7c4e3dSmrg	# From Paul.Green@stratus.com.
13403458e6c2Smrg	GUESS=hppa1.1-stratus-vos
13413458e6c2Smrg	;;
13422c7c4e3dSmrg    mc68*:A/UX:*:*)
13433458e6c2Smrg	GUESS=m68k-apple-aux$UNAME_RELEASE
13443458e6c2Smrg	;;
13452c7c4e3dSmrg    news*:NEWS-OS:6*:*)
13463458e6c2Smrg	GUESS=mips-sony-newsos6
13473458e6c2Smrg	;;
13482c7c4e3dSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
13493458e6c2Smrg	if test -d /usr/nec; then
13503458e6c2Smrg		GUESS=mips-nec-sysv$UNAME_RELEASE
13512c7c4e3dSmrg	else
13523458e6c2Smrg		GUESS=mips-unknown-sysv$UNAME_RELEASE
13532c7c4e3dSmrg	fi
13543458e6c2Smrg	;;
13552c7c4e3dSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
13563458e6c2Smrg	GUESS=powerpc-be-beos
13573458e6c2Smrg	;;
13582c7c4e3dSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
13593458e6c2Smrg	GUESS=powerpc-apple-beos
13603458e6c2Smrg	;;
13612c7c4e3dSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
13623458e6c2Smrg	GUESS=i586-pc-beos
13633458e6c2Smrg	;;
13648650bb69Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
13653458e6c2Smrg	GUESS=i586-pc-haiku
13663458e6c2Smrg	;;
13672becc446Smrg    x86_64:Haiku:*:*)
13683458e6c2Smrg	GUESS=x86_64-unknown-haiku
13693458e6c2Smrg	;;
13702c7c4e3dSmrg    SX-4:SUPER-UX:*:*)
13713458e6c2Smrg	GUESS=sx4-nec-superux$UNAME_RELEASE
13723458e6c2Smrg	;;
13732c7c4e3dSmrg    SX-5:SUPER-UX:*:*)
13743458e6c2Smrg	GUESS=sx5-nec-superux$UNAME_RELEASE
13753458e6c2Smrg	;;
13762c7c4e3dSmrg    SX-6:SUPER-UX:*:*)
13773458e6c2Smrg	GUESS=sx6-nec-superux$UNAME_RELEASE
13783458e6c2Smrg	;;
13798650bb69Smrg    SX-7:SUPER-UX:*:*)
13803458e6c2Smrg	GUESS=sx7-nec-superux$UNAME_RELEASE
13813458e6c2Smrg	;;
13828650bb69Smrg    SX-8:SUPER-UX:*:*)
13833458e6c2Smrg	GUESS=sx8-nec-superux$UNAME_RELEASE
13843458e6c2Smrg	;;
13858650bb69Smrg    SX-8R:SUPER-UX:*:*)
13863458e6c2Smrg	GUESS=sx8r-nec-superux$UNAME_RELEASE
13873458e6c2Smrg	;;
13883458e6c2Smrg    SX-ACE:SUPER-UX:*:*)
13893458e6c2Smrg	GUESS=sxace-nec-superux$UNAME_RELEASE
13903458e6c2Smrg	;;
13912c7c4e3dSmrg    Power*:Rhapsody:*:*)
13923458e6c2Smrg	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
13933458e6c2Smrg	;;
13942c7c4e3dSmrg    *:Rhapsody:*:*)
13953458e6c2Smrg	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
13963458e6c2Smrg	;;
13973458e6c2Smrg    arm64:Darwin:*:*)
13983458e6c2Smrg	GUESS=aarch64-apple-darwin$UNAME_RELEASE
13993458e6c2Smrg	;;
14002c7c4e3dSmrg    *:Darwin:*:*)
14013458e6c2Smrg	UNAME_PROCESSOR=`uname -p`
14023458e6c2Smrg	case $UNAME_PROCESSOR in
14033458e6c2Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
14043458e6c2Smrg	esac
14053458e6c2Smrg	if command -v xcode-select > /dev/null 2> /dev/null && \
14063458e6c2Smrg		! xcode-select --print-path > /dev/null 2> /dev/null ; then
14073458e6c2Smrg	    # Avoid executing cc if there is no toolchain installed as
14083458e6c2Smrg	    # cc will be a stub that puts up a graphical alert
14093458e6c2Smrg	    # prompting the user to install developer tools.
14103458e6c2Smrg	    CC_FOR_BUILD=no_compiler_found
14113458e6c2Smrg	else
14123458e6c2Smrg	    set_cc_for_build
14132becc446Smrg	fi
14143458e6c2Smrg	if test "$CC_FOR_BUILD" != no_compiler_found; then
14153458e6c2Smrg	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
14163458e6c2Smrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
14173458e6c2Smrg		   grep IS_64BIT_ARCH >/dev/null
14183458e6c2Smrg	    then
14193458e6c2Smrg		case $UNAME_PROCESSOR in
14203458e6c2Smrg		    i386) UNAME_PROCESSOR=x86_64 ;;
14213458e6c2Smrg		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
14223458e6c2Smrg		esac
14233458e6c2Smrg	    fi
14243458e6c2Smrg	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
14253458e6c2Smrg	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
14263458e6c2Smrg		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
14273458e6c2Smrg		   grep IS_PPC >/dev/null
14283458e6c2Smrg	    then
14293458e6c2Smrg		UNAME_PROCESSOR=powerpc
14302becc446Smrg	    fi
14312becc446Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
14323458e6c2Smrg	    # uname -m returns i386 or x86_64
14333458e6c2Smrg	    UNAME_PROCESSOR=$UNAME_MACHINE
14342becc446Smrg	fi
14353458e6c2Smrg	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
14363458e6c2Smrg	;;
14372c7c4e3dSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
14382c7c4e3dSmrg	UNAME_PROCESSOR=`uname -p`
14393458e6c2Smrg	if test "$UNAME_PROCESSOR" = x86; then
14402c7c4e3dSmrg		UNAME_PROCESSOR=i386
14412c7c4e3dSmrg		UNAME_MACHINE=pc
14422c7c4e3dSmrg	fi
14433458e6c2Smrg	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
14443458e6c2Smrg	;;
14452c7c4e3dSmrg    *:QNX:*:4*)
14463458e6c2Smrg	GUESS=i386-pc-qnx
14473458e6c2Smrg	;;
14483458e6c2Smrg    NEO-*:NONSTOP_KERNEL:*:*)
14493458e6c2Smrg	GUESS=neo-tandem-nsk$UNAME_RELEASE
14503458e6c2Smrg	;;
14512becc446Smrg    NSE-*:NONSTOP_KERNEL:*:*)
14523458e6c2Smrg	GUESS=nse-tandem-nsk$UNAME_RELEASE
14533458e6c2Smrg	;;
14543458e6c2Smrg    NSR-*:NONSTOP_KERNEL:*:*)
14553458e6c2Smrg	GUESS=nsr-tandem-nsk$UNAME_RELEASE
14563458e6c2Smrg	;;
14573458e6c2Smrg    NSV-*:NONSTOP_KERNEL:*:*)
14583458e6c2Smrg	GUESS=nsv-tandem-nsk$UNAME_RELEASE
14593458e6c2Smrg	;;
14603458e6c2Smrg    NSX-*:NONSTOP_KERNEL:*:*)
14613458e6c2Smrg	GUESS=nsx-tandem-nsk$UNAME_RELEASE
14623458e6c2Smrg	;;
14632c7c4e3dSmrg    *:NonStop-UX:*:*)
14643458e6c2Smrg	GUESS=mips-compaq-nonstopux
14653458e6c2Smrg	;;
14662c7c4e3dSmrg    BS2000:POSIX*:*:*)
14673458e6c2Smrg	GUESS=bs2000-siemens-sysv
14683458e6c2Smrg	;;
14692c7c4e3dSmrg    DS/*:UNIX_System_V:*:*)
14703458e6c2Smrg	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
14713458e6c2Smrg	;;
14722c7c4e3dSmrg    *:Plan9:*:*)
14732c7c4e3dSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
14742c7c4e3dSmrg	# is converted to i386 for consistency with other x86
14752c7c4e3dSmrg	# operating systems.
14763458e6c2Smrg	if test "${cputype-}" = 386; then
14772c7c4e3dSmrg	    UNAME_MACHINE=i386
14783458e6c2Smrg	elif test "x${cputype-}" != x; then
14793458e6c2Smrg	    UNAME_MACHINE=$cputype
14802c7c4e3dSmrg	fi
14813458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-plan9
14823458e6c2Smrg	;;
14832c7c4e3dSmrg    *:TOPS-10:*:*)
14843458e6c2Smrg	GUESS=pdp10-unknown-tops10
14853458e6c2Smrg	;;
14862c7c4e3dSmrg    *:TENEX:*:*)
14873458e6c2Smrg	GUESS=pdp10-unknown-tenex
14883458e6c2Smrg	;;
14892c7c4e3dSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
14903458e6c2Smrg	GUESS=pdp10-dec-tops20
14913458e6c2Smrg	;;
14922c7c4e3dSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
14933458e6c2Smrg	GUESS=pdp10-xkl-tops20
14943458e6c2Smrg	;;
14952c7c4e3dSmrg    *:TOPS-20:*:*)
14963458e6c2Smrg	GUESS=pdp10-unknown-tops20
14973458e6c2Smrg	;;
14982c7c4e3dSmrg    *:ITS:*:*)
14993458e6c2Smrg	GUESS=pdp10-unknown-its
15003458e6c2Smrg	;;
15012c7c4e3dSmrg    SEI:*:*:SEIUX)
15023458e6c2Smrg	GUESS=mips-sei-seiux$UNAME_RELEASE
15033458e6c2Smrg	;;
15048650bb69Smrg    *:DragonFly:*:*)
15053458e6c2Smrg	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
15063458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
15073458e6c2Smrg	;;
15088650bb69Smrg    *:*VMS:*:*)
15092becc446Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
15103458e6c2Smrg	case $UNAME_MACHINE in
15113458e6c2Smrg	    A*) GUESS=alpha-dec-vms ;;
15123458e6c2Smrg	    I*) GUESS=ia64-dec-vms ;;
15133458e6c2Smrg	    V*) GUESS=vax-dec-vms ;;
15148650bb69Smrg	esac ;;
15158650bb69Smrg    *:XENIX:*:SysV)
15163458e6c2Smrg	GUESS=i386-pc-xenix
15173458e6c2Smrg	;;
15188650bb69Smrg    i*86:skyos:*:*)
15193458e6c2Smrg	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
15203458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
15213458e6c2Smrg	;;
15228650bb69Smrg    i*86:rdos:*:*)
15233458e6c2Smrg	GUESS=$UNAME_MACHINE-pc-rdos
15243458e6c2Smrg	;;
15253458e6c2Smrg    *:AROS:*:*)
15263458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-aros
15273458e6c2Smrg	;;
15282becc446Smrg    x86_64:VMkernel:*:*)
15293458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-esx
15303458e6c2Smrg	;;
15313458e6c2Smrg    amd64:Isilon\ OneFS:*:*)
15323458e6c2Smrg	GUESS=x86_64-unknown-onefs
15333458e6c2Smrg	;;
15343458e6c2Smrg    *:Unleashed:*:*)
15353458e6c2Smrg	GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
15363458e6c2Smrg	;;
15373458e6c2Smrgesac
15383458e6c2Smrg
15393458e6c2Smrg# Do we have a guess based on uname results?
15403458e6c2Smrgif test "x$GUESS" != x; then
15413458e6c2Smrg    echo "$GUESS"
15423458e6c2Smrg    exit
15433458e6c2Smrgfi
15443458e6c2Smrg
15453458e6c2Smrg# No uname command or uname output not recognized.
15463458e6c2Smrgset_cc_for_build
15473458e6c2Smrgcat > "$dummy.c" <<EOF
15483458e6c2Smrg#ifdef _SEQUENT_
15493458e6c2Smrg#include <sys/types.h>
15503458e6c2Smrg#include <sys/utsname.h>
15513458e6c2Smrg#endif
15523458e6c2Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
15533458e6c2Smrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
15543458e6c2Smrg#include <signal.h>
15553458e6c2Smrg#if defined(_SIZE_T_) || defined(SIGLOST)
15563458e6c2Smrg#include <sys/utsname.h>
15573458e6c2Smrg#endif
15583458e6c2Smrg#endif
15593458e6c2Smrg#endif
15603458e6c2Smrgmain ()
15613458e6c2Smrg{
15623458e6c2Smrg#if defined (sony)
15633458e6c2Smrg#if defined (MIPSEB)
15643458e6c2Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
15653458e6c2Smrg     I don't know....  */
15663458e6c2Smrg  printf ("mips-sony-bsd\n"); exit (0);
15673458e6c2Smrg#else
15683458e6c2Smrg#include <sys/param.h>
15693458e6c2Smrg  printf ("m68k-sony-newsos%s\n",
15703458e6c2Smrg#ifdef NEWSOS4
15713458e6c2Smrg  "4"
15723458e6c2Smrg#else
15733458e6c2Smrg  ""
15743458e6c2Smrg#endif
15753458e6c2Smrg  ); exit (0);
15763458e6c2Smrg#endif
15773458e6c2Smrg#endif
15783458e6c2Smrg
15793458e6c2Smrg#if defined (NeXT)
15803458e6c2Smrg#if !defined (__ARCHITECTURE__)
15813458e6c2Smrg#define __ARCHITECTURE__ "m68k"
15823458e6c2Smrg#endif
15833458e6c2Smrg  int version;
15843458e6c2Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
15853458e6c2Smrg  if (version < 4)
15863458e6c2Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
15873458e6c2Smrg  else
15883458e6c2Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
15893458e6c2Smrg  exit (0);
15903458e6c2Smrg#endif
15913458e6c2Smrg
15923458e6c2Smrg#if defined (MULTIMAX) || defined (n16)
15933458e6c2Smrg#if defined (UMAXV)
15943458e6c2Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
15953458e6c2Smrg#else
15963458e6c2Smrg#if defined (CMU)
15973458e6c2Smrg  printf ("ns32k-encore-mach\n"); exit (0);
15983458e6c2Smrg#else
15993458e6c2Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
16003458e6c2Smrg#endif
16013458e6c2Smrg#endif
16023458e6c2Smrg#endif
16033458e6c2Smrg
16043458e6c2Smrg#if defined (__386BSD__)
16053458e6c2Smrg  printf ("i386-pc-bsd\n"); exit (0);
16063458e6c2Smrg#endif
16073458e6c2Smrg
16083458e6c2Smrg#if defined (sequent)
16093458e6c2Smrg#if defined (i386)
16103458e6c2Smrg  printf ("i386-sequent-dynix\n"); exit (0);
16113458e6c2Smrg#endif
16123458e6c2Smrg#if defined (ns32000)
16133458e6c2Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
16143458e6c2Smrg#endif
16153458e6c2Smrg#endif
16163458e6c2Smrg
16173458e6c2Smrg#if defined (_SEQUENT_)
16183458e6c2Smrg  struct utsname un;
16193458e6c2Smrg
16203458e6c2Smrg  uname(&un);
16213458e6c2Smrg  if (strncmp(un.version, "V2", 2) == 0) {
16223458e6c2Smrg    printf ("i386-sequent-ptx2\n"); exit (0);
16233458e6c2Smrg  }
16243458e6c2Smrg  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
16253458e6c2Smrg    printf ("i386-sequent-ptx1\n"); exit (0);
16263458e6c2Smrg  }
16273458e6c2Smrg  printf ("i386-sequent-ptx\n"); exit (0);
16283458e6c2Smrg#endif
16293458e6c2Smrg
16303458e6c2Smrg#if defined (vax)
16313458e6c2Smrg#if !defined (ultrix)
16323458e6c2Smrg#include <sys/param.h>
16333458e6c2Smrg#if defined (BSD)
16343458e6c2Smrg#if BSD == 43
16353458e6c2Smrg  printf ("vax-dec-bsd4.3\n"); exit (0);
16363458e6c2Smrg#else
16373458e6c2Smrg#if BSD == 199006
16383458e6c2Smrg  printf ("vax-dec-bsd4.3reno\n"); exit (0);
16393458e6c2Smrg#else
16403458e6c2Smrg  printf ("vax-dec-bsd\n"); exit (0);
16413458e6c2Smrg#endif
16423458e6c2Smrg#endif
16433458e6c2Smrg#else
16443458e6c2Smrg  printf ("vax-dec-bsd\n"); exit (0);
16453458e6c2Smrg#endif
16463458e6c2Smrg#else
16473458e6c2Smrg#if defined(_SIZE_T_) || defined(SIGLOST)
16483458e6c2Smrg  struct utsname un;
16493458e6c2Smrg  uname (&un);
16503458e6c2Smrg  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
16513458e6c2Smrg#else
16523458e6c2Smrg  printf ("vax-dec-ultrix\n"); exit (0);
16533458e6c2Smrg#endif
16543458e6c2Smrg#endif
16553458e6c2Smrg#endif
16563458e6c2Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
16573458e6c2Smrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
16583458e6c2Smrg#if defined(_SIZE_T_) || defined(SIGLOST)
16593458e6c2Smrg  struct utsname *un;
16603458e6c2Smrg  uname (&un);
16613458e6c2Smrg  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
16623458e6c2Smrg#else
16633458e6c2Smrg  printf ("mips-dec-ultrix\n"); exit (0);
16643458e6c2Smrg#endif
16653458e6c2Smrg#endif
16663458e6c2Smrg#endif
16673458e6c2Smrg
16683458e6c2Smrg#if defined (alliant) && defined (i860)
16693458e6c2Smrg  printf ("i860-alliant-bsd\n"); exit (0);
16703458e6c2Smrg#endif
16713458e6c2Smrg
16723458e6c2Smrg  exit (1);
16733458e6c2Smrg}
16743458e6c2SmrgEOF
16753458e6c2Smrg
16763458e6c2Smrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
16773458e6c2Smrg	{ echo "$SYSTEM_NAME"; exit; }
16783458e6c2Smrg
16793458e6c2Smrg# Apollos put the system type in the environment.
16803458e6c2Smrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
16813458e6c2Smrg
16823458e6c2Smrgecho "$0: unable to guess system type" >&2
16833458e6c2Smrg
16843458e6c2Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM in
16853458e6c2Smrg    mips:Linux | mips64:Linux)
16863458e6c2Smrg	# If we got here on MIPS GNU/Linux, output extra information.
16873458e6c2Smrg	cat >&2 <<EOF
16883458e6c2Smrg
16893458e6c2SmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
16903458e6c2Smrgthe system type. Please install a C compiler and try again.
16913458e6c2SmrgEOF
16923458e6c2Smrg	;;
16932becc446Smrgesac
16942c7c4e3dSmrg
16952c7c4e3dSmrgcat >&2 <<EOF
16962c7c4e3dSmrg
16973458e6c2SmrgThis script (version $timestamp), has failed to recognize the
16983458e6c2Smrgoperating system you are using. If your script is old, overwrite *all*
16993458e6c2Smrgcopies of config.guess and config.sub with the latest versions from:
17002c7c4e3dSmrg
17013458e6c2Smrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
17028650bb69Smrgand
17033458e6c2Smrg  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
17043458e6c2SmrgEOF
17052c7c4e3dSmrg
17063458e6c2Smrgour_year=`echo $timestamp | sed 's,-.*,,'`
17073458e6c2Smrgthisyear=`date +%Y`
17083458e6c2Smrg# shellcheck disable=SC2003
17093458e6c2Smrgscript_age=`expr "$thisyear" - "$our_year"`
17103458e6c2Smrgif test "$script_age" -lt 3 ; then
17113458e6c2Smrg   cat >&2 <<EOF
17123458e6c2Smrg
17133458e6c2SmrgIf $0 has already been updated, send the following data and any
17143458e6c2Smrginformation you think might be pertinent to config-patches@gnu.org to
17153458e6c2Smrgprovide the necessary information to handle your system.
17162c7c4e3dSmrg
17172c7c4e3dSmrgconfig.guess timestamp = $timestamp
17182c7c4e3dSmrg
17192c7c4e3dSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
17202c7c4e3dSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
17212c7c4e3dSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
17222c7c4e3dSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
17232c7c4e3dSmrg
17242c7c4e3dSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
17252c7c4e3dSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
17262c7c4e3dSmrg
17272c7c4e3dSmrghostinfo               = `(hostinfo) 2>/dev/null`
17282c7c4e3dSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
17292c7c4e3dSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
17302c7c4e3dSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
17312c7c4e3dSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
17322c7c4e3dSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
17332c7c4e3dSmrg
17343458e6c2SmrgUNAME_MACHINE = "$UNAME_MACHINE"
17353458e6c2SmrgUNAME_RELEASE = "$UNAME_RELEASE"
17363458e6c2SmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
17373458e6c2SmrgUNAME_VERSION = "$UNAME_VERSION"
17382c7c4e3dSmrgEOF
17393458e6c2Smrgfi
17402c7c4e3dSmrg
17412c7c4e3dSmrgexit 1
17422c7c4e3dSmrg
17432c7c4e3dSmrg# Local variables:
17443458e6c2Smrg# eval: (add-hook 'before-save-hook 'time-stamp)
17452c7c4e3dSmrg# time-stamp-start: "timestamp='"
17462c7c4e3dSmrg# time-stamp-format: "%:y-%02m-%02d"
17472c7c4e3dSmrg# time-stamp-end: "'"
17482c7c4e3dSmrg# End:
1749