1238106Sdes#! /bin/sh 2238106Sdes# Attempt to guess a canonical system name. 3285206Sdes# Copyright 1992-2013 Free Software Foundation, Inc. 4238106Sdes 5285206Sdestimestamp='2013-06-10' 6238106Sdes 7238106Sdes# This file is free software; you can redistribute it and/or modify it 8238106Sdes# under the terms of the GNU General Public License as published by 9285206Sdes# the Free Software Foundation; either version 3 of the License, or 10238106Sdes# (at your option) any later version. 11238106Sdes# 12238106Sdes# This program is distributed in the hope that it will be useful, but 13238106Sdes# WITHOUT ANY WARRANTY; without even the implied warranty of 14238106Sdes# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15238106Sdes# General Public License for more details. 16238106Sdes# 17238106Sdes# You should have received a copy of the GNU General Public License 18249141Sdes# along with this program; if not, see <http://www.gnu.org/licenses/>. 19238106Sdes# 20238106Sdes# As a special exception to the GNU General Public License, if you 21238106Sdes# distribute this file as part of a program that contains a 22238106Sdes# configuration script generated by Autoconf, you may include it under 23285206Sdes# the same distribution terms that you use for the rest of that 24285206Sdes# program. This Exception is an additional permission under section 7 25285206Sdes# of the GNU General Public License, version 3 ("GPLv3"). 26238106Sdes# 27285206Sdes# Originally written by Per Bothner. 28238106Sdes# 29238106Sdes# You can get the latest version of this script from: 30238106Sdes# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 31285206Sdes# 32285206Sdes# Please send patches with a ChangeLog entry to config-patches@gnu.org. 33238106Sdes 34285206Sdes 35238106Sdesme=`echo "$0" | sed -e 's,.*/,,'` 36238106Sdes 37238106Sdesusage="\ 38238106SdesUsage: $0 [OPTION] 39238106Sdes 40238106SdesOutput the configuration name of the system \`$me' is run on. 41238106Sdes 42238106SdesOperation modes: 43238106Sdes -h, --help print this help, then exit 44238106Sdes -t, --time-stamp print date of last modification, then exit 45238106Sdes -v, --version print version number, then exit 46238106Sdes 47238106SdesReport bugs and patches to <config-patches@gnu.org>." 48238106Sdes 49238106Sdesversion="\ 50238106SdesGNU config.guess ($timestamp) 51238106Sdes 52238106SdesOriginally written by Per Bothner. 53285206SdesCopyright 1992-2013 Free Software Foundation, Inc. 54238106Sdes 55238106SdesThis is free software; see the source for copying conditions. There is NO 56238106Sdeswarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 57238106Sdes 58238106Sdeshelp=" 59238106SdesTry \`$me --help' for more information." 60238106Sdes 61238106Sdes# Parse command line 62238106Sdeswhile test $# -gt 0 ; do 63238106Sdes case $1 in 64238106Sdes --time-stamp | --time* | -t ) 65238106Sdes echo "$timestamp" ; exit ;; 66238106Sdes --version | -v ) 67238106Sdes echo "$version" ; exit ;; 68238106Sdes --help | --h* | -h ) 69238106Sdes echo "$usage"; exit ;; 70238106Sdes -- ) # Stop option processing 71238106Sdes shift; break ;; 72238106Sdes - ) # Use stdin as input. 73238106Sdes break ;; 74238106Sdes -* ) 75238106Sdes echo "$me: invalid option $1$help" >&2 76238106Sdes exit 1 ;; 77238106Sdes * ) 78238106Sdes break ;; 79238106Sdes esac 80238106Sdesdone 81238106Sdes 82238106Sdesif test $# != 0; then 83238106Sdes echo "$me: too many arguments$help" >&2 84238106Sdes exit 1 85238106Sdesfi 86238106Sdes 87238106Sdestrap 'exit 1' 1 2 15 88238106Sdes 89238106Sdes# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 90238106Sdes# compiler to aid in system detection is discouraged as it requires 91238106Sdes# temporary files to be created and, as you can see below, it is a 92238106Sdes# headache to deal with in a portable fashion. 93238106Sdes 94238106Sdes# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 95238106Sdes# use `HOST_CC' if defined, but it is deprecated. 96238106Sdes 97238106Sdes# Portable tmp directory creation inspired by the Autoconf team. 98238106Sdes 99238106Sdesset_cc_for_build=' 100238106Sdestrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 101238106Sdestrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 102238106Sdes: ${TMPDIR=/tmp} ; 103238106Sdes { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 104238106Sdes { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 105238106Sdes { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 106238106Sdes { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 107238106Sdesdummy=$tmp/dummy ; 108238106Sdestmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 109238106Sdescase $CC_FOR_BUILD,$HOST_CC,$CC in 110238106Sdes ,,) echo "int x;" > $dummy.c ; 111238106Sdes for c in cc gcc c89 c99 ; do 112238106Sdes if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 113238106Sdes CC_FOR_BUILD="$c"; break ; 114238106Sdes fi ; 115238106Sdes done ; 116238106Sdes if test x"$CC_FOR_BUILD" = x ; then 117238106Sdes CC_FOR_BUILD=no_compiler_found ; 118238106Sdes fi 119238106Sdes ;; 120238106Sdes ,,*) CC_FOR_BUILD=$CC ;; 121238106Sdes ,*,*) CC_FOR_BUILD=$HOST_CC ;; 122238106Sdesesac ; set_cc_for_build= ;' 123238106Sdes 124238106Sdes# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 125238106Sdes# (ghazi@noc.rutgers.edu 1994-08-24) 126238106Sdesif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 127238106Sdes PATH=$PATH:/.attbin ; export PATH 128238106Sdesfi 129238106Sdes 130238106SdesUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 131238106SdesUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 132238106SdesUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 133238106SdesUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 134238106Sdes 135285206Sdescase "${UNAME_SYSTEM}" in 136285206SdesLinux|GNU|GNU/*) 137285206Sdes # If the system lacks a compiler, then just pick glibc. 138285206Sdes # We could probably try harder. 139285206Sdes LIBC=gnu 140285206Sdes 141285206Sdes eval $set_cc_for_build 142285206Sdes cat <<-EOF > $dummy.c 143285206Sdes #include <features.h> 144285206Sdes #if defined(__UCLIBC__) 145285206Sdes LIBC=uclibc 146285206Sdes #elif defined(__dietlibc__) 147285206Sdes LIBC=dietlibc 148285206Sdes #else 149285206Sdes LIBC=gnu 150285206Sdes #endif 151285206Sdes EOF 152285206Sdes eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 153285206Sdes ;; 154285206Sdesesac 155285206Sdes 156238106Sdes# Note: order is significant - the case branches are not exclusive. 157238106Sdes 158238106Sdescase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 159238106Sdes *:NetBSD:*:*) 160238106Sdes # NetBSD (nbsd) targets should (where applicable) match one or 161249141Sdes # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 162238106Sdes # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 163238106Sdes # switched to ELF, *-*-netbsd* would select the old 164238106Sdes # object file format. This provides both forward 165238106Sdes # compatibility and a consistent mechanism for selecting the 166238106Sdes # object file format. 167238106Sdes # 168238106Sdes # Note: NetBSD doesn't particularly care about the vendor 169238106Sdes # portion of the name. We always set it to "unknown". 170238106Sdes sysctl="sysctl -n hw.machine_arch" 171238106Sdes UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 172238106Sdes /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 173238106Sdes case "${UNAME_MACHINE_ARCH}" in 174238106Sdes armeb) machine=armeb-unknown ;; 175238106Sdes arm*) machine=arm-unknown ;; 176238106Sdes sh3el) machine=shl-unknown ;; 177238106Sdes sh3eb) machine=sh-unknown ;; 178238106Sdes sh5el) machine=sh5le-unknown ;; 179238106Sdes *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 180238106Sdes esac 181238106Sdes # The Operating System including object format, if it has switched 182238106Sdes # to ELF recently, or will in the future. 183238106Sdes case "${UNAME_MACHINE_ARCH}" in 184238106Sdes arm*|i386|m68k|ns32k|sh3*|sparc|vax) 185238106Sdes eval $set_cc_for_build 186238106Sdes if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 187238106Sdes | grep -q __ELF__ 188238106Sdes then 189238106Sdes # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 190238106Sdes # Return netbsd for either. FIX? 191238106Sdes os=netbsd 192238106Sdes else 193238106Sdes os=netbsdelf 194238106Sdes fi 195238106Sdes ;; 196238106Sdes *) 197249141Sdes os=netbsd 198238106Sdes ;; 199238106Sdes esac 200238106Sdes # The OS release 201238106Sdes # Debian GNU/NetBSD machines have a different userland, and 202238106Sdes # thus, need a distinct triplet. However, they do not need 203238106Sdes # kernel version information, so it can be replaced with a 204238106Sdes # suitable tag, in the style of linux-gnu. 205238106Sdes case "${UNAME_VERSION}" in 206238106Sdes Debian*) 207238106Sdes release='-gnu' 208238106Sdes ;; 209238106Sdes *) 210238106Sdes release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 211238106Sdes ;; 212238106Sdes esac 213238106Sdes # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 214238106Sdes # contains redundant information, the shorter form: 215238106Sdes # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 216238106Sdes echo "${machine}-${os}${release}" 217238106Sdes exit ;; 218285206Sdes *:Bitrig:*:*) 219285206Sdes UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 220285206Sdes echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} 221285206Sdes exit ;; 222238106Sdes *:OpenBSD:*:*) 223238106Sdes UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 224238106Sdes echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 225238106Sdes exit ;; 226238106Sdes *:ekkoBSD:*:*) 227238106Sdes echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 228238106Sdes exit ;; 229238106Sdes *:SolidBSD:*:*) 230238106Sdes echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 231238106Sdes exit ;; 232238106Sdes macppc:MirBSD:*:*) 233238106Sdes echo powerpc-unknown-mirbsd${UNAME_RELEASE} 234238106Sdes exit ;; 235238106Sdes *:MirBSD:*:*) 236238106Sdes echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 237238106Sdes exit ;; 238238106Sdes alpha:OSF1:*:*) 239238106Sdes case $UNAME_RELEASE in 240238106Sdes *4.0) 241238106Sdes UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 242238106Sdes ;; 243238106Sdes *5.*) 244249141Sdes UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 245238106Sdes ;; 246238106Sdes esac 247238106Sdes # According to Compaq, /usr/sbin/psrinfo has been available on 248238106Sdes # OSF/1 and Tru64 systems produced since 1995. I hope that 249238106Sdes # covers most systems running today. This code pipes the CPU 250238106Sdes # types through head -n 1, so we only detect the type of CPU 0. 251238106Sdes ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 252238106Sdes case "$ALPHA_CPU_TYPE" in 253238106Sdes "EV4 (21064)") 254238106Sdes UNAME_MACHINE="alpha" ;; 255238106Sdes "EV4.5 (21064)") 256238106Sdes UNAME_MACHINE="alpha" ;; 257238106Sdes "LCA4 (21066/21068)") 258238106Sdes UNAME_MACHINE="alpha" ;; 259238106Sdes "EV5 (21164)") 260238106Sdes UNAME_MACHINE="alphaev5" ;; 261238106Sdes "EV5.6 (21164A)") 262238106Sdes UNAME_MACHINE="alphaev56" ;; 263238106Sdes "EV5.6 (21164PC)") 264238106Sdes UNAME_MACHINE="alphapca56" ;; 265238106Sdes "EV5.7 (21164PC)") 266238106Sdes UNAME_MACHINE="alphapca57" ;; 267238106Sdes "EV6 (21264)") 268238106Sdes UNAME_MACHINE="alphaev6" ;; 269238106Sdes "EV6.7 (21264A)") 270238106Sdes UNAME_MACHINE="alphaev67" ;; 271238106Sdes "EV6.8CB (21264C)") 272238106Sdes UNAME_MACHINE="alphaev68" ;; 273238106Sdes "EV6.8AL (21264B)") 274238106Sdes UNAME_MACHINE="alphaev68" ;; 275238106Sdes "EV6.8CX (21264D)") 276238106Sdes UNAME_MACHINE="alphaev68" ;; 277238106Sdes "EV6.9A (21264/EV69A)") 278238106Sdes UNAME_MACHINE="alphaev69" ;; 279238106Sdes "EV7 (21364)") 280238106Sdes UNAME_MACHINE="alphaev7" ;; 281238106Sdes "EV7.9 (21364A)") 282238106Sdes UNAME_MACHINE="alphaev79" ;; 283238106Sdes esac 284238106Sdes # A Pn.n version is a patched version. 285238106Sdes # A Vn.n version is a released version. 286238106Sdes # A Tn.n version is a released field test version. 287238106Sdes # A Xn.n version is an unreleased experimental baselevel. 288238106Sdes # 1.2 uses "1.2" for uname -r. 289238106Sdes echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 290249141Sdes # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 291249141Sdes exitcode=$? 292249141Sdes trap '' 0 293249141Sdes exit $exitcode ;; 294238106Sdes Alpha\ *:Windows_NT*:*) 295238106Sdes # How do we know it's Interix rather than the generic POSIX subsystem? 296238106Sdes # Should we change UNAME_MACHINE based on the output of uname instead 297238106Sdes # of the specific Alpha model? 298238106Sdes echo alpha-pc-interix 299238106Sdes exit ;; 300238106Sdes 21064:Windows_NT:50:3) 301238106Sdes echo alpha-dec-winnt3.5 302238106Sdes exit ;; 303238106Sdes Amiga*:UNIX_System_V:4.0:*) 304238106Sdes echo m68k-unknown-sysv4 305238106Sdes exit ;; 306238106Sdes *:[Aa]miga[Oo][Ss]:*:*) 307238106Sdes echo ${UNAME_MACHINE}-unknown-amigaos 308238106Sdes exit ;; 309238106Sdes *:[Mm]orph[Oo][Ss]:*:*) 310238106Sdes echo ${UNAME_MACHINE}-unknown-morphos 311238106Sdes exit ;; 312238106Sdes *:OS/390:*:*) 313238106Sdes echo i370-ibm-openedition 314238106Sdes exit ;; 315238106Sdes *:z/VM:*:*) 316238106Sdes echo s390-ibm-zvmoe 317238106Sdes exit ;; 318238106Sdes *:OS400:*:*) 319249141Sdes echo powerpc-ibm-os400 320238106Sdes exit ;; 321238106Sdes arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 322238106Sdes echo arm-acorn-riscix${UNAME_RELEASE} 323238106Sdes exit ;; 324285206Sdes arm*:riscos:*:*|arm*:RISCOS:*:*) 325238106Sdes echo arm-unknown-riscos 326238106Sdes exit ;; 327238106Sdes SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 328238106Sdes echo hppa1.1-hitachi-hiuxmpp 329238106Sdes exit ;; 330238106Sdes Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 331238106Sdes # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 332238106Sdes if test "`(/bin/universe) 2>/dev/null`" = att ; then 333238106Sdes echo pyramid-pyramid-sysv3 334238106Sdes else 335238106Sdes echo pyramid-pyramid-bsd 336238106Sdes fi 337238106Sdes exit ;; 338238106Sdes NILE*:*:*:dcosx) 339238106Sdes echo pyramid-pyramid-svr4 340238106Sdes exit ;; 341238106Sdes DRS?6000:unix:4.0:6*) 342238106Sdes echo sparc-icl-nx6 343238106Sdes exit ;; 344238106Sdes DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 345238106Sdes case `/usr/bin/uname -p` in 346238106Sdes sparc) echo sparc-icl-nx7; exit ;; 347238106Sdes esac ;; 348238106Sdes s390x:SunOS:*:*) 349238106Sdes echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 350238106Sdes exit ;; 351238106Sdes sun4H:SunOS:5.*:*) 352238106Sdes echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 353238106Sdes exit ;; 354238106Sdes sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 355238106Sdes echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 356238106Sdes exit ;; 357238106Sdes i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 358238106Sdes echo i386-pc-auroraux${UNAME_RELEASE} 359238106Sdes exit ;; 360238106Sdes i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 361238106Sdes eval $set_cc_for_build 362238106Sdes SUN_ARCH="i386" 363238106Sdes # If there is a compiler, see if it is configured for 64-bit objects. 364238106Sdes # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 365238106Sdes # This test works for both compilers. 366238106Sdes if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 367238106Sdes if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 368238106Sdes (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 369238106Sdes grep IS_64BIT_ARCH >/dev/null 370238106Sdes then 371238106Sdes SUN_ARCH="x86_64" 372238106Sdes fi 373238106Sdes fi 374238106Sdes echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 375238106Sdes exit ;; 376238106Sdes sun4*:SunOS:6*:*) 377238106Sdes # According to config.sub, this is the proper way to canonicalize 378238106Sdes # SunOS6. Hard to guess exactly what SunOS6 will be like, but 379238106Sdes # it's likely to be more like Solaris than SunOS4. 380238106Sdes echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 381238106Sdes exit ;; 382238106Sdes sun4*:SunOS:*:*) 383238106Sdes case "`/usr/bin/arch -k`" in 384238106Sdes Series*|S4*) 385238106Sdes UNAME_RELEASE=`uname -v` 386238106Sdes ;; 387238106Sdes esac 388238106Sdes # Japanese Language versions have a version number like `4.1.3-JL'. 389238106Sdes echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 390238106Sdes exit ;; 391238106Sdes sun3*:SunOS:*:*) 392238106Sdes echo m68k-sun-sunos${UNAME_RELEASE} 393238106Sdes exit ;; 394238106Sdes sun*:*:4.2BSD:*) 395238106Sdes UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 396238106Sdes test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 397238106Sdes case "`/bin/arch`" in 398238106Sdes sun3) 399238106Sdes echo m68k-sun-sunos${UNAME_RELEASE} 400238106Sdes ;; 401238106Sdes sun4) 402238106Sdes echo sparc-sun-sunos${UNAME_RELEASE} 403238106Sdes ;; 404238106Sdes esac 405238106Sdes exit ;; 406238106Sdes aushp:SunOS:*:*) 407238106Sdes echo sparc-auspex-sunos${UNAME_RELEASE} 408238106Sdes exit ;; 409238106Sdes # The situation for MiNT is a little confusing. The machine name 410238106Sdes # can be virtually everything (everything which is not 411238106Sdes # "atarist" or "atariste" at least should have a processor 412238106Sdes # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 413238106Sdes # to the lowercase version "mint" (or "freemint"). Finally 414238106Sdes # the system name "TOS" denotes a system which is actually not 415238106Sdes # MiNT. But MiNT is downward compatible to TOS, so this should 416238106Sdes # be no problem. 417238106Sdes atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 418249141Sdes echo m68k-atari-mint${UNAME_RELEASE} 419238106Sdes exit ;; 420238106Sdes atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 421238106Sdes echo m68k-atari-mint${UNAME_RELEASE} 422249141Sdes exit ;; 423238106Sdes *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 424249141Sdes echo m68k-atari-mint${UNAME_RELEASE} 425238106Sdes exit ;; 426238106Sdes milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 427249141Sdes echo m68k-milan-mint${UNAME_RELEASE} 428249141Sdes exit ;; 429238106Sdes hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 430249141Sdes echo m68k-hades-mint${UNAME_RELEASE} 431249141Sdes exit ;; 432238106Sdes *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 433249141Sdes echo m68k-unknown-mint${UNAME_RELEASE} 434249141Sdes exit ;; 435238106Sdes m68k:machten:*:*) 436238106Sdes echo m68k-apple-machten${UNAME_RELEASE} 437238106Sdes exit ;; 438238106Sdes powerpc:machten:*:*) 439238106Sdes echo powerpc-apple-machten${UNAME_RELEASE} 440238106Sdes exit ;; 441238106Sdes RISC*:Mach:*:*) 442238106Sdes echo mips-dec-mach_bsd4.3 443238106Sdes exit ;; 444238106Sdes RISC*:ULTRIX:*:*) 445238106Sdes echo mips-dec-ultrix${UNAME_RELEASE} 446238106Sdes exit ;; 447238106Sdes VAX*:ULTRIX*:*:*) 448238106Sdes echo vax-dec-ultrix${UNAME_RELEASE} 449238106Sdes exit ;; 450238106Sdes 2020:CLIX:*:* | 2430:CLIX:*:*) 451238106Sdes echo clipper-intergraph-clix${UNAME_RELEASE} 452238106Sdes exit ;; 453238106Sdes mips:*:*:UMIPS | mips:*:*:RISCos) 454238106Sdes eval $set_cc_for_build 455238106Sdes sed 's/^ //' << EOF >$dummy.c 456238106Sdes#ifdef __cplusplus 457238106Sdes#include <stdio.h> /* for printf() prototype */ 458238106Sdes int main (int argc, char *argv[]) { 459238106Sdes#else 460238106Sdes int main (argc, argv) int argc; char *argv[]; { 461238106Sdes#endif 462238106Sdes #if defined (host_mips) && defined (MIPSEB) 463238106Sdes #if defined (SYSTYPE_SYSV) 464238106Sdes printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 465238106Sdes #endif 466238106Sdes #if defined (SYSTYPE_SVR4) 467238106Sdes printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 468238106Sdes #endif 469238106Sdes #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 470238106Sdes printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 471238106Sdes #endif 472238106Sdes #endif 473238106Sdes exit (-1); 474238106Sdes } 475238106SdesEOF 476238106Sdes $CC_FOR_BUILD -o $dummy $dummy.c && 477238106Sdes dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 478238106Sdes SYSTEM_NAME=`$dummy $dummyarg` && 479238106Sdes { echo "$SYSTEM_NAME"; exit; } 480238106Sdes echo mips-mips-riscos${UNAME_RELEASE} 481238106Sdes exit ;; 482238106Sdes Motorola:PowerMAX_OS:*:*) 483238106Sdes echo powerpc-motorola-powermax 484238106Sdes exit ;; 485238106Sdes Motorola:*:4.3:PL8-*) 486238106Sdes echo powerpc-harris-powermax 487238106Sdes exit ;; 488238106Sdes Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 489238106Sdes echo powerpc-harris-powermax 490238106Sdes exit ;; 491238106Sdes Night_Hawk:Power_UNIX:*:*) 492238106Sdes echo powerpc-harris-powerunix 493238106Sdes exit ;; 494238106Sdes m88k:CX/UX:7*:*) 495238106Sdes echo m88k-harris-cxux7 496238106Sdes exit ;; 497238106Sdes m88k:*:4*:R4*) 498238106Sdes echo m88k-motorola-sysv4 499238106Sdes exit ;; 500238106Sdes m88k:*:3*:R3*) 501238106Sdes echo m88k-motorola-sysv3 502238106Sdes exit ;; 503238106Sdes AViiON:dgux:*:*) 504249141Sdes # DG/UX returns AViiON for all architectures 505249141Sdes UNAME_PROCESSOR=`/usr/bin/uname -p` 506238106Sdes if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 507238106Sdes then 508238106Sdes if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 509238106Sdes [ ${TARGET_BINARY_INTERFACE}x = x ] 510238106Sdes then 511238106Sdes echo m88k-dg-dgux${UNAME_RELEASE} 512238106Sdes else 513238106Sdes echo m88k-dg-dguxbcs${UNAME_RELEASE} 514238106Sdes fi 515238106Sdes else 516238106Sdes echo i586-dg-dgux${UNAME_RELEASE} 517238106Sdes fi 518249141Sdes exit ;; 519238106Sdes M88*:DolphinOS:*:*) # DolphinOS (SVR3) 520238106Sdes echo m88k-dolphin-sysv3 521238106Sdes exit ;; 522238106Sdes M88*:*:R3*:*) 523238106Sdes # Delta 88k system running SVR3 524238106Sdes echo m88k-motorola-sysv3 525238106Sdes exit ;; 526238106Sdes XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 527238106Sdes echo m88k-tektronix-sysv3 528238106Sdes exit ;; 529238106Sdes Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 530238106Sdes echo m68k-tektronix-bsd 531238106Sdes exit ;; 532238106Sdes *:IRIX*:*:*) 533238106Sdes echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 534238106Sdes exit ;; 535238106Sdes ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 536238106Sdes echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 537238106Sdes exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 538238106Sdes i*86:AIX:*:*) 539238106Sdes echo i386-ibm-aix 540238106Sdes exit ;; 541238106Sdes ia64:AIX:*:*) 542238106Sdes if [ -x /usr/bin/oslevel ] ; then 543238106Sdes IBM_REV=`/usr/bin/oslevel` 544238106Sdes else 545238106Sdes IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 546238106Sdes fi 547238106Sdes echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 548238106Sdes exit ;; 549238106Sdes *:AIX:2:3) 550238106Sdes if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 551238106Sdes eval $set_cc_for_build 552238106Sdes sed 's/^ //' << EOF >$dummy.c 553238106Sdes #include <sys/systemcfg.h> 554238106Sdes 555238106Sdes main() 556238106Sdes { 557238106Sdes if (!__power_pc()) 558238106Sdes exit(1); 559238106Sdes puts("powerpc-ibm-aix3.2.5"); 560238106Sdes exit(0); 561238106Sdes } 562238106SdesEOF 563238106Sdes if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 564238106Sdes then 565238106Sdes echo "$SYSTEM_NAME" 566238106Sdes else 567238106Sdes echo rs6000-ibm-aix3.2.5 568238106Sdes fi 569238106Sdes elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 570238106Sdes echo rs6000-ibm-aix3.2.4 571238106Sdes else 572238106Sdes echo rs6000-ibm-aix3.2 573238106Sdes fi 574238106Sdes exit ;; 575249141Sdes *:AIX:*:[4567]) 576238106Sdes IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 577238106Sdes if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 578238106Sdes IBM_ARCH=rs6000 579238106Sdes else 580238106Sdes IBM_ARCH=powerpc 581238106Sdes fi 582238106Sdes if [ -x /usr/bin/oslevel ] ; then 583238106Sdes IBM_REV=`/usr/bin/oslevel` 584238106Sdes else 585238106Sdes IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 586238106Sdes fi 587238106Sdes echo ${IBM_ARCH}-ibm-aix${IBM_REV} 588238106Sdes exit ;; 589238106Sdes *:AIX:*:*) 590238106Sdes echo rs6000-ibm-aix 591238106Sdes exit ;; 592238106Sdes ibmrt:4.4BSD:*|romp-ibm:BSD:*) 593238106Sdes echo romp-ibm-bsd4.4 594238106Sdes exit ;; 595238106Sdes ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 596238106Sdes echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 597238106Sdes exit ;; # report: romp-ibm BSD 4.3 598238106Sdes *:BOSX:*:*) 599238106Sdes echo rs6000-bull-bosx 600238106Sdes exit ;; 601238106Sdes DPX/2?00:B.O.S.:*:*) 602238106Sdes echo m68k-bull-sysv3 603238106Sdes exit ;; 604238106Sdes 9000/[34]??:4.3bsd:1.*:*) 605238106Sdes echo m68k-hp-bsd 606238106Sdes exit ;; 607238106Sdes hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 608238106Sdes echo m68k-hp-bsd4.4 609238106Sdes exit ;; 610238106Sdes 9000/[34678]??:HP-UX:*:*) 611238106Sdes HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 612238106Sdes case "${UNAME_MACHINE}" in 613238106Sdes 9000/31? ) HP_ARCH=m68000 ;; 614238106Sdes 9000/[34]?? ) HP_ARCH=m68k ;; 615238106Sdes 9000/[678][0-9][0-9]) 616238106Sdes if [ -x /usr/bin/getconf ]; then 617238106Sdes sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 618249141Sdes sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 619249141Sdes case "${sc_cpu_version}" in 620249141Sdes 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 621249141Sdes 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 622249141Sdes 532) # CPU_PA_RISC2_0 623249141Sdes case "${sc_kernel_bits}" in 624249141Sdes 32) HP_ARCH="hppa2.0n" ;; 625249141Sdes 64) HP_ARCH="hppa2.0w" ;; 626238106Sdes '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 627249141Sdes esac ;; 628249141Sdes esac 629238106Sdes fi 630238106Sdes if [ "${HP_ARCH}" = "" ]; then 631238106Sdes eval $set_cc_for_build 632249141Sdes sed 's/^ //' << EOF >$dummy.c 633238106Sdes 634249141Sdes #define _HPUX_SOURCE 635249141Sdes #include <stdlib.h> 636249141Sdes #include <unistd.h> 637238106Sdes 638249141Sdes int main () 639249141Sdes { 640249141Sdes #if defined(_SC_KERNEL_BITS) 641249141Sdes long bits = sysconf(_SC_KERNEL_BITS); 642249141Sdes #endif 643249141Sdes long cpu = sysconf (_SC_CPU_VERSION); 644238106Sdes 645249141Sdes switch (cpu) 646249141Sdes { 647249141Sdes case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 648249141Sdes case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 649249141Sdes case CPU_PA_RISC2_0: 650249141Sdes #if defined(_SC_KERNEL_BITS) 651249141Sdes switch (bits) 652249141Sdes { 653249141Sdes case 64: puts ("hppa2.0w"); break; 654249141Sdes case 32: puts ("hppa2.0n"); break; 655249141Sdes default: puts ("hppa2.0"); break; 656249141Sdes } break; 657249141Sdes #else /* !defined(_SC_KERNEL_BITS) */ 658249141Sdes puts ("hppa2.0"); break; 659249141Sdes #endif 660249141Sdes default: puts ("hppa1.0"); break; 661249141Sdes } 662249141Sdes exit (0); 663249141Sdes } 664238106SdesEOF 665238106Sdes (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 666238106Sdes test -z "$HP_ARCH" && HP_ARCH=hppa 667238106Sdes fi ;; 668238106Sdes esac 669238106Sdes if [ ${HP_ARCH} = "hppa2.0w" ] 670238106Sdes then 671238106Sdes eval $set_cc_for_build 672238106Sdes 673238106Sdes # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 674238106Sdes # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 675238106Sdes # generating 64-bit code. GNU and HP use different nomenclature: 676238106Sdes # 677238106Sdes # $ CC_FOR_BUILD=cc ./config.guess 678238106Sdes # => hppa2.0w-hp-hpux11.23 679238106Sdes # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 680238106Sdes # => hppa64-hp-hpux11.23 681238106Sdes 682238106Sdes if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 683238106Sdes grep -q __LP64__ 684238106Sdes then 685238106Sdes HP_ARCH="hppa2.0w" 686238106Sdes else 687238106Sdes HP_ARCH="hppa64" 688238106Sdes fi 689238106Sdes fi 690238106Sdes echo ${HP_ARCH}-hp-hpux${HPUX_REV} 691238106Sdes exit ;; 692238106Sdes ia64:HP-UX:*:*) 693238106Sdes HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 694238106Sdes echo ia64-hp-hpux${HPUX_REV} 695238106Sdes exit ;; 696238106Sdes 3050*:HI-UX:*:*) 697238106Sdes eval $set_cc_for_build 698238106Sdes sed 's/^ //' << EOF >$dummy.c 699238106Sdes #include <unistd.h> 700238106Sdes int 701238106Sdes main () 702238106Sdes { 703238106Sdes long cpu = sysconf (_SC_CPU_VERSION); 704238106Sdes /* The order matters, because CPU_IS_HP_MC68K erroneously returns 705238106Sdes true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 706238106Sdes results, however. */ 707238106Sdes if (CPU_IS_PA_RISC (cpu)) 708238106Sdes { 709238106Sdes switch (cpu) 710238106Sdes { 711238106Sdes case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 712238106Sdes case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 713238106Sdes case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 714238106Sdes default: puts ("hppa-hitachi-hiuxwe2"); break; 715238106Sdes } 716238106Sdes } 717238106Sdes else if (CPU_IS_HP_MC68K (cpu)) 718238106Sdes puts ("m68k-hitachi-hiuxwe2"); 719238106Sdes else puts ("unknown-hitachi-hiuxwe2"); 720238106Sdes exit (0); 721238106Sdes } 722238106SdesEOF 723238106Sdes $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 724238106Sdes { echo "$SYSTEM_NAME"; exit; } 725238106Sdes echo unknown-hitachi-hiuxwe2 726238106Sdes exit ;; 727238106Sdes 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 728238106Sdes echo hppa1.1-hp-bsd 729238106Sdes exit ;; 730238106Sdes 9000/8??:4.3bsd:*:*) 731238106Sdes echo hppa1.0-hp-bsd 732238106Sdes exit ;; 733238106Sdes *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 734238106Sdes echo hppa1.0-hp-mpeix 735238106Sdes exit ;; 736238106Sdes hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 737238106Sdes echo hppa1.1-hp-osf 738238106Sdes exit ;; 739238106Sdes hp8??:OSF1:*:*) 740238106Sdes echo hppa1.0-hp-osf 741238106Sdes exit ;; 742238106Sdes i*86:OSF1:*:*) 743238106Sdes if [ -x /usr/sbin/sysversion ] ; then 744238106Sdes echo ${UNAME_MACHINE}-unknown-osf1mk 745238106Sdes else 746238106Sdes echo ${UNAME_MACHINE}-unknown-osf1 747238106Sdes fi 748238106Sdes exit ;; 749238106Sdes parisc*:Lites*:*:*) 750238106Sdes echo hppa1.1-hp-lites 751238106Sdes exit ;; 752238106Sdes C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 753238106Sdes echo c1-convex-bsd 754249141Sdes exit ;; 755238106Sdes C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 756238106Sdes if getsysinfo -f scalar_acc 757238106Sdes then echo c32-convex-bsd 758238106Sdes else echo c2-convex-bsd 759238106Sdes fi 760249141Sdes exit ;; 761238106Sdes C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 762238106Sdes echo c34-convex-bsd 763249141Sdes exit ;; 764238106Sdes C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 765238106Sdes echo c38-convex-bsd 766249141Sdes exit ;; 767238106Sdes C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 768238106Sdes echo c4-convex-bsd 769249141Sdes exit ;; 770238106Sdes CRAY*Y-MP:*:*:*) 771238106Sdes echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 772238106Sdes exit ;; 773238106Sdes CRAY*[A-Z]90:*:*:*) 774238106Sdes echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 775238106Sdes | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 776238106Sdes -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 777238106Sdes -e 's/\.[^.]*$/.X/' 778238106Sdes exit ;; 779238106Sdes CRAY*TS:*:*:*) 780238106Sdes echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 781238106Sdes exit ;; 782238106Sdes CRAY*T3E:*:*:*) 783238106Sdes echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 784238106Sdes exit ;; 785238106Sdes CRAY*SV1:*:*:*) 786238106Sdes echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 787238106Sdes exit ;; 788238106Sdes *:UNICOS/mp:*:*) 789238106Sdes echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 790238106Sdes exit ;; 791238106Sdes F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 792238106Sdes FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 793249141Sdes FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 794249141Sdes FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 795249141Sdes echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 796249141Sdes exit ;; 797238106Sdes 5000:UNIX_System_V:4.*:*) 798249141Sdes FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 799249141Sdes FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 800249141Sdes echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 801238106Sdes exit ;; 802238106Sdes i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 803238106Sdes echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 804238106Sdes exit ;; 805238106Sdes sparc*:BSD/OS:*:*) 806238106Sdes echo sparc-unknown-bsdi${UNAME_RELEASE} 807238106Sdes exit ;; 808238106Sdes *:BSD/OS:*:*) 809238106Sdes echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 810238106Sdes exit ;; 811238106Sdes *:FreeBSD:*:*) 812249141Sdes UNAME_PROCESSOR=`/usr/bin/uname -p` 813249141Sdes case ${UNAME_PROCESSOR} in 814238106Sdes amd64) 815238106Sdes echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 816238106Sdes *) 817249141Sdes echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 818238106Sdes esac 819238106Sdes exit ;; 820238106Sdes i*:CYGWIN*:*) 821238106Sdes echo ${UNAME_MACHINE}-pc-cygwin 822238106Sdes exit ;; 823285206Sdes *:MINGW64*:*) 824285206Sdes echo ${UNAME_MACHINE}-pc-mingw64 825285206Sdes exit ;; 826238106Sdes *:MINGW*:*) 827238106Sdes echo ${UNAME_MACHINE}-pc-mingw32 828238106Sdes exit ;; 829249141Sdes i*:MSYS*:*) 830249141Sdes echo ${UNAME_MACHINE}-pc-msys 831249141Sdes exit ;; 832238106Sdes i*:windows32*:*) 833249141Sdes # uname -m includes "-pc" on this system. 834249141Sdes echo ${UNAME_MACHINE}-mingw32 835238106Sdes exit ;; 836238106Sdes i*:PW*:*) 837238106Sdes echo ${UNAME_MACHINE}-pc-pw32 838238106Sdes exit ;; 839238106Sdes *:Interix*:*) 840249141Sdes case ${UNAME_MACHINE} in 841238106Sdes x86) 842238106Sdes echo i586-pc-interix${UNAME_RELEASE} 843238106Sdes exit ;; 844238106Sdes authenticamd | genuineintel | EM64T) 845238106Sdes echo x86_64-unknown-interix${UNAME_RELEASE} 846238106Sdes exit ;; 847238106Sdes IA64) 848238106Sdes echo ia64-unknown-interix${UNAME_RELEASE} 849238106Sdes exit ;; 850238106Sdes esac ;; 851238106Sdes [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 852238106Sdes echo i${UNAME_MACHINE}-pc-mks 853238106Sdes exit ;; 854238106Sdes 8664:Windows_NT:*) 855238106Sdes echo x86_64-pc-mks 856238106Sdes exit ;; 857238106Sdes i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 858238106Sdes # How do we know it's Interix rather than the generic POSIX subsystem? 859238106Sdes # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 860238106Sdes # UNAME_MACHINE based on the output of uname instead of i386? 861238106Sdes echo i586-pc-interix 862238106Sdes exit ;; 863238106Sdes i*:UWIN*:*) 864238106Sdes echo ${UNAME_MACHINE}-pc-uwin 865238106Sdes exit ;; 866238106Sdes amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 867238106Sdes echo x86_64-unknown-cygwin 868238106Sdes exit ;; 869238106Sdes p*:CYGWIN*:*) 870238106Sdes echo powerpcle-unknown-cygwin 871238106Sdes exit ;; 872238106Sdes prep*:SunOS:5.*:*) 873238106Sdes echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 874238106Sdes exit ;; 875238106Sdes *:GNU:*:*) 876238106Sdes # the GNU system 877285206Sdes echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 878238106Sdes exit ;; 879238106Sdes *:GNU/*:*:*) 880238106Sdes # other systems with GNU libc and userland 881285206Sdes echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} 882238106Sdes exit ;; 883238106Sdes i*86:Minix:*:*) 884238106Sdes echo ${UNAME_MACHINE}-pc-minix 885238106Sdes exit ;; 886249141Sdes aarch64:Linux:*:*) 887285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 888249141Sdes exit ;; 889249141Sdes aarch64_be:Linux:*:*) 890249141Sdes UNAME_MACHINE=aarch64_be 891285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 892249141Sdes exit ;; 893238106Sdes alpha:Linux:*:*) 894238106Sdes case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 895238106Sdes EV5) UNAME_MACHINE=alphaev5 ;; 896238106Sdes EV56) UNAME_MACHINE=alphaev56 ;; 897238106Sdes PCA56) UNAME_MACHINE=alphapca56 ;; 898238106Sdes PCA57) UNAME_MACHINE=alphapca56 ;; 899238106Sdes EV6) UNAME_MACHINE=alphaev6 ;; 900238106Sdes EV67) UNAME_MACHINE=alphaev67 ;; 901238106Sdes EV68*) UNAME_MACHINE=alphaev68 ;; 902249141Sdes esac 903238106Sdes objdump --private-headers /bin/sh | grep -q ld.so.1 904285206Sdes if test "$?" = 0 ; then LIBC="gnulibc1" ; fi 905285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 906238106Sdes exit ;; 907285206Sdes arc:Linux:*:* | arceb:Linux:*:*) 908285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 909285206Sdes exit ;; 910238106Sdes arm*:Linux:*:*) 911238106Sdes eval $set_cc_for_build 912238106Sdes if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 913238106Sdes | grep -q __ARM_EABI__ 914238106Sdes then 915285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 916238106Sdes else 917249141Sdes if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 918249141Sdes | grep -q __ARM_PCS_VFP 919249141Sdes then 920285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi 921249141Sdes else 922285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf 923249141Sdes fi 924238106Sdes fi 925238106Sdes exit ;; 926238106Sdes avr32*:Linux:*:*) 927285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 928238106Sdes exit ;; 929238106Sdes cris:Linux:*:*) 930285206Sdes echo ${UNAME_MACHINE}-axis-linux-${LIBC} 931238106Sdes exit ;; 932238106Sdes crisv32:Linux:*:*) 933285206Sdes echo ${UNAME_MACHINE}-axis-linux-${LIBC} 934238106Sdes exit ;; 935238106Sdes frv:Linux:*:*) 936285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 937238106Sdes exit ;; 938249141Sdes hexagon:Linux:*:*) 939285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 940249141Sdes exit ;; 941238106Sdes i*86:Linux:*:*) 942285206Sdes echo ${UNAME_MACHINE}-pc-linux-${LIBC} 943238106Sdes exit ;; 944238106Sdes ia64:Linux:*:*) 945285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 946238106Sdes exit ;; 947238106Sdes m32r*:Linux:*:*) 948285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 949238106Sdes exit ;; 950238106Sdes m68*:Linux:*:*) 951285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 952238106Sdes exit ;; 953238106Sdes mips:Linux:*:* | mips64:Linux:*:*) 954238106Sdes eval $set_cc_for_build 955238106Sdes sed 's/^ //' << EOF >$dummy.c 956238106Sdes #undef CPU 957238106Sdes #undef ${UNAME_MACHINE} 958238106Sdes #undef ${UNAME_MACHINE}el 959238106Sdes #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 960238106Sdes CPU=${UNAME_MACHINE}el 961238106Sdes #else 962238106Sdes #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 963238106Sdes CPU=${UNAME_MACHINE} 964238106Sdes #else 965238106Sdes CPU= 966238106Sdes #endif 967238106Sdes #endif 968238106SdesEOF 969238106Sdes eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 970285206Sdes test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 971238106Sdes ;; 972285206Sdes or1k:Linux:*:*) 973285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 974285206Sdes exit ;; 975238106Sdes or32:Linux:*:*) 976285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 977238106Sdes exit ;; 978238106Sdes padre:Linux:*:*) 979285206Sdes echo sparc-unknown-linux-${LIBC} 980238106Sdes exit ;; 981238106Sdes parisc64:Linux:*:* | hppa64:Linux:*:*) 982285206Sdes echo hppa64-unknown-linux-${LIBC} 983238106Sdes exit ;; 984238106Sdes parisc:Linux:*:* | hppa:Linux:*:*) 985238106Sdes # Look for CPU level 986238106Sdes case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 987285206Sdes PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; 988285206Sdes PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; 989285206Sdes *) echo hppa-unknown-linux-${LIBC} ;; 990238106Sdes esac 991238106Sdes exit ;; 992238106Sdes ppc64:Linux:*:*) 993285206Sdes echo powerpc64-unknown-linux-${LIBC} 994238106Sdes exit ;; 995238106Sdes ppc:Linux:*:*) 996285206Sdes echo powerpc-unknown-linux-${LIBC} 997238106Sdes exit ;; 998285206Sdes ppc64le:Linux:*:*) 999285206Sdes echo powerpc64le-unknown-linux-${LIBC} 1000285206Sdes exit ;; 1001285206Sdes ppcle:Linux:*:*) 1002285206Sdes echo powerpcle-unknown-linux-${LIBC} 1003285206Sdes exit ;; 1004238106Sdes s390:Linux:*:* | s390x:Linux:*:*) 1005285206Sdes echo ${UNAME_MACHINE}-ibm-linux-${LIBC} 1006238106Sdes exit ;; 1007238106Sdes sh64*:Linux:*:*) 1008285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1009238106Sdes exit ;; 1010238106Sdes sh*:Linux:*:*) 1011285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1012238106Sdes exit ;; 1013238106Sdes sparc:Linux:*:* | sparc64:Linux:*:*) 1014285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1015238106Sdes exit ;; 1016249141Sdes tile*:Linux:*:*) 1017285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1018249141Sdes exit ;; 1019238106Sdes vax:Linux:*:*) 1020285206Sdes echo ${UNAME_MACHINE}-dec-linux-${LIBC} 1021238106Sdes exit ;; 1022238106Sdes x86_64:Linux:*:*) 1023285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1024238106Sdes exit ;; 1025238106Sdes xtensa*:Linux:*:*) 1026285206Sdes echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1027238106Sdes exit ;; 1028238106Sdes i*86:DYNIX/ptx:4*:*) 1029238106Sdes # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 1030238106Sdes # earlier versions are messed up and put the nodename in both 1031238106Sdes # sysname and nodename. 1032238106Sdes echo i386-sequent-sysv4 1033238106Sdes exit ;; 1034238106Sdes i*86:UNIX_SV:4.2MP:2.*) 1035249141Sdes # Unixware is an offshoot of SVR4, but it has its own version 1036249141Sdes # number series starting with 2... 1037249141Sdes # I am not positive that other SVR4 systems won't match this, 1038238106Sdes # I just have to hope. -- rms. 1039249141Sdes # Use sysv4.2uw... so that sysv4* matches it. 1040238106Sdes echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 1041238106Sdes exit ;; 1042238106Sdes i*86:OS/2:*:*) 1043238106Sdes # If we were able to find `uname', then EMX Unix compatibility 1044238106Sdes # is probably installed. 1045238106Sdes echo ${UNAME_MACHINE}-pc-os2-emx 1046238106Sdes exit ;; 1047238106Sdes i*86:XTS-300:*:STOP) 1048238106Sdes echo ${UNAME_MACHINE}-unknown-stop 1049238106Sdes exit ;; 1050238106Sdes i*86:atheos:*:*) 1051238106Sdes echo ${UNAME_MACHINE}-unknown-atheos 1052238106Sdes exit ;; 1053238106Sdes i*86:syllable:*:*) 1054238106Sdes echo ${UNAME_MACHINE}-pc-syllable 1055238106Sdes exit ;; 1056238106Sdes i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1057238106Sdes echo i386-unknown-lynxos${UNAME_RELEASE} 1058238106Sdes exit ;; 1059238106Sdes i*86:*DOS:*:*) 1060238106Sdes echo ${UNAME_MACHINE}-pc-msdosdjgpp 1061238106Sdes exit ;; 1062238106Sdes i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 1063238106Sdes UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 1064238106Sdes if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1065238106Sdes echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 1066238106Sdes else 1067238106Sdes echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1068238106Sdes fi 1069238106Sdes exit ;; 1070238106Sdes i*86:*:5:[678]*) 1071249141Sdes # UnixWare 7.x, OpenUNIX and OpenServer 6. 1072238106Sdes case `/bin/uname -X | grep "^Machine"` in 1073238106Sdes *486*) UNAME_MACHINE=i486 ;; 1074238106Sdes *Pentium) UNAME_MACHINE=i586 ;; 1075238106Sdes *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1076238106Sdes esac 1077238106Sdes echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1078238106Sdes exit ;; 1079238106Sdes i*86:*:3.2:*) 1080238106Sdes if test -f /usr/options/cb.name; then 1081238106Sdes UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1082238106Sdes echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 1083238106Sdes elif /bin/uname -X 2>/dev/null >/dev/null ; then 1084238106Sdes UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1085238106Sdes (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1086238106Sdes (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 1087238106Sdes && UNAME_MACHINE=i586 1088238106Sdes (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 1089238106Sdes && UNAME_MACHINE=i686 1090238106Sdes (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1091238106Sdes && UNAME_MACHINE=i686 1092238106Sdes echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 1093238106Sdes else 1094238106Sdes echo ${UNAME_MACHINE}-pc-sysv32 1095238106Sdes fi 1096238106Sdes exit ;; 1097238106Sdes pc:*:*:*) 1098238106Sdes # Left here for compatibility: 1099249141Sdes # uname -m prints for DJGPP always 'pc', but it prints nothing about 1100249141Sdes # the processor, so we play safe by assuming i586. 1101238106Sdes # Note: whatever this is, it MUST be the same as what config.sub 1102238106Sdes # prints for the "djgpp" host, or else GDB configury will decide that 1103238106Sdes # this is a cross-build. 1104238106Sdes echo i586-pc-msdosdjgpp 1105249141Sdes exit ;; 1106238106Sdes Intel:Mach:3*:*) 1107238106Sdes echo i386-pc-mach3 1108238106Sdes exit ;; 1109238106Sdes paragon:*:*:*) 1110238106Sdes echo i860-intel-osf1 1111238106Sdes exit ;; 1112238106Sdes i860:*:4.*:*) # i860-SVR4 1113238106Sdes if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1114238106Sdes echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 1115238106Sdes else # Add other i860-SVR4 vendors below as they are discovered. 1116238106Sdes echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 1117238106Sdes fi 1118238106Sdes exit ;; 1119238106Sdes mini*:CTIX:SYS*5:*) 1120238106Sdes # "miniframe" 1121238106Sdes echo m68010-convergent-sysv 1122238106Sdes exit ;; 1123238106Sdes mc68k:UNIX:SYSTEM5:3.51m) 1124238106Sdes echo m68k-convergent-sysv 1125238106Sdes exit ;; 1126238106Sdes M680?0:D-NIX:5.3:*) 1127238106Sdes echo m68k-diab-dnix 1128238106Sdes exit ;; 1129238106Sdes M68*:*:R3V[5678]*:*) 1130238106Sdes test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1131238106Sdes 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) 1132238106Sdes OS_REL='' 1133238106Sdes test -r /etc/.relid \ 1134238106Sdes && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1135238106Sdes /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1136238106Sdes && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1137238106Sdes /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1138238106Sdes && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1139238106Sdes 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1140249141Sdes /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1141249141Sdes && { echo i486-ncr-sysv4; exit; } ;; 1142238106Sdes NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1143238106Sdes OS_REL='.3' 1144238106Sdes test -r /etc/.relid \ 1145238106Sdes && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1146238106Sdes /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1147238106Sdes && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1148238106Sdes /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1149238106Sdes && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1150238106Sdes /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1151238106Sdes && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1152238106Sdes m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1153238106Sdes echo m68k-unknown-lynxos${UNAME_RELEASE} 1154238106Sdes exit ;; 1155238106Sdes mc68030:UNIX_System_V:4.*:*) 1156238106Sdes echo m68k-atari-sysv4 1157238106Sdes exit ;; 1158238106Sdes TSUNAMI:LynxOS:2.*:*) 1159238106Sdes echo sparc-unknown-lynxos${UNAME_RELEASE} 1160238106Sdes exit ;; 1161238106Sdes rs6000:LynxOS:2.*:*) 1162238106Sdes echo rs6000-unknown-lynxos${UNAME_RELEASE} 1163238106Sdes exit ;; 1164238106Sdes PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1165238106Sdes echo powerpc-unknown-lynxos${UNAME_RELEASE} 1166238106Sdes exit ;; 1167238106Sdes SM[BE]S:UNIX_SV:*:*) 1168238106Sdes echo mips-dde-sysv${UNAME_RELEASE} 1169238106Sdes exit ;; 1170238106Sdes RM*:ReliantUNIX-*:*:*) 1171238106Sdes echo mips-sni-sysv4 1172238106Sdes exit ;; 1173238106Sdes RM*:SINIX-*:*:*) 1174238106Sdes echo mips-sni-sysv4 1175238106Sdes exit ;; 1176238106Sdes *:SINIX-*:*:*) 1177238106Sdes if uname -p 2>/dev/null >/dev/null ; then 1178238106Sdes UNAME_MACHINE=`(uname -p) 2>/dev/null` 1179238106Sdes echo ${UNAME_MACHINE}-sni-sysv4 1180238106Sdes else 1181238106Sdes echo ns32k-sni-sysv 1182238106Sdes fi 1183238106Sdes exit ;; 1184249141Sdes PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1185249141Sdes # says <Richard.M.Bartel@ccMail.Census.GOV> 1186249141Sdes echo i586-unisys-sysv4 1187249141Sdes exit ;; 1188238106Sdes *:UNIX_System_V:4*:FTX*) 1189238106Sdes # From Gerald Hewes <hewes@openmarket.com>. 1190238106Sdes # How about differentiating between stratus architectures? -djm 1191238106Sdes echo hppa1.1-stratus-sysv4 1192238106Sdes exit ;; 1193238106Sdes *:*:*:FTX*) 1194238106Sdes # From seanf@swdc.stratus.com. 1195238106Sdes echo i860-stratus-sysv4 1196238106Sdes exit ;; 1197238106Sdes i*86:VOS:*:*) 1198238106Sdes # From Paul.Green@stratus.com. 1199238106Sdes echo ${UNAME_MACHINE}-stratus-vos 1200238106Sdes exit ;; 1201238106Sdes *:VOS:*:*) 1202238106Sdes # From Paul.Green@stratus.com. 1203238106Sdes echo hppa1.1-stratus-vos 1204238106Sdes exit ;; 1205238106Sdes mc68*:A/UX:*:*) 1206238106Sdes echo m68k-apple-aux${UNAME_RELEASE} 1207238106Sdes exit ;; 1208238106Sdes news*:NEWS-OS:6*:*) 1209238106Sdes echo mips-sony-newsos6 1210238106Sdes exit ;; 1211238106Sdes R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1212238106Sdes if [ -d /usr/nec ]; then 1213249141Sdes echo mips-nec-sysv${UNAME_RELEASE} 1214238106Sdes else 1215249141Sdes echo mips-unknown-sysv${UNAME_RELEASE} 1216238106Sdes fi 1217249141Sdes exit ;; 1218238106Sdes BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1219238106Sdes echo powerpc-be-beos 1220238106Sdes exit ;; 1221238106Sdes BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1222238106Sdes echo powerpc-apple-beos 1223238106Sdes exit ;; 1224238106Sdes BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1225238106Sdes echo i586-pc-beos 1226238106Sdes exit ;; 1227238106Sdes BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1228238106Sdes echo i586-pc-haiku 1229238106Sdes exit ;; 1230285206Sdes x86_64:Haiku:*:*) 1231285206Sdes echo x86_64-unknown-haiku 1232285206Sdes exit ;; 1233238106Sdes SX-4:SUPER-UX:*:*) 1234238106Sdes echo sx4-nec-superux${UNAME_RELEASE} 1235238106Sdes exit ;; 1236238106Sdes SX-5:SUPER-UX:*:*) 1237238106Sdes echo sx5-nec-superux${UNAME_RELEASE} 1238238106Sdes exit ;; 1239238106Sdes SX-6:SUPER-UX:*:*) 1240238106Sdes echo sx6-nec-superux${UNAME_RELEASE} 1241238106Sdes exit ;; 1242238106Sdes SX-7:SUPER-UX:*:*) 1243238106Sdes echo sx7-nec-superux${UNAME_RELEASE} 1244238106Sdes exit ;; 1245238106Sdes SX-8:SUPER-UX:*:*) 1246238106Sdes echo sx8-nec-superux${UNAME_RELEASE} 1247238106Sdes exit ;; 1248238106Sdes SX-8R:SUPER-UX:*:*) 1249238106Sdes echo sx8r-nec-superux${UNAME_RELEASE} 1250238106Sdes exit ;; 1251238106Sdes Power*:Rhapsody:*:*) 1252238106Sdes echo powerpc-apple-rhapsody${UNAME_RELEASE} 1253238106Sdes exit ;; 1254238106Sdes *:Rhapsody:*:*) 1255238106Sdes echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1256238106Sdes exit ;; 1257238106Sdes *:Darwin:*:*) 1258238106Sdes UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1259285206Sdes eval $set_cc_for_build 1260285206Sdes if test "$UNAME_PROCESSOR" = unknown ; then 1261285206Sdes UNAME_PROCESSOR=powerpc 1262285206Sdes fi 1263285206Sdes if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1264285206Sdes if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1265285206Sdes (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1266285206Sdes grep IS_64BIT_ARCH >/dev/null 1267285206Sdes then 1268285206Sdes case $UNAME_PROCESSOR in 1269285206Sdes i386) UNAME_PROCESSOR=x86_64 ;; 1270285206Sdes powerpc) UNAME_PROCESSOR=powerpc64 ;; 1271285206Sdes esac 1272285206Sdes fi 1273285206Sdes fi 1274238106Sdes echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1275238106Sdes exit ;; 1276238106Sdes *:procnto*:*:* | *:QNX:[0123456789]*:*) 1277238106Sdes UNAME_PROCESSOR=`uname -p` 1278238106Sdes if test "$UNAME_PROCESSOR" = "x86"; then 1279238106Sdes UNAME_PROCESSOR=i386 1280238106Sdes UNAME_MACHINE=pc 1281238106Sdes fi 1282238106Sdes echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1283238106Sdes exit ;; 1284238106Sdes *:QNX:*:4*) 1285238106Sdes echo i386-pc-qnx 1286238106Sdes exit ;; 1287249141Sdes NEO-?:NONSTOP_KERNEL:*:*) 1288249141Sdes echo neo-tandem-nsk${UNAME_RELEASE} 1289249141Sdes exit ;; 1290249141Sdes NSE-*:NONSTOP_KERNEL:*:*) 1291238106Sdes echo nse-tandem-nsk${UNAME_RELEASE} 1292238106Sdes exit ;; 1293238106Sdes NSR-?:NONSTOP_KERNEL:*:*) 1294238106Sdes echo nsr-tandem-nsk${UNAME_RELEASE} 1295238106Sdes exit ;; 1296238106Sdes *:NonStop-UX:*:*) 1297238106Sdes echo mips-compaq-nonstopux 1298238106Sdes exit ;; 1299238106Sdes BS2000:POSIX*:*:*) 1300238106Sdes echo bs2000-siemens-sysv 1301238106Sdes exit ;; 1302238106Sdes DS/*:UNIX_System_V:*:*) 1303238106Sdes echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1304238106Sdes exit ;; 1305238106Sdes *:Plan9:*:*) 1306238106Sdes # "uname -m" is not consistent, so use $cputype instead. 386 1307238106Sdes # is converted to i386 for consistency with other x86 1308238106Sdes # operating systems. 1309238106Sdes if test "$cputype" = "386"; then 1310238106Sdes UNAME_MACHINE=i386 1311238106Sdes else 1312238106Sdes UNAME_MACHINE="$cputype" 1313238106Sdes fi 1314238106Sdes echo ${UNAME_MACHINE}-unknown-plan9 1315238106Sdes exit ;; 1316238106Sdes *:TOPS-10:*:*) 1317238106Sdes echo pdp10-unknown-tops10 1318238106Sdes exit ;; 1319238106Sdes *:TENEX:*:*) 1320238106Sdes echo pdp10-unknown-tenex 1321238106Sdes exit ;; 1322238106Sdes KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1323238106Sdes echo pdp10-dec-tops20 1324238106Sdes exit ;; 1325238106Sdes XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1326238106Sdes echo pdp10-xkl-tops20 1327238106Sdes exit ;; 1328238106Sdes *:TOPS-20:*:*) 1329238106Sdes echo pdp10-unknown-tops20 1330238106Sdes exit ;; 1331238106Sdes *:ITS:*:*) 1332238106Sdes echo pdp10-unknown-its 1333238106Sdes exit ;; 1334238106Sdes SEI:*:*:SEIUX) 1335249141Sdes echo mips-sei-seiux${UNAME_RELEASE} 1336238106Sdes exit ;; 1337238106Sdes *:DragonFly:*:*) 1338238106Sdes echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1339238106Sdes exit ;; 1340238106Sdes *:*VMS:*:*) 1341249141Sdes UNAME_MACHINE=`(uname -p) 2>/dev/null` 1342238106Sdes case "${UNAME_MACHINE}" in 1343238106Sdes A*) echo alpha-dec-vms ; exit ;; 1344238106Sdes I*) echo ia64-dec-vms ; exit ;; 1345238106Sdes V*) echo vax-dec-vms ; exit ;; 1346238106Sdes esac ;; 1347238106Sdes *:XENIX:*:SysV) 1348238106Sdes echo i386-pc-xenix 1349238106Sdes exit ;; 1350238106Sdes i*86:skyos:*:*) 1351238106Sdes echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1352238106Sdes exit ;; 1353238106Sdes i*86:rdos:*:*) 1354238106Sdes echo ${UNAME_MACHINE}-pc-rdos 1355238106Sdes exit ;; 1356238106Sdes i*86:AROS:*:*) 1357238106Sdes echo ${UNAME_MACHINE}-pc-aros 1358238106Sdes exit ;; 1359249141Sdes x86_64:VMkernel:*:*) 1360249141Sdes echo ${UNAME_MACHINE}-unknown-esx 1361249141Sdes exit ;; 1362238106Sdesesac 1363238106Sdes 1364238106Sdeseval $set_cc_for_build 1365238106Sdescat >$dummy.c <<EOF 1366238106Sdes#ifdef _SEQUENT_ 1367238106Sdes# include <sys/types.h> 1368238106Sdes# include <sys/utsname.h> 1369238106Sdes#endif 1370238106Sdesmain () 1371238106Sdes{ 1372238106Sdes#if defined (sony) 1373238106Sdes#if defined (MIPSEB) 1374238106Sdes /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1375238106Sdes I don't know.... */ 1376238106Sdes printf ("mips-sony-bsd\n"); exit (0); 1377238106Sdes#else 1378238106Sdes#include <sys/param.h> 1379238106Sdes printf ("m68k-sony-newsos%s\n", 1380238106Sdes#ifdef NEWSOS4 1381249141Sdes "4" 1382238106Sdes#else 1383249141Sdes "" 1384238106Sdes#endif 1385249141Sdes ); exit (0); 1386238106Sdes#endif 1387238106Sdes#endif 1388238106Sdes 1389238106Sdes#if defined (__arm) && defined (__acorn) && defined (__unix) 1390238106Sdes printf ("arm-acorn-riscix\n"); exit (0); 1391238106Sdes#endif 1392238106Sdes 1393238106Sdes#if defined (hp300) && !defined (hpux) 1394238106Sdes printf ("m68k-hp-bsd\n"); exit (0); 1395238106Sdes#endif 1396238106Sdes 1397238106Sdes#if defined (NeXT) 1398238106Sdes#if !defined (__ARCHITECTURE__) 1399238106Sdes#define __ARCHITECTURE__ "m68k" 1400238106Sdes#endif 1401238106Sdes int version; 1402238106Sdes version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1403238106Sdes if (version < 4) 1404238106Sdes printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1405238106Sdes else 1406238106Sdes printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1407238106Sdes exit (0); 1408238106Sdes#endif 1409238106Sdes 1410238106Sdes#if defined (MULTIMAX) || defined (n16) 1411238106Sdes#if defined (UMAXV) 1412238106Sdes printf ("ns32k-encore-sysv\n"); exit (0); 1413238106Sdes#else 1414238106Sdes#if defined (CMU) 1415238106Sdes printf ("ns32k-encore-mach\n"); exit (0); 1416238106Sdes#else 1417238106Sdes printf ("ns32k-encore-bsd\n"); exit (0); 1418238106Sdes#endif 1419238106Sdes#endif 1420238106Sdes#endif 1421238106Sdes 1422238106Sdes#if defined (__386BSD__) 1423238106Sdes printf ("i386-pc-bsd\n"); exit (0); 1424238106Sdes#endif 1425238106Sdes 1426238106Sdes#if defined (sequent) 1427238106Sdes#if defined (i386) 1428238106Sdes printf ("i386-sequent-dynix\n"); exit (0); 1429238106Sdes#endif 1430238106Sdes#if defined (ns32000) 1431238106Sdes printf ("ns32k-sequent-dynix\n"); exit (0); 1432238106Sdes#endif 1433238106Sdes#endif 1434238106Sdes 1435238106Sdes#if defined (_SEQUENT_) 1436238106Sdes struct utsname un; 1437238106Sdes 1438238106Sdes uname(&un); 1439238106Sdes 1440238106Sdes if (strncmp(un.version, "V2", 2) == 0) { 1441238106Sdes printf ("i386-sequent-ptx2\n"); exit (0); 1442238106Sdes } 1443238106Sdes if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1444238106Sdes printf ("i386-sequent-ptx1\n"); exit (0); 1445238106Sdes } 1446238106Sdes printf ("i386-sequent-ptx\n"); exit (0); 1447238106Sdes 1448238106Sdes#endif 1449238106Sdes 1450238106Sdes#if defined (vax) 1451238106Sdes# if !defined (ultrix) 1452238106Sdes# include <sys/param.h> 1453238106Sdes# if defined (BSD) 1454238106Sdes# if BSD == 43 1455238106Sdes printf ("vax-dec-bsd4.3\n"); exit (0); 1456238106Sdes# else 1457238106Sdes# if BSD == 199006 1458238106Sdes printf ("vax-dec-bsd4.3reno\n"); exit (0); 1459238106Sdes# else 1460238106Sdes printf ("vax-dec-bsd\n"); exit (0); 1461238106Sdes# endif 1462238106Sdes# endif 1463238106Sdes# else 1464238106Sdes printf ("vax-dec-bsd\n"); exit (0); 1465238106Sdes# endif 1466238106Sdes# else 1467238106Sdes printf ("vax-dec-ultrix\n"); exit (0); 1468238106Sdes# endif 1469238106Sdes#endif 1470238106Sdes 1471238106Sdes#if defined (alliant) && defined (i860) 1472238106Sdes printf ("i860-alliant-bsd\n"); exit (0); 1473238106Sdes#endif 1474238106Sdes 1475238106Sdes exit (1); 1476238106Sdes} 1477238106SdesEOF 1478238106Sdes 1479238106Sdes$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 1480238106Sdes { echo "$SYSTEM_NAME"; exit; } 1481238106Sdes 1482238106Sdes# Apollos put the system type in the environment. 1483238106Sdes 1484238106Sdestest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 1485238106Sdes 1486238106Sdes# Convex versions that predate uname can use getsysinfo(1) 1487238106Sdes 1488238106Sdesif [ -x /usr/convex/getsysinfo ] 1489238106Sdesthen 1490238106Sdes case `getsysinfo -f cpu_type` in 1491238106Sdes c1*) 1492238106Sdes echo c1-convex-bsd 1493238106Sdes exit ;; 1494238106Sdes c2*) 1495238106Sdes if getsysinfo -f scalar_acc 1496238106Sdes then echo c32-convex-bsd 1497238106Sdes else echo c2-convex-bsd 1498238106Sdes fi 1499238106Sdes exit ;; 1500238106Sdes c34*) 1501238106Sdes echo c34-convex-bsd 1502238106Sdes exit ;; 1503238106Sdes c38*) 1504238106Sdes echo c38-convex-bsd 1505238106Sdes exit ;; 1506238106Sdes c4*) 1507238106Sdes echo c4-convex-bsd 1508238106Sdes exit ;; 1509238106Sdes esac 1510238106Sdesfi 1511238106Sdes 1512238106Sdescat >&2 <<EOF 1513238106Sdes$0: unable to guess system type 1514238106Sdes 1515238106SdesThis script, last modified $timestamp, has failed to recognize 1516238106Sdesthe operating system you are using. It is advised that you 1517238106Sdesdownload the most up to date version of the config scripts from 1518238106Sdes 1519238106Sdes http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 1520238106Sdesand 1521238106Sdes http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 1522238106Sdes 1523238106SdesIf the version you run ($0) is already up to date, please 1524238106Sdessend the following data and any information you think might be 1525238106Sdespertinent to <config-patches@gnu.org> in order to provide the needed 1526238106Sdesinformation to handle your system. 1527238106Sdes 1528238106Sdesconfig.guess timestamp = $timestamp 1529238106Sdes 1530238106Sdesuname -m = `(uname -m) 2>/dev/null || echo unknown` 1531238106Sdesuname -r = `(uname -r) 2>/dev/null || echo unknown` 1532238106Sdesuname -s = `(uname -s) 2>/dev/null || echo unknown` 1533238106Sdesuname -v = `(uname -v) 2>/dev/null || echo unknown` 1534238106Sdes 1535238106Sdes/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1536238106Sdes/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1537238106Sdes 1538238106Sdeshostinfo = `(hostinfo) 2>/dev/null` 1539238106Sdes/bin/universe = `(/bin/universe) 2>/dev/null` 1540238106Sdes/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1541238106Sdes/bin/arch = `(/bin/arch) 2>/dev/null` 1542238106Sdes/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1543238106Sdes/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1544238106Sdes 1545238106SdesUNAME_MACHINE = ${UNAME_MACHINE} 1546238106SdesUNAME_RELEASE = ${UNAME_RELEASE} 1547238106SdesUNAME_SYSTEM = ${UNAME_SYSTEM} 1548238106SdesUNAME_VERSION = ${UNAME_VERSION} 1549238106SdesEOF 1550238106Sdes 1551238106Sdesexit 1 1552238106Sdes 1553238106Sdes# Local variables: 1554238106Sdes# eval: (add-hook 'write-file-hooks 'time-stamp) 1555238106Sdes# time-stamp-start: "timestamp='" 1556238106Sdes# time-stamp-format: "%:y-%02m-%02d" 1557238106Sdes# time-stamp-end: "'" 1558238106Sdes# End: 1559