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