annotate config.guess @ 1187:ad9829c3c12c

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