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