Blame SOURCES/libsodium-1.0.18/build-aux/config.guess

ca16be
#! /bin/sh
ca16be
# Attempt to guess a canonical system name.
ca16be
#   Copyright 1992-2019 Free Software Foundation, Inc.
ca16be
ca16be
timestamp='2019-05-28'
ca16be
ca16be
# This file is free software; you can redistribute it and/or modify it
ca16be
# under the terms of the GNU General Public License as published by
ca16be
# the Free Software Foundation; either version 3 of the License, or
ca16be
# (at your option) any later version.
ca16be
#
ca16be
# This program is distributed in the hope that it will be useful, but
ca16be
# WITHOUT ANY WARRANTY; without even the implied warranty of
ca16be
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ca16be
# General Public License for more details.
ca16be
#
ca16be
# You should have received a copy of the GNU General Public License
ca16be
# along with this program; if not, see <https://www.gnu.org/licenses/>.
ca16be
#
ca16be
# As a special exception to the GNU General Public License, if you
ca16be
# distribute this file as part of a program that contains a
ca16be
# configuration script generated by Autoconf, you may include it under
ca16be
# the same distribution terms that you use for the rest of that
ca16be
# program.  This Exception is an additional permission under section 7
ca16be
# of the GNU General Public License, version 3 ("GPLv3").
ca16be
#
ca16be
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
ca16be
#
ca16be
# You can get the latest version of this script from:
ca16be
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
ca16be
#
ca16be
# Please send patches to <config-patches@gnu.org>.
ca16be
ca16be
ca16be
me=`echo "$0" | sed -e 's,.*/,,'`
ca16be
ca16be
usage="\
ca16be
Usage: $0 [OPTION]
ca16be
ca16be
Output the configuration name of the system \`$me' is run on.
ca16be
ca16be
Options:
ca16be
  -h, --help         print this help, then exit
ca16be
  -t, --time-stamp   print date of last modification, then exit
ca16be
  -v, --version      print version number, then exit
ca16be
ca16be
Report bugs and patches to <config-patches@gnu.org>."
ca16be
ca16be
version="\
ca16be
GNU config.guess ($timestamp)
ca16be
ca16be
Originally written by Per Bothner.
ca16be
Copyright 1992-2019 Free Software Foundation, Inc.
ca16be
ca16be
This is free software; see the source for copying conditions.  There is NO
ca16be
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
ca16be
ca16be
help="
ca16be
Try \`$me --help' for more information."
ca16be
ca16be
# Parse command line
ca16be
while test $# -gt 0 ; do
ca16be
  case $1 in
ca16be
    --time-stamp | --time* | -t )
ca16be
       echo "$timestamp" ; exit ;;
ca16be
    --version | -v )
ca16be
       echo "$version" ; exit ;;
ca16be
    --help | --h* | -h )
ca16be
       echo "$usage"; exit ;;
ca16be
    -- )     # Stop option processing
ca16be
       shift; break ;;
ca16be
    - )	# Use stdin as input.
ca16be
       break ;;
ca16be
    -* )
ca16be
       echo "$me: invalid option $1$help" >&2
ca16be
       exit 1 ;;
ca16be
    * )
ca16be
       break ;;
ca16be
  esac
ca16be
done
ca16be
ca16be
if test $# != 0; then
ca16be
  echo "$me: too many arguments$help" >&2
ca16be
  exit 1
ca16be
fi
ca16be
ca16be
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
ca16be
# compiler to aid in system detection is discouraged as it requires
ca16be
# temporary files to be created and, as you can see below, it is a
ca16be
# headache to deal with in a portable fashion.
ca16be
ca16be
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
ca16be
# use `HOST_CC' if defined, but it is deprecated.
ca16be
ca16be
# Portable tmp directory creation inspired by the Autoconf team.
ca16be
ca16be
tmp=
ca16be
# shellcheck disable=SC2172
ca16be
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
ca16be
ca16be
set_cc_for_build() {
ca16be
    : "${TMPDIR=/tmp}"
ca16be
    # shellcheck disable=SC2039
ca16be
    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
ca16be
	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
ca16be
	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
ca16be
	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
ca16be
    dummy=$tmp/dummy
ca16be
    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
ca16be
	,,)    echo "int x;" > "$dummy.c"
ca16be
	       for driver in cc gcc c89 c99 ; do
ca16be
		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
ca16be
		       CC_FOR_BUILD="$driver"
ca16be
		       break
ca16be
		   fi
ca16be
	       done
ca16be
	       if test x"$CC_FOR_BUILD" = x ; then
ca16be
		   CC_FOR_BUILD=no_compiler_found
ca16be
	       fi
ca16be
	       ;;
ca16be
	,,*)   CC_FOR_BUILD=$CC ;;
ca16be
	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
ca16be
    esac
ca16be
}
ca16be
ca16be
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
ca16be
# (ghazi@noc.rutgers.edu 1994-08-24)
ca16be
if test -f /.attbin/uname ; then
ca16be
	PATH=$PATH:/.attbin ; export PATH
