Blame SOURCES/config.guess

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