config.guess
changeset 112 18ef1756e699
parent 16 3f4734b3c97e
child 182 be2f2fcde889
     1.1 --- a/config.guess	Fri Dec 02 22:51:58 2005 +0000
     1.2 +++ b/config.guess	Fri Dec 02 22:54:15 2005 +0000
     1.3 @@ -1,9 +1,9 @@
     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, 2000, 2001
     1.7 -#   Free Software Foundation, Inc.
     1.8 +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     1.9 +#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    1.10  
    1.11 -timestamp='2001-01-17'
    1.12 +timestamp='2003-02-22'
    1.13  
    1.14  # This file is free software; you can redistribute it and/or modify it
    1.15  # under the terms of the GNU General Public License as published by
    1.16 @@ -24,8 +24,9 @@
    1.17  # configuration script generated by Autoconf, you may include it under
    1.18  # the same distribution terms that you use for the rest of that program.
    1.19  
    1.20 -# Written by Per Bothner <bothner@cygnus.com>.
    1.21 -# Please send patches to <config-patches@gnu.org>.
    1.22 +# Originally written by Per Bothner <per@bothner.com>.
    1.23 +# Please send patches to <config-patches@gnu.org>.  Submit a context
    1.24 +# diff and a properly formatted ChangeLog entry.
    1.25  #
    1.26  # This script attempts to guess a canonical system name similar to
    1.27  # config.sub.  If it succeeds, it prints the system name on stdout, and
    1.28 @@ -33,10 +34,6 @@
    1.29  #
    1.30  # The plan is that this can be called by configure scripts if you
    1.31  # don't specify an explicit build system type.
    1.32 -#
    1.33 -# Only a few systems have been added to this list; please add others
    1.34 -# (but try to keep the structure clean).
    1.35 -#
    1.36  
    1.37  me=`echo "$0" | sed -e 's,.*/,,'`
    1.38  
    1.39 @@ -56,7 +53,7 @@
    1.40  GNU config.guess ($timestamp)
    1.41  
    1.42  Originally written by Per Bothner.
    1.43 -Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
    1.44 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
    1.45  Free Software Foundation, Inc.
    1.46  
    1.47  This is free software; see the source for copying conditions.  There is NO
    1.48 @@ -91,33 +88,44 @@
    1.49    exit 1
    1.50  fi
    1.51  
    1.52 +trap 'exit 1' 1 2 15
    1.53  
    1.54 -dummy=dummy-$$
    1.55 -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
    1.56 +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
    1.57 +# compiler to aid in system detection is discouraged as it requires
    1.58 +# temporary files to be created and, as you can see below, it is a
    1.59 +# headache to deal with in a portable fashion.
    1.60  
    1.61 -# CC_FOR_BUILD -- compiler used by this script.
    1.62  # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
    1.63  # use `HOST_CC' if defined, but it is deprecated.
    1.64  
    1.65 +# Portable tmp directory creation inspired by the Autoconf team.
    1.66 +
    1.67 +set_cc_for_build='
    1.68 +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
    1.69 +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
    1.70 +: ${TMPDIR=/tmp} ;
    1.71 + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
    1.72 + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
    1.73 + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
    1.74 +dummy=$tmp/dummy ;
    1.75 +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
    1.76  case $CC_FOR_BUILD,$HOST_CC,$CC in
    1.77 - ,,)    echo "int dummy(){}" > $dummy.c
    1.78 -	for c in cc gcc c89 ; do
    1.79 -	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
    1.80 -	  if test $? = 0 ; then
    1.81 -	     CC_FOR_BUILD="$c"; break
    1.82 -	  fi
    1.83 -	done
    1.84 -	rm -f $dummy.c $dummy.o $dummy.rel
    1.85 + ,,)    echo "int x;" > $dummy.c ;
    1.86 +	for c in cc gcc c89 c99 ; do
    1.87 +	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
    1.88 +	     CC_FOR_BUILD="$c"; break ;
    1.89 +	  fi ;
    1.90 +	done ;
    1.91  	if test x"$CC_FOR_BUILD" = x ; then
    1.92 -	  CC_FOR_BUILD=no_compiler_found
    1.93 +	  CC_FOR_BUILD=no_compiler_found ;
    1.94  	fi
    1.95  	;;
    1.96   ,,*)   CC_FOR_BUILD=$CC ;;
    1.97   ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
    1.98 -esac
    1.99 +esac ;'
   1.100  
   1.101  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
   1.102 -# (ghazi@noc.rutgers.edu 8/24/94.)
   1.103 +# (ghazi@noc.rutgers.edu 1994-08-24)
   1.104  if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
   1.105  	PATH=$PATH:/.attbin ; export PATH
   1.106  fi
   1.107 @@ -131,29 +139,31 @@
   1.108  
   1.109  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
   1.110      *:NetBSD:*:*)
   1.111 -	# Netbsd (nbsd) targets should (where applicable) match one or
   1.112 +	# NetBSD (nbsd) targets should (where applicable) match one or
   1.113  	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
   1.114  	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
   1.115  	# switched to ELF, *-*-netbsd* would select the old
   1.116  	# object file format.  This provides both forward
   1.117  	# compatibility and a consistent mechanism for selecting the
   1.118  	# object file format.
   1.119 -	# Determine the machine/vendor (is the vendor relevant).
   1.120 -	case "${UNAME_MACHINE}" in
   1.121 -	    amiga) machine=m68k-unknown ;;
   1.122 -	    arm32) machine=arm-unknown ;;
   1.123 -	    atari*) machine=m68k-atari ;;
   1.124 -	    sun3*) machine=m68k-sun ;;
   1.125 -	    mac68k) machine=m68k-apple ;;
   1.126 -	    macppc) machine=powerpc-apple ;;
   1.127 -	    hp3[0-9][05]) machine=m68k-hp ;;
   1.128 -	    ibmrt|romp-ibm) machine=romp-ibm ;;
   1.129 -	    *) machine=${UNAME_MACHINE}-unknown ;;
   1.130 +	#
   1.131 +	# Note: NetBSD doesn't particularly care about the vendor
   1.132 +	# portion of the name.  We always set it to "unknown".
   1.133 +	sysctl="sysctl -n hw.machine_arch"
   1.134 +	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
   1.135 +	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
   1.136 +	case "${UNAME_MACHINE_ARCH}" in
   1.137 +	    armeb) machine=armeb-unknown ;;
   1.138 +	    arm*) machine=arm-unknown ;;
   1.139 +	    sh3el) machine=shl-unknown ;;
   1.140 +	    sh3eb) machine=sh-unknown ;;
   1.141 +	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
   1.142  	esac
   1.143  	# The Operating System including object format, if it has switched
   1.144  	# to ELF recently, or will in the future.
   1.145 -	case "${UNAME_MACHINE}" in
   1.146 -	    i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
   1.147 +	case "${UNAME_MACHINE_ARCH}" in
   1.148 +	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
   1.149 +		eval $set_cc_for_build
   1.150  		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
   1.151  			| grep __ELF__ >/dev/null
   1.152  		then
   1.153 @@ -169,69 +179,107 @@
   1.154  		;;
   1.155  	esac
   1.156  	# The OS release
   1.157 -	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.158 +	# Debian GNU/NetBSD machines have a different userland, and
   1.159 +	# thus, need a distinct triplet. However, they do not need
   1.160 +	# kernel version information, so it can be replaced with a
   1.161 +	# suitable tag, in the style of linux-gnu.
   1.162 +	case "${UNAME_VERSION}" in
   1.163 +	    Debian*)
   1.164 +		release='-gnu'
   1.165 +		;;
   1.166 +	    *)
   1.167 +		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.168 +		;;
   1.169 +	esac
   1.170  	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
   1.171  	# contains redundant information, the shorter form:
   1.172  	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
   1.173  	echo "${machine}-${os}${release}"
   1.174  	exit 0 ;;
   1.175 +    amiga:OpenBSD:*:*)
   1.176 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.177 +	exit 0 ;;
   1.178 +    arc:OpenBSD:*:*)
   1.179 +	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.180 +	exit 0 ;;
   1.181 +    hp300:OpenBSD:*:*)
   1.182 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.183 +	exit 0 ;;
   1.184 +    mac68k:OpenBSD:*:*)
   1.185 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.186 +	exit 0 ;;
   1.187 +    macppc:OpenBSD:*:*)
   1.188 +	echo powerpc-unknown-openbsd${UNAME_RELEASE}
   1.189 +	exit 0 ;;
   1.190 +    mvme68k:OpenBSD:*:*)
   1.191 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.192 +	exit 0 ;;
   1.193 +    mvme88k:OpenBSD:*:*)
   1.194 +	echo m88k-unknown-openbsd${UNAME_RELEASE}
   1.195 +	exit 0 ;;
   1.196 +    mvmeppc:OpenBSD:*:*)
   1.197 +	echo powerpc-unknown-openbsd${UNAME_RELEASE}
   1.198 +	exit 0 ;;
   1.199 +    pmax:OpenBSD:*:*)
   1.200 +	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.201 +	exit 0 ;;
   1.202 +    sgi:OpenBSD:*:*)
   1.203 +	echo mipseb-unknown-openbsd${UNAME_RELEASE}
   1.204 +	exit 0 ;;
   1.205 +    sun3:OpenBSD:*:*)
   1.206 +	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.207 +	exit 0 ;;
   1.208 +    wgrisc:OpenBSD:*:*)
   1.209 +	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.210 +	exit 0 ;;
   1.211 +    *:OpenBSD:*:*)
   1.212 +	echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
   1.213 +	exit 0 ;;
   1.214      alpha:OSF1:*:*)
   1.215  	if test $UNAME_RELEASE = "V4.0"; then
   1.216  		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
   1.217  	fi
   1.218 +	# According to Compaq, /usr/sbin/psrinfo has been available on
   1.219 +	# OSF/1 and Tru64 systems produced since 1995.  I hope that
   1.220 +	# covers most systems running today.  This code pipes the CPU
   1.221 +	# types through head -n 1, so we only detect the type of CPU 0.
   1.222 +	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
   1.223 +	case "$ALPHA_CPU_TYPE" in
   1.224 +	    "EV4 (21064)")
   1.225 +		UNAME_MACHINE="alpha" ;;
   1.226 +	    "EV4.5 (21064)")
   1.227 +		UNAME_MACHINE="alpha" ;;
   1.228 +	    "LCA4 (21066/21068)")
   1.229 +		UNAME_MACHINE="alpha" ;;
   1.230 +	    "EV5 (21164)")
   1.231 +		UNAME_MACHINE="alphaev5" ;;
   1.232 +	    "EV5.6 (21164A)")
   1.233 +		UNAME_MACHINE="alphaev56" ;;
   1.234 +	    "EV5.6 (21164PC)")
   1.235 +		UNAME_MACHINE="alphapca56" ;;
   1.236 +	    "EV5.7 (21164PC)")
   1.237 +		UNAME_MACHINE="alphapca57" ;;
   1.238 +	    "EV6 (21264)")
   1.239 +		UNAME_MACHINE="alphaev6" ;;
   1.240 +	    "EV6.7 (21264A)")
   1.241 +		UNAME_MACHINE="alphaev67" ;;
   1.242 +	    "EV6.8CB (21264C)")
   1.243 +		UNAME_MACHINE="alphaev68" ;;
   1.244 +	    "EV6.8AL (21264B)")
   1.245 +		UNAME_MACHINE="alphaev68" ;;
   1.246 +	    "EV6.8CX (21264D)")
   1.247 +		UNAME_MACHINE="alphaev68" ;;
   1.248 +	    "EV6.9A (21264/EV69A)")
   1.249 +		UNAME_MACHINE="alphaev69" ;;
   1.250 +	    "EV7 (21364)")
   1.251 +		UNAME_MACHINE="alphaev7" ;;
   1.252 +	    "EV7.9 (21364A)")
   1.253 +		UNAME_MACHINE="alphaev79" ;;
   1.254 +	esac
   1.255  	# A Vn.n version is a released version.
   1.256  	# A Tn.n version is a released field test version.
   1.257  	# A Xn.n version is an unreleased experimental baselevel.
   1.258  	# 1.2 uses "1.2" for uname -r.
   1.259 -	cat <<EOF >$dummy.s
   1.260 -	.data
   1.261 -\$Lformat:
   1.262 -	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
   1.263 -
   1.264 -	.text
   1.265 -	.globl main
   1.266 -	.align 4
   1.267 -	.ent main
   1.268 -main:
   1.269 -	.frame \$30,16,\$26,0
   1.270 -	ldgp \$29,0(\$27)
   1.271 -	.prologue 1
   1.272 -	.long 0x47e03d80 # implver \$0
   1.273 -	lda \$2,-1
   1.274 -	.long 0x47e20c21 # amask \$2,\$1
   1.275 -	lda \$16,\$Lformat
   1.276 -	mov \$0,\$17
   1.277 -	not \$1,\$18
   1.278 -	jsr \$26,printf
   1.279 -	ldgp \$29,0(\$26)
   1.280 -	mov 0,\$16
   1.281 -	jsr \$26,exit
   1.282 -	.end main
   1.283 -EOF
   1.284 -	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
   1.285 -	if test "$?" = 0 ; then
   1.286 -		case `./$dummy` in
   1.287 -			0-0)
   1.288 -				UNAME_MACHINE="alpha"
   1.289 -				;;
   1.290 -			1-0)
   1.291 -				UNAME_MACHINE="alphaev5"
   1.292 -				;;
   1.293 -			1-1)
   1.294 -				UNAME_MACHINE="alphaev56"
   1.295 -				;;
   1.296 -			1-101)
   1.297 -				UNAME_MACHINE="alphapca56"
   1.298 -				;;
   1.299 -			2-303)
   1.300 -				UNAME_MACHINE="alphaev6"
   1.301 -				;;
   1.302 -			2-307)
   1.303 -				UNAME_MACHINE="alphaev67"
   1.304 -				;;
   1.305 -		esac
   1.306 -	fi
   1.307 -	rm -f $dummy.s $dummy
   1.308  	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.309  	exit 0 ;;
   1.310      Alpha\ *:Windows_NT*:*)
   1.311 @@ -246,29 +294,11 @@
   1.312      Amiga*:UNIX_System_V:4.0:*)
   1.313  	echo m68k-unknown-sysv4
   1.314  	exit 0;;
   1.315 -    amiga:OpenBSD:*:*)
   1.316 -	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.317 -	exit 0 ;;
   1.318      *:[Aa]miga[Oo][Ss]:*:*)
   1.319  	echo ${UNAME_MACHINE}-unknown-amigaos
   1.320  	exit 0 ;;
   1.321 -    arc64:OpenBSD:*:*)
   1.322 -	echo mips64el-unknown-openbsd${UNAME_RELEASE}
   1.323 -	exit 0 ;;
   1.324 -    arc:OpenBSD:*:*)
   1.325 -	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.326 -	exit 0 ;;
   1.327 -    hkmips:OpenBSD:*:*)
   1.328 -	echo mips-unknown-openbsd${UNAME_RELEASE}
   1.329 -	exit 0 ;;
   1.330 -    pmax:OpenBSD:*:*)
   1.331 -	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.332 -	exit 0 ;;
   1.333 -    sgi:OpenBSD:*:*)
   1.334 -	echo mips-unknown-openbsd${UNAME_RELEASE}
   1.335 -	exit 0 ;;
   1.336 -    wgrisc:OpenBSD:*:*)
   1.337 -	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.338 +    *:[Mm]orph[Oo][Ss]:*:*)
   1.339 +	echo ${UNAME_MACHINE}-unknown-morphos
   1.340  	exit 0 ;;
   1.341      *:OS/390:*:*)
   1.342  	echo i370-ibm-openedition
   1.343 @@ -290,6 +320,10 @@
   1.344      NILE*:*:*:dcosx)
   1.345  	echo pyramid-pyramid-svr4
   1.346  	exit 0 ;;
   1.347 +    DRS?6000:UNIX_SV:4.2*:7*)
   1.348 +	case `/usr/bin/uname -p` in
   1.349 +	    sparc) echo sparc-icl-nx7 && exit 0 ;;
   1.350 +	esac ;;
   1.351      sun4H:SunOS:5.*:*)
   1.352  	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   1.353  	exit 0 ;;
   1.354 @@ -318,7 +352,7 @@
   1.355  	echo m68k-sun-sunos${UNAME_RELEASE}
   1.356  	exit 0 ;;
   1.357      sun*:*:4.2BSD:*)
   1.358 -	UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
   1.359 +	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
   1.360  	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
   1.361  	case "`/bin/arch`" in
   1.362  	    sun3)
   1.363 @@ -332,9 +366,6 @@
   1.364      aushp:SunOS:*:*)
   1.365  	echo sparc-auspex-sunos${UNAME_RELEASE}
   1.366  	exit 0 ;;
   1.367 -    atari*:OpenBSD:*:*)
   1.368 -	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.369 -	exit 0 ;;
   1.370      # The situation for MiNT is a little confusing.  The machine name
   1.371      # can be virtually everything (everything which is not
   1.372      # "atarist" or "atariste" at least should have a processor
   1.373 @@ -361,18 +392,6 @@
   1.374      *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
   1.375          echo m68k-unknown-mint${UNAME_RELEASE}
   1.376          exit 0 ;;
   1.377 -    sun3*:OpenBSD:*:*)
   1.378 -	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.379 -	exit 0 ;;
   1.380 -    mac68k:OpenBSD:*:*)
   1.381 -	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.382 -	exit 0 ;;
   1.383 -    mvme68k:OpenBSD:*:*)
   1.384 -	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.385 -	exit 0 ;;
   1.386 -    mvme88k:OpenBSD:*:*)
   1.387 -	echo m88k-unknown-openbsd${UNAME_RELEASE}
   1.388 -	exit 0 ;;
   1.389      powerpc:machten:*:*)
   1.390  	echo powerpc-apple-machten${UNAME_RELEASE}
   1.391  	exit 0 ;;
   1.392 @@ -389,6 +408,7 @@
   1.393  	echo clipper-intergraph-clix${UNAME_RELEASE}
   1.394  	exit 0 ;;
   1.395      mips:*:*:UMIPS | mips:*:*:RISCos)
   1.396 +	eval $set_cc_for_build
   1.397  	sed 's/^	//' << EOF >$dummy.c
   1.398  #ifdef __cplusplus
   1.399  #include <stdio.h>  /* for printf() prototype */
   1.400 @@ -410,12 +430,20 @@
   1.401  	  exit (-1);
   1.402  	}
   1.403  EOF
   1.404 -	$CC_FOR_BUILD $dummy.c -o $dummy \
   1.405 -	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
   1.406 -	  && rm $dummy.c $dummy && exit 0
   1.407 -	rm -f $dummy.c $dummy
   1.408 +	$CC_FOR_BUILD -o $dummy $dummy.c \
   1.409 +	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
   1.410 +	  && exit 0
   1.411  	echo mips-mips-riscos${UNAME_RELEASE}
   1.412  	exit 0 ;;
   1.413 +    Motorola:PowerMAX_OS:*:*)
   1.414 +	echo powerpc-motorola-powermax
   1.415 +	exit 0 ;;
   1.416 +    Motorola:*:4.3:PL8-*)
   1.417 +	echo powerpc-harris-powermax
   1.418 +	exit 0 ;;
   1.419 +    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
   1.420 +	echo powerpc-harris-powermax
   1.421 +	exit 0 ;;
   1.422      Night_Hawk:Power_UNIX:*:*)
   1.423  	echo powerpc-harris-powerunix
   1.424  	exit 0 ;;
   1.425 @@ -463,11 +491,20 @@
   1.426      ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
   1.427  	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
   1.428  	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
   1.429 -    i?86:AIX:*:*)
   1.430 +    i*86:AIX:*:*)
   1.431  	echo i386-ibm-aix
   1.432  	exit 0 ;;
   1.433 +    ia64:AIX:*:*)
   1.434 +	if [ -x /usr/bin/oslevel ] ; then
   1.435 +		IBM_REV=`/usr/bin/oslevel`
   1.436 +	else
   1.437 +		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
   1.438 +	fi
   1.439 +	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
   1.440 +	exit 0 ;;
   1.441      *:AIX:2:3)
   1.442  	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
   1.443 +		eval $set_cc_for_build
   1.444  		sed 's/^		//' << EOF >$dummy.c
   1.445  		#include <sys/systemcfg.h>
   1.446  
   1.447 @@ -479,8 +516,7 @@
   1.448  			exit(0);
   1.449  			}
   1.450  EOF
   1.451 -		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
   1.452 -		rm -f $dummy.c $dummy
   1.453 +		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
   1.454  		echo rs6000-ibm-aix3.2.5
   1.455  	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
   1.456  		echo rs6000-ibm-aix3.2.4
   1.457 @@ -488,9 +524,9 @@
   1.458  		echo rs6000-ibm-aix3.2
   1.459  	fi
   1.460  	exit 0 ;;
   1.461 -    *:AIX:*:4)
   1.462 -	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
   1.463 -	if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
   1.464 +    *:AIX:*:[45])
   1.465 +	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
   1.466 +	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
   1.467  		IBM_ARCH=rs6000
   1.468  	else
   1.469  		IBM_ARCH=powerpc
   1.470 @@ -498,23 +534,10 @@
   1.471  	if [ -x /usr/bin/oslevel ] ; then
   1.472  		IBM_REV=`/usr/bin/oslevel`
   1.473  	else
   1.474 -		IBM_REV=4.${UNAME_RELEASE}
   1.475 +		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
   1.476  	fi
   1.477  	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
   1.478  	exit 0 ;;
   1.479 -    *:AIX:*:5)
   1.480 -	case "`lsattr -El proc0 -a type -F value`" in
   1.481 -	    PowerPC*) IBM_ARCH=powerpc
   1.482 -		      IBM_MANUF=ibm ;;
   1.483 -	    Itanium)  IBM_ARCH=ia64
   1.484 -		      IBM_MANUF=unknown ;;
   1.485 -	    POWER*)   IBM_ARCH=power
   1.486 -		      IBM_MANUF=ibm ;;
   1.487 -	    *)        IBM_ARCH=powerpc
   1.488 -		      IBM_MANUF=ibm ;;
   1.489 -	esac
   1.490 -	echo ${IBM_ARCH}-${IBM_MANUF}-aix${UNAME_VERSION}.${UNAME_RELEASE}
   1.491 -	exit 0 ;;
   1.492      *:AIX:*:*)
   1.493  	echo rs6000-ibm-aix
   1.494  	exit 0 ;;
   1.495 @@ -542,10 +565,8 @@
   1.496  	    9000/31? )            HP_ARCH=m68000 ;;
   1.497  	    9000/[34]?? )         HP_ARCH=m68k ;;
   1.498  	    9000/[678][0-9][0-9])
   1.499 -              case "${HPUX_REV}" in
   1.500 -                11.[0-9][0-9])
   1.501 -                  if [ -x /usr/bin/getconf ]; then
   1.502 -                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
   1.503 +		if [ -x /usr/bin/getconf ]; then
   1.504 +		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
   1.505                      sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
   1.506                      case "${sc_cpu_version}" in
   1.507                        523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
   1.508 @@ -554,12 +575,13 @@
   1.509                          case "${sc_kernel_bits}" in
   1.510                            32) HP_ARCH="hppa2.0n" ;;
   1.511                            64) HP_ARCH="hppa2.0w" ;;
   1.512 +			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
   1.513                          esac ;;
   1.514                      esac
   1.515 -                  fi ;;
   1.516 -              esac
   1.517 -              if [ "${HP_ARCH}" = "" ]; then
   1.518 -              sed 's/^              //' << EOF >$dummy.c
   1.519 +		fi
   1.520 +		if [ "${HP_ARCH}" = "" ]; then
   1.521 +		    eval $set_cc_for_build
   1.522 +		    sed 's/^              //' << EOF >$dummy.c
   1.523  
   1.524                #define _HPUX_SOURCE
   1.525                #include <stdlib.h>
   1.526 @@ -592,11 +614,21 @@
   1.527                    exit (0);
   1.528                }
   1.529  EOF
   1.530 -	(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
   1.531 -	if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
   1.532 -	rm -f $dummy.c $dummy
   1.533 -	fi ;;
   1.534 +		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
   1.535 +		    test -z "$HP_ARCH" && HP_ARCH=hppa
   1.536 +		fi ;;
   1.537  	esac
   1.538 +	if [ ${HP_ARCH} = "hppa2.0w" ]
   1.539 +	then
   1.540 +	    # avoid double evaluation of $set_cc_for_build
   1.541 +	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
   1.542 +	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
   1.543 +	    then
   1.544 +		HP_ARCH="hppa2.0w"
   1.545 +	    else
   1.546 +		HP_ARCH="hppa64"
   1.547 +	    fi
   1.548 +	fi
   1.549  	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
   1.550  	exit 0 ;;
   1.551      ia64:HP-UX:*:*)
   1.552 @@ -604,6 +636,7 @@
   1.553  	echo ia64-hp-hpux${HPUX_REV}
   1.554  	exit 0 ;;
   1.555      3050*:HI-UX:*:*)
   1.556 +	eval $set_cc_for_build
   1.557  	sed 's/^	//' << EOF >$dummy.c
   1.558  	#include <unistd.h>
   1.559  	int
   1.560 @@ -629,8 +662,7 @@
   1.561  	  exit (0);
   1.562  	}
   1.563  EOF
   1.564 -	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
   1.565 -	rm -f $dummy.c $dummy
   1.566 +	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
   1.567  	echo unknown-hitachi-hiuxwe2
   1.568  	exit 0 ;;
   1.569      9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
   1.570 @@ -639,7 +671,7 @@
   1.571      9000/8??:4.3bsd:*:*)
   1.572  	echo hppa1.0-hp-bsd
   1.573  	exit 0 ;;
   1.574 -    *9??*:MPE/iX:*:*)
   1.575 +    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
   1.576  	echo hppa1.0-hp-mpeix
   1.577  	exit 0 ;;
   1.578      hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
   1.579 @@ -648,7 +680,7 @@
   1.580      hp8??:OSF1:*:*)
   1.581  	echo hppa1.0-hp-osf
   1.582  	exit 0 ;;
   1.583 -    i?86:OSF1:*:*)
   1.584 +    i*86:OSF1:*:*)
   1.585  	if [ -x /usr/sbin/sysversion ] ; then
   1.586  	    echo ${UNAME_MACHINE}-unknown-osf1mk
   1.587  	else
   1.588 @@ -658,9 +690,6 @@
   1.589      parisc*:Lites*:*:*)
   1.590  	echo hppa1.1-hp-lites
   1.591  	exit 0 ;;
   1.592 -    hppa*:OpenBSD:*:*)
   1.593 -	echo hppa-unknown-openbsd
   1.594 -	exit 0 ;;
   1.595      C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
   1.596  	echo c1-convex-bsd
   1.597          exit 0 ;;
   1.598 @@ -679,42 +708,34 @@
   1.599      C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
   1.600  	echo c4-convex-bsd
   1.601          exit 0 ;;
   1.602 -    CRAY*X-MP:*:*:*)
   1.603 -	echo xmp-cray-unicos
   1.604 -        exit 0 ;;
   1.605      CRAY*Y-MP:*:*:*)
   1.606 -	echo ymp-cray-unicos${UNAME_RELEASE}
   1.607 +	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.608  	exit 0 ;;
   1.609      CRAY*[A-Z]90:*:*:*)
   1.610  	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
   1.611  	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
   1.612 -	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
   1.613 +	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
   1.614 +	      -e 's/\.[^.]*$/.X/'
   1.615  	exit 0 ;;
   1.616      CRAY*TS:*:*:*)
   1.617  	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.618  	exit 0 ;;
   1.619 -    CRAY*T3D:*:*:*)
   1.620 -	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.621 -	exit 0 ;;
   1.622      CRAY*T3E:*:*:*)
   1.623  	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.624  	exit 0 ;;
   1.625      CRAY*SV1:*:*:*)
   1.626  	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.627  	exit 0 ;;
   1.628 -    CRAY-2:*:*:*)
   1.629 -	echo cray2-cray-unicos
   1.630 -        exit 0 ;;
   1.631 +    *:UNICOS/mp:*:*)
   1.632 +	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
   1.633 +	exit 0 ;;
   1.634      F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
   1.635  	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.636          FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
   1.637          FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
   1.638          echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   1.639          exit 0 ;;
   1.640 -    hp300:OpenBSD:*:*)
   1.641 -	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.642 -	exit 0 ;;
   1.643 -    i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
   1.644 +    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
   1.645  	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
   1.646  	exit 0 ;;
   1.647      sparc*:BSD/OS:*:*)
   1.648 @@ -724,10 +745,18 @@
   1.649  	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
   1.650  	exit 0 ;;
   1.651      *:FreeBSD:*:*)
   1.652 -	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
   1.653 -	exit 0 ;;
   1.654 -    *:OpenBSD:*:*)
   1.655 -	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.656 +	# Determine whether the default compiler uses glibc.
   1.657 +	eval $set_cc_for_build
   1.658 +	sed 's/^	//' << EOF >$dummy.c
   1.659 +	#include <features.h>
   1.660 +	#if __GLIBC__ >= 2
   1.661 +	LIBC=gnu
   1.662 +	#else
   1.663 +	LIBC=
   1.664 +	#endif
   1.665 +EOF
   1.666 +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
   1.667 +	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
   1.668  	exit 0 ;;
   1.669      i*:CYGWIN*:*)
   1.670  	echo ${UNAME_MACHINE}-pc-cygwin
   1.671 @@ -738,11 +767,17 @@
   1.672      i*:PW*:*)
   1.673  	echo ${UNAME_MACHINE}-pc-pw32
   1.674  	exit 0 ;;
   1.675 +    x86:Interix*:3*)
   1.676 +	echo i586-pc-interix3
   1.677 +	exit 0 ;;
   1.678 +    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
   1.679 +	echo i${UNAME_MACHINE}-pc-mks
   1.680 +	exit 0 ;;
   1.681      i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
   1.682  	# How do we know it's Interix rather than the generic POSIX subsystem?
   1.683  	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
   1.684  	# UNAME_MACHINE based on the output of uname instead of i386?
   1.685 -	echo i386-pc-interix
   1.686 +	echo i586-pc-interix
   1.687  	exit 0 ;;
   1.688      i*:UWIN*:*)
   1.689  	echo ${UNAME_MACHINE}-pc-uwin
   1.690 @@ -759,242 +794,156 @@
   1.691      i*86:Minix:*:*)
   1.692  	echo ${UNAME_MACHINE}-pc-minix
   1.693  	exit 0 ;;
   1.694 -    *:Linux:*:*)
   1.695 -
   1.696 +    arm*:Linux:*:*)
   1.697 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.698 +	exit 0 ;;
   1.699 +    ia64:Linux:*:*)
   1.700 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.701 +	exit 0 ;;
   1.702 +    m68*:Linux:*:*)
   1.703 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.704 +	exit 0 ;;
   1.705 +    mips:Linux:*:*)
   1.706 +	eval $set_cc_for_build
   1.707 +	sed 's/^	//' << EOF >$dummy.c
   1.708 +	#undef CPU
   1.709 +	#undef mips
   1.710 +	#undef mipsel
   1.711 +	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   1.712 +	CPU=mipsel
   1.713 +	#else
   1.714 +	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   1.715 +	CPU=mips
   1.716 +	#else
   1.717 +	CPU=
   1.718 +	#endif
   1.719 +	#endif
   1.720 +EOF
   1.721 +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
   1.722 +	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
   1.723 +	;;
   1.724 +    mips64:Linux:*:*)
   1.725 +	eval $set_cc_for_build
   1.726 +	sed 's/^	//' << EOF >$dummy.c
   1.727 +	#undef CPU
   1.728 +	#undef mips64
   1.729 +	#undef mips64el
   1.730 +	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   1.731 +	CPU=mips64el
   1.732 +	#else
   1.733 +	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   1.734 +	CPU=mips64
   1.735 +	#else
   1.736 +	CPU=
   1.737 +	#endif
   1.738 +	#endif
   1.739 +EOF
   1.740 +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
   1.741 +	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
   1.742 +	;;
   1.743 +    ppc:Linux:*:*)
   1.744 +	echo powerpc-unknown-linux-gnu
   1.745 +	exit 0 ;;
   1.746 +    ppc64:Linux:*:*)
   1.747 +	echo powerpc64-unknown-linux-gnu
   1.748 +	exit 0 ;;
   1.749 +    alpha:Linux:*:*)
   1.750 +	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
   1.751 +	  EV5)   UNAME_MACHINE=alphaev5 ;;
   1.752 +	  EV56)  UNAME_MACHINE=alphaev56 ;;
   1.753 +	  PCA56) UNAME_MACHINE=alphapca56 ;;
   1.754 +	  PCA57) UNAME_MACHINE=alphapca56 ;;
   1.755 +	  EV6)   UNAME_MACHINE=alphaev6 ;;
   1.756 +	  EV67)  UNAME_MACHINE=alphaev67 ;;
   1.757 +	  EV68*) UNAME_MACHINE=alphaev68 ;;
   1.758 +        esac
   1.759 +	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
   1.760 +	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
   1.761 +	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
   1.762 +	exit 0 ;;
   1.763 +    parisc:Linux:*:* | hppa:Linux:*:*)
   1.764 +	# Look for CPU level
   1.765 +	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   1.766 +	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
   1.767 +	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
   1.768 +	  *)    echo hppa-unknown-linux-gnu ;;
   1.769 +	esac
   1.770 +	exit 0 ;;
   1.771 +    parisc64:Linux:*:* | hppa64:Linux:*:*)
   1.772 +	echo hppa64-unknown-linux-gnu
   1.773 +	exit 0 ;;
   1.774 +    s390:Linux:*:* | s390x:Linux:*:*)
   1.775 +	echo ${UNAME_MACHINE}-ibm-linux
   1.776 +	exit 0 ;;
   1.777 +    sh*:Linux:*:*)
   1.778 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.779 +	exit 0 ;;
   1.780 +    sparc:Linux:*:* | sparc64:Linux:*:*)
   1.781 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.782 +	exit 0 ;;
   1.783 +    x86_64:Linux:*:*)
   1.784 +	echo x86_64-unknown-linux-gnu
   1.785 +	exit 0 ;;
   1.786 +    i*86:Linux:*:*)
   1.787  	# The BFD linker knows what the default object file format is, so
   1.788  	# first see if it will tell us. cd to the root directory to prevent
   1.789  	# problems with other programs or directories called `ld' in the path.
   1.790 -	ld_supported_emulations=`cd /; ld --help 2>&1 \
   1.791 -			 | sed -ne '/supported emulations:/!d
   1.792 +	# Set LC_ALL=C to ensure ld outputs messages in English.
   1.793 +	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
   1.794 +			 | sed -ne '/supported targets:/!d
   1.795  				    s/[ 	][ 	]*/ /g
   1.796 -				    s/.*supported emulations: *//
   1.797 +				    s/.*supported targets: *//
   1.798  				    s/ .*//
   1.799  				    p'`
   1.800 -        case "$ld_supported_emulations" in
   1.801 -	  *ia64)
   1.802 -		echo "${UNAME_MACHINE}-unknown-linux"
   1.803 -		exit 0
   1.804 -		;;
   1.805 -	  i?86linux)
   1.806 -		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
   1.807 -		exit 0
   1.808 -		;;
   1.809 -	  elf_i?86)
   1.810 +        case "$ld_supported_targets" in
   1.811 +	  elf32-i386)
   1.812  		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
   1.813  		;;
   1.814 -	  i?86coff)
   1.815 +	  a.out-i386-linux)
   1.816 +		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
   1.817 +		exit 0 ;;
   1.818 +	  coff-i386)
   1.819  		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
   1.820 -		exit 0
   1.821 -		;;
   1.822 -	  sparclinux)
   1.823 -		echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
   1.824 -		exit 0
   1.825 -		;;
   1.826 -	  elf32_sparc)
   1.827 -		echo "${UNAME_MACHINE}-unknown-linux-gnu"
   1.828 -		exit 0
   1.829 -		;;
   1.830 -	  armlinux)
   1.831 -		echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
   1.832 -		exit 0
   1.833 -		;;
   1.834 -	  elf32arm*)
   1.835 -		echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
   1.836 -		exit 0
   1.837 -		;;
   1.838 -	  armelf_linux*)
   1.839 -		echo "${UNAME_MACHINE}-unknown-linux-gnu"
   1.840 -		exit 0
   1.841 -		;;
   1.842 -	  m68klinux)
   1.843 -		echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
   1.844 -		exit 0
   1.845 -		;;
   1.846 -	  elf32ppc | elf32ppclinux)
   1.847 -		# Determine Lib Version
   1.848 -		cat >$dummy.c <<EOF
   1.849 -#include <features.h>
   1.850 -#if defined(__GLIBC__)
   1.851 -extern char __libc_version[];
   1.852 -extern char __libc_release[];
   1.853 -#endif
   1.854 -main(argc, argv)
   1.855 -     int argc;
   1.856 -     char *argv[];
   1.857 -{
   1.858 -#if defined(__GLIBC__)
   1.859 -  printf("%s %s\n", __libc_version, __libc_release);
   1.860 -#else
   1.861 -  printf("unkown\n");
   1.862 -#endif
   1.863 -  return 0;
   1.864 -}
   1.865 +		exit 0 ;;
   1.866 +	  "")
   1.867 +		# Either a pre-BFD a.out linker (linux-gnuoldld) or
   1.868 +		# one that does not give us useful --help.
   1.869 +		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
   1.870 +		exit 0 ;;
   1.871 +	esac
   1.872 +	# Determine whether the default compiler is a.out or elf
   1.873 +	eval $set_cc_for_build
   1.874 +	sed 's/^	//' << EOF >$dummy.c
   1.875 +	#include <features.h>
   1.876 +	#ifdef __ELF__
   1.877 +	# ifdef __GLIBC__
   1.878 +	#  if __GLIBC__ >= 2
   1.879 +	LIBC=gnu
   1.880 +	#  else
   1.881 +	LIBC=gnulibc1
   1.882 +	#  endif
   1.883 +	# else
   1.884 +	LIBC=gnulibc1
   1.885 +	# endif
   1.886 +	#else
   1.887 +	#ifdef __INTEL_COMPILER
   1.888 +	LIBC=gnu
   1.889 +	#else
   1.890 +	LIBC=gnuaout
   1.891 +	#endif
   1.892 +	#endif
   1.893  EOF
   1.894 -		LIBC=""
   1.895 -		$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
   1.896 -		if test "$?" = 0 ; then
   1.897 -			./$dummy | grep 1\.99 > /dev/null
   1.898 -			if test "$?" = 0 ; then
   1.899 -				LIBC="libc1"
   1.900 -			fi
   1.901 -		fi
   1.902 -		rm -f $dummy.c $dummy
   1.903 -		echo powerpc-unknown-linux-gnu${LIBC}
   1.904 -		exit 0
   1.905 -		;;
   1.906 -	  shelf_linux)
   1.907 -		echo "${UNAME_MACHINE}-unknown-linux-gnu"
   1.908 -		exit 0
   1.909 -		;;
   1.910 -	esac
   1.911 -
   1.912 -	if test "${UNAME_MACHINE}" = "alpha" ; then
   1.913 -		cat <<EOF >$dummy.s
   1.914 -			.data
   1.915 -		\$Lformat:
   1.916 -			.byte 37,100,45,37,120,10,0	# "%d-%x\n"
   1.917 -
   1.918 -			.text
   1.919 -			.globl main
   1.920 -			.align 4
   1.921 -			.ent main
   1.922 -		main:
   1.923 -			.frame \$30,16,\$26,0
   1.924 -			ldgp \$29,0(\$27)
   1.925 -			.prologue 1
   1.926 -			.long 0x47e03d80 # implver \$0
   1.927 -			lda \$2,-1
   1.928 -			.long 0x47e20c21 # amask \$2,\$1
   1.929 -			lda \$16,\$Lformat
   1.930 -			mov \$0,\$17
   1.931 -			not \$1,\$18
   1.932 -			jsr \$26,printf
   1.933 -			ldgp \$29,0(\$26)
   1.934 -			mov 0,\$16
   1.935 -			jsr \$26,exit
   1.936 -			.end main
   1.937 -EOF
   1.938 -		LIBC=""
   1.939 -		$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
   1.940 -		if test "$?" = 0 ; then
   1.941 -			case `./$dummy` in
   1.942 -			0-0)
   1.943 -				UNAME_MACHINE="alpha"
   1.944 -				;;
   1.945 -			1-0)
   1.946 -				UNAME_MACHINE="alphaev5"
   1.947 -				;;
   1.948 -			1-1)
   1.949 -				UNAME_MACHINE="alphaev56"
   1.950 -				;;
   1.951 -			1-101)
   1.952 -				UNAME_MACHINE="alphapca56"
   1.953 -				;;
   1.954 -			2-303)
   1.955 -				UNAME_MACHINE="alphaev6"
   1.956 -				;;
   1.957 -			2-307)
   1.958 -				UNAME_MACHINE="alphaev67"
   1.959 -				;;
   1.960 -			esac
   1.961 -
   1.962 -			objdump --private-headers $dummy | \
   1.963 -			  grep ld.so.1 > /dev/null
   1.964 -			if test "$?" = 0 ; then
   1.965 -				LIBC="libc1"
   1.966 -			fi
   1.967 -		fi
   1.968 -		rm -f $dummy.s $dummy
   1.969 -		echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
   1.970 -	elif test "${UNAME_MACHINE}" = "mips" ; then
   1.971 -	  cat >$dummy.c <<EOF
   1.972 -#ifdef __cplusplus
   1.973 -#include <stdio.h>  /* for printf() prototype */
   1.974 -	int main (int argc, char *argv[]) {
   1.975 -#else
   1.976 -	int main (argc, argv) int argc; char *argv[]; {
   1.977 -#endif
   1.978 -#ifdef __MIPSEB__
   1.979 -  printf ("%s-unknown-linux-gnu\n", argv[1]);
   1.980 -#endif
   1.981 -#ifdef __MIPSEL__
   1.982 -  printf ("%sel-unknown-linux-gnu\n", argv[1]);
   1.983 -#endif
   1.984 -  return 0;
   1.985 -}
   1.986 -EOF
   1.987 -	  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
   1.988 -	  rm -f $dummy.c $dummy
   1.989 -	elif test "${UNAME_MACHINE}" = "s390"; then
   1.990 -	  echo s390-ibm-linux && exit 0
   1.991 -	elif test "${UNAME_MACHINE}" = "x86_64"; then
   1.992 -	  echo x86_64-unknown-linux-gnu && exit 0
   1.993 -	elif test "${UNAME_MACHINE}" = "parisc" -o "${UNAME_MACHINE}" = "hppa"; then
   1.994 -	  # Look for CPU level
   1.995 -	  case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   1.996 -	    PA7*)
   1.997 -		echo hppa1.1-unknown-linux-gnu
   1.998 -		;;
   1.999 -	    PA8*)
  1.1000 -		echo hppa2.0-unknown-linux-gnu
  1.1001 -		;;
  1.1002 -	    *)
  1.1003 -		echo hppa-unknown-linux-gnu
  1.1004 -		;;
  1.1005 -	  esac
  1.1006 -	  exit 0
  1.1007 -	else
  1.1008 -	  # Either a pre-BFD a.out linker (linux-gnuoldld)
  1.1009 -	  # or one that does not give us useful --help.
  1.1010 -	  # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
  1.1011 -	  # If ld does not provide *any* "supported emulations:"
  1.1012 -	  # that means it is gnuoldld.
  1.1013 -	  test -z "$ld_supported_emulations" \
  1.1014 -	    && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
  1.1015 -
  1.1016 -	  case "${UNAME_MACHINE}" in
  1.1017 -	  i?86)
  1.1018 -	    VENDOR=pc;
  1.1019 -	    ;;
  1.1020 -	  *)
  1.1021 -	    VENDOR=unknown;
  1.1022 -	    ;;
  1.1023 -	  esac
  1.1024 -	  # Determine whether the default compiler is a.out or elf
  1.1025 -	  cat >$dummy.c <<EOF
  1.1026 -#include <features.h>
  1.1027 -#ifdef __cplusplus
  1.1028 -#include <stdio.h>  /* for printf() prototype */
  1.1029 -	int main (int argc, char *argv[]) {
  1.1030 -#else
  1.1031 -	int main (argc, argv) int argc; char *argv[]; {
  1.1032 -#endif
  1.1033 -#ifdef __ELF__
  1.1034 -# ifdef __GLIBC__
  1.1035 -#  if __GLIBC__ >= 2
  1.1036 -    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
  1.1037 -#  else
  1.1038 -    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
  1.1039 -#  endif
  1.1040 -# else
  1.1041 -   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
  1.1042 -# endif
  1.1043 -#else
  1.1044 -  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
  1.1045 -#endif
  1.1046 -  return 0;
  1.1047 -}
  1.1048 -EOF
  1.1049 -	  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
  1.1050 -	  rm -f $dummy.c $dummy
  1.1051 -	  test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
  1.1052 -	fi ;;
  1.1053 -# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
  1.1054 -# are messed up and put the nodename in both sysname and nodename.
  1.1055 -    i?86:DYNIX/ptx:4*:*)
  1.1056 +	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
  1.1057 +	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
  1.1058 +	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
  1.1059 +	;;
  1.1060 +    i*86:DYNIX/ptx:4*:*)
  1.1061 +	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  1.1062 +	# earlier versions are messed up and put the nodename in both
  1.1063 +	# sysname and nodename.
  1.1064  	echo i386-sequent-sysv4
  1.1065  	exit 0 ;;
  1.1066 -    i?86:UNIX_SV:4.2MP:2.*)
  1.1067 +    i*86:UNIX_SV:4.2MP:2.*)
  1.1068          # Unixware is an offshoot of SVR4, but it has its own version
  1.1069          # number series starting with 2...
  1.1070          # I am not positive that other SVR4 systems won't match this,
  1.1071 @@ -1002,7 +951,24 @@
  1.1072          # Use sysv4.2uw... so that sysv4* matches it.
  1.1073  	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
  1.1074  	exit 0 ;;
  1.1075 -    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
  1.1076 +    i*86:OS/2:*:*)
  1.1077 +	# If we were able to find `uname', then EMX Unix compatibility
  1.1078 +	# is probably installed.
  1.1079 +	echo ${UNAME_MACHINE}-pc-os2-emx
  1.1080 +	exit 0 ;;
  1.1081 +    i*86:XTS-300:*:STOP)
  1.1082 +	echo ${UNAME_MACHINE}-unknown-stop
  1.1083 +	exit 0 ;;
  1.1084 +    i*86:atheos:*:*)
  1.1085 +	echo ${UNAME_MACHINE}-unknown-atheos
  1.1086 +	exit 0 ;;
  1.1087 +    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
  1.1088 +	echo i386-unknown-lynxos${UNAME_RELEASE}
  1.1089 +	exit 0 ;;
  1.1090 +    i*86:*DOS:*:*)
  1.1091 +	echo ${UNAME_MACHINE}-pc-msdosdjgpp
  1.1092 +	exit 0 ;;
  1.1093 +    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
  1.1094  	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
  1.1095  	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  1.1096  		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
  1.1097 @@ -1010,36 +976,32 @@
  1.1098  		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
  1.1099  	fi
  1.1100  	exit 0 ;;
  1.1101 -    i?86:*:5:7*)
  1.1102 -        # Fixed at (any) Pentium or better
  1.1103 -        UNAME_MACHINE=i586
  1.1104 -        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
  1.1105 -	    echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
  1.1106 -	else
  1.1107 -	    echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
  1.1108 -	fi
  1.1109 +    i*86:*:5:[78]*)
  1.1110 +	case `/bin/uname -X | grep "^Machine"` in
  1.1111 +	    *486*)	     UNAME_MACHINE=i486 ;;
  1.1112 +	    *Pentium)	     UNAME_MACHINE=i586 ;;
  1.1113 +	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  1.1114 +	esac
  1.1115 +	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
  1.1116  	exit 0 ;;
  1.1117 -    i?86:*:3.2:*)
  1.1118 +    i*86:*:3.2:*)
  1.1119  	if test -f /usr/options/cb.name; then
  1.1120  		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  1.1121  		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
  1.1122  	elif /bin/uname -X 2>/dev/null >/dev/null ; then
  1.1123 -		UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
  1.1124 -		(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
  1.1125 -		(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
  1.1126 +		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
  1.1127 +		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
  1.1128 +		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
  1.1129  			&& UNAME_MACHINE=i586
  1.1130 -		(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
  1.1131 +		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
  1.1132  			&& UNAME_MACHINE=i686
  1.1133 -		(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
  1.1134 +		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
  1.1135  			&& UNAME_MACHINE=i686
  1.1136  		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
  1.1137  	else
  1.1138  		echo ${UNAME_MACHINE}-pc-sysv32
  1.1139  	fi
  1.1140  	exit 0 ;;
  1.1141 -    i?86:*DOS:*:*)
  1.1142 -	echo ${UNAME_MACHINE}-pc-msdosdjgpp
  1.1143 -	exit 0 ;;
  1.1144      pc:*:*:*)
  1.1145  	# Left here for compatibility:
  1.1146          # uname -m prints for DJGPP always 'pc', but it prints nothing about
  1.1147 @@ -1063,9 +1025,15 @@
  1.1148  	# "miniframe"
  1.1149  	echo m68010-convergent-sysv
  1.1150  	exit 0 ;;
  1.1151 +    mc68k:UNIX:SYSTEM5:3.51m)
  1.1152 +	echo m68k-convergent-sysv
  1.1153 +	exit 0 ;;
  1.1154 +    M680?0:D-NIX:5.3:*)
  1.1155 +	echo m68k-diab-dnix
  1.1156 +	exit 0 ;;
  1.1157      M68*:*:R3V[567]*:*)
  1.1158  	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  1.1159 -    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
  1.1160 +    3[34]??:*: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)
  1.1161  	OS_REL=''
  1.1162  	test -r /etc/.relid \
  1.1163  	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1.1164 @@ -1076,22 +1044,19 @@
  1.1165      3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1.1166          /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1.1167            && echo i486-ncr-sysv4 && exit 0 ;;
  1.1168 -    m68*:LynxOS:2.*:*)
  1.1169 +    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
  1.1170  	echo m68k-unknown-lynxos${UNAME_RELEASE}
  1.1171  	exit 0 ;;
  1.1172      mc68030:UNIX_System_V:4.*:*)
  1.1173  	echo m68k-atari-sysv4
  1.1174  	exit 0 ;;
  1.1175 -    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
  1.1176 -	echo i386-unknown-lynxos${UNAME_RELEASE}
  1.1177 -	exit 0 ;;
  1.1178      TSUNAMI:LynxOS:2.*:*)
  1.1179  	echo sparc-unknown-lynxos${UNAME_RELEASE}
  1.1180  	exit 0 ;;
  1.1181      rs6000:LynxOS:2.*:*)
  1.1182  	echo rs6000-unknown-lynxos${UNAME_RELEASE}
  1.1183  	exit 0 ;;
  1.1184 -    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:*)
  1.1185 +    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
  1.1186  	echo powerpc-unknown-lynxos${UNAME_RELEASE}
  1.1187  	exit 0 ;;
  1.1188      SM[BE]S:UNIX_SV:*:*)
  1.1189 @@ -1111,8 +1076,8 @@
  1.1190  		echo ns32k-sni-sysv
  1.1191  	fi
  1.1192  	exit 0 ;;
  1.1193 -    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  1.1194 -                           # says <Richard.M.Bartel@ccMail.Census.GOV>
  1.1195 +    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  1.1196 +                      # says <Richard.M.Bartel@ccMail.Census.GOV>
  1.1197          echo i586-unisys-sysv4
  1.1198          exit 0 ;;
  1.1199      *:UNIX_System_V:4*:FTX*)
  1.1200 @@ -1124,6 +1089,10 @@
  1.1201  	# From seanf@swdc.stratus.com.
  1.1202  	echo i860-stratus-sysv4
  1.1203  	exit 0 ;;
  1.1204 +    *:VOS:*:*)
  1.1205 +	# From Paul.Green@stratus.com.
  1.1206 +	echo hppa1.1-stratus-vos
  1.1207 +	exit 0 ;;
  1.1208      mc68*:A/UX:*:*)
  1.1209  	echo m68k-apple-aux${UNAME_RELEASE}
  1.1210  	exit 0 ;;
  1.1211 @@ -1152,6 +1121,9 @@
  1.1212      SX-5:SUPER-UX:*:*)
  1.1213  	echo sx5-nec-superux${UNAME_RELEASE}
  1.1214  	exit 0 ;;
  1.1215 +    SX-6:SUPER-UX:*:*)
  1.1216 +	echo sx6-nec-superux${UNAME_RELEASE}
  1.1217 +	exit 0 ;;
  1.1218      Power*:Rhapsody:*:*)
  1.1219  	echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1.1220  	exit 0 ;;
  1.1221 @@ -1159,18 +1131,24 @@
  1.1222  	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1.1223  	exit 0 ;;
  1.1224      *:Darwin:*:*)
  1.1225 -	echo `uname -p`-apple-darwin${UNAME_RELEASE}
  1.1226 +	case `uname -p` in
  1.1227 +	    *86) UNAME_PROCESSOR=i686 ;;
  1.1228 +	    powerpc) UNAME_PROCESSOR=powerpc ;;
  1.1229 +	esac
  1.1230 +	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
  1.1231  	exit 0 ;;
  1.1232      *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1.1233 -	if test "${UNAME_MACHINE}" = "x86pc"; then
  1.1234 +	UNAME_PROCESSOR=`uname -p`
  1.1235 +	if test "$UNAME_PROCESSOR" = "x86"; then
  1.1236 +		UNAME_PROCESSOR=i386
  1.1237  		UNAME_MACHINE=pc
  1.1238  	fi
  1.1239 -	echo `uname -p`-${UNAME_MACHINE}-nto-qnx
  1.1240 +	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
  1.1241  	exit 0 ;;
  1.1242      *:QNX:*:4*)
  1.1243  	echo i386-pc-qnx
  1.1244  	exit 0 ;;
  1.1245 -    NSR-[KW]:NONSTOP_KERNEL:*:*)
  1.1246 +    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
  1.1247  	echo nsr-tandem-nsk${UNAME_RELEASE}
  1.1248  	exit 0 ;;
  1.1249      *:NonStop-UX:*:*)
  1.1250 @@ -1193,11 +1171,6 @@
  1.1251  	fi
  1.1252  	echo ${UNAME_MACHINE}-unknown-plan9
  1.1253  	exit 0 ;;
  1.1254 -    i?86:OS/2:*:*)
  1.1255 -	# If we were able to find `uname', then EMX Unix compatibility
  1.1256 -	# is probably installed.
  1.1257 -	echo ${UNAME_MACHINE}-pc-os2-emx
  1.1258 -	exit 0 ;;
  1.1259      *:TOPS-10:*:*)
  1.1260  	echo pdp10-unknown-tops10
  1.1261  	exit 0 ;;
  1.1262 @@ -1221,6 +1194,7 @@
  1.1263  #echo '(No uname command or uname output not recognized.)' 1>&2
  1.1264  #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  1.1265  
  1.1266 +eval $set_cc_for_build
  1.1267  cat >$dummy.c <<EOF
  1.1268  #ifdef _SEQUENT_
  1.1269  # include <sys/types.h>
  1.1270 @@ -1307,11 +1281,24 @@
  1.1271  #endif
  1.1272  
  1.1273  #if defined (vax)
  1.1274 -#if !defined (ultrix)
  1.1275 -  printf ("vax-dec-bsd\n"); exit (0);
  1.1276 -#else
  1.1277 -  printf ("vax-dec-ultrix\n"); exit (0);
  1.1278 -#endif
  1.1279 +# if !defined (ultrix)
  1.1280 +#  include <sys/param.h>
  1.1281 +#  if defined (BSD)
  1.1282 +#   if BSD == 43
  1.1283 +      printf ("vax-dec-bsd4.3\n"); exit (0);
  1.1284 +#   else
  1.1285 +#    if BSD == 199006
  1.1286 +      printf ("vax-dec-bsd4.3reno\n"); exit (0);
  1.1287 +#    else
  1.1288 +      printf ("vax-dec-bsd\n"); exit (0);
  1.1289 +#    endif
  1.1290 +#   endif
  1.1291 +#  else
  1.1292 +    printf ("vax-dec-bsd\n"); exit (0);
  1.1293 +#  endif
  1.1294 +# else
  1.1295 +    printf ("vax-dec-ultrix\n"); exit (0);
  1.1296 +# endif
  1.1297  #endif
  1.1298  
  1.1299  #if defined (alliant) && defined (i860)
  1.1300 @@ -1322,8 +1309,7 @@
  1.1301  }
  1.1302  EOF
  1.1303  
  1.1304 -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
  1.1305 -rm -f $dummy.c $dummy
  1.1306 +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
  1.1307  
  1.1308  # Apollos put the system type in the environment.
  1.1309