config.guess
changeset 220 e59707061bde
parent 192 cee9f4af8db0
child 456 861128794ce2
child 597 85d1fcc58846
     1.1 --- a/config.guess	Thu Oct 08 05:35:16 2009 +0000
     1.2 +++ b/config.guess	Thu Oct 08 07:08:45 2009 +0000
     1.3 @@ -1,10 +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 -#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     1.8 +#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
     1.9  #   Free Software Foundation, Inc.
    1.10  
    1.11 -timestamp='2009-02-03'
    1.12 +timestamp='2009-09-18'
    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 @@ -27,16 +27,16 @@
    1.17  # the same distribution terms that you use for the rest of that program.
    1.18  
    1.19  
    1.20 -# Originally written by Per Bothner <per@bothner.com>.
    1.21 -# Please send patches to <config-patches@gnu.org>.  Submit a context
    1.22 -# diff and a properly formatted ChangeLog entry.
    1.23 +# Originally written by Per Bothner.  Please send patches (context
    1.24 +# diff format) to <config-patches@gnu.org> and include a ChangeLog
    1.25 +# entry.
    1.26  #
    1.27  # This script attempts to guess a canonical system name similar to
    1.28  # config.sub.  If it succeeds, it prints the system name on stdout, and
    1.29  # exits with 0.  Otherwise, it exits with 1.
    1.30  #
    1.31 -# The plan is that this can be called by configure scripts if you
    1.32 -# don't specify an explicit build system type.
    1.33 +# You can get the latest version of this script from:
    1.34 +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
    1.35  
    1.36  me=`echo "$0" | sed -e 's,.*/,,'`
    1.37  
    1.38 @@ -170,7 +170,7 @@
    1.39  	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
    1.40  		eval $set_cc_for_build
    1.41  		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
    1.42 -			| grep __ELF__ >/dev/null
    1.43 +			| grep -q __ELF__
    1.44  		then
    1.45  		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
    1.46  		    # Return netbsd for either.  FIX?
    1.47 @@ -324,6 +324,9 @@
    1.48  	case `/usr/bin/uname -p` in
    1.49  	    sparc) echo sparc-icl-nx7; exit ;;
    1.50  	esac ;;
    1.51 +    s390x:SunOS:*:*)
    1.52 +	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    1.53 +	exit ;;
    1.54      sun4H:SunOS:5.*:*)
    1.55  	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    1.56  	exit ;;
    1.57 @@ -653,7 +656,7 @@
    1.58  	    # => hppa64-hp-hpux11.23
    1.59  
    1.60  	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
    1.61 -		grep __LP64__ >/dev/null
    1.62 +		grep -q __LP64__
    1.63  	    then
    1.64  		HP_ARCH="hppa2.0w"
    1.65  	    else
    1.66 @@ -819,6 +822,9 @@
    1.67      [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
    1.68  	echo i${UNAME_MACHINE}-pc-mks
    1.69  	exit ;;
    1.70 +    8664:Windows_NT:*)
    1.71 +	echo x86_64-pc-mks
    1.72 +	exit ;;
    1.73      i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
    1.74  	# How do we know it's Interix rather than the generic POSIX subsystem?
    1.75  	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
    1.76 @@ -848,6 +854,20 @@
    1.77      i*86:Minix:*:*)
    1.78  	echo ${UNAME_MACHINE}-pc-minix
    1.79  	exit ;;
    1.80 +    alpha:Linux:*:*)
    1.81 +	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
    1.82 +	  EV5)   UNAME_MACHINE=alphaev5 ;;
    1.83 +	  EV56)  UNAME_MACHINE=alphaev56 ;;
    1.84 +	  PCA56) UNAME_MACHINE=alphapca56 ;;
    1.85 +	  PCA57) UNAME_MACHINE=alphapca56 ;;
    1.86 +	  EV6)   UNAME_MACHINE=alphaev6 ;;
    1.87 +	  EV67)  UNAME_MACHINE=alphaev67 ;;
    1.88 +	  EV68*) UNAME_MACHINE=alphaev68 ;;
    1.89 +        esac
    1.90 +	objdump --private-headers /bin/sh | grep -q ld.so.1
    1.91 +	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
    1.92 +	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
    1.93 +	exit ;;
    1.94      arm*:Linux:*:*)
    1.95  	eval $set_cc_for_build
    1.96  	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
    1.97 @@ -870,6 +890,9 @@
    1.98      frv:Linux:*:*)
    1.99      	echo frv-unknown-linux-gnu
   1.100  	exit ;;
   1.101 +    i*86:Linux:*:*)
   1.102 +	echo ${UNAME_MACHINE}-pc-linux-gnu
   1.103 +	exit ;;
   1.104      ia64:Linux:*:*)
   1.105  	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.106  	exit ;;
   1.107 @@ -879,40 +902,17 @@
   1.108      m68*:Linux:*:*)
   1.109  	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.110  	exit ;;
   1.111 -    mips:Linux:*:*)
   1.112 +    mips:Linux:*:* | mips64:Linux:*:*)
   1.113  	eval $set_cc_for_build
   1.114  	sed 's/^	//' << EOF >$dummy.c
   1.115  	#undef CPU
   1.116 -	#undef mips
   1.117 -	#undef mipsel
   1.118 +	#undef ${UNAME_MACHINE}
   1.119 +	#undef ${UNAME_MACHINE}el
   1.120  	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   1.121 -	CPU=mipsel
   1.122 +	CPU=${UNAME_MACHINE}el
   1.123  	#else
   1.124  	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   1.125 -	CPU=mips
   1.126 -	#else
   1.127 -	CPU=
   1.128 -	#endif
   1.129 -	#endif
   1.130 -EOF
   1.131 -	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
   1.132 -	    /^CPU/{
   1.133 -		s: ::g
   1.134 -		p
   1.135 -	    }'`"
   1.136 -	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
   1.137 -	;;
   1.138 -    mips64:Linux:*:*)
   1.139 -	eval $set_cc_for_build
   1.140 -	sed 's/^	//' << EOF >$dummy.c
   1.141 -	#undef CPU
   1.142 -	#undef mips64
   1.143 -	#undef mips64el
   1.144 -	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   1.145 -	CPU=mips64el
   1.146 -	#else
   1.147 -	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   1.148 -	CPU=mips64
   1.149 +	CPU=${UNAME_MACHINE}
   1.150  	#else
   1.151  	CPU=
   1.152  	#endif
   1.153 @@ -928,29 +928,12 @@
   1.154      or32:Linux:*:*)
   1.155  	echo or32-unknown-linux-gnu
   1.156  	exit ;;
   1.157 -    ppc:Linux:*:*)
   1.158 -	echo powerpc-unknown-linux-gnu
   1.159 -	exit ;;
   1.160 -    ppc64:Linux:*:*)
   1.161 -	echo powerpc64-unknown-linux-gnu
   1.162 -	exit ;;
   1.163 -    alpha:Linux:*:*)
   1.164 -	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
   1.165 -	  EV5)   UNAME_MACHINE=alphaev5 ;;
   1.166 -	  EV56)  UNAME_MACHINE=alphaev56 ;;
   1.167 -	  PCA56) UNAME_MACHINE=alphapca56 ;;
   1.168 -	  PCA57) UNAME_MACHINE=alphapca56 ;;
   1.169 -	  EV6)   UNAME_MACHINE=alphaev6 ;;
   1.170 -	  EV67)  UNAME_MACHINE=alphaev67 ;;
   1.171 -	  EV68*) UNAME_MACHINE=alphaev68 ;;
   1.172 -        esac
   1.173 -	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
   1.174 -	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
   1.175 -	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
   1.176 -	exit ;;
   1.177      padre:Linux:*:*)
   1.178  	echo sparc-unknown-linux-gnu
   1.179  	exit ;;
   1.180 +    parisc64:Linux:*:* | hppa64:Linux:*:*)
   1.181 +	echo hppa64-unknown-linux-gnu
   1.182 +	exit ;;
   1.183      parisc:Linux:*:* | hppa:Linux:*:*)
   1.184  	# Look for CPU level
   1.185  	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   1.186 @@ -959,8 +942,11 @@
   1.187  	  *)    echo hppa-unknown-linux-gnu ;;
   1.188  	esac
   1.189  	exit ;;
   1.190 -    parisc64:Linux:*:* | hppa64:Linux:*:*)
   1.191 -	echo hppa64-unknown-linux-gnu
   1.192 +    ppc64:Linux:*:*)
   1.193 +	echo powerpc64-unknown-linux-gnu
   1.194 +	exit ;;
   1.195 +    ppc:Linux:*:*)
   1.196 +	echo powerpc-unknown-linux-gnu
   1.197  	exit ;;
   1.198      s390:Linux:*:* | s390x:Linux:*:*)
   1.199  	echo ${UNAME_MACHINE}-ibm-linux
   1.200 @@ -983,66 +969,6 @@
   1.201      xtensa*:Linux:*:*)
   1.202      	echo ${UNAME_MACHINE}-unknown-linux-gnu
   1.203  	exit ;;
   1.204 -    i*86:Linux:*:*)
   1.205 -	# The BFD linker knows what the default object file format is, so
   1.206 -	# first see if it will tell us. cd to the root directory to prevent
   1.207 -	# problems with other programs or directories called `ld' in the path.
   1.208 -	# Set LC_ALL=C to ensure ld outputs messages in English.
   1.209 -	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
   1.210 -			 | sed -ne '/supported targets:/!d
   1.211 -				    s/[ 	][ 	]*/ /g
   1.212 -				    s/.*supported targets: *//
   1.213 -				    s/ .*//
   1.214 -				    p'`
   1.215 -        case "$ld_supported_targets" in
   1.216 -	  elf32-i386)
   1.217 -		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
   1.218 -		;;
   1.219 -	  a.out-i386-linux)
   1.220 -		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
   1.221 -		exit ;;
   1.222 -	  "")
   1.223 -		# Either a pre-BFD a.out linker (linux-gnuoldld) or
   1.224 -		# one that does not give us useful --help.
   1.225 -		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
   1.226 -		exit ;;
   1.227 -	esac
   1.228 -	# Determine whether the default compiler is a.out or elf
   1.229 -	eval $set_cc_for_build
   1.230 -	sed 's/^	//' << EOF >$dummy.c
   1.231 -	#include <features.h>
   1.232 -	#ifdef __ELF__
   1.233 -	# ifdef __GLIBC__
   1.234 -	#  if __GLIBC__ >= 2
   1.235 -	LIBC=gnu
   1.236 -	#  else
   1.237 -	LIBC=gnulibc1
   1.238 -	#  endif
   1.239 -	# else
   1.240 -	LIBC=gnulibc1
   1.241 -	# endif
   1.242 -	#else
   1.243 -	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
   1.244 -	LIBC=gnu
   1.245 -	#else
   1.246 -	LIBC=gnuaout
   1.247 -	#endif
   1.248 -	#endif
   1.249 -	#ifdef __dietlibc__
   1.250 -	LIBC=dietlibc
   1.251 -	#endif
   1.252 -EOF
   1.253 -	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
   1.254 -	    /^LIBC/{
   1.255 -		s: ::g
   1.256 -		p
   1.257 -	    }'`"
   1.258 -	test x"${LIBC}" != x && {
   1.259 -		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
   1.260 -		exit
   1.261 -	}
   1.262 -	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
   1.263 -	;;
   1.264      i*86:DYNIX/ptx:4*:*)
   1.265  	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
   1.266  	# earlier versions are messed up and put the nodename in both
   1.267 @@ -1071,7 +997,7 @@
   1.268      i*86:syllable:*:*)
   1.269  	echo ${UNAME_MACHINE}-pc-syllable
   1.270  	exit ;;
   1.271 -    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
   1.272 +    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
   1.273  	echo i386-unknown-lynxos${UNAME_RELEASE}
   1.274  	exit ;;
   1.275      i*86:*DOS:*:*)
   1.276 @@ -1115,8 +1041,11 @@
   1.277      pc:*:*:*)
   1.278  	# Left here for compatibility:
   1.279          # uname -m prints for DJGPP always 'pc', but it prints nothing about
   1.280 -        # the processor, so we play safe by assuming i386.
   1.281 -	echo i386-pc-msdosdjgpp
   1.282 +        # the processor, so we play safe by assuming i586.
   1.283 +	# Note: whatever this is, it MUST be the same as what config.sub
   1.284 +	# prints for the "djgpp" host, or else GDB configury will decide that
   1.285 +	# this is a cross-build.
   1.286 +	echo i586-pc-msdosdjgpp
   1.287          exit ;;
   1.288      Intel:Mach:3*:*)
   1.289  	echo i386-pc-mach3
   1.290 @@ -1176,7 +1105,7 @@
   1.291      rs6000:LynxOS:2.*:*)
   1.292  	echo rs6000-unknown-lynxos${UNAME_RELEASE}
   1.293  	exit ;;
   1.294 -    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
   1.295 +    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
   1.296  	echo powerpc-unknown-lynxos${UNAME_RELEASE}
   1.297  	exit ;;
   1.298      SM[BE]S:UNIX_SV:*:*)
   1.299 @@ -1269,6 +1198,16 @@
   1.300      *:Darwin:*:*)
   1.301  	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
   1.302  	case $UNAME_PROCESSOR in
   1.303 +	    i386)
   1.304 +		eval $set_cc_for_build
   1.305 +		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
   1.306 +		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
   1.307 +		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
   1.308 +		      grep IS_64BIT_ARCH >/dev/null
   1.309 +		  then
   1.310 +		      UNAME_PROCESSOR="x86_64"
   1.311 +		  fi
   1.312 +		fi ;;
   1.313  	    unknown) UNAME_PROCESSOR=powerpc ;;
   1.314  	esac
   1.315  	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}