ca16be
fi
ca16be
ca16be
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
ca16be
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
ca16be
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
ca16be
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
ca16be
ca16be
case "$UNAME_SYSTEM" in
ca16be
Linux|GNU|GNU/*)
ca16be
	# If the system lacks a compiler, then just pick glibc.
ca16be
	# We could probably try harder.
ca16be
	LIBC=gnu
ca16be
ca16be
	set_cc_for_build
ca16be
	cat <<-EOF > "$dummy.c"
ca16be
	#include <features.h>
ca16be
	#if defined(__UCLIBC__)
ca16be
	LIBC=uclibc
ca16be
	#elif defined(__dietlibc__)
ca16be
	LIBC=dietlibc
ca16be
	#else
ca16be
	LIBC=gnu
ca16be
	#endif
ca16be
	EOF
ca16be
	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
ca16be
ca16be
	# If ldd exists, use it to detect musl libc.
ca16be
	if command -v ldd >/dev/null && \
ca16be
		ldd --version 2>&1 | grep -q ^musl
ca16be
	then
ca16be
	    LIBC=musl
ca16be
	fi
ca16be
	;;
ca16be
esac
ca16be
ca16be
# Note: order is significant - the case branches are not exclusive.
ca16be
ca16be
case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
ca16be
    *:NetBSD:*:*)
ca16be
	# NetBSD (nbsd) targets should (where applicable) match one or
ca16be
	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
ca16be
	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
ca16be
	# switched to ELF, *-*-netbsd* would select the old
ca16be
	# object file format.  This provides both forward
ca16be
	# compatibility and a consistent mechanism for selecting the
ca16be
	# object file format.
ca16be
	#
ca16be
	# Note: NetBSD doesn't particularly care about the vendor
ca16be
	# portion of the name.  We always set it to "unknown".
ca16be
	sysctl="sysctl -n hw.machine_arch"
ca16be
	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
ca16be
	    "/sbin/$sysctl" 2>/dev/null || \
ca16be
	    "/usr/sbin/$sysctl" 2>/dev/null || \
ca16be
	    echo unknown)`
ca16be
	case "$UNAME_MACHINE_ARCH" in
ca16be
	    armeb) machine=armeb-unknown ;;
ca16be
	    arm*) machine=arm-unknown ;;
ca16be
	    sh3el) machine=shl-unknown ;;
ca16be
	    sh3eb) machine=sh-unknown ;;
ca16be
	    sh5el) machine=sh5le-unknown ;;
ca16be
	    earmv*)
ca16be
		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
ca16be
		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
ca16be
		machine="${arch}${endian}"-unknown
ca16be
		;;
ca16be
	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
ca16be
	esac
ca16be
	# The Operating System including object format, if it has switched
ca16be
	# to ELF recently (or will in the future) and ABI.
ca16be
	case "$UNAME_MACHINE_ARCH" in
ca16be
	    earm*)
ca16be
		os=netbsdelf
ca16be
		;;
ca16be
	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
ca16be
		set_cc_for_build
ca16be
		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
ca16be
			| grep -q __ELF__
ca16be
		then
ca16be
		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
ca16be
		    # Return netbsd for either.  FIX?
ca16be
		    os=netbsd
ca16be
		else
ca16be
		    os=netbsdelf
ca16be
		fi
ca16be
		;;
ca16be
	    *)
ca16be
		os=netbsd
ca16be
		;;
ca16be
	esac
ca16be
	# Determine ABI tags.
ca16be
	case "$UNAME_MACHINE_ARCH" in
ca16be
	    earm*)
ca16be
		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
ca16be
		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
ca16be
		;;
ca16be
	esac
ca16be
	# The OS release
ca16be
	# Debian GNU/NetBSD machines have a different userland, and
ca16be
	# thus, need a distinct triplet. However, they do not need
ca16be
	# kernel version information, so it can be replaced with a
ca16be
	# suitable tag, in the style of linux-gnu.
ca16be
	case "$UNAME_VERSION" in
ca16be
	    Debian*)
ca16be
		release='-gnu'
ca16be
		;;
ca16be
	    *)
ca16be
		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
ca16be
		;;
ca16be
	esac
ca16be
	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
ca16be
	# contains redundant information, the shorter form:
ca16be
	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
ca16be
	echo "$machine-${os}${release}${abi-}"
ca16be
	exit ;;
ca16be
    *:Bitrig:*:*)
ca16be
	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
ca16be
	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:OpenBSD:*:*)
ca16be
	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
ca16be
	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:LibertyBSD:*:*)
ca16be
	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
ca16be
	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:MidnightBSD:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:ekkoBSD:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:SolidBSD:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    macppc:MirBSD:*:*)
ca16be
	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:MirBSD:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:Sortix:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-sortix
ca16be
	exit ;;
ca16be
    *:Redox:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-redox
ca16be
	exit ;;
ca16be
    mips:OSF1:*.*)
ca16be
        echo mips-dec-osf1
ca16be
        exit ;;
ca16be
    alpha:OSF1:*:*)
ca16be
	case $UNAME_RELEASE in
ca16be
	*4.0)
ca16be
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
ca16be
		;;
ca16be
	*5.*)
ca16be
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
ca16be
		;;
ca16be
	esac
ca16be
	# According to Compaq, /usr/sbin/psrinfo has been available on
ca16be
	# OSF/1 and Tru64 systems produced since 1995.  I hope that
ca16be
	# covers most systems running today.  This code pipes the CPU
ca16be
	# types through head -n 1, so we only detect the type of CPU 0.
ca16be
	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
ca16be
	case "$ALPHA_CPU_TYPE" in
ca16be
	    "EV4 (21064)")
ca16be
		UNAME_MACHINE=alpha ;;
ca16be
	    "EV4.5 (21064)")
ca16be
		UNAME_MACHINE=alpha ;;
ca16be
	    "LCA4 (21066/21068)")
ca16be
		UNAME_MACHINE=alpha ;;
ca16be
	    "EV5 (21164)")
ca16be
		UNAME_MACHINE=alphaev5 ;;
ca16be
	    "EV5.6 (21164A)")
ca16be
		UNAME_MACHINE=alphaev56 ;;
ca16be
	    "EV5.6 (21164PC)")
ca16be
		UNAME_MACHINE=alphapca56 ;;
ca16be
	    "EV5.7 (21164PC)")
ca16be
		UNAME_MACHINE=alphapca57 ;;
ca16be
	    "EV6 (21264)")
ca16be
		UNAME_MACHINE=alphaev6 ;;
ca16be
	    "EV6.7 (21264A)")
ca16be
		UNAME_MACHINE=alphaev67 ;;
ca16be
	    "EV6.8CB (21264C)")
ca16be
		UNAME_MACHINE=alphaev68 ;;
ca16be
	    "EV6.8AL (21264B)")
ca16be
		UNAME_MACHINE=alphaev68 ;;
ca16be
	    "EV6.8CX (21264D)")
ca16be
		UNAME_MACHINE=alphaev68 ;;
ca16be
	    "EV6.9A (21264/EV69A)")
ca16be
		UNAME_MACHINE=alphaev69 ;;
ca16be
	    "EV7 (21364)")
ca16be
		UNAME_MACHINE=alphaev7 ;;
ca16be
	    "EV7.9 (21364A)")
ca16be
		UNAME_MACHINE=alphaev79 ;;
ca16be
	esac
ca16be
	# A Pn.n version is a patched version.
ca16be
	# A Vn.n version is a released version.
ca16be
	# A Tn.n version is a released field test version.
ca16be
	# A Xn.n version is an unreleased experimental baselevel.
ca16be
	# 1.2 uses "1.2" for uname -r.
ca16be
	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
ca16be
	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
ca16be
	exitcode=$?
ca16be
	trap '' 0
ca16be
	exit $exitcode ;;
ca16be
    Amiga*:UNIX_System_V:4.0:*)
ca16be
	echo m68k-unknown-sysv4
ca16be
	exit ;;
ca16be
    *:[Aa]miga[Oo][Ss]:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-amigaos
ca16be
	exit ;;
ca16be
    *:[Mm]orph[Oo][Ss]:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-morphos
ca16be
	exit ;;
ca16be
    *:OS/390:*:*)
ca16be
	echo i370-ibm-openedition
ca16be
	exit ;;
ca16be
    *:z/VM:*:*)
ca16be
	echo s390-ibm-zvmoe
ca16be
	exit ;;
ca16be
    *:OS400:*:*)
ca16be
	echo powerpc-ibm-os400
ca16be
	exit ;;
ca16be
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
ca16be
	echo arm-acorn-riscix"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    arm*:riscos:*:*|arm*:RISCOS:*:*)
ca16be
	echo arm-unknown-riscos
ca16be
	exit ;;
ca16be
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
ca16be
	echo hppa1.1-hitachi-hiuxmpp
ca16be
	exit ;;
ca16be
    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
ca16be
	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
ca16be
	if test "`(/bin/universe) 2>/dev/null`" = att ; then
ca16be
		echo pyramid-pyramid-sysv3
ca16be
	else
ca16be
		echo pyramid-pyramid-bsd
ca16be
	fi
ca16be
	exit ;;
ca16be
    NILE*:*:*:dcosx)
ca16be
	echo pyramid-pyramid-svr4
ca16be
	exit ;;
ca16be
    DRS?6000:unix:4.0:6*)
ca16be
	echo sparc-icl-nx6
ca16be
	exit ;;
ca16be
    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
ca16be
	case `/usr/bin/uname -p` in
ca16be
	    sparc) echo sparc-icl-nx7; exit ;;
ca16be
	esac ;;
ca16be
    s390x:SunOS:*:*)
ca16be
	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
ca16be
	exit ;;
ca16be
    sun4H:SunOS:5.*:*)
ca16be
	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
ca16be
	exit ;;
ca16be
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
ca16be
	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
ca16be
	exit ;;
ca16be
    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
ca16be
	echo i386-pc-auroraux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
ca16be
	set_cc_for_build
ca16be
	SUN_ARCH=i386
ca16be
	# If there is a compiler, see if it is configured for 64-bit objects.
ca16be
	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
ca16be
	# This test works for both compilers.
ca16be
	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
ca16be
	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
ca16be
		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
ca16be
		grep IS_64BIT_ARCH >/dev/null
ca16be
	    then
ca16be
		SUN_ARCH=x86_64
ca16be
	    fi
ca16be
	fi
ca16be
	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
ca16be
	exit ;;
ca16be
    sun4*:SunOS:6*:*)
ca16be
	# According to config.sub, this is the proper way to canonicalize
ca16be
	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
ca16be
	# it's likely to be more like Solaris than SunOS4.
ca16be
	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
ca16be
	exit ;;
ca16be
    sun4*:SunOS:*:*)
ca16be
	case "`/usr/bin/arch -k`" in
ca16be
	    Series*|S4*)
ca16be
		UNAME_RELEASE=`uname -v`
ca16be
		;;
ca16be
	esac
ca16be
	# Japanese Language versions have a version number like `4.1.3-JL'.
ca16be
	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
ca16be
	exit ;;
ca16be
    sun3*:SunOS:*:*)
ca16be
	echo m68k-sun-sunos"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    sun*:*:4.2BSD:*)
ca16be
	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
ca16be
	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
ca16be
	case "`/bin/arch`" in
ca16be
	    sun3)
ca16be
		echo m68k-sun-sunos"$UNAME_RELEASE"
ca16be
		;;
ca16be
	    sun4)
ca16be
		echo sparc-sun-sunos"$UNAME_RELEASE"
ca16be
		;;
ca16be
	esac
ca16be
	exit ;;
ca16be
    aushp:SunOS:*:*)
ca16be
	echo sparc-auspex-sunos"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    # The situation for MiNT is a little confusing.  The machine name
ca16be
    # can be virtually everything (everything which is not
ca16be
    # "atarist" or "atariste" at least should have a processor
ca16be
    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
ca16be
    # to the lowercase version "mint" (or "freemint").  Finally
ca16be
    # the system name "TOS" denotes a system which is actually not
ca16be
    # MiNT.  But MiNT is downward compatible to TOS, so this should
ca16be
    # be no problem.
ca16be
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
ca16be
	echo m68k-atari-mint"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
ca16be
	echo m68k-atari-mint"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
ca16be
	echo m68k-atari-mint"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
ca16be
	echo m68k-milan-mint"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
ca16be
	echo m68k-hades-mint"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
ca16be
	echo m68k-unknown-mint"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    m68k:machten:*:*)
ca16be
	echo m68k-apple-machten"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    powerpc:machten:*:*)
ca16be
	echo powerpc-apple-machten"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    RISC*:Mach:*:*)
ca16be
	echo mips-dec-mach_bsd4.3
ca16be
	exit ;;
ca16be
    RISC*:ULTRIX:*:*)
ca16be
	echo mips-dec-ultrix"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    VAX*:ULTRIX*:*:*)
ca16be
	echo vax-dec-ultrix"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    2020:CLIX:*:* | 2430:CLIX:*:*)
ca16be
	echo clipper-intergraph-clix"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    mips:*:*:UMIPS | mips:*:*:RISCos)
ca16be
	set_cc_for_build
ca16be
	sed 's/^	//' << EOF > "$dummy.c"
ca16be
#ifdef __cplusplus
ca16be
#include <stdio.h>  /* for printf() prototype */
ca16be
	int main (int argc, char *argv[]) {
ca16be
#else
ca16be
	int main (argc, argv) int argc; char *argv[]; {
ca16be
#endif
ca16be
	#if defined (host_mips) && defined (MIPSEB)
ca16be
	#if defined (SYSTYPE_SYSV)
ca16be
	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
ca16be
	#endif
ca16be
	#if defined (SYSTYPE_SVR4)
ca16be
	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
ca16be
	#endif
ca16be
	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
ca16be
	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
ca16be
	#endif
ca16be
	#endif
ca16be
	  exit (-1);
ca16be
	}
ca16be
EOF
ca16be
	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
ca16be
	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
ca16be
	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
ca16be
	    { echo "$SYSTEM_NAME"; exit; }
ca16be
	echo mips-mips-riscos"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    Motorola:PowerMAX_OS:*:*)
ca16be
	echo powerpc-motorola-powermax
ca16be
	exit ;;
ca16be
    Motorola:*:4.3:PL8-*)
