Blame SOURCES/config.guess

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