1117610Sdes#! /bin/sh 2117610Sdes# Attempt to guess a canonical system name. 3263421Sdes# Copyright 1992-2013 Free Software Foundation, Inc. 4117610Sdes 5263421Sdestimestamp='2013-05-16' 6117610Sdes 7117610Sdes# This file is free software; you can redistribute it and/or modify it 8117610Sdes# under the terms of the GNU General Public License as published by 9263421Sdes# the Free Software Foundation; either version 3 of the License, or 10117610Sdes# (at your option) any later version. 11117610Sdes# 12117610Sdes# This program is distributed in the hope that it will be useful, but 13117610Sdes# WITHOUT ANY WARRANTY; without even the implied warranty of 14117610Sdes# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15117610Sdes# General Public License for more details. 16117610Sdes# 17117610Sdes# You should have received a copy of the GNU General Public License 18263421Sdes# along with this program; if not, see <http://www.gnu.org/licenses/>. 19117610Sdes# 20117610Sdes# As a special exception to the GNU General Public License, if you 21117610Sdes# distribute this file as part of a program that contains a 22117610Sdes# configuration script generated by Autoconf, you may include it under 23263421Sdes# the same distribution terms that you use for the rest of that 24263421Sdes# program. This Exception is an additional permission under section 7 25263421Sdes# of the GNU General Public License, version 3 ("GPLv3"). 26117610Sdes# 27263421Sdes# Originally written by Per Bothner. 28117610Sdes# 29263421Sdes# You can get the latest version of this script from: 30263421Sdes# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 31263421Sdes# 32263421Sdes# Please send patches with a ChangeLog entry to config-patches@gnu.org. 33117610Sdes 34263421Sdes 35117610Sdesme=`echo "$0" | sed -e 's,.*/,,'` 36117610Sdes 37117610Sdesusage="\ 38117610SdesUsage: $0 [OPTION] 39117610Sdes 40117610SdesOutput the configuration name of the system \`$me' is run on. 41117610Sdes 42117610SdesOperation modes: 43117610Sdes -h, --help print this help, then exit 44117610Sdes -t, --time-stamp print date of last modification, then exit 45117610Sdes -v, --version print version number, then exit 46117610Sdes 47117610SdesReport bugs and patches to <config-patches@gnu.org>." 48117610Sdes 49117610Sdesversion="\ 50117610SdesGNU config.guess ($timestamp) 51117610Sdes 52117610SdesOriginally written by Per Bothner. 53263421SdesCopyright 1992-2013 Free Software Foundation, Inc. 54117610Sdes 55117610SdesThis is free software; see the source for copying conditions. There is NO 56117610Sdeswarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 57117610Sdes 58117610Sdeshelp=" 59117610SdesTry \`$me --help' for more information." 60117610Sdes 61117610Sdes# Parse command line 62117610Sdeswhile test $# -gt 0 ; do 63117610Sdes case $1 in 64117610Sdes --time-stamp | --time* | -t ) 65263421Sdes echo "$timestamp" ; exit ;; 66117610Sdes --version | -v ) 67263421Sdes echo "$version" ; exit ;; 68117610Sdes --help | --h* | -h ) 69263421Sdes echo "$usage"; exit ;; 70117610Sdes -- ) # Stop option processing 71117610Sdes shift; break ;; 72117610Sdes - ) # Use stdin as input. 73117610Sdes break ;; 74117610Sdes -* ) 75117610Sdes echo "$me: invalid option $1$help" >&2 76117610Sdes exit 1 ;; 77117610Sdes * ) 78117610Sdes break ;; 79117610Sdes esac 80117610Sdesdone 81117610Sdes 82117610Sdesif test $# != 0; then 83117610Sdes echo "$me: too many arguments$help" >&2 84117610Sdes exit 1 85117610Sdesfi 86117610Sdes 87117610Sdestrap 'exit 1' 1 2 15 88117610Sdes 89117610Sdes# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 90117610Sdes# compiler to aid in system detection is discouraged as it requires 91117610Sdes# temporary files to be created and, as you can see below, it is a 92117610Sdes# headache to deal with in a portable fashion. 93117610Sdes 94117610Sdes# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 95117610Sdes# use `HOST_CC' if defined, but it is deprecated. 96117610Sdes 97117610Sdes# Portable tmp directory creation inspired by the Autoconf team. 98117610Sdes 99117610Sdesset_cc_for_build=' 100117610Sdestrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 101117610Sdestrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 102117610Sdes: ${TMPDIR=/tmp} ; 103263421Sdes { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 104117610Sdes { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 105117610Sdes { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 106117610Sdes { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 107117610Sdesdummy=$tmp/dummy ; 108117610Sdestmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 109117610Sdescase $CC_FOR_BUILD,$HOST_CC,$CC in 110117610Sdes ,,) echo "int x;" > $dummy.c ; 111117610Sdes for c in cc gcc c89 c99 ; do 112117610Sdes if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 113117610Sdes CC_FOR_BUILD="$c"; break ; 114117610Sdes fi ; 115117610Sdes done ; 116117610Sdes if test x"$CC_FOR_BUILD" = x ; then 117117610Sdes CC_FOR_BUILD=no_compiler_found ; 118117610Sdes fi 119117610Sdes ;; 120117610Sdes ,,*) CC_FOR_BUILD=$CC ;; 121117610Sdes ,*,*) CC_FOR_BUILD=$HOST_CC ;; 122263421Sdesesac ; set_cc_for_build= ;' 123117610Sdes 124117610Sdes# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 125117610Sdes# (ghazi@noc.rutgers.edu 1994-08-24) 126117610Sdesif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 127117610Sdes PATH=$PATH:/.attbin ; export PATH 128117610Sdesfi 129117610Sdes 130117610SdesUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 131117610SdesUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 132117610SdesUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 133117610SdesUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 134117610Sdes 135263421Sdescase "${UNAME_SYSTEM}" in 136263421SdesLinux|GNU|GNU/*) 137263421Sdes # If the system lacks a compiler, then just pick glibc. 138263421Sdes # We could probably try harder. 139263421Sdes LIBC=gnu 140263421Sdes 141263421Sdes eval $set_cc_for_build 142263421Sdes cat <<-EOF > $dummy.c 143263421Sdes #include <features.h> 144263421Sdes #if defined(__UCLIBC__) 145263421Sdes LIBC=uclibc 146263421Sdes #elif defined(__dietlibc__) 147263421Sdes LIBC=dietlibc 148263421Sdes #else 149263421Sdes LIBC=gnu 150263421Sdes #endif 151263421Sdes EOF 152263421Sdes eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 153263421Sdes ;; 154263421Sdesesac 155263421Sdes 156117610Sdes# Note: order is significant - the case branches are not exclusive. 157117610Sdes 158117610Sdescase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 159117610Sdes *:NetBSD:*:*) 160117610Sdes # NetBSD (nbsd) targets should (where applicable) match one or 161263421Sdes # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 162117610Sdes # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 163117610Sdes # switched to ELF, *-*-netbsd* would select the old 164117610Sdes # object file format. This provides both forward 165117610Sdes # compatibility and a consistent mechanism for selecting the 166117610Sdes # object file format. 167117610Sdes # 168117610Sdes # Note: NetBSD doesn't particularly care about the vendor 169117610Sdes # portion of the name. We always set it to "unknown". 170117610Sdes sysctl="sysctl -n hw.machine_arch" 171117610Sdes UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 172117610Sdes /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 173117610Sdes case "${UNAME_MACHINE_ARCH}" in 174117610Sdes armeb) machine=armeb-unknown ;; 175117610Sdes arm*) machine=arm-unknown ;; 176117610Sdes sh3el) machine=shl-unknown ;; 177117610Sdes sh3eb) machine=sh-unknown ;; 178263421Sdes sh5el) machine=sh5le-unknown ;; 179117610Sdes *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 180117610Sdes esac 181117610Sdes # The Operating System including object format, if it has switched 182117610Sdes # to ELF recently, or will in the future. 183117610Sdes case "${UNAME_MACHINE_ARCH}" in 184117610Sdes arm*|i386|m68k|ns32k|sh3*|sparc|vax) 185117610Sdes eval $set_cc_for_build 186117610Sdes if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 187263421Sdes | grep -q __ELF__ 188117610Sdes then 189117610Sdes # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 190117610Sdes # Return netbsd for either. FIX? 191117610Sdes os=netbsd 192117610Sdes else 193117610Sdes os=netbsdelf 194117610Sdes fi 195117610Sdes ;; 196117610Sdes *) 197263421Sdes os=netbsd 198117610Sdes ;; 199117610Sdes esac 200117610Sdes # The OS release 201117610Sdes # Debian GNU/NetBSD machines have a different userland, and 202117610Sdes # thus, need a distinct triplet. However, they do not need 203117610Sdes # kernel version information, so it can be replaced with a 204117610Sdes # suitable tag, in the style of linux-gnu. 205117610Sdes case "${UNAME_VERSION}" in 206117610Sdes Debian*) 207117610Sdes release='-gnu' 208117610Sdes ;; 209117610Sdes *) 210117610Sdes release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 211117610Sdes ;; 212117610Sdes esac 213117610Sdes # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 214117610Sdes # contains redundant information, the shorter form: 215117610Sdes # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 216117610Sdes echo "${machine}-${os}${release}" 217263421Sdes exit ;; 218263421Sdes *:Bitrig:*:*) 219263421Sdes UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 220263421Sdes echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} 221263421Sdes exit ;; 222117610Sdes *:OpenBSD:*:*) 223263421Sdes UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 224263421Sdes echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 225263421Sdes exit ;; 226263421Sdes *:ekkoBSD:*:*) 227263421Sdes echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 228263421Sdes exit ;; 229263421Sdes *:SolidBSD:*:*) 230263421Sdes echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 231263421Sdes exit ;; 232263421Sdes macppc:MirBSD:*:*) 233263421Sdes echo powerpc-unknown-mirbsd${UNAME_RELEASE} 234263421Sdes exit ;; 235263421Sdes *:MirBSD:*:*) 236263421Sdes echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 237263421Sdes exit ;; 238117610Sdes alpha:OSF1:*:*) 239263421Sdes case $UNAME_RELEASE in 240263421Sdes *4.0) 241117610Sdes UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 242263421Sdes ;; 243263421Sdes *5.*) 244263421Sdes UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 245263421Sdes ;; 246263421Sdes esac 247117610Sdes # According to Compaq, /usr/sbin/psrinfo has been available on 248117610Sdes # OSF/1 and Tru64 systems produced since 1995. I hope that 249117610Sdes # covers most systems running today. This code pipes the CPU 250117610Sdes # types through head -n 1, so we only detect the type of CPU 0. 251117610Sdes ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 252117610Sdes case "$ALPHA_CPU_TYPE" in 253117610Sdes "EV4 (21064)") 254117610Sdes UNAME_MACHINE="alpha" ;; 255117610Sdes "EV4.5 (21064)") 256117610Sdes UNAME_MACHINE="alpha" ;; 257117610Sdes "LCA4 (21066/21068)") 258117610Sdes UNAME_MACHINE="alpha" ;; 259117610Sdes "EV5 (21164)") 260117610Sdes UNAME_MACHINE="alphaev5" ;; 261117610Sdes "EV5.6 (21164A)") 262117610Sdes UNAME_MACHINE="alphaev56" ;; 263117610Sdes "EV5.6 (21164PC)") 264117610Sdes UNAME_MACHINE="alphapca56" ;; 265117610Sdes "EV5.7 (21164PC)") 266117610Sdes UNAME_MACHINE="alphapca57" ;; 267117610Sdes "EV6 (21264)") 268117610Sdes UNAME_MACHINE="alphaev6" ;; 269117610Sdes "EV6.7 (21264A)") 270117610Sdes UNAME_MACHINE="alphaev67" ;; 271117610Sdes "EV6.8CB (21264C)") 272117610Sdes UNAME_MACHINE="alphaev68" ;; 273117610Sdes "EV6.8AL (21264B)") 274117610Sdes UNAME_MACHINE="alphaev68" ;; 275117610Sdes "EV6.8CX (21264D)") 276117610Sdes UNAME_MACHINE="alphaev68" ;; 277117610Sdes "EV6.9A (21264/EV69A)") 278117610Sdes UNAME_MACHINE="alphaev69" ;; 279117610Sdes "EV7 (21364)") 280117610Sdes UNAME_MACHINE="alphaev7" ;; 281117610Sdes "EV7.9 (21364A)") 282117610Sdes UNAME_MACHINE="alphaev79" ;; 283117610Sdes esac 284263421Sdes # A Pn.n version is a patched version. 285117610Sdes # A Vn.n version is a released version. 286117610Sdes # A Tn.n version is a released field test version. 287117610Sdes # A Xn.n version is an unreleased experimental baselevel. 288117610Sdes # 1.2 uses "1.2" for uname -r. 289263421Sdes echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 290263421Sdes # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 291263421Sdes exitcode=$? 292263421Sdes trap '' 0 293263421Sdes exit $exitcode ;; 294117610Sdes Alpha\ *:Windows_NT*:*) 295117610Sdes # How do we know it's Interix rather than the generic POSIX subsystem? 296117610Sdes # Should we change UNAME_MACHINE based on the output of uname instead 297117610Sdes # of the specific Alpha model? 298117610Sdes echo alpha-pc-interix 299263421Sdes exit ;; 300117610Sdes 21064:Windows_NT:50:3) 301117610Sdes echo alpha-dec-winnt3.5 302263421Sdes exit ;; 303117610Sdes Amiga*:UNIX_System_V:4.0:*) 304117610Sdes echo m68k-unknown-sysv4 305263421Sdes exit ;; 306117610Sdes *:[Aa]miga[Oo][Ss]:*:*) 307117610Sdes echo ${UNAME_MACHINE}-unknown-amigaos 308263421Sdes exit ;; 309117610Sdes *:[Mm]orph[Oo][Ss]:*:*) 310117610Sdes echo ${UNAME_MACHINE}-unknown-morphos 311263421Sdes exit ;; 312117610Sdes *:OS/390:*:*) 313117610Sdes echo i370-ibm-openedition 314263421Sdes exit ;; 315263421Sdes *:z/VM:*:*) 316263421Sdes echo s390-ibm-zvmoe 317263421Sdes exit ;; 318263421Sdes *:OS400:*:*) 319263421Sdes echo powerpc-ibm-os400 320263421Sdes exit ;; 321117610Sdes arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 322117610Sdes echo arm-acorn-riscix${UNAME_RELEASE} 323263421Sdes exit ;; 324263421Sdes arm*:riscos:*:*|arm*:RISCOS:*:*) 325263421Sdes echo arm-unknown-riscos 326263421Sdes exit ;; 327117610Sdes SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 328117610Sdes echo hppa1.1-hitachi-hiuxmpp 329263421Sdes exit ;; 330117610Sdes Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 331117610Sdes # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 332117610Sdes if test "`(/bin/universe) 2>/dev/null`" = att ; then 333117610Sdes echo pyramid-pyramid-sysv3 334117610Sdes else 335117610Sdes echo pyramid-pyramid-bsd 336117610Sdes fi 337263421Sdes exit ;; 338117610Sdes NILE*:*:*:dcosx) 339117610Sdes echo pyramid-pyramid-svr4 340263421Sdes exit ;; 341117610Sdes DRS?6000:unix:4.0:6*) 342117610Sdes echo sparc-icl-nx6 343263421Sdes exit ;; 344263421Sdes DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 345117610Sdes case `/usr/bin/uname -p` in 346263421Sdes sparc) echo sparc-icl-nx7; exit ;; 347117610Sdes esac ;; 348263421Sdes s390x:SunOS:*:*) 349263421Sdes echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 350263421Sdes exit ;; 351117610Sdes sun4H:SunOS:5.*:*) 352117610Sdes echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 353263421Sdes exit ;; 354117610Sdes sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 355117610Sdes echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 356263421Sdes exit ;; 357263421Sdes i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 358263421Sdes echo i386-pc-auroraux${UNAME_RELEASE} 359263421Sdes exit ;; 360263421Sdes i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 361263421Sdes eval $set_cc_for_build 362263421Sdes SUN_ARCH="i386" 363263421Sdes # If there is a compiler, see if it is configured for 64-bit objects. 364263421Sdes # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 365263421Sdes # This test works for both compilers. 366263421Sdes if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 367263421Sdes if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 368263421Sdes (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 369263421Sdes grep IS_64BIT_ARCH >/dev/null 370263421Sdes then 371263421Sdes SUN_ARCH="x86_64" 372263421Sdes fi 373263421Sdes fi 374263421Sdes echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 375263421Sdes exit ;; 376117610Sdes sun4*:SunOS:6*:*) 377117610Sdes # According to config.sub, this is the proper way to canonicalize 378117610Sdes # SunOS6. Hard to guess exactly what SunOS6 will be like, but 379117610Sdes # it's likely to be more like Solaris than SunOS4. 380117610Sdes echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 381263421Sdes exit ;; 382117610Sdes sun4*:SunOS:*:*) 383117610Sdes case "`/usr/bin/arch -k`" in 384117610Sdes Series*|S4*) 385117610Sdes UNAME_RELEASE=`uname -v` 386117610Sdes ;; 387117610Sdes esac 388117610Sdes # Japanese Language versions have a version number like `4.1.3-JL'. 389117610Sdes echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 390263421Sdes exit ;; 391117610Sdes sun3*:SunOS:*:*) 392117610Sdes echo m68k-sun-sunos${UNAME_RELEASE} 393263421Sdes exit ;; 394117610Sdes sun*:*:4.2BSD:*) 395117610Sdes UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 396117610Sdes test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 397117610Sdes case "`/bin/arch`" in 398117610Sdes sun3) 399117610Sdes echo m68k-sun-sunos${UNAME_RELEASE} 400117610Sdes ;; 401117610Sdes sun4) 402117610Sdes echo sparc-sun-sunos${UNAME_RELEASE} 403117610Sdes ;; 404117610Sdes esac 405263421Sdes exit ;; 406117610Sdes aushp:SunOS:*:*) 407117610Sdes echo sparc-auspex-sunos${UNAME_RELEASE} 408263421Sdes exit ;; 409117610Sdes # The situation for MiNT is a little confusing. The machine name 410117610Sdes # can be virtually everything (everything which is not 411117610Sdes # "atarist" or "atariste" at least should have a processor 412117610Sdes # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 413117610Sdes # to the lowercase version "mint" (or "freemint"). Finally 414117610Sdes # the system name "TOS" denotes a system which is actually not 415117610Sdes # MiNT. But MiNT is downward compatible to TOS, so this should 416117610Sdes # be no problem. 417117610Sdes atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 418263421Sdes echo m68k-atari-mint${UNAME_RELEASE} 419263421Sdes exit ;; 420117610Sdes atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 421117610Sdes echo m68k-atari-mint${UNAME_RELEASE} 422263421Sdes exit ;; 423117610Sdes *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 424263421Sdes echo m68k-atari-mint${UNAME_RELEASE} 425263421Sdes exit ;; 426117610Sdes milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 427263421Sdes echo m68k-milan-mint${UNAME_RELEASE} 428263421Sdes exit ;; 429117610Sdes hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 430263421Sdes echo m68k-hades-mint${UNAME_RELEASE} 431263421Sdes exit ;; 432117610Sdes *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 433263421Sdes echo m68k-unknown-mint${UNAME_RELEASE} 434263421Sdes exit ;; 435263421Sdes m68k:machten:*:*) 436263421Sdes echo m68k-apple-machten${UNAME_RELEASE} 437263421Sdes exit ;; 438117610Sdes powerpc:machten:*:*) 439117610Sdes echo powerpc-apple-machten${UNAME_RELEASE} 440263421Sdes exit ;; 441117610Sdes RISC*:Mach:*:*) 442117610Sdes echo mips-dec-mach_bsd4.3 443263421Sdes exit ;; 444117610Sdes RISC*:ULTRIX:*:*) 445117610Sdes echo mips-dec-ultrix${UNAME_RELEASE} 446263421Sdes exit ;; 447117610Sdes VAX*:ULTRIX*:*:*) 448117610Sdes echo vax-dec-ultrix${UNAME_RELEASE} 449263421Sdes exit ;; 450117610Sdes 2020:CLIX:*:* | 2430:CLIX:*:*) 451117610Sdes echo clipper-intergraph-clix${UNAME_RELEASE} 452263421Sdes exit ;; 453117610Sdes mips:*:*:UMIPS | mips:*:*:RISCos) 454117610Sdes eval $set_cc_for_build 455117610Sdes sed 's/^ //' << EOF >$dummy.c 456117610Sdes#ifdef __cplusplus 457117610Sdes#include <stdio.h> /* for printf() prototype */ 458117610Sdes int main (int argc, char *argv[]) { 459117610Sdes#else 460117610Sdes int main (argc, argv) int argc; char *argv[]; { 461117610Sdes#endif 462117610Sdes #if defined (host_mips) && defined (MIPSEB) 463117610Sdes #if defined (SYSTYPE_SYSV) 464117610Sdes printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 465117610Sdes #endif 466117610Sdes #if defined (SYSTYPE_SVR4) 467117610Sdes printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 468117610Sdes #endif 469117610Sdes #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 470117610Sdes printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 471117610Sdes #endif 472117610Sdes #endif 473117610Sdes exit (-1); 474117610Sdes } 475117610SdesEOF 476263421Sdes $CC_FOR_BUILD -o $dummy $dummy.c && 477263421Sdes dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 478263421Sdes SYSTEM_NAME=`$dummy $dummyarg` && 479263421Sdes { echo "$SYSTEM_NAME"; exit; } 480117610Sdes echo mips-mips-riscos${UNAME_RELEASE} 481263421Sdes exit ;; 482117610Sdes Motorola:PowerMAX_OS:*:*) 483117610Sdes echo powerpc-motorola-powermax 484263421Sdes exit ;; 485117610Sdes Motorola:*:4.3:PL8-*) 486117610Sdes echo powerpc-harris-powermax 487263421Sdes exit ;; 488117610Sdes Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 489117610Sdes echo powerpc-harris-powermax 490263421Sdes exit ;; 491117610Sdes Night_Hawk:Power_UNIX:*:*) 492117610Sdes echo powerpc-harris-powerunix 493263421Sdes exit ;; 494117610Sdes m88k:CX/UX:7*:*) 495117610Sdes echo m88k-harris-cxux7 496263421Sdes exit ;; 497117610Sdes m88k:*:4*:R4*) 498117610Sdes echo m88k-motorola-sysv4 499263421Sdes exit ;; 500117610Sdes m88k:*:3*:R3*) 501117610Sdes echo m88k-motorola-sysv3 502263421Sdes exit ;; 503117610Sdes AViiON:dgux:*:*) 504263421Sdes # DG/UX returns AViiON for all architectures 505263421Sdes UNAME_PROCESSOR=`/usr/bin/uname -p` 506117610Sdes if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 507117610Sdes then 508117610Sdes if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 509117610Sdes [ ${TARGET_BINARY_INTERFACE}x = x ] 510117610Sdes then 511117610Sdes echo m88k-dg-dgux${UNAME_RELEASE} 512117610Sdes else 513117610Sdes echo m88k-dg-dguxbcs${UNAME_RELEASE} 514117610Sdes fi 515117610Sdes else 516117610Sdes echo i586-dg-dgux${UNAME_RELEASE} 517117610Sdes fi 518263421Sdes exit ;; 519117610Sdes M88*:DolphinOS:*:*) # DolphinOS (SVR3) 520117610Sdes echo m88k-dolphin-sysv3 521263421Sdes exit ;; 522117610Sdes M88*:*:R3*:*) 523117610Sdes # Delta 88k system running SVR3 524117610Sdes echo m88k-motorola-sysv3 525263421Sdes exit ;; 526117610Sdes XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 527117610Sdes echo m88k-tektronix-sysv3 528263421Sdes exit ;; 529117610Sdes Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 530117610Sdes echo m68k-tektronix-bsd 531263421Sdes exit ;; 532117610Sdes *:IRIX*:*:*) 533117610Sdes echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 534263421Sdes exit ;; 535117610Sdes ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 536263421Sdes echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 537263421Sdes exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 538117610Sdes i*86:AIX:*:*) 539117610Sdes echo i386-ibm-aix 540263421Sdes exit ;; 541117610Sdes ia64:AIX:*:*) 542117610Sdes if [ -x /usr/bin/oslevel ] ; then 543117610Sdes IBM_REV=`/usr/bin/oslevel` 544117610Sdes else 545117610Sdes IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 546117610Sdes fi 547117610Sdes echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 548263421Sdes exit ;; 549117610Sdes *:AIX:2:3) 550117610Sdes if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 551117610Sdes eval $set_cc_for_build 552117610Sdes sed 's/^ //' << EOF >$dummy.c 553117610Sdes #include <sys/systemcfg.h> 554117610Sdes 555117610Sdes main() 556117610Sdes { 557117610Sdes if (!__power_pc()) 558117610Sdes exit(1); 559117610Sdes puts("powerpc-ibm-aix3.2.5"); 560117610Sdes exit(0); 561117610Sdes } 562117610SdesEOF 563263421Sdes if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 564263421Sdes then 565263421Sdes echo "$SYSTEM_NAME" 566263421Sdes else 567263421Sdes echo rs6000-ibm-aix3.2.5 568263421Sdes fi 569117610Sdes elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 570117610Sdes echo rs6000-ibm-aix3.2.4 571117610Sdes else 572117610Sdes echo rs6000-ibm-aix3.2 573117610Sdes fi 574263421Sdes exit ;; 575263421Sdes *:AIX:*:[4567]) 576117610Sdes IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 577117610Sdes if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 578117610Sdes IBM_ARCH=rs6000 579117610Sdes else 580117610Sdes IBM_ARCH=powerpc 581117610Sdes fi 582117610Sdes if [ -x /usr/bin/oslevel ] ; then 583117610Sdes IBM_REV=`/usr/bin/oslevel` 584117610Sdes else 585117610Sdes IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 586117610Sdes fi 587117610Sdes echo ${IBM_ARCH}-ibm-aix${IBM_REV} 588263421Sdes exit ;; 589117610Sdes *:AIX:*:*) 590117610Sdes echo rs6000-ibm-aix 591263421Sdes exit ;; 592117610Sdes ibmrt:4.4BSD:*|romp-ibm:BSD:*) 593117610Sdes echo romp-ibm-bsd4.4 594263421Sdes exit ;; 595117610Sdes ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 596117610Sdes echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 597263421Sdes exit ;; # report: romp-ibm BSD 4.3 598117610Sdes *:BOSX:*:*) 599117610Sdes echo rs6000-bull-bosx 600263421Sdes exit ;; 601117610Sdes DPX/2?00:B.O.S.:*:*) 602117610Sdes echo m68k-bull-sysv3 603263421Sdes exit ;; 604117610Sdes 9000/[34]??:4.3bsd:1.*:*) 605117610Sdes echo m68k-hp-bsd 606263421Sdes exit ;; 607117610Sdes hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 608117610Sdes echo m68k-hp-bsd4.4 609263421Sdes exit ;; 610117610Sdes 9000/[34678]??:HP-UX:*:*) 611117610Sdes HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 612117610Sdes case "${UNAME_MACHINE}" in 613117610Sdes 9000/31? ) HP_ARCH=m68000 ;; 614117610Sdes 9000/[34]?? ) HP_ARCH=m68k ;; 615117610Sdes 9000/[678][0-9][0-9]) 616117610Sdes if [ -x /usr/bin/getconf ]; then 617117610Sdes sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 618263421Sdes sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 619263421Sdes case "${sc_cpu_version}" in 620263421Sdes 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 621263421Sdes 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 622263421Sdes 532) # CPU_PA_RISC2_0 623263421Sdes case "${sc_kernel_bits}" in 624263421Sdes 32) HP_ARCH="hppa2.0n" ;; 625263421Sdes 64) HP_ARCH="hppa2.0w" ;; 626117610Sdes '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 627263421Sdes esac ;; 628263421Sdes esac 629117610Sdes fi 630117610Sdes if [ "${HP_ARCH}" = "" ]; then 631117610Sdes eval $set_cc_for_build 632263421Sdes sed 's/^ //' << EOF >$dummy.c 633117610Sdes 634263421Sdes #define _HPUX_SOURCE 635263421Sdes #include <stdlib.h> 636263421Sdes #include <unistd.h> 637117610Sdes 638263421Sdes int main () 639263421Sdes { 640263421Sdes #if defined(_SC_KERNEL_BITS) 641263421Sdes long bits = sysconf(_SC_KERNEL_BITS); 642263421Sdes #endif 643263421Sdes long cpu = sysconf (_SC_CPU_VERSION); 644117610Sdes 645263421Sdes switch (cpu) 646263421Sdes { 647263421Sdes case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 648263421Sdes case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 649263421Sdes case CPU_PA_RISC2_0: 650263421Sdes #if defined(_SC_KERNEL_BITS) 651263421Sdes switch (bits) 652263421Sdes { 653263421Sdes case 64: puts ("hppa2.0w"); break; 654263421Sdes case 32: puts ("hppa2.0n"); break; 655263421Sdes default: puts ("hppa2.0"); break; 656263421Sdes } break; 657263421Sdes #else /* !defined(_SC_KERNEL_BITS) */ 658263421Sdes puts ("hppa2.0"); break; 659263421Sdes #endif 660263421Sdes default: puts ("hppa1.0"); break; 661263421Sdes } 662263421Sdes exit (0); 663263421Sdes } 664117610SdesEOF 665117610Sdes (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 666117610Sdes test -z "$HP_ARCH" && HP_ARCH=hppa 667117610Sdes fi ;; 668117610Sdes esac 669117610Sdes if [ ${HP_ARCH} = "hppa2.0w" ] 670117610Sdes then 671263421Sdes eval $set_cc_for_build 672263421Sdes 673263421Sdes # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 674263421Sdes # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 675263421Sdes # generating 64-bit code. GNU and HP use different nomenclature: 676263421Sdes # 677263421Sdes # $ CC_FOR_BUILD=cc ./config.guess 678263421Sdes # => hppa2.0w-hp-hpux11.23 679263421Sdes # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 680263421Sdes # => hppa64-hp-hpux11.23 681263421Sdes 682263421Sdes if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 683263421Sdes grep -q __LP64__ 684117610Sdes then 685117610Sdes HP_ARCH="hppa2.0w" 686117610Sdes else 687117610Sdes HP_ARCH="hppa64" 688117610Sdes fi 689117610Sdes fi 690117610Sdes echo ${HP_ARCH}-hp-hpux${HPUX_REV} 691263421Sdes exit ;; 692117610Sdes ia64:HP-UX:*:*) 693117610Sdes HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 694117610Sdes echo ia64-hp-hpux${HPUX_REV} 695263421Sdes exit ;; 696117610Sdes 3050*:HI-UX:*:*) 697117610Sdes eval $set_cc_for_build 698117610Sdes sed 's/^ //' << EOF >$dummy.c 699117610Sdes #include <unistd.h> 700117610Sdes int 701117610Sdes main () 702117610Sdes { 703117610Sdes long cpu = sysconf (_SC_CPU_VERSION); 704117610Sdes /* The order matters, because CPU_IS_HP_MC68K erroneously returns 705117610Sdes true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 706117610Sdes results, however. */ 707117610Sdes if (CPU_IS_PA_RISC (cpu)) 708117610Sdes { 709117610Sdes switch (cpu) 710117610Sdes { 711117610Sdes case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 712117610Sdes case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 713117610Sdes case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 714117610Sdes default: puts ("hppa-hitachi-hiuxwe2"); break; 715117610Sdes } 716117610Sdes } 717117610Sdes else if (CPU_IS_HP_MC68K (cpu)) 718117610Sdes puts ("m68k-hitachi-hiuxwe2"); 719117610Sdes else puts ("unknown-hitachi-hiuxwe2"); 720117610Sdes exit (0); 721117610Sdes } 722117610SdesEOF 723263421Sdes $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 724263421Sdes { echo "$SYSTEM_NAME"; exit; } 725117610Sdes echo unknown-hitachi-hiuxwe2 726263421Sdes exit ;; 727117610Sdes 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 728117610Sdes echo hppa1.1-hp-bsd 729263421Sdes exit ;; 730117610Sdes 9000/8??:4.3bsd:*:*) 731117610Sdes echo hppa1.0-hp-bsd 732263421Sdes exit ;; 733117610Sdes *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 734117610Sdes echo hppa1.0-hp-mpeix 735263421Sdes exit ;; 736117610Sdes hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 737117610Sdes echo hppa1.1-hp-osf 738263421Sdes exit ;; 739117610Sdes hp8??:OSF1:*:*) 740117610Sdes echo hppa1.0-hp-osf 741263421Sdes exit ;; 742117610Sdes i*86:OSF1:*:*) 743117610Sdes if [ -x /usr/sbin/sysversion ] ; then 744117610Sdes echo ${UNAME_MACHINE}-unknown-osf1mk 745117610Sdes else 746117610Sdes echo ${UNAME_MACHINE}-unknown-osf1 747117610Sdes fi 748263421Sdes exit ;; 749117610Sdes parisc*:Lites*:*:*) 750117610Sdes echo hppa1.1-hp-lites 751263421Sdes exit ;; 752117610Sdes C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 753117610Sdes echo c1-convex-bsd 754263421Sdes exit ;; 755117610Sdes C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 756117610Sdes if getsysinfo -f scalar_acc 757117610Sdes then echo c32-convex-bsd 758117610Sdes else echo c2-convex-bsd 759117610Sdes fi 760263421Sdes exit ;; 761117610Sdes C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 762117610Sdes echo c34-convex-bsd 763263421Sdes exit ;; 764117610Sdes C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 765117610Sdes echo c38-convex-bsd 766263421Sdes exit ;; 767117610Sdes C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 768117610Sdes echo c4-convex-bsd 769263421Sdes exit ;; 770117610Sdes CRAY*Y-MP:*:*:*) 771117610Sdes echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 772263421Sdes exit ;; 773117610Sdes CRAY*[A-Z]90:*:*:*) 774117610Sdes echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 775117610Sdes | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 776117610Sdes -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 777117610Sdes -e 's/\.[^.]*$/.X/' 778263421Sdes exit ;; 779117610Sdes CRAY*TS:*:*:*) 780117610Sdes echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 781263421Sdes exit ;; 782117610Sdes CRAY*T3E:*:*:*) 783117610Sdes echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 784263421Sdes exit ;; 785117610Sdes CRAY*SV1:*:*:*) 786117610Sdes echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 787263421Sdes exit ;; 788117610Sdes *:UNICOS/mp:*:*) 789263421Sdes echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 790263421Sdes exit ;; 791117610Sdes F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 792117610Sdes FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 793263421Sdes FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 794263421Sdes FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 795263421Sdes echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 796263421Sdes exit ;; 797263421Sdes 5000:UNIX_System_V:4.*:*) 798263421Sdes FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 799263421Sdes FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 800263421Sdes echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 801263421Sdes exit ;; 802117610Sdes i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 803117610Sdes echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 804263421Sdes exit ;; 805117610Sdes sparc*:BSD/OS:*:*) 806117610Sdes echo sparc-unknown-bsdi${UNAME_RELEASE} 807263421Sdes exit ;; 808117610Sdes *:BSD/OS:*:*) 809117610Sdes echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 810263421Sdes exit ;; 811263421Sdes *:FreeBSD:*:*) 812263421Sdes UNAME_PROCESSOR=`/usr/bin/uname -p` 813263421Sdes echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 814263421Sdes exit ;; 815117610Sdes i*:CYGWIN*:*) 816117610Sdes echo ${UNAME_MACHINE}-pc-cygwin 817263421Sdes exit ;; 818263421Sdes *:MINGW64*:*) 819263421Sdes echo ${UNAME_MACHINE}-pc-mingw64 820263421Sdes exit ;; 821263421Sdes *:MINGW*:*) 822117610Sdes echo ${UNAME_MACHINE}-pc-mingw32 823263421Sdes exit ;; 824263421Sdes i*:MSYS*:*) 825263421Sdes echo ${UNAME_MACHINE}-pc-msys 826263421Sdes exit ;; 827263421Sdes i*:windows32*:*) 828263421Sdes # uname -m includes "-pc" on this system. 829263421Sdes echo ${UNAME_MACHINE}-mingw32 830263421Sdes exit ;; 831117610Sdes i*:PW*:*) 832117610Sdes echo ${UNAME_MACHINE}-pc-pw32 833263421Sdes exit ;; 834263421Sdes *:Interix*:*) 835263421Sdes case ${UNAME_MACHINE} in 836263421Sdes x86) 837263421Sdes echo i586-pc-interix${UNAME_RELEASE} 838263421Sdes exit ;; 839263421Sdes authenticamd | genuineintel | EM64T) 840263421Sdes echo x86_64-unknown-interix${UNAME_RELEASE} 841263421Sdes exit ;; 842263421Sdes IA64) 843263421Sdes echo ia64-unknown-interix${UNAME_RELEASE} 844263421Sdes exit ;; 845263421Sdes esac ;; 846117610Sdes [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 847117610Sdes echo i${UNAME_MACHINE}-pc-mks 848263421Sdes exit ;; 849263421Sdes 8664:Windows_NT:*) 850263421Sdes echo x86_64-pc-mks 851263421Sdes exit ;; 852117610Sdes i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 853117610Sdes # How do we know it's Interix rather than the generic POSIX subsystem? 854117610Sdes # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 855117610Sdes # UNAME_MACHINE based on the output of uname instead of i386? 856117610Sdes echo i586-pc-interix 857263421Sdes exit ;; 858117610Sdes i*:UWIN*:*) 859117610Sdes echo ${UNAME_MACHINE}-pc-uwin 860263421Sdes exit ;; 861263421Sdes amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 862263421Sdes echo x86_64-unknown-cygwin 863263421Sdes exit ;; 864117610Sdes p*:CYGWIN*:*) 865117610Sdes echo powerpcle-unknown-cygwin 866263421Sdes exit ;; 867117610Sdes prep*:SunOS:5.*:*) 868117610Sdes echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 869263421Sdes exit ;; 870117610Sdes *:GNU:*:*) 871263421Sdes # the GNU system 872263421Sdes echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 873263421Sdes exit ;; 874263421Sdes *:GNU/*:*:*) 875263421Sdes # other systems with GNU libc and userland 876263421Sdes echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} 877263421Sdes exit ;; 878117610Sdes i*86:Minix:*:*) 879117610Sdes echo ${UNAME_MACHINE}-pc-minix 880263421Sdes exit ;; 881263421Sdes aarch64:Linux:*:*) 882263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 883263421Sdes exit ;; 884263421Sdes aarch64_be:Linux:*:*) 885263421Sdes UNAME_MACHINE=aarch64_be 886263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 887263421Sdes exit ;; 888263421Sdes alpha:Linux:*:*) 889263421Sdes case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 890263421Sdes EV5) UNAME_MACHINE=alphaev5 ;; 891263421Sdes EV56) UNAME_MACHINE=alphaev56 ;; 892263421Sdes PCA56) UNAME_MACHINE=alphapca56 ;; 893263421Sdes PCA57) UNAME_MACHINE=alphapca56 ;; 894263421Sdes EV6) UNAME_MACHINE=alphaev6 ;; 895263421Sdes EV67) UNAME_MACHINE=alphaev67 ;; 896263421Sdes EV68*) UNAME_MACHINE=alphaev68 ;; 897263421Sdes esac 898263421Sdes objdump --private-headers /bin/sh | grep -q ld.so.1 899263421Sdes if test "$?" = 0 ; then LIBC="gnulibc1" ; fi 900263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 901263421Sdes exit ;; 902263421Sdes arc:Linux:*:* | arceb:Linux:*:*) 903263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 904263421Sdes exit ;; 905117610Sdes arm*:Linux:*:*) 906263421Sdes eval $set_cc_for_build 907263421Sdes if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 908263421Sdes | grep -q __ARM_EABI__ 909263421Sdes then 910263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 911263421Sdes else 912263421Sdes if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 913263421Sdes | grep -q __ARM_PCS_VFP 914263421Sdes then 915263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi 916263421Sdes else 917263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf 918263421Sdes fi 919263421Sdes fi 920263421Sdes exit ;; 921263421Sdes avr32*:Linux:*:*) 922263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 923263421Sdes exit ;; 924117610Sdes cris:Linux:*:*) 925263421Sdes echo ${UNAME_MACHINE}-axis-linux-${LIBC} 926263421Sdes exit ;; 927263421Sdes crisv32:Linux:*:*) 928263421Sdes echo ${UNAME_MACHINE}-axis-linux-${LIBC} 929263421Sdes exit ;; 930263421Sdes frv:Linux:*:*) 931263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 932263421Sdes exit ;; 933263421Sdes hexagon:Linux:*:*) 934263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 935263421Sdes exit ;; 936263421Sdes i*86:Linux:*:*) 937263421Sdes echo ${UNAME_MACHINE}-pc-linux-${LIBC} 938263421Sdes exit ;; 939117610Sdes ia64:Linux:*:*) 940263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 941263421Sdes exit ;; 942263421Sdes m32r*:Linux:*:*) 943263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 944263421Sdes exit ;; 945117610Sdes m68*:Linux:*:*) 946263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 947263421Sdes exit ;; 948263421Sdes mips:Linux:*:* | mips64:Linux:*:*) 949117610Sdes eval $set_cc_for_build 950117610Sdes sed 's/^ //' << EOF >$dummy.c 951117610Sdes #undef CPU 952263421Sdes #undef ${UNAME_MACHINE} 953263421Sdes #undef ${UNAME_MACHINE}el 954117610Sdes #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 955263421Sdes CPU=${UNAME_MACHINE}el 956117610Sdes #else 957117610Sdes #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 958263421Sdes CPU=${UNAME_MACHINE} 959117610Sdes #else 960117610Sdes CPU= 961117610Sdes #endif 962117610Sdes #endif 963117610SdesEOF 964263421Sdes eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 965263421Sdes test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 966117610Sdes ;; 967263421Sdes or1k:Linux:*:*) 968263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 969263421Sdes exit ;; 970263421Sdes or32:Linux:*:*) 971263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 972263421Sdes exit ;; 973263421Sdes padre:Linux:*:*) 974263421Sdes echo sparc-unknown-linux-${LIBC} 975263421Sdes exit ;; 976263421Sdes parisc64:Linux:*:* | hppa64:Linux:*:*) 977263421Sdes echo hppa64-unknown-linux-${LIBC} 978263421Sdes exit ;; 979117610Sdes parisc:Linux:*:* | hppa:Linux:*:*) 980117610Sdes # Look for CPU level 981117610Sdes case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 982263421Sdes PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; 983263421Sdes PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; 984263421Sdes *) echo hppa-unknown-linux-${LIBC} ;; 985117610Sdes esac 986263421Sdes exit ;; 987263421Sdes ppc64:Linux:*:*) 988263421Sdes echo powerpc64-unknown-linux-${LIBC} 989263421Sdes exit ;; 990263421Sdes ppc:Linux:*:*) 991263421Sdes echo powerpc-unknown-linux-${LIBC} 992263421Sdes exit ;; 993117610Sdes s390:Linux:*:* | s390x:Linux:*:*) 994263421Sdes echo ${UNAME_MACHINE}-ibm-linux-${LIBC} 995263421Sdes exit ;; 996117610Sdes sh64*:Linux:*:*) 997263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 998263421Sdes exit ;; 999117610Sdes sh*:Linux:*:*) 1000263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1001263421Sdes exit ;; 1002117610Sdes sparc:Linux:*:* | sparc64:Linux:*:*) 1003263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1004263421Sdes exit ;; 1005263421Sdes tile*:Linux:*:*) 1006263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1007263421Sdes exit ;; 1008263421Sdes vax:Linux:*:*) 1009263421Sdes echo ${UNAME_MACHINE}-dec-linux-${LIBC} 1010263421Sdes exit ;; 1011117610Sdes x86_64:Linux:*:*) 1012263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1013263421Sdes exit ;; 1014263421Sdes xtensa*:Linux:*:*) 1015263421Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1016263421Sdes exit ;; 1017117610Sdes i*86:DYNIX/ptx:4*:*) 1018117610Sdes # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1019117610Sdes # earlier versions are messed up and put the nodename in both 1020117610Sdes # sysname and nodename. 1021117610Sdes echo i386-sequent-sysv4 1022263421Sdes exit ;; 1023117610Sdes i*86:UNIX_SV:4.2MP:2.*) 1024263421Sdes # Unixware is an offshoot of SVR4, but it has its own version 1025263421Sdes # number series starting with 2... 1026263421Sdes # I am not positive that other SVR4 systems won't match this, 1027117610Sdes # I just have to hope. -- rms. 1028263421Sdes # Use sysv4.2uw... so that sysv4* matches it. 1029117610Sdes echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 1030263421Sdes exit ;; 1031117610Sdes i*86:OS/2:*:*) 1032117610Sdes # If we were able to find `uname', then EMX Unix compatibility 1033117610Sdes # is probably installed. 1034117610Sdes echo ${UNAME_MACHINE}-pc-os2-emx 1035263421Sdes exit ;; 1036117610Sdes i*86:XTS-300:*:STOP) 1037117610Sdes echo ${UNAME_MACHINE}-unknown-stop 1038263421Sdes exit ;; 1039117610Sdes i*86:atheos:*:*) 1040117610Sdes echo ${UNAME_MACHINE}-unknown-atheos 1041263421Sdes exit ;; 1042263421Sdes i*86:syllable:*:*) 1043263421Sdes echo ${UNAME_MACHINE}-pc-syllable 1044263421Sdes exit ;; 1045263421Sdes i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1046117610Sdes echo i386-unknown-lynxos${UNAME_RELEASE} 1047263421Sdes exit ;; 1048117610Sdes i*86:*DOS:*:*) 1049117610Sdes echo ${UNAME_MACHINE}-pc-msdosdjgpp 1050263421Sdes exit ;; 1051117610Sdes i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 1052117610Sdes UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 1053117610Sdes if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1054117610Sdes echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 1055117610Sdes else 1056117610Sdes echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1057117610Sdes fi 1058263421Sdes exit ;; 1059263421Sdes i*86:*:5:[678]*) 1060263421Sdes # UnixWare 7.x, OpenUNIX and OpenServer 6. 1061117610Sdes case `/bin/uname -X | grep "^Machine"` in 1062117610Sdes *486*) UNAME_MACHINE=i486 ;; 1063117610Sdes *Pentium) UNAME_MACHINE=i586 ;; 1064117610Sdes *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1065117610Sdes esac 1066117610Sdes echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1067263421Sdes exit ;; 1068117610Sdes i*86:*:3.2:*) 1069117610Sdes if test -f /usr/options/cb.name; then 1070117610Sdes UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1071117610Sdes echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 1072117610Sdes elif /bin/uname -X 2>/dev/null >/dev/null ; then 1073117610Sdes UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1074117610Sdes (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1075117610Sdes (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 1076117610Sdes && UNAME_MACHINE=i586 1077117610Sdes (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 1078117610Sdes && UNAME_MACHINE=i686 1079117610Sdes (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1080117610Sdes && UNAME_MACHINE=i686 1081117610Sdes echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 1082117610Sdes else 1083117610Sdes echo ${UNAME_MACHINE}-pc-sysv32 1084117610Sdes fi 1085263421Sdes exit ;; 1086117610Sdes pc:*:*:*) 1087117610Sdes # Left here for compatibility: 1088263421Sdes # uname -m prints for DJGPP always 'pc', but it prints nothing about 1089263421Sdes # the processor, so we play safe by assuming i586. 1090263421Sdes # Note: whatever this is, it MUST be the same as what config.sub 1091263421Sdes # prints for the "djgpp" host, or else GDB configury will decide that 1092263421Sdes # this is a cross-build. 1093263421Sdes echo i586-pc-msdosdjgpp 1094263421Sdes exit ;; 1095117610Sdes Intel:Mach:3*:*) 1096117610Sdes echo i386-pc-mach3 1097263421Sdes exit ;; 1098117610Sdes paragon:*:*:*) 1099117610Sdes echo i860-intel-osf1 1100263421Sdes exit ;; 1101117610Sdes i860:*:4.*:*) # i860-SVR4 1102117610Sdes if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1103117610Sdes echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 1104117610Sdes else # Add other i860-SVR4 vendors below as they are discovered. 1105117610Sdes echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 1106117610Sdes fi 1107263421Sdes exit ;; 1108117610Sdes mini*:CTIX:SYS*5:*) 1109117610Sdes # "miniframe" 1110117610Sdes echo m68010-convergent-sysv 1111263421Sdes exit ;; 1112117610Sdes mc68k:UNIX:SYSTEM5:3.51m) 1113117610Sdes echo m68k-convergent-sysv 1114263421Sdes exit ;; 1115117610Sdes M680?0:D-NIX:5.3:*) 1116117610Sdes echo m68k-diab-dnix 1117263421Sdes exit ;; 1118263421Sdes M68*:*:R3V[5678]*:*) 1119263421Sdes test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1120263421Sdes 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) 1121117610Sdes OS_REL='' 1122117610Sdes test -r /etc/.relid \ 1123117610Sdes && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1124117610Sdes /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1125263421Sdes && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1126117610Sdes /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1127263421Sdes && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1128117610Sdes 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1129263421Sdes /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1130263421Sdes && { echo i486-ncr-sysv4; exit; } ;; 1131263421Sdes NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1132263421Sdes OS_REL='.3' 1133263421Sdes test -r /etc/.relid \ 1134263421Sdes && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1135263421Sdes /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1136263421Sdes && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1137263421Sdes /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1138263421Sdes && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1139263421Sdes /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1140263421Sdes && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1141117610Sdes m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1142117610Sdes echo m68k-unknown-lynxos${UNAME_RELEASE} 1143263421Sdes exit ;; 1144117610Sdes mc68030:UNIX_System_V:4.*:*) 1145117610Sdes echo m68k-atari-sysv4 1146263421Sdes exit ;; 1147117610Sdes TSUNAMI:LynxOS:2.*:*) 1148117610Sdes echo sparc-unknown-lynxos${UNAME_RELEASE} 1149263421Sdes exit ;; 1150117610Sdes rs6000:LynxOS:2.*:*) 1151117610Sdes echo rs6000-unknown-lynxos${UNAME_RELEASE} 1152263421Sdes exit ;; 1153263421Sdes PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1154117610Sdes echo powerpc-unknown-lynxos${UNAME_RELEASE} 1155263421Sdes exit ;; 1156117610Sdes SM[BE]S:UNIX_SV:*:*) 1157117610Sdes echo mips-dde-sysv${UNAME_RELEASE} 1158263421Sdes exit ;; 1159117610Sdes RM*:ReliantUNIX-*:*:*) 1160117610Sdes echo mips-sni-sysv4 1161263421Sdes exit ;; 1162117610Sdes RM*:SINIX-*:*:*) 1163117610Sdes echo mips-sni-sysv4 1164263421Sdes exit ;; 1165117610Sdes *:SINIX-*:*:*) 1166117610Sdes if uname -p 2>/dev/null >/dev/null ; then 1167117610Sdes UNAME_MACHINE=`(uname -p) 2>/dev/null` 1168117610Sdes echo ${UNAME_MACHINE}-sni-sysv4 1169117610Sdes else 1170117610Sdes echo ns32k-sni-sysv 1171117610Sdes fi 1172263421Sdes exit ;; 1173263421Sdes PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1174263421Sdes # says <Richard.M.Bartel@ccMail.Census.GOV> 1175263421Sdes echo i586-unisys-sysv4 1176263421Sdes exit ;; 1177117610Sdes *:UNIX_System_V:4*:FTX*) 1178117610Sdes # From Gerald Hewes <hewes@openmarket.com>. 1179117610Sdes # How about differentiating between stratus architectures? -djm 1180117610Sdes echo hppa1.1-stratus-sysv4 1181263421Sdes exit ;; 1182117610Sdes *:*:*:FTX*) 1183117610Sdes # From seanf@swdc.stratus.com. 1184117610Sdes echo i860-stratus-sysv4 1185263421Sdes exit ;; 1186263421Sdes i*86:VOS:*:*) 1187263421Sdes # From Paul.Green@stratus.com. 1188263421Sdes echo ${UNAME_MACHINE}-stratus-vos 1189263421Sdes exit ;; 1190117610Sdes *:VOS:*:*) 1191117610Sdes # From Paul.Green@stratus.com. 1192117610Sdes echo hppa1.1-stratus-vos 1193263421Sdes exit ;; 1194117610Sdes mc68*:A/UX:*:*) 1195117610Sdes echo m68k-apple-aux${UNAME_RELEASE} 1196263421Sdes exit ;; 1197117610Sdes news*:NEWS-OS:6*:*) 1198117610Sdes echo mips-sony-newsos6 1199263421Sdes exit ;; 1200117610Sdes R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1201117610Sdes if [ -d /usr/nec ]; then 1202263421Sdes echo mips-nec-sysv${UNAME_RELEASE} 1203117610Sdes else 1204263421Sdes echo mips-unknown-sysv${UNAME_RELEASE} 1205117610Sdes fi 1206263421Sdes exit ;; 1207117610Sdes BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1208117610Sdes echo powerpc-be-beos 1209263421Sdes exit ;; 1210117610Sdes BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1211117610Sdes echo powerpc-apple-beos 1212263421Sdes exit ;; 1213117610Sdes BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1214117610Sdes echo i586-pc-beos 1215263421Sdes exit ;; 1216263421Sdes BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1217263421Sdes echo i586-pc-haiku 1218263421Sdes exit ;; 1219263421Sdes x86_64:Haiku:*:*) 1220263421Sdes echo x86_64-unknown-haiku 1221263421Sdes exit ;; 1222117610Sdes SX-4:SUPER-UX:*:*) 1223117610Sdes echo sx4-nec-superux${UNAME_RELEASE} 1224263421Sdes exit ;; 1225117610Sdes SX-5:SUPER-UX:*:*) 1226117610Sdes echo sx5-nec-superux${UNAME_RELEASE} 1227263421Sdes exit ;; 1228117610Sdes SX-6:SUPER-UX:*:*) 1229117610Sdes echo sx6-nec-superux${UNAME_RELEASE} 1230263421Sdes exit ;; 1231263421Sdes SX-7:SUPER-UX:*:*) 1232263421Sdes echo sx7-nec-superux${UNAME_RELEASE} 1233263421Sdes exit ;; 1234263421Sdes SX-8:SUPER-UX:*:*) 1235263421Sdes echo sx8-nec-superux${UNAME_RELEASE} 1236263421Sdes exit ;; 1237263421Sdes SX-8R:SUPER-UX:*:*) 1238263421Sdes echo sx8r-nec-superux${UNAME_RELEASE} 1239263421Sdes exit ;; 1240117610Sdes Power*:Rhapsody:*:*) 1241117610Sdes echo powerpc-apple-rhapsody${UNAME_RELEASE} 1242263421Sdes exit ;; 1243117610Sdes *:Rhapsody:*:*) 1244117610Sdes echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1245263421Sdes exit ;; 1246117610Sdes *:Darwin:*:*) 1247263421Sdes UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1248263421Sdes eval $set_cc_for_build 1249263421Sdes if test "$UNAME_PROCESSOR" = unknown ; then 1250263421Sdes UNAME_PROCESSOR=powerpc 1251263421Sdes fi 1252263421Sdes if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1253263421Sdes if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1254263421Sdes (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1255263421Sdes grep IS_64BIT_ARCH >/dev/null 1256263421Sdes then 1257263421Sdes case $UNAME_PROCESSOR in 1258263421Sdes i386) UNAME_PROCESSOR=x86_64 ;; 1259263421Sdes powerpc) UNAME_PROCESSOR=powerpc64 ;; 1260263421Sdes esac 1261263421Sdes fi 1262263421Sdes fi 1263117610Sdes echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1264263421Sdes exit ;; 1265117610Sdes *:procnto*:*:* | *:QNX:[0123456789]*:*) 1266117610Sdes UNAME_PROCESSOR=`uname -p` 1267117610Sdes if test "$UNAME_PROCESSOR" = "x86"; then 1268117610Sdes UNAME_PROCESSOR=i386 1269117610Sdes UNAME_MACHINE=pc 1270117610Sdes fi 1271117610Sdes echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1272263421Sdes exit ;; 1273117610Sdes *:QNX:*:4*) 1274117610Sdes echo i386-pc-qnx 1275263421Sdes exit ;; 1276263421Sdes NEO-?:NONSTOP_KERNEL:*:*) 1277263421Sdes echo neo-tandem-nsk${UNAME_RELEASE} 1278263421Sdes exit ;; 1279263421Sdes NSE-*:NONSTOP_KERNEL:*:*) 1280263421Sdes echo nse-tandem-nsk${UNAME_RELEASE} 1281263421Sdes exit ;; 1282263421Sdes NSR-?:NONSTOP_KERNEL:*:*) 1283117610Sdes echo nsr-tandem-nsk${UNAME_RELEASE} 1284263421Sdes exit ;; 1285117610Sdes *:NonStop-UX:*:*) 1286117610Sdes echo mips-compaq-nonstopux 1287263421Sdes exit ;; 1288117610Sdes BS2000:POSIX*:*:*) 1289117610Sdes echo bs2000-siemens-sysv 1290263421Sdes exit ;; 1291117610Sdes DS/*:UNIX_System_V:*:*) 1292117610Sdes echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1293263421Sdes exit ;; 1294117610Sdes *:Plan9:*:*) 1295117610Sdes # "uname -m" is not consistent, so use $cputype instead. 386 1296117610Sdes # is converted to i386 for consistency with other x86 1297117610Sdes # operating systems. 1298117610Sdes if test "$cputype" = "386"; then 1299117610Sdes UNAME_MACHINE=i386 1300117610Sdes else 1301117610Sdes UNAME_MACHINE="$cputype" 1302117610Sdes fi 1303117610Sdes echo ${UNAME_MACHINE}-unknown-plan9 1304263421Sdes exit ;; 1305117610Sdes *:TOPS-10:*:*) 1306117610Sdes echo pdp10-unknown-tops10 1307263421Sdes exit ;; 1308117610Sdes *:TENEX:*:*) 1309117610Sdes echo pdp10-unknown-tenex 1310263421Sdes exit ;; 1311117610Sdes KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1312117610Sdes echo pdp10-dec-tops20 1313263421Sdes exit ;; 1314117610Sdes XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1315117610Sdes echo pdp10-xkl-tops20 1316263421Sdes exit ;; 1317117610Sdes *:TOPS-20:*:*) 1318117610Sdes echo pdp10-unknown-tops20 1319263421Sdes exit ;; 1320117610Sdes *:ITS:*:*) 1321117610Sdes echo pdp10-unknown-its 1322263421Sdes exit ;; 1323117610Sdes SEI:*:*:SEIUX) 1324263421Sdes echo mips-sei-seiux${UNAME_RELEASE} 1325263421Sdes exit ;; 1326263421Sdes *:DragonFly:*:*) 1327263421Sdes echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1328263421Sdes exit ;; 1329263421Sdes *:*VMS:*:*) 1330263421Sdes UNAME_MACHINE=`(uname -p) 2>/dev/null` 1331263421Sdes case "${UNAME_MACHINE}" in 1332263421Sdes A*) echo alpha-dec-vms ; exit ;; 1333263421Sdes I*) echo ia64-dec-vms ; exit ;; 1334263421Sdes V*) echo vax-dec-vms ; exit ;; 1335263421Sdes esac ;; 1336263421Sdes *:XENIX:*:SysV) 1337263421Sdes echo i386-pc-xenix 1338263421Sdes exit ;; 1339263421Sdes i*86:skyos:*:*) 1340263421Sdes echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1341263421Sdes exit ;; 1342263421Sdes i*86:rdos:*:*) 1343263421Sdes echo ${UNAME_MACHINE}-pc-rdos 1344263421Sdes exit ;; 1345263421Sdes i*86:AROS:*:*) 1346263421Sdes echo ${UNAME_MACHINE}-pc-aros 1347263421Sdes exit ;; 1348263421Sdes x86_64:VMkernel:*:*) 1349263421Sdes echo ${UNAME_MACHINE}-unknown-esx 1350263421Sdes exit ;; 1351117610Sdesesac 1352117610Sdes 1353117610Sdeseval $set_cc_for_build 1354117610Sdescat >$dummy.c <<EOF 1355117610Sdes#ifdef _SEQUENT_ 1356117610Sdes# include <sys/types.h> 1357117610Sdes# include <sys/utsname.h> 1358117610Sdes#endif 1359117610Sdesmain () 1360117610Sdes{ 1361117610Sdes#if defined (sony) 1362117610Sdes#if defined (MIPSEB) 1363117610Sdes /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1364117610Sdes I don't know.... */ 1365117610Sdes printf ("mips-sony-bsd\n"); exit (0); 1366117610Sdes#else 1367117610Sdes#include <sys/param.h> 1368117610Sdes printf ("m68k-sony-newsos%s\n", 1369117610Sdes#ifdef NEWSOS4 1370263421Sdes "4" 1371117610Sdes#else 1372263421Sdes "" 1373117610Sdes#endif 1374263421Sdes ); exit (0); 1375117610Sdes#endif 1376117610Sdes#endif 1377117610Sdes 1378117610Sdes#if defined (__arm) && defined (__acorn) && defined (__unix) 1379263421Sdes printf ("arm-acorn-riscix\n"); exit (0); 1380117610Sdes#endif 1381117610Sdes 1382117610Sdes#if defined (hp300) && !defined (hpux) 1383117610Sdes printf ("m68k-hp-bsd\n"); exit (0); 1384117610Sdes#endif 1385117610Sdes 1386117610Sdes#if defined (NeXT) 1387117610Sdes#if !defined (__ARCHITECTURE__) 1388117610Sdes#define __ARCHITECTURE__ "m68k" 1389117610Sdes#endif 1390117610Sdes int version; 1391117610Sdes version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1392117610Sdes if (version < 4) 1393117610Sdes printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1394117610Sdes else 1395117610Sdes printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1396117610Sdes exit (0); 1397117610Sdes#endif 1398117610Sdes 1399117610Sdes#if defined (MULTIMAX) || defined (n16) 1400117610Sdes#if defined (UMAXV) 1401117610Sdes printf ("ns32k-encore-sysv\n"); exit (0); 1402117610Sdes#else 1403117610Sdes#if defined (CMU) 1404117610Sdes printf ("ns32k-encore-mach\n"); exit (0); 1405117610Sdes#else 1406117610Sdes printf ("ns32k-encore-bsd\n"); exit (0); 1407117610Sdes#endif 1408117610Sdes#endif 1409117610Sdes#endif 1410117610Sdes 1411117610Sdes#if defined (__386BSD__) 1412117610Sdes printf ("i386-pc-bsd\n"); exit (0); 1413117610Sdes#endif 1414117610Sdes 1415117610Sdes#if defined (sequent) 1416117610Sdes#if defined (i386) 1417117610Sdes printf ("i386-sequent-dynix\n"); exit (0); 1418117610Sdes#endif 1419117610Sdes#if defined (ns32000) 1420117610Sdes printf ("ns32k-sequent-dynix\n"); exit (0); 1421117610Sdes#endif 1422117610Sdes#endif 1423117610Sdes 1424117610Sdes#if defined (_SEQUENT_) 1425117610Sdes struct utsname un; 1426117610Sdes 1427117610Sdes uname(&un); 1428117610Sdes 1429117610Sdes if (strncmp(un.version, "V2", 2) == 0) { 1430117610Sdes printf ("i386-sequent-ptx2\n"); exit (0); 1431117610Sdes } 1432117610Sdes if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1433117610Sdes printf ("i386-sequent-ptx1\n"); exit (0); 1434117610Sdes } 1435117610Sdes printf ("i386-sequent-ptx\n"); exit (0); 1436117610Sdes 1437117610Sdes#endif 1438117610Sdes 1439117610Sdes#if defined (vax) 1440117610Sdes# if !defined (ultrix) 1441117610Sdes# include <sys/param.h> 1442117610Sdes# if defined (BSD) 1443117610Sdes# if BSD == 43 1444117610Sdes printf ("vax-dec-bsd4.3\n"); exit (0); 1445117610Sdes# else 1446117610Sdes# if BSD == 199006 1447117610Sdes printf ("vax-dec-bsd4.3reno\n"); exit (0); 1448117610Sdes# else 1449117610Sdes printf ("vax-dec-bsd\n"); exit (0); 1450117610Sdes# endif 1451117610Sdes# endif 1452117610Sdes# else 1453117610Sdes printf ("vax-dec-bsd\n"); exit (0); 1454117610Sdes# endif 1455117610Sdes# else 1456117610Sdes printf ("vax-dec-ultrix\n"); exit (0); 1457117610Sdes# endif 1458117610Sdes#endif 1459117610Sdes 1460117610Sdes#if defined (alliant) && defined (i860) 1461117610Sdes printf ("i860-alliant-bsd\n"); exit (0); 1462117610Sdes#endif 1463117610Sdes 1464117610Sdes exit (1); 1465117610Sdes} 1466117610SdesEOF 1467117610Sdes 1468263421Sdes$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 1469263421Sdes { echo "$SYSTEM_NAME"; exit; } 1470117610Sdes 1471117610Sdes# Apollos put the system type in the environment. 1472117610Sdes 1473263421Sdestest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 1474117610Sdes 1475117610Sdes# Convex versions that predate uname can use getsysinfo(1) 1476117610Sdes 1477117610Sdesif [ -x /usr/convex/getsysinfo ] 1478117610Sdesthen 1479117610Sdes case `getsysinfo -f cpu_type` in 1480117610Sdes c1*) 1481117610Sdes echo c1-convex-bsd 1482263421Sdes exit ;; 1483117610Sdes c2*) 1484117610Sdes if getsysinfo -f scalar_acc 1485117610Sdes then echo c32-convex-bsd 1486117610Sdes else echo c2-convex-bsd 1487117610Sdes fi 1488263421Sdes exit ;; 1489117610Sdes c34*) 1490117610Sdes echo c34-convex-bsd 1491263421Sdes exit ;; 1492117610Sdes c38*) 1493117610Sdes echo c38-convex-bsd 1494263421Sdes exit ;; 1495117610Sdes c4*) 1496117610Sdes echo c4-convex-bsd 1497263421Sdes exit ;; 1498117610Sdes esac 1499117610Sdesfi 1500117610Sdes 1501117610Sdescat >&2 <<EOF 1502117610Sdes$0: unable to guess system type 1503117610Sdes 1504117610SdesThis script, last modified $timestamp, has failed to recognize 1505117610Sdesthe operating system you are using. It is advised that you 1506117610Sdesdownload the most up to date version of the config scripts from 1507117610Sdes 1508263421Sdes http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 1509263421Sdesand 1510263421Sdes http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 1511117610Sdes 1512117610SdesIf the version you run ($0) is already up to date, please 1513117610Sdessend the following data and any information you think might be 1514117610Sdespertinent to <config-patches@gnu.org> in order to provide the needed 1515117610Sdesinformation to handle your system. 1516117610Sdes 1517117610Sdesconfig.guess timestamp = $timestamp 1518117610Sdes 1519117610Sdesuname -m = `(uname -m) 2>/dev/null || echo unknown` 1520117610Sdesuname -r = `(uname -r) 2>/dev/null || echo unknown` 1521117610Sdesuname -s = `(uname -s) 2>/dev/null || echo unknown` 1522117610Sdesuname -v = `(uname -v) 2>/dev/null || echo unknown` 1523117610Sdes 1524117610Sdes/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1525117610Sdes/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1526117610Sdes 1527117610Sdeshostinfo = `(hostinfo) 2>/dev/null` 1528117610Sdes/bin/universe = `(/bin/universe) 2>/dev/null` 1529117610Sdes/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1530117610Sdes/bin/arch = `(/bin/arch) 2>/dev/null` 1531117610Sdes/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1532117610Sdes/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1533117610Sdes 1534117610SdesUNAME_MACHINE = ${UNAME_MACHINE} 1535117610SdesUNAME_RELEASE = ${UNAME_RELEASE} 1536117610SdesUNAME_SYSTEM = ${UNAME_SYSTEM} 1537117610SdesUNAME_VERSION = ${UNAME_VERSION} 1538117610SdesEOF 1539117610Sdes 1540117610Sdesexit 1 1541117610Sdes 1542117610Sdes# Local variables: 1543117610Sdes# eval: (add-hook 'write-file-hooks 'time-stamp) 1544117610Sdes# time-stamp-start: "timestamp='" 1545117610Sdes# time-stamp-format: "%:y-%02m-%02d" 1546117610Sdes# time-stamp-end: "'" 1547117610Sdes# End: 1548