1247738Sbapt#! /bin/sh 2247738Sbapt# Attempt to guess a canonical system name. 3247738Sbapt# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 4247738Sbapt# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 5247738Sbapt# Free Software Foundation, Inc. 6247738Sbapt 7247738Sbapttimestamp='2009-12-30' 8247738Sbapt 9247738Sbapt# This file is free software; you can redistribute it and/or modify it 10247738Sbapt# under the terms of the GNU General Public License as published by 11247738Sbapt# the Free Software Foundation; either version 2 of the License, or 12247738Sbapt# (at your option) any later version. 13247738Sbapt# 14247738Sbapt# This program is distributed in the hope that it will be useful, but 15247738Sbapt# WITHOUT ANY WARRANTY; without even the implied warranty of 16247738Sbapt# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17247738Sbapt# General Public License for more details. 18247738Sbapt# 19247738Sbapt# You should have received a copy of the GNU General Public License 20247738Sbapt# along with this program; if not, write to the Free Software 21247738Sbapt# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 22247738Sbapt# 02110-1301, USA. 23247738Sbapt# 24247738Sbapt# As a special exception to the GNU General Public License, if you 25247738Sbapt# distribute this file as part of a program that contains a 26247738Sbapt# configuration script generated by Autoconf, you may include it under 27247738Sbapt# the same distribution terms that you use for the rest of that program. 28247738Sbapt 29247738Sbapt 30247738Sbapt# Originally written by Per Bothner. Please send patches (context 31247738Sbapt# diff format) to <config-patches@gnu.org> and include a ChangeLog 32247738Sbapt# entry. 33247738Sbapt# 34247738Sbapt# This script attempts to guess a canonical system name similar to 35247738Sbapt# config.sub. If it succeeds, it prints the system name on stdout, and 36247738Sbapt# exits with 0. Otherwise, it exits with 1. 37247738Sbapt# 38247738Sbapt# You can get the latest version of this script from: 39247738Sbapt# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 40247738Sbapt 41247738Sbaptme=`echo "$0" | sed -e 's,.*/,,'` 42247738Sbapt 43247738Sbaptusage="\ 44247738SbaptUsage: $0 [OPTION] 45247738Sbapt 46247738SbaptOutput the configuration name of the system \`$me' is run on. 47247738Sbapt 48247738SbaptOperation modes: 49247738Sbapt -h, --help print this help, then exit 50247738Sbapt -t, --time-stamp print date of last modification, then exit 51247738Sbapt -v, --version print version number, then exit 52247738Sbapt 53247738SbaptReport bugs and patches to <config-patches@gnu.org>." 54247738Sbapt 55247738Sbaptversion="\ 56247738SbaptGNU config.guess ($timestamp) 57247738Sbapt 58247738SbaptOriginally written by Per Bothner. 59247738SbaptCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 60247738Sbapt2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free 61247738SbaptSoftware Foundation, Inc. 62247738Sbapt 63247738SbaptThis is free software; see the source for copying conditions. There is NO 64247738Sbaptwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 65247738Sbapt 66247738Sbapthelp=" 67247738SbaptTry \`$me --help' for more information." 68247738Sbapt 69247738Sbapt# Parse command line 70247738Sbaptwhile test $# -gt 0 ; do 71247738Sbapt case $1 in 72247738Sbapt --time-stamp | --time* | -t ) 73247738Sbapt echo "$timestamp" ; exit ;; 74247738Sbapt --version | -v ) 75247738Sbapt echo "$version" ; exit ;; 76247738Sbapt --help | --h* | -h ) 77247738Sbapt echo "$usage"; exit ;; 78247738Sbapt -- ) # Stop option processing 79247738Sbapt shift; break ;; 80247738Sbapt - ) # Use stdin as input. 81247738Sbapt break ;; 82247738Sbapt -* ) 83247738Sbapt echo "$me: invalid option $1$help" >&2 84247738Sbapt exit 1 ;; 85247738Sbapt * ) 86247738Sbapt break ;; 87247738Sbapt esac 88247738Sbaptdone 89247738Sbapt 90247738Sbaptif test $# != 0; then 91247738Sbapt echo "$me: too many arguments$help" >&2 92247738Sbapt exit 1 93247738Sbaptfi 94247738Sbapt 95247738Sbapttrap 'exit 1' 1 2 15 96247738Sbapt 97247738Sbapt# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 98247738Sbapt# compiler to aid in system detection is discouraged as it requires 99247738Sbapt# temporary files to be created and, as you can see below, it is a 100247738Sbapt# headache to deal with in a portable fashion. 101247738Sbapt 102247738Sbapt# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 103247738Sbapt# use `HOST_CC' if defined, but it is deprecated. 104247738Sbapt 105247738Sbapt# Portable tmp directory creation inspired by the Autoconf team. 106247738Sbapt 107247738Sbaptset_cc_for_build=' 108247738Sbapttrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 109247738Sbapttrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 110247738Sbapt: ${TMPDIR=/tmp} ; 111247738Sbapt { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 112247738Sbapt { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 113247738Sbapt { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 114247738Sbapt { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 115247738Sbaptdummy=$tmp/dummy ; 116247738Sbapttmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 117247738Sbaptcase $CC_FOR_BUILD,$HOST_CC,$CC in 118247738Sbapt ,,) echo "int x;" > $dummy.c ; 119247738Sbapt for c in cc gcc c89 c99 ; do 120247738Sbapt if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 121247738Sbapt CC_FOR_BUILD="$c"; break ; 122247738Sbapt fi ; 123247738Sbapt done ; 124247738Sbapt if test x"$CC_FOR_BUILD" = x ; then 125247738Sbapt CC_FOR_BUILD=no_compiler_found ; 126247738Sbapt fi 127247738Sbapt ;; 128247738Sbapt ,,*) CC_FOR_BUILD=$CC ;; 129247738Sbapt ,*,*) CC_FOR_BUILD=$HOST_CC ;; 130247738Sbaptesac ; set_cc_for_build= ;' 131247738Sbapt 132247738Sbapt# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 133247738Sbapt# (ghazi@noc.rutgers.edu 1994-08-24) 134247738Sbaptif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 135247738Sbapt PATH=$PATH:/.attbin ; export PATH 136247738Sbaptfi 137247738Sbapt 138247738SbaptUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 139247738SbaptUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 140247738SbaptUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 141247738SbaptUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 142247738Sbapt 143247738Sbapt# Note: order is significant - the case branches are not exclusive. 144247738Sbapt 145247738Sbaptcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 146247738Sbapt *:NetBSD:*:*) 147247738Sbapt # NetBSD (nbsd) targets should (where applicable) match one or 148247738Sbapt # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 149247738Sbapt # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 150247738Sbapt # switched to ELF, *-*-netbsd* would select the old 151247738Sbapt # object file format. This provides both forward 152247738Sbapt # compatibility and a consistent mechanism for selecting the 153247738Sbapt # object file format. 154247738Sbapt # 155247738Sbapt # Note: NetBSD doesn't particularly care about the vendor 156247738Sbapt # portion of the name. We always set it to "unknown". 157247738Sbapt sysctl="sysctl -n hw.machine_arch" 158247738Sbapt UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 159247738Sbapt /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 160247738Sbapt case "${UNAME_MACHINE_ARCH}" in 161247738Sbapt armeb) machine=armeb-unknown ;; 162247738Sbapt arm*) machine=arm-unknown ;; 163247738Sbapt sh3el) machine=shl-unknown ;; 164247738Sbapt sh3eb) machine=sh-unknown ;; 165247738Sbapt sh5el) machine=sh5le-unknown ;; 166247738Sbapt *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 167247738Sbapt esac 168247738Sbapt # The Operating System including object format, if it has switched 169247738Sbapt # to ELF recently, or will in the future. 170247738Sbapt case "${UNAME_MACHINE_ARCH}" in 171247738Sbapt arm*|i386|m68k|ns32k|sh3*|sparc|vax) 172247738Sbapt eval $set_cc_for_build 173247738Sbapt if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 174247738Sbapt | grep -q __ELF__ 175247738Sbapt then 176247738Sbapt # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 177247738Sbapt # Return netbsd for either. FIX? 178247738Sbapt os=netbsd 179247738Sbapt else 180247738Sbapt os=netbsdelf 181247738Sbapt fi 182247738Sbapt ;; 183247738Sbapt *) 184247738Sbapt os=netbsd 185247738Sbapt ;; 186247738Sbapt esac 187247738Sbapt # The OS release 188247738Sbapt # Debian GNU/NetBSD machines have a different userland, and 189247738Sbapt # thus, need a distinct triplet. However, they do not need 190247738Sbapt # kernel version information, so it can be replaced with a 191247738Sbapt # suitable tag, in the style of linux-gnu. 192247738Sbapt case "${UNAME_VERSION}" in 193247738Sbapt Debian*) 194247738Sbapt release='-gnu' 195247738Sbapt ;; 196247738Sbapt *) 197247738Sbapt release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 198247738Sbapt ;; 199247738Sbapt esac 200247738Sbapt # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 201247738Sbapt # contains redundant information, the shorter form: 202247738Sbapt # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 203247738Sbapt echo "${machine}-${os}${release}" 204247738Sbapt exit ;; 205247738Sbapt *:OpenBSD:*:*) 206247738Sbapt UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 207247738Sbapt echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 208247738Sbapt exit ;; 209247738Sbapt *:ekkoBSD:*:*) 210247738Sbapt echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 211247738Sbapt exit ;; 212247738Sbapt *:SolidBSD:*:*) 213247738Sbapt echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 214247738Sbapt exit ;; 215247738Sbapt macppc:MirBSD:*:*) 216247738Sbapt echo powerpc-unknown-mirbsd${UNAME_RELEASE} 217247738Sbapt exit ;; 218247738Sbapt *:MirBSD:*:*) 219247738Sbapt echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 220247738Sbapt exit ;; 221247738Sbapt alpha:OSF1:*:*) 222247738Sbapt case $UNAME_RELEASE in 223247738Sbapt *4.0) 224247738Sbapt UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 225247738Sbapt ;; 226247738Sbapt *5.*) 227247738Sbapt UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 228247738Sbapt ;; 229247738Sbapt esac 230247738Sbapt # According to Compaq, /usr/sbin/psrinfo has been available on 231247738Sbapt # OSF/1 and Tru64 systems produced since 1995. I hope that 232247738Sbapt # covers most systems running today. This code pipes the CPU 233247738Sbapt # types through head -n 1, so we only detect the type of CPU 0. 234247738Sbapt ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 235247738Sbapt case "$ALPHA_CPU_TYPE" in 236247738Sbapt "EV4 (21064)") 237247738Sbapt UNAME_MACHINE="alpha" ;; 238247738Sbapt "EV4.5 (21064)") 239247738Sbapt UNAME_MACHINE="alpha" ;; 240247738Sbapt "LCA4 (21066/21068)") 241247738Sbapt UNAME_MACHINE="alpha" ;; 242247738Sbapt "EV5 (21164)") 243247738Sbapt UNAME_MACHINE="alphaev5" ;; 244247738Sbapt "EV5.6 (21164A)") 245247738Sbapt UNAME_MACHINE="alphaev56" ;; 246247738Sbapt "EV5.6 (21164PC)") 247247738Sbapt UNAME_MACHINE="alphapca56" ;; 248247738Sbapt "EV5.7 (21164PC)") 249247738Sbapt UNAME_MACHINE="alphapca57" ;; 250247738Sbapt "EV6 (21264)") 251247738Sbapt UNAME_MACHINE="alphaev6" ;; 252247738Sbapt "EV6.7 (21264A)") 253247738Sbapt UNAME_MACHINE="alphaev67" ;; 254247738Sbapt "EV6.8CB (21264C)") 255247738Sbapt UNAME_MACHINE="alphaev68" ;; 256247738Sbapt "EV6.8AL (21264B)") 257247738Sbapt UNAME_MACHINE="alphaev68" ;; 258247738Sbapt "EV6.8CX (21264D)") 259247738Sbapt UNAME_MACHINE="alphaev68" ;; 260247738Sbapt "EV6.9A (21264/EV69A)") 261247738Sbapt UNAME_MACHINE="alphaev69" ;; 262247738Sbapt "EV7 (21364)") 263247738Sbapt UNAME_MACHINE="alphaev7" ;; 264247738Sbapt "EV7.9 (21364A)") 265247738Sbapt UNAME_MACHINE="alphaev79" ;; 266247738Sbapt esac 267247738Sbapt # A Pn.n version is a patched version. 268247738Sbapt # A Vn.n version is a released version. 269247738Sbapt # A Tn.n version is a released field test version. 270247738Sbapt # A Xn.n version is an unreleased experimental baselevel. 271247738Sbapt # 1.2 uses "1.2" for uname -r. 272247738Sbapt echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 273247738Sbapt exit ;; 274247738Sbapt Alpha\ *:Windows_NT*:*) 275247738Sbapt # How do we know it's Interix rather than the generic POSIX subsystem? 276247738Sbapt # Should we change UNAME_MACHINE based on the output of uname instead 277247738Sbapt # of the specific Alpha model? 278247738Sbapt echo alpha-pc-interix 279247738Sbapt exit ;; 280247738Sbapt 21064:Windows_NT:50:3) 281247738Sbapt echo alpha-dec-winnt3.5 282247738Sbapt exit ;; 283247738Sbapt Amiga*:UNIX_System_V:4.0:*) 284247738Sbapt echo m68k-unknown-sysv4 285247738Sbapt exit ;; 286247738Sbapt *:[Aa]miga[Oo][Ss]:*:*) 287247738Sbapt echo ${UNAME_MACHINE}-unknown-amigaos 288247738Sbapt exit ;; 289247738Sbapt *:[Mm]orph[Oo][Ss]:*:*) 290247738Sbapt echo ${UNAME_MACHINE}-unknown-morphos 291247738Sbapt exit ;; 292247738Sbapt *:OS/390:*:*) 293247738Sbapt echo i370-ibm-openedition 294247738Sbapt exit ;; 295247738Sbapt *:z/VM:*:*) 296247738Sbapt echo s390-ibm-zvmoe 297247738Sbapt exit ;; 298247738Sbapt *:OS400:*:*) 299247738Sbapt echo powerpc-ibm-os400 300247738Sbapt exit ;; 301247738Sbapt arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 302247738Sbapt echo arm-acorn-riscix${UNAME_RELEASE} 303247738Sbapt exit ;; 304247738Sbapt arm:riscos:*:*|arm:RISCOS:*:*) 305247738Sbapt echo arm-unknown-riscos 306247738Sbapt exit ;; 307247738Sbapt SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 308247738Sbapt echo hppa1.1-hitachi-hiuxmpp 309247738Sbapt exit ;; 310247738Sbapt Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 311247738Sbapt # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 312247738Sbapt if test "`(/bin/universe) 2>/dev/null`" = att ; then 313247738Sbapt echo pyramid-pyramid-sysv3 314247738Sbapt else 315247738Sbapt echo pyramid-pyramid-bsd 316247738Sbapt fi 317247738Sbapt exit ;; 318247738Sbapt NILE*:*:*:dcosx) 319247738Sbapt echo pyramid-pyramid-svr4 320247738Sbapt exit ;; 321247738Sbapt DRS?6000:unix:4.0:6*) 322247738Sbapt echo sparc-icl-nx6 323247738Sbapt exit ;; 324247738Sbapt DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 325247738Sbapt case `/usr/bin/uname -p` in 326247738Sbapt sparc) echo sparc-icl-nx7; exit ;; 327247738Sbapt esac ;; 328247738Sbapt s390x:SunOS:*:*) 329247738Sbapt echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 330247738Sbapt exit ;; 331247738Sbapt sun4H:SunOS:5.*:*) 332247738Sbapt echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 333247738Sbapt exit ;; 334247738Sbapt sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 335247738Sbapt echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 336247738Sbapt exit ;; 337247738Sbapt i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 338247738Sbapt echo i386-pc-auroraux${UNAME_RELEASE} 339247738Sbapt exit ;; 340247738Sbapt i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 341247738Sbapt eval $set_cc_for_build 342247738Sbapt SUN_ARCH="i386" 343247738Sbapt # If there is a compiler, see if it is configured for 64-bit objects. 344247738Sbapt # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 345247738Sbapt # This test works for both compilers. 346247738Sbapt if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 347247738Sbapt if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 348247738Sbapt (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 349247738Sbapt grep IS_64BIT_ARCH >/dev/null 350247738Sbapt then 351247738Sbapt SUN_ARCH="x86_64" 352247738Sbapt fi 353247738Sbapt fi 354247738Sbapt echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 355247738Sbapt exit ;; 356247738Sbapt sun4*:SunOS:6*:*) 357247738Sbapt # According to config.sub, this is the proper way to canonicalize 358247738Sbapt # SunOS6. Hard to guess exactly what SunOS6 will be like, but 359247738Sbapt # it's likely to be more like Solaris than SunOS4. 360247738Sbapt echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 361247738Sbapt exit ;; 362247738Sbapt sun4*:SunOS:*:*) 363247738Sbapt case "`/usr/bin/arch -k`" in 364247738Sbapt Series*|S4*) 365247738Sbapt UNAME_RELEASE=`uname -v` 366247738Sbapt ;; 367247738Sbapt esac 368247738Sbapt # Japanese Language versions have a version number like `4.1.3-JL'. 369247738Sbapt echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 370247738Sbapt exit ;; 371247738Sbapt sun3*:SunOS:*:*) 372247738Sbapt echo m68k-sun-sunos${UNAME_RELEASE} 373247738Sbapt exit ;; 374247738Sbapt sun*:*:4.2BSD:*) 375247738Sbapt UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 376247738Sbapt test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 377247738Sbapt case "`/bin/arch`" in 378247738Sbapt sun3) 379247738Sbapt echo m68k-sun-sunos${UNAME_RELEASE} 380247738Sbapt ;; 381247738Sbapt sun4) 382247738Sbapt echo sparc-sun-sunos${UNAME_RELEASE} 383247738Sbapt ;; 384247738Sbapt esac 385247738Sbapt exit ;; 386247738Sbapt aushp:SunOS:*:*) 387247738Sbapt echo sparc-auspex-sunos${UNAME_RELEASE} 388247738Sbapt exit ;; 389247738Sbapt # The situation for MiNT is a little confusing. The machine name 390247738Sbapt # can be virtually everything (everything which is not 391247738Sbapt # "atarist" or "atariste" at least should have a processor 392247738Sbapt # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 393247738Sbapt # to the lowercase version "mint" (or "freemint"). Finally 394247738Sbapt # the system name "TOS" denotes a system which is actually not 395247738Sbapt # MiNT. But MiNT is downward compatible to TOS, so this should 396247738Sbapt # be no problem. 397247738Sbapt atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 398247738Sbapt echo m68k-atari-mint${UNAME_RELEASE} 399247738Sbapt exit ;; 400247738Sbapt atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 401247738Sbapt echo m68k-atari-mint${UNAME_RELEASE} 402247738Sbapt exit ;; 403247738Sbapt *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 404247738Sbapt echo m68k-atari-mint${UNAME_RELEASE} 405247738Sbapt exit ;; 406247738Sbapt milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 407247738Sbapt echo m68k-milan-mint${UNAME_RELEASE} 408247738Sbapt exit ;; 409247738Sbapt hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 410247738Sbapt echo m68k-hades-mint${UNAME_RELEASE} 411247738Sbapt exit ;; 412247738Sbapt *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 413247738Sbapt echo m68k-unknown-mint${UNAME_RELEASE} 414247738Sbapt exit ;; 415247738Sbapt m68k:machten:*:*) 416247738Sbapt echo m68k-apple-machten${UNAME_RELEASE} 417247738Sbapt exit ;; 418247738Sbapt powerpc:machten:*:*) 419247738Sbapt echo powerpc-apple-machten${UNAME_RELEASE} 420247738Sbapt exit ;; 421247738Sbapt RISC*:Mach:*:*) 422247738Sbapt echo mips-dec-mach_bsd4.3 423247738Sbapt exit ;; 424247738Sbapt RISC*:ULTRIX:*:*) 425247738Sbapt echo mips-dec-ultrix${UNAME_RELEASE} 426247738Sbapt exit ;; 427247738Sbapt VAX*:ULTRIX*:*:*) 428247738Sbapt echo vax-dec-ultrix${UNAME_RELEASE} 429247738Sbapt exit ;; 430247738Sbapt 2020:CLIX:*:* | 2430:CLIX:*:*) 431247738Sbapt echo clipper-intergraph-clix${UNAME_RELEASE} 432247738Sbapt exit ;; 433247738Sbapt mips:*:*:UMIPS | mips:*:*:RISCos) 434247738Sbapt eval $set_cc_for_build 435247738Sbapt sed 's/^ //' << EOF >$dummy.c 436247738Sbapt#ifdef __cplusplus 437247738Sbapt#include <stdio.h> /* for printf() prototype */ 438247738Sbapt int main (int argc, char *argv[]) { 439247738Sbapt#else 440247738Sbapt int main (argc, argv) int argc; char *argv[]; { 441247738Sbapt#endif 442247738Sbapt #if defined (host_mips) && defined (MIPSEB) 443247738Sbapt #if defined (SYSTYPE_SYSV) 444247738Sbapt printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 445247738Sbapt #endif 446247738Sbapt #if defined (SYSTYPE_SVR4) 447247738Sbapt printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 448247738Sbapt #endif 449247738Sbapt #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 450247738Sbapt printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 451247738Sbapt #endif 452247738Sbapt #endif 453247738Sbapt exit (-1); 454247738Sbapt } 455247738SbaptEOF 456247738Sbapt $CC_FOR_BUILD -o $dummy $dummy.c && 457247738Sbapt dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 458247738Sbapt SYSTEM_NAME=`$dummy $dummyarg` && 459247738Sbapt { echo "$SYSTEM_NAME"; exit; } 460247738Sbapt echo mips-mips-riscos${UNAME_RELEASE} 461247738Sbapt exit ;; 462247738Sbapt Motorola:PowerMAX_OS:*:*) 463247738Sbapt echo powerpc-motorola-powermax 464247738Sbapt exit ;; 465247738Sbapt Motorola:*:4.3:PL8-*) 466247738Sbapt echo powerpc-harris-powermax 467247738Sbapt exit ;; 468247738Sbapt Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 469247738Sbapt echo powerpc-harris-powermax 470247738Sbapt exit ;; 471247738Sbapt Night_Hawk:Power_UNIX:*:*) 472247738Sbapt echo powerpc-harris-powerunix 473247738Sbapt exit ;; 474247738Sbapt m88k:CX/UX:7*:*) 475247738Sbapt echo m88k-harris-cxux7 476247738Sbapt exit ;; 477247738Sbapt m88k:*:4*:R4*) 478247738Sbapt echo m88k-motorola-sysv4 479247738Sbapt exit ;; 480247738Sbapt m88k:*:3*:R3*) 481247738Sbapt echo m88k-motorola-sysv3 482247738Sbapt exit ;; 483247738Sbapt AViiON:dgux:*:*) 484247738Sbapt # DG/UX returns AViiON for all architectures 485247738Sbapt UNAME_PROCESSOR=`/usr/bin/uname -p` 486247738Sbapt if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 487247738Sbapt then 488247738Sbapt if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 489247738Sbapt [ ${TARGET_BINARY_INTERFACE}x = x ] 490247738Sbapt then 491247738Sbapt echo m88k-dg-dgux${UNAME_RELEASE} 492247738Sbapt else 493247738Sbapt echo m88k-dg-dguxbcs${UNAME_RELEASE} 494247738Sbapt fi 495247738Sbapt else 496247738Sbapt echo i586-dg-dgux${UNAME_RELEASE} 497247738Sbapt fi 498247738Sbapt exit ;; 499247738Sbapt M88*:DolphinOS:*:*) # DolphinOS (SVR3) 500247738Sbapt echo m88k-dolphin-sysv3 501247738Sbapt exit ;; 502247738Sbapt M88*:*:R3*:*) 503247738Sbapt # Delta 88k system running SVR3 504247738Sbapt echo m88k-motorola-sysv3 505247738Sbapt exit ;; 506247738Sbapt XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 507247738Sbapt echo m88k-tektronix-sysv3 508247738Sbapt exit ;; 509247738Sbapt Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 510247738Sbapt echo m68k-tektronix-bsd 511247738Sbapt exit ;; 512247738Sbapt *:IRIX*:*:*) 513247738Sbapt echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 514247738Sbapt exit ;; 515247738Sbapt ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 516247738Sbapt echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 517247738Sbapt exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 518247738Sbapt i*86:AIX:*:*) 519247738Sbapt echo i386-ibm-aix 520247738Sbapt exit ;; 521247738Sbapt ia64:AIX:*:*) 522247738Sbapt if [ -x /usr/bin/oslevel ] ; then 523247738Sbapt IBM_REV=`/usr/bin/oslevel` 524247738Sbapt else 525247738Sbapt IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 526247738Sbapt fi 527247738Sbapt echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 528247738Sbapt exit ;; 529247738Sbapt *:AIX:2:3) 530247738Sbapt if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 531247738Sbapt eval $set_cc_for_build 532247738Sbapt sed 's/^ //' << EOF >$dummy.c 533247738Sbapt #include <sys/systemcfg.h> 534247738Sbapt 535247738Sbapt main() 536247738Sbapt { 537247738Sbapt if (!__power_pc()) 538247738Sbapt exit(1); 539247738Sbapt puts("powerpc-ibm-aix3.2.5"); 540247738Sbapt exit(0); 541247738Sbapt } 542247738SbaptEOF 543247738Sbapt if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 544247738Sbapt then 545247738Sbapt echo "$SYSTEM_NAME" 546247738Sbapt else 547247738Sbapt echo rs6000-ibm-aix3.2.5 548247738Sbapt fi 549247738Sbapt elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 550247738Sbapt echo rs6000-ibm-aix3.2.4 551247738Sbapt else 552247738Sbapt echo rs6000-ibm-aix3.2 553247738Sbapt fi 554247738Sbapt exit ;; 555247738Sbapt *:AIX:*:[456]) 556247738Sbapt IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 557247738Sbapt if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 558247738Sbapt IBM_ARCH=rs6000 559247738Sbapt else 560247738Sbapt IBM_ARCH=powerpc 561247738Sbapt fi 562247738Sbapt if [ -x /usr/bin/oslevel ] ; then 563247738Sbapt IBM_REV=`/usr/bin/oslevel` 564247738Sbapt else 565247738Sbapt IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 566247738Sbapt fi 567247738Sbapt echo ${IBM_ARCH}-ibm-aix${IBM_REV} 568247738Sbapt exit ;; 569247738Sbapt *:AIX:*:*) 570247738Sbapt echo rs6000-ibm-aix 571247738Sbapt exit ;; 572247738Sbapt ibmrt:4.4BSD:*|romp-ibm:BSD:*) 573247738Sbapt echo romp-ibm-bsd4.4 574247738Sbapt exit ;; 575247738Sbapt ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 576247738Sbapt echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 577247738Sbapt exit ;; # report: romp-ibm BSD 4.3 578247738Sbapt *:BOSX:*:*) 579247738Sbapt echo rs6000-bull-bosx 580247738Sbapt exit ;; 581247738Sbapt DPX/2?00:B.O.S.:*:*) 582247738Sbapt echo m68k-bull-sysv3 583247738Sbapt exit ;; 584247738Sbapt 9000/[34]??:4.3bsd:1.*:*) 585247738Sbapt echo m68k-hp-bsd 586247738Sbapt exit ;; 587247738Sbapt hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 588247738Sbapt echo m68k-hp-bsd4.4 589247738Sbapt exit ;; 590247738Sbapt 9000/[34678]??:HP-UX:*:*) 591247738Sbapt HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 592247738Sbapt case "${UNAME_MACHINE}" in 593247738Sbapt 9000/31? ) HP_ARCH=m68000 ;; 594247738Sbapt 9000/[34]?? ) HP_ARCH=m68k ;; 595247738Sbapt 9000/[678][0-9][0-9]) 596247738Sbapt if [ -x /usr/bin/getconf ]; then 597247738Sbapt sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 598247738Sbapt sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 599247738Sbapt case "${sc_cpu_version}" in 600247738Sbapt 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 601247738Sbapt 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 602247738Sbapt 532) # CPU_PA_RISC2_0 603247738Sbapt case "${sc_kernel_bits}" in 604247738Sbapt 32) HP_ARCH="hppa2.0n" ;; 605247738Sbapt 64) HP_ARCH="hppa2.0w" ;; 606247738Sbapt '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 607247738Sbapt esac ;; 608247738Sbapt esac 609247738Sbapt fi 610247738Sbapt if [ "${HP_ARCH}" = "" ]; then 611247738Sbapt eval $set_cc_for_build 612247738Sbapt sed 's/^ //' << EOF >$dummy.c 613247738Sbapt 614247738Sbapt #define _HPUX_SOURCE 615247738Sbapt #include <stdlib.h> 616247738Sbapt #include <unistd.h> 617247738Sbapt 618247738Sbapt int main () 619247738Sbapt { 620247738Sbapt #if defined(_SC_KERNEL_BITS) 621247738Sbapt long bits = sysconf(_SC_KERNEL_BITS); 622247738Sbapt #endif 623247738Sbapt long cpu = sysconf (_SC_CPU_VERSION); 624247738Sbapt 625247738Sbapt switch (cpu) 626247738Sbapt { 627247738Sbapt case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 628247738Sbapt case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 629247738Sbapt case CPU_PA_RISC2_0: 630247738Sbapt #if defined(_SC_KERNEL_BITS) 631247738Sbapt switch (bits) 632247738Sbapt { 633247738Sbapt case 64: puts ("hppa2.0w"); break; 634247738Sbapt case 32: puts ("hppa2.0n"); break; 635247738Sbapt default: puts ("hppa2.0"); break; 636247738Sbapt } break; 637247738Sbapt #else /* !defined(_SC_KERNEL_BITS) */ 638247738Sbapt puts ("hppa2.0"); break; 639247738Sbapt #endif 640247738Sbapt default: puts ("hppa1.0"); break; 641247738Sbapt } 642247738Sbapt exit (0); 643247738Sbapt } 644247738SbaptEOF 645247738Sbapt (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 646247738Sbapt test -z "$HP_ARCH" && HP_ARCH=hppa 647247738Sbapt fi ;; 648247738Sbapt esac 649247738Sbapt if [ ${HP_ARCH} = "hppa2.0w" ] 650247738Sbapt then 651247738Sbapt eval $set_cc_for_build 652247738Sbapt 653247738Sbapt # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 654247738Sbapt # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 655247738Sbapt # generating 64-bit code. GNU and HP use different nomenclature: 656247738Sbapt # 657247738Sbapt # $ CC_FOR_BUILD=cc ./config.guess 658247738Sbapt # => hppa2.0w-hp-hpux11.23 659247738Sbapt # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 660247738Sbapt # => hppa64-hp-hpux11.23 661247738Sbapt 662247738Sbapt if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 663247738Sbapt grep -q __LP64__ 664247738Sbapt then 665247738Sbapt HP_ARCH="hppa2.0w" 666247738Sbapt else 667247738Sbapt HP_ARCH="hppa64" 668247738Sbapt fi 669247738Sbapt fi 670247738Sbapt echo ${HP_ARCH}-hp-hpux${HPUX_REV} 671247738Sbapt exit ;; 672247738Sbapt ia64:HP-UX:*:*) 673247738Sbapt HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 674247738Sbapt echo ia64-hp-hpux${HPUX_REV} 675247738Sbapt exit ;; 676247738Sbapt 3050*:HI-UX:*:*) 677247738Sbapt eval $set_cc_for_build 678247738Sbapt sed 's/^ //' << EOF >$dummy.c 679247738Sbapt #include <unistd.h> 680247738Sbapt int 681247738Sbapt main () 682247738Sbapt { 683247738Sbapt long cpu = sysconf (_SC_CPU_VERSION); 684247738Sbapt /* The order matters, because CPU_IS_HP_MC68K erroneously returns 685247738Sbapt true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 686247738Sbapt results, however. */ 687247738Sbapt if (CPU_IS_PA_RISC (cpu)) 688247738Sbapt { 689247738Sbapt switch (cpu) 690247738Sbapt { 691247738Sbapt case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 692247738Sbapt case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 693247738Sbapt case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 694247738Sbapt default: puts ("hppa-hitachi-hiuxwe2"); break; 695247738Sbapt } 696247738Sbapt } 697247738Sbapt else if (CPU_IS_HP_MC68K (cpu)) 698247738Sbapt puts ("m68k-hitachi-hiuxwe2"); 699247738Sbapt else puts ("unknown-hitachi-hiuxwe2"); 700247738Sbapt exit (0); 701247738Sbapt } 702247738SbaptEOF 703247738Sbapt $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 704247738Sbapt { echo "$SYSTEM_NAME"; exit; } 705247738Sbapt echo unknown-hitachi-hiuxwe2 706247738Sbapt exit ;; 707247738Sbapt 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 708247738Sbapt echo hppa1.1-hp-bsd 709247738Sbapt exit ;; 710247738Sbapt 9000/8??:4.3bsd:*:*) 711247738Sbapt echo hppa1.0-hp-bsd 712247738Sbapt exit ;; 713247738Sbapt *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 714247738Sbapt echo hppa1.0-hp-mpeix 715247738Sbapt exit ;; 716247738Sbapt hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 717247738Sbapt echo hppa1.1-hp-osf 718247738Sbapt exit ;; 719247738Sbapt hp8??:OSF1:*:*) 720247738Sbapt echo hppa1.0-hp-osf 721247738Sbapt exit ;; 722247738Sbapt i*86:OSF1:*:*) 723247738Sbapt if [ -x /usr/sbin/sysversion ] ; then 724247738Sbapt echo ${UNAME_MACHINE}-unknown-osf1mk 725247738Sbapt else 726247738Sbapt echo ${UNAME_MACHINE}-unknown-osf1 727247738Sbapt fi 728247738Sbapt exit ;; 729247738Sbapt parisc*:Lites*:*:*) 730247738Sbapt echo hppa1.1-hp-lites 731247738Sbapt exit ;; 732247738Sbapt C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 733247738Sbapt echo c1-convex-bsd 734247738Sbapt exit ;; 735247738Sbapt C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 736247738Sbapt if getsysinfo -f scalar_acc 737247738Sbapt then echo c32-convex-bsd 738247738Sbapt else echo c2-convex-bsd 739247738Sbapt fi 740247738Sbapt exit ;; 741247738Sbapt C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 742247738Sbapt echo c34-convex-bsd 743247738Sbapt exit ;; 744247738Sbapt C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 745247738Sbapt echo c38-convex-bsd 746247738Sbapt exit ;; 747247738Sbapt C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 748247738Sbapt echo c4-convex-bsd 749247738Sbapt exit ;; 750247738Sbapt CRAY*Y-MP:*:*:*) 751247738Sbapt echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 752247738Sbapt exit ;; 753247738Sbapt CRAY*[A-Z]90:*:*:*) 754247738Sbapt echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 755247738Sbapt | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 756247738Sbapt -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 757247738Sbapt -e 's/\.[^.]*$/.X/' 758247738Sbapt exit ;; 759247738Sbapt CRAY*TS:*:*:*) 760247738Sbapt echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 761247738Sbapt exit ;; 762247738Sbapt CRAY*T3E:*:*:*) 763247738Sbapt echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 764247738Sbapt exit ;; 765247738Sbapt CRAY*SV1:*:*:*) 766247738Sbapt echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 767247738Sbapt exit ;; 768247738Sbapt *:UNICOS/mp:*:*) 769247738Sbapt echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 770247738Sbapt exit ;; 771247738Sbapt F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 772247738Sbapt FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 773247738Sbapt FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 774247738Sbapt FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 775247738Sbapt echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 776247738Sbapt exit ;; 777247738Sbapt 5000:UNIX_System_V:4.*:*) 778247738Sbapt FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 779247738Sbapt FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 780247738Sbapt echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 781247738Sbapt exit ;; 782247738Sbapt i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 783247738Sbapt echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 784247738Sbapt exit ;; 785247738Sbapt sparc*:BSD/OS:*:*) 786247738Sbapt echo sparc-unknown-bsdi${UNAME_RELEASE} 787247738Sbapt exit ;; 788247738Sbapt *:BSD/OS:*:*) 789247738Sbapt echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 790247738Sbapt exit ;; 791247738Sbapt *:FreeBSD:*:*) 792247738Sbapt case ${UNAME_MACHINE} in 793247738Sbapt pc98) 794247738Sbapt echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 795247738Sbapt amd64) 796247738Sbapt echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 797247738Sbapt *) 798247738Sbapt echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 799247738Sbapt esac 800247738Sbapt exit ;; 801247738Sbapt i*:CYGWIN*:*) 802247738Sbapt echo ${UNAME_MACHINE}-pc-cygwin 803247738Sbapt exit ;; 804247738Sbapt *:MINGW*:*) 805247738Sbapt echo ${UNAME_MACHINE}-pc-mingw32 806247738Sbapt exit ;; 807247738Sbapt i*:windows32*:*) 808247738Sbapt # uname -m includes "-pc" on this system. 809247738Sbapt echo ${UNAME_MACHINE}-mingw32 810247738Sbapt exit ;; 811247738Sbapt i*:PW*:*) 812247738Sbapt echo ${UNAME_MACHINE}-pc-pw32 813247738Sbapt exit ;; 814247738Sbapt *:Interix*:*) 815247738Sbapt case ${UNAME_MACHINE} in 816247738Sbapt x86) 817247738Sbapt echo i586-pc-interix${UNAME_RELEASE} 818247738Sbapt exit ;; 819247738Sbapt authenticamd | genuineintel | EM64T) 820247738Sbapt echo x86_64-unknown-interix${UNAME_RELEASE} 821247738Sbapt exit ;; 822247738Sbapt IA64) 823247738Sbapt echo ia64-unknown-interix${UNAME_RELEASE} 824247738Sbapt exit ;; 825247738Sbapt esac ;; 826247738Sbapt [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 827247738Sbapt echo i${UNAME_MACHINE}-pc-mks 828247738Sbapt exit ;; 829247738Sbapt 8664:Windows_NT:*) 830247738Sbapt echo x86_64-pc-mks 831247738Sbapt exit ;; 832247738Sbapt i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 833247738Sbapt # How do we know it's Interix rather than the generic POSIX subsystem? 834247738Sbapt # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 835247738Sbapt # UNAME_MACHINE based on the output of uname instead of i386? 836247738Sbapt echo i586-pc-interix 837247738Sbapt exit ;; 838247738Sbapt i*:UWIN*:*) 839247738Sbapt echo ${UNAME_MACHINE}-pc-uwin 840247738Sbapt exit ;; 841247738Sbapt amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 842247738Sbapt echo x86_64-unknown-cygwin 843247738Sbapt exit ;; 844247738Sbapt p*:CYGWIN*:*) 845247738Sbapt echo powerpcle-unknown-cygwin 846247738Sbapt exit ;; 847247738Sbapt prep*:SunOS:5.*:*) 848247738Sbapt echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 849247738Sbapt exit ;; 850247738Sbapt *:GNU:*:*) 851247738Sbapt # the GNU system 852247738Sbapt echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 853247738Sbapt exit ;; 854247738Sbapt *:GNU/*:*:*) 855247738Sbapt # other systems with GNU libc and userland 856247738Sbapt echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 857247738Sbapt exit ;; 858247738Sbapt i*86:Minix:*:*) 859247738Sbapt echo ${UNAME_MACHINE}-pc-minix 860247738Sbapt exit ;; 861247738Sbapt alpha:Linux:*:*) 862247738Sbapt case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 863247738Sbapt EV5) UNAME_MACHINE=alphaev5 ;; 864247738Sbapt EV56) UNAME_MACHINE=alphaev56 ;; 865247738Sbapt PCA56) UNAME_MACHINE=alphapca56 ;; 866247738Sbapt PCA57) UNAME_MACHINE=alphapca56 ;; 867247738Sbapt EV6) UNAME_MACHINE=alphaev6 ;; 868247738Sbapt EV67) UNAME_MACHINE=alphaev67 ;; 869247738Sbapt EV68*) UNAME_MACHINE=alphaev68 ;; 870247738Sbapt esac 871247738Sbapt objdump --private-headers /bin/sh | grep -q ld.so.1 872247738Sbapt if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 873247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 874247738Sbapt exit ;; 875247738Sbapt arm*:Linux:*:*) 876247738Sbapt eval $set_cc_for_build 877247738Sbapt if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 878247738Sbapt | grep -q __ARM_EABI__ 879247738Sbapt then 880247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 881247738Sbapt else 882247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnueabi 883247738Sbapt fi 884247738Sbapt exit ;; 885247738Sbapt avr32*:Linux:*:*) 886247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 887247738Sbapt exit ;; 888247738Sbapt cris:Linux:*:*) 889247738Sbapt echo cris-axis-linux-gnu 890247738Sbapt exit ;; 891247738Sbapt crisv32:Linux:*:*) 892247738Sbapt echo crisv32-axis-linux-gnu 893247738Sbapt exit ;; 894247738Sbapt frv:Linux:*:*) 895247738Sbapt echo frv-unknown-linux-gnu 896247738Sbapt exit ;; 897247738Sbapt i*86:Linux:*:*) 898247738Sbapt LIBC=gnu 899247738Sbapt eval $set_cc_for_build 900247738Sbapt sed 's/^ //' << EOF >$dummy.c 901247738Sbapt #ifdef __dietlibc__ 902247738Sbapt LIBC=dietlibc 903247738Sbapt #endif 904247738SbaptEOF 905247738Sbapt eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 906247738Sbapt echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 907247738Sbapt exit ;; 908247738Sbapt ia64:Linux:*:*) 909247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 910247738Sbapt exit ;; 911247738Sbapt m32r*:Linux:*:*) 912247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 913247738Sbapt exit ;; 914247738Sbapt m68*:Linux:*:*) 915247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 916247738Sbapt exit ;; 917247738Sbapt mips:Linux:*:* | mips64:Linux:*:*) 918247738Sbapt eval $set_cc_for_build 919247738Sbapt sed 's/^ //' << EOF >$dummy.c 920247738Sbapt #undef CPU 921247738Sbapt #undef ${UNAME_MACHINE} 922247738Sbapt #undef ${UNAME_MACHINE}el 923247738Sbapt #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 924247738Sbapt CPU=${UNAME_MACHINE}el 925247738Sbapt #else 926247738Sbapt #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 927247738Sbapt CPU=${UNAME_MACHINE} 928247738Sbapt #else 929247738Sbapt CPU= 930247738Sbapt #endif 931247738Sbapt #endif 932247738SbaptEOF 933247738Sbapt eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 934247738Sbapt test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 935247738Sbapt ;; 936247738Sbapt or32:Linux:*:*) 937247738Sbapt echo or32-unknown-linux-gnu 938247738Sbapt exit ;; 939247738Sbapt padre:Linux:*:*) 940247738Sbapt echo sparc-unknown-linux-gnu 941247738Sbapt exit ;; 942247738Sbapt parisc64:Linux:*:* | hppa64:Linux:*:*) 943247738Sbapt echo hppa64-unknown-linux-gnu 944247738Sbapt exit ;; 945247738Sbapt parisc:Linux:*:* | hppa:Linux:*:*) 946247738Sbapt # Look for CPU level 947247738Sbapt case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 948247738Sbapt PA7*) echo hppa1.1-unknown-linux-gnu ;; 949247738Sbapt PA8*) echo hppa2.0-unknown-linux-gnu ;; 950247738Sbapt *) echo hppa-unknown-linux-gnu ;; 951247738Sbapt esac 952247738Sbapt exit ;; 953247738Sbapt ppc64:Linux:*:*) 954247738Sbapt echo powerpc64-unknown-linux-gnu 955247738Sbapt exit ;; 956247738Sbapt ppc:Linux:*:*) 957247738Sbapt echo powerpc-unknown-linux-gnu 958247738Sbapt exit ;; 959247738Sbapt s390:Linux:*:* | s390x:Linux:*:*) 960247738Sbapt echo ${UNAME_MACHINE}-ibm-linux 961247738Sbapt exit ;; 962247738Sbapt sh64*:Linux:*:*) 963247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 964247738Sbapt exit ;; 965247738Sbapt sh*:Linux:*:*) 966247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 967247738Sbapt exit ;; 968247738Sbapt sparc:Linux:*:* | sparc64:Linux:*:*) 969247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 970247738Sbapt exit ;; 971247738Sbapt vax:Linux:*:*) 972247738Sbapt echo ${UNAME_MACHINE}-dec-linux-gnu 973247738Sbapt exit ;; 974247738Sbapt x86_64:Linux:*:*) 975247738Sbapt echo x86_64-unknown-linux-gnu 976247738Sbapt exit ;; 977247738Sbapt xtensa*:Linux:*:*) 978247738Sbapt echo ${UNAME_MACHINE}-unknown-linux-gnu 979247738Sbapt exit ;; 980247738Sbapt i*86:DYNIX/ptx:4*:*) 981247738Sbapt # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 982247738Sbapt # earlier versions are messed up and put the nodename in both 983247738Sbapt # sysname and nodename. 984247738Sbapt echo i386-sequent-sysv4 985247738Sbapt exit ;; 986247738Sbapt i*86:UNIX_SV:4.2MP:2.*) 987247738Sbapt # Unixware is an offshoot of SVR4, but it has its own version 988247738Sbapt # number series starting with 2... 989247738Sbapt # I am not positive that other SVR4 systems won't match this, 990247738Sbapt # I just have to hope. -- rms. 991247738Sbapt # Use sysv4.2uw... so that sysv4* matches it. 992247738Sbapt echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 993247738Sbapt exit ;; 994247738Sbapt i*86:OS/2:*:*) 995247738Sbapt # If we were able to find `uname', then EMX Unix compatibility 996247738Sbapt # is probably installed. 997247738Sbapt echo ${UNAME_MACHINE}-pc-os2-emx 998247738Sbapt exit ;; 999247738Sbapt i*86:XTS-300:*:STOP) 1000247738Sbapt echo ${UNAME_MACHINE}-unknown-stop 1001247738Sbapt exit ;; 1002247738Sbapt i*86:atheos:*:*) 1003247738Sbapt echo ${UNAME_MACHINE}-unknown-atheos 1004247738Sbapt exit ;; 1005247738Sbapt i*86:syllable:*:*) 1006247738Sbapt echo ${UNAME_MACHINE}-pc-syllable 1007247738Sbapt exit ;; 1008247738Sbapt i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 1009247738Sbapt echo i386-unknown-lynxos${UNAME_RELEASE} 1010247738Sbapt exit ;; 1011247738Sbapt i*86:*DOS:*:*) 1012247738Sbapt echo ${UNAME_MACHINE}-pc-msdosdjgpp 1013247738Sbapt exit ;; 1014247738Sbapt i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 1015247738Sbapt UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 1016247738Sbapt if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 1017247738Sbapt echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 1018247738Sbapt else 1019247738Sbapt echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 1020247738Sbapt fi 1021247738Sbapt exit ;; 1022247738Sbapt i*86:*:5:[678]*) 1023247738Sbapt # UnixWare 7.x, OpenUNIX and OpenServer 6. 1024247738Sbapt case `/bin/uname -X | grep "^Machine"` in 1025247738Sbapt *486*) UNAME_MACHINE=i486 ;; 1026247738Sbapt *Pentium) UNAME_MACHINE=i586 ;; 1027247738Sbapt *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 1028247738Sbapt esac 1029247738Sbapt echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 1030247738Sbapt exit ;; 1031247738Sbapt i*86:*:3.2:*) 1032247738Sbapt if test -f /usr/options/cb.name; then 1033247738Sbapt UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 1034247738Sbapt echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 1035247738Sbapt elif /bin/uname -X 2>/dev/null >/dev/null ; then 1036247738Sbapt UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 1037247738Sbapt (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 1038247738Sbapt (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 1039247738Sbapt && UNAME_MACHINE=i586 1040247738Sbapt (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 1041247738Sbapt && UNAME_MACHINE=i686 1042247738Sbapt (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 1043247738Sbapt && UNAME_MACHINE=i686 1044247738Sbapt echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 1045247738Sbapt else 1046247738Sbapt echo ${UNAME_MACHINE}-pc-sysv32 1047247738Sbapt fi 1048247738Sbapt exit ;; 1049247738Sbapt pc:*:*:*) 1050247738Sbapt # Left here for compatibility: 1051247738Sbapt # uname -m prints for DJGPP always 'pc', but it prints nothing about 1052247738Sbapt # the processor, so we play safe by assuming i586. 1053247738Sbapt # Note: whatever this is, it MUST be the same as what config.sub 1054247738Sbapt # prints for the "djgpp" host, or else GDB configury will decide that 1055247738Sbapt # this is a cross-build. 1056247738Sbapt echo i586-pc-msdosdjgpp 1057247738Sbapt exit ;; 1058247738Sbapt Intel:Mach:3*:*) 1059247738Sbapt echo i386-pc-mach3 1060247738Sbapt exit ;; 1061247738Sbapt paragon:*:*:*) 1062247738Sbapt echo i860-intel-osf1 1063247738Sbapt exit ;; 1064247738Sbapt i860:*:4.*:*) # i860-SVR4 1065247738Sbapt if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 1066247738Sbapt echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 1067247738Sbapt else # Add other i860-SVR4 vendors below as they are discovered. 1068247738Sbapt echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 1069247738Sbapt fi 1070247738Sbapt exit ;; 1071247738Sbapt mini*:CTIX:SYS*5:*) 1072247738Sbapt # "miniframe" 1073247738Sbapt echo m68010-convergent-sysv 1074247738Sbapt exit ;; 1075247738Sbapt mc68k:UNIX:SYSTEM5:3.51m) 1076247738Sbapt echo m68k-convergent-sysv 1077247738Sbapt exit ;; 1078247738Sbapt M680?0:D-NIX:5.3:*) 1079247738Sbapt echo m68k-diab-dnix 1080247738Sbapt exit ;; 1081247738Sbapt M68*:*:R3V[5678]*:*) 1082247738Sbapt test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 1083247738Sbapt 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) 1084247738Sbapt OS_REL='' 1085247738Sbapt test -r /etc/.relid \ 1086247738Sbapt && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1087247738Sbapt /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1088247738Sbapt && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1089247738Sbapt /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1090247738Sbapt && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1091247738Sbapt 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 1092247738Sbapt /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1093247738Sbapt && { echo i486-ncr-sysv4; exit; } ;; 1094247738Sbapt NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1095247738Sbapt OS_REL='.3' 1096247738Sbapt test -r /etc/.relid \ 1097247738Sbapt && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1098247738Sbapt /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1099247738Sbapt && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1100247738Sbapt /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1101247738Sbapt && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1102247738Sbapt /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1103247738Sbapt && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 1104247738Sbapt m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 1105247738Sbapt echo m68k-unknown-lynxos${UNAME_RELEASE} 1106247738Sbapt exit ;; 1107247738Sbapt mc68030:UNIX_System_V:4.*:*) 1108247738Sbapt echo m68k-atari-sysv4 1109247738Sbapt exit ;; 1110247738Sbapt TSUNAMI:LynxOS:2.*:*) 1111247738Sbapt echo sparc-unknown-lynxos${UNAME_RELEASE} 1112247738Sbapt exit ;; 1113247738Sbapt rs6000:LynxOS:2.*:*) 1114247738Sbapt echo rs6000-unknown-lynxos${UNAME_RELEASE} 1115247738Sbapt exit ;; 1116247738Sbapt PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 1117247738Sbapt echo powerpc-unknown-lynxos${UNAME_RELEASE} 1118247738Sbapt exit ;; 1119247738Sbapt SM[BE]S:UNIX_SV:*:*) 1120247738Sbapt echo mips-dde-sysv${UNAME_RELEASE} 1121247738Sbapt exit ;; 1122247738Sbapt RM*:ReliantUNIX-*:*:*) 1123247738Sbapt echo mips-sni-sysv4 1124247738Sbapt exit ;; 1125247738Sbapt RM*:SINIX-*:*:*) 1126247738Sbapt echo mips-sni-sysv4 1127247738Sbapt exit ;; 1128247738Sbapt *:SINIX-*:*:*) 1129247738Sbapt if uname -p 2>/dev/null >/dev/null ; then 1130247738Sbapt UNAME_MACHINE=`(uname -p) 2>/dev/null` 1131247738Sbapt echo ${UNAME_MACHINE}-sni-sysv4 1132247738Sbapt else 1133247738Sbapt echo ns32k-sni-sysv 1134247738Sbapt fi 1135247738Sbapt exit ;; 1136247738Sbapt PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 1137247738Sbapt # says <Richard.M.Bartel@ccMail.Census.GOV> 1138247738Sbapt echo i586-unisys-sysv4 1139247738Sbapt exit ;; 1140247738Sbapt *:UNIX_System_V:4*:FTX*) 1141247738Sbapt # From Gerald Hewes <hewes@openmarket.com>. 1142247738Sbapt # How about differentiating between stratus architectures? -djm 1143247738Sbapt echo hppa1.1-stratus-sysv4 1144247738Sbapt exit ;; 1145247738Sbapt *:*:*:FTX*) 1146247738Sbapt # From seanf@swdc.stratus.com. 1147247738Sbapt echo i860-stratus-sysv4 1148247738Sbapt exit ;; 1149247738Sbapt i*86:VOS:*:*) 1150247738Sbapt # From Paul.Green@stratus.com. 1151247738Sbapt echo ${UNAME_MACHINE}-stratus-vos 1152247738Sbapt exit ;; 1153247738Sbapt *:VOS:*:*) 1154247738Sbapt # From Paul.Green@stratus.com. 1155247738Sbapt echo hppa1.1-stratus-vos 1156247738Sbapt exit ;; 1157247738Sbapt mc68*:A/UX:*:*) 1158247738Sbapt echo m68k-apple-aux${UNAME_RELEASE} 1159247738Sbapt exit ;; 1160247738Sbapt news*:NEWS-OS:6*:*) 1161247738Sbapt echo mips-sony-newsos6 1162247738Sbapt exit ;; 1163247738Sbapt R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 1164247738Sbapt if [ -d /usr/nec ]; then 1165247738Sbapt echo mips-nec-sysv${UNAME_RELEASE} 1166247738Sbapt else 1167247738Sbapt echo mips-unknown-sysv${UNAME_RELEASE} 1168247738Sbapt fi 1169247738Sbapt exit ;; 1170247738Sbapt BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1171247738Sbapt echo powerpc-be-beos 1172247738Sbapt exit ;; 1173247738Sbapt BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1174247738Sbapt echo powerpc-apple-beos 1175247738Sbapt exit ;; 1176247738Sbapt BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1177247738Sbapt echo i586-pc-beos 1178247738Sbapt exit ;; 1179247738Sbapt BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1180247738Sbapt echo i586-pc-haiku 1181247738Sbapt exit ;; 1182247738Sbapt SX-4:SUPER-UX:*:*) 1183247738Sbapt echo sx4-nec-superux${UNAME_RELEASE} 1184247738Sbapt exit ;; 1185247738Sbapt SX-5:SUPER-UX:*:*) 1186247738Sbapt echo sx5-nec-superux${UNAME_RELEASE} 1187247738Sbapt exit ;; 1188247738Sbapt SX-6:SUPER-UX:*:*) 1189247738Sbapt echo sx6-nec-superux${UNAME_RELEASE} 1190247738Sbapt exit ;; 1191247738Sbapt SX-7:SUPER-UX:*:*) 1192247738Sbapt echo sx7-nec-superux${UNAME_RELEASE} 1193247738Sbapt exit ;; 1194247738Sbapt SX-8:SUPER-UX:*:*) 1195247738Sbapt echo sx8-nec-superux${UNAME_RELEASE} 1196247738Sbapt exit ;; 1197247738Sbapt SX-8R:SUPER-UX:*:*) 1198247738Sbapt echo sx8r-nec-superux${UNAME_RELEASE} 1199247738Sbapt exit ;; 1200247738Sbapt Power*:Rhapsody:*:*) 1201247738Sbapt echo powerpc-apple-rhapsody${UNAME_RELEASE} 1202247738Sbapt exit ;; 1203247738Sbapt *:Rhapsody:*:*) 1204247738Sbapt echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1205247738Sbapt exit ;; 1206247738Sbapt *:Darwin:*:*) 1207247738Sbapt UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 1208247738Sbapt case $UNAME_PROCESSOR in 1209247738Sbapt i386) 1210247738Sbapt eval $set_cc_for_build 1211247738Sbapt if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1212247738Sbapt if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1213247738Sbapt (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1214247738Sbapt grep IS_64BIT_ARCH >/dev/null 1215247738Sbapt then 1216247738Sbapt UNAME_PROCESSOR="x86_64" 1217247738Sbapt fi 1218247738Sbapt fi ;; 1219247738Sbapt unknown) UNAME_PROCESSOR=powerpc ;; 1220247738Sbapt esac 1221247738Sbapt echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 1222247738Sbapt exit ;; 1223247738Sbapt *:procnto*:*:* | *:QNX:[0123456789]*:*) 1224247738Sbapt UNAME_PROCESSOR=`uname -p` 1225247738Sbapt if test "$UNAME_PROCESSOR" = "x86"; then 1226247738Sbapt UNAME_PROCESSOR=i386 1227247738Sbapt UNAME_MACHINE=pc 1228247738Sbapt fi 1229247738Sbapt echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 1230247738Sbapt exit ;; 1231247738Sbapt *:QNX:*:4*) 1232247738Sbapt echo i386-pc-qnx 1233247738Sbapt exit ;; 1234247738Sbapt NSE-?:NONSTOP_KERNEL:*:*) 1235247738Sbapt echo nse-tandem-nsk${UNAME_RELEASE} 1236247738Sbapt exit ;; 1237247738Sbapt NSR-?:NONSTOP_KERNEL:*:*) 1238247738Sbapt echo nsr-tandem-nsk${UNAME_RELEASE} 1239247738Sbapt exit ;; 1240247738Sbapt *:NonStop-UX:*:*) 1241247738Sbapt echo mips-compaq-nonstopux 1242247738Sbapt exit ;; 1243247738Sbapt BS2000:POSIX*:*:*) 1244247738Sbapt echo bs2000-siemens-sysv 1245247738Sbapt exit ;; 1246247738Sbapt DS/*:UNIX_System_V:*:*) 1247247738Sbapt echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1248247738Sbapt exit ;; 1249247738Sbapt *:Plan9:*:*) 1250247738Sbapt # "uname -m" is not consistent, so use $cputype instead. 386 1251247738Sbapt # is converted to i386 for consistency with other x86 1252247738Sbapt # operating systems. 1253247738Sbapt if test "$cputype" = "386"; then 1254247738Sbapt UNAME_MACHINE=i386 1255247738Sbapt else 1256247738Sbapt UNAME_MACHINE="$cputype" 1257247738Sbapt fi 1258247738Sbapt echo ${UNAME_MACHINE}-unknown-plan9 1259247738Sbapt exit ;; 1260247738Sbapt *:TOPS-10:*:*) 1261247738Sbapt echo pdp10-unknown-tops10 1262247738Sbapt exit ;; 1263247738Sbapt *:TENEX:*:*) 1264247738Sbapt echo pdp10-unknown-tenex 1265247738Sbapt exit ;; 1266247738Sbapt KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1267247738Sbapt echo pdp10-dec-tops20 1268247738Sbapt exit ;; 1269247738Sbapt XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1270247738Sbapt echo pdp10-xkl-tops20 1271247738Sbapt exit ;; 1272247738Sbapt *:TOPS-20:*:*) 1273247738Sbapt echo pdp10-unknown-tops20 1274247738Sbapt exit ;; 1275247738Sbapt *:ITS:*:*) 1276247738Sbapt echo pdp10-unknown-its 1277247738Sbapt exit ;; 1278247738Sbapt SEI:*:*:SEIUX) 1279247738Sbapt echo mips-sei-seiux${UNAME_RELEASE} 1280247738Sbapt exit ;; 1281247738Sbapt *:DragonFly:*:*) 1282247738Sbapt echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 1283247738Sbapt exit ;; 1284247738Sbapt *:*VMS:*:*) 1285247738Sbapt UNAME_MACHINE=`(uname -p) 2>/dev/null` 1286247738Sbapt case "${UNAME_MACHINE}" in 1287247738Sbapt A*) echo alpha-dec-vms ; exit ;; 1288247738Sbapt I*) echo ia64-dec-vms ; exit ;; 1289247738Sbapt V*) echo vax-dec-vms ; exit ;; 1290247738Sbapt esac ;; 1291247738Sbapt *:XENIX:*:SysV) 1292247738Sbapt echo i386-pc-xenix 1293247738Sbapt exit ;; 1294247738Sbapt i*86:skyos:*:*) 1295247738Sbapt echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 1296247738Sbapt exit ;; 1297247738Sbapt i*86:rdos:*:*) 1298247738Sbapt echo ${UNAME_MACHINE}-pc-rdos 1299247738Sbapt exit ;; 1300247738Sbapt i*86:AROS:*:*) 1301247738Sbapt echo ${UNAME_MACHINE}-pc-aros 1302247738Sbapt exit ;; 1303247738Sbaptesac 1304247738Sbapt 1305247738Sbapt#echo '(No uname command or uname output not recognized.)' 1>&2 1306247738Sbapt#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1307247738Sbapt 1308247738Sbapteval $set_cc_for_build 1309247738Sbaptcat >$dummy.c <<EOF 1310247738Sbapt#ifdef _SEQUENT_ 1311247738Sbapt# include <sys/types.h> 1312247738Sbapt# include <sys/utsname.h> 1313247738Sbapt#endif 1314247738Sbaptmain () 1315247738Sbapt{ 1316247738Sbapt#if defined (sony) 1317247738Sbapt#if defined (MIPSEB) 1318247738Sbapt /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1319247738Sbapt I don't know.... */ 1320247738Sbapt printf ("mips-sony-bsd\n"); exit (0); 1321247738Sbapt#else 1322247738Sbapt#include <sys/param.h> 1323247738Sbapt printf ("m68k-sony-newsos%s\n", 1324247738Sbapt#ifdef NEWSOS4 1325247738Sbapt "4" 1326247738Sbapt#else 1327247738Sbapt "" 1328247738Sbapt#endif 1329247738Sbapt ); exit (0); 1330247738Sbapt#endif 1331247738Sbapt#endif 1332247738Sbapt 1333247738Sbapt#if defined (__arm) && defined (__acorn) && defined (__unix) 1334247738Sbapt printf ("arm-acorn-riscix\n"); exit (0); 1335247738Sbapt#endif 1336247738Sbapt 1337247738Sbapt#if defined (hp300) && !defined (hpux) 1338247738Sbapt printf ("m68k-hp-bsd\n"); exit (0); 1339247738Sbapt#endif 1340247738Sbapt 1341247738Sbapt#if defined (NeXT) 1342247738Sbapt#if !defined (__ARCHITECTURE__) 1343247738Sbapt#define __ARCHITECTURE__ "m68k" 1344247738Sbapt#endif 1345247738Sbapt int version; 1346247738Sbapt version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1347247738Sbapt if (version < 4) 1348247738Sbapt printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1349247738Sbapt else 1350247738Sbapt printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1351247738Sbapt exit (0); 1352247738Sbapt#endif 1353247738Sbapt 1354247738Sbapt#if defined (MULTIMAX) || defined (n16) 1355247738Sbapt#if defined (UMAXV) 1356247738Sbapt printf ("ns32k-encore-sysv\n"); exit (0); 1357247738Sbapt#else 1358247738Sbapt#if defined (CMU) 1359247738Sbapt printf ("ns32k-encore-mach\n"); exit (0); 1360247738Sbapt#else 1361247738Sbapt printf ("ns32k-encore-bsd\n"); exit (0); 1362247738Sbapt#endif 1363247738Sbapt#endif 1364247738Sbapt#endif 1365247738Sbapt 1366247738Sbapt#if defined (__386BSD__) 1367247738Sbapt printf ("i386-pc-bsd\n"); exit (0); 1368247738Sbapt#endif 1369247738Sbapt 1370247738Sbapt#if defined (sequent) 1371247738Sbapt#if defined (i386) 1372247738Sbapt printf ("i386-sequent-dynix\n"); exit (0); 1373247738Sbapt#endif 1374247738Sbapt#if defined (ns32000) 1375247738Sbapt printf ("ns32k-sequent-dynix\n"); exit (0); 1376247738Sbapt#endif 1377247738Sbapt#endif 1378247738Sbapt 1379247738Sbapt#if defined (_SEQUENT_) 1380247738Sbapt struct utsname un; 1381247738Sbapt 1382247738Sbapt uname(&un); 1383247738Sbapt 1384247738Sbapt if (strncmp(un.version, "V2", 2) == 0) { 1385247738Sbapt printf ("i386-sequent-ptx2\n"); exit (0); 1386247738Sbapt } 1387247738Sbapt if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1388247738Sbapt printf ("i386-sequent-ptx1\n"); exit (0); 1389247738Sbapt } 1390247738Sbapt printf ("i386-sequent-ptx\n"); exit (0); 1391247738Sbapt 1392247738Sbapt#endif 1393247738Sbapt 1394247738Sbapt#if defined (vax) 1395247738Sbapt# if !defined (ultrix) 1396247738Sbapt# include <sys/param.h> 1397247738Sbapt# if defined (BSD) 1398247738Sbapt# if BSD == 43 1399247738Sbapt printf ("vax-dec-bsd4.3\n"); exit (0); 1400247738Sbapt# else 1401247738Sbapt# if BSD == 199006 1402247738Sbapt printf ("vax-dec-bsd4.3reno\n"); exit (0); 1403247738Sbapt# else 1404247738Sbapt printf ("vax-dec-bsd\n"); exit (0); 1405247738Sbapt# endif 1406247738Sbapt# endif 1407247738Sbapt# else 1408247738Sbapt printf ("vax-dec-bsd\n"); exit (0); 1409247738Sbapt# endif 1410247738Sbapt# else 1411247738Sbapt printf ("vax-dec-ultrix\n"); exit (0); 1412247738Sbapt# endif 1413247738Sbapt#endif 1414247738Sbapt 1415247738Sbapt#if defined (alliant) && defined (i860) 1416247738Sbapt printf ("i860-alliant-bsd\n"); exit (0); 1417247738Sbapt#endif 1418247738Sbapt 1419247738Sbapt exit (1); 1420247738Sbapt} 1421247738SbaptEOF 1422247738Sbapt 1423247738Sbapt$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 1424247738Sbapt { echo "$SYSTEM_NAME"; exit; } 1425247738Sbapt 1426247738Sbapt# Apollos put the system type in the environment. 1427247738Sbapt 1428247738Sbapttest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 1429247738Sbapt 1430247738Sbapt# Convex versions that predate uname can use getsysinfo(1) 1431247738Sbapt 1432247738Sbaptif [ -x /usr/convex/getsysinfo ] 1433247738Sbaptthen 1434247738Sbapt case `getsysinfo -f cpu_type` in 1435247738Sbapt c1*) 1436247738Sbapt echo c1-convex-bsd 1437247738Sbapt exit ;; 1438247738Sbapt c2*) 1439247738Sbapt if getsysinfo -f scalar_acc 1440247738Sbapt then echo c32-convex-bsd 1441247738Sbapt else echo c2-convex-bsd 1442247738Sbapt fi 1443247738Sbapt exit ;; 1444247738Sbapt c34*) 1445247738Sbapt echo c34-convex-bsd 1446247738Sbapt exit ;; 1447247738Sbapt c38*) 1448247738Sbapt echo c38-convex-bsd 1449247738Sbapt exit ;; 1450247738Sbapt c4*) 1451247738Sbapt echo c4-convex-bsd 1452247738Sbapt exit ;; 1453247738Sbapt esac 1454247738Sbaptfi 1455247738Sbapt 1456247738Sbaptcat >&2 <<EOF 1457247738Sbapt$0: unable to guess system type 1458247738Sbapt 1459247738SbaptThis script, last modified $timestamp, has failed to recognize 1460247738Sbaptthe operating system you are using. It is advised that you 1461247738Sbaptdownload the most up to date version of the config scripts from 1462247738Sbapt 1463247738Sbapt http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 1464247738Sbaptand 1465247738Sbapt http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 1466247738Sbapt 1467247738SbaptIf the version you run ($0) is already up to date, please 1468247738Sbaptsend the following data and any information you think might be 1469247738Sbaptpertinent to <config-patches@gnu.org> in order to provide the needed 1470247738Sbaptinformation to handle your system. 1471247738Sbapt 1472247738Sbaptconfig.guess timestamp = $timestamp 1473247738Sbapt 1474247738Sbaptuname -m = `(uname -m) 2>/dev/null || echo unknown` 1475247738Sbaptuname -r = `(uname -r) 2>/dev/null || echo unknown` 1476247738Sbaptuname -s = `(uname -s) 2>/dev/null || echo unknown` 1477247738Sbaptuname -v = `(uname -v) 2>/dev/null || echo unknown` 1478247738Sbapt 1479247738Sbapt/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1480247738Sbapt/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1481247738Sbapt 1482247738Sbapthostinfo = `(hostinfo) 2>/dev/null` 1483247738Sbapt/bin/universe = `(/bin/universe) 2>/dev/null` 1484247738Sbapt/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1485247738Sbapt/bin/arch = `(/bin/arch) 2>/dev/null` 1486247738Sbapt/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1487247738Sbapt/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1488247738Sbapt 1489247738SbaptUNAME_MACHINE = ${UNAME_MACHINE} 1490247738SbaptUNAME_RELEASE = ${UNAME_RELEASE} 1491247738SbaptUNAME_SYSTEM = ${UNAME_SYSTEM} 1492247738SbaptUNAME_VERSION = ${UNAME_VERSION} 1493247738SbaptEOF 1494247738Sbapt 1495247738Sbaptexit 1 1496247738Sbapt 1497247738Sbapt# Local variables: 1498247738Sbapt# eval: (add-hook 'write-file-hooks 'time-stamp) 1499247738Sbapt# time-stamp-start: "timestamp='" 1500247738Sbapt# time-stamp-format: "%:y-%02m-%02d" 1501247738Sbapt# time-stamp-end: "'" 1502247738Sbapt# End: 1503