197e8a2e8Smrg#! /bin/sh 297e8a2e8Smrg# Attempt to guess a canonical system name. 3bbfad078Smrg# Copyright 1992-2024 Free Software Foundation, Inc. 497e8a2e8Smrg 5219ffec0Smrg# shellcheck disable=SC2006,SC2268 # see below for rationale 6219ffec0Smrg 7bbfad078Smrgtimestamp='2024-01-01' 897e8a2e8Smrg 997e8a2e8Smrg# This file is free software; you can redistribute it and/or modify it 1097e8a2e8Smrg# under the terms of the GNU General Public License as published by 11bbfad078Smrg# the Free Software Foundation, either version 3 of the License, or 1297e8a2e8Smrg# (at your option) any later version. 1397e8a2e8Smrg# 1497e8a2e8Smrg# This program is distributed in the hope that it will be useful, but 1597e8a2e8Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1697e8a2e8Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1797e8a2e8Smrg# General Public License for more details. 1897e8a2e8Smrg# 1997e8a2e8Smrg# You should have received a copy of the GNU General Public License 20219ffec0Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>. 2197e8a2e8Smrg# 2297e8a2e8Smrg# As a special exception to the GNU General Public License, if you 2397e8a2e8Smrg# distribute this file as part of a program that contains a 2497e8a2e8Smrg# configuration script generated by Autoconf, you may include it under 2568af480fSmrg# the same distribution terms that you use for the rest of that 2668af480fSmrg# program. This Exception is an additional permission under section 7 2768af480fSmrg# of the GNU General Public License, version 3 ("GPLv3"). 2897e8a2e8Smrg# 29219ffec0Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 3097e8a2e8Smrg# 31c3f70f0aSmrg# You can get the latest version of this script from: 32219ffec0Smrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 3368af480fSmrg# 34219ffec0Smrg# Please send patches to <config-patches@gnu.org>. 35219ffec0Smrg 36219ffec0Smrg 37219ffec0Smrg# The "shellcheck disable" line above the timestamp inhibits complaints 38219ffec0Smrg# about features and limitations of the classic Bourne shell that were 39219ffec0Smrg# superseded or lifted in POSIX. However, this script identifies a wide 40219ffec0Smrg# variety of pre-POSIX systems that do not have POSIX shells at all, and 41219ffec0Smrg# even some reasonably current systems (Solaris 10 as case-in-point) still 42219ffec0Smrg# have a pre-POSIX /bin/sh. 4368af480fSmrg 4497e8a2e8Smrg 4597e8a2e8Smrgme=`echo "$0" | sed -e 's,.*/,,'` 4697e8a2e8Smrg 4797e8a2e8Smrgusage="\ 4897e8a2e8SmrgUsage: $0 [OPTION] 4997e8a2e8Smrg 50bbfad078SmrgOutput the configuration name of the system '$me' is run on. 5197e8a2e8Smrg 52219ffec0SmrgOptions: 5397e8a2e8Smrg -h, --help print this help, then exit 5497e8a2e8Smrg -t, --time-stamp print date of last modification, then exit 5597e8a2e8Smrg -v, --version print version number, then exit 5697e8a2e8Smrg 5797e8a2e8SmrgReport bugs and patches to <config-patches@gnu.org>." 5897e8a2e8Smrg 5997e8a2e8Smrgversion="\ 6097e8a2e8SmrgGNU config.guess ($timestamp) 6197e8a2e8Smrg 6297e8a2e8SmrgOriginally written by Per Bothner. 63bbfad078SmrgCopyright 1992-2024 Free Software Foundation, Inc. 6497e8a2e8Smrg 6597e8a2e8SmrgThis is free software; see the source for copying conditions. There is NO 6697e8a2e8Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6797e8a2e8Smrg 6897e8a2e8Smrghelp=" 69bbfad078SmrgTry '$me --help' for more information." 7097e8a2e8Smrg 7197e8a2e8Smrg# Parse command line 7297e8a2e8Smrgwhile test $# -gt 0 ; do 7397e8a2e8Smrg case $1 in 7497e8a2e8Smrg --time-stamp | --time* | -t ) 75d7accfefSmrg echo "$timestamp" ; exit ;; 7697e8a2e8Smrg --version | -v ) 77d7accfefSmrg echo "$version" ; exit ;; 7897e8a2e8Smrg --help | --h* | -h ) 79d7accfefSmrg echo "$usage"; exit ;; 8097e8a2e8Smrg -- ) # Stop option processing 8197e8a2e8Smrg shift; break ;; 8297e8a2e8Smrg - ) # Use stdin as input. 8397e8a2e8Smrg break ;; 8497e8a2e8Smrg -* ) 8597e8a2e8Smrg echo "$me: invalid option $1$help" >&2 8697e8a2e8Smrg exit 1 ;; 8797e8a2e8Smrg * ) 8897e8a2e8Smrg break ;; 8997e8a2e8Smrg esac 9097e8a2e8Smrgdone 9197e8a2e8Smrg 9297e8a2e8Smrgif test $# != 0; then 9397e8a2e8Smrg echo "$me: too many arguments$help" >&2 9497e8a2e8Smrg exit 1 9597e8a2e8Smrgfi 9697e8a2e8Smrg 97219ffec0Smrg# Just in case it came from the environment. 98219ffec0SmrgGUESS= 9997e8a2e8Smrg 10097e8a2e8Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 10197e8a2e8Smrg# compiler to aid in system detection is discouraged as it requires 10297e8a2e8Smrg# temporary files to be created and, as you can see below, it is a 10397e8a2e8Smrg# headache to deal with in a portable fashion. 10497e8a2e8Smrg 105bbfad078Smrg# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still 106bbfad078Smrg# use 'HOST_CC' if defined, but it is deprecated. 10797e8a2e8Smrg 10897e8a2e8Smrg# Portable tmp directory creation inspired by the Autoconf team. 10997e8a2e8Smrg 110219ffec0Smrgtmp= 111219ffec0Smrg# shellcheck disable=SC2172 112219ffec0Smrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 113219ffec0Smrg 114219ffec0Smrgset_cc_for_build() { 115219ffec0Smrg # prevent multiple calls if $tmp is already set 116219ffec0Smrg test "$tmp" && return 0 117219ffec0Smrg : "${TMPDIR=/tmp}" 118219ffec0Smrg # shellcheck disable=SC2039,SC3028 119219ffec0Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 120219ffec0Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || 121219ffec0Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || 122219ffec0Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } 123219ffec0Smrg dummy=$tmp/dummy 124219ffec0Smrg case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in 125219ffec0Smrg ,,) echo "int x;" > "$dummy.c" 126219ffec0Smrg for driver in cc gcc c89 c99 ; do 127219ffec0Smrg if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then 128219ffec0Smrg CC_FOR_BUILD=$driver 129219ffec0Smrg break 130219ffec0Smrg fi 131219ffec0Smrg done 132219ffec0Smrg if test x"$CC_FOR_BUILD" = x ; then 133219ffec0Smrg CC_FOR_BUILD=no_compiler_found 134219ffec0Smrg fi 135219ffec0Smrg ;; 136219ffec0Smrg ,,*) CC_FOR_BUILD=$CC ;; 137219ffec0Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 138219ffec0Smrg esac 139219ffec0Smrg} 14097e8a2e8Smrg 14197e8a2e8Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 14297e8a2e8Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 143219ffec0Smrgif test -f /.attbin/uname ; then 14497e8a2e8Smrg PATH=$PATH:/.attbin ; export PATH 14597e8a2e8Smrgfi 14697e8a2e8Smrg 14797e8a2e8SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 14897e8a2e8SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 149219ffec0SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 15097e8a2e8SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 15197e8a2e8Smrg 152219ffec0Smrgcase $UNAME_SYSTEM in 15368af480fSmrgLinux|GNU|GNU/*) 154219ffec0Smrg LIBC=unknown 15568af480fSmrg 156219ffec0Smrg set_cc_for_build 157219ffec0Smrg cat <<-EOF > "$dummy.c" 158bbfad078Smrg #if defined(__ANDROID__) 159bbfad078Smrg LIBC=android 160bbfad078Smrg #else 16168af480fSmrg #include <features.h> 16268af480fSmrg #if defined(__UCLIBC__) 16368af480fSmrg LIBC=uclibc 16468af480fSmrg #elif defined(__dietlibc__) 16568af480fSmrg LIBC=dietlibc 166219ffec0Smrg #elif defined(__GLIBC__) 16768af480fSmrg LIBC=gnu 168bbfad078Smrg #elif defined(__LLVM_LIBC__) 169bbfad078Smrg LIBC=llvm 170219ffec0Smrg #else 171219ffec0Smrg #include <stdarg.h> 172219ffec0Smrg /* First heuristic to detect musl libc. */ 173219ffec0Smrg #ifdef __DEFINED_va_list 174219ffec0Smrg LIBC=musl 175219ffec0Smrg #endif 17668af480fSmrg #endif 177bbfad078Smrg #endif 17868af480fSmrg EOF 179219ffec0Smrg cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` 180219ffec0Smrg eval "$cc_set_libc" 181219ffec0Smrg 182219ffec0Smrg # Second heuristic to detect musl libc. 183219ffec0Smrg if [ "$LIBC" = unknown ] && 184219ffec0Smrg command -v ldd >/dev/null && 185219ffec0Smrg ldd --version 2>&1 | grep -q ^musl; then 186219ffec0Smrg LIBC=musl 187219ffec0Smrg fi 188219ffec0Smrg 189219ffec0Smrg # If the system lacks a compiler, then just pick glibc. 190219ffec0Smrg # We could probably try harder. 191219ffec0Smrg if [ "$LIBC" = unknown ]; then 192219ffec0Smrg LIBC=gnu 193219ffec0Smrg fi 19468af480fSmrg ;; 19568af480fSmrgesac 19668af480fSmrg 19797e8a2e8Smrg# Note: order is significant - the case branches are not exclusive. 19897e8a2e8Smrg 199219ffec0Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in 20097e8a2e8Smrg *:NetBSD:*:*) 20197e8a2e8Smrg # NetBSD (nbsd) targets should (where applicable) match one or 20268af480fSmrg # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 20397e8a2e8Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 20497e8a2e8Smrg # switched to ELF, *-*-netbsd* would select the old 20597e8a2e8Smrg # object file format. This provides both forward 20697e8a2e8Smrg # compatibility and a consistent mechanism for selecting the 20797e8a2e8Smrg # object file format. 20897e8a2e8Smrg # 20997e8a2e8Smrg # Note: NetBSD doesn't particularly care about the vendor 21097e8a2e8Smrg # portion of the name. We always set it to "unknown". 211219ffec0Smrg UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ 212219ffec0Smrg /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 213219ffec0Smrg /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 214219ffec0Smrg echo unknown)` 215219ffec0Smrg case $UNAME_MACHINE_ARCH in 216219ffec0Smrg aarch64eb) machine=aarch64_be-unknown ;; 21797e8a2e8Smrg armeb) machine=armeb-unknown ;; 21897e8a2e8Smrg arm*) machine=arm-unknown ;; 21997e8a2e8Smrg sh3el) machine=shl-unknown ;; 22097e8a2e8Smrg sh3eb) machine=sh-unknown ;; 221d7accfefSmrg sh5el) machine=sh5le-unknown ;; 222219ffec0Smrg earmv*) 223219ffec0Smrg arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` 224219ffec0Smrg endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` 225219ffec0Smrg machine=${arch}${endian}-unknown 226219ffec0Smrg ;; 227219ffec0Smrg *) machine=$UNAME_MACHINE_ARCH-unknown ;; 22897e8a2e8Smrg esac 22997e8a2e8Smrg # The Operating System including object format, if it has switched 230219ffec0Smrg # to ELF recently (or will in the future) and ABI. 231219ffec0Smrg case $UNAME_MACHINE_ARCH in 232219ffec0Smrg earm*) 233219ffec0Smrg os=netbsdelf 234219ffec0Smrg ;; 23597e8a2e8Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 236219ffec0Smrg set_cc_for_build 23797e8a2e8Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 238c3f70f0aSmrg | grep -q __ELF__ 23997e8a2e8Smrg then 24097e8a2e8Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 24197e8a2e8Smrg # Return netbsd for either. FIX? 24297e8a2e8Smrg os=netbsd 24397e8a2e8Smrg else 24497e8a2e8Smrg os=netbsdelf 24597e8a2e8Smrg fi 24697e8a2e8Smrg ;; 24797e8a2e8Smrg *) 24868af480fSmrg os=netbsd 24997e8a2e8Smrg ;; 25097e8a2e8Smrg esac 251219ffec0Smrg # Determine ABI tags. 252219ffec0Smrg case $UNAME_MACHINE_ARCH in 253219ffec0Smrg earm*) 254219ffec0Smrg expr='s/^earmv[0-9]/-eabi/;s/eb$//' 255219ffec0Smrg abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` 256219ffec0Smrg ;; 257219ffec0Smrg esac 25897e8a2e8Smrg # The OS release 25997e8a2e8Smrg # Debian GNU/NetBSD machines have a different userland, and 26097e8a2e8Smrg # thus, need a distinct triplet. However, they do not need 26197e8a2e8Smrg # kernel version information, so it can be replaced with a 26297e8a2e8Smrg # suitable tag, in the style of linux-gnu. 263219ffec0Smrg case $UNAME_VERSION in 26497e8a2e8Smrg Debian*) 26597e8a2e8Smrg release='-gnu' 26697e8a2e8Smrg ;; 26797e8a2e8Smrg *) 268219ffec0Smrg release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` 26997e8a2e8Smrg ;; 27097e8a2e8Smrg esac 27197e8a2e8Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 27297e8a2e8Smrg # contains redundant information, the shorter form: 27397e8a2e8Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 274219ffec0Smrg GUESS=$machine-${os}${release}${abi-} 275219ffec0Smrg ;; 27668af480fSmrg *:Bitrig:*:*) 27768af480fSmrg UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 278219ffec0Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE 279219ffec0Smrg ;; 28097e8a2e8Smrg *:OpenBSD:*:*) 281d7accfefSmrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 282219ffec0Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE 283219ffec0Smrg ;; 284219ffec0Smrg *:SecBSD:*:*) 285219ffec0Smrg UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` 286219ffec0Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE 287219ffec0Smrg ;; 288219ffec0Smrg *:LibertyBSD:*:*) 289219ffec0Smrg UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` 290219ffec0Smrg GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE 291219ffec0Smrg ;; 292219ffec0Smrg *:MidnightBSD:*:*) 293219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE 294219ffec0Smrg ;; 295d7accfefSmrg *:ekkoBSD:*:*) 296219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE 297219ffec0Smrg ;; 298d7accfefSmrg *:SolidBSD:*:*) 299219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE 300219ffec0Smrg ;; 301219ffec0Smrg *:OS108:*:*) 302219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE 303219ffec0Smrg ;; 304d7accfefSmrg macppc:MirBSD:*:*) 305219ffec0Smrg GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE 306219ffec0Smrg ;; 307d7accfefSmrg *:MirBSD:*:*) 308219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE 309219ffec0Smrg ;; 310219ffec0Smrg *:Sortix:*:*) 311219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-sortix 312219ffec0Smrg ;; 313219ffec0Smrg *:Twizzler:*:*) 314219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-twizzler 315219ffec0Smrg ;; 316219ffec0Smrg *:Redox:*:*) 317219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-redox 318219ffec0Smrg ;; 319219ffec0Smrg mips:OSF1:*.*) 320219ffec0Smrg GUESS=mips-dec-osf1 321219ffec0Smrg ;; 32297e8a2e8Smrg alpha:OSF1:*:*) 323219ffec0Smrg # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 324219ffec0Smrg trap '' 0 325d7accfefSmrg case $UNAME_RELEASE in 326d7accfefSmrg *4.0) 32797e8a2e8Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 328d7accfefSmrg ;; 329d7accfefSmrg *5.*) 33068af480fSmrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 331d7accfefSmrg ;; 332d7accfefSmrg esac 33397e8a2e8Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 33497e8a2e8Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 33597e8a2e8Smrg # covers most systems running today. This code pipes the CPU 33697e8a2e8Smrg # types through head -n 1, so we only detect the type of CPU 0. 33797e8a2e8Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 338219ffec0Smrg case $ALPHA_CPU_TYPE in 33997e8a2e8Smrg "EV4 (21064)") 340219ffec0Smrg UNAME_MACHINE=alpha ;; 34197e8a2e8Smrg "EV4.5 (21064)") 342219ffec0Smrg UNAME_MACHINE=alpha ;; 34397e8a2e8Smrg "LCA4 (21066/21068)") 344219ffec0Smrg UNAME_MACHINE=alpha ;; 34597e8a2e8Smrg "EV5 (21164)") 346219ffec0Smrg UNAME_MACHINE=alphaev5 ;; 34797e8a2e8Smrg "EV5.6 (21164A)") 348219ffec0Smrg UNAME_MACHINE=alphaev56 ;; 34997e8a2e8Smrg "EV5.6 (21164PC)") 350219ffec0Smrg UNAME_MACHINE=alphapca56 ;; 35197e8a2e8Smrg "EV5.7 (21164PC)") 352219ffec0Smrg UNAME_MACHINE=alphapca57 ;; 35397e8a2e8Smrg "EV6 (21264)") 354219ffec0Smrg UNAME_MACHINE=alphaev6 ;; 35597e8a2e8Smrg "EV6.7 (21264A)") 356219ffec0Smrg UNAME_MACHINE=alphaev67 ;; 35797e8a2e8Smrg "EV6.8CB (21264C)") 358219ffec0Smrg UNAME_MACHINE=alphaev68 ;; 35997e8a2e8Smrg "EV6.8AL (21264B)") 360219ffec0Smrg UNAME_MACHINE=alphaev68 ;; 36197e8a2e8Smrg "EV6.8CX (21264D)") 362219ffec0Smrg UNAME_MACHINE=alphaev68 ;; 36397e8a2e8Smrg "EV6.9A (21264/EV69A)") 364219ffec0Smrg UNAME_MACHINE=alphaev69 ;; 36597e8a2e8Smrg "EV7 (21364)") 366219ffec0Smrg UNAME_MACHINE=alphaev7 ;; 36797e8a2e8Smrg "EV7.9 (21364A)") 368219ffec0Smrg UNAME_MACHINE=alphaev79 ;; 36997e8a2e8Smrg esac 370d7accfefSmrg # A Pn.n version is a patched version. 37197e8a2e8Smrg # A Vn.n version is a released version. 37297e8a2e8Smrg # A Tn.n version is a released field test version. 37397e8a2e8Smrg # A Xn.n version is an unreleased experimental baselevel. 37497e8a2e8Smrg # 1.2 uses "1.2" for uname -r. 375219ffec0Smrg OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 376219ffec0Smrg GUESS=$UNAME_MACHINE-dec-osf$OSF_REL 377219ffec0Smrg ;; 37897e8a2e8Smrg Amiga*:UNIX_System_V:4.0:*) 379219ffec0Smrg GUESS=m68k-unknown-sysv4 380219ffec0Smrg ;; 38197e8a2e8Smrg *:[Aa]miga[Oo][Ss]:*:*) 382219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-amigaos 383219ffec0Smrg ;; 38497e8a2e8Smrg *:[Mm]orph[Oo][Ss]:*:*) 385219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-morphos 386219ffec0Smrg ;; 38797e8a2e8Smrg *:OS/390:*:*) 388219ffec0Smrg GUESS=i370-ibm-openedition 389219ffec0Smrg ;; 390d7accfefSmrg *:z/VM:*:*) 391219ffec0Smrg GUESS=s390-ibm-zvmoe 392219ffec0Smrg ;; 393d7accfefSmrg *:OS400:*:*) 394219ffec0Smrg GUESS=powerpc-ibm-os400 395219ffec0Smrg ;; 39697e8a2e8Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 397219ffec0Smrg GUESS=arm-acorn-riscix$UNAME_RELEASE 398219ffec0Smrg ;; 39968af480fSmrg arm*:riscos:*:*|arm*:RISCOS:*:*) 400219ffec0Smrg GUESS=arm-unknown-riscos 401219ffec0Smrg ;; 40297e8a2e8Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 403219ffec0Smrg GUESS=hppa1.1-hitachi-hiuxmpp 404219ffec0Smrg ;; 40597e8a2e8Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 40697e8a2e8Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 407219ffec0Smrg case `(/bin/universe) 2>/dev/null` in 408219ffec0Smrg att) GUESS=pyramid-pyramid-sysv3 ;; 409219ffec0Smrg *) GUESS=pyramid-pyramid-bsd ;; 410219ffec0Smrg esac 411219ffec0Smrg ;; 41297e8a2e8Smrg NILE*:*:*:dcosx) 413219ffec0Smrg GUESS=pyramid-pyramid-svr4 414219ffec0Smrg ;; 41597e8a2e8Smrg DRS?6000:unix:4.0:6*) 416219ffec0Smrg GUESS=sparc-icl-nx6 417219ffec0Smrg ;; 418d7accfefSmrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 41997e8a2e8Smrg case `/usr/bin/uname -p` in 420219ffec0Smrg sparc) GUESS=sparc-icl-nx7 ;; 421219ffec0Smrg esac 422219ffec0Smrg ;; 423d7accfefSmrg s390x:SunOS:*:*) 424219ffec0Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 425219ffec0Smrg GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL 426219ffec0Smrg ;; 42797e8a2e8Smrg sun4H:SunOS:5.*:*) 428219ffec0Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 429219ffec0Smrg GUESS=sparc-hal-solaris2$SUN_REL 430219ffec0Smrg ;; 43197e8a2e8Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 432219ffec0Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 433219ffec0Smrg GUESS=sparc-sun-solaris2$SUN_REL 434219ffec0Smrg ;; 435c3f70f0aSmrg i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 436219ffec0Smrg GUESS=i386-pc-auroraux$UNAME_RELEASE 437219ffec0Smrg ;; 438d7accfefSmrg i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 439219ffec0Smrg set_cc_for_build 440219ffec0Smrg SUN_ARCH=i386 441d7accfefSmrg # If there is a compiler, see if it is configured for 64-bit objects. 442d7accfefSmrg # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 443d7accfefSmrg # This test works for both compilers. 444219ffec0Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 445d7accfefSmrg if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 446bbfad078Smrg (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ 447d7accfefSmrg grep IS_64BIT_ARCH >/dev/null 448d7accfefSmrg then 449219ffec0Smrg SUN_ARCH=x86_64 450d7accfefSmrg fi 451d7accfefSmrg fi 452219ffec0Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 453219ffec0Smrg GUESS=$SUN_ARCH-pc-solaris2$SUN_REL 454219ffec0Smrg ;; 45597e8a2e8Smrg sun4*:SunOS:6*:*) 45697e8a2e8Smrg # According to config.sub, this is the proper way to canonicalize 45797e8a2e8Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 45897e8a2e8Smrg # it's likely to be more like Solaris than SunOS4. 459219ffec0Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 460219ffec0Smrg GUESS=sparc-sun-solaris3$SUN_REL 461219ffec0Smrg ;; 46297e8a2e8Smrg sun4*:SunOS:*:*) 463219ffec0Smrg case `/usr/bin/arch -k` in 46497e8a2e8Smrg Series*|S4*) 46597e8a2e8Smrg UNAME_RELEASE=`uname -v` 46697e8a2e8Smrg ;; 46797e8a2e8Smrg esac 468bbfad078Smrg # Japanese Language versions have a version number like '4.1.3-JL'. 469219ffec0Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` 470219ffec0Smrg GUESS=sparc-sun-sunos$SUN_REL 471219ffec0Smrg ;; 47297e8a2e8Smrg sun3*:SunOS:*:*) 473219ffec0Smrg GUESS=m68k-sun-sunos$UNAME_RELEASE 474219ffec0Smrg ;; 47597e8a2e8Smrg sun*:*:4.2BSD:*) 47697e8a2e8Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 477219ffec0Smrg test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 478219ffec0Smrg case `/bin/arch` in 47997e8a2e8Smrg sun3) 480219ffec0Smrg GUESS=m68k-sun-sunos$UNAME_RELEASE 48197e8a2e8Smrg ;; 48297e8a2e8Smrg sun4) 483219ffec0Smrg GUESS=sparc-sun-sunos$UNAME_RELEASE 48497e8a2e8Smrg ;; 48597e8a2e8Smrg esac 486219ffec0Smrg ;; 48797e8a2e8Smrg aushp:SunOS:*:*) 488219ffec0Smrg GUESS=sparc-auspex-sunos$UNAME_RELEASE 489219ffec0Smrg ;; 49097e8a2e8Smrg # The situation for MiNT is a little confusing. The machine name 49197e8a2e8Smrg # can be virtually everything (everything which is not 49297e8a2e8Smrg # "atarist" or "atariste" at least should have a processor 49397e8a2e8Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 49497e8a2e8Smrg # to the lowercase version "mint" (or "freemint"). Finally 49597e8a2e8Smrg # the system name "TOS" denotes a system which is actually not 49697e8a2e8Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 49797e8a2e8Smrg # be no problem. 49897e8a2e8Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 499219ffec0Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 500219ffec0Smrg ;; 50197e8a2e8Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 502219ffec0Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 503219ffec0Smrg ;; 50497e8a2e8Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 505219ffec0Smrg GUESS=m68k-atari-mint$UNAME_RELEASE 506219ffec0Smrg ;; 50797e8a2e8Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 508219ffec0Smrg GUESS=m68k-milan-mint$UNAME_RELEASE 509219ffec0Smrg ;; 51097e8a2e8Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 511219ffec0Smrg GUESS=m68k-hades-mint$UNAME_RELEASE 512219ffec0Smrg ;; 51397e8a2e8Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 514219ffec0Smrg GUESS=m68k-unknown-mint$UNAME_RELEASE 515219ffec0Smrg ;; 516d7accfefSmrg m68k:machten:*:*) 517219ffec0Smrg GUESS=m68k-apple-machten$UNAME_RELEASE 518219ffec0Smrg ;; 51997e8a2e8Smrg powerpc:machten:*:*) 520219ffec0Smrg GUESS=powerpc-apple-machten$UNAME_RELEASE 521219ffec0Smrg ;; 52297e8a2e8Smrg RISC*:Mach:*:*) 523219ffec0Smrg GUESS=mips-dec-mach_bsd4.3 524219ffec0Smrg ;; 52597e8a2e8Smrg RISC*:ULTRIX:*:*) 526219ffec0Smrg GUESS=mips-dec-ultrix$UNAME_RELEASE 527219ffec0Smrg ;; 52897e8a2e8Smrg VAX*:ULTRIX*:*:*) 529219ffec0Smrg GUESS=vax-dec-ultrix$UNAME_RELEASE 530219ffec0Smrg ;; 53197e8a2e8Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 532219ffec0Smrg GUESS=clipper-intergraph-clix$UNAME_RELEASE 533219ffec0Smrg ;; 53497e8a2e8Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 535219ffec0Smrg set_cc_for_build 536219ffec0Smrg sed 's/^ //' << EOF > "$dummy.c" 53797e8a2e8Smrg#ifdef __cplusplus 53897e8a2e8Smrg#include <stdio.h> /* for printf() prototype */ 53997e8a2e8Smrg int main (int argc, char *argv[]) { 54097e8a2e8Smrg#else 54197e8a2e8Smrg int main (argc, argv) int argc; char *argv[]; { 54297e8a2e8Smrg#endif 54397e8a2e8Smrg #if defined (host_mips) && defined (MIPSEB) 54497e8a2e8Smrg #if defined (SYSTYPE_SYSV) 545219ffec0Smrg printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); 54697e8a2e8Smrg #endif 54797e8a2e8Smrg #if defined (SYSTYPE_SVR4) 548219ffec0Smrg printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); 54997e8a2e8Smrg #endif 55097e8a2e8Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 551219ffec0Smrg printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); 55297e8a2e8Smrg #endif 55397e8a2e8Smrg #endif 55497e8a2e8Smrg exit (-1); 55597e8a2e8Smrg } 55697e8a2e8SmrgEOF 557219ffec0Smrg $CC_FOR_BUILD -o "$dummy" "$dummy.c" && 558219ffec0Smrg dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && 559219ffec0Smrg SYSTEM_NAME=`"$dummy" "$dummyarg"` && 560d7accfefSmrg { echo "$SYSTEM_NAME"; exit; } 561219ffec0Smrg GUESS=mips-mips-riscos$UNAME_RELEASE 562219ffec0Smrg ;; 56397e8a2e8Smrg Motorola:PowerMAX_OS:*:*) 564219ffec0Smrg GUESS=powerpc-motorola-powermax 565219ffec0Smrg ;; 56697e8a2e8Smrg Motorola:*:4.3:PL8-*) 567219ffec0Smrg GUESS=powerpc-harris-powermax 568219ffec0Smrg ;; 56997e8a2e8Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 570219ffec0Smrg GUESS=powerpc-harris-powermax 571219ffec0Smrg ;; 57297e8a2e8Smrg Night_Hawk:Power_UNIX:*:*) 573219ffec0Smrg GUESS=powerpc-harris-powerunix 574219ffec0Smrg ;; 57597e8a2e8Smrg m88k:CX/UX:7*:*) 576219ffec0Smrg GUESS=m88k-harris-cxux7 577219ffec0Smrg ;; 57897e8a2e8Smrg m88k:*:4*:R4*) 579219ffec0Smrg GUESS=m88k-motorola-sysv4 580219ffec0Smrg ;; 58197e8a2e8Smrg m88k:*:3*:R3*) 582219ffec0Smrg GUESS=m88k-motorola-sysv3 583219ffec0Smrg ;; 58497e8a2e8Smrg AViiON:dgux:*:*) 58568af480fSmrg # DG/UX returns AViiON for all architectures 58668af480fSmrg UNAME_PROCESSOR=`/usr/bin/uname -p` 587219ffec0Smrg if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 58897e8a2e8Smrg then 589219ffec0Smrg if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ 590219ffec0Smrg test "$TARGET_BINARY_INTERFACE"x = x 59197e8a2e8Smrg then 592219ffec0Smrg GUESS=m88k-dg-dgux$UNAME_RELEASE 59397e8a2e8Smrg else 594219ffec0Smrg GUESS=m88k-dg-dguxbcs$UNAME_RELEASE 59597e8a2e8Smrg fi 59697e8a2e8Smrg else 597219ffec0Smrg GUESS=i586-dg-dgux$UNAME_RELEASE 59897e8a2e8Smrg fi 599219ffec0Smrg ;; 60097e8a2e8Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 601219ffec0Smrg GUESS=m88k-dolphin-sysv3 602219ffec0Smrg ;; 60397e8a2e8Smrg M88*:*:R3*:*) 60497e8a2e8Smrg # Delta 88k system running SVR3 605219ffec0Smrg GUESS=m88k-motorola-sysv3 606219ffec0Smrg ;; 60797e8a2e8Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 608219ffec0Smrg GUESS=m88k-tektronix-sysv3 609219ffec0Smrg ;; 61097e8a2e8Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 611219ffec0Smrg GUESS=m68k-tektronix-bsd 612219ffec0Smrg ;; 61397e8a2e8Smrg *:IRIX*:*:*) 614219ffec0Smrg IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` 615219ffec0Smrg GUESS=mips-sgi-irix$IRIX_REL 616219ffec0Smrg ;; 61797e8a2e8Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 618219ffec0Smrg GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id 619219ffec0Smrg ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 62097e8a2e8Smrg i*86:AIX:*:*) 621219ffec0Smrg GUESS=i386-ibm-aix 622219ffec0Smrg ;; 62397e8a2e8Smrg ia64:AIX:*:*) 624219ffec0Smrg if test -x /usr/bin/oslevel ; then 62597e8a2e8Smrg IBM_REV=`/usr/bin/oslevel` 62697e8a2e8Smrg else 627219ffec0Smrg IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 62897e8a2e8Smrg fi 629219ffec0Smrg GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV 630219ffec0Smrg ;; 63197e8a2e8Smrg *:AIX:2:3) 63297e8a2e8Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 633219ffec0Smrg set_cc_for_build 634219ffec0Smrg sed 's/^ //' << EOF > "$dummy.c" 63597e8a2e8Smrg #include <sys/systemcfg.h> 63697e8a2e8Smrg 63797e8a2e8Smrg main() 63897e8a2e8Smrg { 63997e8a2e8Smrg if (!__power_pc()) 64097e8a2e8Smrg exit(1); 64197e8a2e8Smrg puts("powerpc-ibm-aix3.2.5"); 64297e8a2e8Smrg exit(0); 64397e8a2e8Smrg } 64497e8a2e8SmrgEOF 645219ffec0Smrg if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` 646d7accfefSmrg then 647219ffec0Smrg GUESS=$SYSTEM_NAME 648d7accfefSmrg else 649219ffec0Smrg GUESS=rs6000-ibm-aix3.2.5 650d7accfefSmrg fi 65197e8a2e8Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 652219ffec0Smrg GUESS=rs6000-ibm-aix3.2.4 65397e8a2e8Smrg else 654219ffec0Smrg GUESS=rs6000-ibm-aix3.2 65597e8a2e8Smrg fi 656219ffec0Smrg ;; 657c3f70f0aSmrg *:AIX:*:[4567]) 65897e8a2e8Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 659219ffec0Smrg if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then 66097e8a2e8Smrg IBM_ARCH=rs6000 66197e8a2e8Smrg else 66297e8a2e8Smrg IBM_ARCH=powerpc 66397e8a2e8Smrg fi 664219ffec0Smrg if test -x /usr/bin/lslpp ; then 665219ffec0Smrg IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ 666219ffec0Smrg awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 66797e8a2e8Smrg else 668219ffec0Smrg IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 66997e8a2e8Smrg fi 670219ffec0Smrg GUESS=$IBM_ARCH-ibm-aix$IBM_REV 671219ffec0Smrg ;; 67297e8a2e8Smrg *:AIX:*:*) 673219ffec0Smrg GUESS=rs6000-ibm-aix 674219ffec0Smrg ;; 675219ffec0Smrg ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 676219ffec0Smrg GUESS=romp-ibm-bsd4.4 677219ffec0Smrg ;; 67897e8a2e8Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 679219ffec0Smrg GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to 680219ffec0Smrg ;; # report: romp-ibm BSD 4.3 68197e8a2e8Smrg *:BOSX:*:*) 682219ffec0Smrg GUESS=rs6000-bull-bosx 683219ffec0Smrg ;; 68497e8a2e8Smrg DPX/2?00:B.O.S.:*:*) 685219ffec0Smrg GUESS=m68k-bull-sysv3 686219ffec0Smrg ;; 68797e8a2e8Smrg 9000/[34]??:4.3bsd:1.*:*) 688219ffec0Smrg GUESS=m68k-hp-bsd 689219ffec0Smrg ;; 69097e8a2e8Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 691219ffec0Smrg GUESS=m68k-hp-bsd4.4 692219ffec0Smrg ;; 69397e8a2e8Smrg 9000/[34678]??:HP-UX:*:*) 694219ffec0Smrg HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 695219ffec0Smrg case $UNAME_MACHINE in 696219ffec0Smrg 9000/31?) HP_ARCH=m68000 ;; 697219ffec0Smrg 9000/[34]??) HP_ARCH=m68k ;; 69897e8a2e8Smrg 9000/[678][0-9][0-9]) 699219ffec0Smrg if test -x /usr/bin/getconf; then 70097e8a2e8Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 70168af480fSmrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 702219ffec0Smrg case $sc_cpu_version in 703219ffec0Smrg 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 704219ffec0Smrg 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 70568af480fSmrg 532) # CPU_PA_RISC2_0 706219ffec0Smrg case $sc_kernel_bits in 707219ffec0Smrg 32) HP_ARCH=hppa2.0n ;; 708219ffec0Smrg 64) HP_ARCH=hppa2.0w ;; 709219ffec0Smrg '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 71068af480fSmrg esac ;; 71168af480fSmrg esac 71297e8a2e8Smrg fi 713219ffec0Smrg if test "$HP_ARCH" = ""; then 714219ffec0Smrg set_cc_for_build 715219ffec0Smrg sed 's/^ //' << EOF > "$dummy.c" 71697e8a2e8Smrg 71768af480fSmrg #define _HPUX_SOURCE 71868af480fSmrg #include <stdlib.h> 71968af480fSmrg #include <unistd.h> 72097e8a2e8Smrg 72168af480fSmrg int main () 72268af480fSmrg { 72368af480fSmrg #if defined(_SC_KERNEL_BITS) 72468af480fSmrg long bits = sysconf(_SC_KERNEL_BITS); 72568af480fSmrg #endif 72668af480fSmrg long cpu = sysconf (_SC_CPU_VERSION); 72797e8a2e8Smrg 72868af480fSmrg switch (cpu) 72968af480fSmrg { 73068af480fSmrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 73168af480fSmrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 73268af480fSmrg case CPU_PA_RISC2_0: 73368af480fSmrg #if defined(_SC_KERNEL_BITS) 73468af480fSmrg switch (bits) 73568af480fSmrg { 73668af480fSmrg case 64: puts ("hppa2.0w"); break; 73768af480fSmrg case 32: puts ("hppa2.0n"); break; 73868af480fSmrg default: puts ("hppa2.0"); break; 73968af480fSmrg } break; 74068af480fSmrg #else /* !defined(_SC_KERNEL_BITS) */ 74168af480fSmrg puts ("hppa2.0"); break; 74268af480fSmrg #endif 74368af480fSmrg default: puts ("hppa1.0"); break; 74468af480fSmrg } 74568af480fSmrg exit (0); 74668af480fSmrg } 74797e8a2e8SmrgEOF 748219ffec0Smrg (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` 74997e8a2e8Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 75097e8a2e8Smrg fi ;; 75197e8a2e8Smrg esac 752219ffec0Smrg if test "$HP_ARCH" = hppa2.0w 75397e8a2e8Smrg then 754219ffec0Smrg set_cc_for_build 755d7accfefSmrg 756d7accfefSmrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 757d7accfefSmrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 758d7accfefSmrg # generating 64-bit code. GNU and HP use different nomenclature: 759d7accfefSmrg # 760d7accfefSmrg # $ CC_FOR_BUILD=cc ./config.guess 761d7accfefSmrg # => hppa2.0w-hp-hpux11.23 762d7accfefSmrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 763d7accfefSmrg # => hppa64-hp-hpux11.23 764d7accfefSmrg 765219ffec0Smrg if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | 766c3f70f0aSmrg grep -q __LP64__ 76797e8a2e8Smrg then 768219ffec0Smrg HP_ARCH=hppa2.0w 76997e8a2e8Smrg else 770219ffec0Smrg HP_ARCH=hppa64 77197e8a2e8Smrg fi 77297e8a2e8Smrg fi 773219ffec0Smrg GUESS=$HP_ARCH-hp-hpux$HPUX_REV 774219ffec0Smrg ;; 77597e8a2e8Smrg ia64:HP-UX:*:*) 776219ffec0Smrg HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 777219ffec0Smrg GUESS=ia64-hp-hpux$HPUX_REV 778219ffec0Smrg ;; 77997e8a2e8Smrg 3050*:HI-UX:*:*) 780219ffec0Smrg set_cc_for_build 781219ffec0Smrg sed 's/^ //' << EOF > "$dummy.c" 78297e8a2e8Smrg #include <unistd.h> 78397e8a2e8Smrg int 78497e8a2e8Smrg main () 78597e8a2e8Smrg { 78697e8a2e8Smrg long cpu = sysconf (_SC_CPU_VERSION); 78797e8a2e8Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 78897e8a2e8Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 78997e8a2e8Smrg results, however. */ 79097e8a2e8Smrg if (CPU_IS_PA_RISC (cpu)) 79197e8a2e8Smrg { 79297e8a2e8Smrg switch (cpu) 79397e8a2e8Smrg { 79497e8a2e8Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 79597e8a2e8Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 79697e8a2e8Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 79797e8a2e8Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 79897e8a2e8Smrg } 79997e8a2e8Smrg } 80097e8a2e8Smrg else if (CPU_IS_HP_MC68K (cpu)) 80197e8a2e8Smrg puts ("m68k-hitachi-hiuxwe2"); 80297e8a2e8Smrg else puts ("unknown-hitachi-hiuxwe2"); 80397e8a2e8Smrg exit (0); 80497e8a2e8Smrg } 80597e8a2e8SmrgEOF 806219ffec0Smrg $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && 807d7accfefSmrg { echo "$SYSTEM_NAME"; exit; } 808219ffec0Smrg GUESS=unknown-hitachi-hiuxwe2 809219ffec0Smrg ;; 810219ffec0Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) 811219ffec0Smrg GUESS=hppa1.1-hp-bsd 812219ffec0Smrg ;; 81397e8a2e8Smrg 9000/8??:4.3bsd:*:*) 814219ffec0Smrg GUESS=hppa1.0-hp-bsd 815219ffec0Smrg ;; 81697e8a2e8Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 817219ffec0Smrg GUESS=hppa1.0-hp-mpeix 818219ffec0Smrg ;; 819219ffec0Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) 820219ffec0Smrg GUESS=hppa1.1-hp-osf 821219ffec0Smrg ;; 82297e8a2e8Smrg hp8??:OSF1:*:*) 823219ffec0Smrg GUESS=hppa1.0-hp-osf 824219ffec0Smrg ;; 82597e8a2e8Smrg i*86:OSF1:*:*) 826219ffec0Smrg if test -x /usr/sbin/sysversion ; then 827219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-osf1mk 82897e8a2e8Smrg else 829219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-osf1 83097e8a2e8Smrg fi 831219ffec0Smrg ;; 83297e8a2e8Smrg parisc*:Lites*:*:*) 833219ffec0Smrg GUESS=hppa1.1-hp-lites 834219ffec0Smrg ;; 83597e8a2e8Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 836219ffec0Smrg GUESS=c1-convex-bsd 837219ffec0Smrg ;; 83897e8a2e8Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 83997e8a2e8Smrg if getsysinfo -f scalar_acc 84097e8a2e8Smrg then echo c32-convex-bsd 84197e8a2e8Smrg else echo c2-convex-bsd 84297e8a2e8Smrg fi 84368af480fSmrg exit ;; 84497e8a2e8Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 845219ffec0Smrg GUESS=c34-convex-bsd 846219ffec0Smrg ;; 84797e8a2e8Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 848219ffec0Smrg GUESS=c38-convex-bsd 849219ffec0Smrg ;; 85097e8a2e8Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 851219ffec0Smrg GUESS=c4-convex-bsd 852219ffec0Smrg ;; 85397e8a2e8Smrg CRAY*Y-MP:*:*:*) 854219ffec0Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 855219ffec0Smrg GUESS=ymp-cray-unicos$CRAY_REL 856219ffec0Smrg ;; 85797e8a2e8Smrg CRAY*[A-Z]90:*:*:*) 858219ffec0Smrg echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ 85997e8a2e8Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 86097e8a2e8Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 86197e8a2e8Smrg -e 's/\.[^.]*$/.X/' 862d7accfefSmrg exit ;; 86397e8a2e8Smrg CRAY*TS:*:*:*) 864219ffec0Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 865219ffec0Smrg GUESS=t90-cray-unicos$CRAY_REL 866219ffec0Smrg ;; 86797e8a2e8Smrg CRAY*T3E:*:*:*) 868219ffec0Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 869219ffec0Smrg GUESS=alphaev5-cray-unicosmk$CRAY_REL 870219ffec0Smrg ;; 87197e8a2e8Smrg CRAY*SV1:*:*:*) 872219ffec0Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 873219ffec0Smrg GUESS=sv1-cray-unicos$CRAY_REL 874219ffec0Smrg ;; 87597e8a2e8Smrg *:UNICOS/mp:*:*) 876219ffec0Smrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 877219ffec0Smrg GUESS=craynv-cray-unicosmp$CRAY_REL 878219ffec0Smrg ;; 87997e8a2e8Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 880219ffec0Smrg FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 881219ffec0Smrg FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 882219ffec0Smrg FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` 883219ffec0Smrg GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 884219ffec0Smrg ;; 885d7accfefSmrg 5000:UNIX_System_V:4.*:*) 886219ffec0Smrg FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 887219ffec0Smrg FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` 888219ffec0Smrg GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 889219ffec0Smrg ;; 89097e8a2e8Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 891219ffec0Smrg GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE 892219ffec0Smrg ;; 89397e8a2e8Smrg sparc*:BSD/OS:*:*) 894219ffec0Smrg GUESS=sparc-unknown-bsdi$UNAME_RELEASE 895219ffec0Smrg ;; 89697e8a2e8Smrg *:BSD/OS:*:*) 897219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE 898219ffec0Smrg ;; 899219ffec0Smrg arm:FreeBSD:*:*) 900219ffec0Smrg UNAME_PROCESSOR=`uname -p` 901219ffec0Smrg set_cc_for_build 902219ffec0Smrg if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 903219ffec0Smrg | grep -q __ARM_PCS_VFP 904219ffec0Smrg then 905219ffec0Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 906219ffec0Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi 907219ffec0Smrg else 908219ffec0Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 909219ffec0Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf 910219ffec0Smrg fi 911219ffec0Smrg ;; 912d7accfefSmrg *:FreeBSD:*:*) 913bbfad078Smrg UNAME_PROCESSOR=`uname -p` 914219ffec0Smrg case $UNAME_PROCESSOR in 915d7accfefSmrg amd64) 916219ffec0Smrg UNAME_PROCESSOR=x86_64 ;; 917219ffec0Smrg i386) 918219ffec0Smrg UNAME_PROCESSOR=i586 ;; 919d7accfefSmrg esac 920219ffec0Smrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 921219ffec0Smrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL 922219ffec0Smrg ;; 92397e8a2e8Smrg i*:CYGWIN*:*) 924219ffec0Smrg GUESS=$UNAME_MACHINE-pc-cygwin 925219ffec0Smrg ;; 92668af480fSmrg *:MINGW64*:*) 927219ffec0Smrg GUESS=$UNAME_MACHINE-pc-mingw64 928219ffec0Smrg ;; 929d7accfefSmrg *:MINGW*:*) 930219ffec0Smrg GUESS=$UNAME_MACHINE-pc-mingw32 931219ffec0Smrg ;; 932219ffec0Smrg *:MSYS*:*) 933219ffec0Smrg GUESS=$UNAME_MACHINE-pc-msys 934219ffec0Smrg ;; 93597e8a2e8Smrg i*:PW*:*) 936219ffec0Smrg GUESS=$UNAME_MACHINE-pc-pw32 937219ffec0Smrg ;; 938bbfad078Smrg *:SerenityOS:*:*) 939bbfad078Smrg GUESS=$UNAME_MACHINE-pc-serenity 940bbfad078Smrg ;; 941c3f70f0aSmrg *:Interix*:*) 942219ffec0Smrg case $UNAME_MACHINE in 943d7accfefSmrg x86) 944219ffec0Smrg GUESS=i586-pc-interix$UNAME_RELEASE 945219ffec0Smrg ;; 946c3f70f0aSmrg authenticamd | genuineintel | EM64T) 947219ffec0Smrg GUESS=x86_64-unknown-interix$UNAME_RELEASE 948219ffec0Smrg ;; 949d7accfefSmrg IA64) 950219ffec0Smrg GUESS=ia64-unknown-interix$UNAME_RELEASE 951219ffec0Smrg ;; 952d7accfefSmrg esac ;; 95397e8a2e8Smrg i*:UWIN*:*) 954219ffec0Smrg GUESS=$UNAME_MACHINE-pc-uwin 955219ffec0Smrg ;; 956d7accfefSmrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 957219ffec0Smrg GUESS=x86_64-pc-cygwin 958219ffec0Smrg ;; 95997e8a2e8Smrg prep*:SunOS:5.*:*) 960219ffec0Smrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 961219ffec0Smrg GUESS=powerpcle-unknown-solaris2$SUN_REL 962219ffec0Smrg ;; 96397e8a2e8Smrg *:GNU:*:*) 964d7accfefSmrg # the GNU system 965219ffec0Smrg GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` 966219ffec0Smrg GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` 967219ffec0Smrg GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL 968219ffec0Smrg ;; 969d7accfefSmrg *:GNU/*:*:*) 970d7accfefSmrg # other systems with GNU libc and userland 971219ffec0Smrg GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` 972219ffec0Smrg GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 973219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC 974219ffec0Smrg ;; 975bbfad078Smrg x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) 976bbfad078Smrg GUESS="$UNAME_MACHINE-pc-managarm-mlibc" 977bbfad078Smrg ;; 978bbfad078Smrg *:[Mm]anagarm:*:*) 979bbfad078Smrg GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" 980bbfad078Smrg ;; 981219ffec0Smrg *:Minix:*:*) 982219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-minix 983219ffec0Smrg ;; 98468af480fSmrg aarch64:Linux:*:*) 985bbfad078Smrg set_cc_for_build 986bbfad078Smrg CPU=$UNAME_MACHINE 987bbfad078Smrg LIBCABI=$LIBC 988bbfad078Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 989bbfad078Smrg ABI=64 990bbfad078Smrg sed 's/^ //' << EOF > "$dummy.c" 991bbfad078Smrg #ifdef __ARM_EABI__ 992bbfad078Smrg #ifdef __ARM_PCS_VFP 993bbfad078Smrg ABI=eabihf 994bbfad078Smrg #else 995bbfad078Smrg ABI=eabi 996bbfad078Smrg #endif 997bbfad078Smrg #endif 998bbfad078SmrgEOF 999bbfad078Smrg cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` 1000bbfad078Smrg eval "$cc_set_abi" 1001bbfad078Smrg case $ABI in 1002bbfad078Smrg eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; 1003bbfad078Smrg esac 1004bbfad078Smrg fi 1005bbfad078Smrg GUESS=$CPU-unknown-linux-$LIBCABI 1006219ffec0Smrg ;; 100768af480fSmrg aarch64_be:Linux:*:*) 100868af480fSmrg UNAME_MACHINE=aarch64_be 1009219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1010219ffec0Smrg ;; 1011c3f70f0aSmrg alpha:Linux:*:*) 1012219ffec0Smrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in 1013c3f70f0aSmrg EV5) UNAME_MACHINE=alphaev5 ;; 1014c3f70f0aSmrg EV56) UNAME_MACHINE=alphaev56 ;; 1015c3f70f0aSmrg PCA56) UNAME_MACHINE=alphapca56 ;; 1016c3f70f0aSmrg PCA57) UNAME_MACHINE=alphapca56 ;; 1017c3f70f0aSmrg EV6) UNAME_MACHINE=alphaev6 ;; 1018c3f70f0aSmrg EV67) UNAME_MACHINE=alphaev67 ;; 1019c3f70f0aSmrg EV68*) UNAME_MACHINE=alphaev68 ;; 102068af480fSmrg esac 1021c3f70f0aSmrg objdump --private-headers /bin/sh | grep -q ld.so.1 1022219ffec0Smrg if test "$?" = 0 ; then LIBC=gnulibc1 ; fi 1023219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1024219ffec0Smrg ;; 1025219ffec0Smrg arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) 1026219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1027219ffec0Smrg ;; 102897e8a2e8Smrg arm*:Linux:*:*) 1029219ffec0Smrg set_cc_for_build 1030d7accfefSmrg if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 1031d7accfefSmrg | grep -q __ARM_EABI__ 1032d7accfefSmrg then 1033219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1034d7accfefSmrg else 103568af480fSmrg if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 103668af480fSmrg | grep -q __ARM_PCS_VFP 103768af480fSmrg then 1038219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi 103968af480fSmrg else 1040219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf 104168af480fSmrg fi 1042d7accfefSmrg fi 1043219ffec0Smrg ;; 1044d7accfefSmrg avr32*:Linux:*:*) 1045219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1046219ffec0Smrg ;; 104797e8a2e8Smrg cris:Linux:*:*) 1048219ffec0Smrg GUESS=$UNAME_MACHINE-axis-linux-$LIBC 1049219ffec0Smrg ;; 1050d7accfefSmrg crisv32:Linux:*:*) 1051219ffec0Smrg GUESS=$UNAME_MACHINE-axis-linux-$LIBC 1052219ffec0Smrg ;; 1053219ffec0Smrg e2k:Linux:*:*) 1054219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1055219ffec0Smrg ;; 1056d7accfefSmrg frv:Linux:*:*) 1057219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1058219ffec0Smrg ;; 105968af480fSmrg hexagon:Linux:*:*) 1060219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1061219ffec0Smrg ;; 1062c3f70f0aSmrg i*86:Linux:*:*) 1063219ffec0Smrg GUESS=$UNAME_MACHINE-pc-linux-$LIBC 1064219ffec0Smrg ;; 106597e8a2e8Smrg ia64:Linux:*:*) 1066219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1067219ffec0Smrg ;; 1068219ffec0Smrg k1om:Linux:*:*) 1069219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1070219ffec0Smrg ;; 1071bbfad078Smrg kvx:Linux:*:*) 1072bbfad078Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1073bbfad078Smrg ;; 1074bbfad078Smrg kvx:cos:*:*) 1075bbfad078Smrg GUESS=$UNAME_MACHINE-unknown-cos 1076bbfad078Smrg ;; 1077bbfad078Smrg kvx:mbr:*:*) 1078bbfad078Smrg GUESS=$UNAME_MACHINE-unknown-mbr 1079bbfad078Smrg ;; 1080bbfad078Smrg loongarch32:Linux:*:* | loongarch64:Linux:*:*) 1081219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1082219ffec0Smrg ;; 1083d7accfefSmrg m32r*:Linux:*:*) 1084219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1085219ffec0Smrg ;; 108697e8a2e8Smrg m68*:Linux:*:*) 1087219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1088219ffec0Smrg ;; 1089c3f70f0aSmrg mips:Linux:*:* | mips64:Linux:*:*) 1090219ffec0Smrg set_cc_for_build 1091219ffec0Smrg IS_GLIBC=0 1092219ffec0Smrg test x"${LIBC}" = xgnu && IS_GLIBC=1 1093219ffec0Smrg sed 's/^ //' << EOF > "$dummy.c" 109497e8a2e8Smrg #undef CPU 1095219ffec0Smrg #undef mips 1096219ffec0Smrg #undef mipsel 1097219ffec0Smrg #undef mips64 1098219ffec0Smrg #undef mips64el 1099219ffec0Smrg #if ${IS_GLIBC} && defined(_ABI64) 1100219ffec0Smrg LIBCABI=gnuabi64 1101219ffec0Smrg #else 1102219ffec0Smrg #if ${IS_GLIBC} && defined(_ABIN32) 1103219ffec0Smrg LIBCABI=gnuabin32 1104219ffec0Smrg #else 1105219ffec0Smrg LIBCABI=${LIBC} 1106219ffec0Smrg #endif 1107219ffec0Smrg #endif 1108219ffec0Smrg 1109219ffec0Smrg #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 1110219ffec0Smrg CPU=mipsisa64r6 1111219ffec0Smrg #else 1112219ffec0Smrg #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 1113219ffec0Smrg CPU=mipsisa32r6 1114219ffec0Smrg #else 1115219ffec0Smrg #if defined(__mips64) 1116219ffec0Smrg CPU=mips64 1117219ffec0Smrg #else 1118219ffec0Smrg CPU=mips 1119219ffec0Smrg #endif 1120219ffec0Smrg #endif 1121219ffec0Smrg #endif 1122219ffec0Smrg 112397e8a2e8Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 1124219ffec0Smrg MIPS_ENDIAN=el 112597e8a2e8Smrg #else 112697e8a2e8Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 1127219ffec0Smrg MIPS_ENDIAN= 112897e8a2e8Smrg #else 1129219ffec0Smrg MIPS_ENDIAN= 113097e8a2e8Smrg #endif 113197e8a2e8Smrg #endif 113297e8a2e8SmrgEOF 1133219ffec0Smrg cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` 1134219ffec0Smrg eval "$cc_set_vars" 1135219ffec0Smrg test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } 1136219ffec0Smrg ;; 1137219ffec0Smrg mips64el:Linux:*:*) 1138219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1139219ffec0Smrg ;; 1140219ffec0Smrg openrisc*:Linux:*:*) 1141219ffec0Smrg GUESS=or1k-unknown-linux-$LIBC 1142219ffec0Smrg ;; 1143219ffec0Smrg or32:Linux:*:* | or1k*:Linux:*:*) 1144219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 114597e8a2e8Smrg ;; 1146d7accfefSmrg padre:Linux:*:*) 1147219ffec0Smrg GUESS=sparc-unknown-linux-$LIBC 1148219ffec0Smrg ;; 1149c3f70f0aSmrg parisc64:Linux:*:* | hppa64:Linux:*:*) 1150219ffec0Smrg GUESS=hppa64-unknown-linux-$LIBC 1151219ffec0Smrg ;; 115297e8a2e8Smrg parisc:Linux:*:* | hppa:Linux:*:*) 115397e8a2e8Smrg # Look for CPU level 115497e8a2e8Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 1155219ffec0Smrg PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; 1156219ffec0Smrg PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; 1157219ffec0Smrg *) GUESS=hppa-unknown-linux-$LIBC ;; 115897e8a2e8Smrg esac 1159219ffec0Smrg ;; 1160c3f70f0aSmrg ppc64:Linux:*:*) 1161219ffec0Smrg GUESS=powerpc64-unknown-linux-$LIBC 1162219ffec0Smrg ;; 1163c3f70f0aSmrg ppc:Linux:*:*) 1164219ffec0Smrg GUESS=powerpc-unknown-linux-$LIBC 1165219ffec0Smrg ;; 116668af480fSmrg ppc64le:Linux:*:*) 1167219ffec0Smrg GUESS=powerpc64le-unknown-linux-$LIBC 1168219ffec0Smrg ;; 116968af480fSmrg ppcle:Linux:*:*) 1170219ffec0Smrg GUESS=powerpcle-unknown-linux-$LIBC 1171219ffec0Smrg ;; 1172219ffec0Smrg riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) 1173219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1174219ffec0Smrg ;; 117597e8a2e8Smrg s390:Linux:*:* | s390x:Linux:*:*) 1176219ffec0Smrg GUESS=$UNAME_MACHINE-ibm-linux-$LIBC 1177219ffec0Smrg ;; 117897e8a2e8Smrg sh64*:Linux:*:*) 1179219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1180219ffec0Smrg ;; 118197e8a2e8Smrg sh*:Linux:*:*) 1182219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1183219ffec0Smrg ;; 118497e8a2e8Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 1185219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1186219ffec0Smrg ;; 1187c3f70f0aSmrg tile*:Linux:*:*) 1188219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1189219ffec0Smrg ;; 1190d7accfefSmrg vax:Linux:*:*) 1191219ffec0Smrg GUESS=$UNAME_MACHINE-dec-linux-$LIBC 1192219ffec0Smrg ;; 119397e8a2e8Smrg x86_64:Linux:*:*) 1194219ffec0Smrg set_cc_for_build 1195bbfad078Smrg CPU=$UNAME_MACHINE 1196219ffec0Smrg LIBCABI=$LIBC 1197219ffec0Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 1198bbfad078Smrg ABI=64 1199bbfad078Smrg sed 's/^ //' << EOF > "$dummy.c" 1200bbfad078Smrg #ifdef __i386__ 1201bbfad078Smrg ABI=x86 1202bbfad078Smrg #else 1203bbfad078Smrg #ifdef __ILP32__ 1204bbfad078Smrg ABI=x32 1205bbfad078Smrg #endif 1206bbfad078Smrg #endif 1207bbfad078SmrgEOF 1208bbfad078Smrg cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` 1209bbfad078Smrg eval "$cc_set_abi" 1210bbfad078Smrg case $ABI in 1211bbfad078Smrg x86) CPU=i686 ;; 1212bbfad078Smrg x32) LIBCABI=${LIBC}x32 ;; 1213bbfad078Smrg esac 1214219ffec0Smrg fi 1215bbfad078Smrg GUESS=$CPU-pc-linux-$LIBCABI 1216219ffec0Smrg ;; 1217d7accfefSmrg xtensa*:Linux:*:*) 1218219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1219219ffec0Smrg ;; 122097e8a2e8Smrg i*86:DYNIX/ptx:4*:*) 122197e8a2e8Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 122297e8a2e8Smrg # earlier versions are messed up and put the nodename in both 122397e8a2e8Smrg # sysname and nodename. 1224219ffec0Smrg GUESS=i386-sequent-sysv4 1225219ffec0Smrg ;; 122697e8a2e8Smrg i*86:UNIX_SV:4.2MP:2.*) 122768af480fSmrg # Unixware is an offshoot of SVR4, but it has its own version 122868af480fSmrg # number series starting with 2... 122968af480fSmrg # I am not positive that other SVR4 systems won't match this, 123097e8a2e8Smrg # I just have to hope. -- rms. 123168af480fSmrg # Use sysv4.2uw... so that sysv4* matches it. 1232219ffec0Smrg GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION 1233219ffec0Smrg ;; 123497e8a2e8Smrg i*86:OS/2:*:*) 1235bbfad078Smrg # If we were able to find 'uname', then EMX Unix compatibility 123697e8a2e8Smrg # is probably installed. 1237219ffec0Smrg GUESS=$UNAME_MACHINE-pc-os2-emx 1238219ffec0Smrg ;; 123997e8a2e8Smrg i*86:XTS-300:*:STOP) 1240219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-stop 1241219ffec0Smrg ;; 124297e8a2e8Smrg i*86:atheos:*:*) 1243219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-atheos 1244219ffec0Smrg ;; 1245d7accfefSmrg i*86:syllable:*:*) 1246219ffec0Smrg GUESS=$UNAME_MACHINE-pc-syllable 1247219ffec0Smrg ;; 1248c3f70f0aSmrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1249219ffec0Smrg GUESS=i386-unknown-lynxos$UNAME_RELEASE 1250219ffec0Smrg ;; 125197e8a2e8Smrg i*86:*DOS:*:*) 1252219ffec0Smrg GUESS=$UNAME_MACHINE-pc-msdosdjgpp 1253219ffec0Smrg ;; 1254219ffec0Smrg i*86:*:4.*:*) 1255219ffec0Smrg UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` 125697e8a2e8Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1257219ffec0Smrg GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL 125897e8a2e8Smrg else 1259219ffec0Smrg GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL 126097e8a2e8Smrg fi 1261219ffec0Smrg ;; 1262d7accfefSmrg i*86:*:5:[678]*) 126368af480fSmrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 126497e8a2e8Smrg case `/bin/uname -X | grep "^Machine"` in 126597e8a2e8Smrg *486*) UNAME_MACHINE=i486 ;; 126697e8a2e8Smrg *Pentium) UNAME_MACHINE=i586 ;; 126797e8a2e8Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 126897e8a2e8Smrg esac 1269219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1270219ffec0Smrg ;; 127197e8a2e8Smrg i*86:*:3.2:*) 127297e8a2e8Smrg if test -f /usr/options/cb.name; then 127397e8a2e8Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1274219ffec0Smrg GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL 127597e8a2e8Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 127697e8a2e8Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 127797e8a2e8Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 127897e8a2e8Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 127997e8a2e8Smrg && UNAME_MACHINE=i586 128097e8a2e8Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 128197e8a2e8Smrg && UNAME_MACHINE=i686 128297e8a2e8Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 128397e8a2e8Smrg && UNAME_MACHINE=i686 1284219ffec0Smrg GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL 128597e8a2e8Smrg else 1286219ffec0Smrg GUESS=$UNAME_MACHINE-pc-sysv32 128797e8a2e8Smrg fi 1288219ffec0Smrg ;; 128997e8a2e8Smrg pc:*:*:*) 129097e8a2e8Smrg # Left here for compatibility: 129168af480fSmrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 129268af480fSmrg # the processor, so we play safe by assuming i586. 1293d7accfefSmrg # Note: whatever this is, it MUST be the same as what config.sub 1294219ffec0Smrg # prints for the "djgpp" host, or else GDB configure will decide that 1295d7accfefSmrg # this is a cross-build. 1296219ffec0Smrg GUESS=i586-pc-msdosdjgpp 1297219ffec0Smrg ;; 129897e8a2e8Smrg Intel:Mach:3*:*) 1299219ffec0Smrg GUESS=i386-pc-mach3 1300219ffec0Smrg ;; 130197e8a2e8Smrg paragon:*:*:*) 1302219ffec0Smrg GUESS=i860-intel-osf1 1303219ffec0Smrg ;; 130497e8a2e8Smrg i860:*:4.*:*) # i860-SVR4 130597e8a2e8Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1306219ffec0Smrg GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 130797e8a2e8Smrg else # Add other i860-SVR4 vendors below as they are discovered. 1308219ffec0Smrg GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 130997e8a2e8Smrg fi 1310219ffec0Smrg ;; 131197e8a2e8Smrg mini*:CTIX:SYS*5:*) 131297e8a2e8Smrg # "miniframe" 1313219ffec0Smrg GUESS=m68010-convergent-sysv 1314219ffec0Smrg ;; 131597e8a2e8Smrg mc68k:UNIX:SYSTEM5:3.51m) 1316219ffec0Smrg GUESS=m68k-convergent-sysv 1317219ffec0Smrg ;; 131897e8a2e8Smrg M680?0:D-NIX:5.3:*) 1319219ffec0Smrg GUESS=m68k-diab-dnix 1320219ffec0Smrg ;; 1321d7accfefSmrg M68*:*:R3V[5678]*:*) 1322d7accfefSmrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1323d7accfefSmrg 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) 132497e8a2e8Smrg OS_REL='' 132597e8a2e8Smrg test -r /etc/.relid \ 132697e8a2e8Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 132797e8a2e8Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1328219ffec0Smrg && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 132997e8a2e8Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1330219ffec0Smrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 133197e8a2e8Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 133268af480fSmrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 133368af480fSmrg && { echo i486-ncr-sysv4; exit; } ;; 1334d7accfefSmrg NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1335d7accfefSmrg OS_REL='.3' 1336d7accfefSmrg test -r /etc/.relid \ 1337d7accfefSmrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1338d7accfefSmrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1339219ffec0Smrg && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 1340d7accfefSmrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1341219ffec0Smrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } 1342d7accfefSmrg /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1343219ffec0Smrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 134497e8a2e8Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1345219ffec0Smrg GUESS=m68k-unknown-lynxos$UNAME_RELEASE 1346219ffec0Smrg ;; 134797e8a2e8Smrg mc68030:UNIX_System_V:4.*:*) 1348219ffec0Smrg GUESS=m68k-atari-sysv4 1349219ffec0Smrg ;; 135097e8a2e8Smrg TSUNAMI:LynxOS:2.*:*) 1351219ffec0Smrg GUESS=sparc-unknown-lynxos$UNAME_RELEASE 1352219ffec0Smrg ;; 135397e8a2e8Smrg rs6000:LynxOS:2.*:*) 1354219ffec0Smrg GUESS=rs6000-unknown-lynxos$UNAME_RELEASE 1355219ffec0Smrg ;; 1356c3f70f0aSmrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1357219ffec0Smrg GUESS=powerpc-unknown-lynxos$UNAME_RELEASE 1358219ffec0Smrg ;; 135997e8a2e8Smrg SM[BE]S:UNIX_SV:*:*) 1360219ffec0Smrg GUESS=mips-dde-sysv$UNAME_RELEASE 1361219ffec0Smrg ;; 136297e8a2e8Smrg RM*:ReliantUNIX-*:*:*) 1363219ffec0Smrg GUESS=mips-sni-sysv4 1364219ffec0Smrg ;; 136597e8a2e8Smrg RM*:SINIX-*:*:*) 1366219ffec0Smrg GUESS=mips-sni-sysv4 1367219ffec0Smrg ;; 136897e8a2e8Smrg *:SINIX-*:*:*) 136997e8a2e8Smrg if uname -p 2>/dev/null >/dev/null ; then 137097e8a2e8Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 1371219ffec0Smrg GUESS=$UNAME_MACHINE-sni-sysv4 137297e8a2e8Smrg else 1373219ffec0Smrg GUESS=ns32k-sni-sysv 137497e8a2e8Smrg fi 1375219ffec0Smrg ;; 1376bbfad078Smrg PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort 137768af480fSmrg # says <Richard.M.Bartel@ccMail.Census.GOV> 1378219ffec0Smrg GUESS=i586-unisys-sysv4 1379219ffec0Smrg ;; 138097e8a2e8Smrg *:UNIX_System_V:4*:FTX*) 138197e8a2e8Smrg # From Gerald Hewes <hewes@openmarket.com>. 138297e8a2e8Smrg # How about differentiating between stratus architectures? -djm 1383219ffec0Smrg GUESS=hppa1.1-stratus-sysv4 1384219ffec0Smrg ;; 138597e8a2e8Smrg *:*:*:FTX*) 138697e8a2e8Smrg # From seanf@swdc.stratus.com. 1387219ffec0Smrg GUESS=i860-stratus-sysv4 1388219ffec0Smrg ;; 1389d7accfefSmrg i*86:VOS:*:*) 1390d7accfefSmrg # From Paul.Green@stratus.com. 1391219ffec0Smrg GUESS=$UNAME_MACHINE-stratus-vos 1392219ffec0Smrg ;; 139397e8a2e8Smrg *:VOS:*:*) 139497e8a2e8Smrg # From Paul.Green@stratus.com. 1395219ffec0Smrg GUESS=hppa1.1-stratus-vos 1396219ffec0Smrg ;; 139797e8a2e8Smrg mc68*:A/UX:*:*) 1398219ffec0Smrg GUESS=m68k-apple-aux$UNAME_RELEASE 1399219ffec0Smrg ;; 140097e8a2e8Smrg news*:NEWS-OS:6*:*) 1401219ffec0Smrg GUESS=mips-sony-newsos6 1402219ffec0Smrg ;; 140397e8a2e8Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1404219ffec0Smrg if test -d /usr/nec; then 1405219ffec0Smrg GUESS=mips-nec-sysv$UNAME_RELEASE 140697e8a2e8Smrg else 1407219ffec0Smrg GUESS=mips-unknown-sysv$UNAME_RELEASE 140897e8a2e8Smrg fi 1409219ffec0Smrg ;; 141097e8a2e8Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1411219ffec0Smrg GUESS=powerpc-be-beos 1412219ffec0Smrg ;; 141397e8a2e8Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1414219ffec0Smrg GUESS=powerpc-apple-beos 1415219ffec0Smrg ;; 141697e8a2e8Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1417219ffec0Smrg GUESS=i586-pc-beos 1418219ffec0Smrg ;; 1419d7accfefSmrg BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1420219ffec0Smrg GUESS=i586-pc-haiku 1421219ffec0Smrg ;; 1422bbfad078Smrg ppc:Haiku:*:*) # Haiku running on Apple PowerPC 1423bbfad078Smrg GUESS=powerpc-apple-haiku 1424bbfad078Smrg ;; 1425bbfad078Smrg *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) 1426bbfad078Smrg GUESS=$UNAME_MACHINE-unknown-haiku 1427219ffec0Smrg ;; 142897e8a2e8Smrg SX-4:SUPER-UX:*:*) 1429219ffec0Smrg GUESS=sx4-nec-superux$UNAME_RELEASE 1430219ffec0Smrg ;; 143197e8a2e8Smrg SX-5:SUPER-UX:*:*) 1432219ffec0Smrg GUESS=sx5-nec-superux$UNAME_RELEASE 1433219ffec0Smrg ;; 143497e8a2e8Smrg SX-6:SUPER-UX:*:*) 1435219ffec0Smrg GUESS=sx6-nec-superux$UNAME_RELEASE 1436219ffec0Smrg ;; 1437d7accfefSmrg SX-7:SUPER-UX:*:*) 1438219ffec0Smrg GUESS=sx7-nec-superux$UNAME_RELEASE 1439219ffec0Smrg ;; 1440d7accfefSmrg SX-8:SUPER-UX:*:*) 1441219ffec0Smrg GUESS=sx8-nec-superux$UNAME_RELEASE 1442219ffec0Smrg ;; 1443d7accfefSmrg SX-8R:SUPER-UX:*:*) 1444219ffec0Smrg GUESS=sx8r-nec-superux$UNAME_RELEASE 1445219ffec0Smrg ;; 1446219ffec0Smrg SX-ACE:SUPER-UX:*:*) 1447219ffec0Smrg GUESS=sxace-nec-superux$UNAME_RELEASE 1448219ffec0Smrg ;; 144997e8a2e8Smrg Power*:Rhapsody:*:*) 1450219ffec0Smrg GUESS=powerpc-apple-rhapsody$UNAME_RELEASE 1451219ffec0Smrg ;; 145297e8a2e8Smrg *:Rhapsody:*:*) 1453219ffec0Smrg GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE 1454219ffec0Smrg ;; 1455219ffec0Smrg arm64:Darwin:*:*) 1456219ffec0Smrg GUESS=aarch64-apple-darwin$UNAME_RELEASE 1457219ffec0Smrg ;; 145897e8a2e8Smrg *:Darwin:*:*) 1459219ffec0Smrg UNAME_PROCESSOR=`uname -p` 1460219ffec0Smrg case $UNAME_PROCESSOR in 1461219ffec0Smrg unknown) UNAME_PROCESSOR=powerpc ;; 1462219ffec0Smrg esac 1463219ffec0Smrg if command -v xcode-select > /dev/null 2> /dev/null && \ 1464219ffec0Smrg ! xcode-select --print-path > /dev/null 2> /dev/null ; then 1465219ffec0Smrg # Avoid executing cc if there is no toolchain installed as 1466219ffec0Smrg # cc will be a stub that puts up a graphical alert 1467219ffec0Smrg # prompting the user to install developer tools. 1468219ffec0Smrg CC_FOR_BUILD=no_compiler_found 1469219ffec0Smrg else 1470219ffec0Smrg set_cc_for_build 147168af480fSmrg fi 1472219ffec0Smrg if test "$CC_FOR_BUILD" != no_compiler_found; then 147368af480fSmrg if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1474219ffec0Smrg (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1475219ffec0Smrg grep IS_64BIT_ARCH >/dev/null 147668af480fSmrg then 147768af480fSmrg case $UNAME_PROCESSOR in 147868af480fSmrg i386) UNAME_PROCESSOR=x86_64 ;; 147968af480fSmrg powerpc) UNAME_PROCESSOR=powerpc64 ;; 148068af480fSmrg esac 148168af480fSmrg fi 1482219ffec0Smrg # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc 1483219ffec0Smrg if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ 1484219ffec0Smrg (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1485219ffec0Smrg grep IS_PPC >/dev/null 1486219ffec0Smrg then 1487219ffec0Smrg UNAME_PROCESSOR=powerpc 1488219ffec0Smrg fi 1489219ffec0Smrg elif test "$UNAME_PROCESSOR" = i386 ; then 1490219ffec0Smrg # uname -m returns i386 or x86_64 1491219ffec0Smrg UNAME_PROCESSOR=$UNAME_MACHINE 149268af480fSmrg fi 1493219ffec0Smrg GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE 1494219ffec0Smrg ;; 149597e8a2e8Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 149697e8a2e8Smrg UNAME_PROCESSOR=`uname -p` 1497219ffec0Smrg if test "$UNAME_PROCESSOR" = x86; then 149897e8a2e8Smrg UNAME_PROCESSOR=i386 149997e8a2e8Smrg UNAME_MACHINE=pc 150097e8a2e8Smrg fi 1501219ffec0Smrg GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE 1502219ffec0Smrg ;; 150397e8a2e8Smrg *:QNX:*:4*) 1504219ffec0Smrg GUESS=i386-pc-qnx 1505219ffec0Smrg ;; 1506219ffec0Smrg NEO-*:NONSTOP_KERNEL:*:*) 1507219ffec0Smrg GUESS=neo-tandem-nsk$UNAME_RELEASE 1508219ffec0Smrg ;; 150968af480fSmrg NSE-*:NONSTOP_KERNEL:*:*) 1510219ffec0Smrg GUESS=nse-tandem-nsk$UNAME_RELEASE 1511219ffec0Smrg ;; 1512219ffec0Smrg NSR-*:NONSTOP_KERNEL:*:*) 1513219ffec0Smrg GUESS=nsr-tandem-nsk$UNAME_RELEASE 1514219ffec0Smrg ;; 1515219ffec0Smrg NSV-*:NONSTOP_KERNEL:*:*) 1516219ffec0Smrg GUESS=nsv-tandem-nsk$UNAME_RELEASE 1517219ffec0Smrg ;; 1518219ffec0Smrg NSX-*:NONSTOP_KERNEL:*:*) 1519219ffec0Smrg GUESS=nsx-tandem-nsk$UNAME_RELEASE 1520219ffec0Smrg ;; 152197e8a2e8Smrg *:NonStop-UX:*:*) 1522219ffec0Smrg GUESS=mips-compaq-nonstopux 1523219ffec0Smrg ;; 152497e8a2e8Smrg BS2000:POSIX*:*:*) 1525219ffec0Smrg GUESS=bs2000-siemens-sysv 1526219ffec0Smrg ;; 152797e8a2e8Smrg DS/*:UNIX_System_V:*:*) 1528219ffec0Smrg GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE 1529219ffec0Smrg ;; 153097e8a2e8Smrg *:Plan9:*:*) 153197e8a2e8Smrg # "uname -m" is not consistent, so use $cputype instead. 386 153297e8a2e8Smrg # is converted to i386 for consistency with other x86 153397e8a2e8Smrg # operating systems. 1534219ffec0Smrg if test "${cputype-}" = 386; then 153597e8a2e8Smrg UNAME_MACHINE=i386 1536219ffec0Smrg elif test "x${cputype-}" != x; then 1537219ffec0Smrg UNAME_MACHINE=$cputype 153897e8a2e8Smrg fi 1539219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-plan9 1540219ffec0Smrg ;; 154197e8a2e8Smrg *:TOPS-10:*:*) 1542219ffec0Smrg GUESS=pdp10-unknown-tops10 1543219ffec0Smrg ;; 154497e8a2e8Smrg *:TENEX:*:*) 1545219ffec0Smrg GUESS=pdp10-unknown-tenex 1546219ffec0Smrg ;; 154797e8a2e8Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1548219ffec0Smrg GUESS=pdp10-dec-tops20 1549219ffec0Smrg ;; 155097e8a2e8Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1551219ffec0Smrg GUESS=pdp10-xkl-tops20 1552219ffec0Smrg ;; 155397e8a2e8Smrg *:TOPS-20:*:*) 1554219ffec0Smrg GUESS=pdp10-unknown-tops20 1555219ffec0Smrg ;; 155697e8a2e8Smrg *:ITS:*:*) 1557219ffec0Smrg GUESS=pdp10-unknown-its 1558219ffec0Smrg ;; 155997e8a2e8Smrg SEI:*:*:SEIUX) 1560219ffec0Smrg GUESS=mips-sei-seiux$UNAME_RELEASE 1561219ffec0Smrg ;; 1562d7accfefSmrg *:DragonFly:*:*) 1563219ffec0Smrg DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 1564219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL 1565219ffec0Smrg ;; 1566d7accfefSmrg *:*VMS:*:*) 156768af480fSmrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 1568219ffec0Smrg case $UNAME_MACHINE in 1569219ffec0Smrg A*) GUESS=alpha-dec-vms ;; 1570219ffec0Smrg I*) GUESS=ia64-dec-vms ;; 1571219ffec0Smrg V*) GUESS=vax-dec-vms ;; 1572d7accfefSmrg esac ;; 1573d7accfefSmrg *:XENIX:*:SysV) 1574219ffec0Smrg GUESS=i386-pc-xenix 1575219ffec0Smrg ;; 1576d7accfefSmrg i*86:skyos:*:*) 1577219ffec0Smrg SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` 1578219ffec0Smrg GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL 1579219ffec0Smrg ;; 1580d7accfefSmrg i*86:rdos:*:*) 1581219ffec0Smrg GUESS=$UNAME_MACHINE-pc-rdos 1582219ffec0Smrg ;; 1583bbfad078Smrg i*86:Fiwix:*:*) 1584bbfad078Smrg GUESS=$UNAME_MACHINE-pc-fiwix 1585bbfad078Smrg ;; 1586219ffec0Smrg *:AROS:*:*) 1587219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-aros 1588219ffec0Smrg ;; 158968af480fSmrg x86_64:VMkernel:*:*) 1590219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-esx 1591219ffec0Smrg ;; 1592219ffec0Smrg amd64:Isilon\ OneFS:*:*) 1593219ffec0Smrg GUESS=x86_64-unknown-onefs 1594219ffec0Smrg ;; 1595219ffec0Smrg *:Unleashed:*:*) 1596219ffec0Smrg GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE 1597219ffec0Smrg ;; 1598bbfad078Smrg *:Ironclad:*:*) 1599bbfad078Smrg GUESS=$UNAME_MACHINE-unknown-ironclad 1600bbfad078Smrg ;; 160197e8a2e8Smrgesac 160297e8a2e8Smrg 1603219ffec0Smrg# Do we have a guess based on uname results? 1604219ffec0Smrgif test "x$GUESS" != x; then 1605219ffec0Smrg echo "$GUESS" 1606219ffec0Smrg exit 1607219ffec0Smrgfi 1608219ffec0Smrg 1609219ffec0Smrg# No uname command or uname output not recognized. 1610219ffec0Smrgset_cc_for_build 1611219ffec0Smrgcat > "$dummy.c" <<EOF 161297e8a2e8Smrg#ifdef _SEQUENT_ 1613219ffec0Smrg#include <sys/types.h> 1614219ffec0Smrg#include <sys/utsname.h> 1615219ffec0Smrg#endif 1616219ffec0Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 1617219ffec0Smrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 1618219ffec0Smrg#include <signal.h> 1619219ffec0Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1620219ffec0Smrg#include <sys/utsname.h> 1621219ffec0Smrg#endif 1622219ffec0Smrg#endif 162397e8a2e8Smrg#endif 162497e8a2e8Smrgmain () 162597e8a2e8Smrg{ 162697e8a2e8Smrg#if defined (sony) 162797e8a2e8Smrg#if defined (MIPSEB) 162897e8a2e8Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 162997e8a2e8Smrg I don't know.... */ 163097e8a2e8Smrg printf ("mips-sony-bsd\n"); exit (0); 163197e8a2e8Smrg#else 163297e8a2e8Smrg#include <sys/param.h> 163397e8a2e8Smrg printf ("m68k-sony-newsos%s\n", 163497e8a2e8Smrg#ifdef NEWSOS4 1635219ffec0Smrg "4" 163697e8a2e8Smrg#else 1637219ffec0Smrg "" 163897e8a2e8Smrg#endif 1639219ffec0Smrg ); exit (0); 164097e8a2e8Smrg#endif 164197e8a2e8Smrg#endif 164297e8a2e8Smrg 164397e8a2e8Smrg#if defined (NeXT) 164497e8a2e8Smrg#if !defined (__ARCHITECTURE__) 164597e8a2e8Smrg#define __ARCHITECTURE__ "m68k" 164697e8a2e8Smrg#endif 164797e8a2e8Smrg int version; 164897e8a2e8Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 164997e8a2e8Smrg if (version < 4) 165097e8a2e8Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 165197e8a2e8Smrg else 165297e8a2e8Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 165397e8a2e8Smrg exit (0); 165497e8a2e8Smrg#endif 165597e8a2e8Smrg 165697e8a2e8Smrg#if defined (MULTIMAX) || defined (n16) 165797e8a2e8Smrg#if defined (UMAXV) 165897e8a2e8Smrg printf ("ns32k-encore-sysv\n"); exit (0); 165997e8a2e8Smrg#else 166097e8a2e8Smrg#if defined (CMU) 166197e8a2e8Smrg printf ("ns32k-encore-mach\n"); exit (0); 166297e8a2e8Smrg#else 166397e8a2e8Smrg printf ("ns32k-encore-bsd\n"); exit (0); 166497e8a2e8Smrg#endif 166597e8a2e8Smrg#endif 166697e8a2e8Smrg#endif 166797e8a2e8Smrg 166897e8a2e8Smrg#if defined (__386BSD__) 166997e8a2e8Smrg printf ("i386-pc-bsd\n"); exit (0); 167097e8a2e8Smrg#endif 167197e8a2e8Smrg 167297e8a2e8Smrg#if defined (sequent) 167397e8a2e8Smrg#if defined (i386) 167497e8a2e8Smrg printf ("i386-sequent-dynix\n"); exit (0); 167597e8a2e8Smrg#endif 167697e8a2e8Smrg#if defined (ns32000) 167797e8a2e8Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 167897e8a2e8Smrg#endif 167997e8a2e8Smrg#endif 168097e8a2e8Smrg 168197e8a2e8Smrg#if defined (_SEQUENT_) 1682219ffec0Smrg struct utsname un; 168397e8a2e8Smrg 1684219ffec0Smrg uname(&un); 1685219ffec0Smrg if (strncmp(un.version, "V2", 2) == 0) { 1686219ffec0Smrg printf ("i386-sequent-ptx2\n"); exit (0); 1687219ffec0Smrg } 1688219ffec0Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1689219ffec0Smrg printf ("i386-sequent-ptx1\n"); exit (0); 1690219ffec0Smrg } 1691219ffec0Smrg printf ("i386-sequent-ptx\n"); exit (0); 169297e8a2e8Smrg#endif 169397e8a2e8Smrg 169497e8a2e8Smrg#if defined (vax) 1695219ffec0Smrg#if !defined (ultrix) 1696219ffec0Smrg#include <sys/param.h> 1697219ffec0Smrg#if defined (BSD) 1698219ffec0Smrg#if BSD == 43 1699219ffec0Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 1700219ffec0Smrg#else 1701219ffec0Smrg#if BSD == 199006 1702219ffec0Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 1703219ffec0Smrg#else 1704219ffec0Smrg printf ("vax-dec-bsd\n"); exit (0); 1705219ffec0Smrg#endif 1706219ffec0Smrg#endif 1707219ffec0Smrg#else 1708219ffec0Smrg printf ("vax-dec-bsd\n"); exit (0); 1709219ffec0Smrg#endif 1710219ffec0Smrg#else 1711219ffec0Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1712219ffec0Smrg struct utsname un; 1713219ffec0Smrg uname (&un); 1714219ffec0Smrg printf ("vax-dec-ultrix%s\n", un.release); exit (0); 1715219ffec0Smrg#else 1716219ffec0Smrg printf ("vax-dec-ultrix\n"); exit (0); 1717219ffec0Smrg#endif 1718219ffec0Smrg#endif 1719219ffec0Smrg#endif 1720219ffec0Smrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 1721219ffec0Smrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 1722219ffec0Smrg#if defined(_SIZE_T_) || defined(SIGLOST) 1723219ffec0Smrg struct utsname *un; 1724219ffec0Smrg uname (&un); 1725219ffec0Smrg printf ("mips-dec-ultrix%s\n", un.release); exit (0); 1726219ffec0Smrg#else 1727219ffec0Smrg printf ("mips-dec-ultrix\n"); exit (0); 1728219ffec0Smrg#endif 1729219ffec0Smrg#endif 173097e8a2e8Smrg#endif 173197e8a2e8Smrg 173297e8a2e8Smrg#if defined (alliant) && defined (i860) 173397e8a2e8Smrg printf ("i860-alliant-bsd\n"); exit (0); 173497e8a2e8Smrg#endif 173597e8a2e8Smrg 173697e8a2e8Smrg exit (1); 173797e8a2e8Smrg} 173897e8a2e8SmrgEOF 173997e8a2e8Smrg 1740219ffec0Smrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && 1741d7accfefSmrg { echo "$SYSTEM_NAME"; exit; } 174297e8a2e8Smrg 174397e8a2e8Smrg# Apollos put the system type in the environment. 1744219ffec0Smrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } 174597e8a2e8Smrg 1746219ffec0Smrgecho "$0: unable to guess system type" >&2 174797e8a2e8Smrg 1748219ffec0Smrgcase $UNAME_MACHINE:$UNAME_SYSTEM in 1749219ffec0Smrg mips:Linux | mips64:Linux) 1750219ffec0Smrg # If we got here on MIPS GNU/Linux, output extra information. 1751219ffec0Smrg cat >&2 <<EOF 175297e8a2e8Smrg 1753219ffec0SmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize 1754219ffec0Smrgthe system type. Please install a C compiler and try again. 1755219ffec0SmrgEOF 1756219ffec0Smrg ;; 1757219ffec0Smrgesac 175897e8a2e8Smrg 175997e8a2e8Smrgcat >&2 <<EOF 176097e8a2e8Smrg 1761219ffec0SmrgThis script (version $timestamp), has failed to recognize the 1762219ffec0Smrgoperating system you are using. If your script is old, overwrite *all* 1763219ffec0Smrgcopies of config.guess and config.sub with the latest versions from: 176497e8a2e8Smrg 1765219ffec0Smrg https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 1766d7accfefSmrgand 1767219ffec0Smrg https://git.savannah.gnu.org/cgit/config.git/plain/config.sub 1768219ffec0SmrgEOF 176997e8a2e8Smrg 1770219ffec0Smrgour_year=`echo $timestamp | sed 's,-.*,,'` 1771219ffec0Smrgthisyear=`date +%Y` 1772219ffec0Smrg# shellcheck disable=SC2003 1773219ffec0Smrgscript_age=`expr "$thisyear" - "$our_year"` 1774219ffec0Smrgif test "$script_age" -lt 3 ; then 1775219ffec0Smrg cat >&2 <<EOF 1776219ffec0Smrg 1777219ffec0SmrgIf $0 has already been updated, send the following data and any 1778219ffec0Smrginformation you think might be pertinent to config-patches@gnu.org to 1779219ffec0Smrgprovide the necessary information to handle your system. 178097e8a2e8Smrg 178197e8a2e8Smrgconfig.guess timestamp = $timestamp 178297e8a2e8Smrg 178397e8a2e8Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 178497e8a2e8Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 178597e8a2e8Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 178697e8a2e8Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 178797e8a2e8Smrg 178897e8a2e8Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 178997e8a2e8Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 179097e8a2e8Smrg 179197e8a2e8Smrghostinfo = `(hostinfo) 2>/dev/null` 179297e8a2e8Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 179397e8a2e8Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 179497e8a2e8Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 179597e8a2e8Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 179697e8a2e8Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 179797e8a2e8Smrg 1798219ffec0SmrgUNAME_MACHINE = "$UNAME_MACHINE" 1799219ffec0SmrgUNAME_RELEASE = "$UNAME_RELEASE" 1800219ffec0SmrgUNAME_SYSTEM = "$UNAME_SYSTEM" 1801219ffec0SmrgUNAME_VERSION = "$UNAME_VERSION" 180297e8a2e8SmrgEOF 1803219ffec0Smrgfi 180497e8a2e8Smrg 180597e8a2e8Smrgexit 1 180697e8a2e8Smrg 180797e8a2e8Smrg# Local variables: 1808219ffec0Smrg# eval: (add-hook 'before-save-hook 'time-stamp) 180997e8a2e8Smrg# time-stamp-start: "timestamp='" 181097e8a2e8Smrg# time-stamp-format: "%:y-%02m-%02d" 181197e8a2e8Smrg# time-stamp-end: "'" 181297e8a2e8Smrg# End: 1813