ca16be
	echo powerpc-harris-powermax
ca16be
	exit ;;
ca16be
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
ca16be
	echo powerpc-harris-powermax
ca16be
	exit ;;
ca16be
    Night_Hawk:Power_UNIX:*:*)
ca16be
	echo powerpc-harris-powerunix
ca16be
	exit ;;
ca16be
    m88k:CX/UX:7*:*)
ca16be
	echo m88k-harris-cxux7
ca16be
	exit ;;
ca16be
    m88k:*:4*:R4*)
ca16be
	echo m88k-motorola-sysv4
ca16be
	exit ;;
ca16be
    m88k:*:3*:R3*)
ca16be
	echo m88k-motorola-sysv3
ca16be
	exit ;;
ca16be
    AViiON:dgux:*:*)
ca16be
	# DG/UX returns AViiON for all architectures
ca16be
	UNAME_PROCESSOR=`/usr/bin/uname -p`
ca16be
	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
ca16be
	then
ca16be
	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
ca16be
	       [ "$TARGET_BINARY_INTERFACE"x = x ]
ca16be
	    then
ca16be
		echo m88k-dg-dgux"$UNAME_RELEASE"
ca16be
	    else
ca16be
		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
ca16be
	    fi
ca16be
	else
ca16be
	    echo i586-dg-dgux"$UNAME_RELEASE"
ca16be
	fi
ca16be
	exit ;;
ca16be
    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
ca16be
	echo m88k-dolphin-sysv3
ca16be
	exit ;;
ca16be
    M88*:*:R3*:*)
ca16be
	# Delta 88k system running SVR3
ca16be
	echo m88k-motorola-sysv3
ca16be
	exit ;;
ca16be
    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
ca16be
	echo m88k-tektronix-sysv3
ca16be
	exit ;;
ca16be
    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
ca16be
	echo m68k-tektronix-bsd
ca16be
	exit ;;
ca16be
    *:IRIX*:*:*)
ca16be
	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
ca16be
	exit ;;
ca16be
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
ca16be
	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
ca16be
	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
ca16be
    i*86:AIX:*:*)
ca16be
	echo i386-ibm-aix
ca16be
	exit ;;
ca16be
    ia64:AIX:*:*)
ca16be
	if [ -x /usr/bin/oslevel ] ; then
ca16be
		IBM_REV=`/usr/bin/oslevel`
ca16be
	else
ca16be
		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
ca16be
	fi
ca16be
	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
ca16be
	exit ;;
ca16be
    *:AIX:2:3)
ca16be
	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
ca16be
		set_cc_for_build
ca16be
		sed 's/^		//' << EOF > "$dummy.c"
ca16be
		#include <sys/systemcfg.h>
ca16be
ca16be
		main()
ca16be
			{
ca16be
			if (!__power_pc())
ca16be
				exit(1);
ca16be
			puts("powerpc-ibm-aix3.2.5");
ca16be
			exit(0);
ca16be
			}
ca16be
EOF
ca16be
		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
ca16be
		then
ca16be
			echo "$SYSTEM_NAME"
ca16be
		else
ca16be
			echo rs6000-ibm-aix3.2.5
