osloup / rpms / openjade

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