annotate config.guess @ 1706:0152f65ced6a

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