annotate config.guess @ 1670:6a1b54e84f82

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