config.guess
branchSDL-1.2
changeset 597 85d1fcc58846
parent 220 e59707061bde
equal deleted inserted replaced
475:0c88c81b59c9 597:85d1fcc58846
     1 #! /bin/sh
     1 #! /bin/sh
     2 # Attempt to guess a canonical system name.
     2 # Attempt to guess a canonical system name.
     3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
     3 #   Copyright 1992-2017 Free Software Foundation, Inc.
     4 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
     4 
     5 #   Free Software Foundation, Inc.
     5 timestamp='2017-08-08'
     6 
       
     7 timestamp='2009-09-18'
       
     8 
     6 
     9 # This file is free software; you can redistribute it and/or modify it
     7 # This file is free software; you can redistribute it and/or modify it
    10 # under the terms of the GNU General Public License as published by
     8 # under the terms of the GNU General Public License as published by
    11 # the Free Software Foundation; either version 2 of the License, or
     9 # the Free Software Foundation; either version 3 of the License, or
    12 # (at your option) any later version.
    10 # (at your option) any later version.
    13 #
    11 #
    14 # This program is distributed in the hope that it will be useful, but
    12 # This program is distributed in the hope that it will be useful, but
    15 # WITHOUT ANY WARRANTY; without even the implied warranty of
    13 # WITHOUT ANY WARRANTY; without even the implied warranty of
    16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    17 # General Public License for more details.
    15 # General Public License for more details.
    18 #
    16 #
    19 # You should have received a copy of the GNU General Public License
    17 # You should have received a copy of the GNU General Public License
    20 # along with this program; if not, write to the Free Software
    18 # along with this program; if not, see <http://www.gnu.org/licenses/>.
    21 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
       
    22 # 02110-1301, USA.
       
    23 #
    19 #
    24 # As a special exception to the GNU General Public License, if you
    20 # As a special exception to the GNU General Public License, if you
    25 # distribute this file as part of a program that contains a
    21 # distribute this file as part of a program that contains a
    26 # configuration script generated by Autoconf, you may include it under
    22 # configuration script generated by Autoconf, you may include it under
    27 # the same distribution terms that you use for the rest of that program.
    23 # the same distribution terms that you use for the rest of that
    28 
    24 # program.  This Exception is an additional permission under section 7
    29 
    25 # of the GNU General Public License, version 3 ("GPLv3").
    30 # Originally written by Per Bothner.  Please send patches (context
       
    31 # diff format) to <config-patches@gnu.org> and include a ChangeLog
       
    32 # entry.
       
    33 #
    26 #
    34 # This script attempts to guess a canonical system name similar to
    27 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
    35 # config.sub.  If it succeeds, it prints the system name on stdout, and
       
    36 # exits with 0.  Otherwise, it exits with 1.
       
    37 #
    28 #
    38 # You can get the latest version of this script from:
    29 # You can get the latest version of this script from:
    39 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
    30 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
       
    31 #
       
    32 # Please send patches to <config-patches@gnu.org>.
       
    33 
    40 
    34 
    41 me=`echo "$0" | sed -e 's,.*/,,'`
    35 me=`echo "$0" | sed -e 's,.*/,,'`
    42 
    36 
    43 usage="\
    37 usage="\
    44 Usage: $0 [OPTION]
    38 Usage: $0 [OPTION]
    54 
    48 
    55 version="\
    49 version="\
    56 GNU config.guess ($timestamp)
    50 GNU config.guess ($timestamp)
    57 
    51 
    58 Originally written by Per Bothner.
    52 Originally written by Per Bothner.
    59 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
    53 Copyright 1992-2017 Free Software Foundation, Inc.
    60 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
       
    61 
    54 
    62 This is free software; see the source for copying conditions.  There is NO
    55 This is free software; see the source for copying conditions.  There is NO
    63 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    56 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
    64 
    57 
    65 help="
    58 help="
   137 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
   130 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
   138 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
   131 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
   139 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
   132 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
   140 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
   133 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
   141 
   134 
       
   135 case "${UNAME_SYSTEM}" in
       
   136 Linux|GNU|GNU/*)
       
   137 	# If the system lacks a compiler, then just pick glibc.
       
   138 	# We could probably try harder.
       
   139 	LIBC=gnu
       
   140 
       
   141 	eval $set_cc_for_build
       
   142 	cat <<-EOF > $dummy.c
       
   143 	#include <features.h>
       
   144 	#if defined(__UCLIBC__)
       
   145 	LIBC=uclibc
       
   146 	#elif defined(__dietlibc__)
       
   147 	LIBC=dietlibc
       
   148 	#else
       
   149 	LIBC=gnu
       
   150 	#endif
       
   151 	EOF
       
   152 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
       
   153 	;;
       
   154 esac
       
   155 
   142 # Note: order is significant - the case branches are not exclusive.
   156 # Note: order is significant - the case branches are not exclusive.
   143 
   157 
   144 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
   158 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
   145     *:NetBSD:*:*)
   159     *:NetBSD:*:*)
   146 	# NetBSD (nbsd) targets should (where applicable) match one or
   160 	# NetBSD (nbsd) targets should (where applicable) match one or
   147 	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
   161 	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
   148 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
   162 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
   149 	# switched to ELF, *-*-netbsd* would select the old
   163 	# switched to ELF, *-*-netbsd* would select the old
   150 	# object file format.  This provides both forward
   164 	# object file format.  This provides both forward
   151 	# compatibility and a consistent mechanism for selecting the
   165 	# compatibility and a consistent mechanism for selecting the
   152 	# object file format.
   166 	# object file format.
   153 	#
   167 	#
   154 	# Note: NetBSD doesn't particularly care about the vendor
   168 	# Note: NetBSD doesn't particularly care about the vendor
   155 	# portion of the name.  We always set it to "unknown".
   169 	# portion of the name.  We always set it to "unknown".
   156 	sysctl="sysctl -n hw.machine_arch"
   170 	sysctl="sysctl -n hw.machine_arch"
   157 	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
   171 	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
   158 	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
   172 	    /sbin/$sysctl 2>/dev/null || \
       
   173 	    /usr/sbin/$sysctl 2>/dev/null || \
       
   174 	    echo unknown)`
   159 	case "${UNAME_MACHINE_ARCH}" in
   175 	case "${UNAME_MACHINE_ARCH}" in
   160 	    armeb) machine=armeb-unknown ;;
   176 	    armeb) machine=armeb-unknown ;;
   161 	    arm*) machine=arm-unknown ;;
   177 	    arm*) machine=arm-unknown ;;
   162 	    sh3el) machine=shl-unknown ;;
   178 	    sh3el) machine=shl-unknown ;;
   163 	    sh3eb) machine=sh-unknown ;;
   179 	    sh3eb) machine=sh-unknown ;;
   164 	    sh5el) machine=sh5le-unknown ;;
   180 	    sh5el) machine=sh5le-unknown ;;
       
   181 	    earmv*)
       
   182 		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
       
   183 		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
       
   184 		machine=${arch}${endian}-unknown
       
   185 		;;
   165 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
   186 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
   166 	esac
   187 	esac
   167 	# The Operating System including object format, if it has switched
   188 	# The Operating System including object format, if it has switched
   168 	# to ELF recently, or will in the future.
   189 	# to ELF recently (or will in the future) and ABI.
   169 	case "${UNAME_MACHINE_ARCH}" in
   190 	case "${UNAME_MACHINE_ARCH}" in
       
   191 	    earm*)
       
   192 		os=netbsdelf
       
   193 		;;
   170 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
   194 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
   171 		eval $set_cc_for_build
   195 		eval $set_cc_for_build
   172 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
   196 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
   173 			| grep -q __ELF__
   197 			| grep -q __ELF__
   174 		then
   198 		then
   178 		else
   202 		else
   179 		    os=netbsdelf
   203 		    os=netbsdelf
   180 		fi
   204 		fi
   181 		;;
   205 		;;
   182 	    *)
   206 	    *)
   183 	        os=netbsd
   207 		os=netbsd
       
   208 		;;
       
   209 	esac
       
   210 	# Determine ABI tags.
       
   211 	case "${UNAME_MACHINE_ARCH}" in
       
   212 	    earm*)
       
   213 		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
       
   214 		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
   184 		;;
   215 		;;
   185 	esac
   216 	esac
   186 	# The OS release
   217 	# The OS release
   187 	# Debian GNU/NetBSD machines have a different userland, and
   218 	# Debian GNU/NetBSD machines have a different userland, and
   188 	# thus, need a distinct triplet. However, they do not need
   219 	# thus, need a distinct triplet. However, they do not need
   191 	case "${UNAME_VERSION}" in
   222 	case "${UNAME_VERSION}" in
   192 	    Debian*)
   223 	    Debian*)
   193 		release='-gnu'
   224 		release='-gnu'
   194 		;;
   225 		;;
   195 	    *)
   226 	    *)
   196 		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
   227 		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
   197 		;;
   228 		;;
   198 	esac
   229 	esac
   199 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
   230 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
   200 	# contains redundant information, the shorter form:
   231 	# contains redundant information, the shorter form:
   201 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
   232 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
   202 	echo "${machine}-${os}${release}"
   233 	echo "${machine}-${os}${release}${abi}"
       
   234 	exit ;;
       
   235     *:Bitrig:*:*)
       
   236 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
       
   237 	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
   203 	exit ;;
   238 	exit ;;
   204     *:OpenBSD:*:*)
   239     *:OpenBSD:*:*)
   205 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
   240 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
   206 	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
   241 	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
   207 	exit ;;
   242 	exit ;;
       
   243     *:LibertyBSD:*:*)
       
   244 	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
       
   245 	echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
       
   246 	exit ;;
   208     *:ekkoBSD:*:*)
   247     *:ekkoBSD:*:*)
   209 	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
   248 	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
   210 	exit ;;
   249 	exit ;;
   211     *:SolidBSD:*:*)
   250     *:SolidBSD:*:*)
   212 	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
   251 	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
   214     macppc:MirBSD:*:*)
   253     macppc:MirBSD:*:*)
   215 	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
   254 	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
   216 	exit ;;
   255 	exit ;;
   217     *:MirBSD:*:*)
   256     *:MirBSD:*:*)
   218 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
   257 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
       
   258 	exit ;;
       
   259     *:Sortix:*:*)
       
   260 	echo ${UNAME_MACHINE}-unknown-sortix
       
   261 	exit ;;
       
   262     *:Redox:*:*)
       
   263 	echo ${UNAME_MACHINE}-unknown-redox
   219 	exit ;;
   264 	exit ;;
   220     alpha:OSF1:*:*)
   265     alpha:OSF1:*:*)
   221 	case $UNAME_RELEASE in
   266 	case $UNAME_RELEASE in
   222 	*4.0)
   267 	*4.0)
   223 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
   268 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
   224 		;;
   269 		;;
   225 	*5.*)
   270 	*5.*)
   226 	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
   271 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
   227 		;;
   272 		;;
   228 	esac
   273 	esac
   229 	# According to Compaq, /usr/sbin/psrinfo has been available on
   274 	# According to Compaq, /usr/sbin/psrinfo has been available on
   230 	# OSF/1 and Tru64 systems produced since 1995.  I hope that
   275 	# OSF/1 and Tru64 systems produced since 1995.  I hope that
   231 	# covers most systems running today.  This code pipes the CPU
   276 	# covers most systems running today.  This code pipes the CPU
   232 	# types through head -n 1, so we only detect the type of CPU 0.
   277 	# types through head -n 1, so we only detect the type of CPU 0.
   233 	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
   278 	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
   234 	case "$ALPHA_CPU_TYPE" in
   279 	case "$ALPHA_CPU_TYPE" in
   235 	    "EV4 (21064)")
   280 	    "EV4 (21064)")
   236 		UNAME_MACHINE="alpha" ;;
   281 		UNAME_MACHINE=alpha ;;
   237 	    "EV4.5 (21064)")
   282 	    "EV4.5 (21064)")
   238 		UNAME_MACHINE="alpha" ;;
   283 		UNAME_MACHINE=alpha ;;
   239 	    "LCA4 (21066/21068)")
   284 	    "LCA4 (21066/21068)")
   240 		UNAME_MACHINE="alpha" ;;
   285 		UNAME_MACHINE=alpha ;;
   241 	    "EV5 (21164)")
   286 	    "EV5 (21164)")
   242 		UNAME_MACHINE="alphaev5" ;;
   287 		UNAME_MACHINE=alphaev5 ;;
   243 	    "EV5.6 (21164A)")
   288 	    "EV5.6 (21164A)")
   244 		UNAME_MACHINE="alphaev56" ;;
   289 		UNAME_MACHINE=alphaev56 ;;
   245 	    "EV5.6 (21164PC)")
   290 	    "EV5.6 (21164PC)")
   246 		UNAME_MACHINE="alphapca56" ;;
   291 		UNAME_MACHINE=alphapca56 ;;
   247 	    "EV5.7 (21164PC)")
   292 	    "EV5.7 (21164PC)")
   248 		UNAME_MACHINE="alphapca57" ;;
   293 		UNAME_MACHINE=alphapca57 ;;
   249 	    "EV6 (21264)")
   294 	    "EV6 (21264)")
   250 		UNAME_MACHINE="alphaev6" ;;
   295 		UNAME_MACHINE=alphaev6 ;;
   251 	    "EV6.7 (21264A)")
   296 	    "EV6.7 (21264A)")
   252 		UNAME_MACHINE="alphaev67" ;;
   297 		UNAME_MACHINE=alphaev67 ;;
   253 	    "EV6.8CB (21264C)")
   298 	    "EV6.8CB (21264C)")
   254 		UNAME_MACHINE="alphaev68" ;;
   299 		UNAME_MACHINE=alphaev68 ;;
   255 	    "EV6.8AL (21264B)")
   300 	    "EV6.8AL (21264B)")
   256 		UNAME_MACHINE="alphaev68" ;;
   301 		UNAME_MACHINE=alphaev68 ;;
   257 	    "EV6.8CX (21264D)")
   302 	    "EV6.8CX (21264D)")
   258 		UNAME_MACHINE="alphaev68" ;;
   303 		UNAME_MACHINE=alphaev68 ;;
   259 	    "EV6.9A (21264/EV69A)")
   304 	    "EV6.9A (21264/EV69A)")
   260 		UNAME_MACHINE="alphaev69" ;;
   305 		UNAME_MACHINE=alphaev69 ;;
   261 	    "EV7 (21364)")
   306 	    "EV7 (21364)")
   262 		UNAME_MACHINE="alphaev7" ;;
   307 		UNAME_MACHINE=alphaev7 ;;
   263 	    "EV7.9 (21364A)")
   308 	    "EV7.9 (21364A)")
   264 		UNAME_MACHINE="alphaev79" ;;
   309 		UNAME_MACHINE=alphaev79 ;;
   265 	esac
   310 	esac
   266 	# A Pn.n version is a patched version.
   311 	# A Pn.n version is a patched version.
   267 	# A Vn.n version is a released version.
   312 	# A Vn.n version is a released version.
   268 	# A Tn.n version is a released field test version.
   313 	# A Tn.n version is a released field test version.
   269 	# A Xn.n version is an unreleased experimental baselevel.
   314 	# A Xn.n version is an unreleased experimental baselevel.
   270 	# 1.2 uses "1.2" for uname -r.
   315 	# 1.2 uses "1.2" for uname -r.
   271 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   316 	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
   272 	exit ;;
   317 	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
       
   318 	exitcode=$?
       
   319 	trap '' 0
       
   320 	exit $exitcode ;;
   273     Alpha\ *:Windows_NT*:*)
   321     Alpha\ *:Windows_NT*:*)
   274 	# How do we know it's Interix rather than the generic POSIX subsystem?
   322 	# How do we know it's Interix rather than the generic POSIX subsystem?
   275 	# Should we change UNAME_MACHINE based on the output of uname instead
   323 	# Should we change UNAME_MACHINE based on the output of uname instead
   276 	# of the specific Alpha model?
   324 	# of the specific Alpha model?
   277 	echo alpha-pc-interix
   325 	echo alpha-pc-interix
   293 	exit ;;
   341 	exit ;;
   294     *:z/VM:*:*)
   342     *:z/VM:*:*)
   295 	echo s390-ibm-zvmoe
   343 	echo s390-ibm-zvmoe
   296 	exit ;;
   344 	exit ;;
   297     *:OS400:*:*)
   345     *:OS400:*:*)
   298         echo powerpc-ibm-os400
   346 	echo powerpc-ibm-os400
   299 	exit ;;
   347 	exit ;;
   300     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
   348     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
   301 	echo arm-acorn-riscix${UNAME_RELEASE}
   349 	echo arm-acorn-riscix${UNAME_RELEASE}
   302 	exit ;;
   350 	exit ;;
   303     arm:riscos:*:*|arm:RISCOS:*:*)
   351     arm*:riscos:*:*|arm*:RISCOS:*:*)
   304 	echo arm-unknown-riscos
   352 	echo arm-unknown-riscos
   305 	exit ;;
   353 	exit ;;
   306     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
   354     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
   307 	echo hppa1.1-hitachi-hiuxmpp
   355 	echo hppa1.1-hitachi-hiuxmpp
   308 	exit ;;
   356 	exit ;;
   331 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   379 	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   332 	exit ;;
   380 	exit ;;
   333     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
   381     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
   334 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   382 	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   335 	exit ;;
   383 	exit ;;
       
   384     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
       
   385 	echo i386-pc-auroraux${UNAME_RELEASE}
       
   386 	exit ;;
   336     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
   387     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
   337 	eval $set_cc_for_build
   388 	eval $set_cc_for_build
   338 	SUN_ARCH="i386"
   389 	SUN_ARCH=i386
   339 	# If there is a compiler, see if it is configured for 64-bit objects.
   390 	# If there is a compiler, see if it is configured for 64-bit objects.
   340 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
   391 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
   341 	# This test works for both compilers.
   392 	# This test works for both compilers.
   342 	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
   393 	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
   343 	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
   394 	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
   344 		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
   395 		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
   345 		grep IS_64BIT_ARCH >/dev/null
   396 		grep IS_64BIT_ARCH >/dev/null
   346 	    then
   397 	    then
   347 		SUN_ARCH="x86_64"
   398 		SUN_ARCH=x86_64
   348 	    fi
   399 	    fi
   349 	fi
   400 	fi
   350 	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   401 	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   351 	exit ;;
   402 	exit ;;
   352     sun4*:SunOS:6*:*)
   403     sun4*:SunOS:6*:*)
   367     sun3*:SunOS:*:*)
   418     sun3*:SunOS:*:*)
   368 	echo m68k-sun-sunos${UNAME_RELEASE}
   419 	echo m68k-sun-sunos${UNAME_RELEASE}
   369 	exit ;;
   420 	exit ;;
   370     sun*:*:4.2BSD:*)
   421     sun*:*:4.2BSD:*)
   371 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
   422 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
   372 	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
   423 	test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
   373 	case "`/bin/arch`" in
   424 	case "`/bin/arch`" in
   374 	    sun3)
   425 	    sun3)
   375 		echo m68k-sun-sunos${UNAME_RELEASE}
   426 		echo m68k-sun-sunos${UNAME_RELEASE}
   376 		;;
   427 		;;
   377 	    sun4)
   428 	    sun4)
   389     # to the lowercase version "mint" (or "freemint").  Finally
   440     # to the lowercase version "mint" (or "freemint").  Finally
   390     # the system name "TOS" denotes a system which is actually not
   441     # the system name "TOS" denotes a system which is actually not
   391     # MiNT.  But MiNT is downward compatible to TOS, so this should
   442     # MiNT.  But MiNT is downward compatible to TOS, so this should
   392     # be no problem.
   443     # be no problem.
   393     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
   444     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
   394         echo m68k-atari-mint${UNAME_RELEASE}
   445 	echo m68k-atari-mint${UNAME_RELEASE}
   395 	exit ;;
   446 	exit ;;
   396     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
   447     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
   397 	echo m68k-atari-mint${UNAME_RELEASE}
   448 	echo m68k-atari-mint${UNAME_RELEASE}
   398         exit ;;
   449 	exit ;;
   399     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
   450     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
   400         echo m68k-atari-mint${UNAME_RELEASE}
   451 	echo m68k-atari-mint${UNAME_RELEASE}
   401 	exit ;;
   452 	exit ;;
   402     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
   453     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
   403         echo m68k-milan-mint${UNAME_RELEASE}
   454 	echo m68k-milan-mint${UNAME_RELEASE}
   404         exit ;;
   455 	exit ;;
   405     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
   456     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
   406         echo m68k-hades-mint${UNAME_RELEASE}
   457 	echo m68k-hades-mint${UNAME_RELEASE}
   407         exit ;;
   458 	exit ;;
   408     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
   459     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
   409         echo m68k-unknown-mint${UNAME_RELEASE}
   460 	echo m68k-unknown-mint${UNAME_RELEASE}
   410         exit ;;
   461 	exit ;;
   411     m68k:machten:*:*)
   462     m68k:machten:*:*)
   412 	echo m68k-apple-machten${UNAME_RELEASE}
   463 	echo m68k-apple-machten${UNAME_RELEASE}
   413 	exit ;;
   464 	exit ;;
   414     powerpc:machten:*:*)
   465     powerpc:machten:*:*)
   415 	echo powerpc-apple-machten${UNAME_RELEASE}
   466 	echo powerpc-apple-machten${UNAME_RELEASE}
   475 	exit ;;
   526 	exit ;;
   476     m88k:*:3*:R3*)
   527     m88k:*:3*:R3*)
   477 	echo m88k-motorola-sysv3
   528 	echo m88k-motorola-sysv3
   478 	exit ;;
   529 	exit ;;
   479     AViiON:dgux:*:*)
   530     AViiON:dgux:*:*)
   480         # DG/UX returns AViiON for all architectures
   531 	# DG/UX returns AViiON for all architectures
   481         UNAME_PROCESSOR=`/usr/bin/uname -p`
   532 	UNAME_PROCESSOR=`/usr/bin/uname -p`
   482 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
   533 	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
   483 	then
   534 	then
   484 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
   535 	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
   485 	       [ ${TARGET_BINARY_INTERFACE}x = x ]
   536 	       [ ${TARGET_BINARY_INTERFACE}x = x ]
   486 	    then
   537 	    then
   489 		echo m88k-dg-dguxbcs${UNAME_RELEASE}
   540 		echo m88k-dg-dguxbcs${UNAME_RELEASE}
   490 	    fi
   541 	    fi
   491 	else
   542 	else
   492 	    echo i586-dg-dgux${UNAME_RELEASE}
   543 	    echo i586-dg-dgux${UNAME_RELEASE}
   493 	fi
   544 	fi
   494  	exit ;;
   545 	exit ;;
   495     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
   546     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
   496 	echo m88k-dolphin-sysv3
   547 	echo m88k-dolphin-sysv3
   497 	exit ;;
   548 	exit ;;
   498     M88*:*:R3*:*)
   549     M88*:*:R3*:*)
   499 	# Delta 88k system running SVR3
   550 	# Delta 88k system running SVR3
   546 		echo rs6000-ibm-aix3.2.4
   597 		echo rs6000-ibm-aix3.2.4
   547 	else
   598 	else
   548 		echo rs6000-ibm-aix3.2
   599 		echo rs6000-ibm-aix3.2
   549 	fi
   600 	fi
   550 	exit ;;
   601 	exit ;;
   551     *:AIX:*:[456])
   602     *:AIX:*:[4567])
   552 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
   603 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
   553 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
   604 	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
   554 		IBM_ARCH=rs6000
   605 		IBM_ARCH=rs6000
   555 	else
   606 	else
   556 		IBM_ARCH=powerpc
   607 		IBM_ARCH=powerpc
   557 	fi
   608 	fi
   558 	if [ -x /usr/bin/oslevel ] ; then
   609 	if [ -x /usr/bin/lslpp ] ; then
   559 		IBM_REV=`/usr/bin/oslevel`
   610 		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
       
   611 			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
   560 	else
   612 	else
   561 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
   613 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
   562 	fi
   614 	fi
   563 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
   615 	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
   564 	exit ;;
   616 	exit ;;
   589 	    9000/31? )            HP_ARCH=m68000 ;;
   641 	    9000/31? )            HP_ARCH=m68000 ;;
   590 	    9000/[34]?? )         HP_ARCH=m68k ;;
   642 	    9000/[34]?? )         HP_ARCH=m68k ;;
   591 	    9000/[678][0-9][0-9])
   643 	    9000/[678][0-9][0-9])
   592 		if [ -x /usr/bin/getconf ]; then
   644 		if [ -x /usr/bin/getconf ]; then
   593 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
   645 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
   594                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
   646 		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
   595                     case "${sc_cpu_version}" in
   647 		    case "${sc_cpu_version}" in
   596                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
   648 		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
   597                       528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
   649 		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
   598                       532)                      # CPU_PA_RISC2_0
   650 		      532)                      # CPU_PA_RISC2_0
   599                         case "${sc_kernel_bits}" in
   651 			case "${sc_kernel_bits}" in
   600                           32) HP_ARCH="hppa2.0n" ;;
   652 			  32) HP_ARCH=hppa2.0n ;;
   601                           64) HP_ARCH="hppa2.0w" ;;
   653 			  64) HP_ARCH=hppa2.0w ;;
   602 			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
   654 			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
   603                         esac ;;
   655 			esac ;;
   604                     esac
   656 		    esac
   605 		fi
   657 		fi
   606 		if [ "${HP_ARCH}" = "" ]; then
   658 		if [ "${HP_ARCH}" = "" ]; then
   607 		    eval $set_cc_for_build
   659 		    eval $set_cc_for_build
   608 		    sed 's/^              //' << EOF >$dummy.c
   660 		    sed 's/^		//' << EOF >$dummy.c
   609 
   661 
   610               #define _HPUX_SOURCE
   662 		#define _HPUX_SOURCE
   611               #include <stdlib.h>
   663 		#include <stdlib.h>
   612               #include <unistd.h>
   664 		#include <unistd.h>
   613 
   665 
   614               int main ()
   666 		int main ()
   615               {
   667 		{
   616               #if defined(_SC_KERNEL_BITS)
   668 		#if defined(_SC_KERNEL_BITS)
   617                   long bits = sysconf(_SC_KERNEL_BITS);
   669 		    long bits = sysconf(_SC_KERNEL_BITS);
   618               #endif
   670 		#endif
   619                   long cpu  = sysconf (_SC_CPU_VERSION);
   671 		    long cpu  = sysconf (_SC_CPU_VERSION);
   620 
   672 
   621                   switch (cpu)
   673 		    switch (cpu)
   622               	{
   674 			{
   623               	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
   675 			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
   624               	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
   676 			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
   625               	case CPU_PA_RISC2_0:
   677 			case CPU_PA_RISC2_0:
   626               #if defined(_SC_KERNEL_BITS)
   678 		#if defined(_SC_KERNEL_BITS)
   627               	    switch (bits)
   679 			    switch (bits)
   628               		{
   680 				{
   629               		case 64: puts ("hppa2.0w"); break;
   681 				case 64: puts ("hppa2.0w"); break;
   630               		case 32: puts ("hppa2.0n"); break;
   682 				case 32: puts ("hppa2.0n"); break;
   631               		default: puts ("hppa2.0"); break;
   683 				default: puts ("hppa2.0"); break;
   632               		} break;
   684 				} break;
   633               #else  /* !defined(_SC_KERNEL_BITS) */
   685 		#else  /* !defined(_SC_KERNEL_BITS) */
   634               	    puts ("hppa2.0"); break;
   686 			    puts ("hppa2.0"); break;
   635               #endif
   687 		#endif
   636               	default: puts ("hppa1.0"); break;
   688 			default: puts ("hppa1.0"); break;
   637               	}
   689 			}
   638                   exit (0);
   690 		    exit (0);
   639               }
   691 		}
   640 EOF
   692 EOF
   641 		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
   693 		    (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
   642 		    test -z "$HP_ARCH" && HP_ARCH=hppa
   694 		    test -z "$HP_ARCH" && HP_ARCH=hppa
   643 		fi ;;
   695 		fi ;;
   644 	esac
   696 	esac
   645 	if [ ${HP_ARCH} = "hppa2.0w" ]
   697 	if [ ${HP_ARCH} = hppa2.0w ]
   646 	then
   698 	then
   647 	    eval $set_cc_for_build
   699 	    eval $set_cc_for_build
   648 
   700 
   649 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
   701 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
   650 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
   702 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
   653 	    # $ CC_FOR_BUILD=cc ./config.guess
   705 	    # $ CC_FOR_BUILD=cc ./config.guess
   654 	    # => hppa2.0w-hp-hpux11.23
   706 	    # => hppa2.0w-hp-hpux11.23
   655 	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
   707 	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
   656 	    # => hppa64-hp-hpux11.23
   708 	    # => hppa64-hp-hpux11.23
   657 
   709 
   658 	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
   710 	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
   659 		grep -q __LP64__
   711 		grep -q __LP64__
   660 	    then
   712 	    then
   661 		HP_ARCH="hppa2.0w"
   713 		HP_ARCH=hppa2.0w
   662 	    else
   714 	    else
   663 		HP_ARCH="hppa64"
   715 		HP_ARCH=hppa64
   664 	    fi
   716 	    fi
   665 	fi
   717 	fi
   666 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
   718 	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
   667 	exit ;;
   719 	exit ;;
   668     ia64:HP-UX:*:*)
   720     ia64:HP-UX:*:*)
   725     parisc*:Lites*:*:*)
   777     parisc*:Lites*:*:*)
   726 	echo hppa1.1-hp-lites
   778 	echo hppa1.1-hp-lites
   727 	exit ;;
   779 	exit ;;
   728     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
   780     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
   729 	echo c1-convex-bsd
   781 	echo c1-convex-bsd
   730         exit ;;
   782 	exit ;;
   731     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
   783     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
   732 	if getsysinfo -f scalar_acc
   784 	if getsysinfo -f scalar_acc
   733 	then echo c32-convex-bsd
   785 	then echo c32-convex-bsd
   734 	else echo c2-convex-bsd
   786 	else echo c2-convex-bsd
   735 	fi
   787 	fi
   736         exit ;;
   788 	exit ;;
   737     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
   789     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
   738 	echo c34-convex-bsd
   790 	echo c34-convex-bsd
   739         exit ;;
   791 	exit ;;
   740     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
   792     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
   741 	echo c38-convex-bsd
   793 	echo c38-convex-bsd
   742         exit ;;
   794 	exit ;;
   743     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
   795     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
   744 	echo c4-convex-bsd
   796 	echo c4-convex-bsd
   745         exit ;;
   797 	exit ;;
   746     CRAY*Y-MP:*:*:*)
   798     CRAY*Y-MP:*:*:*)
   747 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   799 	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   748 	exit ;;
   800 	exit ;;
   749     CRAY*[A-Z]90:*:*:*)
   801     CRAY*[A-Z]90:*:*:*)
   750 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
   802 	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
   763 	exit ;;
   815 	exit ;;
   764     *:UNICOS/mp:*:*)
   816     *:UNICOS/mp:*:*)
   765 	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   817 	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
   766 	exit ;;
   818 	exit ;;
   767     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
   819     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
   768 	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   820 	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
   769         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
   821 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
   770         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
   822 	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
   771         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   823 	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   772         exit ;;
   824 	exit ;;
   773     5000:UNIX_System_V:4.*:*)
   825     5000:UNIX_System_V:4.*:*)
   774         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
   826 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
   775         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
   827 	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
   776         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   828 	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
   777 	exit ;;
   829 	exit ;;
   778     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
   830     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
   779 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
   831 	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
   780 	exit ;;
   832 	exit ;;
   781     sparc*:BSD/OS:*:*)
   833     sparc*:BSD/OS:*:*)
   783 	exit ;;
   835 	exit ;;
   784     *:BSD/OS:*:*)
   836     *:BSD/OS:*:*)
   785 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
   837 	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
   786 	exit ;;
   838 	exit ;;
   787     *:FreeBSD:*:*)
   839     *:FreeBSD:*:*)
   788 	case ${UNAME_MACHINE} in
   840 	UNAME_PROCESSOR=`/usr/bin/uname -p`
   789 	    pc98)
   841 	case ${UNAME_PROCESSOR} in
   790 		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
       
   791 	    amd64)
   842 	    amd64)
   792 		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
   843 		UNAME_PROCESSOR=x86_64 ;;
   793 	    *)
   844 	    i386)
   794 		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
   845 		UNAME_PROCESSOR=i586 ;;
   795 	esac
   846 	esac
       
   847 	echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
   796 	exit ;;
   848 	exit ;;
   797     i*:CYGWIN*:*)
   849     i*:CYGWIN*:*)
   798 	echo ${UNAME_MACHINE}-pc-cygwin
   850 	echo ${UNAME_MACHINE}-pc-cygwin
   799 	exit ;;
   851 	exit ;;
       
   852     *:MINGW64*:*)
       
   853 	echo ${UNAME_MACHINE}-pc-mingw64
       
   854 	exit ;;
   800     *:MINGW*:*)
   855     *:MINGW*:*)
   801 	echo ${UNAME_MACHINE}-pc-mingw32
   856 	echo ${UNAME_MACHINE}-pc-mingw32
   802 	exit ;;
   857 	exit ;;
       
   858     *:MSYS*:*)
       
   859 	echo ${UNAME_MACHINE}-pc-msys
       
   860 	exit ;;
   803     i*:windows32*:*)
   861     i*:windows32*:*)
   804     	# uname -m includes "-pc" on this system.
   862 	# uname -m includes "-pc" on this system.
   805     	echo ${UNAME_MACHINE}-mingw32
   863 	echo ${UNAME_MACHINE}-mingw32
   806 	exit ;;
   864 	exit ;;
   807     i*:PW*:*)
   865     i*:PW*:*)
   808 	echo ${UNAME_MACHINE}-pc-pw32
   866 	echo ${UNAME_MACHINE}-pc-pw32
   809 	exit ;;
   867 	exit ;;
   810     *:Interix*:[3456]*)
   868     *:Interix*:*)
   811     	case ${UNAME_MACHINE} in
   869 	case ${UNAME_MACHINE} in
   812 	    x86)
   870 	    x86)
   813 		echo i586-pc-interix${UNAME_RELEASE}
   871 		echo i586-pc-interix${UNAME_RELEASE}
   814 		exit ;;
   872 		exit ;;
   815 	    EM64T | authenticamd | genuineintel)
   873 	    authenticamd | genuineintel | EM64T)
   816 		echo x86_64-unknown-interix${UNAME_RELEASE}
   874 		echo x86_64-unknown-interix${UNAME_RELEASE}
   817 		exit ;;
   875 		exit ;;
   818 	    IA64)
   876 	    IA64)
   819 		echo ia64-unknown-interix${UNAME_RELEASE}
   877 		echo ia64-unknown-interix${UNAME_RELEASE}
   820 		exit ;;
   878 		exit ;;
   843     prep*:SunOS:5.*:*)
   901     prep*:SunOS:5.*:*)
   844 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   902 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
   845 	exit ;;
   903 	exit ;;
   846     *:GNU:*:*)
   904     *:GNU:*:*)
   847 	# the GNU system
   905 	# the GNU system
   848 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
   906 	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
   849 	exit ;;
   907 	exit ;;
   850     *:GNU/*:*:*)
   908     *:GNU/*:*:*)
   851 	# other systems with GNU libc and userland
   909 	# other systems with GNU libc and userland
   852 	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
   910 	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
   853 	exit ;;
   911 	exit ;;
   854     i*86:Minix:*:*)
   912     i*86:Minix:*:*)
   855 	echo ${UNAME_MACHINE}-pc-minix
   913 	echo ${UNAME_MACHINE}-pc-minix
       
   914 	exit ;;
       
   915     aarch64:Linux:*:*)
       
   916 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
       
   917 	exit ;;
       
   918     aarch64_be:Linux:*:*)
       
   919 	UNAME_MACHINE=aarch64_be
       
   920 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   856 	exit ;;
   921 	exit ;;
   857     alpha:Linux:*:*)
   922     alpha:Linux:*:*)
   858 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
   923 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
   859 	  EV5)   UNAME_MACHINE=alphaev5 ;;
   924 	  EV5)   UNAME_MACHINE=alphaev5 ;;
   860 	  EV56)  UNAME_MACHINE=alphaev56 ;;
   925 	  EV56)  UNAME_MACHINE=alphaev56 ;;
   861 	  PCA56) UNAME_MACHINE=alphapca56 ;;
   926 	  PCA56) UNAME_MACHINE=alphapca56 ;;
   862 	  PCA57) UNAME_MACHINE=alphapca56 ;;
   927 	  PCA57) UNAME_MACHINE=alphapca56 ;;
   863 	  EV6)   UNAME_MACHINE=alphaev6 ;;
   928 	  EV6)   UNAME_MACHINE=alphaev6 ;;
   864 	  EV67)  UNAME_MACHINE=alphaev67 ;;
   929 	  EV67)  UNAME_MACHINE=alphaev67 ;;
   865 	  EV68*) UNAME_MACHINE=alphaev68 ;;
   930 	  EV68*) UNAME_MACHINE=alphaev68 ;;
   866         esac
   931 	esac
   867 	objdump --private-headers /bin/sh | grep -q ld.so.1
   932 	objdump --private-headers /bin/sh | grep -q ld.so.1
   868 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
   933 	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
   869 	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
   934 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
       
   935 	exit ;;
       
   936     arc:Linux:*:* | arceb:Linux:*:*)
       
   937 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   870 	exit ;;
   938 	exit ;;
   871     arm*:Linux:*:*)
   939     arm*:Linux:*:*)
   872 	eval $set_cc_for_build
   940 	eval $set_cc_for_build
   873 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
   941 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
   874 	    | grep -q __ARM_EABI__
   942 	    | grep -q __ARM_EABI__
   875 	then
   943 	then
   876 	    echo ${UNAME_MACHINE}-unknown-linux-gnu
   944 	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   877 	else
   945 	else
   878 	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
   946 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
       
   947 		| grep -q __ARM_PCS_VFP
       
   948 	    then
       
   949 		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
       
   950 	    else
       
   951 		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
       
   952 	    fi
   879 	fi
   953 	fi
   880 	exit ;;
   954 	exit ;;
   881     avr32*:Linux:*:*)
   955     avr32*:Linux:*:*)
   882 	echo ${UNAME_MACHINE}-unknown-linux-gnu
   956 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   883 	exit ;;
   957 	exit ;;
   884     cris:Linux:*:*)
   958     cris:Linux:*:*)
   885 	echo cris-axis-linux-gnu
   959 	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
   886 	exit ;;
   960 	exit ;;
   887     crisv32:Linux:*:*)
   961     crisv32:Linux:*:*)
   888 	echo crisv32-axis-linux-gnu
   962 	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
       
   963 	exit ;;
       
   964     e2k:Linux:*:*)
       
   965 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   889 	exit ;;
   966 	exit ;;
   890     frv:Linux:*:*)
   967     frv:Linux:*:*)
   891     	echo frv-unknown-linux-gnu
   968 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
       
   969 	exit ;;
       
   970     hexagon:Linux:*:*)
       
   971 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   892 	exit ;;
   972 	exit ;;
   893     i*86:Linux:*:*)
   973     i*86:Linux:*:*)
   894 	echo ${UNAME_MACHINE}-pc-linux-gnu
   974 	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
   895 	exit ;;
   975 	exit ;;
   896     ia64:Linux:*:*)
   976     ia64:Linux:*:*)
   897 	echo ${UNAME_MACHINE}-unknown-linux-gnu
   977 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
       
   978 	exit ;;
       
   979     k1om:Linux:*:*)
       
   980 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   898 	exit ;;
   981 	exit ;;
   899     m32r*:Linux:*:*)
   982     m32r*:Linux:*:*)
   900 	echo ${UNAME_MACHINE}-unknown-linux-gnu
   983 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   901 	exit ;;
   984 	exit ;;
   902     m68*:Linux:*:*)
   985     m68*:Linux:*:*)
   903 	echo ${UNAME_MACHINE}-unknown-linux-gnu
   986 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   904 	exit ;;
   987 	exit ;;
   905     mips:Linux:*:* | mips64:Linux:*:*)
   988     mips:Linux:*:* | mips64:Linux:*:*)
   906 	eval $set_cc_for_build
   989 	eval $set_cc_for_build
   907 	sed 's/^	//' << EOF >$dummy.c
   990 	sed 's/^	//' << EOF >$dummy.c
   908 	#undef CPU
   991 	#undef CPU
   916 	#else
   999 	#else
   917 	CPU=
  1000 	CPU=
   918 	#endif
  1001 	#endif
   919 	#endif
  1002 	#endif
   920 EOF
  1003 EOF
   921 	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
  1004 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
   922 	    /^CPU/{
  1005 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
   923 		s: ::g
       
   924 		p
       
   925 	    }'`"
       
   926 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
       
   927 	;;
  1006 	;;
   928     or32:Linux:*:*)
  1007     mips64el:Linux:*:*)
   929 	echo or32-unknown-linux-gnu
  1008 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
       
  1009 	exit ;;
       
  1010     openrisc*:Linux:*:*)
       
  1011 	echo or1k-unknown-linux-${LIBC}
       
  1012 	exit ;;
       
  1013     or32:Linux:*:* | or1k*:Linux:*:*)
       
  1014 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   930 	exit ;;
  1015 	exit ;;
   931     padre:Linux:*:*)
  1016     padre:Linux:*:*)
   932 	echo sparc-unknown-linux-gnu
  1017 	echo sparc-unknown-linux-${LIBC}
   933 	exit ;;
  1018 	exit ;;
   934     parisc64:Linux:*:* | hppa64:Linux:*:*)
  1019     parisc64:Linux:*:* | hppa64:Linux:*:*)
   935 	echo hppa64-unknown-linux-gnu
  1020 	echo hppa64-unknown-linux-${LIBC}
   936 	exit ;;
  1021 	exit ;;
   937     parisc:Linux:*:* | hppa:Linux:*:*)
  1022     parisc:Linux:*:* | hppa:Linux:*:*)
   938 	# Look for CPU level
  1023 	# Look for CPU level
   939 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  1024 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   940 	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
  1025 	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
   941 	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
  1026 	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
   942 	  *)    echo hppa-unknown-linux-gnu ;;
  1027 	  *)    echo hppa-unknown-linux-${LIBC} ;;
   943 	esac
  1028 	esac
   944 	exit ;;
  1029 	exit ;;
   945     ppc64:Linux:*:*)
  1030     ppc64:Linux:*:*)
   946 	echo powerpc64-unknown-linux-gnu
  1031 	echo powerpc64-unknown-linux-${LIBC}
   947 	exit ;;
  1032 	exit ;;
   948     ppc:Linux:*:*)
  1033     ppc:Linux:*:*)
   949 	echo powerpc-unknown-linux-gnu
  1034 	echo powerpc-unknown-linux-${LIBC}
       
  1035 	exit ;;
       
  1036     ppc64le:Linux:*:*)
       
  1037 	echo powerpc64le-unknown-linux-${LIBC}
       
  1038 	exit ;;
       
  1039     ppcle:Linux:*:*)
       
  1040 	echo powerpcle-unknown-linux-${LIBC}
       
  1041 	exit ;;
       
  1042     riscv32:Linux:*:* | riscv64:Linux:*:*)
       
  1043 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   950 	exit ;;
  1044 	exit ;;
   951     s390:Linux:*:* | s390x:Linux:*:*)
  1045     s390:Linux:*:* | s390x:Linux:*:*)
   952 	echo ${UNAME_MACHINE}-ibm-linux
  1046 	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
   953 	exit ;;
  1047 	exit ;;
   954     sh64*:Linux:*:*)
  1048     sh64*:Linux:*:*)
   955     	echo ${UNAME_MACHINE}-unknown-linux-gnu
  1049 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   956 	exit ;;
  1050 	exit ;;
   957     sh*:Linux:*:*)
  1051     sh*:Linux:*:*)
   958 	echo ${UNAME_MACHINE}-unknown-linux-gnu
  1052 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   959 	exit ;;
  1053 	exit ;;
   960     sparc:Linux:*:* | sparc64:Linux:*:*)
  1054     sparc:Linux:*:* | sparc64:Linux:*:*)
   961 	echo ${UNAME_MACHINE}-unknown-linux-gnu
  1055 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
       
  1056 	exit ;;
       
  1057     tile*:Linux:*:*)
       
  1058 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   962 	exit ;;
  1059 	exit ;;
   963     vax:Linux:*:*)
  1060     vax:Linux:*:*)
   964 	echo ${UNAME_MACHINE}-dec-linux-gnu
  1061 	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
   965 	exit ;;
  1062 	exit ;;
   966     x86_64:Linux:*:*)
  1063     x86_64:Linux:*:*)
   967 	echo x86_64-unknown-linux-gnu
  1064 	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
   968 	exit ;;
  1065 	exit ;;
   969     xtensa*:Linux:*:*)
  1066     xtensa*:Linux:*:*)
   970     	echo ${UNAME_MACHINE}-unknown-linux-gnu
  1067 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
   971 	exit ;;
  1068 	exit ;;
   972     i*86:DYNIX/ptx:4*:*)
  1069     i*86:DYNIX/ptx:4*:*)
   973 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  1070 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
   974 	# earlier versions are messed up and put the nodename in both
  1071 	# earlier versions are messed up and put the nodename in both
   975 	# sysname and nodename.
  1072 	# sysname and nodename.
   976 	echo i386-sequent-sysv4
  1073 	echo i386-sequent-sysv4
   977 	exit ;;
  1074 	exit ;;
   978     i*86:UNIX_SV:4.2MP:2.*)
  1075     i*86:UNIX_SV:4.2MP:2.*)
   979         # Unixware is an offshoot of SVR4, but it has its own version
  1076 	# Unixware is an offshoot of SVR4, but it has its own version
   980         # number series starting with 2...
  1077 	# number series starting with 2...
   981         # I am not positive that other SVR4 systems won't match this,
  1078 	# I am not positive that other SVR4 systems won't match this,
   982 	# I just have to hope.  -- rms.
  1079 	# I just have to hope.  -- rms.
   983         # Use sysv4.2uw... so that sysv4* matches it.
  1080 	# Use sysv4.2uw... so that sysv4* matches it.
   984 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
  1081 	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
   985 	exit ;;
  1082 	exit ;;
   986     i*86:OS/2:*:*)
  1083     i*86:OS/2:*:*)
   987 	# If we were able to find `uname', then EMX Unix compatibility
  1084 	# If we were able to find `uname', then EMX Unix compatibility
   988 	# is probably installed.
  1085 	# is probably installed.
  1010 	else
  1107 	else
  1011 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
  1108 		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
  1012 	fi
  1109 	fi
  1013 	exit ;;
  1110 	exit ;;
  1014     i*86:*:5:[678]*)
  1111     i*86:*:5:[678]*)
  1015     	# UnixWare 7.x, OpenUNIX and OpenServer 6.
  1112 	# UnixWare 7.x, OpenUNIX and OpenServer 6.
  1016 	case `/bin/uname -X | grep "^Machine"` in
  1113 	case `/bin/uname -X | grep "^Machine"` in
  1017 	    *486*)	     UNAME_MACHINE=i486 ;;
  1114 	    *486*)	     UNAME_MACHINE=i486 ;;
  1018 	    *Pentium)	     UNAME_MACHINE=i586 ;;
  1115 	    *Pentium)	     UNAME_MACHINE=i586 ;;
  1019 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  1116 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
  1020 	esac
  1117 	esac
  1038 		echo ${UNAME_MACHINE}-pc-sysv32
  1135 		echo ${UNAME_MACHINE}-pc-sysv32
  1039 	fi
  1136 	fi
  1040 	exit ;;
  1137 	exit ;;
  1041     pc:*:*:*)
  1138     pc:*:*:*)
  1042 	# Left here for compatibility:
  1139 	# Left here for compatibility:
  1043         # uname -m prints for DJGPP always 'pc', but it prints nothing about
  1140 	# uname -m prints for DJGPP always 'pc', but it prints nothing about
  1044         # the processor, so we play safe by assuming i586.
  1141 	# the processor, so we play safe by assuming i586.
  1045 	# Note: whatever this is, it MUST be the same as what config.sub
  1142 	# Note: whatever this is, it MUST be the same as what config.sub
  1046 	# prints for the "djgpp" host, or else GDB configury will decide that
  1143 	# prints for the "djgpp" host, or else GDB configure will decide that
  1047 	# this is a cross-build.
  1144 	# this is a cross-build.
  1048 	echo i586-pc-msdosdjgpp
  1145 	echo i586-pc-msdosdjgpp
  1049         exit ;;
  1146 	exit ;;
  1050     Intel:Mach:3*:*)
  1147     Intel:Mach:3*:*)
  1051 	echo i386-pc-mach3
  1148 	echo i386-pc-mach3
  1052 	exit ;;
  1149 	exit ;;
  1053     paragon:*:*:*)
  1150     paragon:*:*:*)
  1054 	echo i860-intel-osf1
  1151 	echo i860-intel-osf1
  1079 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1176 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1080 	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
  1177 	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
  1081 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1178 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
  1082 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
  1179 	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
  1083     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1180     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  1084         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1181 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1085           && { echo i486-ncr-sysv4; exit; } ;;
  1182 	  && { echo i486-ncr-sysv4; exit; } ;;
  1086     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
  1183     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
  1087 	OS_REL='.3'
  1184 	OS_REL='.3'
  1088 	test -r /etc/.relid \
  1185 	test -r /etc/.relid \
  1089 	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1186 	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
  1090 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1187 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
  1123 		echo ${UNAME_MACHINE}-sni-sysv4
  1220 		echo ${UNAME_MACHINE}-sni-sysv4
  1124 	else
  1221 	else
  1125 		echo ns32k-sni-sysv
  1222 		echo ns32k-sni-sysv
  1126 	fi
  1223 	fi
  1127 	exit ;;
  1224 	exit ;;
  1128     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  1225     PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
  1129                       # says <Richard.M.Bartel@ccMail.Census.GOV>
  1226 			# says <Richard.M.Bartel@ccMail.Census.GOV>
  1130         echo i586-unisys-sysv4
  1227 	echo i586-unisys-sysv4
  1131         exit ;;
  1228 	exit ;;
  1132     *:UNIX_System_V:4*:FTX*)
  1229     *:UNIX_System_V:4*:FTX*)
  1133 	# From Gerald Hewes <hewes@openmarket.com>.
  1230 	# From Gerald Hewes <hewes@openmarket.com>.
  1134 	# How about differentiating between stratus architectures? -djm
  1231 	# How about differentiating between stratus architectures? -djm
  1135 	echo hppa1.1-stratus-sysv4
  1232 	echo hppa1.1-stratus-sysv4
  1136 	exit ;;
  1233 	exit ;;
  1152     news*:NEWS-OS:6*:*)
  1249     news*:NEWS-OS:6*:*)
  1153 	echo mips-sony-newsos6
  1250 	echo mips-sony-newsos6
  1154 	exit ;;
  1251 	exit ;;
  1155     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1252     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
  1156 	if [ -d /usr/nec ]; then
  1253 	if [ -d /usr/nec ]; then
  1157 	        echo mips-nec-sysv${UNAME_RELEASE}
  1254 		echo mips-nec-sysv${UNAME_RELEASE}
  1158 	else
  1255 	else
  1159 	        echo mips-unknown-sysv${UNAME_RELEASE}
  1256 		echo mips-unknown-sysv${UNAME_RELEASE}
  1160 	fi
  1257 	fi
  1161         exit ;;
  1258 	exit ;;
  1162     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
  1259     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
  1163 	echo powerpc-be-beos
  1260 	echo powerpc-be-beos
  1164 	exit ;;
  1261 	exit ;;
  1165     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
  1262     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
  1166 	echo powerpc-apple-beos
  1263 	echo powerpc-apple-beos
  1169 	echo i586-pc-beos
  1266 	echo i586-pc-beos
  1170 	exit ;;
  1267 	exit ;;
  1171     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
  1268     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
  1172 	echo i586-pc-haiku
  1269 	echo i586-pc-haiku
  1173 	exit ;;
  1270 	exit ;;
       
  1271     x86_64:Haiku:*:*)
       
  1272 	echo x86_64-unknown-haiku
       
  1273 	exit ;;
  1174     SX-4:SUPER-UX:*:*)
  1274     SX-4:SUPER-UX:*:*)
  1175 	echo sx4-nec-superux${UNAME_RELEASE}
  1275 	echo sx4-nec-superux${UNAME_RELEASE}
  1176 	exit ;;
  1276 	exit ;;
  1177     SX-5:SUPER-UX:*:*)
  1277     SX-5:SUPER-UX:*:*)
  1178 	echo sx5-nec-superux${UNAME_RELEASE}
  1278 	echo sx5-nec-superux${UNAME_RELEASE}
  1187 	echo sx8-nec-superux${UNAME_RELEASE}
  1287 	echo sx8-nec-superux${UNAME_RELEASE}
  1188 	exit ;;
  1288 	exit ;;
  1189     SX-8R:SUPER-UX:*:*)
  1289     SX-8R:SUPER-UX:*:*)
  1190 	echo sx8r-nec-superux${UNAME_RELEASE}
  1290 	echo sx8r-nec-superux${UNAME_RELEASE}
  1191 	exit ;;
  1291 	exit ;;
       
  1292     SX-ACE:SUPER-UX:*:*)
       
  1293 	echo sxace-nec-superux${UNAME_RELEASE}
       
  1294 	exit ;;
  1192     Power*:Rhapsody:*:*)
  1295     Power*:Rhapsody:*:*)
  1193 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1296 	echo powerpc-apple-rhapsody${UNAME_RELEASE}
  1194 	exit ;;
  1297 	exit ;;
  1195     *:Rhapsody:*:*)
  1298     *:Rhapsody:*:*)
  1196 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1299 	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
  1197 	exit ;;
  1300 	exit ;;
  1198     *:Darwin:*:*)
  1301     *:Darwin:*:*)
  1199 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
  1302 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
  1200 	case $UNAME_PROCESSOR in
  1303 	eval $set_cc_for_build
  1201 	    i386)
  1304 	if test "$UNAME_PROCESSOR" = unknown ; then
  1202 		eval $set_cc_for_build
  1305 	    UNAME_PROCESSOR=powerpc
  1203 		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
  1306 	fi
  1204 		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
  1307 	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
  1205 		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
  1308 	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
  1206 		      grep IS_64BIT_ARCH >/dev/null
  1309 		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
  1207 		  then
  1310 		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
  1208 		      UNAME_PROCESSOR="x86_64"
  1311 		       grep IS_64BIT_ARCH >/dev/null
  1209 		  fi
  1312 		then
  1210 		fi ;;
  1313 		    case $UNAME_PROCESSOR in
  1211 	    unknown) UNAME_PROCESSOR=powerpc ;;
  1314 			i386) UNAME_PROCESSOR=x86_64 ;;
  1212 	esac
  1315 			powerpc) UNAME_PROCESSOR=powerpc64 ;;
       
  1316 		    esac
       
  1317 		fi
       
  1318 		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
       
  1319 		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
       
  1320 		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
       
  1321 		       grep IS_PPC >/dev/null
       
  1322 		then
       
  1323 		    UNAME_PROCESSOR=powerpc
       
  1324 		fi
       
  1325 	    fi
       
  1326 	elif test "$UNAME_PROCESSOR" = i386 ; then
       
  1327 	    # Avoid executing cc on OS X 10.9, as it ships with a stub
       
  1328 	    # that puts up a graphical alert prompting to install
       
  1329 	    # developer tools.  Any system running Mac OS X 10.7 or
       
  1330 	    # later (Darwin 11 and later) is required to have a 64-bit
       
  1331 	    # processor. This is not true of the ARM version of Darwin
       
  1332 	    # that Apple uses in portable devices.
       
  1333 	    UNAME_PROCESSOR=x86_64
       
  1334 	fi
  1213 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
  1335 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
  1214 	exit ;;
  1336 	exit ;;
  1215     *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1337     *:procnto*:*:* | *:QNX:[0123456789]*:*)
  1216 	UNAME_PROCESSOR=`uname -p`
  1338 	UNAME_PROCESSOR=`uname -p`
  1217 	if test "$UNAME_PROCESSOR" = "x86"; then
  1339 	if test "$UNAME_PROCESSOR" = x86; then
  1218 		UNAME_PROCESSOR=i386
  1340 		UNAME_PROCESSOR=i386
  1219 		UNAME_MACHINE=pc
  1341 		UNAME_MACHINE=pc
  1220 	fi
  1342 	fi
  1221 	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
  1343 	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
  1222 	exit ;;
  1344 	exit ;;
  1223     *:QNX:*:4*)
  1345     *:QNX:*:4*)
  1224 	echo i386-pc-qnx
  1346 	echo i386-pc-qnx
  1225 	exit ;;
  1347 	exit ;;
  1226     NSE-?:NONSTOP_KERNEL:*:*)
  1348     NEO-*:NONSTOP_KERNEL:*:*)
       
  1349 	echo neo-tandem-nsk${UNAME_RELEASE}
       
  1350 	exit ;;
       
  1351     NSE-*:NONSTOP_KERNEL:*:*)
  1227 	echo nse-tandem-nsk${UNAME_RELEASE}
  1352 	echo nse-tandem-nsk${UNAME_RELEASE}
  1228 	exit ;;
  1353 	exit ;;
  1229     NSR-?:NONSTOP_KERNEL:*:*)
  1354     NSR-*:NONSTOP_KERNEL:*:*)
  1230 	echo nsr-tandem-nsk${UNAME_RELEASE}
  1355 	echo nsr-tandem-nsk${UNAME_RELEASE}
       
  1356 	exit ;;
       
  1357     NSX-*:NONSTOP_KERNEL:*:*)
       
  1358 	echo nsx-tandem-nsk${UNAME_RELEASE}
  1231 	exit ;;
  1359 	exit ;;
  1232     *:NonStop-UX:*:*)
  1360     *:NonStop-UX:*:*)
  1233 	echo mips-compaq-nonstopux
  1361 	echo mips-compaq-nonstopux
  1234 	exit ;;
  1362 	exit ;;
  1235     BS2000:POSIX*:*:*)
  1363     BS2000:POSIX*:*:*)
  1240 	exit ;;
  1368 	exit ;;
  1241     *:Plan9:*:*)
  1369     *:Plan9:*:*)
  1242 	# "uname -m" is not consistent, so use $cputype instead. 386
  1370 	# "uname -m" is not consistent, so use $cputype instead. 386
  1243 	# is converted to i386 for consistency with other x86
  1371 	# is converted to i386 for consistency with other x86
  1244 	# operating systems.
  1372 	# operating systems.
  1245 	if test "$cputype" = "386"; then
  1373 	if test "$cputype" = 386; then
  1246 	    UNAME_MACHINE=i386
  1374 	    UNAME_MACHINE=i386
  1247 	else
  1375 	else
  1248 	    UNAME_MACHINE="$cputype"
  1376 	    UNAME_MACHINE="$cputype"
  1249 	fi
  1377 	fi
  1250 	echo ${UNAME_MACHINE}-unknown-plan9
  1378 	echo ${UNAME_MACHINE}-unknown-plan9
  1266 	exit ;;
  1394 	exit ;;
  1267     *:ITS:*:*)
  1395     *:ITS:*:*)
  1268 	echo pdp10-unknown-its
  1396 	echo pdp10-unknown-its
  1269 	exit ;;
  1397 	exit ;;
  1270     SEI:*:*:SEIUX)
  1398     SEI:*:*:SEIUX)
  1271         echo mips-sei-seiux${UNAME_RELEASE}
  1399 	echo mips-sei-seiux${UNAME_RELEASE}
  1272 	exit ;;
  1400 	exit ;;
  1273     *:DragonFly:*:*)
  1401     *:DragonFly:*:*)
  1274 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
  1402 	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
  1275 	exit ;;
  1403 	exit ;;
  1276     *:*VMS:*:*)
  1404     *:*VMS:*:*)
  1277     	UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1405 	UNAME_MACHINE=`(uname -p) 2>/dev/null`
  1278 	case "${UNAME_MACHINE}" in
  1406 	case "${UNAME_MACHINE}" in
  1279 	    A*) echo alpha-dec-vms ; exit ;;
  1407 	    A*) echo alpha-dec-vms ; exit ;;
  1280 	    I*) echo ia64-dec-vms ; exit ;;
  1408 	    I*) echo ia64-dec-vms ; exit ;;
  1281 	    V*) echo vax-dec-vms ; exit ;;
  1409 	    V*) echo vax-dec-vms ; exit ;;
  1282 	esac ;;
  1410 	esac ;;
  1283     *:XENIX:*:SysV)
  1411     *:XENIX:*:SysV)
  1284 	echo i386-pc-xenix
  1412 	echo i386-pc-xenix
  1285 	exit ;;
  1413 	exit ;;
  1286     i*86:skyos:*:*)
  1414     i*86:skyos:*:*)
  1287 	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
  1415 	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
  1288 	exit ;;
  1416 	exit ;;
  1289     i*86:rdos:*:*)
  1417     i*86:rdos:*:*)
  1290 	echo ${UNAME_MACHINE}-pc-rdos
  1418 	echo ${UNAME_MACHINE}-pc-rdos
  1291 	exit ;;
  1419 	exit ;;
  1292     i*86:AROS:*:*)
  1420     i*86:AROS:*:*)
  1293 	echo ${UNAME_MACHINE}-pc-aros
  1421 	echo ${UNAME_MACHINE}-pc-aros
  1294 	exit ;;
  1422 	exit ;;
       
  1423     x86_64:VMkernel:*:*)
       
  1424 	echo ${UNAME_MACHINE}-unknown-esx
       
  1425 	exit ;;
       
  1426     amd64:Isilon\ OneFS:*:*)
       
  1427 	echo x86_64-unknown-onefs
       
  1428 	exit ;;
  1295 esac
  1429 esac
  1296 
       
  1297 #echo '(No uname command or uname output not recognized.)' 1>&2
       
  1298 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
       
  1299 
       
  1300 eval $set_cc_for_build
       
  1301 cat >$dummy.c <<EOF
       
  1302 #ifdef _SEQUENT_
       
  1303 # include <sys/types.h>
       
  1304 # include <sys/utsname.h>
       
  1305 #endif
       
  1306 main ()
       
  1307 {
       
  1308 #if defined (sony)
       
  1309 #if defined (MIPSEB)
       
  1310   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
       
  1311      I don't know....  */
       
  1312   printf ("mips-sony-bsd\n"); exit (0);
       
  1313 #else
       
  1314 #include <sys/param.h>
       
  1315   printf ("m68k-sony-newsos%s\n",
       
  1316 #ifdef NEWSOS4
       
  1317           "4"
       
  1318 #else
       
  1319 	  ""
       
  1320 #endif
       
  1321          ); exit (0);
       
  1322 #endif
       
  1323 #endif
       
  1324 
       
  1325 #if defined (__arm) && defined (__acorn) && defined (__unix)
       
  1326   printf ("arm-acorn-riscix\n"); exit (0);
       
  1327 #endif
       
  1328 
       
  1329 #if defined (hp300) && !defined (hpux)
       
  1330   printf ("m68k-hp-bsd\n"); exit (0);
       
  1331 #endif
       
  1332 
       
  1333 #if defined (NeXT)
       
  1334 #if !defined (__ARCHITECTURE__)
       
  1335 #define __ARCHITECTURE__ "m68k"
       
  1336 #endif
       
  1337   int version;
       
  1338   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
       
  1339   if (version < 4)
       
  1340     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
       
  1341   else
       
  1342     printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
       
  1343   exit (0);
       
  1344 #endif
       
  1345 
       
  1346 #if defined (MULTIMAX) || defined (n16)
       
  1347 #if defined (UMAXV)
       
  1348   printf ("ns32k-encore-sysv\n"); exit (0);
       
  1349 #else
       
  1350 #if defined (CMU)
       
  1351   printf ("ns32k-encore-mach\n"); exit (0);
       
  1352 #else
       
  1353   printf ("ns32k-encore-bsd\n"); exit (0);
       
  1354 #endif
       
  1355 #endif
       
  1356 #endif
       
  1357 
       
  1358 #if defined (__386BSD__)
       
  1359   printf ("i386-pc-bsd\n"); exit (0);
       
  1360 #endif
       
  1361 
       
  1362 #if defined (sequent)
       
  1363 #if defined (i386)
       
  1364   printf ("i386-sequent-dynix\n"); exit (0);
       
  1365 #endif
       
  1366 #if defined (ns32000)
       
  1367   printf ("ns32k-sequent-dynix\n"); exit (0);
       
  1368 #endif
       
  1369 #endif
       
  1370 
       
  1371 #if defined (_SEQUENT_)
       
  1372     struct utsname un;
       
  1373 
       
  1374     uname(&un);
       
  1375 
       
  1376     if (strncmp(un.version, "V2", 2) == 0) {
       
  1377 	printf ("i386-sequent-ptx2\n"); exit (0);
       
  1378     }
       
  1379     if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
       
  1380 	printf ("i386-sequent-ptx1\n"); exit (0);
       
  1381     }
       
  1382     printf ("i386-sequent-ptx\n"); exit (0);
       
  1383 
       
  1384 #endif
       
  1385 
       
  1386 #if defined (vax)
       
  1387 # if !defined (ultrix)
       
  1388 #  include <sys/param.h>
       
  1389 #  if defined (BSD)
       
  1390 #   if BSD == 43
       
  1391       printf ("vax-dec-bsd4.3\n"); exit (0);
       
  1392 #   else
       
  1393 #    if BSD == 199006
       
  1394       printf ("vax-dec-bsd4.3reno\n"); exit (0);
       
  1395 #    else
       
  1396       printf ("vax-dec-bsd\n"); exit (0);
       
  1397 #    endif
       
  1398 #   endif
       
  1399 #  else
       
  1400     printf ("vax-dec-bsd\n"); exit (0);
       
  1401 #  endif
       
  1402 # else
       
  1403     printf ("vax-dec-ultrix\n"); exit (0);
       
  1404 # endif
       
  1405 #endif
       
  1406 
       
  1407 #if defined (alliant) && defined (i860)
       
  1408   printf ("i860-alliant-bsd\n"); exit (0);
       
  1409 #endif
       
  1410 
       
  1411   exit (1);
       
  1412 }
       
  1413 EOF
       
  1414 
       
  1415 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
       
  1416 	{ echo "$SYSTEM_NAME"; exit; }
       
  1417 
       
  1418 # Apollos put the system type in the environment.
       
  1419 
       
  1420 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
       
  1421 
       
  1422 # Convex versions that predate uname can use getsysinfo(1)
       
  1423 
       
  1424 if [ -x /usr/convex/getsysinfo ]
       
  1425 then
       
  1426     case `getsysinfo -f cpu_type` in
       
  1427     c1*)
       
  1428 	echo c1-convex-bsd
       
  1429 	exit ;;
       
  1430     c2*)
       
  1431 	if getsysinfo -f scalar_acc
       
  1432 	then echo c32-convex-bsd
       
  1433 	else echo c2-convex-bsd
       
  1434 	fi
       
  1435 	exit ;;
       
  1436     c34*)
       
  1437 	echo c34-convex-bsd
       
  1438 	exit ;;
       
  1439     c38*)
       
  1440 	echo c38-convex-bsd
       
  1441 	exit ;;
       
  1442     c4*)
       
  1443 	echo c4-convex-bsd
       
  1444 	exit ;;
       
  1445     esac
       
  1446 fi
       
  1447 
  1430 
  1448 cat >&2 <<EOF
  1431 cat >&2 <<EOF
  1449 $0: unable to guess system type
  1432 $0: unable to guess system type
  1450 
  1433 
  1451 This script, last modified $timestamp, has failed to recognize
  1434 This script (version $timestamp), has failed to recognize the
  1452 the operating system you are using. It is advised that you
  1435 operating system you are using. If your script is old, overwrite *all*
  1453 download the most up to date version of the config scripts from
  1436 copies of config.guess and config.sub with the latest versions from:
  1454 
  1437 
  1455   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
  1438   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
  1456 and
  1439 and
  1457   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
  1440   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
  1458 
  1441 
  1459 If the version you run ($0) is already up to date, please
  1442 If $0 has already been updated, send the following data and any
  1460 send the following data and any information you think might be
  1443 information you think might be pertinent to config-patches@gnu.org to
  1461 pertinent to <config-patches@gnu.org> in order to provide the needed
  1444 provide the necessary information to handle your system.
  1462 information to handle your system.
       
  1463 
  1445 
  1464 config.guess timestamp = $timestamp
  1446 config.guess timestamp = $timestamp
  1465 
  1447 
  1466 uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1448 uname -m = `(uname -m) 2>/dev/null || echo unknown`
  1467 uname -r = `(uname -r) 2>/dev/null || echo unknown`
  1449 uname -r = `(uname -r) 2>/dev/null || echo unknown`