ca16be
		fi
ca16be
	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
ca16be
		echo rs6000-ibm-aix3.2.4
ca16be
	else
ca16be
		echo rs6000-ibm-aix3.2
ca16be
	fi
ca16be
	exit ;;
ca16be
    *:AIX:*:[4567])
ca16be
	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
ca16be
	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
ca16be
		IBM_ARCH=rs6000
ca16be
	else
ca16be
		IBM_ARCH=powerpc
ca16be
	fi
ca16be
	if [ -x /usr/bin/lslpp ] ; then
ca16be
		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
ca16be
			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
ca16be
	else
ca16be
		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
ca16be
	fi
ca16be
	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
ca16be
	exit ;;
ca16be
    *:AIX:*:*)
ca16be
	echo rs6000-ibm-aix
ca16be
	exit ;;
ca16be
    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
ca16be
	echo romp-ibm-bsd4.4
ca16be
	exit ;;
ca16be
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
ca16be
	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
ca16be
	exit ;;                             # report: romp-ibm BSD 4.3
ca16be
    *:BOSX:*:*)
ca16be
	echo rs6000-bull-bosx
ca16be
	exit ;;
ca16be
    DPX/2?00:B.O.S.:*:*)
ca16be
	echo m68k-bull-sysv3
ca16be
	exit ;;
ca16be
    9000/[34]??:4.3bsd:1.*:*)
ca16be
	echo m68k-hp-bsd
ca16be
	exit ;;
ca16be
    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
ca16be
	echo m68k-hp-bsd4.4
ca16be
	exit ;;
ca16be
    9000/[34678]??:HP-UX:*:*)
ca16be
	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
ca16be
	case "$UNAME_MACHINE" in
ca16be
	    9000/31?)            HP_ARCH=m68000 ;;
ca16be
	    9000/[34]??)         HP_ARCH=m68k ;;
ca16be
	    9000/[678][0-9][0-9])
ca16be
		if [ -x /usr/bin/getconf ]; then
ca16be
		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
ca16be
		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
ca16be
		    case "$sc_cpu_version" in
ca16be
		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
ca16be
		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
ca16be
		      532)                      # CPU_PA_RISC2_0
ca16be
			case "$sc_kernel_bits" in
ca16be
			  32) HP_ARCH=hppa2.0n ;;
ca16be
			  64) HP_ARCH=hppa2.0w ;;
ca16be
			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
ca16be
			esac ;;
ca16be
		    esac
ca16be
		fi
ca16be
		if [ "$HP_ARCH" = "" ]; then
ca16be
		    set_cc_for_build
ca16be
		    sed 's/^		//' << EOF > "$dummy.c"
ca16be
ca16be
		#define _HPUX_SOURCE
ca16be
		#include <stdlib.h>
ca16be
		#include <unistd.h>
ca16be
ca16be
		int main ()
ca16be
		{
ca16be
		#if defined(_SC_KERNEL_BITS)
ca16be
		    long bits = sysconf(_SC_KERNEL_BITS);
ca16be
		#endif
ca16be
		    long cpu  = sysconf (_SC_CPU_VERSION);
ca16be
ca16be
		    switch (cpu)
ca16be
			{
ca16be
			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
ca16be
			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
ca16be
			case CPU_PA_RISC2_0:
ca16be
		#if defined(_SC_KERNEL_BITS)
ca16be
			    switch (bits)
ca16be
				{
ca16be
				case 64: puts ("hppa2.0w"); break;
ca16be
				case 32: puts ("hppa2.0n"); break;
ca16be
				default: puts ("hppa2.0"); break;
ca16be
				} break;
ca16be
		#else  /* !defined(_SC_KERNEL_BITS) */
ca16be
			    puts ("hppa2.0"); break;
ca16be
		#endif
ca16be
			default: puts ("hppa1.0"); break;
ca16be
			}
ca16be
		    exit (0);
ca16be
		}
ca16be
EOF
ca16be
		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
ca16be
		    test -z "$HP_ARCH" && HP_ARCH=hppa
ca16be
		fi ;;
ca16be
	esac
ca16be
	if [ "$HP_ARCH" = hppa2.0w ]
ca16be
	then
ca16be
	    set_cc_for_build
ca16be
ca16be
	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
ca16be
	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
ca16be
	    # generating 64-bit code.  GNU and HP use different nomenclature:
ca16be
	    #
ca16be
	    # $ CC_FOR_BUILD=cc ./config.guess
ca16be
	    # => hppa2.0w-hp-hpux11.23
ca16be
	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
ca16be
	    # => hppa64-hp-hpux11.23
ca16be
ca16be
	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
ca16be
		grep -q __LP64__
ca16be
	    then
ca16be
		HP_ARCH=hppa2.0w
ca16be
	    else
ca16be
		HP_ARCH=hppa64
ca16be
	    fi
ca16be
	fi
ca16be
	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
ca16be
	exit ;;
ca16be
    ia64:HP-UX:*:*)
ca16be
	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
ca16be
	echo ia64-hp-hpux"$HPUX_REV"
ca16be
	exit ;;
ca16be
    3050*:HI-UX:*:*)
ca16be
	set_cc_for_build
ca16be
	sed 's/^	//' << EOF > "$dummy.c"
ca16be
	#include <unistd.h>
ca16be
	int
ca16be
	main ()
ca16be
	{
ca16be
	  long cpu = sysconf (_SC_CPU_VERSION);
ca16be
	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
ca16be
	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
ca16be
	     results, however.  */
ca16be
	  if (CPU_IS_PA_RISC (cpu))
ca16be
	    {
ca16be
	      switch (cpu)
ca16be
		{
ca16be
		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
ca16be
		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
ca16be
		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
ca16be
		  default: puts ("hppa-hitachi-hiuxwe2"); break;
ca16be
		}
ca16be
	    }
ca16be
	  else if (CPU_IS_HP_MC68K (cpu))
ca16be
	    puts ("m68k-hitachi-hiuxwe2");
ca16be
	  else puts ("unknown-hitachi-hiuxwe2");
ca16be
	  exit (0);
ca16be
	}
ca16be
EOF
ca16be
	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
ca16be
		{ echo "$SYSTEM_NAME"; exit; }
ca16be
	echo unknown-hitachi-hiuxwe2
ca16be
	exit ;;
ca16be
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
ca16be
	echo hppa1.1-hp-bsd
ca16be
	exit ;;
ca16be
    9000/8??:4.3bsd:*:*)
ca16be
	echo hppa1.0-hp-bsd
ca16be
	exit ;;
ca16be
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
ca16be
	echo hppa1.0-hp-mpeix
ca16be
	exit ;;
ca16be
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
ca16be
	echo hppa1.1-hp-osf
ca16be
	exit ;;
ca16be
    hp8??:OSF1:*:*)
ca16be
	echo hppa1.0-hp-osf
ca16be
	exit ;;
ca16be
    i*86:OSF1:*:*)
ca16be
	if [ -x /usr/sbin/sysversion ] ; then
ca16be
	    echo "$UNAME_MACHINE"-unknown-osf1mk
ca16be
	else
ca16be
	    echo "$UNAME_MACHINE"-unknown-osf1
ca16be
	fi
ca16be
	exit ;;
ca16be
    parisc*:Lites*:*:*)
ca16be
	echo hppa1.1-hp-lites
ca16be
	exit ;;
ca16be
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
ca16be
	echo c1-convex-bsd
ca16be
	exit ;;
ca16be
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
ca16be
	if getsysinfo -f scalar_acc
