130da1778Schristos#! /bin/sh 230da1778Schristos# Attempt to guess a canonical system name. 3cc576e1dSsevan# Copyright 1992-2017 Free Software Foundation, Inc. 430da1778Schristos 5cc576e1dSsevantimestamp='2017-01-01' 630da1778Schristos 730da1778Schristos# This file is free software; you can redistribute it and/or modify it 830da1778Schristos# under the terms of the GNU General Public License as published by 930da1778Schristos# the Free Software Foundation; either version 3 of the License, or 1030da1778Schristos# (at your option) any later version. 1130da1778Schristos# 1230da1778Schristos# This program is distributed in the hope that it will be useful, but 1330da1778Schristos# WITHOUT ANY WARRANTY; without even the implied warranty of 1430da1778Schristos# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1530da1778Schristos# General Public License for more details. 1630da1778Schristos# 1730da1778Schristos# You should have received a copy of the GNU General Public License 1830da1778Schristos# along with this program; if not, see <http://www.gnu.org/licenses/>. 1930da1778Schristos# 2030da1778Schristos# As a special exception to the GNU General Public License, if you 2130da1778Schristos# distribute this file as part of a program that contains a 2230da1778Schristos# configuration script generated by Autoconf, you may include it under 2330da1778Schristos# the same distribution terms that you use for the rest of that 2430da1778Schristos# program. This Exception is an additional permission under section 7 2530da1778Schristos# of the GNU General Public License, version 3 ("GPLv3"). 2630da1778Schristos# 2730da1778Schristos# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. 2830da1778Schristos# 2930da1778Schristos# You can get the latest version of this script from: 30cc576e1dSsevan# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess 3130da1778Schristos# 3230da1778Schristos# Please send patches to <config-patches@gnu.org>. 3330da1778Schristos 3430da1778Schristos 3530da1778Schristosme=`echo "$0" | sed -e 's,.*/,,'` 3630da1778Schristos 3730da1778Schristosusage="\ 3830da1778SchristosUsage: $0 [OPTION] 3930da1778Schristos 4030da1778SchristosOutput the configuration name of the system \`$me' is run on. 4130da1778Schristos 4230da1778SchristosOperation modes: 4330da1778Schristos -h, --help print this help, then exit 4430da1778Schristos -t, --time-stamp print date of last modification, then exit 4530da1778Schristos -v, --version print version number, then exit 4630da1778Schristos 4730da1778SchristosReport bugs and patches to <config-patches@gnu.org>." 4830da1778Schristos 4930da1778Schristosversion="\ 5030da1778SchristosGNU config.guess ($timestamp) 5130da1778Schristos 5230da1778SchristosOriginally written by Per Bothner. 53cc576e1dSsevanCopyright 1992-2017 Free Software Foundation, Inc. 5430da1778Schristos 5530da1778SchristosThis is free software; see the source for copying conditions. There is NO 5630da1778Schristoswarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 5730da1778Schristos 5830da1778Schristoshelp=" 5930da1778SchristosTry \`$me --help' for more information." 6030da1778Schristos 6130da1778Schristos# Parse command line 6230da1778Schristoswhile test $# -gt 0 ; do 6330da1778Schristos case $1 in 6430da1778Schristos --time-stamp | --time* | -t ) 6530da1778Schristos echo "$timestamp" ; exit ;; 6630da1778Schristos --version | -v ) 6730da1778Schristos echo "$version" ; exit ;; 6830da1778Schristos --help | --h* | -h ) 6930da1778Schristos echo "$usage"; exit ;; 7030da1778Schristos -- ) # Stop option processing 7130da1778Schristos shift; break ;; 7230da1778Schristos - ) # Use stdin as input. 7330da1778Schristos break ;; 7430da1778Schristos -* ) 7530da1778Schristos echo "$me: invalid option $1$help" >&2 7630da1778Schristos exit 1 ;; 7730da1778Schristos * ) 7830da1778Schristos break ;; 7930da1778Schristos esac 8030da1778Schristosdone 8130da1778Schristos 8230da1778Schristosif test $# != 0; then 8330da1778Schristos echo "$me: too many arguments$help" >&2 8430da1778Schristos exit 1 8530da1778Schristosfi 8630da1778Schristos 8730da1778Schristostrap 'exit 1' 1 2 15 8830da1778Schristos 8930da1778Schristos# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 9030da1778Schristos# compiler to aid in system detection is discouraged as it requires 9130da1778Schristos# temporary files to be created and, as you can see below, it is a 9230da1778Schristos# headache to deal with in a portable fashion. 9330da1778Schristos 9430da1778Schristos# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 9530da1778Schristos# use `HOST_CC' if defined, but it is deprecated. 9630da1778Schristos 9730da1778Schristos# Portable tmp directory creation inspired by the Autoconf team. 9830da1778Schristos 9930da1778Schristosset_cc_for_build=' 10030da1778Schristostrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 10130da1778Schristostrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 10230da1778Schristos: ${TMPDIR=/tmp} ; 10330da1778Schristos { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 10430da1778Schristos { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 10530da1778Schristos { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 10630da1778Schristos { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 10730da1778Schristosdummy=$tmp/dummy ; 10830da1778Schristostmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 10930da1778Schristoscase $CC_FOR_BUILD,$HOST_CC,$CC in 11030da1778Schristos ,,) echo "int x;" > $dummy.c ; 11130da1778Schristos for c in cc gcc c89 c99 ; do 11230da1778Schristos if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 11330da1778Schristos CC_FOR_BUILD="$c"; break ; 11430da1778Schristos fi ; 11530da1778Schristos done ; 11630da1778Schristos if test x"$CC_FOR_BUILD" = x ; then 11730da1778Schristos CC_FOR_BUILD=no_compiler_found ; 11830da1778Schristos fi 11930da1778Schristos ;; 12030da1778Schristos ,,*) CC_FOR_BUILD=$CC ;; 12130da1778Schristos ,*,*) CC_FOR_BUILD=$HOST_CC ;; 12230da1778Schristosesac ; set_cc_for_build= ;' 12330da1778Schristos 12430da1778Schristos# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 12530da1778Schristos# (ghazi@noc.rutgers.edu 1994-08-24) 12630da1778Schristosif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 12730da1778Schristos PATH=$PATH:/.attbin ; export PATH 12830da1778Schristosfi 12930da1778Schristos 13030da1778SchristosUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 13130da1778SchristosUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 13230da1778SchristosUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 13330da1778SchristosUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 13430da1778Schristos 13530da1778Schristoscase "${UNAME_SYSTEM}" in 13630da1778SchristosLinux|GNU|GNU/*) 13730da1778Schristos # If the system lacks a compiler, then just pick glibc. 13830da1778Schristos # We could probably try harder. 13930da1778Schristos LIBC=gnu 14030da1778Schristos 14130da1778Schristos eval $set_cc_for_build 14230da1778Schristos cat <<-EOF > $dummy.c 14330da1778Schristos #include <features.h> 14430da1778Schristos #if defined(__UCLIBC__) 14530da1778Schristos LIBC=uclibc 14630da1778Schristos #elif defined(__dietlibc__) 14730da1778Schristos LIBC=dietlibc 14830da1778Schristos #else 14930da1778Schristos LIBC=gnu 15030da1778Schristos #endif 15130da1778Schristos EOF 15230da1778Schristos eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` 15330da1778Schristos ;; 15430da1778Schristosesac 15530da1778Schristos 15630da1778Schristos# Note: order is significant - the case branches are not exclusive. 15730da1778Schristos 15830da1778Schristoscase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 15930da1778Schristos *:NetBSD:*:*) 16030da1778Schristos # NetBSD (nbsd) targets should (where applicable) match one or 16130da1778Schristos # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, 16230da1778Schristos # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 16330da1778Schristos # switched to ELF, *-*-netbsd* would select the old 16430da1778Schristos # object file format. This provides both forward 16530da1778Schristos # compatibility and a consistent mechanism for selecting the 16630da1778Schristos # object file format. 16730da1778Schristos # 16830da1778Schristos # Note: NetBSD doesn't particularly care about the vendor 16930da1778Schristos # portion of the name. We always set it to "unknown". 17030da1778Schristos sysctl="sysctl -n hw.machine_arch" 17156bd8546Schristos UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ 17256bd8546Schristos /sbin/$sysctl 2>/dev/null || \ 17356bd8546Schristos /usr/sbin/$sysctl 2>/dev/null || \ 17456bd8546Schristos echo unknown)` 17530da1778Schristos case "${UNAME_MACHINE_ARCH}" in 176*a8c74629Srin aarch64eb) machine=aarch64_be-unknown ;; 17730da1778Schristos armeb) machine=armeb-unknown ;; 17830da1778Schristos arm*) machine=arm-unknown ;; 17930da1778Schristos sh3el) machine=shl-unknown ;; 18030da1778Schristos sh3eb) machine=sh-unknown ;; 18130da1778Schristos sh5el) machine=sh5le-unknown ;; 18256bd8546Schristos earmv*) 18356bd8546Schristos arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` 18456bd8546Schristos endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` 18556bd8546Schristos machine=${arch}${endian}-unknown 18656bd8546Schristos ;; 18730da1778Schristos *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 18830da1778Schristos esac 18930da1778Schristos # The Operating System including object format, if it has switched 190cc576e1dSsevan # to ELF recently (or will in the future) and ABI. 19130da1778Schristos case "${UNAME_MACHINE_ARCH}" in 192cc576e1dSsevan earm*) 193cc576e1dSsevan os=netbsdelf 194cc576e1dSsevan ;; 195cc576e1dSsevan arm*|i386|m68k|ns32k|sh3*|sparc|vax) 19630da1778Schristos eval $set_cc_for_build 19730da1778Schristos if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 19830da1778Schristos | grep -q __ELF__ 19930da1778Schristos then 20030da1778Schristos # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 20130da1778Schristos # Return netbsd for either. FIX? 20230da1778Schristos os=netbsd 20330da1778Schristos else 20430da1778Schristos os=netbsdelf 20530da1778Schristos fi 20630da1778Schristos ;; 20730da1778Schristos *) 20830da1778Schristos os=netbsd 20930da1778Schristos ;; 21030da1778Schristos esac 21156bd8546Schristos # Determine ABI tags. 21256bd8546Schristos case "${UNAME_MACHINE_ARCH}" in 21356bd8546Schristos earm*) 21456bd8546Schristos expr='s/^earmv[0-9]/-eabi/;s/eb$//' 21556bd8546Schristos abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` 21656bd8546Schristos ;; 21756bd8546Schristos esac 21830da1778Schristos # The OS release 21930da1778Schristos # Debian GNU/NetBSD machines have a different userland, and 22030da1778Schristos # thus, need a distinct triplet. However, they do not need 22130da1778Schristos # kernel version information, so it can be replaced with a 22230da1778Schristos # suitable tag, in the style of linux-gnu. 22330da1778Schristos case "${UNAME_VERSION}" in 22430da1778Schristos Debian*) 22530da1778Schristos release='-gnu' 22630da1778Schristos ;; 22730da1778Schristos *) 22856bd8546Schristos release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` 22930da1778Schristos ;; 23030da1778Schristos esac 23130da1778Schristos # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 23230da1778Schristos # contains redundant information, the shorter form: 23330da1778Schristos # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 23456bd8546Schristos echo "${machine}-${os}${release}${abi}" 23530da1778Schristos exit ;; 23630da1778Schristos *:Bitrig:*:*) 23730da1778Schristos UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` 23830da1778Schristos echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} 23930da1778Schristos exit ;; 24030da1778Schristos *:OpenBSD:*:*) 24130da1778Schristos UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 24230da1778Schristos echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 24330da1778Schristos exit ;; 244cc576e1dSsevan *:LibertyBSD:*:*) 245cc576e1dSsevan UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` 246cc576e1dSsevan echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} 247cc576e1dSsevan exit ;; 24830da1778Schristos *:ekkoBSD:*:*) 24930da1778Schristos echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 25030da1778Schristos exit ;; 25130da1778Schristos *:SolidBSD:*:*) 25230da1778Schristos echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 25330da1778Schristos exit ;; 25430da1778Schristos macppc:MirBSD:*:*) 25530da1778Schristos echo powerpc-unknown-mirbsd${UNAME_RELEASE} 25630da1778Schristos exit ;; 25730da1778Schristos *:MirBSD:*:*) 25830da1778Schristos echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 25930da1778Schristos exit ;; 26056bd8546Schristos *:Sortix:*:*) 26156bd8546Schristos echo ${UNAME_MACHINE}-unknown-sortix 26256bd8546Schristos exit ;; 26330da1778Schristos alpha:OSF1:*:*) 26430da1778Schristos case $UNAME_RELEASE in 26530da1778Schristos *4.0) 26630da1778Schristos UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 26730da1778Schristos ;; 26830da1778Schristos *5.*) 26930da1778Schristos UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 27030da1778Schristos ;; 27130da1778Schristos esac 27230da1778Schristos # According to Compaq, /usr/sbin/psrinfo has been available on 27330da1778Schristos # OSF/1 and Tru64 systems produced since 1995. I hope that 27430da1778Schristos # covers most systems running today. This code pipes the CPU 27530da1778Schristos # types through head -n 1, so we only detect the type of CPU 0. 27630da1778Schristos ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 27730da1778Schristos case "$ALPHA_CPU_TYPE" in 27830da1778Schristos "EV4 (21064)") 279cc576e1dSsevan UNAME_MACHINE=alpha ;; 28030da1778Schristos "EV4.5 (21064)") 281cc576e1dSsevan UNAME_MACHINE=alpha ;; 28230da1778Schristos "LCA4 (21066/21068)") 283cc576e1dSsevan UNAME_MACHINE=alpha ;; 28430da1778Schristos "EV5 (21164)") 285cc576e1dSsevan UNAME_MACHINE=alphaev5 ;; 28630da1778Schristos "EV5.6 (21164A)") 287cc576e1dSsevan UNAME_MACHINE=alphaev56 ;; 28830da1778Schristos "EV5.6 (21164PC)") 289cc576e1dSsevan UNAME_MACHINE=alphapca56 ;; 29030da1778Schristos "EV5.7 (21164PC)") 291cc576e1dSsevan UNAME_MACHINE=alphapca57 ;; 29230da1778Schristos "EV6 (21264)") 293cc576e1dSsevan UNAME_MACHINE=alphaev6 ;; 29430da1778Schristos "EV6.7 (21264A)") 295cc576e1dSsevan UNAME_MACHINE=alphaev67 ;; 29630da1778Schristos "EV6.8CB (21264C)") 297cc576e1dSsevan UNAME_MACHINE=alphaev68 ;; 29830da1778Schristos "EV6.8AL (21264B)") 299cc576e1dSsevan UNAME_MACHINE=alphaev68 ;; 30030da1778Schristos "EV6.8CX (21264D)") 301cc576e1dSsevan UNAME_MACHINE=alphaev68 ;; 30230da1778Schristos "EV6.9A (21264/EV69A)") 303cc576e1dSsevan UNAME_MACHINE=alphaev69 ;; 30430da1778Schristos "EV7 (21364)") 305cc576e1dSsevan UNAME_MACHINE=alphaev7 ;; 30630da1778Schristos "EV7.9 (21364A)") 307cc576e1dSsevan UNAME_MACHINE=alphaev79 ;; 30830da1778Schristos esac 30930da1778Schristos # A Pn.n version is a patched version. 31030da1778Schristos # A Vn.n version is a released version. 31130da1778Schristos # A Tn.n version is a released field test version. 31230da1778Schristos # A Xn.n version is an unreleased experimental baselevel. 31330da1778Schristos # 1.2 uses "1.2" for uname -r. 314cc576e1dSsevan echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 31530da1778Schristos # Reset EXIT trap before exiting to avoid spurious non-zero exit code. 31630da1778Schristos exitcode=$? 31730da1778Schristos trap '' 0 31830da1778Schristos exit $exitcode ;; 31930da1778Schristos Alpha\ *:Windows_NT*:*) 32030da1778Schristos # How do we know it's Interix rather than the generic POSIX subsystem? 32130da1778Schristos # Should we change UNAME_MACHINE based on the output of uname instead 32230da1778Schristos # of the specific Alpha model? 32330da1778Schristos echo alpha-pc-interix 32430da1778Schristos exit ;; 32530da1778Schristos 21064:Windows_NT:50:3) 32630da1778Schristos echo alpha-dec-winnt3.5 32730da1778Schristos exit ;; 32830da1778Schristos Amiga*:UNIX_System_V:4.0:*) 32930da1778Schristos echo m68k-unknown-sysv4 33030da1778Schristos exit ;; 33130da1778Schristos *:[Aa]miga[Oo][Ss]:*:*) 33230da1778Schristos echo ${UNAME_MACHINE}-unknown-amigaos 33330da1778Schristos exit ;; 33430da1778Schristos *:[Mm]orph[Oo][Ss]:*:*) 33530da1778Schristos echo ${UNAME_MACHINE}-unknown-morphos 33630da1778Schristos exit ;; 33730da1778Schristos *:OS/390:*:*) 33830da1778Schristos echo i370-ibm-openedition 33930da1778Schristos exit ;; 34030da1778Schristos *:z/VM:*:*) 34130da1778Schristos echo s390-ibm-zvmoe 34230da1778Schristos exit ;; 34330da1778Schristos *:OS400:*:*) 34430da1778Schristos echo powerpc-ibm-os400 34530da1778Schristos exit ;; 34630da1778Schristos arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 34730da1778Schristos echo arm-acorn-riscix${UNAME_RELEASE} 34830da1778Schristos exit ;; 34930da1778Schristos arm*:riscos:*:*|arm*:RISCOS:*:*) 35030da1778Schristos echo arm-unknown-riscos 35130da1778Schristos exit ;; 35230da1778Schristos SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 35330da1778Schristos echo hppa1.1-hitachi-hiuxmpp 35430da1778Schristos exit ;; 35530da1778Schristos Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 35630da1778Schristos # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 35730da1778Schristos if test "`(/bin/universe) 2>/dev/null`" = att ; then 35830da1778Schristos echo pyramid-pyramid-sysv3 35930da1778Schristos else 36030da1778Schristos echo pyramid-pyramid-bsd 36130da1778Schristos fi 36230da1778Schristos exit ;; 36330da1778Schristos NILE*:*:*:dcosx) 36430da1778Schristos echo pyramid-pyramid-svr4 36530da1778Schristos exit ;; 36630da1778Schristos DRS?6000:unix:4.0:6*) 36730da1778Schristos echo sparc-icl-nx6 36830da1778Schristos exit ;; 36930da1778Schristos DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 37030da1778Schristos case `/usr/bin/uname -p` in 37130da1778Schristos sparc) echo sparc-icl-nx7; exit ;; 37230da1778Schristos esac ;; 37330da1778Schristos s390x:SunOS:*:*) 37430da1778Schristos echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 37530da1778Schristos exit ;; 37630da1778Schristos sun4H:SunOS:5.*:*) 37730da1778Schristos echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 37830da1778Schristos exit ;; 37930da1778Schristos sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 38030da1778Schristos echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 38130da1778Schristos exit ;; 38230da1778Schristos i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 38330da1778Schristos echo i386-pc-auroraux${UNAME_RELEASE} 38430da1778Schristos exit ;; 38530da1778Schristos i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 38630da1778Schristos eval $set_cc_for_build 387cc576e1dSsevan SUN_ARCH=i386 38830da1778Schristos # If there is a compiler, see if it is configured for 64-bit objects. 38930da1778Schristos # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 39030da1778Schristos # This test works for both compilers. 391cc576e1dSsevan if [ "$CC_FOR_BUILD" != no_compiler_found ]; then 39230da1778Schristos if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 393cc576e1dSsevan (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 39430da1778Schristos grep IS_64BIT_ARCH >/dev/null 39530da1778Schristos then 396cc576e1dSsevan SUN_ARCH=x86_64 39730da1778Schristos fi 39830da1778Schristos fi 39930da1778Schristos echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 40030da1778Schristos exit ;; 40130da1778Schristos sun4*:SunOS:6*:*) 40230da1778Schristos # According to config.sub, this is the proper way to canonicalize 40330da1778Schristos # SunOS6. Hard to guess exactly what SunOS6 will be like, but 40430da1778Schristos # it's likely to be more like Solaris than SunOS4. 40530da1778Schristos echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 40630da1778Schristos exit ;; 40730da1778Schristos sun4*:SunOS:*:*) 40830da1778Schristos case "`/usr/bin/arch -k`" in 40930da1778Schristos Series*|S4*) 41030da1778Schristos UNAME_RELEASE=`uname -v` 41130da1778Schristos ;; 41230da1778Schristos esac 41330da1778Schristos # Japanese Language versions have a version number like `4.1.3-JL'. 41430da1778Schristos echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 41530da1778Schristos exit ;; 41630da1778Schristos sun3*:SunOS:*:*) 41730da1778Schristos echo m68k-sun-sunos${UNAME_RELEASE} 41830da1778Schristos exit ;; 41930da1778Schristos sun*:*:4.2BSD:*) 42030da1778Schristos UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 421cc576e1dSsevan test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 42230da1778Schristos case "`/bin/arch`" in 42330da1778Schristos sun3) 42430da1778Schristos echo m68k-sun-sunos${UNAME_RELEASE} 42530da1778Schristos ;; 42630da1778Schristos sun4) 42730da1778Schristos echo sparc-sun-sunos${UNAME_RELEASE} 42830da1778Schristos ;; 42930da1778Schristos esac 43030da1778Schristos exit ;; 43130da1778Schristos aushp:SunOS:*:*) 43230da1778Schristos echo sparc-auspex-sunos${UNAME_RELEASE} 43330da1778Schristos exit ;; 43430da1778Schristos # The situation for MiNT is a little confusing. The machine name 43530da1778Schristos # can be virtually everything (everything which is not 43630da1778Schristos # "atarist" or "atariste" at least should have a processor 43730da1778Schristos # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 43830da1778Schristos # to the lowercase version "mint" (or "freemint"). Finally 43930da1778Schristos # the system name "TOS" denotes a system which is actually not 44030da1778Schristos # MiNT. But MiNT is downward compatible to TOS, so this should 44130da1778Schristos # be no problem. 44230da1778Schristos atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 44330da1778Schristos echo m68k-atari-mint${UNAME_RELEASE} 44430da1778Schristos exit ;; 44530da1778Schristos atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 44630da1778Schristos echo m68k-atari-mint${UNAME_RELEASE} 44730da1778Schristos exit ;; 44830da1778Schristos *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 44930da1778Schristos echo m68k-atari-mint${UNAME_RELEASE} 45030da1778Schristos exit ;; 45130da1778Schristos milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 45230da1778Schristos echo m68k-milan-mint${UNAME_RELEASE} 45330da1778Schristos exit ;; 45430da1778Schristos hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 45530da1778Schristos echo m68k-hades-mint${UNAME_RELEASE} 45630da1778Schristos exit ;; 45730da1778Schristos *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 45830da1778Schristos echo m68k-unknown-mint${UNAME_RELEASE} 45930da1778Schristos exit ;; 46030da1778Schristos m68k:machten:*:*) 46130da1778Schristos echo m68k-apple-machten${UNAME_RELEASE} 46230da1778Schristos exit ;; 46330da1778Schristos powerpc:machten:*:*) 46430da1778Schristos echo powerpc-apple-machten${UNAME_RELEASE} 46530da1778Schristos exit ;; 46630da1778Schristos RISC*:Mach:*:*) 46730da1778Schristos echo mips-dec-mach_bsd4.3 46830da1778Schristos exit ;; 46930da1778Schristos RISC*:ULTRIX:*:*) 47030da1778Schristos echo mips-dec-ultrix${UNAME_RELEASE} 47130da1778Schristos exit ;; 47230da1778Schristos VAX*:ULTRIX*:*:*) 47330da1778Schristos echo vax-dec-ultrix${UNAME_RELEASE} 47430da1778Schristos exit ;; 47530da1778Schristos 2020:CLIX:*:* | 2430:CLIX:*:*) 47630da1778Schristos echo clipper-intergraph-clix${UNAME_RELEASE} 47730da1778Schristos exit ;; 47830da1778Schristos mips:*:*:UMIPS | mips:*:*:RISCos) 47930da1778Schristos eval $set_cc_for_build 48030da1778Schristos sed 's/^ //' << EOF >$dummy.c 48130da1778Schristos#ifdef __cplusplus 48230da1778Schristos#include <stdio.h> /* for printf() prototype */ 48330da1778Schristos int main (int argc, char *argv[]) { 48430da1778Schristos#else 48530da1778Schristos int main (argc, argv) int argc; char *argv[]; { 48630da1778Schristos#endif 48730da1778Schristos #if defined (host_mips) && defined (MIPSEB) 48830da1778Schristos #if defined (SYSTYPE_SYSV) 48930da1778Schristos printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 49030da1778Schristos #endif 49130da1778Schristos #if defined (SYSTYPE_SVR4) 49230da1778Schristos printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 49330da1778Schristos #endif 49430da1778Schristos #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 49530da1778Schristos printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 49630da1778Schristos #endif 49730da1778Schristos #endif 49830da1778Schristos exit (-1); 49930da1778Schristos } 50030da1778SchristosEOF 50130da1778Schristos $CC_FOR_BUILD -o $dummy $dummy.c && 50230da1778Schristos dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 50330da1778Schristos SYSTEM_NAME=`$dummy $dummyarg` && 50430da1778Schristos { echo "$SYSTEM_NAME"; exit; } 50530da1778Schristos echo mips-mips-riscos${UNAME_RELEASE} 50630da1778Schristos exit ;; 50730da1778Schristos Motorola:PowerMAX_OS:*:*) 50830da1778Schristos echo powerpc-motorola-powermax 50930da1778Schristos exit ;; 51030da1778Schristos Motorola:*:4.3:PL8-*) 51130da1778Schristos echo powerpc-harris-powermax 51230da1778Schristos exit ;; 51330da1778Schristos Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 51430da1778Schristos echo powerpc-harris-powermax 51530da1778Schristos exit ;; 51630da1778Schristos Night_Hawk:Power_UNIX:*:*) 51730da1778Schristos echo powerpc-harris-powerunix 51830da1778Schristos exit ;; 51930da1778Schristos m88k:CX/UX:7*:*) 52030da1778Schristos echo m88k-harris-cxux7 52130da1778Schristos exit ;; 52230da1778Schristos m88k:*:4*:R4*) 52330da1778Schristos echo m88k-motorola-sysv4 52430da1778Schristos exit ;; 52530da1778Schristos m88k:*:3*:R3*) 52630da1778Schristos echo m88k-motorola-sysv3 52730da1778Schristos exit ;; 52830da1778Schristos AViiON:dgux:*:*) 52930da1778Schristos # DG/UX returns AViiON for all architectures 53030da1778Schristos UNAME_PROCESSOR=`/usr/bin/uname -p` 53130da1778Schristos if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 53230da1778Schristos then 53330da1778Schristos if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 53430da1778Schristos [ ${TARGET_BINARY_INTERFACE}x = x ] 53530da1778Schristos then 53630da1778Schristos echo m88k-dg-dgux${UNAME_RELEASE} 53730da1778Schristos else 53830da1778Schristos echo m88k-dg-dguxbcs${UNAME_RELEASE} 53930da1778Schristos fi 54030da1778Schristos else 54130da1778Schristos echo i586-dg-dgux${UNAME_RELEASE} 54230da1778Schristos fi 54330da1778Schristos exit ;; 54430da1778Schristos M88*:DolphinOS:*:*) # DolphinOS (SVR3) 54530da1778Schristos echo m88k-dolphin-sysv3 54630da1778Schristos exit ;; 54730da1778Schristos M88*:*:R3*:*) 54830da1778Schristos # Delta 88k system running SVR3 54930da1778Schristos echo m88k-motorola-sysv3 55030da1778Schristos exit ;; 55130da1778Schristos XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 55230da1778Schristos echo m88k-tektronix-sysv3 55330da1778Schristos exit ;; 55430da1778Schristos Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 55530da1778Schristos echo m68k-tektronix-bsd 55630da1778Schristos exit ;; 55730da1778Schristos *:IRIX*:*:*) 55830da1778Schristos echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 55930da1778Schristos exit ;; 56030da1778Schristos ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 56130da1778Schristos echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 56230da1778Schristos exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 56330da1778Schristos i*86:AIX:*:*) 56430da1778Schristos echo i386-ibm-aix 56530da1778Schristos exit ;; 56630da1778Schristos ia64:AIX:*:*) 56730da1778Schristos if [ -x /usr/bin/oslevel ] ; then 56830da1778Schristos IBM_REV=`/usr/bin/oslevel` 56930da1778Schristos else 57030da1778Schristos IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 57130da1778Schristos fi 57230da1778Schristos echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 57330da1778Schristos exit ;; 57430da1778Schristos *:AIX:2:3) 57530da1778Schristos if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 57630da1778Schristos eval $set_cc_for_build 57730da1778Schristos sed 's/^ //' << EOF >$dummy.c 57830da1778Schristos #include <sys/systemcfg.h> 57930da1778Schristos 58030da1778Schristos main() 58130da1778Schristos { 58230da1778Schristos if (!__power_pc()) 58330da1778Schristos exit(1); 58430da1778Schristos puts("powerpc-ibm-aix3.2.5"); 58530da1778Schristos exit(0); 58630da1778Schristos } 58730da1778SchristosEOF 58830da1778Schristos if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 58930da1778Schristos then 59030da1778Schristos echo "$SYSTEM_NAME" 59130da1778Schristos else 59230da1778Schristos echo rs6000-ibm-aix3.2.5 59330da1778Schristos fi 59430da1778Schristos elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 59530da1778Schristos echo rs6000-ibm-aix3.2.4 59630da1778Schristos else 59730da1778Schristos echo rs6000-ibm-aix3.2 59830da1778Schristos fi 59930da1778Schristos exit ;; 60030da1778Schristos *:AIX:*:[4567]) 60130da1778Schristos IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 60230da1778Schristos if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 60330da1778Schristos IBM_ARCH=rs6000 60430da1778Schristos else 60530da1778Schristos IBM_ARCH=powerpc 60630da1778Schristos fi 60730da1778Schristos if [ -x /usr/bin/lslpp ] ; then 60830da1778Schristos IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | 60930da1778Schristos awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 61030da1778Schristos else 61130da1778Schristos IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 61230da1778Schristos fi 61330da1778Schristos echo ${IBM_ARCH}-ibm-aix${IBM_REV} 61430da1778Schristos exit ;; 61530da1778Schristos *:AIX:*:*) 61630da1778Schristos echo rs6000-ibm-aix 61730da1778Schristos exit ;; 61830da1778Schristos ibmrt:4.4BSD:*|romp-ibm:BSD:*) 61930da1778Schristos echo romp-ibm-bsd4.4 62030da1778Schristos exit ;; 62130da1778Schristos ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 62230da1778Schristos echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 62330da1778Schristos exit ;; # report: romp-ibm BSD 4.3 62430da1778Schristos *:BOSX:*:*) 62530da1778Schristos echo rs6000-bull-bosx 62630da1778Schristos exit ;; 62730da1778Schristos DPX/2?00:B.O.S.:*:*) 62830da1778Schristos echo m68k-bull-sysv3 62930da1778Schristos exit ;; 63030da1778Schristos 9000/[34]??:4.3bsd:1.*:*) 63130da1778Schristos echo m68k-hp-bsd 63230da1778Schristos exit ;; 63330da1778Schristos hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 63430da1778Schristos echo m68k-hp-bsd4.4 63530da1778Schristos exit ;; 63630da1778Schristos 9000/[34678]??:HP-UX:*:*) 63730da1778Schristos HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 63830da1778Schristos case "${UNAME_MACHINE}" in 63930da1778Schristos 9000/31? ) HP_ARCH=m68000 ;; 64030da1778Schristos 9000/[34]?? ) HP_ARCH=m68k ;; 64130da1778Schristos 9000/[678][0-9][0-9]) 64230da1778Schristos if [ -x /usr/bin/getconf ]; then 64330da1778Schristos sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 64430da1778Schristos sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 64530da1778Schristos case "${sc_cpu_version}" in 646cc576e1dSsevan 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 647cc576e1dSsevan 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 64830da1778Schristos 532) # CPU_PA_RISC2_0 64930da1778Schristos case "${sc_kernel_bits}" in 650cc576e1dSsevan 32) HP_ARCH=hppa2.0n ;; 651cc576e1dSsevan 64) HP_ARCH=hppa2.0w ;; 652cc576e1dSsevan '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 65330da1778Schristos esac ;; 65430da1778Schristos esac 65530da1778Schristos fi 65630da1778Schristos if [ "${HP_ARCH}" = "" ]; then 65730da1778Schristos eval $set_cc_for_build 65830da1778Schristos sed 's/^ //' << EOF >$dummy.c 65930da1778Schristos 66030da1778Schristos #define _HPUX_SOURCE 66130da1778Schristos #include <stdlib.h> 66230da1778Schristos #include <unistd.h> 66330da1778Schristos 66430da1778Schristos int main () 66530da1778Schristos { 66630da1778Schristos #if defined(_SC_KERNEL_BITS) 66730da1778Schristos long bits = sysconf(_SC_KERNEL_BITS); 66830da1778Schristos #endif 66930da1778Schristos long cpu = sysconf (_SC_CPU_VERSION); 67030da1778Schristos 67130da1778Schristos switch (cpu) 67230da1778Schristos { 67330da1778Schristos case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 67430da1778Schristos case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 67530da1778Schristos case CPU_PA_RISC2_0: 67630da1778Schristos #if defined(_SC_KERNEL_BITS) 67730da1778Schristos switch (bits) 67830da1778Schristos { 67930da1778Schristos case 64: puts ("hppa2.0w"); break; 68030da1778Schristos case 32: puts ("hppa2.0n"); break; 68130da1778Schristos default: puts ("hppa2.0"); break; 68230da1778Schristos } break; 68330da1778Schristos #else /* !defined(_SC_KERNEL_BITS) */ 68430da1778Schristos puts ("hppa2.0"); break; 68530da1778Schristos #endif 68630da1778Schristos default: puts ("hppa1.0"); break; 68730da1778Schristos } 68830da1778Schristos exit (0); 68930da1778Schristos } 69030da1778SchristosEOF 691cc576e1dSsevan (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 69230da1778Schristos test -z "$HP_ARCH" && HP_ARCH=hppa 69330da1778Schristos fi ;; 69430da1778Schristos esac 695cc576e1dSsevan if [ ${HP_ARCH} = hppa2.0w ] 69630da1778Schristos then 69730da1778Schristos eval $set_cc_for_build 69830da1778Schristos 69930da1778Schristos # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 70030da1778Schristos # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 70130da1778Schristos # generating 64-bit code. GNU and HP use different nomenclature: 70230da1778Schristos # 70330da1778Schristos # $ CC_FOR_BUILD=cc ./config.guess 70430da1778Schristos # => hppa2.0w-hp-hpux11.23 70530da1778Schristos # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 70630da1778Schristos # => hppa64-hp-hpux11.23 70730da1778Schristos 708cc576e1dSsevan if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | 70930da1778Schristos grep -q __LP64__ 71030da1778Schristos then 711cc576e1dSsevan HP_ARCH=hppa2.0w 71230da1778Schristos else 713cc576e1dSsevan HP_ARCH=hppa64 71430da1778Schristos fi 71530da1778Schristos fi 71630da1778Schristos echo ${HP_ARCH}-hp-hpux${HPUX_REV} 71730da1778Schristos exit ;; 71830da1778Schristos ia64:HP-UX:*:*) 71930da1778Schristos HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 72030da1778Schristos echo ia64-hp-hpux${HPUX_REV} 72130da1778Schristos exit ;; 72230da1778Schristos 3050*:HI-UX:*:*) 72330da1778Schristos eval $set_cc_for_build 72430da1778Schristos sed 's/^ //' << EOF >$dummy.c 72530da1778Schristos #include <unistd.h> 72630da1778Schristos int 72730da1778Schristos main () 72830da1778Schristos { 72930da1778Schristos long cpu = sysconf (_SC_CPU_VERSION); 73030da1778Schristos /* The order matters, because CPU_IS_HP_MC68K erroneously returns 73130da1778Schristos true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 73230da1778Schristos results, however. */ 73330da1778Schristos if (CPU_IS_PA_RISC (cpu)) 73430da1778Schristos { 73530da1778Schristos switch (cpu) 73630da1778Schristos { 73730da1778Schristos case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 73830da1778Schristos case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 73930da1778Schristos case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 74030da1778Schristos default: puts ("hppa-hitachi-hiuxwe2"); break; 74130da1778Schristos } 74230da1778Schristos } 74330da1778Schristos else if (CPU_IS_HP_MC68K (cpu)) 74430da1778Schristos puts ("m68k-hitachi-hiuxwe2"); 74530da1778Schristos else puts ("unknown-hitachi-hiuxwe2"); 74630da1778Schristos exit (0); 74730da1778Schristos } 74830da1778SchristosEOF 74930da1778Schristos $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 75030da1778Schristos { echo "$SYSTEM_NAME"; exit; } 75130da1778Schristos echo unknown-hitachi-hiuxwe2 75230da1778Schristos exit ;; 75330da1778Schristos 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 75430da1778Schristos echo hppa1.1-hp-bsd 75530da1778Schristos exit ;; 75630da1778Schristos 9000/8??:4.3bsd:*:*) 75730da1778Schristos echo hppa1.0-hp-bsd 75830da1778Schristos exit ;; 75930da1778Schristos *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 76030da1778Schristos echo hppa1.0-hp-mpeix 76130da1778Schristos exit ;; 76230da1778Schristos hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 76330da1778Schristos echo hppa1.1-hp-osf 76430da1778Schristos exit ;; 76530da1778Schristos hp8??:OSF1:*:*) 76630da1778Schristos echo hppa1.0-hp-osf 76730da1778Schristos exit ;; 76830da1778Schristos i*86:OSF1:*:*) 76930da1778Schristos if [ -x /usr/sbin/sysversion ] ; then 77030da1778Schristos echo ${UNAME_MACHINE}-unknown-osf1mk 77130da1778Schristos else 77230da1778Schristos echo ${UNAME_MACHINE}-unknown-osf1 77330da1778Schristos fi 77430da1778Schristos exit ;; 77530da1778Schristos parisc*:Lites*:*:*) 77630da1778Schristos echo hppa1.1-hp-lites 77730da1778Schristos exit ;; 77830da1778Schristos C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 77930da1778Schristos echo c1-convex-bsd 78030da1778Schristos exit ;; 78130da1778Schristos C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 78230da1778Schristos if getsysinfo -f scalar_acc 78330da1778Schristos then echo c32-convex-bsd 78430da1778Schristos else echo c2-convex-bsd 78530da1778Schristos fi 78630da1778Schristos exit ;; 78730da1778Schristos C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 78830da1778Schristos echo c34-convex-bsd 78930da1778Schristos exit ;; 79030da1778Schristos C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 79130da1778Schristos echo c38-convex-bsd 79230da1778Schristos exit ;; 79330da1778Schristos C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 79430da1778Schristos echo c4-convex-bsd 79530da1778Schristos exit ;; 79630da1778Schristos CRAY*Y-MP:*:*:*) 79730da1778Schristos echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 79830da1778Schristos exit ;; 79930da1778Schristos CRAY*[A-Z]90:*:*:*) 80030da1778Schristos echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 80130da1778Schristos | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 80230da1778Schristos -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 80330da1778Schristos -e 's/\.[^.]*$/.X/' 80430da1778Schristos exit ;; 80530da1778Schristos CRAY*TS:*:*:*) 80630da1778Schristos echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 80730da1778Schristos exit ;; 80830da1778Schristos CRAY*T3E:*:*:*) 80930da1778Schristos echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 81030da1778Schristos exit ;; 81130da1778Schristos CRAY*SV1:*:*:*) 81230da1778Schristos echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 81330da1778Schristos exit ;; 81430da1778Schristos *:UNICOS/mp:*:*) 81530da1778Schristos echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 81630da1778Schristos exit ;; 81730da1778Schristos F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 818cc576e1dSsevan FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` 819cc576e1dSsevan FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 82030da1778Schristos FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 82130da1778Schristos echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 82230da1778Schristos exit ;; 82330da1778Schristos 5000:UNIX_System_V:4.*:*) 824cc576e1dSsevan FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` 825cc576e1dSsevan FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` 82630da1778Schristos echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 82730da1778Schristos exit ;; 82830da1778Schristos i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 82930da1778Schristos echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 83030da1778Schristos exit ;; 83130da1778Schristos sparc*:BSD/OS:*:*) 83230da1778Schristos echo sparc-unknown-bsdi${UNAME_RELEASE} 83330da1778Schristos exit ;; 83430da1778Schristos *:BSD/OS:*:*) 83530da1778Schristos echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 83630da1778Schristos exit ;; 83730da1778Schristos *:FreeBSD:*:*) 83830da1778Schristos UNAME_PROCESSOR=`/usr/bin/uname -p` 83930da1778Schristos case ${UNAME_PROCESSOR} in 84030da1778Schristos amd64) 84130da1778Schristos echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 84230da1778Schristos *) 84330da1778Schristos echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 84430da1778Schristos esac 84530da1778Schristos exit ;; 84630da1778Schristos i*:CYGWIN*:*) 84730da1778Schristos echo ${UNAME_MACHINE}-pc-cygwin 84830da1778Schristos exit ;; 84930da1778Schristos *:MINGW64*:*) 85030da1778Schristos echo ${UNAME_MACHINE}-pc-mingw64 85130da1778Schristos exit ;; 85230da1778Schristos *:MINGW*:*) 85330da1778Schristos echo ${UNAME_MACHINE}-pc-mingw32 85430da1778Schristos exit ;; 85530da1778Schristos *:MSYS*:*) 85630da1778Schristos echo ${UNAME_MACHINE}-pc-msys 85730da1778Schristos exit ;; 85830da1778Schristos i*:windows32*:*) 85930da1778Schristos # uname -m includes "-pc" on this system. 86030da1778Schristos echo ${UNAME_MACHINE}-mingw32 86130da1778Schristos exit ;; 86230da1778Schristos i*:PW*:*) 86330da1778Schristos echo ${UNAME_MACHINE}-pc-pw32 86430da1778Schristos exit ;; 86530da1778Schristos *:Interix*:*) 86630da1778Schristos case ${UNAME_MACHINE} in 86730da1778Schristos x86) 86830da1778Schristos echo i586-pc-interix${UNAME_RELEASE} 86930da1778Schristos exit ;; 87030da1778Schristos authenticamd | genuineintel | EM64T) 87130da1778Schristos echo x86_64-unknown-interix${UNAME_RELEASE} 87230da1778Schristos exit ;; 87330da1778Schristos IA64) 87430da1778Schristos echo ia64-unknown-interix${UNAME_RELEASE} 87530da1778Schristos exit ;; 87630da1778Schristos esac ;; 87730da1778Schristos [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 87830da1778Schristos echo i${UNAME_MACHINE}-pc-mks 87930da1778Schristos exit ;; 88030da1778Schristos 8664:Windows_NT:*) 88130da1778Schristos echo x86_64-pc-mks 88230da1778Schristos exit ;; 88330da1778Schristos i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 88430da1778Schristos # How do we know it's Interix rather than the generic POSIX subsystem? 88530da1778Schristos # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 88630da1778Schristos # UNAME_MACHINE based on the output of uname instead of i386? 88730da1778Schristos echo i586-pc-interix 88830da1778Schristos exit ;; 88930da1778Schristos i*:UWIN*:*) 89030da1778Schristos echo ${UNAME_MACHINE}-pc-uwin 89130da1778Schristos exit ;; 89230da1778Schristos amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 89330da1778Schristos echo x86_64-unknown-cygwin 89430da1778Schristos exit ;; 89530da1778Schristos p*:CYGWIN*:*) 89630da1778Schristos echo powerpcle-unknown-cygwin 89730da1778Schristos exit ;; 89830da1778Schristos prep*:SunOS:5.*:*) 89930da1778Schristos echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 90030da1778Schristos exit ;; 90130da1778Schristos *:GNU:*:*) 90230da1778Schristos # the GNU system 90330da1778Schristos echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 90430da1778Schristos exit ;; 90530da1778Schristos *:GNU/*:*:*) 90630da1778Schristos # other systems with GNU libc and userland 907cc576e1dSsevan echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} 90830da1778Schristos exit ;; 90930da1778Schristos i*86:Minix:*:*) 91030da1778Schristos echo ${UNAME_MACHINE}-pc-minix 91130da1778Schristos exit ;; 91230da1778Schristos aarch64:Linux:*:*) 91330da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 91430da1778Schristos exit ;; 91530da1778Schristos aarch64_be:Linux:*:*) 91630da1778Schristos UNAME_MACHINE=aarch64_be 91730da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 91830da1778Schristos exit ;; 91930da1778Schristos alpha:Linux:*:*) 92030da1778Schristos case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 92130da1778Schristos EV5) UNAME_MACHINE=alphaev5 ;; 92230da1778Schristos EV56) UNAME_MACHINE=alphaev56 ;; 92330da1778Schristos PCA56) UNAME_MACHINE=alphapca56 ;; 92430da1778Schristos PCA57) UNAME_MACHINE=alphapca56 ;; 92530da1778Schristos EV6) UNAME_MACHINE=alphaev6 ;; 92630da1778Schristos EV67) UNAME_MACHINE=alphaev67 ;; 92730da1778Schristos EV68*) UNAME_MACHINE=alphaev68 ;; 92830da1778Schristos esac 92930da1778Schristos objdump --private-headers /bin/sh | grep -q ld.so.1 930cc576e1dSsevan if test "$?" = 0 ; then LIBC=gnulibc1 ; fi 93130da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 93230da1778Schristos exit ;; 93330da1778Schristos arc:Linux:*:* | arceb:Linux:*:*) 93430da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 93530da1778Schristos exit ;; 93630da1778Schristos arm*:Linux:*:*) 93730da1778Schristos eval $set_cc_for_build 93830da1778Schristos if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 93930da1778Schristos | grep -q __ARM_EABI__ 94030da1778Schristos then 94130da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 94230da1778Schristos else 94330da1778Schristos if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ 94430da1778Schristos | grep -q __ARM_PCS_VFP 94530da1778Schristos then 94630da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi 94730da1778Schristos else 94830da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf 94930da1778Schristos fi 95030da1778Schristos fi 95130da1778Schristos exit ;; 95230da1778Schristos avr32*:Linux:*:*) 95330da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 95430da1778Schristos exit ;; 95530da1778Schristos cris:Linux:*:*) 95630da1778Schristos echo ${UNAME_MACHINE}-axis-linux-${LIBC} 95730da1778Schristos exit ;; 95830da1778Schristos crisv32:Linux:*:*) 95930da1778Schristos echo ${UNAME_MACHINE}-axis-linux-${LIBC} 96030da1778Schristos exit ;; 96156bd8546Schristos e2k:Linux:*:*) 96256bd8546Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 96356bd8546Schristos exit ;; 96430da1778Schristos frv:Linux:*:*) 96530da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 96630da1778Schristos exit ;; 96730da1778Schristos hexagon:Linux:*:*) 96830da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 96930da1778Schristos exit ;; 97030da1778Schristos i*86:Linux:*:*) 97130da1778Schristos echo ${UNAME_MACHINE}-pc-linux-${LIBC} 97230da1778Schristos exit ;; 97330da1778Schristos ia64:Linux:*:*) 97430da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 97530da1778Schristos exit ;; 976cc576e1dSsevan k1om:Linux:*:*) 977cc576e1dSsevan echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 978cc576e1dSsevan exit ;; 97930da1778Schristos m32r*:Linux:*:*) 98030da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 98130da1778Schristos exit ;; 98230da1778Schristos m68*:Linux:*:*) 98330da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 98430da1778Schristos exit ;; 98530da1778Schristos mips:Linux:*:* | mips64:Linux:*:*) 98630da1778Schristos eval $set_cc_for_build 98730da1778Schristos sed 's/^ //' << EOF >$dummy.c 98830da1778Schristos #undef CPU 98930da1778Schristos #undef ${UNAME_MACHINE} 99030da1778Schristos #undef ${UNAME_MACHINE}el 99130da1778Schristos #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 99230da1778Schristos CPU=${UNAME_MACHINE}el 99330da1778Schristos #else 99430da1778Schristos #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 99530da1778Schristos CPU=${UNAME_MACHINE} 99630da1778Schristos #else 99730da1778Schristos CPU= 99830da1778Schristos #endif 99930da1778Schristos #endif 100030da1778SchristosEOF 100130da1778Schristos eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 100230da1778Schristos test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 100330da1778Schristos ;; 1004cc576e1dSsevan mips64el:Linux:*:*) 1005cc576e1dSsevan echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1006cc576e1dSsevan exit ;; 100730da1778Schristos openrisc*:Linux:*:*) 100830da1778Schristos echo or1k-unknown-linux-${LIBC} 100930da1778Schristos exit ;; 101030da1778Schristos or32:Linux:*:* | or1k*:Linux:*:*) 101130da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 101230da1778Schristos exit ;; 101330da1778Schristos padre:Linux:*:*) 101430da1778Schristos echo sparc-unknown-linux-${LIBC} 101530da1778Schristos exit ;; 101630da1778Schristos parisc64:Linux:*:* | hppa64:Linux:*:*) 101730da1778Schristos echo hppa64-unknown-linux-${LIBC} 101830da1778Schristos exit ;; 101930da1778Schristos parisc:Linux:*:* | hppa:Linux:*:*) 102030da1778Schristos # Look for CPU level 102130da1778Schristos case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 102230da1778Schristos PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; 102330da1778Schristos PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; 102430da1778Schristos *) echo hppa-unknown-linux-${LIBC} ;; 102530da1778Schristos esac 102630da1778Schristos exit ;; 102730da1778Schristos ppc64:Linux:*:*) 102830da1778Schristos echo powerpc64-unknown-linux-${LIBC} 102930da1778Schristos exit ;; 103030da1778Schristos ppc:Linux:*:*) 103130da1778Schristos echo powerpc-unknown-linux-${LIBC} 103230da1778Schristos exit ;; 103330da1778Schristos ppc64le:Linux:*:*) 103430da1778Schristos echo powerpc64le-unknown-linux-${LIBC} 103530da1778Schristos exit ;; 103630da1778Schristos ppcle:Linux:*:*) 103730da1778Schristos echo powerpcle-unknown-linux-${LIBC} 103830da1778Schristos exit ;; 1039cc576e1dSsevan riscv32:Linux:*:* | riscv64:Linux:*:*) 1040cc576e1dSsevan echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 1041cc576e1dSsevan exit ;; 104230da1778Schristos s390:Linux:*:* | s390x:Linux:*:*) 104330da1778Schristos echo ${UNAME_MACHINE}-ibm-linux-${LIBC} 104430da1778Schristos exit ;; 104530da1778Schristos sh64*:Linux:*:*) 104630da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 104730da1778Schristos exit ;; 104830da1778Schristos sh*:Linux:*:*) 104930da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 105030da1778Schristos exit ;; 105130da1778Schristos sparc:Linux:*:* | sparc64:Linux:*:*) 105230da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 105330da1778Schristos exit ;; 105430da1778Schristos tile*:Linux:*:*) 105530da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 105630da1778Schristos exit ;; 105730da1778Schristos vax:Linux:*:*) 105830da1778Schristos echo ${UNAME_MACHINE}-dec-linux-${LIBC} 105930da1778Schristos exit ;; 106030da1778Schristos x86_64:Linux:*:*) 106156bd8546Schristos echo ${UNAME_MACHINE}-pc-linux-${LIBC} 106230da1778Schristos exit ;; 106330da1778Schristos xtensa*:Linux:*:*) 106430da1778Schristos echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 106530da1778Schristos exit ;; 106630da1778Schristos i*86:DYNIX/ptx:4*:*) 106730da1778Schristos # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 106830da1778Schristos # earlier versions are messed up and put the nodename in both 106930da1778Schristos # sysname and nodename. 107030da1778Schristos echo i386-sequent-sysv4 107130da1778Schristos exit ;; 107230da1778Schristos i*86:UNIX_SV:4.2MP:2.*) 107330da1778Schristos # Unixware is an offshoot of SVR4, but it has its own version 107430da1778Schristos # number series starting with 2... 107530da1778Schristos # I am not positive that other SVR4 systems won't match this, 107630da1778Schristos # I just have to hope. -- rms. 107730da1778Schristos # Use sysv4.2uw... so that sysv4* matches it. 107830da1778Schristos echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 107930da1778Schristos exit ;; 108030da1778Schristos i*86:OS/2:*:*) 108130da1778Schristos # If we were able to find `uname', then EMX Unix compatibility 108230da1778Schristos # is probably installed. 108330da1778Schristos echo ${UNAME_MACHINE}-pc-os2-emx 108430da1778Schristos exit ;; 108530da1778Schristos i*86:XTS-300:*:STOP) 108630da1778Schristos echo ${UNAME_MACHINE}-unknown-stop 108730da1778Schristos exit ;; 108830da1778Schristos i*86:atheos:*:*) 108930da1778Schristos echo ${UNAME_MACHINE}-unknown-atheos 109030da1778Schristos exit ;; 109130da1778Schristos i*86:syllable:*:*) 109230da1778Schristos echo ${UNAME_MACHINE}-pc-syllable 109330da1778Schristos exit ;; 109430da1778Schristos i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 109530da1778Schristos echo i386-unknown-lynxos${UNAME_RELEASE} 109630da1778Schristos exit ;; 109730da1778Schristos i*86:*DOS:*:*) 109830da1778Schristos echo ${UNAME_MACHINE}-pc-msdosdjgpp 109930da1778Schristos exit ;; 110030da1778Schristos i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 110130da1778Schristos UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 110230da1778Schristos if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 110330da1778Schristos echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 110430da1778Schristos else 110530da1778Schristos echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 110630da1778Schristos fi 110730da1778Schristos exit ;; 110830da1778Schristos i*86:*:5:[678]*) 110930da1778Schristos # UnixWare 7.x, OpenUNIX and OpenServer 6. 111030da1778Schristos case `/bin/uname -X | grep "^Machine"` in 111130da1778Schristos *486*) UNAME_MACHINE=i486 ;; 111230da1778Schristos *Pentium) UNAME_MACHINE=i586 ;; 111330da1778Schristos *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 111430da1778Schristos esac 111530da1778Schristos echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 111630da1778Schristos exit ;; 111730da1778Schristos i*86:*:3.2:*) 111830da1778Schristos if test -f /usr/options/cb.name; then 111930da1778Schristos UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 112030da1778Schristos echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 112130da1778Schristos elif /bin/uname -X 2>/dev/null >/dev/null ; then 112230da1778Schristos UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 112330da1778Schristos (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 112430da1778Schristos (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 112530da1778Schristos && UNAME_MACHINE=i586 112630da1778Schristos (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 112730da1778Schristos && UNAME_MACHINE=i686 112830da1778Schristos (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 112930da1778Schristos && UNAME_MACHINE=i686 113030da1778Schristos echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 113130da1778Schristos else 113230da1778Schristos echo ${UNAME_MACHINE}-pc-sysv32 113330da1778Schristos fi 113430da1778Schristos exit ;; 113530da1778Schristos pc:*:*:*) 113630da1778Schristos # Left here for compatibility: 113730da1778Schristos # uname -m prints for DJGPP always 'pc', but it prints nothing about 113830da1778Schristos # the processor, so we play safe by assuming i586. 113930da1778Schristos # Note: whatever this is, it MUST be the same as what config.sub 1140cc576e1dSsevan # prints for the "djgpp" host, or else GDB configure will decide that 114130da1778Schristos # this is a cross-build. 114230da1778Schristos echo i586-pc-msdosdjgpp 114330da1778Schristos exit ;; 114430da1778Schristos Intel:Mach:3*:*) 114530da1778Schristos echo i386-pc-mach3 114630da1778Schristos exit ;; 114730da1778Schristos paragon:*:*:*) 114830da1778Schristos echo i860-intel-osf1 114930da1778Schristos exit ;; 115030da1778Schristos i860:*:4.*:*) # i860-SVR4 115130da1778Schristos if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 115230da1778Schristos echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 115330da1778Schristos else # Add other i860-SVR4 vendors below as they are discovered. 115430da1778Schristos echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 115530da1778Schristos fi 115630da1778Schristos exit ;; 115730da1778Schristos mini*:CTIX:SYS*5:*) 115830da1778Schristos # "miniframe" 115930da1778Schristos echo m68010-convergent-sysv 116030da1778Schristos exit ;; 116130da1778Schristos mc68k:UNIX:SYSTEM5:3.51m) 116230da1778Schristos echo m68k-convergent-sysv 116330da1778Schristos exit ;; 116430da1778Schristos M680?0:D-NIX:5.3:*) 116530da1778Schristos echo m68k-diab-dnix 116630da1778Schristos exit ;; 116730da1778Schristos M68*:*:R3V[5678]*:*) 116830da1778Schristos test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 116930da1778Schristos 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) 117030da1778Schristos OS_REL='' 117130da1778Schristos test -r /etc/.relid \ 117230da1778Schristos && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 117330da1778Schristos /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 117430da1778Schristos && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 117530da1778Schristos /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 117630da1778Schristos && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 117730da1778Schristos 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 117830da1778Schristos /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 117930da1778Schristos && { echo i486-ncr-sysv4; exit; } ;; 118030da1778Schristos NCR*:*:4.2:* | MPRAS*:*:4.2:*) 118130da1778Schristos OS_REL='.3' 118230da1778Schristos test -r /etc/.relid \ 118330da1778Schristos && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 118430da1778Schristos /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 118530da1778Schristos && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 118630da1778Schristos /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 118730da1778Schristos && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 118830da1778Schristos /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 118930da1778Schristos && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 119030da1778Schristos m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 119130da1778Schristos echo m68k-unknown-lynxos${UNAME_RELEASE} 119230da1778Schristos exit ;; 119330da1778Schristos mc68030:UNIX_System_V:4.*:*) 119430da1778Schristos echo m68k-atari-sysv4 119530da1778Schristos exit ;; 119630da1778Schristos TSUNAMI:LynxOS:2.*:*) 119730da1778Schristos echo sparc-unknown-lynxos${UNAME_RELEASE} 119830da1778Schristos exit ;; 119930da1778Schristos rs6000:LynxOS:2.*:*) 120030da1778Schristos echo rs6000-unknown-lynxos${UNAME_RELEASE} 120130da1778Schristos exit ;; 120230da1778Schristos PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 120330da1778Schristos echo powerpc-unknown-lynxos${UNAME_RELEASE} 120430da1778Schristos exit ;; 120530da1778Schristos SM[BE]S:UNIX_SV:*:*) 120630da1778Schristos echo mips-dde-sysv${UNAME_RELEASE} 120730da1778Schristos exit ;; 120830da1778Schristos RM*:ReliantUNIX-*:*:*) 120930da1778Schristos echo mips-sni-sysv4 121030da1778Schristos exit ;; 121130da1778Schristos RM*:SINIX-*:*:*) 121230da1778Schristos echo mips-sni-sysv4 121330da1778Schristos exit ;; 121430da1778Schristos *:SINIX-*:*:*) 121530da1778Schristos if uname -p 2>/dev/null >/dev/null ; then 121630da1778Schristos UNAME_MACHINE=`(uname -p) 2>/dev/null` 121730da1778Schristos echo ${UNAME_MACHINE}-sni-sysv4 121830da1778Schristos else 121930da1778Schristos echo ns32k-sni-sysv 122030da1778Schristos fi 122130da1778Schristos exit ;; 122230da1778Schristos PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 122330da1778Schristos # says <Richard.M.Bartel@ccMail.Census.GOV> 122430da1778Schristos echo i586-unisys-sysv4 122530da1778Schristos exit ;; 122630da1778Schristos *:UNIX_System_V:4*:FTX*) 122730da1778Schristos # From Gerald Hewes <hewes@openmarket.com>. 122830da1778Schristos # How about differentiating between stratus architectures? -djm 122930da1778Schristos echo hppa1.1-stratus-sysv4 123030da1778Schristos exit ;; 123130da1778Schristos *:*:*:FTX*) 123230da1778Schristos # From seanf@swdc.stratus.com. 123330da1778Schristos echo i860-stratus-sysv4 123430da1778Schristos exit ;; 123530da1778Schristos i*86:VOS:*:*) 123630da1778Schristos # From Paul.Green@stratus.com. 123730da1778Schristos echo ${UNAME_MACHINE}-stratus-vos 123830da1778Schristos exit ;; 123930da1778Schristos *:VOS:*:*) 124030da1778Schristos # From Paul.Green@stratus.com. 124130da1778Schristos echo hppa1.1-stratus-vos 124230da1778Schristos exit ;; 124330da1778Schristos mc68*:A/UX:*:*) 124430da1778Schristos echo m68k-apple-aux${UNAME_RELEASE} 124530da1778Schristos exit ;; 124630da1778Schristos news*:NEWS-OS:6*:*) 124730da1778Schristos echo mips-sony-newsos6 124830da1778Schristos exit ;; 124930da1778Schristos R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 125030da1778Schristos if [ -d /usr/nec ]; then 125130da1778Schristos echo mips-nec-sysv${UNAME_RELEASE} 125230da1778Schristos else 125330da1778Schristos echo mips-unknown-sysv${UNAME_RELEASE} 125430da1778Schristos fi 125530da1778Schristos exit ;; 125630da1778Schristos BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 125730da1778Schristos echo powerpc-be-beos 125830da1778Schristos exit ;; 125930da1778Schristos BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 126030da1778Schristos echo powerpc-apple-beos 126130da1778Schristos exit ;; 126230da1778Schristos BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 126330da1778Schristos echo i586-pc-beos 126430da1778Schristos exit ;; 126530da1778Schristos BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 126630da1778Schristos echo i586-pc-haiku 126730da1778Schristos exit ;; 126830da1778Schristos x86_64:Haiku:*:*) 126930da1778Schristos echo x86_64-unknown-haiku 127030da1778Schristos exit ;; 127130da1778Schristos SX-4:SUPER-UX:*:*) 127230da1778Schristos echo sx4-nec-superux${UNAME_RELEASE} 127330da1778Schristos exit ;; 127430da1778Schristos SX-5:SUPER-UX:*:*) 127530da1778Schristos echo sx5-nec-superux${UNAME_RELEASE} 127630da1778Schristos exit ;; 127730da1778Schristos SX-6:SUPER-UX:*:*) 127830da1778Schristos echo sx6-nec-superux${UNAME_RELEASE} 127930da1778Schristos exit ;; 128030da1778Schristos SX-7:SUPER-UX:*:*) 128130da1778Schristos echo sx7-nec-superux${UNAME_RELEASE} 128230da1778Schristos exit ;; 128330da1778Schristos SX-8:SUPER-UX:*:*) 128430da1778Schristos echo sx8-nec-superux${UNAME_RELEASE} 128530da1778Schristos exit ;; 128630da1778Schristos SX-8R:SUPER-UX:*:*) 128730da1778Schristos echo sx8r-nec-superux${UNAME_RELEASE} 128830da1778Schristos exit ;; 1289cc576e1dSsevan SX-ACE:SUPER-UX:*:*) 1290cc576e1dSsevan echo sxace-nec-superux${UNAME_RELEASE} 1291cc576e1dSsevan exit ;; 129230da1778Schristos Power*:Rhapsody:*:*) 129330da1778Schristos echo powerpc-apple-rhapsody${UNAME_RELEASE} 129430da1778Schristos exit ;; 129530da1778Schristos *:Rhapsody:*:*) 129630da1778Schristos echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 129730da1778Schristos exit ;; 129830da1778Schristos *:Darwin:*:*) 129930da1778Schristos UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 130030da1778Schristos eval $set_cc_for_build 130130da1778Schristos if test "$UNAME_PROCESSOR" = unknown ; then 130230da1778Schristos UNAME_PROCESSOR=powerpc 130330da1778Schristos fi 130430da1778Schristos if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then 1305cc576e1dSsevan if [ "$CC_FOR_BUILD" != no_compiler_found ]; then 130630da1778Schristos if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1307cc576e1dSsevan (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ 130830da1778Schristos grep IS_64BIT_ARCH >/dev/null 130930da1778Schristos then 131030da1778Schristos case $UNAME_PROCESSOR in 131130da1778Schristos i386) UNAME_PROCESSOR=x86_64 ;; 131230da1778Schristos powerpc) UNAME_PROCESSOR=powerpc64 ;; 131330da1778Schristos esac 131430da1778Schristos fi 131530da1778Schristos fi 131630da1778Schristos elif test "$UNAME_PROCESSOR" = i386 ; then 131730da1778Schristos # Avoid executing cc on OS X 10.9, as it ships with a stub 131830da1778Schristos # that puts up a graphical alert prompting to install 131930da1778Schristos # developer tools. Any system running Mac OS X 10.7 or 132030da1778Schristos # later (Darwin 11 and later) is required to have a 64-bit 132130da1778Schristos # processor. This is not true of the ARM version of Darwin 132230da1778Schristos # that Apple uses in portable devices. 132330da1778Schristos UNAME_PROCESSOR=x86_64 132430da1778Schristos fi 132530da1778Schristos echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 132630da1778Schristos exit ;; 132730da1778Schristos *:procnto*:*:* | *:QNX:[0123456789]*:*) 132830da1778Schristos UNAME_PROCESSOR=`uname -p` 1329cc576e1dSsevan if test "$UNAME_PROCESSOR" = x86; then 133030da1778Schristos UNAME_PROCESSOR=i386 133130da1778Schristos UNAME_MACHINE=pc 133230da1778Schristos fi 133330da1778Schristos echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 133430da1778Schristos exit ;; 133530da1778Schristos *:QNX:*:4*) 133630da1778Schristos echo i386-pc-qnx 133730da1778Schristos exit ;; 133830da1778Schristos NEO-?:NONSTOP_KERNEL:*:*) 133930da1778Schristos echo neo-tandem-nsk${UNAME_RELEASE} 134030da1778Schristos exit ;; 134130da1778Schristos NSE-*:NONSTOP_KERNEL:*:*) 134230da1778Schristos echo nse-tandem-nsk${UNAME_RELEASE} 134330da1778Schristos exit ;; 134430da1778Schristos NSR-?:NONSTOP_KERNEL:*:*) 134530da1778Schristos echo nsr-tandem-nsk${UNAME_RELEASE} 134630da1778Schristos exit ;; 134730da1778Schristos *:NonStop-UX:*:*) 134830da1778Schristos echo mips-compaq-nonstopux 134930da1778Schristos exit ;; 135030da1778Schristos BS2000:POSIX*:*:*) 135130da1778Schristos echo bs2000-siemens-sysv 135230da1778Schristos exit ;; 135330da1778Schristos DS/*:UNIX_System_V:*:*) 135430da1778Schristos echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 135530da1778Schristos exit ;; 135630da1778Schristos *:Plan9:*:*) 135730da1778Schristos # "uname -m" is not consistent, so use $cputype instead. 386 135830da1778Schristos # is converted to i386 for consistency with other x86 135930da1778Schristos # operating systems. 1360cc576e1dSsevan if test "$cputype" = 386; then 136130da1778Schristos UNAME_MACHINE=i386 136230da1778Schristos else 136330da1778Schristos UNAME_MACHINE="$cputype" 136430da1778Schristos fi 136530da1778Schristos echo ${UNAME_MACHINE}-unknown-plan9 136630da1778Schristos exit ;; 136730da1778Schristos *:TOPS-10:*:*) 136830da1778Schristos echo pdp10-unknown-tops10 136930da1778Schristos exit ;; 137030da1778Schristos *:TENEX:*:*) 137130da1778Schristos echo pdp10-unknown-tenex 137230da1778Schristos exit ;; 137330da1778Schristos KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 137430da1778Schristos echo pdp10-dec-tops20 137530da1778Schristos exit ;; 137630da1778Schristos XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 137730da1778Schristos echo pdp10-xkl-tops20 137830da1778Schristos exit ;; 137930da1778Schristos *:TOPS-20:*:*) 138030da1778Schristos echo pdp10-unknown-tops20 138130da1778Schristos exit ;; 138230da1778Schristos *:ITS:*:*) 138330da1778Schristos echo pdp10-unknown-its 138430da1778Schristos exit ;; 138530da1778Schristos SEI:*:*:SEIUX) 138630da1778Schristos echo mips-sei-seiux${UNAME_RELEASE} 138730da1778Schristos exit ;; 138830da1778Schristos *:DragonFly:*:*) 138930da1778Schristos echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 139030da1778Schristos exit ;; 139130da1778Schristos *:*VMS:*:*) 139230da1778Schristos UNAME_MACHINE=`(uname -p) 2>/dev/null` 139330da1778Schristos case "${UNAME_MACHINE}" in 139430da1778Schristos A*) echo alpha-dec-vms ; exit ;; 139530da1778Schristos I*) echo ia64-dec-vms ; exit ;; 139630da1778Schristos V*) echo vax-dec-vms ; exit ;; 139730da1778Schristos esac ;; 139830da1778Schristos *:XENIX:*:SysV) 139930da1778Schristos echo i386-pc-xenix 140030da1778Schristos exit ;; 140130da1778Schristos i*86:skyos:*:*) 1402cc576e1dSsevan echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` 140330da1778Schristos exit ;; 140430da1778Schristos i*86:rdos:*:*) 140530da1778Schristos echo ${UNAME_MACHINE}-pc-rdos 140630da1778Schristos exit ;; 140730da1778Schristos i*86:AROS:*:*) 140830da1778Schristos echo ${UNAME_MACHINE}-pc-aros 140930da1778Schristos exit ;; 141030da1778Schristos x86_64:VMkernel:*:*) 141130da1778Schristos echo ${UNAME_MACHINE}-unknown-esx 141230da1778Schristos exit ;; 1413cc576e1dSsevan amd64:Isilon\ OneFS:*:*) 1414cc576e1dSsevan echo x86_64-unknown-onefs 1415cc576e1dSsevan exit ;; 141630da1778Schristosesac 141730da1778Schristos 141830da1778Schristoscat >&2 <<EOF 141930da1778Schristos$0: unable to guess system type 142030da1778Schristos 1421cc576e1dSsevanThis script (version $timestamp), has failed to recognize the 1422cc576e1dSsevanoperating system you are using. If your script is old, overwrite 1423cc576e1dSsevanconfig.guess and config.sub with the latest versions from: 142430da1778Schristos 1425cc576e1dSsevan http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess 142630da1778Schristosand 1427cc576e1dSsevan http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub 142830da1778Schristos 1429cc576e1dSsevanIf $0 has already been updated, send the following data and any 1430cc576e1dSsevaninformation you think might be pertinent to config-patches@gnu.org to 1431cc576e1dSsevanprovide the necessary information to handle your system. 143230da1778Schristos 143330da1778Schristosconfig.guess timestamp = $timestamp 143430da1778Schristos 143530da1778Schristosuname -m = `(uname -m) 2>/dev/null || echo unknown` 143630da1778Schristosuname -r = `(uname -r) 2>/dev/null || echo unknown` 143730da1778Schristosuname -s = `(uname -s) 2>/dev/null || echo unknown` 143830da1778Schristosuname -v = `(uname -v) 2>/dev/null || echo unknown` 143930da1778Schristos 144030da1778Schristos/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 144130da1778Schristos/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 144230da1778Schristos 144330da1778Schristoshostinfo = `(hostinfo) 2>/dev/null` 144430da1778Schristos/bin/universe = `(/bin/universe) 2>/dev/null` 144530da1778Schristos/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 144630da1778Schristos/bin/arch = `(/bin/arch) 2>/dev/null` 144730da1778Schristos/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 144830da1778Schristos/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 144930da1778Schristos 145030da1778SchristosUNAME_MACHINE = ${UNAME_MACHINE} 145130da1778SchristosUNAME_RELEASE = ${UNAME_RELEASE} 145230da1778SchristosUNAME_SYSTEM = ${UNAME_SYSTEM} 145330da1778SchristosUNAME_VERSION = ${UNAME_VERSION} 145430da1778SchristosEOF 145530da1778Schristos 145630da1778Schristosexit 1 145730da1778Schristos 145830da1778Schristos# Local variables: 145930da1778Schristos# eval: (add-hook 'write-file-hooks 'time-stamp) 146030da1778Schristos# time-stamp-start: "timestamp='" 146130da1778Schristos# time-stamp-format: "%:y-%02m-%02d" 146230da1778Schristos# time-stamp-end: "'" 146330da1778Schristos# End: 1464