Home | History | Annotate | Line # | Download | only in dist
config.guess revision 1.13
      1   1.1  christos #! /bin/sh
      2   1.1  christos # Attempt to guess a canonical system name.
      3  1.12  christos #   Copyright 1992-2020 Free Software Foundation, Inc.
      4   1.1  christos 
      5  1.12  christos timestamp='2020-01-01'
      6   1.1  christos 
      7   1.1  christos # This file is free software; you can redistribute it and/or modify it
      8   1.1  christos # under the terms of the GNU General Public License as published by
      9   1.3  christos # the Free Software Foundation; either version 3 of the License, or
     10   1.1  christos # (at your option) any later version.
     11   1.1  christos #
     12   1.1  christos # This program is distributed in the hope that it will be useful, but
     13   1.1  christos # WITHOUT ANY WARRANTY; without even the implied warranty of
     14   1.1  christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15   1.1  christos # General Public License for more details.
     16   1.1  christos #
     17   1.1  christos # You should have received a copy of the GNU General Public License
     18  1.11  christos # along with this program; if not, see <https://www.gnu.org/licenses/>.
     19   1.1  christos #
     20   1.1  christos # As a special exception to the GNU General Public License, if you
     21   1.1  christos # distribute this file as part of a program that contains a
     22   1.1  christos # configuration script generated by Autoconf, you may include it under
     23   1.3  christos # the same distribution terms that you use for the rest of that
     24   1.3  christos # program.  This Exception is an additional permission under section 7
     25   1.3  christos # of the GNU General Public License, version 3 ("GPLv3").
     26   1.1  christos #
     27   1.5  christos # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
     28   1.1  christos #
     29   1.1  christos # You can get the latest version of this script from:
     30  1.11  christos # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
     31   1.3  christos #
     32   1.5  christos # Please send patches to <config-patches (at] gnu.org>.
     33   1.3  christos 
     34   1.1  christos 
     35   1.1  christos me=`echo "$0" | sed -e 's,.*/,,'`
     36   1.1  christos 
     37   1.1  christos usage="\
     38   1.1  christos Usage: $0 [OPTION]
     39   1.1  christos 
     40   1.1  christos Output the configuration name of the system \`$me' is run on.
     41   1.1  christos 
     42  1.11  christos Options:
     43   1.1  christos   -h, --help         print this help, then exit
     44   1.1  christos   -t, --time-stamp   print date of last modification, then exit
     45   1.1  christos   -v, --version      print version number, then exit
     46   1.1  christos 
     47   1.1  christos Report bugs and patches to <config-patches (at] gnu.org>."
     48   1.1  christos 
     49   1.1  christos version="\
     50   1.1  christos GNU config.guess ($timestamp)
     51   1.1  christos 
     52   1.1  christos Originally written by Per Bothner.
     53  1.12  christos Copyright 1992-2020 Free Software Foundation, Inc.
     54   1.1  christos 
     55   1.1  christos This is free software; see the source for copying conditions.  There is NO
     56   1.1  christos warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
     57   1.1  christos 
     58   1.1  christos help="
     59   1.1  christos Try \`$me --help' for more information."
     60   1.1  christos 
     61   1.1  christos # Parse command line
     62   1.1  christos while test $# -gt 0 ; do
     63   1.1  christos   case $1 in
     64   1.1  christos     --time-stamp | --time* | -t )
     65   1.1  christos        echo "$timestamp" ; exit ;;
     66   1.1  christos     --version | -v )
     67   1.1  christos        echo "$version" ; exit ;;
     68   1.1  christos     --help | --h* | -h )
     69   1.1  christos        echo "$usage"; exit ;;
     70   1.1  christos     -- )     # Stop option processing
     71   1.1  christos        shift; break ;;
     72   1.1  christos     - )	# Use stdin as input.
     73   1.1  christos        break ;;
     74   1.1  christos     -* )
     75   1.1  christos        echo "$me: invalid option $1$help" >&2
     76   1.1  christos        exit 1 ;;
     77   1.1  christos     * )
     78   1.1  christos        break ;;
     79   1.1  christos   esac
     80   1.1  christos done
     81   1.1  christos 
     82   1.1  christos if test $# != 0; then
     83   1.1  christos   echo "$me: too many arguments$help" >&2
     84   1.1  christos   exit 1
     85   1.1  christos fi
     86   1.1  christos 
     87   1.1  christos # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
     88   1.1  christos # compiler to aid in system detection is discouraged as it requires
     89   1.1  christos # temporary files to be created and, as you can see below, it is a
     90   1.1  christos # headache to deal with in a portable fashion.
     91   1.1  christos 
     92   1.1  christos # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
     93   1.1  christos # use `HOST_CC' if defined, but it is deprecated.
     94   1.1  christos 
     95   1.1  christos # Portable tmp directory creation inspired by the Autoconf team.
     96   1.1  christos 
     97  1.11  christos tmp=
     98  1.11  christos # shellcheck disable=SC2172
     99  1.11  christos trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
    100  1.11  christos 
    101  1.11  christos set_cc_for_build() {
    102  1.12  christos     # prevent multiple calls if $tmp is already set
    103  1.12  christos     test "$tmp" && return 0
    104  1.11  christos     : "${TMPDIR=/tmp}"
    105  1.11  christos     # shellcheck disable=SC2039
    106  1.11  christos     { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
    107  1.11  christos 	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
    108  1.11  christos 	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
    109  1.11  christos 	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
    110  1.11  christos     dummy=$tmp/dummy
    111  1.11  christos     case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
    112  1.11  christos 	,,)    echo "int x;" > "$dummy.c"
    113  1.11  christos 	       for driver in cc gcc c89 c99 ; do
    114  1.11  christos 		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
    115  1.11  christos 		       CC_FOR_BUILD="$driver"
    116  1.11  christos 		       break
    117  1.11  christos 		   fi
    118  1.11  christos 	       done
    119  1.11  christos 	       if test x"$CC_FOR_BUILD" = x ; then
    120  1.11  christos 		   CC_FOR_BUILD=no_compiler_found
    121  1.11  christos 	       fi
    122  1.11  christos 	       ;;
    123  1.11  christos 	,,*)   CC_FOR_BUILD=$CC ;;
    124  1.11  christos 	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
    125  1.11  christos     esac
    126  1.11  christos }
    127   1.1  christos 
    128   1.1  christos # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
    129   1.1  christos # (ghazi (at] noc.rutgers.edu 1994-08-24)
    130  1.11  christos if test -f /.attbin/uname ; then
    131   1.1  christos 	PATH=$PATH:/.attbin ; export PATH
    132   1.1  christos fi
    133   1.1  christos 
    134   1.1  christos UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
    135   1.1  christos UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
    136   1.1  christos UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
    137   1.1  christos UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    138   1.1  christos 
    139  1.11  christos case "$UNAME_SYSTEM" in
    140   1.4  christos Linux|GNU|GNU/*)
    141   1.4  christos 	# If the system lacks a compiler, then just pick glibc.
    142   1.4  christos 	# We could probably try harder.
    143   1.4  christos 	LIBC=gnu
    144   1.4  christos 
    145  1.11  christos 	set_cc_for_build
    146  1.11  christos 	cat <<-EOF > "$dummy.c"
    147   1.4  christos 	#include <features.h>
    148   1.4  christos 	#if defined(__UCLIBC__)
    149   1.4  christos 	LIBC=uclibc
    150   1.4  christos 	#elif defined(__dietlibc__)
    151   1.4  christos 	LIBC=dietlibc
    152   1.4  christos 	#else
    153   1.4  christos 	LIBC=gnu
    154   1.4  christos 	#endif
    155   1.4  christos 	EOF
    156  1.11  christos 	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
    157  1.11  christos 
    158  1.11  christos 	# If ldd exists, use it to detect musl libc.
    159  1.11  christos 	if command -v ldd >/dev/null && \
    160  1.11  christos 		ldd --version 2>&1 | grep -q ^musl
    161  1.11  christos 	then
    162  1.11  christos 	    LIBC=musl
    163  1.11  christos 	fi
    164   1.4  christos 	;;
    165   1.4  christos esac
    166   1.4  christos 
    167   1.1  christos # Note: order is significant - the case branches are not exclusive.
    168   1.1  christos 
    169  1.11  christos case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
    170   1.1  christos     *:NetBSD:*:*)
    171   1.1  christos 	# NetBSD (nbsd) targets should (where applicable) match one or
    172   1.3  christos 	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
    173   1.1  christos 	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
    174   1.1  christos 	# switched to ELF, *-*-netbsd* would select the old
    175   1.1  christos 	# object file format.  This provides both forward
    176   1.1  christos 	# compatibility and a consistent mechanism for selecting the
    177   1.1  christos 	# object file format.
    178   1.1  christos 	#
    179   1.1  christos 	# Note: NetBSD doesn't particularly care about the vendor
    180   1.1  christos 	# portion of the name.  We always set it to "unknown".
    181   1.1  christos 	sysctl="sysctl -n hw.machine_arch"
    182   1.6  christos 	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
    183  1.11  christos 	    "/sbin/$sysctl" 2>/dev/null || \
    184  1.11  christos 	    "/usr/sbin/$sysctl" 2>/dev/null || \
    185   1.6  christos 	    echo unknown)`
    186  1.11  christos 	case "$UNAME_MACHINE_ARCH" in
    187  1.13       rin 	    aarch64eb) machine=aarch64_be-unknown ;;
    188   1.1  christos 	    armeb) machine=armeb-unknown ;;
    189   1.1  christos 	    arm*) machine=arm-unknown ;;
    190   1.1  christos 	    sh3el) machine=shl-unknown ;;
    191   1.1  christos 	    sh3eb) machine=sh-unknown ;;
    192   1.1  christos 	    sh5el) machine=sh5le-unknown ;;
    193   1.6  christos 	    earmv*)
    194  1.11  christos 		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
    195  1.11  christos 		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
    196  1.11  christos 		machine="${arch}${endian}"-unknown
    197   1.6  christos 		;;
    198  1.11  christos 	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
    199   1.1  christos 	esac
    200   1.1  christos 	# The Operating System including object format, if it has switched
    201   1.9     sevan 	# to ELF recently (or will in the future) and ABI.
    202  1.11  christos 	case "$UNAME_MACHINE_ARCH" in
    203   1.2      matt 	    earm*)
    204   1.7     skrll 		os=netbsdelf
    205   1.2      matt 		;;
    206   1.1  christos 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
    207  1.11  christos 		set_cc_for_build
    208   1.1  christos 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
    209   1.1  christos 			| grep -q __ELF__
    210   1.1  christos 		then
    211   1.1  christos 		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
    212   1.1  christos 		    # Return netbsd for either.  FIX?
    213   1.1  christos 		    os=netbsd
    214   1.1  christos 		else
    215   1.1  christos 		    os=netbsdelf
    216   1.1  christos 		fi
    217   1.1  christos 		;;
    218   1.1  christos 	    *)
    219   1.1  christos 		os=netbsd
    220   1.1  christos 		;;
    221   1.1  christos 	esac
    222   1.6  christos 	# Determine ABI tags.
    223  1.11  christos 	case "$UNAME_MACHINE_ARCH" in
    224   1.6  christos 	    earm*)
    225   1.9     sevan 		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
    226  1.11  christos 		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
    227   1.6  christos 		;;
    228   1.6  christos 	esac
    229   1.1  christos 	# The OS release
    230   1.1  christos 	# Debian GNU/NetBSD machines have a different userland, and
    231   1.1  christos 	# thus, need a distinct triplet. However, they do not need
    232   1.1  christos 	# kernel version information, so it can be replaced with a
    233   1.1  christos 	# suitable tag, in the style of linux-gnu.
    234  1.11  christos 	case "$UNAME_VERSION" in
    235   1.1  christos 	    Debian*)
    236   1.1  christos 		release='-gnu'
    237   1.1  christos 		;;
    238   1.1  christos 	    *)
    239  1.11  christos 		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
    240   1.1  christos 		;;
    241   1.1  christos 	esac
    242   1.1  christos 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
    243   1.1  christos 	# contains redundant information, the shorter form:
    244   1.1  christos 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
    245  1.11  christos 	echo "$machine-${os}${release}${abi-}"
    246   1.1  christos 	exit ;;
    247   1.3  christos     *:Bitrig:*:*)
    248   1.3  christos 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
    249  1.11  christos 	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
    250   1.3  christos 	exit ;;
    251   1.1  christos     *:OpenBSD:*:*)
    252   1.1  christos 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
    253  1.11  christos 	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
    254   1.1  christos 	exit ;;
    255   1.7     skrll     *:LibertyBSD:*:*)
    256   1.7     skrll 	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
    257  1.11  christos 	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
    258  1.11  christos 	exit ;;
    259  1.11  christos     *:MidnightBSD:*:*)
    260  1.11  christos 	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
    261   1.7     skrll 	exit ;;
    262   1.1  christos     *:ekkoBSD:*:*)
    263  1.11  christos 	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
    264   1.1  christos 	exit ;;
    265   1.1  christos     *:SolidBSD:*:*)
    266  1.11  christos 	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
    267   1.1  christos 	exit ;;
    268  1.12  christos     *:OS108:*:*)
    269  1.12  christos 	echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
    270  1.12  christos 	exit ;;
    271   1.1  christos     macppc:MirBSD:*:*)
    272  1.11  christos 	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
    273   1.1  christos 	exit ;;
    274   1.1  christos     *:MirBSD:*:*)
    275  1.11  christos 	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
    276   1.1  christos 	exit ;;
    277   1.7     skrll     *:Sortix:*:*)
    278  1.11  christos 	echo "$UNAME_MACHINE"-unknown-sortix
    279  1.11  christos 	exit ;;
    280  1.12  christos     *:Twizzler:*:*)
    281  1.12  christos 	echo "$UNAME_MACHINE"-unknown-twizzler
    282  1.12  christos 	exit ;;
    283  1.11  christos     *:Redox:*:*)
    284  1.11  christos 	echo "$UNAME_MACHINE"-unknown-redox
    285   1.7     skrll 	exit ;;
    286  1.11  christos     mips:OSF1:*.*)
    287  1.12  christos 	echo mips-dec-osf1
    288  1.12  christos 	exit ;;
    289   1.1  christos     alpha:OSF1:*:*)
    290   1.1  christos 	case $UNAME_RELEASE in
    291   1.1  christos 	*4.0)
    292   1.1  christos 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
    293   1.1  christos 		;;
    294   1.1  christos 	*5.*)
    295   1.1  christos 		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
    296   1.1  christos 		;;
    297   1.1  christos 	esac
    298   1.1  christos 	# According to Compaq, /usr/sbin/psrinfo has been available on
    299   1.1  christos 	# OSF/1 and Tru64 systems produced since 1995.  I hope that
    300   1.1  christos 	# covers most systems running today.  This code pipes the CPU
    301   1.1  christos 	# types through head -n 1, so we only detect the type of CPU 0.
    302   1.1  christos 	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
    303   1.1  christos 	case "$ALPHA_CPU_TYPE" in
    304   1.1  christos 	    "EV4 (21064)")
    305   1.7     skrll 		UNAME_MACHINE=alpha ;;
    306   1.1  christos 	    "EV4.5 (21064)")
    307   1.7     skrll 		UNAME_MACHINE=alpha ;;
    308   1.1  christos 	    "LCA4 (21066/21068)")
    309   1.7     skrll 		UNAME_MACHINE=alpha ;;
    310   1.1  christos 	    "EV5 (21164)")
    311   1.7     skrll 		UNAME_MACHINE=alphaev5 ;;
    312   1.1  christos 	    "EV5.6 (21164A)")
    313   1.7     skrll 		UNAME_MACHINE=alphaev56 ;;
    314   1.1  christos 	    "EV5.6 (21164PC)")
    315   1.7     skrll 		UNAME_MACHINE=alphapca56 ;;
    316   1.1  christos 	    "EV5.7 (21164PC)")
    317   1.7     skrll 		UNAME_MACHINE=alphapca57 ;;
    318   1.1  christos 	    "EV6 (21264)")
    319   1.7     skrll 		UNAME_MACHINE=alphaev6 ;;
    320   1.1  christos 	    "EV6.7 (21264A)")
    321   1.7     skrll 		UNAME_MACHINE=alphaev67 ;;
    322   1.1  christos 	    "EV6.8CB (21264C)")
    323   1.7     skrll 		UNAME_MACHINE=alphaev68 ;;
    324   1.1  christos 	    "EV6.8AL (21264B)")
    325   1.7     skrll 		UNAME_MACHINE=alphaev68 ;;
    326   1.1  christos 	    "EV6.8CX (21264D)")
    327   1.7     skrll 		UNAME_MACHINE=alphaev68 ;;
    328   1.1  christos 	    "EV6.9A (21264/EV69A)")
    329   1.7     skrll 		UNAME_MACHINE=alphaev69 ;;
    330   1.1  christos 	    "EV7 (21364)")
    331   1.7     skrll 		UNAME_MACHINE=alphaev7 ;;
    332   1.1  christos 	    "EV7.9 (21364A)")
    333   1.7     skrll 		UNAME_MACHINE=alphaev79 ;;
    334   1.1  christos 	esac
    335   1.1  christos 	# A Pn.n version is a patched version.
    336   1.1  christos 	# A Vn.n version is a released version.
    337   1.1  christos 	# A Tn.n version is a released field test version.
    338   1.1  christos 	# A Xn.n version is an unreleased experimental baselevel.
    339   1.1  christos 	# 1.2 uses "1.2" for uname -r.
    340  1.11  christos 	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
    341   1.1  christos 	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
    342   1.1  christos 	exitcode=$?
    343   1.1  christos 	trap '' 0
    344   1.1  christos 	exit $exitcode ;;
    345   1.1  christos     Amiga*:UNIX_System_V:4.0:*)
    346   1.1  christos 	echo m68k-unknown-sysv4
    347   1.1  christos 	exit ;;
    348   1.1  christos     *:[Aa]miga[Oo][Ss]:*:*)
    349  1.11  christos 	echo "$UNAME_MACHINE"-unknown-amigaos
    350   1.1  christos 	exit ;;
    351   1.1  christos     *:[Mm]orph[Oo][Ss]:*:*)
    352  1.11  christos 	echo "$UNAME_MACHINE"-unknown-morphos
    353   1.1  christos 	exit ;;
    354   1.1  christos     *:OS/390:*:*)
    355   1.1  christos 	echo i370-ibm-openedition
    356   1.1  christos 	exit ;;
    357   1.1  christos     *:z/VM:*:*)
    358   1.1  christos 	echo s390-ibm-zvmoe
    359   1.1  christos 	exit ;;
    360   1.1  christos     *:OS400:*:*)
    361   1.1  christos 	echo powerpc-ibm-os400
    362   1.1  christos 	exit ;;
    363   1.1  christos     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    364  1.11  christos 	echo arm-acorn-riscix"$UNAME_RELEASE"
    365   1.1  christos 	exit ;;
    366   1.3  christos     arm*:riscos:*:*|arm*:RISCOS:*:*)
    367   1.1  christos 	echo arm-unknown-riscos
    368   1.1  christos 	exit ;;
    369   1.1  christos     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
    370   1.1  christos 	echo hppa1.1-hitachi-hiuxmpp
    371   1.1  christos 	exit ;;
    372   1.1  christos     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
    373   1.1  christos 	# akee (at] wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
    374   1.1  christos 	if test "`(/bin/universe) 2>/dev/null`" = att ; then
    375   1.1  christos 		echo pyramid-pyramid-sysv3
    376   1.1  christos 	else
    377   1.1  christos 		echo pyramid-pyramid-bsd
    378   1.1  christos 	fi
    379   1.1  christos 	exit ;;
    380   1.1  christos     NILE*:*:*:dcosx)
    381   1.1  christos 	echo pyramid-pyramid-svr4
    382   1.1  christos 	exit ;;
    383   1.1  christos     DRS?6000:unix:4.0:6*)
    384   1.1  christos 	echo sparc-icl-nx6
    385   1.1  christos 	exit ;;
    386   1.1  christos     DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
    387   1.1  christos 	case `/usr/bin/uname -p` in
    388   1.1  christos 	    sparc) echo sparc-icl-nx7; exit ;;
    389   1.1  christos 	esac ;;
    390   1.1  christos     s390x:SunOS:*:*)
    391  1.11  christos 	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
    392   1.1  christos 	exit ;;
    393   1.1  christos     sun4H:SunOS:5.*:*)
    394  1.11  christos 	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
    395   1.1  christos 	exit ;;
    396   1.1  christos     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    397  1.12  christos 	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
    398   1.1  christos 	exit ;;
    399   1.1  christos     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
    400  1.11  christos 	echo i386-pc-auroraux"$UNAME_RELEASE"
    401   1.1  christos 	exit ;;
    402   1.1  christos     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
    403  1.11  christos 	set_cc_for_build
    404   1.7     skrll 	SUN_ARCH=i386
    405   1.1  christos 	# If there is a compiler, see if it is configured for 64-bit objects.
    406   1.1  christos 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
    407   1.1  christos 	# This test works for both compilers.
    408   1.7     skrll 	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
    409   1.1  christos 	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
    410   1.7     skrll 		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
    411   1.1  christos 		grep IS_64BIT_ARCH >/dev/null
    412   1.1  christos 	    then
    413   1.7     skrll 		SUN_ARCH=x86_64
    414   1.1  christos 	    fi
    415   1.1  christos 	fi
    416  1.11  christos 	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
    417   1.1  christos 	exit ;;
    418   1.1  christos     sun4*:SunOS:6*:*)
    419   1.1  christos 	# According to config.sub, this is the proper way to canonicalize
    420   1.1  christos 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
    421   1.1  christos 	# it's likely to be more like Solaris than SunOS4.
    422  1.11  christos 	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
    423   1.1  christos 	exit ;;
    424   1.1  christos     sun4*:SunOS:*:*)
    425   1.1  christos 	case "`/usr/bin/arch -k`" in
    426   1.1  christos 	    Series*|S4*)
    427   1.1  christos 		UNAME_RELEASE=`uname -v`
    428   1.1  christos 		;;
    429   1.1  christos 	esac
    430   1.1  christos 	# Japanese Language versions have a version number like `4.1.3-JL'.
    431  1.11  christos 	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
    432   1.1  christos 	exit ;;
    433   1.1  christos     sun3*:SunOS:*:*)
    434  1.11  christos 	echo m68k-sun-sunos"$UNAME_RELEASE"
    435   1.1  christos 	exit ;;
    436   1.1  christos     sun*:*:4.2BSD:*)
    437   1.1  christos 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
    438  1.11  christos 	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
    439   1.1  christos 	case "`/bin/arch`" in
    440   1.1  christos 	    sun3)
    441  1.11  christos 		echo m68k-sun-sunos"$UNAME_RELEASE"
    442   1.1  christos 		;;
    443   1.1  christos 	    sun4)
    444  1.11  christos 		echo sparc-sun-sunos"$UNAME_RELEASE"
    445   1.1  christos 		;;
    446   1.1  christos 	esac
    447   1.1  christos 	exit ;;
    448   1.1  christos     aushp:SunOS:*:*)
    449  1.11  christos 	echo sparc-auspex-sunos"$UNAME_RELEASE"
    450   1.1  christos 	exit ;;
    451   1.1  christos     # The situation for MiNT is a little confusing.  The machine name
    452   1.1  christos     # can be virtually everything (everything which is not
    453   1.1  christos     # "atarist" or "atariste" at least should have a processor
    454   1.1  christos     # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
    455   1.1  christos     # to the lowercase version "mint" (or "freemint").  Finally
    456   1.1  christos     # the system name "TOS" denotes a system which is actually not
    457   1.1  christos     # MiNT.  But MiNT is downward compatible to TOS, so this should
    458   1.1  christos     # be no problem.
    459   1.1  christos     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    460  1.11  christos 	echo m68k-atari-mint"$UNAME_RELEASE"
    461   1.1  christos 	exit ;;
    462   1.1  christos     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    463  1.11  christos 	echo m68k-atari-mint"$UNAME_RELEASE"
    464   1.1  christos 	exit ;;
    465   1.1  christos     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    466  1.11  christos 	echo m68k-atari-mint"$UNAME_RELEASE"
    467   1.1  christos 	exit ;;
    468   1.1  christos     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    469  1.11  christos 	echo m68k-milan-mint"$UNAME_RELEASE"
    470   1.1  christos 	exit ;;
    471   1.1  christos     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    472  1.11  christos 	echo m68k-hades-mint"$UNAME_RELEASE"
    473   1.1  christos 	exit ;;
    474   1.1  christos     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    475  1.11  christos 	echo m68k-unknown-mint"$UNAME_RELEASE"
    476   1.1  christos 	exit ;;
    477   1.1  christos     m68k:machten:*:*)
    478  1.11  christos 	echo m68k-apple-machten"$UNAME_RELEASE"
    479   1.1  christos 	exit ;;
    480   1.1  christos     powerpc:machten:*:*)
    481  1.11  christos 	echo powerpc-apple-machten"$UNAME_RELEASE"
    482   1.1  christos 	exit ;;
    483   1.1  christos     RISC*:Mach:*:*)
    484   1.1  christos 	echo mips-dec-mach_bsd4.3
    485   1.1  christos 	exit ;;
    486   1.1  christos     RISC*:ULTRIX:*:*)
    487  1.11  christos 	echo mips-dec-ultrix"$UNAME_RELEASE"
    488   1.1  christos 	exit ;;
    489   1.1  christos     VAX*:ULTRIX*:*:*)
    490  1.11  christos 	echo vax-dec-ultrix"$UNAME_RELEASE"
    491   1.1  christos 	exit ;;
    492   1.1  christos     2020:CLIX:*:* | 2430:CLIX:*:*)
    493  1.11  christos 	echo clipper-intergraph-clix"$UNAME_RELEASE"
    494   1.1  christos 	exit ;;
    495   1.1  christos     mips:*:*:UMIPS | mips:*:*:RISCos)
    496  1.11  christos 	set_cc_for_build
    497  1.11  christos 	sed 's/^	//' << EOF > "$dummy.c"
    498   1.1  christos #ifdef __cplusplus
    499   1.1  christos #include <stdio.h>  /* for printf() prototype */
    500   1.1  christos 	int main (int argc, char *argv[]) {
    501   1.1  christos #else
    502   1.1  christos 	int main (argc, argv) int argc; char *argv[]; {
    503   1.1  christos #endif
    504   1.1  christos 	#if defined (host_mips) && defined (MIPSEB)
    505   1.1  christos 	#if defined (SYSTYPE_SYSV)
    506  1.11  christos 	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
    507   1.1  christos 	#endif
    508   1.1  christos 	#if defined (SYSTYPE_SVR4)
    509  1.11  christos 	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
    510   1.1  christos 	#endif
    511   1.1  christos 	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
    512  1.11  christos 	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
    513   1.1  christos 	#endif
    514   1.1  christos 	#endif
    515   1.1  christos 	  exit (-1);
    516   1.1  christos 	}
    517   1.1  christos EOF
    518  1.11  christos 	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
    519  1.11  christos 	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
    520  1.11  christos 	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
    521   1.1  christos 	    { echo "$SYSTEM_NAME"; exit; }
    522  1.11  christos 	echo mips-mips-riscos"$UNAME_RELEASE"
    523   1.1  christos 	exit ;;
    524   1.1  christos     Motorola:PowerMAX_OS:*:*)
    525   1.1  christos 	echo powerpc-motorola-powermax
    526   1.1  christos 	exit ;;
    527   1.1  christos     Motorola:*:4.3:PL8-*)
    528   1.1  christos 	echo powerpc-harris-powermax
    529   1.1  christos 	exit ;;
    530   1.1  christos     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
    531   1.1  christos 	echo powerpc-harris-powermax
    532   1.1  christos 	exit ;;
    533   1.1  christos     Night_Hawk:Power_UNIX:*:*)
    534   1.1  christos 	echo powerpc-harris-powerunix
    535   1.1  christos 	exit ;;
    536   1.1  christos     m88k:CX/UX:7*:*)
    537   1.1  christos 	echo m88k-harris-cxux7
    538   1.1  christos 	exit ;;
    539   1.1  christos     m88k:*:4*:R4*)
    540   1.1  christos 	echo m88k-motorola-sysv4
    541   1.1  christos 	exit ;;
    542   1.1  christos     m88k:*:3*:R3*)
    543   1.1  christos 	echo m88k-motorola-sysv3
    544   1.1  christos 	exit ;;
    545   1.1  christos     AViiON:dgux:*:*)
    546   1.1  christos 	# DG/UX returns AViiON for all architectures
    547   1.1  christos 	UNAME_PROCESSOR=`/usr/bin/uname -p`
    548  1.11  christos 	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
    549   1.1  christos 	then
    550  1.11  christos 	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
    551  1.11  christos 	       [ "$TARGET_BINARY_INTERFACE"x = x ]
    552   1.1  christos 	    then
    553  1.11  christos 		echo m88k-dg-dgux"$UNAME_RELEASE"
    554   1.1  christos 	    else
    555  1.11  christos 		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
    556   1.1  christos 	    fi
    557   1.1  christos 	else
    558  1.11  christos 	    echo i586-dg-dgux"$UNAME_RELEASE"
    559   1.1  christos 	fi
    560   1.1  christos 	exit ;;
    561   1.1  christos     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
    562   1.1  christos 	echo m88k-dolphin-sysv3
    563   1.1  christos 	exit ;;
    564   1.1  christos     M88*:*:R3*:*)
    565   1.1  christos 	# Delta 88k system running SVR3
    566   1.1  christos 	echo m88k-motorola-sysv3
    567   1.1  christos 	exit ;;
    568   1.1  christos     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
    569   1.1  christos 	echo m88k-tektronix-sysv3
    570   1.1  christos 	exit ;;
    571   1.1  christos     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
    572   1.1  christos 	echo m68k-tektronix-bsd
    573   1.1  christos 	exit ;;
    574   1.1  christos     *:IRIX*:*:*)
    575  1.11  christos 	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
    576   1.1  christos 	exit ;;
    577   1.1  christos     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
    578   1.1  christos 	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
    579   1.1  christos 	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
    580   1.1  christos     i*86:AIX:*:*)
    581   1.1  christos 	echo i386-ibm-aix
    582   1.1  christos 	exit ;;
    583   1.1  christos     ia64:AIX:*:*)
    584   1.1  christos 	if [ -x /usr/bin/oslevel ] ; then
    585   1.1  christos 		IBM_REV=`/usr/bin/oslevel`
    586   1.1  christos 	else
    587  1.11  christos 		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
    588   1.1  christos 	fi
    589  1.11  christos 	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
    590   1.1  christos 	exit ;;
    591   1.1  christos     *:AIX:2:3)
    592   1.1  christos 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
    593  1.11  christos 		set_cc_for_build
    594  1.11  christos 		sed 's/^		//' << EOF > "$dummy.c"
    595   1.1  christos 		#include <sys/systemcfg.h>
    596   1.1  christos 
    597   1.1  christos 		main()
    598   1.1  christos 			{
    599   1.1  christos 			if (!__power_pc())
    600   1.1  christos 				exit(1);
    601   1.1  christos 			puts("powerpc-ibm-aix3.2.5");
    602   1.1  christos 			exit(0);
    603   1.1  christos 			}
    604   1.1  christos EOF
    605  1.11  christos 		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
    606   1.1  christos 		then
    607   1.1  christos 			echo "$SYSTEM_NAME"
    608   1.1  christos 		else
    609   1.1  christos 			echo rs6000-ibm-aix3.2.5
    610   1.1  christos 		fi
    611   1.1  christos 	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
    612   1.1  christos 		echo rs6000-ibm-aix3.2.4
    613   1.1  christos 	else
    614   1.1  christos 		echo rs6000-ibm-aix3.2
    615   1.1  christos 	fi
    616   1.1  christos 	exit ;;
    617   1.1  christos     *:AIX:*:[4567])
    618   1.1  christos 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
    619  1.11  christos 	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
    620   1.1  christos 		IBM_ARCH=rs6000
    621   1.1  christos 	else
    622   1.1  christos 		IBM_ARCH=powerpc
    623   1.1  christos 	fi
    624   1.5  christos 	if [ -x /usr/bin/lslpp ] ; then
    625   1.5  christos 		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
    626   1.5  christos 			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
    627   1.1  christos 	else
    628  1.11  christos 		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
    629   1.1  christos 	fi
    630  1.11  christos 	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
    631   1.1  christos 	exit ;;
    632   1.1  christos     *:AIX:*:*)
    633   1.1  christos 	echo rs6000-ibm-aix
    634   1.1  christos 	exit ;;
    635  1.11  christos     ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
    636   1.1  christos 	echo romp-ibm-bsd4.4
    637   1.1  christos 	exit ;;
    638   1.1  christos     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    639  1.11  christos 	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
    640   1.1  christos 	exit ;;                             # report: romp-ibm BSD 4.3
    641   1.1  christos     *:BOSX:*:*)
    642   1.1  christos 	echo rs6000-bull-bosx
    643   1.1  christos 	exit ;;
    644   1.1  christos     DPX/2?00:B.O.S.:*:*)
    645   1.1  christos 	echo m68k-bull-sysv3
    646   1.1  christos 	exit ;;
    647   1.1  christos     9000/[34]??:4.3bsd:1.*:*)
    648   1.1  christos 	echo m68k-hp-bsd
    649   1.1  christos 	exit ;;
    650   1.1  christos     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
    651   1.1  christos 	echo m68k-hp-bsd4.4
    652   1.1  christos 	exit ;;
    653   1.1  christos     9000/[34678]??:HP-UX:*:*)
    654  1.11  christos 	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
    655  1.11  christos 	case "$UNAME_MACHINE" in
    656  1.11  christos 	    9000/31?)            HP_ARCH=m68000 ;;
    657  1.11  christos 	    9000/[34]??)         HP_ARCH=m68k ;;
    658   1.1  christos 	    9000/[678][0-9][0-9])
    659   1.1  christos 		if [ -x /usr/bin/getconf ]; then
    660   1.1  christos 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
    661   1.1  christos 		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
    662  1.11  christos 		    case "$sc_cpu_version" in
    663   1.7     skrll 		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
    664   1.7     skrll 		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
    665   1.1  christos 		      532)                      # CPU_PA_RISC2_0
    666  1.11  christos 			case "$sc_kernel_bits" in
    667   1.7     skrll 			  32) HP_ARCH=hppa2.0n ;;
    668   1.7     skrll 			  64) HP_ARCH=hppa2.0w ;;
    669   1.7     skrll 			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
    670   1.1  christos 			esac ;;
    671   1.1  christos 		    esac
    672   1.1  christos 		fi
    673  1.11  christos 		if [ "$HP_ARCH" = "" ]; then
    674  1.11  christos 		    set_cc_for_build
    675  1.11  christos 		    sed 's/^		//' << EOF > "$dummy.c"
    676   1.1  christos 
    677   1.1  christos 		#define _HPUX_SOURCE
    678   1.1  christos 		#include <stdlib.h>
    679   1.1  christos 		#include <unistd.h>
    680   1.1  christos 
    681   1.1  christos 		int main ()
    682   1.1  christos 		{
    683   1.1  christos 		#if defined(_SC_KERNEL_BITS)
    684   1.1  christos 		    long bits = sysconf(_SC_KERNEL_BITS);
    685   1.1  christos 		#endif
    686   1.1  christos 		    long cpu  = sysconf (_SC_CPU_VERSION);
    687   1.1  christos 
    688   1.1  christos 		    switch (cpu)
    689   1.1  christos 			{
    690   1.1  christos 			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
    691   1.1  christos 			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
    692   1.1  christos 			case CPU_PA_RISC2_0:
    693   1.1  christos 		#if defined(_SC_KERNEL_BITS)
    694   1.1  christos 			    switch (bits)
    695   1.1  christos 				{
    696   1.1  christos 				case 64: puts ("hppa2.0w"); break;
    697   1.1  christos 				case 32: puts ("hppa2.0n"); break;
    698   1.1  christos 				default: puts ("hppa2.0"); break;
    699   1.1  christos 				} break;
    700   1.1  christos 		#else  /* !defined(_SC_KERNEL_BITS) */
    701   1.1  christos 			    puts ("hppa2.0"); break;
    702   1.1  christos 		#endif
    703   1.1  christos 			default: puts ("hppa1.0"); break;
    704   1.1  christos 			}
    705   1.1  christos 		    exit (0);
    706   1.1  christos 		}
    707   1.1  christos EOF
    708  1.11  christos 		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
    709   1.1  christos 		    test -z "$HP_ARCH" && HP_ARCH=hppa
    710   1.1  christos 		fi ;;
    711   1.1  christos 	esac
    712  1.11  christos 	if [ "$HP_ARCH" = hppa2.0w ]
    713   1.1  christos 	then
    714  1.11  christos 	    set_cc_for_build
    715   1.1  christos 
    716   1.1  christos 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
    717   1.1  christos 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
    718   1.1  christos 	    # generating 64-bit code.  GNU and HP use different nomenclature:
    719   1.1  christos 	    #
    720   1.1  christos 	    # $ CC_FOR_BUILD=cc ./config.guess
    721   1.1  christos 	    # => hppa2.0w-hp-hpux11.23
    722   1.1  christos 	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
    723   1.1  christos 	    # => hppa64-hp-hpux11.23
    724   1.1  christos 
    725   1.7     skrll 	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
    726   1.1  christos 		grep -q __LP64__
    727   1.1  christos 	    then
    728   1.7     skrll 		HP_ARCH=hppa2.0w
    729   1.1  christos 	    else
    730   1.7     skrll 		HP_ARCH=hppa64
    731   1.1  christos 	    fi
    732   1.1  christos 	fi
    733  1.11  christos 	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
    734   1.1  christos 	exit ;;
    735   1.1  christos     ia64:HP-UX:*:*)
    736  1.11  christos 	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
    737  1.11  christos 	echo ia64-hp-hpux"$HPUX_REV"
    738   1.1  christos 	exit ;;
    739   1.1  christos     3050*:HI-UX:*:*)
    740  1.11  christos 	set_cc_for_build
    741  1.11  christos 	sed 's/^	//' << EOF > "$dummy.c"
    742   1.1  christos 	#include <unistd.h>
    743   1.1  christos 	int
    744   1.1  christos 	main ()
    745   1.1  christos 	{
    746   1.1  christos 	  long cpu = sysconf (_SC_CPU_VERSION);
    747   1.1  christos 	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
    748   1.1  christos 	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
    749   1.1  christos 	     results, however.  */
    750   1.1  christos 	  if (CPU_IS_PA_RISC (cpu))
    751   1.1  christos 	    {
    752   1.1  christos 	      switch (cpu)
    753   1.1  christos 		{
    754   1.1  christos 		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
    755   1.1  christos 		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
    756   1.1  christos 		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
    757   1.1  christos 		  default: puts ("hppa-hitachi-hiuxwe2"); break;
    758   1.1  christos 		}
    759   1.1  christos 	    }
    760   1.1  christos 	  else if (CPU_IS_HP_MC68K (cpu))
    761   1.1  christos 	    puts ("m68k-hitachi-hiuxwe2");
    762   1.1  christos 	  else puts ("unknown-hitachi-hiuxwe2");
    763   1.1  christos 	  exit (0);
    764   1.1  christos 	}
    765   1.1  christos EOF
    766  1.11  christos 	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
    767   1.1  christos 		{ echo "$SYSTEM_NAME"; exit; }
    768   1.1  christos 	echo unknown-hitachi-hiuxwe2
    769   1.1  christos 	exit ;;
    770  1.11  christos     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
    771   1.1  christos 	echo hppa1.1-hp-bsd
    772   1.1  christos 	exit ;;
    773   1.1  christos     9000/8??:4.3bsd:*:*)
    774   1.1  christos 	echo hppa1.0-hp-bsd
    775   1.1  christos 	exit ;;
    776   1.1  christos     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
    777   1.1  christos 	echo hppa1.0-hp-mpeix
    778   1.1  christos 	exit ;;
    779  1.11  christos     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
    780   1.1  christos 	echo hppa1.1-hp-osf
    781   1.1  christos 	exit ;;
    782   1.1  christos     hp8??:OSF1:*:*)
    783   1.1  christos 	echo hppa1.0-hp-osf
    784   1.1  christos 	exit ;;
    785   1.1  christos     i*86:OSF1:*:*)
    786   1.1  christos 	if [ -x /usr/sbin/sysversion ] ; then
    787  1.11  christos 	    echo "$UNAME_MACHINE"-unknown-osf1mk
    788   1.1  christos 	else
    789  1.11  christos 	    echo "$UNAME_MACHINE"-unknown-osf1
    790   1.1  christos 	fi
    791   1.1  christos 	exit ;;
    792   1.1  christos     parisc*:Lites*:*:*)
    793   1.1  christos 	echo hppa1.1-hp-lites
    794   1.1  christos 	exit ;;
    795   1.1  christos     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    796   1.1  christos 	echo c1-convex-bsd
    797   1.1  christos 	exit ;;
    798   1.1  christos     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    799   1.1  christos 	if getsysinfo -f scalar_acc
    800   1.1  christos 	then echo c32-convex-bsd
    801   1.1  christos 	else echo c2-convex-bsd
    802   1.1  christos 	fi
    803   1.1  christos 	exit ;;
    804   1.1  christos     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    805   1.1  christos 	echo c34-convex-bsd
    806   1.1  christos 	exit ;;
    807   1.1  christos     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    808   1.1  christos 	echo c38-convex-bsd
    809   1.1  christos 	exit ;;
    810   1.1  christos     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    811   1.1  christos 	echo c4-convex-bsd
    812   1.1  christos 	exit ;;
    813   1.1  christos     CRAY*Y-MP:*:*:*)
    814  1.11  christos 	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    815   1.1  christos 	exit ;;
    816   1.1  christos     CRAY*[A-Z]90:*:*:*)
    817  1.11  christos 	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
    818   1.1  christos 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
    819   1.1  christos 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
    820   1.1  christos 	      -e 's/\.[^.]*$/.X/'
    821   1.1  christos 	exit ;;
    822   1.1  christos     CRAY*TS:*:*:*)
    823  1.11  christos 	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    824   1.1  christos 	exit ;;
    825   1.1  christos     CRAY*T3E:*:*:*)
    826  1.11  christos 	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    827   1.1  christos 	exit ;;
    828   1.1  christos     CRAY*SV1:*:*:*)
    829  1.11  christos 	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    830   1.1  christos 	exit ;;
    831   1.1  christos     *:UNICOS/mp:*:*)
    832  1.11  christos 	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
    833   1.1  christos 	exit ;;
    834   1.1  christos     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    835   1.7     skrll 	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
    836   1.7     skrll 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
    837  1.11  christos 	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
    838   1.1  christos 	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    839   1.1  christos 	exit ;;
    840   1.1  christos     5000:UNIX_System_V:4.*:*)
    841   1.7     skrll 	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
    842  1.11  christos 	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
    843   1.1  christos 	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    844   1.1  christos 	exit ;;
    845   1.1  christos     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    846  1.11  christos 	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
    847   1.1  christos 	exit ;;
    848   1.1  christos     sparc*:BSD/OS:*:*)
    849  1.11  christos 	echo sparc-unknown-bsdi"$UNAME_RELEASE"
    850   1.1  christos 	exit ;;
    851   1.1  christos     *:BSD/OS:*:*)
    852  1.11  christos 	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
    853  1.11  christos 	exit ;;
    854  1.11  christos     arm:FreeBSD:*:*)
    855  1.11  christos 	UNAME_PROCESSOR=`uname -p`
    856  1.11  christos 	set_cc_for_build
    857  1.11  christos 	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
    858  1.11  christos 	    | grep -q __ARM_PCS_VFP
    859  1.11  christos 	then
    860  1.11  christos 	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
    861  1.11  christos 	else
    862  1.11  christos 	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
    863  1.11  christos 	fi
    864   1.1  christos 	exit ;;
    865   1.1  christos     *:FreeBSD:*:*)
    866   1.3  christos 	UNAME_PROCESSOR=`/usr/bin/uname -p`
    867  1.11  christos 	case "$UNAME_PROCESSOR" in
    868   1.1  christos 	    amd64)
    869  1.11  christos 		UNAME_PROCESSOR=x86_64 ;;
    870  1.10  christos 	    i386)
    871  1.10  christos 		UNAME_PROCESSOR=i586 ;;
    872   1.1  christos 	esac
    873  1.11  christos 	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
    874   1.1  christos 	exit ;;
    875   1.1  christos     i*:CYGWIN*:*)
    876  1.11  christos 	echo "$UNAME_MACHINE"-pc-cygwin
    877   1.1  christos 	exit ;;
    878   1.3  christos     *:MINGW64*:*)
    879  1.11  christos 	echo "$UNAME_MACHINE"-pc-mingw64
    880   1.3  christos 	exit ;;
    881   1.1  christos     *:MINGW*:*)
    882  1.11  christos 	echo "$UNAME_MACHINE"-pc-mingw32
    883   1.1  christos 	exit ;;
    884   1.5  christos     *:MSYS*:*)
    885  1.11  christos 	echo "$UNAME_MACHINE"-pc-msys
    886   1.1  christos 	exit ;;
    887   1.1  christos     i*:PW*:*)
    888  1.11  christos 	echo "$UNAME_MACHINE"-pc-pw32
    889   1.1  christos 	exit ;;
    890   1.1  christos     *:Interix*:*)
    891  1.11  christos 	case "$UNAME_MACHINE" in
    892   1.1  christos 	    x86)
    893  1.11  christos 		echo i586-pc-interix"$UNAME_RELEASE"
    894   1.1  christos 		exit ;;
    895   1.1  christos 	    authenticamd | genuineintel | EM64T)
    896  1.11  christos 		echo x86_64-unknown-interix"$UNAME_RELEASE"
    897   1.1  christos 		exit ;;
    898   1.1  christos 	    IA64)
    899  1.11  christos 		echo ia64-unknown-interix"$UNAME_RELEASE"
    900   1.1  christos 		exit ;;
    901   1.1  christos 	esac ;;
    902   1.1  christos     i*:UWIN*:*)
    903  1.11  christos 	echo "$UNAME_MACHINE"-pc-uwin
    904   1.1  christos 	exit ;;
    905   1.1  christos     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
    906  1.11  christos 	echo x86_64-pc-cygwin
    907   1.1  christos 	exit ;;
    908   1.1  christos     prep*:SunOS:5.*:*)
    909  1.11  christos 	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
    910   1.1  christos 	exit ;;
    911   1.1  christos     *:GNU:*:*)
    912   1.1  christos 	# the GNU system
    913  1.11  christos 	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
    914   1.1  christos 	exit ;;
    915   1.1  christos     *:GNU/*:*:*)
    916   1.1  christos 	# other systems with GNU libc and userland
    917  1.11  christos 	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
    918   1.1  christos 	exit ;;
    919  1.11  christos     *:Minix:*:*)
    920  1.11  christos 	echo "$UNAME_MACHINE"-unknown-minix
    921   1.1  christos 	exit ;;
    922   1.3  christos     aarch64:Linux:*:*)
    923  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    924   1.3  christos 	exit ;;
    925   1.3  christos     aarch64_be:Linux:*:*)
    926   1.3  christos 	UNAME_MACHINE=aarch64_be
    927  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    928   1.3  christos 	exit ;;
    929   1.1  christos     alpha:Linux:*:*)
    930  1.12  christos 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
    931   1.1  christos 	  EV5)   UNAME_MACHINE=alphaev5 ;;
    932   1.1  christos 	  EV56)  UNAME_MACHINE=alphaev56 ;;
    933   1.1  christos 	  PCA56) UNAME_MACHINE=alphapca56 ;;
    934   1.1  christos 	  PCA57) UNAME_MACHINE=alphapca56 ;;
    935   1.1  christos 	  EV6)   UNAME_MACHINE=alphaev6 ;;
    936   1.1  christos 	  EV67)  UNAME_MACHINE=alphaev67 ;;
    937   1.1  christos 	  EV68*) UNAME_MACHINE=alphaev68 ;;
    938   1.1  christos 	esac
    939   1.1  christos 	objdump --private-headers /bin/sh | grep -q ld.so.1
    940   1.7     skrll 	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
    941  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    942   1.4  christos 	exit ;;
    943   1.4  christos     arc:Linux:*:* | arceb:Linux:*:*)
    944  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    945   1.1  christos 	exit ;;
    946   1.1  christos     arm*:Linux:*:*)
    947  1.11  christos 	set_cc_for_build
    948   1.1  christos 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
    949   1.1  christos 	    | grep -q __ARM_EABI__
    950   1.1  christos 	then
    951  1.11  christos 	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    952   1.1  christos 	else
    953   1.3  christos 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
    954   1.3  christos 		| grep -q __ARM_PCS_VFP
    955   1.3  christos 	    then
    956  1.11  christos 		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
    957   1.3  christos 	    else
    958  1.11  christos 		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
    959   1.3  christos 	    fi
    960   1.1  christos 	fi
    961   1.1  christos 	exit ;;
    962   1.1  christos     avr32*:Linux:*:*)
    963  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    964   1.1  christos 	exit ;;
    965   1.1  christos     cris:Linux:*:*)
    966  1.11  christos 	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
    967   1.1  christos 	exit ;;
    968   1.1  christos     crisv32:Linux:*:*)
    969  1.11  christos 	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
    970   1.1  christos 	exit ;;
    971   1.6  christos     e2k:Linux:*:*)
    972  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    973   1.6  christos 	exit ;;
    974   1.1  christos     frv:Linux:*:*)
    975  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    976   1.3  christos 	exit ;;
    977   1.3  christos     hexagon:Linux:*:*)
    978  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    979   1.1  christos 	exit ;;
    980   1.1  christos     i*86:Linux:*:*)
    981  1.11  christos 	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
    982   1.1  christos 	exit ;;
    983   1.1  christos     ia64:Linux:*:*)
    984  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    985   1.1  christos 	exit ;;
    986   1.7     skrll     k1om:Linux:*:*)
    987  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    988   1.7     skrll 	exit ;;
    989   1.1  christos     m32r*:Linux:*:*)
    990  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    991   1.1  christos 	exit ;;
    992   1.1  christos     m68*:Linux:*:*)
    993  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
    994   1.1  christos 	exit ;;
    995   1.1  christos     mips:Linux:*:* | mips64:Linux:*:*)
    996  1.11  christos 	set_cc_for_build
    997  1.12  christos 	IS_GLIBC=0
    998  1.12  christos 	test x"${LIBC}" = xgnu && IS_GLIBC=1
    999  1.11  christos 	sed 's/^	//' << EOF > "$dummy.c"
   1000   1.1  christos 	#undef CPU
   1001  1.12  christos 	#undef mips
   1002  1.12  christos 	#undef mipsel
   1003  1.12  christos 	#undef mips64
   1004  1.12  christos 	#undef mips64el
   1005  1.12  christos 	#if ${IS_GLIBC} && defined(_ABI64)
   1006  1.12  christos 	LIBCABI=gnuabi64
   1007  1.12  christos 	#else
   1008  1.12  christos 	#if ${IS_GLIBC} && defined(_ABIN32)
   1009  1.12  christos 	LIBCABI=gnuabin32
   1010  1.12  christos 	#else
   1011  1.12  christos 	LIBCABI=${LIBC}
   1012  1.12  christos 	#endif
   1013  1.12  christos 	#endif
   1014  1.12  christos 
   1015  1.12  christos 	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
   1016  1.12  christos 	CPU=mipsisa64r6
   1017  1.12  christos 	#else
   1018  1.12  christos 	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
   1019  1.12  christos 	CPU=mipsisa32r6
   1020  1.12  christos 	#else
   1021  1.12  christos 	#if defined(__mips64)
   1022  1.12  christos 	CPU=mips64
   1023  1.12  christos 	#else
   1024  1.12  christos 	CPU=mips
   1025  1.12  christos 	#endif
   1026  1.12  christos 	#endif
   1027  1.12  christos 	#endif
   1028  1.12  christos 
   1029   1.1  christos 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
   1030  1.12  christos 	MIPS_ENDIAN=el
   1031   1.1  christos 	#else
   1032   1.1  christos 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
   1033  1.12  christos 	MIPS_ENDIAN=
   1034   1.1  christos 	#else
   1035  1.12  christos 	MIPS_ENDIAN=
   1036   1.1  christos 	#endif
   1037   1.1  christos 	#endif
   1038   1.1  christos EOF
   1039  1.12  christos 	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
   1040  1.12  christos 	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
   1041   1.1  christos 	;;
   1042   1.9     sevan     mips64el:Linux:*:*)
   1043  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   1044   1.9     sevan 	exit ;;
   1045   1.5  christos     openrisc*:Linux:*:*)
   1046  1.11  christos 	echo or1k-unknown-linux-"$LIBC"
   1047   1.4  christos 	exit ;;
   1048   1.5  christos     or32:Linux:*:* | or1k*:Linux:*:*)
   1049  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   1050   1.1  christos 	exit ;;
   1051   1.1  christos     padre:Linux:*:*)
   1052  1.11  christos 	echo sparc-unknown-linux-"$LIBC"
   1053   1.1  christos 	exit ;;
   1054   1.1  christos     parisc64:Linux:*:* | hppa64:Linux:*:*)
   1055  1.11  christos 	echo hppa64-unknown-linux-"$LIBC"
   1056   1.1  christos 	exit ;;
   1057   1.1  christos     parisc:Linux:*:* | hppa:Linux:*:*)
   1058   1.1  christos 	# Look for CPU level
   1059   1.1  christos 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
   1060  1.11  christos 	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
   1061  1.11  christos 	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
   1062  1.11  christos 	  *)    echo hppa-unknown-linux-"$LIBC" ;;
   1063   1.1  christos 	esac
   1064   1.1  christos 	exit ;;
   1065   1.1  christos     ppc64:Linux:*:*)
   1066  1.11  christos 	echo powerpc64-unknown-linux-"$LIBC"
   1067   1.1  christos 	exit ;;
   1068   1.1  christos     ppc:Linux:*:*)
   1069  1.11  christos 	echo powerpc-unknown-linux-"$LIBC"
   1070   1.4  christos 	exit ;;
   1071   1.4  christos     ppc64le:Linux:*:*)
   1072  1.11  christos 	echo powerpc64le-unknown-linux-"$LIBC"
   1073   1.4  christos 	exit ;;
   1074   1.4  christos     ppcle:Linux:*:*)
   1075  1.11  christos 	echo powerpcle-unknown-linux-"$LIBC"
   1076   1.1  christos 	exit ;;
   1077   1.9     sevan     riscv32:Linux:*:* | riscv64:Linux:*:*)
   1078  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   1079   1.9     sevan 	exit ;;
   1080   1.1  christos     s390:Linux:*:* | s390x:Linux:*:*)
   1081  1.11  christos 	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
   1082   1.1  christos 	exit ;;
   1083   1.1  christos     sh64*:Linux:*:*)
   1084  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   1085   1.1  christos 	exit ;;
   1086   1.1  christos     sh*:Linux:*:*)
   1087  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   1088   1.1  christos 	exit ;;
   1089   1.1  christos     sparc:Linux:*:* | sparc64:Linux:*:*)
   1090  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   1091   1.1  christos 	exit ;;
   1092   1.1  christos     tile*:Linux:*:*)
   1093  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   1094   1.1  christos 	exit ;;
   1095   1.1  christos     vax:Linux:*:*)
   1096  1.11  christos 	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
   1097   1.1  christos 	exit ;;
   1098   1.1  christos     x86_64:Linux:*:*)
   1099  1.11  christos 	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
   1100   1.1  christos 	exit ;;
   1101   1.1  christos     xtensa*:Linux:*:*)
   1102  1.11  christos 	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
   1103   1.1  christos 	exit ;;
   1104   1.1  christos     i*86:DYNIX/ptx:4*:*)
   1105   1.1  christos 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
   1106   1.1  christos 	# earlier versions are messed up and put the nodename in both
   1107   1.1  christos 	# sysname and nodename.
   1108   1.1  christos 	echo i386-sequent-sysv4
   1109   1.1  christos 	exit ;;
   1110   1.1  christos     i*86:UNIX_SV:4.2MP:2.*)
   1111   1.1  christos 	# Unixware is an offshoot of SVR4, but it has its own version
   1112   1.1  christos 	# number series starting with 2...
   1113   1.1  christos 	# I am not positive that other SVR4 systems won't match this,
   1114   1.1  christos 	# I just have to hope.  -- rms.
   1115   1.1  christos 	# Use sysv4.2uw... so that sysv4* matches it.
   1116  1.11  christos 	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
   1117   1.1  christos 	exit ;;
   1118   1.1  christos     i*86:OS/2:*:*)
   1119   1.1  christos 	# If we were able to find `uname', then EMX Unix compatibility
   1120   1.1  christos 	# is probably installed.
   1121  1.11  christos 	echo "$UNAME_MACHINE"-pc-os2-emx
   1122   1.1  christos 	exit ;;
   1123   1.1  christos     i*86:XTS-300:*:STOP)
   1124  1.11  christos 	echo "$UNAME_MACHINE"-unknown-stop
   1125   1.1  christos 	exit ;;
   1126   1.1  christos     i*86:atheos:*:*)
   1127  1.11  christos 	echo "$UNAME_MACHINE"-unknown-atheos
   1128   1.1  christos 	exit ;;
   1129   1.1  christos     i*86:syllable:*:*)
   1130  1.11  christos 	echo "$UNAME_MACHINE"-pc-syllable
   1131   1.1  christos 	exit ;;
   1132   1.1  christos     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
   1133  1.11  christos 	echo i386-unknown-lynxos"$UNAME_RELEASE"
   1134   1.1  christos 	exit ;;
   1135   1.1  christos     i*86:*DOS:*:*)
   1136  1.11  christos 	echo "$UNAME_MACHINE"-pc-msdosdjgpp
   1137   1.1  christos 	exit ;;
   1138  1.11  christos     i*86:*:4.*:*)
   1139  1.11  christos 	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
   1140   1.1  christos 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
   1141  1.11  christos 		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
   1142   1.1  christos 	else
   1143  1.11  christos 		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
   1144   1.1  christos 	fi
   1145   1.1  christos 	exit ;;
   1146   1.1  christos     i*86:*:5:[678]*)
   1147   1.1  christos 	# UnixWare 7.x, OpenUNIX and OpenServer 6.
   1148   1.1  christos 	case `/bin/uname -X | grep "^Machine"` in
   1149   1.1  christos 	    *486*)	     UNAME_MACHINE=i486 ;;
   1150   1.1  christos 	    *Pentium)	     UNAME_MACHINE=i586 ;;
   1151   1.1  christos 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
   1152   1.1  christos 	esac
   1153  1.12  christos 	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
   1154   1.1  christos 	exit ;;
   1155   1.1  christos     i*86:*:3.2:*)
   1156   1.1  christos 	if test -f /usr/options/cb.name; then
   1157   1.1  christos 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
   1158  1.11  christos 		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
   1159   1.1  christos 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
   1160   1.1  christos 		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
   1161   1.1  christos 		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
   1162   1.1  christos 		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
   1163   1.1  christos 			&& UNAME_MACHINE=i586
   1164   1.1  christos 		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
   1165   1.1  christos 			&& UNAME_MACHINE=i686
   1166   1.1  christos 		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
   1167   1.1  christos 			&& UNAME_MACHINE=i686
   1168  1.11  christos 		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
   1169   1.1  christos 	else
   1170  1.11  christos 		echo "$UNAME_MACHINE"-pc-sysv32
   1171   1.1  christos 	fi
   1172   1.1  christos 	exit ;;
   1173   1.1  christos     pc:*:*:*)
   1174   1.1  christos 	# Left here for compatibility:
   1175   1.1  christos 	# uname -m prints for DJGPP always 'pc', but it prints nothing about
   1176   1.1  christos 	# the processor, so we play safe by assuming i586.
   1177   1.1  christos 	# Note: whatever this is, it MUST be the same as what config.sub
   1178   1.7     skrll 	# prints for the "djgpp" host, or else GDB configure will decide that
   1179   1.1  christos 	# this is a cross-build.
   1180   1.1  christos 	echo i586-pc-msdosdjgpp
   1181   1.1  christos 	exit ;;
   1182   1.1  christos     Intel:Mach:3*:*)
   1183   1.1  christos 	echo i386-pc-mach3
   1184   1.1  christos 	exit ;;
   1185   1.1  christos     paragon:*:*:*)
   1186   1.1  christos 	echo i860-intel-osf1
   1187   1.1  christos 	exit ;;
   1188   1.1  christos     i860:*:4.*:*) # i860-SVR4
   1189   1.1  christos 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
   1190  1.11  christos 	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
   1191   1.1  christos 	else # Add other i860-SVR4 vendors below as they are discovered.
   1192  1.11  christos 	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
   1193   1.1  christos 	fi
   1194   1.1  christos 	exit ;;
   1195   1.1  christos     mini*:CTIX:SYS*5:*)
   1196   1.1  christos 	# "miniframe"
   1197   1.1  christos 	echo m68010-convergent-sysv
   1198   1.1  christos 	exit ;;
   1199   1.1  christos     mc68k:UNIX:SYSTEM5:3.51m)
   1200   1.1  christos 	echo m68k-convergent-sysv
   1201   1.1  christos 	exit ;;
   1202   1.1  christos     M680?0:D-NIX:5.3:*)
   1203   1.1  christos 	echo m68k-diab-dnix
   1204   1.1  christos 	exit ;;
   1205   1.1  christos     M68*:*:R3V[5678]*:*)
   1206   1.1  christos 	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
   1207   1.1  christos     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
   1208   1.1  christos 	OS_REL=''
   1209   1.1  christos 	test -r /etc/.relid \
   1210   1.1  christos 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
   1211   1.1  christos 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
   1212  1.11  christos 	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
   1213   1.1  christos 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
   1214  1.11  christos 	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
   1215   1.1  christos     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
   1216   1.1  christos 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
   1217   1.1  christos 	  && { echo i486-ncr-sysv4; exit; } ;;
   1218   1.1  christos     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
   1219   1.1  christos 	OS_REL='.3'
   1220   1.1  christos 	test -r /etc/.relid \
   1221   1.1  christos 	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
   1222   1.1  christos 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
   1223  1.11  christos 	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
   1224   1.1  christos 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
   1225  1.11  christos 	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
   1226   1.1  christos 	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
   1227  1.11  christos 	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
   1228   1.1  christos     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
   1229  1.11  christos 	echo m68k-unknown-lynxos"$UNAME_RELEASE"
   1230   1.1  christos 	exit ;;
   1231   1.1  christos     mc68030:UNIX_System_V:4.*:*)
   1232   1.1  christos 	echo m68k-atari-sysv4
   1233   1.1  christos 	exit ;;
   1234   1.1  christos     TSUNAMI:LynxOS:2.*:*)
   1235  1.11  christos 	echo sparc-unknown-lynxos"$UNAME_RELEASE"
   1236   1.1  christos 	exit ;;
   1237   1.1  christos     rs6000:LynxOS:2.*:*)
   1238  1.11  christos 	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
   1239   1.1  christos 	exit ;;
   1240   1.1  christos     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
   1241  1.11  christos 	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
   1242   1.1  christos 	exit ;;
   1243   1.1  christos     SM[BE]S:UNIX_SV:*:*)
   1244  1.11  christos 	echo mips-dde-sysv"$UNAME_RELEASE"
   1245   1.1  christos 	exit ;;
   1246   1.1  christos     RM*:ReliantUNIX-*:*:*)
   1247   1.1  christos 	echo mips-sni-sysv4
   1248   1.1  christos 	exit ;;
   1249   1.1  christos     RM*:SINIX-*:*:*)
   1250   1.1  christos 	echo mips-sni-sysv4
   1251   1.1  christos 	exit ;;
   1252   1.1  christos     *:SINIX-*:*:*)
   1253   1.1  christos 	if uname -p 2>/dev/null >/dev/null ; then
   1254   1.1  christos 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
   1255  1.11  christos 		echo "$UNAME_MACHINE"-sni-sysv4
   1256   1.1  christos 	else
   1257   1.1  christos 		echo ns32k-sni-sysv
   1258   1.1  christos 	fi
   1259   1.1  christos 	exit ;;
   1260   1.1  christos     PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
   1261   1.1  christos 			# says <Richard.M.Bartel (at] ccMail.Census.GOV>
   1262   1.1  christos 	echo i586-unisys-sysv4
   1263   1.1  christos 	exit ;;
   1264   1.1  christos     *:UNIX_System_V:4*:FTX*)
   1265   1.1  christos 	# From Gerald Hewes <hewes (at] openmarket.com>.
   1266   1.1  christos 	# How about differentiating between stratus architectures? -djm
   1267   1.1  christos 	echo hppa1.1-stratus-sysv4
   1268   1.1  christos 	exit ;;
   1269   1.1  christos     *:*:*:FTX*)
   1270   1.1  christos 	# From seanf (at] swdc.stratus.com.
   1271   1.1  christos 	echo i860-stratus-sysv4
   1272   1.1  christos 	exit ;;
   1273   1.1  christos     i*86:VOS:*:*)
   1274   1.1  christos 	# From Paul.Green (at] stratus.com.
   1275  1.11  christos 	echo "$UNAME_MACHINE"-stratus-vos
   1276   1.1  christos 	exit ;;
   1277   1.1  christos     *:VOS:*:*)
   1278   1.1  christos 	# From Paul.Green (at] stratus.com.
   1279   1.1  christos 	echo hppa1.1-stratus-vos
   1280   1.1  christos 	exit ;;
   1281   1.1  christos     mc68*:A/UX:*:*)
   1282  1.11  christos 	echo m68k-apple-aux"$UNAME_RELEASE"
   1283   1.1  christos 	exit ;;
   1284   1.1  christos     news*:NEWS-OS:6*:*)
   1285   1.1  christos 	echo mips-sony-newsos6
   1286   1.1  christos 	exit ;;
   1287   1.1  christos     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
   1288   1.1  christos 	if [ -d /usr/nec ]; then
   1289  1.11  christos 		echo mips-nec-sysv"$UNAME_RELEASE"
   1290   1.1  christos 	else
   1291  1.11  christos 		echo mips-unknown-sysv"$UNAME_RELEASE"
   1292   1.1  christos 	fi
   1293   1.1  christos 	exit ;;
   1294   1.1  christos     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
   1295   1.1  christos 	echo powerpc-be-beos
   1296   1.1  christos 	exit ;;
   1297   1.1  christos     BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
   1298   1.1  christos 	echo powerpc-apple-beos
   1299   1.1  christos 	exit ;;
   1300   1.1  christos     BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
   1301   1.1  christos 	echo i586-pc-beos
   1302   1.1  christos 	exit ;;
   1303   1.1  christos     BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
   1304   1.1  christos 	echo i586-pc-haiku
   1305   1.1  christos 	exit ;;
   1306   1.3  christos     x86_64:Haiku:*:*)
   1307   1.3  christos 	echo x86_64-unknown-haiku
   1308   1.3  christos 	exit ;;
   1309   1.1  christos     SX-4:SUPER-UX:*:*)
   1310  1.11  christos 	echo sx4-nec-superux"$UNAME_RELEASE"
   1311   1.1  christos 	exit ;;
   1312   1.1  christos     SX-5:SUPER-UX:*:*)
   1313  1.11  christos 	echo sx5-nec-superux"$UNAME_RELEASE"
   1314   1.1  christos 	exit ;;
   1315   1.1  christos     SX-6:SUPER-UX:*:*)
   1316  1.11  christos 	echo sx6-nec-superux"$UNAME_RELEASE"
   1317   1.1  christos 	exit ;;
   1318   1.1  christos     SX-7:SUPER-UX:*:*)
   1319  1.11  christos 	echo sx7-nec-superux"$UNAME_RELEASE"
   1320   1.1  christos 	exit ;;
   1321   1.1  christos     SX-8:SUPER-UX:*:*)
   1322  1.11  christos 	echo sx8-nec-superux"$UNAME_RELEASE"
   1323   1.1  christos 	exit ;;
   1324   1.1  christos     SX-8R:SUPER-UX:*:*)
   1325  1.11  christos 	echo sx8r-nec-superux"$UNAME_RELEASE"
   1326   1.1  christos 	exit ;;
   1327   1.7     skrll     SX-ACE:SUPER-UX:*:*)
   1328  1.11  christos 	echo sxace-nec-superux"$UNAME_RELEASE"
   1329   1.7     skrll 	exit ;;
   1330   1.1  christos     Power*:Rhapsody:*:*)
   1331  1.11  christos 	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
   1332   1.1  christos 	exit ;;
   1333   1.1  christos     *:Rhapsody:*:*)
   1334  1.11  christos 	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
   1335   1.1  christos 	exit ;;
   1336   1.1  christos     *:Darwin:*:*)
   1337  1.12  christos 	UNAME_PROCESSOR=`uname -p`
   1338  1.12  christos 	case $UNAME_PROCESSOR in
   1339  1.12  christos 	    unknown) UNAME_PROCESSOR=powerpc ;;
   1340  1.12  christos 	esac
   1341  1.12  christos 	if command -v xcode-select > /dev/null 2> /dev/null && \
   1342  1.12  christos 		! xcode-select --print-path > /dev/null 2> /dev/null ; then
   1343  1.12  christos 	    # Avoid executing cc if there is no toolchain installed as
   1344  1.12  christos 	    # cc will be a stub that puts up a graphical alert
   1345  1.12  christos 	    # prompting the user to install developer tools.
   1346  1.12  christos 	    CC_FOR_BUILD=no_compiler_found
   1347  1.12  christos 	else
   1348  1.12  christos 	    set_cc_for_build
   1349   1.4  christos 	fi
   1350  1.12  christos 	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
   1351  1.12  christos 	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
   1352  1.12  christos 		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
   1353  1.12  christos 		   grep IS_64BIT_ARCH >/dev/null
   1354  1.12  christos 	    then
   1355  1.12  christos 		case $UNAME_PROCESSOR in
   1356  1.12  christos 		    i386) UNAME_PROCESSOR=x86_64 ;;
   1357  1.12  christos 		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
   1358  1.12  christos 		esac
   1359  1.12  christos 	    fi
   1360  1.12  christos 	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
   1361  1.12  christos 	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
   1362  1.12  christos 		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
   1363  1.12  christos 		   grep IS_PPC >/dev/null
   1364  1.12  christos 	    then
   1365  1.12  christos 		UNAME_PROCESSOR=powerpc
   1366   1.4  christos 	    fi
   1367   1.5  christos 	elif test "$UNAME_PROCESSOR" = i386 ; then
   1368  1.12  christos 	    # uname -m returns i386 or x86_64
   1369  1.12  christos 	    UNAME_PROCESSOR=$UNAME_MACHINE
   1370   1.4  christos 	fi
   1371  1.11  christos 	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
   1372   1.1  christos 	exit ;;
   1373   1.1  christos     *:procnto*:*:* | *:QNX:[0123456789]*:*)
   1374   1.1  christos 	UNAME_PROCESSOR=`uname -p`
   1375   1.7     skrll 	if test "$UNAME_PROCESSOR" = x86; then
   1376   1.1  christos 		UNAME_PROCESSOR=i386
   1377   1.1  christos 		UNAME_MACHINE=pc
   1378   1.1  christos 	fi
   1379  1.11  christos 	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
   1380   1.1  christos 	exit ;;
   1381   1.1  christos     *:QNX:*:4*)
   1382   1.1  christos 	echo i386-pc-qnx
   1383   1.1  christos 	exit ;;
   1384  1.11  christos     NEO-*:NONSTOP_KERNEL:*:*)
   1385  1.11  christos 	echo neo-tandem-nsk"$UNAME_RELEASE"
   1386   1.1  christos 	exit ;;
   1387   1.3  christos     NSE-*:NONSTOP_KERNEL:*:*)
   1388  1.11  christos 	echo nse-tandem-nsk"$UNAME_RELEASE"
   1389  1.11  christos 	exit ;;
   1390  1.11  christos     NSR-*:NONSTOP_KERNEL:*:*)
   1391  1.11  christos 	echo nsr-tandem-nsk"$UNAME_RELEASE"
   1392   1.1  christos 	exit ;;
   1393  1.11  christos     NSV-*:NONSTOP_KERNEL:*:*)
   1394  1.11  christos 	echo nsv-tandem-nsk"$UNAME_RELEASE"
   1395   1.1  christos 	exit ;;
   1396  1.11  christos     NSX-*:NONSTOP_KERNEL:*:*)
   1397  1.11  christos 	echo nsx-tandem-nsk"$UNAME_RELEASE"
   1398  1.10  christos 	exit ;;
   1399   1.1  christos     *:NonStop-UX:*:*)
   1400   1.1  christos 	echo mips-compaq-nonstopux
   1401   1.1  christos 	exit ;;
   1402   1.1  christos     BS2000:POSIX*:*:*)
   1403   1.1  christos 	echo bs2000-siemens-sysv
   1404   1.1  christos 	exit ;;
   1405   1.1  christos     DS/*:UNIX_System_V:*:*)
   1406  1.11  christos 	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
   1407   1.1  christos 	exit ;;
   1408   1.1  christos     *:Plan9:*:*)
   1409   1.1  christos 	# "uname -m" is not consistent, so use $cputype instead. 386
   1410   1.1  christos 	# is converted to i386 for consistency with other x86
   1411   1.1  christos 	# operating systems.
   1412  1.11  christos 	# shellcheck disable=SC2154
   1413   1.7     skrll 	if test "$cputype" = 386; then
   1414   1.1  christos 	    UNAME_MACHINE=i386
   1415   1.1  christos 	else
   1416   1.1  christos 	    UNAME_MACHINE="$cputype"
   1417   1.1  christos 	fi
   1418  1.11  christos 	echo "$UNAME_MACHINE"-unknown-plan9
   1419   1.1  christos 	exit ;;
   1420   1.1  christos     *:TOPS-10:*:*)
   1421   1.1  christos 	echo pdp10-unknown-tops10
   1422   1.1  christos 	exit ;;
   1423   1.1  christos     *:TENEX:*:*)
   1424   1.1  christos 	echo pdp10-unknown-tenex
   1425   1.1  christos 	exit ;;
   1426   1.1  christos     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
   1427   1.1  christos 	echo pdp10-dec-tops20
   1428   1.1  christos 	exit ;;
   1429   1.1  christos     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
   1430   1.1  christos 	echo pdp10-xkl-tops20
   1431   1.1  christos 	exit ;;
   1432   1.1  christos     *:TOPS-20:*:*)
   1433   1.1  christos 	echo pdp10-unknown-tops20
   1434   1.1  christos 	exit ;;
   1435   1.1  christos     *:ITS:*:*)
   1436   1.1  christos 	echo pdp10-unknown-its
   1437   1.1  christos 	exit ;;
   1438   1.1  christos     SEI:*:*:SEIUX)
   1439  1.11  christos 	echo mips-sei-seiux"$UNAME_RELEASE"
   1440   1.1  christos 	exit ;;
   1441   1.1  christos     *:DragonFly:*:*)
   1442  1.11  christos 	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
   1443   1.1  christos 	exit ;;
   1444   1.1  christos     *:*VMS:*:*)
   1445   1.1  christos 	UNAME_MACHINE=`(uname -p) 2>/dev/null`
   1446  1.11  christos 	case "$UNAME_MACHINE" in
   1447   1.1  christos 	    A*) echo alpha-dec-vms ; exit ;;
   1448   1.1  christos 	    I*) echo ia64-dec-vms ; exit ;;
   1449   1.1  christos 	    V*) echo vax-dec-vms ; exit ;;
   1450   1.1  christos 	esac ;;
   1451   1.1  christos     *:XENIX:*:SysV)
   1452   1.1  christos 	echo i386-pc-xenix
   1453   1.1  christos 	exit ;;
   1454   1.1  christos     i*86:skyos:*:*)
   1455  1.11  christos 	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
   1456   1.1  christos 	exit ;;
   1457   1.1  christos     i*86:rdos:*:*)
   1458  1.11  christos 	echo "$UNAME_MACHINE"-pc-rdos
   1459   1.1  christos 	exit ;;
   1460   1.1  christos     i*86:AROS:*:*)
   1461  1.11  christos 	echo "$UNAME_MACHINE"-pc-aros
   1462   1.1  christos 	exit ;;
   1463   1.3  christos     x86_64:VMkernel:*:*)
   1464  1.11  christos 	echo "$UNAME_MACHINE"-unknown-esx
   1465   1.3  christos 	exit ;;
   1466   1.7     skrll     amd64:Isilon\ OneFS:*:*)
   1467   1.7     skrll 	echo x86_64-unknown-onefs
   1468   1.7     skrll 	exit ;;
   1469  1.11  christos     *:Unleashed:*:*)
   1470  1.11  christos 	echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
   1471  1.11  christos 	exit ;;
   1472  1.11  christos esac
   1473  1.11  christos 
   1474  1.12  christos # No uname command or uname output not recognized.
   1475  1.12  christos set_cc_for_build
   1476  1.12  christos cat > "$dummy.c" <<EOF
   1477  1.12  christos #ifdef _SEQUENT_
   1478  1.12  christos #include <sys/types.h>
   1479  1.12  christos #include <sys/utsname.h>
   1480  1.12  christos #endif
   1481  1.12  christos #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
   1482  1.12  christos #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
   1483  1.12  christos #include <signal.h>
   1484  1.12  christos #if defined(_SIZE_T_) || defined(SIGLOST)
   1485  1.12  christos #include <sys/utsname.h>
   1486  1.12  christos #endif
   1487  1.12  christos #endif
   1488  1.12  christos #endif
   1489  1.12  christos main ()
   1490  1.12  christos {
   1491  1.12  christos #if defined (sony)
   1492  1.12  christos #if defined (MIPSEB)
   1493  1.12  christos   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
   1494  1.12  christos      I don't know....  */
   1495  1.12  christos   printf ("mips-sony-bsd\n"); exit (0);
   1496  1.12  christos #else
   1497  1.12  christos #include <sys/param.h>
   1498  1.12  christos   printf ("m68k-sony-newsos%s\n",
   1499  1.12  christos #ifdef NEWSOS4
   1500  1.12  christos   "4"
   1501  1.12  christos #else
   1502  1.12  christos   ""
   1503  1.12  christos #endif
   1504  1.12  christos   ); exit (0);
   1505  1.12  christos #endif
   1506  1.12  christos #endif
   1507  1.12  christos 
   1508  1.12  christos #if defined (NeXT)
   1509  1.12  christos #if !defined (__ARCHITECTURE__)
   1510  1.12  christos #define __ARCHITECTURE__ "m68k"
   1511  1.12  christos #endif
   1512  1.12  christos   int version;
   1513  1.12  christos   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
   1514  1.12  christos   if (version < 4)
   1515  1.12  christos     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
   1516  1.12  christos   else
   1517  1.12  christos     printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
   1518  1.12  christos   exit (0);
   1519  1.12  christos #endif
   1520  1.12  christos 
   1521  1.12  christos #if defined (MULTIMAX) || defined (n16)
   1522  1.12  christos #if defined (UMAXV)
   1523  1.12  christos   printf ("ns32k-encore-sysv\n"); exit (0);
   1524  1.12  christos #else
   1525  1.12  christos #if defined (CMU)
   1526  1.12  christos   printf ("ns32k-encore-mach\n"); exit (0);
   1527  1.12  christos #else
   1528  1.12  christos   printf ("ns32k-encore-bsd\n"); exit (0);
   1529  1.12  christos #endif
   1530  1.12  christos #endif
   1531  1.12  christos #endif
   1532  1.12  christos 
   1533  1.12  christos #if defined (__386BSD__)
   1534  1.12  christos   printf ("i386-pc-bsd\n"); exit (0);
   1535  1.12  christos #endif
   1536  1.12  christos 
   1537  1.12  christos #if defined (sequent)
   1538  1.12  christos #if defined (i386)
   1539  1.12  christos   printf ("i386-sequent-dynix\n"); exit (0);
   1540  1.12  christos #endif
   1541  1.12  christos #if defined (ns32000)
   1542  1.12  christos   printf ("ns32k-sequent-dynix\n"); exit (0);
   1543  1.12  christos #endif
   1544  1.12  christos #endif
   1545  1.12  christos 
   1546  1.12  christos #if defined (_SEQUENT_)
   1547  1.12  christos   struct utsname un;
   1548  1.12  christos 
   1549  1.12  christos   uname(&un);
   1550  1.12  christos   if (strncmp(un.version, "V2", 2) == 0) {
   1551  1.12  christos     printf ("i386-sequent-ptx2\n"); exit (0);
   1552  1.12  christos   }
   1553  1.12  christos   if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
   1554  1.12  christos     printf ("i386-sequent-ptx1\n"); exit (0);
   1555  1.12  christos   }
   1556  1.12  christos   printf ("i386-sequent-ptx\n"); exit (0);
   1557  1.12  christos #endif
   1558  1.12  christos 
   1559  1.12  christos #if defined (vax)
   1560  1.12  christos #if !defined (ultrix)
   1561  1.12  christos #include <sys/param.h>
   1562  1.12  christos #if defined (BSD)
   1563  1.12  christos #if BSD == 43
   1564  1.12  christos   printf ("vax-dec-bsd4.3\n"); exit (0);
   1565  1.12  christos #else
   1566  1.12  christos #if BSD == 199006
   1567  1.12  christos   printf ("vax-dec-bsd4.3reno\n"); exit (0);
   1568  1.12  christos #else
   1569  1.12  christos   printf ("vax-dec-bsd\n"); exit (0);
   1570  1.12  christos #endif
   1571  1.12  christos #endif
   1572  1.12  christos #else
   1573  1.12  christos   printf ("vax-dec-bsd\n"); exit (0);
   1574  1.12  christos #endif
   1575  1.12  christos #else
   1576  1.12  christos #if defined(_SIZE_T_) || defined(SIGLOST)
   1577  1.12  christos   struct utsname un;
   1578  1.12  christos   uname (&un);
   1579  1.12  christos   printf ("vax-dec-ultrix%s\n", un.release); exit (0);
   1580  1.12  christos #else
   1581  1.12  christos   printf ("vax-dec-ultrix\n"); exit (0);
   1582  1.12  christos #endif
   1583  1.12  christos #endif
   1584  1.12  christos #endif
   1585  1.12  christos #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
   1586  1.12  christos #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
   1587  1.12  christos #if defined(_SIZE_T_) || defined(SIGLOST)
   1588  1.12  christos   struct utsname *un;
   1589  1.12  christos   uname (&un);
   1590  1.12  christos   printf ("mips-dec-ultrix%s\n", un.release); exit (0);
   1591  1.12  christos #else
   1592  1.12  christos   printf ("mips-dec-ultrix\n"); exit (0);
   1593  1.12  christos #endif
   1594  1.12  christos #endif
   1595  1.12  christos #endif
   1596  1.12  christos 
   1597  1.12  christos #if defined (alliant) && defined (i860)
   1598  1.12  christos   printf ("i860-alliant-bsd\n"); exit (0);
   1599  1.12  christos #endif
   1600  1.12  christos 
   1601  1.12  christos   exit (1);
   1602  1.12  christos }
   1603  1.12  christos EOF
   1604  1.12  christos 
   1605  1.12  christos $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
   1606  1.12  christos 	{ echo "$SYSTEM_NAME"; exit; }
   1607  1.12  christos 
   1608  1.12  christos # Apollos put the system type in the environment.
   1609  1.12  christos test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
   1610  1.12  christos 
   1611  1.11  christos echo "$0: unable to guess system type" >&2
   1612  1.11  christos 
   1613  1.11  christos case "$UNAME_MACHINE:$UNAME_SYSTEM" in
   1614  1.11  christos     mips:Linux | mips64:Linux)
   1615  1.11  christos 	# If we got here on MIPS GNU/Linux, output extra information.
   1616  1.11  christos 	cat >&2 <<EOF
   1617  1.11  christos 
   1618  1.11  christos NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
   1619  1.11  christos the system type. Please install a C compiler and try again.
   1620  1.11  christos EOF
   1621  1.11  christos 	;;
   1622   1.1  christos esac
   1623   1.1  christos 
   1624   1.1  christos cat >&2 <<EOF
   1625   1.1  christos 
   1626   1.9     sevan This script (version $timestamp), has failed to recognize the
   1627  1.11  christos operating system you are using. If your script is old, overwrite *all*
   1628  1.11  christos copies of config.guess and config.sub with the latest versions from:
   1629   1.1  christos 
   1630  1.11  christos   https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
   1631   1.1  christos and
   1632  1.11  christos   https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
   1633   1.1  christos 
   1634   1.9     sevan If $0 has already been updated, send the following data and any
   1635   1.9     sevan information you think might be pertinent to config-patches (at] gnu.org to
   1636   1.9     sevan provide the necessary information to handle your system.
   1637   1.1  christos 
   1638   1.1  christos config.guess timestamp = $timestamp
   1639   1.1  christos 
   1640   1.1  christos uname -m = `(uname -m) 2>/dev/null || echo unknown`
   1641   1.1  christos uname -r = `(uname -r) 2>/dev/null || echo unknown`
   1642   1.1  christos uname -s = `(uname -s) 2>/dev/null || echo unknown`
   1643   1.1  christos uname -v = `(uname -v) 2>/dev/null || echo unknown`
   1644   1.1  christos 
   1645   1.1  christos /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
   1646   1.1  christos /bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
   1647   1.1  christos 
   1648   1.1  christos hostinfo               = `(hostinfo) 2>/dev/null`
   1649   1.1  christos /bin/universe          = `(/bin/universe) 2>/dev/null`
   1650   1.1  christos /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
   1651   1.1  christos /bin/arch              = `(/bin/arch) 2>/dev/null`
   1652   1.1  christos /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
   1653   1.1  christos /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
   1654   1.1  christos 
   1655  1.11  christos UNAME_MACHINE = "$UNAME_MACHINE"
   1656  1.11  christos UNAME_RELEASE = "$UNAME_RELEASE"
   1657  1.11  christos UNAME_SYSTEM  = "$UNAME_SYSTEM"
   1658  1.11  christos UNAME_VERSION = "$UNAME_VERSION"
   1659   1.1  christos EOF
   1660   1.1  christos 
   1661   1.1  christos exit 1
   1662   1.1  christos 
   1663   1.1  christos # Local variables:
   1664  1.11  christos # eval: (add-hook 'before-save-hook 'time-stamp)
   1665   1.1  christos # time-stamp-start: "timestamp='"
   1666   1.1  christos # time-stamp-format: "%:y-%02m-%02d"
   1667   1.1  christos # time-stamp-end: "'"
   1668   1.1  christos # End:
   1669