18cf6c252SPaul Traina#! /bin/sh 28cf6c252SPaul Traina# Attempt to guess a canonical system name. 3*afdbf109SJoseph Mingrone# Copyright 1992-2024 Free Software Foundation, Inc. 4dc2c7305SBill Fenner 56f9cba8fSJoseph Mingrone# shellcheck disable=SC2006,SC2268 # see below for rationale 66f9cba8fSJoseph Mingrone 7*afdbf109SJoseph Mingronetimestamp='2024-01-01' 8dc2c7305SBill Fenner 98cf6c252SPaul Traina# This file is free software; you can redistribute it and/or modify it 108cf6c252SPaul Traina# under the terms of the GNU General Public License as published by 116f9cba8fSJoseph Mingrone# the Free Software Foundation, either version 3 of the License, or 128cf6c252SPaul Traina# (at your option) any later version. 138cf6c252SPaul Traina# 148cf6c252SPaul Traina# This program is distributed in the hope that it will be useful, but 158cf6c252SPaul Traina# WITHOUT ANY WARRANTY; without even the implied warranty of 168cf6c252SPaul Traina# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 178cf6c252SPaul Traina# General Public License for more details. 188cf6c252SPaul Traina# 198cf6c252SPaul Traina# You should have received a copy of the GNU General Public License 2057e22627SCy Schubert# along with this program; if not, see <https://www.gnu.org/licenses/>. 218cf6c252SPaul Traina# 228cf6c252SPaul Traina# As a special exception to the GNU General Public License, if you 238cf6c252SPaul Traina# distribute this file as part of a program that contains a 248cf6c252SPaul Traina# configuration script generated by Autoconf, you may include it under 25ada6f083SXin LI# the same distribution terms that you use for the rest of that 26ada6f083SXin LI# program. This Exception is an additional permission under section 7 27ada6f083SXin LI# of the GNU General Public License, version 3 ("GPLv3"). 288cf6c252SPaul Traina# 29ada6f083SXin LI# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 308cf6c252SPaul Traina# 31a0ee43a1SRui Paulo# You can get the latest version of this script from: 326f9cba8fSJoseph Mingrone# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 33ada6f083SXin LI# 34ada6f083SXin LI# Please send patches to <config-patches@gnu.org>. 35ada6f083SXin LI 368cf6c252SPaul Traina 376f9cba8fSJoseph Mingrone# The "shellcheck disable" line above the timestamp inhibits complaints 386f9cba8fSJoseph Mingrone# about features and limitations of the classic Bourne shell that were 396f9cba8fSJoseph Mingrone# superseded or lifted in POSIX. However, this script identifies a wide 406f9cba8fSJoseph Mingrone# variety of pre-POSIX systems that do not have POSIX shells at all, and 416f9cba8fSJoseph Mingrone# even some reasonably current systems (Solaris 10 as case-in-point) still 426f9cba8fSJoseph Mingrone# have a pre-POSIX /bin/sh. 436f9cba8fSJoseph Mingrone 446f9cba8fSJoseph Mingrone 45dc2c7305SBill Fennerme=`echo "$0" | sed -e 's,.*/,,'` 46dc2c7305SBill Fenner 47dc2c7305SBill Fennerusage="\ 48dc2c7305SBill FennerUsage: $0 [OPTION] 49dc2c7305SBill Fenner 50*afdbf109SJoseph MingroneOutput the configuration name of the system '$me' is run on. 51dc2c7305SBill Fenner 5257e22627SCy SchubertOptions: 53dc2c7305SBill Fenner -h, --help print this help, then exit 54dc2c7305SBill Fenner -t, --time-stamp print date of last modification, then exit 55dc2c7305SBill Fenner -v, --version print version number, then exit 56dc2c7305SBill Fenner 57dc2c7305SBill FennerReport bugs and patches to <config-patches@gnu.org>." 58dc2c7305SBill Fenner 59dc2c7305SBill Fennerversion="\ 60dc2c7305SBill FennerGNU config.guess ($timestamp) 61dc2c7305SBill Fenner 62dc2c7305SBill FennerOriginally written by Per Bothner. 63*afdbf109SJoseph MingroneCopyright 1992-2024 Free Software Foundation, Inc. 64dc2c7305SBill Fenner 65dc2c7305SBill FennerThis is free software; see the source for copying conditions. There is NO 66dc2c7305SBill Fennerwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 67dc2c7305SBill Fenner 68dc2c7305SBill Fennerhelp=" 69*afdbf109SJoseph MingroneTry '$me --help' for more information." 70dc2c7305SBill Fenner 71dc2c7305SBill Fenner# Parse command line 72dc2c7305SBill Fennerwhile test $# -gt 0 ; do 73dc2c7305SBill Fenner case $1 in 74dc2c7305SBill Fenner --time-stamp | --time* | -t ) 75a0ee43a1SRui Paulo echo "$timestamp" ; exit ;; 76dc2c7305SBill Fenner --version | -v ) 77a0ee43a1SRui Paulo echo "$version" ; exit ;; 78dc2c7305SBill Fenner --help | --h* | -h ) 79a0ee43a1SRui Paulo echo "$usage"; exit ;; 80dc2c7305SBill Fenner -- ) # Stop option processing 81dc2c7305SBill Fenner shift; break ;; 82dc2c7305SBill Fenner - ) # Use stdin as input. 83dc2c7305SBill Fenner break ;; 84dc2c7305SBill Fenner -* ) 85dc2c7305SBill Fenner echo "$me: invalid option $1$help" >&2 86dc2c7305SBill Fenner exit 1 ;; 87dc2c7305SBill Fenner * ) 88dc2c7305SBill Fenner break ;; 89dc2c7305SBill Fenner esac 90dc2c7305SBill Fennerdone 91dc2c7305SBill Fenner 92dc2c7305SBill Fennerif test $# != 0; then 93dc2c7305SBill Fenner echo "$me: too many arguments$help" >&2 94dc2c7305SBill Fenner exit 1 95dc2c7305SBill Fennerfi 96dc2c7305SBill Fenner 976f9cba8fSJoseph Mingrone# Just in case it came from the environment. 986f9cba8fSJoseph MingroneGUESS= 99dc2c7305SBill Fenner 100feb4ecdbSBruce M Simpson# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 101feb4ecdbSBruce M Simpson# compiler to aid in system detection is discouraged as it requires 102feb4ecdbSBruce M Simpson# temporary files to be created and, as you can see below, it is a 103feb4ecdbSBruce M Simpson# headache to deal with in a portable fashion. 104dc2c7305SBill Fenner 105*afdbf109SJoseph Mingrone# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still 106*afdbf109SJoseph Mingrone# use 'HOST_CC' if defined, but it is deprecated. 107dc2c7305SBill Fenner 108feb4ecdbSBruce M Simpson# Portable tmp directory creation inspired by the Autoconf team. 109feb4ecdbSBruce M Simpson 1106f9cba8fSJoseph Mingronetmp= 1116f9cba8fSJoseph Mingrone# shellcheck disable=SC2172 1126f9cba8fSJoseph Mingronetrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 1136f9cba8fSJoseph Mingrone 1146f9cba8fSJoseph Mingroneset_cc_for_build() { 1156f9cba8fSJoseph Mingrone # prevent multiple calls if $tmp is already set 1166f9cba8fSJoseph Mingrone test "$tmp" && return 0 1176f9cba8fSJoseph Mingrone : "${TMPDIR=/tmp}" 1186f9cba8fSJoseph Mingrone # shellcheck disable=SC2039,SC3028 119a0ee43a1SRui Paulo { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 1206f9cba8fSJoseph Mingrone { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || 1216f9cba8fSJoseph Mingrone { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || 1226f9cba8fSJoseph Mingrone { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } 1236f9cba8fSJoseph Mingrone dummy=$tmp/dummy 12457e22627SCy Schubert case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in 1256f9cba8fSJoseph Mingrone ,,) echo "int x;" > "$dummy.c" 1266f9cba8fSJoseph Mingrone for driver in cc gcc c89 c99 ; do 1276f9cba8fSJoseph Mingrone if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then 1286f9cba8fSJoseph Mingrone CC_FOR_BUILD=$driver 1296f9cba8fSJoseph Mingrone break 1306f9cba8fSJoseph Mingrone fi 1316f9cba8fSJoseph Mingrone done 132dc2c7305SBill Fenner if test x"$CC_FOR_BUILD" = x ; then 1336f9cba8fSJoseph Mingrone CC_FOR_BUILD=no_compiler_found 134dc2c7305SBill Fenner fi 135dc2c7305SBill Fenner ;; 136dc2c7305SBill Fenner ,,*) CC_FOR_BUILD=$CC ;; 137dc2c7305SBill Fenner ,*,*) CC_FOR_BUILD=$HOST_CC ;; 1386f9cba8fSJoseph Mingrone esac 1396f9cba8fSJoseph Mingrone} 140dc2c7305SBill Fenner 1418cf6c252SPaul Traina# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 142feb4ecdbSBruce M Simpson# (ghazi@noc.rutgers.edu 1994-08-24) 1436f9cba8fSJoseph Mingroneif test -f /.attbin/uname ; then 1448cf6c252SPaul Traina PATH=$PATH:/.attbin ; export PATH 1458cf6c252SPaul Trainafi 1468cf6c252SPaul Traina 1478cf6c252SPaul TrainaUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 1488cf6c252SPaul TrainaUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 1498cf6c252SPaul TrainaUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 1508cf6c252SPaul TrainaUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 1518cf6c252SPaul Traina 1526f9cba8fSJoseph Mingronecase $UNAME_SYSTEM in 153ada6f083SXin LILinux|GNU|GNU/*) 1546f9cba8fSJoseph Mingrone LIBC=unknown 155ada6f083SXin LI 1566f9cba8fSJoseph Mingrone set_cc_for_build 15757e22627SCy Schubert cat <<-EOF > "$dummy.c" 158*afdbf109SJoseph Mingrone #if defined(__ANDROID__) 159*afdbf109SJoseph Mingrone LIBC=android 160*afdbf109SJoseph Mingrone #else 161ada6f083SXin LI #include <features.h> 162ada6f083SXin LI #if defined(__UCLIBC__) 163ada6f083SXin LI LIBC=uclibc 164ada6f083SXin LI #elif defined(__dietlibc__) 165ada6f083SXin LI LIBC=dietlibc 1666f9cba8fSJoseph Mingrone #elif defined(__GLIBC__) 167ada6f083SXin LI LIBC=gnu 168*afdbf109SJoseph Mingrone #elif defined(__LLVM_LIBC__) 169*afdbf109SJoseph Mingrone LIBC=llvm 1706f9cba8fSJoseph Mingrone #else 1716f9cba8fSJoseph Mingrone #include <stdarg.h> 1726f9cba8fSJoseph Mingrone /* First heuristic to detect musl libc. */ 1736f9cba8fSJoseph Mingrone #ifdef __DEFINED_va_list 1746f9cba8fSJoseph Mingrone LIBC=musl 1756f9cba8fSJoseph Mingrone #endif 176ada6f083SXin LI #endif 177*afdbf109SJoseph Mingrone #endif 178ada6f083SXin LI EOF 1796f9cba8fSJoseph Mingrone cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` 1806f9cba8fSJoseph Mingrone eval "$cc_set_libc" 18157e22627SCy Schubert 1826f9cba8fSJoseph Mingrone # Second heuristic to detect musl libc. 1836f9cba8fSJoseph Mingrone if [ "$LIBC" = unknown ] && 1846f9cba8fSJoseph Mingrone command -v ldd >/dev/null && 1856f9cba8fSJoseph Mingrone ldd --version 2>&1 | grep -q ^musl; then 18657e22627SCy Schubert LIBC=musl 18757e22627SCy Schubert fi 1886f9cba8fSJoseph Mingrone 1896f9cba8fSJoseph Mingrone # If the system lacks a compiler, then just pick glibc. 1906f9cba8fSJoseph Mingrone # We could probably try harder. 1916f9cba8fSJoseph Mingrone if [ "$LIBC" = unknown ]; then 1926f9cba8fSJoseph Mingrone LIBC=gnu 1936f9cba8fSJoseph Mingrone fi 194ada6f083SXin LI ;; 195ada6f083SXin LIesac 196ada6f083SXin LI 1978cf6c252SPaul Traina# Note: order is significant - the case branches are not exclusive. 1988cf6c252SPaul Traina 1996f9cba8fSJoseph Mingronecase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in 200dc2c7305SBill Fenner *:NetBSD:*:*) 201feb4ecdbSBruce M Simpson # NetBSD (nbsd) targets should (where applicable) match one or 202681ed54cSXin LI # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 203dc2c7305SBill Fenner # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 204dc2c7305SBill Fenner # switched to ELF, *-*-netbsd* would select the old 205dc2c7305SBill Fenner # object file format. This provides both forward 206dc2c7305SBill Fenner # compatibility and a consistent mechanism for selecting the 207dc2c7305SBill Fenner # object file format. 208feb4ecdbSBruce M Simpson # 209feb4ecdbSBruce M Simpson # Note: NetBSD doesn't particularly care about the vendor 210feb4ecdbSBruce M Simpson # portion of the name. We always set it to "unknown". 211ada6f083SXin LI UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ 2126f9cba8fSJoseph Mingrone /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 2136f9cba8fSJoseph Mingrone /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 214ada6f083SXin LI echo unknown)` 2156f9cba8fSJoseph Mingrone case $UNAME_MACHINE_ARCH in 2166f9cba8fSJoseph Mingrone aarch64eb) machine=aarch64_be-unknown ;; 217feb4ecdbSBruce M Simpson armeb) machine=armeb-unknown ;; 218feb4ecdbSBruce M Simpson arm*) machine=arm-unknown ;; 219feb4ecdbSBruce M Simpson sh3el) machine=shl-unknown ;; 220feb4ecdbSBruce M Simpson sh3eb) machine=sh-unknown ;; 221a0ee43a1SRui Paulo sh5el) machine=sh5le-unknown ;; 222ada6f083SXin LI earmv*) 22357e22627SCy Schubert arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` 22457e22627SCy Schubert endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` 2256f9cba8fSJoseph Mingrone machine=${arch}${endian}-unknown 226ada6f083SXin LI ;; 2276f9cba8fSJoseph Mingrone *) machine=$UNAME_MACHINE_ARCH-unknown ;; 228dc2c7305SBill Fenner esac 229dc2c7305SBill Fenner # The Operating System including object format, if it has switched 23057e22627SCy Schubert # to ELF recently (or will in the future) and ABI. 2316f9cba8fSJoseph Mingrone case $UNAME_MACHINE_ARCH in 23257e22627SCy Schubert earm*) 23357e22627SCy Schubert os=netbsdelf 23457e22627SCy Schubert ;; 23557e22627SCy Schubert arm*|i386|m68k|ns32k|sh3*|sparc|vax) 2366f9cba8fSJoseph Mingrone set_cc_for_build 237dc2c7305SBill Fenner if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 238a0ee43a1SRui Paulo | grep -q __ELF__ 239dc2c7305SBill Fenner then 240dc2c7305SBill Fenner # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 241dc2c7305SBill Fenner # Return netbsd for either. FIX? 242dc2c7305SBill Fenner os=netbsd 243dc2c7305SBill Fenner else 244dc2c7305SBill Fenner os=netbsdelf 245dc2c7305SBill Fenner fi 246dc2c7305SBill Fenner ;; 247dc2c7305SBill Fenner *) 248dc2c7305SBill Fenner os=netbsd 249dc2c7305SBill Fenner ;; 250dc2c7305SBill Fenner esac 251ada6f083SXin LI # Determine ABI tags. 2526f9cba8fSJoseph Mingrone case $UNAME_MACHINE_ARCH in 253ada6f083SXin LI earm*) 254ada6f083SXin LI expr='s/^earmv[0-9]/-eabi/;s/eb$//' 25557e22627SCy Schubert abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` 256ada6f083SXin LI ;; 257ada6f083SXin LI esac 258dc2c7305SBill Fenner # The OS release 259feb4ecdbSBruce M Simpson # Debian GNU/NetBSD machines have a different userland, and 260feb4ecdbSBruce M Simpson # thus, need a distinct triplet. However, they do not need 261feb4ecdbSBruce M Simpson # kernel version information, so it can be replaced with a 262feb4ecdbSBruce M Simpson # suitable tag, in the style of linux-gnu. 2636f9cba8fSJoseph Mingrone case $UNAME_VERSION in 264feb4ecdbSBruce M Simpson Debian*) 265feb4ecdbSBruce M Simpson release='-gnu' 266feb4ecdbSBruce M Simpson ;; 267feb4ecdbSBruce M Simpson *) 26857e22627SCy Schubert release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` 269feb4ecdbSBruce M Simpson ;; 270feb4ecdbSBruce M Simpson esac 271dc2c7305SBill Fenner # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 272dc2c7305SBill Fenner # contains redundant information, the shorter form: 273dc2c7305SBill Fenner # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 2746f9cba8fSJoseph Mingrone GUESS=$machine-${os}${release}${abi-} 2756f9cba8fSJoseph Mingrone ;; 276ada6f083SXin LI *:Bitrig:*:*) 277ada6f083SXin LI UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 2786f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE 2796f9cba8fSJoseph Mingrone ;; 280feb4ecdbSBruce M Simpson *:OpenBSD:*:*) 281a0ee43a1SRui Paulo UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 2826f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE 2836f9cba8fSJoseph Mingrone ;; 2846f9cba8fSJoseph Mingrone *:SecBSD:*:*) 2856f9cba8fSJoseph Mingrone UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` 2866f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE 2876f9cba8fSJoseph Mingrone ;; 28857e22627SCy Schubert *:LibertyBSD:*:*) 28957e22627SCy Schubert UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` 2906f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE 2916f9cba8fSJoseph Mingrone ;; 29257e22627SCy Schubert *:MidnightBSD:*:*) 2936f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE 2946f9cba8fSJoseph Mingrone ;; 295a0ee43a1SRui Paulo *:ekkoBSD:*:*) 2966f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE 2976f9cba8fSJoseph Mingrone ;; 298a0ee43a1SRui Paulo *:SolidBSD:*:*) 2996f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE 3006f9cba8fSJoseph Mingrone ;; 3016f9cba8fSJoseph Mingrone *:OS108:*:*) 3026f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE 3036f9cba8fSJoseph Mingrone ;; 304a0ee43a1SRui Paulo macppc:MirBSD:*:*) 3056f9cba8fSJoseph Mingrone GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE 3066f9cba8fSJoseph Mingrone ;; 307a0ee43a1SRui Paulo *:MirBSD:*:*) 3086f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE 3096f9cba8fSJoseph Mingrone ;; 31057e22627SCy Schubert *:Sortix:*:*) 3116f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-sortix 3126f9cba8fSJoseph Mingrone ;; 3136f9cba8fSJoseph Mingrone *:Twizzler:*:*) 3146f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-twizzler 3156f9cba8fSJoseph Mingrone ;; 31657e22627SCy Schubert *:Redox:*:*) 3176f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-redox 3186f9cba8fSJoseph Mingrone ;; 31957e22627SCy Schubert mips:OSF1:*.*) 3206f9cba8fSJoseph Mingrone GUESS=mips-dec-osf1 3216f9cba8fSJoseph Mingrone ;; 3228cf6c252SPaul Traina alpha:OSF1:*:*) 3236f9cba8fSJoseph Mingrone # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 3246f9cba8fSJoseph Mingrone trap '' 0 325a0ee43a1SRui Paulo case $UNAME_RELEASE in 326a0ee43a1SRui Paulo *4.0) 327dc2c7305SBill Fenner UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 328a0ee43a1SRui Paulo ;; 329a0ee43a1SRui Paulo *5.*) 330a0ee43a1SRui Paulo UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 331a0ee43a1SRui Paulo ;; 332a0ee43a1SRui Paulo esac 333feb4ecdbSBruce M Simpson # According to Compaq, /usr/sbin/psrinfo has been available on 334feb4ecdbSBruce M Simpson # OSF/1 and Tru64 systems produced since 1995. I hope that 335feb4ecdbSBruce M Simpson # covers most systems running today. This code pipes the CPU 336feb4ecdbSBruce M Simpson # types through head -n 1, so we only detect the type of CPU 0. 337feb4ecdbSBruce M Simpson ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 3386f9cba8fSJoseph Mingrone case $ALPHA_CPU_TYPE in 339feb4ecdbSBruce M Simpson "EV4 (21064)") 34057e22627SCy Schubert UNAME_MACHINE=alpha ;; 341feb4ecdbSBruce M Simpson "EV4.5 (21064)") 34257e22627SCy Schubert UNAME_MACHINE=alpha ;; 343feb4ecdbSBruce M Simpson "LCA4 (21066/21068)") 34457e22627SCy Schubert UNAME_MACHINE=alpha ;; 345feb4ecdbSBruce M Simpson "EV5 (21164)") 34657e22627SCy Schubert UNAME_MACHINE=alphaev5 ;; 347feb4ecdbSBruce M Simpson "EV5.6 (21164A)") 34857e22627SCy Schubert UNAME_MACHINE=alphaev56 ;; 349feb4ecdbSBruce M Simpson "EV5.6 (21164PC)") 35057e22627SCy Schubert UNAME_MACHINE=alphapca56 ;; 351feb4ecdbSBruce M Simpson "EV5.7 (21164PC)") 35257e22627SCy Schubert UNAME_MACHINE=alphapca57 ;; 353feb4ecdbSBruce M Simpson "EV6 (21264)") 35457e22627SCy Schubert UNAME_MACHINE=alphaev6 ;; 355feb4ecdbSBruce M Simpson "EV6.7 (21264A)") 35657e22627SCy Schubert UNAME_MACHINE=alphaev67 ;; 357feb4ecdbSBruce M Simpson "EV6.8CB (21264C)") 35857e22627SCy Schubert UNAME_MACHINE=alphaev68 ;; 359feb4ecdbSBruce M Simpson "EV6.8AL (21264B)") 36057e22627SCy Schubert UNAME_MACHINE=alphaev68 ;; 361feb4ecdbSBruce M Simpson "EV6.8CX (21264D)") 36257e22627SCy Schubert UNAME_MACHINE=alphaev68 ;; 363feb4ecdbSBruce M Simpson "EV6.9A (21264/EV69A)") 36457e22627SCy Schubert UNAME_MACHINE=alphaev69 ;; 365feb4ecdbSBruce M Simpson "EV7 (21364)") 36657e22627SCy Schubert UNAME_MACHINE=alphaev7 ;; 367feb4ecdbSBruce M Simpson "EV7.9 (21364A)") 36857e22627SCy Schubert UNAME_MACHINE=alphaev79 ;; 369feb4ecdbSBruce M Simpson esac 370a0ee43a1SRui Paulo # A Pn.n version is a patched version. 3718cf6c252SPaul Traina # A Vn.n version is a released version. 3728cf6c252SPaul Traina # A Tn.n version is a released field test version. 3738cf6c252SPaul Traina # A Xn.n version is an unreleased experimental baselevel. 3748cf6c252SPaul Traina # 1.2 uses "1.2" for uname -r. 3756f9cba8fSJoseph Mingrone OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 3766f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-dec-osf$OSF_REL 3776f9cba8fSJoseph Mingrone ;; 3788cf6c252SPaul Traina Amiga*:UNIX_System_V:4.0:*) 3796f9cba8fSJoseph Mingrone GUESS=m68k-unknown-sysv4 3806f9cba8fSJoseph Mingrone ;; 381dc2c7305SBill Fenner *:[Aa]miga[Oo][Ss]:*:*) 3826f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-amigaos 3836f9cba8fSJoseph Mingrone ;; 384feb4ecdbSBruce M Simpson *:[Mm]orph[Oo][Ss]:*:*) 3856f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-morphos 3866f9cba8fSJoseph Mingrone ;; 387dc2c7305SBill Fenner *:OS/390:*:*) 3886f9cba8fSJoseph Mingrone GUESS=i370-ibm-openedition 3896f9cba8fSJoseph Mingrone ;; 390a0ee43a1SRui Paulo *:z/VM:*:*) 3916f9cba8fSJoseph Mingrone GUESS=s390-ibm-zvmoe 3926f9cba8fSJoseph Mingrone ;; 393feb4ecdbSBruce M Simpson *:OS400:*:*) 3946f9cba8fSJoseph Mingrone GUESS=powerpc-ibm-os400 3956f9cba8fSJoseph Mingrone ;; 3968cf6c252SPaul Traina arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 3976f9cba8fSJoseph Mingrone GUESS=arm-acorn-riscix$UNAME_RELEASE 3986f9cba8fSJoseph Mingrone ;; 399ada6f083SXin LI arm*:riscos:*:*|arm*:RISCOS:*:*) 4006f9cba8fSJoseph Mingrone GUESS=arm-unknown-riscos 4016f9cba8fSJoseph Mingrone ;; 4020a94d38fSBill Fenner SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 4036f9cba8fSJoseph Mingrone GUESS=hppa1.1-hitachi-hiuxmpp 4046f9cba8fSJoseph Mingrone ;; 405dc2c7305SBill Fenner Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 4063052b236SBill Fenner # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 4076f9cba8fSJoseph Mingrone case `(/bin/universe) 2>/dev/null` in 4086f9cba8fSJoseph Mingrone att) GUESS=pyramid-pyramid-sysv3 ;; 4096f9cba8fSJoseph Mingrone *) GUESS=pyramid-pyramid-bsd ;; 4106f9cba8fSJoseph Mingrone esac 4116f9cba8fSJoseph Mingrone ;; 412dc2c7305SBill Fenner NILE*:*:*:dcosx) 4136f9cba8fSJoseph Mingrone GUESS=pyramid-pyramid-svr4 4146f9cba8fSJoseph Mingrone ;; 415feb4ecdbSBruce M Simpson DRS?6000:unix:4.0:6*) 4166f9cba8fSJoseph Mingrone GUESS=sparc-icl-nx6 4176f9cba8fSJoseph Mingrone ;; 418a0ee43a1SRui Paulo DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 419feb4ecdbSBruce M Simpson case `/usr/bin/uname -p` in 4206f9cba8fSJoseph Mingrone sparc) GUESS=sparc-icl-nx7 ;; 4216f9cba8fSJoseph Mingrone esac 4226f9cba8fSJoseph Mingrone ;; 423a0ee43a1SRui Paulo s390x:SunOS:*:*) 4246f9cba8fSJoseph Mingrone SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 4256f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL 4266f9cba8fSJoseph Mingrone ;; 427dc2c7305SBill Fenner sun4H:SunOS:5.*:*) 4286f9cba8fSJoseph Mingrone SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 4296f9cba8fSJoseph Mingrone GUESS=sparc-hal-solaris2$SUN_REL 4306f9cba8fSJoseph Mingrone ;; 4313052b236SBill Fenner sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 4326f9cba8fSJoseph Mingrone SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 4336f9cba8fSJoseph Mingrone GUESS=sparc-sun-solaris2$SUN_REL 4346f9cba8fSJoseph Mingrone ;; 435a0ee43a1SRui Paulo i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 4366f9cba8fSJoseph Mingrone GUESS=i386-pc-auroraux$UNAME_RELEASE 4376f9cba8fSJoseph Mingrone ;; 438a0ee43a1SRui Paulo i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 4396f9cba8fSJoseph Mingrone set_cc_for_build 44057e22627SCy Schubert SUN_ARCH=i386 441a0ee43a1SRui Paulo # If there is a compiler, see if it is configured for 64-bit objects. 442a0ee43a1SRui Paulo # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 443a0ee43a1SRui Paulo # This test works for both compilers. 4446f9cba8fSJoseph Mingrone if test "$CC_FOR_BUILD" != no_compiler_found; then 445a0ee43a1SRui Paulo if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 4466f9cba8fSJoseph Mingrone (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ 447a0ee43a1SRui Paulo grep IS_64BIT_ARCH >/dev/null 448a0ee43a1SRui Paulo then 44957e22627SCy Schubert SUN_ARCH=x86_64 450a0ee43a1SRui Paulo fi 451a0ee43a1SRui Paulo fi 4526f9cba8fSJoseph Mingrone SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 4536f9cba8fSJoseph Mingrone GUESS=$SUN_ARCH-pc-solaris2$SUN_REL 4546f9cba8fSJoseph Mingrone ;; 4558cf6c252SPaul Traina sun4*:SunOS:6*:*) 4568cf6c252SPaul Traina # According to config.sub, this is the proper way to canonicalize 4578cf6c252SPaul Traina # SunOS6. Hard to guess exactly what SunOS6 will be like, but 4588cf6c252SPaul Traina # it's likely to be more like Solaris than SunOS4. 4596f9cba8fSJoseph Mingrone SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 4606f9cba8fSJoseph Mingrone GUESS=sparc-sun-solaris3$SUN_REL 4616f9cba8fSJoseph Mingrone ;; 4628cf6c252SPaul Traina sun4*:SunOS:*:*) 4636f9cba8fSJoseph Mingrone case `/usr/bin/arch -k` in 4648cf6c252SPaul Traina Series*|S4*) 4658cf6c252SPaul Traina UNAME_RELEASE=`uname -v` 4668cf6c252SPaul Traina ;; 4678cf6c252SPaul Traina esac 468*afdbf109SJoseph Mingrone # Japanese Language versions have a version number like '4.1.3-JL'. 4696f9cba8fSJoseph Mingrone SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` 4706f9cba8fSJoseph Mingrone GUESS=sparc-sun-sunos$SUN_REL 4716f9cba8fSJoseph Mingrone ;; 4728cf6c252SPaul Traina sun3*:SunOS:*:*) 4736f9cba8fSJoseph Mingrone GUESS=m68k-sun-sunos$UNAME_RELEASE 4746f9cba8fSJoseph Mingrone ;; 475dc2c7305SBill Fenner sun*:*:4.2BSD:*) 476feb4ecdbSBruce M Simpson UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 47757e22627SCy Schubert test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 4786f9cba8fSJoseph Mingrone case `/bin/arch` in 479dc2c7305SBill Fenner sun3) 4806f9cba8fSJoseph Mingrone GUESS=m68k-sun-sunos$UNAME_RELEASE 481dc2c7305SBill Fenner ;; 482dc2c7305SBill Fenner sun4) 4836f9cba8fSJoseph Mingrone GUESS=sparc-sun-sunos$UNAME_RELEASE 484dc2c7305SBill Fenner ;; 485dc2c7305SBill Fenner esac 4866f9cba8fSJoseph Mingrone ;; 4873052b236SBill Fenner aushp:SunOS:*:*) 4886f9cba8fSJoseph Mingrone GUESS=sparc-auspex-sunos$UNAME_RELEASE 4896f9cba8fSJoseph Mingrone ;; 490dc2c7305SBill Fenner # The situation for MiNT is a little confusing. The machine name 491dc2c7305SBill Fenner # can be virtually everything (everything which is not 492dc2c7305SBill Fenner # "atarist" or "atariste" at least should have a processor 493dc2c7305SBill Fenner # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 494dc2c7305SBill Fenner # to the lowercase version "mint" (or "freemint"). Finally 495dc2c7305SBill Fenner # the system name "TOS" denotes a system which is actually not 496dc2c7305SBill Fenner # MiNT. But MiNT is downward compatible to TOS, so this should 497dc2c7305SBill Fenner # be no problem. 498dc2c7305SBill Fenner atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 4996f9cba8fSJoseph Mingrone GUESS=m68k-atari-mint$UNAME_RELEASE 5006f9cba8fSJoseph Mingrone ;; 501dc2c7305SBill Fenner atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 5026f9cba8fSJoseph Mingrone GUESS=m68k-atari-mint$UNAME_RELEASE 5036f9cba8fSJoseph Mingrone ;; 504dc2c7305SBill Fenner *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 5056f9cba8fSJoseph Mingrone GUESS=m68k-atari-mint$UNAME_RELEASE 5066f9cba8fSJoseph Mingrone ;; 507dc2c7305SBill Fenner milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 5086f9cba8fSJoseph Mingrone GUESS=m68k-milan-mint$UNAME_RELEASE 5096f9cba8fSJoseph Mingrone ;; 510dc2c7305SBill Fenner hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 5116f9cba8fSJoseph Mingrone GUESS=m68k-hades-mint$UNAME_RELEASE 5126f9cba8fSJoseph Mingrone ;; 513dc2c7305SBill Fenner *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 5146f9cba8fSJoseph Mingrone GUESS=m68k-unknown-mint$UNAME_RELEASE 5156f9cba8fSJoseph Mingrone ;; 516a0ee43a1SRui Paulo m68k:machten:*:*) 5176f9cba8fSJoseph Mingrone GUESS=m68k-apple-machten$UNAME_RELEASE 5186f9cba8fSJoseph Mingrone ;; 5193052b236SBill Fenner powerpc:machten:*:*) 5206f9cba8fSJoseph Mingrone GUESS=powerpc-apple-machten$UNAME_RELEASE 5216f9cba8fSJoseph Mingrone ;; 5223052b236SBill Fenner RISC*:Mach:*:*) 5236f9cba8fSJoseph Mingrone GUESS=mips-dec-mach_bsd4.3 5246f9cba8fSJoseph Mingrone ;; 5258cf6c252SPaul Traina RISC*:ULTRIX:*:*) 5266f9cba8fSJoseph Mingrone GUESS=mips-dec-ultrix$UNAME_RELEASE 5276f9cba8fSJoseph Mingrone ;; 5288cf6c252SPaul Traina VAX*:ULTRIX*:*:*) 5296f9cba8fSJoseph Mingrone GUESS=vax-dec-ultrix$UNAME_RELEASE 5306f9cba8fSJoseph Mingrone ;; 531dc2c7305SBill Fenner 2020:CLIX:*:* | 2430:CLIX:*:*) 5326f9cba8fSJoseph Mingrone GUESS=clipper-intergraph-clix$UNAME_RELEASE 5336f9cba8fSJoseph Mingrone ;; 5343052b236SBill Fenner mips:*:*:UMIPS | mips:*:*:RISCos) 5356f9cba8fSJoseph Mingrone set_cc_for_build 53657e22627SCy Schubert sed 's/^ //' << EOF > "$dummy.c" 537dc2c7305SBill Fenner#ifdef __cplusplus 538dc2c7305SBill Fenner#include <stdio.h> /* for printf() prototype */ 539dc2c7305SBill Fenner int main (int argc, char *argv[]) { 540dc2c7305SBill Fenner#else 541dc2c7305SBill Fenner int main (argc, argv) int argc; char *argv[]; { 542dc2c7305SBill Fenner#endif 5433052b236SBill Fenner #if defined (host_mips) && defined (MIPSEB) 5443052b236SBill Fenner #if defined (SYSTYPE_SYSV) 54557e22627SCy Schubert printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); 5463052b236SBill Fenner #endif 5473052b236SBill Fenner #if defined (SYSTYPE_SVR4) 54857e22627SCy Schubert printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); 5493052b236SBill Fenner #endif 5503052b236SBill Fenner #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 55157e22627SCy Schubert printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); 5523052b236SBill Fenner #endif 5533052b236SBill Fenner #endif 5543052b236SBill Fenner exit (-1); 5553052b236SBill Fenner } 5563052b236SBill FennerEOF 55757e22627SCy Schubert $CC_FOR_BUILD -o "$dummy" "$dummy.c" && 55857e22627SCy Schubert dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && 55957e22627SCy Schubert SYSTEM_NAME=`"$dummy" "$dummyarg"` && 560a0ee43a1SRui Paulo { echo "$SYSTEM_NAME"; exit; } 5616f9cba8fSJoseph Mingrone GUESS=mips-mips-riscos$UNAME_RELEASE 5626f9cba8fSJoseph Mingrone ;; 5630a94d38fSBill Fenner Motorola:PowerMAX_OS:*:*) 5646f9cba8fSJoseph Mingrone GUESS=powerpc-motorola-powermax 5656f9cba8fSJoseph Mingrone ;; 566feb4ecdbSBruce M Simpson Motorola:*:4.3:PL8-*) 5676f9cba8fSJoseph Mingrone GUESS=powerpc-harris-powermax 5686f9cba8fSJoseph Mingrone ;; 569feb4ecdbSBruce M Simpson Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 5706f9cba8fSJoseph Mingrone GUESS=powerpc-harris-powermax 5716f9cba8fSJoseph Mingrone ;; 5728cf6c252SPaul Traina Night_Hawk:Power_UNIX:*:*) 5736f9cba8fSJoseph Mingrone GUESS=powerpc-harris-powerunix 5746f9cba8fSJoseph Mingrone ;; 5758cf6c252SPaul Traina m88k:CX/UX:7*:*) 5766f9cba8fSJoseph Mingrone GUESS=m88k-harris-cxux7 5776f9cba8fSJoseph Mingrone ;; 5788cf6c252SPaul Traina m88k:*:4*:R4*) 5796f9cba8fSJoseph Mingrone GUESS=m88k-motorola-sysv4 5806f9cba8fSJoseph Mingrone ;; 5818cf6c252SPaul Traina m88k:*:3*:R3*) 5826f9cba8fSJoseph Mingrone GUESS=m88k-motorola-sysv3 5836f9cba8fSJoseph Mingrone ;; 5848cf6c252SPaul Traina AViiON:dgux:*:*) 5858cf6c252SPaul Traina # DG/UX returns AViiON for all architectures 5868cf6c252SPaul Traina UNAME_PROCESSOR=`/usr/bin/uname -p` 5876f9cba8fSJoseph Mingrone if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 588dc2c7305SBill Fenner then 5896f9cba8fSJoseph Mingrone if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ 5906f9cba8fSJoseph Mingrone test "$TARGET_BINARY_INTERFACE"x = x 591dc2c7305SBill Fenner then 5926f9cba8fSJoseph Mingrone GUESS=m88k-dg-dgux$UNAME_RELEASE 5938cf6c252SPaul Traina else 5946f9cba8fSJoseph Mingrone GUESS=m88k-dg-dguxbcs$UNAME_RELEASE 5958cf6c252SPaul Traina fi 596dc2c7305SBill Fenner else 5976f9cba8fSJoseph Mingrone GUESS=i586-dg-dgux$UNAME_RELEASE 5988cf6c252SPaul Traina fi 5996f9cba8fSJoseph Mingrone ;; 6008cf6c252SPaul Traina M88*:DolphinOS:*:*) # DolphinOS (SVR3) 6016f9cba8fSJoseph Mingrone GUESS=m88k-dolphin-sysv3 6026f9cba8fSJoseph Mingrone ;; 6038cf6c252SPaul Traina M88*:*:R3*:*) 6048cf6c252SPaul Traina # Delta 88k system running SVR3 6056f9cba8fSJoseph Mingrone GUESS=m88k-motorola-sysv3 6066f9cba8fSJoseph Mingrone ;; 6078cf6c252SPaul Traina XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 6086f9cba8fSJoseph Mingrone GUESS=m88k-tektronix-sysv3 6096f9cba8fSJoseph Mingrone ;; 6108cf6c252SPaul Traina Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 6116f9cba8fSJoseph Mingrone GUESS=m68k-tektronix-bsd 6126f9cba8fSJoseph Mingrone ;; 6138cf6c252SPaul Traina *:IRIX*:*:*) 6146f9cba8fSJoseph Mingrone IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` 6156f9cba8fSJoseph Mingrone GUESS=mips-sgi-irix$IRIX_REL 6166f9cba8fSJoseph Mingrone ;; 6178cf6c252SPaul Traina ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 6186f9cba8fSJoseph Mingrone GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id 6196f9cba8fSJoseph Mingrone ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 6200a94d38fSBill Fenner i*86:AIX:*:*) 6216f9cba8fSJoseph Mingrone GUESS=i386-ibm-aix 6226f9cba8fSJoseph Mingrone ;; 6230a94d38fSBill Fenner ia64:AIX:*:*) 6246f9cba8fSJoseph Mingrone if test -x /usr/bin/oslevel ; then 6250a94d38fSBill Fenner IBM_REV=`/usr/bin/oslevel` 6260a94d38fSBill Fenner else 6276f9cba8fSJoseph Mingrone IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 6280a94d38fSBill Fenner fi 6296f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV 6306f9cba8fSJoseph Mingrone ;; 6318cf6c252SPaul Traina *:AIX:2:3) 6328cf6c252SPaul Traina if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 6336f9cba8fSJoseph Mingrone set_cc_for_build 63457e22627SCy Schubert sed 's/^ //' << EOF > "$dummy.c" 6358cf6c252SPaul Traina #include <sys/systemcfg.h> 6368cf6c252SPaul Traina 6378cf6c252SPaul Traina main() 6388cf6c252SPaul Traina { 6398cf6c252SPaul Traina if (!__power_pc()) 6408cf6c252SPaul Traina exit(1); 6418cf6c252SPaul Traina puts("powerpc-ibm-aix3.2.5"); 6428cf6c252SPaul Traina exit(0); 6438cf6c252SPaul Traina } 6448cf6c252SPaul TrainaEOF 64557e22627SCy Schubert if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` 646a0ee43a1SRui Paulo then 6476f9cba8fSJoseph Mingrone GUESS=$SYSTEM_NAME 648a0ee43a1SRui Paulo else 6496f9cba8fSJoseph Mingrone GUESS=rs6000-ibm-aix3.2.5 650a0ee43a1SRui Paulo fi 6518cf6c252SPaul Traina elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 6526f9cba8fSJoseph Mingrone GUESS=rs6000-ibm-aix3.2.4 6538cf6c252SPaul Traina else 6546f9cba8fSJoseph Mingrone GUESS=rs6000-ibm-aix3.2 6558cf6c252SPaul Traina fi 6566f9cba8fSJoseph Mingrone ;; 657681ed54cSXin LI *:AIX:*:[4567]) 658feb4ecdbSBruce M Simpson IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 65957e22627SCy Schubert if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then 6608cf6c252SPaul Traina IBM_ARCH=rs6000 6618cf6c252SPaul Traina else 6628cf6c252SPaul Traina IBM_ARCH=powerpc 6638cf6c252SPaul Traina fi 6646f9cba8fSJoseph Mingrone if test -x /usr/bin/lslpp ; then 6656f9cba8fSJoseph Mingrone IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ 666ada6f083SXin LI awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 6678cf6c252SPaul Traina else 6686f9cba8fSJoseph Mingrone IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 6698cf6c252SPaul Traina fi 6706f9cba8fSJoseph Mingrone GUESS=$IBM_ARCH-ibm-aix$IBM_REV 6716f9cba8fSJoseph Mingrone ;; 6728cf6c252SPaul Traina *:AIX:*:*) 6736f9cba8fSJoseph Mingrone GUESS=rs6000-ibm-aix 6746f9cba8fSJoseph Mingrone ;; 67557e22627SCy Schubert ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 6766f9cba8fSJoseph Mingrone GUESS=romp-ibm-bsd4.4 6776f9cba8fSJoseph Mingrone ;; 678dc2c7305SBill Fenner ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 6796f9cba8fSJoseph Mingrone GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to 6806f9cba8fSJoseph Mingrone ;; # report: romp-ibm BSD 4.3 6818cf6c252SPaul Traina *:BOSX:*:*) 6826f9cba8fSJoseph Mingrone GUESS=rs6000-bull-bosx 6836f9cba8fSJoseph Mingrone ;; 6848cf6c252SPaul Traina DPX/2?00:B.O.S.:*:*) 6856f9cba8fSJoseph Mingrone GUESS=m68k-bull-sysv3 6866f9cba8fSJoseph Mingrone ;; 6878cf6c252SPaul Traina 9000/[34]??:4.3bsd:1.*:*) 6886f9cba8fSJoseph Mingrone GUESS=m68k-hp-bsd 6896f9cba8fSJoseph Mingrone ;; 6908cf6c252SPaul Traina hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 6916f9cba8fSJoseph Mingrone GUESS=m68k-hp-bsd4.4 6926f9cba8fSJoseph Mingrone ;; 693dc2c7305SBill Fenner 9000/[34678]??:HP-UX:*:*) 69457e22627SCy Schubert HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 6956f9cba8fSJoseph Mingrone case $UNAME_MACHINE in 6968cf6c252SPaul Traina 9000/31?) HP_ARCH=m68000 ;; 6978cf6c252SPaul Traina 9000/[34]??) HP_ARCH=m68k ;; 698dc2c7305SBill Fenner 9000/[678][0-9][0-9]) 6996f9cba8fSJoseph Mingrone if test -x /usr/bin/getconf; then 700dc2c7305SBill Fenner sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 701dc2c7305SBill Fenner sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 7026f9cba8fSJoseph Mingrone case $sc_cpu_version in 70357e22627SCy Schubert 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 70457e22627SCy Schubert 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 705dc2c7305SBill Fenner 532) # CPU_PA_RISC2_0 7066f9cba8fSJoseph Mingrone case $sc_kernel_bits in 70757e22627SCy Schubert 32) HP_ARCH=hppa2.0n ;; 70857e22627SCy Schubert 64) HP_ARCH=hppa2.0w ;; 70957e22627SCy Schubert '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 710dc2c7305SBill Fenner esac ;; 7118cf6c252SPaul Traina esac 712feb4ecdbSBruce M Simpson fi 7136f9cba8fSJoseph Mingrone if test "$HP_ARCH" = ""; then 7146f9cba8fSJoseph Mingrone set_cc_for_build 71557e22627SCy Schubert sed 's/^ //' << EOF > "$dummy.c" 716dc2c7305SBill Fenner 717dc2c7305SBill Fenner #define _HPUX_SOURCE 718dc2c7305SBill Fenner #include <stdlib.h> 719dc2c7305SBill Fenner #include <unistd.h> 720dc2c7305SBill Fenner 721dc2c7305SBill Fenner int main () 722dc2c7305SBill Fenner { 723dc2c7305SBill Fenner #if defined(_SC_KERNEL_BITS) 724dc2c7305SBill Fenner long bits = sysconf(_SC_KERNEL_BITS); 725dc2c7305SBill Fenner #endif 726dc2c7305SBill Fenner long cpu = sysconf (_SC_CPU_VERSION); 727dc2c7305SBill Fenner 728dc2c7305SBill Fenner switch (cpu) 729dc2c7305SBill Fenner { 730dc2c7305SBill Fenner case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 731dc2c7305SBill Fenner case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 732dc2c7305SBill Fenner case CPU_PA_RISC2_0: 733dc2c7305SBill Fenner #if defined(_SC_KERNEL_BITS) 734dc2c7305SBill Fenner switch (bits) 735dc2c7305SBill Fenner { 736dc2c7305SBill Fenner case 64: puts ("hppa2.0w"); break; 737dc2c7305SBill Fenner case 32: puts ("hppa2.0n"); break; 738dc2c7305SBill Fenner default: puts ("hppa2.0"); break; 739dc2c7305SBill Fenner } break; 740dc2c7305SBill Fenner #else /* !defined(_SC_KERNEL_BITS) */ 741dc2c7305SBill Fenner puts ("hppa2.0"); break; 742dc2c7305SBill Fenner #endif 743dc2c7305SBill Fenner default: puts ("hppa1.0"); break; 744dc2c7305SBill Fenner } 745dc2c7305SBill Fenner exit (0); 746dc2c7305SBill Fenner } 747dc2c7305SBill FennerEOF 74857e22627SCy Schubert (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` 749feb4ecdbSBruce M Simpson test -z "$HP_ARCH" && HP_ARCH=hppa 750dc2c7305SBill Fenner fi ;; 751dc2c7305SBill Fenner esac 7526f9cba8fSJoseph Mingrone if test "$HP_ARCH" = hppa2.0w 753feb4ecdbSBruce M Simpson then 7546f9cba8fSJoseph Mingrone set_cc_for_build 755a0ee43a1SRui Paulo 756a0ee43a1SRui Paulo # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 757a0ee43a1SRui Paulo # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 758a0ee43a1SRui Paulo # generating 64-bit code. GNU and HP use different nomenclature: 759a0ee43a1SRui Paulo # 760a0ee43a1SRui Paulo # $ CC_FOR_BUILD=cc ./config.guess 761a0ee43a1SRui Paulo # => hppa2.0w-hp-hpux11.23 762a0ee43a1SRui Paulo # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 763a0ee43a1SRui Paulo # => hppa64-hp-hpux11.23 764a0ee43a1SRui Paulo 76557e22627SCy Schubert if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | 766a0ee43a1SRui Paulo grep -q __LP64__ 767feb4ecdbSBruce M Simpson then 76857e22627SCy Schubert HP_ARCH=hppa2.0w 769feb4ecdbSBruce M Simpson else 77057e22627SCy Schubert HP_ARCH=hppa64 771feb4ecdbSBruce M Simpson fi 772feb4ecdbSBruce M Simpson fi 7736f9cba8fSJoseph Mingrone GUESS=$HP_ARCH-hp-hpux$HPUX_REV 7746f9cba8fSJoseph Mingrone ;; 7750a94d38fSBill Fenner ia64:HP-UX:*:*) 77657e22627SCy Schubert HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 7776f9cba8fSJoseph Mingrone GUESS=ia64-hp-hpux$HPUX_REV 7786f9cba8fSJoseph Mingrone ;; 7798cf6c252SPaul Traina 3050*:HI-UX:*:*) 7806f9cba8fSJoseph Mingrone set_cc_for_build 78157e22627SCy Schubert sed 's/^ //' << EOF > "$dummy.c" 7828cf6c252SPaul Traina #include <unistd.h> 7838cf6c252SPaul Traina int 7848cf6c252SPaul Traina main () 7858cf6c252SPaul Traina { 7868cf6c252SPaul Traina long cpu = sysconf (_SC_CPU_VERSION); 7878cf6c252SPaul Traina /* The order matters, because CPU_IS_HP_MC68K erroneously returns 7888cf6c252SPaul Traina true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 7898cf6c252SPaul Traina results, however. */ 7908cf6c252SPaul Traina if (CPU_IS_PA_RISC (cpu)) 7918cf6c252SPaul Traina { 7928cf6c252SPaul Traina switch (cpu) 7938cf6c252SPaul Traina { 7948cf6c252SPaul Traina case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 7958cf6c252SPaul Traina case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 7968cf6c252SPaul Traina case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 7978cf6c252SPaul Traina default: puts ("hppa-hitachi-hiuxwe2"); break; 7988cf6c252SPaul Traina } 7998cf6c252SPaul Traina } 8008cf6c252SPaul Traina else if (CPU_IS_HP_MC68K (cpu)) 8018cf6c252SPaul Traina puts ("m68k-hitachi-hiuxwe2"); 8028cf6c252SPaul Traina else puts ("unknown-hitachi-hiuxwe2"); 8038cf6c252SPaul Traina exit (0); 8048cf6c252SPaul Traina } 8058cf6c252SPaul TrainaEOF 80657e22627SCy Schubert $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && 807a0ee43a1SRui Paulo { echo "$SYSTEM_NAME"; exit; } 8086f9cba8fSJoseph Mingrone GUESS=unknown-hitachi-hiuxwe2 8096f9cba8fSJoseph Mingrone ;; 8108cf6c252SPaul Traina 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) 8116f9cba8fSJoseph Mingrone GUESS=hppa1.1-hp-bsd 8126f9cba8fSJoseph Mingrone ;; 8138cf6c252SPaul Traina 9000/8??:4.3bsd:*:*) 8146f9cba8fSJoseph Mingrone GUESS=hppa1.0-hp-bsd 8156f9cba8fSJoseph Mingrone ;; 816feb4ecdbSBruce M Simpson *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 8176f9cba8fSJoseph Mingrone GUESS=hppa1.0-hp-mpeix 8186f9cba8fSJoseph Mingrone ;; 8198cf6c252SPaul Traina hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) 8206f9cba8fSJoseph Mingrone GUESS=hppa1.1-hp-osf 8216f9cba8fSJoseph Mingrone ;; 8228cf6c252SPaul Traina hp8??:OSF1:*:*) 8236f9cba8fSJoseph Mingrone GUESS=hppa1.0-hp-osf 8246f9cba8fSJoseph Mingrone ;; 8250a94d38fSBill Fenner i*86:OSF1:*:*) 8266f9cba8fSJoseph Mingrone if test -x /usr/sbin/sysversion ; then 8276f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-osf1mk 8283052b236SBill Fenner else 8296f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-osf1 8303052b236SBill Fenner fi 8316f9cba8fSJoseph Mingrone ;; 8328cf6c252SPaul Traina parisc*:Lites*:*:*) 8336f9cba8fSJoseph Mingrone GUESS=hppa1.1-hp-lites 8346f9cba8fSJoseph Mingrone ;; 8358cf6c252SPaul Traina C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 8366f9cba8fSJoseph Mingrone GUESS=c1-convex-bsd 8376f9cba8fSJoseph Mingrone ;; 8388cf6c252SPaul Traina C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 8398cf6c252SPaul Traina if getsysinfo -f scalar_acc 8408cf6c252SPaul Traina then echo c32-convex-bsd 8418cf6c252SPaul Traina else echo c2-convex-bsd 8428cf6c252SPaul Traina fi 843a0ee43a1SRui Paulo exit ;; 8448cf6c252SPaul Traina C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 8456f9cba8fSJoseph Mingrone GUESS=c34-convex-bsd 8466f9cba8fSJoseph Mingrone ;; 8478cf6c252SPaul Traina C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 8486f9cba8fSJoseph Mingrone GUESS=c38-convex-bsd 8496f9cba8fSJoseph Mingrone ;; 8508cf6c252SPaul Traina C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 8516f9cba8fSJoseph Mingrone GUESS=c4-convex-bsd 8526f9cba8fSJoseph Mingrone ;; 8538cf6c252SPaul Traina CRAY*Y-MP:*:*:*) 8546f9cba8fSJoseph Mingrone CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 8556f9cba8fSJoseph Mingrone GUESS=ymp-cray-unicos$CRAY_REL 8566f9cba8fSJoseph Mingrone ;; 8573052b236SBill Fenner CRAY*[A-Z]90:*:*:*) 85857e22627SCy Schubert echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ 8593052b236SBill Fenner | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 860feb4ecdbSBruce M Simpson -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 861feb4ecdbSBruce M Simpson -e 's/\.[^.]*$/.X/' 862a0ee43a1SRui Paulo exit ;; 8633052b236SBill Fenner CRAY*TS:*:*:*) 8646f9cba8fSJoseph Mingrone CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 8656f9cba8fSJoseph Mingrone GUESS=t90-cray-unicos$CRAY_REL 8666f9cba8fSJoseph Mingrone ;; 867dc2c7305SBill Fenner CRAY*T3E:*:*:*) 8686f9cba8fSJoseph Mingrone CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 8696f9cba8fSJoseph Mingrone GUESS=alphaev5-cray-unicosmk$CRAY_REL 8706f9cba8fSJoseph Mingrone ;; 871dc2c7305SBill Fenner CRAY*SV1:*:*:*) 8726f9cba8fSJoseph Mingrone CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 8736f9cba8fSJoseph Mingrone GUESS=sv1-cray-unicos$CRAY_REL 8746f9cba8fSJoseph Mingrone ;; 875feb4ecdbSBruce M Simpson *:UNICOS/mp:*:*) 8766f9cba8fSJoseph Mingrone CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 8776f9cba8fSJoseph Mingrone GUESS=craynv-cray-unicosmp$CRAY_REL 8786f9cba8fSJoseph Mingrone ;; 8790a94d38fSBill Fenner F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 88057e22627SCy Schubert FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 88157e22627SCy Schubert FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 88257e22627SCy Schubert FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` 8836f9cba8fSJoseph Mingrone GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 8846f9cba8fSJoseph Mingrone ;; 885feb4ecdbSBruce M Simpson 5000:UNIX_System_V:4.*:*) 88657e22627SCy Schubert FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 88757e22627SCy Schubert FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` 8886f9cba8fSJoseph Mingrone GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 8896f9cba8fSJoseph Mingrone ;; 8900a94d38fSBill Fenner i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 8916f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE 8926f9cba8fSJoseph Mingrone ;; 893dc2c7305SBill Fenner sparc*:BSD/OS:*:*) 8946f9cba8fSJoseph Mingrone GUESS=sparc-unknown-bsdi$UNAME_RELEASE 8956f9cba8fSJoseph Mingrone ;; 896dc2c7305SBill Fenner *:BSD/OS:*:*) 8976f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE 8986f9cba8fSJoseph Mingrone ;; 8996f9cba8fSJoseph Mingrone arm:FreeBSD:*:*) 9006f9cba8fSJoseph Mingrone UNAME_PROCESSOR=`uname -p` 9016f9cba8fSJoseph Mingrone set_cc_for_build 9026f9cba8fSJoseph Mingrone if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 9036f9cba8fSJoseph Mingrone | grep -q __ARM_PCS_VFP 9046f9cba8fSJoseph Mingrone then 9056f9cba8fSJoseph Mingrone FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 9066f9cba8fSJoseph Mingrone GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi 9076f9cba8fSJoseph Mingrone else 9086f9cba8fSJoseph Mingrone FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 9096f9cba8fSJoseph Mingrone GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf 9106f9cba8fSJoseph Mingrone fi 9116f9cba8fSJoseph Mingrone ;; 9128cf6c252SPaul Traina *:FreeBSD:*:*) 913*afdbf109SJoseph Mingrone UNAME_PROCESSOR=`uname -p` 9146f9cba8fSJoseph Mingrone case $UNAME_PROCESSOR in 915a0ee43a1SRui Paulo amd64) 91657e22627SCy Schubert UNAME_PROCESSOR=x86_64 ;; 91757e22627SCy Schubert i386) 91857e22627SCy Schubert UNAME_PROCESSOR=i586 ;; 919a0ee43a1SRui Paulo esac 9206f9cba8fSJoseph Mingrone FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 9216f9cba8fSJoseph Mingrone GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL 9226f9cba8fSJoseph Mingrone ;; 9238cf6c252SPaul Traina i*:CYGWIN*:*) 9246f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-cygwin 9256f9cba8fSJoseph Mingrone ;; 926ada6f083SXin LI *:MINGW64*:*) 9276f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-mingw64 9286f9cba8fSJoseph Mingrone ;; 929a0ee43a1SRui Paulo *:MINGW*:*) 9306f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-mingw32 9316f9cba8fSJoseph Mingrone ;; 932ada6f083SXin LI *:MSYS*:*) 9336f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-msys 9346f9cba8fSJoseph Mingrone ;; 935dc2c7305SBill Fenner i*:PW*:*) 9366f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-pw32 9376f9cba8fSJoseph Mingrone ;; 9386f9cba8fSJoseph Mingrone *:SerenityOS:*:*) 9396f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-serenity 9406f9cba8fSJoseph Mingrone ;; 941a0ee43a1SRui Paulo *:Interix*:*) 9426f9cba8fSJoseph Mingrone case $UNAME_MACHINE in 943a0ee43a1SRui Paulo x86) 9446f9cba8fSJoseph Mingrone GUESS=i586-pc-interix$UNAME_RELEASE 9456f9cba8fSJoseph Mingrone ;; 946a0ee43a1SRui Paulo authenticamd | genuineintel | EM64T) 9476f9cba8fSJoseph Mingrone GUESS=x86_64-unknown-interix$UNAME_RELEASE 9486f9cba8fSJoseph Mingrone ;; 949a0ee43a1SRui Paulo IA64) 9506f9cba8fSJoseph Mingrone GUESS=ia64-unknown-interix$UNAME_RELEASE 9516f9cba8fSJoseph Mingrone ;; 952a0ee43a1SRui Paulo esac ;; 953dc2c7305SBill Fenner i*:UWIN*:*) 9546f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-uwin 9556f9cba8fSJoseph Mingrone ;; 956a0ee43a1SRui Paulo amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 9576f9cba8fSJoseph Mingrone GUESS=x86_64-pc-cygwin 9586f9cba8fSJoseph Mingrone ;; 9598cf6c252SPaul Traina prep*:SunOS:5.*:*) 9606f9cba8fSJoseph Mingrone SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 9616f9cba8fSJoseph Mingrone GUESS=powerpcle-unknown-solaris2$SUN_REL 9626f9cba8fSJoseph Mingrone ;; 9638cf6c252SPaul Traina *:GNU:*:*) 964feb4ecdbSBruce M Simpson # the GNU system 9656f9cba8fSJoseph Mingrone GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` 9666f9cba8fSJoseph Mingrone GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` 9676f9cba8fSJoseph Mingrone GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL 9686f9cba8fSJoseph Mingrone ;; 969feb4ecdbSBruce M Simpson *:GNU/*:*:*) 970feb4ecdbSBruce M Simpson # other systems with GNU libc and userland 9716f9cba8fSJoseph Mingrone GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` 9726f9cba8fSJoseph Mingrone GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 9736f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC 9746f9cba8fSJoseph Mingrone ;; 975dd744a89SJoseph Mingrone x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) 976dd744a89SJoseph Mingrone GUESS="$UNAME_MACHINE-pc-managarm-mlibc" 977dd744a89SJoseph Mingrone ;; 978dd744a89SJoseph Mingrone *:[Mm]anagarm:*:*) 979dd744a89SJoseph Mingrone GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" 980dd744a89SJoseph Mingrone ;; 98157e22627SCy Schubert *:Minix:*:*) 9826f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-minix 9836f9cba8fSJoseph Mingrone ;; 984681ed54cSXin LI aarch64:Linux:*:*) 985*afdbf109SJoseph Mingrone set_cc_for_build 986*afdbf109SJoseph Mingrone CPU=$UNAME_MACHINE 987*afdbf109SJoseph Mingrone LIBCABI=$LIBC 988*afdbf109SJoseph Mingrone if test "$CC_FOR_BUILD" != no_compiler_found; then 989*afdbf109SJoseph Mingrone ABI=64 990*afdbf109SJoseph Mingrone sed 's/^ //' << EOF > "$dummy.c" 991*afdbf109SJoseph Mingrone #ifdef __ARM_EABI__ 992*afdbf109SJoseph Mingrone #ifdef __ARM_PCS_VFP 993*afdbf109SJoseph Mingrone ABI=eabihf 994*afdbf109SJoseph Mingrone #else 995*afdbf109SJoseph Mingrone ABI=eabi 996*afdbf109SJoseph Mingrone #endif 997*afdbf109SJoseph Mingrone #endif 998*afdbf109SJoseph MingroneEOF 999*afdbf109SJoseph Mingrone cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` 1000*afdbf109SJoseph Mingrone eval "$cc_set_abi" 1001*afdbf109SJoseph Mingrone case $ABI in 1002*afdbf109SJoseph Mingrone eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; 1003*afdbf109SJoseph Mingrone esac 1004*afdbf109SJoseph Mingrone fi 1005*afdbf109SJoseph Mingrone GUESS=$CPU-unknown-linux-$LIBCABI 10066f9cba8fSJoseph Mingrone ;; 1007681ed54cSXin LI aarch64_be:Linux:*:*) 1008681ed54cSXin LI UNAME_MACHINE=aarch64_be 10096f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10106f9cba8fSJoseph Mingrone ;; 10110a94d38fSBill Fenner alpha:Linux:*:*) 10126f9cba8fSJoseph Mingrone case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in 1013feb4ecdbSBruce M Simpson EV5) UNAME_MACHINE=alphaev5 ;; 1014feb4ecdbSBruce M Simpson EV56) UNAME_MACHINE=alphaev56 ;; 1015feb4ecdbSBruce M Simpson PCA56) UNAME_MACHINE=alphapca56 ;; 1016feb4ecdbSBruce M Simpson PCA57) UNAME_MACHINE=alphapca56 ;; 1017feb4ecdbSBruce M Simpson EV6) UNAME_MACHINE=alphaev6 ;; 1018feb4ecdbSBruce M Simpson EV67) UNAME_MACHINE=alphaev67 ;; 1019feb4ecdbSBruce M Simpson EV68*) UNAME_MACHINE=alphaev68 ;; 1020dc2c7305SBill Fenner esac 1021a0ee43a1SRui Paulo objdump --private-headers /bin/sh | grep -q ld.so.1 102257e22627SCy Schubert if test "$?" = 0 ; then LIBC=gnulibc1 ; fi 10236f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10246f9cba8fSJoseph Mingrone ;; 10256f9cba8fSJoseph Mingrone arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) 10266f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10276f9cba8fSJoseph Mingrone ;; 1028a0ee43a1SRui Paulo arm*:Linux:*:*) 10296f9cba8fSJoseph Mingrone set_cc_for_build 1030a0ee43a1SRui Paulo if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 1031a0ee43a1SRui Paulo | grep -q __ARM_EABI__ 1032a0ee43a1SRui Paulo then 10336f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1034a0ee43a1SRui Paulo else 1035681ed54cSXin LI if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 1036681ed54cSXin LI | grep -q __ARM_PCS_VFP 1037681ed54cSXin LI then 10386f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi 1039681ed54cSXin LI else 10406f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf 1041681ed54cSXin LI fi 1042a0ee43a1SRui Paulo fi 10436f9cba8fSJoseph Mingrone ;; 1044a0ee43a1SRui Paulo avr32*:Linux:*:*) 10456f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10466f9cba8fSJoseph Mingrone ;; 1047a0ee43a1SRui Paulo cris:Linux:*:*) 10486f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-axis-linux-$LIBC 10496f9cba8fSJoseph Mingrone ;; 1050a0ee43a1SRui Paulo crisv32:Linux:*:*) 10516f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-axis-linux-$LIBC 10526f9cba8fSJoseph Mingrone ;; 105357e22627SCy Schubert e2k:Linux:*:*) 10546f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10556f9cba8fSJoseph Mingrone ;; 1056a0ee43a1SRui Paulo frv:Linux:*:*) 10576f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10586f9cba8fSJoseph Mingrone ;; 1059681ed54cSXin LI hexagon:Linux:*:*) 10606f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10616f9cba8fSJoseph Mingrone ;; 1062a0ee43a1SRui Paulo i*86:Linux:*:*) 10636f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-linux-$LIBC 10646f9cba8fSJoseph Mingrone ;; 1065a0ee43a1SRui Paulo ia64:Linux:*:*) 10666f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10676f9cba8fSJoseph Mingrone ;; 106857e22627SCy Schubert k1om:Linux:*:*) 10696f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10706f9cba8fSJoseph Mingrone ;; 1071*afdbf109SJoseph Mingrone kvx:Linux:*:*) 1072*afdbf109SJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1073*afdbf109SJoseph Mingrone ;; 1074*afdbf109SJoseph Mingrone kvx:cos:*:*) 1075*afdbf109SJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-cos 1076*afdbf109SJoseph Mingrone ;; 1077*afdbf109SJoseph Mingrone kvx:mbr:*:*) 1078*afdbf109SJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-mbr 1079*afdbf109SJoseph Mingrone ;; 10806f9cba8fSJoseph Mingrone loongarch32:Linux:*:* | loongarch64:Linux:*:*) 10816f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10826f9cba8fSJoseph Mingrone ;; 1083a0ee43a1SRui Paulo m32r*:Linux:*:*) 10846f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10856f9cba8fSJoseph Mingrone ;; 1086a0ee43a1SRui Paulo m68*:Linux:*:*) 10876f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10886f9cba8fSJoseph Mingrone ;; 1089a0ee43a1SRui Paulo mips:Linux:*:* | mips64:Linux:*:*) 10906f9cba8fSJoseph Mingrone set_cc_for_build 10916f9cba8fSJoseph Mingrone IS_GLIBC=0 10926f9cba8fSJoseph Mingrone test x"${LIBC}" = xgnu && IS_GLIBC=1 109357e22627SCy Schubert sed 's/^ //' << EOF > "$dummy.c" 1094a0ee43a1SRui Paulo #undef CPU 10956f9cba8fSJoseph Mingrone #undef mips 10966f9cba8fSJoseph Mingrone #undef mipsel 10976f9cba8fSJoseph Mingrone #undef mips64 10986f9cba8fSJoseph Mingrone #undef mips64el 10996f9cba8fSJoseph Mingrone #if ${IS_GLIBC} && defined(_ABI64) 11006f9cba8fSJoseph Mingrone LIBCABI=gnuabi64 11016f9cba8fSJoseph Mingrone #else 11026f9cba8fSJoseph Mingrone #if ${IS_GLIBC} && defined(_ABIN32) 11036f9cba8fSJoseph Mingrone LIBCABI=gnuabin32 11046f9cba8fSJoseph Mingrone #else 11056f9cba8fSJoseph Mingrone LIBCABI=${LIBC} 11066f9cba8fSJoseph Mingrone #endif 11076f9cba8fSJoseph Mingrone #endif 11086f9cba8fSJoseph Mingrone 11096f9cba8fSJoseph Mingrone #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 11106f9cba8fSJoseph Mingrone CPU=mipsisa64r6 11116f9cba8fSJoseph Mingrone #else 11126f9cba8fSJoseph Mingrone #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 11136f9cba8fSJoseph Mingrone CPU=mipsisa32r6 11146f9cba8fSJoseph Mingrone #else 11156f9cba8fSJoseph Mingrone #if defined(__mips64) 11166f9cba8fSJoseph Mingrone CPU=mips64 11176f9cba8fSJoseph Mingrone #else 11186f9cba8fSJoseph Mingrone CPU=mips 11196f9cba8fSJoseph Mingrone #endif 11206f9cba8fSJoseph Mingrone #endif 11216f9cba8fSJoseph Mingrone #endif 11226f9cba8fSJoseph Mingrone 1123a0ee43a1SRui Paulo #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 11246f9cba8fSJoseph Mingrone MIPS_ENDIAN=el 1125a0ee43a1SRui Paulo #else 1126a0ee43a1SRui Paulo #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 11276f9cba8fSJoseph Mingrone MIPS_ENDIAN= 1128a0ee43a1SRui Paulo #else 11296f9cba8fSJoseph Mingrone MIPS_ENDIAN= 1130a0ee43a1SRui Paulo #endif 1131a0ee43a1SRui Paulo #endif 1132a0ee43a1SRui PauloEOF 11336f9cba8fSJoseph Mingrone cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` 11346f9cba8fSJoseph Mingrone eval "$cc_set_vars" 11356f9cba8fSJoseph Mingrone test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } 1136a0ee43a1SRui Paulo ;; 113757e22627SCy Schubert mips64el:Linux:*:*) 11386f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 11396f9cba8fSJoseph Mingrone ;; 1140ada6f083SXin LI openrisc*:Linux:*:*) 11416f9cba8fSJoseph Mingrone GUESS=or1k-unknown-linux-$LIBC 11426f9cba8fSJoseph Mingrone ;; 1143ada6f083SXin LI or32:Linux:*:* | or1k*:Linux:*:*) 11446f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 11456f9cba8fSJoseph Mingrone ;; 1146a0ee43a1SRui Paulo padre:Linux:*:*) 11476f9cba8fSJoseph Mingrone GUESS=sparc-unknown-linux-$LIBC 11486f9cba8fSJoseph Mingrone ;; 1149a0ee43a1SRui Paulo parisc64:Linux:*:* | hppa64:Linux:*:*) 11506f9cba8fSJoseph Mingrone GUESS=hppa64-unknown-linux-$LIBC 11516f9cba8fSJoseph Mingrone ;; 11520a94d38fSBill Fenner parisc:Linux:*:* | hppa:Linux:*:*) 1153dc2c7305SBill Fenner # Look for CPU level 1154dc2c7305SBill Fenner case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 11556f9cba8fSJoseph Mingrone PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; 11566f9cba8fSJoseph Mingrone PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; 11576f9cba8fSJoseph Mingrone *) GUESS=hppa-unknown-linux-$LIBC ;; 11580a94d38fSBill Fenner esac 11596f9cba8fSJoseph Mingrone ;; 1160a0ee43a1SRui Paulo ppc64:Linux:*:*) 11616f9cba8fSJoseph Mingrone GUESS=powerpc64-unknown-linux-$LIBC 11626f9cba8fSJoseph Mingrone ;; 1163a0ee43a1SRui Paulo ppc:Linux:*:*) 11646f9cba8fSJoseph Mingrone GUESS=powerpc-unknown-linux-$LIBC 11656f9cba8fSJoseph Mingrone ;; 1166ada6f083SXin LI ppc64le:Linux:*:*) 11676f9cba8fSJoseph Mingrone GUESS=powerpc64le-unknown-linux-$LIBC 11686f9cba8fSJoseph Mingrone ;; 1169ada6f083SXin LI ppcle:Linux:*:*) 11706f9cba8fSJoseph Mingrone GUESS=powerpcle-unknown-linux-$LIBC 11716f9cba8fSJoseph Mingrone ;; 11726f9cba8fSJoseph Mingrone riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) 11736f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 11746f9cba8fSJoseph Mingrone ;; 11750a94d38fSBill Fenner s390:Linux:*:* | s390x:Linux:*:*) 11766f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-ibm-linux-$LIBC 11776f9cba8fSJoseph Mingrone ;; 1178feb4ecdbSBruce M Simpson sh64*:Linux:*:*) 11796f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 11806f9cba8fSJoseph Mingrone ;; 11810a94d38fSBill Fenner sh*:Linux:*:*) 11826f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 11836f9cba8fSJoseph Mingrone ;; 11840a94d38fSBill Fenner sparc:Linux:*:* | sparc64:Linux:*:*) 11856f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 11866f9cba8fSJoseph Mingrone ;; 1187681ed54cSXin LI tile*:Linux:*:*) 11886f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 11896f9cba8fSJoseph Mingrone ;; 1190a0ee43a1SRui Paulo vax:Linux:*:*) 11916f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-dec-linux-$LIBC 11926f9cba8fSJoseph Mingrone ;; 11930a94d38fSBill Fenner x86_64:Linux:*:*) 11946f9cba8fSJoseph Mingrone set_cc_for_build 11956f9cba8fSJoseph Mingrone CPU=$UNAME_MACHINE 11966f9cba8fSJoseph Mingrone LIBCABI=$LIBC 11976f9cba8fSJoseph Mingrone if test "$CC_FOR_BUILD" != no_compiler_found; then 11986f9cba8fSJoseph Mingrone ABI=64 11996f9cba8fSJoseph Mingrone sed 's/^ //' << EOF > "$dummy.c" 12006f9cba8fSJoseph Mingrone #ifdef __i386__ 12016f9cba8fSJoseph Mingrone ABI=x86 12026f9cba8fSJoseph Mingrone #else 12036f9cba8fSJoseph Mingrone #ifdef __ILP32__ 12046f9cba8fSJoseph Mingrone ABI=x32 12056f9cba8fSJoseph Mingrone #endif 12066f9cba8fSJoseph Mingrone #endif 12076f9cba8fSJoseph MingroneEOF 12086f9cba8fSJoseph Mingrone cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` 12096f9cba8fSJoseph Mingrone eval "$cc_set_abi" 12106f9cba8fSJoseph Mingrone case $ABI in 12116f9cba8fSJoseph Mingrone x86) CPU=i686 ;; 12126f9cba8fSJoseph Mingrone x32) LIBCABI=${LIBC}x32 ;; 12136f9cba8fSJoseph Mingrone esac 12146f9cba8fSJoseph Mingrone fi 12156f9cba8fSJoseph Mingrone GUESS=$CPU-pc-linux-$LIBCABI 12166f9cba8fSJoseph Mingrone ;; 1217a0ee43a1SRui Paulo xtensa*:Linux:*:*) 12186f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 12196f9cba8fSJoseph Mingrone ;; 12200a94d38fSBill Fenner i*86:DYNIX/ptx:4*:*) 1221feb4ecdbSBruce M Simpson # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1222feb4ecdbSBruce M Simpson # earlier versions are messed up and put the nodename in both 1223feb4ecdbSBruce M Simpson # sysname and nodename. 12246f9cba8fSJoseph Mingrone GUESS=i386-sequent-sysv4 12256f9cba8fSJoseph Mingrone ;; 12260a94d38fSBill Fenner i*86:UNIX_SV:4.2MP:2.*) 1227dc2c7305SBill Fenner # Unixware is an offshoot of SVR4, but it has its own version 1228dc2c7305SBill Fenner # number series starting with 2... 1229dc2c7305SBill Fenner # I am not positive that other SVR4 systems won't match this, 1230dc2c7305SBill Fenner # I just have to hope. -- rms. 1231dc2c7305SBill Fenner # Use sysv4.2uw... so that sysv4* matches it. 12326f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION 12336f9cba8fSJoseph Mingrone ;; 1234feb4ecdbSBruce M Simpson i*86:OS/2:*:*) 1235*afdbf109SJoseph Mingrone # If we were able to find 'uname', then EMX Unix compatibility 1236feb4ecdbSBruce M Simpson # is probably installed. 12376f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-os2-emx 12386f9cba8fSJoseph Mingrone ;; 1239feb4ecdbSBruce M Simpson i*86:XTS-300:*:STOP) 12406f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-stop 12416f9cba8fSJoseph Mingrone ;; 1242feb4ecdbSBruce M Simpson i*86:atheos:*:*) 12436f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-atheos 12446f9cba8fSJoseph Mingrone ;; 1245a0ee43a1SRui Paulo i*86:syllable:*:*) 12466f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-syllable 12476f9cba8fSJoseph Mingrone ;; 1248a0ee43a1SRui Paulo i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 12496f9cba8fSJoseph Mingrone GUESS=i386-unknown-lynxos$UNAME_RELEASE 12506f9cba8fSJoseph Mingrone ;; 1251feb4ecdbSBruce M Simpson i*86:*DOS:*:*) 12526f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-msdosdjgpp 12536f9cba8fSJoseph Mingrone ;; 125457e22627SCy Schubert i*86:*:4.*:*) 125557e22627SCy Schubert UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` 12568cf6c252SPaul Traina if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 12576f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL 1258dc2c7305SBill Fenner else 12596f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL 1260dc2c7305SBill Fenner fi 12616f9cba8fSJoseph Mingrone ;; 1262a0ee43a1SRui Paulo i*86:*:5:[678]*) 1263a0ee43a1SRui Paulo # UnixWare 7.x, OpenUNIX and OpenServer 6. 1264feb4ecdbSBruce M Simpson case `/bin/uname -X | grep "^Machine"` in 1265feb4ecdbSBruce M Simpson *486*) UNAME_MACHINE=i486 ;; 1266feb4ecdbSBruce M Simpson *Pentium) UNAME_MACHINE=i586 ;; 1267feb4ecdbSBruce M Simpson *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1268feb4ecdbSBruce M Simpson esac 12696f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 12706f9cba8fSJoseph Mingrone ;; 12710a94d38fSBill Fenner i*86:*:3.2:*) 12728cf6c252SPaul Traina if test -f /usr/options/cb.name; then 12738cf6c252SPaul Traina UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 12746f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL 12758cf6c252SPaul Traina elif /bin/uname -X 2>/dev/null >/dev/null ; then 1276feb4ecdbSBruce M Simpson UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1277feb4ecdbSBruce M Simpson (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1278feb4ecdbSBruce M Simpson (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 12798cf6c252SPaul Traina && UNAME_MACHINE=i586 1280feb4ecdbSBruce M Simpson (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 1281dc2c7305SBill Fenner && UNAME_MACHINE=i686 1282feb4ecdbSBruce M Simpson (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1283dc2c7305SBill Fenner && UNAME_MACHINE=i686 12846f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL 12858cf6c252SPaul Traina else 12866f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-sysv32 12878cf6c252SPaul Traina fi 12886f9cba8fSJoseph Mingrone ;; 1289dc2c7305SBill Fenner pc:*:*:*) 1290dc2c7305SBill Fenner # Left here for compatibility: 1291dc2c7305SBill Fenner # uname -m prints for DJGPP always 'pc', but it prints nothing about 1292a0ee43a1SRui Paulo # the processor, so we play safe by assuming i586. 1293a0ee43a1SRui Paulo # Note: whatever this is, it MUST be the same as what config.sub 129457e22627SCy Schubert # prints for the "djgpp" host, or else GDB configure will decide that 1295a0ee43a1SRui Paulo # this is a cross-build. 12966f9cba8fSJoseph Mingrone GUESS=i586-pc-msdosdjgpp 12976f9cba8fSJoseph Mingrone ;; 12988cf6c252SPaul Traina Intel:Mach:3*:*) 12996f9cba8fSJoseph Mingrone GUESS=i386-pc-mach3 13006f9cba8fSJoseph Mingrone ;; 13018cf6c252SPaul Traina paragon:*:*:*) 13026f9cba8fSJoseph Mingrone GUESS=i860-intel-osf1 13036f9cba8fSJoseph Mingrone ;; 13048cf6c252SPaul Traina i860:*:4.*:*) # i860-SVR4 13058cf6c252SPaul Traina if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 13066f9cba8fSJoseph Mingrone GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 13078cf6c252SPaul Traina else # Add other i860-SVR4 vendors below as they are discovered. 13086f9cba8fSJoseph Mingrone GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 13098cf6c252SPaul Traina fi 13106f9cba8fSJoseph Mingrone ;; 13118cf6c252SPaul Traina mini*:CTIX:SYS*5:*) 13128cf6c252SPaul Traina # "miniframe" 13136f9cba8fSJoseph Mingrone GUESS=m68010-convergent-sysv 13146f9cba8fSJoseph Mingrone ;; 1315feb4ecdbSBruce M Simpson mc68k:UNIX:SYSTEM5:3.51m) 13166f9cba8fSJoseph Mingrone GUESS=m68k-convergent-sysv 13176f9cba8fSJoseph Mingrone ;; 1318feb4ecdbSBruce M Simpson M680?0:D-NIX:5.3:*) 13196f9cba8fSJoseph Mingrone GUESS=m68k-diab-dnix 13206f9cba8fSJoseph Mingrone ;; 1321a0ee43a1SRui Paulo M68*:*:R3V[5678]*:*) 1322a0ee43a1SRui Paulo test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1323a0ee43a1SRui Paulo 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) 13243052b236SBill Fenner OS_REL='' 13253052b236SBill Fenner test -r /etc/.relid \ 13263052b236SBill Fenner && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 13273052b236SBill Fenner /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 132857e22627SCy Schubert && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 13293052b236SBill Fenner /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 133057e22627SCy Schubert && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 13318cf6c252SPaul Traina 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 13323052b236SBill Fenner /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1333a0ee43a1SRui Paulo && { echo i486-ncr-sysv4; exit; } ;; 1334a0ee43a1SRui Paulo NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1335a0ee43a1SRui Paulo OS_REL='.3' 1336a0ee43a1SRui Paulo test -r /etc/.relid \ 1337a0ee43a1SRui Paulo && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1338a0ee43a1SRui Paulo /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 133957e22627SCy Schubert && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 1340a0ee43a1SRui Paulo /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 134157e22627SCy Schubert && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } 1342a0ee43a1SRui Paulo /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 134357e22627SCy Schubert && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 13440a94d38fSBill Fenner m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 13456f9cba8fSJoseph Mingrone GUESS=m68k-unknown-lynxos$UNAME_RELEASE 13466f9cba8fSJoseph Mingrone ;; 13478cf6c252SPaul Traina mc68030:UNIX_System_V:4.*:*) 13486f9cba8fSJoseph Mingrone GUESS=m68k-atari-sysv4 13496f9cba8fSJoseph Mingrone ;; 13503052b236SBill Fenner TSUNAMI:LynxOS:2.*:*) 13516f9cba8fSJoseph Mingrone GUESS=sparc-unknown-lynxos$UNAME_RELEASE 13526f9cba8fSJoseph Mingrone ;; 13530a94d38fSBill Fenner rs6000:LynxOS:2.*:*) 13546f9cba8fSJoseph Mingrone GUESS=rs6000-unknown-lynxos$UNAME_RELEASE 13556f9cba8fSJoseph Mingrone ;; 1356a0ee43a1SRui Paulo PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 13576f9cba8fSJoseph Mingrone GUESS=powerpc-unknown-lynxos$UNAME_RELEASE 13586f9cba8fSJoseph Mingrone ;; 13593052b236SBill Fenner SM[BE]S:UNIX_SV:*:*) 13606f9cba8fSJoseph Mingrone GUESS=mips-dde-sysv$UNAME_RELEASE 13616f9cba8fSJoseph Mingrone ;; 1362dc2c7305SBill Fenner RM*:ReliantUNIX-*:*:*) 13636f9cba8fSJoseph Mingrone GUESS=mips-sni-sysv4 13646f9cba8fSJoseph Mingrone ;; 13658cf6c252SPaul Traina RM*:SINIX-*:*:*) 13666f9cba8fSJoseph Mingrone GUESS=mips-sni-sysv4 13676f9cba8fSJoseph Mingrone ;; 13688cf6c252SPaul Traina *:SINIX-*:*:*) 13698cf6c252SPaul Traina if uname -p 2>/dev/null >/dev/null ; then 13708cf6c252SPaul Traina UNAME_MACHINE=`(uname -p) 2>/dev/null` 13716f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-sni-sysv4 13728cf6c252SPaul Traina else 13736f9cba8fSJoseph Mingrone GUESS=ns32k-sni-sysv 13748cf6c252SPaul Traina fi 13756f9cba8fSJoseph Mingrone ;; 1376*afdbf109SJoseph Mingrone PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort 1377dc2c7305SBill Fenner # says <Richard.M.Bartel@ccMail.Census.GOV> 13786f9cba8fSJoseph Mingrone GUESS=i586-unisys-sysv4 13796f9cba8fSJoseph Mingrone ;; 13803052b236SBill Fenner *:UNIX_System_V:4*:FTX*) 13813052b236SBill Fenner # From Gerald Hewes <hewes@openmarket.com>. 13823052b236SBill Fenner # How about differentiating between stratus architectures? -djm 13836f9cba8fSJoseph Mingrone GUESS=hppa1.1-stratus-sysv4 13846f9cba8fSJoseph Mingrone ;; 13853052b236SBill Fenner *:*:*:FTX*) 13863052b236SBill Fenner # From seanf@swdc.stratus.com. 13876f9cba8fSJoseph Mingrone GUESS=i860-stratus-sysv4 13886f9cba8fSJoseph Mingrone ;; 1389a0ee43a1SRui Paulo i*86:VOS:*:*) 1390a0ee43a1SRui Paulo # From Paul.Green@stratus.com. 13916f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-stratus-vos 13926f9cba8fSJoseph Mingrone ;; 1393feb4ecdbSBruce M Simpson *:VOS:*:*) 1394feb4ecdbSBruce M Simpson # From Paul.Green@stratus.com. 13956f9cba8fSJoseph Mingrone GUESS=hppa1.1-stratus-vos 13966f9cba8fSJoseph Mingrone ;; 13978cf6c252SPaul Traina mc68*:A/UX:*:*) 13986f9cba8fSJoseph Mingrone GUESS=m68k-apple-aux$UNAME_RELEASE 13996f9cba8fSJoseph Mingrone ;; 1400dc2c7305SBill Fenner news*:NEWS-OS:6*:*) 14016f9cba8fSJoseph Mingrone GUESS=mips-sony-newsos6 14026f9cba8fSJoseph Mingrone ;; 1403dc2c7305SBill Fenner R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 14046f9cba8fSJoseph Mingrone if test -d /usr/nec; then 14056f9cba8fSJoseph Mingrone GUESS=mips-nec-sysv$UNAME_RELEASE 14068cf6c252SPaul Traina else 14076f9cba8fSJoseph Mingrone GUESS=mips-unknown-sysv$UNAME_RELEASE 14088cf6c252SPaul Traina fi 14096f9cba8fSJoseph Mingrone ;; 1410dc2c7305SBill Fenner BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 14116f9cba8fSJoseph Mingrone GUESS=powerpc-be-beos 14126f9cba8fSJoseph Mingrone ;; 1413dc2c7305SBill Fenner BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 14146f9cba8fSJoseph Mingrone GUESS=powerpc-apple-beos 14156f9cba8fSJoseph Mingrone ;; 1416dc2c7305SBill Fenner BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 14176f9cba8fSJoseph Mingrone GUESS=i586-pc-beos 14186f9cba8fSJoseph Mingrone ;; 1419a0ee43a1SRui Paulo BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 14206f9cba8fSJoseph Mingrone GUESS=i586-pc-haiku 14216f9cba8fSJoseph Mingrone ;; 14226f9cba8fSJoseph Mingrone ppc:Haiku:*:*) # Haiku running on Apple PowerPC 14236f9cba8fSJoseph Mingrone GUESS=powerpc-apple-haiku 14246f9cba8fSJoseph Mingrone ;; 14256f9cba8fSJoseph Mingrone *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) 14266f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-haiku 14276f9cba8fSJoseph Mingrone ;; 1428dc2c7305SBill Fenner SX-4:SUPER-UX:*:*) 14296f9cba8fSJoseph Mingrone GUESS=sx4-nec-superux$UNAME_RELEASE 14306f9cba8fSJoseph Mingrone ;; 1431dc2c7305SBill Fenner SX-5:SUPER-UX:*:*) 14326f9cba8fSJoseph Mingrone GUESS=sx5-nec-superux$UNAME_RELEASE 14336f9cba8fSJoseph Mingrone ;; 1434feb4ecdbSBruce M Simpson SX-6:SUPER-UX:*:*) 14356f9cba8fSJoseph Mingrone GUESS=sx6-nec-superux$UNAME_RELEASE 14366f9cba8fSJoseph Mingrone ;; 1437a0ee43a1SRui Paulo SX-7:SUPER-UX:*:*) 14386f9cba8fSJoseph Mingrone GUESS=sx7-nec-superux$UNAME_RELEASE 14396f9cba8fSJoseph Mingrone ;; 1440a0ee43a1SRui Paulo SX-8:SUPER-UX:*:*) 14416f9cba8fSJoseph Mingrone GUESS=sx8-nec-superux$UNAME_RELEASE 14426f9cba8fSJoseph Mingrone ;; 1443a0ee43a1SRui Paulo SX-8R:SUPER-UX:*:*) 14446f9cba8fSJoseph Mingrone GUESS=sx8r-nec-superux$UNAME_RELEASE 14456f9cba8fSJoseph Mingrone ;; 144657e22627SCy Schubert SX-ACE:SUPER-UX:*:*) 14476f9cba8fSJoseph Mingrone GUESS=sxace-nec-superux$UNAME_RELEASE 14486f9cba8fSJoseph Mingrone ;; 1449dc2c7305SBill Fenner Power*:Rhapsody:*:*) 14506f9cba8fSJoseph Mingrone GUESS=powerpc-apple-rhapsody$UNAME_RELEASE 14516f9cba8fSJoseph Mingrone ;; 1452dc2c7305SBill Fenner *:Rhapsody:*:*) 14536f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE 14546f9cba8fSJoseph Mingrone ;; 14556f9cba8fSJoseph Mingrone arm64:Darwin:*:*) 14566f9cba8fSJoseph Mingrone GUESS=aarch64-apple-darwin$UNAME_RELEASE 14576f9cba8fSJoseph Mingrone ;; 1458dc2c7305SBill Fenner *:Darwin:*:*) 14596f9cba8fSJoseph Mingrone UNAME_PROCESSOR=`uname -p` 14606f9cba8fSJoseph Mingrone case $UNAME_PROCESSOR in 14616f9cba8fSJoseph Mingrone unknown) UNAME_PROCESSOR=powerpc ;; 14626f9cba8fSJoseph Mingrone esac 14636f9cba8fSJoseph Mingrone if command -v xcode-select > /dev/null 2> /dev/null && \ 14646f9cba8fSJoseph Mingrone ! xcode-select --print-path > /dev/null 2> /dev/null ; then 14656f9cba8fSJoseph Mingrone # Avoid executing cc if there is no toolchain installed as 14666f9cba8fSJoseph Mingrone # cc will be a stub that puts up a graphical alert 14676f9cba8fSJoseph Mingrone # prompting the user to install developer tools. 14686f9cba8fSJoseph Mingrone CC_FOR_BUILD=no_compiler_found 14696f9cba8fSJoseph Mingrone else 14706f9cba8fSJoseph Mingrone set_cc_for_build 1471ada6f083SXin LI fi 14726f9cba8fSJoseph Mingrone if test "$CC_FOR_BUILD" != no_compiler_found; then 1473a0ee43a1SRui Paulo if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 147457e22627SCy Schubert (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1475a0ee43a1SRui Paulo grep IS_64BIT_ARCH >/dev/null 1476a0ee43a1SRui Paulo then 1477ada6f083SXin LI case $UNAME_PROCESSOR in 1478ada6f083SXin LI i386) UNAME_PROCESSOR=x86_64 ;; 1479ada6f083SXin LI powerpc) UNAME_PROCESSOR=powerpc64 ;; 1480feb4ecdbSBruce M Simpson esac 1481ada6f083SXin LI fi 148257e22627SCy Schubert # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc 148357e22627SCy Schubert if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ 148457e22627SCy Schubert (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 148557e22627SCy Schubert grep IS_PPC >/dev/null 148657e22627SCy Schubert then 148757e22627SCy Schubert UNAME_PROCESSOR=powerpc 148857e22627SCy Schubert fi 1489ada6f083SXin LI elif test "$UNAME_PROCESSOR" = i386 ; then 14906f9cba8fSJoseph Mingrone # uname -m returns i386 or x86_64 14916f9cba8fSJoseph Mingrone UNAME_PROCESSOR=$UNAME_MACHINE 1492ada6f083SXin LI fi 14936f9cba8fSJoseph Mingrone GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE 14946f9cba8fSJoseph Mingrone ;; 1495dc2c7305SBill Fenner *:procnto*:*:* | *:QNX:[0123456789]*:*) 1496feb4ecdbSBruce M Simpson UNAME_PROCESSOR=`uname -p` 149757e22627SCy Schubert if test "$UNAME_PROCESSOR" = x86; then 1498feb4ecdbSBruce M Simpson UNAME_PROCESSOR=i386 1499dc2c7305SBill Fenner UNAME_MACHINE=pc 1500dc2c7305SBill Fenner fi 15016f9cba8fSJoseph Mingrone GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE 15026f9cba8fSJoseph Mingrone ;; 1503dc2c7305SBill Fenner *:QNX:*:4*) 15046f9cba8fSJoseph Mingrone GUESS=i386-pc-qnx 15056f9cba8fSJoseph Mingrone ;; 150657e22627SCy Schubert NEO-*:NONSTOP_KERNEL:*:*) 15076f9cba8fSJoseph Mingrone GUESS=neo-tandem-nsk$UNAME_RELEASE 15086f9cba8fSJoseph Mingrone ;; 1509ada6f083SXin LI NSE-*:NONSTOP_KERNEL:*:*) 15106f9cba8fSJoseph Mingrone GUESS=nse-tandem-nsk$UNAME_RELEASE 15116f9cba8fSJoseph Mingrone ;; 151257e22627SCy Schubert NSR-*:NONSTOP_KERNEL:*:*) 15136f9cba8fSJoseph Mingrone GUESS=nsr-tandem-nsk$UNAME_RELEASE 15146f9cba8fSJoseph Mingrone ;; 151557e22627SCy Schubert NSV-*:NONSTOP_KERNEL:*:*) 15166f9cba8fSJoseph Mingrone GUESS=nsv-tandem-nsk$UNAME_RELEASE 15176f9cba8fSJoseph Mingrone ;; 151857e22627SCy Schubert NSX-*:NONSTOP_KERNEL:*:*) 15196f9cba8fSJoseph Mingrone GUESS=nsx-tandem-nsk$UNAME_RELEASE 15206f9cba8fSJoseph Mingrone ;; 1521dc2c7305SBill Fenner *:NonStop-UX:*:*) 15226f9cba8fSJoseph Mingrone GUESS=mips-compaq-nonstopux 15236f9cba8fSJoseph Mingrone ;; 1524dc2c7305SBill Fenner BS2000:POSIX*:*:*) 15256f9cba8fSJoseph Mingrone GUESS=bs2000-siemens-sysv 15266f9cba8fSJoseph Mingrone ;; 1527dc2c7305SBill Fenner DS/*:UNIX_System_V:*:*) 15286f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE 15296f9cba8fSJoseph Mingrone ;; 1530dc2c7305SBill Fenner *:Plan9:*:*) 1531dc2c7305SBill Fenner # "uname -m" is not consistent, so use $cputype instead. 386 1532dc2c7305SBill Fenner # is converted to i386 for consistency with other x86 1533dc2c7305SBill Fenner # operating systems. 15346f9cba8fSJoseph Mingrone if test "${cputype-}" = 386; then 1535dc2c7305SBill Fenner UNAME_MACHINE=i386 15366f9cba8fSJoseph Mingrone elif test "x${cputype-}" != x; then 15376f9cba8fSJoseph Mingrone UNAME_MACHINE=$cputype 1538dc2c7305SBill Fenner fi 15396f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-plan9 15406f9cba8fSJoseph Mingrone ;; 15410a94d38fSBill Fenner *:TOPS-10:*:*) 15426f9cba8fSJoseph Mingrone GUESS=pdp10-unknown-tops10 15436f9cba8fSJoseph Mingrone ;; 15440a94d38fSBill Fenner *:TENEX:*:*) 15456f9cba8fSJoseph Mingrone GUESS=pdp10-unknown-tenex 15466f9cba8fSJoseph Mingrone ;; 15470a94d38fSBill Fenner KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 15486f9cba8fSJoseph Mingrone GUESS=pdp10-dec-tops20 15496f9cba8fSJoseph Mingrone ;; 15500a94d38fSBill Fenner XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 15516f9cba8fSJoseph Mingrone GUESS=pdp10-xkl-tops20 15526f9cba8fSJoseph Mingrone ;; 15530a94d38fSBill Fenner *:TOPS-20:*:*) 15546f9cba8fSJoseph Mingrone GUESS=pdp10-unknown-tops20 15556f9cba8fSJoseph Mingrone ;; 15560a94d38fSBill Fenner *:ITS:*:*) 15576f9cba8fSJoseph Mingrone GUESS=pdp10-unknown-its 15586f9cba8fSJoseph Mingrone ;; 1559feb4ecdbSBruce M Simpson SEI:*:*:SEIUX) 15606f9cba8fSJoseph Mingrone GUESS=mips-sei-seiux$UNAME_RELEASE 15616f9cba8fSJoseph Mingrone ;; 1562a0ee43a1SRui Paulo *:DragonFly:*:*) 15636f9cba8fSJoseph Mingrone DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 15646f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL 15656f9cba8fSJoseph Mingrone ;; 1566a0ee43a1SRui Paulo *:*VMS:*:*) 1567a0ee43a1SRui Paulo UNAME_MACHINE=`(uname -p) 2>/dev/null` 15686f9cba8fSJoseph Mingrone case $UNAME_MACHINE in 15696f9cba8fSJoseph Mingrone A*) GUESS=alpha-dec-vms ;; 15706f9cba8fSJoseph Mingrone I*) GUESS=ia64-dec-vms ;; 15716f9cba8fSJoseph Mingrone V*) GUESS=vax-dec-vms ;; 1572a0ee43a1SRui Paulo esac ;; 1573a0ee43a1SRui Paulo *:XENIX:*:SysV) 15746f9cba8fSJoseph Mingrone GUESS=i386-pc-xenix 15756f9cba8fSJoseph Mingrone ;; 1576a0ee43a1SRui Paulo i*86:skyos:*:*) 15776f9cba8fSJoseph Mingrone SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` 15786f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL 15796f9cba8fSJoseph Mingrone ;; 1580a0ee43a1SRui Paulo i*86:rdos:*:*) 15816f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-rdos 15826f9cba8fSJoseph Mingrone ;; 15836f9cba8fSJoseph Mingrone i*86:Fiwix:*:*) 15846f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-pc-fiwix 15856f9cba8fSJoseph Mingrone ;; 15866f9cba8fSJoseph Mingrone *:AROS:*:*) 15876f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-aros 15886f9cba8fSJoseph Mingrone ;; 1589681ed54cSXin LI x86_64:VMkernel:*:*) 15906f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-esx 15916f9cba8fSJoseph Mingrone ;; 159257e22627SCy Schubert amd64:Isilon\ OneFS:*:*) 15936f9cba8fSJoseph Mingrone GUESS=x86_64-unknown-onefs 15946f9cba8fSJoseph Mingrone ;; 15956f9cba8fSJoseph Mingrone *:Unleashed:*:*) 15966f9cba8fSJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE 15976f9cba8fSJoseph Mingrone ;; 1598*afdbf109SJoseph Mingrone *:Ironclad:*:*) 1599*afdbf109SJoseph Mingrone GUESS=$UNAME_MACHINE-unknown-ironclad 1600*afdbf109SJoseph Mingrone ;; 16018cf6c252SPaul Trainaesac 16028cf6c252SPaul Traina 16036f9cba8fSJoseph Mingrone# Do we have a guess based on uname results? 16046f9cba8fSJoseph Mingroneif test "x$GUESS" != x; then 16056f9cba8fSJoseph Mingrone echo "$GUESS" 16066f9cba8fSJoseph Mingrone exit 16076f9cba8fSJoseph Mingronefi 16086f9cba8fSJoseph Mingrone 16096f9cba8fSJoseph Mingrone# No uname command or uname output not recognized. 16106f9cba8fSJoseph Mingroneset_cc_for_build 16116f9cba8fSJoseph Mingronecat > "$dummy.c" <<EOF 16126f9cba8fSJoseph Mingrone#ifdef _SEQUENT_ 16136f9cba8fSJoseph Mingrone#include <sys/types.h> 16146f9cba8fSJoseph Mingrone#include <sys/utsname.h> 16156f9cba8fSJoseph Mingrone#endif 16166f9cba8fSJoseph Mingrone#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 16176f9cba8fSJoseph Mingrone#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 16186f9cba8fSJoseph Mingrone#include <signal.h> 16196f9cba8fSJoseph Mingrone#if defined(_SIZE_T_) || defined(SIGLOST) 16206f9cba8fSJoseph Mingrone#include <sys/utsname.h> 16216f9cba8fSJoseph Mingrone#endif 16226f9cba8fSJoseph Mingrone#endif 16236f9cba8fSJoseph Mingrone#endif 16246f9cba8fSJoseph Mingronemain () 16256f9cba8fSJoseph Mingrone{ 16266f9cba8fSJoseph Mingrone#if defined (sony) 16276f9cba8fSJoseph Mingrone#if defined (MIPSEB) 16286f9cba8fSJoseph Mingrone /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 16296f9cba8fSJoseph Mingrone I don't know.... */ 16306f9cba8fSJoseph Mingrone printf ("mips-sony-bsd\n"); exit (0); 16316f9cba8fSJoseph Mingrone#else 16326f9cba8fSJoseph Mingrone#include <sys/param.h> 16336f9cba8fSJoseph Mingrone printf ("m68k-sony-newsos%s\n", 16346f9cba8fSJoseph Mingrone#ifdef NEWSOS4 16356f9cba8fSJoseph Mingrone "4" 16366f9cba8fSJoseph Mingrone#else 16376f9cba8fSJoseph Mingrone "" 16386f9cba8fSJoseph Mingrone#endif 16396f9cba8fSJoseph Mingrone ); exit (0); 16406f9cba8fSJoseph Mingrone#endif 16416f9cba8fSJoseph Mingrone#endif 16426f9cba8fSJoseph Mingrone 16436f9cba8fSJoseph Mingrone#if defined (NeXT) 16446f9cba8fSJoseph Mingrone#if !defined (__ARCHITECTURE__) 16456f9cba8fSJoseph Mingrone#define __ARCHITECTURE__ "m68k" 16466f9cba8fSJoseph Mingrone#endif 16476f9cba8fSJoseph Mingrone int version; 16486f9cba8fSJoseph Mingrone version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 16496f9cba8fSJoseph Mingrone if (version < 4) 16506f9cba8fSJoseph Mingrone printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 16516f9cba8fSJoseph Mingrone else 16526f9cba8fSJoseph Mingrone printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 16536f9cba8fSJoseph Mingrone exit (0); 16546f9cba8fSJoseph Mingrone#endif 16556f9cba8fSJoseph Mingrone 16566f9cba8fSJoseph Mingrone#if defined (MULTIMAX) || defined (n16) 16576f9cba8fSJoseph Mingrone#if defined (UMAXV) 16586f9cba8fSJoseph Mingrone printf ("ns32k-encore-sysv\n"); exit (0); 16596f9cba8fSJoseph Mingrone#else 16606f9cba8fSJoseph Mingrone#if defined (CMU) 16616f9cba8fSJoseph Mingrone printf ("ns32k-encore-mach\n"); exit (0); 16626f9cba8fSJoseph Mingrone#else 16636f9cba8fSJoseph Mingrone printf ("ns32k-encore-bsd\n"); exit (0); 16646f9cba8fSJoseph Mingrone#endif 16656f9cba8fSJoseph Mingrone#endif 16666f9cba8fSJoseph Mingrone#endif 16676f9cba8fSJoseph Mingrone 16686f9cba8fSJoseph Mingrone#if defined (__386BSD__) 16696f9cba8fSJoseph Mingrone printf ("i386-pc-bsd\n"); exit (0); 16706f9cba8fSJoseph Mingrone#endif 16716f9cba8fSJoseph Mingrone 16726f9cba8fSJoseph Mingrone#if defined (sequent) 16736f9cba8fSJoseph Mingrone#if defined (i386) 16746f9cba8fSJoseph Mingrone printf ("i386-sequent-dynix\n"); exit (0); 16756f9cba8fSJoseph Mingrone#endif 16766f9cba8fSJoseph Mingrone#if defined (ns32000) 16776f9cba8fSJoseph Mingrone printf ("ns32k-sequent-dynix\n"); exit (0); 16786f9cba8fSJoseph Mingrone#endif 16796f9cba8fSJoseph Mingrone#endif 16806f9cba8fSJoseph Mingrone 16816f9cba8fSJoseph Mingrone#if defined (_SEQUENT_) 16826f9cba8fSJoseph Mingrone struct utsname un; 16836f9cba8fSJoseph Mingrone 16846f9cba8fSJoseph Mingrone uname(&un); 16856f9cba8fSJoseph Mingrone if (strncmp(un.version, "V2", 2) == 0) { 16866f9cba8fSJoseph Mingrone printf ("i386-sequent-ptx2\n"); exit (0); 16876f9cba8fSJoseph Mingrone } 16886f9cba8fSJoseph Mingrone if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 16896f9cba8fSJoseph Mingrone printf ("i386-sequent-ptx1\n"); exit (0); 16906f9cba8fSJoseph Mingrone } 16916f9cba8fSJoseph Mingrone printf ("i386-sequent-ptx\n"); exit (0); 16926f9cba8fSJoseph Mingrone#endif 16936f9cba8fSJoseph Mingrone 16946f9cba8fSJoseph Mingrone#if defined (vax) 16956f9cba8fSJoseph Mingrone#if !defined (ultrix) 16966f9cba8fSJoseph Mingrone#include <sys/param.h> 16976f9cba8fSJoseph Mingrone#if defined (BSD) 16986f9cba8fSJoseph Mingrone#if BSD == 43 16996f9cba8fSJoseph Mingrone printf ("vax-dec-bsd4.3\n"); exit (0); 17006f9cba8fSJoseph Mingrone#else 17016f9cba8fSJoseph Mingrone#if BSD == 199006 17026f9cba8fSJoseph Mingrone printf ("vax-dec-bsd4.3reno\n"); exit (0); 17036f9cba8fSJoseph Mingrone#else 17046f9cba8fSJoseph Mingrone printf ("vax-dec-bsd\n"); exit (0); 17056f9cba8fSJoseph Mingrone#endif 17066f9cba8fSJoseph Mingrone#endif 17076f9cba8fSJoseph Mingrone#else 17086f9cba8fSJoseph Mingrone printf ("vax-dec-bsd\n"); exit (0); 17096f9cba8fSJoseph Mingrone#endif 17106f9cba8fSJoseph Mingrone#else 17116f9cba8fSJoseph Mingrone#if defined(_SIZE_T_) || defined(SIGLOST) 17126f9cba8fSJoseph Mingrone struct utsname un; 17136f9cba8fSJoseph Mingrone uname (&un); 17146f9cba8fSJoseph Mingrone printf ("vax-dec-ultrix%s\n", un.release); exit (0); 17156f9cba8fSJoseph Mingrone#else 17166f9cba8fSJoseph Mingrone printf ("vax-dec-ultrix\n"); exit (0); 17176f9cba8fSJoseph Mingrone#endif 17186f9cba8fSJoseph Mingrone#endif 17196f9cba8fSJoseph Mingrone#endif 17206f9cba8fSJoseph Mingrone#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 17216f9cba8fSJoseph Mingrone#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 17226f9cba8fSJoseph Mingrone#if defined(_SIZE_T_) || defined(SIGLOST) 17236f9cba8fSJoseph Mingrone struct utsname *un; 17246f9cba8fSJoseph Mingrone uname (&un); 17256f9cba8fSJoseph Mingrone printf ("mips-dec-ultrix%s\n", un.release); exit (0); 17266f9cba8fSJoseph Mingrone#else 17276f9cba8fSJoseph Mingrone printf ("mips-dec-ultrix\n"); exit (0); 17286f9cba8fSJoseph Mingrone#endif 17296f9cba8fSJoseph Mingrone#endif 17306f9cba8fSJoseph Mingrone#endif 17316f9cba8fSJoseph Mingrone 17326f9cba8fSJoseph Mingrone#if defined (alliant) && defined (i860) 17336f9cba8fSJoseph Mingrone printf ("i860-alliant-bsd\n"); exit (0); 17346f9cba8fSJoseph Mingrone#endif 17356f9cba8fSJoseph Mingrone 17366f9cba8fSJoseph Mingrone exit (1); 17376f9cba8fSJoseph Mingrone} 17386f9cba8fSJoseph MingroneEOF 17396f9cba8fSJoseph Mingrone 17406f9cba8fSJoseph Mingrone$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && 17416f9cba8fSJoseph Mingrone { echo "$SYSTEM_NAME"; exit; } 17426f9cba8fSJoseph Mingrone 17436f9cba8fSJoseph Mingrone# Apollos put the system type in the environment. 17446f9cba8fSJoseph Mingronetest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } 17456f9cba8fSJoseph Mingrone 174657e22627SCy Schubertecho "$0: unable to guess system type" >&2 174757e22627SCy Schubert 17486f9cba8fSJoseph Mingronecase $UNAME_MACHINE:$UNAME_SYSTEM in 174957e22627SCy Schubert mips:Linux | mips64:Linux) 175057e22627SCy Schubert # If we got here on MIPS GNU/Linux, output extra information. 1751dc2c7305SBill Fenner cat >&2 <<EOF 1752dc2c7305SBill Fenner 175357e22627SCy SchubertNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize 175457e22627SCy Schubertthe system type. Please install a C compiler and try again. 175557e22627SCy SchubertEOF 175657e22627SCy Schubert ;; 175757e22627SCy Schubertesac 1758dc2c7305SBill Fenner 175957e22627SCy Schubertcat >&2 <<EOF 176057e22627SCy Schubert 176157e22627SCy SchubertThis script (version $timestamp), has failed to recognize the 176257e22627SCy Schubertoperating system you are using. If your script is old, overwrite *all* 176357e22627SCy Schubertcopies of config.guess and config.sub with the latest versions from: 176457e22627SCy Schubert 17656f9cba8fSJoseph Mingrone https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 1766a0ee43a1SRui Pauloand 17676f9cba8fSJoseph Mingrone https://git.savannah.gnu.org/cgit/config.git/plain/config.sub 17686f9cba8fSJoseph MingroneEOF 17696f9cba8fSJoseph Mingrone 17706f9cba8fSJoseph Mingroneour_year=`echo $timestamp | sed 's,-.*,,'` 17716f9cba8fSJoseph Mingronethisyear=`date +%Y` 17726f9cba8fSJoseph Mingrone# shellcheck disable=SC2003 17736f9cba8fSJoseph Mingronescript_age=`expr "$thisyear" - "$our_year"` 17746f9cba8fSJoseph Mingroneif test "$script_age" -lt 3 ; then 17756f9cba8fSJoseph Mingrone cat >&2 <<EOF 1776dc2c7305SBill Fenner 177757e22627SCy SchubertIf $0 has already been updated, send the following data and any 177857e22627SCy Schubertinformation you think might be pertinent to config-patches@gnu.org to 177957e22627SCy Schubertprovide the necessary information to handle your system. 1780dc2c7305SBill Fenner 17810a94d38fSBill Fennerconfig.guess timestamp = $timestamp 1782dc2c7305SBill Fenner 1783dc2c7305SBill Fenneruname -m = `(uname -m) 2>/dev/null || echo unknown` 1784dc2c7305SBill Fenneruname -r = `(uname -r) 2>/dev/null || echo unknown` 1785dc2c7305SBill Fenneruname -s = `(uname -s) 2>/dev/null || echo unknown` 1786dc2c7305SBill Fenneruname -v = `(uname -v) 2>/dev/null || echo unknown` 1787dc2c7305SBill Fenner 1788dc2c7305SBill Fenner/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1789dc2c7305SBill Fenner/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1790dc2c7305SBill Fenner 1791dc2c7305SBill Fennerhostinfo = `(hostinfo) 2>/dev/null` 1792dc2c7305SBill Fenner/bin/universe = `(/bin/universe) 2>/dev/null` 1793dc2c7305SBill Fenner/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1794dc2c7305SBill Fenner/bin/arch = `(/bin/arch) 2>/dev/null` 1795dc2c7305SBill Fenner/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1796dc2c7305SBill Fenner/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1797dc2c7305SBill Fenner 179857e22627SCy SchubertUNAME_MACHINE = "$UNAME_MACHINE" 179957e22627SCy SchubertUNAME_RELEASE = "$UNAME_RELEASE" 180057e22627SCy SchubertUNAME_SYSTEM = "$UNAME_SYSTEM" 180157e22627SCy SchubertUNAME_VERSION = "$UNAME_VERSION" 1802dc2c7305SBill FennerEOF 18036f9cba8fSJoseph Mingronefi 18048cf6c252SPaul Traina 18058cf6c252SPaul Trainaexit 1 1806dc2c7305SBill Fenner 1807dc2c7305SBill Fenner# Local variables: 180857e22627SCy Schubert# eval: (add-hook 'before-save-hook 'time-stamp) 1809dc2c7305SBill Fenner# time-stamp-start: "timestamp='" 1810dc2c7305SBill Fenner# time-stamp-format: "%:y-%02m-%02d" 1811dc2c7305SBill Fenner# time-stamp-end: "'" 1812dc2c7305SBill Fenner# End: 1813