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