Blame SOURCES/config.guess

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