config.guess revision e9f7eabc
150806d53Smrg#! /bin/sh 250806d53Smrg# Attempt to guess a canonical system name. 3e9f7eabcSmrg# Copyright 1992-2023 Free Software Foundation, Inc. 450806d53Smrg 5e9f7eabcSmrg# shellcheck disable=SC2006,SC2268 # see below for rationale 6e9f7eabcSmrg 7e9f7eabcSmrgtimestamp='2023-01-01' 850806d53Smrg 950806d53Smrg# This file is free software; you can redistribute it and/or modify it 1050806d53Smrg# under the terms of the GNU General Public License as published by 11e9f7eabcSmrg# the Free Software Foundation, either version 3 of the License, or 1250806d53Smrg# (at your option) any later version. 1350806d53Smrg# 1450806d53Smrg# This program is distributed in the hope that it will be useful, but 1550806d53Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1650806d53Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1750806d53Smrg# General Public License for more details. 1850806d53Smrg# 1950806d53Smrg# You should have received a copy of the GNU General Public License 20e9f7eabcSmrg# along with this program; if not, see <https://www.gnu.org/licenses/>. 2150806d53Smrg# 2250806d53Smrg# As a special exception to the GNU General Public License, if you 2350806d53Smrg# distribute this file as part of a program that contains a 2450806d53Smrg# configuration script generated by Autoconf, you may include it under 254a8d91dcSmrg# the same distribution terms that you use for the rest of that 264a8d91dcSmrg# program. This Exception is an additional permission under section 7 274a8d91dcSmrg# of the GNU General Public License, version 3 ("GPLv3"). 2850806d53Smrg# 294a8d91dcSmrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 3050806d53Smrg# 31a73423d7Smrg# You can get the latest version of this script from: 32e9f7eabcSmrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 334a8d91dcSmrg# 344a8d91dcSmrg# Please send patches to <config-patches@gnu.org>. 354a8d91dcSmrg 3650806d53Smrg 37e9f7eabcSmrg# The "shellcheck disable" line above the timestamp inhibits complaints 38e9f7eabcSmrg# about features and limitations of the classic Bourne shell that were 39e9f7eabcSmrg# superseded or lifted in POSIX. However, this script identifies a wide 40e9f7eabcSmrg# variety of pre-POSIX systems that do not have POSIX shells at all, and 41e9f7eabcSmrg# even some reasonably current systems (Solaris 10 as case-in-point) still 42e9f7eabcSmrg# have a pre-POSIX /bin/sh. 43e9f7eabcSmrg 44e9f7eabcSmrg 4550806d53Smrgme=`echo "$0" | sed -e 's,.*/,,'` 4650806d53Smrg 4750806d53Smrgusage="\ 4850806d53SmrgUsage: $0 [OPTION] 4950806d53Smrg 5050806d53SmrgOutput the configuration name of the system \`$me' is run on. 5150806d53Smrg 52e9f7eabcSmrgOptions: 5350806d53Smrg -h, --help print this help, then exit 5450806d53Smrg -t, --time-stamp print date of last modification, then exit 5550806d53Smrg -v, --version print version number, then exit 5650806d53Smrg 5750806d53SmrgReport bugs and patches to <config-patches@gnu.org>." 5850806d53Smrg 5950806d53Smrgversion="\ 6050806d53SmrgGNU config.guess ($timestamp) 6150806d53Smrg 6250806d53SmrgOriginally written by Per Bothner. 63e9f7eabcSmrgCopyright 1992-2023 Free Software Foundation, Inc. 6450806d53Smrg 6550806d53SmrgThis is free software; see the source for copying conditions. There is NO 6650806d53Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6750806d53Smrg 6850806d53Smrghelp=" 6950806d53SmrgTry \`$me --help' for more information." 7050806d53Smrg 7150806d53Smrg# Parse command line 7250806d53Smrgwhile test $# -gt 0 ; do 7350806d53Smrg case $1 in 7450806d53Smrg --time-stamp | --time* | -t ) 757965d9acSmrg echo "$timestamp" ; exit ;; 7650806d53Smrg --version | -v ) 777965d9acSmrg echo "$version" ; exit ;; 7850806d53Smrg --help | --h* | -h ) 797965d9acSmrg echo "$usage"; exit ;; 8050806d53Smrg -- ) # Stop option processing 8150806d53Smrg shift; break ;; 8250806d53Smrg - ) # Use stdin as input. 8350806d53Smrg break ;; 8450806d53Smrg -* ) 8550806d53Smrg echo "$me: invalid option $1$help" >&2 8650806d53Smrg exit 1 ;; 8750806d53Smrg * ) 8850806d53Smrg break ;; 8950806d53Smrg esac 9050806d53Smrgdone 9150806d53Smrg 9250806d53Smrgif test $# != 0; then 9350806d53Smrg echo "$me: too many arguments$help" >&2 9450806d53Smrg exit 1 9550806d53Smrgfi 9650806d53Smrg 97e9f7eabcSmrg# Just in case it came from the environment. 98e9f7eabcSmrgGUESS= 9950806d53Smrg 10050806d53Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 10150806d53Smrg# compiler to aid in system detection is discouraged as it requires 10250806d53Smrg# temporary files to be created and, as you can see below, it is a 10350806d53Smrg# headache to deal with in a portable fashion. 10450806d53Smrg 10550806d53Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 10650806d53Smrg# use `HOST_CC' if defined, but it is deprecated. 10750806d53Smrg 10850806d53Smrg# Portable tmp directory creation inspired by the Autoconf team. 10950806d53Smrg 110e9f7eabcSmrgtmp= 111e9f7eabcSmrg# shellcheck disable=SC2172 112e9f7eabcSmrgtrap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 113e9f7eabcSmrg 114e9f7eabcSmrgset_cc_for_build() { 115e9f7eabcSmrg # prevent multiple calls if $tmp is already set 116e9f7eabcSmrg test "$tmp" && return 0 117e9f7eabcSmrg : "${TMPDIR=/tmp}" 118e9f7eabcSmrg # shellcheck disable=SC2039,SC3028 119e9f7eabcSmrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 120e9f7eabcSmrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || 121e9f7eabcSmrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || 122e9f7eabcSmrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } 123e9f7eabcSmrg dummy=$tmp/dummy 124e9f7eabcSmrg case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in 125e9f7eabcSmrg ,,) echo "int x;" > "$dummy.c" 126e9f7eabcSmrg for driver in cc gcc c89 c99 ; do 127e9f7eabcSmrg if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then 128e9f7eabcSmrg CC_FOR_BUILD=$driver 129e9f7eabcSmrg break 130e9f7eabcSmrg fi 131e9f7eabcSmrg done 132e9f7eabcSmrg if test x"$CC_FOR_BUILD" = x ; then 133e9f7eabcSmrg CC_FOR_BUILD=no_compiler_found 134e9f7eabcSmrg fi 135e9f7eabcSmrg ;; 136e9f7eabcSmrg ,,*) CC_FOR_BUILD=$CC ;; 137e9f7eabcSmrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 138e9f7eabcSmrg esac 139e9f7eabcSmrg} 14050806d53Smrg 14150806d53Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 14250806d53Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 143e9f7eabcSmrgif test -f /.attbin/uname ; then 14450806d53Smrg PATH=$PATH:/.attbin ; export PATH 14550806d53Smrgfi 14650806d53Smrg 14750806d53SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 14850806d53SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 149e9f7eabcSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 15050806d53SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 15150806d53Smrg 152e9f7eabcSmrgcase $UNAME_SYSTEM in 1534a8d91dcSmrgLinux|GNU|GNU/*) 154e9f7eabcSmrg LIBC=unknown 1554a8d91dcSmrg 156e9f7eabcSmrg set_cc_for_build 157e9f7eabcSmrg cat <<-EOF > "$dummy.c" 1584a8d91dcSmrg #include <features.h> 1594a8d91dcSmrg #if defined(__UCLIBC__) 1604a8d91dcSmrg LIBC=uclibc 1614a8d91dcSmrg #elif defined(__dietlibc__) 1624a8d91dcSmrg LIBC=dietlibc 163e9f7eabcSmrg #elif defined(__GLIBC__) 1644a8d91dcSmrg LIBC=gnu 165e9f7eabcSmrg #else 166e9f7eabcSmrg #include <stdarg.h> 167e9f7eabcSmrg /* First heuristic to detect musl libc. */ 168e9f7eabcSmrg #ifdef __DEFINED_va_list 169e9f7eabcSmrg LIBC=musl 170e9f7eabcSmrg #endif 1714a8d91dcSmrg #endif 1724a8d91dcSmrg EOF 173e9f7eabcSmrg cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` 174e9f7eabcSmrg eval "$cc_set_libc" 175e9f7eabcSmrg 176e9f7eabcSmrg # Second heuristic to detect musl libc. 177e9f7eabcSmrg if [ "$LIBC" = unknown ] && 178e9f7eabcSmrg command -v ldd >/dev/null && 179e9f7eabcSmrg ldd --version 2>&1 | grep -q ^musl; then 180e9f7eabcSmrg LIBC=musl 181e9f7eabcSmrg fi 182e9f7eabcSmrg 183e9f7eabcSmrg # If the system lacks a compiler, then just pick glibc. 184e9f7eabcSmrg # We could probably try harder. 185e9f7eabcSmrg if [ "$LIBC" = unknown ]; then 186e9f7eabcSmrg LIBC=gnu 187e9f7eabcSmrg fi 1884a8d91dcSmrg ;; 1894a8d91dcSmrgesac 1904a8d91dcSmrg 19150806d53Smrg# Note: order is significant - the case branches are not exclusive. 19250806d53Smrg 193e9f7eabcSmrgcase $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in 19450806d53Smrg *:NetBSD:*:*) 19550806d53Smrg # NetBSD (nbsd) targets should (where applicable) match one or 196a73423d7Smrg # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 19750806d53Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 19850806d53Smrg # switched to ELF, *-*-netbsd* would select the old 19950806d53Smrg # object file format. This provides both forward 20050806d53Smrg # compatibility and a consistent mechanism for selecting the 20150806d53Smrg # object file format. 20250806d53Smrg # 20350806d53Smrg # Note: NetBSD doesn't particularly care about the vendor 20450806d53Smrg # portion of the name. We always set it to "unknown". 2054a8d91dcSmrg UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ 206e9f7eabcSmrg /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 207e9f7eabcSmrg /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ 2084a8d91dcSmrg echo unknown)` 209e9f7eabcSmrg case $UNAME_MACHINE_ARCH in 210e9f7eabcSmrg aarch64eb) machine=aarch64_be-unknown ;; 21150806d53Smrg armeb) machine=armeb-unknown ;; 21250806d53Smrg arm*) machine=arm-unknown ;; 21350806d53Smrg sh3el) machine=shl-unknown ;; 21450806d53Smrg sh3eb) machine=sh-unknown ;; 2157965d9acSmrg sh5el) machine=sh5le-unknown ;; 2164a8d91dcSmrg earmv*) 217e9f7eabcSmrg arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` 218e9f7eabcSmrg endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` 2194a8d91dcSmrg machine=${arch}${endian}-unknown 2204a8d91dcSmrg ;; 221e9f7eabcSmrg *) machine=$UNAME_MACHINE_ARCH-unknown ;; 22250806d53Smrg esac 22350806d53Smrg # The Operating System including object format, if it has switched 224e9f7eabcSmrg # to ELF recently (or will in the future) and ABI. 225e9f7eabcSmrg case $UNAME_MACHINE_ARCH in 226e9f7eabcSmrg earm*) 227e9f7eabcSmrg os=netbsdelf 228e9f7eabcSmrg ;; 229e9f7eabcSmrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 230e9f7eabcSmrg set_cc_for_build 23150806d53Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 232a73423d7Smrg | grep -q __ELF__ 23350806d53Smrg then 23450806d53Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 23550806d53Smrg # Return netbsd for either. FIX? 23650806d53Smrg os=netbsd 23750806d53Smrg else 23850806d53Smrg os=netbsdelf 23950806d53Smrg fi 24050806d53Smrg ;; 24150806d53Smrg *) 242a73423d7Smrg os=netbsd 24350806d53Smrg ;; 24450806d53Smrg esac 2454a8d91dcSmrg # Determine ABI tags. 246e9f7eabcSmrg case $UNAME_MACHINE_ARCH in 2474a8d91dcSmrg earm*) 2484a8d91dcSmrg expr='s/^earmv[0-9]/-eabi/;s/eb$//' 249e9f7eabcSmrg abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` 2504a8d91dcSmrg ;; 2514a8d91dcSmrg esac 25250806d53Smrg # The OS release 25350806d53Smrg # Debian GNU/NetBSD machines have a different userland, and 25450806d53Smrg # thus, need a distinct triplet. However, they do not need 25550806d53Smrg # kernel version information, so it can be replaced with a 25650806d53Smrg # suitable tag, in the style of linux-gnu. 257e9f7eabcSmrg case $UNAME_VERSION in 25850806d53Smrg Debian*) 25950806d53Smrg release='-gnu' 26050806d53Smrg ;; 26150806d53Smrg *) 262e9f7eabcSmrg release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` 26350806d53Smrg ;; 26450806d53Smrg esac 26550806d53Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 26650806d53Smrg # contains redundant information, the shorter form: 26750806d53Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 268e9f7eabcSmrg GUESS=$machine-${os}${release}${abi-} 269e9f7eabcSmrg ;; 2704a8d91dcSmrg *:Bitrig:*:*) 2714a8d91dcSmrg UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 272e9f7eabcSmrg GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE 273e9f7eabcSmrg ;; 27450806d53Smrg *:OpenBSD:*:*) 2757965d9acSmrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 276e9f7eabcSmrg GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE 277e9f7eabcSmrg ;; 278e9f7eabcSmrg *:SecBSD:*:*) 279e9f7eabcSmrg UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` 280e9f7eabcSmrg GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE 281e9f7eabcSmrg ;; 282e9f7eabcSmrg *:LibertyBSD:*:*) 283e9f7eabcSmrg UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` 284e9f7eabcSmrg GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE 285e9f7eabcSmrg ;; 286e9f7eabcSmrg *:MidnightBSD:*:*) 287e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE 288e9f7eabcSmrg ;; 2897965d9acSmrg *:ekkoBSD:*:*) 290e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE 291e9f7eabcSmrg ;; 2927965d9acSmrg *:SolidBSD:*:*) 293e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE 294e9f7eabcSmrg ;; 295e9f7eabcSmrg *:OS108:*:*) 296e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE 297e9f7eabcSmrg ;; 2987965d9acSmrg macppc:MirBSD:*:*) 299e9f7eabcSmrg GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE 300e9f7eabcSmrg ;; 3017965d9acSmrg *:MirBSD:*:*) 302e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE 303e9f7eabcSmrg ;; 3044a8d91dcSmrg *:Sortix:*:*) 305e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-sortix 306e9f7eabcSmrg ;; 307e9f7eabcSmrg *:Twizzler:*:*) 308e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-twizzler 309e9f7eabcSmrg ;; 310e9f7eabcSmrg *:Redox:*:*) 311e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-redox 312e9f7eabcSmrg ;; 313e9f7eabcSmrg mips:OSF1:*.*) 314e9f7eabcSmrg GUESS=mips-dec-osf1 315e9f7eabcSmrg ;; 31650806d53Smrg alpha:OSF1:*:*) 317e9f7eabcSmrg # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 318e9f7eabcSmrg trap '' 0 3197965d9acSmrg case $UNAME_RELEASE in 3207965d9acSmrg *4.0) 32150806d53Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 3227965d9acSmrg ;; 3237965d9acSmrg *5.*) 324a73423d7Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 3257965d9acSmrg ;; 3267965d9acSmrg esac 32750806d53Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 32850806d53Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 32950806d53Smrg # covers most systems running today. This code pipes the CPU 33050806d53Smrg # types through head -n 1, so we only detect the type of CPU 0. 33150806d53Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 332e9f7eabcSmrg case $ALPHA_CPU_TYPE in 33350806d53Smrg "EV4 (21064)") 334e9f7eabcSmrg UNAME_MACHINE=alpha ;; 33550806d53Smrg "EV4.5 (21064)") 336e9f7eabcSmrg UNAME_MACHINE=alpha ;; 33750806d53Smrg "LCA4 (21066/21068)") 338e9f7eabcSmrg UNAME_MACHINE=alpha ;; 33950806d53Smrg "EV5 (21164)") 340e9f7eabcSmrg UNAME_MACHINE=alphaev5 ;; 34150806d53Smrg "EV5.6 (21164A)") 342e9f7eabcSmrg UNAME_MACHINE=alphaev56 ;; 34350806d53Smrg "EV5.6 (21164PC)") 344e9f7eabcSmrg UNAME_MACHINE=alphapca56 ;; 34550806d53Smrg "EV5.7 (21164PC)") 346e9f7eabcSmrg UNAME_MACHINE=alphapca57 ;; 34750806d53Smrg "EV6 (21264)") 348e9f7eabcSmrg UNAME_MACHINE=alphaev6 ;; 34950806d53Smrg "EV6.7 (21264A)") 350e9f7eabcSmrg UNAME_MACHINE=alphaev67 ;; 35150806d53Smrg "EV6.8CB (21264C)") 352e9f7eabcSmrg UNAME_MACHINE=alphaev68 ;; 35350806d53Smrg "EV6.8AL (21264B)") 354e9f7eabcSmrg UNAME_MACHINE=alphaev68 ;; 35550806d53Smrg "EV6.8CX (21264D)") 356e9f7eabcSmrg UNAME_MACHINE=alphaev68 ;; 35750806d53Smrg "EV6.9A (21264/EV69A)") 358e9f7eabcSmrg UNAME_MACHINE=alphaev69 ;; 35950806d53Smrg "EV7 (21364)") 360e9f7eabcSmrg UNAME_MACHINE=alphaev7 ;; 36150806d53Smrg "EV7.9 (21364A)") 362e9f7eabcSmrg UNAME_MACHINE=alphaev79 ;; 36350806d53Smrg esac 3647965d9acSmrg # A Pn.n version is a patched version. 36550806d53Smrg # A Vn.n version is a released version. 36650806d53Smrg # A Tn.n version is a released field test version. 36750806d53Smrg # A Xn.n version is an unreleased experimental baselevel. 36850806d53Smrg # 1.2 uses "1.2" for uname -r. 369e9f7eabcSmrg OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 370e9f7eabcSmrg GUESS=$UNAME_MACHINE-dec-osf$OSF_REL 371e9f7eabcSmrg ;; 37250806d53Smrg Amiga*:UNIX_System_V:4.0:*) 373e9f7eabcSmrg GUESS=m68k-unknown-sysv4 374e9f7eabcSmrg ;; 37550806d53Smrg *:[Aa]miga[Oo][Ss]:*:*) 376e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-amigaos 377e9f7eabcSmrg ;; 37850806d53Smrg *:[Mm]orph[Oo][Ss]:*:*) 379e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-morphos 380e9f7eabcSmrg ;; 38150806d53Smrg *:OS/390:*:*) 382e9f7eabcSmrg GUESS=i370-ibm-openedition 383e9f7eabcSmrg ;; 3847965d9acSmrg *:z/VM:*:*) 385e9f7eabcSmrg GUESS=s390-ibm-zvmoe 386e9f7eabcSmrg ;; 3877965d9acSmrg *:OS400:*:*) 388e9f7eabcSmrg GUESS=powerpc-ibm-os400 389e9f7eabcSmrg ;; 39050806d53Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 391e9f7eabcSmrg GUESS=arm-acorn-riscix$UNAME_RELEASE 392e9f7eabcSmrg ;; 3934a8d91dcSmrg arm*:riscos:*:*|arm*:RISCOS:*:*) 394e9f7eabcSmrg GUESS=arm-unknown-riscos 395e9f7eabcSmrg ;; 39650806d53Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 397e9f7eabcSmrg GUESS=hppa1.1-hitachi-hiuxmpp 398e9f7eabcSmrg ;; 39950806d53Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 40050806d53Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 401e9f7eabcSmrg case `(/bin/universe) 2>/dev/null` in 402e9f7eabcSmrg att) GUESS=pyramid-pyramid-sysv3 ;; 403e9f7eabcSmrg *) GUESS=pyramid-pyramid-bsd ;; 404e9f7eabcSmrg esac 405e9f7eabcSmrg ;; 40650806d53Smrg NILE*:*:*:dcosx) 407e9f7eabcSmrg GUESS=pyramid-pyramid-svr4 408e9f7eabcSmrg ;; 40950806d53Smrg DRS?6000:unix:4.0:6*) 410e9f7eabcSmrg GUESS=sparc-icl-nx6 411e9f7eabcSmrg ;; 4127965d9acSmrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 41350806d53Smrg case `/usr/bin/uname -p` in 414e9f7eabcSmrg sparc) GUESS=sparc-icl-nx7 ;; 415e9f7eabcSmrg esac 416e9f7eabcSmrg ;; 417a73423d7Smrg s390x:SunOS:*:*) 418e9f7eabcSmrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 419e9f7eabcSmrg GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL 420e9f7eabcSmrg ;; 42150806d53Smrg sun4H:SunOS:5.*:*) 422e9f7eabcSmrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 423e9f7eabcSmrg GUESS=sparc-hal-solaris2$SUN_REL 424e9f7eabcSmrg ;; 42550806d53Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 426e9f7eabcSmrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 427e9f7eabcSmrg GUESS=sparc-sun-solaris2$SUN_REL 428e9f7eabcSmrg ;; 429a73423d7Smrg i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 430e9f7eabcSmrg GUESS=i386-pc-auroraux$UNAME_RELEASE 431e9f7eabcSmrg ;; 4327965d9acSmrg i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 433e9f7eabcSmrg set_cc_for_build 434e9f7eabcSmrg SUN_ARCH=i386 435b3e38ee4Smrg # If there is a compiler, see if it is configured for 64-bit objects. 436b3e38ee4Smrg # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 437b3e38ee4Smrg # This test works for both compilers. 438e9f7eabcSmrg if test "$CC_FOR_BUILD" != no_compiler_found; then 439a73423d7Smrg if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 440e9f7eabcSmrg (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ 441b3e38ee4Smrg grep IS_64BIT_ARCH >/dev/null 442b3e38ee4Smrg then 443e9f7eabcSmrg SUN_ARCH=x86_64 444b3e38ee4Smrg fi 445b3e38ee4Smrg fi 446e9f7eabcSmrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 447e9f7eabcSmrg GUESS=$SUN_ARCH-pc-solaris2$SUN_REL 448e9f7eabcSmrg ;; 44950806d53Smrg sun4*:SunOS:6*:*) 45050806d53Smrg # According to config.sub, this is the proper way to canonicalize 45150806d53Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 45250806d53Smrg # it's likely to be more like Solaris than SunOS4. 453e9f7eabcSmrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 454e9f7eabcSmrg GUESS=sparc-sun-solaris3$SUN_REL 455e9f7eabcSmrg ;; 45650806d53Smrg sun4*:SunOS:*:*) 457e9f7eabcSmrg case `/usr/bin/arch -k` in 45850806d53Smrg Series*|S4*) 45950806d53Smrg UNAME_RELEASE=`uname -v` 46050806d53Smrg ;; 46150806d53Smrg esac 46250806d53Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 463e9f7eabcSmrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` 464e9f7eabcSmrg GUESS=sparc-sun-sunos$SUN_REL 465e9f7eabcSmrg ;; 46650806d53Smrg sun3*:SunOS:*:*) 467e9f7eabcSmrg GUESS=m68k-sun-sunos$UNAME_RELEASE 468e9f7eabcSmrg ;; 46950806d53Smrg sun*:*:4.2BSD:*) 47050806d53Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 471e9f7eabcSmrg test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 472e9f7eabcSmrg case `/bin/arch` in 47350806d53Smrg sun3) 474e9f7eabcSmrg GUESS=m68k-sun-sunos$UNAME_RELEASE 47550806d53Smrg ;; 47650806d53Smrg sun4) 477e9f7eabcSmrg GUESS=sparc-sun-sunos$UNAME_RELEASE 47850806d53Smrg ;; 47950806d53Smrg esac 480e9f7eabcSmrg ;; 48150806d53Smrg aushp:SunOS:*:*) 482e9f7eabcSmrg GUESS=sparc-auspex-sunos$UNAME_RELEASE 483e9f7eabcSmrg ;; 48450806d53Smrg # The situation for MiNT is a little confusing. The machine name 48550806d53Smrg # can be virtually everything (everything which is not 48650806d53Smrg # "atarist" or "atariste" at least should have a processor 48750806d53Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 48850806d53Smrg # to the lowercase version "mint" (or "freemint"). Finally 48950806d53Smrg # the system name "TOS" denotes a system which is actually not 49050806d53Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 49150806d53Smrg # be no problem. 49250806d53Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 493e9f7eabcSmrg GUESS=m68k-atari-mint$UNAME_RELEASE 494e9f7eabcSmrg ;; 49550806d53Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 496e9f7eabcSmrg GUESS=m68k-atari-mint$UNAME_RELEASE 497e9f7eabcSmrg ;; 49850806d53Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 499e9f7eabcSmrg GUESS=m68k-atari-mint$UNAME_RELEASE 500e9f7eabcSmrg ;; 50150806d53Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 502e9f7eabcSmrg GUESS=m68k-milan-mint$UNAME_RELEASE 503e9f7eabcSmrg ;; 50450806d53Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 505e9f7eabcSmrg GUESS=m68k-hades-mint$UNAME_RELEASE 506e9f7eabcSmrg ;; 50750806d53Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 508e9f7eabcSmrg GUESS=m68k-unknown-mint$UNAME_RELEASE 509e9f7eabcSmrg ;; 5107965d9acSmrg m68k:machten:*:*) 511e9f7eabcSmrg GUESS=m68k-apple-machten$UNAME_RELEASE 512e9f7eabcSmrg ;; 51350806d53Smrg powerpc:machten:*:*) 514e9f7eabcSmrg GUESS=powerpc-apple-machten$UNAME_RELEASE 515e9f7eabcSmrg ;; 51650806d53Smrg RISC*:Mach:*:*) 517e9f7eabcSmrg GUESS=mips-dec-mach_bsd4.3 518e9f7eabcSmrg ;; 51950806d53Smrg RISC*:ULTRIX:*:*) 520e9f7eabcSmrg GUESS=mips-dec-ultrix$UNAME_RELEASE 521e9f7eabcSmrg ;; 52250806d53Smrg VAX*:ULTRIX*:*:*) 523e9f7eabcSmrg GUESS=vax-dec-ultrix$UNAME_RELEASE 524e9f7eabcSmrg ;; 52550806d53Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 526e9f7eabcSmrg GUESS=clipper-intergraph-clix$UNAME_RELEASE 527e9f7eabcSmrg ;; 52850806d53Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 529e9f7eabcSmrg set_cc_for_build 530e9f7eabcSmrg sed 's/^ //' << EOF > "$dummy.c" 53150806d53Smrg#ifdef __cplusplus 53250806d53Smrg#include <stdio.h> /* for printf() prototype */ 53350806d53Smrg int main (int argc, char *argv[]) { 53450806d53Smrg#else 53550806d53Smrg int main (argc, argv) int argc; char *argv[]; { 53650806d53Smrg#endif 53750806d53Smrg #if defined (host_mips) && defined (MIPSEB) 53850806d53Smrg #if defined (SYSTYPE_SYSV) 539e9f7eabcSmrg printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); 54050806d53Smrg #endif 54150806d53Smrg #if defined (SYSTYPE_SVR4) 542e9f7eabcSmrg printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); 54350806d53Smrg #endif 54450806d53Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 545e9f7eabcSmrg printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); 54650806d53Smrg #endif 54750806d53Smrg #endif 54850806d53Smrg exit (-1); 54950806d53Smrg } 55050806d53SmrgEOF 551e9f7eabcSmrg $CC_FOR_BUILD -o "$dummy" "$dummy.c" && 552e9f7eabcSmrg dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && 553e9f7eabcSmrg SYSTEM_NAME=`"$dummy" "$dummyarg"` && 5547965d9acSmrg { echo "$SYSTEM_NAME"; exit; } 555e9f7eabcSmrg GUESS=mips-mips-riscos$UNAME_RELEASE 556e9f7eabcSmrg ;; 55750806d53Smrg Motorola:PowerMAX_OS:*:*) 558e9f7eabcSmrg GUESS=powerpc-motorola-powermax 559e9f7eabcSmrg ;; 56050806d53Smrg Motorola:*:4.3:PL8-*) 561e9f7eabcSmrg GUESS=powerpc-harris-powermax 562e9f7eabcSmrg ;; 56350806d53Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 564e9f7eabcSmrg GUESS=powerpc-harris-powermax 565e9f7eabcSmrg ;; 56650806d53Smrg Night_Hawk:Power_UNIX:*:*) 567e9f7eabcSmrg GUESS=powerpc-harris-powerunix 568e9f7eabcSmrg ;; 56950806d53Smrg m88k:CX/UX:7*:*) 570e9f7eabcSmrg GUESS=m88k-harris-cxux7 571e9f7eabcSmrg ;; 57250806d53Smrg m88k:*:4*:R4*) 573e9f7eabcSmrg GUESS=m88k-motorola-sysv4 574e9f7eabcSmrg ;; 57550806d53Smrg m88k:*:3*:R3*) 576e9f7eabcSmrg GUESS=m88k-motorola-sysv3 577e9f7eabcSmrg ;; 57850806d53Smrg AViiON:dgux:*:*) 579a73423d7Smrg # DG/UX returns AViiON for all architectures 580a73423d7Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 581e9f7eabcSmrg if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 58250806d53Smrg then 583e9f7eabcSmrg if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ 584e9f7eabcSmrg test "$TARGET_BINARY_INTERFACE"x = x 58550806d53Smrg then 586e9f7eabcSmrg GUESS=m88k-dg-dgux$UNAME_RELEASE 58750806d53Smrg else 588e9f7eabcSmrg GUESS=m88k-dg-dguxbcs$UNAME_RELEASE 58950806d53Smrg fi 59050806d53Smrg else 591e9f7eabcSmrg GUESS=i586-dg-dgux$UNAME_RELEASE 59250806d53Smrg fi 593e9f7eabcSmrg ;; 59450806d53Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 595e9f7eabcSmrg GUESS=m88k-dolphin-sysv3 596e9f7eabcSmrg ;; 59750806d53Smrg M88*:*:R3*:*) 59850806d53Smrg # Delta 88k system running SVR3 599e9f7eabcSmrg GUESS=m88k-motorola-sysv3 600e9f7eabcSmrg ;; 60150806d53Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 602e9f7eabcSmrg GUESS=m88k-tektronix-sysv3 603e9f7eabcSmrg ;; 60450806d53Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 605e9f7eabcSmrg GUESS=m68k-tektronix-bsd 606e9f7eabcSmrg ;; 60750806d53Smrg *:IRIX*:*:*) 608e9f7eabcSmrg IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` 609e9f7eabcSmrg GUESS=mips-sgi-irix$IRIX_REL 610e9f7eabcSmrg ;; 61150806d53Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 612e9f7eabcSmrg GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id 613e9f7eabcSmrg ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 61450806d53Smrg i*86:AIX:*:*) 615e9f7eabcSmrg GUESS=i386-ibm-aix 616e9f7eabcSmrg ;; 61750806d53Smrg ia64:AIX:*:*) 618e9f7eabcSmrg if test -x /usr/bin/oslevel ; then 61950806d53Smrg IBM_REV=`/usr/bin/oslevel` 62050806d53Smrg else 621e9f7eabcSmrg IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 62250806d53Smrg fi 623e9f7eabcSmrg GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV 624e9f7eabcSmrg ;; 62550806d53Smrg *:AIX:2:3) 62650806d53Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 627e9f7eabcSmrg set_cc_for_build 628e9f7eabcSmrg sed 's/^ //' << EOF > "$dummy.c" 62950806d53Smrg #include <sys/systemcfg.h> 63050806d53Smrg 63150806d53Smrg main() 63250806d53Smrg { 63350806d53Smrg if (!__power_pc()) 63450806d53Smrg exit(1); 63550806d53Smrg puts("powerpc-ibm-aix3.2.5"); 63650806d53Smrg exit(0); 63750806d53Smrg } 63850806d53SmrgEOF 639e9f7eabcSmrg if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` 6407965d9acSmrg then 641e9f7eabcSmrg GUESS=$SYSTEM_NAME 6427965d9acSmrg else 643e9f7eabcSmrg GUESS=rs6000-ibm-aix3.2.5 6447965d9acSmrg fi 64550806d53Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 646e9f7eabcSmrg GUESS=rs6000-ibm-aix3.2.4 64750806d53Smrg else 648e9f7eabcSmrg GUESS=rs6000-ibm-aix3.2 64950806d53Smrg fi 650e9f7eabcSmrg ;; 651a73423d7Smrg *:AIX:*:[4567]) 65250806d53Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 653e9f7eabcSmrg if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then 65450806d53Smrg IBM_ARCH=rs6000 65550806d53Smrg else 65650806d53Smrg IBM_ARCH=powerpc 65750806d53Smrg fi 658e9f7eabcSmrg if test -x /usr/bin/lslpp ; then 659e9f7eabcSmrg IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ 6604a8d91dcSmrg awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 66150806d53Smrg else 662e9f7eabcSmrg IBM_REV=$UNAME_VERSION.$UNAME_RELEASE 66350806d53Smrg fi 664e9f7eabcSmrg GUESS=$IBM_ARCH-ibm-aix$IBM_REV 665e9f7eabcSmrg ;; 66650806d53Smrg *:AIX:*:*) 667e9f7eabcSmrg GUESS=rs6000-ibm-aix 668e9f7eabcSmrg ;; 669e9f7eabcSmrg ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 670e9f7eabcSmrg GUESS=romp-ibm-bsd4.4 671e9f7eabcSmrg ;; 67250806d53Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 673e9f7eabcSmrg GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to 674e9f7eabcSmrg ;; # report: romp-ibm BSD 4.3 67550806d53Smrg *:BOSX:*:*) 676e9f7eabcSmrg GUESS=rs6000-bull-bosx 677e9f7eabcSmrg ;; 67850806d53Smrg DPX/2?00:B.O.S.:*:*) 679e9f7eabcSmrg GUESS=m68k-bull-sysv3 680e9f7eabcSmrg ;; 68150806d53Smrg 9000/[34]??:4.3bsd:1.*:*) 682e9f7eabcSmrg GUESS=m68k-hp-bsd 683e9f7eabcSmrg ;; 68450806d53Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 685e9f7eabcSmrg GUESS=m68k-hp-bsd4.4 686e9f7eabcSmrg ;; 68750806d53Smrg 9000/[34678]??:HP-UX:*:*) 688e9f7eabcSmrg HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 689e9f7eabcSmrg case $UNAME_MACHINE in 690e9f7eabcSmrg 9000/31?) HP_ARCH=m68000 ;; 691e9f7eabcSmrg 9000/[34]??) HP_ARCH=m68k ;; 69250806d53Smrg 9000/[678][0-9][0-9]) 693e9f7eabcSmrg if test -x /usr/bin/getconf; then 69450806d53Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 695a73423d7Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 696e9f7eabcSmrg case $sc_cpu_version in 697e9f7eabcSmrg 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 698e9f7eabcSmrg 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 699a73423d7Smrg 532) # CPU_PA_RISC2_0 700e9f7eabcSmrg case $sc_kernel_bits in 701e9f7eabcSmrg 32) HP_ARCH=hppa2.0n ;; 702e9f7eabcSmrg 64) HP_ARCH=hppa2.0w ;; 703e9f7eabcSmrg '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 704a73423d7Smrg esac ;; 705a73423d7Smrg esac 70650806d53Smrg fi 707e9f7eabcSmrg if test "$HP_ARCH" = ""; then 708e9f7eabcSmrg set_cc_for_build 709e9f7eabcSmrg sed 's/^ //' << EOF > "$dummy.c" 71050806d53Smrg 711a73423d7Smrg #define _HPUX_SOURCE 712a73423d7Smrg #include <stdlib.h> 713a73423d7Smrg #include <unistd.h> 71450806d53Smrg 715a73423d7Smrg int main () 716a73423d7Smrg { 717a73423d7Smrg #if defined(_SC_KERNEL_BITS) 718a73423d7Smrg long bits = sysconf(_SC_KERNEL_BITS); 719a73423d7Smrg #endif 720a73423d7Smrg long cpu = sysconf (_SC_CPU_VERSION); 72150806d53Smrg 722a73423d7Smrg switch (cpu) 723a73423d7Smrg { 724a73423d7Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 725a73423d7Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 726a73423d7Smrg case CPU_PA_RISC2_0: 727a73423d7Smrg #if defined(_SC_KERNEL_BITS) 728a73423d7Smrg switch (bits) 729a73423d7Smrg { 730a73423d7Smrg case 64: puts ("hppa2.0w"); break; 731a73423d7Smrg case 32: puts ("hppa2.0n"); break; 732a73423d7Smrg default: puts ("hppa2.0"); break; 733a73423d7Smrg } break; 734a73423d7Smrg #else /* !defined(_SC_KERNEL_BITS) */ 735a73423d7Smrg puts ("hppa2.0"); break; 736a73423d7Smrg #endif 737a73423d7Smrg default: puts ("hppa1.0"); break; 738a73423d7Smrg } 739a73423d7Smrg exit (0); 740a73423d7Smrg } 74150806d53SmrgEOF 742e9f7eabcSmrg (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` 74350806d53Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 74450806d53Smrg fi ;; 74550806d53Smrg esac 746e9f7eabcSmrg if test "$HP_ARCH" = hppa2.0w 74750806d53Smrg then 748e9f7eabcSmrg set_cc_for_build 7497965d9acSmrg 7507965d9acSmrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 7517965d9acSmrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 7527965d9acSmrg # generating 64-bit code. GNU and HP use different nomenclature: 7537965d9acSmrg # 7547965d9acSmrg # $ CC_FOR_BUILD=cc ./config.guess 7557965d9acSmrg # => hppa2.0w-hp-hpux11.23 7567965d9acSmrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 7577965d9acSmrg # => hppa64-hp-hpux11.23 7587965d9acSmrg 759e9f7eabcSmrg if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | 760a73423d7Smrg grep -q __LP64__ 76150806d53Smrg then 762e9f7eabcSmrg HP_ARCH=hppa2.0w 76350806d53Smrg else 764e9f7eabcSmrg HP_ARCH=hppa64 76550806d53Smrg fi 76650806d53Smrg fi 767e9f7eabcSmrg GUESS=$HP_ARCH-hp-hpux$HPUX_REV 768e9f7eabcSmrg ;; 76950806d53Smrg ia64:HP-UX:*:*) 770e9f7eabcSmrg HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` 771e9f7eabcSmrg GUESS=ia64-hp-hpux$HPUX_REV 772e9f7eabcSmrg ;; 77350806d53Smrg 3050*:HI-UX:*:*) 774e9f7eabcSmrg set_cc_for_build 775e9f7eabcSmrg sed 's/^ //' << EOF > "$dummy.c" 77650806d53Smrg #include <unistd.h> 77750806d53Smrg int 77850806d53Smrg main () 77950806d53Smrg { 78050806d53Smrg long cpu = sysconf (_SC_CPU_VERSION); 78150806d53Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 78250806d53Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 78350806d53Smrg results, however. */ 78450806d53Smrg if (CPU_IS_PA_RISC (cpu)) 78550806d53Smrg { 78650806d53Smrg switch (cpu) 78750806d53Smrg { 78850806d53Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 78950806d53Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 79050806d53Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 79150806d53Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 79250806d53Smrg } 79350806d53Smrg } 79450806d53Smrg else if (CPU_IS_HP_MC68K (cpu)) 79550806d53Smrg puts ("m68k-hitachi-hiuxwe2"); 79650806d53Smrg else puts ("unknown-hitachi-hiuxwe2"); 79750806d53Smrg exit (0); 79850806d53Smrg } 79950806d53SmrgEOF 800e9f7eabcSmrg $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && 8017965d9acSmrg { echo "$SYSTEM_NAME"; exit; } 802e9f7eabcSmrg GUESS=unknown-hitachi-hiuxwe2 803e9f7eabcSmrg ;; 804e9f7eabcSmrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) 805e9f7eabcSmrg GUESS=hppa1.1-hp-bsd 806e9f7eabcSmrg ;; 80750806d53Smrg 9000/8??:4.3bsd:*:*) 808e9f7eabcSmrg GUESS=hppa1.0-hp-bsd 809e9f7eabcSmrg ;; 81050806d53Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 811e9f7eabcSmrg GUESS=hppa1.0-hp-mpeix 812e9f7eabcSmrg ;; 813e9f7eabcSmrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) 814e9f7eabcSmrg GUESS=hppa1.1-hp-osf 815e9f7eabcSmrg ;; 81650806d53Smrg hp8??:OSF1:*:*) 817e9f7eabcSmrg GUESS=hppa1.0-hp-osf 818e9f7eabcSmrg ;; 81950806d53Smrg i*86:OSF1:*:*) 820e9f7eabcSmrg if test -x /usr/sbin/sysversion ; then 821e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-osf1mk 82250806d53Smrg else 823e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-osf1 82450806d53Smrg fi 825e9f7eabcSmrg ;; 82650806d53Smrg parisc*:Lites*:*:*) 827e9f7eabcSmrg GUESS=hppa1.1-hp-lites 828e9f7eabcSmrg ;; 82950806d53Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 830e9f7eabcSmrg GUESS=c1-convex-bsd 831e9f7eabcSmrg ;; 83250806d53Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 83350806d53Smrg if getsysinfo -f scalar_acc 83450806d53Smrg then echo c32-convex-bsd 83550806d53Smrg else echo c2-convex-bsd 83650806d53Smrg fi 837a73423d7Smrg exit ;; 83850806d53Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 839e9f7eabcSmrg GUESS=c34-convex-bsd 840e9f7eabcSmrg ;; 84150806d53Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 842e9f7eabcSmrg GUESS=c38-convex-bsd 843e9f7eabcSmrg ;; 84450806d53Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 845e9f7eabcSmrg GUESS=c4-convex-bsd 846e9f7eabcSmrg ;; 84750806d53Smrg CRAY*Y-MP:*:*:*) 848e9f7eabcSmrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 849e9f7eabcSmrg GUESS=ymp-cray-unicos$CRAY_REL 850e9f7eabcSmrg ;; 85150806d53Smrg CRAY*[A-Z]90:*:*:*) 852e9f7eabcSmrg echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ 85350806d53Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 85450806d53Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 85550806d53Smrg -e 's/\.[^.]*$/.X/' 8567965d9acSmrg exit ;; 85750806d53Smrg CRAY*TS:*:*:*) 858e9f7eabcSmrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 859e9f7eabcSmrg GUESS=t90-cray-unicos$CRAY_REL 860e9f7eabcSmrg ;; 86150806d53Smrg CRAY*T3E:*:*:*) 862e9f7eabcSmrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 863e9f7eabcSmrg GUESS=alphaev5-cray-unicosmk$CRAY_REL 864e9f7eabcSmrg ;; 86550806d53Smrg CRAY*SV1:*:*:*) 866e9f7eabcSmrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 867e9f7eabcSmrg GUESS=sv1-cray-unicos$CRAY_REL 868e9f7eabcSmrg ;; 86950806d53Smrg *:UNICOS/mp:*:*) 870e9f7eabcSmrg CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` 871e9f7eabcSmrg GUESS=craynv-cray-unicosmp$CRAY_REL 872e9f7eabcSmrg ;; 87350806d53Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 874e9f7eabcSmrg FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 875e9f7eabcSmrg FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 876e9f7eabcSmrg FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` 877e9f7eabcSmrg GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 878e9f7eabcSmrg ;; 8797965d9acSmrg 5000:UNIX_System_V:4.*:*) 880e9f7eabcSmrg FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 881e9f7eabcSmrg FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` 882e9f7eabcSmrg GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} 883e9f7eabcSmrg ;; 88450806d53Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 885e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE 886e9f7eabcSmrg ;; 88750806d53Smrg sparc*:BSD/OS:*:*) 888e9f7eabcSmrg GUESS=sparc-unknown-bsdi$UNAME_RELEASE 889e9f7eabcSmrg ;; 89050806d53Smrg *:BSD/OS:*:*) 891e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE 892e9f7eabcSmrg ;; 893e9f7eabcSmrg arm:FreeBSD:*:*) 894e9f7eabcSmrg UNAME_PROCESSOR=`uname -p` 895e9f7eabcSmrg set_cc_for_build 896e9f7eabcSmrg if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 897e9f7eabcSmrg | grep -q __ARM_PCS_VFP 898e9f7eabcSmrg then 899e9f7eabcSmrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 900e9f7eabcSmrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi 901e9f7eabcSmrg else 902e9f7eabcSmrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 903e9f7eabcSmrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf 904e9f7eabcSmrg fi 905e9f7eabcSmrg ;; 9067965d9acSmrg *:FreeBSD:*:*) 907a73423d7Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 908e9f7eabcSmrg case $UNAME_PROCESSOR in 9097965d9acSmrg amd64) 910e9f7eabcSmrg UNAME_PROCESSOR=x86_64 ;; 911e9f7eabcSmrg i386) 912e9f7eabcSmrg UNAME_PROCESSOR=i586 ;; 9137965d9acSmrg esac 914e9f7eabcSmrg FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 915e9f7eabcSmrg GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL 916e9f7eabcSmrg ;; 91750806d53Smrg i*:CYGWIN*:*) 918e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-cygwin 919e9f7eabcSmrg ;; 9204a8d91dcSmrg *:MINGW64*:*) 921e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-mingw64 922e9f7eabcSmrg ;; 9237965d9acSmrg *:MINGW*:*) 924e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-mingw32 925e9f7eabcSmrg ;; 9264a8d91dcSmrg *:MSYS*:*) 927e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-msys 928e9f7eabcSmrg ;; 92950806d53Smrg i*:PW*:*) 930e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-pw32 931e9f7eabcSmrg ;; 932e9f7eabcSmrg *:SerenityOS:*:*) 933e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-serenity 934e9f7eabcSmrg ;; 935a73423d7Smrg *:Interix*:*) 936e9f7eabcSmrg case $UNAME_MACHINE in 9377965d9acSmrg x86) 938e9f7eabcSmrg GUESS=i586-pc-interix$UNAME_RELEASE 939e9f7eabcSmrg ;; 940a73423d7Smrg authenticamd | genuineintel | EM64T) 941e9f7eabcSmrg GUESS=x86_64-unknown-interix$UNAME_RELEASE 942e9f7eabcSmrg ;; 9437965d9acSmrg IA64) 944e9f7eabcSmrg GUESS=ia64-unknown-interix$UNAME_RELEASE 945e9f7eabcSmrg ;; 9467965d9acSmrg esac ;; 94750806d53Smrg i*:UWIN*:*) 948e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-uwin 949e9f7eabcSmrg ;; 9507965d9acSmrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 951e9f7eabcSmrg GUESS=x86_64-pc-cygwin 952e9f7eabcSmrg ;; 95350806d53Smrg prep*:SunOS:5.*:*) 954e9f7eabcSmrg SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` 955e9f7eabcSmrg GUESS=powerpcle-unknown-solaris2$SUN_REL 956e9f7eabcSmrg ;; 95750806d53Smrg *:GNU:*:*) 9587965d9acSmrg # the GNU system 959e9f7eabcSmrg GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` 960e9f7eabcSmrg GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` 961e9f7eabcSmrg GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL 962e9f7eabcSmrg ;; 9637965d9acSmrg *:GNU/*:*:*) 9647965d9acSmrg # other systems with GNU libc and userland 965e9f7eabcSmrg GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` 966e9f7eabcSmrg GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 967e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC 968e9f7eabcSmrg ;; 969e9f7eabcSmrg x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) 970e9f7eabcSmrg GUESS="$UNAME_MACHINE-pc-managarm-mlibc" 971e9f7eabcSmrg ;; 972e9f7eabcSmrg *:[Mm]anagarm:*:*) 973e9f7eabcSmrg GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" 974e9f7eabcSmrg ;; 975e9f7eabcSmrg *:Minix:*:*) 976e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-minix 977e9f7eabcSmrg ;; 9784a8d91dcSmrg aarch64:Linux:*:*) 979e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 980e9f7eabcSmrg ;; 9814a8d91dcSmrg aarch64_be:Linux:*:*) 9824a8d91dcSmrg UNAME_MACHINE=aarch64_be 983e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 984e9f7eabcSmrg ;; 985a73423d7Smrg alpha:Linux:*:*) 986e9f7eabcSmrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in 987a73423d7Smrg EV5) UNAME_MACHINE=alphaev5 ;; 988a73423d7Smrg EV56) UNAME_MACHINE=alphaev56 ;; 989a73423d7Smrg PCA56) UNAME_MACHINE=alphapca56 ;; 990a73423d7Smrg PCA57) UNAME_MACHINE=alphapca56 ;; 991a73423d7Smrg EV6) UNAME_MACHINE=alphaev6 ;; 992a73423d7Smrg EV67) UNAME_MACHINE=alphaev67 ;; 993a73423d7Smrg EV68*) UNAME_MACHINE=alphaev68 ;; 994a73423d7Smrg esac 995a73423d7Smrg objdump --private-headers /bin/sh | grep -q ld.so.1 996e9f7eabcSmrg if test "$?" = 0 ; then LIBC=gnulibc1 ; fi 997e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 998e9f7eabcSmrg ;; 999e9f7eabcSmrg arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) 1000e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1001e9f7eabcSmrg ;; 100250806d53Smrg arm*:Linux:*:*) 1003e9f7eabcSmrg set_cc_for_build 10047965d9acSmrg if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 10057965d9acSmrg | grep -q __ARM_EABI__ 10067965d9acSmrg then 1007e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 10087965d9acSmrg else 1009a73423d7Smrg if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 1010a73423d7Smrg | grep -q __ARM_PCS_VFP 1011a73423d7Smrg then 1012e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi 1013a73423d7Smrg else 1014e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf 1015a73423d7Smrg fi 10167965d9acSmrg fi 1017e9f7eabcSmrg ;; 10187965d9acSmrg avr32*:Linux:*:*) 1019e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1020e9f7eabcSmrg ;; 102150806d53Smrg cris:Linux:*:*) 1022e9f7eabcSmrg GUESS=$UNAME_MACHINE-axis-linux-$LIBC 1023e9f7eabcSmrg ;; 10247965d9acSmrg crisv32:Linux:*:*) 1025e9f7eabcSmrg GUESS=$UNAME_MACHINE-axis-linux-$LIBC 1026e9f7eabcSmrg ;; 10274a8d91dcSmrg e2k:Linux:*:*) 1028e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1029e9f7eabcSmrg ;; 10307965d9acSmrg frv:Linux:*:*) 1031e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1032e9f7eabcSmrg ;; 1033a73423d7Smrg hexagon:Linux:*:*) 1034e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1035e9f7eabcSmrg ;; 1036a73423d7Smrg i*86:Linux:*:*) 1037e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-linux-$LIBC 1038e9f7eabcSmrg ;; 103950806d53Smrg ia64:Linux:*:*) 1040e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1041e9f7eabcSmrg ;; 1042e9f7eabcSmrg k1om:Linux:*:*) 1043e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1044e9f7eabcSmrg ;; 1045e9f7eabcSmrg loongarch32:Linux:*:* | loongarch64:Linux:*:*) 1046e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1047e9f7eabcSmrg ;; 10487965d9acSmrg m32r*:Linux:*:*) 1049e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1050e9f7eabcSmrg ;; 105150806d53Smrg m68*:Linux:*:*) 1052e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1053e9f7eabcSmrg ;; 1054a73423d7Smrg mips:Linux:*:* | mips64:Linux:*:*) 1055e9f7eabcSmrg set_cc_for_build 1056e9f7eabcSmrg IS_GLIBC=0 1057e9f7eabcSmrg test x"${LIBC}" = xgnu && IS_GLIBC=1 1058e9f7eabcSmrg sed 's/^ //' << EOF > "$dummy.c" 105950806d53Smrg #undef CPU 1060e9f7eabcSmrg #undef mips 1061e9f7eabcSmrg #undef mipsel 1062e9f7eabcSmrg #undef mips64 1063e9f7eabcSmrg #undef mips64el 1064e9f7eabcSmrg #if ${IS_GLIBC} && defined(_ABI64) 1065e9f7eabcSmrg LIBCABI=gnuabi64 1066e9f7eabcSmrg #else 1067e9f7eabcSmrg #if ${IS_GLIBC} && defined(_ABIN32) 1068e9f7eabcSmrg LIBCABI=gnuabin32 1069e9f7eabcSmrg #else 1070e9f7eabcSmrg LIBCABI=${LIBC} 1071e9f7eabcSmrg #endif 1072e9f7eabcSmrg #endif 1073e9f7eabcSmrg 1074e9f7eabcSmrg #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 1075e9f7eabcSmrg CPU=mipsisa64r6 1076e9f7eabcSmrg #else 1077e9f7eabcSmrg #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 1078e9f7eabcSmrg CPU=mipsisa32r6 1079e9f7eabcSmrg #else 1080e9f7eabcSmrg #if defined(__mips64) 1081e9f7eabcSmrg CPU=mips64 1082e9f7eabcSmrg #else 1083e9f7eabcSmrg CPU=mips 1084e9f7eabcSmrg #endif 1085e9f7eabcSmrg #endif 1086e9f7eabcSmrg #endif 1087e9f7eabcSmrg 108850806d53Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 1089e9f7eabcSmrg MIPS_ENDIAN=el 109050806d53Smrg #else 109150806d53Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 1092e9f7eabcSmrg MIPS_ENDIAN= 109350806d53Smrg #else 1094e9f7eabcSmrg MIPS_ENDIAN= 109550806d53Smrg #endif 109650806d53Smrg #endif 109750806d53SmrgEOF 1098e9f7eabcSmrg cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` 1099e9f7eabcSmrg eval "$cc_set_vars" 1100e9f7eabcSmrg test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } 1101e9f7eabcSmrg ;; 1102e9f7eabcSmrg mips64el:Linux:*:*) 1103e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 110450806d53Smrg ;; 11054a8d91dcSmrg openrisc*:Linux:*:*) 1106e9f7eabcSmrg GUESS=or1k-unknown-linux-$LIBC 1107e9f7eabcSmrg ;; 11084a8d91dcSmrg or32:Linux:*:* | or1k*:Linux:*:*) 1109e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1110e9f7eabcSmrg ;; 1111b3e38ee4Smrg padre:Linux:*:*) 1112e9f7eabcSmrg GUESS=sparc-unknown-linux-$LIBC 1113e9f7eabcSmrg ;; 1114a73423d7Smrg parisc64:Linux:*:* | hppa64:Linux:*:*) 1115e9f7eabcSmrg GUESS=hppa64-unknown-linux-$LIBC 1116e9f7eabcSmrg ;; 111750806d53Smrg parisc:Linux:*:* | hppa:Linux:*:*) 111850806d53Smrg # Look for CPU level 111950806d53Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 1120e9f7eabcSmrg PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; 1121e9f7eabcSmrg PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; 1122e9f7eabcSmrg *) GUESS=hppa-unknown-linux-$LIBC ;; 112350806d53Smrg esac 1124e9f7eabcSmrg ;; 1125a73423d7Smrg ppc64:Linux:*:*) 1126e9f7eabcSmrg GUESS=powerpc64-unknown-linux-$LIBC 1127e9f7eabcSmrg ;; 1128a73423d7Smrg ppc:Linux:*:*) 1129e9f7eabcSmrg GUESS=powerpc-unknown-linux-$LIBC 1130e9f7eabcSmrg ;; 11314a8d91dcSmrg ppc64le:Linux:*:*) 1132e9f7eabcSmrg GUESS=powerpc64le-unknown-linux-$LIBC 1133e9f7eabcSmrg ;; 11344a8d91dcSmrg ppcle:Linux:*:*) 1135e9f7eabcSmrg GUESS=powerpcle-unknown-linux-$LIBC 1136e9f7eabcSmrg ;; 1137e9f7eabcSmrg riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) 1138e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1139e9f7eabcSmrg ;; 114050806d53Smrg s390:Linux:*:* | s390x:Linux:*:*) 1141e9f7eabcSmrg GUESS=$UNAME_MACHINE-ibm-linux-$LIBC 1142e9f7eabcSmrg ;; 114350806d53Smrg sh64*:Linux:*:*) 1144e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1145e9f7eabcSmrg ;; 114650806d53Smrg sh*:Linux:*:*) 1147e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1148e9f7eabcSmrg ;; 114950806d53Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 1150e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1151e9f7eabcSmrg ;; 1152a73423d7Smrg tile*:Linux:*:*) 1153e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1154e9f7eabcSmrg ;; 11557965d9acSmrg vax:Linux:*:*) 1156e9f7eabcSmrg GUESS=$UNAME_MACHINE-dec-linux-$LIBC 1157e9f7eabcSmrg ;; 115850806d53Smrg x86_64:Linux:*:*) 1159e9f7eabcSmrg set_cc_for_build 1160e9f7eabcSmrg CPU=$UNAME_MACHINE 1161e9f7eabcSmrg LIBCABI=$LIBC 1162e9f7eabcSmrg if test "$CC_FOR_BUILD" != no_compiler_found; then 1163e9f7eabcSmrg ABI=64 1164e9f7eabcSmrg sed 's/^ //' << EOF > "$dummy.c" 1165e9f7eabcSmrg #ifdef __i386__ 1166e9f7eabcSmrg ABI=x86 1167e9f7eabcSmrg #else 1168e9f7eabcSmrg #ifdef __ILP32__ 1169e9f7eabcSmrg ABI=x32 1170e9f7eabcSmrg #endif 1171e9f7eabcSmrg #endif 1172e9f7eabcSmrgEOF 1173e9f7eabcSmrg cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` 1174e9f7eabcSmrg eval "$cc_set_abi" 1175e9f7eabcSmrg case $ABI in 1176e9f7eabcSmrg x86) CPU=i686 ;; 1177e9f7eabcSmrg x32) LIBCABI=${LIBC}x32 ;; 1178e9f7eabcSmrg esac 1179e9f7eabcSmrg fi 1180e9f7eabcSmrg GUESS=$CPU-pc-linux-$LIBCABI 1181e9f7eabcSmrg ;; 11827965d9acSmrg xtensa*:Linux:*:*) 1183e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-linux-$LIBC 1184e9f7eabcSmrg ;; 118550806d53Smrg i*86:DYNIX/ptx:4*:*) 118650806d53Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 118750806d53Smrg # earlier versions are messed up and put the nodename in both 118850806d53Smrg # sysname and nodename. 1189e9f7eabcSmrg GUESS=i386-sequent-sysv4 1190e9f7eabcSmrg ;; 119150806d53Smrg i*86:UNIX_SV:4.2MP:2.*) 1192a73423d7Smrg # Unixware is an offshoot of SVR4, but it has its own version 1193a73423d7Smrg # number series starting with 2... 1194a73423d7Smrg # I am not positive that other SVR4 systems won't match this, 119550806d53Smrg # I just have to hope. -- rms. 1196a73423d7Smrg # Use sysv4.2uw... so that sysv4* matches it. 1197e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION 1198e9f7eabcSmrg ;; 119950806d53Smrg i*86:OS/2:*:*) 120050806d53Smrg # If we were able to find `uname', then EMX Unix compatibility 120150806d53Smrg # is probably installed. 1202e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-os2-emx 1203e9f7eabcSmrg ;; 120450806d53Smrg i*86:XTS-300:*:STOP) 1205e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-stop 1206e9f7eabcSmrg ;; 120750806d53Smrg i*86:atheos:*:*) 1208e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-atheos 1209e9f7eabcSmrg ;; 12107965d9acSmrg i*86:syllable:*:*) 1211e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-syllable 1212e9f7eabcSmrg ;; 1213a73423d7Smrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1214e9f7eabcSmrg GUESS=i386-unknown-lynxos$UNAME_RELEASE 1215e9f7eabcSmrg ;; 121650806d53Smrg i*86:*DOS:*:*) 1217e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-msdosdjgpp 1218e9f7eabcSmrg ;; 1219e9f7eabcSmrg i*86:*:4.*:*) 1220e9f7eabcSmrg UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` 122150806d53Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1222e9f7eabcSmrg GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL 122350806d53Smrg else 1224e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL 122550806d53Smrg fi 1226e9f7eabcSmrg ;; 12277965d9acSmrg i*86:*:5:[678]*) 1228a73423d7Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 122950806d53Smrg case `/bin/uname -X | grep "^Machine"` in 123050806d53Smrg *486*) UNAME_MACHINE=i486 ;; 123150806d53Smrg *Pentium) UNAME_MACHINE=i586 ;; 123250806d53Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 123350806d53Smrg esac 1234e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1235e9f7eabcSmrg ;; 123650806d53Smrg i*86:*:3.2:*) 123750806d53Smrg if test -f /usr/options/cb.name; then 123850806d53Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1239e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL 124050806d53Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 124150806d53Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 124250806d53Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 124350806d53Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 124450806d53Smrg && UNAME_MACHINE=i586 124550806d53Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 124650806d53Smrg && UNAME_MACHINE=i686 124750806d53Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 124850806d53Smrg && UNAME_MACHINE=i686 1249e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL 125050806d53Smrg else 1251e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-sysv32 125250806d53Smrg fi 1253e9f7eabcSmrg ;; 125450806d53Smrg pc:*:*:*) 125550806d53Smrg # Left here for compatibility: 1256a73423d7Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 1257a73423d7Smrg # the processor, so we play safe by assuming i586. 1258a73423d7Smrg # Note: whatever this is, it MUST be the same as what config.sub 1259e9f7eabcSmrg # prints for the "djgpp" host, or else GDB configure will decide that 1260a73423d7Smrg # this is a cross-build. 1261e9f7eabcSmrg GUESS=i586-pc-msdosdjgpp 1262e9f7eabcSmrg ;; 126350806d53Smrg Intel:Mach:3*:*) 1264e9f7eabcSmrg GUESS=i386-pc-mach3 1265e9f7eabcSmrg ;; 126650806d53Smrg paragon:*:*:*) 1267e9f7eabcSmrg GUESS=i860-intel-osf1 1268e9f7eabcSmrg ;; 126950806d53Smrg i860:*:4.*:*) # i860-SVR4 127050806d53Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1271e9f7eabcSmrg GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 127250806d53Smrg else # Add other i860-SVR4 vendors below as they are discovered. 1273e9f7eabcSmrg GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 127450806d53Smrg fi 1275e9f7eabcSmrg ;; 127650806d53Smrg mini*:CTIX:SYS*5:*) 127750806d53Smrg # "miniframe" 1278e9f7eabcSmrg GUESS=m68010-convergent-sysv 1279e9f7eabcSmrg ;; 128050806d53Smrg mc68k:UNIX:SYSTEM5:3.51m) 1281e9f7eabcSmrg GUESS=m68k-convergent-sysv 1282e9f7eabcSmrg ;; 128350806d53Smrg M680?0:D-NIX:5.3:*) 1284e9f7eabcSmrg GUESS=m68k-diab-dnix 1285e9f7eabcSmrg ;; 12867965d9acSmrg M68*:*:R3V[5678]*:*) 12877965d9acSmrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 12887965d9acSmrg 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) 128950806d53Smrg OS_REL='' 129050806d53Smrg test -r /etc/.relid \ 129150806d53Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 129250806d53Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1293e9f7eabcSmrg && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 129450806d53Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1295e9f7eabcSmrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 129650806d53Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1297a73423d7Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1298a73423d7Smrg && { echo i486-ncr-sysv4; exit; } ;; 1299a73423d7Smrg NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1300a73423d7Smrg OS_REL='.3' 1301a73423d7Smrg test -r /etc/.relid \ 1302a73423d7Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1303a73423d7Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1304e9f7eabcSmrg && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } 1305a73423d7Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1306e9f7eabcSmrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } 1307a73423d7Smrg /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1308e9f7eabcSmrg && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 130950806d53Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1310e9f7eabcSmrg GUESS=m68k-unknown-lynxos$UNAME_RELEASE 1311e9f7eabcSmrg ;; 131250806d53Smrg mc68030:UNIX_System_V:4.*:*) 1313e9f7eabcSmrg GUESS=m68k-atari-sysv4 1314e9f7eabcSmrg ;; 131550806d53Smrg TSUNAMI:LynxOS:2.*:*) 1316e9f7eabcSmrg GUESS=sparc-unknown-lynxos$UNAME_RELEASE 1317e9f7eabcSmrg ;; 131850806d53Smrg rs6000:LynxOS:2.*:*) 1319e9f7eabcSmrg GUESS=rs6000-unknown-lynxos$UNAME_RELEASE 1320e9f7eabcSmrg ;; 1321a73423d7Smrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1322e9f7eabcSmrg GUESS=powerpc-unknown-lynxos$UNAME_RELEASE 1323e9f7eabcSmrg ;; 132450806d53Smrg SM[BE]S:UNIX_SV:*:*) 1325e9f7eabcSmrg GUESS=mips-dde-sysv$UNAME_RELEASE 1326e9f7eabcSmrg ;; 132750806d53Smrg RM*:ReliantUNIX-*:*:*) 1328e9f7eabcSmrg GUESS=mips-sni-sysv4 1329e9f7eabcSmrg ;; 133050806d53Smrg RM*:SINIX-*:*:*) 1331e9f7eabcSmrg GUESS=mips-sni-sysv4 1332e9f7eabcSmrg ;; 133350806d53Smrg *:SINIX-*:*:*) 133450806d53Smrg if uname -p 2>/dev/null >/dev/null ; then 133550806d53Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 1336e9f7eabcSmrg GUESS=$UNAME_MACHINE-sni-sysv4 133750806d53Smrg else 1338e9f7eabcSmrg GUESS=ns32k-sni-sysv 133950806d53Smrg fi 1340e9f7eabcSmrg ;; 1341a73423d7Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1342a73423d7Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 1343e9f7eabcSmrg GUESS=i586-unisys-sysv4 1344e9f7eabcSmrg ;; 134550806d53Smrg *:UNIX_System_V:4*:FTX*) 134650806d53Smrg # From Gerald Hewes <hewes@openmarket.com>. 134750806d53Smrg # How about differentiating between stratus architectures? -djm 1348e9f7eabcSmrg GUESS=hppa1.1-stratus-sysv4 1349e9f7eabcSmrg ;; 135050806d53Smrg *:*:*:FTX*) 135150806d53Smrg # From seanf@swdc.stratus.com. 1352e9f7eabcSmrg GUESS=i860-stratus-sysv4 1353e9f7eabcSmrg ;; 13547965d9acSmrg i*86:VOS:*:*) 13557965d9acSmrg # From Paul.Green@stratus.com. 1356e9f7eabcSmrg GUESS=$UNAME_MACHINE-stratus-vos 1357e9f7eabcSmrg ;; 135850806d53Smrg *:VOS:*:*) 135950806d53Smrg # From Paul.Green@stratus.com. 1360e9f7eabcSmrg GUESS=hppa1.1-stratus-vos 1361e9f7eabcSmrg ;; 136250806d53Smrg mc68*:A/UX:*:*) 1363e9f7eabcSmrg GUESS=m68k-apple-aux$UNAME_RELEASE 1364e9f7eabcSmrg ;; 136550806d53Smrg news*:NEWS-OS:6*:*) 1366e9f7eabcSmrg GUESS=mips-sony-newsos6 1367e9f7eabcSmrg ;; 136850806d53Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1369e9f7eabcSmrg if test -d /usr/nec; then 1370e9f7eabcSmrg GUESS=mips-nec-sysv$UNAME_RELEASE 137150806d53Smrg else 1372e9f7eabcSmrg GUESS=mips-unknown-sysv$UNAME_RELEASE 137350806d53Smrg fi 1374e9f7eabcSmrg ;; 137550806d53Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1376e9f7eabcSmrg GUESS=powerpc-be-beos 1377e9f7eabcSmrg ;; 137850806d53Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1379e9f7eabcSmrg GUESS=powerpc-apple-beos 1380e9f7eabcSmrg ;; 138150806d53Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1382e9f7eabcSmrg GUESS=i586-pc-beos 1383e9f7eabcSmrg ;; 1384b3e38ee4Smrg BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1385e9f7eabcSmrg GUESS=i586-pc-haiku 1386e9f7eabcSmrg ;; 1387e9f7eabcSmrg ppc:Haiku:*:*) # Haiku running on Apple PowerPC 1388e9f7eabcSmrg GUESS=powerpc-apple-haiku 1389e9f7eabcSmrg ;; 1390e9f7eabcSmrg *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) 1391e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-haiku 1392e9f7eabcSmrg ;; 139350806d53Smrg SX-4:SUPER-UX:*:*) 1394e9f7eabcSmrg GUESS=sx4-nec-superux$UNAME_RELEASE 1395e9f7eabcSmrg ;; 139650806d53Smrg SX-5:SUPER-UX:*:*) 1397e9f7eabcSmrg GUESS=sx5-nec-superux$UNAME_RELEASE 1398e9f7eabcSmrg ;; 139950806d53Smrg SX-6:SUPER-UX:*:*) 1400e9f7eabcSmrg GUESS=sx6-nec-superux$UNAME_RELEASE 1401e9f7eabcSmrg ;; 14027965d9acSmrg SX-7:SUPER-UX:*:*) 1403e9f7eabcSmrg GUESS=sx7-nec-superux$UNAME_RELEASE 1404e9f7eabcSmrg ;; 14057965d9acSmrg SX-8:SUPER-UX:*:*) 1406e9f7eabcSmrg GUESS=sx8-nec-superux$UNAME_RELEASE 1407e9f7eabcSmrg ;; 14087965d9acSmrg SX-8R:SUPER-UX:*:*) 1409e9f7eabcSmrg GUESS=sx8r-nec-superux$UNAME_RELEASE 1410e9f7eabcSmrg ;; 1411e9f7eabcSmrg SX-ACE:SUPER-UX:*:*) 1412e9f7eabcSmrg GUESS=sxace-nec-superux$UNAME_RELEASE 1413e9f7eabcSmrg ;; 141450806d53Smrg Power*:Rhapsody:*:*) 1415e9f7eabcSmrg GUESS=powerpc-apple-rhapsody$UNAME_RELEASE 1416e9f7eabcSmrg ;; 141750806d53Smrg *:Rhapsody:*:*) 1418e9f7eabcSmrg GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE 1419e9f7eabcSmrg ;; 1420e9f7eabcSmrg arm64:Darwin:*:*) 1421e9f7eabcSmrg GUESS=aarch64-apple-darwin$UNAME_RELEASE 1422e9f7eabcSmrg ;; 142350806d53Smrg *:Darwin:*:*) 1424e9f7eabcSmrg UNAME_PROCESSOR=`uname -p` 1425e9f7eabcSmrg case $UNAME_PROCESSOR in 1426e9f7eabcSmrg unknown) UNAME_PROCESSOR=powerpc ;; 1427e9f7eabcSmrg esac 1428e9f7eabcSmrg if command -v xcode-select > /dev/null 2> /dev/null && \ 1429e9f7eabcSmrg ! xcode-select --print-path > /dev/null 2> /dev/null ; then 1430e9f7eabcSmrg # Avoid executing cc if there is no toolchain installed as 1431e9f7eabcSmrg # cc will be a stub that puts up a graphical alert 1432e9f7eabcSmrg # prompting the user to install developer tools. 1433e9f7eabcSmrg CC_FOR_BUILD=no_compiler_found 1434e9f7eabcSmrg else 1435e9f7eabcSmrg set_cc_for_build 14364a8d91dcSmrg fi 1437e9f7eabcSmrg if test "$CC_FOR_BUILD" != no_compiler_found; then 1438e9f7eabcSmrg if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1439e9f7eabcSmrg (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1440e9f7eabcSmrg grep IS_64BIT_ARCH >/dev/null 1441e9f7eabcSmrg then 1442e9f7eabcSmrg case $UNAME_PROCESSOR in 1443e9f7eabcSmrg i386) UNAME_PROCESSOR=x86_64 ;; 1444e9f7eabcSmrg powerpc) UNAME_PROCESSOR=powerpc64 ;; 1445e9f7eabcSmrg esac 1446e9f7eabcSmrg fi 1447e9f7eabcSmrg # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc 1448e9f7eabcSmrg if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ 1449e9f7eabcSmrg (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 1450e9f7eabcSmrg grep IS_PPC >/dev/null 1451e9f7eabcSmrg then 1452e9f7eabcSmrg UNAME_PROCESSOR=powerpc 14534a8d91dcSmrg fi 14544a8d91dcSmrg elif test "$UNAME_PROCESSOR" = i386 ; then 1455e9f7eabcSmrg # uname -m returns i386 or x86_64 1456e9f7eabcSmrg UNAME_PROCESSOR=$UNAME_MACHINE 14574a8d91dcSmrg fi 1458e9f7eabcSmrg GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE 1459e9f7eabcSmrg ;; 146050806d53Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 146150806d53Smrg UNAME_PROCESSOR=`uname -p` 1462e9f7eabcSmrg if test "$UNAME_PROCESSOR" = x86; then 146350806d53Smrg UNAME_PROCESSOR=i386 146450806d53Smrg UNAME_MACHINE=pc 146550806d53Smrg fi 1466e9f7eabcSmrg GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE 1467e9f7eabcSmrg ;; 146850806d53Smrg *:QNX:*:4*) 1469e9f7eabcSmrg GUESS=i386-pc-qnx 1470e9f7eabcSmrg ;; 1471e9f7eabcSmrg NEO-*:NONSTOP_KERNEL:*:*) 1472e9f7eabcSmrg GUESS=neo-tandem-nsk$UNAME_RELEASE 1473e9f7eabcSmrg ;; 14744a8d91dcSmrg NSE-*:NONSTOP_KERNEL:*:*) 1475e9f7eabcSmrg GUESS=nse-tandem-nsk$UNAME_RELEASE 1476e9f7eabcSmrg ;; 1477e9f7eabcSmrg NSR-*:NONSTOP_KERNEL:*:*) 1478e9f7eabcSmrg GUESS=nsr-tandem-nsk$UNAME_RELEASE 1479e9f7eabcSmrg ;; 1480e9f7eabcSmrg NSV-*:NONSTOP_KERNEL:*:*) 1481e9f7eabcSmrg GUESS=nsv-tandem-nsk$UNAME_RELEASE 1482e9f7eabcSmrg ;; 1483e9f7eabcSmrg NSX-*:NONSTOP_KERNEL:*:*) 1484e9f7eabcSmrg GUESS=nsx-tandem-nsk$UNAME_RELEASE 1485e9f7eabcSmrg ;; 148650806d53Smrg *:NonStop-UX:*:*) 1487e9f7eabcSmrg GUESS=mips-compaq-nonstopux 1488e9f7eabcSmrg ;; 148950806d53Smrg BS2000:POSIX*:*:*) 1490e9f7eabcSmrg GUESS=bs2000-siemens-sysv 1491e9f7eabcSmrg ;; 149250806d53Smrg DS/*:UNIX_System_V:*:*) 1493e9f7eabcSmrg GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE 1494e9f7eabcSmrg ;; 149550806d53Smrg *:Plan9:*:*) 149650806d53Smrg # "uname -m" is not consistent, so use $cputype instead. 386 149750806d53Smrg # is converted to i386 for consistency with other x86 149850806d53Smrg # operating systems. 1499e9f7eabcSmrg if test "${cputype-}" = 386; then 150050806d53Smrg UNAME_MACHINE=i386 1501e9f7eabcSmrg elif test "x${cputype-}" != x; then 1502e9f7eabcSmrg UNAME_MACHINE=$cputype 150350806d53Smrg fi 1504e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-plan9 1505e9f7eabcSmrg ;; 150650806d53Smrg *:TOPS-10:*:*) 1507e9f7eabcSmrg GUESS=pdp10-unknown-tops10 1508e9f7eabcSmrg ;; 150950806d53Smrg *:TENEX:*:*) 1510e9f7eabcSmrg GUESS=pdp10-unknown-tenex 1511e9f7eabcSmrg ;; 151250806d53Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1513e9f7eabcSmrg GUESS=pdp10-dec-tops20 1514e9f7eabcSmrg ;; 151550806d53Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1516e9f7eabcSmrg GUESS=pdp10-xkl-tops20 1517e9f7eabcSmrg ;; 151850806d53Smrg *:TOPS-20:*:*) 1519e9f7eabcSmrg GUESS=pdp10-unknown-tops20 1520e9f7eabcSmrg ;; 152150806d53Smrg *:ITS:*:*) 1522e9f7eabcSmrg GUESS=pdp10-unknown-its 1523e9f7eabcSmrg ;; 152450806d53Smrg SEI:*:*:SEIUX) 1525e9f7eabcSmrg GUESS=mips-sei-seiux$UNAME_RELEASE 1526e9f7eabcSmrg ;; 15277965d9acSmrg *:DragonFly:*:*) 1528e9f7eabcSmrg DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` 1529e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL 1530e9f7eabcSmrg ;; 15317965d9acSmrg *:*VMS:*:*) 1532a73423d7Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 1533e9f7eabcSmrg case $UNAME_MACHINE in 1534e9f7eabcSmrg A*) GUESS=alpha-dec-vms ;; 1535e9f7eabcSmrg I*) GUESS=ia64-dec-vms ;; 1536e9f7eabcSmrg V*) GUESS=vax-dec-vms ;; 15377965d9acSmrg esac ;; 15387965d9acSmrg *:XENIX:*:SysV) 1539e9f7eabcSmrg GUESS=i386-pc-xenix 1540e9f7eabcSmrg ;; 15417965d9acSmrg i*86:skyos:*:*) 1542e9f7eabcSmrg SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` 1543e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL 1544e9f7eabcSmrg ;; 15457965d9acSmrg i*86:rdos:*:*) 1546e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-rdos 1547e9f7eabcSmrg ;; 1548e9f7eabcSmrg i*86:Fiwix:*:*) 1549e9f7eabcSmrg GUESS=$UNAME_MACHINE-pc-fiwix 1550e9f7eabcSmrg ;; 1551e9f7eabcSmrg *:AROS:*:*) 1552e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-aros 1553e9f7eabcSmrg ;; 15544a8d91dcSmrg x86_64:VMkernel:*:*) 1555e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-esx 1556e9f7eabcSmrg ;; 1557e9f7eabcSmrg amd64:Isilon\ OneFS:*:*) 1558e9f7eabcSmrg GUESS=x86_64-unknown-onefs 1559e9f7eabcSmrg ;; 1560e9f7eabcSmrg *:Unleashed:*:*) 1561e9f7eabcSmrg GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE 1562e9f7eabcSmrg ;; 1563e9f7eabcSmrgesac 1564e9f7eabcSmrg 1565e9f7eabcSmrg# Do we have a guess based on uname results? 1566e9f7eabcSmrgif test "x$GUESS" != x; then 1567e9f7eabcSmrg echo "$GUESS" 1568e9f7eabcSmrg exit 1569e9f7eabcSmrgfi 1570e9f7eabcSmrg 1571e9f7eabcSmrg# No uname command or uname output not recognized. 1572e9f7eabcSmrgset_cc_for_build 1573e9f7eabcSmrgcat > "$dummy.c" <<EOF 1574e9f7eabcSmrg#ifdef _SEQUENT_ 1575e9f7eabcSmrg#include <sys/types.h> 1576e9f7eabcSmrg#include <sys/utsname.h> 1577e9f7eabcSmrg#endif 1578e9f7eabcSmrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 1579e9f7eabcSmrg#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 1580e9f7eabcSmrg#include <signal.h> 1581e9f7eabcSmrg#if defined(_SIZE_T_) || defined(SIGLOST) 1582e9f7eabcSmrg#include <sys/utsname.h> 1583e9f7eabcSmrg#endif 1584e9f7eabcSmrg#endif 1585e9f7eabcSmrg#endif 1586e9f7eabcSmrgmain () 1587e9f7eabcSmrg{ 1588e9f7eabcSmrg#if defined (sony) 1589e9f7eabcSmrg#if defined (MIPSEB) 1590e9f7eabcSmrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1591e9f7eabcSmrg I don't know.... */ 1592e9f7eabcSmrg printf ("mips-sony-bsd\n"); exit (0); 1593e9f7eabcSmrg#else 1594e9f7eabcSmrg#include <sys/param.h> 1595e9f7eabcSmrg printf ("m68k-sony-newsos%s\n", 1596e9f7eabcSmrg#ifdef NEWSOS4 1597e9f7eabcSmrg "4" 1598e9f7eabcSmrg#else 1599e9f7eabcSmrg "" 1600e9f7eabcSmrg#endif 1601e9f7eabcSmrg ); exit (0); 1602e9f7eabcSmrg#endif 1603e9f7eabcSmrg#endif 1604e9f7eabcSmrg 1605e9f7eabcSmrg#if defined (NeXT) 1606e9f7eabcSmrg#if !defined (__ARCHITECTURE__) 1607e9f7eabcSmrg#define __ARCHITECTURE__ "m68k" 1608e9f7eabcSmrg#endif 1609e9f7eabcSmrg int version; 1610e9f7eabcSmrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1611e9f7eabcSmrg if (version < 4) 1612e9f7eabcSmrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1613e9f7eabcSmrg else 1614e9f7eabcSmrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1615e9f7eabcSmrg exit (0); 1616e9f7eabcSmrg#endif 1617e9f7eabcSmrg 1618e9f7eabcSmrg#if defined (MULTIMAX) || defined (n16) 1619e9f7eabcSmrg#if defined (UMAXV) 1620e9f7eabcSmrg printf ("ns32k-encore-sysv\n"); exit (0); 1621e9f7eabcSmrg#else 1622e9f7eabcSmrg#if defined (CMU) 1623e9f7eabcSmrg printf ("ns32k-encore-mach\n"); exit (0); 1624e9f7eabcSmrg#else 1625e9f7eabcSmrg printf ("ns32k-encore-bsd\n"); exit (0); 1626e9f7eabcSmrg#endif 1627e9f7eabcSmrg#endif 1628e9f7eabcSmrg#endif 1629e9f7eabcSmrg 1630e9f7eabcSmrg#if defined (__386BSD__) 1631e9f7eabcSmrg printf ("i386-pc-bsd\n"); exit (0); 1632e9f7eabcSmrg#endif 1633e9f7eabcSmrg 1634e9f7eabcSmrg#if defined (sequent) 1635e9f7eabcSmrg#if defined (i386) 1636e9f7eabcSmrg printf ("i386-sequent-dynix\n"); exit (0); 1637e9f7eabcSmrg#endif 1638e9f7eabcSmrg#if defined (ns32000) 1639e9f7eabcSmrg printf ("ns32k-sequent-dynix\n"); exit (0); 1640e9f7eabcSmrg#endif 1641e9f7eabcSmrg#endif 1642e9f7eabcSmrg 1643e9f7eabcSmrg#if defined (_SEQUENT_) 1644e9f7eabcSmrg struct utsname un; 1645e9f7eabcSmrg 1646e9f7eabcSmrg uname(&un); 1647e9f7eabcSmrg if (strncmp(un.version, "V2", 2) == 0) { 1648e9f7eabcSmrg printf ("i386-sequent-ptx2\n"); exit (0); 1649e9f7eabcSmrg } 1650e9f7eabcSmrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1651e9f7eabcSmrg printf ("i386-sequent-ptx1\n"); exit (0); 1652e9f7eabcSmrg } 1653e9f7eabcSmrg printf ("i386-sequent-ptx\n"); exit (0); 1654e9f7eabcSmrg#endif 1655e9f7eabcSmrg 1656e9f7eabcSmrg#if defined (vax) 1657e9f7eabcSmrg#if !defined (ultrix) 1658e9f7eabcSmrg#include <sys/param.h> 1659e9f7eabcSmrg#if defined (BSD) 1660e9f7eabcSmrg#if BSD == 43 1661e9f7eabcSmrg printf ("vax-dec-bsd4.3\n"); exit (0); 1662e9f7eabcSmrg#else 1663e9f7eabcSmrg#if BSD == 199006 1664e9f7eabcSmrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 1665e9f7eabcSmrg#else 1666e9f7eabcSmrg printf ("vax-dec-bsd\n"); exit (0); 1667e9f7eabcSmrg#endif 1668e9f7eabcSmrg#endif 1669e9f7eabcSmrg#else 1670e9f7eabcSmrg printf ("vax-dec-bsd\n"); exit (0); 1671e9f7eabcSmrg#endif 1672e9f7eabcSmrg#else 1673e9f7eabcSmrg#if defined(_SIZE_T_) || defined(SIGLOST) 1674e9f7eabcSmrg struct utsname un; 1675e9f7eabcSmrg uname (&un); 1676e9f7eabcSmrg printf ("vax-dec-ultrix%s\n", un.release); exit (0); 1677e9f7eabcSmrg#else 1678e9f7eabcSmrg printf ("vax-dec-ultrix\n"); exit (0); 1679e9f7eabcSmrg#endif 1680e9f7eabcSmrg#endif 1681e9f7eabcSmrg#endif 1682e9f7eabcSmrg#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) 1683e9f7eabcSmrg#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) 1684e9f7eabcSmrg#if defined(_SIZE_T_) || defined(SIGLOST) 1685e9f7eabcSmrg struct utsname *un; 1686e9f7eabcSmrg uname (&un); 1687e9f7eabcSmrg printf ("mips-dec-ultrix%s\n", un.release); exit (0); 1688e9f7eabcSmrg#else 1689e9f7eabcSmrg printf ("mips-dec-ultrix\n"); exit (0); 1690e9f7eabcSmrg#endif 1691e9f7eabcSmrg#endif 1692e9f7eabcSmrg#endif 1693e9f7eabcSmrg 1694e9f7eabcSmrg#if defined (alliant) && defined (i860) 1695e9f7eabcSmrg printf ("i860-alliant-bsd\n"); exit (0); 1696e9f7eabcSmrg#endif 1697e9f7eabcSmrg 1698e9f7eabcSmrg exit (1); 1699e9f7eabcSmrg} 1700e9f7eabcSmrgEOF 1701e9f7eabcSmrg 1702e9f7eabcSmrg$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && 1703e9f7eabcSmrg { echo "$SYSTEM_NAME"; exit; } 1704e9f7eabcSmrg 1705e9f7eabcSmrg# Apollos put the system type in the environment. 1706e9f7eabcSmrgtest -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } 1707e9f7eabcSmrg 1708e9f7eabcSmrgecho "$0: unable to guess system type" >&2 1709e9f7eabcSmrg 1710e9f7eabcSmrgcase $UNAME_MACHINE:$UNAME_SYSTEM in 1711e9f7eabcSmrg mips:Linux | mips64:Linux) 1712e9f7eabcSmrg # If we got here on MIPS GNU/Linux, output extra information. 1713e9f7eabcSmrg cat >&2 <<EOF 1714e9f7eabcSmrg 1715e9f7eabcSmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize 1716e9f7eabcSmrgthe system type. Please install a C compiler and try again. 1717e9f7eabcSmrgEOF 1718e9f7eabcSmrg ;; 17194a8d91dcSmrgesac 172050806d53Smrg 172150806d53Smrgcat >&2 <<EOF 172250806d53Smrg 1723e9f7eabcSmrgThis script (version $timestamp), has failed to recognize the 1724e9f7eabcSmrgoperating system you are using. If your script is old, overwrite *all* 1725e9f7eabcSmrgcopies of config.guess and config.sub with the latest versions from: 172650806d53Smrg 1727e9f7eabcSmrg https://git.savannah.gnu.org/cgit/config.git/plain/config.guess 17287965d9acSmrgand 1729e9f7eabcSmrg https://git.savannah.gnu.org/cgit/config.git/plain/config.sub 1730e9f7eabcSmrgEOF 173150806d53Smrg 1732e9f7eabcSmrgour_year=`echo $timestamp | sed 's,-.*,,'` 1733e9f7eabcSmrgthisyear=`date +%Y` 1734e9f7eabcSmrg# shellcheck disable=SC2003 1735e9f7eabcSmrgscript_age=`expr "$thisyear" - "$our_year"` 1736e9f7eabcSmrgif test "$script_age" -lt 3 ; then 1737e9f7eabcSmrg cat >&2 <<EOF 1738e9f7eabcSmrg 1739e9f7eabcSmrgIf $0 has already been updated, send the following data and any 1740e9f7eabcSmrginformation you think might be pertinent to config-patches@gnu.org to 1741e9f7eabcSmrgprovide the necessary information to handle your system. 174250806d53Smrg 174350806d53Smrgconfig.guess timestamp = $timestamp 174450806d53Smrg 174550806d53Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 174650806d53Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 174750806d53Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 174850806d53Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 174950806d53Smrg 175050806d53Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 175150806d53Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 175250806d53Smrg 175350806d53Smrghostinfo = `(hostinfo) 2>/dev/null` 175450806d53Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 175550806d53Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 175650806d53Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 175750806d53Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 175850806d53Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 175950806d53Smrg 1760e9f7eabcSmrgUNAME_MACHINE = "$UNAME_MACHINE" 1761e9f7eabcSmrgUNAME_RELEASE = "$UNAME_RELEASE" 1762e9f7eabcSmrgUNAME_SYSTEM = "$UNAME_SYSTEM" 1763e9f7eabcSmrgUNAME_VERSION = "$UNAME_VERSION" 176450806d53SmrgEOF 1765e9f7eabcSmrgfi 176650806d53Smrg 176750806d53Smrgexit 1 176850806d53Smrg 176950806d53Smrg# Local variables: 1770e9f7eabcSmrg# eval: (add-hook 'before-save-hook 'time-stamp) 177150806d53Smrg# time-stamp-start: "timestamp='" 177250806d53Smrg# time-stamp-format: "%:y-%02m-%02d" 177350806d53Smrg# time-stamp-end: "'" 177450806d53Smrg# End: 1775