config.guess
changeset 0 76be7dab668c
child 2 e273b0e38b8b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config.guess	Thu Aug 10 06:05:39 2000 +0000
     1.3 @@ -0,0 +1,1087 @@
     1.4 +#! /bin/sh
     1.5 +# Attempt to guess a canonical system name.
     1.6 +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
     1.7 +#   Free Software Foundation, Inc.
     1.8 +#
     1.9 +# This file is free software; you can redistribute it and/or modify it
    1.10 +# under the terms of the GNU General Public License as published by
    1.11 +# the Free Software Foundation; either version 2 of the License, or
    1.12 +# (at your option) any later version.
    1.13 +#
    1.14 +# This program is distributed in the hope that it will be useful, but
    1.15 +# WITHOUT ANY WARRANTY; without even the implied warranty of
    1.16 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.17 +# General Public License for more details.
    1.18 +#
    1.19 +# You should have received a copy of the GNU General Public License
    1.20 +# along with this program; if not, write to the Free Software
    1.21 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1.22 +#
    1.23 +# As a special exception to the GNU General Public License, if you
    1.24 +# distribute this file as part of a program that contains a
    1.25 +# configuration script generated by Autoconf, you may include it under
    1.26 +# the same distribution terms that you use for the rest of that program.
    1.27 +
    1.28 +# Written by Per Bothner <bothner@cygnus.com>.
    1.29 +# The master version of this file is at the FSF in /home/gd/gnu/lib.
    1.30 +# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
    1.31 +#
    1.32 +# This script attempts to guess a canonical system name similar to
    1.33 +# config.sub.  If it succeeds, it prints the system name on stdout, and
    1.34 +# exits with 0.  Otherwise, it exits with 1.
    1.35 +#
    1.36 +# The plan is that this can be called by configure scripts if you
    1.37 +# don't specify an explicit system type (host/target name).
    1.38 +#
    1.39 +# Only a few systems have been added to this list; please add others
    1.40 +# (but try to keep the structure clean).
    1.41 +#
    1.42 +
    1.43 +# Use $HOST_CC if defined. $CC may point to a cross-compiler
    1.44 +if test x"$CC_FOR_BUILD" = x; then
    1.45 +  if test x"$HOST_CC" != x; then
    1.46 +    CC_FOR_BUILD="$HOST_CC"
    1.47 +  else
    1.48 +    if test x"$CC" != x; then
    1.49 +      CC_FOR_BUILD="$CC"
    1.50 +    else
    1.51 +      CC_FOR_BUILD=cc
    1.52 +    fi
    1.53 +  fi
    1.54 +fi
    1.55 +
    1.56 +
    1.57 +# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
    1.58 +# (ghazi@noc.rutgers.edu 8/24/94.)
    1.59 +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
    1.60 +	PATH=$PATH:/.attbin ; export PATH
    1.61 +fi
    1.62 +
    1.63 +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
    1.64 +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
    1.65 +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
    1.66 +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    1.67 +
    1.68 +dummy=dummy-$$
    1.69 +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
    1.70 +
    1.71 +# Note: order is significant - the case branches are not exclusive.
    1.72 +
    1.73 +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
    1.74 +    alpha:OSF1:*:*)
    1.75 +	if test $UNAME_RELEASE = "V4.0"; then
    1.76 +		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    1.77 +	fi
    1.78 +	# A Vn.n version is a released version.
    1.79 +	# A Tn.n version is a released field test version.
    1.80 +	# A Xn.n version is an unreleased experimental baselevel.
    1.81 +	# 1.2 uses "1.2" for uname -r.
    1.82 +	cat <<EOF >$dummy.s
    1.83 +	.globl main
    1.84 +	.ent main
    1.85 +main:
    1.86 +	.frame \$30,0,\$26,0
    1.87 +	.prologue 0
    1.88 +	.long 0x47e03d80 # implver $0
    1.89 +	lda \$2,259
    1.90 +	.long 0x47e20c21 # amask $2,$1
    1.91 +	srl \$1,8,\$2
    1.92 +	sll \$2,2,\$2
    1.93 +	sll \$0,3,\$0
    1.94 +	addl \$1,\$0,\$0
    1.95 +	addl \$2,\$0,\$0
    1.96 +	ret \$31,(\$26),1
    1.97 +	.end main
    1.98 +EOF
    1.99 +	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
   1.100 +	if test "$?" = 0 ; then
   1.101 +		./$dummy
   1.102 +		case "$?" in
   1.103 +			7)
   1.104 +				UNAME_MACHINE="alpha"
   1.105 +				;;
   1.106 +			15)
   1.107 +				UNAME_MACHINE="alphaev5"
   1.108 +				;;
   1.109 +			14)
   1.110 +				UNAME_MACHINE="alphaev56"
   1.111 +				;;
   1.112 +			10)
   1.113 +				UNAME_MACHINE="alphapca56"
   1.114 +				;;
   1.115 +			16)
   1.116 +				UNAME_MACHINE="alphaev6"
   1.117 +				;;
   1.118 +		esac
   1.119 +	fi
   1.120 +	rm -f $dummy.s $dummy
   1.121 +	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.122 +	exit 0 ;;
   1.123 +    Alpha\ *:Windows_NT*:*)
   1.124 +	# How do we know it's Interix rather than the generic POSIX subsystem?
   1.125 +	# Should we change UNAME_MACHINE based on the output of uname instead
   1.126 +	# of the specific Alpha model?
   1.127 +	echo alpha-pc-interix
   1.128 +	exit 0 ;;
   1.129 +    21064:Windows_NT:50:3)
   1.130 +	echo alpha-dec-winnt3.5
   1.131 +	exit 0 ;;
   1.132 +    Amiga*:UNIX_System_V:4.0:*)
   1.133 +	echo m68k-cbm-sysv4
   1.134 +	exit 0;;
   1.135 +    amiga:NetBSD:*:*)
   1.136 +      echo m68k-cbm-netbsd${UNAME_RELEASE}
   1.137 +      exit 0 ;;
   1.138 +    amiga:OpenBSD:*:*)
   1.139 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.140 +	exit 0 ;;
   1.141 +    *:[Aa]miga[Oo][Ss]:*:*)
   1.142 +	echo ${UNAME_MACHINE}-unknown-amigaos
   1.143 +	exit 0 ;;
   1.144 +    arc64:OpenBSD:*:*)
   1.145 +	echo mips64el-unknown-openbsd${UNAME_RELEASE}
   1.146 +	exit 0 ;;
   1.147 +    arc:OpenBSD:*:*)
   1.148 +	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.149 +	exit 0 ;;
   1.150 +    hkmips:OpenBSD:*:*)
   1.151 +	echo mips-unknown-openbsd${UNAME_RELEASE}
   1.152 +	exit 0 ;;
   1.153 +    pmax:OpenBSD:*:*)
   1.154 +	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.155 +	exit 0 ;;
   1.156 +    sgi:OpenBSD:*:*)
   1.157 +	echo mips-unknown-openbsd${UNAME_RELEASE}
   1.158 +	exit 0 ;;
   1.159 +    wgrisc:OpenBSD:*:*)
   1.160 +	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.161 +	exit 0 ;;
   1.162 +    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
   1.163 +	echo arm-acorn-riscix${UNAME_RELEASE}
   1.164 +	exit 0;;
   1.165 +    arm32:NetBSD:*:*)
   1.166 +	echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.167 +	exit 0 ;;
   1.168 +    SR2?01:HI-UX/MPP:*:*)
   1.169 +	echo hppa1.1-hitachi-hiuxmpp
   1.170 +	exit 0;;
   1.171 +    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
   1.172 +	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
   1.173 +	if test "`(/bin/universe) 2>/dev/null`" = att ; then
   1.174 +		echo pyramid-pyramid-sysv3
   1.175 +	else
   1.176 +		echo pyramid-pyramid-bsd
   1.177 +	fi
   1.178 +	exit 0 ;;
   1.179 +    NILE*:*:*:dcosx)
   1.180 +	echo pyramid-pyramid-svr4
   1.181 +	exit 0 ;;
   1.182 +    sun4H:SunOS:5.*:*)
   1.183 +	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   1.184 +	exit 0 ;;
   1.185 +    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
   1.186 +	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   1.187 +	exit 0 ;;
   1.188 +    i86pc:SunOS:5.*:*)
   1.189 +	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   1.190 +	exit 0 ;;
   1.191 +    sun4*:SunOS:6*:*)
   1.192 +	# According to config.sub, this is the proper way to canonicalize
   1.193 +	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
   1.194 +	# it's likely to be more like Solaris than SunOS4.
   1.195 +	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   1.196 +	exit 0 ;;
   1.197 +    sun4*:SunOS:*:*)
   1.198 +	case "`/usr/bin/arch -k`" in
   1.199 +	    Series*|S4*)
   1.200 +		UNAME_RELEASE=`uname -v`
   1.201 +		;;
   1.202 +	esac
   1.203 +	# Japanese Language versions have a version number like `4.1.3-JL'.
   1.204 +	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
   1.205 +	exit 0 ;;
   1.206 +    sun3*:SunOS:*:*)
   1.207 +	echo m68k-sun-sunos${UNAME_RELEASE}
   1.208 +	exit 0 ;;
   1.209 +    sun*:*:4.2BSD:*)
   1.210 +	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
   1.211 +	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
   1.212 +	case "`/bin/arch`" in
   1.213 +	    sun3)
   1.214 +		echo m68k-sun-sunos${UNAME_RELEASE}
   1.215 +		;;
   1.216 +	    sun4)
   1.217 +		echo sparc-sun-sunos${UNAME_RELEASE}
   1.218 +		;;
   1.219 +	esac
   1.220 +	exit 0 ;;
   1.221 +    aushp:SunOS:*:*)
   1.222 +	echo sparc-auspex-sunos${UNAME_RELEASE}
   1.223 +	exit 0 ;;
   1.224 +    atari*:NetBSD:*:*)
   1.225 +	echo m68k-atari-netbsd${UNAME_RELEASE}
   1.226 +	exit 0 ;;
   1.227 +    atari*:OpenBSD:*:*)
   1.228 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.229 +	exit 0 ;;
   1.230 +    # The situation for MiNT is a little confusing.  The machine name
   1.231 +    # can be virtually everything (everything which is not
   1.232 +    # "atarist" or "atariste" at least should have a processor 
   1.233 +    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
   1.234 +    # to the lowercase version "mint" (or "freemint").  Finally
   1.235 +    # the system name "TOS" denotes a system which is actually not
   1.236 +    # MiNT.  But MiNT is downward compatible to TOS, so this should
   1.237 +    # be no problem.
   1.238 +    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
   1.239 +        echo m68k-atari-mint${UNAME_RELEASE}
   1.240 +	exit 0 ;;
   1.241 +    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
   1.242 +	echo m68k-atari-mint${UNAME_RELEASE}
   1.243 +        exit 0 ;;
   1.244 +    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
   1.245 +        echo m68k-atari-mint${UNAME_RELEASE}
   1.246 +	exit 0 ;;
   1.247 +    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
   1.248 +        echo m68k-milan-mint${UNAME_RELEASE}
   1.249 +        exit 0 ;;
   1.250 +    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
   1.251 +        echo m68k-hades-mint${UNAME_RELEASE}
   1.252 +        exit 0 ;;
   1.253 +    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
   1.254 +        echo m68k-unknown-mint${UNAME_RELEASE}
   1.255 +        exit 0 ;;
   1.256 +    sun3*:NetBSD:*:*)
   1.257 +	echo m68k-sun-netbsd${UNAME_RELEASE}
   1.258 +	exit 0 ;;
   1.259 +    sun3*:OpenBSD:*:*)
   1.260 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.261 +	exit 0 ;;
   1.262 +    mac68k:NetBSD:*:*)
   1.263 +	echo m68k-apple-netbsd${UNAME_RELEASE}
   1.264 +	exit 0 ;;
   1.265 +    mac68k:OpenBSD:*:*)
   1.266 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.267 +	exit 0 ;;
   1.268 +    mvme68k:OpenBSD:*:*)
   1.269 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.270 +	exit 0 ;;
   1.271 +    mvme88k:OpenBSD:*:*)
   1.272 +	echo m88k-unknown-openbsd${UNAME_RELEASE}
   1.273 +	exit 0 ;;
   1.274 +    powerpc:machten:*:*)
   1.275 +	echo powerpc-apple-machten${UNAME_RELEASE}
   1.276 +	exit 0 ;;
   1.277 +    macppc:NetBSD:*:*)
   1.278 +        echo powerpc-apple-netbsd${UNAME_RELEASE}
   1.279 +        exit 0 ;;
   1.280 +    RISC*:Mach:*:*)
   1.281 +	echo mips-dec-mach_bsd4.3
   1.282 +	exit 0 ;;
   1.283 +    RISC*:ULTRIX:*:*)
   1.284 +	echo mips-dec-ultrix${UNAME_RELEASE}
   1.285 +	exit 0 ;;
   1.286 +    VAX*:ULTRIX*:*:*)
   1.287 +	echo vax-dec-ultrix${UNAME_RELEASE}
   1.288 +	exit 0 ;;
   1.289 +    2020:CLIX:*:* | 2430:CLIX:*:*)
   1.290 +	echo clipper-intergraph-clix${UNAME_RELEASE}
   1.291 +	exit 0 ;;
   1.292 +    mips:*:*:UMIPS | mips:*:*:RISCos)
   1.293 +	sed 's/^	//' << EOF >$dummy.c
   1.294 +#ifdef __cplusplus
   1.295 +	int main (int argc, char *argv[]) {
   1.296 +#else
   1.297 +	int main (argc, argv) int argc; char *argv[]; {
   1.298 +#endif
   1.299 +	#if defined (host_mips) && defined (MIPSEB)
   1.300 +	#if defined (SYSTYPE_SYSV)
   1.301 +	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
   1.302 +	#endif
   1.303 +	#if defined (SYSTYPE_SVR4)
   1.304 +	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
   1.305 +	#endif
   1.306 +	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
   1.307 +	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
   1.308 +	#endif
   1.309 +	#endif
   1.310 +	  exit (-1);
   1.311 +	}
   1.312 +EOF
   1.313 +	$CC_FOR_BUILD $dummy.c -o $dummy \
   1.314 +	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
   1.315 +	  && rm $dummy.c $dummy && exit 0
   1.316 +	rm -f $dummy.c $dummy
   1.317 +	echo mips-mips-riscos${UNAME_RELEASE}
   1.318 +	exit 0 ;;
   1.319 +    Night_Hawk:Power_UNIX:*:*)
   1.320 +	echo powerpc-harris-powerunix
   1.321 +	exit 0 ;;
   1.322 +    m88k:CX/UX:7*:*)
   1.323 +	echo m88k-harris-cxux7
   1.324 +	exit 0 ;;
   1.325 +    m88k:*:4*:R4*)
   1.326 +	echo m88k-motorola-sysv4
   1.327 +	exit 0 ;;
   1.328 +    m88k:*:3*:R3*)
   1.329 +	echo m88k-motorola-sysv3
   1.330 +	exit 0 ;;
   1.331 +    AViiON:dgux:*:*)
   1.332 +        # DG/UX returns AViiON for all architectures
   1.333 +        UNAME_PROCESSOR=`/usr/bin/uname -p`
   1.334 +        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
   1.335 +	if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
   1.336 +	     -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
   1.337 +		echo m88k-dg-dgux${UNAME_RELEASE}
   1.338 +	else
   1.339 +		echo m88k-dg-dguxbcs${UNAME_RELEASE}
   1.340 +	fi
   1.341 +        else echo i586-dg-dgux${UNAME_RELEASE}
   1.342 +        fi
   1.343 + 	exit 0 ;;
   1.344 +    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
   1.345 +	echo m88k-dolphin-sysv3
   1.346 +	exit 0 ;;
   1.347 +    M88*:*:R3*:*)
   1.348 +	# Delta 88k system running SVR3
   1.349 +	echo m88k-motorola-sysv3
   1.350 +	exit 0 ;;
   1.351 +    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
   1.352 +	echo m88k-tektronix-sysv3
   1.353 +	exit 0 ;;
   1.354 +    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
   1.355 +	echo m68k-tektronix-bsd
   1.356 +	exit 0 ;;
   1.357 +    *:IRIX*:*:*)
   1.358 +	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
   1.359 +	exit 0 ;;
   1.360 +    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
   1.361 +	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
   1.362 +	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
   1.363 +    i?86:AIX:*:*)
   1.364 +	echo i386-ibm-aix
   1.365 +	exit 0 ;;
   1.366 +    *:AIX:2:3)
   1.367 +	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
   1.368 +		sed 's/^		//' << EOF >$dummy.c
   1.369 +		#include <sys/systemcfg.h>
   1.370 +
   1.371 +		main()
   1.372 +			{
   1.373 +			if (!__power_pc())
   1.374 +				exit(1);
   1.375 +			puts("powerpc-ibm-aix3.2.5");
   1.376 +			exit(0);
   1.377 +			}
   1.378 +EOF
   1.379 +		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
   1.380 +		rm -f $dummy.c $dummy
   1.381 +		echo rs6000-ibm-aix3.2.5
   1.382 +	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
   1.383 +		echo rs6000-ibm-aix3.2.4
   1.384 +	else
   1.385 +		echo rs6000-ibm-aix3.2
   1.386 +	fi
   1.387 +	exit 0 ;;
   1.388 +    *:AIX:*:4)
   1.389 +	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
   1.390 +	if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
   1.391 +		IBM_ARCH=rs6000
   1.392 +	else
   1.393 +		IBM_ARCH=powerpc
   1.394 +	fi
   1.395 +	if [ -x /usr/bin/oslevel ] ; then
   1.396 +		IBM_REV=`/usr/bin/oslevel`
   1.397 +	else
   1.398 +		IBM_REV=4.${UNAME_RELEASE}
   1.399 +	fi
   1.400 +	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
   1.401 +	exit 0 ;;
   1.402 +    *:AIX:*:*)
   1.403 +	echo rs6000-ibm-aix
   1.404 +	exit 0 ;;
   1.405 +    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
   1.406 +	echo romp-ibm-bsd4.4
   1.407 +	exit 0 ;;
   1.408 +    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
   1.409 +	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
   1.410 +	exit 0 ;;                           # report: romp-ibm BSD 4.3
   1.411 +    *:BOSX:*:*)
   1.412 +	echo rs6000-bull-bosx
   1.413 +	exit 0 ;;
   1.414 +    DPX/2?00:B.O.S.:*:*)
   1.415 +	echo m68k-bull-sysv3
   1.416 +	exit 0 ;;
   1.417 +    9000/[34]??:4.3bsd:1.*:*)
   1.418 +	echo m68k-hp-bsd
   1.419 +	exit 0 ;;
   1.420 +    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
   1.421 +	echo m68k-hp-bsd4.4
   1.422 +	exit 0 ;;
   1.423 +    9000/[34678]??:HP-UX:*:*)
   1.424 +	case "${UNAME_MACHINE}" in
   1.425 +	    9000/31? )            HP_ARCH=m68000 ;;
   1.426 +	    9000/[34]?? )         HP_ARCH=m68k ;;
   1.427 +	    9000/[678][0-9][0-9])
   1.428 +              sed 's/^              //' << EOF >$dummy.c
   1.429 +              #include <stdlib.h>
   1.430 +              #include <unistd.h>
   1.431 +
   1.432 +              int main ()
   1.433 +              {
   1.434 +              #if defined(_SC_KERNEL_BITS)
   1.435 +                  long bits = sysconf(_SC_KERNEL_BITS);
   1.436 +              #endif
   1.437 +                  long cpu  = sysconf (_SC_CPU_VERSION);
   1.438 +
   1.439 +                  switch (cpu)
   1.440 +              	{
   1.441 +              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
   1.442 +              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
   1.443 +              	case CPU_PA_RISC2_0:
   1.444 +              #if defined(_SC_KERNEL_BITS)
   1.445 +              	    switch (bits)
   1.446 +              		{
   1.447 +              		case 64: puts ("hppa2.0w"); break;
   1.448 +              		case 32: puts ("hppa2.0n"); break;
   1.449 +              		default: puts ("hppa2.0"); break;
   1.450 +              		} break;
   1.451 +              #else  /* !defined(_SC_KERNEL_BITS) */
   1.452 +              	    puts ("hppa2.0"); break;
   1.453 +              #endif
   1.454 +              	default: puts ("hppa1.0"); break;
   1.455 +              	}
   1.456 +                  exit (0);
   1.457 +              }
   1.458 +EOF
   1.459 +	($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
   1.460 +	rm -f $dummy.c $dummy
   1.461 +	esac
   1.462 +	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
   1.463 +	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
   1.464 +	exit 0 ;;
   1.465 +    3050*:HI-UX:*:*)
   1.466 +	sed 's/^	//' << EOF >$dummy.c
   1.467 +	#include <unistd.h>
   1.468 +	int
   1.469 +	main ()
   1.470 +	{
   1.471 +	  long cpu = sysconf (_SC_CPU_VERSION);
   1.472 +	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
   1.473 +	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
   1.474 +	     results, however.  */
   1.475 +	  if (CPU_IS_PA_RISC (cpu))
   1.476 +	    {
   1.477 +	      switch (cpu)
   1.478 +		{
   1.479 +		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
   1.480 +		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
   1.481 +		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
   1.482 +		  default: puts ("hppa-hitachi-hiuxwe2"); break;
   1.483 +		}
   1.484 +	    }
   1.485 +	  else if (CPU_IS_HP_MC68K (cpu))
   1.486 +	    puts ("m68k-hitachi-hiuxwe2");
   1.487 +	  else puts ("unknown-hitachi-hiuxwe2");
   1.488 +	  exit (0);
   1.489 +	}
   1.490 +EOF
   1.491 +	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
   1.492 +	rm -f $dummy.c $dummy
   1.493 +	echo unknown-hitachi-hiuxwe2
   1.494 +	exit 0 ;;
   1.495 +    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
   1.496 +	echo hppa1.1-hp-bsd
   1.497 +	exit 0 ;;
   1.498 +    9000/8??:4.3bsd:*:*)
   1.499 +	echo hppa1.0-hp-bsd
   1.500 +	exit 0 ;;
   1.501 +    *9??*:MPE/iX:*:*)
   1.502 +	echo hppa1.0-hp-mpeix
   1.503 +	exit 0 ;;
   1.504 +    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
   1.505 +	echo hppa1.1-hp-osf
   1.506 +	exit 0 ;;
   1.507 +    hp8??:OSF1:*:*)
   1.508 +	echo hppa1.0-hp-osf
   1.509 +	exit 0 ;;
   1.510 +    i?86:OSF1:*:*)
   1.511 +	if [ -x /usr/sbin/sysversion ] ; then
   1.512 +	    echo ${UNAME_MACHINE}-unknown-osf1mk
   1.513 +	else
   1.514 +	    echo ${UNAME_MACHINE}-unknown-osf1
   1.515 +	fi
   1.516 +	exit 0 ;;
   1.517 +    parisc*:Lites*:*:*)
   1.518 +	echo hppa1.1-hp-lites
   1.519 +	exit 0 ;;
   1.520 +    hppa*:OpenBSD:*:*)
   1.521 +	echo hppa-unknown-openbsd
   1.522 +	exit 0 ;;
   1.523 +    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
   1.524 +	echo c1-convex-bsd
   1.525 +        exit 0 ;;
   1.526 +    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
   1.527 +	if getsysinfo -f scalar_acc
   1.528 +	then echo c32-convex-bsd
   1.529 +	else echo c2-convex-bsd
   1.530 +	fi
   1.531 +        exit 0 ;;
   1.532 +    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
   1.533 +	echo c34-convex-bsd
   1.534 +        exit 0 ;;
   1.535 +    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
   1.536 +	echo c38-convex-bsd
   1.537 +        exit 0 ;;
   1.538 +    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
   1.539 +	echo c4-convex-bsd
   1.540 +        exit 0 ;;
   1.541 +    CRAY*X-MP:*:*:*)
   1.542 +	echo xmp-cray-unicos
   1.543 +        exit 0 ;;
   1.544 +    CRAY*Y-MP:*:*:*)
   1.545 +	echo ymp-cray-unicos${UNAME_RELEASE}
   1.546 +	exit 0 ;;
   1.547 +    CRAY*[A-Z]90:*:*:*)
   1.548 +	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
   1.549 +	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
   1.550 +	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
   1.551 +	exit 0 ;;
   1.552 +    CRAY*TS:*:*:*)
   1.553 +	echo t90-cray-unicos${UNAME_RELEASE}
   1.554 +	exit 0 ;;
   1.555 +    CRAY*T3E:*:*:*)
   1.556 +	echo t3e-cray-unicosmk${UNAME_RELEASE}
   1.557 +	exit 0 ;;
   1.558 +    CRAY-2:*:*:*)
   1.559 +	echo cray2-cray-unicos
   1.560 +        exit 0 ;;
   1.561 +    F300:UNIX_System_V:*:*)
   1.562 +        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
   1.563 +        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
   1.564 +        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   1.565 +        exit 0 ;;
   1.566 +    F301:UNIX_System_V:*:*)
   1.567 +       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
   1.568 +       exit 0 ;;
   1.569 +    hp3[0-9][05]:NetBSD:*:*)
   1.570 +	echo m68k-hp-netbsd${UNAME_RELEASE}
   1.571 +	exit 0 ;;
   1.572 +    hp300:OpenBSD:*:*)
   1.573 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.574 +	exit 0 ;;
   1.575 +    i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
   1.576 +	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
   1.577 +	exit 0 ;;
   1.578 +    sparc*:BSD/OS:*:*)
   1.579 +	echo sparc-unknown-bsdi${UNAME_RELEASE}
   1.580 +	exit 0 ;;
   1.581 +    *:BSD/OS:*:*)
   1.582 +	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
   1.583 +	exit 0 ;;
   1.584 +    *:FreeBSD:*:*)
   1.585 +	if test -x /usr/bin/objformat; then
   1.586 +	    if test "elf" = "`/usr/bin/objformat`"; then
   1.587 +		echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
   1.588 +		exit 0
   1.589 +	    fi
   1.590 +	fi
   1.591 +	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
   1.592 +	exit 0 ;;
   1.593 +    *:NetBSD:*:*)
   1.594 +	echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.595 +	exit 0 ;;
   1.596 +    *:OpenBSD:*:*)
   1.597 +	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.598 +	exit 0 ;;
   1.599 +    i*:CYGWIN*:*)
   1.600 +	echo ${UNAME_MACHINE}-pc-cygwin
   1.601 +	exit 0 ;;
   1.602 +    i*:MINGW*:*)
   1.603 +	echo ${UNAME_MACHINE}-pc-mingw32
   1.604 +	exit 0 ;;
   1.605 +    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
   1.606 +	# How do we know it's Interix rather than the generic POSIX subsystem?
   1.607 +	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
   1.608 +	# UNAME_MACHINE based on the output of uname instead of i386?
   1.609 +	echo i386-pc-interix
   1.610 +	exit 0 ;;
   1.611 +    i*:UWIN*:*)
   1.612 +	echo ${UNAME_MACHINE}-pc-uwin
   1.613 +	exit 0 ;;
   1.614 +    p*:CYGWIN*:*)
   1.615 +	echo powerpcle-unknown-cygwin
   1.616 +	exit 0 ;;
   1.617 +    prep*:SunOS:5.*:*)
   1.618 +	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   1.619 +	exit 0 ;;
   1.620 +    *:GNU:*:*)
   1.621 +	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
   1.622 +	exit 0 ;;
   1.623 +    *:Linux:*:*)
   1.624 +	# uname on the ARM produces all sorts of strangeness, and we need to
   1.625 +	# filter it out.
   1.626 +	case "$UNAME_MACHINE" in
   1.627 +	  armv*)		      UNAME_MACHINE=$UNAME_MACHINE ;;
   1.628 +	  arm* | sa110*)	      UNAME_MACHINE="arm" ;;
   1.629 +	esac
   1.630 +
   1.631 +	# The BFD linker knows what the default object file format is, so
   1.632 +	# first see if it will tell us. cd to the root directory to prevent
   1.633 +	# problems with other programs or directories called `ld' in the path.
   1.634 +	ld_help_string=`cd /; ld --help 2>&1`
   1.635 +	ld_supported_emulations=`echo $ld_help_string \
   1.636 +			 | sed -ne '/supported emulations:/!d
   1.637 +				    s/[ 	][ 	]*/ /g
   1.638 +				    s/.*supported emulations: *//
   1.639 +				    s/ .*//
   1.640 +				    p'`
   1.641 +        case "$ld_supported_emulations" in
   1.642 +	  i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
   1.643 +	  i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
   1.644 +	  sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
   1.645 +	  armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
   1.646 +	  m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
   1.647 +	  elf32ppc)
   1.648 +		# Determine Lib Version
   1.649 +		cat >$dummy.c <<EOF
   1.650 +#include <features.h>
   1.651 +#if defined(__GLIBC__)
   1.652 +extern char __libc_version[];
   1.653 +extern char __libc_release[];
   1.654 +#endif
   1.655 +main(argc, argv)
   1.656 +     int argc;
   1.657 +     char *argv[];
   1.658 +{
   1.659 +#if defined(__GLIBC__)
   1.660 +  printf("%s %s\n", __libc_version, __libc_release);
   1.661 +#else
   1.662 +  printf("unkown\n");
   1.663 +#endif
   1.664 +  return 0;
   1.665 +}
   1.666 +EOF
   1.667 +		LIBC=""
   1.668 +		$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
   1.669 +		if test "$?" = 0 ; then
   1.670 +			./$dummy | grep 1\.99 > /dev/null
   1.671 +			if test "$?" = 0 ; then
   1.672 +				LIBC="libc1"
   1.673 +			fi
   1.674 +		fi	
   1.675 +		rm -f $dummy.c $dummy
   1.676 +		echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
   1.677 +	esac
   1.678 +
   1.679 +	if test "${UNAME_MACHINE}" = "alpha" ; then
   1.680 +		sed 's/^	//'  <<EOF >$dummy.s
   1.681 +		.globl main
   1.682 +		.ent main
   1.683 +	main:
   1.684 +		.frame \$30,0,\$26,0
   1.685 +		.prologue 0
   1.686 +		.long 0x47e03d80 # implver $0
   1.687 +		lda \$2,259
   1.688 +		.long 0x47e20c21 # amask $2,$1
   1.689 +		srl \$1,8,\$2
   1.690 +		sll \$2,2,\$2
   1.691 +		sll \$0,3,\$0
   1.692 +		addl \$1,\$0,\$0
   1.693 +		addl \$2,\$0,\$0
   1.694 +		ret \$31,(\$26),1
   1.695 +		.end main
   1.696 +EOF
   1.697 +		LIBC=""
   1.698 +		$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
   1.699 +		if test "$?" = 0 ; then
   1.700 +			./$dummy
   1.701 +			case "$?" in
   1.702 +			7)
   1.703 +				UNAME_MACHINE="alpha"
   1.704 +				;;
   1.705 +			15)
   1.706 +				UNAME_MACHINE="alphaev5"
   1.707 +				;;
   1.708 +			14)
   1.709 +				UNAME_MACHINE="alphaev56"
   1.710 +				;;
   1.711 +			10)
   1.712 +				UNAME_MACHINE="alphapca56"
   1.713 +				;;
   1.714 +			16)
   1.715 +				UNAME_MACHINE="alphaev6"
   1.716 +				;;
   1.717 +			esac
   1.718 +
   1.719 +			objdump --private-headers $dummy | \
   1.720 +			  grep ld.so.1 > /dev/null
   1.721 +			if test "$?" = 0 ; then
   1.722 +				LIBC="libc1"
   1.723 +			fi
   1.724 +		fi
   1.725 +		rm -f $dummy.s $dummy
   1.726 +		echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
   1.727 +	elif test "${UNAME_MACHINE}" = "mips" ; then
   1.728 +	  cat >$dummy.c <<EOF
   1.729 +#ifdef __cplusplus
   1.730 +	int main (int argc, char *argv[]) {
   1.731 +#else
   1.732 +	int main (argc, argv) int argc; char *argv[]; {
   1.733 +#endif
   1.734 +#ifdef __MIPSEB__
   1.735 +  printf ("%s-unknown-linux-gnu\n", argv[1]);
   1.736 +#endif
   1.737 +#ifdef __MIPSEL__
   1.738 +  printf ("%sel-unknown-linux-gnu\n", argv[1]);
   1.739 +#endif
   1.740 +  return 0;
   1.741 +}
   1.742 +EOF
   1.743 +	  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
   1.744 +	  rm -f $dummy.c $dummy
   1.745 +	else
   1.746 +	  # Either a pre-BFD a.out linker (linux-gnuoldld)
   1.747 +	  # or one that does not give us useful --help.
   1.748 +	  # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
   1.749 +	  # If ld does not provide *any* "supported emulations:"
   1.750 +	  # that means it is gnuoldld.
   1.751 +	  echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
   1.752 +	  test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
   1.753 +
   1.754 +	  case "${UNAME_MACHINE}" in
   1.755 +	  i?86)
   1.756 +	    VENDOR=pc;
   1.757 +	    ;;
   1.758 +	  *)
   1.759 +	    VENDOR=unknown;
   1.760 +	    ;;
   1.761 +	  esac
   1.762 +	  # Determine whether the default compiler is a.out or elf
   1.763 +	  cat >$dummy.c <<EOF
   1.764 +#include <features.h>
   1.765 +#ifdef __cplusplus
   1.766 +	int main (int argc, char *argv[]) {
   1.767 +#else
   1.768 +	int main (argc, argv) int argc; char *argv[]; {
   1.769 +#endif
   1.770 +#ifdef __ELF__
   1.771 +# ifdef __GLIBC__
   1.772 +#  if __GLIBC__ >= 2
   1.773 +    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
   1.774 +#  else
   1.775 +    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
   1.776 +#  endif
   1.777 +# else
   1.778 +   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
   1.779 +# endif
   1.780 +#else
   1.781 +  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
   1.782 +#endif
   1.783 +  return 0;
   1.784 +}
   1.785 +EOF
   1.786 +	  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
   1.787 +	  rm -f $dummy.c $dummy
   1.788 +	fi ;;
   1.789 +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
   1.790 +# are messed up and put the nodename in both sysname and nodename.
   1.791 +    i?86:DYNIX/ptx:4*:*)
   1.792 +	echo i386-sequent-sysv4
   1.793 +	exit 0 ;;
   1.794 +    i?86:UNIX_SV:4.2MP:2.*)
   1.795 +        # Unixware is an offshoot of SVR4, but it has its own version
   1.796 +        # number series starting with 2...
   1.797 +        # I am not positive that other SVR4 systems won't match this,
   1.798 +	# I just have to hope.  -- rms.
   1.799 +        # Use sysv4.2uw... so that sysv4* matches it.
   1.800 +	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
   1.801 +	exit 0 ;;
   1.802 +    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
   1.803 +	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
   1.804 +		echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
   1.805 +	else
   1.806 +		echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
   1.807 +	fi
   1.808 +	exit 0 ;;
   1.809 +    i?86:*:5:7*)
   1.810 +	UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
   1.811 +	(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
   1.812 +	(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
   1.813 +	(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
   1.814 +	(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
   1.815 +	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
   1.816 +	exit 0 ;;
   1.817 +    i?86:*:3.2:*)
   1.818 +	if test -f /usr/options/cb.name; then
   1.819 +		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
   1.820 +		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
   1.821 +	elif /bin/uname -X 2>/dev/null >/dev/null ; then
   1.822 +		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
   1.823 +		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
   1.824 +		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
   1.825 +			&& UNAME_MACHINE=i586
   1.826 +		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
   1.827 +			&& UNAME_MACHINE=i686
   1.828 +		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
   1.829 +			&& UNAME_MACHINE=i686
   1.830 +		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
   1.831 +	else
   1.832 +		echo ${UNAME_MACHINE}-pc-sysv32
   1.833 +	fi
   1.834 +	exit 0 ;;
   1.835 +    pc:*:*:*)
   1.836 +        # uname -m prints for DJGPP always 'pc', but it prints nothing about
   1.837 +        # the processor, so we play safe by assuming i386.
   1.838 +	echo i386-pc-msdosdjgpp
   1.839 +        exit 0 ;;
   1.840 +    Intel:Mach:3*:*)
   1.841 +	echo i386-pc-mach3
   1.842 +	exit 0 ;;
   1.843 +    paragon:*:*:*)
   1.844 +	echo i860-intel-osf1
   1.845 +	exit 0 ;;
   1.846 +    i860:*:4.*:*) # i860-SVR4
   1.847 +	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
   1.848 +	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
   1.849 +	else # Add other i860-SVR4 vendors below as they are discovered.
   1.850 +	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
   1.851 +	fi
   1.852 +	exit 0 ;;
   1.853 +    mini*:CTIX:SYS*5:*)
   1.854 +	# "miniframe"
   1.855 +	echo m68010-convergent-sysv
   1.856 +	exit 0 ;;
   1.857 +    M68*:*:R3V[567]*:*)
   1.858 +	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
   1.859 +    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
   1.860 +	OS_REL=''
   1.861 +	test -r /etc/.relid \
   1.862 +	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
   1.863 +	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
   1.864 +	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
   1.865 +	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
   1.866 +	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
   1.867 +    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
   1.868 +        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
   1.869 +          && echo i486-ncr-sysv4 && exit 0 ;;
   1.870 +    m68*:LynxOS:2.*:*)
   1.871 +	echo m68k-unknown-lynxos${UNAME_RELEASE}
   1.872 +	exit 0 ;;
   1.873 +    mc68030:UNIX_System_V:4.*:*)
   1.874 +	echo m68k-atari-sysv4
   1.875 +	exit 0 ;;
   1.876 +    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
   1.877 +	echo i386-unknown-lynxos${UNAME_RELEASE}
   1.878 +	exit 0 ;;
   1.879 +    TSUNAMI:LynxOS:2.*:*)
   1.880 +	echo sparc-unknown-lynxos${UNAME_RELEASE}
   1.881 +	exit 0 ;;
   1.882 +    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
   1.883 +	echo rs6000-unknown-lynxos${UNAME_RELEASE}
   1.884 +	exit 0 ;;
   1.885 +    SM[BE]S:UNIX_SV:*:*)
   1.886 +	echo mips-dde-sysv${UNAME_RELEASE}
   1.887 +	exit 0 ;;
   1.888 +    RM*:ReliantUNIX-*:*:*)
   1.889 +	echo mips-sni-sysv4
   1.890 +	exit 0 ;;
   1.891 +    RM*:SINIX-*:*:*)
   1.892 +	echo mips-sni-sysv4
   1.893 +	exit 0 ;;
   1.894 +    *:SINIX-*:*:*)
   1.895 +	if uname -p 2>/dev/null >/dev/null ; then
   1.896 +		UNAME_MACHINE=`(uname -p) 2>/dev/null`
   1.897 +		echo ${UNAME_MACHINE}-sni-sysv4
   1.898 +	else
   1.899 +		echo ns32k-sni-sysv
   1.900 +	fi
   1.901 +	exit 0 ;;
   1.902 +    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
   1.903 +                           # says <Richard.M.Bartel@ccMail.Census.GOV>
   1.904 +        echo i586-unisys-sysv4
   1.905 +        exit 0 ;;
   1.906 +    *:UNIX_System_V:4*:FTX*)
   1.907 +	# From Gerald Hewes <hewes@openmarket.com>.
   1.908 +	# How about differentiating between stratus architectures? -djm
   1.909 +	echo hppa1.1-stratus-sysv4
   1.910 +	exit 0 ;;
   1.911 +    *:*:*:FTX*)
   1.912 +	# From seanf@swdc.stratus.com.
   1.913 +	echo i860-stratus-sysv4
   1.914 +	exit 0 ;;
   1.915 +    mc68*:A/UX:*:*)
   1.916 +	echo m68k-apple-aux${UNAME_RELEASE}
   1.917 +	exit 0 ;;
   1.918 +    news*:NEWS-OS:*:6*)
   1.919 +	echo mips-sony-newsos6
   1.920 +	exit 0 ;;
   1.921 +    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
   1.922 +	if [ -d /usr/nec ]; then
   1.923 +	        echo mips-nec-sysv${UNAME_RELEASE}
   1.924 +	else
   1.925 +	        echo mips-unknown-sysv${UNAME_RELEASE}
   1.926 +	fi
   1.927 +        exit 0 ;;
   1.928 +    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
   1.929 +	echo powerpc-be-beos
   1.930 +	exit 0 ;;
   1.931 +    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
   1.932 +	echo powerpc-apple-beos
   1.933 +	exit 0 ;;
   1.934 +    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
   1.935 +	echo i586-pc-beos
   1.936 +	exit 0 ;;
   1.937 +    SX-4:SUPER-UX:*:*)
   1.938 +	echo sx4-nec-superux${UNAME_RELEASE}
   1.939 +	exit 0 ;;
   1.940 +    SX-5:SUPER-UX:*:*)
   1.941 +	echo sx5-nec-superux${UNAME_RELEASE}
   1.942 +	exit 0 ;;
   1.943 +    Power*:Rhapsody:*:*)
   1.944 +	echo powerpc-apple-rhapsody${UNAME_RELEASE}
   1.945 +	exit 0 ;;
   1.946 +    *:Rhapsody:*:*)
   1.947 +	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
   1.948 +	exit 0 ;;
   1.949 +esac
   1.950 +
   1.951 +#echo '(No uname command or uname output not recognized.)' 1>&2
   1.952 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
   1.953 +
   1.954 +cat >$dummy.c <<EOF
   1.955 +#ifdef _SEQUENT_
   1.956 +# include <sys/types.h>
   1.957 +# include <sys/utsname.h>
   1.958 +#endif
   1.959 +main ()
   1.960 +{
   1.961 +#if defined (sony)
   1.962 +#if defined (MIPSEB)
   1.963 +  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
   1.964 +     I don't know....  */
   1.965 +  printf ("mips-sony-bsd\n"); exit (0);
   1.966 +#else
   1.967 +#include <sys/param.h>
   1.968 +  printf ("m68k-sony-newsos%s\n",
   1.969 +#ifdef NEWSOS4
   1.970 +          "4"
   1.971 +#else
   1.972 +	  ""
   1.973 +#endif
   1.974 +         ); exit (0);
   1.975 +#endif
   1.976 +#endif
   1.977 +
   1.978 +#if defined (__arm) && defined (__acorn) && defined (__unix)
   1.979 +  printf ("arm-acorn-riscix"); exit (0);
   1.980 +#endif
   1.981 +
   1.982 +#if defined (hp300) && !defined (hpux)
   1.983 +  printf ("m68k-hp-bsd\n"); exit (0);
   1.984 +#endif
   1.985 +
   1.986 +#if defined (NeXT)
   1.987 +#if !defined (__ARCHITECTURE__)
   1.988 +#define __ARCHITECTURE__ "m68k"
   1.989 +#endif
   1.990 +  int version;
   1.991 +  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
   1.992 +  if (version < 4)
   1.993 +    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
   1.994 +  else
   1.995 +    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
   1.996 +  exit (0);
   1.997 +#endif
   1.998 +
   1.999 +#if defined (MULTIMAX) || defined (n16)
  1.1000 +#if defined (UMAXV)
  1.1001 +  printf ("ns32k-encore-sysv\n"); exit (0);
  1.1002 +#else
  1.1003 +#if defined (CMU)
  1.1004 +  printf ("ns32k-encore-mach\n"); exit (0);
  1.1005 +#else
  1.1006 +  printf ("ns32k-encore-bsd\n"); exit (0);
  1.1007 +#endif
  1.1008 +#endif
  1.1009 +#endif
  1.1010 +
  1.1011 +#if defined (__386BSD__)
  1.1012 +  printf ("i386-pc-bsd\n"); exit (0);
  1.1013 +#endif
  1.1014 +
  1.1015 +#if defined (sequent)
  1.1016 +#if defined (i386)
  1.1017 +  printf ("i386-sequent-dynix\n"); exit (0);
  1.1018 +#endif
  1.1019 +#if defined (ns32000)
  1.1020 +  printf ("ns32k-sequent-dynix\n"); exit (0);
  1.1021 +#endif
  1.1022 +#endif
  1.1023 +
  1.1024 +#if defined (_SEQUENT_)
  1.1025 +    struct utsname un;
  1.1026 +
  1.1027 +    uname(&un);
  1.1028 +
  1.1029 +    if (strncmp(un.version, "V2", 2) == 0) {
  1.1030 +	printf ("i386-sequent-ptx2\n"); exit (0);
  1.1031 +    }
  1.1032 +    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  1.1033 +	printf ("i386-sequent-ptx1\n"); exit (0);
  1.1034 +    }
  1.1035 +    printf ("i386-sequent-ptx\n"); exit (0);
  1.1036 +
  1.1037 +#endif
  1.1038 +
  1.1039 +#if defined (vax)
  1.1040 +#if !defined (ultrix)
  1.1041 +  printf ("vax-dec-bsd\n"); exit (0);
  1.1042 +#else
  1.1043 +  printf ("vax-dec-ultrix\n"); exit (0);
  1.1044 +#endif
  1.1045 +#endif
  1.1046 +
  1.1047 +#if defined (alliant) && defined (i860)
  1.1048 +  printf ("i860-alliant-bsd\n"); exit (0);
  1.1049 +#endif
  1.1050 +
  1.1051 +  exit (1);
  1.1052 +}
  1.1053 +EOF
  1.1054 +
  1.1055 +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
  1.1056 +rm -f $dummy.c $dummy
  1.1057 +
  1.1058 +# Apollos put the system type in the environment.
  1.1059 +
  1.1060 +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  1.1061 +
  1.1062 +# Convex versions that predate uname can use getsysinfo(1)
  1.1063 +
  1.1064 +if [ -x /usr/convex/getsysinfo ]
  1.1065 +then
  1.1066 +    case `getsysinfo -f cpu_type` in
  1.1067 +    c1*)
  1.1068 +	echo c1-convex-bsd
  1.1069 +	exit 0 ;;
  1.1070 +    c2*)
  1.1071 +	if getsysinfo -f scalar_acc
  1.1072 +	then echo c32-convex-bsd
  1.1073 +	else echo c2-convex-bsd
  1.1074 +	fi
  1.1075 +	exit 0 ;;
  1.1076 +    c34*)
  1.1077 +	echo c34-convex-bsd
  1.1078 +	exit 0 ;;
  1.1079 +    c38*)
  1.1080 +	echo c38-convex-bsd
  1.1081 +	exit 0 ;;
  1.1082 +    c4*)
  1.1083 +	echo c4-convex-bsd
  1.1084 +	exit 0 ;;
  1.1085 +    esac
  1.1086 +fi
  1.1087 +
  1.1088 +#echo '(Unable to guess system type)' 1>&2
  1.1089 +
  1.1090 +exit 1