11abf7346Smrg#! /bin/sh 21abf7346Smrg# Attempt to guess a canonical system name. 3a5a2a776Smrg# Copyright 1992-2023 Free Software Foundation, Inc. 41abf7346Smrg 5a5a2a776Smrg# shellcheck disable=SC2006,SC2268 # see below for rationale 6a5a2a776Smrg 7a5a2a776Smrgtimestamp='2023-01-01' 81abf7346Smrg 91abf7346Smrg# This file is free software; you can redistribute it and/or modify it 101abf7346Smrg# under the terms of the GNU General Public License as published by 11a5a2a776Smrg# the Free Software Foundation, either version 3 of the License, or 121abf7346Smrg# (at your option) any later version. 131abf7346Smrg# 141abf7346Smrg# This program is distributed in the hope that it will be useful, but 151abf7346Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 161abf7346Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 171abf7346Smrg# General Public License for more details. 181abf7346Smrg# 191abf7346Smrg# You should have received a copy of the GNU General Public License 20ae5a67adSmrg# along with this program; if not, see <https://www.gnu.org/licenses/>. 211abf7346Smrg# 221abf7346Smrg# As a special exception to the GNU General Public License, if you 231abf7346Smrg# distribute this file as part of a program that contains a 241abf7346Smrg# configuration script generated by Autoconf, you may include it under 256d36ef34Smrg# the same distribution terms that you use for the rest of that 266d36ef34Smrg# program. This Exception is an additional permission under section 7 276d36ef34Smrg# of the GNU General Public License, version 3 ("GPLv3"). 281abf7346Smrg# 29da4a0041Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 301abf7346Smrg# 3123a8d56dSmrg# You can get the latest version of this script from: 32a5a2a776Smrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 336d36ef34Smrg# 34da4a0041Smrg# Please send patches to <config-patches@gnu.org>. 356d36ef34Smrg 361abf7346Smrg 37a5a2a776Smrg# The "shellcheck disable" line above the timestamp inhibits complaints 38a5a2a776Smrg# about features and limitations of the classic Bourne shell that were 39a5a2a776Smrg# superseded or lifted in POSIX. However, this script identifies a wide 40a5a2a776Smrg# variety of pre-POSIX systems that do not have POSIX shells at all, and 41a5a2a776Smrg# even some reasonably current systems (Solaris 10 as case-in-point) still 42a5a2a776Smrg# have a pre-POSIX /bin/sh. 43a5a2a776Smrg 44a5a2a776Smrg 451abf7346Smrgme=`echo "$0" | sed -e 's,.*/,,'` 461abf7346Smrg 471abf7346Smrgusage="\ 481abf7346SmrgUsage: $0 [OPTION] 491abf7346Smrg 501abf7346SmrgOutput the configuration name of the system \`$me' is run on. 511abf7346Smrg 52ae5a67adSmrgOptions: 531abf7346Smrg -h, --help print this help, then exit 541abf7346Smrg -t, --time-stamp print date of last modification, then exit 551abf7346Smrg -v, --version print version number, then exit 561abf7346Smrg 571abf7346SmrgReport bugs and patches to <config-patches@gnu.org>." 581abf7346Smrg 591abf7346Smrgversion="\ 601abf7346SmrgGNU config.guess ($timestamp) 611abf7346Smrg 621abf7346SmrgOriginally written by Per Bothner. 63a5a2a776SmrgCopyright 1992-2023 Free Software Foundation, Inc. 641abf7346Smrg 651abf7346SmrgThis is free software; see the source for copying conditions. There is NO 661abf7346Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 671abf7346Smrg 681abf7346Smrghelp=" 691abf7346SmrgTry \`$me --help' for more information." 701abf7346Smrg 711abf7346Smrg# Parse command line 721abf7346Smrgwhile test $# -gt 0 ; do 731abf7346Smrg case $1 in 741abf7346Smrg --time-stamp | --time* | -t ) 751abf7346Smrg echo "$timestamp" ; exit ;; 761abf7346Smrg --version | -v ) 771abf7346Smrg echo "$version" ; exit ;; 781abf7346Smrg --help | --h* | -h ) 791abf7346Smrg echo "$usage"; exit ;; 801abf7346Smrg -- ) # Stop option processing 811abf7346Smrg shift; break ;; 821abf7346Smrg - ) # Use stdin as input. 831abf7346Smrg break ;; 841abf7346Smrg -* ) 851abf7346Smrg echo "$me: invalid option $1$help" >&2 861abf7346Smrg exit 1 ;; 871abf7346Smrg * ) 881abf7346Smrg break ;; 891abf7346Smrg esac 901abf7346Smrgdone 911abf7346Smrg 921abf7346Smrgif test $# != 0; then 931abf7346Smrg echo "$me: too many arguments$help" >&2 941abf7346Smrg exit 1 951abf7346Smrgfi 961abf7346Smrg 97a5a2a776Smrg# Just in case it came from the environment. 98a5a2a776SmrgGUESS= 991abf7346Smrg 1001abf7346Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 1011abf7346Smrg# compiler to aid in system detection is discouraged as it requires 1021abf7346Smrg# temporary files to be created and, as you can see below, it is a 1031abf7346Smrg# headache to deal with in a portable fashion. 1041abf7346Smrg 1051abf7346Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 1061abf7346Smrg# use `HOST_CC' if defined, but it is deprecated. 1071abf7346Smrg 1081abf7346Smrg# Portable tmp directory creation inspired by the Autoconf team. 1091abf7346Smrg 110a5a2a776Smrgtmp= 111a5a2a776Smrg# shellcheck disable=SC2172 112a5a2a776Smrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 113a5a2a776Smrg 114a5a2a776Smrgset_cc_for_build() { 115a5a2a776Smrg # prevent multiple calls if $tmp is already set 116a5a2a776Smrg test "$tmp" && return 0 117a5a2a776Smrg : "${TMPDIR=/tmp}" 118a5a2a776Smrg # shellcheck disable=SC2039,SC3028 119a5a2a776Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 120a5a2a776Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || 121a5a2a776Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || 122a5a2a776Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } 123a5a2a776Smrg dummy=$tmp/dummy 124a5a2a776Smrg case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in 125a5a2a776Smrg ,,) echo "int x;" > "$dummy.c" 126a5a2a776Smrg for driver in cc gcc c89 c99 ; do 127a5a2a776Smrg if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then 128a5a2a776Smrg CC_FOR_BUILD=$driver 129a5a2a776Smrg break 130a5a2a776Smrg fi 131a5a2a776Smrg done 132a5a2a776Smrg if test x"$CC_FOR_BUILD" = x ; then 133a5a2a776Smrg CC_FOR_BUILD=no_compiler_found 134a5a2a776Smrg fi 135a5a2a776Smrg ;; 136a5a2a776Smrg ,,*) CC_FOR_BUILD=$CC ;; 137a5a2a776Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 138a5a2a776Smrg esac 139a5a2a776Smrg} 1401abf7346Smrg 1411abf7346Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 1421abf7346Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 143a5a2a776Smrgif test -f /.attbin/uname ; then 1441abf7346Smrg PATH=$PATH:/.attbin ; export PATH 1451abf7346Smrgfi 1461abf7346Smrg 1471abf7346SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 1481abf7346SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 149a5a2a776SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 1501abf7346SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 1511abf7346Smrg 152a5a2a776Smrgcase $UNAME_SYSTEM in 1536d36ef34SmrgLinux|GNU|GNU/*) 154a5a2a776Smrg LIBC=unknown 1556d36ef34Smrg 156a5a2a776Smrg set_cc_for_build 157ae5a67adSmrg cat <<-EOF > "$dummy.c" 1586d36ef34Smrg #include <features.h> 1596d36ef34Smrg #if defined(__UCLIBC__) 1606d36ef34Smrg LIBC=uclibc 1616d36ef34Smrg #elif defined(__dietlibc__) 1626d36ef34Smrg LIBC=dietlibc 163a5a2a776Smrg #elif defined(__GLIBC__) 1646d36ef34Smrg LIBC=gnu 165a5a2a776Smrg #else 166a5a2a776Smrg #include <stdarg.h> 167a5a2a776Smrg /* First heuristic to detect musl libc. */ 168a5a2a776Smrg #ifdef __DEFINED_va_list 169a5a2a776Smrg LIBC=musl 170a5a2a776Smrg #endif 1716d36ef34Smrg #endif 1726d36ef34Smrg EOF 173a5a2a776Smrg cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` 174a5a2a776Smrg eval "$cc_set_libc" 175ae5a67adSmrg 176a5a2a776Smrg # Second heuristic to detect musl libc. 177a5a2a776Smrg if [ "$LIBC" = unknown ] && 178a5a2a776Smrg command -v ldd >/dev/null && 179a5a2a776Smrg ldd --version 2>&1 | grep -q ^musl; then 180a5a2a776Smrg LIBC=musl 181a5a2a776Smrg fi 182a5a2a776Smrg 183a5a2a776Smrg # If the system lacks a compiler, then just pick glibc. 184a5a2a776Smrg # We could probably try harder. 185a5a2a776Smrg if [ "$LIBC" = unknown ]; then 186a5a2a776Smrg LIBC=gnu 187ae5a67adSmrg fi 1886d36ef34Smrg ;; 1896d36ef34Smrgesac 1906d36ef34Smrg 1911abf7346Smrg# Note: order is significant - the case branches are not exclusive. 1921abf7346Smrg 193a5a2a776Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in 1941abf7346Smrg *:NetBSD:*:*) 1951abf7346Smrg # NetBSD (nbsd) targets should (where applicable) match one or 1966d36ef34Smrg # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 1971abf7346Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 1981abf7346Smrg # switched to ELF, *-*-netbsd* would select the old 1991abf7346Smrg # object file format. This provides both forward 2001abf7346Smrg # compatibility and a consistent mechanism for selecting the 2011abf7346Smrg # object file format. 2021abf7346Smrg # 2031abf7346Smrg # Note: NetBSD doesn't particularly care about the vendor 2041abf7346Smrg # portion of the name. We always set it to "unknown". 205ae5a67adSmrg UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ 206a5a2a776Smrg /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 207a5a2a776Smrg /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 208ae5a67adSmrg echo unknown)` 209a5a2a776Smrg case $UNAME_MACHINE_ARCH in 210a5a2a776Smrg aarch64eb) machine=aarch64_be-unknown ;; 2111abf7346Smrg armeb) machine=armeb-unknown ;; 2121abf7346Smrg arm*) machine=arm-unknown ;; 2131abf7346Smrg sh3el) machine=shl-unknown ;; 2141abf7346Smrg sh3eb) machine=sh-unknown ;; 2158b6d6341Smrg sh5el) machine=sh5le-unknown ;; 216ae5a67adSmrg earmv*) 217ae5a67adSmrg arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` 218ae5a67adSmrg endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` 219a5a2a776Smrg machine=${arch}${endian}-unknown 220ae5a67adSmrg ;; 221a5a2a776Smrg *) machine=$UNAME_MACHINE_ARCH-unknown ;; 2221abf7346Smrg esac 2231abf7346Smrg # The Operating System including object format, if it has switched 224ae5a67adSmrg # to ELF recently (or will in the future) and ABI. 225a5a2a776Smrg case $UNAME_MACHINE_ARCH in 226ae5a67adSmrg earm*) 227ae5a67adSmrg os=netbsdelf 228ae5a67adSmrg ;; 2291abf7346Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 230a5a2a776Smrg set_cc_for_build 2311abf7346Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 23223a8d56dSmrg | grep -q __ELF__ 2331abf7346Smrg then 2341abf7346Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 2351abf7346Smrg # Return netbsd for either. FIX? 2361abf7346Smrg os=netbsd 2371abf7346Smrg else 2381abf7346Smrg os=netbsdelf 2391abf7346Smrg fi 2401abf7346Smrg ;; 2411abf7346Smrg *) 2426d36ef34Smrg os=netbsd 2431abf7346Smrg ;; 2441abf7346Smrg esac 245ae5a67adSmrg # Determine ABI tags. 246a5a2a776Smrg case $UNAME_MACHINE_ARCH in 247ae5a67adSmrg earm*) 248ae5a67adSmrg expr='s/^earmv[0-9]/-eabi/;s/eb$//' 249ae5a67adSmrg abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` 250ae5a67adSmrg ;; 251ae5a67adSmrg esac 2521abf7346Smrg # The OS release 2531abf7346Smrg # Debian GNU/NetBSD machines have a different userland, and 2541abf7346Smrg # thus, need a distinct triplet. However, they do not need 2551abf7346Smrg # kernel version information, so it can be replaced with a 2561abf7346Smrg # suitable tag, in the style of linux-gnu. 257a5a2a776Smrg case $UNAME_VERSION in 2581abf7346Smrg Debian*) 2591abf7346Smrg release='-gnu' 2601abf7346Smrg ;; 2611abf7346Smrg *) 262ae5a67adSmrg release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` 2631abf7346Smrg ;; 2641abf7346Smrg esac 2651abf7346Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 2661abf7346Smrg # contains redundant information, the shorter form: 2671abf7346Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 268a5a2a776Smrg GUESS=$machine-${os}${release}${abi-} 269a5a2a776Smrg ;; 2706d36ef34Smrg *:Bitrig:*:*) 2716d36ef34Smrg UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 272a5a2a776Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE 273a5a2a776Smrg ;; 2741abf7346Smrg *:OpenBSD:*:*) 2751abf7346Smrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 276a5a2a776Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE 277a5a2a776Smrg ;; 278a5a2a776Smrg *:SecBSD:*:*) 279a5a2a776Smrg UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` 280a5a2a776Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE 281a5a2a776Smrg ;; 282ae5a67adSmrg *:LibertyBSD:*:*) 283ae5a67adSmrg UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` 284a5a2a776Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE 285a5a2a776Smrg ;; 286ae5a67adSmrg *:MidnightBSD:*:*) 287a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE 288a5a2a776Smrg ;; 2891abf7346Smrg *:ekkoBSD:*:*) 290a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE 291a5a2a776Smrg ;; 2921abf7346Smrg *:SolidBSD:*:*) 293a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE 294a5a2a776Smrg ;; 295a5a2a776Smrg *:OS108:*:*) 296a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE 297a5a2a776Smrg ;; 2981abf7346Smrg macppc:MirBSD:*:*) 299a5a2a776Smrg GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE 300a5a2a776Smrg ;; 3011abf7346Smrg *:MirBSD:*:*) 302a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE 303a5a2a776Smrg ;; 304ae5a67adSmrg *:Sortix:*:*) 305a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-sortix 306a5a2a776Smrg ;; 307a5a2a776Smrg *:Twizzler:*:*) 308a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-twizzler 309a5a2a776Smrg ;; 310ae5a67adSmrg *:Redox:*:*) 311a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-redox 312a5a2a776Smrg ;; 313ae5a67adSmrg mips:OSF1:*.*) 314a5a2a776Smrg GUESS=mips-dec-osf1 315a5a2a776Smrg ;; 3161abf7346Smrg alpha:OSF1:*:*) 317a5a2a776Smrg # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 318a5a2a776Smrg trap '' 0 3191abf7346Smrg case $UNAME_RELEASE in 3201abf7346Smrg *4.0) 3211abf7346Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 3221abf7346Smrg ;; 3231abf7346Smrg *5.*) 3246d36ef34Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 3251abf7346Smrg ;; 3261abf7346Smrg esac 3271abf7346Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 3281abf7346Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 3291abf7346Smrg # covers most systems running today. This code pipes the CPU 3301abf7346Smrg # types through head -n 1, so we only detect the type of CPU 0. 3311abf7346Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 332a5a2a776Smrg case $ALPHA_CPU_TYPE in 3331abf7346Smrg "EV4 (21064)") 334ae5a67adSmrg UNAME_MACHINE=alpha ;; 3351abf7346Smrg "EV4.5 (21064)") 336ae5a67adSmrg UNAME_MACHINE=alpha ;; 3371abf7346Smrg "LCA4 (21066/21068)") 338ae5a67adSmrg UNAME_MACHINE=alpha ;; 3391abf7346Smrg "EV5 (21164)") 340ae5a67adSmrg UNAME_MACHINE=alphaev5 ;; 3411abf7346Smrg "EV5.6 (21164A)") 342ae5a67adSmrg UNAME_MACHINE=alphaev56 ;; 3431abf7346Smrg "EV5.6 (21164PC)") 344ae5a67adSmrg UNAME_MACHINE=alphapca56 ;; 3451abf7346Smrg "EV5.7 (21164PC)") 346ae5a67adSmrg UNAME_MACHINE=alphapca57 ;; 3471abf7346Smrg "EV6 (21264)") 348ae5a67adSmrg UNAME_MACHINE=alphaev6 ;; 3491abf7346Smrg "EV6.7 (21264A)") 350ae5a67adSmrg UNAME_MACHINE=alphaev67 ;; 3511abf7346Smrg "EV6.8CB (21264C)") 352ae5a67adSmrg UNAME_MACHINE=alphaev68 ;; 3531abf7346Smrg "EV6.8AL (21264B)") 354ae5a67adSmrg UNAME_MACHINE=alphaev68 ;; 3551abf7346Smrg "EV6.8CX (21264D)") 356ae5a67adSmrg UNAME_MACHINE=alphaev68 ;; 3571abf7346Smrg "EV6.9A (21264/EV69A)") 358ae5a67adSmrg UNAME_MACHINE=alphaev69 ;; 3591abf7346Smrg "EV7 (21364)") 360ae5a67adSmrg UNAME_MACHINE=alphaev7 ;; 3611abf7346Smrg "EV7.9 (21364A)") 362ae5a67adSmrg UNAME_MACHINE=alphaev79 ;; 3631abf7346Smrg esac 3641abf7346Smrg # A Pn.n version is a patched version. 3651abf7346Smrg # A Vn.n version is a released version. 3661abf7346Smrg # A Tn.n version is a released field test version. 3671abf7346Smrg # A Xn.n version is an unreleased experimental baselevel. 3681abf7346Smrg # 1.2 uses "1.2" for uname -r. 369a5a2a776Smrg OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 370a5a2a776Smrg GUESS=$UNAME_MACHINE-dec-osf$OSF_REL 371a5a2a776Smrg ;; 3721abf7346Smrg Amiga*:UNIX_System_V:4.0:*) 373a5a2a776Smrg GUESS=m68k-unknown-sysv4 374a5a2a776Smrg ;; 3751abf7346Smrg *:[Aa]miga[Oo][Ss]:*:*) 376a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-amigaos 377a5a2a776Smrg ;; 3781abf7346Smrg *:[Mm]orph[Oo][Ss]:*:*) 379a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-morphos 380a5a2a776Smrg ;; 3811abf7346Smrg *:OS/390:*:*) 382a5a2a776Smrg GUESS=i370-ibm-openedition 383a5a2a776Smrg ;; 3841abf7346Smrg *:z/VM:*:*) 385a5a2a776Smrg GUESS=s390-ibm-zvmoe 386a5a2a776Smrg ;; 3871abf7346Smrg *:OS400:*:*) 388a5a2a776Smrg GUESS=powerpc-ibm-os400 389a5a2a776Smrg ;; 3901abf7346Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 391a5a2a776Smrg GUESS=arm-acorn-riscix$UNAME_RELEASE 392a5a2a776Smrg ;; 3936d36ef34Smrg arm*:riscos:*:*|arm*:RISCOS:*:*) 394a5a2a776Smrg GUESS=arm-unknown-riscos 395a5a2a776Smrg ;; 3961abf7346Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 397a5a2a776Smrg GUESS=hppa1.1-hitachi-hiuxmpp 398a5a2a776Smrg ;; 3991abf7346Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 4001abf7346Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 401a5a2a776Smrg case `(/bin/universe) 2>/dev/null` in 402a5a2a776Smrg att) GUESS=pyramid-pyramid-sysv3 ;; 403a5a2a776Smrg *) GUESS=pyramid-pyramid-bsd ;; 404a5a2a776Smrg esac 405a5a2a776Smrg ;; 4061abf7346Smrg NILE*:*:*:dcosx) 407a5a2a776Smrg GUESS=pyramid-pyramid-svr4 408a5a2a776Smrg ;; 4091abf7346Smrg DRS?6000:unix:4.0:6*) 410a5a2a776Smrg GUESS=sparc-icl-nx6 411a5a2a776Smrg ;; 4121abf7346Smrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 4131abf7346Smrg case `/usr/bin/uname -p` in 414a5a2a776Smrg sparc) GUESS=sparc-icl-nx7 ;; 415a5a2a776Smrg esac 416a5a2a776Smrg ;; 4178b6d6341Smrg s390x:SunOS:*:*) 418a5a2a776Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 419a5a2a776Smrg GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL 420a5a2a776Smrg ;; 4211abf7346Smrg sun4H:SunOS:5.*:*) 422a5a2a776Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 423a5a2a776Smrg GUESS=sparc-hal-solaris2$SUN_REL 424a5a2a776Smrg ;; 4251abf7346Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 426a5a2a776Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 427a5a2a776Smrg GUESS=sparc-sun-solaris2$SUN_REL 428a5a2a776Smrg ;; 42923a8d56dSmrg i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 430a5a2a776Smrg GUESS=i386-pc-auroraux$UNAME_RELEASE 431a5a2a776Smrg ;; 4328b6d6341Smrg i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 433a5a2a776Smrg set_cc_for_build 434ae5a67adSmrg SUN_ARCH=i386 4358b6d6341Smrg # If there is a compiler, see if it is configured for 64-bit objects. 4368b6d6341Smrg # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 4378b6d6341Smrg # This test works for both compilers. 438a5a2a776Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 4398b6d6341Smrg if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 440a5a2a776Smrg (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ 4418b6d6341Smrg grep IS_64BIT_ARCH >/dev/null 4428b6d6341Smrg then 443ae5a67adSmrg SUN_ARCH=x86_64 4448b6d6341Smrg fi 4458b6d6341Smrg fi 446a5a2a776Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 447a5a2a776Smrg GUESS=$SUN_ARCH-pc-solaris2$SUN_REL 448a5a2a776Smrg ;; 4491abf7346Smrg sun4*:SunOS:6*:*) 4501abf7346Smrg # According to config.sub, this is the proper way to canonicalize 4511abf7346Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 4521abf7346Smrg # it's likely to be more like Solaris than SunOS4. 453a5a2a776Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 454a5a2a776Smrg GUESS=sparc-sun-solaris3$SUN_REL 455a5a2a776Smrg ;; 4561abf7346Smrg sun4*:SunOS:*:*) 457a5a2a776Smrg case `/usr/bin/arch -k` in 4581abf7346Smrg Series*|S4*) 4591abf7346Smrg UNAME_RELEASE=`uname -v` 4601abf7346Smrg ;; 4611abf7346Smrg esac 4621abf7346Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 463a5a2a776Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` 464a5a2a776Smrg GUESS=sparc-sun-sunos$SUN_REL 465a5a2a776Smrg ;; 4661abf7346Smrg sun3*:SunOS:*:*) 467a5a2a776Smrg GUESS=m68k-sun-sunos$UNAME_RELEASE 468a5a2a776Smrg ;; 4691abf7346Smrg sun*:*:4.2BSD:*) 4701abf7346Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 471ae5a67adSmrg test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 472a5a2a776Smrg case `/bin/arch` in 4731abf7346Smrg sun3) 474a5a2a776Smrg GUESS=m68k-sun-sunos$UNAME_RELEASE 4751abf7346Smrg ;; 4761abf7346Smrg sun4) 477a5a2a776Smrg GUESS=sparc-sun-sunos$UNAME_RELEASE 4781abf7346Smrg ;; 4791abf7346Smrg esac 480a5a2a776Smrg ;; 4811abf7346Smrg aushp:SunOS:*:*) 482a5a2a776Smrg GUESS=sparc-auspex-sunos$UNAME_RELEASE 483a5a2a776Smrg ;; 4841abf7346Smrg # The situation for MiNT is a little confusing. The machine name 4851abf7346Smrg # can be virtually everything (everything which is not 4861abf7346Smrg # "atarist" or "atariste" at least should have a processor 4871abf7346Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 4881abf7346Smrg # to the lowercase version "mint" (or "freemint"). Finally 4891abf7346Smrg # the system name "TOS" denotes a system which is actually not 4901abf7346Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 4911abf7346Smrg # be no problem. 4921abf7346Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 493a5a2a776Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 494a5a2a776Smrg ;; 4951abf7346Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 496a5a2a776Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 497a5a2a776Smrg ;; 4981abf7346Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 499a5a2a776Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 500a5a2a776Smrg ;; 5011abf7346Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 502a5a2a776Smrg GUESS=m68k-milan-mint$UNAME_RELEASE 503a5a2a776Smrg ;; 5041abf7346Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 505a5a2a776Smrg GUESS=m68k-hades-mint$UNAME_RELEASE 506a5a2a776Smrg ;; 5071abf7346Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 508a5a2a776Smrg GUESS=m68k-unknown-mint$UNAME_RELEASE 509a5a2a776Smrg ;; 5101abf7346Smrg m68k:machten:*:*) 511a5a2a776Smrg GUESS=m68k-apple-machten$UNAME_RELEASE 512a5a2a776Smrg ;; 5131abf7346Smrg powerpc:machten:*:*) 514a5a2a776Smrg GUESS=powerpc-apple-machten$UNAME_RELEASE 515a5a2a776Smrg ;; 5161abf7346Smrg RISC*:Mach:*:*) 517a5a2a776Smrg GUESS=mips-dec-mach_bsd4.3 518a5a2a776Smrg ;; 5191abf7346Smrg RISC*:ULTRIX:*:*) 520a5a2a776Smrg GUESS=mips-dec-ultrix$UNAME_RELEASE 521a5a2a776Smrg ;; 5221abf7346Smrg VAX*:ULTRIX*:*:*) 523a5a2a776Smrg GUESS=vax-dec-ultrix$UNAME_RELEASE 524a5a2a776Smrg ;; 5251abf7346Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 526a5a2a776Smrg GUESS=clipper-intergraph-clix$UNAME_RELEASE 527a5a2a776Smrg ;; 5281abf7346Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 529a5a2a776Smrg set_cc_for_build 530ae5a67adSmrg sed 's/^ //' << EOF > "$dummy.c" 5311abf7346Smrg#ifdef __cplusplus 5321abf7346Smrg#include <stdio.h> /* for printf() prototype */ 5331abf7346Smrg int main (int argc, char *argv[]) { 5341abf7346Smrg#else 5351abf7346Smrg int main (argc, argv) int argc; char *argv[]; { 5361abf7346Smrg#endif 5371abf7346Smrg #if defined (host_mips) && defined (MIPSEB) 5381abf7346Smrg #if defined (SYSTYPE_SYSV) 539ae5a67adSmrg printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); 5401abf7346Smrg #endif 5411abf7346Smrg #if defined (SYSTYPE_SVR4) 542ae5a67adSmrg printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); 5431abf7346Smrg #endif 5441abf7346Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 545ae5a67adSmrg printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); 5461abf7346Smrg #endif 5471abf7346Smrg #endif 5481abf7346Smrg exit (-1); 5491abf7346Smrg } 5501abf7346SmrgEOF 551ae5a67adSmrg $CC_FOR_BUILD -o "$dummy" "$dummy.c" && 552ae5a67adSmrg dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && 553ae5a67adSmrg SYSTEM_NAME=`"$dummy" "$dummyarg"` && 5541abf7346Smrg { echo "$SYSTEM_NAME"; exit; } 555a5a2a776Smrg GUESS=mips-mips-riscos$UNAME_RELEASE 556a5a2a776Smrg ;; 5571abf7346Smrg Motorola:PowerMAX_OS:*:*) 558a5a2a776Smrg GUESS=powerpc-motorola-powermax 559a5a2a776Smrg ;; 5601abf7346Smrg Motorola:*:4.3:PL8-*) 561a5a2a776Smrg GUESS=powerpc-harris-powermax 562a5a2a776Smrg ;; 5631abf7346Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 564a5a2a776Smrg GUESS=powerpc-harris-powermax 565a5a2a776Smrg ;; 5661abf7346Smrg Night_Hawk:Power_UNIX:*:*) 567a5a2a776Smrg GUESS=powerpc-harris-powerunix 568a5a2a776Smrg ;; 5691abf7346Smrg m88k:CX/UX:7*:*) 570a5a2a776Smrg GUESS=m88k-harris-cxux7 571a5a2a776Smrg ;; 5721abf7346Smrg m88k:*:4*:R4*) 573a5a2a776Smrg GUESS=m88k-motorola-sysv4 574a5a2a776Smrg ;; 5751abf7346Smrg m88k:*:3*:R3*) 576a5a2a776Smrg GUESS=m88k-motorola-sysv3 577a5a2a776Smrg ;; 5781abf7346Smrg AViiON:dgux:*:*) 5796d36ef34Smrg # DG/UX returns AViiON for all architectures 5806d36ef34Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 581a5a2a776Smrg if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 5821abf7346Smrg then 583a5a2a776Smrg if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ 584a5a2a776Smrg test "$TARGET_BINARY_INTERFACE"x = x 5851abf7346Smrg then 586a5a2a776Smrg GUESS=m88k-dg-dgux$UNAME_RELEASE 5871abf7346Smrg else 588a5a2a776Smrg GUESS=m88k-dg-dguxbcs$UNAME_RELEASE 5891abf7346Smrg fi 5901abf7346Smrg else 591a5a2a776Smrg GUESS=i586-dg-dgux$UNAME_RELEASE 5921abf7346Smrg fi 593a5a2a776Smrg ;; 5941abf7346Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 595a5a2a776Smrg GUESS=m88k-dolphin-sysv3 596a5a2a776Smrg ;; 5971abf7346Smrg M88*:*:R3*:*) 5981abf7346Smrg # Delta 88k system running SVR3 599a5a2a776Smrg GUESS=m88k-motorola-sysv3 600a5a2a776Smrg ;; 6011abf7346Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 602a5a2a776Smrg GUESS=m88k-tektronix-sysv3 603a5a2a776Smrg ;; 6041abf7346Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 605a5a2a776Smrg GUESS=m68k-tektronix-bsd 606a5a2a776Smrg ;; 6071abf7346Smrg *:IRIX*:*:*) 608a5a2a776Smrg IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` 609a5a2a776Smrg GUESS=mips-sgi-irix$IRIX_REL 610a5a2a776Smrg ;; 6111abf7346Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 612a5a2a776Smrg GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id 613a5a2a776Smrg ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 6141abf7346Smrg i*86:AIX:*:*) 615a5a2a776Smrg GUESS=i386-ibm-aix 616a5a2a776Smrg ;; 6171abf7346Smrg ia64:AIX:*:*) 618a5a2a776Smrg if test -x /usr/bin/oslevel ; then 6191abf7346Smrg IBM_REV=`/usr/bin/oslevel` 6201abf7346Smrg else 621a5a2a776Smrg IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 6221abf7346Smrg fi 623a5a2a776Smrg GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV 624a5a2a776Smrg ;; 6251abf7346Smrg *:AIX:2:3) 6261abf7346Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 627a5a2a776Smrg set_cc_for_build 628ae5a67adSmrg sed 's/^ //' << EOF > "$dummy.c" 6291abf7346Smrg #include <sys/systemcfg.h> 6301abf7346Smrg 6311abf7346Smrg main() 6321abf7346Smrg { 6331abf7346Smrg if (!__power_pc()) 6341abf7346Smrg exit(1); 6351abf7346Smrg puts("powerpc-ibm-aix3.2.5"); 6361abf7346Smrg exit(0); 6371abf7346Smrg } 6381abf7346SmrgEOF 639ae5a67adSmrg if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` 6401abf7346Smrg then 641a5a2a776Smrg GUESS=$SYSTEM_NAME 6421abf7346Smrg else 643a5a2a776Smrg GUESS=rs6000-ibm-aix3.2.5 6441abf7346Smrg fi 6451abf7346Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 646a5a2a776Smrg GUESS=rs6000-ibm-aix3.2.4 6471abf7346Smrg else 648a5a2a776Smrg GUESS=rs6000-ibm-aix3.2 6491abf7346Smrg fi 650a5a2a776Smrg ;; 65123a8d56dSmrg *:AIX:*:[4567]) 6521abf7346Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 653ae5a67adSmrg if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then 6541abf7346Smrg IBM_ARCH=rs6000 6551abf7346Smrg else 6561abf7346Smrg IBM_ARCH=powerpc 6571abf7346Smrg fi 658a5a2a776Smrg if test -x /usr/bin/lslpp ; then 659a5a2a776Smrg IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ 660da4a0041Smrg awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 6611abf7346Smrg else 662a5a2a776Smrg IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 6631abf7346Smrg fi 664a5a2a776Smrg GUESS=$IBM_ARCH-ibm-aix$IBM_REV 665a5a2a776Smrg ;; 6661abf7346Smrg *:AIX:*:*) 667a5a2a776Smrg GUESS=rs6000-ibm-aix 668a5a2a776Smrg ;; 669ae5a67adSmrg ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 670a5a2a776Smrg GUESS=romp-ibm-bsd4.4 671a5a2a776Smrg ;; 6721abf7346Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 673a5a2a776Smrg GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to 674a5a2a776Smrg ;; # report: romp-ibm BSD 4.3 6751abf7346Smrg *:BOSX:*:*) 676a5a2a776Smrg GUESS=rs6000-bull-bosx 677a5a2a776Smrg ;; 6781abf7346Smrg DPX/2?00:B.O.S.:*:*) 679a5a2a776Smrg GUESS=m68k-bull-sysv3 680a5a2a776Smrg ;; 6811abf7346Smrg 9000/[34]??:4.3bsd:1.*:*) 682a5a2a776Smrg GUESS=m68k-hp-bsd 683a5a2a776Smrg ;; 6841abf7346Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 685a5a2a776Smrg GUESS=m68k-hp-bsd4.4 686a5a2a776Smrg ;; 6871abf7346Smrg 9000/[34678]??:HP-UX:*:*) 688a5a2a776Smrg HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 689a5a2a776Smrg case $UNAME_MACHINE in 690ae5a67adSmrg 9000/31?) HP_ARCH=m68000 ;; 691ae5a67adSmrg 9000/[34]??) HP_ARCH=m68k ;; 6921abf7346Smrg 9000/[678][0-9][0-9]) 693a5a2a776Smrg if test -x /usr/bin/getconf; then 6941abf7346Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 6956d36ef34Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 696a5a2a776Smrg case $sc_cpu_version in 697ae5a67adSmrg 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 698ae5a67adSmrg 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 6996d36ef34Smrg 532) # CPU_PA_RISC2_0 700a5a2a776Smrg case $sc_kernel_bits in 701ae5a67adSmrg 32) HP_ARCH=hppa2.0n ;; 702ae5a67adSmrg 64) HP_ARCH=hppa2.0w ;; 703ae5a67adSmrg '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 7046d36ef34Smrg esac ;; 7056d36ef34Smrg esac 7061abf7346Smrg fi 707a5a2a776Smrg if test "$HP_ARCH" = ""; then 708a5a2a776Smrg set_cc_for_build 709ae5a67adSmrg sed 's/^ //' << EOF > "$dummy.c" 7101abf7346Smrg 7116d36ef34Smrg #define _HPUX_SOURCE 7126d36ef34Smrg #include <stdlib.h> 7136d36ef34Smrg #include <unistd.h> 7141abf7346Smrg 7156d36ef34Smrg int main () 7166d36ef34Smrg { 7176d36ef34Smrg #if defined(_SC_KERNEL_BITS) 7186d36ef34Smrg long bits = sysconf(_SC_KERNEL_BITS); 7196d36ef34Smrg #endif 7206d36ef34Smrg long cpu = sysconf (_SC_CPU_VERSION); 7211abf7346Smrg 7226d36ef34Smrg switch (cpu) 7236d36ef34Smrg { 7246d36ef34Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 7256d36ef34Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 7266d36ef34Smrg case CPU_PA_RISC2_0: 7276d36ef34Smrg #if defined(_SC_KERNEL_BITS) 7286d36ef34Smrg switch (bits) 7296d36ef34Smrg { 7306d36ef34Smrg case 64: puts ("hppa2.0w"); break; 7316d36ef34Smrg case 32: puts ("hppa2.0n"); break; 7326d36ef34Smrg default: puts ("hppa2.0"); break; 7336d36ef34Smrg } break; 7346d36ef34Smrg #else /* !defined(_SC_KERNEL_BITS) */ 7356d36ef34Smrg puts ("hppa2.0"); break; 7366d36ef34Smrg #endif 7376d36ef34Smrg default: puts ("hppa1.0"); break; 7386d36ef34Smrg } 7396d36ef34Smrg exit (0); 7406d36ef34Smrg } 7411abf7346SmrgEOF 742ae5a67adSmrg (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` 7431abf7346Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 7441abf7346Smrg fi ;; 7451abf7346Smrg esac 746a5a2a776Smrg if test "$HP_ARCH" = hppa2.0w 7471abf7346Smrg then 748a5a2a776Smrg set_cc_for_build 7491abf7346Smrg 7501abf7346Smrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 7511abf7346Smrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 7521abf7346Smrg # generating 64-bit code. GNU and HP use different nomenclature: 7531abf7346Smrg # 7541abf7346Smrg # $ CC_FOR_BUILD=cc ./config.guess 7551abf7346Smrg # => hppa2.0w-hp-hpux11.23 7561abf7346Smrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 7571abf7346Smrg # => hppa64-hp-hpux11.23 7581abf7346Smrg 759ae5a67adSmrg if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | 76023a8d56dSmrg grep -q __LP64__ 7611abf7346Smrg then 762ae5a67adSmrg HP_ARCH=hppa2.0w 7631abf7346Smrg else 764ae5a67adSmrg HP_ARCH=hppa64 7651abf7346Smrg fi 7661abf7346Smrg fi 767a5a2a776Smrg GUESS=$HP_ARCH-hp-hpux$HPUX_REV 768a5a2a776Smrg ;; 7691abf7346Smrg ia64:HP-UX:*:*) 770a5a2a776Smrg HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 771a5a2a776Smrg GUESS=ia64-hp-hpux$HPUX_REV 772a5a2a776Smrg ;; 7731abf7346Smrg 3050*:HI-UX:*:*) 774a5a2a776Smrg set_cc_for_build 775ae5a67adSmrg sed 's/^ //' << EOF > "$dummy.c" 7761abf7346Smrg #include <unistd.h> 7771abf7346Smrg int 7781abf7346Smrg main () 7791abf7346Smrg { 7801abf7346Smrg long cpu = sysconf (_SC_CPU_VERSION); 7811abf7346Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 7821abf7346Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 7831abf7346Smrg results, however. */ 7841abf7346Smrg if (CPU_IS_PA_RISC (cpu)) 7851abf7346Smrg { 7861abf7346Smrg switch (cpu) 7871abf7346Smrg { 7881abf7346Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 7891abf7346Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 7901abf7346Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 7911abf7346Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 7921abf7346Smrg } 7931abf7346Smrg } 7941abf7346Smrg else if (CPU_IS_HP_MC68K (cpu)) 7951abf7346Smrg puts ("m68k-hitachi-hiuxwe2"); 7961abf7346Smrg else puts ("unknown-hitachi-hiuxwe2"); 7971abf7346Smrg exit (0); 7981abf7346Smrg } 7991abf7346SmrgEOF 800ae5a67adSmrg $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && 8011abf7346Smrg { echo "$SYSTEM_NAME"; exit; } 802a5a2a776Smrg GUESS=unknown-hitachi-hiuxwe2 803a5a2a776Smrg ;; 804ae5a67adSmrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) 805a5a2a776Smrg GUESS=hppa1.1-hp-bsd 806a5a2a776Smrg ;; 8071abf7346Smrg 9000/8??:4.3bsd:*:*) 808a5a2a776Smrg GUESS=hppa1.0-hp-bsd 809a5a2a776Smrg ;; 8101abf7346Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 811a5a2a776Smrg GUESS=hppa1.0-hp-mpeix 812a5a2a776Smrg ;; 813ae5a67adSmrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) 814a5a2a776Smrg GUESS=hppa1.1-hp-osf 815a5a2a776Smrg ;; 8161abf7346Smrg hp8??:OSF1:*:*) 817a5a2a776Smrg GUESS=hppa1.0-hp-osf 818a5a2a776Smrg ;; 8191abf7346Smrg i*86:OSF1:*:*) 820a5a2a776Smrg if test -x /usr/sbin/sysversion ; then 821a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-osf1mk 8221abf7346Smrg else 823a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-osf1 8241abf7346Smrg fi 825a5a2a776Smrg ;; 8261abf7346Smrg parisc*:Lites*:*:*) 827a5a2a776Smrg GUESS=hppa1.1-hp-lites 828a5a2a776Smrg ;; 8291abf7346Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 830a5a2a776Smrg GUESS=c1-convex-bsd 831a5a2a776Smrg ;; 8321abf7346Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 8331abf7346Smrg if getsysinfo -f scalar_acc 8341abf7346Smrg then echo c32-convex-bsd 8351abf7346Smrg else echo c2-convex-bsd 8361abf7346Smrg fi 8376d36ef34Smrg exit ;; 8381abf7346Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 839a5a2a776Smrg GUESS=c34-convex-bsd 840a5a2a776Smrg ;; 8411abf7346Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 842a5a2a776Smrg GUESS=c38-convex-bsd 843a5a2a776Smrg ;; 8441abf7346Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 845a5a2a776Smrg GUESS=c4-convex-bsd 846a5a2a776Smrg ;; 8471abf7346Smrg CRAY*Y-MP:*:*:*) 848a5a2a776Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 849a5a2a776Smrg GUESS=ymp-cray-unicos$CRAY_REL 850a5a2a776Smrg ;; 8511abf7346Smrg CRAY*[A-Z]90:*:*:*) 852ae5a67adSmrg echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ 8531abf7346Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 8541abf7346Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 8551abf7346Smrg -e 's/\.[^.]*$/.X/' 8561abf7346Smrg exit ;; 8571abf7346Smrg CRAY*TS:*:*:*) 858a5a2a776Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 859a5a2a776Smrg GUESS=t90-cray-unicos$CRAY_REL 860a5a2a776Smrg ;; 8611abf7346Smrg CRAY*T3E:*:*:*) 862a5a2a776Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 863a5a2a776Smrg GUESS=alphaev5-cray-unicosmk$CRAY_REL 864a5a2a776Smrg ;; 8651abf7346Smrg CRAY*SV1:*:*:*) 866a5a2a776Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 867a5a2a776Smrg GUESS=sv1-cray-unicos$CRAY_REL 868a5a2a776Smrg ;; 8691abf7346Smrg *:UNICOS/mp:*:*) 870a5a2a776Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 871a5a2a776Smrg GUESS=craynv-cray-unicosmp$CRAY_REL 872a5a2a776Smrg ;; 8731abf7346Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 874ae5a67adSmrg FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 875ae5a67adSmrg FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 876ae5a67adSmrg FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` 877a5a2a776Smrg GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 878a5a2a776Smrg ;; 8791abf7346Smrg 5000:UNIX_System_V:4.*:*) 880ae5a67adSmrg FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 881ae5a67adSmrg FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` 882a5a2a776Smrg GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 883a5a2a776Smrg ;; 8841abf7346Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 885a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE 886a5a2a776Smrg ;; 8871abf7346Smrg sparc*:BSD/OS:*:*) 888a5a2a776Smrg GUESS=sparc-unknown-bsdi$UNAME_RELEASE 889a5a2a776Smrg ;; 8901abf7346Smrg *:BSD/OS:*:*) 891a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE 892a5a2a776Smrg ;; 893a5a2a776Smrg arm:FreeBSD:*:*) 894a5a2a776Smrg UNAME_PROCESSOR=`uname -p` 895a5a2a776Smrg set_cc_for_build 896a5a2a776Smrg if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 897a5a2a776Smrg | grep -q __ARM_PCS_VFP 898a5a2a776Smrg then 899a5a2a776Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 900a5a2a776Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi 901a5a2a776Smrg else 902a5a2a776Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 903a5a2a776Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf 904a5a2a776Smrg fi 905a5a2a776Smrg ;; 9061abf7346Smrg *:FreeBSD:*:*) 9076d36ef34Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 908a5a2a776Smrg case $UNAME_PROCESSOR in 9091abf7346Smrg amd64) 910ae5a67adSmrg UNAME_PROCESSOR=x86_64 ;; 911ae5a67adSmrg i386) 912ae5a67adSmrg UNAME_PROCESSOR=i586 ;; 9131abf7346Smrg esac 914a5a2a776Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 915a5a2a776Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL 916a5a2a776Smrg ;; 9171abf7346Smrg i*:CYGWIN*:*) 918a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-cygwin 919a5a2a776Smrg ;; 9206d36ef34Smrg *:MINGW64*:*) 921a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-mingw64 922a5a2a776Smrg ;; 9238b6d6341Smrg *:MINGW*:*) 924a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-mingw32 925a5a2a776Smrg ;; 926da4a0041Smrg *:MSYS*:*) 927a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-msys 928a5a2a776Smrg ;; 9291abf7346Smrg i*:PW*:*) 930a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-pw32 931a5a2a776Smrg ;; 932a5a2a776Smrg *:SerenityOS:*:*) 933a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-serenity 934a5a2a776Smrg ;; 93523a8d56dSmrg *:Interix*:*) 936a5a2a776Smrg case $UNAME_MACHINE in 9378b6d6341Smrg x86) 938a5a2a776Smrg GUESS=i586-pc-interix$UNAME_RELEASE 939a5a2a776Smrg ;; 94023a8d56dSmrg authenticamd | genuineintel | EM64T) 941a5a2a776Smrg GUESS=x86_64-unknown-interix$UNAME_RELEASE 942a5a2a776Smrg ;; 9438b6d6341Smrg IA64) 944a5a2a776Smrg GUESS=ia64-unknown-interix$UNAME_RELEASE 945a5a2a776Smrg ;; 9468b6d6341Smrg esac ;; 9471abf7346Smrg i*:UWIN*:*) 948a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-uwin 949a5a2a776Smrg ;; 9501abf7346Smrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 951a5a2a776Smrg GUESS=x86_64-pc-cygwin 952a5a2a776Smrg ;; 9531abf7346Smrg prep*:SunOS:5.*:*) 954a5a2a776Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 955a5a2a776Smrg GUESS=powerpcle-unknown-solaris2$SUN_REL 956a5a2a776Smrg ;; 9571abf7346Smrg *:GNU:*:*) 9581abf7346Smrg # the GNU system 959a5a2a776Smrg GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` 960a5a2a776Smrg GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` 961a5a2a776Smrg GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL 962a5a2a776Smrg ;; 9631abf7346Smrg *:GNU/*:*:*) 9641abf7346Smrg # other systems with GNU libc and userland 965a5a2a776Smrg GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` 966a5a2a776Smrg GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 967a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC 968a5a2a776Smrg ;; 969a5a2a776Smrg x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) 970a5a2a776Smrg GUESS="$UNAME_MACHINE-pc-managarm-mlibc" 971a5a2a776Smrg ;; 972a5a2a776Smrg *:[Mm]anagarm:*:*) 973a5a2a776Smrg GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" 974a5a2a776Smrg ;; 975a5a2a776Smrg *:Minix:*:*) 976a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-minix 977a5a2a776Smrg ;; 9786d36ef34Smrg aarch64:Linux:*:*) 979a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 980a5a2a776Smrg ;; 9816d36ef34Smrg aarch64_be:Linux:*:*) 9826d36ef34Smrg UNAME_MACHINE=aarch64_be 983a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 984a5a2a776Smrg ;; 98523a8d56dSmrg alpha:Linux:*:*) 986a5a2a776Smrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in 98723a8d56dSmrg EV5) UNAME_MACHINE=alphaev5 ;; 98823a8d56dSmrg EV56) UNAME_MACHINE=alphaev56 ;; 98923a8d56dSmrg PCA56) UNAME_MACHINE=alphapca56 ;; 99023a8d56dSmrg PCA57) UNAME_MACHINE=alphapca56 ;; 99123a8d56dSmrg EV6) UNAME_MACHINE=alphaev6 ;; 99223a8d56dSmrg EV67) UNAME_MACHINE=alphaev67 ;; 99323a8d56dSmrg EV68*) UNAME_MACHINE=alphaev68 ;; 9946d36ef34Smrg esac 99523a8d56dSmrg objdump --private-headers /bin/sh | grep -q ld.so.1 996ae5a67adSmrg if test "$?" = 0 ; then LIBC=gnulibc1 ; fi 997a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 998a5a2a776Smrg ;; 999a5a2a776Smrg arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) 1000a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1001a5a2a776Smrg ;; 10021abf7346Smrg arm*:Linux:*:*) 1003a5a2a776Smrg set_cc_for_build 10048b6d6341Smrg if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 10058b6d6341Smrg | grep -q __ARM_EABI__ 10068b6d6341Smrg then 1007a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10088b6d6341Smrg else 10096d36ef34Smrg if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 10106d36ef34Smrg | grep -q __ARM_PCS_VFP 10116d36ef34Smrg then 1012a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi 10136d36ef34Smrg else 1014a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf 10156d36ef34Smrg fi 10168b6d6341Smrg fi 1017a5a2a776Smrg ;; 10181abf7346Smrg avr32*:Linux:*:*) 1019a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1020a5a2a776Smrg ;; 10211abf7346Smrg cris:Linux:*:*) 1022a5a2a776Smrg GUESS=$UNAME_MACHINE-axis-linux-$LIBC 1023a5a2a776Smrg ;; 10241abf7346Smrg crisv32:Linux:*:*) 1025a5a2a776Smrg GUESS=$UNAME_MACHINE-axis-linux-$LIBC 1026a5a2a776Smrg ;; 1027ae5a67adSmrg e2k:Linux:*:*) 1028a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1029a5a2a776Smrg ;; 10301abf7346Smrg frv:Linux:*:*) 1031a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1032a5a2a776Smrg ;; 10336d36ef34Smrg hexagon:Linux:*:*) 1034a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1035a5a2a776Smrg ;; 103623a8d56dSmrg i*86:Linux:*:*) 1037a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-linux-$LIBC 1038a5a2a776Smrg ;; 10391abf7346Smrg ia64:Linux:*:*) 1040a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1041a5a2a776Smrg ;; 1042ae5a67adSmrg k1om:Linux:*:*) 1043a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1044a5a2a776Smrg ;; 1045a5a2a776Smrg loongarch32:Linux:*:* | loongarch64:Linux:*:*) 1046a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1047a5a2a776Smrg ;; 10481abf7346Smrg m32r*:Linux:*:*) 1049a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1050a5a2a776Smrg ;; 10511abf7346Smrg m68*:Linux:*:*) 1052a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1053a5a2a776Smrg ;; 105423a8d56dSmrg mips:Linux:*:* | mips64:Linux:*:*) 1055a5a2a776Smrg set_cc_for_build 1056a5a2a776Smrg IS_GLIBC=0 1057a5a2a776Smrg test x"${LIBC}" = xgnu && IS_GLIBC=1 1058ae5a67adSmrg sed 's/^ //' << EOF > "$dummy.c" 10591abf7346Smrg #undef CPU 1060a5a2a776Smrg #undef mips 1061a5a2a776Smrg #undef mipsel 1062a5a2a776Smrg #undef mips64 1063a5a2a776Smrg #undef mips64el 1064a5a2a776Smrg #if ${IS_GLIBC} && defined(_ABI64) 1065a5a2a776Smrg LIBCABI=gnuabi64 1066a5a2a776Smrg #else 1067a5a2a776Smrg #if ${IS_GLIBC} && defined(_ABIN32) 1068a5a2a776Smrg LIBCABI=gnuabin32 1069a5a2a776Smrg #else 1070a5a2a776Smrg LIBCABI=${LIBC} 1071a5a2a776Smrg #endif 1072a5a2a776Smrg #endif 1073a5a2a776Smrg 1074a5a2a776Smrg #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 1075a5a2a776Smrg CPU=mipsisa64r6 1076a5a2a776Smrg #else 1077a5a2a776Smrg #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 1078a5a2a776Smrg CPU=mipsisa32r6 1079a5a2a776Smrg #else 1080a5a2a776Smrg #if defined(__mips64) 1081a5a2a776Smrg CPU=mips64 1082a5a2a776Smrg #else 1083a5a2a776Smrg CPU=mips 1084a5a2a776Smrg #endif 1085a5a2a776Smrg #endif 1086a5a2a776Smrg #endif 1087a5a2a776Smrg 10881abf7346Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 1089a5a2a776Smrg MIPS_ENDIAN=el 10901abf7346Smrg #else 10911abf7346Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 1092a5a2a776Smrg MIPS_ENDIAN= 10931abf7346Smrg #else 1094a5a2a776Smrg MIPS_ENDIAN= 10951abf7346Smrg #endif 10961abf7346Smrg #endif 10971abf7346SmrgEOF 1098a5a2a776Smrg cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` 1099a5a2a776Smrg eval "$cc_set_vars" 1100a5a2a776Smrg test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } 11011abf7346Smrg ;; 1102ae5a67adSmrg mips64el:Linux:*:*) 1103a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1104a5a2a776Smrg ;; 1105da4a0041Smrg openrisc*:Linux:*:*) 1106a5a2a776Smrg GUESS=or1k-unknown-linux-$LIBC 1107a5a2a776Smrg ;; 1108da4a0041Smrg or32:Linux:*:* | or1k*:Linux:*:*) 1109a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1110a5a2a776Smrg ;; 11118b6d6341Smrg padre:Linux:*:*) 1112a5a2a776Smrg GUESS=sparc-unknown-linux-$LIBC 1113a5a2a776Smrg ;; 111423a8d56dSmrg parisc64:Linux:*:* | hppa64:Linux:*:*) 1115a5a2a776Smrg GUESS=hppa64-unknown-linux-$LIBC 1116a5a2a776Smrg ;; 11171abf7346Smrg parisc:Linux:*:* | hppa:Linux:*:*) 11181abf7346Smrg # Look for CPU level 11191abf7346Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 1120a5a2a776Smrg PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; 1121a5a2a776Smrg PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; 1122a5a2a776Smrg *) GUESS=hppa-unknown-linux-$LIBC ;; 11231abf7346Smrg esac 1124a5a2a776Smrg ;; 112523a8d56dSmrg ppc64:Linux:*:*) 1126a5a2a776Smrg GUESS=powerpc64-unknown-linux-$LIBC 1127a5a2a776Smrg ;; 112823a8d56dSmrg ppc:Linux:*:*) 1129a5a2a776Smrg GUESS=powerpc-unknown-linux-$LIBC 1130a5a2a776Smrg ;; 11316d36ef34Smrg ppc64le:Linux:*:*) 1132a5a2a776Smrg GUESS=powerpc64le-unknown-linux-$LIBC 1133a5a2a776Smrg ;; 11346d36ef34Smrg ppcle:Linux:*:*) 1135a5a2a776Smrg GUESS=powerpcle-unknown-linux-$LIBC 1136a5a2a776Smrg ;; 1137a5a2a776Smrg riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) 1138a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1139a5a2a776Smrg ;; 11401abf7346Smrg s390:Linux:*:* | s390x:Linux:*:*) 1141a5a2a776Smrg GUESS=$UNAME_MACHINE-ibm-linux-$LIBC 1142a5a2a776Smrg ;; 11431abf7346Smrg sh64*:Linux:*:*) 1144a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1145a5a2a776Smrg ;; 11461abf7346Smrg sh*:Linux:*:*) 1147a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1148a5a2a776Smrg ;; 11491abf7346Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 1150a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1151a5a2a776Smrg ;; 115223a8d56dSmrg tile*:Linux:*:*) 1153a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1154a5a2a776Smrg ;; 11551abf7346Smrg vax:Linux:*:*) 1156a5a2a776Smrg GUESS=$UNAME_MACHINE-dec-linux-$LIBC 1157a5a2a776Smrg ;; 11581abf7346Smrg x86_64:Linux:*:*) 1159a5a2a776Smrg set_cc_for_build 1160a5a2a776Smrg CPU=$UNAME_MACHINE 1161a5a2a776Smrg LIBCABI=$LIBC 1162a5a2a776Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 1163a5a2a776Smrg ABI=64 1164a5a2a776Smrg sed 's/^ //' << EOF > "$dummy.c" 1165a5a2a776Smrg #ifdef __i386__ 1166a5a2a776Smrg ABI=x86 1167a5a2a776Smrg #else 1168a5a2a776Smrg #ifdef __ILP32__ 1169a5a2a776Smrg ABI=x32 1170a5a2a776Smrg #endif 1171a5a2a776Smrg #endif 1172a5a2a776SmrgEOF 1173a5a2a776Smrg cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` 1174a5a2a776Smrg eval "$cc_set_abi" 1175a5a2a776Smrg case $ABI in 1176a5a2a776Smrg x86) CPU=i686 ;; 1177a5a2a776Smrg x32) LIBCABI=${LIBC}x32 ;; 1178a5a2a776Smrg esac 1179a5a2a776Smrg fi 1180a5a2a776Smrg GUESS=$CPU-pc-linux-$LIBCABI 1181a5a2a776Smrg ;; 11828b6d6341Smrg xtensa*:Linux:*:*) 1183a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1184a5a2a776Smrg ;; 11851abf7346Smrg i*86:DYNIX/ptx:4*:*) 11861abf7346Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 11871abf7346Smrg # earlier versions are messed up and put the nodename in both 11881abf7346Smrg # sysname and nodename. 1189a5a2a776Smrg GUESS=i386-sequent-sysv4 1190a5a2a776Smrg ;; 11911abf7346Smrg i*86:UNIX_SV:4.2MP:2.*) 11926d36ef34Smrg # Unixware is an offshoot of SVR4, but it has its own version 11936d36ef34Smrg # number series starting with 2... 11946d36ef34Smrg # I am not positive that other SVR4 systems won't match this, 11951abf7346Smrg # I just have to hope. -- rms. 11966d36ef34Smrg # Use sysv4.2uw... so that sysv4* matches it. 1197a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION 1198a5a2a776Smrg ;; 11991abf7346Smrg i*86:OS/2:*:*) 12001abf7346Smrg # If we were able to find `uname', then EMX Unix compatibility 12011abf7346Smrg # is probably installed. 1202a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-os2-emx 1203a5a2a776Smrg ;; 12041abf7346Smrg i*86:XTS-300:*:STOP) 1205a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-stop 1206a5a2a776Smrg ;; 12071abf7346Smrg i*86:atheos:*:*) 1208a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-atheos 1209a5a2a776Smrg ;; 12101abf7346Smrg i*86:syllable:*:*) 1211a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-syllable 1212a5a2a776Smrg ;; 121323a8d56dSmrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1214a5a2a776Smrg GUESS=i386-unknown-lynxos$UNAME_RELEASE 1215a5a2a776Smrg ;; 12161abf7346Smrg i*86:*DOS:*:*) 1217a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-msdosdjgpp 1218a5a2a776Smrg ;; 1219ae5a67adSmrg i*86:*:4.*:*) 1220ae5a67adSmrg UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` 12211abf7346Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1222a5a2a776Smrg GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL 12231abf7346Smrg else 1224a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL 12251abf7346Smrg fi 1226a5a2a776Smrg ;; 12271abf7346Smrg i*86:*:5:[678]*) 12286d36ef34Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 12291abf7346Smrg case `/bin/uname -X | grep "^Machine"` in 12301abf7346Smrg *486*) UNAME_MACHINE=i486 ;; 12311abf7346Smrg *Pentium) UNAME_MACHINE=i586 ;; 12321abf7346Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 12331abf7346Smrg esac 1234a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1235a5a2a776Smrg ;; 12361abf7346Smrg i*86:*:3.2:*) 12371abf7346Smrg if test -f /usr/options/cb.name; then 12381abf7346Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1239a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL 12401abf7346Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 12411abf7346Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 12421abf7346Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 12431abf7346Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 12441abf7346Smrg && UNAME_MACHINE=i586 12451abf7346Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 12461abf7346Smrg && UNAME_MACHINE=i686 12471abf7346Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 12481abf7346Smrg && UNAME_MACHINE=i686 1249a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL 12501abf7346Smrg else 1251a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-sysv32 12521abf7346Smrg fi 1253a5a2a776Smrg ;; 12541abf7346Smrg pc:*:*:*) 12551abf7346Smrg # Left here for compatibility: 12566d36ef34Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 12576d36ef34Smrg # the processor, so we play safe by assuming i586. 12588b6d6341Smrg # Note: whatever this is, it MUST be the same as what config.sub 1259ae5a67adSmrg # prints for the "djgpp" host, or else GDB configure will decide that 12608b6d6341Smrg # this is a cross-build. 1261a5a2a776Smrg GUESS=i586-pc-msdosdjgpp 1262a5a2a776Smrg ;; 12631abf7346Smrg Intel:Mach:3*:*) 1264a5a2a776Smrg GUESS=i386-pc-mach3 1265a5a2a776Smrg ;; 12661abf7346Smrg paragon:*:*:*) 1267a5a2a776Smrg GUESS=i860-intel-osf1 1268a5a2a776Smrg ;; 12691abf7346Smrg i860:*:4.*:*) # i860-SVR4 12701abf7346Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1271a5a2a776Smrg GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 12721abf7346Smrg else # Add other i860-SVR4 vendors below as they are discovered. 1273a5a2a776Smrg GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 12741abf7346Smrg fi 1275a5a2a776Smrg ;; 12761abf7346Smrg mini*:CTIX:SYS*5:*) 12771abf7346Smrg # "miniframe" 1278a5a2a776Smrg GUESS=m68010-convergent-sysv 1279a5a2a776Smrg ;; 12801abf7346Smrg mc68k:UNIX:SYSTEM5:3.51m) 1281a5a2a776Smrg GUESS=m68k-convergent-sysv 1282a5a2a776Smrg ;; 12831abf7346Smrg M680?0:D-NIX:5.3:*) 1284a5a2a776Smrg GUESS=m68k-diab-dnix 1285a5a2a776Smrg ;; 12861abf7346Smrg M68*:*:R3V[5678]*:*) 12871abf7346Smrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 12881abf7346Smrg 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) 12891abf7346Smrg OS_REL='' 12901abf7346Smrg test -r /etc/.relid \ 12911abf7346Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 12921abf7346Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1293ae5a67adSmrg && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 12941abf7346Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1295ae5a67adSmrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 12961abf7346Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 12976d36ef34Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 12986d36ef34Smrg && { echo i486-ncr-sysv4; exit; } ;; 12998b6d6341Smrg NCR*:*:4.2:* | MPRAS*:*:4.2:*) 13008b6d6341Smrg OS_REL='.3' 13018b6d6341Smrg test -r /etc/.relid \ 13028b6d6341Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 13038b6d6341Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1304ae5a67adSmrg && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 13058b6d6341Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1306ae5a67adSmrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } 13078b6d6341Smrg /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1308ae5a67adSmrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 13091abf7346Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1310a5a2a776Smrg GUESS=m68k-unknown-lynxos$UNAME_RELEASE 1311a5a2a776Smrg ;; 13121abf7346Smrg mc68030:UNIX_System_V:4.*:*) 1313a5a2a776Smrg GUESS=m68k-atari-sysv4 1314a5a2a776Smrg ;; 13151abf7346Smrg TSUNAMI:LynxOS:2.*:*) 1316a5a2a776Smrg GUESS=sparc-unknown-lynxos$UNAME_RELEASE 1317a5a2a776Smrg ;; 13181abf7346Smrg rs6000:LynxOS:2.*:*) 1319a5a2a776Smrg GUESS=rs6000-unknown-lynxos$UNAME_RELEASE 1320a5a2a776Smrg ;; 132123a8d56dSmrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1322a5a2a776Smrg GUESS=powerpc-unknown-lynxos$UNAME_RELEASE 1323a5a2a776Smrg ;; 13241abf7346Smrg SM[BE]S:UNIX_SV:*:*) 1325a5a2a776Smrg GUESS=mips-dde-sysv$UNAME_RELEASE 1326a5a2a776Smrg ;; 13271abf7346Smrg RM*:ReliantUNIX-*:*:*) 1328a5a2a776Smrg GUESS=mips-sni-sysv4 1329a5a2a776Smrg ;; 13301abf7346Smrg RM*:SINIX-*:*:*) 1331a5a2a776Smrg GUESS=mips-sni-sysv4 1332a5a2a776Smrg ;; 13331abf7346Smrg *:SINIX-*:*:*) 13341abf7346Smrg if uname -p 2>/dev/null >/dev/null ; then 13351abf7346Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 1336a5a2a776Smrg GUESS=$UNAME_MACHINE-sni-sysv4 13371abf7346Smrg else 1338a5a2a776Smrg GUESS=ns32k-sni-sysv 13391abf7346Smrg fi 1340a5a2a776Smrg ;; 13416d36ef34Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 13426d36ef34Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 1343a5a2a776Smrg GUESS=i586-unisys-sysv4 1344a5a2a776Smrg ;; 13451abf7346Smrg *:UNIX_System_V:4*:FTX*) 13461abf7346Smrg # From Gerald Hewes <hewes@openmarket.com>. 13471abf7346Smrg # How about differentiating between stratus architectures? -djm 1348a5a2a776Smrg GUESS=hppa1.1-stratus-sysv4 1349a5a2a776Smrg ;; 13501abf7346Smrg *:*:*:FTX*) 13511abf7346Smrg # From seanf@swdc.stratus.com. 1352a5a2a776Smrg GUESS=i860-stratus-sysv4 1353a5a2a776Smrg ;; 13541abf7346Smrg i*86:VOS:*:*) 13551abf7346Smrg # From Paul.Green@stratus.com. 1356a5a2a776Smrg GUESS=$UNAME_MACHINE-stratus-vos 1357a5a2a776Smrg ;; 13581abf7346Smrg *:VOS:*:*) 13591abf7346Smrg # From Paul.Green@stratus.com. 1360a5a2a776Smrg GUESS=hppa1.1-stratus-vos 1361a5a2a776Smrg ;; 13621abf7346Smrg mc68*:A/UX:*:*) 1363a5a2a776Smrg GUESS=m68k-apple-aux$UNAME_RELEASE 1364a5a2a776Smrg ;; 13651abf7346Smrg news*:NEWS-OS:6*:*) 1366a5a2a776Smrg GUESS=mips-sony-newsos6 1367a5a2a776Smrg ;; 13681abf7346Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1369a5a2a776Smrg if test -d /usr/nec; then 1370a5a2a776Smrg GUESS=mips-nec-sysv$UNAME_RELEASE 13711abf7346Smrg else 1372a5a2a776Smrg GUESS=mips-unknown-sysv$UNAME_RELEASE 13731abf7346Smrg fi 1374a5a2a776Smrg ;; 13751abf7346Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1376a5a2a776Smrg GUESS=powerpc-be-beos 1377a5a2a776Smrg ;; 13781abf7346Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1379a5a2a776Smrg GUESS=powerpc-apple-beos 1380a5a2a776Smrg ;; 13811abf7346Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1382a5a2a776Smrg GUESS=i586-pc-beos 1383a5a2a776Smrg ;; 13848b6d6341Smrg BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1385a5a2a776Smrg GUESS=i586-pc-haiku 1386a5a2a776Smrg ;; 1387a5a2a776Smrg ppc:Haiku:*:*) # Haiku running on Apple PowerPC 1388a5a2a776Smrg GUESS=powerpc-apple-haiku 1389a5a2a776Smrg ;; 1390a5a2a776Smrg *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) 1391a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-haiku 1392a5a2a776Smrg ;; 13931abf7346Smrg SX-4:SUPER-UX:*:*) 1394a5a2a776Smrg GUESS=sx4-nec-superux$UNAME_RELEASE 1395a5a2a776Smrg ;; 13961abf7346Smrg SX-5:SUPER-UX:*:*) 1397a5a2a776Smrg GUESS=sx5-nec-superux$UNAME_RELEASE 1398a5a2a776Smrg ;; 13991abf7346Smrg SX-6:SUPER-UX:*:*) 1400a5a2a776Smrg GUESS=sx6-nec-superux$UNAME_RELEASE 1401a5a2a776Smrg ;; 14028b6d6341Smrg SX-7:SUPER-UX:*:*) 1403a5a2a776Smrg GUESS=sx7-nec-superux$UNAME_RELEASE 1404a5a2a776Smrg ;; 14058b6d6341Smrg SX-8:SUPER-UX:*:*) 1406a5a2a776Smrg GUESS=sx8-nec-superux$UNAME_RELEASE 1407a5a2a776Smrg ;; 14088b6d6341Smrg SX-8R:SUPER-UX:*:*) 1409a5a2a776Smrg GUESS=sx8r-nec-superux$UNAME_RELEASE 1410a5a2a776Smrg ;; 1411ae5a67adSmrg SX-ACE:SUPER-UX:*:*) 1412a5a2a776Smrg GUESS=sxace-nec-superux$UNAME_RELEASE 1413a5a2a776Smrg ;; 14141abf7346Smrg Power*:Rhapsody:*:*) 1415a5a2a776Smrg GUESS=powerpc-apple-rhapsody$UNAME_RELEASE 1416a5a2a776Smrg ;; 14171abf7346Smrg *:Rhapsody:*:*) 1418a5a2a776Smrg GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE 1419a5a2a776Smrg ;; 1420a5a2a776Smrg arm64:Darwin:*:*) 1421a5a2a776Smrg GUESS=aarch64-apple-darwin$UNAME_RELEASE 1422a5a2a776Smrg ;; 14231abf7346Smrg *:Darwin:*:*) 1424a5a2a776Smrg UNAME_PROCESSOR=`uname -p` 1425a5a2a776Smrg case $UNAME_PROCESSOR in 1426a5a2a776Smrg unknown) UNAME_PROCESSOR=powerpc ;; 1427a5a2a776Smrg esac 1428a5a2a776Smrg if command -v xcode-select > /dev/null 2> /dev/null && \ 1429a5a2a776Smrg ! xcode-select --print-path > /dev/null 2> /dev/null ; then 1430a5a2a776Smrg # Avoid executing cc if there is no toolchain installed as 1431a5a2a776Smrg # cc will be a stub that puts up a graphical alert 1432a5a2a776Smrg # prompting the user to install developer tools. 1433a5a2a776Smrg CC_FOR_BUILD=no_compiler_found 1434a5a2a776Smrg else 1435a5a2a776Smrg set_cc_for_build 14366d36ef34Smrg fi 1437a5a2a776Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 1438a5a2a776Smrg if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1439a5a2a776Smrg (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1440a5a2a776Smrg grep IS_64BIT_ARCH >/dev/null 1441a5a2a776Smrg then 1442a5a2a776Smrg case $UNAME_PROCESSOR in 1443a5a2a776Smrg i386) UNAME_PROCESSOR=x86_64 ;; 1444a5a2a776Smrg powerpc) UNAME_PROCESSOR=powerpc64 ;; 1445a5a2a776Smrg esac 1446a5a2a776Smrg fi 1447a5a2a776Smrg # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc 1448a5a2a776Smrg if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ 1449a5a2a776Smrg (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1450a5a2a776Smrg grep IS_PPC >/dev/null 1451a5a2a776Smrg then 1452a5a2a776Smrg UNAME_PROCESSOR=powerpc 14536d36ef34Smrg fi 1454da4a0041Smrg elif test "$UNAME_PROCESSOR" = i386 ; then 1455a5a2a776Smrg # uname -m returns i386 or x86_64 1456a5a2a776Smrg UNAME_PROCESSOR=$UNAME_MACHINE 14576d36ef34Smrg fi 1458a5a2a776Smrg GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE 1459a5a2a776Smrg ;; 14601abf7346Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 14611abf7346Smrg UNAME_PROCESSOR=`uname -p` 1462ae5a67adSmrg if test "$UNAME_PROCESSOR" = x86; then 14631abf7346Smrg UNAME_PROCESSOR=i386 14641abf7346Smrg UNAME_MACHINE=pc 14651abf7346Smrg fi 1466a5a2a776Smrg GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE 1467a5a2a776Smrg ;; 14681abf7346Smrg *:QNX:*:4*) 1469a5a2a776Smrg GUESS=i386-pc-qnx 1470a5a2a776Smrg ;; 1471ae5a67adSmrg NEO-*:NONSTOP_KERNEL:*:*) 1472a5a2a776Smrg GUESS=neo-tandem-nsk$UNAME_RELEASE 1473a5a2a776Smrg ;; 14746d36ef34Smrg NSE-*:NONSTOP_KERNEL:*:*) 1475a5a2a776Smrg GUESS=nse-tandem-nsk$UNAME_RELEASE 1476a5a2a776Smrg ;; 1477ae5a67adSmrg NSR-*:NONSTOP_KERNEL:*:*) 1478a5a2a776Smrg GUESS=nsr-tandem-nsk$UNAME_RELEASE 1479a5a2a776Smrg ;; 1480ae5a67adSmrg NSV-*:NONSTOP_KERNEL:*:*) 1481a5a2a776Smrg GUESS=nsv-tandem-nsk$UNAME_RELEASE 1482a5a2a776Smrg ;; 1483ae5a67adSmrg NSX-*:NONSTOP_KERNEL:*:*) 1484a5a2a776Smrg GUESS=nsx-tandem-nsk$UNAME_RELEASE 1485a5a2a776Smrg ;; 14861abf7346Smrg *:NonStop-UX:*:*) 1487a5a2a776Smrg GUESS=mips-compaq-nonstopux 1488a5a2a776Smrg ;; 14891abf7346Smrg BS2000:POSIX*:*:*) 1490a5a2a776Smrg GUESS=bs2000-siemens-sysv 1491a5a2a776Smrg ;; 14921abf7346Smrg DS/*:UNIX_System_V:*:*) 1493a5a2a776Smrg GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE 1494a5a2a776Smrg ;; 14951abf7346Smrg *:Plan9:*:*) 14961abf7346Smrg # "uname -m" is not consistent, so use $cputype instead. 386 14971abf7346Smrg # is converted to i386 for consistency with other x86 14981abf7346Smrg # operating systems. 1499a5a2a776Smrg if test "${cputype-}" = 386; then 15001abf7346Smrg UNAME_MACHINE=i386 1501a5a2a776Smrg elif test "x${cputype-}" != x; then 1502a5a2a776Smrg UNAME_MACHINE=$cputype 15031abf7346Smrg fi 1504a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-plan9 1505a5a2a776Smrg ;; 15061abf7346Smrg *:TOPS-10:*:*) 1507a5a2a776Smrg GUESS=pdp10-unknown-tops10 1508a5a2a776Smrg ;; 15091abf7346Smrg *:TENEX:*:*) 1510a5a2a776Smrg GUESS=pdp10-unknown-tenex 1511a5a2a776Smrg ;; 15121abf7346Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1513a5a2a776Smrg GUESS=pdp10-dec-tops20 1514a5a2a776Smrg ;; 15151abf7346Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1516a5a2a776Smrg GUESS=pdp10-xkl-tops20 1517a5a2a776Smrg ;; 15181abf7346Smrg *:TOPS-20:*:*) 1519a5a2a776Smrg GUESS=pdp10-unknown-tops20 1520a5a2a776Smrg ;; 15211abf7346Smrg *:ITS:*:*) 1522a5a2a776Smrg GUESS=pdp10-unknown-its 1523a5a2a776Smrg ;; 15241abf7346Smrg SEI:*:*:SEIUX) 1525a5a2a776Smrg GUESS=mips-sei-seiux$UNAME_RELEASE 1526a5a2a776Smrg ;; 15271abf7346Smrg *:DragonFly:*:*) 1528a5a2a776Smrg DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 1529a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL 1530a5a2a776Smrg ;; 15311abf7346Smrg *:*VMS:*:*) 15326d36ef34Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 1533a5a2a776Smrg case $UNAME_MACHINE in 1534a5a2a776Smrg A*) GUESS=alpha-dec-vms ;; 1535a5a2a776Smrg I*) GUESS=ia64-dec-vms ;; 1536a5a2a776Smrg V*) GUESS=vax-dec-vms ;; 15371abf7346Smrg esac ;; 15381abf7346Smrg *:XENIX:*:SysV) 1539a5a2a776Smrg GUESS=i386-pc-xenix 1540a5a2a776Smrg ;; 15411abf7346Smrg i*86:skyos:*:*) 1542a5a2a776Smrg SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` 1543a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL 1544a5a2a776Smrg ;; 15451abf7346Smrg i*86:rdos:*:*) 1546a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-rdos 1547a5a2a776Smrg ;; 1548a5a2a776Smrg i*86:Fiwix:*:*) 1549a5a2a776Smrg GUESS=$UNAME_MACHINE-pc-fiwix 1550a5a2a776Smrg ;; 1551a5a2a776Smrg *:AROS:*:*) 1552a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-aros 1553a5a2a776Smrg ;; 15546d36ef34Smrg x86_64:VMkernel:*:*) 1555a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-esx 1556a5a2a776Smrg ;; 1557ae5a67adSmrg amd64:Isilon\ OneFS:*:*) 1558a5a2a776Smrg GUESS=x86_64-unknown-onefs 1559a5a2a776Smrg ;; 1560a5a2a776Smrg *:Unleashed:*:*) 1561a5a2a776Smrg GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE 1562a5a2a776Smrg ;; 15631abf7346Smrgesac 15641abf7346Smrg 1565a5a2a776Smrg# Do we have a guess based on uname results? 1566a5a2a776Smrgif test "x$GUESS" != x; then 1567a5a2a776Smrg echo "$GUESS" 1568a5a2a776Smrg exit 1569a5a2a776Smrgfi 1570a5a2a776Smrg 1571a5a2a776Smrg# No uname command or uname output not recognized. 1572a5a2a776Smrgset_cc_for_build 1573a5a2a776Smrgcat > "$dummy.c" <<EOF 1574a5a2a776Smrg#ifdef _SEQUENT_ 1575a5a2a776Smrg#include <sys/types.h> 1576a5a2a776Smrg#include <sys/utsname.h> 1577a5a2a776Smrg#endif 1578a5a2a776Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 1579a5a2a776Smrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 1580a5a2a776Smrg#include <signal.h> 1581a5a2a776Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1582a5a2a776Smrg#include <sys/utsname.h> 1583a5a2a776Smrg#endif 1584a5a2a776Smrg#endif 1585a5a2a776Smrg#endif 1586a5a2a776Smrgmain () 1587a5a2a776Smrg{ 1588a5a2a776Smrg#if defined (sony) 1589a5a2a776Smrg#if defined (MIPSEB) 1590a5a2a776Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1591a5a2a776Smrg I don't know.... */ 1592a5a2a776Smrg printf ("mips-sony-bsd\n"); exit (0); 1593a5a2a776Smrg#else 1594a5a2a776Smrg#include <sys/param.h> 1595a5a2a776Smrg printf ("m68k-sony-newsos%s\n", 1596a5a2a776Smrg#ifdef NEWSOS4 1597a5a2a776Smrg "4" 1598a5a2a776Smrg#else 1599a5a2a776Smrg "" 1600a5a2a776Smrg#endif 1601a5a2a776Smrg ); exit (0); 1602a5a2a776Smrg#endif 1603a5a2a776Smrg#endif 1604a5a2a776Smrg 1605a5a2a776Smrg#if defined (NeXT) 1606a5a2a776Smrg#if !defined (__ARCHITECTURE__) 1607a5a2a776Smrg#define __ARCHITECTURE__ "m68k" 1608a5a2a776Smrg#endif 1609a5a2a776Smrg int version; 1610a5a2a776Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1611a5a2a776Smrg if (version < 4) 1612a5a2a776Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1613a5a2a776Smrg else 1614a5a2a776Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1615a5a2a776Smrg exit (0); 1616a5a2a776Smrg#endif 1617a5a2a776Smrg 1618a5a2a776Smrg#if defined (MULTIMAX) || defined (n16) 1619a5a2a776Smrg#if defined (UMAXV) 1620a5a2a776Smrg printf ("ns32k-encore-sysv\n"); exit (0); 1621a5a2a776Smrg#else 1622a5a2a776Smrg#if defined (CMU) 1623a5a2a776Smrg printf ("ns32k-encore-mach\n"); exit (0); 1624a5a2a776Smrg#else 1625a5a2a776Smrg printf ("ns32k-encore-bsd\n"); exit (0); 1626a5a2a776Smrg#endif 1627a5a2a776Smrg#endif 1628a5a2a776Smrg#endif 1629a5a2a776Smrg 1630a5a2a776Smrg#if defined (__386BSD__) 1631a5a2a776Smrg printf ("i386-pc-bsd\n"); exit (0); 1632a5a2a776Smrg#endif 1633a5a2a776Smrg 1634a5a2a776Smrg#if defined (sequent) 1635a5a2a776Smrg#if defined (i386) 1636a5a2a776Smrg printf ("i386-sequent-dynix\n"); exit (0); 1637a5a2a776Smrg#endif 1638a5a2a776Smrg#if defined (ns32000) 1639a5a2a776Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 1640a5a2a776Smrg#endif 1641a5a2a776Smrg#endif 1642a5a2a776Smrg 1643a5a2a776Smrg#if defined (_SEQUENT_) 1644a5a2a776Smrg struct utsname un; 1645a5a2a776Smrg 1646a5a2a776Smrg uname(&un); 1647a5a2a776Smrg if (strncmp(un.version, "V2", 2) == 0) { 1648a5a2a776Smrg printf ("i386-sequent-ptx2\n"); exit (0); 1649a5a2a776Smrg } 1650a5a2a776Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1651a5a2a776Smrg printf ("i386-sequent-ptx1\n"); exit (0); 1652a5a2a776Smrg } 1653a5a2a776Smrg printf ("i386-sequent-ptx\n"); exit (0); 1654a5a2a776Smrg#endif 1655a5a2a776Smrg 1656a5a2a776Smrg#if defined (vax) 1657a5a2a776Smrg#if !defined (ultrix) 1658a5a2a776Smrg#include <sys/param.h> 1659a5a2a776Smrg#if defined (BSD) 1660a5a2a776Smrg#if BSD == 43 1661a5a2a776Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 1662a5a2a776Smrg#else 1663a5a2a776Smrg#if BSD == 199006 1664a5a2a776Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 1665a5a2a776Smrg#else 1666a5a2a776Smrg printf ("vax-dec-bsd\n"); exit (0); 1667a5a2a776Smrg#endif 1668a5a2a776Smrg#endif 1669a5a2a776Smrg#else 1670a5a2a776Smrg printf ("vax-dec-bsd\n"); exit (0); 1671a5a2a776Smrg#endif 1672a5a2a776Smrg#else 1673a5a2a776Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1674a5a2a776Smrg struct utsname un; 1675a5a2a776Smrg uname (&un); 1676a5a2a776Smrg printf ("vax-dec-ultrix%s\n", un.release); exit (0); 1677a5a2a776Smrg#else 1678a5a2a776Smrg printf ("vax-dec-ultrix\n"); exit (0); 1679a5a2a776Smrg#endif 1680a5a2a776Smrg#endif 1681a5a2a776Smrg#endif 1682a5a2a776Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 1683a5a2a776Smrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 1684a5a2a776Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1685a5a2a776Smrg struct utsname *un; 1686a5a2a776Smrg uname (&un); 1687a5a2a776Smrg printf ("mips-dec-ultrix%s\n", un.release); exit (0); 1688a5a2a776Smrg#else 1689a5a2a776Smrg printf ("mips-dec-ultrix\n"); exit (0); 1690a5a2a776Smrg#endif 1691a5a2a776Smrg#endif 1692a5a2a776Smrg#endif 1693a5a2a776Smrg 1694a5a2a776Smrg#if defined (alliant) && defined (i860) 1695a5a2a776Smrg printf ("i860-alliant-bsd\n"); exit (0); 1696a5a2a776Smrg#endif 1697a5a2a776Smrg 1698a5a2a776Smrg exit (1); 1699a5a2a776Smrg} 1700a5a2a776SmrgEOF 1701a5a2a776Smrg 1702a5a2a776Smrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && 1703a5a2a776Smrg { echo "$SYSTEM_NAME"; exit; } 1704a5a2a776Smrg 1705a5a2a776Smrg# Apollos put the system type in the environment. 1706a5a2a776Smrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } 1707a5a2a776Smrg 1708ae5a67adSmrgecho "$0: unable to guess system type" >&2 1709ae5a67adSmrg 1710a5a2a776Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM in 1711ae5a67adSmrg mips:Linux | mips64:Linux) 1712ae5a67adSmrg # If we got here on MIPS GNU/Linux, output extra information. 1713ae5a67adSmrg cat >&2 <<EOF 1714ae5a67adSmrg 1715ae5a67adSmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize 1716ae5a67adSmrgthe system type. Please install a C compiler and try again. 1717ae5a67adSmrgEOF 1718ae5a67adSmrg ;; 1719ae5a67adSmrgesac 1720ae5a67adSmrg 17211abf7346Smrgcat >&2 <<EOF 17221abf7346Smrg 1723ae5a67adSmrgThis script (version $timestamp), has failed to recognize the 1724ae5a67adSmrgoperating system you are using. If your script is old, overwrite *all* 1725ae5a67adSmrgcopies of config.guess and config.sub with the latest versions from: 17261abf7346Smrg 1727a5a2a776Smrg https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 17281abf7346Smrgand 1729a5a2a776Smrg https://git.savannah.gnu.org/cgit/config.git/plain/config.sub 1730a5a2a776SmrgEOF 1731a5a2a776Smrg 1732a5a2a776Smrgour_year=`echo $timestamp | sed 's,-.*,,'` 1733a5a2a776Smrgthisyear=`date +%Y` 1734a5a2a776Smrg# shellcheck disable=SC2003 1735a5a2a776Smrgscript_age=`expr "$thisyear" - "$our_year"` 1736a5a2a776Smrgif test "$script_age" -lt 3 ; then 1737a5a2a776Smrg cat >&2 <<EOF 17381abf7346Smrg 1739ae5a67adSmrgIf $0 has already been updated, send the following data and any 1740ae5a67adSmrginformation you think might be pertinent to config-patches@gnu.org to 1741ae5a67adSmrgprovide the necessary information to handle your system. 17421abf7346Smrg 17431abf7346Smrgconfig.guess timestamp = $timestamp 17441abf7346Smrg 17451abf7346Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 17461abf7346Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 17471abf7346Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 17481abf7346Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 17491abf7346Smrg 17501abf7346Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 17511abf7346Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 17521abf7346Smrg 17531abf7346Smrghostinfo = `(hostinfo) 2>/dev/null` 17541abf7346Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 17551abf7346Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 17561abf7346Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 17571abf7346Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 17581abf7346Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 17591abf7346Smrg 1760ae5a67adSmrgUNAME_MACHINE = "$UNAME_MACHINE" 1761ae5a67adSmrgUNAME_RELEASE = "$UNAME_RELEASE" 1762ae5a67adSmrgUNAME_SYSTEM = "$UNAME_SYSTEM" 1763ae5a67adSmrgUNAME_VERSION = "$UNAME_VERSION" 17641abf7346SmrgEOF 1765a5a2a776Smrgfi 17661abf7346Smrg 17671abf7346Smrgexit 1 17681abf7346Smrg 17691abf7346Smrg# Local variables: 1770a5a2a776Smrg# eval: (add-hook 'before-save-hook 'time-stamp) 17711abf7346Smrg# time-stamp-start: "timestamp='" 17721abf7346Smrg# time-stamp-format: "%:y-%02m-%02d" 17731abf7346Smrg# time-stamp-end: "'" 17741abf7346Smrg# End: 1775