ca16be
	then echo c32-convex-bsd
ca16be
	else echo c2-convex-bsd
ca16be
	fi
ca16be
	exit ;;
ca16be
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
ca16be
	echo c34-convex-bsd
ca16be
	exit ;;
ca16be
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
ca16be
	echo c38-convex-bsd
ca16be
	exit ;;
ca16be
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
ca16be
	echo c4-convex-bsd
ca16be
	exit ;;
ca16be
    CRAY*Y-MP:*:*:*)
ca16be
	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
ca16be
	exit ;;
ca16be
    CRAY*[A-Z]90:*:*:*)
ca16be
	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
ca16be
	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
ca16be
	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
ca16be
	      -e 's/\.[^.]*$/.X/'
ca16be
	exit ;;
ca16be
    CRAY*TS:*:*:*)
ca16be
	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
ca16be
	exit ;;
ca16be
    CRAY*T3E:*:*:*)
ca16be
	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
ca16be
	exit ;;
ca16be
    CRAY*SV1:*:*:*)
ca16be
	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
ca16be
	exit ;;
ca16be
    *:UNICOS/mp:*:*)
ca16be
	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
ca16be
	exit ;;
ca16be
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
ca16be
	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
ca16be
	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
ca16be
	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
ca16be
	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
ca16be
	exit ;;
ca16be
    5000:UNIX_System_V:4.*:*)
ca16be
	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
ca16be
	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
ca16be
	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
ca16be
	exit ;;
ca16be
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    sparc*:BSD/OS:*:*)
ca16be
	echo sparc-unknown-bsdi"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:BSD/OS:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    arm:FreeBSD:*:*)
ca16be
	UNAME_PROCESSOR=`uname -p`
ca16be
	set_cc_for_build
ca16be
	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
ca16be
	    | grep -q __ARM_PCS_VFP
ca16be
	then
ca16be
	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
ca16be
	else
ca16be
	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
ca16be
	fi
ca16be
	exit ;;
ca16be
    *:FreeBSD:*:*)
ca16be
	UNAME_PROCESSOR=`/usr/bin/uname -p`
ca16be
	case "$UNAME_PROCESSOR" in
ca16be
	    amd64)
ca16be
		UNAME_PROCESSOR=x86_64 ;;
ca16be
	    i386)
ca16be
		UNAME_PROCESSOR=i586 ;;
ca16be
	esac
ca16be
	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
ca16be
	exit ;;
ca16be
    i*:CYGWIN*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-cygwin
ca16be
	exit ;;
ca16be
    *:MINGW64*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-mingw64
ca16be
	exit ;;
ca16be
    *:MINGW*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-mingw32
ca16be
	exit ;;
ca16be
    *:MSYS*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-msys
ca16be
	exit ;;
ca16be
    i*:PW*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-pw32
ca16be
	exit ;;
ca16be
    *:Interix*:*)
ca16be
	case "$UNAME_MACHINE" in
ca16be
	    x86)
ca16be
		echo i586-pc-interix"$UNAME_RELEASE"
ca16be
		exit ;;
ca16be
	    authenticamd | genuineintel | EM64T)
ca16be
		echo x86_64-unknown-interix"$UNAME_RELEASE"
ca16be
		exit ;;
ca16be
	    IA64)
ca16be
		echo ia64-unknown-interix"$UNAME_RELEASE"
ca16be
		exit ;;
ca16be
	esac ;;
ca16be
    i*:UWIN*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-uwin
ca16be
	exit ;;
ca16be
    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
ca16be
	echo x86_64-pc-cygwin
ca16be
	exit ;;
ca16be
    prep*:SunOS:5.*:*)
ca16be
	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
ca16be
	exit ;;
ca16be
    *:GNU:*:*)
ca16be
	# the GNU system
ca16be
	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
ca16be
	exit ;;
