osloup / rpms / openjade

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