129459361Smrg#! /bin/sh 229459361Smrg# Attempt to guess a canonical system name. 39683b4e0Smrg# Copyright 1992-2023 Free Software Foundation, Inc. 429459361Smrg 5291ca6f5Smrg# shellcheck disable=SC2006,SC2268 # see below for rationale 6291ca6f5Smrg 79683b4e0Smrgtimestamp='2023-01-01' 829459361Smrg 929459361Smrg# This file is free software; you can redistribute it and/or modify it 1029459361Smrg# under the terms of the GNU General Public License as published by 119683b4e0Smrg# the Free Software Foundation, either version 3 of the License, or 1229459361Smrg# (at your option) any later version. 1329459361Smrg# 1429459361Smrg# This program is distributed in the hope that it will be useful, but 1529459361Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1629459361Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1729459361Smrg# General Public License for more details. 1829459361Smrg# 1929459361Smrg# You should have received a copy of the GNU General Public License 2027935385Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>. 2129459361Smrg# 2229459361Smrg# As a special exception to the GNU General Public License, if you 2329459361Smrg# distribute this file as part of a program that contains a 2429459361Smrg# configuration script generated by Autoconf, you may include it under 25f66e55a2Smrg# the same distribution terms that you use for the rest of that 26f66e55a2Smrg# program. This Exception is an additional permission under section 7 27f66e55a2Smrg# of the GNU General Public License, version 3 ("GPLv3"). 2829459361Smrg# 2927935385Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 3029459361Smrg# 31c3c9b392Smrg# You can get the latest version of this script from: 32291ca6f5Smrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 33f66e55a2Smrg# 3427935385Smrg# Please send patches to <config-patches@gnu.org>. 35f66e55a2Smrg 3629459361Smrg 37291ca6f5Smrg# The "shellcheck disable" line above the timestamp inhibits complaints 38291ca6f5Smrg# about features and limitations of the classic Bourne shell that were 39291ca6f5Smrg# superseded or lifted in POSIX. However, this script identifies a wide 40291ca6f5Smrg# variety of pre-POSIX systems that do not have POSIX shells at all, and 41291ca6f5Smrg# even some reasonably current systems (Solaris 10 as case-in-point) still 42291ca6f5Smrg# have a pre-POSIX /bin/sh. 43291ca6f5Smrg 44291ca6f5Smrg 4529459361Smrgme=`echo "$0" | sed -e 's,.*/,,'` 4629459361Smrg 4729459361Smrgusage="\ 4829459361SmrgUsage: $0 [OPTION] 4929459361Smrg 5029459361SmrgOutput the configuration name of the system \`$me' is run on. 5129459361Smrg 5227935385SmrgOptions: 5329459361Smrg -h, --help print this help, then exit 5429459361Smrg -t, --time-stamp print date of last modification, then exit 5529459361Smrg -v, --version print version number, then exit 5629459361Smrg 5729459361SmrgReport bugs and patches to <config-patches@gnu.org>." 5829459361Smrg 5929459361Smrgversion="\ 6029459361SmrgGNU config.guess ($timestamp) 6129459361Smrg 6229459361SmrgOriginally written by Per Bothner. 639683b4e0SmrgCopyright 1992-2023 Free Software Foundation, Inc. 6429459361Smrg 6529459361SmrgThis is free software; see the source for copying conditions. There is NO 6629459361Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6729459361Smrg 6829459361Smrghelp=" 6929459361SmrgTry \`$me --help' for more information." 7029459361Smrg 7129459361Smrg# Parse command line 7229459361Smrgwhile test $# -gt 0 ; do 7329459361Smrg case $1 in 7429459361Smrg --time-stamp | --time* | -t ) 7529459361Smrg echo "$timestamp" ; exit ;; 7629459361Smrg --version | -v ) 7729459361Smrg echo "$version" ; exit ;; 7829459361Smrg --help | --h* | -h ) 7929459361Smrg echo "$usage"; exit ;; 8029459361Smrg -- ) # Stop option processing 8129459361Smrg shift; break ;; 8229459361Smrg - ) # Use stdin as input. 8329459361Smrg break ;; 8429459361Smrg -* ) 8529459361Smrg echo "$me: invalid option $1$help" >&2 8629459361Smrg exit 1 ;; 8729459361Smrg * ) 8829459361Smrg break ;; 8929459361Smrg esac 9029459361Smrgdone 9129459361Smrg 9229459361Smrgif test $# != 0; then 9329459361Smrg echo "$me: too many arguments$help" >&2 9429459361Smrg exit 1 9529459361Smrgfi 9629459361Smrg 97291ca6f5Smrg# Just in case it came from the environment. 98291ca6f5SmrgGUESS= 9929459361Smrg 10029459361Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 10129459361Smrg# compiler to aid in system detection is discouraged as it requires 10229459361Smrg# temporary files to be created and, as you can see below, it is a 10329459361Smrg# headache to deal with in a portable fashion. 10429459361Smrg 10529459361Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 10629459361Smrg# use `HOST_CC' if defined, but it is deprecated. 10729459361Smrg 10829459361Smrg# Portable tmp directory creation inspired by the Autoconf team. 10929459361Smrg 110291ca6f5Smrgtmp= 111291ca6f5Smrg# shellcheck disable=SC2172 112291ca6f5Smrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 113291ca6f5Smrg 114291ca6f5Smrgset_cc_for_build() { 115291ca6f5Smrg # prevent multiple calls if $tmp is already set 116291ca6f5Smrg test "$tmp" && return 0 117291ca6f5Smrg : "${TMPDIR=/tmp}" 118291ca6f5Smrg # shellcheck disable=SC2039,SC3028 119291ca6f5Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 120291ca6f5Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || 121291ca6f5Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || 122291ca6f5Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } 123291ca6f5Smrg dummy=$tmp/dummy 124291ca6f5Smrg case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in 125291ca6f5Smrg ,,) echo "int x;" > "$dummy.c" 126291ca6f5Smrg for driver in cc gcc c89 c99 ; do 127291ca6f5Smrg if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then 128291ca6f5Smrg CC_FOR_BUILD=$driver 129291ca6f5Smrg break 130291ca6f5Smrg fi 131291ca6f5Smrg done 132291ca6f5Smrg if test x"$CC_FOR_BUILD" = x ; then 133291ca6f5Smrg CC_FOR_BUILD=no_compiler_found 134291ca6f5Smrg fi 135291ca6f5Smrg ;; 136291ca6f5Smrg ,,*) CC_FOR_BUILD=$CC ;; 137291ca6f5Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 138291ca6f5Smrg esac 139291ca6f5Smrg} 14029459361Smrg 14129459361Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 14229459361Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 143291ca6f5Smrgif test -f /.attbin/uname ; then 14429459361Smrg PATH=$PATH:/.attbin ; export PATH 14529459361Smrgfi 14629459361Smrg 14729459361SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 14829459361SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 149291ca6f5SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 15029459361SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 15129459361Smrg 152291ca6f5Smrgcase $UNAME_SYSTEM in 15327935385SmrgLinux|GNU|GNU/*) 154291ca6f5Smrg LIBC=unknown 15527935385Smrg 156291ca6f5Smrg set_cc_for_build 15727935385Smrg cat <<-EOF > "$dummy.c" 15827935385Smrg #include <features.h> 15927935385Smrg #if defined(__UCLIBC__) 16027935385Smrg LIBC=uclibc 16127935385Smrg #elif defined(__dietlibc__) 16227935385Smrg LIBC=dietlibc 163291ca6f5Smrg #elif defined(__GLIBC__) 16427935385Smrg LIBC=gnu 165291ca6f5Smrg #else 166291ca6f5Smrg #include <stdarg.h> 167291ca6f5Smrg /* First heuristic to detect musl libc. */ 168291ca6f5Smrg #ifdef __DEFINED_va_list 169291ca6f5Smrg LIBC=musl 170291ca6f5Smrg #endif 17127935385Smrg #endif 17227935385Smrg EOF 173291ca6f5Smrg cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` 174291ca6f5Smrg eval "$cc_set_libc" 17527935385Smrg 176291ca6f5Smrg # Second heuristic to detect musl libc. 177291ca6f5Smrg if [ "$LIBC" = unknown ] && 178291ca6f5Smrg command -v ldd >/dev/null && 179291ca6f5Smrg ldd --version 2>&1 | grep -q ^musl; then 180291ca6f5Smrg LIBC=musl 181291ca6f5Smrg fi 182291ca6f5Smrg 183291ca6f5Smrg # If the system lacks a compiler, then just pick glibc. 184291ca6f5Smrg # We could probably try harder. 185291ca6f5Smrg if [ "$LIBC" = unknown ]; then 186291ca6f5Smrg LIBC=gnu 18727935385Smrg fi 18827935385Smrg ;; 18927935385Smrgesac 19027935385Smrg 19129459361Smrg# Note: order is significant - the case branches are not exclusive. 19229459361Smrg 193291ca6f5Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in 19429459361Smrg *:NetBSD:*:*) 19529459361Smrg # NetBSD (nbsd) targets should (where applicable) match one or 196f66e55a2Smrg # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 19729459361Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 19829459361Smrg # switched to ELF, *-*-netbsd* would select the old 19929459361Smrg # object file format. This provides both forward 20029459361Smrg # compatibility and a consistent mechanism for selecting the 20129459361Smrg # object file format. 20229459361Smrg # 20329459361Smrg # Note: NetBSD doesn't particularly care about the vendor 20429459361Smrg # portion of the name. We always set it to "unknown". 20527935385Smrg UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ 206291ca6f5Smrg /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 207291ca6f5Smrg /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 20827935385Smrg echo unknown)` 209291ca6f5Smrg case $UNAME_MACHINE_ARCH in 210291ca6f5Smrg aarch64eb) machine=aarch64_be-unknown ;; 21129459361Smrg armeb) machine=armeb-unknown ;; 21229459361Smrg arm*) machine=arm-unknown ;; 21329459361Smrg sh3el) machine=shl-unknown ;; 21429459361Smrg sh3eb) machine=sh-unknown ;; 21529459361Smrg sh5el) machine=sh5le-unknown ;; 21627935385Smrg earmv*) 21727935385Smrg arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` 21827935385Smrg endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` 219291ca6f5Smrg machine=${arch}${endian}-unknown 22027935385Smrg ;; 221291ca6f5Smrg *) machine=$UNAME_MACHINE_ARCH-unknown ;; 22229459361Smrg esac 22329459361Smrg # The Operating System including object format, if it has switched 22427935385Smrg # to ELF recently (or will in the future) and ABI. 225291ca6f5Smrg case $UNAME_MACHINE_ARCH in 22627935385Smrg earm*) 22727935385Smrg os=netbsdelf 22827935385Smrg ;; 22929459361Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 230291ca6f5Smrg set_cc_for_build 23129459361Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 232c3c9b392Smrg | grep -q __ELF__ 23329459361Smrg then 23429459361Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 23529459361Smrg # Return netbsd for either. FIX? 23629459361Smrg os=netbsd 23729459361Smrg else 23829459361Smrg os=netbsdelf 23929459361Smrg fi 24029459361Smrg ;; 24129459361Smrg *) 242f66e55a2Smrg os=netbsd 24329459361Smrg ;; 24429459361Smrg esac 24527935385Smrg # Determine ABI tags. 246291ca6f5Smrg case $UNAME_MACHINE_ARCH in 24727935385Smrg earm*) 24827935385Smrg expr='s/^earmv[0-9]/-eabi/;s/eb$//' 24927935385Smrg abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` 25027935385Smrg ;; 25127935385Smrg esac 25229459361Smrg # The OS release 25329459361Smrg # Debian GNU/NetBSD machines have a different userland, and 25429459361Smrg # thus, need a distinct triplet. However, they do not need 25529459361Smrg # kernel version information, so it can be replaced with a 25629459361Smrg # suitable tag, in the style of linux-gnu. 257291ca6f5Smrg case $UNAME_VERSION in 25829459361Smrg Debian*) 25929459361Smrg release='-gnu' 26029459361Smrg ;; 26129459361Smrg *) 26227935385Smrg release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` 26329459361Smrg ;; 26429459361Smrg esac 26529459361Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 26629459361Smrg # contains redundant information, the shorter form: 26729459361Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 268291ca6f5Smrg GUESS=$machine-${os}${release}${abi-} 269291ca6f5Smrg ;; 270f66e55a2Smrg *:Bitrig:*:*) 271f66e55a2Smrg UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 272291ca6f5Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE 273291ca6f5Smrg ;; 27429459361Smrg *:OpenBSD:*:*) 27529459361Smrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 276291ca6f5Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE 277291ca6f5Smrg ;; 278291ca6f5Smrg *:SecBSD:*:*) 279291ca6f5Smrg UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` 280291ca6f5Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE 281291ca6f5Smrg ;; 28227935385Smrg *:LibertyBSD:*:*) 28327935385Smrg UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` 284291ca6f5Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE 285291ca6f5Smrg ;; 28627935385Smrg *:MidnightBSD:*:*) 287291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE 288291ca6f5Smrg ;; 28929459361Smrg *:ekkoBSD:*:*) 290291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE 291291ca6f5Smrg ;; 29229459361Smrg *:SolidBSD:*:*) 293291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE 294291ca6f5Smrg ;; 295291ca6f5Smrg *:OS108:*:*) 296291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE 297291ca6f5Smrg ;; 29829459361Smrg macppc:MirBSD:*:*) 299291ca6f5Smrg GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE 300291ca6f5Smrg ;; 30129459361Smrg *:MirBSD:*:*) 302291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE 303291ca6f5Smrg ;; 30427935385Smrg *:Sortix:*:*) 305291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-sortix 306291ca6f5Smrg ;; 307291ca6f5Smrg *:Twizzler:*:*) 308291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-twizzler 309291ca6f5Smrg ;; 31027935385Smrg *:Redox:*:*) 311291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-redox 312291ca6f5Smrg ;; 31327935385Smrg mips:OSF1:*.*) 314291ca6f5Smrg GUESS=mips-dec-osf1 315291ca6f5Smrg ;; 31629459361Smrg alpha:OSF1:*:*) 317291ca6f5Smrg # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 318291ca6f5Smrg trap '' 0 31929459361Smrg case $UNAME_RELEASE in 32029459361Smrg *4.0) 32129459361Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 32229459361Smrg ;; 32329459361Smrg *5.*) 324f66e55a2Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 32529459361Smrg ;; 32629459361Smrg esac 32729459361Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 32829459361Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 32929459361Smrg # covers most systems running today. This code pipes the CPU 33029459361Smrg # types through head -n 1, so we only detect the type of CPU 0. 33129459361Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 332291ca6f5Smrg case $ALPHA_CPU_TYPE in 33329459361Smrg "EV4 (21064)") 33427935385Smrg UNAME_MACHINE=alpha ;; 33529459361Smrg "EV4.5 (21064)") 33627935385Smrg UNAME_MACHINE=alpha ;; 33729459361Smrg "LCA4 (21066/21068)") 33827935385Smrg UNAME_MACHINE=alpha ;; 33929459361Smrg "EV5 (21164)") 34027935385Smrg UNAME_MACHINE=alphaev5 ;; 34129459361Smrg "EV5.6 (21164A)") 34227935385Smrg UNAME_MACHINE=alphaev56 ;; 34329459361Smrg "EV5.6 (21164PC)") 34427935385Smrg UNAME_MACHINE=alphapca56 ;; 34529459361Smrg "EV5.7 (21164PC)") 34627935385Smrg UNAME_MACHINE=alphapca57 ;; 34729459361Smrg "EV6 (21264)") 34827935385Smrg UNAME_MACHINE=alphaev6 ;; 34929459361Smrg "EV6.7 (21264A)") 35027935385Smrg UNAME_MACHINE=alphaev67 ;; 35129459361Smrg "EV6.8CB (21264C)") 35227935385Smrg UNAME_MACHINE=alphaev68 ;; 35329459361Smrg "EV6.8AL (21264B)") 35427935385Smrg UNAME_MACHINE=alphaev68 ;; 35529459361Smrg "EV6.8CX (21264D)") 35627935385Smrg UNAME_MACHINE=alphaev68 ;; 35729459361Smrg "EV6.9A (21264/EV69A)") 35827935385Smrg UNAME_MACHINE=alphaev69 ;; 35929459361Smrg "EV7 (21364)") 36027935385Smrg UNAME_MACHINE=alphaev7 ;; 36129459361Smrg "EV7.9 (21364A)") 36227935385Smrg UNAME_MACHINE=alphaev79 ;; 36329459361Smrg esac 36429459361Smrg # A Pn.n version is a patched version. 36529459361Smrg # A Vn.n version is a released version. 36629459361Smrg # A Tn.n version is a released field test version. 36729459361Smrg # A Xn.n version is an unreleased experimental baselevel. 36829459361Smrg # 1.2 uses "1.2" for uname -r. 369291ca6f5Smrg OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 370291ca6f5Smrg GUESS=$UNAME_MACHINE-dec-osf$OSF_REL 371291ca6f5Smrg ;; 37229459361Smrg Amiga*:UNIX_System_V:4.0:*) 373291ca6f5Smrg GUESS=m68k-unknown-sysv4 374291ca6f5Smrg ;; 37529459361Smrg *:[Aa]miga[Oo][Ss]:*:*) 376291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-amigaos 377291ca6f5Smrg ;; 37829459361Smrg *:[Mm]orph[Oo][Ss]:*:*) 379291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-morphos 380291ca6f5Smrg ;; 38129459361Smrg *:OS/390:*:*) 382291ca6f5Smrg GUESS=i370-ibm-openedition 383291ca6f5Smrg ;; 38429459361Smrg *:z/VM:*:*) 385291ca6f5Smrg GUESS=s390-ibm-zvmoe 386291ca6f5Smrg ;; 38729459361Smrg *:OS400:*:*) 388291ca6f5Smrg GUESS=powerpc-ibm-os400 389291ca6f5Smrg ;; 39029459361Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 391291ca6f5Smrg GUESS=arm-acorn-riscix$UNAME_RELEASE 392291ca6f5Smrg ;; 393f66e55a2Smrg arm*:riscos:*:*|arm*:RISCOS:*:*) 394291ca6f5Smrg GUESS=arm-unknown-riscos 395291ca6f5Smrg ;; 39629459361Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 397291ca6f5Smrg GUESS=hppa1.1-hitachi-hiuxmpp 398291ca6f5Smrg ;; 39929459361Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 40029459361Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 401291ca6f5Smrg case `(/bin/universe) 2>/dev/null` in 402291ca6f5Smrg att) GUESS=pyramid-pyramid-sysv3 ;; 403291ca6f5Smrg *) GUESS=pyramid-pyramid-bsd ;; 404291ca6f5Smrg esac 405291ca6f5Smrg ;; 40629459361Smrg NILE*:*:*:dcosx) 407291ca6f5Smrg GUESS=pyramid-pyramid-svr4 408291ca6f5Smrg ;; 40929459361Smrg DRS?6000:unix:4.0:6*) 410291ca6f5Smrg GUESS=sparc-icl-nx6 411291ca6f5Smrg ;; 41229459361Smrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 41329459361Smrg case `/usr/bin/uname -p` in 414291ca6f5Smrg sparc) GUESS=sparc-icl-nx7 ;; 415291ca6f5Smrg esac 416291ca6f5Smrg ;; 4175715adc0Smrg s390x:SunOS:*:*) 418291ca6f5Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 419291ca6f5Smrg GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL 420291ca6f5Smrg ;; 42129459361Smrg sun4H:SunOS:5.*:*) 422291ca6f5Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 423291ca6f5Smrg GUESS=sparc-hal-solaris2$SUN_REL 424291ca6f5Smrg ;; 42529459361Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 426291ca6f5Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 427291ca6f5Smrg GUESS=sparc-sun-solaris2$SUN_REL 428291ca6f5Smrg ;; 429c3c9b392Smrg i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 430291ca6f5Smrg GUESS=i386-pc-auroraux$UNAME_RELEASE 431291ca6f5Smrg ;; 4325715adc0Smrg i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 433291ca6f5Smrg set_cc_for_build 43427935385Smrg SUN_ARCH=i386 4355715adc0Smrg # If there is a compiler, see if it is configured for 64-bit objects. 4365715adc0Smrg # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 4375715adc0Smrg # This test works for both compilers. 438291ca6f5Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 4395715adc0Smrg if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 4409683b4e0Smrg (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ 4415715adc0Smrg grep IS_64BIT_ARCH >/dev/null 4425715adc0Smrg then 44327935385Smrg SUN_ARCH=x86_64 4445715adc0Smrg fi 4455715adc0Smrg fi 446291ca6f5Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 447291ca6f5Smrg GUESS=$SUN_ARCH-pc-solaris2$SUN_REL 448291ca6f5Smrg ;; 44929459361Smrg sun4*:SunOS:6*:*) 45029459361Smrg # According to config.sub, this is the proper way to canonicalize 45129459361Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 45229459361Smrg # it's likely to be more like Solaris than SunOS4. 453291ca6f5Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 454291ca6f5Smrg GUESS=sparc-sun-solaris3$SUN_REL 455291ca6f5Smrg ;; 45629459361Smrg sun4*:SunOS:*:*) 457291ca6f5Smrg case `/usr/bin/arch -k` in 45829459361Smrg Series*|S4*) 45929459361Smrg UNAME_RELEASE=`uname -v` 46029459361Smrg ;; 46129459361Smrg esac 46229459361Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 463291ca6f5Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` 464291ca6f5Smrg GUESS=sparc-sun-sunos$SUN_REL 465291ca6f5Smrg ;; 46629459361Smrg sun3*:SunOS:*:*) 467291ca6f5Smrg GUESS=m68k-sun-sunos$UNAME_RELEASE 468291ca6f5Smrg ;; 46929459361Smrg sun*:*:4.2BSD:*) 47029459361Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 47127935385Smrg test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 472291ca6f5Smrg case `/bin/arch` in 47329459361Smrg sun3) 474291ca6f5Smrg GUESS=m68k-sun-sunos$UNAME_RELEASE 47529459361Smrg ;; 47629459361Smrg sun4) 477291ca6f5Smrg GUESS=sparc-sun-sunos$UNAME_RELEASE 47829459361Smrg ;; 47929459361Smrg esac 480291ca6f5Smrg ;; 48129459361Smrg aushp:SunOS:*:*) 482291ca6f5Smrg GUESS=sparc-auspex-sunos$UNAME_RELEASE 483291ca6f5Smrg ;; 48429459361Smrg # The situation for MiNT is a little confusing. The machine name 48529459361Smrg # can be virtually everything (everything which is not 48629459361Smrg # "atarist" or "atariste" at least should have a processor 48729459361Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 48829459361Smrg # to the lowercase version "mint" (or "freemint"). Finally 48929459361Smrg # the system name "TOS" denotes a system which is actually not 49029459361Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 49129459361Smrg # be no problem. 49229459361Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 493291ca6f5Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 494291ca6f5Smrg ;; 49529459361Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 496291ca6f5Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 497291ca6f5Smrg ;; 49829459361Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 499291ca6f5Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 500291ca6f5Smrg ;; 50129459361Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 502291ca6f5Smrg GUESS=m68k-milan-mint$UNAME_RELEASE 503291ca6f5Smrg ;; 50429459361Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 505291ca6f5Smrg GUESS=m68k-hades-mint$UNAME_RELEASE 506291ca6f5Smrg ;; 50729459361Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 508291ca6f5Smrg GUESS=m68k-unknown-mint$UNAME_RELEASE 509291ca6f5Smrg ;; 51029459361Smrg m68k:machten:*:*) 511291ca6f5Smrg GUESS=m68k-apple-machten$UNAME_RELEASE 512291ca6f5Smrg ;; 51329459361Smrg powerpc:machten:*:*) 514291ca6f5Smrg GUESS=powerpc-apple-machten$UNAME_RELEASE 515291ca6f5Smrg ;; 51629459361Smrg RISC*:Mach:*:*) 517291ca6f5Smrg GUESS=mips-dec-mach_bsd4.3 518291ca6f5Smrg ;; 51929459361Smrg RISC*:ULTRIX:*:*) 520291ca6f5Smrg GUESS=mips-dec-ultrix$UNAME_RELEASE 521291ca6f5Smrg ;; 52229459361Smrg VAX*:ULTRIX*:*:*) 523291ca6f5Smrg GUESS=vax-dec-ultrix$UNAME_RELEASE 524291ca6f5Smrg ;; 52529459361Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 526291ca6f5Smrg GUESS=clipper-intergraph-clix$UNAME_RELEASE 527291ca6f5Smrg ;; 52829459361Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 529291ca6f5Smrg set_cc_for_build 53027935385Smrg sed 's/^ //' << EOF > "$dummy.c" 53129459361Smrg#ifdef __cplusplus 53229459361Smrg#include <stdio.h> /* for printf() prototype */ 53329459361Smrg int main (int argc, char *argv[]) { 53429459361Smrg#else 53529459361Smrg int main (argc, argv) int argc; char *argv[]; { 53629459361Smrg#endif 53729459361Smrg #if defined (host_mips) && defined (MIPSEB) 53829459361Smrg #if defined (SYSTYPE_SYSV) 53927935385Smrg printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); 54029459361Smrg #endif 54129459361Smrg #if defined (SYSTYPE_SVR4) 54227935385Smrg printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); 54329459361Smrg #endif 54429459361Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 54527935385Smrg printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); 54629459361Smrg #endif 54729459361Smrg #endif 54829459361Smrg exit (-1); 54929459361Smrg } 55029459361SmrgEOF 55127935385Smrg $CC_FOR_BUILD -o "$dummy" "$dummy.c" && 55227935385Smrg dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && 55327935385Smrg SYSTEM_NAME=`"$dummy" "$dummyarg"` && 55429459361Smrg { echo "$SYSTEM_NAME"; exit; } 555291ca6f5Smrg GUESS=mips-mips-riscos$UNAME_RELEASE 556291ca6f5Smrg ;; 55729459361Smrg Motorola:PowerMAX_OS:*:*) 558291ca6f5Smrg GUESS=powerpc-motorola-powermax 559291ca6f5Smrg ;; 56029459361Smrg Motorola:*:4.3:PL8-*) 561291ca6f5Smrg GUESS=powerpc-harris-powermax 562291ca6f5Smrg ;; 56329459361Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 564291ca6f5Smrg GUESS=powerpc-harris-powermax 565291ca6f5Smrg ;; 56629459361Smrg Night_Hawk:Power_UNIX:*:*) 567291ca6f5Smrg GUESS=powerpc-harris-powerunix 568291ca6f5Smrg ;; 56929459361Smrg m88k:CX/UX:7*:*) 570291ca6f5Smrg GUESS=m88k-harris-cxux7 571291ca6f5Smrg ;; 57229459361Smrg m88k:*:4*:R4*) 573291ca6f5Smrg GUESS=m88k-motorola-sysv4 574291ca6f5Smrg ;; 57529459361Smrg m88k:*:3*:R3*) 576291ca6f5Smrg GUESS=m88k-motorola-sysv3 577291ca6f5Smrg ;; 57829459361Smrg AViiON:dgux:*:*) 579f66e55a2Smrg # DG/UX returns AViiON for all architectures 580f66e55a2Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 581291ca6f5Smrg if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 58229459361Smrg then 583291ca6f5Smrg if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ 584291ca6f5Smrg test "$TARGET_BINARY_INTERFACE"x = x 58529459361Smrg then 586291ca6f5Smrg GUESS=m88k-dg-dgux$UNAME_RELEASE 58729459361Smrg else 588291ca6f5Smrg GUESS=m88k-dg-dguxbcs$UNAME_RELEASE 58929459361Smrg fi 59029459361Smrg else 591291ca6f5Smrg GUESS=i586-dg-dgux$UNAME_RELEASE 59229459361Smrg fi 593291ca6f5Smrg ;; 59429459361Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 595291ca6f5Smrg GUESS=m88k-dolphin-sysv3 596291ca6f5Smrg ;; 59729459361Smrg M88*:*:R3*:*) 59829459361Smrg # Delta 88k system running SVR3 599291ca6f5Smrg GUESS=m88k-motorola-sysv3 600291ca6f5Smrg ;; 60129459361Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 602291ca6f5Smrg GUESS=m88k-tektronix-sysv3 603291ca6f5Smrg ;; 60429459361Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 605291ca6f5Smrg GUESS=m68k-tektronix-bsd 606291ca6f5Smrg ;; 60729459361Smrg *:IRIX*:*:*) 608291ca6f5Smrg IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` 609291ca6f5Smrg GUESS=mips-sgi-irix$IRIX_REL 610291ca6f5Smrg ;; 61129459361Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 612291ca6f5Smrg GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id 613291ca6f5Smrg ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 61429459361Smrg i*86:AIX:*:*) 615291ca6f5Smrg GUESS=i386-ibm-aix 616291ca6f5Smrg ;; 61729459361Smrg ia64:AIX:*:*) 618291ca6f5Smrg if test -x /usr/bin/oslevel ; then 61929459361Smrg IBM_REV=`/usr/bin/oslevel` 62029459361Smrg else 621291ca6f5Smrg IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 62229459361Smrg fi 623291ca6f5Smrg GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV 624291ca6f5Smrg ;; 62529459361Smrg *:AIX:2:3) 62629459361Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 627291ca6f5Smrg set_cc_for_build 62827935385Smrg sed 's/^ //' << EOF > "$dummy.c" 62929459361Smrg #include <sys/systemcfg.h> 63029459361Smrg 63129459361Smrg main() 63229459361Smrg { 63329459361Smrg if (!__power_pc()) 63429459361Smrg exit(1); 63529459361Smrg puts("powerpc-ibm-aix3.2.5"); 63629459361Smrg exit(0); 63729459361Smrg } 63829459361SmrgEOF 63927935385Smrg if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` 64029459361Smrg then 641291ca6f5Smrg GUESS=$SYSTEM_NAME 64229459361Smrg else 643291ca6f5Smrg GUESS=rs6000-ibm-aix3.2.5 64429459361Smrg fi 64529459361Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 646291ca6f5Smrg GUESS=rs6000-ibm-aix3.2.4 64729459361Smrg else 648291ca6f5Smrg GUESS=rs6000-ibm-aix3.2 64929459361Smrg fi 650291ca6f5Smrg ;; 651c3c9b392Smrg *:AIX:*:[4567]) 65229459361Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 65327935385Smrg if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then 65429459361Smrg IBM_ARCH=rs6000 65529459361Smrg else 65629459361Smrg IBM_ARCH=powerpc 65729459361Smrg fi 658291ca6f5Smrg if test -x /usr/bin/lslpp ; then 659291ca6f5Smrg IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ 66027935385Smrg awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 66129459361Smrg else 662291ca6f5Smrg IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 66329459361Smrg fi 664291ca6f5Smrg GUESS=$IBM_ARCH-ibm-aix$IBM_REV 665291ca6f5Smrg ;; 66629459361Smrg *:AIX:*:*) 667291ca6f5Smrg GUESS=rs6000-ibm-aix 668291ca6f5Smrg ;; 66927935385Smrg ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 670291ca6f5Smrg GUESS=romp-ibm-bsd4.4 671291ca6f5Smrg ;; 67229459361Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 673291ca6f5Smrg GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to 674291ca6f5Smrg ;; # report: romp-ibm BSD 4.3 67529459361Smrg *:BOSX:*:*) 676291ca6f5Smrg GUESS=rs6000-bull-bosx 677291ca6f5Smrg ;; 67829459361Smrg DPX/2?00:B.O.S.:*:*) 679291ca6f5Smrg GUESS=m68k-bull-sysv3 680291ca6f5Smrg ;; 68129459361Smrg 9000/[34]??:4.3bsd:1.*:*) 682291ca6f5Smrg GUESS=m68k-hp-bsd 683291ca6f5Smrg ;; 68429459361Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 685291ca6f5Smrg GUESS=m68k-hp-bsd4.4 686291ca6f5Smrg ;; 68729459361Smrg 9000/[34678]??:HP-UX:*:*) 688291ca6f5Smrg HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 689291ca6f5Smrg case $UNAME_MACHINE in 69027935385Smrg 9000/31?) HP_ARCH=m68000 ;; 69127935385Smrg 9000/[34]??) HP_ARCH=m68k ;; 69229459361Smrg 9000/[678][0-9][0-9]) 693291ca6f5Smrg if test -x /usr/bin/getconf; then 69429459361Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 695f66e55a2Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 696291ca6f5Smrg case $sc_cpu_version in 69727935385Smrg 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 69827935385Smrg 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 699f66e55a2Smrg 532) # CPU_PA_RISC2_0 700291ca6f5Smrg case $sc_kernel_bits in 70127935385Smrg 32) HP_ARCH=hppa2.0n ;; 70227935385Smrg 64) HP_ARCH=hppa2.0w ;; 70327935385Smrg '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 704f66e55a2Smrg esac ;; 705f66e55a2Smrg esac 70629459361Smrg fi 707291ca6f5Smrg if test "$HP_ARCH" = ""; then 708291ca6f5Smrg set_cc_for_build 70927935385Smrg sed 's/^ //' << EOF > "$dummy.c" 71029459361Smrg 711f66e55a2Smrg #define _HPUX_SOURCE 712f66e55a2Smrg #include <stdlib.h> 713f66e55a2Smrg #include <unistd.h> 71429459361Smrg 715f66e55a2Smrg int main () 716f66e55a2Smrg { 717f66e55a2Smrg #if defined(_SC_KERNEL_BITS) 718f66e55a2Smrg long bits = sysconf(_SC_KERNEL_BITS); 719f66e55a2Smrg #endif 720f66e55a2Smrg long cpu = sysconf (_SC_CPU_VERSION); 72129459361Smrg 722f66e55a2Smrg switch (cpu) 723f66e55a2Smrg { 724f66e55a2Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 725f66e55a2Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 726f66e55a2Smrg case CPU_PA_RISC2_0: 727f66e55a2Smrg #if defined(_SC_KERNEL_BITS) 728f66e55a2Smrg switch (bits) 729f66e55a2Smrg { 730f66e55a2Smrg case 64: puts ("hppa2.0w"); break; 731f66e55a2Smrg case 32: puts ("hppa2.0n"); break; 732f66e55a2Smrg default: puts ("hppa2.0"); break; 733f66e55a2Smrg } break; 734f66e55a2Smrg #else /* !defined(_SC_KERNEL_BITS) */ 735f66e55a2Smrg puts ("hppa2.0"); break; 736f66e55a2Smrg #endif 737f66e55a2Smrg default: puts ("hppa1.0"); break; 738f66e55a2Smrg } 739f66e55a2Smrg exit (0); 740f66e55a2Smrg } 74129459361SmrgEOF 74227935385Smrg (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` 74329459361Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 74429459361Smrg fi ;; 74529459361Smrg esac 746291ca6f5Smrg if test "$HP_ARCH" = hppa2.0w 74729459361Smrg then 748291ca6f5Smrg set_cc_for_build 74929459361Smrg 75029459361Smrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 75129459361Smrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 75229459361Smrg # generating 64-bit code. GNU and HP use different nomenclature: 75329459361Smrg # 75429459361Smrg # $ CC_FOR_BUILD=cc ./config.guess 75529459361Smrg # => hppa2.0w-hp-hpux11.23 75629459361Smrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 75729459361Smrg # => hppa64-hp-hpux11.23 75829459361Smrg 75927935385Smrg if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | 760c3c9b392Smrg grep -q __LP64__ 76129459361Smrg then 76227935385Smrg HP_ARCH=hppa2.0w 76329459361Smrg else 76427935385Smrg HP_ARCH=hppa64 76529459361Smrg fi 76629459361Smrg fi 767291ca6f5Smrg GUESS=$HP_ARCH-hp-hpux$HPUX_REV 768291ca6f5Smrg ;; 76929459361Smrg ia64:HP-UX:*:*) 770291ca6f5Smrg HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 771291ca6f5Smrg GUESS=ia64-hp-hpux$HPUX_REV 772291ca6f5Smrg ;; 77329459361Smrg 3050*:HI-UX:*:*) 774291ca6f5Smrg set_cc_for_build 77527935385Smrg sed 's/^ //' << EOF > "$dummy.c" 77629459361Smrg #include <unistd.h> 77729459361Smrg int 77829459361Smrg main () 77929459361Smrg { 78029459361Smrg long cpu = sysconf (_SC_CPU_VERSION); 78129459361Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 78229459361Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 78329459361Smrg results, however. */ 78429459361Smrg if (CPU_IS_PA_RISC (cpu)) 78529459361Smrg { 78629459361Smrg switch (cpu) 78729459361Smrg { 78829459361Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 78929459361Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 79029459361Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 79129459361Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 79229459361Smrg } 79329459361Smrg } 79429459361Smrg else if (CPU_IS_HP_MC68K (cpu)) 79529459361Smrg puts ("m68k-hitachi-hiuxwe2"); 79629459361Smrg else puts ("unknown-hitachi-hiuxwe2"); 79729459361Smrg exit (0); 79829459361Smrg } 79929459361SmrgEOF 80027935385Smrg $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && 80129459361Smrg { echo "$SYSTEM_NAME"; exit; } 802291ca6f5Smrg GUESS=unknown-hitachi-hiuxwe2 803291ca6f5Smrg ;; 80427935385Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) 805291ca6f5Smrg GUESS=hppa1.1-hp-bsd 806291ca6f5Smrg ;; 80729459361Smrg 9000/8??:4.3bsd:*:*) 808291ca6f5Smrg GUESS=hppa1.0-hp-bsd 809291ca6f5Smrg ;; 81029459361Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 811291ca6f5Smrg GUESS=hppa1.0-hp-mpeix 812291ca6f5Smrg ;; 81327935385Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) 814291ca6f5Smrg GUESS=hppa1.1-hp-osf 815291ca6f5Smrg ;; 81629459361Smrg hp8??:OSF1:*:*) 817291ca6f5Smrg GUESS=hppa1.0-hp-osf 818291ca6f5Smrg ;; 81929459361Smrg i*86:OSF1:*:*) 820291ca6f5Smrg if test -x /usr/sbin/sysversion ; then 821291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-osf1mk 82229459361Smrg else 823291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-osf1 82429459361Smrg fi 825291ca6f5Smrg ;; 82629459361Smrg parisc*:Lites*:*:*) 827291ca6f5Smrg GUESS=hppa1.1-hp-lites 828291ca6f5Smrg ;; 82929459361Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 830291ca6f5Smrg GUESS=c1-convex-bsd 831291ca6f5Smrg ;; 83229459361Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 83329459361Smrg if getsysinfo -f scalar_acc 83429459361Smrg then echo c32-convex-bsd 83529459361Smrg else echo c2-convex-bsd 83629459361Smrg fi 837f66e55a2Smrg exit ;; 83829459361Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 839291ca6f5Smrg GUESS=c34-convex-bsd 840291ca6f5Smrg ;; 84129459361Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 842291ca6f5Smrg GUESS=c38-convex-bsd 843291ca6f5Smrg ;; 84429459361Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 845291ca6f5Smrg GUESS=c4-convex-bsd 846291ca6f5Smrg ;; 84729459361Smrg CRAY*Y-MP:*:*:*) 848291ca6f5Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 849291ca6f5Smrg GUESS=ymp-cray-unicos$CRAY_REL 850291ca6f5Smrg ;; 85129459361Smrg CRAY*[A-Z]90:*:*:*) 85227935385Smrg echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ 85329459361Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 85429459361Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 85529459361Smrg -e 's/\.[^.]*$/.X/' 85629459361Smrg exit ;; 85729459361Smrg CRAY*TS:*:*:*) 858291ca6f5Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 859291ca6f5Smrg GUESS=t90-cray-unicos$CRAY_REL 860291ca6f5Smrg ;; 86129459361Smrg CRAY*T3E:*:*:*) 862291ca6f5Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 863291ca6f5Smrg GUESS=alphaev5-cray-unicosmk$CRAY_REL 864291ca6f5Smrg ;; 86529459361Smrg CRAY*SV1:*:*:*) 866291ca6f5Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 867291ca6f5Smrg GUESS=sv1-cray-unicos$CRAY_REL 868291ca6f5Smrg ;; 86929459361Smrg *:UNICOS/mp:*:*) 870291ca6f5Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 871291ca6f5Smrg GUESS=craynv-cray-unicosmp$CRAY_REL 872291ca6f5Smrg ;; 87329459361Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 87427935385Smrg FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 87527935385Smrg FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 87627935385Smrg FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` 877291ca6f5Smrg GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 878291ca6f5Smrg ;; 87929459361Smrg 5000:UNIX_System_V:4.*:*) 88027935385Smrg FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 88127935385Smrg FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` 882291ca6f5Smrg GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 883291ca6f5Smrg ;; 88429459361Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 885291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE 886291ca6f5Smrg ;; 88729459361Smrg sparc*:BSD/OS:*:*) 888291ca6f5Smrg GUESS=sparc-unknown-bsdi$UNAME_RELEASE 889291ca6f5Smrg ;; 89029459361Smrg *:BSD/OS:*:*) 891291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE 892291ca6f5Smrg ;; 893291ca6f5Smrg arm:FreeBSD:*:*) 894291ca6f5Smrg UNAME_PROCESSOR=`uname -p` 895291ca6f5Smrg set_cc_for_build 896291ca6f5Smrg if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 897291ca6f5Smrg | grep -q __ARM_PCS_VFP 898291ca6f5Smrg then 899291ca6f5Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 900291ca6f5Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi 901291ca6f5Smrg else 902291ca6f5Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 903291ca6f5Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf 904291ca6f5Smrg fi 905291ca6f5Smrg ;; 90629459361Smrg *:FreeBSD:*:*) 907f66e55a2Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 908291ca6f5Smrg case $UNAME_PROCESSOR in 90929459361Smrg amd64) 91027935385Smrg UNAME_PROCESSOR=x86_64 ;; 91127935385Smrg i386) 91227935385Smrg UNAME_PROCESSOR=i586 ;; 91329459361Smrg esac 914291ca6f5Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 915291ca6f5Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL 916291ca6f5Smrg ;; 91729459361Smrg i*:CYGWIN*:*) 918291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-cygwin 919291ca6f5Smrg ;; 920f66e55a2Smrg *:MINGW64*:*) 921291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-mingw64 922291ca6f5Smrg ;; 9235715adc0Smrg *:MINGW*:*) 924291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-mingw32 925291ca6f5Smrg ;; 92627935385Smrg *:MSYS*:*) 927291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-msys 928291ca6f5Smrg ;; 92929459361Smrg i*:PW*:*) 930291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-pw32 931291ca6f5Smrg ;; 9329683b4e0Smrg *:SerenityOS:*:*) 9339683b4e0Smrg GUESS=$UNAME_MACHINE-pc-serenity 9349683b4e0Smrg ;; 935c3c9b392Smrg *:Interix*:*) 936291ca6f5Smrg case $UNAME_MACHINE in 9375715adc0Smrg x86) 938291ca6f5Smrg GUESS=i586-pc-interix$UNAME_RELEASE 939291ca6f5Smrg ;; 940c3c9b392Smrg authenticamd | genuineintel | EM64T) 941291ca6f5Smrg GUESS=x86_64-unknown-interix$UNAME_RELEASE 942291ca6f5Smrg ;; 9435715adc0Smrg IA64) 944291ca6f5Smrg GUESS=ia64-unknown-interix$UNAME_RELEASE 945291ca6f5Smrg ;; 9465715adc0Smrg esac ;; 94729459361Smrg i*:UWIN*:*) 948291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-uwin 949291ca6f5Smrg ;; 95029459361Smrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 951291ca6f5Smrg GUESS=x86_64-pc-cygwin 952291ca6f5Smrg ;; 95329459361Smrg prep*:SunOS:5.*:*) 954291ca6f5Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 955291ca6f5Smrg GUESS=powerpcle-unknown-solaris2$SUN_REL 956291ca6f5Smrg ;; 95729459361Smrg *:GNU:*:*) 95829459361Smrg # the GNU system 959291ca6f5Smrg GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` 960291ca6f5Smrg GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` 961291ca6f5Smrg GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL 962291ca6f5Smrg ;; 96329459361Smrg *:GNU/*:*:*) 96429459361Smrg # other systems with GNU libc and userland 965291ca6f5Smrg GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` 966291ca6f5Smrg GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 967291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC 968291ca6f5Smrg ;; 9699683b4e0Smrg x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) 9709683b4e0Smrg GUESS="$UNAME_MACHINE-pc-managarm-mlibc" 9719683b4e0Smrg ;; 9729683b4e0Smrg *:[Mm]anagarm:*:*) 9739683b4e0Smrg GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" 9749683b4e0Smrg ;; 975291ca6f5Smrg *:Minix:*:*) 976291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-minix 977291ca6f5Smrg ;; 978f66e55a2Smrg aarch64:Linux:*:*) 979291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 980291ca6f5Smrg ;; 981f66e55a2Smrg aarch64_be:Linux:*:*) 982f66e55a2Smrg UNAME_MACHINE=aarch64_be 983291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 984291ca6f5Smrg ;; 985c3c9b392Smrg alpha:Linux:*:*) 986291ca6f5Smrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in 987c3c9b392Smrg EV5) UNAME_MACHINE=alphaev5 ;; 988c3c9b392Smrg EV56) UNAME_MACHINE=alphaev56 ;; 989c3c9b392Smrg PCA56) UNAME_MACHINE=alphapca56 ;; 990c3c9b392Smrg PCA57) UNAME_MACHINE=alphapca56 ;; 991c3c9b392Smrg EV6) UNAME_MACHINE=alphaev6 ;; 992c3c9b392Smrg EV67) UNAME_MACHINE=alphaev67 ;; 993c3c9b392Smrg EV68*) UNAME_MACHINE=alphaev68 ;; 994f66e55a2Smrg esac 995c3c9b392Smrg objdump --private-headers /bin/sh | grep -q ld.so.1 99627935385Smrg if test "$?" = 0 ; then LIBC=gnulibc1 ; fi 997291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 998291ca6f5Smrg ;; 999291ca6f5Smrg arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) 1000291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1001291ca6f5Smrg ;; 100229459361Smrg arm*:Linux:*:*) 1003291ca6f5Smrg set_cc_for_build 10045715adc0Smrg if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 10055715adc0Smrg | grep -q __ARM_EABI__ 10065715adc0Smrg then 1007291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10085715adc0Smrg else 1009f66e55a2Smrg if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 1010f66e55a2Smrg | grep -q __ARM_PCS_VFP 1011f66e55a2Smrg then 1012291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi 1013f66e55a2Smrg else 1014291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf 1015f66e55a2Smrg fi 10165715adc0Smrg fi 1017291ca6f5Smrg ;; 101829459361Smrg avr32*:Linux:*:*) 1019291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1020291ca6f5Smrg ;; 102129459361Smrg cris:Linux:*:*) 1022291ca6f5Smrg GUESS=$UNAME_MACHINE-axis-linux-$LIBC 1023291ca6f5Smrg ;; 102429459361Smrg crisv32:Linux:*:*) 1025291ca6f5Smrg GUESS=$UNAME_MACHINE-axis-linux-$LIBC 1026291ca6f5Smrg ;; 102727935385Smrg e2k:Linux:*:*) 1028291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1029291ca6f5Smrg ;; 103029459361Smrg frv:Linux:*:*) 1031291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1032291ca6f5Smrg ;; 1033f66e55a2Smrg hexagon:Linux:*:*) 1034291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1035291ca6f5Smrg ;; 1036c3c9b392Smrg i*86:Linux:*:*) 1037291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-linux-$LIBC 1038291ca6f5Smrg ;; 103929459361Smrg ia64:Linux:*:*) 1040291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1041291ca6f5Smrg ;; 104227935385Smrg k1om:Linux:*:*) 1043291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1044291ca6f5Smrg ;; 10459683b4e0Smrg loongarch32:Linux:*:* | loongarch64:Linux:*:*) 1046291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1047291ca6f5Smrg ;; 104829459361Smrg m32r*:Linux:*:*) 1049291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1050291ca6f5Smrg ;; 105129459361Smrg m68*:Linux:*:*) 1052291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1053291ca6f5Smrg ;; 1054c3c9b392Smrg mips:Linux:*:* | mips64:Linux:*:*) 1055291ca6f5Smrg set_cc_for_build 1056291ca6f5Smrg IS_GLIBC=0 1057291ca6f5Smrg test x"${LIBC}" = xgnu && IS_GLIBC=1 105827935385Smrg sed 's/^ //' << EOF > "$dummy.c" 105929459361Smrg #undef CPU 1060291ca6f5Smrg #undef mips 1061291ca6f5Smrg #undef mipsel 1062291ca6f5Smrg #undef mips64 1063291ca6f5Smrg #undef mips64el 1064291ca6f5Smrg #if ${IS_GLIBC} && defined(_ABI64) 1065291ca6f5Smrg LIBCABI=gnuabi64 1066291ca6f5Smrg #else 1067291ca6f5Smrg #if ${IS_GLIBC} && defined(_ABIN32) 1068291ca6f5Smrg LIBCABI=gnuabin32 1069291ca6f5Smrg #else 1070291ca6f5Smrg LIBCABI=${LIBC} 1071291ca6f5Smrg #endif 1072291ca6f5Smrg #endif 1073291ca6f5Smrg 1074291ca6f5Smrg #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 1075291ca6f5Smrg CPU=mipsisa64r6 1076291ca6f5Smrg #else 1077291ca6f5Smrg #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 1078291ca6f5Smrg CPU=mipsisa32r6 1079291ca6f5Smrg #else 1080291ca6f5Smrg #if defined(__mips64) 1081291ca6f5Smrg CPU=mips64 1082291ca6f5Smrg #else 1083291ca6f5Smrg CPU=mips 1084291ca6f5Smrg #endif 1085291ca6f5Smrg #endif 1086291ca6f5Smrg #endif 1087291ca6f5Smrg 108829459361Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 1089291ca6f5Smrg MIPS_ENDIAN=el 109029459361Smrg #else 109129459361Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 1092291ca6f5Smrg MIPS_ENDIAN= 109329459361Smrg #else 1094291ca6f5Smrg MIPS_ENDIAN= 109529459361Smrg #endif 109629459361Smrg #endif 109729459361SmrgEOF 1098291ca6f5Smrg cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` 1099291ca6f5Smrg eval "$cc_set_vars" 1100291ca6f5Smrg test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } 110129459361Smrg ;; 110227935385Smrg mips64el:Linux:*:*) 1103291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1104291ca6f5Smrg ;; 110527935385Smrg openrisc*:Linux:*:*) 1106291ca6f5Smrg GUESS=or1k-unknown-linux-$LIBC 1107291ca6f5Smrg ;; 110827935385Smrg or32:Linux:*:* | or1k*:Linux:*:*) 1109291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1110291ca6f5Smrg ;; 11115715adc0Smrg padre:Linux:*:*) 1112291ca6f5Smrg GUESS=sparc-unknown-linux-$LIBC 1113291ca6f5Smrg ;; 1114c3c9b392Smrg parisc64:Linux:*:* | hppa64:Linux:*:*) 1115291ca6f5Smrg GUESS=hppa64-unknown-linux-$LIBC 1116291ca6f5Smrg ;; 111729459361Smrg parisc:Linux:*:* | hppa:Linux:*:*) 111829459361Smrg # Look for CPU level 111929459361Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 1120291ca6f5Smrg PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; 1121291ca6f5Smrg PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; 1122291ca6f5Smrg *) GUESS=hppa-unknown-linux-$LIBC ;; 112329459361Smrg esac 1124291ca6f5Smrg ;; 1125c3c9b392Smrg ppc64:Linux:*:*) 1126291ca6f5Smrg GUESS=powerpc64-unknown-linux-$LIBC 1127291ca6f5Smrg ;; 1128c3c9b392Smrg ppc:Linux:*:*) 1129291ca6f5Smrg GUESS=powerpc-unknown-linux-$LIBC 1130291ca6f5Smrg ;; 113127935385Smrg ppc64le:Linux:*:*) 1132291ca6f5Smrg GUESS=powerpc64le-unknown-linux-$LIBC 1133291ca6f5Smrg ;; 113427935385Smrg ppcle:Linux:*:*) 1135291ca6f5Smrg GUESS=powerpcle-unknown-linux-$LIBC 1136291ca6f5Smrg ;; 1137291ca6f5Smrg riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) 1138291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1139291ca6f5Smrg ;; 114029459361Smrg s390:Linux:*:* | s390x:Linux:*:*) 1141291ca6f5Smrg GUESS=$UNAME_MACHINE-ibm-linux-$LIBC 1142291ca6f5Smrg ;; 114329459361Smrg sh64*:Linux:*:*) 1144291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1145291ca6f5Smrg ;; 114629459361Smrg sh*:Linux:*:*) 1147291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1148291ca6f5Smrg ;; 114929459361Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 1150291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1151291ca6f5Smrg ;; 1152c3c9b392Smrg tile*:Linux:*:*) 1153291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1154291ca6f5Smrg ;; 115529459361Smrg vax:Linux:*:*) 1156291ca6f5Smrg GUESS=$UNAME_MACHINE-dec-linux-$LIBC 1157291ca6f5Smrg ;; 115829459361Smrg x86_64:Linux:*:*) 1159291ca6f5Smrg set_cc_for_build 11609683b4e0Smrg CPU=$UNAME_MACHINE 1161291ca6f5Smrg LIBCABI=$LIBC 1162291ca6f5Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 11639683b4e0Smrg ABI=64 11649683b4e0Smrg sed 's/^ //' << EOF > "$dummy.c" 11659683b4e0Smrg #ifdef __i386__ 11669683b4e0Smrg ABI=x86 11679683b4e0Smrg #else 11689683b4e0Smrg #ifdef __ILP32__ 11699683b4e0Smrg ABI=x32 11709683b4e0Smrg #endif 11719683b4e0Smrg #endif 11729683b4e0SmrgEOF 11739683b4e0Smrg cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` 11749683b4e0Smrg eval "$cc_set_abi" 11759683b4e0Smrg case $ABI in 11769683b4e0Smrg x86) CPU=i686 ;; 11779683b4e0Smrg x32) LIBCABI=${LIBC}x32 ;; 11789683b4e0Smrg esac 1179291ca6f5Smrg fi 11809683b4e0Smrg GUESS=$CPU-pc-linux-$LIBCABI 1181291ca6f5Smrg ;; 11825715adc0Smrg xtensa*:Linux:*:*) 1183291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1184291ca6f5Smrg ;; 118529459361Smrg i*86:DYNIX/ptx:4*:*) 118629459361Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 118729459361Smrg # earlier versions are messed up and put the nodename in both 118829459361Smrg # sysname and nodename. 1189291ca6f5Smrg GUESS=i386-sequent-sysv4 1190291ca6f5Smrg ;; 119129459361Smrg i*86:UNIX_SV:4.2MP:2.*) 1192f66e55a2Smrg # Unixware is an offshoot of SVR4, but it has its own version 1193f66e55a2Smrg # number series starting with 2... 1194f66e55a2Smrg # I am not positive that other SVR4 systems won't match this, 119529459361Smrg # I just have to hope. -- rms. 1196f66e55a2Smrg # Use sysv4.2uw... so that sysv4* matches it. 1197291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION 1198291ca6f5Smrg ;; 119929459361Smrg i*86:OS/2:*:*) 120029459361Smrg # If we were able to find `uname', then EMX Unix compatibility 120129459361Smrg # is probably installed. 1202291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-os2-emx 1203291ca6f5Smrg ;; 120429459361Smrg i*86:XTS-300:*:STOP) 1205291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-stop 1206291ca6f5Smrg ;; 120729459361Smrg i*86:atheos:*:*) 1208291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-atheos 1209291ca6f5Smrg ;; 121029459361Smrg i*86:syllable:*:*) 1211291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-syllable 1212291ca6f5Smrg ;; 1213c3c9b392Smrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1214291ca6f5Smrg GUESS=i386-unknown-lynxos$UNAME_RELEASE 1215291ca6f5Smrg ;; 121629459361Smrg i*86:*DOS:*:*) 1217291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-msdosdjgpp 1218291ca6f5Smrg ;; 121927935385Smrg i*86:*:4.*:*) 122027935385Smrg UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` 122129459361Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1222291ca6f5Smrg GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL 122329459361Smrg else 1224291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL 122529459361Smrg fi 1226291ca6f5Smrg ;; 122729459361Smrg i*86:*:5:[678]*) 1228f66e55a2Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 122929459361Smrg case `/bin/uname -X | grep "^Machine"` in 123029459361Smrg *486*) UNAME_MACHINE=i486 ;; 123129459361Smrg *Pentium) UNAME_MACHINE=i586 ;; 123229459361Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 123329459361Smrg esac 1234291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1235291ca6f5Smrg ;; 123629459361Smrg i*86:*:3.2:*) 123729459361Smrg if test -f /usr/options/cb.name; then 123829459361Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1239291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL 124029459361Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 124129459361Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 124229459361Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 124329459361Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 124429459361Smrg && UNAME_MACHINE=i586 124529459361Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 124629459361Smrg && UNAME_MACHINE=i686 124729459361Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 124829459361Smrg && UNAME_MACHINE=i686 1249291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL 125029459361Smrg else 1251291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-sysv32 125229459361Smrg fi 1253291ca6f5Smrg ;; 125429459361Smrg pc:*:*:*) 125529459361Smrg # Left here for compatibility: 1256f66e55a2Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 1257f66e55a2Smrg # the processor, so we play safe by assuming i586. 12585715adc0Smrg # Note: whatever this is, it MUST be the same as what config.sub 125927935385Smrg # prints for the "djgpp" host, or else GDB configure will decide that 12605715adc0Smrg # this is a cross-build. 1261291ca6f5Smrg GUESS=i586-pc-msdosdjgpp 1262291ca6f5Smrg ;; 126329459361Smrg Intel:Mach:3*:*) 1264291ca6f5Smrg GUESS=i386-pc-mach3 1265291ca6f5Smrg ;; 126629459361Smrg paragon:*:*:*) 1267291ca6f5Smrg GUESS=i860-intel-osf1 1268291ca6f5Smrg ;; 126929459361Smrg i860:*:4.*:*) # i860-SVR4 127029459361Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1271291ca6f5Smrg GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 127229459361Smrg else # Add other i860-SVR4 vendors below as they are discovered. 1273291ca6f5Smrg GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 127429459361Smrg fi 1275291ca6f5Smrg ;; 127629459361Smrg mini*:CTIX:SYS*5:*) 127729459361Smrg # "miniframe" 1278291ca6f5Smrg GUESS=m68010-convergent-sysv 1279291ca6f5Smrg ;; 128029459361Smrg mc68k:UNIX:SYSTEM5:3.51m) 1281291ca6f5Smrg GUESS=m68k-convergent-sysv 1282291ca6f5Smrg ;; 128329459361Smrg M680?0:D-NIX:5.3:*) 1284291ca6f5Smrg GUESS=m68k-diab-dnix 1285291ca6f5Smrg ;; 128629459361Smrg M68*:*:R3V[5678]*:*) 128729459361Smrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 128829459361Smrg 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) 128929459361Smrg OS_REL='' 129029459361Smrg test -r /etc/.relid \ 129129459361Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 129229459361Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 129327935385Smrg && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 129429459361Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 129527935385Smrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 129629459361Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1297f66e55a2Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1298f66e55a2Smrg && { echo i486-ncr-sysv4; exit; } ;; 12995715adc0Smrg NCR*:*:4.2:* | MPRAS*:*:4.2:*) 13005715adc0Smrg OS_REL='.3' 13015715adc0Smrg test -r /etc/.relid \ 13025715adc0Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 13035715adc0Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 130427935385Smrg && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 13055715adc0Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 130627935385Smrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } 13075715adc0Smrg /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 130827935385Smrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 130929459361Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1310291ca6f5Smrg GUESS=m68k-unknown-lynxos$UNAME_RELEASE 1311291ca6f5Smrg ;; 131229459361Smrg mc68030:UNIX_System_V:4.*:*) 1313291ca6f5Smrg GUESS=m68k-atari-sysv4 1314291ca6f5Smrg ;; 131529459361Smrg TSUNAMI:LynxOS:2.*:*) 1316291ca6f5Smrg GUESS=sparc-unknown-lynxos$UNAME_RELEASE 1317291ca6f5Smrg ;; 131829459361Smrg rs6000:LynxOS:2.*:*) 1319291ca6f5Smrg GUESS=rs6000-unknown-lynxos$UNAME_RELEASE 1320291ca6f5Smrg ;; 1321c3c9b392Smrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1322291ca6f5Smrg GUESS=powerpc-unknown-lynxos$UNAME_RELEASE 1323291ca6f5Smrg ;; 132429459361Smrg SM[BE]S:UNIX_SV:*:*) 1325291ca6f5Smrg GUESS=mips-dde-sysv$UNAME_RELEASE 1326291ca6f5Smrg ;; 132729459361Smrg RM*:ReliantUNIX-*:*:*) 1328291ca6f5Smrg GUESS=mips-sni-sysv4 1329291ca6f5Smrg ;; 133029459361Smrg RM*:SINIX-*:*:*) 1331291ca6f5Smrg GUESS=mips-sni-sysv4 1332291ca6f5Smrg ;; 133329459361Smrg *:SINIX-*:*:*) 133429459361Smrg if uname -p 2>/dev/null >/dev/null ; then 133529459361Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 1336291ca6f5Smrg GUESS=$UNAME_MACHINE-sni-sysv4 133729459361Smrg else 1338291ca6f5Smrg GUESS=ns32k-sni-sysv 133929459361Smrg fi 1340291ca6f5Smrg ;; 1341f66e55a2Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1342f66e55a2Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 1343291ca6f5Smrg GUESS=i586-unisys-sysv4 1344291ca6f5Smrg ;; 134529459361Smrg *:UNIX_System_V:4*:FTX*) 134629459361Smrg # From Gerald Hewes <hewes@openmarket.com>. 134729459361Smrg # How about differentiating between stratus architectures? -djm 1348291ca6f5Smrg GUESS=hppa1.1-stratus-sysv4 1349291ca6f5Smrg ;; 135029459361Smrg *:*:*:FTX*) 135129459361Smrg # From seanf@swdc.stratus.com. 1352291ca6f5Smrg GUESS=i860-stratus-sysv4 1353291ca6f5Smrg ;; 135429459361Smrg i*86:VOS:*:*) 135529459361Smrg # From Paul.Green@stratus.com. 1356291ca6f5Smrg GUESS=$UNAME_MACHINE-stratus-vos 1357291ca6f5Smrg ;; 135829459361Smrg *:VOS:*:*) 135929459361Smrg # From Paul.Green@stratus.com. 1360291ca6f5Smrg GUESS=hppa1.1-stratus-vos 1361291ca6f5Smrg ;; 136229459361Smrg mc68*:A/UX:*:*) 1363291ca6f5Smrg GUESS=m68k-apple-aux$UNAME_RELEASE 1364291ca6f5Smrg ;; 136529459361Smrg news*:NEWS-OS:6*:*) 1366291ca6f5Smrg GUESS=mips-sony-newsos6 1367291ca6f5Smrg ;; 136829459361Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1369291ca6f5Smrg if test -d /usr/nec; then 1370291ca6f5Smrg GUESS=mips-nec-sysv$UNAME_RELEASE 137129459361Smrg else 1372291ca6f5Smrg GUESS=mips-unknown-sysv$UNAME_RELEASE 137329459361Smrg fi 1374291ca6f5Smrg ;; 137529459361Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1376291ca6f5Smrg GUESS=powerpc-be-beos 1377291ca6f5Smrg ;; 137829459361Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1379291ca6f5Smrg GUESS=powerpc-apple-beos 1380291ca6f5Smrg ;; 138129459361Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1382291ca6f5Smrg GUESS=i586-pc-beos 1383291ca6f5Smrg ;; 13845715adc0Smrg BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1385291ca6f5Smrg GUESS=i586-pc-haiku 1386291ca6f5Smrg ;; 13879683b4e0Smrg ppc:Haiku:*:*) # Haiku running on Apple PowerPC 13889683b4e0Smrg GUESS=powerpc-apple-haiku 13899683b4e0Smrg ;; 13909683b4e0Smrg *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) 13919683b4e0Smrg GUESS=$UNAME_MACHINE-unknown-haiku 1392291ca6f5Smrg ;; 139329459361Smrg SX-4:SUPER-UX:*:*) 1394291ca6f5Smrg GUESS=sx4-nec-superux$UNAME_RELEASE 1395291ca6f5Smrg ;; 139629459361Smrg SX-5:SUPER-UX:*:*) 1397291ca6f5Smrg GUESS=sx5-nec-superux$UNAME_RELEASE 1398291ca6f5Smrg ;; 139929459361Smrg SX-6:SUPER-UX:*:*) 1400291ca6f5Smrg GUESS=sx6-nec-superux$UNAME_RELEASE 1401291ca6f5Smrg ;; 140229459361Smrg SX-7:SUPER-UX:*:*) 1403291ca6f5Smrg GUESS=sx7-nec-superux$UNAME_RELEASE 1404291ca6f5Smrg ;; 140529459361Smrg SX-8:SUPER-UX:*:*) 1406291ca6f5Smrg GUESS=sx8-nec-superux$UNAME_RELEASE 1407291ca6f5Smrg ;; 14085715adc0Smrg SX-8R:SUPER-UX:*:*) 1409291ca6f5Smrg GUESS=sx8r-nec-superux$UNAME_RELEASE 1410291ca6f5Smrg ;; 141127935385Smrg SX-ACE:SUPER-UX:*:*) 1412291ca6f5Smrg GUESS=sxace-nec-superux$UNAME_RELEASE 1413291ca6f5Smrg ;; 141429459361Smrg Power*:Rhapsody:*:*) 1415291ca6f5Smrg GUESS=powerpc-apple-rhapsody$UNAME_RELEASE 1416291ca6f5Smrg ;; 141729459361Smrg *:Rhapsody:*:*) 1418291ca6f5Smrg GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE 1419291ca6f5Smrg ;; 1420291ca6f5Smrg arm64:Darwin:*:*) 1421291ca6f5Smrg GUESS=aarch64-apple-darwin$UNAME_RELEASE 1422291ca6f5Smrg ;; 142329459361Smrg *:Darwin:*:*) 1424291ca6f5Smrg UNAME_PROCESSOR=`uname -p` 1425291ca6f5Smrg case $UNAME_PROCESSOR in 1426291ca6f5Smrg unknown) UNAME_PROCESSOR=powerpc ;; 1427291ca6f5Smrg esac 1428291ca6f5Smrg if command -v xcode-select > /dev/null 2> /dev/null && \ 1429291ca6f5Smrg ! xcode-select --print-path > /dev/null 2> /dev/null ; then 1430291ca6f5Smrg # Avoid executing cc if there is no toolchain installed as 1431291ca6f5Smrg # cc will be a stub that puts up a graphical alert 1432291ca6f5Smrg # prompting the user to install developer tools. 1433291ca6f5Smrg CC_FOR_BUILD=no_compiler_found 1434291ca6f5Smrg else 1435291ca6f5Smrg set_cc_for_build 143627935385Smrg fi 1437291ca6f5Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 1438291ca6f5Smrg if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1439291ca6f5Smrg (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1440291ca6f5Smrg grep IS_64BIT_ARCH >/dev/null 1441291ca6f5Smrg then 1442291ca6f5Smrg case $UNAME_PROCESSOR in 1443291ca6f5Smrg i386) UNAME_PROCESSOR=x86_64 ;; 1444291ca6f5Smrg powerpc) UNAME_PROCESSOR=powerpc64 ;; 1445291ca6f5Smrg esac 1446291ca6f5Smrg fi 1447291ca6f5Smrg # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc 1448291ca6f5Smrg if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ 1449291ca6f5Smrg (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1450291ca6f5Smrg grep IS_PPC >/dev/null 1451291ca6f5Smrg then 1452291ca6f5Smrg UNAME_PROCESSOR=powerpc 145327935385Smrg fi 145427935385Smrg elif test "$UNAME_PROCESSOR" = i386 ; then 1455291ca6f5Smrg # uname -m returns i386 or x86_64 1456291ca6f5Smrg UNAME_PROCESSOR=$UNAME_MACHINE 145727935385Smrg fi 1458291ca6f5Smrg GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE 1459291ca6f5Smrg ;; 146029459361Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 146129459361Smrg UNAME_PROCESSOR=`uname -p` 146227935385Smrg if test "$UNAME_PROCESSOR" = x86; then 146329459361Smrg UNAME_PROCESSOR=i386 146429459361Smrg UNAME_MACHINE=pc 146529459361Smrg fi 1466291ca6f5Smrg GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE 1467291ca6f5Smrg ;; 146829459361Smrg *:QNX:*:4*) 1469291ca6f5Smrg GUESS=i386-pc-qnx 1470291ca6f5Smrg ;; 147127935385Smrg NEO-*:NONSTOP_KERNEL:*:*) 1472291ca6f5Smrg GUESS=neo-tandem-nsk$UNAME_RELEASE 1473291ca6f5Smrg ;; 1474f66e55a2Smrg NSE-*:NONSTOP_KERNEL:*:*) 1475291ca6f5Smrg GUESS=nse-tandem-nsk$UNAME_RELEASE 1476291ca6f5Smrg ;; 147727935385Smrg NSR-*:NONSTOP_KERNEL:*:*) 1478291ca6f5Smrg GUESS=nsr-tandem-nsk$UNAME_RELEASE 1479291ca6f5Smrg ;; 148027935385Smrg NSV-*:NONSTOP_KERNEL:*:*) 1481291ca6f5Smrg GUESS=nsv-tandem-nsk$UNAME_RELEASE 1482291ca6f5Smrg ;; 148327935385Smrg NSX-*:NONSTOP_KERNEL:*:*) 1484291ca6f5Smrg GUESS=nsx-tandem-nsk$UNAME_RELEASE 1485291ca6f5Smrg ;; 148629459361Smrg *:NonStop-UX:*:*) 1487291ca6f5Smrg GUESS=mips-compaq-nonstopux 1488291ca6f5Smrg ;; 148929459361Smrg BS2000:POSIX*:*:*) 1490291ca6f5Smrg GUESS=bs2000-siemens-sysv 1491291ca6f5Smrg ;; 149229459361Smrg DS/*:UNIX_System_V:*:*) 1493291ca6f5Smrg GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE 1494291ca6f5Smrg ;; 149529459361Smrg *:Plan9:*:*) 149629459361Smrg # "uname -m" is not consistent, so use $cputype instead. 386 149729459361Smrg # is converted to i386 for consistency with other x86 149829459361Smrg # operating systems. 1499291ca6f5Smrg if test "${cputype-}" = 386; then 150029459361Smrg UNAME_MACHINE=i386 1501291ca6f5Smrg elif test "x${cputype-}" != x; then 1502291ca6f5Smrg UNAME_MACHINE=$cputype 150329459361Smrg fi 1504291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-plan9 1505291ca6f5Smrg ;; 150629459361Smrg *:TOPS-10:*:*) 1507291ca6f5Smrg GUESS=pdp10-unknown-tops10 1508291ca6f5Smrg ;; 150929459361Smrg *:TENEX:*:*) 1510291ca6f5Smrg GUESS=pdp10-unknown-tenex 1511291ca6f5Smrg ;; 151229459361Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1513291ca6f5Smrg GUESS=pdp10-dec-tops20 1514291ca6f5Smrg ;; 151529459361Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1516291ca6f5Smrg GUESS=pdp10-xkl-tops20 1517291ca6f5Smrg ;; 151829459361Smrg *:TOPS-20:*:*) 1519291ca6f5Smrg GUESS=pdp10-unknown-tops20 1520291ca6f5Smrg ;; 152129459361Smrg *:ITS:*:*) 1522291ca6f5Smrg GUESS=pdp10-unknown-its 1523291ca6f5Smrg ;; 152429459361Smrg SEI:*:*:SEIUX) 1525291ca6f5Smrg GUESS=mips-sei-seiux$UNAME_RELEASE 1526291ca6f5Smrg ;; 152729459361Smrg *:DragonFly:*:*) 1528291ca6f5Smrg DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 1529291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL 1530291ca6f5Smrg ;; 153129459361Smrg *:*VMS:*:*) 1532f66e55a2Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 1533291ca6f5Smrg case $UNAME_MACHINE in 1534291ca6f5Smrg A*) GUESS=alpha-dec-vms ;; 1535291ca6f5Smrg I*) GUESS=ia64-dec-vms ;; 1536291ca6f5Smrg V*) GUESS=vax-dec-vms ;; 153729459361Smrg esac ;; 153829459361Smrg *:XENIX:*:SysV) 1539291ca6f5Smrg GUESS=i386-pc-xenix 1540291ca6f5Smrg ;; 154129459361Smrg i*86:skyos:*:*) 1542291ca6f5Smrg SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` 1543291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL 1544291ca6f5Smrg ;; 154529459361Smrg i*86:rdos:*:*) 1546291ca6f5Smrg GUESS=$UNAME_MACHINE-pc-rdos 1547291ca6f5Smrg ;; 15489683b4e0Smrg i*86:Fiwix:*:*) 15499683b4e0Smrg GUESS=$UNAME_MACHINE-pc-fiwix 15509683b4e0Smrg ;; 1551291ca6f5Smrg *:AROS:*:*) 1552291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-aros 1553291ca6f5Smrg ;; 1554f66e55a2Smrg x86_64:VMkernel:*:*) 1555291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-esx 1556291ca6f5Smrg ;; 155727935385Smrg amd64:Isilon\ OneFS:*:*) 1558291ca6f5Smrg GUESS=x86_64-unknown-onefs 1559291ca6f5Smrg ;; 1560291ca6f5Smrg *:Unleashed:*:*) 1561291ca6f5Smrg GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE 1562291ca6f5Smrg ;; 156329459361Smrgesac 156429459361Smrg 1565291ca6f5Smrg# Do we have a guess based on uname results? 1566291ca6f5Smrgif test "x$GUESS" != x; then 1567291ca6f5Smrg echo "$GUESS" 1568291ca6f5Smrg exit 1569291ca6f5Smrgfi 1570291ca6f5Smrg 1571291ca6f5Smrg# No uname command or uname output not recognized. 1572291ca6f5Smrgset_cc_for_build 1573291ca6f5Smrgcat > "$dummy.c" <<EOF 1574291ca6f5Smrg#ifdef _SEQUENT_ 1575291ca6f5Smrg#include <sys/types.h> 1576291ca6f5Smrg#include <sys/utsname.h> 1577291ca6f5Smrg#endif 1578291ca6f5Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 1579291ca6f5Smrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 1580291ca6f5Smrg#include <signal.h> 1581291ca6f5Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1582291ca6f5Smrg#include <sys/utsname.h> 1583291ca6f5Smrg#endif 1584291ca6f5Smrg#endif 1585291ca6f5Smrg#endif 1586291ca6f5Smrgmain () 1587291ca6f5Smrg{ 1588291ca6f5Smrg#if defined (sony) 1589291ca6f5Smrg#if defined (MIPSEB) 1590291ca6f5Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1591291ca6f5Smrg I don't know.... */ 1592291ca6f5Smrg printf ("mips-sony-bsd\n"); exit (0); 1593291ca6f5Smrg#else 1594291ca6f5Smrg#include <sys/param.h> 1595291ca6f5Smrg printf ("m68k-sony-newsos%s\n", 1596291ca6f5Smrg#ifdef NEWSOS4 1597291ca6f5Smrg "4" 1598291ca6f5Smrg#else 1599291ca6f5Smrg "" 1600291ca6f5Smrg#endif 1601291ca6f5Smrg ); exit (0); 1602291ca6f5Smrg#endif 1603291ca6f5Smrg#endif 1604291ca6f5Smrg 1605291ca6f5Smrg#if defined (NeXT) 1606291ca6f5Smrg#if !defined (__ARCHITECTURE__) 1607291ca6f5Smrg#define __ARCHITECTURE__ "m68k" 1608291ca6f5Smrg#endif 1609291ca6f5Smrg int version; 1610291ca6f5Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1611291ca6f5Smrg if (version < 4) 1612291ca6f5Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1613291ca6f5Smrg else 1614291ca6f5Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1615291ca6f5Smrg exit (0); 1616291ca6f5Smrg#endif 1617291ca6f5Smrg 1618291ca6f5Smrg#if defined (MULTIMAX) || defined (n16) 1619291ca6f5Smrg#if defined (UMAXV) 1620291ca6f5Smrg printf ("ns32k-encore-sysv\n"); exit (0); 1621291ca6f5Smrg#else 1622291ca6f5Smrg#if defined (CMU) 1623291ca6f5Smrg printf ("ns32k-encore-mach\n"); exit (0); 1624291ca6f5Smrg#else 1625291ca6f5Smrg printf ("ns32k-encore-bsd\n"); exit (0); 1626291ca6f5Smrg#endif 1627291ca6f5Smrg#endif 1628291ca6f5Smrg#endif 1629291ca6f5Smrg 1630291ca6f5Smrg#if defined (__386BSD__) 1631291ca6f5Smrg printf ("i386-pc-bsd\n"); exit (0); 1632291ca6f5Smrg#endif 1633291ca6f5Smrg 1634291ca6f5Smrg#if defined (sequent) 1635291ca6f5Smrg#if defined (i386) 1636291ca6f5Smrg printf ("i386-sequent-dynix\n"); exit (0); 1637291ca6f5Smrg#endif 1638291ca6f5Smrg#if defined (ns32000) 1639291ca6f5Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 1640291ca6f5Smrg#endif 1641291ca6f5Smrg#endif 1642291ca6f5Smrg 1643291ca6f5Smrg#if defined (_SEQUENT_) 1644291ca6f5Smrg struct utsname un; 1645291ca6f5Smrg 1646291ca6f5Smrg uname(&un); 1647291ca6f5Smrg if (strncmp(un.version, "V2", 2) == 0) { 1648291ca6f5Smrg printf ("i386-sequent-ptx2\n"); exit (0); 1649291ca6f5Smrg } 1650291ca6f5Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1651291ca6f5Smrg printf ("i386-sequent-ptx1\n"); exit (0); 1652291ca6f5Smrg } 1653291ca6f5Smrg printf ("i386-sequent-ptx\n"); exit (0); 1654291ca6f5Smrg#endif 1655291ca6f5Smrg 1656291ca6f5Smrg#if defined (vax) 1657291ca6f5Smrg#if !defined (ultrix) 1658291ca6f5Smrg#include <sys/param.h> 1659291ca6f5Smrg#if defined (BSD) 1660291ca6f5Smrg#if BSD == 43 1661291ca6f5Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 1662291ca6f5Smrg#else 1663291ca6f5Smrg#if BSD == 199006 1664291ca6f5Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 1665291ca6f5Smrg#else 1666291ca6f5Smrg printf ("vax-dec-bsd\n"); exit (0); 1667291ca6f5Smrg#endif 1668291ca6f5Smrg#endif 1669291ca6f5Smrg#else 1670291ca6f5Smrg printf ("vax-dec-bsd\n"); exit (0); 1671291ca6f5Smrg#endif 1672291ca6f5Smrg#else 1673291ca6f5Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1674291ca6f5Smrg struct utsname un; 1675291ca6f5Smrg uname (&un); 1676291ca6f5Smrg printf ("vax-dec-ultrix%s\n", un.release); exit (0); 1677291ca6f5Smrg#else 1678291ca6f5Smrg printf ("vax-dec-ultrix\n"); exit (0); 1679291ca6f5Smrg#endif 1680291ca6f5Smrg#endif 1681291ca6f5Smrg#endif 1682291ca6f5Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 1683291ca6f5Smrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 1684291ca6f5Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1685291ca6f5Smrg struct utsname *un; 1686291ca6f5Smrg uname (&un); 1687291ca6f5Smrg printf ("mips-dec-ultrix%s\n", un.release); exit (0); 1688291ca6f5Smrg#else 1689291ca6f5Smrg printf ("mips-dec-ultrix\n"); exit (0); 1690291ca6f5Smrg#endif 1691291ca6f5Smrg#endif 1692291ca6f5Smrg#endif 1693291ca6f5Smrg 1694291ca6f5Smrg#if defined (alliant) && defined (i860) 1695291ca6f5Smrg printf ("i860-alliant-bsd\n"); exit (0); 1696291ca6f5Smrg#endif 1697291ca6f5Smrg 1698291ca6f5Smrg exit (1); 1699291ca6f5Smrg} 1700291ca6f5SmrgEOF 1701291ca6f5Smrg 1702291ca6f5Smrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && 1703291ca6f5Smrg { echo "$SYSTEM_NAME"; exit; } 1704291ca6f5Smrg 1705291ca6f5Smrg# Apollos put the system type in the environment. 1706291ca6f5Smrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } 1707291ca6f5Smrg 170827935385Smrgecho "$0: unable to guess system type" >&2 170929459361Smrg 1710291ca6f5Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM in 171127935385Smrg mips:Linux | mips64:Linux) 171227935385Smrg # If we got here on MIPS GNU/Linux, output extra information. 171327935385Smrg cat >&2 <<EOF 171429459361Smrg 171527935385SmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize 171627935385Smrgthe system type. Please install a C compiler and try again. 171729459361SmrgEOF 171827935385Smrg ;; 171927935385Smrgesac 172029459361Smrg 172129459361Smrgcat >&2 <<EOF 172229459361Smrg 172327935385SmrgThis script (version $timestamp), has failed to recognize the 172427935385Smrgoperating system you are using. If your script is old, overwrite *all* 172527935385Smrgcopies of config.guess and config.sub with the latest versions from: 172629459361Smrg 1727291ca6f5Smrg https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 172829459361Smrgand 1729291ca6f5Smrg https://git.savannah.gnu.org/cgit/config.git/plain/config.sub 1730291ca6f5SmrgEOF 1731291ca6f5Smrg 1732291ca6f5Smrgour_year=`echo $timestamp | sed 's,-.*,,'` 1733291ca6f5Smrgthisyear=`date +%Y` 1734291ca6f5Smrg# shellcheck disable=SC2003 1735291ca6f5Smrgscript_age=`expr "$thisyear" - "$our_year"` 1736291ca6f5Smrgif test "$script_age" -lt 3 ; then 1737291ca6f5Smrg cat >&2 <<EOF 173829459361Smrg 173927935385SmrgIf $0 has already been updated, send the following data and any 174027935385Smrginformation you think might be pertinent to config-patches@gnu.org to 174127935385Smrgprovide the necessary information to handle your system. 174229459361Smrg 174329459361Smrgconfig.guess timestamp = $timestamp 174429459361Smrg 174529459361Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 174629459361Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 174729459361Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 174829459361Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 174929459361Smrg 175029459361Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 175129459361Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 175229459361Smrg 175329459361Smrghostinfo = `(hostinfo) 2>/dev/null` 175429459361Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 175529459361Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 175629459361Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 175729459361Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 175829459361Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 175929459361Smrg 176027935385SmrgUNAME_MACHINE = "$UNAME_MACHINE" 176127935385SmrgUNAME_RELEASE = "$UNAME_RELEASE" 176227935385SmrgUNAME_SYSTEM = "$UNAME_SYSTEM" 176327935385SmrgUNAME_VERSION = "$UNAME_VERSION" 176429459361SmrgEOF 1765291ca6f5Smrgfi 176629459361Smrg 176729459361Smrgexit 1 176829459361Smrg 176929459361Smrg# Local variables: 1770291ca6f5Smrg# eval: (add-hook 'before-save-hook 'time-stamp) 177129459361Smrg# time-stamp-start: "timestamp='" 177229459361Smrg# time-stamp-format: "%:y-%02m-%02d" 177329459361Smrg# time-stamp-end: "'" 177429459361Smrg# End: 1775