ca16be
    *:GNU/*:*:*)
ca16be
	# other systems with GNU libc and userland
ca16be
	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
ca16be
	exit ;;
ca16be
    *:Minix:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-minix
ca16be
	exit ;;
ca16be
    aarch64:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    aarch64_be:Linux:*:*)
ca16be
	UNAME_MACHINE=aarch64_be
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    alpha:Linux:*:*)
ca16be
	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
ca16be
	  EV5)   UNAME_MACHINE=alphaev5 ;;
ca16be
	  EV56)  UNAME_MACHINE=alphaev56 ;;
ca16be
	  PCA56) UNAME_MACHINE=alphapca56 ;;
ca16be
	  PCA57) UNAME_MACHINE=alphapca56 ;;
ca16be
	  EV6)   UNAME_MACHINE=alphaev6 ;;
ca16be
	  EV67)  UNAME_MACHINE=alphaev67 ;;
ca16be
	  EV68*) UNAME_MACHINE=alphaev68 ;;
ca16be
	esac
ca16be
	objdump --private-headers /bin/sh | grep -q ld.so.1
ca16be
	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    arc:Linux:*:* | arceb:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    arm*:Linux:*:*)
ca16be
	set_cc_for_build
ca16be
	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
ca16be
	    | grep -q __ARM_EABI__
ca16be
	then
ca16be
	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	else
ca16be
	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
ca16be
		| grep -q __ARM_PCS_VFP
ca16be
	    then
ca16be
		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
ca16be
	    else
ca16be
		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
ca16be
	    fi
ca16be
	fi
ca16be
	exit ;;
ca16be
    avr32*:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    cris:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    crisv32:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    e2k:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    frv:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    hexagon:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    i*86:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    ia64:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    k1om:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    m32r*:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    m68*:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    mips:Linux:*:* | mips64:Linux:*:*)
ca16be
	set_cc_for_build
ca16be
	IS_GLIBC=0
ca16be
	test x"${LIBC}" = xgnu && IS_GLIBC=1
ca16be
	sed 's/^	//' << EOF > "$dummy.c"
ca16be
	#undef CPU
ca16be
	#undef mips
ca16be
	#undef mipsel
ca16be
	#undef mips64
ca16be
	#undef mips64el
ca16be
	#if ${IS_GLIBC} && defined(_ABI64)
ca16be
	LIBCABI=gnuabi64
ca16be
	#else
ca16be
	#if ${IS_GLIBC} && defined(_ABIN32)
ca16be
	LIBCABI=gnuabin32
ca16be
	#else
ca16be
	LIBCABI=${LIBC}
ca16be
	#endif
ca16be
	#endif
ca16be
ca16be
	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
ca16be
	CPU=mipsisa64r6
ca16be
	#else
ca16be
	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
ca16be
	CPU=mipsisa32r6
ca16be
	#else
ca16be
	#if defined(__mips64)
ca16be
	CPU=mips64
ca16be
	#else
ca16be
	CPU=mips
ca16be
	#endif
ca16be
	#endif
ca16be
	#endif
ca16be
ca16be
	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
ca16be
	MIPS_ENDIAN=el
ca16be
	#else
ca16be
	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
ca16be
	MIPS_ENDIAN=
ca16be
	#else
ca16be
	MIPS_ENDIAN=
ca16be
	#endif
ca16be
	#endif
ca16be
EOF
ca16be
	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
ca16be
	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
ca16be
	;;
ca16be
    mips64el:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    openrisc*:Linux:*:*)
ca16be
	echo or1k-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    or32:Linux:*:* | or1k*:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    padre:Linux:*:*)
ca16be
	echo sparc-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    parisc64:Linux:*:* | hppa64:Linux:*:*)
ca16be
	echo hppa64-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    parisc:Linux:*:* | hppa:Linux:*:*)
ca16be
	# Look for CPU level
ca16be
	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
ca16be
	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
ca16be
	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
ca16be
	  *)    echo hppa-unknown-linux-"$LIBC" ;;
ca16be
	esac
ca16be
	exit ;;
ca16be
    ppc64:Linux:*:*)
ca16be
	echo powerpc64-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    ppc:Linux:*:*)
ca16be
	echo powerpc-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    ppc64le:Linux:*:*)
ca16be
	echo powerpc64le-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    ppcle:Linux:*:*)
ca16be
	echo powerpcle-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    riscv32:Linux:*:* | riscv64:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    s390:Linux:*:* | s390x:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    sh64*:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    sh*:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    sparc:Linux:*:* | sparc64:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    tile*:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    vax:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    x86_64:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    xtensa*:Linux:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
ca16be
	exit ;;
ca16be
    i*86:DYNIX/ptx:4*:*)
ca16be
	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
ca16be
	# earlier versions are messed up and put the nodename in both
ca16be
	# sysname and nodename.
ca16be
	echo i386-sequent-sysv4
ca16be
	exit ;;
ca16be
    i*86:UNIX_SV:4.2MP:2.*)
ca16be
	# Unixware is an offshoot of SVR4, but it has its own version
ca16be
	# number series starting with 2...
ca16be
	# I am not positive that other SVR4 systems won't match this,
ca16be
	# I just have to hope.  -- rms.
ca16be
	# Use sysv4.2uw... so that sysv4* matches it.
ca16be
	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
ca16be
	exit ;;
ca16be
    i*86:OS/2:*:*)
ca16be
	# If we were able to find `uname', then EMX Unix compatibility
ca16be
	# is probably installed.
ca16be
	echo "$UNAME_MACHINE"-pc-os2-emx
ca16be
	exit ;;
ca16be
    i*86:XTS-300:*:STOP)
ca16be
	echo "$UNAME_MACHINE"-unknown-stop
ca16be
	exit ;;
ca16be
    i*86:atheos:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-atheos
ca16be
	exit ;;
ca16be
    i*86:syllable:*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-syllable
ca16be
	exit ;;
ca16be
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
ca16be
	echo i386-unknown-lynxos"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    i*86:*DOS:*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-msdosdjgpp
ca16be
	exit ;;
ca16be
    i*86:*:4.*:*)
ca16be
	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
ca16be
	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
ca16be
		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
ca16be
	else
ca16be
		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
ca16be
	fi
ca16be
	exit ;;
ca16be
    i*86:*:5:[678]*)
ca16be
	# UnixWare 7.x, OpenUNIX and OpenServer 6.
ca16be
	case `/bin/uname -X | grep "^Machine"` in
ca16be
	    *486*)	     UNAME_MACHINE=i486 ;;
ca16be
	    *Pentium)	     UNAME_MACHINE=i586 ;;
ca16be
	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
ca16be
	esac
ca16be
	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
ca16be
	exit ;;
ca16be
    i*86:*:3.2:*)
ca16be
	if test -f /usr/options/cb.name; then
ca16be
		UNAME_REL=`sed -n 's/.*Version //p' 
ca16be
		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
ca16be
	elif /bin/uname -X 2>/dev/null >/dev/null ; then
ca16be
		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
ca16be
		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
ca16be
		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
ca16be
			&& UNAME_MACHINE=i586
ca16be
		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
ca16be
			&& UNAME_MACHINE=i686
ca16be
		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
ca16be
			&& UNAME_MACHINE=i686
ca16be
		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
ca16be
	else
ca16be
		echo "$UNAME_MACHINE"-pc-sysv32
ca16be
	fi
ca16be
	exit ;;
ca16be
    pc:*:*:*)
ca16be
	# Left here for compatibility:
ca16be
	# uname -m prints for DJGPP always 'pc', but it prints nothing about
ca16be
	# the processor, so we play safe by assuming i586.
ca16be
	# Note: whatever this is, it MUST be the same as what config.sub
ca16be
	# prints for the "djgpp" host, or else GDB configure will decide that
ca16be
	# this is a cross-build.
ca16be
	echo i586-pc-msdosdjgpp
ca16be
	exit ;;
ca16be
    Intel:Mach:3*:*)
ca16be
	echo i386-pc-mach3
ca16be
	exit ;;
ca16be
    paragon:*:*:*)
ca16be
	echo i860-intel-osf1
ca16be
	exit ;;
ca16be
    i860:*:4.*:*) # i860-SVR4
ca16be
	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
ca16be
	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
ca16be
	else # Add other i860-SVR4 vendors below as they are discovered.
ca16be
	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
ca16be
	fi
ca16be
	exit ;;
ca16be
    mini*:CTIX:SYS*5:*)
ca16be
	# "miniframe"
ca16be
	echo m68010-convergent-sysv
ca16be
	exit ;;
ca16be
    mc68k:UNIX:SYSTEM5:3.51m)
ca16be
	echo m68k-convergent-sysv
ca16be
	exit ;;
ca16be
    M680?0:D-NIX:5.3:*)
ca16be
	echo m68k-diab-dnix
ca16be
	exit ;;
ca16be
    M68*:*:R3V[5678]*:*)
ca16be
	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
ca16be
    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)
ca16be
	OS_REL=''
ca16be
	test -r /etc/.relid \
ca16be
	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
ca16be
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
ca16be
	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
ca16be
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
ca16be
	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
ca16be
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
ca16be
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
ca16be
	  && { echo i486-ncr-sysv4; exit; } ;;
ca16be
    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
ca16be
	OS_REL='.3'
ca16be
	test -r /etc/.relid \
ca16be
	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
ca16be
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
ca16be
	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
ca16be
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
ca16be
	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
ca16be
	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
ca16be
	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
ca16be
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
ca16be
	echo m68k-unknown-lynxos"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    mc68030:UNIX_System_V:4.*:*)
ca16be
	echo m68k-atari-sysv4
ca16be
	exit ;;
ca16be
    TSUNAMI:LynxOS:2.*:*)
ca16be
	echo sparc-unknown-lynxos"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    rs6000:LynxOS:2.*:*)
ca16be
	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
ca16be
	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    SM[BE]S:UNIX_SV:*:*)
ca16be
	echo mips-dde-sysv"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    RM*:ReliantUNIX-*:*:*)
ca16be
	echo mips-sni-sysv4
ca16be
	exit ;;
ca16be
    RM*:SINIX-*:*:*)
ca16be
	echo mips-sni-sysv4
ca16be
	exit ;;
ca16be
    *:SINIX-*:*:*)
ca16be
	if uname -p 2>/dev/null >/dev/null ; then
ca16be
		UNAME_MACHINE=`(uname -p) 2>/dev/null`
ca16be
		echo "$UNAME_MACHINE"-sni-sysv4
ca16be
	else
ca16be
		echo ns32k-sni-sysv
ca16be
	fi
ca16be
	exit ;;
ca16be
    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
ca16be
			# says <Richard.M.Bartel@ccMail.Census.GOV>
ca16be
	echo i586-unisys-sysv4
ca16be
	exit ;;
ca16be
    *:UNIX_System_V:4*:FTX*)
ca16be
	# From Gerald Hewes <hewes@openmarket.com>.
ca16be
	# How about differentiating between stratus architectures? -djm
ca16be
	echo hppa1.1-stratus-sysv4
ca16be
	exit ;;
ca16be
    *:*:*:FTX*)
ca16be
	# From seanf@swdc.stratus.com.
ca16be
	echo i860-stratus-sysv4
ca16be
	exit ;;
ca16be
    i*86:VOS:*:*)
ca16be
	# From Paul.Green@stratus.com.
ca16be
	echo "$UNAME_MACHINE"-stratus-vos
ca16be
	exit ;;
ca16be
    *:VOS:*:*)
ca16be
	# From Paul.Green@stratus.com.
ca16be
	echo hppa1.1-stratus-vos
ca16be
	exit ;;
ca16be
    mc68*:A/UX:*:*)
ca16be
	echo m68k-apple-aux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    news*:NEWS-OS:6*:*)
ca16be
	echo mips-sony-newsos6
ca16be
	exit ;;
ca16be
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
ca16be
	if [ -d /usr/nec ]; then
ca16be
		echo mips-nec-sysv"$UNAME_RELEASE"
ca16be
	else
ca16be
		echo mips-unknown-sysv"$UNAME_RELEASE"
ca16be
	fi
ca16be
	exit ;;
ca16be
    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
ca16be
	echo powerpc-be-beos
ca16be
	exit ;;
ca16be
    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
ca16be
	echo powerpc-apple-beos
ca16be
	exit ;;
ca16be
    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
ca16be
	echo i586-pc-beos
ca16be
	exit ;;
ca16be
    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
ca16be
	echo i586-pc-haiku
ca16be
	exit ;;
ca16be
    x86_64:Haiku:*:*)
ca16be
	echo x86_64-unknown-haiku
ca16be
	exit ;;
ca16be
    SX-4:SUPER-UX:*:*)
ca16be
	echo sx4-nec-superux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    SX-5:SUPER-UX:*:*)
ca16be
	echo sx5-nec-superux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    SX-6:SUPER-UX:*:*)
ca16be
	echo sx6-nec-superux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    SX-7:SUPER-UX:*:*)
ca16be
	echo sx7-nec-superux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    SX-8:SUPER-UX:*:*)
ca16be
	echo sx8-nec-superux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    SX-8R:SUPER-UX:*:*)
ca16be
	echo sx8r-nec-superux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    SX-ACE:SUPER-UX:*:*)
ca16be
	echo sxace-nec-superux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    Power*:Rhapsody:*:*)
ca16be
	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:Rhapsody:*:*)
ca16be
	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:Darwin:*:*)
ca16be
	UNAME_PROCESSOR=`uname -p`
ca16be
	case $UNAME_PROCESSOR in
ca16be
	    unknown) UNAME_PROCESSOR=powerpc ;;
ca16be
	esac
ca16be
	if command -v xcode-select > /dev/null 2> /dev/null && \
ca16be
		! xcode-select --print-path > /dev/null 2> /dev/null ; then
ca16be
	    # Avoid executing cc if there is no toolchain installed as
ca16be
	    # cc will be a stub that puts up a graphical alert
ca16be
	    # prompting the user to install developer tools.
ca16be
	    CC_FOR_BUILD=no_compiler_found
ca16be
	else
ca16be
	    set_cc_for_build
ca16be
	fi
ca16be
	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
ca16be
	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
ca16be
		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
ca16be
		   grep IS_64BIT_ARCH >/dev/null
ca16be
	    then
ca16be
		case $UNAME_PROCESSOR in
ca16be
		    i386) UNAME_PROCESSOR=x86_64 ;;
ca16be
		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
ca16be
		esac
ca16be
	    fi
ca16be
	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
ca16be
	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
ca16be
		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
ca16be
		   grep IS_PPC >/dev/null
ca16be
	    then
ca16be
		UNAME_PROCESSOR=powerpc
ca16be
	    fi
ca16be
	elif test "$UNAME_PROCESSOR" = i386 ; then
ca16be
	    # uname -m returns i386 or x86_64
ca16be
	    UNAME_PROCESSOR=$UNAME_MACHINE
ca16be
	fi
ca16be
	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
ca16be
	UNAME_PROCESSOR=`uname -p`
ca16be
	if test "$UNAME_PROCESSOR" = x86; then
ca16be
		UNAME_PROCESSOR=i386
ca16be
		UNAME_MACHINE=pc
ca16be
	fi
ca16be
	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:QNX:*:4*)
ca16be
	echo i386-pc-qnx
ca16be
	exit ;;
ca16be
    NEO-*:NONSTOP_KERNEL:*:*)
ca16be
	echo neo-tandem-nsk"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    NSE-*:NONSTOP_KERNEL:*:*)
ca16be
	echo nse-tandem-nsk"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    NSR-*:NONSTOP_KERNEL:*:*)
ca16be
	echo nsr-tandem-nsk"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    NSV-*:NONSTOP_KERNEL:*:*)
ca16be
	echo nsv-tandem-nsk"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    NSX-*:NONSTOP_KERNEL:*:*)
ca16be
	echo nsx-tandem-nsk"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:NonStop-UX:*:*)
ca16be
	echo mips-compaq-nonstopux
ca16be
	exit ;;
ca16be
    BS2000:POSIX*:*:*)
ca16be
	echo bs2000-siemens-sysv
ca16be
	exit ;;
ca16be
    DS/*:UNIX_System_V:*:*)
ca16be
	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:Plan9:*:*)
ca16be
	# "uname -m" is not consistent, so use $cputype instead. 386
ca16be
	# is converted to i386 for consistency with other x86
ca16be
	# operating systems.
ca16be
	# shellcheck disable=SC2154
ca16be
	if test "$cputype" = 386; then
ca16be
	    UNAME_MACHINE=i386
ca16be
	else
ca16be
	    UNAME_MACHINE="$cputype"
ca16be
	fi
ca16be
	echo "$UNAME_MACHINE"-unknown-plan9
ca16be
	exit ;;
ca16be
    *:TOPS-10:*:*)
ca16be
	echo pdp10-unknown-tops10
ca16be
	exit ;;
ca16be
    *:TENEX:*:*)
ca16be
	echo pdp10-unknown-tenex
ca16be
	exit ;;
ca16be
    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
ca16be
	echo pdp10-dec-tops20
ca16be
	exit ;;
ca16be
    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
ca16be
	echo pdp10-xkl-tops20
ca16be
	exit ;;
ca16be
    *:TOPS-20:*:*)
ca16be
	echo pdp10-unknown-tops20
ca16be
	exit ;;
ca16be
    *:ITS:*:*)
ca16be
	echo pdp10-unknown-its
ca16be
	exit ;;
ca16be
    SEI:*:*:SEIUX)
ca16be
	echo mips-sei-seiux"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
    *:DragonFly:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
ca16be
	exit ;;
ca16be
    *:*VMS:*:*)
ca16be
	UNAME_MACHINE=`(uname -p) 2>/dev/null`
ca16be
	case "$UNAME_MACHINE" in
ca16be
	    A*) echo alpha-dec-vms ; exit ;;
ca16be
	    I*) echo ia64-dec-vms ; exit ;;
ca16be
	    V*) echo vax-dec-vms ; exit ;;
ca16be
	esac ;;
ca16be
    *:XENIX:*:SysV)
ca16be
	echo i386-pc-xenix
ca16be
	exit ;;
ca16be
    i*86:skyos:*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
ca16be
	exit ;;
ca16be
    i*86:rdos:*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-rdos
ca16be
	exit ;;
ca16be
    i*86:AROS:*:*)
ca16be
	echo "$UNAME_MACHINE"-pc-aros
ca16be
	exit ;;
ca16be
    x86_64:VMkernel:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-esx
ca16be
	exit ;;
ca16be
    amd64:Isilon\ OneFS:*:*)
ca16be
	echo x86_64-unknown-onefs
ca16be
	exit ;;
ca16be
    *:Unleashed:*:*)
ca16be
	echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
ca16be
	exit ;;
ca16be
esac
ca16be
ca16be
# No uname command or uname output not recognized.
ca16be
set_cc_for_build
ca16be
cat > "$dummy.c" <
ca16be
#ifdef _SEQUENT_
ca16be
#include <sys/types.h>
ca16be
#include <sys/utsname.h>
ca16be
#endif
ca16be
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
ca16be
#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
ca16be
#include <signal.h>
ca16be
#if defined(_SIZE_T_) || defined(SIGLOST)
ca16be
#include <sys/utsname.h>
ca16be
#endif
ca16be
#endif
ca16be
#endif
ca16be
main ()
ca16be
{
ca16be
#if defined (sony)
ca16be
#if defined (MIPSEB)
ca16be
  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
ca16be
     I don't know....  */
