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