annotate config.guess @ 9:f19beef42ceb

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