config.guess
changeset 53 25dfe480c75e
parent 28 6e53ad1f461e
child 729 dac996d69abb
     1.1 --- a/config.guess	Sun Jun 10 05:02:38 2001 +0000
     1.2 +++ b/config.guess	Sun Jun 10 18:20:23 2001 +0000
     1.3 @@ -1,8 +1,10 @@
     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 +#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
     1.8  #   Free Software Foundation, Inc.
     1.9 -#
    1.10 +
    1.11 +timestamp='2001-03-16'
    1.12 +
    1.13  # This file is free software; you can redistribute it and/or modify it
    1.14  # under the terms of the GNU General Public License as published by
    1.15  # the Free Software Foundation; either version 2 of the License, or
    1.16 @@ -23,34 +25,93 @@
    1.17  # the same distribution terms that you use for the rest of that program.
    1.18  
    1.19  # Written by Per Bothner <bothner@cygnus.com>.
    1.20 -# The master version of this file is at the FSF in /home/gd/gnu/lib.
    1.21 -# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
    1.22 +# Please send patches to <config-patches@gnu.org>.
    1.23  #
    1.24  # This script attempts to guess a canonical system name similar to
    1.25  # config.sub.  If it succeeds, it prints the system name on stdout, and
    1.26  # exits with 0.  Otherwise, it exits with 1.
    1.27  #
    1.28  # The plan is that this can be called by configure scripts if you
    1.29 -# don't specify an explicit system type (host/target name).
    1.30 -#
    1.31 -# Only a few systems have been added to this list; please add others
    1.32 -# (but try to keep the structure clean).
    1.33 -#
    1.34 +# don't specify an explicit build system type.
    1.35  
    1.36 -# Use $HOST_CC if defined. $CC may point to a cross-compiler
    1.37 -if test x"$CC_FOR_BUILD" = x; then
    1.38 -  if test x"$HOST_CC" != x; then
    1.39 -    CC_FOR_BUILD="$HOST_CC"
    1.40 -  else
    1.41 -    if test x"$CC" != x; then
    1.42 -      CC_FOR_BUILD="$CC"
    1.43 -    else
    1.44 -      CC_FOR_BUILD=cc
    1.45 -    fi
    1.46 -  fi
    1.47 +me=`echo "$0" | sed -e 's,.*/,,'`
    1.48 +
    1.49 +usage="\
    1.50 +Usage: $0 [OPTION]
    1.51 +
    1.52 +Output the configuration name of the system \`$me' is run on.
    1.53 +
    1.54 +Operation modes:
    1.55 +  -h, --help         print this help, then exit
    1.56 +  -t, --time-stamp   print date of last modification, then exit
    1.57 +  -v, --version      print version number, then exit
    1.58 +
    1.59 +Report bugs and patches to <config-patches@gnu.org>."
    1.60 +
    1.61 +version="\
    1.62 +GNU config.guess ($timestamp)
    1.63 +
    1.64 +Originally written by Per Bothner.
    1.65 +Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
    1.66 +Free Software Foundation, Inc.
    1.67 +
    1.68 +This is free software; see the source for copying conditions.  There is NO
    1.69 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    1.70 +
    1.71 +help="
    1.72 +Try \`$me --help' for more information."
    1.73 +
    1.74 +# Parse command line
    1.75 +while test $# -gt 0 ; do
    1.76 +  case $1 in
    1.77 +    --time-stamp | --time* | -t )
    1.78 +       echo "$timestamp" ; exit 0 ;;
    1.79 +    --version | -v )
    1.80 +       echo "$version" ; exit 0 ;;
    1.81 +    --help | --h* | -h )
    1.82 +       echo "$usage"; exit 0 ;;
    1.83 +    -- )     # Stop option processing
    1.84 +       shift; break ;;
    1.85 +    - )	# Use stdin as input.
    1.86 +       break ;;
    1.87 +    -* )
    1.88 +       echo "$me: invalid option $1$help" >&2
    1.89 +       exit 1 ;;
    1.90 +    * )
    1.91 +       break ;;
    1.92 +  esac
    1.93 +done
    1.94 +
    1.95 +if test $# != 0; then
    1.96 +  echo "$me: too many arguments$help" >&2
    1.97 +  exit 1
    1.98  fi
    1.99  
   1.100  
   1.101 +dummy=dummy-$$
   1.102 +trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
   1.103 +
   1.104 +# CC_FOR_BUILD -- compiler used by this script.
   1.105 +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
   1.106 +# use `HOST_CC' if defined, but it is deprecated.
   1.107 +
   1.108 +case $CC_FOR_BUILD,$HOST_CC,$CC in
   1.109 + ,,)    echo "int dummy(){}" > $dummy.c
   1.110 +	for c in cc gcc c89 ; do
   1.111 +	  ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
   1.112 +	  if test $? = 0 ; then
   1.113 +	     CC_FOR_BUILD="$c"; break
   1.114 +	  fi
   1.115 +	done
   1.116 +	rm -f $dummy.c $dummy.o $dummy.rel
   1.117 +	if test x"$CC_FOR_BUILD" = x ; then
   1.118 +	  CC_FOR_BUILD=no_compiler_found
   1.119 +	fi
   1.120 +	;;
   1.121 + ,,*)   CC_FOR_BUILD=$CC ;;
   1.122 + ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
   1.123 +esac
   1.124 +
   1.125  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
   1.126  # (ghazi@noc.rutgers.edu 8/24/94.)
   1.127  if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
   1.128 @@ -59,15 +120,57 @@
   1.129  
   1.130  UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
   1.131  UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
   1.132 -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
   1.133 +UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
   1.134  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
   1.135  
   1.136 -dummy=dummy-$$
   1.137 -trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
   1.138 -
   1.139  # Note: order is significant - the case branches are not exclusive.
   1.140  
   1.141  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
   1.142 +    *:NetBSD:*:*)
   1.143 +	# Netbsd (nbsd) targets should (where applicable) match one or
   1.144 +	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
   1.145 +	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
   1.146 +	# switched to ELF, *-*-netbsd* would select the old
   1.147 +	# object file format.  This provides both forward
   1.148 +	# compatibility and a consistent mechanism for selecting the
   1.149 +	# object file format.
   1.150 +	# Determine the machine/vendor (is the vendor relevant).
   1.151 +	case "${UNAME_MACHINE}" in
   1.152 +	    amiga) machine=m68k-unknown ;;
   1.153 +	    arm32) machine=arm-unknown ;;
   1.154 +	    atari*) machine=m68k-atari ;;
   1.155 +	    sun3*) machine=m68k-sun ;;
   1.156 +	    mac68k) machine=m68k-apple ;;
   1.157 +	    macppc) machine=powerpc-apple ;;
   1.158 +	    hp3[0-9][05]) machine=m68k-hp ;;
   1.159 +	    ibmrt|romp-ibm) machine=romp-ibm ;;
   1.160 +	    *) machine=${UNAME_MACHINE}-unknown ;;
   1.161 +	esac
   1.162 +	# The Operating System including object format, if it has switched
   1.163 +	# to ELF recently, or will in the future.
   1.164 +	case "${UNAME_MACHINE}" in
   1.165 +	    i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
   1.166 +		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
   1.167 +			| grep __ELF__ >/dev/null
   1.168 +		then
   1.169 +		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
   1.170 +		    # Return netbsd for either.  FIX?
   1.171 +		    os=netbsd
   1.172 +		else
   1.173 +		    os=netbsdelf
   1.174 +		fi
   1.175 +		;;
   1.176 +	    *)
   1.177 +	        os=netbsd
   1.178 +		;;
   1.179 +	esac
   1.180 +	# The OS release
   1.181 +	release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.182 +	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
   1.183 +	# contains redundant information, the shorter form:
   1.184 +	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
   1.185 +	echo "${machine}-${os}${release}"
   1.186 +	exit 0 ;;
   1.187      alpha:OSF1:*:*)
   1.188  	if test $UNAME_RELEASE = "V4.0"; then
   1.189  		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
   1.190 @@ -77,41 +180,51 @@
   1.191  	# A Xn.n version is an unreleased experimental baselevel.
   1.192  	# 1.2 uses "1.2" for uname -r.
   1.193  	cat <<EOF >$dummy.s
   1.194 +	.data
   1.195 +\$Lformat:
   1.196 +	.byte 37,100,45,37,120,10,0	# "%d-%x\n"
   1.197 +
   1.198 +	.text
   1.199  	.globl main
   1.200 +	.align 4
   1.201  	.ent main
   1.202  main:
   1.203 -	.frame \$30,0,\$26,0
   1.204 -	.prologue 0
   1.205 -	.long 0x47e03d80 # implver $0
   1.206 -	lda \$2,259
   1.207 -	.long 0x47e20c21 # amask $2,$1
   1.208 -	srl \$1,8,\$2
   1.209 -	sll \$2,2,\$2
   1.210 -	sll \$0,3,\$0
   1.211 -	addl \$1,\$0,\$0
   1.212 -	addl \$2,\$0,\$0
   1.213 -	ret \$31,(\$26),1
   1.214 +	.frame \$30,16,\$26,0
   1.215 +	ldgp \$29,0(\$27)
   1.216 +	.prologue 1
   1.217 +	.long 0x47e03d80 # implver \$0
   1.218 +	lda \$2,-1
   1.219 +	.long 0x47e20c21 # amask \$2,\$1
   1.220 +	lda \$16,\$Lformat
   1.221 +	mov \$0,\$17
   1.222 +	not \$1,\$18
   1.223 +	jsr \$26,printf
   1.224 +	ldgp \$29,0(\$26)
   1.225 +	mov 0,\$16
   1.226 +	jsr \$26,exit
   1.227  	.end main
   1.228  EOF
   1.229  	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
   1.230  	if test "$?" = 0 ; then
   1.231 -		./$dummy
   1.232 -		case "$?" in
   1.233 -			7)
   1.234 +		case `./$dummy` in
   1.235 +			0-0)
   1.236  				UNAME_MACHINE="alpha"
   1.237  				;;
   1.238 -			15)
   1.239 +			1-0)
   1.240  				UNAME_MACHINE="alphaev5"
   1.241  				;;
   1.242 -			14)
   1.243 +			1-1)
   1.244  				UNAME_MACHINE="alphaev56"
   1.245  				;;
   1.246 -			10)
   1.247 +			1-101)
   1.248  				UNAME_MACHINE="alphapca56"
   1.249  				;;
   1.250 -			16)
   1.251 +			2-303)
   1.252  				UNAME_MACHINE="alphaev6"
   1.253  				;;
   1.254 +			2-307)
   1.255 +				UNAME_MACHINE="alphaev67"
   1.256 +				;;
   1.257  		esac
   1.258  	fi
   1.259  	rm -f $dummy.s $dummy
   1.260 @@ -127,11 +240,8 @@
   1.261  	echo alpha-dec-winnt3.5
   1.262  	exit 0 ;;
   1.263      Amiga*:UNIX_System_V:4.0:*)
   1.264 -	echo m68k-cbm-sysv4
   1.265 +	echo m68k-unknown-sysv4
   1.266  	exit 0;;
   1.267 -    amiga:NetBSD:*:*)
   1.268 -      echo m68k-cbm-netbsd${UNAME_RELEASE}
   1.269 -      exit 0 ;;
   1.270      amiga:OpenBSD:*:*)
   1.271  	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.272  	exit 0 ;;
   1.273 @@ -156,13 +266,13 @@
   1.274      wgrisc:OpenBSD:*:*)
   1.275  	echo mipsel-unknown-openbsd${UNAME_RELEASE}
   1.276  	exit 0 ;;
   1.277 +    *:OS/390:*:*)
   1.278 +	echo i370-ibm-openedition
   1.279 +	exit 0 ;;
   1.280      arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
   1.281  	echo arm-acorn-riscix${UNAME_RELEASE}
   1.282  	exit 0;;
   1.283 -    arm32:NetBSD:*:*)
   1.284 -	echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.285 -	exit 0 ;;
   1.286 -    SR2?01:HI-UX/MPP:*:*)
   1.287 +    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
   1.288  	echo hppa1.1-hitachi-hiuxmpp
   1.289  	exit 0;;
   1.290      Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
   1.291 @@ -218,15 +328,12 @@
   1.292      aushp:SunOS:*:*)
   1.293  	echo sparc-auspex-sunos${UNAME_RELEASE}
   1.294  	exit 0 ;;
   1.295 -    atari*:NetBSD:*:*)
   1.296 -	echo m68k-atari-netbsd${UNAME_RELEASE}
   1.297 -	exit 0 ;;
   1.298      atari*:OpenBSD:*:*)
   1.299  	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.300  	exit 0 ;;
   1.301      # The situation for MiNT is a little confusing.  The machine name
   1.302      # can be virtually everything (everything which is not
   1.303 -    # "atarist" or "atariste" at least should have a processor 
   1.304 +    # "atarist" or "atariste" at least should have a processor
   1.305      # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
   1.306      # to the lowercase version "mint" (or "freemint").  Finally
   1.307      # the system name "TOS" denotes a system which is actually not
   1.308 @@ -250,15 +357,9 @@
   1.309      *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
   1.310          echo m68k-unknown-mint${UNAME_RELEASE}
   1.311          exit 0 ;;
   1.312 -    sun3*:NetBSD:*:*)
   1.313 -	echo m68k-sun-netbsd${UNAME_RELEASE}
   1.314 -	exit 0 ;;
   1.315      sun3*:OpenBSD:*:*)
   1.316  	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.317  	exit 0 ;;
   1.318 -    mac68k:NetBSD:*:*)
   1.319 -	echo m68k-apple-netbsd${UNAME_RELEASE}
   1.320 -	exit 0 ;;
   1.321      mac68k:OpenBSD:*:*)
   1.322  	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.323  	exit 0 ;;
   1.324 @@ -271,9 +372,6 @@
   1.325      powerpc:machten:*:*)
   1.326  	echo powerpc-apple-machten${UNAME_RELEASE}
   1.327  	exit 0 ;;
   1.328 -    macppc:NetBSD:*:*)
   1.329 -        echo powerpc-apple-netbsd${UNAME_RELEASE}
   1.330 -        exit 0 ;;
   1.331      RISC*:Mach:*:*)
   1.332  	echo mips-dec-mach_bsd4.3
   1.333  	exit 0 ;;
   1.334 @@ -289,6 +387,7 @@
   1.335      mips:*:*:UMIPS | mips:*:*:RISCos)
   1.336  	sed 's/^	//' << EOF >$dummy.c
   1.337  #ifdef __cplusplus
   1.338 +#include <stdio.h>  /* for printf() prototype */
   1.339  	int main (int argc, char *argv[]) {
   1.340  #else
   1.341  	int main (argc, argv) int argc; char *argv[]; {
   1.342 @@ -309,7 +408,7 @@
   1.343  EOF
   1.344  	$CC_FOR_BUILD $dummy.c -o $dummy \
   1.345  	  && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
   1.346 -	  && rm $dummy.c $dummy && exit 0
   1.347 +	  && rm -f $dummy.c $dummy && exit 0
   1.348  	rm -f $dummy.c $dummy
   1.349  	echo mips-mips-riscos${UNAME_RELEASE}
   1.350  	exit 0 ;;
   1.351 @@ -328,15 +427,18 @@
   1.352      AViiON:dgux:*:*)
   1.353          # DG/UX returns AViiON for all architectures
   1.354          UNAME_PROCESSOR=`/usr/bin/uname -p`
   1.355 -        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
   1.356 -	if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
   1.357 -	     -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
   1.358 +	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
   1.359 +	then
   1.360 +	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
   1.361 +	       [ ${TARGET_BINARY_INTERFACE}x = x ]
   1.362 +	    then
   1.363  		echo m88k-dg-dgux${UNAME_RELEASE}
   1.364 +	    else
   1.365 +		echo m88k-dg-dguxbcs${UNAME_RELEASE}
   1.366 +	    fi
   1.367  	else
   1.368 -		echo m88k-dg-dguxbcs${UNAME_RELEASE}
   1.369 +	    echo i586-dg-dgux${UNAME_RELEASE}
   1.370  	fi
   1.371 -        else echo i586-dg-dgux${UNAME_RELEASE}
   1.372 -        fi
   1.373   	exit 0 ;;
   1.374      M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
   1.375  	echo m88k-dolphin-sysv3
   1.376 @@ -360,6 +462,14 @@
   1.377      i?86:AIX:*:*)
   1.378  	echo i386-ibm-aix
   1.379  	exit 0 ;;
   1.380 +    ia64:AIX:*:*)
   1.381 +	if [ -x /usr/bin/oslevel ] ; then
   1.382 +		IBM_REV=`/usr/bin/oslevel`
   1.383 +	else
   1.384 +		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
   1.385 +	fi
   1.386 +	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
   1.387 +	exit 0 ;;
   1.388      *:AIX:2:3)
   1.389  	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
   1.390  		sed 's/^		//' << EOF >$dummy.c
   1.391 @@ -373,7 +483,7 @@
   1.392  			exit(0);
   1.393  			}
   1.394  EOF
   1.395 -		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
   1.396 +		$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
   1.397  		rm -f $dummy.c $dummy
   1.398  		echo rs6000-ibm-aix3.2.5
   1.399  	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
   1.400 @@ -382,9 +492,9 @@
   1.401  		echo rs6000-ibm-aix3.2
   1.402  	fi
   1.403  	exit 0 ;;
   1.404 -    *:AIX:*:4)
   1.405 +    *:AIX:*:[45])
   1.406  	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
   1.407 -	if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
   1.408 +	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
   1.409  		IBM_ARCH=rs6000
   1.410  	else
   1.411  		IBM_ARCH=powerpc
   1.412 @@ -392,7 +502,7 @@
   1.413  	if [ -x /usr/bin/oslevel ] ; then
   1.414  		IBM_REV=`/usr/bin/oslevel`
   1.415  	else
   1.416 -		IBM_REV=4.${UNAME_RELEASE}
   1.417 +		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
   1.418  	fi
   1.419  	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
   1.420  	exit 0 ;;
   1.421 @@ -402,7 +512,7 @@
   1.422      ibmrt:4.4BSD:*|romp-ibm:BSD:*)
   1.423  	echo romp-ibm-bsd4.4
   1.424  	exit 0 ;;
   1.425 -    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
   1.426 +    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
   1.427  	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
   1.428  	exit 0 ;;                           # report: romp-ibm BSD 4.3
   1.429      *:BOSX:*:*)
   1.430 @@ -418,11 +528,31 @@
   1.431  	echo m68k-hp-bsd4.4
   1.432  	exit 0 ;;
   1.433      9000/[34678]??:HP-UX:*:*)
   1.434 +	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
   1.435  	case "${UNAME_MACHINE}" in
   1.436  	    9000/31? )            HP_ARCH=m68000 ;;
   1.437  	    9000/[34]?? )         HP_ARCH=m68k ;;
   1.438  	    9000/[678][0-9][0-9])
   1.439 +              case "${HPUX_REV}" in
   1.440 +                11.[0-9][0-9])
   1.441 +                  if [ -x /usr/bin/getconf ]; then
   1.442 +                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
   1.443 +                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
   1.444 +                    case "${sc_cpu_version}" in
   1.445 +                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
   1.446 +                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
   1.447 +                      532)                      # CPU_PA_RISC2_0
   1.448 +                        case "${sc_kernel_bits}" in
   1.449 +                          32) HP_ARCH="hppa2.0n" ;;
   1.450 +                          64) HP_ARCH="hppa2.0w" ;;
   1.451 +                        esac ;;
   1.452 +                    esac
   1.453 +                  fi ;;
   1.454 +              esac
   1.455 +              if [ "${HP_ARCH}" = "" ]; then
   1.456                sed 's/^              //' << EOF >$dummy.c
   1.457 +
   1.458 +              #define _HPUX_SOURCE
   1.459                #include <stdlib.h>
   1.460                #include <unistd.h>
   1.461  
   1.462 @@ -453,11 +583,16 @@
   1.463                    exit (0);
   1.464                }
   1.465  EOF
   1.466 -	($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
   1.467 +	(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
   1.468 +	if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
   1.469  	rm -f $dummy.c $dummy
   1.470 +	fi ;;
   1.471  	esac
   1.472 +	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
   1.473 +	exit 0 ;;
   1.474 +    ia64:HP-UX:*:*)
   1.475  	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
   1.476 -	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
   1.477 +	echo ia64-hp-hpux${HPUX_REV}
   1.478  	exit 0 ;;
   1.479      3050*:HI-UX:*:*)
   1.480  	sed 's/^	//' << EOF >$dummy.c
   1.481 @@ -485,7 +620,7 @@
   1.482  	  exit (0);
   1.483  	}
   1.484  EOF
   1.485 -	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
   1.486 +	$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
   1.487  	rm -f $dummy.c $dummy
   1.488  	echo unknown-hitachi-hiuxwe2
   1.489  	exit 0 ;;
   1.490 @@ -547,29 +682,30 @@
   1.491  	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
   1.492  	exit 0 ;;
   1.493      CRAY*TS:*:*:*)
   1.494 -	echo t90-cray-unicos${UNAME_RELEASE}
   1.495 +	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.496 +	exit 0 ;;
   1.497 +    CRAY*T3D:*:*:*)
   1.498 +	echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.499  	exit 0 ;;
   1.500      CRAY*T3E:*:*:*)
   1.501 -	echo t3e-cray-unicosmk${UNAME_RELEASE}
   1.502 +	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.503 +	exit 0 ;;
   1.504 +    CRAY*SV1:*:*:*)
   1.505 +	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   1.506  	exit 0 ;;
   1.507      CRAY-2:*:*:*)
   1.508  	echo cray2-cray-unicos
   1.509          exit 0 ;;
   1.510 -    F300:UNIX_System_V:*:*)
   1.511 +    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
   1.512 +	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.513          FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
   1.514          FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
   1.515 -        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   1.516 +        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   1.517          exit 0 ;;
   1.518 -    F301:UNIX_System_V:*:*)
   1.519 -       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
   1.520 -       exit 0 ;;
   1.521 -    hp3[0-9][05]:NetBSD:*:*)
   1.522 -	echo m68k-hp-netbsd${UNAME_RELEASE}
   1.523 -	exit 0 ;;
   1.524      hp300:OpenBSD:*:*)
   1.525  	echo m68k-unknown-openbsd${UNAME_RELEASE}
   1.526  	exit 0 ;;
   1.527 -    i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
   1.528 +    i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
   1.529  	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
   1.530  	exit 0 ;;
   1.531      sparc*:BSD/OS:*:*)
   1.532 @@ -579,17 +715,8 @@
   1.533  	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
   1.534  	exit 0 ;;
   1.535      *:FreeBSD:*:*)
   1.536 -	if test -x /usr/bin/objformat; then
   1.537 -	    if test "elf" = "`/usr/bin/objformat`"; then
   1.538 -		echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
   1.539 -		exit 0
   1.540 -	    fi
   1.541 -	fi
   1.542  	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
   1.543  	exit 0 ;;
   1.544 -    *:NetBSD:*:*)
   1.545 -	echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.546 -	exit 0 ;;
   1.547      *:OpenBSD:*:*)
   1.548  	echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   1.549  	exit 0 ;;
   1.550 @@ -599,6 +726,9 @@
   1.551      i*:MINGW*:*)
   1.552  	echo ${UNAME_MACHINE}-pc-mingw32
   1.553  	exit 0 ;;
   1.554 +    i*:PW*:*)
   1.555 +	echo ${UNAME_MACHINE}-pc-pw32
   1.556 +	exit 0 ;;
   1.557      i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
   1.558  	# How do we know it's Interix rather than the generic POSIX subsystem?
   1.559  	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
   1.560 @@ -617,34 +747,41 @@
   1.561      *:GNU:*:*)
   1.562  	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
   1.563  	exit 0 ;;
   1.564 -    *:Linux:*:*)
   1.565 -#	# uname on the ARM produces all sorts of strangeness, and we need to
   1.566 -#	# filter it out.
   1.567 -#	case "$UNAME_MACHINE" in
   1.568 -#	  armv*)		      UNAME_MACHINE=$UNAME_MACHINE ;;
   1.569 -#	  arm* | sa110*)	      UNAME_MACHINE="arm" ;;
   1.570 -#	esac
   1.571 -
   1.572 -	# The BFD linker knows what the default object file format is, so
   1.573 -	# first see if it will tell us. cd to the root directory to prevent
   1.574 -	# problems with other programs or directories called `ld' in the path.
   1.575 -	ld_help_string=`cd /; ld --help 2>&1`
   1.576 -	ld_supported_emulations=`echo $ld_help_string \
   1.577 -			 | sed -ne '/supported emulations:/!d
   1.578 -				    s/[ 	][ 	]*/ /g
   1.579 -				    s/.*supported emulations: *//
   1.580 -				    s/ .*//
   1.581 -				    p'`
   1.582 -        case "$ld_supported_emulations" in
   1.583 -	  i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
   1.584 -	  i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
   1.585 -	  sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
   1.586 -	  armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
   1.587 -	  m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
   1.588 -	  elf32arm)   echo "${UNAME_MACHINE}-unknown-linux-gnu"     ; exit 0 ;;
   1.589 -	  elf32ppc)
   1.590 -		# Determine Lib Version
   1.591 -		cat >$dummy.c <<EOF
   1.592 +    i*86:Minix:*:*)
   1.593 +	echo ${UNAME_MACHINE}-pc-minix
   1.594 +	exit 0 ;;
   1.595 +    arm*:Linux:*:*)
   1.596 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.597 +	exit 0 ;;
   1.598 +    ia64:Linux:*:*)
   1.599 +	echo ${UNAME_MACHINE}-unknown-linux
   1.600 +	exit 0 ;;
   1.601 +    m68*:Linux:*:*)
   1.602 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.603 +	exit 0 ;;
   1.604 +    mips:Linux:*:*)
   1.605 +	cat >$dummy.c <<EOF
   1.606 +#ifdef __cplusplus
   1.607 +#include <stdio.h>  /* for printf() prototype */
   1.608 +int main (int argc, char *argv[]) {
   1.609 +#else
   1.610 +int main (argc, argv) int argc; char *argv[]; {
   1.611 +#endif
   1.612 +#ifdef __MIPSEB__
   1.613 +  printf ("%s-unknown-linux-gnu\n", argv[1]);
   1.614 +#endif
   1.615 +#ifdef __MIPSEL__
   1.616 +  printf ("%sel-unknown-linux-gnu\n", argv[1]);
   1.617 +#endif
   1.618 +  return 0;
   1.619 +}
   1.620 +EOF
   1.621 +	$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
   1.622 +	rm -f $dummy.c $dummy
   1.623 +	;;
   1.624 +    ppc:Linux:*:*)
   1.625 +	# Determine Lib Version
   1.626 +	cat >$dummy.c <<EOF
   1.627  #include <features.h>
   1.628  #if defined(__GLIBC__)
   1.629  extern char __libc_version[];
   1.630 @@ -657,110 +794,130 @@
   1.631  #if defined(__GLIBC__)
   1.632    printf("%s %s\n", __libc_version, __libc_release);
   1.633  #else
   1.634 -  printf("unkown\n");
   1.635 +  printf("unknown\n");
   1.636  #endif
   1.637    return 0;
   1.638  }
   1.639  EOF
   1.640 -		LIBC=""
   1.641 -		$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
   1.642 -		if test "$?" = 0 ; then
   1.643 -			./$dummy | grep 1\.99 > /dev/null
   1.644 -			if test "$?" = 0 ; then
   1.645 -				LIBC="libc1"
   1.646 -			fi
   1.647 -		fi	
   1.648 -		rm -f $dummy.c $dummy
   1.649 -		echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
   1.650 -	esac
   1.651 -
   1.652 -	if test "${UNAME_MACHINE}" = "alpha" ; then
   1.653 -		sed 's/^	//'  <<EOF >$dummy.s
   1.654 +	LIBC=""
   1.655 +	$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
   1.656 +	if test "$?" = 0 ; then
   1.657 +		./$dummy | grep 1\.99 > /dev/null
   1.658 +		if test "$?" = 0 ; then LIBC="libc1" ; fi
   1.659 +	fi
   1.660 +	rm -f $dummy.c $dummy
   1.661 +	echo powerpc-unknown-linux-gnu${LIBC}
   1.662 +	exit 0 ;;
   1.663 +    alpha:Linux:*:*)
   1.664 +	cat <<EOF >$dummy.s
   1.665 +	  .data
   1.666 +	  \$Lformat:
   1.667 +		.byte 37,100,45,37,120,10,0	# "%d-%x\n"
   1.668 +	   .text
   1.669  		.globl main
   1.670 +		.align 4
   1.671  		.ent main
   1.672 -	main:
   1.673 -		.frame \$30,0,\$26,0
   1.674 -		.prologue 0
   1.675 -		.long 0x47e03d80 # implver $0
   1.676 -		lda \$2,259
   1.677 -		.long 0x47e20c21 # amask $2,$1
   1.678 -		srl \$1,8,\$2
   1.679 -		sll \$2,2,\$2
   1.680 -		sll \$0,3,\$0
   1.681 -		addl \$1,\$0,\$0
   1.682 -		addl \$2,\$0,\$0
   1.683 -		ret \$31,(\$26),1
   1.684 +	    main:
   1.685 +		.frame \$30,16,\$26,0
   1.686 +		ldgp \$29,0(\$27)
   1.687 +		.prologue 1
   1.688 +		.long 0x47e03d80 # implver \$0
   1.689 +		lda \$2,-1
   1.690 +		.long 0x47e20c21 # amask \$2,\$1
   1.691 +		lda \$16,\$Lformat
   1.692 +		mov \$0,\$17
   1.693 +		not \$1,\$18
   1.694 +		jsr \$26,printf
   1.695 +		ldgp \$29,0(\$26)
   1.696 +		mov 0,\$16
   1.697 +		jsr \$26,exit
   1.698  		.end main
   1.699  EOF
   1.700 -		LIBC=""
   1.701 -		$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
   1.702 +	LIBC=""
   1.703 +	$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
   1.704 +	if test "$?" = 0 ; then
   1.705 +		case `./$dummy` in
   1.706 +		0-0)	UNAME_MACHINE="alpha" ;;
   1.707 +		1-0)	UNAME_MACHINE="alphaev5" ;;
   1.708 +		1-1)    UNAME_MACHINE="alphaev56" ;;
   1.709 +		1-101)	UNAME_MACHINE="alphapca56" ;;
   1.710 +		2-303)	UNAME_MACHINE="alphaev6" ;;
   1.711 +		2-307)	UNAME_MACHINE="alphaev67" ;;
   1.712 +		esac
   1.713 +		objdump --private-headers $dummy | \
   1.714 +		  grep ld.so.1 > /dev/null
   1.715  		if test "$?" = 0 ; then
   1.716 -			./$dummy
   1.717 -			case "$?" in
   1.718 -			7)
   1.719 -				UNAME_MACHINE="alpha"
   1.720 -				;;
   1.721 -			15)
   1.722 -				UNAME_MACHINE="alphaev5"
   1.723 -				;;
   1.724 -			14)
   1.725 -				UNAME_MACHINE="alphaev56"
   1.726 -				;;
   1.727 -			10)
   1.728 -				UNAME_MACHINE="alphapca56"
   1.729 -				;;
   1.730 -			16)
   1.731 -				UNAME_MACHINE="alphaev6"
   1.732 -				;;
   1.733 -			esac
   1.734 -
   1.735 -			objdump --private-headers $dummy | \
   1.736 -			  grep ld.so.1 > /dev/null
   1.737 -			if test "$?" = 0 ; then
   1.738 -				LIBC="libc1"
   1.739 -			fi
   1.740 +			LIBC="libc1"
   1.741  		fi
   1.742 -		rm -f $dummy.s $dummy
   1.743 -		echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
   1.744 -	elif test "${UNAME_MACHINE}" = "mips" ; then
   1.745 -	  cat >$dummy.c <<EOF
   1.746 -#ifdef __cplusplus
   1.747 -	int main (int argc, char *argv[]) {
   1.748 -#else
   1.749 -	int main (argc, argv) int argc; char *argv[]; {
   1.750 -#endif
   1.751 -#ifdef __MIPSEB__
   1.752 -  printf ("%s-unknown-linux-gnu\n", argv[1]);
   1.753 -#endif
   1.754 -#ifdef __MIPSEL__
   1.755 -  printf ("%sel-unknown-linux-gnu\n", argv[1]);
   1.756 -#endif
   1.757 -  return 0;
   1.758 -}
   1.759 -EOF
   1.760 -	  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
   1.761 -	  rm -f $dummy.c $dummy
   1.762 -	else
   1.763 -	  # Either a pre-BFD a.out linker (linux-gnuoldld)
   1.764 -	  # or one that does not give us useful --help.
   1.765 -	  # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
   1.766 -	  # If ld does not provide *any* "supported emulations:"
   1.767 -	  # that means it is gnuoldld.
   1.768 -	  echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
   1.769 -	  test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
   1.770 -
   1.771 -	  case "${UNAME_MACHINE}" in
   1.772 -	  i?86)
   1.773 -	    VENDOR=pc;
   1.774 -	    ;;
   1.775 -	  *)
   1.776 -	    VENDOR=unknown;
   1.777 -	    ;;
   1.778 -	  esac
   1.779 -	  # Determine whether the default compiler is a.out or elf
   1.780 -	  cat >$dummy.c <<EOF
   1.781 +	fi
   1.782 +	rm -f $dummy.s $dummy
   1.783 +	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
   1.784 +	exit 0 ;;
   1.785 +    parisc:Linux:*:* | hppa:Linux:*:*)
   1.786 +	# Look for CPU level
   1.787 +	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   1.788 +	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
   1.789 +	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
   1.790 +	  *)    echo hppa-unknown-linux-gnu ;;
   1.791 +	esac
   1.792 +	exit 0 ;;
   1.793 +    parisc64:Linux:*:* | hppa64:Linux:*:*)
   1.794 +	echo hppa64-unknown-linux-gnu
   1.795 +	exit 0 ;;
   1.796 +    s390:Linux:*:* | s390x:Linux:*:*)
   1.797 +	echo ${UNAME_MACHINE}-ibm-linux
   1.798 +	exit 0 ;;
   1.799 +    sh*:Linux:*:*)
   1.800 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.801 +	exit 0 ;;
   1.802 +    sparc:Linux:*:* | sparc64:Linux:*:*)
   1.803 +	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.804 +	exit 0 ;;
   1.805 +    x86_64:Linux:*:*)
   1.806 +	echo x86_64-unknown-linux-gnu
   1.807 +	exit 0 ;;
   1.808 +    i?86:Linux:*:*)
   1.809 +	# The BFD linker knows what the default object file format is, so
   1.810 +	# first see if it will tell us. cd to the root directory to prevent
   1.811 +	# problems with other programs or directories called `ld' in the path.
   1.812 +	ld_supported_emulations=`cd /; ld --help 2>&1 \
   1.813 +			 | sed -ne '/supported emulations:/!d
   1.814 +				    s/[ 	][ 	]*/ /g
   1.815 +				    s/.*supported emulations: *//
   1.816 +				    s/ .*//
   1.817 +				    p'`
   1.818 +        case "$ld_supported_emulations" in
   1.819 +	  i?86linux)
   1.820 +		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
   1.821 +		exit 0
   1.822 +		;;
   1.823 +	  elf_i?86)
   1.824 +		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
   1.825 +		;;
   1.826 +	  i?86coff)
   1.827 +		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
   1.828 +		exit 0
   1.829 +		;;
   1.830 +	esac
   1.831 +	# Either a pre-BFD a.out linker (linux-gnuoldld)
   1.832 +	# or one that does not give us useful --help.
   1.833 +	# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
   1.834 +	# If ld does not provide *any* "supported emulations:"
   1.835 +	# that means it is gnuoldld.
   1.836 +	test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
   1.837 +	case "${UNAME_MACHINE}" in
   1.838 +	i?86)
   1.839 +	  VENDOR=pc;
   1.840 +	  ;;
   1.841 +	*)
   1.842 +	  VENDOR=unknown;
   1.843 +	  ;;
   1.844 +	esac
   1.845 +	# Determine whether the default compiler is a.out or elf
   1.846 +	cat >$dummy.c <<EOF
   1.847  #include <features.h>
   1.848  #ifdef __cplusplus
   1.849 +#include <stdio.h>  /* for printf() prototype */
   1.850  	int main (int argc, char *argv[]) {
   1.851  #else
   1.852  	int main (argc, argv) int argc; char *argv[]; {
   1.853 @@ -781,9 +938,10 @@
   1.854    return 0;
   1.855  }
   1.856  EOF
   1.857 -	  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
   1.858 -	  rm -f $dummy.c $dummy
   1.859 -	fi ;;
   1.860 +	$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
   1.861 +	rm -f $dummy.c $dummy
   1.862 +	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
   1.863 +	;;
   1.864  # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
   1.865  # are messed up and put the nodename in both sysname and nodename.
   1.866      i?86:DYNIX/ptx:4*:*)
   1.867 @@ -798,19 +956,21 @@
   1.868  	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
   1.869  	exit 0 ;;
   1.870      i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
   1.871 +	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
   1.872  	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
   1.873 -		echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
   1.874 +		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
   1.875  	else
   1.876 -		echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
   1.877 +		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
   1.878  	fi
   1.879  	exit 0 ;;
   1.880      i?86:*:5:7*)
   1.881 -	UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
   1.882 -	(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
   1.883 -	(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
   1.884 -	(/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
   1.885 -	(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
   1.886 -	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
   1.887 +        # Fixed at (any) Pentium or better
   1.888 +        UNAME_MACHINE=i586
   1.889 +        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
   1.890 +	    echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
   1.891 +	else
   1.892 +	    echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
   1.893 +	fi
   1.894  	exit 0 ;;
   1.895      i?86:*:3.2:*)
   1.896  	if test -f /usr/options/cb.name; then
   1.897 @@ -830,7 +990,11 @@
   1.898  		echo ${UNAME_MACHINE}-pc-sysv32
   1.899  	fi
   1.900  	exit 0 ;;
   1.901 +    i?86:*DOS:*:*)
   1.902 +	echo ${UNAME_MACHINE}-pc-msdosdjgpp
   1.903 +	exit 0 ;;
   1.904      pc:*:*:*)
   1.905 +	# Left here for compatibility:
   1.906          # uname -m prints for DJGPP always 'pc', but it prints nothing about
   1.907          # the processor, so we play safe by assuming i386.
   1.908  	echo i386-pc-msdosdjgpp
   1.909 @@ -854,7 +1018,7 @@
   1.910  	exit 0 ;;
   1.911      M68*:*:R3V[567]*:*)
   1.912  	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
   1.913 -    3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
   1.914 +    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.915  	OS_REL=''
   1.916  	test -r /etc/.relid \
   1.917  	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
   1.918 @@ -877,9 +1041,12 @@
   1.919      TSUNAMI:LynxOS:2.*:*)
   1.920  	echo sparc-unknown-lynxos${UNAME_RELEASE}
   1.921  	exit 0 ;;
   1.922 -    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
   1.923 +    rs6000:LynxOS:2.*:*)
   1.924  	echo rs6000-unknown-lynxos${UNAME_RELEASE}
   1.925  	exit 0 ;;
   1.926 +    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:*)
   1.927 +	echo powerpc-unknown-lynxos${UNAME_RELEASE}
   1.928 +	exit 0 ;;
   1.929      SM[BE]S:UNIX_SV:*:*)
   1.930  	echo mips-dde-sysv${UNAME_RELEASE}
   1.931  	exit 0 ;;
   1.932 @@ -913,7 +1080,7 @@
   1.933      mc68*:A/UX:*:*)
   1.934  	echo m68k-apple-aux${UNAME_RELEASE}
   1.935  	exit 0 ;;
   1.936 -    news*:NEWS-OS:*:6*)
   1.937 +    news*:NEWS-OS:6*:*)
   1.938  	echo mips-sony-newsos6
   1.939  	exit 0 ;;
   1.940      R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
   1.941 @@ -944,6 +1111,64 @@
   1.942      *:Rhapsody:*:*)
   1.943  	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
   1.944  	exit 0 ;;
   1.945 +    *:Darwin:*:*)
   1.946 +	echo `uname -p`-apple-darwin${UNAME_RELEASE}
   1.947 +	exit 0 ;;
   1.948 +    *:procnto*:*:* | *:QNX:[0123456789]*:*)
   1.949 +	if test "${UNAME_MACHINE}" = "x86pc"; then
   1.950 +		UNAME_MACHINE=pc
   1.951 +	fi
   1.952 +	echo `uname -p`-${UNAME_MACHINE}-nto-qnx
   1.953 +	exit 0 ;;
   1.954 +    *:QNX:*:4*)
   1.955 +	echo i386-pc-qnx
   1.956 +	exit 0 ;;
   1.957 +    NSR-[KW]:NONSTOP_KERNEL:*:*)
   1.958 +	echo nsr-tandem-nsk${UNAME_RELEASE}
   1.959 +	exit 0 ;;
   1.960 +    *:NonStop-UX:*:*)
   1.961 +	echo mips-compaq-nonstopux
   1.962 +	exit 0 ;;
   1.963 +    BS2000:POSIX*:*:*)
   1.964 +	echo bs2000-siemens-sysv
   1.965 +	exit 0 ;;
   1.966 +    DS/*:UNIX_System_V:*:*)
   1.967 +	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
   1.968 +	exit 0 ;;
   1.969 +    *:Plan9:*:*)
   1.970 +	# "uname -m" is not consistent, so use $cputype instead. 386
   1.971 +	# is converted to i386 for consistency with other x86
   1.972 +	# operating systems.
   1.973 +	if test "$cputype" = "386"; then
   1.974 +	    UNAME_MACHINE=i386
   1.975 +	else
   1.976 +	    UNAME_MACHINE="$cputype"
   1.977 +	fi
   1.978 +	echo ${UNAME_MACHINE}-unknown-plan9
   1.979 +	exit 0 ;;
   1.980 +    i?86:OS/2:*:*)
   1.981 +	# If we were able to find `uname', then EMX Unix compatibility
   1.982 +	# is probably installed.
   1.983 +	echo ${UNAME_MACHINE}-pc-os2-emx
   1.984 +	exit 0 ;;
   1.985 +    *:TOPS-10:*:*)
   1.986 +	echo pdp10-unknown-tops10
   1.987 +	exit 0 ;;
   1.988 +    *:TENEX:*:*)
   1.989 +	echo pdp10-unknown-tenex
   1.990 +	exit 0 ;;
   1.991 +    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
   1.992 +	echo pdp10-dec-tops20
   1.993 +	exit 0 ;;
   1.994 +    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
   1.995 +	echo pdp10-xkl-tops20
   1.996 +	exit 0 ;;
   1.997 +    *:TOPS-20:*:*)
   1.998 +	echo pdp10-unknown-tops20
   1.999 +	exit 0 ;;
  1.1000 +    *:ITS:*:*)
  1.1001 +	echo pdp10-unknown-its
  1.1002 +	exit 0 ;;
  1.1003  esac
  1.1004  
  1.1005  #echo '(No uname command or uname output not recognized.)' 1>&2
  1.1006 @@ -1035,11 +1260,24 @@
  1.1007  #endif
  1.1008  
  1.1009  #if defined (vax)
  1.1010 -#if !defined (ultrix)
  1.1011 -  printf ("vax-dec-bsd\n"); exit (0);
  1.1012 -#else
  1.1013 -  printf ("vax-dec-ultrix\n"); exit (0);
  1.1014 -#endif
  1.1015 +# if !defined (ultrix)
  1.1016 +#  include <sys/param.h>
  1.1017 +#  if defined (BSD)
  1.1018 +#   if BSD == 43
  1.1019 +      printf ("vax-dec-bsd4.3\n"); exit (0);
  1.1020 +#   else
  1.1021 +#    if BSD == 199006
  1.1022 +      printf ("vax-dec-bsd4.3reno\n"); exit (0);
  1.1023 +#    else
  1.1024 +      printf ("vax-dec-bsd\n"); exit (0);
  1.1025 +#    endif
  1.1026 +#   endif
  1.1027 +#  else
  1.1028 +    printf ("vax-dec-bsd\n"); exit (0);
  1.1029 +#  endif
  1.1030 +# else
  1.1031 +    printf ("vax-dec-ultrix\n"); exit (0);
  1.1032 +# endif
  1.1033  #endif
  1.1034  
  1.1035  #if defined (alliant) && defined (i860)
  1.1036 @@ -1050,7 +1288,7 @@
  1.1037  }
  1.1038  EOF
  1.1039  
  1.1040 -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
  1.1041 +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
  1.1042  rm -f $dummy.c $dummy
  1.1043  
  1.1044  # Apollos put the system type in the environment.
  1.1045 @@ -1083,6 +1321,48 @@
  1.1046      esac
  1.1047  fi
  1.1048  
  1.1049 -#echo '(Unable to guess system type)' 1>&2
  1.1050 +cat >&2 <<EOF
  1.1051 +$0: unable to guess system type
  1.1052 +
  1.1053 +This script, last modified $timestamp, has failed to recognize
  1.1054 +the operating system you are using. It is advised that you
  1.1055 +download the most up to date version of the config scripts from
  1.1056 +
  1.1057 +    ftp://ftp.gnu.org/pub/gnu/config/
  1.1058 +
  1.1059 +If the version you run ($0) is already up to date, please
  1.1060 +send the following data and any information you think might be
  1.1061 +pertinent to <config-patches@gnu.org> in order to provide the needed
  1.1062 +information to handle your system.
  1.1063 +
  1.1064 +config.guess timestamp = $timestamp
  1.1065 +
  1.1066 +uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1.1067 +uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1.1068 +uname -s = `(uname -s) 2>/dev/null || echo unknown`
  1.1069 +uname -v = `(uname -v) 2>/dev/null || echo unknown`
  1.1070 +
  1.1071 +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
  1.1072 +/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
  1.1073 +
  1.1074 +hostinfo               = `(hostinfo) 2>/dev/null`
  1.1075 +/bin/universe          = `(/bin/universe) 2>/dev/null`
  1.1076 +/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
  1.1077 +/bin/arch              = `(/bin/arch) 2>/dev/null`
  1.1078 +/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
  1.1079 +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
  1.1080 +
  1.1081 +UNAME_MACHINE = ${UNAME_MACHINE}
  1.1082 +UNAME_RELEASE = ${UNAME_RELEASE}
  1.1083 +UNAME_SYSTEM  = ${UNAME_SYSTEM}
  1.1084 +UNAME_VERSION = ${UNAME_VERSION}
  1.1085 +EOF
  1.1086  
  1.1087  exit 1
  1.1088 +
  1.1089 +# Local variables:
  1.1090 +# eval: (add-hook 'write-file-hooks 'time-stamp)
  1.1091 +# time-stamp-start: "timestamp='"
  1.1092 +# time-stamp-format: "%:y-%02m-%02d"
  1.1093 +# time-stamp-end: "'"
  1.1094 +# End: