common/autoconf/build-aux/autoconf-config.guess

Mon, 14 Jan 2013 16:38:25 -0800

author
ohair
date
Mon, 14 Jan 2013 16:38:25 -0800
changeset 576
b66c81dfa291
parent 459
3156dff953b1
child 794
8dadd26c2a58
permissions
-rw-r--r--

8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
Reviewed-by: katleman

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

mercurial