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