Blame SOURCES/config.guess

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