Blame SOURCES/config.guess

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