ca16be
  printf ("mips-sony-bsd\n"); exit (0);
ca16be
#else
ca16be
#include <sys/param.h>
ca16be
  printf ("m68k-sony-newsos%s\n",
ca16be
#ifdef NEWSOS4
ca16be
  "4"
ca16be
#else
ca16be
  ""
ca16be
#endif
ca16be
  ); exit (0);
ca16be
#endif
ca16be
#endif
ca16be
ca16be
#if defined (NeXT)
ca16be
#if !defined (__ARCHITECTURE__)
ca16be
#define __ARCHITECTURE__ "m68k"
ca16be
#endif
ca16be
  int version;
ca16be
  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
ca16be
  if (version < 4)
ca16be
    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
ca16be
  else
ca16be
    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
ca16be
  exit (0);
ca16be
#endif
ca16be
ca16be
#if defined (MULTIMAX) || defined (n16)
ca16be
#if defined (UMAXV)
ca16be
  printf ("ns32k-encore-sysv\n"); exit (0);
ca16be
#else
ca16be
#if defined (CMU)
ca16be
  printf ("ns32k-encore-mach\n"); exit (0);
ca16be
#else
ca16be
  printf ("ns32k-encore-bsd\n"); exit (0);
ca16be
#endif
ca16be
#endif
ca16be
#endif
ca16be
ca16be
#if defined (__386BSD__)
ca16be
  printf ("i386-pc-bsd\n"); exit (0);
