annotate config.guess @ 883:b52d5de7783f

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