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