ca16be
#endif
ca16be
ca16be
#if defined (sequent)
ca16be
#if defined (i386)
ca16be
  printf ("i386-sequent-dynix\n"); exit (0);
ca16be
#endif
ca16be
#if defined (ns32000)
ca16be
  printf ("ns32k-sequent-dynix\n"); exit (0);
ca16be
#endif
ca16be
#endif
ca16be
ca16be
#if defined (_SEQUENT_)
ca16be
  struct utsname un;
ca16be
ca16be
  uname(&un;;
ca16be
  if (strncmp(un.version, "V2", 2) == 0) {
ca16be
    printf ("i386-sequent-ptx2\n"); exit (0);
ca16be
  }
ca16be
  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
ca16be
    printf ("i386-sequent-ptx1\n"); exit (0);
ca16be
  }
ca16be
  printf ("i386-sequent-ptx\n"); exit (0);
ca16be
#endif
ca16be
ca16be
#if defined (vax)
ca16be
#if !defined (ultrix)
ca16be
#include <sys/param.h>
ca16be
#if defined (BSD)
ca16be
#if BSD == 43
ca16be
  printf ("vax-dec-bsd4.3\n"); exit (0);
ca16be
#else
ca16be
#if BSD == 199006
ca16be
  printf ("vax-dec-bsd4.3reno\n"); exit (0);
ca16be
#else
ca16be
  printf ("vax-dec-bsd\n"); exit (0);
ca16be
#endif
ca16be
#endif
ca16be
#else
ca16be
  printf ("vax-dec-bsd\n"); exit (0);
ca16be
#endif
ca16be
#else
ca16be
#if defined(_SIZE_T_) || defined(SIGLOST)
ca16be
  struct utsname un;
ca16be
  uname (&un;;
ca16be
  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
ca16be
#else
ca16be
  printf ("vax-dec-ultrix\n"); exit (0);
ca16be
#endif
ca16be
#endif
ca16be
#endif
ca16be
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
ca16be
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
ca16be
#if defined(_SIZE_T_) || defined(SIGLOST)
ca16be
  struct utsname *un;
ca16be
  uname (&un;;
ca16be
  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
ca16be
#else
ca16be
  printf ("mips-dec-ultrix\n"); exit (0);
ca16be
#endif
ca16be
#endif
ca16be
#endif
ca16be
ca16be
#if defined (alliant) && defined (i860)
ca16be
  printf ("i860-alliant-bsd\n"); exit (0);
ca16be
#endif
ca16be
ca16be
  exit (1);
ca16be
}
ca16be
EOF
ca16be
ca16be
$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
ca16be
	{ echo "$SYSTEM_NAME"; exit; }
ca16be
ca16be
# Apollos put the system type in the environment.
ca16be
test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
ca16be
ca16be
echo "$0: unable to guess system type" >&2
ca16be
ca16be
case "$UNAME_MACHINE:$UNAME_SYSTEM" in
ca16be
    mips:Linux | mips64:Linux)
ca16be
	# If we got here on MIPS GNU/Linux, output extra information.
ca16be
	cat >&2 <
ca16be
ca16be
NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
ca16be
the system type. Please install a C compiler and try again.
ca16be
EOF
ca16be
	;;
ca16be
esac
ca16be
ca16be
cat >&2 <
ca16be
ca16be
This script (version $timestamp), has failed to recognize the
ca16be
operating system you are using. If your script is old, overwrite *all*
ca16be
copies of config.guess and config.sub with the latest versions from:
ca16be
ca16be
  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
ca16be
and
ca16be
  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
ca16be
ca16be
If $0 has already been updated, send the following data and any
ca16be
information you think might be pertinent to config-patches@gnu.org to
ca16be
provide the necessary information to handle your system.
ca16be
ca16be
config.guess timestamp = $timestamp
ca16be
ca16be
uname -m = `(uname -m) 2>/dev/null || echo unknown`
ca16be
uname -r = `(uname -r) 2>/dev/null || echo unknown`
ca16be
uname -s = `(uname -s) 2>/dev/null || echo unknown`
ca16be
uname -v = `(uname -v) 2>/dev/null || echo unknown`
ca16be
ca16be
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
ca16be
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
ca16be
ca16be
hostinfo               = `(hostinfo) 2>/dev/null`
ca16be
/bin/universe          = `(/bin/universe) 2>/dev/null`
ca16be
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
ca16be
/bin/arch              = `(/bin/arch) 2>/dev/null`
ca16be
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
ca16be
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
ca16be
ca16be
UNAME_MACHINE = "$UNAME_MACHINE"
ca16be
UNAME_RELEASE = "$UNAME_RELEASE"
ca16be
UNAME_SYSTEM  = "$UNAME_SYSTEM"
ca16be
UNAME_VERSION = "$UNAME_VERSION"
ca16be
EOF
ca16be
ca16be
exit 1
ca16be
ca16be
# Local variables:
ca16be
# eval: (add-hook 'before-save-hook 'time-stamp)
ca16be
# time-stamp-start: "timestamp='"
ca16be
# time-stamp-format: "%:y-%02m-%02d"
ca16be
# time-stamp-end: "'"
ca16be
# End: