17c478bd9Sstevel@tonic-gate#! /bin/sh
27c478bd9Sstevel@tonic-gate# Attempt to guess a canonical system name.
37c478bd9Sstevel@tonic-gate#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4*1b8adde7SWilliam Kucharski#   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
57c478bd9Sstevel@tonic-gate
6*1b8adde7SWilliam Kucharskitimestamp='2004-11-12'
77c478bd9Sstevel@tonic-gate
87c478bd9Sstevel@tonic-gate# This file is free software; you can redistribute it and/or modify it
97c478bd9Sstevel@tonic-gate# under the terms of the GNU General Public License as published by
107c478bd9Sstevel@tonic-gate# the Free Software Foundation; either version 2 of the License, or
117c478bd9Sstevel@tonic-gate# (at your option) any later version.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# This program is distributed in the hope that it will be useful, but
147c478bd9Sstevel@tonic-gate# WITHOUT ANY WARRANTY; without even the implied warranty of
157c478bd9Sstevel@tonic-gate# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
167c478bd9Sstevel@tonic-gate# General Public License for more details.
177c478bd9Sstevel@tonic-gate#
187c478bd9Sstevel@tonic-gate# You should have received a copy of the GNU General Public License
197c478bd9Sstevel@tonic-gate# along with this program; if not, write to the Free Software
207c478bd9Sstevel@tonic-gate# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
217c478bd9Sstevel@tonic-gate#
227c478bd9Sstevel@tonic-gate# As a special exception to the GNU General Public License, if you
237c478bd9Sstevel@tonic-gate# distribute this file as part of a program that contains a
247c478bd9Sstevel@tonic-gate# configuration script generated by Autoconf, you may include it under
257c478bd9Sstevel@tonic-gate# the same distribution terms that you use for the rest of that program.
267c478bd9Sstevel@tonic-gate
277c478bd9Sstevel@tonic-gate# Originally written by Per Bothner <per@bothner.com>.
287c478bd9Sstevel@tonic-gate# Please send patches to <config-patches@gnu.org>.  Submit a context
297c478bd9Sstevel@tonic-gate# diff and a properly formatted ChangeLog entry.
307c478bd9Sstevel@tonic-gate#
317c478bd9Sstevel@tonic-gate# This script attempts to guess a canonical system name similar to
327c478bd9Sstevel@tonic-gate# config.sub.  If it succeeds, it prints the system name on stdout, and
337c478bd9Sstevel@tonic-gate# exits with 0.  Otherwise, it exits with 1.
347c478bd9Sstevel@tonic-gate#
357c478bd9Sstevel@tonic-gate# The plan is that this can be called by configure scripts if you
367c478bd9Sstevel@tonic-gate# don't specify an explicit build system type.
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateme=`echo "$0" | sed -e 's,.*/,,'`
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gateusage="\
417c478bd9Sstevel@tonic-gateUsage: $0 [OPTION]
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gateOutput the configuration name of the system \`$me' is run on.
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gateOperation modes:
467c478bd9Sstevel@tonic-gate  -h, --help         print this help, then exit
477c478bd9Sstevel@tonic-gate  -t, --time-stamp   print date of last modification, then exit
487c478bd9Sstevel@tonic-gate  -v, --version      print version number, then exit
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gateReport bugs and patches to <config-patches@gnu.org>."
517c478bd9Sstevel@tonic-gate
527c478bd9Sstevel@tonic-gateversion="\
537c478bd9Sstevel@tonic-gateGNU config.guess ($timestamp)
547c478bd9Sstevel@tonic-gate
557c478bd9Sstevel@tonic-gateOriginally written by Per Bothner.
56*1b8adde7SWilliam KucharskiCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
577c478bd9Sstevel@tonic-gateFree Software Foundation, Inc.
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gateThis is free software; see the source for copying conditions.  There is NO
607c478bd9Sstevel@tonic-gatewarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gatehelp="
637c478bd9Sstevel@tonic-gateTry \`$me --help' for more information."
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gate# Parse command line
667c478bd9Sstevel@tonic-gatewhile test $# -gt 0 ; do
677c478bd9Sstevel@tonic-gate  case $1 in
687c478bd9Sstevel@tonic-gate    --time-stamp | --time* | -t )
697c478bd9Sstevel@tonic-gate       echo "$timestamp" ; exit 0 ;;
707c478bd9Sstevel@tonic-gate    --version | -v )
717c478bd9Sstevel@tonic-gate       echo "$version" ; exit 0 ;;
727c478bd9Sstevel@tonic-gate    --help | --h* | -h )
737c478bd9Sstevel@tonic-gate       echo "$usage"; exit 0 ;;
747c478bd9Sstevel@tonic-gate    -- )     # Stop option processing
757c478bd9Sstevel@tonic-gate       shift; break ;;
767c478bd9Sstevel@tonic-gate    - )	# Use stdin as input.
777c478bd9Sstevel@tonic-gate       break ;;
787c478bd9Sstevel@tonic-gate    -* )
797c478bd9Sstevel@tonic-gate       echo "$me: invalid option $1$help" >&2
807c478bd9Sstevel@tonic-gate       exit 1 ;;
817c478bd9Sstevel@tonic-gate    * )
827c478bd9Sstevel@tonic-gate       break ;;
837c478bd9Sstevel@tonic-gate  esac
847c478bd9Sstevel@tonic-gatedone
857c478bd9Sstevel@tonic-gate
867c478bd9Sstevel@tonic-gateif test $# != 0; then
877c478bd9Sstevel@tonic-gate  echo "$me: too many arguments$help" >&2
887c478bd9Sstevel@tonic-gate  exit 1
897c478bd9Sstevel@tonic-gatefi
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gatetrap 'exit 1' 1 2 15
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gate# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
947c478bd9Sstevel@tonic-gate# compiler to aid in system detection is discouraged as it requires
957c478bd9Sstevel@tonic-gate# temporary files to be created and, as you can see below, it is a
967c478bd9Sstevel@tonic-gate# headache to deal with in a portable fashion.
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gate# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
997c478bd9Sstevel@tonic-gate# use `HOST_CC' if defined, but it is deprecated.
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate# Portable tmp directory creation inspired by the Autoconf team.
1027c478bd9Sstevel@tonic-gate
1037c478bd9Sstevel@tonic-gateset_cc_for_build='
1047c478bd9Sstevel@tonic-gatetrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1057c478bd9Sstevel@tonic-gatetrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1067c478bd9Sstevel@tonic-gate: ${TMPDIR=/tmp} ;
1077c478bd9Sstevel@tonic-gate { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1087c478bd9Sstevel@tonic-gate { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1097c478bd9Sstevel@tonic-gate { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1107c478bd9Sstevel@tonic-gate { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1117c478bd9Sstevel@tonic-gatedummy=$tmp/dummy ;
1127c478bd9Sstevel@tonic-gatetmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1137c478bd9Sstevel@tonic-gatecase $CC_FOR_BUILD,$HOST_CC,$CC in
1147c478bd9Sstevel@tonic-gate ,,)    echo "int x;" > $dummy.c ;
1157c478bd9Sstevel@tonic-gate	for c in cc gcc c89 c99 ; do
1167c478bd9Sstevel@tonic-gate	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1177c478bd9Sstevel@tonic-gate	     CC_FOR_BUILD="$c"; break ;
1187c478bd9Sstevel@tonic-gate	  fi ;
1197c478bd9Sstevel@tonic-gate	done ;
1207c478bd9Sstevel@tonic-gate	if test x"$CC_FOR_BUILD" = x ; then
1217c478bd9Sstevel@tonic-gate	  CC_FOR_BUILD=no_compiler_found ;
1227c478bd9Sstevel@tonic-gate	fi
1237c478bd9Sstevel@tonic-gate	;;
1247c478bd9Sstevel@tonic-gate ,,*)   CC_FOR_BUILD=$CC ;;
1257c478bd9Sstevel@tonic-gate ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1267c478bd9Sstevel@tonic-gateesac ;'
1277c478bd9Sstevel@tonic-gate
1287c478bd9Sstevel@tonic-gate# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1297c478bd9Sstevel@tonic-gate# (ghazi@noc.rutgers.edu 1994-08-24)
1307c478bd9Sstevel@tonic-gateif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1317c478bd9Sstevel@tonic-gate	PATH=$PATH:/.attbin ; export PATH
1327c478bd9Sstevel@tonic-gatefi
1337c478bd9Sstevel@tonic-gate
1347c478bd9Sstevel@tonic-gateUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1357c478bd9Sstevel@tonic-gateUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1367c478bd9Sstevel@tonic-gateUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1377c478bd9Sstevel@tonic-gateUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gate# Note: order is significant - the case branches are not exclusive.
1407c478bd9Sstevel@tonic-gate
1417c478bd9Sstevel@tonic-gatecase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1427c478bd9Sstevel@tonic-gate    *:NetBSD:*:*)
1437c478bd9Sstevel@tonic-gate	# NetBSD (nbsd) targets should (where applicable) match one or
1447c478bd9Sstevel@tonic-gate	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
1457c478bd9Sstevel@tonic-gate	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1467c478bd9Sstevel@tonic-gate	# switched to ELF, *-*-netbsd* would select the old
1477c478bd9Sstevel@tonic-gate	# object file format.  This provides both forward
1487c478bd9Sstevel@tonic-gate	# compatibility and a consistent mechanism for selecting the
1497c478bd9Sstevel@tonic-gate	# object file format.
1507c478bd9Sstevel@tonic-gate	#
1517c478bd9Sstevel@tonic-gate	# Note: NetBSD doesn't particularly care about the vendor
1527c478bd9Sstevel@tonic-gate	# portion of the name.  We always set it to "unknown".
1537c478bd9Sstevel@tonic-gate	sysctl="sysctl -n hw.machine_arch"
1547c478bd9Sstevel@tonic-gate	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1557c478bd9Sstevel@tonic-gate	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1567c478bd9Sstevel@tonic-gate	case "${UNAME_MACHINE_ARCH}" in
1577c478bd9Sstevel@tonic-gate	    armeb) machine=armeb-unknown ;;
1587c478bd9Sstevel@tonic-gate	    arm*) machine=arm-unknown ;;
1597c478bd9Sstevel@tonic-gate	    sh3el) machine=shl-unknown ;;
1607c478bd9Sstevel@tonic-gate	    sh3eb) machine=sh-unknown ;;
1617c478bd9Sstevel@tonic-gate	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1627c478bd9Sstevel@tonic-gate	esac
1637c478bd9Sstevel@tonic-gate	# The Operating System including object format, if it has switched
1647c478bd9Sstevel@tonic-gate	# to ELF recently, or will in the future.
1657c478bd9Sstevel@tonic-gate	case "${UNAME_MACHINE_ARCH}" in
1667c478bd9Sstevel@tonic-gate	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1677c478bd9Sstevel@tonic-gate		eval $set_cc_for_build
1687c478bd9Sstevel@tonic-gate		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1697c478bd9Sstevel@tonic-gate			| grep __ELF__ >/dev/null
1707c478bd9Sstevel@tonic-gate		then
1717c478bd9Sstevel@tonic-gate		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1727c478bd9Sstevel@tonic-gate		    # Return netbsd for either.  FIX?
1737c478bd9Sstevel@tonic-gate		    os=netbsd
1747c478bd9Sstevel@tonic-gate		else
1757c478bd9Sstevel@tonic-gate		    os=netbsdelf
1767c478bd9Sstevel@tonic-gate		fi
1777c478bd9Sstevel@tonic-gate		;;
1787c478bd9Sstevel@tonic-gate	    *)
1797c478bd9Sstevel@tonic-gate	        os=netbsd
1807c478bd9Sstevel@tonic-gate		;;
1817c478bd9Sstevel@tonic-gate	esac
1827c478bd9Sstevel@tonic-gate	# The OS release
1837c478bd9Sstevel@tonic-gate	# Debian GNU/NetBSD machines have a different userland, and
1847c478bd9Sstevel@tonic-gate	# thus, need a distinct triplet. However, they do not need
1857c478bd9Sstevel@tonic-gate	# kernel version information, so it can be replaced with a
1867c478bd9Sstevel@tonic-gate	# suitable tag, in the style of linux-gnu.
1877c478bd9Sstevel@tonic-gate	case "${UNAME_VERSION}" in
1887c478bd9Sstevel@tonic-gate	    Debian*)
1897c478bd9Sstevel@tonic-gate		release='-gnu'
1907c478bd9Sstevel@tonic-gate		;;
1917c478bd9Sstevel@tonic-gate	    *)
1927c478bd9Sstevel@tonic-gate		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
1937c478bd9Sstevel@tonic-gate		;;
1947c478bd9Sstevel@tonic-gate	esac
1957c478bd9Sstevel@tonic-gate	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
1967c478bd9Sstevel@tonic-gate	# contains redundant information, the shorter form:
1977c478bd9Sstevel@tonic-gate	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
1987c478bd9Sstevel@tonic-gate	echo "${machine}-${os}${release}"
1997c478bd9Sstevel@tonic-gate	exit 0 ;;
200*1b8adde7SWilliam Kucharski    amd64:OpenBSD:*:*)
201*1b8adde7SWilliam Kucharski	echo x86_64-unknown-openbsd${UNAME_RELEASE}
202*1b8adde7SWilliam Kucharski	exit 0 ;;
2037c478bd9Sstevel@tonic-gate    amiga:OpenBSD:*:*)
2047c478bd9Sstevel@tonic-gate	echo m68k-unknown-openbsd${UNAME_RELEASE}
2057c478bd9Sstevel@tonic-gate	exit 0 ;;
206*1b8adde7SWilliam Kucharski    cats:OpenBSD:*:*)
207*1b8adde7SWilliam Kucharski	echo arm-unknown-openbsd${UNAME_RELEASE}
2087c478bd9Sstevel@tonic-gate	exit 0 ;;
2097c478bd9Sstevel@tonic-gate    hp300:OpenBSD:*:*)
2107c478bd9Sstevel@tonic-gate	echo m68k-unknown-openbsd${UNAME_RELEASE}
2117c478bd9Sstevel@tonic-gate	exit 0 ;;
212*1b8adde7SWilliam Kucharski    luna88k:OpenBSD:*:*)
213*1b8adde7SWilliam Kucharski    	echo m88k-unknown-openbsd${UNAME_RELEASE}
214*1b8adde7SWilliam Kucharski	exit 0 ;;
2157c478bd9Sstevel@tonic-gate    mac68k:OpenBSD:*:*)
2167c478bd9Sstevel@tonic-gate	echo m68k-unknown-openbsd${UNAME_RELEASE}
2177c478bd9Sstevel@tonic-gate	exit 0 ;;
2187c478bd9Sstevel@tonic-gate    macppc:OpenBSD:*:*)
2197c478bd9Sstevel@tonic-gate	echo powerpc-unknown-openbsd${UNAME_RELEASE}
2207c478bd9Sstevel@tonic-gate	exit 0 ;;
2217c478bd9Sstevel@tonic-gate    mvme68k:OpenBSD:*:*)
2227c478bd9Sstevel@tonic-gate	echo m68k-unknown-openbsd${UNAME_RELEASE}
2237c478bd9Sstevel@tonic-gate	exit 0 ;;
2247c478bd9Sstevel@tonic-gate    mvme88k:OpenBSD:*:*)
2257c478bd9Sstevel@tonic-gate	echo m88k-unknown-openbsd${UNAME_RELEASE}
2267c478bd9Sstevel@tonic-gate	exit 0 ;;
2277c478bd9Sstevel@tonic-gate    mvmeppc:OpenBSD:*:*)
2287c478bd9Sstevel@tonic-gate	echo powerpc-unknown-openbsd${UNAME_RELEASE}
2297c478bd9Sstevel@tonic-gate	exit 0 ;;
2307c478bd9Sstevel@tonic-gate    sgi:OpenBSD:*:*)
231*1b8adde7SWilliam Kucharski	echo mips64-unknown-openbsd${UNAME_RELEASE}
2327c478bd9Sstevel@tonic-gate	exit 0 ;;
2337c478bd9Sstevel@tonic-gate    sun3:OpenBSD:*:*)
2347c478bd9Sstevel@tonic-gate	echo m68k-unknown-openbsd${UNAME_RELEASE}
2357c478bd9Sstevel@tonic-gate	exit 0 ;;
2367c478bd9Sstevel@tonic-gate    *:OpenBSD:*:*)
2377c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
2387c478bd9Sstevel@tonic-gate	exit 0 ;;
239*1b8adde7SWilliam Kucharski    *:ekkoBSD:*:*)
240*1b8adde7SWilliam Kucharski	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
241*1b8adde7SWilliam Kucharski	exit 0 ;;
242*1b8adde7SWilliam Kucharski    macppc:MirBSD:*:*)
243*1b8adde7SWilliam Kucharski	echo powerppc-unknown-mirbsd${UNAME_RELEASE}
244*1b8adde7SWilliam Kucharski	exit 0 ;;
245*1b8adde7SWilliam Kucharski    *:MirBSD:*:*)
246*1b8adde7SWilliam Kucharski	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
247*1b8adde7SWilliam Kucharski	exit 0 ;;
2487c478bd9Sstevel@tonic-gate    alpha:OSF1:*:*)
249*1b8adde7SWilliam Kucharski	case $UNAME_RELEASE in
250*1b8adde7SWilliam Kucharski	*4.0)
2517c478bd9Sstevel@tonic-gate		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
252*1b8adde7SWilliam Kucharski		;;
253*1b8adde7SWilliam Kucharski	*5.*)
254*1b8adde7SWilliam Kucharski	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
255*1b8adde7SWilliam Kucharski		;;
256*1b8adde7SWilliam Kucharski	esac
2577c478bd9Sstevel@tonic-gate	# According to Compaq, /usr/sbin/psrinfo has been available on
2587c478bd9Sstevel@tonic-gate	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2597c478bd9Sstevel@tonic-gate	# covers most systems running today.  This code pipes the CPU
2607c478bd9Sstevel@tonic-gate	# types through head -n 1, so we only detect the type of CPU 0.
2617c478bd9Sstevel@tonic-gate	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2627c478bd9Sstevel@tonic-gate	case "$ALPHA_CPU_TYPE" in
2637c478bd9Sstevel@tonic-gate	    "EV4 (21064)")
2647c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alpha" ;;
2657c478bd9Sstevel@tonic-gate	    "EV4.5 (21064)")
2667c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alpha" ;;
2677c478bd9Sstevel@tonic-gate	    "LCA4 (21066/21068)")
2687c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alpha" ;;
2697c478bd9Sstevel@tonic-gate	    "EV5 (21164)")
2707c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev5" ;;
2717c478bd9Sstevel@tonic-gate	    "EV5.6 (21164A)")
2727c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev56" ;;
2737c478bd9Sstevel@tonic-gate	    "EV5.6 (21164PC)")
2747c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphapca56" ;;
2757c478bd9Sstevel@tonic-gate	    "EV5.7 (21164PC)")
2767c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphapca57" ;;
2777c478bd9Sstevel@tonic-gate	    "EV6 (21264)")
2787c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev6" ;;
2797c478bd9Sstevel@tonic-gate	    "EV6.7 (21264A)")
2807c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev67" ;;
2817c478bd9Sstevel@tonic-gate	    "EV6.8CB (21264C)")
2827c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev68" ;;
2837c478bd9Sstevel@tonic-gate	    "EV6.8AL (21264B)")
2847c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev68" ;;
2857c478bd9Sstevel@tonic-gate	    "EV6.8CX (21264D)")
2867c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev68" ;;
2877c478bd9Sstevel@tonic-gate	    "EV6.9A (21264/EV69A)")
2887c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev69" ;;
2897c478bd9Sstevel@tonic-gate	    "EV7 (21364)")
2907c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev7" ;;
2917c478bd9Sstevel@tonic-gate	    "EV7.9 (21364A)")
2927c478bd9Sstevel@tonic-gate		UNAME_MACHINE="alphaev79" ;;
2937c478bd9Sstevel@tonic-gate	esac
294*1b8adde7SWilliam Kucharski	# A Pn.n version is a patched version.
2957c478bd9Sstevel@tonic-gate	# A Vn.n version is a released version.
2967c478bd9Sstevel@tonic-gate	# A Tn.n version is a released field test version.
2977c478bd9Sstevel@tonic-gate	# A Xn.n version is an unreleased experimental baselevel.
2987c478bd9Sstevel@tonic-gate	# 1.2 uses "1.2" for uname -r.
299*1b8adde7SWilliam Kucharski	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
3007c478bd9Sstevel@tonic-gate	exit 0 ;;
3017c478bd9Sstevel@tonic-gate    Alpha\ *:Windows_NT*:*)
3027c478bd9Sstevel@tonic-gate	# How do we know it's Interix rather than the generic POSIX subsystem?
3037c478bd9Sstevel@tonic-gate	# Should we change UNAME_MACHINE based on the output of uname instead
3047c478bd9Sstevel@tonic-gate	# of the specific Alpha model?
3057c478bd9Sstevel@tonic-gate	echo alpha-pc-interix
3067c478bd9Sstevel@tonic-gate	exit 0 ;;
3077c478bd9Sstevel@tonic-gate    21064:Windows_NT:50:3)
3087c478bd9Sstevel@tonic-gate	echo alpha-dec-winnt3.5
3097c478bd9Sstevel@tonic-gate	exit 0 ;;
3107c478bd9Sstevel@tonic-gate    Amiga*:UNIX_System_V:4.0:*)
3117c478bd9Sstevel@tonic-gate	echo m68k-unknown-sysv4
3127c478bd9Sstevel@tonic-gate	exit 0;;
3137c478bd9Sstevel@tonic-gate    *:[Aa]miga[Oo][Ss]:*:*)
3147c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-amigaos
3157c478bd9Sstevel@tonic-gate	exit 0 ;;
3167c478bd9Sstevel@tonic-gate    *:[Mm]orph[Oo][Ss]:*:*)
3177c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-morphos
3187c478bd9Sstevel@tonic-gate	exit 0 ;;
3197c478bd9Sstevel@tonic-gate    *:OS/390:*:*)
3207c478bd9Sstevel@tonic-gate	echo i370-ibm-openedition
3217c478bd9Sstevel@tonic-gate	exit 0 ;;
322*1b8adde7SWilliam Kucharski    *:z/VM:*:*)
323*1b8adde7SWilliam Kucharski	echo s390-ibm-zvmoe
324*1b8adde7SWilliam Kucharski	exit 0 ;;
3257c478bd9Sstevel@tonic-gate    *:OS400:*:*)
3267c478bd9Sstevel@tonic-gate        echo powerpc-ibm-os400
3277c478bd9Sstevel@tonic-gate	exit 0 ;;
3287c478bd9Sstevel@tonic-gate    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3297c478bd9Sstevel@tonic-gate	echo arm-acorn-riscix${UNAME_RELEASE}
3307c478bd9Sstevel@tonic-gate	exit 0;;
3317c478bd9Sstevel@tonic-gate    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3327c478bd9Sstevel@tonic-gate	echo hppa1.1-hitachi-hiuxmpp
3337c478bd9Sstevel@tonic-gate	exit 0;;
3347c478bd9Sstevel@tonic-gate    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3357c478bd9Sstevel@tonic-gate	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3367c478bd9Sstevel@tonic-gate	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3377c478bd9Sstevel@tonic-gate		echo pyramid-pyramid-sysv3
3387c478bd9Sstevel@tonic-gate	else
3397c478bd9Sstevel@tonic-gate		echo pyramid-pyramid-bsd
3407c478bd9Sstevel@tonic-gate	fi
3417c478bd9Sstevel@tonic-gate	exit 0 ;;
3427c478bd9Sstevel@tonic-gate    NILE*:*:*:dcosx)
3437c478bd9Sstevel@tonic-gate	echo pyramid-pyramid-svr4
3447c478bd9Sstevel@tonic-gate	exit 0 ;;
3457c478bd9Sstevel@tonic-gate    DRS?6000:unix:4.0:6*)
3467c478bd9Sstevel@tonic-gate	echo sparc-icl-nx6
3477c478bd9Sstevel@tonic-gate	exit 0 ;;
348*1b8adde7SWilliam Kucharski    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3497c478bd9Sstevel@tonic-gate	case `/usr/bin/uname -p` in
3507c478bd9Sstevel@tonic-gate	    sparc) echo sparc-icl-nx7 && exit 0 ;;
3517c478bd9Sstevel@tonic-gate	esac ;;
3527c478bd9Sstevel@tonic-gate    sun4H:SunOS:5.*:*)
3537c478bd9Sstevel@tonic-gate	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3547c478bd9Sstevel@tonic-gate	exit 0 ;;
3557c478bd9Sstevel@tonic-gate    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3567c478bd9Sstevel@tonic-gate	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3577c478bd9Sstevel@tonic-gate	exit 0 ;;
3587c478bd9Sstevel@tonic-gate    i86pc:SunOS:5.*:*)
3597c478bd9Sstevel@tonic-gate	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3607c478bd9Sstevel@tonic-gate	exit 0 ;;
3617c478bd9Sstevel@tonic-gate    sun4*:SunOS:6*:*)
3627c478bd9Sstevel@tonic-gate	# According to config.sub, this is the proper way to canonicalize
3637c478bd9Sstevel@tonic-gate	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3647c478bd9Sstevel@tonic-gate	# it's likely to be more like Solaris than SunOS4.
3657c478bd9Sstevel@tonic-gate	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3667c478bd9Sstevel@tonic-gate	exit 0 ;;
3677c478bd9Sstevel@tonic-gate    sun4*:SunOS:*:*)
3687c478bd9Sstevel@tonic-gate	case "`/usr/bin/arch -k`" in
3697c478bd9Sstevel@tonic-gate	    Series*|S4*)
3707c478bd9Sstevel@tonic-gate		UNAME_RELEASE=`uname -v`
3717c478bd9Sstevel@tonic-gate		;;
3727c478bd9Sstevel@tonic-gate	esac
3737c478bd9Sstevel@tonic-gate	# Japanese Language versions have a version number like `4.1.3-JL'.
3747c478bd9Sstevel@tonic-gate	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3757c478bd9Sstevel@tonic-gate	exit 0 ;;
3767c478bd9Sstevel@tonic-gate    sun3*:SunOS:*:*)
3777c478bd9Sstevel@tonic-gate	echo m68k-sun-sunos${UNAME_RELEASE}
3787c478bd9Sstevel@tonic-gate	exit 0 ;;
3797c478bd9Sstevel@tonic-gate    sun*:*:4.2BSD:*)
3807c478bd9Sstevel@tonic-gate	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3817c478bd9Sstevel@tonic-gate	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
3827c478bd9Sstevel@tonic-gate	case "`/bin/arch`" in
3837c478bd9Sstevel@tonic-gate	    sun3)
3847c478bd9Sstevel@tonic-gate		echo m68k-sun-sunos${UNAME_RELEASE}
3857c478bd9Sstevel@tonic-gate		;;
3867c478bd9Sstevel@tonic-gate	    sun4)
3877c478bd9Sstevel@tonic-gate		echo sparc-sun-sunos${UNAME_RELEASE}
3887c478bd9Sstevel@tonic-gate		;;
3897c478bd9Sstevel@tonic-gate	esac
3907c478bd9Sstevel@tonic-gate	exit 0 ;;
3917c478bd9Sstevel@tonic-gate    aushp:SunOS:*:*)
3927c478bd9Sstevel@tonic-gate	echo sparc-auspex-sunos${UNAME_RELEASE}
3937c478bd9Sstevel@tonic-gate	exit 0 ;;
3947c478bd9Sstevel@tonic-gate    # The situation for MiNT is a little confusing.  The machine name
3957c478bd9Sstevel@tonic-gate    # can be virtually everything (everything which is not
3967c478bd9Sstevel@tonic-gate    # "atarist" or "atariste" at least should have a processor
3977c478bd9Sstevel@tonic-gate    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
3987c478bd9Sstevel@tonic-gate    # to the lowercase version "mint" (or "freemint").  Finally
3997c478bd9Sstevel@tonic-gate    # the system name "TOS" denotes a system which is actually not
4007c478bd9Sstevel@tonic-gate    # MiNT.  But MiNT is downward compatible to TOS, so this should
4017c478bd9Sstevel@tonic-gate    # be no problem.
4027c478bd9Sstevel@tonic-gate    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
4037c478bd9Sstevel@tonic-gate        echo m68k-atari-mint${UNAME_RELEASE}
4047c478bd9Sstevel@tonic-gate	exit 0 ;;
4057c478bd9Sstevel@tonic-gate    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4067c478bd9Sstevel@tonic-gate	echo m68k-atari-mint${UNAME_RELEASE}
4077c478bd9Sstevel@tonic-gate        exit 0 ;;
4087c478bd9Sstevel@tonic-gate    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
4097c478bd9Sstevel@tonic-gate        echo m68k-atari-mint${UNAME_RELEASE}
4107c478bd9Sstevel@tonic-gate	exit 0 ;;
4117c478bd9Sstevel@tonic-gate    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
4127c478bd9Sstevel@tonic-gate        echo m68k-milan-mint${UNAME_RELEASE}
4137c478bd9Sstevel@tonic-gate        exit 0 ;;
4147c478bd9Sstevel@tonic-gate    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
4157c478bd9Sstevel@tonic-gate        echo m68k-hades-mint${UNAME_RELEASE}
4167c478bd9Sstevel@tonic-gate        exit 0 ;;
4177c478bd9Sstevel@tonic-gate    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
4187c478bd9Sstevel@tonic-gate        echo m68k-unknown-mint${UNAME_RELEASE}
4197c478bd9Sstevel@tonic-gate        exit 0 ;;
420*1b8adde7SWilliam Kucharski    m68k:machten:*:*)
421*1b8adde7SWilliam Kucharski	echo m68k-apple-machten${UNAME_RELEASE}
422*1b8adde7SWilliam Kucharski	exit 0 ;;
4237c478bd9Sstevel@tonic-gate    powerpc:machten:*:*)
4247c478bd9Sstevel@tonic-gate	echo powerpc-apple-machten${UNAME_RELEASE}
4257c478bd9Sstevel@tonic-gate	exit 0 ;;
4267c478bd9Sstevel@tonic-gate    RISC*:Mach:*:*)
4277c478bd9Sstevel@tonic-gate	echo mips-dec-mach_bsd4.3
4287c478bd9Sstevel@tonic-gate	exit 0 ;;
4297c478bd9Sstevel@tonic-gate    RISC*:ULTRIX:*:*)
4307c478bd9Sstevel@tonic-gate	echo mips-dec-ultrix${UNAME_RELEASE}
4317c478bd9Sstevel@tonic-gate	exit 0 ;;
4327c478bd9Sstevel@tonic-gate    VAX*:ULTRIX*:*:*)
4337c478bd9Sstevel@tonic-gate	echo vax-dec-ultrix${UNAME_RELEASE}
4347c478bd9Sstevel@tonic-gate	exit 0 ;;
4357c478bd9Sstevel@tonic-gate    2020:CLIX:*:* | 2430:CLIX:*:*)
4367c478bd9Sstevel@tonic-gate	echo clipper-intergraph-clix${UNAME_RELEASE}
4377c478bd9Sstevel@tonic-gate	exit 0 ;;
4387c478bd9Sstevel@tonic-gate    mips:*:*:UMIPS | mips:*:*:RISCos)
4397c478bd9Sstevel@tonic-gate	eval $set_cc_for_build
4407c478bd9Sstevel@tonic-gate	sed 's/^	//' << EOF >$dummy.c
4417c478bd9Sstevel@tonic-gate#ifdef __cplusplus
4427c478bd9Sstevel@tonic-gate#include <stdio.h>  /* for printf() prototype */
4437c478bd9Sstevel@tonic-gate	int main (int argc, char *argv[]) {
4447c478bd9Sstevel@tonic-gate#else
4457c478bd9Sstevel@tonic-gate	int main (argc, argv) int argc; char *argv[]; {
4467c478bd9Sstevel@tonic-gate#endif
4477c478bd9Sstevel@tonic-gate	#if defined (host_mips) && defined (MIPSEB)
4487c478bd9Sstevel@tonic-gate	#if defined (SYSTYPE_SYSV)
4497c478bd9Sstevel@tonic-gate	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4507c478bd9Sstevel@tonic-gate	#endif
4517c478bd9Sstevel@tonic-gate	#if defined (SYSTYPE_SVR4)
4527c478bd9Sstevel@tonic-gate	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4537c478bd9Sstevel@tonic-gate	#endif
4547c478bd9Sstevel@tonic-gate	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4557c478bd9Sstevel@tonic-gate	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4567c478bd9Sstevel@tonic-gate	#endif
4577c478bd9Sstevel@tonic-gate	#endif
4587c478bd9Sstevel@tonic-gate	  exit (-1);
4597c478bd9Sstevel@tonic-gate	}
4607c478bd9Sstevel@tonic-gateEOF
4617c478bd9Sstevel@tonic-gate	$CC_FOR_BUILD -o $dummy $dummy.c \
4627c478bd9Sstevel@tonic-gate	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
4637c478bd9Sstevel@tonic-gate	  && exit 0
4647c478bd9Sstevel@tonic-gate	echo mips-mips-riscos${UNAME_RELEASE}
4657c478bd9Sstevel@tonic-gate	exit 0 ;;
4667c478bd9Sstevel@tonic-gate    Motorola:PowerMAX_OS:*:*)
4677c478bd9Sstevel@tonic-gate	echo powerpc-motorola-powermax
4687c478bd9Sstevel@tonic-gate	exit 0 ;;
4697c478bd9Sstevel@tonic-gate    Motorola:*:4.3:PL8-*)
4707c478bd9Sstevel@tonic-gate	echo powerpc-harris-powermax
4717c478bd9Sstevel@tonic-gate	exit 0 ;;
4727c478bd9Sstevel@tonic-gate    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4737c478bd9Sstevel@tonic-gate	echo powerpc-harris-powermax
4747c478bd9Sstevel@tonic-gate	exit 0 ;;
4757c478bd9Sstevel@tonic-gate    Night_Hawk:Power_UNIX:*:*)
4767c478bd9Sstevel@tonic-gate	echo powerpc-harris-powerunix
4777c478bd9Sstevel@tonic-gate	exit 0 ;;
4787c478bd9Sstevel@tonic-gate    m88k:CX/UX:7*:*)
4797c478bd9Sstevel@tonic-gate	echo m88k-harris-cxux7
4807c478bd9Sstevel@tonic-gate	exit 0 ;;
4817c478bd9Sstevel@tonic-gate    m88k:*:4*:R4*)
4827c478bd9Sstevel@tonic-gate	echo m88k-motorola-sysv4
4837c478bd9Sstevel@tonic-gate	exit 0 ;;
4847c478bd9Sstevel@tonic-gate    m88k:*:3*:R3*)
4857c478bd9Sstevel@tonic-gate	echo m88k-motorola-sysv3
4867c478bd9Sstevel@tonic-gate	exit 0 ;;
4877c478bd9Sstevel@tonic-gate    AViiON:dgux:*:*)
4887c478bd9Sstevel@tonic-gate        # DG/UX returns AViiON for all architectures
4897c478bd9Sstevel@tonic-gate        UNAME_PROCESSOR=`/usr/bin/uname -p`
4907c478bd9Sstevel@tonic-gate	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
4917c478bd9Sstevel@tonic-gate	then
4927c478bd9Sstevel@tonic-gate	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
4937c478bd9Sstevel@tonic-gate	       [ ${TARGET_BINARY_INTERFACE}x = x ]
4947c478bd9Sstevel@tonic-gate	    then
4957c478bd9Sstevel@tonic-gate		echo m88k-dg-dgux${UNAME_RELEASE}
4967c478bd9Sstevel@tonic-gate	    else
4977c478bd9Sstevel@tonic-gate		echo m88k-dg-dguxbcs${UNAME_RELEASE}
4987c478bd9Sstevel@tonic-gate	    fi
4997c478bd9Sstevel@tonic-gate	else
5007c478bd9Sstevel@tonic-gate	    echo i586-dg-dgux${UNAME_RELEASE}
5017c478bd9Sstevel@tonic-gate	fi
5027c478bd9Sstevel@tonic-gate 	exit 0 ;;
5037c478bd9Sstevel@tonic-gate    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
5047c478bd9Sstevel@tonic-gate	echo m88k-dolphin-sysv3
5057c478bd9Sstevel@tonic-gate	exit 0 ;;
5067c478bd9Sstevel@tonic-gate    M88*:*:R3*:*)
5077c478bd9Sstevel@tonic-gate	# Delta 88k system running SVR3
5087c478bd9Sstevel@tonic-gate	echo m88k-motorola-sysv3
5097c478bd9Sstevel@tonic-gate	exit 0 ;;
5107c478bd9Sstevel@tonic-gate    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5117c478bd9Sstevel@tonic-gate	echo m88k-tektronix-sysv3
5127c478bd9Sstevel@tonic-gate	exit 0 ;;
5137c478bd9Sstevel@tonic-gate    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5147c478bd9Sstevel@tonic-gate	echo m68k-tektronix-bsd
5157c478bd9Sstevel@tonic-gate	exit 0 ;;
5167c478bd9Sstevel@tonic-gate    *:IRIX*:*:*)
5177c478bd9Sstevel@tonic-gate	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5187c478bd9Sstevel@tonic-gate	exit 0 ;;
5197c478bd9Sstevel@tonic-gate    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5207c478bd9Sstevel@tonic-gate	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
5217c478bd9Sstevel@tonic-gate	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
5227c478bd9Sstevel@tonic-gate    i*86:AIX:*:*)
5237c478bd9Sstevel@tonic-gate	echo i386-ibm-aix
5247c478bd9Sstevel@tonic-gate	exit 0 ;;
5257c478bd9Sstevel@tonic-gate    ia64:AIX:*:*)
5267c478bd9Sstevel@tonic-gate	if [ -x /usr/bin/oslevel ] ; then
5277c478bd9Sstevel@tonic-gate		IBM_REV=`/usr/bin/oslevel`
5287c478bd9Sstevel@tonic-gate	else
5297c478bd9Sstevel@tonic-gate		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5307c478bd9Sstevel@tonic-gate	fi
5317c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5327c478bd9Sstevel@tonic-gate	exit 0 ;;
5337c478bd9Sstevel@tonic-gate    *:AIX:2:3)
5347c478bd9Sstevel@tonic-gate	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5357c478bd9Sstevel@tonic-gate		eval $set_cc_for_build
5367c478bd9Sstevel@tonic-gate		sed 's/^		//' << EOF >$dummy.c
5377c478bd9Sstevel@tonic-gate		#include <sys/systemcfg.h>
5387c478bd9Sstevel@tonic-gate
5397c478bd9Sstevel@tonic-gate		main()
5407c478bd9Sstevel@tonic-gate			{
5417c478bd9Sstevel@tonic-gate			if (!__power_pc())
5427c478bd9Sstevel@tonic-gate				exit(1);
5437c478bd9Sstevel@tonic-gate			puts("powerpc-ibm-aix3.2.5");
5447c478bd9Sstevel@tonic-gate			exit(0);
5457c478bd9Sstevel@tonic-gate			}
5467c478bd9Sstevel@tonic-gateEOF
5477c478bd9Sstevel@tonic-gate		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
5487c478bd9Sstevel@tonic-gate		echo rs6000-ibm-aix3.2.5
5497c478bd9Sstevel@tonic-gate	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5507c478bd9Sstevel@tonic-gate		echo rs6000-ibm-aix3.2.4
5517c478bd9Sstevel@tonic-gate	else
5527c478bd9Sstevel@tonic-gate		echo rs6000-ibm-aix3.2
5537c478bd9Sstevel@tonic-gate	fi
5547c478bd9Sstevel@tonic-gate	exit 0 ;;
5557c478bd9Sstevel@tonic-gate    *:AIX:*:[45])
5567c478bd9Sstevel@tonic-gate	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5577c478bd9Sstevel@tonic-gate	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5587c478bd9Sstevel@tonic-gate		IBM_ARCH=rs6000
5597c478bd9Sstevel@tonic-gate	else
5607c478bd9Sstevel@tonic-gate		IBM_ARCH=powerpc
5617c478bd9Sstevel@tonic-gate	fi
5627c478bd9Sstevel@tonic-gate	if [ -x /usr/bin/oslevel ] ; then
5637c478bd9Sstevel@tonic-gate		IBM_REV=`/usr/bin/oslevel`
5647c478bd9Sstevel@tonic-gate	else
5657c478bd9Sstevel@tonic-gate		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5667c478bd9Sstevel@tonic-gate	fi
5677c478bd9Sstevel@tonic-gate	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5687c478bd9Sstevel@tonic-gate	exit 0 ;;
5697c478bd9Sstevel@tonic-gate    *:AIX:*:*)
5707c478bd9Sstevel@tonic-gate	echo rs6000-ibm-aix
5717c478bd9Sstevel@tonic-gate	exit 0 ;;
5727c478bd9Sstevel@tonic-gate    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5737c478bd9Sstevel@tonic-gate	echo romp-ibm-bsd4.4
5747c478bd9Sstevel@tonic-gate	exit 0 ;;
5757c478bd9Sstevel@tonic-gate    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5767c478bd9Sstevel@tonic-gate	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5777c478bd9Sstevel@tonic-gate	exit 0 ;;                           # report: romp-ibm BSD 4.3
5787c478bd9Sstevel@tonic-gate    *:BOSX:*:*)
5797c478bd9Sstevel@tonic-gate	echo rs6000-bull-bosx
5807c478bd9Sstevel@tonic-gate	exit 0 ;;
5817c478bd9Sstevel@tonic-gate    DPX/2?00:B.O.S.:*:*)
5827c478bd9Sstevel@tonic-gate	echo m68k-bull-sysv3
5837c478bd9Sstevel@tonic-gate	exit 0 ;;
5847c478bd9Sstevel@tonic-gate    9000/[34]??:4.3bsd:1.*:*)
5857c478bd9Sstevel@tonic-gate	echo m68k-hp-bsd
5867c478bd9Sstevel@tonic-gate	exit 0 ;;
5877c478bd9Sstevel@tonic-gate    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
5887c478bd9Sstevel@tonic-gate	echo m68k-hp-bsd4.4
5897c478bd9Sstevel@tonic-gate	exit 0 ;;
5907c478bd9Sstevel@tonic-gate    9000/[34678]??:HP-UX:*:*)
5917c478bd9Sstevel@tonic-gate	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
5927c478bd9Sstevel@tonic-gate	case "${UNAME_MACHINE}" in
5937c478bd9Sstevel@tonic-gate	    9000/31? )            HP_ARCH=m68000 ;;
5947c478bd9Sstevel@tonic-gate	    9000/[34]?? )         HP_ARCH=m68k ;;
5957c478bd9Sstevel@tonic-gate	    9000/[678][0-9][0-9])
5967c478bd9Sstevel@tonic-gate		if [ -x /usr/bin/getconf ]; then
5977c478bd9Sstevel@tonic-gate		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
5987c478bd9Sstevel@tonic-gate                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
5997c478bd9Sstevel@tonic-gate                    case "${sc_cpu_version}" in
6007c478bd9Sstevel@tonic-gate                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
6017c478bd9Sstevel@tonic-gate                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
6027c478bd9Sstevel@tonic-gate                      532)                      # CPU_PA_RISC2_0
6037c478bd9Sstevel@tonic-gate                        case "${sc_kernel_bits}" in
6047c478bd9Sstevel@tonic-gate                          32) HP_ARCH="hppa2.0n" ;;
6057c478bd9Sstevel@tonic-gate                          64) HP_ARCH="hppa2.0w" ;;
6067c478bd9Sstevel@tonic-gate			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
6077c478bd9Sstevel@tonic-gate                        esac ;;
6087c478bd9Sstevel@tonic-gate                    esac
6097c478bd9Sstevel@tonic-gate		fi
6107c478bd9Sstevel@tonic-gate		if [ "${HP_ARCH}" = "" ]; then
6117c478bd9Sstevel@tonic-gate		    eval $set_cc_for_build
6127c478bd9Sstevel@tonic-gate		    sed 's/^              //' << EOF >$dummy.c
6137c478bd9Sstevel@tonic-gate
6147c478bd9Sstevel@tonic-gate              #define _HPUX_SOURCE
6157c478bd9Sstevel@tonic-gate              #include <stdlib.h>
6167c478bd9Sstevel@tonic-gate              #include <unistd.h>
6177c478bd9Sstevel@tonic-gate
6187c478bd9Sstevel@tonic-gate              int main ()
6197c478bd9Sstevel@tonic-gate              {
6207c478bd9Sstevel@tonic-gate              #if defined(_SC_KERNEL_BITS)
6217c478bd9Sstevel@tonic-gate                  long bits = sysconf(_SC_KERNEL_BITS);
6227c478bd9Sstevel@tonic-gate              #endif
6237c478bd9Sstevel@tonic-gate                  long cpu  = sysconf (_SC_CPU_VERSION);
6247c478bd9Sstevel@tonic-gate
6257c478bd9Sstevel@tonic-gate                  switch (cpu)
6267c478bd9Sstevel@tonic-gate              	{
6277c478bd9Sstevel@tonic-gate              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
6287c478bd9Sstevel@tonic-gate              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
6297c478bd9Sstevel@tonic-gate              	case CPU_PA_RISC2_0:
6307c478bd9Sstevel@tonic-gate              #if defined(_SC_KERNEL_BITS)
6317c478bd9Sstevel@tonic-gate              	    switch (bits)
6327c478bd9Sstevel@tonic-gate              		{
6337c478bd9Sstevel@tonic-gate              		case 64: puts ("hppa2.0w"); break;
6347c478bd9Sstevel@tonic-gate              		case 32: puts ("hppa2.0n"); break;
6357c478bd9Sstevel@tonic-gate              		default: puts ("hppa2.0"); break;
6367c478bd9Sstevel@tonic-gate              		} break;
6377c478bd9Sstevel@tonic-gate              #else  /* !defined(_SC_KERNEL_BITS) */
6387c478bd9Sstevel@tonic-gate              	    puts ("hppa2.0"); break;
6397c478bd9Sstevel@tonic-gate              #endif
6407c478bd9Sstevel@tonic-gate              	default: puts ("hppa1.0"); break;
6417c478bd9Sstevel@tonic-gate              	}
6427c478bd9Sstevel@tonic-gate                  exit (0);
6437c478bd9Sstevel@tonic-gate              }
6447c478bd9Sstevel@tonic-gateEOF
6457c478bd9Sstevel@tonic-gate		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6467c478bd9Sstevel@tonic-gate		    test -z "$HP_ARCH" && HP_ARCH=hppa
6477c478bd9Sstevel@tonic-gate		fi ;;
6487c478bd9Sstevel@tonic-gate	esac
6497c478bd9Sstevel@tonic-gate	if [ ${HP_ARCH} = "hppa2.0w" ]
6507c478bd9Sstevel@tonic-gate	then
6517c478bd9Sstevel@tonic-gate	    # avoid double evaluation of $set_cc_for_build
6527c478bd9Sstevel@tonic-gate	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
6537c478bd9Sstevel@tonic-gate	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
6547c478bd9Sstevel@tonic-gate	    then
6557c478bd9Sstevel@tonic-gate		HP_ARCH="hppa2.0w"
6567c478bd9Sstevel@tonic-gate	    else
6577c478bd9Sstevel@tonic-gate		HP_ARCH="hppa64"
6587c478bd9Sstevel@tonic-gate	    fi
6597c478bd9Sstevel@tonic-gate	fi
6607c478bd9Sstevel@tonic-gate	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6617c478bd9Sstevel@tonic-gate	exit 0 ;;
6627c478bd9Sstevel@tonic-gate    ia64:HP-UX:*:*)
6637c478bd9Sstevel@tonic-gate	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6647c478bd9Sstevel@tonic-gate	echo ia64-hp-hpux${HPUX_REV}
6657c478bd9Sstevel@tonic-gate	exit 0 ;;
6667c478bd9Sstevel@tonic-gate    3050*:HI-UX:*:*)
6677c478bd9Sstevel@tonic-gate	eval $set_cc_for_build
6687c478bd9Sstevel@tonic-gate	sed 's/^	//' << EOF >$dummy.c
6697c478bd9Sstevel@tonic-gate	#include <unistd.h>
6707c478bd9Sstevel@tonic-gate	int
6717c478bd9Sstevel@tonic-gate	main ()
6727c478bd9Sstevel@tonic-gate	{
6737c478bd9Sstevel@tonic-gate	  long cpu = sysconf (_SC_CPU_VERSION);
6747c478bd9Sstevel@tonic-gate	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
6757c478bd9Sstevel@tonic-gate	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
6767c478bd9Sstevel@tonic-gate	     results, however.  */
6777c478bd9Sstevel@tonic-gate	  if (CPU_IS_PA_RISC (cpu))
6787c478bd9Sstevel@tonic-gate	    {
6797c478bd9Sstevel@tonic-gate	      switch (cpu)
6807c478bd9Sstevel@tonic-gate		{
6817c478bd9Sstevel@tonic-gate		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
6827c478bd9Sstevel@tonic-gate		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
6837c478bd9Sstevel@tonic-gate		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
6847c478bd9Sstevel@tonic-gate		  default: puts ("hppa-hitachi-hiuxwe2"); break;
6857c478bd9Sstevel@tonic-gate		}
6867c478bd9Sstevel@tonic-gate	    }
6877c478bd9Sstevel@tonic-gate	  else if (CPU_IS_HP_MC68K (cpu))
6887c478bd9Sstevel@tonic-gate	    puts ("m68k-hitachi-hiuxwe2");
6897c478bd9Sstevel@tonic-gate	  else puts ("unknown-hitachi-hiuxwe2");
6907c478bd9Sstevel@tonic-gate	  exit (0);
6917c478bd9Sstevel@tonic-gate	}
6927c478bd9Sstevel@tonic-gateEOF
6937c478bd9Sstevel@tonic-gate	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
6947c478bd9Sstevel@tonic-gate	echo unknown-hitachi-hiuxwe2
6957c478bd9Sstevel@tonic-gate	exit 0 ;;
6967c478bd9Sstevel@tonic-gate    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
6977c478bd9Sstevel@tonic-gate	echo hppa1.1-hp-bsd
6987c478bd9Sstevel@tonic-gate	exit 0 ;;
6997c478bd9Sstevel@tonic-gate    9000/8??:4.3bsd:*:*)
7007c478bd9Sstevel@tonic-gate	echo hppa1.0-hp-bsd
7017c478bd9Sstevel@tonic-gate	exit 0 ;;
7027c478bd9Sstevel@tonic-gate    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7037c478bd9Sstevel@tonic-gate	echo hppa1.0-hp-mpeix
7047c478bd9Sstevel@tonic-gate	exit 0 ;;
7057c478bd9Sstevel@tonic-gate    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7067c478bd9Sstevel@tonic-gate	echo hppa1.1-hp-osf
7077c478bd9Sstevel@tonic-gate	exit 0 ;;
7087c478bd9Sstevel@tonic-gate    hp8??:OSF1:*:*)
7097c478bd9Sstevel@tonic-gate	echo hppa1.0-hp-osf
7107c478bd9Sstevel@tonic-gate	exit 0 ;;
7117c478bd9Sstevel@tonic-gate    i*86:OSF1:*:*)
7127c478bd9Sstevel@tonic-gate	if [ -x /usr/sbin/sysversion ] ; then
7137c478bd9Sstevel@tonic-gate	    echo ${UNAME_MACHINE}-unknown-osf1mk
7147c478bd9Sstevel@tonic-gate	else
7157c478bd9Sstevel@tonic-gate	    echo ${UNAME_MACHINE}-unknown-osf1
7167c478bd9Sstevel@tonic-gate	fi
7177c478bd9Sstevel@tonic-gate	exit 0 ;;
7187c478bd9Sstevel@tonic-gate    parisc*:Lites*:*:*)
7197c478bd9Sstevel@tonic-gate	echo hppa1.1-hp-lites
7207c478bd9Sstevel@tonic-gate	exit 0 ;;
7217c478bd9Sstevel@tonic-gate    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7227c478bd9Sstevel@tonic-gate	echo c1-convex-bsd
7237c478bd9Sstevel@tonic-gate        exit 0 ;;
7247c478bd9Sstevel@tonic-gate    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7257c478bd9Sstevel@tonic-gate	if getsysinfo -f scalar_acc
7267c478bd9Sstevel@tonic-gate	then echo c32-convex-bsd
7277c478bd9Sstevel@tonic-gate	else echo c2-convex-bsd
7287c478bd9Sstevel@tonic-gate	fi
7297c478bd9Sstevel@tonic-gate        exit 0 ;;
7307c478bd9Sstevel@tonic-gate    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7317c478bd9Sstevel@tonic-gate	echo c34-convex-bsd
7327c478bd9Sstevel@tonic-gate        exit 0 ;;
7337c478bd9Sstevel@tonic-gate    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7347c478bd9Sstevel@tonic-gate	echo c38-convex-bsd
7357c478bd9Sstevel@tonic-gate        exit 0 ;;
7367c478bd9Sstevel@tonic-gate    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7377c478bd9Sstevel@tonic-gate	echo c4-convex-bsd
7387c478bd9Sstevel@tonic-gate        exit 0 ;;
7397c478bd9Sstevel@tonic-gate    CRAY*Y-MP:*:*:*)
7407c478bd9Sstevel@tonic-gate	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7417c478bd9Sstevel@tonic-gate	exit 0 ;;
7427c478bd9Sstevel@tonic-gate    CRAY*[A-Z]90:*:*:*)
7437c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7447c478bd9Sstevel@tonic-gate	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7457c478bd9Sstevel@tonic-gate	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7467c478bd9Sstevel@tonic-gate	      -e 's/\.[^.]*$/.X/'
7477c478bd9Sstevel@tonic-gate	exit 0 ;;
7487c478bd9Sstevel@tonic-gate    CRAY*TS:*:*:*)
7497c478bd9Sstevel@tonic-gate	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7507c478bd9Sstevel@tonic-gate	exit 0 ;;
7517c478bd9Sstevel@tonic-gate    CRAY*T3E:*:*:*)
7527c478bd9Sstevel@tonic-gate	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7537c478bd9Sstevel@tonic-gate	exit 0 ;;
7547c478bd9Sstevel@tonic-gate    CRAY*SV1:*:*:*)
7557c478bd9Sstevel@tonic-gate	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7567c478bd9Sstevel@tonic-gate	exit 0 ;;
7577c478bd9Sstevel@tonic-gate    *:UNICOS/mp:*:*)
758*1b8adde7SWilliam Kucharski	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7597c478bd9Sstevel@tonic-gate	exit 0 ;;
7607c478bd9Sstevel@tonic-gate    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7617c478bd9Sstevel@tonic-gate	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
7627c478bd9Sstevel@tonic-gate        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7637c478bd9Sstevel@tonic-gate        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
7647c478bd9Sstevel@tonic-gate        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7657c478bd9Sstevel@tonic-gate        exit 0 ;;
7667c478bd9Sstevel@tonic-gate    5000:UNIX_System_V:4.*:*)
7677c478bd9Sstevel@tonic-gate        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
7687c478bd9Sstevel@tonic-gate        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
7697c478bd9Sstevel@tonic-gate        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7707c478bd9Sstevel@tonic-gate	exit 0 ;;
7717c478bd9Sstevel@tonic-gate    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
7727c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
7737c478bd9Sstevel@tonic-gate	exit 0 ;;
7747c478bd9Sstevel@tonic-gate    sparc*:BSD/OS:*:*)
7757c478bd9Sstevel@tonic-gate	echo sparc-unknown-bsdi${UNAME_RELEASE}
7767c478bd9Sstevel@tonic-gate	exit 0 ;;
7777c478bd9Sstevel@tonic-gate    *:BSD/OS:*:*)
7787c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
7797c478bd9Sstevel@tonic-gate	exit 0 ;;
7807c478bd9Sstevel@tonic-gate    *:FreeBSD:*:*)
781*1b8adde7SWilliam Kucharski	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
7827c478bd9Sstevel@tonic-gate	exit 0 ;;
7837c478bd9Sstevel@tonic-gate    i*:CYGWIN*:*)
7847c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-cygwin
7857c478bd9Sstevel@tonic-gate	exit 0 ;;
7867c478bd9Sstevel@tonic-gate    i*:MINGW*:*)
7877c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-mingw32
7887c478bd9Sstevel@tonic-gate	exit 0 ;;
7897c478bd9Sstevel@tonic-gate    i*:PW*:*)
7907c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-pw32
7917c478bd9Sstevel@tonic-gate	exit 0 ;;
7927c478bd9Sstevel@tonic-gate    x86:Interix*:[34]*)
7937c478bd9Sstevel@tonic-gate	echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
7947c478bd9Sstevel@tonic-gate	exit 0 ;;
7957c478bd9Sstevel@tonic-gate    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
7967c478bd9Sstevel@tonic-gate	echo i${UNAME_MACHINE}-pc-mks
7977c478bd9Sstevel@tonic-gate	exit 0 ;;
7987c478bd9Sstevel@tonic-gate    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
7997c478bd9Sstevel@tonic-gate	# How do we know it's Interix rather than the generic POSIX subsystem?
8007c478bd9Sstevel@tonic-gate	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8017c478bd9Sstevel@tonic-gate	# UNAME_MACHINE based on the output of uname instead of i386?
8027c478bd9Sstevel@tonic-gate	echo i586-pc-interix
8037c478bd9Sstevel@tonic-gate	exit 0 ;;
8047c478bd9Sstevel@tonic-gate    i*:UWIN*:*)
8057c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-uwin
8067c478bd9Sstevel@tonic-gate	exit 0 ;;
8077c478bd9Sstevel@tonic-gate    p*:CYGWIN*:*)
8087c478bd9Sstevel@tonic-gate	echo powerpcle-unknown-cygwin
8097c478bd9Sstevel@tonic-gate	exit 0 ;;
8107c478bd9Sstevel@tonic-gate    prep*:SunOS:5.*:*)
8117c478bd9Sstevel@tonic-gate	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8127c478bd9Sstevel@tonic-gate	exit 0 ;;
8137c478bd9Sstevel@tonic-gate    *:GNU:*:*)
8147c478bd9Sstevel@tonic-gate	# the GNU system
8157c478bd9Sstevel@tonic-gate	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8167c478bd9Sstevel@tonic-gate	exit 0 ;;
8177c478bd9Sstevel@tonic-gate    *:GNU/*:*:*)
8187c478bd9Sstevel@tonic-gate	# other systems with GNU libc and userland
8197c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
8207c478bd9Sstevel@tonic-gate	exit 0 ;;
8217c478bd9Sstevel@tonic-gate    i*86:Minix:*:*)
8227c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-minix
8237c478bd9Sstevel@tonic-gate	exit 0 ;;
8247c478bd9Sstevel@tonic-gate    arm*:Linux:*:*)
8257c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-linux-gnu
8267c478bd9Sstevel@tonic-gate	exit 0 ;;
8277c478bd9Sstevel@tonic-gate    cris:Linux:*:*)
8287c478bd9Sstevel@tonic-gate	echo cris-axis-linux-gnu
8297c478bd9Sstevel@tonic-gate	exit 0 ;;
830*1b8adde7SWilliam Kucharski    crisv32:Linux:*:*)
831*1b8adde7SWilliam Kucharski	echo crisv32-axis-linux-gnu
832*1b8adde7SWilliam Kucharski	exit 0 ;;
833*1b8adde7SWilliam Kucharski    frv:Linux:*:*)
834*1b8adde7SWilliam Kucharski    	echo frv-unknown-linux-gnu
835*1b8adde7SWilliam Kucharski	exit 0 ;;
8367c478bd9Sstevel@tonic-gate    ia64:Linux:*:*)
8377c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-linux-gnu
8387c478bd9Sstevel@tonic-gate	exit 0 ;;
839*1b8adde7SWilliam Kucharski    m32r*:Linux:*:*)
840*1b8adde7SWilliam Kucharski	echo ${UNAME_MACHINE}-unknown-linux-gnu
841*1b8adde7SWilliam Kucharski	exit 0 ;;
8427c478bd9Sstevel@tonic-gate    m68*:Linux:*:*)
8437c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-linux-gnu
8447c478bd9Sstevel@tonic-gate	exit 0 ;;
8457c478bd9Sstevel@tonic-gate    mips:Linux:*:*)
8467c478bd9Sstevel@tonic-gate	eval $set_cc_for_build
8477c478bd9Sstevel@tonic-gate	sed 's/^	//' << EOF >$dummy.c
8487c478bd9Sstevel@tonic-gate	#undef CPU
8497c478bd9Sstevel@tonic-gate	#undef mips
8507c478bd9Sstevel@tonic-gate	#undef mipsel
8517c478bd9Sstevel@tonic-gate	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
8527c478bd9Sstevel@tonic-gate	CPU=mipsel
8537c478bd9Sstevel@tonic-gate	#else
8547c478bd9Sstevel@tonic-gate	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
8557c478bd9Sstevel@tonic-gate	CPU=mips
8567c478bd9Sstevel@tonic-gate	#else
8577c478bd9Sstevel@tonic-gate	CPU=
8587c478bd9Sstevel@tonic-gate	#endif
8597c478bd9Sstevel@tonic-gate	#endif
8607c478bd9Sstevel@tonic-gateEOF
8617c478bd9Sstevel@tonic-gate	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
8627c478bd9Sstevel@tonic-gate	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
8637c478bd9Sstevel@tonic-gate	;;
8647c478bd9Sstevel@tonic-gate    mips64:Linux:*:*)
8657c478bd9Sstevel@tonic-gate	eval $set_cc_for_build
8667c478bd9Sstevel@tonic-gate	sed 's/^	//' << EOF >$dummy.c
8677c478bd9Sstevel@tonic-gate	#undef CPU
8687c478bd9Sstevel@tonic-gate	#undef mips64
8697c478bd9Sstevel@tonic-gate	#undef mips64el
8707c478bd9Sstevel@tonic-gate	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
8717c478bd9Sstevel@tonic-gate	CPU=mips64el
8727c478bd9Sstevel@tonic-gate	#else
8737c478bd9Sstevel@tonic-gate	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
8747c478bd9Sstevel@tonic-gate	CPU=mips64
8757c478bd9Sstevel@tonic-gate	#else
8767c478bd9Sstevel@tonic-gate	CPU=
8777c478bd9Sstevel@tonic-gate	#endif
8787c478bd9Sstevel@tonic-gate	#endif
8797c478bd9Sstevel@tonic-gateEOF
8807c478bd9Sstevel@tonic-gate	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
8817c478bd9Sstevel@tonic-gate	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
8827c478bd9Sstevel@tonic-gate	;;
8837c478bd9Sstevel@tonic-gate    ppc:Linux:*:*)
8847c478bd9Sstevel@tonic-gate	echo powerpc-unknown-linux-gnu
8857c478bd9Sstevel@tonic-gate	exit 0 ;;
8867c478bd9Sstevel@tonic-gate    ppc64:Linux:*:*)
8877c478bd9Sstevel@tonic-gate	echo powerpc64-unknown-linux-gnu
8887c478bd9Sstevel@tonic-gate	exit 0 ;;
8897c478bd9Sstevel@tonic-gate    alpha:Linux:*:*)
8907c478bd9Sstevel@tonic-gate	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
8917c478bd9Sstevel@tonic-gate	  EV5)   UNAME_MACHINE=alphaev5 ;;
8927c478bd9Sstevel@tonic-gate	  EV56)  UNAME_MACHINE=alphaev56 ;;
8937c478bd9Sstevel@tonic-gate	  PCA56) UNAME_MACHINE=alphapca56 ;;
8947c478bd9Sstevel@tonic-gate	  PCA57) UNAME_MACHINE=alphapca56 ;;
8957c478bd9Sstevel@tonic-gate	  EV6)   UNAME_MACHINE=alphaev6 ;;
8967c478bd9Sstevel@tonic-gate	  EV67)  UNAME_MACHINE=alphaev67 ;;
8977c478bd9Sstevel@tonic-gate	  EV68*) UNAME_MACHINE=alphaev68 ;;
8987c478bd9Sstevel@tonic-gate        esac
8997c478bd9Sstevel@tonic-gate	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
9007c478bd9Sstevel@tonic-gate	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
9017c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
9027c478bd9Sstevel@tonic-gate	exit 0 ;;
9037c478bd9Sstevel@tonic-gate    parisc:Linux:*:* | hppa:Linux:*:*)
9047c478bd9Sstevel@tonic-gate	# Look for CPU level
9057c478bd9Sstevel@tonic-gate	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9067c478bd9Sstevel@tonic-gate	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
9077c478bd9Sstevel@tonic-gate	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
9087c478bd9Sstevel@tonic-gate	  *)    echo hppa-unknown-linux-gnu ;;
9097c478bd9Sstevel@tonic-gate	esac
9107c478bd9Sstevel@tonic-gate	exit 0 ;;
9117c478bd9Sstevel@tonic-gate    parisc64:Linux:*:* | hppa64:Linux:*:*)
9127c478bd9Sstevel@tonic-gate	echo hppa64-unknown-linux-gnu
9137c478bd9Sstevel@tonic-gate	exit 0 ;;
9147c478bd9Sstevel@tonic-gate    s390:Linux:*:* | s390x:Linux:*:*)
9157c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-ibm-linux
9167c478bd9Sstevel@tonic-gate	exit 0 ;;
9177c478bd9Sstevel@tonic-gate    sh64*:Linux:*:*)
9187c478bd9Sstevel@tonic-gate    	echo ${UNAME_MACHINE}-unknown-linux-gnu
9197c478bd9Sstevel@tonic-gate	exit 0 ;;
9207c478bd9Sstevel@tonic-gate    sh*:Linux:*:*)
9217c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-linux-gnu
9227c478bd9Sstevel@tonic-gate	exit 0 ;;
9237c478bd9Sstevel@tonic-gate    sparc:Linux:*:* | sparc64:Linux:*:*)
9247c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-linux-gnu
9257c478bd9Sstevel@tonic-gate	exit 0 ;;
9267c478bd9Sstevel@tonic-gate    x86_64:Linux:*:*)
9277c478bd9Sstevel@tonic-gate	echo x86_64-unknown-linux-gnu
9287c478bd9Sstevel@tonic-gate	exit 0 ;;
9297c478bd9Sstevel@tonic-gate    i*86:Linux:*:*)
9307c478bd9Sstevel@tonic-gate	# The BFD linker knows what the default object file format is, so
9317c478bd9Sstevel@tonic-gate	# first see if it will tell us. cd to the root directory to prevent
9327c478bd9Sstevel@tonic-gate	# problems with other programs or directories called `ld' in the path.
9337c478bd9Sstevel@tonic-gate	# Set LC_ALL=C to ensure ld outputs messages in English.
9347c478bd9Sstevel@tonic-gate	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
9357c478bd9Sstevel@tonic-gate			 | sed -ne '/supported targets:/!d
9367c478bd9Sstevel@tonic-gate				    s/[ 	][ 	]*/ /g
9377c478bd9Sstevel@tonic-gate				    s/.*supported targets: *//
9387c478bd9Sstevel@tonic-gate				    s/ .*//
9397c478bd9Sstevel@tonic-gate				    p'`
9407c478bd9Sstevel@tonic-gate        case "$ld_supported_targets" in
9417c478bd9Sstevel@tonic-gate	  elf32-i386)
9427c478bd9Sstevel@tonic-gate		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
9437c478bd9Sstevel@tonic-gate		;;
9447c478bd9Sstevel@tonic-gate	  a.out-i386-linux)
9457c478bd9Sstevel@tonic-gate		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
9467c478bd9Sstevel@tonic-gate		exit 0 ;;
9477c478bd9Sstevel@tonic-gate	  coff-i386)
9487c478bd9Sstevel@tonic-gate		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
9497c478bd9Sstevel@tonic-gate		exit 0 ;;
9507c478bd9Sstevel@tonic-gate	  "")
9517c478bd9Sstevel@tonic-gate		# Either a pre-BFD a.out linker (linux-gnuoldld) or
9527c478bd9Sstevel@tonic-gate		# one that does not give us useful --help.
9537c478bd9Sstevel@tonic-gate		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
9547c478bd9Sstevel@tonic-gate		exit 0 ;;
9557c478bd9Sstevel@tonic-gate	esac
9567c478bd9Sstevel@tonic-gate	# Determine whether the default compiler is a.out or elf
9577c478bd9Sstevel@tonic-gate	eval $set_cc_for_build
9587c478bd9Sstevel@tonic-gate	sed 's/^	//' << EOF >$dummy.c
9597c478bd9Sstevel@tonic-gate	#include <features.h>
9607c478bd9Sstevel@tonic-gate	#ifdef __ELF__
9617c478bd9Sstevel@tonic-gate	# ifdef __GLIBC__
9627c478bd9Sstevel@tonic-gate	#  if __GLIBC__ >= 2
9637c478bd9Sstevel@tonic-gate	LIBC=gnu
9647c478bd9Sstevel@tonic-gate	#  else
9657c478bd9Sstevel@tonic-gate	LIBC=gnulibc1
9667c478bd9Sstevel@tonic-gate	#  endif
9677c478bd9Sstevel@tonic-gate	# else
9687c478bd9Sstevel@tonic-gate	LIBC=gnulibc1
9697c478bd9Sstevel@tonic-gate	# endif
9707c478bd9Sstevel@tonic-gate	#else
9717c478bd9Sstevel@tonic-gate	#ifdef __INTEL_COMPILER
9727c478bd9Sstevel@tonic-gate	LIBC=gnu
9737c478bd9Sstevel@tonic-gate	#else
9747c478bd9Sstevel@tonic-gate	LIBC=gnuaout
9757c478bd9Sstevel@tonic-gate	#endif
9767c478bd9Sstevel@tonic-gate	#endif
9777c478bd9Sstevel@tonic-gate	#ifdef __dietlibc__
9787c478bd9Sstevel@tonic-gate	LIBC=dietlibc
9797c478bd9Sstevel@tonic-gate	#endif
9807c478bd9Sstevel@tonic-gateEOF
9817c478bd9Sstevel@tonic-gate	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
9827c478bd9Sstevel@tonic-gate	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
9837c478bd9Sstevel@tonic-gate	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
9847c478bd9Sstevel@tonic-gate	;;
9857c478bd9Sstevel@tonic-gate    i*86:DYNIX/ptx:4*:*)
9867c478bd9Sstevel@tonic-gate	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
9877c478bd9Sstevel@tonic-gate	# earlier versions are messed up and put the nodename in both
9887c478bd9Sstevel@tonic-gate	# sysname and nodename.
9897c478bd9Sstevel@tonic-gate	echo i386-sequent-sysv4
9907c478bd9Sstevel@tonic-gate	exit 0 ;;
9917c478bd9Sstevel@tonic-gate    i*86:UNIX_SV:4.2MP:2.*)
9927c478bd9Sstevel@tonic-gate        # Unixware is an offshoot of SVR4, but it has its own version
9937c478bd9Sstevel@tonic-gate        # number series starting with 2...
9947c478bd9Sstevel@tonic-gate        # I am not positive that other SVR4 systems won't match this,
9957c478bd9Sstevel@tonic-gate	# I just have to hope.  -- rms.
9967c478bd9Sstevel@tonic-gate        # Use sysv4.2uw... so that sysv4* matches it.
9977c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
9987c478bd9Sstevel@tonic-gate	exit 0 ;;
9997c478bd9Sstevel@tonic-gate    i*86:OS/2:*:*)
10007c478bd9Sstevel@tonic-gate	# If we were able to find `uname', then EMX Unix compatibility
10017c478bd9Sstevel@tonic-gate	# is probably installed.
10027c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-os2-emx
10037c478bd9Sstevel@tonic-gate	exit 0 ;;
10047c478bd9Sstevel@tonic-gate    i*86:XTS-300:*:STOP)
10057c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-stop
10067c478bd9Sstevel@tonic-gate	exit 0 ;;
10077c478bd9Sstevel@tonic-gate    i*86:atheos:*:*)
10087c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-atheos
10097c478bd9Sstevel@tonic-gate	exit 0 ;;
10107c478bd9Sstevel@tonic-gate	i*86:syllable:*:*)
10117c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-syllable
10127c478bd9Sstevel@tonic-gate	exit 0 ;;
10137c478bd9Sstevel@tonic-gate    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
10147c478bd9Sstevel@tonic-gate	echo i386-unknown-lynxos${UNAME_RELEASE}
10157c478bd9Sstevel@tonic-gate	exit 0 ;;
10167c478bd9Sstevel@tonic-gate    i*86:*DOS:*:*)
10177c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10187c478bd9Sstevel@tonic-gate	exit 0 ;;
10197c478bd9Sstevel@tonic-gate    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10207c478bd9Sstevel@tonic-gate	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10217c478bd9Sstevel@tonic-gate	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10227c478bd9Sstevel@tonic-gate		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10237c478bd9Sstevel@tonic-gate	else
10247c478bd9Sstevel@tonic-gate		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10257c478bd9Sstevel@tonic-gate	fi
10267c478bd9Sstevel@tonic-gate	exit 0 ;;
10277c478bd9Sstevel@tonic-gate    i*86:*:5:[78]*)
10287c478bd9Sstevel@tonic-gate	case `/bin/uname -X | grep "^Machine"` in
10297c478bd9Sstevel@tonic-gate	    *486*)	     UNAME_MACHINE=i486 ;;
10307c478bd9Sstevel@tonic-gate	    *Pentium)	     UNAME_MACHINE=i586 ;;
10317c478bd9Sstevel@tonic-gate	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10327c478bd9Sstevel@tonic-gate	esac
10337c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10347c478bd9Sstevel@tonic-gate	exit 0 ;;
10357c478bd9Sstevel@tonic-gate    i*86:*:3.2:*)
10367c478bd9Sstevel@tonic-gate	if test -f /usr/options/cb.name; then
10377c478bd9Sstevel@tonic-gate		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
10387c478bd9Sstevel@tonic-gate		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
10397c478bd9Sstevel@tonic-gate	elif /bin/uname -X 2>/dev/null >/dev/null ; then
10407c478bd9Sstevel@tonic-gate		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10417c478bd9Sstevel@tonic-gate		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10427c478bd9Sstevel@tonic-gate		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
10437c478bd9Sstevel@tonic-gate			&& UNAME_MACHINE=i586
10447c478bd9Sstevel@tonic-gate		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
10457c478bd9Sstevel@tonic-gate			&& UNAME_MACHINE=i686
10467c478bd9Sstevel@tonic-gate		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10477c478bd9Sstevel@tonic-gate			&& UNAME_MACHINE=i686
10487c478bd9Sstevel@tonic-gate		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
10497c478bd9Sstevel@tonic-gate	else
10507c478bd9Sstevel@tonic-gate		echo ${UNAME_MACHINE}-pc-sysv32
10517c478bd9Sstevel@tonic-gate	fi
10527c478bd9Sstevel@tonic-gate	exit 0 ;;
10537c478bd9Sstevel@tonic-gate    pc:*:*:*)
10547c478bd9Sstevel@tonic-gate	# Left here for compatibility:
10557c478bd9Sstevel@tonic-gate        # uname -m prints for DJGPP always 'pc', but it prints nothing about
10567c478bd9Sstevel@tonic-gate        # the processor, so we play safe by assuming i386.
10577c478bd9Sstevel@tonic-gate	echo i386-pc-msdosdjgpp
10587c478bd9Sstevel@tonic-gate        exit 0 ;;
10597c478bd9Sstevel@tonic-gate    Intel:Mach:3*:*)
10607c478bd9Sstevel@tonic-gate	echo i386-pc-mach3
10617c478bd9Sstevel@tonic-gate	exit 0 ;;
10627c478bd9Sstevel@tonic-gate    paragon:*:*:*)
10637c478bd9Sstevel@tonic-gate	echo i860-intel-osf1
10647c478bd9Sstevel@tonic-gate	exit 0 ;;
10657c478bd9Sstevel@tonic-gate    i860:*:4.*:*) # i860-SVR4
10667c478bd9Sstevel@tonic-gate	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
10677c478bd9Sstevel@tonic-gate	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
10687c478bd9Sstevel@tonic-gate	else # Add other i860-SVR4 vendors below as they are discovered.
10697c478bd9Sstevel@tonic-gate	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
10707c478bd9Sstevel@tonic-gate	fi
10717c478bd9Sstevel@tonic-gate	exit 0 ;;
10727c478bd9Sstevel@tonic-gate    mini*:CTIX:SYS*5:*)
10737c478bd9Sstevel@tonic-gate	# "miniframe"
10747c478bd9Sstevel@tonic-gate	echo m68010-convergent-sysv
10757c478bd9Sstevel@tonic-gate	exit 0 ;;
10767c478bd9Sstevel@tonic-gate    mc68k:UNIX:SYSTEM5:3.51m)
10777c478bd9Sstevel@tonic-gate	echo m68k-convergent-sysv
10787c478bd9Sstevel@tonic-gate	exit 0 ;;
10797c478bd9Sstevel@tonic-gate    M680?0:D-NIX:5.3:*)
10807c478bd9Sstevel@tonic-gate	echo m68k-diab-dnix
10817c478bd9Sstevel@tonic-gate	exit 0 ;;
1082*1b8adde7SWilliam Kucharski    M68*:*:R3V[5678]*:*)
10837c478bd9Sstevel@tonic-gate	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1084*1b8adde7SWilliam Kucharski    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)
10857c478bd9Sstevel@tonic-gate	OS_REL=''
10867c478bd9Sstevel@tonic-gate	test -r /etc/.relid \
10877c478bd9Sstevel@tonic-gate	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
10887c478bd9Sstevel@tonic-gate	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
10897c478bd9Sstevel@tonic-gate	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
10907c478bd9Sstevel@tonic-gate	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
10917c478bd9Sstevel@tonic-gate	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
10927c478bd9Sstevel@tonic-gate    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
10937c478bd9Sstevel@tonic-gate        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
10947c478bd9Sstevel@tonic-gate          && echo i486-ncr-sysv4 && exit 0 ;;
10957c478bd9Sstevel@tonic-gate    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
10967c478bd9Sstevel@tonic-gate	echo m68k-unknown-lynxos${UNAME_RELEASE}
10977c478bd9Sstevel@tonic-gate	exit 0 ;;
10987c478bd9Sstevel@tonic-gate    mc68030:UNIX_System_V:4.*:*)
10997c478bd9Sstevel@tonic-gate	echo m68k-atari-sysv4
11007c478bd9Sstevel@tonic-gate	exit 0 ;;
11017c478bd9Sstevel@tonic-gate    TSUNAMI:LynxOS:2.*:*)
11027c478bd9Sstevel@tonic-gate	echo sparc-unknown-lynxos${UNAME_RELEASE}
11037c478bd9Sstevel@tonic-gate	exit 0 ;;
11047c478bd9Sstevel@tonic-gate    rs6000:LynxOS:2.*:*)
11057c478bd9Sstevel@tonic-gate	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11067c478bd9Sstevel@tonic-gate	exit 0 ;;
11077c478bd9Sstevel@tonic-gate    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
11087c478bd9Sstevel@tonic-gate	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11097c478bd9Sstevel@tonic-gate	exit 0 ;;
11107c478bd9Sstevel@tonic-gate    SM[BE]S:UNIX_SV:*:*)
11117c478bd9Sstevel@tonic-gate	echo mips-dde-sysv${UNAME_RELEASE}
11127c478bd9Sstevel@tonic-gate	exit 0 ;;
11137c478bd9Sstevel@tonic-gate    RM*:ReliantUNIX-*:*:*)
11147c478bd9Sstevel@tonic-gate	echo mips-sni-sysv4
11157c478bd9Sstevel@tonic-gate	exit 0 ;;
11167c478bd9Sstevel@tonic-gate    RM*:SINIX-*:*:*)
11177c478bd9Sstevel@tonic-gate	echo mips-sni-sysv4
11187c478bd9Sstevel@tonic-gate	exit 0 ;;
11197c478bd9Sstevel@tonic-gate    *:SINIX-*:*:*)
11207c478bd9Sstevel@tonic-gate	if uname -p 2>/dev/null >/dev/null ; then
11217c478bd9Sstevel@tonic-gate		UNAME_MACHINE=`(uname -p) 2>/dev/null`
11227c478bd9Sstevel@tonic-gate		echo ${UNAME_MACHINE}-sni-sysv4
11237c478bd9Sstevel@tonic-gate	else
11247c478bd9Sstevel@tonic-gate		echo ns32k-sni-sysv
11257c478bd9Sstevel@tonic-gate	fi
11267c478bd9Sstevel@tonic-gate	exit 0 ;;
11277c478bd9Sstevel@tonic-gate    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
11287c478bd9Sstevel@tonic-gate                      # says <Richard.M.Bartel@ccMail.Census.GOV>
11297c478bd9Sstevel@tonic-gate        echo i586-unisys-sysv4
11307c478bd9Sstevel@tonic-gate        exit 0 ;;
11317c478bd9Sstevel@tonic-gate    *:UNIX_System_V:4*:FTX*)
11327c478bd9Sstevel@tonic-gate	# From Gerald Hewes <hewes@openmarket.com>.
11337c478bd9Sstevel@tonic-gate	# How about differentiating between stratus architectures? -djm
11347c478bd9Sstevel@tonic-gate	echo hppa1.1-stratus-sysv4
11357c478bd9Sstevel@tonic-gate	exit 0 ;;
11367c478bd9Sstevel@tonic-gate    *:*:*:FTX*)
11377c478bd9Sstevel@tonic-gate	# From seanf@swdc.stratus.com.
11387c478bd9Sstevel@tonic-gate	echo i860-stratus-sysv4
11397c478bd9Sstevel@tonic-gate	exit 0 ;;
11407c478bd9Sstevel@tonic-gate    *:VOS:*:*)
11417c478bd9Sstevel@tonic-gate	# From Paul.Green@stratus.com.
11427c478bd9Sstevel@tonic-gate	echo hppa1.1-stratus-vos
11437c478bd9Sstevel@tonic-gate	exit 0 ;;
11447c478bd9Sstevel@tonic-gate    mc68*:A/UX:*:*)
11457c478bd9Sstevel@tonic-gate	echo m68k-apple-aux${UNAME_RELEASE}
11467c478bd9Sstevel@tonic-gate	exit 0 ;;
11477c478bd9Sstevel@tonic-gate    news*:NEWS-OS:6*:*)
11487c478bd9Sstevel@tonic-gate	echo mips-sony-newsos6
11497c478bd9Sstevel@tonic-gate	exit 0 ;;
11507c478bd9Sstevel@tonic-gate    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
11517c478bd9Sstevel@tonic-gate	if [ -d /usr/nec ]; then
11527c478bd9Sstevel@tonic-gate	        echo mips-nec-sysv${UNAME_RELEASE}
11537c478bd9Sstevel@tonic-gate	else
11547c478bd9Sstevel@tonic-gate	        echo mips-unknown-sysv${UNAME_RELEASE}
11557c478bd9Sstevel@tonic-gate	fi
11567c478bd9Sstevel@tonic-gate        exit 0 ;;
11577c478bd9Sstevel@tonic-gate    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
11587c478bd9Sstevel@tonic-gate	echo powerpc-be-beos
11597c478bd9Sstevel@tonic-gate	exit 0 ;;
11607c478bd9Sstevel@tonic-gate    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
11617c478bd9Sstevel@tonic-gate	echo powerpc-apple-beos
11627c478bd9Sstevel@tonic-gate	exit 0 ;;
11637c478bd9Sstevel@tonic-gate    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
11647c478bd9Sstevel@tonic-gate	echo i586-pc-beos
11657c478bd9Sstevel@tonic-gate	exit 0 ;;
11667c478bd9Sstevel@tonic-gate    SX-4:SUPER-UX:*:*)
11677c478bd9Sstevel@tonic-gate	echo sx4-nec-superux${UNAME_RELEASE}
11687c478bd9Sstevel@tonic-gate	exit 0 ;;
11697c478bd9Sstevel@tonic-gate    SX-5:SUPER-UX:*:*)
11707c478bd9Sstevel@tonic-gate	echo sx5-nec-superux${UNAME_RELEASE}
11717c478bd9Sstevel@tonic-gate	exit 0 ;;
11727c478bd9Sstevel@tonic-gate    SX-6:SUPER-UX:*:*)
11737c478bd9Sstevel@tonic-gate	echo sx6-nec-superux${UNAME_RELEASE}
11747c478bd9Sstevel@tonic-gate	exit 0 ;;
11757c478bd9Sstevel@tonic-gate    Power*:Rhapsody:*:*)
11767c478bd9Sstevel@tonic-gate	echo powerpc-apple-rhapsody${UNAME_RELEASE}
11777c478bd9Sstevel@tonic-gate	exit 0 ;;
11787c478bd9Sstevel@tonic-gate    *:Rhapsody:*:*)
11797c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
11807c478bd9Sstevel@tonic-gate	exit 0 ;;
11817c478bd9Sstevel@tonic-gate    *:Darwin:*:*)
1182*1b8adde7SWilliam Kucharski	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1183*1b8adde7SWilliam Kucharski	case $UNAME_PROCESSOR in
11847c478bd9Sstevel@tonic-gate	    *86) UNAME_PROCESSOR=i686 ;;
1185*1b8adde7SWilliam Kucharski	    unknown) UNAME_PROCESSOR=powerpc ;;
11867c478bd9Sstevel@tonic-gate	esac
11877c478bd9Sstevel@tonic-gate	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
11887c478bd9Sstevel@tonic-gate	exit 0 ;;
11897c478bd9Sstevel@tonic-gate    *:procnto*:*:* | *:QNX:[0123456789]*:*)
11907c478bd9Sstevel@tonic-gate	UNAME_PROCESSOR=`uname -p`
11917c478bd9Sstevel@tonic-gate	if test "$UNAME_PROCESSOR" = "x86"; then
11927c478bd9Sstevel@tonic-gate		UNAME_PROCESSOR=i386
11937c478bd9Sstevel@tonic-gate		UNAME_MACHINE=pc
11947c478bd9Sstevel@tonic-gate	fi
11957c478bd9Sstevel@tonic-gate	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
11967c478bd9Sstevel@tonic-gate	exit 0 ;;
11977c478bd9Sstevel@tonic-gate    *:QNX:*:4*)
11987c478bd9Sstevel@tonic-gate	echo i386-pc-qnx
11997c478bd9Sstevel@tonic-gate	exit 0 ;;
12007c478bd9Sstevel@tonic-gate    NSR-?:NONSTOP_KERNEL:*:*)
12017c478bd9Sstevel@tonic-gate	echo nsr-tandem-nsk${UNAME_RELEASE}
12027c478bd9Sstevel@tonic-gate	exit 0 ;;
12037c478bd9Sstevel@tonic-gate    *:NonStop-UX:*:*)
12047c478bd9Sstevel@tonic-gate	echo mips-compaq-nonstopux
12057c478bd9Sstevel@tonic-gate	exit 0 ;;
12067c478bd9Sstevel@tonic-gate    BS2000:POSIX*:*:*)
12077c478bd9Sstevel@tonic-gate	echo bs2000-siemens-sysv
12087c478bd9Sstevel@tonic-gate	exit 0 ;;
12097c478bd9Sstevel@tonic-gate    DS/*:UNIX_System_V:*:*)
12107c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
12117c478bd9Sstevel@tonic-gate	exit 0 ;;
12127c478bd9Sstevel@tonic-gate    *:Plan9:*:*)
12137c478bd9Sstevel@tonic-gate	# "uname -m" is not consistent, so use $cputype instead. 386
12147c478bd9Sstevel@tonic-gate	# is converted to i386 for consistency with other x86
12157c478bd9Sstevel@tonic-gate	# operating systems.
12167c478bd9Sstevel@tonic-gate	if test "$cputype" = "386"; then
12177c478bd9Sstevel@tonic-gate	    UNAME_MACHINE=i386
12187c478bd9Sstevel@tonic-gate	else
12197c478bd9Sstevel@tonic-gate	    UNAME_MACHINE="$cputype"
12207c478bd9Sstevel@tonic-gate	fi
12217c478bd9Sstevel@tonic-gate	echo ${UNAME_MACHINE}-unknown-plan9
12227c478bd9Sstevel@tonic-gate	exit 0 ;;
12237c478bd9Sstevel@tonic-gate    *:TOPS-10:*:*)
12247c478bd9Sstevel@tonic-gate	echo pdp10-unknown-tops10
12257c478bd9Sstevel@tonic-gate	exit 0 ;;
12267c478bd9Sstevel@tonic-gate    *:TENEX:*:*)
12277c478bd9Sstevel@tonic-gate	echo pdp10-unknown-tenex
12287c478bd9Sstevel@tonic-gate	exit 0 ;;
12297c478bd9Sstevel@tonic-gate    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
12307c478bd9Sstevel@tonic-gate	echo pdp10-dec-tops20
12317c478bd9Sstevel@tonic-gate	exit 0 ;;
12327c478bd9Sstevel@tonic-gate    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
12337c478bd9Sstevel@tonic-gate	echo pdp10-xkl-tops20
12347c478bd9Sstevel@tonic-gate	exit 0 ;;
12357c478bd9Sstevel@tonic-gate    *:TOPS-20:*:*)
12367c478bd9Sstevel@tonic-gate	echo pdp10-unknown-tops20
12377c478bd9Sstevel@tonic-gate	exit 0 ;;
12387c478bd9Sstevel@tonic-gate    *:ITS:*:*)
12397c478bd9Sstevel@tonic-gate	echo pdp10-unknown-its
12407c478bd9Sstevel@tonic-gate	exit 0 ;;
12417c478bd9Sstevel@tonic-gate    SEI:*:*:SEIUX)
12427c478bd9Sstevel@tonic-gate        echo mips-sei-seiux${UNAME_RELEASE}
12437c478bd9Sstevel@tonic-gate	exit 0 ;;
1244*1b8adde7SWilliam Kucharski    *:DragonFly:*:*)
1245*1b8adde7SWilliam Kucharski	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1246*1b8adde7SWilliam Kucharski	exit 0 ;;
1247*1b8adde7SWilliam Kucharski    *:*VMS:*:*)
1248*1b8adde7SWilliam Kucharski    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1249*1b8adde7SWilliam Kucharski	case "${UNAME_MACHINE}" in
1250*1b8adde7SWilliam Kucharski	    A*) echo alpha-dec-vms && exit 0 ;;
1251*1b8adde7SWilliam Kucharski	    I*) echo ia64-dec-vms && exit 0 ;;
1252*1b8adde7SWilliam Kucharski	    V*) echo vax-dec-vms && exit 0 ;;
1253*1b8adde7SWilliam Kucharski	esac ;;
1254*1b8adde7SWilliam Kucharski    *:XENIX:*:SysV)
1255*1b8adde7SWilliam Kucharski	echo i386-pc-xenix
12567c478bd9Sstevel@tonic-gate	exit 0 ;;
12577c478bd9Sstevel@tonic-gateesac
12587c478bd9Sstevel@tonic-gate
12597c478bd9Sstevel@tonic-gate#echo '(No uname command or uname output not recognized.)' 1>&2
12607c478bd9Sstevel@tonic-gate#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
12617c478bd9Sstevel@tonic-gate
12627c478bd9Sstevel@tonic-gateeval $set_cc_for_build
12637c478bd9Sstevel@tonic-gatecat >$dummy.c <<EOF
12647c478bd9Sstevel@tonic-gate#ifdef _SEQUENT_
12657c478bd9Sstevel@tonic-gate# include <sys/types.h>
12667c478bd9Sstevel@tonic-gate# include <sys/utsname.h>
12677c478bd9Sstevel@tonic-gate#endif
12687c478bd9Sstevel@tonic-gatemain ()
12697c478bd9Sstevel@tonic-gate{
12707c478bd9Sstevel@tonic-gate#if defined (sony)
12717c478bd9Sstevel@tonic-gate#if defined (MIPSEB)
12727c478bd9Sstevel@tonic-gate  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
12737c478bd9Sstevel@tonic-gate     I don't know....  */
12747c478bd9Sstevel@tonic-gate  printf ("mips-sony-bsd\n"); exit (0);
12757c478bd9Sstevel@tonic-gate#else
12767c478bd9Sstevel@tonic-gate#include <sys/param.h>
12777c478bd9Sstevel@tonic-gate  printf ("m68k-sony-newsos%s\n",
12787c478bd9Sstevel@tonic-gate#ifdef NEWSOS4
12797c478bd9Sstevel@tonic-gate          "4"
12807c478bd9Sstevel@tonic-gate#else
12817c478bd9Sstevel@tonic-gate	  ""
12827c478bd9Sstevel@tonic-gate#endif
12837c478bd9Sstevel@tonic-gate         ); exit (0);
12847c478bd9Sstevel@tonic-gate#endif
12857c478bd9Sstevel@tonic-gate#endif
12867c478bd9Sstevel@tonic-gate
12877c478bd9Sstevel@tonic-gate#if defined (__arm) && defined (__acorn) && defined (__unix)
12887c478bd9Sstevel@tonic-gate  printf ("arm-acorn-riscix"); exit (0);
12897c478bd9Sstevel@tonic-gate#endif
12907c478bd9Sstevel@tonic-gate
12917c478bd9Sstevel@tonic-gate#if defined (hp300) && !defined (hpux)
12927c478bd9Sstevel@tonic-gate  printf ("m68k-hp-bsd\n"); exit (0);
12937c478bd9Sstevel@tonic-gate#endif
12947c478bd9Sstevel@tonic-gate
12957c478bd9Sstevel@tonic-gate#if defined (NeXT)
12967c478bd9Sstevel@tonic-gate#if !defined (__ARCHITECTURE__)
12977c478bd9Sstevel@tonic-gate#define __ARCHITECTURE__ "m68k"
12987c478bd9Sstevel@tonic-gate#endif
12997c478bd9Sstevel@tonic-gate  int version;
13007c478bd9Sstevel@tonic-gate  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
13017c478bd9Sstevel@tonic-gate  if (version < 4)
13027c478bd9Sstevel@tonic-gate    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
13037c478bd9Sstevel@tonic-gate  else
13047c478bd9Sstevel@tonic-gate    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
13057c478bd9Sstevel@tonic-gate  exit (0);
13067c478bd9Sstevel@tonic-gate#endif
13077c478bd9Sstevel@tonic-gate
13087c478bd9Sstevel@tonic-gate#if defined (MULTIMAX) || defined (n16)
13097c478bd9Sstevel@tonic-gate#if defined (UMAXV)
13107c478bd9Sstevel@tonic-gate  printf ("ns32k-encore-sysv\n"); exit (0);
13117c478bd9Sstevel@tonic-gate#else
13127c478bd9Sstevel@tonic-gate#if defined (CMU)
13137c478bd9Sstevel@tonic-gate  printf ("ns32k-encore-mach\n"); exit (0);
13147c478bd9Sstevel@tonic-gate#else
13157c478bd9Sstevel@tonic-gate  printf ("ns32k-encore-bsd\n"); exit (0);
13167c478bd9Sstevel@tonic-gate#endif
13177c478bd9Sstevel@tonic-gate#endif
13187c478bd9Sstevel@tonic-gate#endif
13197c478bd9Sstevel@tonic-gate
13207c478bd9Sstevel@tonic-gate#if defined (__386BSD__)
13217c478bd9Sstevel@tonic-gate  printf ("i386-pc-bsd\n"); exit (0);
13227c478bd9Sstevel@tonic-gate#endif
13237c478bd9Sstevel@tonic-gate
13247c478bd9Sstevel@tonic-gate#if defined (sequent)
13257c478bd9Sstevel@tonic-gate#if defined (i386)
13267c478bd9Sstevel@tonic-gate  printf ("i386-sequent-dynix\n"); exit (0);
13277c478bd9Sstevel@tonic-gate#endif
13287c478bd9Sstevel@tonic-gate#if defined (ns32000)
13297c478bd9Sstevel@tonic-gate  printf ("ns32k-sequent-dynix\n"); exit (0);
13307c478bd9Sstevel@tonic-gate#endif
13317c478bd9Sstevel@tonic-gate#endif
13327c478bd9Sstevel@tonic-gate
13337c478bd9Sstevel@tonic-gate#if defined (_SEQUENT_)
13347c478bd9Sstevel@tonic-gate    struct utsname un;
13357c478bd9Sstevel@tonic-gate
13367c478bd9Sstevel@tonic-gate    uname(&un);
13377c478bd9Sstevel@tonic-gate
13387c478bd9Sstevel@tonic-gate    if (strncmp(un.version, "V2", 2) == 0) {
13397c478bd9Sstevel@tonic-gate	printf ("i386-sequent-ptx2\n"); exit (0);
13407c478bd9Sstevel@tonic-gate    }
13417c478bd9Sstevel@tonic-gate    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
13427c478bd9Sstevel@tonic-gate	printf ("i386-sequent-ptx1\n"); exit (0);
13437c478bd9Sstevel@tonic-gate    }
13447c478bd9Sstevel@tonic-gate    printf ("i386-sequent-ptx\n"); exit (0);
13457c478bd9Sstevel@tonic-gate
13467c478bd9Sstevel@tonic-gate#endif
13477c478bd9Sstevel@tonic-gate
13487c478bd9Sstevel@tonic-gate#if defined (vax)
13497c478bd9Sstevel@tonic-gate# if !defined (ultrix)
13507c478bd9Sstevel@tonic-gate#  include <sys/param.h>
13517c478bd9Sstevel@tonic-gate#  if defined (BSD)
13527c478bd9Sstevel@tonic-gate#   if BSD == 43
13537c478bd9Sstevel@tonic-gate      printf ("vax-dec-bsd4.3\n"); exit (0);
13547c478bd9Sstevel@tonic-gate#   else
13557c478bd9Sstevel@tonic-gate#    if BSD == 199006
13567c478bd9Sstevel@tonic-gate      printf ("vax-dec-bsd4.3reno\n"); exit (0);
13577c478bd9Sstevel@tonic-gate#    else
13587c478bd9Sstevel@tonic-gate      printf ("vax-dec-bsd\n"); exit (0);
13597c478bd9Sstevel@tonic-gate#    endif
13607c478bd9Sstevel@tonic-gate#   endif
13617c478bd9Sstevel@tonic-gate#  else
13627c478bd9Sstevel@tonic-gate    printf ("vax-dec-bsd\n"); exit (0);
13637c478bd9Sstevel@tonic-gate#  endif
13647c478bd9Sstevel@tonic-gate# else
13657c478bd9Sstevel@tonic-gate    printf ("vax-dec-ultrix\n"); exit (0);
13667c478bd9Sstevel@tonic-gate# endif
13677c478bd9Sstevel@tonic-gate#endif
13687c478bd9Sstevel@tonic-gate
13697c478bd9Sstevel@tonic-gate#if defined (alliant) && defined (i860)
13707c478bd9Sstevel@tonic-gate  printf ("i860-alliant-bsd\n"); exit (0);
13717c478bd9Sstevel@tonic-gate#endif
13727c478bd9Sstevel@tonic-gate
13737c478bd9Sstevel@tonic-gate  exit (1);
13747c478bd9Sstevel@tonic-gate}
13757c478bd9Sstevel@tonic-gateEOF
13767c478bd9Sstevel@tonic-gate
13777c478bd9Sstevel@tonic-gate$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
13787c478bd9Sstevel@tonic-gate
13797c478bd9Sstevel@tonic-gate# Apollos put the system type in the environment.
13807c478bd9Sstevel@tonic-gate
13817c478bd9Sstevel@tonic-gatetest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
13827c478bd9Sstevel@tonic-gate
13837c478bd9Sstevel@tonic-gate# Convex versions that predate uname can use getsysinfo(1)
13847c478bd9Sstevel@tonic-gate
13857c478bd9Sstevel@tonic-gateif [ -x /usr/convex/getsysinfo ]
13867c478bd9Sstevel@tonic-gatethen
13877c478bd9Sstevel@tonic-gate    case `getsysinfo -f cpu_type` in
13887c478bd9Sstevel@tonic-gate    c1*)
13897c478bd9Sstevel@tonic-gate	echo c1-convex-bsd
13907c478bd9Sstevel@tonic-gate	exit 0 ;;
13917c478bd9Sstevel@tonic-gate    c2*)
13927c478bd9Sstevel@tonic-gate	if getsysinfo -f scalar_acc
13937c478bd9Sstevel@tonic-gate	then echo c32-convex-bsd
13947c478bd9Sstevel@tonic-gate	else echo c2-convex-bsd
13957c478bd9Sstevel@tonic-gate	fi
13967c478bd9Sstevel@tonic-gate	exit 0 ;;
13977c478bd9Sstevel@tonic-gate    c34*)
13987c478bd9Sstevel@tonic-gate	echo c34-convex-bsd
13997c478bd9Sstevel@tonic-gate	exit 0 ;;
14007c478bd9Sstevel@tonic-gate    c38*)
14017c478bd9Sstevel@tonic-gate	echo c38-convex-bsd
14027c478bd9Sstevel@tonic-gate	exit 0 ;;
14037c478bd9Sstevel@tonic-gate    c4*)
14047c478bd9Sstevel@tonic-gate	echo c4-convex-bsd
14057c478bd9Sstevel@tonic-gate	exit 0 ;;
14067c478bd9Sstevel@tonic-gate    esac
14077c478bd9Sstevel@tonic-gatefi
14087c478bd9Sstevel@tonic-gate
14097c478bd9Sstevel@tonic-gatecat >&2 <<EOF
14107c478bd9Sstevel@tonic-gate$0: unable to guess system type
14117c478bd9Sstevel@tonic-gate
14127c478bd9Sstevel@tonic-gateThis script, last modified $timestamp, has failed to recognize
14137c478bd9Sstevel@tonic-gatethe operating system you are using. It is advised that you
14147c478bd9Sstevel@tonic-gatedownload the most up to date version of the config scripts from
14157c478bd9Sstevel@tonic-gate
14167c478bd9Sstevel@tonic-gate    ftp://ftp.gnu.org/pub/gnu/config/
14177c478bd9Sstevel@tonic-gate
14187c478bd9Sstevel@tonic-gateIf the version you run ($0) is already up to date, please
14197c478bd9Sstevel@tonic-gatesend the following data and any information you think might be
14207c478bd9Sstevel@tonic-gatepertinent to <config-patches@gnu.org> in order to provide the needed
14217c478bd9Sstevel@tonic-gateinformation to handle your system.
14227c478bd9Sstevel@tonic-gate
14237c478bd9Sstevel@tonic-gateconfig.guess timestamp = $timestamp
14247c478bd9Sstevel@tonic-gate
14257c478bd9Sstevel@tonic-gateuname -m = `(uname -m) 2>/dev/null || echo unknown`
14267c478bd9Sstevel@tonic-gateuname -r = `(uname -r) 2>/dev/null || echo unknown`
14277c478bd9Sstevel@tonic-gateuname -s = `(uname -s) 2>/dev/null || echo unknown`
14287c478bd9Sstevel@tonic-gateuname -v = `(uname -v) 2>/dev/null || echo unknown`
14297c478bd9Sstevel@tonic-gate
14307c478bd9Sstevel@tonic-gate/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
14317c478bd9Sstevel@tonic-gate/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
14327c478bd9Sstevel@tonic-gate
14337c478bd9Sstevel@tonic-gatehostinfo               = `(hostinfo) 2>/dev/null`
14347c478bd9Sstevel@tonic-gate/bin/universe          = `(/bin/universe) 2>/dev/null`
14357c478bd9Sstevel@tonic-gate/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
14367c478bd9Sstevel@tonic-gate/bin/arch              = `(/bin/arch) 2>/dev/null`
14377c478bd9Sstevel@tonic-gate/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
14387c478bd9Sstevel@tonic-gate/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
14397c478bd9Sstevel@tonic-gate
14407c478bd9Sstevel@tonic-gateUNAME_MACHINE = ${UNAME_MACHINE}
14417c478bd9Sstevel@tonic-gateUNAME_RELEASE = ${UNAME_RELEASE}
14427c478bd9Sstevel@tonic-gateUNAME_SYSTEM  = ${UNAME_SYSTEM}
14437c478bd9Sstevel@tonic-gateUNAME_VERSION = ${UNAME_VERSION}
14447c478bd9Sstevel@tonic-gateEOF
14457c478bd9Sstevel@tonic-gate
14467c478bd9Sstevel@tonic-gateexit 1
14477c478bd9Sstevel@tonic-gate
14487c478bd9Sstevel@tonic-gate# Local variables:
14497c478bd9Sstevel@tonic-gate# eval: (add-hook 'write-file-hooks 'time-stamp)
14507c478bd9Sstevel@tonic-gate# time-stamp-start: "timestamp='"
14517c478bd9Sstevel@tonic-gate# time-stamp-format: "%:y-%02m-%02d"
14527c478bd9Sstevel@tonic-gate# time-stamp-end: "'"
14537c478bd9Sstevel@tonic-gate# End:
1454