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