171d7fec4Smrg#! /bin/sh 271d7fec4Smrg# Attempt to guess a canonical system name. 371d7fec4Smrg# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 471d7fec4Smrg# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. 571d7fec4Smrg 671d7fec4Smrgtimestamp='2003-06-17' 771d7fec4Smrg 871d7fec4Smrg# This file is free software; you can redistribute it and/or modify it 971d7fec4Smrg# under the terms of the GNU General Public License as published by 1071d7fec4Smrg# the Free Software Foundation; either version 2 of the License, or 1171d7fec4Smrg# (at your option) any later version. 1271d7fec4Smrg# 1371d7fec4Smrg# This program is distributed in the hope that it will be useful, but 1471d7fec4Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1571d7fec4Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1671d7fec4Smrg# General Public License for more details. 1771d7fec4Smrg# 1871d7fec4Smrg# You should have received a copy of the GNU General Public License 1971d7fec4Smrg# along with this program; if not, write to the Free Software 2071d7fec4Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 2171d7fec4Smrg# 2271d7fec4Smrg# As a special exception to the GNU General Public License, if you 2371d7fec4Smrg# distribute this file as part of a program that contains a 2471d7fec4Smrg# configuration script generated by Autoconf, you may include it under 2571d7fec4Smrg# the same distribution terms that you use for the rest of that program. 2671d7fec4Smrg 2771d7fec4Smrg# Originally written by Per Bothner <per@bothner.com>. 2871d7fec4Smrg# Please send patches to <config-patches@gnu.org>. Submit a context 2971d7fec4Smrg# diff and a properly formatted ChangeLog entry. 3071d7fec4Smrg# 3171d7fec4Smrg# This script attempts to guess a canonical system name similar to 3271d7fec4Smrg# config.sub. If it succeeds, it prints the system name on stdout, and 3371d7fec4Smrg# exits with 0. Otherwise, it exits with 1. 3471d7fec4Smrg# 3571d7fec4Smrg# The plan is that this can be called by configure scripts if you 3671d7fec4Smrg# don't specify an explicit build system type. 3771d7fec4Smrg 3871d7fec4Smrgme=`echo "$0" | sed -e 's,.*/,,'` 3971d7fec4Smrg 4071d7fec4Smrgusage="\ 4171d7fec4SmrgUsage: $0 [OPTION] 4271d7fec4Smrg 4371d7fec4SmrgOutput the configuration name of the system \`$me' is run on. 4471d7fec4Smrg 4571d7fec4SmrgOperation modes: 4671d7fec4Smrg -h, --help print this help, then exit 4771d7fec4Smrg -t, --time-stamp print date of last modification, then exit 4871d7fec4Smrg -v, --version print version number, then exit 4971d7fec4Smrg 5071d7fec4SmrgReport bugs and patches to <config-patches@gnu.org>." 5171d7fec4Smrg 5271d7fec4Smrgversion="\ 5371d7fec4SmrgGNU config.guess ($timestamp) 5471d7fec4Smrg 5571d7fec4SmrgOriginally written by Per Bothner. 5671d7fec4SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 5771d7fec4SmrgFree Software Foundation, Inc. 5871d7fec4Smrg 5971d7fec4SmrgThis is free software; see the source for copying conditions. There is NO 6071d7fec4Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6171d7fec4Smrg 6271d7fec4Smrghelp=" 6371d7fec4SmrgTry \`$me --help' for more information." 6471d7fec4Smrg 6571d7fec4Smrg# Parse command line 6671d7fec4Smrgwhile test $# -gt 0 ; do 6771d7fec4Smrg case $1 in 6871d7fec4Smrg --time-stamp | --time* | -t ) 6971d7fec4Smrg echo "$timestamp" ; exit 0 ;; 7071d7fec4Smrg --version | -v ) 7171d7fec4Smrg echo "$version" ; exit 0 ;; 7271d7fec4Smrg --help | --h* | -h ) 7371d7fec4Smrg echo "$usage"; exit 0 ;; 7471d7fec4Smrg -- ) # Stop option processing 7571d7fec4Smrg shift; break ;; 7671d7fec4Smrg - ) # Use stdin as input. 7771d7fec4Smrg break ;; 7871d7fec4Smrg -* ) 7971d7fec4Smrg echo "$me: invalid option $1$help" >&2 8071d7fec4Smrg exit 1 ;; 8171d7fec4Smrg * ) 8271d7fec4Smrg break ;; 8371d7fec4Smrg esac 8471d7fec4Smrgdone 8571d7fec4Smrg 8671d7fec4Smrgif test $# != 0; then 8771d7fec4Smrg echo "$me: too many arguments$help" >&2 8871d7fec4Smrg exit 1 8971d7fec4Smrgfi 9071d7fec4Smrg 9171d7fec4Smrgtrap 'exit 1' 1 2 15 9271d7fec4Smrg 9371d7fec4Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 9471d7fec4Smrg# compiler to aid in system detection is discouraged as it requires 9571d7fec4Smrg# temporary files to be created and, as you can see below, it is a 9671d7fec4Smrg# headache to deal with in a portable fashion. 9771d7fec4Smrg 9871d7fec4Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 9971d7fec4Smrg# use `HOST_CC' if defined, but it is deprecated. 10071d7fec4Smrg 10171d7fec4Smrg# Portable tmp directory creation inspired by the Autoconf team. 10271d7fec4Smrg 10371d7fec4Smrgset_cc_for_build=' 10471d7fec4Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 10571d7fec4Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 10671d7fec4Smrg: ${TMPDIR=/tmp} ; 10771d7fec4Smrg { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 10871d7fec4Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 10971d7fec4Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 11071d7fec4Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 11171d7fec4Smrgdummy=$tmp/dummy ; 11271d7fec4Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 11371d7fec4Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in 11471d7fec4Smrg ,,) echo "int x;" > $dummy.c ; 11571d7fec4Smrg for c in cc gcc c89 c99 ; do 11671d7fec4Smrg if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 11771d7fec4Smrg CC_FOR_BUILD="$c"; break ; 11871d7fec4Smrg fi ; 11971d7fec4Smrg done ; 12071d7fec4Smrg if test x"$CC_FOR_BUILD" = x ; then 12171d7fec4Smrg CC_FOR_BUILD=no_compiler_found ; 12271d7fec4Smrg fi 12371d7fec4Smrg ;; 12471d7fec4Smrg ,,*) CC_FOR_BUILD=$CC ;; 12571d7fec4Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 12671d7fec4Smrgesac ;' 12771d7fec4Smrg 12871d7fec4Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 12971d7fec4Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 13071d7fec4Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 13171d7fec4Smrg PATH=$PATH:/.attbin ; export PATH 13271d7fec4Smrgfi 13371d7fec4Smrg 13471d7fec4SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 13571d7fec4SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 13671d7fec4SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 13771d7fec4SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 13871d7fec4Smrg 13971d7fec4Smrg## for Red Hat Linux 14071d7fec4Smrgif test -f /etc/redhat-release ; then 14171d7fec4Smrg VENDOR=redhat ; 14271d7fec4Smrgelse 14371d7fec4Smrg VENDOR= ; 14471d7fec4Smrgfi 14571d7fec4Smrg 14671d7fec4Smrg# Note: order is significant - the case branches are not exclusive. 14771d7fec4Smrg 14871d7fec4Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 14971d7fec4Smrg *:NetBSD:*:*) 15071d7fec4Smrg # NetBSD (nbsd) targets should (where applicable) match one or 15171d7fec4Smrg # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 15271d7fec4Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 15371d7fec4Smrg # switched to ELF, *-*-netbsd* would select the old 15471d7fec4Smrg # object file format. This provides both forward 15571d7fec4Smrg # compatibility and a consistent mechanism for selecting the 15671d7fec4Smrg # object file format. 15771d7fec4Smrg # 15871d7fec4Smrg # Note: NetBSD doesn't particularly care about the vendor 15971d7fec4Smrg # portion of the name. We always set it to "unknown". 16071d7fec4Smrg sysctl="sysctl -n hw.machine_arch" 16171d7fec4Smrg UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 16271d7fec4Smrg /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 16371d7fec4Smrg case "${UNAME_MACHINE_ARCH}" in 16471d7fec4Smrg armeb) machine=armeb-unknown ;; 16571d7fec4Smrg arm*) machine=arm-unknown ;; 16671d7fec4Smrg sh3el) machine=shl-unknown ;; 16771d7fec4Smrg sh3eb) machine=sh-unknown ;; 16871d7fec4Smrg *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 16971d7fec4Smrg esac 17071d7fec4Smrg # The Operating System including object format, if it has switched 17171d7fec4Smrg # to ELF recently, or will in the future. 17271d7fec4Smrg case "${UNAME_MACHINE_ARCH}" in 17371d7fec4Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 17471d7fec4Smrg eval $set_cc_for_build 17571d7fec4Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 17671d7fec4Smrg | grep __ELF__ >/dev/null 17771d7fec4Smrg then 17871d7fec4Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 17971d7fec4Smrg # Return netbsd for either. FIX? 18071d7fec4Smrg os=netbsd 18171d7fec4Smrg else 18271d7fec4Smrg os=netbsdelf 18371d7fec4Smrg fi 18471d7fec4Smrg ;; 18571d7fec4Smrg *) 18671d7fec4Smrg os=netbsd 18771d7fec4Smrg ;; 18871d7fec4Smrg esac 18971d7fec4Smrg # The OS release 19071d7fec4Smrg # Debian GNU/NetBSD machines have a different userland, and 19171d7fec4Smrg # thus, need a distinct triplet. However, they do not need 19271d7fec4Smrg # kernel version information, so it can be replaced with a 19371d7fec4Smrg # suitable tag, in the style of linux-gnu. 19471d7fec4Smrg case "${UNAME_VERSION}" in 19571d7fec4Smrg Debian*) 19671d7fec4Smrg release='-gnu' 19771d7fec4Smrg ;; 19871d7fec4Smrg *) 19971d7fec4Smrg release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 20071d7fec4Smrg ;; 20171d7fec4Smrg esac 20271d7fec4Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 20371d7fec4Smrg # contains redundant information, the shorter form: 20471d7fec4Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 20571d7fec4Smrg echo "${machine}-${os}${release}" 20671d7fec4Smrg exit 0 ;; 20771d7fec4Smrg amiga:OpenBSD:*:*) 20871d7fec4Smrg echo m68k-unknown-openbsd${UNAME_RELEASE} 20971d7fec4Smrg exit 0 ;; 21071d7fec4Smrg arc:OpenBSD:*:*) 21171d7fec4Smrg echo mipsel-unknown-openbsd${UNAME_RELEASE} 21271d7fec4Smrg exit 0 ;; 21371d7fec4Smrg hp300:OpenBSD:*:*) 21471d7fec4Smrg echo m68k-unknown-openbsd${UNAME_RELEASE} 21571d7fec4Smrg exit 0 ;; 21671d7fec4Smrg mac68k:OpenBSD:*:*) 21771d7fec4Smrg echo m68k-unknown-openbsd${UNAME_RELEASE} 21871d7fec4Smrg exit 0 ;; 21971d7fec4Smrg macppc:OpenBSD:*:*) 22071d7fec4Smrg echo powerpc-unknown-openbsd${UNAME_RELEASE} 22171d7fec4Smrg exit 0 ;; 22271d7fec4Smrg mvme68k:OpenBSD:*:*) 22371d7fec4Smrg echo m68k-unknown-openbsd${UNAME_RELEASE} 22471d7fec4Smrg exit 0 ;; 22571d7fec4Smrg mvme88k:OpenBSD:*:*) 22671d7fec4Smrg echo m88k-unknown-openbsd${UNAME_RELEASE} 22771d7fec4Smrg exit 0 ;; 22871d7fec4Smrg mvmeppc:OpenBSD:*:*) 22971d7fec4Smrg echo powerpc-unknown-openbsd${UNAME_RELEASE} 23071d7fec4Smrg exit 0 ;; 23171d7fec4Smrg pmax:OpenBSD:*:*) 23271d7fec4Smrg echo mipsel-unknown-openbsd${UNAME_RELEASE} 23371d7fec4Smrg exit 0 ;; 23471d7fec4Smrg sgi:OpenBSD:*:*) 23571d7fec4Smrg echo mipseb-unknown-openbsd${UNAME_RELEASE} 23671d7fec4Smrg exit 0 ;; 23771d7fec4Smrg sun3:OpenBSD:*:*) 23871d7fec4Smrg echo m68k-unknown-openbsd${UNAME_RELEASE} 23971d7fec4Smrg exit 0 ;; 24071d7fec4Smrg wgrisc:OpenBSD:*:*) 24171d7fec4Smrg echo mipsel-unknown-openbsd${UNAME_RELEASE} 24271d7fec4Smrg exit 0 ;; 24371d7fec4Smrg *:OpenBSD:*:*) 24471d7fec4Smrg echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} 24571d7fec4Smrg exit 0 ;; 24671d7fec4Smrg alpha:OSF1:*:*) 24771d7fec4Smrg if test $UNAME_RELEASE = "V4.0"; then 24871d7fec4Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 24971d7fec4Smrg fi 25071d7fec4Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 25171d7fec4Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 25271d7fec4Smrg # covers most systems running today. This code pipes the CPU 25371d7fec4Smrg # types through head -n 1, so we only detect the type of CPU 0. 25471d7fec4Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 25571d7fec4Smrg case "$ALPHA_CPU_TYPE" in 25671d7fec4Smrg "EV4 (21064)") 25771d7fec4Smrg UNAME_MACHINE="alpha" ;; 25871d7fec4Smrg "EV4.5 (21064)") 25971d7fec4Smrg UNAME_MACHINE="alpha" ;; 26071d7fec4Smrg "LCA4 (21066/21068)") 26171d7fec4Smrg UNAME_MACHINE="alpha" ;; 26271d7fec4Smrg "EV5 (21164)") 26371d7fec4Smrg UNAME_MACHINE="alphaev5" ;; 26471d7fec4Smrg "EV5.6 (21164A)") 26571d7fec4Smrg UNAME_MACHINE="alphaev56" ;; 26671d7fec4Smrg "EV5.6 (21164PC)") 26771d7fec4Smrg UNAME_MACHINE="alphapca56" ;; 26871d7fec4Smrg "EV5.7 (21164PC)") 26971d7fec4Smrg UNAME_MACHINE="alphapca57" ;; 27071d7fec4Smrg "EV6 (21264)") 27171d7fec4Smrg UNAME_MACHINE="alphaev6" ;; 27271d7fec4Smrg "EV6.7 (21264A)") 27371d7fec4Smrg UNAME_MACHINE="alphaev67" ;; 27471d7fec4Smrg "EV6.8CB (21264C)") 27571d7fec4Smrg UNAME_MACHINE="alphaev68" ;; 27671d7fec4Smrg "EV6.8AL (21264B)") 27771d7fec4Smrg UNAME_MACHINE="alphaev68" ;; 27871d7fec4Smrg "EV6.8CX (21264D)") 27971d7fec4Smrg UNAME_MACHINE="alphaev68" ;; 28071d7fec4Smrg "EV6.9A (21264/EV69A)") 28171d7fec4Smrg UNAME_MACHINE="alphaev69" ;; 28271d7fec4Smrg "EV7 (21364)") 28371d7fec4Smrg UNAME_MACHINE="alphaev7" ;; 28471d7fec4Smrg "EV7.9 (21364A)") 28571d7fec4Smrg UNAME_MACHINE="alphaev79" ;; 28671d7fec4Smrg esac 28771d7fec4Smrg # A Vn.n version is a released version. 28871d7fec4Smrg # A Tn.n version is a released field test version. 28971d7fec4Smrg # A Xn.n version is an unreleased experimental baselevel. 29071d7fec4Smrg # 1.2 uses "1.2" for uname -r. 29171d7fec4Smrg echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 29271d7fec4Smrg exit 0 ;; 29371d7fec4Smrg Alpha*:OpenVMS:*:*) 29471d7fec4Smrg echo alpha-hp-vms 29571d7fec4Smrg exit 0 ;; 29671d7fec4Smrg Alpha\ *:Windows_NT*:*) 29771d7fec4Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 29871d7fec4Smrg # Should we change UNAME_MACHINE based on the output of uname instead 29971d7fec4Smrg # of the specific Alpha model? 30071d7fec4Smrg echo alpha-pc-interix 30171d7fec4Smrg exit 0 ;; 30271d7fec4Smrg 21064:Windows_NT:50:3) 30371d7fec4Smrg echo alpha-dec-winnt3.5 30471d7fec4Smrg exit 0 ;; 30571d7fec4Smrg Amiga*:UNIX_System_V:4.0:*) 30671d7fec4Smrg echo m68k-unknown-sysv4 30771d7fec4Smrg exit 0;; 30871d7fec4Smrg *:[Aa]miga[Oo][Ss]:*:*) 30971d7fec4Smrg echo ${UNAME_MACHINE}-unknown-amigaos 31071d7fec4Smrg exit 0 ;; 31171d7fec4Smrg *:[Mm]orph[Oo][Ss]:*:*) 31271d7fec4Smrg echo ${UNAME_MACHINE}-unknown-morphos 31371d7fec4Smrg exit 0 ;; 31471d7fec4Smrg *:OS/390:*:*) 31571d7fec4Smrg echo i370-ibm-openedition 31671d7fec4Smrg exit 0 ;; 31771d7fec4Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 31871d7fec4Smrg echo arm-acorn-riscix${UNAME_RELEASE} 31971d7fec4Smrg exit 0;; 32071d7fec4Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 32171d7fec4Smrg echo hppa1.1-hitachi-hiuxmpp 32271d7fec4Smrg exit 0;; 32371d7fec4Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 32471d7fec4Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 32571d7fec4Smrg if test "`(/bin/universe) 2>/dev/null`" = att ; then 32671d7fec4Smrg echo pyramid-pyramid-sysv3 32771d7fec4Smrg else 32871d7fec4Smrg echo pyramid-pyramid-bsd 32971d7fec4Smrg fi 33071d7fec4Smrg exit 0 ;; 33171d7fec4Smrg NILE*:*:*:dcosx) 33271d7fec4Smrg echo pyramid-pyramid-svr4 33371d7fec4Smrg exit 0 ;; 33471d7fec4Smrg DRS?6000:unix:4.0:6*) 33571d7fec4Smrg echo sparc-icl-nx6 33671d7fec4Smrg exit 0 ;; 33771d7fec4Smrg DRS?6000:UNIX_SV:4.2*:7*) 33871d7fec4Smrg case `/usr/bin/uname -p` in 33971d7fec4Smrg sparc) echo sparc-icl-nx7 && exit 0 ;; 34071d7fec4Smrg esac ;; 34171d7fec4Smrg sun4H:SunOS:5.*:*) 34271d7fec4Smrg echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 34371d7fec4Smrg exit 0 ;; 34471d7fec4Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 34571d7fec4Smrg echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 34671d7fec4Smrg exit 0 ;; 34771d7fec4Smrg i86pc:SunOS:5.*:*) 34871d7fec4Smrg echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 34971d7fec4Smrg exit 0 ;; 35071d7fec4Smrg sun4*:SunOS:6*:*) 35171d7fec4Smrg # According to config.sub, this is the proper way to canonicalize 35271d7fec4Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 35371d7fec4Smrg # it's likely to be more like Solaris than SunOS4. 35471d7fec4Smrg echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 35571d7fec4Smrg exit 0 ;; 35671d7fec4Smrg sun4*:SunOS:*:*) 35771d7fec4Smrg case "`/usr/bin/arch -k`" in 35871d7fec4Smrg Series*|S4*) 35971d7fec4Smrg UNAME_RELEASE=`uname -v` 36071d7fec4Smrg ;; 36171d7fec4Smrg esac 36271d7fec4Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 36371d7fec4Smrg echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 36471d7fec4Smrg exit 0 ;; 36571d7fec4Smrg sun3*:SunOS:*:*) 36671d7fec4Smrg echo m68k-sun-sunos${UNAME_RELEASE} 36771d7fec4Smrg exit 0 ;; 36871d7fec4Smrg sun*:*:4.2BSD:*) 36971d7fec4Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 37071d7fec4Smrg test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 37171d7fec4Smrg case "`/bin/arch`" in 37271d7fec4Smrg sun3) 37371d7fec4Smrg echo m68k-sun-sunos${UNAME_RELEASE} 37471d7fec4Smrg ;; 37571d7fec4Smrg sun4) 37671d7fec4Smrg echo sparc-sun-sunos${UNAME_RELEASE} 37771d7fec4Smrg ;; 37871d7fec4Smrg esac 37971d7fec4Smrg exit 0 ;; 38071d7fec4Smrg aushp:SunOS:*:*) 38171d7fec4Smrg echo sparc-auspex-sunos${UNAME_RELEASE} 38271d7fec4Smrg exit 0 ;; 38371d7fec4Smrg # The situation for MiNT is a little confusing. The machine name 38471d7fec4Smrg # can be virtually everything (everything which is not 38571d7fec4Smrg # "atarist" or "atariste" at least should have a processor 38671d7fec4Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 38771d7fec4Smrg # to the lowercase version "mint" (or "freemint"). Finally 38871d7fec4Smrg # the system name "TOS" denotes a system which is actually not 38971d7fec4Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 39071d7fec4Smrg # be no problem. 39171d7fec4Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 39271d7fec4Smrg echo m68k-atari-mint${UNAME_RELEASE} 39371d7fec4Smrg exit 0 ;; 39471d7fec4Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 39571d7fec4Smrg echo m68k-atari-mint${UNAME_RELEASE} 39671d7fec4Smrg exit 0 ;; 39771d7fec4Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 39871d7fec4Smrg echo m68k-atari-mint${UNAME_RELEASE} 39971d7fec4Smrg exit 0 ;; 40071d7fec4Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 40171d7fec4Smrg echo m68k-milan-mint${UNAME_RELEASE} 40271d7fec4Smrg exit 0 ;; 40371d7fec4Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 40471d7fec4Smrg echo m68k-hades-mint${UNAME_RELEASE} 40571d7fec4Smrg exit 0 ;; 40671d7fec4Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 40771d7fec4Smrg echo m68k-unknown-mint${UNAME_RELEASE} 40871d7fec4Smrg exit 0 ;; 40971d7fec4Smrg powerpc:machten:*:*) 41071d7fec4Smrg echo powerpc-apple-machten${UNAME_RELEASE} 41171d7fec4Smrg exit 0 ;; 41271d7fec4Smrg RISC*:Mach:*:*) 41371d7fec4Smrg echo mips-dec-mach_bsd4.3 41471d7fec4Smrg exit 0 ;; 41571d7fec4Smrg RISC*:ULTRIX:*:*) 41671d7fec4Smrg echo mips-dec-ultrix${UNAME_RELEASE} 41771d7fec4Smrg exit 0 ;; 41871d7fec4Smrg VAX*:ULTRIX*:*:*) 41971d7fec4Smrg echo vax-dec-ultrix${UNAME_RELEASE} 42071d7fec4Smrg exit 0 ;; 42171d7fec4Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 42271d7fec4Smrg echo clipper-intergraph-clix${UNAME_RELEASE} 42371d7fec4Smrg exit 0 ;; 42471d7fec4Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 42571d7fec4Smrg eval $set_cc_for_build 42671d7fec4Smrg sed 's/^ //' << EOF >$dummy.c 42771d7fec4Smrg#ifdef __cplusplus 42871d7fec4Smrg#include <stdio.h> /* for printf() prototype */ 42971d7fec4Smrg int main (int argc, char *argv[]) { 43071d7fec4Smrg#else 43171d7fec4Smrg int main (argc, argv) int argc; char *argv[]; { 43271d7fec4Smrg#endif 43371d7fec4Smrg #if defined (host_mips) && defined (MIPSEB) 43471d7fec4Smrg #if defined (SYSTYPE_SYSV) 43571d7fec4Smrg printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 43671d7fec4Smrg #endif 43771d7fec4Smrg #if defined (SYSTYPE_SVR4) 43871d7fec4Smrg printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 43971d7fec4Smrg #endif 44071d7fec4Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 44171d7fec4Smrg printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 44271d7fec4Smrg #endif 44371d7fec4Smrg #endif 44471d7fec4Smrg exit (-1); 44571d7fec4Smrg } 44671d7fec4SmrgEOF 44771d7fec4Smrg $CC_FOR_BUILD -o $dummy $dummy.c \ 44871d7fec4Smrg && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ 44971d7fec4Smrg && exit 0 45071d7fec4Smrg echo mips-mips-riscos${UNAME_RELEASE} 45171d7fec4Smrg exit 0 ;; 45271d7fec4Smrg Motorola:PowerMAX_OS:*:*) 45371d7fec4Smrg echo powerpc-motorola-powermax 45471d7fec4Smrg exit 0 ;; 45571d7fec4Smrg Motorola:*:4.3:PL8-*) 45671d7fec4Smrg echo powerpc-harris-powermax 45771d7fec4Smrg exit 0 ;; 45871d7fec4Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 45971d7fec4Smrg echo powerpc-harris-powermax 46071d7fec4Smrg exit 0 ;; 46171d7fec4Smrg Night_Hawk:Power_UNIX:*:*) 46271d7fec4Smrg echo powerpc-harris-powerunix 46371d7fec4Smrg exit 0 ;; 46471d7fec4Smrg m88k:CX/UX:7*:*) 46571d7fec4Smrg echo m88k-harris-cxux7 46671d7fec4Smrg exit 0 ;; 46771d7fec4Smrg m88k:*:4*:R4*) 46871d7fec4Smrg echo m88k-motorola-sysv4 46971d7fec4Smrg exit 0 ;; 47071d7fec4Smrg m88k:*:3*:R3*) 47171d7fec4Smrg echo m88k-motorola-sysv3 47271d7fec4Smrg exit 0 ;; 47371d7fec4Smrg AViiON:dgux:*:*) 47471d7fec4Smrg # DG/UX returns AViiON for all architectures 47571d7fec4Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 47671d7fec4Smrg if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 47771d7fec4Smrg then 47871d7fec4Smrg if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 47971d7fec4Smrg [ ${TARGET_BINARY_INTERFACE}x = x ] 48071d7fec4Smrg then 48171d7fec4Smrg echo m88k-dg-dgux${UNAME_RELEASE} 48271d7fec4Smrg else 48371d7fec4Smrg echo m88k-dg-dguxbcs${UNAME_RELEASE} 48471d7fec4Smrg fi 48571d7fec4Smrg else 48671d7fec4Smrg echo i586-dg-dgux${UNAME_RELEASE} 48771d7fec4Smrg fi 48871d7fec4Smrg exit 0 ;; 48971d7fec4Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 49071d7fec4Smrg echo m88k-dolphin-sysv3 49171d7fec4Smrg exit 0 ;; 49271d7fec4Smrg M88*:*:R3*:*) 49371d7fec4Smrg # Delta 88k system running SVR3 49471d7fec4Smrg echo m88k-motorola-sysv3 49571d7fec4Smrg exit 0 ;; 49671d7fec4Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 49771d7fec4Smrg echo m88k-tektronix-sysv3 49871d7fec4Smrg exit 0 ;; 49971d7fec4Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 50071d7fec4Smrg echo m68k-tektronix-bsd 50171d7fec4Smrg exit 0 ;; 50271d7fec4Smrg *:IRIX*:*:*) 50371d7fec4Smrg echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 50471d7fec4Smrg exit 0 ;; 50571d7fec4Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 50671d7fec4Smrg echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 50771d7fec4Smrg exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 50871d7fec4Smrg i*86:AIX:*:*) 50971d7fec4Smrg echo i386-ibm-aix 51071d7fec4Smrg exit 0 ;; 51171d7fec4Smrg ia64:AIX:*:*) 51271d7fec4Smrg if [ -x /usr/bin/oslevel ] ; then 51371d7fec4Smrg IBM_REV=`/usr/bin/oslevel` 51471d7fec4Smrg else 51571d7fec4Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 51671d7fec4Smrg fi 51771d7fec4Smrg echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 51871d7fec4Smrg exit 0 ;; 51971d7fec4Smrg *:AIX:2:3) 52071d7fec4Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 52171d7fec4Smrg eval $set_cc_for_build 52271d7fec4Smrg sed 's/^ //' << EOF >$dummy.c 52371d7fec4Smrg #include <sys/systemcfg.h> 52471d7fec4Smrg 52571d7fec4Smrg main() 52671d7fec4Smrg { 52771d7fec4Smrg if (!__power_pc()) 52871d7fec4Smrg exit(1); 52971d7fec4Smrg puts("powerpc-ibm-aix3.2.5"); 53071d7fec4Smrg exit(0); 53171d7fec4Smrg } 53271d7fec4SmrgEOF 53371d7fec4Smrg $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 53471d7fec4Smrg echo rs6000-ibm-aix3.2.5 53571d7fec4Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 53671d7fec4Smrg echo rs6000-ibm-aix3.2.4 53771d7fec4Smrg else 53871d7fec4Smrg echo rs6000-ibm-aix3.2 53971d7fec4Smrg fi 54071d7fec4Smrg exit 0 ;; 54171d7fec4Smrg *:AIX:*:[45]) 54271d7fec4Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 54371d7fec4Smrg if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 54471d7fec4Smrg IBM_ARCH=rs6000 54571d7fec4Smrg else 54671d7fec4Smrg IBM_ARCH=powerpc 54771d7fec4Smrg fi 54871d7fec4Smrg if [ -x /usr/bin/oslevel ] ; then 54971d7fec4Smrg IBM_REV=`/usr/bin/oslevel` 55071d7fec4Smrg else 55171d7fec4Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 55271d7fec4Smrg fi 55371d7fec4Smrg echo ${IBM_ARCH}-ibm-aix${IBM_REV} 55471d7fec4Smrg exit 0 ;; 55571d7fec4Smrg *:AIX:*:*) 55671d7fec4Smrg echo rs6000-ibm-aix 55771d7fec4Smrg exit 0 ;; 55871d7fec4Smrg ibmrt:4.4BSD:*|romp-ibm:BSD:*) 55971d7fec4Smrg echo romp-ibm-bsd4.4 56071d7fec4Smrg exit 0 ;; 56171d7fec4Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 56271d7fec4Smrg echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 56371d7fec4Smrg exit 0 ;; # report: romp-ibm BSD 4.3 56471d7fec4Smrg *:BOSX:*:*) 56571d7fec4Smrg echo rs6000-bull-bosx 56671d7fec4Smrg exit 0 ;; 56771d7fec4Smrg DPX/2?00:B.O.S.:*:*) 56871d7fec4Smrg echo m68k-bull-sysv3 56971d7fec4Smrg exit 0 ;; 57071d7fec4Smrg 9000/[34]??:4.3bsd:1.*:*) 57171d7fec4Smrg echo m68k-hp-bsd 57271d7fec4Smrg exit 0 ;; 57371d7fec4Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 57471d7fec4Smrg echo m68k-hp-bsd4.4 57571d7fec4Smrg exit 0 ;; 57671d7fec4Smrg 9000/[34678]??:HP-UX:*:*) 57771d7fec4Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 57871d7fec4Smrg case "${UNAME_MACHINE}" in 57971d7fec4Smrg 9000/31? ) HP_ARCH=m68000 ;; 58071d7fec4Smrg 9000/[34]?? ) HP_ARCH=m68k ;; 58171d7fec4Smrg 9000/[678][0-9][0-9]) 58271d7fec4Smrg if [ -x /usr/bin/getconf ]; then 58371d7fec4Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 58471d7fec4Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 58571d7fec4Smrg case "${sc_cpu_version}" in 58671d7fec4Smrg 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 58771d7fec4Smrg 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 58871d7fec4Smrg 532) # CPU_PA_RISC2_0 58971d7fec4Smrg case "${sc_kernel_bits}" in 59071d7fec4Smrg 32) HP_ARCH="hppa2.0n" ;; 59171d7fec4Smrg 64) HP_ARCH="hppa2.0w" ;; 59271d7fec4Smrg '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 59371d7fec4Smrg esac ;; 59471d7fec4Smrg esac 59571d7fec4Smrg fi 59671d7fec4Smrg if [ "${HP_ARCH}" = "" ]; then 59771d7fec4Smrg eval $set_cc_for_build 59871d7fec4Smrg sed 's/^ //' << EOF >$dummy.c 59971d7fec4Smrg 60071d7fec4Smrg #define _HPUX_SOURCE 60171d7fec4Smrg #include <stdlib.h> 60271d7fec4Smrg #include <unistd.h> 60371d7fec4Smrg 60471d7fec4Smrg int main () 60571d7fec4Smrg { 60671d7fec4Smrg #if defined(_SC_KERNEL_BITS) 60771d7fec4Smrg long bits = sysconf(_SC_KERNEL_BITS); 60871d7fec4Smrg #endif 60971d7fec4Smrg long cpu = sysconf (_SC_CPU_VERSION); 61071d7fec4Smrg 61171d7fec4Smrg switch (cpu) 61271d7fec4Smrg { 61371d7fec4Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 61471d7fec4Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 61571d7fec4Smrg case CPU_PA_RISC2_0: 61671d7fec4Smrg #if defined(_SC_KERNEL_BITS) 61771d7fec4Smrg switch (bits) 61871d7fec4Smrg { 61971d7fec4Smrg case 64: puts ("hppa2.0w"); break; 62071d7fec4Smrg case 32: puts ("hppa2.0n"); break; 62171d7fec4Smrg default: puts ("hppa2.0"); break; 62271d7fec4Smrg } break; 62371d7fec4Smrg #else /* !defined(_SC_KERNEL_BITS) */ 62471d7fec4Smrg puts ("hppa2.0"); break; 62571d7fec4Smrg #endif 62671d7fec4Smrg default: puts ("hppa1.0"); break; 62771d7fec4Smrg } 62871d7fec4Smrg exit (0); 62971d7fec4Smrg } 63071d7fec4SmrgEOF 63171d7fec4Smrg (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 63271d7fec4Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 63371d7fec4Smrg fi ;; 63471d7fec4Smrg esac 63571d7fec4Smrg if [ ${HP_ARCH} = "hppa2.0w" ] 63671d7fec4Smrg then 63771d7fec4Smrg # avoid double evaluation of $set_cc_for_build 63871d7fec4Smrg test -n "$CC_FOR_BUILD" || eval $set_cc_for_build 63971d7fec4Smrg if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null 64071d7fec4Smrg then 64171d7fec4Smrg HP_ARCH="hppa2.0w" 64271d7fec4Smrg else 64371d7fec4Smrg HP_ARCH="hppa64" 64471d7fec4Smrg fi 64571d7fec4Smrg fi 64671d7fec4Smrg echo ${HP_ARCH}-hp-hpux${HPUX_REV} 64771d7fec4Smrg exit 0 ;; 64871d7fec4Smrg ia64:HP-UX:*:*) 64971d7fec4Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 65071d7fec4Smrg echo ia64-hp-hpux${HPUX_REV} 65171d7fec4Smrg exit 0 ;; 65271d7fec4Smrg 3050*:HI-UX:*:*) 65371d7fec4Smrg eval $set_cc_for_build 65471d7fec4Smrg sed 's/^ //' << EOF >$dummy.c 65571d7fec4Smrg #include <unistd.h> 65671d7fec4Smrg int 65771d7fec4Smrg main () 65871d7fec4Smrg { 65971d7fec4Smrg long cpu = sysconf (_SC_CPU_VERSION); 66071d7fec4Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 66171d7fec4Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 66271d7fec4Smrg results, however. */ 66371d7fec4Smrg if (CPU_IS_PA_RISC (cpu)) 66471d7fec4Smrg { 66571d7fec4Smrg switch (cpu) 66671d7fec4Smrg { 66771d7fec4Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 66871d7fec4Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 66971d7fec4Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 67071d7fec4Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 67171d7fec4Smrg } 67271d7fec4Smrg } 67371d7fec4Smrg else if (CPU_IS_HP_MC68K (cpu)) 67471d7fec4Smrg puts ("m68k-hitachi-hiuxwe2"); 67571d7fec4Smrg else puts ("unknown-hitachi-hiuxwe2"); 67671d7fec4Smrg exit (0); 67771d7fec4Smrg } 67871d7fec4SmrgEOF 67971d7fec4Smrg $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 68071d7fec4Smrg echo unknown-hitachi-hiuxwe2 68171d7fec4Smrg exit 0 ;; 68271d7fec4Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 68371d7fec4Smrg echo hppa1.1-hp-bsd 68471d7fec4Smrg exit 0 ;; 68571d7fec4Smrg 9000/8??:4.3bsd:*:*) 68671d7fec4Smrg echo hppa1.0-hp-bsd 68771d7fec4Smrg exit 0 ;; 68871d7fec4Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 68971d7fec4Smrg echo hppa1.0-hp-mpeix 69071d7fec4Smrg exit 0 ;; 69171d7fec4Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 69271d7fec4Smrg echo hppa1.1-hp-osf 69371d7fec4Smrg exit 0 ;; 69471d7fec4Smrg hp8??:OSF1:*:*) 69571d7fec4Smrg echo hppa1.0-hp-osf 69671d7fec4Smrg exit 0 ;; 69771d7fec4Smrg i*86:OSF1:*:*) 69871d7fec4Smrg if [ -x /usr/sbin/sysversion ] ; then 69971d7fec4Smrg echo ${UNAME_MACHINE}-unknown-osf1mk 70071d7fec4Smrg else 70171d7fec4Smrg echo ${UNAME_MACHINE}-unknown-osf1 70271d7fec4Smrg fi 70371d7fec4Smrg exit 0 ;; 70471d7fec4Smrg parisc*:Lites*:*:*) 70571d7fec4Smrg echo hppa1.1-hp-lites 70671d7fec4Smrg exit 0 ;; 70771d7fec4Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 70871d7fec4Smrg echo c1-convex-bsd 70971d7fec4Smrg exit 0 ;; 71071d7fec4Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 71171d7fec4Smrg if getsysinfo -f scalar_acc 71271d7fec4Smrg then echo c32-convex-bsd 71371d7fec4Smrg else echo c2-convex-bsd 71471d7fec4Smrg fi 71571d7fec4Smrg exit 0 ;; 71671d7fec4Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 71771d7fec4Smrg echo c34-convex-bsd 71871d7fec4Smrg exit 0 ;; 71971d7fec4Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 72071d7fec4Smrg echo c38-convex-bsd 72171d7fec4Smrg exit 0 ;; 72271d7fec4Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 72371d7fec4Smrg echo c4-convex-bsd 72471d7fec4Smrg exit 0 ;; 72571d7fec4Smrg CRAY*Y-MP:*:*:*) 72671d7fec4Smrg echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 72771d7fec4Smrg exit 0 ;; 72871d7fec4Smrg CRAY*[A-Z]90:*:*:*) 72971d7fec4Smrg echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 73071d7fec4Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 73171d7fec4Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 73271d7fec4Smrg -e 's/\.[^.]*$/.X/' 73371d7fec4Smrg exit 0 ;; 73471d7fec4Smrg CRAY*TS:*:*:*) 73571d7fec4Smrg echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 73671d7fec4Smrg exit 0 ;; 73771d7fec4Smrg CRAY*T3E:*:*:*) 73871d7fec4Smrg echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 73971d7fec4Smrg exit 0 ;; 74071d7fec4Smrg CRAY*SV1:*:*:*) 74171d7fec4Smrg echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74271d7fec4Smrg exit 0 ;; 74371d7fec4Smrg *:UNICOS/mp:*:*) 74471d7fec4Smrg echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74571d7fec4Smrg exit 0 ;; 74671d7fec4Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 74771d7fec4Smrg FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 74871d7fec4Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 74971d7fec4Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 75071d7fec4Smrg echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 75171d7fec4Smrg exit 0 ;; 75271d7fec4Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 75371d7fec4Smrg echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 75471d7fec4Smrg exit 0 ;; 75571d7fec4Smrg sparc*:BSD/OS:*:*) 75671d7fec4Smrg echo sparc-unknown-bsdi${UNAME_RELEASE} 75771d7fec4Smrg exit 0 ;; 75871d7fec4Smrg *:BSD/OS:*:*) 75971d7fec4Smrg echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 76071d7fec4Smrg exit 0 ;; 76171d7fec4Smrg *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) 76271d7fec4Smrg # Determine whether the default compiler uses glibc. 76371d7fec4Smrg eval $set_cc_for_build 76471d7fec4Smrg sed 's/^ //' << EOF >$dummy.c 76571d7fec4Smrg #include <features.h> 76671d7fec4Smrg #if __GLIBC__ >= 2 76771d7fec4Smrg LIBC=gnu 76871d7fec4Smrg #else 76971d7fec4Smrg LIBC= 77071d7fec4Smrg #endif 77171d7fec4SmrgEOF 77271d7fec4Smrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` 77371d7fec4Smrg echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} 77471d7fec4Smrg exit 0 ;; 77571d7fec4Smrg i*:CYGWIN*:*) 77671d7fec4Smrg echo ${UNAME_MACHINE}-pc-cygwin 77771d7fec4Smrg exit 0 ;; 77871d7fec4Smrg i*:MINGW*:*) 77971d7fec4Smrg echo ${UNAME_MACHINE}-pc-mingw32 78071d7fec4Smrg exit 0 ;; 78171d7fec4Smrg i*:PW*:*) 78271d7fec4Smrg echo ${UNAME_MACHINE}-pc-pw32 78371d7fec4Smrg exit 0 ;; 78471d7fec4Smrg x86:Interix*:[34]*) 78571d7fec4Smrg echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' 78671d7fec4Smrg exit 0 ;; 78771d7fec4Smrg [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 78871d7fec4Smrg echo i${UNAME_MACHINE}-pc-mks 78971d7fec4Smrg exit 0 ;; 79071d7fec4Smrg i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 79171d7fec4Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 79271d7fec4Smrg # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 79371d7fec4Smrg # UNAME_MACHINE based on the output of uname instead of i386? 79471d7fec4Smrg echo i586-pc-interix 79571d7fec4Smrg exit 0 ;; 79671d7fec4Smrg i*:UWIN*:*) 79771d7fec4Smrg echo ${UNAME_MACHINE}-pc-uwin 79871d7fec4Smrg exit 0 ;; 79971d7fec4Smrg p*:CYGWIN*:*) 80071d7fec4Smrg echo powerpcle-unknown-cygwin 80171d7fec4Smrg exit 0 ;; 80271d7fec4Smrg prep*:SunOS:5.*:*) 80371d7fec4Smrg echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 80471d7fec4Smrg exit 0 ;; 80571d7fec4Smrg *:GNU:*:*) 80671d7fec4Smrg echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 80771d7fec4Smrg exit 0 ;; 80871d7fec4Smrg i*86:Minix:*:*) 80971d7fec4Smrg echo ${UNAME_MACHINE}-pc-minix 81071d7fec4Smrg exit 0 ;; 81171d7fec4Smrg arm*:Linux:*:*) 81271d7fec4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 81371d7fec4Smrg exit 0 ;; 81471d7fec4Smrg cris:Linux:*:*) 81571d7fec4Smrg echo cris-axis-linux-gnu 81671d7fec4Smrg exit 0 ;; 81771d7fec4Smrg ia64:Linux:*:*) 81871d7fec4Smrg echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu 81971d7fec4Smrg exit 0 ;; 82071d7fec4Smrg m68*:Linux:*:*) 82171d7fec4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 82271d7fec4Smrg exit 0 ;; 82371d7fec4Smrg mips:Linux:*:*) 82471d7fec4Smrg eval $set_cc_for_build 82571d7fec4Smrg sed 's/^ //' << EOF >$dummy.c 82671d7fec4Smrg #undef CPU 82771d7fec4Smrg #undef mips 82871d7fec4Smrg #undef mipsel 82971d7fec4Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 83071d7fec4Smrg CPU=mipsel 83171d7fec4Smrg #else 83271d7fec4Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 83371d7fec4Smrg CPU=mips 83471d7fec4Smrg #else 83571d7fec4Smrg CPU= 83671d7fec4Smrg #endif 83771d7fec4Smrg #endif 83871d7fec4SmrgEOF 83971d7fec4Smrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` 84071d7fec4Smrg test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 84171d7fec4Smrg ;; 84271d7fec4Smrg mips64:Linux:*:*) 84371d7fec4Smrg eval $set_cc_for_build 84471d7fec4Smrg sed 's/^ //' << EOF >$dummy.c 84571d7fec4Smrg #undef CPU 84671d7fec4Smrg #undef mips64 84771d7fec4Smrg #undef mips64el 84871d7fec4Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 84971d7fec4Smrg CPU=mips64el 85071d7fec4Smrg #else 85171d7fec4Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 85271d7fec4Smrg CPU=mips64 85371d7fec4Smrg #else 85471d7fec4Smrg CPU= 85571d7fec4Smrg #endif 85671d7fec4Smrg #endif 85771d7fec4SmrgEOF 85871d7fec4Smrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` 85971d7fec4Smrg test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 86071d7fec4Smrg ;; 86171d7fec4Smrg ppc:Linux:*:*) 86271d7fec4Smrg echo powerpc-${VENDOR:-unknown}-linux-gnu 86371d7fec4Smrg exit 0 ;; 86471d7fec4Smrg ppc64:Linux:*:*) 86571d7fec4Smrg echo powerpc64-${VENDOR:-unknown}-linux-gnu 86671d7fec4Smrg exit 0 ;; 86771d7fec4Smrg alpha:Linux:*:*) 86871d7fec4Smrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 86971d7fec4Smrg EV5) UNAME_MACHINE=alphaev5 ;; 87071d7fec4Smrg EV56) UNAME_MACHINE=alphaev56 ;; 87171d7fec4Smrg PCA56) UNAME_MACHINE=alphapca56 ;; 87271d7fec4Smrg PCA57) UNAME_MACHINE=alphapca56 ;; 87371d7fec4Smrg EV6) UNAME_MACHINE=alphaev6 ;; 87471d7fec4Smrg EV67) UNAME_MACHINE=alphaev67 ;; 87571d7fec4Smrg EV68*) UNAME_MACHINE=alphaev68 ;; 87671d7fec4Smrg esac 87771d7fec4Smrg objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 87871d7fec4Smrg if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 87971d7fec4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 88071d7fec4Smrg exit 0 ;; 88171d7fec4Smrg parisc:Linux:*:* | hppa:Linux:*:*) 88271d7fec4Smrg # Look for CPU level 88371d7fec4Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 88471d7fec4Smrg PA7*) echo hppa1.1-unknown-linux-gnu ;; 88571d7fec4Smrg PA8*) echo hppa2.0-unknown-linux-gnu ;; 88671d7fec4Smrg *) echo hppa-unknown-linux-gnu ;; 88771d7fec4Smrg esac 88871d7fec4Smrg exit 0 ;; 88971d7fec4Smrg parisc64:Linux:*:* | hppa64:Linux:*:*) 89071d7fec4Smrg echo hppa64-unknown-linux-gnu 89171d7fec4Smrg exit 0 ;; 89271d7fec4Smrg s390:Linux:*:* | s390x:Linux:*:*) 89371d7fec4Smrg echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu 89471d7fec4Smrg exit 0 ;; 89571d7fec4Smrg sh64*:Linux:*:*) 89671d7fec4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 89771d7fec4Smrg exit 0 ;; 89871d7fec4Smrg sh*:Linux:*:*) 89971d7fec4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 90071d7fec4Smrg exit 0 ;; 90171d7fec4Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 90271d7fec4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 90371d7fec4Smrg exit 0 ;; 90471d7fec4Smrg x86_64:Linux:*:*) 90571d7fec4Smrg echo x86_64-${VENDOR:-unknown}-linux-gnu 90671d7fec4Smrg exit 0 ;; 90771d7fec4Smrg i*86:Linux:*:*) 90871d7fec4Smrg # The BFD linker knows what the default object file format is, so 90971d7fec4Smrg # first see if it will tell us. cd to the root directory to prevent 91071d7fec4Smrg # problems with other programs or directories called `ld' in the path. 91171d7fec4Smrg # Set LC_ALL=C to ensure ld outputs messages in English. 91271d7fec4Smrg ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ 91371d7fec4Smrg | sed -ne '/supported targets:/!d 91471d7fec4Smrg s/[ ][ ]*/ /g 91571d7fec4Smrg s/.*supported targets: *// 91671d7fec4Smrg s/ .*// 91771d7fec4Smrg p'` 91871d7fec4Smrg case "$ld_supported_targets" in 91971d7fec4Smrg elf32-i386) 92071d7fec4Smrg TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" 92171d7fec4Smrg ;; 92271d7fec4Smrg a.out-i386-linux) 92371d7fec4Smrg echo "${UNAME_MACHINE}-pc-linux-gnuaout" 92471d7fec4Smrg exit 0 ;; 92571d7fec4Smrg coff-i386) 92671d7fec4Smrg echo "${UNAME_MACHINE}-pc-linux-gnucoff" 92771d7fec4Smrg exit 0 ;; 92871d7fec4Smrg "") 92971d7fec4Smrg # Either a pre-BFD a.out linker (linux-gnuoldld) or 93071d7fec4Smrg # one that does not give us useful --help. 93171d7fec4Smrg echo "${UNAME_MACHINE}-pc-linux-gnuoldld" 93271d7fec4Smrg exit 0 ;; 93371d7fec4Smrg esac 93471d7fec4Smrg # Determine whether the default compiler is a.out or elf 93571d7fec4Smrg eval $set_cc_for_build 93671d7fec4Smrg sed 's/^ //' << EOF >$dummy.c 93771d7fec4Smrg #include <features.h> 93871d7fec4Smrg #ifdef __ELF__ 93971d7fec4Smrg # ifdef __GLIBC__ 94071d7fec4Smrg # if __GLIBC__ >= 2 94171d7fec4Smrg LIBC=gnu 94271d7fec4Smrg # else 94371d7fec4Smrg LIBC=gnulibc1 94471d7fec4Smrg # endif 94571d7fec4Smrg # else 94671d7fec4Smrg LIBC=gnulibc1 94771d7fec4Smrg # endif 94871d7fec4Smrg #else 94971d7fec4Smrg #ifdef __INTEL_COMPILER 95071d7fec4Smrg LIBC=gnu 95171d7fec4Smrg #else 95271d7fec4Smrg LIBC=gnuaout 95371d7fec4Smrg #endif 95471d7fec4Smrg #endif 95571d7fec4SmrgEOF 95671d7fec4Smrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` 95771d7fec4Smrg test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 95871d7fec4Smrg test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 95971d7fec4Smrg ;; 96071d7fec4Smrg i*86:DYNIX/ptx:4*:*) 96171d7fec4Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 96271d7fec4Smrg # earlier versions are messed up and put the nodename in both 96371d7fec4Smrg # sysname and nodename. 96471d7fec4Smrg echo i386-sequent-sysv4 96571d7fec4Smrg exit 0 ;; 96671d7fec4Smrg i*86:UNIX_SV:4.2MP:2.*) 96771d7fec4Smrg # Unixware is an offshoot of SVR4, but it has its own version 96871d7fec4Smrg # number series starting with 2... 96971d7fec4Smrg # I am not positive that other SVR4 systems won't match this, 97071d7fec4Smrg # I just have to hope. -- rms. 97171d7fec4Smrg # Use sysv4.2uw... so that sysv4* matches it. 97271d7fec4Smrg echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 97371d7fec4Smrg exit 0 ;; 97471d7fec4Smrg i*86:OS/2:*:*) 97571d7fec4Smrg # If we were able to find `uname', then EMX Unix compatibility 97671d7fec4Smrg # is probably installed. 97771d7fec4Smrg echo ${UNAME_MACHINE}-pc-os2-emx 97871d7fec4Smrg exit 0 ;; 97971d7fec4Smrg i*86:XTS-300:*:STOP) 98071d7fec4Smrg echo ${UNAME_MACHINE}-unknown-stop 98171d7fec4Smrg exit 0 ;; 98271d7fec4Smrg i*86:atheos:*:*) 98371d7fec4Smrg echo ${UNAME_MACHINE}-unknown-atheos 98471d7fec4Smrg exit 0 ;; 98571d7fec4Smrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 98671d7fec4Smrg echo i386-unknown-lynxos${UNAME_RELEASE} 98771d7fec4Smrg exit 0 ;; 98871d7fec4Smrg i*86:*DOS:*:*) 98971d7fec4Smrg echo ${UNAME_MACHINE}-pc-msdosdjgpp 99071d7fec4Smrg exit 0 ;; 99171d7fec4Smrg i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 99271d7fec4Smrg UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 99371d7fec4Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 99471d7fec4Smrg echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 99571d7fec4Smrg else 99671d7fec4Smrg echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 99771d7fec4Smrg fi 99871d7fec4Smrg exit 0 ;; 99971d7fec4Smrg i*86:*:5:[78]*) 100071d7fec4Smrg case `/bin/uname -X | grep "^Machine"` in 100171d7fec4Smrg *486*) UNAME_MACHINE=i486 ;; 100271d7fec4Smrg *Pentium) UNAME_MACHINE=i586 ;; 100371d7fec4Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 100471d7fec4Smrg esac 100571d7fec4Smrg echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 100671d7fec4Smrg exit 0 ;; 100771d7fec4Smrg i*86:*:3.2:*) 100871d7fec4Smrg if test -f /usr/options/cb.name; then 100971d7fec4Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 101071d7fec4Smrg echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 101171d7fec4Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 101271d7fec4Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 101371d7fec4Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 101471d7fec4Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 101571d7fec4Smrg && UNAME_MACHINE=i586 101671d7fec4Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 101771d7fec4Smrg && UNAME_MACHINE=i686 101871d7fec4Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 101971d7fec4Smrg && UNAME_MACHINE=i686 102071d7fec4Smrg echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 102171d7fec4Smrg else 102271d7fec4Smrg echo ${UNAME_MACHINE}-pc-sysv32 102371d7fec4Smrg fi 102471d7fec4Smrg exit 0 ;; 102571d7fec4Smrg pc:*:*:*) 102671d7fec4Smrg # Left here for compatibility: 102771d7fec4Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 102871d7fec4Smrg # the processor, so we play safe by assuming i386. 102971d7fec4Smrg echo i386-pc-msdosdjgpp 103071d7fec4Smrg exit 0 ;; 103171d7fec4Smrg Intel:Mach:3*:*) 103271d7fec4Smrg echo i386-pc-mach3 103371d7fec4Smrg exit 0 ;; 103471d7fec4Smrg paragon:*:*:*) 103571d7fec4Smrg echo i860-intel-osf1 103671d7fec4Smrg exit 0 ;; 103771d7fec4Smrg i860:*:4.*:*) # i860-SVR4 103871d7fec4Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 103971d7fec4Smrg echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 104071d7fec4Smrg else # Add other i860-SVR4 vendors below as they are discovered. 104171d7fec4Smrg echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 104271d7fec4Smrg fi 104371d7fec4Smrg exit 0 ;; 104471d7fec4Smrg mini*:CTIX:SYS*5:*) 104571d7fec4Smrg # "miniframe" 104671d7fec4Smrg echo m68010-convergent-sysv 104771d7fec4Smrg exit 0 ;; 104871d7fec4Smrg mc68k:UNIX:SYSTEM5:3.51m) 104971d7fec4Smrg echo m68k-convergent-sysv 105071d7fec4Smrg exit 0 ;; 105171d7fec4Smrg M680?0:D-NIX:5.3:*) 105271d7fec4Smrg echo m68k-diab-dnix 105371d7fec4Smrg exit 0 ;; 105471d7fec4Smrg M68*:*:R3V[567]*:*) 105571d7fec4Smrg test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 105671d7fec4Smrg 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) 105771d7fec4Smrg OS_REL='' 105871d7fec4Smrg test -r /etc/.relid \ 105971d7fec4Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 106071d7fec4Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 106171d7fec4Smrg && echo i486-ncr-sysv4.3${OS_REL} && exit 0 106271d7fec4Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 106371d7fec4Smrg && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 106471d7fec4Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 106571d7fec4Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 106671d7fec4Smrg && echo i486-ncr-sysv4 && exit 0 ;; 106771d7fec4Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 106871d7fec4Smrg echo m68k-unknown-lynxos${UNAME_RELEASE} 106971d7fec4Smrg exit 0 ;; 107071d7fec4Smrg mc68030:UNIX_System_V:4.*:*) 107171d7fec4Smrg echo m68k-atari-sysv4 107271d7fec4Smrg exit 0 ;; 107371d7fec4Smrg TSUNAMI:LynxOS:2.*:*) 107471d7fec4Smrg echo sparc-unknown-lynxos${UNAME_RELEASE} 107571d7fec4Smrg exit 0 ;; 107671d7fec4Smrg rs6000:LynxOS:2.*:*) 107771d7fec4Smrg echo rs6000-unknown-lynxos${UNAME_RELEASE} 107871d7fec4Smrg exit 0 ;; 107971d7fec4Smrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 108071d7fec4Smrg echo powerpc-unknown-lynxos${UNAME_RELEASE} 108171d7fec4Smrg exit 0 ;; 108271d7fec4Smrg SM[BE]S:UNIX_SV:*:*) 108371d7fec4Smrg echo mips-dde-sysv${UNAME_RELEASE} 108471d7fec4Smrg exit 0 ;; 108571d7fec4Smrg RM*:ReliantUNIX-*:*:*) 108671d7fec4Smrg echo mips-sni-sysv4 108771d7fec4Smrg exit 0 ;; 108871d7fec4Smrg RM*:SINIX-*:*:*) 108971d7fec4Smrg echo mips-sni-sysv4 109071d7fec4Smrg exit 0 ;; 109171d7fec4Smrg *:SINIX-*:*:*) 109271d7fec4Smrg if uname -p 2>/dev/null >/dev/null ; then 109371d7fec4Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 109471d7fec4Smrg echo ${UNAME_MACHINE}-sni-sysv4 109571d7fec4Smrg else 109671d7fec4Smrg echo ns32k-sni-sysv 109771d7fec4Smrg fi 109871d7fec4Smrg exit 0 ;; 109971d7fec4Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 110071d7fec4Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 110171d7fec4Smrg echo i586-unisys-sysv4 110271d7fec4Smrg exit 0 ;; 110371d7fec4Smrg *:UNIX_System_V:4*:FTX*) 110471d7fec4Smrg # From Gerald Hewes <hewes@openmarket.com>. 110571d7fec4Smrg # How about differentiating between stratus architectures? -djm 110671d7fec4Smrg echo hppa1.1-stratus-sysv4 110771d7fec4Smrg exit 0 ;; 110871d7fec4Smrg *:*:*:FTX*) 110971d7fec4Smrg # From seanf@swdc.stratus.com. 111071d7fec4Smrg echo i860-stratus-sysv4 111171d7fec4Smrg exit 0 ;; 111271d7fec4Smrg *:VOS:*:*) 111371d7fec4Smrg # From Paul.Green@stratus.com. 111471d7fec4Smrg echo hppa1.1-stratus-vos 111571d7fec4Smrg exit 0 ;; 111671d7fec4Smrg mc68*:A/UX:*:*) 111771d7fec4Smrg echo m68k-apple-aux${UNAME_RELEASE} 111871d7fec4Smrg exit 0 ;; 111971d7fec4Smrg news*:NEWS-OS:6*:*) 112071d7fec4Smrg echo mips-sony-newsos6 112171d7fec4Smrg exit 0 ;; 112271d7fec4Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 112371d7fec4Smrg if [ -d /usr/nec ]; then 112471d7fec4Smrg echo mips-nec-sysv${UNAME_RELEASE} 112571d7fec4Smrg else 112671d7fec4Smrg echo mips-unknown-sysv${UNAME_RELEASE} 112771d7fec4Smrg fi 112871d7fec4Smrg exit 0 ;; 112971d7fec4Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 113071d7fec4Smrg echo powerpc-be-beos 113171d7fec4Smrg exit 0 ;; 113271d7fec4Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 113371d7fec4Smrg echo powerpc-apple-beos 113471d7fec4Smrg exit 0 ;; 113571d7fec4Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 113671d7fec4Smrg echo i586-pc-beos 113771d7fec4Smrg exit 0 ;; 113871d7fec4Smrg SX-4:SUPER-UX:*:*) 113971d7fec4Smrg echo sx4-nec-superux${UNAME_RELEASE} 114071d7fec4Smrg exit 0 ;; 114171d7fec4Smrg SX-5:SUPER-UX:*:*) 114271d7fec4Smrg echo sx5-nec-superux${UNAME_RELEASE} 114371d7fec4Smrg exit 0 ;; 114471d7fec4Smrg SX-6:SUPER-UX:*:*) 114571d7fec4Smrg echo sx6-nec-superux${UNAME_RELEASE} 114671d7fec4Smrg exit 0 ;; 114771d7fec4Smrg Power*:Rhapsody:*:*) 114871d7fec4Smrg echo powerpc-apple-rhapsody${UNAME_RELEASE} 114971d7fec4Smrg exit 0 ;; 115071d7fec4Smrg *:Rhapsody:*:*) 115171d7fec4Smrg echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 115271d7fec4Smrg exit 0 ;; 115371d7fec4Smrg *:Darwin:*:*) 115471d7fec4Smrg case `uname -p` in 115571d7fec4Smrg *86) UNAME_PROCESSOR=i686 ;; 115671d7fec4Smrg powerpc) UNAME_PROCESSOR=powerpc ;; 115771d7fec4Smrg esac 115871d7fec4Smrg echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 115971d7fec4Smrg exit 0 ;; 116071d7fec4Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 116171d7fec4Smrg UNAME_PROCESSOR=`uname -p` 116271d7fec4Smrg if test "$UNAME_PROCESSOR" = "x86"; then 116371d7fec4Smrg UNAME_PROCESSOR=i386 116471d7fec4Smrg UNAME_MACHINE=pc 116571d7fec4Smrg fi 116671d7fec4Smrg echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 116771d7fec4Smrg exit 0 ;; 116871d7fec4Smrg *:QNX:*:4*) 116971d7fec4Smrg echo i386-pc-qnx 117071d7fec4Smrg exit 0 ;; 117171d7fec4Smrg NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) 117271d7fec4Smrg echo nsr-tandem-nsk${UNAME_RELEASE} 117371d7fec4Smrg exit 0 ;; 117471d7fec4Smrg *:NonStop-UX:*:*) 117571d7fec4Smrg echo mips-compaq-nonstopux 117671d7fec4Smrg exit 0 ;; 117771d7fec4Smrg BS2000:POSIX*:*:*) 117871d7fec4Smrg echo bs2000-siemens-sysv 117971d7fec4Smrg exit 0 ;; 118071d7fec4Smrg DS/*:UNIX_System_V:*:*) 118171d7fec4Smrg echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 118271d7fec4Smrg exit 0 ;; 118371d7fec4Smrg *:Plan9:*:*) 118471d7fec4Smrg # "uname -m" is not consistent, so use $cputype instead. 386 118571d7fec4Smrg # is converted to i386 for consistency with other x86 118671d7fec4Smrg # operating systems. 118771d7fec4Smrg if test "$cputype" = "386"; then 118871d7fec4Smrg UNAME_MACHINE=i386 118971d7fec4Smrg else 119071d7fec4Smrg UNAME_MACHINE="$cputype" 119171d7fec4Smrg fi 119271d7fec4Smrg echo ${UNAME_MACHINE}-unknown-plan9 119371d7fec4Smrg exit 0 ;; 119471d7fec4Smrg *:TOPS-10:*:*) 119571d7fec4Smrg echo pdp10-unknown-tops10 119671d7fec4Smrg exit 0 ;; 119771d7fec4Smrg *:TENEX:*:*) 119871d7fec4Smrg echo pdp10-unknown-tenex 119971d7fec4Smrg exit 0 ;; 120071d7fec4Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 120171d7fec4Smrg echo pdp10-dec-tops20 120271d7fec4Smrg exit 0 ;; 120371d7fec4Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 120471d7fec4Smrg echo pdp10-xkl-tops20 120571d7fec4Smrg exit 0 ;; 120671d7fec4Smrg *:TOPS-20:*:*) 120771d7fec4Smrg echo pdp10-unknown-tops20 120871d7fec4Smrg exit 0 ;; 120971d7fec4Smrg *:ITS:*:*) 121071d7fec4Smrg echo pdp10-unknown-its 121171d7fec4Smrg exit 0 ;; 121271d7fec4Smrg SEI:*:*:SEIUX) 121371d7fec4Smrg echo mips-sei-seiux${UNAME_RELEASE} 121471d7fec4Smrg exit 0 ;; 121571d7fec4Smrgesac 121671d7fec4Smrg 121771d7fec4Smrg#echo '(No uname command or uname output not recognized.)' 1>&2 121871d7fec4Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 121971d7fec4Smrg 122071d7fec4Smrgeval $set_cc_for_build 122171d7fec4Smrgcat >$dummy.c <<EOF 122271d7fec4Smrg#ifdef _SEQUENT_ 122371d7fec4Smrg# include <sys/types.h> 122471d7fec4Smrg# include <sys/utsname.h> 122571d7fec4Smrg#endif 122671d7fec4Smrgmain () 122771d7fec4Smrg{ 122871d7fec4Smrg#if defined (sony) 122971d7fec4Smrg#if defined (MIPSEB) 123071d7fec4Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 123171d7fec4Smrg I don't know.... */ 123271d7fec4Smrg printf ("mips-sony-bsd\n"); exit (0); 123371d7fec4Smrg#else 123471d7fec4Smrg#include <sys/param.h> 123571d7fec4Smrg printf ("m68k-sony-newsos%s\n", 123671d7fec4Smrg#ifdef NEWSOS4 123771d7fec4Smrg "4" 123871d7fec4Smrg#else 123971d7fec4Smrg "" 124071d7fec4Smrg#endif 124171d7fec4Smrg ); exit (0); 124271d7fec4Smrg#endif 124371d7fec4Smrg#endif 124471d7fec4Smrg 124571d7fec4Smrg#if defined (__arm) && defined (__acorn) && defined (__unix) 124671d7fec4Smrg printf ("arm-acorn-riscix"); exit (0); 124771d7fec4Smrg#endif 124871d7fec4Smrg 124971d7fec4Smrg#if defined (hp300) && !defined (hpux) 125071d7fec4Smrg printf ("m68k-hp-bsd\n"); exit (0); 125171d7fec4Smrg#endif 125271d7fec4Smrg 125371d7fec4Smrg#if defined (NeXT) 125471d7fec4Smrg#if !defined (__ARCHITECTURE__) 125571d7fec4Smrg#define __ARCHITECTURE__ "m68k" 125671d7fec4Smrg#endif 125771d7fec4Smrg int version; 125871d7fec4Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 125971d7fec4Smrg if (version < 4) 126071d7fec4Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 126171d7fec4Smrg else 126271d7fec4Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 126371d7fec4Smrg exit (0); 126471d7fec4Smrg#endif 126571d7fec4Smrg 126671d7fec4Smrg#if defined (MULTIMAX) || defined (n16) 126771d7fec4Smrg#if defined (UMAXV) 126871d7fec4Smrg printf ("ns32k-encore-sysv\n"); exit (0); 126971d7fec4Smrg#else 127071d7fec4Smrg#if defined (CMU) 127171d7fec4Smrg printf ("ns32k-encore-mach\n"); exit (0); 127271d7fec4Smrg#else 127371d7fec4Smrg printf ("ns32k-encore-bsd\n"); exit (0); 127471d7fec4Smrg#endif 127571d7fec4Smrg#endif 127671d7fec4Smrg#endif 127771d7fec4Smrg 127871d7fec4Smrg#if defined (__386BSD__) 127971d7fec4Smrg printf ("i386-pc-bsd\n"); exit (0); 128071d7fec4Smrg#endif 128171d7fec4Smrg 128271d7fec4Smrg#if defined (sequent) 128371d7fec4Smrg#if defined (i386) 128471d7fec4Smrg printf ("i386-sequent-dynix\n"); exit (0); 128571d7fec4Smrg#endif 128671d7fec4Smrg#if defined (ns32000) 128771d7fec4Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 128871d7fec4Smrg#endif 128971d7fec4Smrg#endif 129071d7fec4Smrg 129171d7fec4Smrg#if defined (_SEQUENT_) 129271d7fec4Smrg struct utsname un; 129371d7fec4Smrg 129471d7fec4Smrg uname(&un); 129571d7fec4Smrg 129671d7fec4Smrg if (strncmp(un.version, "V2", 2) == 0) { 129771d7fec4Smrg printf ("i386-sequent-ptx2\n"); exit (0); 129871d7fec4Smrg } 129971d7fec4Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 130071d7fec4Smrg printf ("i386-sequent-ptx1\n"); exit (0); 130171d7fec4Smrg } 130271d7fec4Smrg printf ("i386-sequent-ptx\n"); exit (0); 130371d7fec4Smrg 130471d7fec4Smrg#endif 130571d7fec4Smrg 130671d7fec4Smrg#if defined (vax) 130771d7fec4Smrg# if !defined (ultrix) 130871d7fec4Smrg# include <sys/param.h> 130971d7fec4Smrg# if defined (BSD) 131071d7fec4Smrg# if BSD == 43 131171d7fec4Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 131271d7fec4Smrg# else 131371d7fec4Smrg# if BSD == 199006 131471d7fec4Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 131571d7fec4Smrg# else 131671d7fec4Smrg printf ("vax-dec-bsd\n"); exit (0); 131771d7fec4Smrg# endif 131871d7fec4Smrg# endif 131971d7fec4Smrg# else 132071d7fec4Smrg printf ("vax-dec-bsd\n"); exit (0); 132171d7fec4Smrg# endif 132271d7fec4Smrg# else 132371d7fec4Smrg printf ("vax-dec-ultrix\n"); exit (0); 132471d7fec4Smrg# endif 132571d7fec4Smrg#endif 132671d7fec4Smrg 132771d7fec4Smrg#if defined (alliant) && defined (i860) 132871d7fec4Smrg printf ("i860-alliant-bsd\n"); exit (0); 132971d7fec4Smrg#endif 133071d7fec4Smrg 133171d7fec4Smrg exit (1); 133271d7fec4Smrg} 133371d7fec4SmrgEOF 133471d7fec4Smrg 133571d7fec4Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 133671d7fec4Smrg 133771d7fec4Smrg# Apollos put the system type in the environment. 133871d7fec4Smrg 133971d7fec4Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } 134071d7fec4Smrg 134171d7fec4Smrg# Convex versions that predate uname can use getsysinfo(1) 134271d7fec4Smrg 134371d7fec4Smrgif [ -x /usr/convex/getsysinfo ] 134471d7fec4Smrgthen 134571d7fec4Smrg case `getsysinfo -f cpu_type` in 134671d7fec4Smrg c1*) 134771d7fec4Smrg echo c1-convex-bsd 134871d7fec4Smrg exit 0 ;; 134971d7fec4Smrg c2*) 135071d7fec4Smrg if getsysinfo -f scalar_acc 135171d7fec4Smrg then echo c32-convex-bsd 135271d7fec4Smrg else echo c2-convex-bsd 135371d7fec4Smrg fi 135471d7fec4Smrg exit 0 ;; 135571d7fec4Smrg c34*) 135671d7fec4Smrg echo c34-convex-bsd 135771d7fec4Smrg exit 0 ;; 135871d7fec4Smrg c38*) 135971d7fec4Smrg echo c38-convex-bsd 136071d7fec4Smrg exit 0 ;; 136171d7fec4Smrg c4*) 136271d7fec4Smrg echo c4-convex-bsd 136371d7fec4Smrg exit 0 ;; 136471d7fec4Smrg esac 136571d7fec4Smrgfi 136671d7fec4Smrg 136771d7fec4Smrgcat >&2 <<EOF 136871d7fec4Smrg$0: unable to guess system type 136971d7fec4Smrg 137071d7fec4SmrgThis script, last modified $timestamp, has failed to recognize 137171d7fec4Smrgthe operating system you are using. It is advised that you 137271d7fec4Smrgdownload the most up to date version of the config scripts from 137371d7fec4Smrg 137471d7fec4Smrg ftp://ftp.gnu.org/pub/gnu/config/ 137571d7fec4Smrg 137671d7fec4SmrgIf the version you run ($0) is already up to date, please 137771d7fec4Smrgsend the following data and any information you think might be 137871d7fec4Smrgpertinent to <config-patches@gnu.org> in order to provide the needed 137971d7fec4Smrginformation to handle your system. 138071d7fec4Smrg 138171d7fec4Smrgconfig.guess timestamp = $timestamp 138271d7fec4Smrg 138371d7fec4Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 138471d7fec4Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 138571d7fec4Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 138671d7fec4Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 138771d7fec4Smrg 138871d7fec4Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 138971d7fec4Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 139071d7fec4Smrg 139171d7fec4Smrghostinfo = `(hostinfo) 2>/dev/null` 139271d7fec4Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 139371d7fec4Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 139471d7fec4Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 139571d7fec4Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 139671d7fec4Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 139771d7fec4Smrg 139871d7fec4SmrgUNAME_MACHINE = ${UNAME_MACHINE} 139971d7fec4SmrgUNAME_RELEASE = ${UNAME_RELEASE} 140071d7fec4SmrgUNAME_SYSTEM = ${UNAME_SYSTEM} 140171d7fec4SmrgUNAME_VERSION = ${UNAME_VERSION} 140271d7fec4SmrgEOF 140371d7fec4Smrg 140471d7fec4Smrgexit 1 140571d7fec4Smrg 140671d7fec4Smrg# Local variables: 140771d7fec4Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 140871d7fec4Smrg# time-stamp-start: "timestamp='" 140971d7fec4Smrg# time-stamp-format: "%:y-%02m-%02d" 141071d7fec4Smrg# time-stamp-end: "'" 141171d7fec4Smrg# End: 1412