config.guess revision 92828
137535Sdes#! /bin/sh 263012Sdes# Attempt to guess a canonical system name. 337535Sdes# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 437535Sdes# 2000, 2001, 2002 Free Software Foundation, Inc. 537535Sdes 637535Sdestimestamp='2002-02-19' 737535Sdes 837535Sdes# This file is free software; you can redistribute it and/or modify it 937535Sdes# under the terms of the GNU General Public License as published by 1037535Sdes# the Free Software Foundation; either version 2 of the License, or 1137535Sdes# (at your option) any later version. 1237535Sdes# 1337535Sdes# This program is distributed in the hope that it will be useful, but 1437535Sdes# WITHOUT ANY WARRANTY; without even the implied warranty of 1563012Sdes# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1637535Sdes# General Public License for more details. 1737535Sdes# 1837535Sdes# You should have received a copy of the GNU General Public License 1937535Sdes# along with this program; if not, write to the Free Software 2037535Sdes# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 2137535Sdes# 2237535Sdes# As a special exception to the GNU General Public License, if you 2337535Sdes# distribute this file as part of a program that contains a 2437535Sdes# configuration script generated by Autoconf, you may include it under 2537535Sdes# the same distribution terms that you use for the rest of that program. 2637535Sdes 2737535Sdes# Originally written by Per Bothner <per@bothner.com>. 2863012Sdes# Please send patches to <config-patches@gnu.org>. Submit a context 2937535Sdes# diff and a properly formatted ChangeLog entry. 3037535Sdes# 3163236Sdes# This script attempts to guess a canonical system name similar to 3263236Sdes# config.sub. If it succeeds, it prints the system name on stdout, and 3363236Sdes# exits with 0. Otherwise, it exits with 1. 3463236Sdes# 3563236Sdes# The plan is that this can be called by configure scripts if you 3663236Sdes# don't specify an explicit build system type. 3763236Sdes 3863236Sdesme=`echo "$0" | sed -e 's,.*/,,'` 3963236Sdes 4063236Sdesusage="\ 4163236SdesUsage: $0 [OPTION] 4263236Sdes 4363236SdesOutput the configuration name of the system \`$me' is run on. 4463236Sdes 4563236SdesOperation modes: 4663236Sdes -h, --help print this help, then exit 4763236Sdes -t, --time-stamp print date of last modification, then exit 4863236Sdes -v, --version print version number, then exit 4963236Sdes 5063236SdesReport bugs and patches to <config-patches@gnu.org>." 5163236Sdes 5263236Sdesversion="\ 5363236SdesGNU config.guess ($timestamp) 5463236Sdes 5563236SdesOriginally written by Per Bothner. 5663236SdesCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 5763236SdesFree Software Foundation, Inc. 5863236Sdes 5963236SdesThis is free software; see the source for copying conditions. There is NO 6063236Sdeswarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6163236Sdes 6263236Sdeshelp=" 6337535SdesTry \`$me --help' for more information." 6460737Sume 6537535Sdes# Parse command line 6663012Sdeswhile test $# -gt 0 ; do 6737535Sdes case $1 in 6863012Sdes --time-stamp | --time* | -t ) 6960376Sdes echo "$timestamp" ; exit 0 ;; 7060189Sdes --version | -v ) 7137608Sdes echo "$version" ; exit 0 ;; 7237535Sdes --help | --h* | -h ) 7337535Sdes echo "$usage"; exit 0 ;; 7437535Sdes -- ) # Stop option processing 7560376Sdes shift; break ;; 7637535Sdes - ) # Use stdin as input. 7737535Sdes break ;; 7837535Sdes -* ) 7940939Sdes echo "$me: invalid option $1$help" >&2 8041862Sdes exit 1 ;; 8137535Sdes * ) 8263012Sdes break ;; 8337535Sdes esac 8463012Sdesdone 8563012Sdes 8637535Sdesif test $# != 0; then 8763012Sdes echo "$me: too many arguments$help" >&2 8863012Sdes exit 1 8963012Sdesfi 9063012Sdes 9163012Sdes 9263012Sdesdummy=dummy-$$ 9363012Sdestrap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 9463012Sdes 9563012Sdes# CC_FOR_BUILD -- compiler used by this script. 9660196Sdes# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 9763012Sdes# use `HOST_CC' if defined, but it is deprecated. 9863012Sdes 9963012Sdesset_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in 10063012Sdes ,,) echo "int dummy(){}" > $dummy.c ; 10163012Sdes for c in cc gcc c89 ; do 10263012Sdes ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; 10363012Sdes if test $? = 0 ; then 10463012Sdes CC_FOR_BUILD="$c"; break ; 10563012Sdes fi ; 10663012Sdes done ; 10737535Sdes rm -f $dummy.c $dummy.o $dummy.rel ; 10837535Sdes if test x"$CC_FOR_BUILD" = x ; then 10963012Sdes CC_FOR_BUILD=no_compiler_found ; 11063012Sdes fi 11163012Sdes ;; 11263012Sdes ,,*) CC_FOR_BUILD=$CC ;; 11363012Sdes ,*,*) CC_FOR_BUILD=$HOST_CC ;; 11463012Sdesesac' 11563012Sdes 11663012Sdes# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 11763281Sdes# (ghazi@noc.rutgers.edu 1994-08-24) 11863012Sdesif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 11963012Sdes PATH=$PATH:/.attbin ; export PATH 12037535Sdesfi 12137535Sdes 12237608SdesUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 12363012SdesUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 12437608SdesUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 12537608SdesUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 12663012Sdes 12737608Sdes# Note: order is significant - the case branches are not exclusive. 12863012Sdes 12937608Sdescase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 13063012Sdes *:NetBSD:*:*) 13163012Sdes # NetBSD (nbsd) targets should (where applicable) match one or 13263012Sdes # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 13363012Sdes # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 13463012Sdes # switched to ELF, *-*-netbsd* would select the old 13563012Sdes # object file format. This provides both forward 13663012Sdes # compatibility and a consistent mechanism for selecting the 13763012Sdes # object file format. 13863012Sdes # 13963012Sdes # Note: NetBSD doesn't particularly care about the vendor 14063012Sdes # portion of the name. We always set it to "unknown". 14163012Sdes UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \ 14263012Sdes UNAME_MACHINE_ARCH=unknown 14363012Sdes case "${UNAME_MACHINE_ARCH}" in 14463281Sdes arm*) machine=arm-unknown ;; 14563012Sdes sh3el) machine=shl-unknown ;; 14663012Sdes sh3eb) machine=sh-unknown ;; 14763012Sdes *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 14863012Sdes esac 14963012Sdes # The Operating System including object format, if it has switched 15063012Sdes # to ELF recently, or will in the future. 15163012Sdes case "${UNAME_MACHINE_ARCH}" in 15263012Sdes arm*|i386|m68k|ns32k|sh3*|sparc|vax) 15363012Sdes eval $set_cc_for_build 15463012Sdes if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 15537608Sdes | grep __ELF__ >/dev/null 15637608Sdes then 15737608Sdes # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 15837608Sdes # Return netbsd for either. FIX? 15937608Sdes os=netbsd 16063012Sdes else 16137535Sdes os=netbsdelf 16237535Sdes fi 16363012Sdes ;; 16463012Sdes *) 16537535Sdes os=netbsd 16663012Sdes ;; 16763012Sdes esac 16863012Sdes # The OS release 16963012Sdes release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 17063012Sdes # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 17163012Sdes # contains redundant information, the shorter form: 17263012Sdes # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 17363012Sdes echo "${machine}-${os}${release}" 17463012Sdes exit 0 ;; 17563012Sdes amiga:OpenBSD:*:*) 17637535Sdes echo m68k-unknown-openbsd${UNAME_RELEASE} 17737535Sdes exit 0 ;; 17863012Sdes arc:OpenBSD:*:*) 17963012Sdes echo mipsel-unknown-openbsd${UNAME_RELEASE} 18063012Sdes exit 0 ;; 18163012Sdes hp300:OpenBSD:*:*) 18263012Sdes echo m68k-unknown-openbsd${UNAME_RELEASE} 18363012Sdes exit 0 ;; 18463012Sdes mac68k:OpenBSD:*:*) 18563012Sdes echo m68k-unknown-openbsd${UNAME_RELEASE} 18663012Sdes exit 0 ;; 18763012Sdes macppc:OpenBSD:*:*) 18863012Sdes echo powerpc-unknown-openbsd${UNAME_RELEASE} 18963012Sdes exit 0 ;; 19063012Sdes mvme68k:OpenBSD:*:*) 19163012Sdes echo m68k-unknown-openbsd${UNAME_RELEASE} 19263012Sdes exit 0 ;; 19363012Sdes mvme88k:OpenBSD:*:*) 19463012Sdes echo m88k-unknown-openbsd${UNAME_RELEASE} 19563012Sdes exit 0 ;; 19663012Sdes mvmeppc:OpenBSD:*:*) 19763012Sdes echo powerpc-unknown-openbsd${UNAME_RELEASE} 19863012Sdes exit 0 ;; 19963012Sdes pmax:OpenBSD:*:*) 20037535Sdes echo mipsel-unknown-openbsd${UNAME_RELEASE} 20137535Sdes exit 0 ;; 20237608Sdes sgi:OpenBSD:*:*) 20337608Sdes echo mipseb-unknown-openbsd${UNAME_RELEASE} 20437608Sdes exit 0 ;; 20537535Sdes sun3:OpenBSD:*:*) 20663012Sdes echo m68k-unknown-openbsd${UNAME_RELEASE} 20737535Sdes exit 0 ;; 20863012Sdes wgrisc:OpenBSD:*:*) 20963012Sdes echo mipsel-unknown-openbsd${UNAME_RELEASE} 21063012Sdes exit 0 ;; 21163012Sdes *:OpenBSD:*:*) 21263012Sdes echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} 21363012Sdes exit 0 ;; 21463012Sdes alpha:OSF1:*:*) 21563012Sdes if test $UNAME_RELEASE = "V4.0"; then 21663012Sdes UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 21737535Sdes fi 21863012Sdes # A Vn.n version is a released version. 21963012Sdes # A Tn.n version is a released field test version. 22037535Sdes # A Xn.n version is an unreleased experimental baselevel. 22163012Sdes # 1.2 uses "1.2" for uname -r. 22263012Sdes cat <<EOF >$dummy.s 22363012Sdes .data 22463012Sdes\$Lformat: 22563012Sdes .byte 37,100,45,37,120,10,0 # "%d-%x\n" 22663012Sdes 22737535Sdes .text 22863012Sdes .globl main 22937535Sdes .align 4 23063012Sdes .ent main 23137535Sdesmain: 23237535Sdes .frame \$30,16,\$26,0 23337608Sdes ldgp \$29,0(\$27) 23437608Sdes .prologue 1 23537608Sdes .long 0x47e03d80 # implver \$0 23637535Sdes lda \$2,-1 23763012Sdes .long 0x47e20c21 # amask \$2,\$1 23837535Sdes lda \$16,\$Lformat 23963012Sdes mov \$0,\$17 24063012Sdes not \$1,\$18 24163012Sdes jsr \$26,printf 24237535Sdes ldgp \$29,0(\$26) 24337535Sdes mov 0,\$16 24437608Sdes jsr \$26,exit 24537608Sdes .end main 24637608SdesEOF 24737535Sdes eval $set_cc_for_build 24863012Sdes $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null 24937535Sdes if test "$?" = 0 ; then 25063012Sdes case `./$dummy` in 25163012Sdes 0-0) 25263012Sdes UNAME_MACHINE="alpha" 25363012Sdes ;; 25463012Sdes 1-0) 25563012Sdes UNAME_MACHINE="alphaev5" 25637535Sdes ;; 25763012Sdes 1-1) 25837535Sdes UNAME_MACHINE="alphaev56" 25937535Sdes ;; 26037608Sdes 1-101) 26163012Sdes UNAME_MACHINE="alphapca56" 26237608Sdes ;; 26363012Sdes 2-303) 26463012Sdes UNAME_MACHINE="alphaev6" 26537535Sdes ;; 26663012Sdes 2-307) 26763012Sdes UNAME_MACHINE="alphaev67" 26863012Sdes ;; 26963012Sdes 2-1307) 27063012Sdes UNAME_MACHINE="alphaev68" 27163012Sdes ;; 27263012Sdes esac 27363012Sdes fi 27463012Sdes rm -f $dummy.s $dummy 27563012Sdes echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 27663012Sdes exit 0 ;; 27763012Sdes Alpha\ *:Windows_NT*:*) 27863012Sdes # How do we know it's Interix rather than the generic POSIX subsystem? 27963012Sdes # Should we change UNAME_MACHINE based on the output of uname instead 28063012Sdes # of the specific Alpha model? 28163012Sdes echo alpha-pc-interix 28263012Sdes exit 0 ;; 28363012Sdes 21064:Windows_NT:50:3) 28463012Sdes echo alpha-dec-winnt3.5 28563012Sdes exit 0 ;; 28663012Sdes Amiga*:UNIX_System_V:4.0:*) 28763012Sdes echo m68k-unknown-sysv4 28863012Sdes exit 0;; 28963012Sdes *:[Aa]miga[Oo][Ss]:*:*) 29063012Sdes echo ${UNAME_MACHINE}-unknown-amigaos 29163012Sdes exit 0 ;; 29263012Sdes *:[Mm]orph[Oo][Ss]:*:*) 29363012Sdes echo ${UNAME_MACHINE}-unknown-morphos 29463012Sdes exit 0 ;; 29563012Sdes *:OS/390:*:*) 29663012Sdes echo i370-ibm-openedition 29763012Sdes exit 0 ;; 29863012Sdes arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 29963012Sdes echo arm-acorn-riscix${UNAME_RELEASE} 30063012Sdes exit 0;; 30163012Sdes SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 30263012Sdes echo hppa1.1-hitachi-hiuxmpp 30363012Sdes exit 0;; 30463012Sdes Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 30563012Sdes # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 30663012Sdes if test "`(/bin/universe) 2>/dev/null`" = att ; then 30763012Sdes echo pyramid-pyramid-sysv3 30863012Sdes else 30963012Sdes echo pyramid-pyramid-bsd 31063012Sdes fi 31163012Sdes exit 0 ;; 31263012Sdes NILE*:*:*:dcosx) 31363012Sdes echo pyramid-pyramid-svr4 31463012Sdes exit 0 ;; 31563012Sdes sun4H:SunOS:5.*:*) 31663012Sdes echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 31763012Sdes exit 0 ;; 31863012Sdes sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 31963012Sdes echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 32063012Sdes exit 0 ;; 32163012Sdes i86pc:SunOS:5.*:*) 32263012Sdes echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 32363012Sdes exit 0 ;; 32463012Sdes sun4*:SunOS:6*:*) 32563012Sdes # According to config.sub, this is the proper way to canonicalize 32663012Sdes # SunOS6. Hard to guess exactly what SunOS6 will be like, but 32763012Sdes # it's likely to be more like Solaris than SunOS4. 32863012Sdes echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 32963012Sdes exit 0 ;; 33063012Sdes sun4*:SunOS:*:*) 33163012Sdes case "`/usr/bin/arch -k`" in 33263012Sdes Series*|S4*) 33363012Sdes UNAME_RELEASE=`uname -v` 33463012Sdes ;; 33563012Sdes esac 33663012Sdes # Japanese Language versions have a version number like `4.1.3-JL'. 33763012Sdes echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 33863012Sdes exit 0 ;; 33963012Sdes sun3*:SunOS:*:*) 34063012Sdes echo m68k-sun-sunos${UNAME_RELEASE} 34163012Sdes exit 0 ;; 34263012Sdes sun*:*:4.2BSD:*) 34363012Sdes UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 34463012Sdes test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 34563012Sdes case "`/bin/arch`" in 34663012Sdes sun3) 34763012Sdes echo m68k-sun-sunos${UNAME_RELEASE} 34863012Sdes ;; 34963012Sdes sun4) 35063012Sdes echo sparc-sun-sunos${UNAME_RELEASE} 35163012Sdes ;; 35263012Sdes esac 35363012Sdes exit 0 ;; 35463012Sdes aushp:SunOS:*:*) 35563012Sdes echo sparc-auspex-sunos${UNAME_RELEASE} 35663012Sdes exit 0 ;; 35737535Sdes # The situation for MiNT is a little confusing. The machine name 35863012Sdes # can be virtually everything (everything which is not 35963012Sdes # "atarist" or "atariste" at least should have a processor 36063012Sdes # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 36163012Sdes # to the lowercase version "mint" (or "freemint"). Finally 36263012Sdes # the system name "TOS" denotes a system which is actually not 36337535Sdes # MiNT. But MiNT is downward compatible to TOS, so this should 36463012Sdes # be no problem. 36563012Sdes atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 36663012Sdes echo m68k-atari-mint${UNAME_RELEASE} 36763012Sdes exit 0 ;; 36863012Sdes atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 36963012Sdes echo m68k-atari-mint${UNAME_RELEASE} 37063012Sdes exit 0 ;; 37163012Sdes *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 37263012Sdes echo m68k-atari-mint${UNAME_RELEASE} 37363012Sdes exit 0 ;; 37437535Sdes milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 37537535Sdes echo m68k-milan-mint${UNAME_RELEASE} 37637608Sdes exit 0 ;; 37763012Sdes hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 37863012Sdes echo m68k-hades-mint${UNAME_RELEASE} 37963012Sdes exit 0 ;; 38063012Sdes *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 38163012Sdes echo m68k-unknown-mint${UNAME_RELEASE} 38263012Sdes exit 0 ;; 38363012Sdes powerpc:machten:*:*) 38463012Sdes echo powerpc-apple-machten${UNAME_RELEASE} 38563012Sdes exit 0 ;; 38663012Sdes RISC*:Mach:*:*) 38763012Sdes echo mips-dec-mach_bsd4.3 38863012Sdes exit 0 ;; 38963012Sdes RISC*:ULTRIX:*:*) 39063012Sdes echo mips-dec-ultrix${UNAME_RELEASE} 39163012Sdes exit 0 ;; 39263012Sdes VAX*:ULTRIX*:*:*) 39363012Sdes echo vax-dec-ultrix${UNAME_RELEASE} 39463012Sdes exit 0 ;; 39563012Sdes 2020:CLIX:*:* | 2430:CLIX:*:*) 39663012Sdes echo clipper-intergraph-clix${UNAME_RELEASE} 39763012Sdes exit 0 ;; 39863012Sdes mips:*:*:UMIPS | mips:*:*:RISCos) 39963012Sdes eval $set_cc_for_build 40063012Sdes sed 's/^ //' << EOF >$dummy.c 40163012Sdes#ifdef __cplusplus 40263012Sdes#include <stdio.h> /* for printf() prototype */ 40363012Sdes int main (int argc, char *argv[]) { 40463012Sdes#else 40563012Sdes int main (argc, argv) int argc; char *argv[]; { 40663012Sdes#endif 40763012Sdes #if defined (host_mips) && defined (MIPSEB) 40863012Sdes #if defined (SYSTYPE_SYSV) 40963012Sdes printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 41063012Sdes #endif 41163012Sdes #if defined (SYSTYPE_SVR4) 41263012Sdes printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 41363012Sdes #endif 41463012Sdes #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 41563012Sdes printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 41663012Sdes #endif 41763012Sdes #endif 41863012Sdes exit (-1); 41963012Sdes } 42063012SdesEOF 42163012Sdes $CC_FOR_BUILD $dummy.c -o $dummy \ 42263012Sdes && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ 42363012Sdes && rm -f $dummy.c $dummy && exit 0 42463012Sdes rm -f $dummy.c $dummy 42563012Sdes echo mips-mips-riscos${UNAME_RELEASE} 42663012Sdes exit 0 ;; 42763012Sdes Motorola:PowerMAX_OS:*:*) 42863012Sdes echo powerpc-motorola-powermax 42963012Sdes exit 0 ;; 43063012Sdes Night_Hawk:Power_UNIX:*:*) 43163012Sdes echo powerpc-harris-powerunix 43263012Sdes exit 0 ;; 43363012Sdes m88k:CX/UX:7*:*) 43463012Sdes echo m88k-harris-cxux7 43563012Sdes exit 0 ;; 43663012Sdes m88k:*:4*:R4*) 43763012Sdes echo m88k-motorola-sysv4 43863012Sdes exit 0 ;; 43963012Sdes m88k:*:3*:R3*) 44063012Sdes echo m88k-motorola-sysv3 44163012Sdes exit 0 ;; 44263012Sdes AViiON:dgux:*:*) 44363012Sdes # DG/UX returns AViiON for all architectures 44463012Sdes UNAME_PROCESSOR=`/usr/bin/uname -p` 44563012Sdes if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 44663012Sdes then 44763012Sdes if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 44863012Sdes [ ${TARGET_BINARY_INTERFACE}x = x ] 44963012Sdes then 45063012Sdes echo m88k-dg-dgux${UNAME_RELEASE} 45163012Sdes else 45263012Sdes echo m88k-dg-dguxbcs${UNAME_RELEASE} 45363012Sdes fi 45463012Sdes else 45563012Sdes echo i586-dg-dgux${UNAME_RELEASE} 45663012Sdes fi 45763012Sdes exit 0 ;; 45863012Sdes M88*:DolphinOS:*:*) # DolphinOS (SVR3) 45963012Sdes echo m88k-dolphin-sysv3 46063012Sdes exit 0 ;; 46163012Sdes M88*:*:R3*:*) 46263012Sdes # Delta 88k system running SVR3 46363012Sdes echo m88k-motorola-sysv3 46463012Sdes exit 0 ;; 46563012Sdes XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 46663012Sdes echo m88k-tektronix-sysv3 46763012Sdes exit 0 ;; 46863012Sdes Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 46963012Sdes echo m68k-tektronix-bsd 47063012Sdes exit 0 ;; 47163012Sdes *:IRIX*:*:*) 47263012Sdes echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 47363012Sdes exit 0 ;; 47463012Sdes ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 47563012Sdes echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 47663012Sdes exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 47763012Sdes i*86:AIX:*:*) 47837608Sdes echo i386-ibm-aix 47937608Sdes exit 0 ;; 48062965Sdes ia64:AIX:*:*) 48162965Sdes if [ -x /usr/bin/oslevel ] ; then 48237608Sdes IBM_REV=`/usr/bin/oslevel` 48337608Sdes else 48437608Sdes IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 48537608Sdes fi 48637608Sdes echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 48762965Sdes exit 0 ;; 48862965Sdes *:AIX:2:3) 48962965Sdes if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 49062965Sdes eval $set_cc_for_build 49162965Sdes sed 's/^ //' << EOF >$dummy.c 49262965Sdes #include <sys/systemcfg.h> 49362965Sdes 49462965Sdes main() 49562965Sdes { 49637608Sdes if (!__power_pc()) 49737608Sdes exit(1); 49837608Sdes puts("powerpc-ibm-aix3.2.5"); 49937608Sdes exit(0); 50037608Sdes } 50137608SdesEOF 50237608Sdes $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 50337608Sdes rm -f $dummy.c $dummy 50437608Sdes echo rs6000-ibm-aix3.2.5 50537608Sdes elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 50637608Sdes echo rs6000-ibm-aix3.2.4 50737608Sdes else 50837608Sdes echo rs6000-ibm-aix3.2 50937608Sdes fi 51037608Sdes exit 0 ;; 51137608Sdes *:AIX:*:[45]) 51237608Sdes IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 51337608Sdes if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 51437608Sdes IBM_ARCH=rs6000 51537608Sdes else 51637608Sdes IBM_ARCH=powerpc 51737608Sdes fi 51837608Sdes if [ -x /usr/bin/oslevel ] ; then 51937608Sdes IBM_REV=`/usr/bin/oslevel` 52037608Sdes else 52137608Sdes IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 52237608Sdes fi 52337608Sdes echo ${IBM_ARCH}-ibm-aix${IBM_REV} 52437608Sdes exit 0 ;; 52537608Sdes *:AIX:*:*) 52637608Sdes echo rs6000-ibm-aix 52737608Sdes exit 0 ;; 52837608Sdes ibmrt:4.4BSD:*|romp-ibm:BSD:*) 52937608Sdes echo romp-ibm-bsd4.4 53062965Sdes exit 0 ;; 53137608Sdes ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 53237608Sdes echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 53337608Sdes exit 0 ;; # report: romp-ibm BSD 4.3 53437608Sdes *:BOSX:*:*) 53537608Sdes echo rs6000-bull-bosx 53662965Sdes exit 0 ;; 53763012Sdes DPX/2?00:B.O.S.:*:*) 53837608Sdes echo m68k-bull-sysv3 53962965Sdes exit 0 ;; 54062965Sdes 9000/[34]??:4.3bsd:1.*:*) 54137608Sdes echo m68k-hp-bsd 54262965Sdes exit 0 ;; 54362965Sdes hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 54462965Sdes echo m68k-hp-bsd4.4 54562965Sdes exit 0 ;; 54662965Sdes 9000/[34678]??:HP-UX:*:*) 54762965Sdes HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 54863012Sdes case "${UNAME_MACHINE}" in 54962965Sdes 9000/31? ) HP_ARCH=m68000 ;; 55062965Sdes 9000/[34]?? ) HP_ARCH=m68k ;; 55162965Sdes 9000/[678][0-9][0-9]) 55262965Sdes if [ -x /usr/bin/getconf ]; then 55362965Sdes sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 55462965Sdes sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 55562965Sdes case "${sc_cpu_version}" in 55662965Sdes 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 55763012Sdes 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 55862965Sdes 532) # CPU_PA_RISC2_0 55962965Sdes case "${sc_kernel_bits}" in 56062965Sdes 32) HP_ARCH="hppa2.0n" ;; 56162965Sdes 64) HP_ARCH="hppa2.0w" ;; 56262965Sdes '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 56362965Sdes esac ;; 56462965Sdes esac 56562965Sdes fi 56662965Sdes if [ "${HP_ARCH}" = "" ]; then 56762965Sdes eval $set_cc_for_build 56862965Sdes sed 's/^ //' << EOF >$dummy.c 56962965Sdes 57062965Sdes #define _HPUX_SOURCE 57162965Sdes #include <stdlib.h> 57262965Sdes #include <unistd.h> 57362965Sdes 57463012Sdes int main () 57562965Sdes { 57662965Sdes #if defined(_SC_KERNEL_BITS) 57762811Sdes long bits = sysconf(_SC_KERNEL_BITS); 57862965Sdes #endif 57937608Sdes long cpu = sysconf (_SC_CPU_VERSION); 58037608Sdes 58163012Sdes switch (cpu) 58263012Sdes { 58363012Sdes case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 58463012Sdes case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 58563012Sdes case CPU_PA_RISC2_0: 58637608Sdes #if defined(_SC_KERNEL_BITS) 58763012Sdes switch (bits) 58837608Sdes { 58963012Sdes case 64: puts ("hppa2.0w"); break; 59063012Sdes case 32: puts ("hppa2.0n"); break; 59137535Sdes default: puts ("hppa2.0"); break; 59263012Sdes } break; 59363012Sdes #else /* !defined(_SC_KERNEL_BITS) */ 59463012Sdes puts ("hppa2.0"); break; 59563012Sdes #endif 59663012Sdes default: puts ("hppa1.0"); break; 59760737Sume } 59863012Sdes exit (0); 59963012Sdes } 60063012SdesEOF 60163012Sdes (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` 60263012Sdes if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi 60363012Sdes rm -f $dummy.c $dummy 60463012Sdes fi ;; 60563012Sdes esac 60663012Sdes echo ${HP_ARCH}-hp-hpux${HPUX_REV} 60763012Sdes exit 0 ;; 60863012Sdes ia64:HP-UX:*:*) 60963012Sdes HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 61063012Sdes echo ia64-hp-hpux${HPUX_REV} 61163012Sdes exit 0 ;; 61263012Sdes 3050*:HI-UX:*:*) 61363012Sdes eval $set_cc_for_build 61463012Sdes sed 's/^ //' << EOF >$dummy.c 61563012Sdes #include <unistd.h> 61663012Sdes int 61763012Sdes main () 61863012Sdes { 61963012Sdes long cpu = sysconf (_SC_CPU_VERSION); 62063012Sdes /* The order matters, because CPU_IS_HP_MC68K erroneously returns 62163012Sdes true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 62263012Sdes results, however. */ 62363012Sdes if (CPU_IS_PA_RISC (cpu)) 62463012Sdes { 62563012Sdes switch (cpu) 62663012Sdes { 62763012Sdes case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 62863012Sdes case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 62963012Sdes case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 63063012Sdes default: puts ("hppa-hitachi-hiuxwe2"); break; 63163012Sdes } 63263012Sdes } 63363012Sdes else if (CPU_IS_HP_MC68K (cpu)) 63463012Sdes puts ("m68k-hitachi-hiuxwe2"); 63563012Sdes else puts ("unknown-hitachi-hiuxwe2"); 63663012Sdes exit (0); 63763012Sdes } 63863012SdesEOF 63963012Sdes $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 64063012Sdes rm -f $dummy.c $dummy 64163012Sdes echo unknown-hitachi-hiuxwe2 64263012Sdes exit 0 ;; 64363012Sdes 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 64463012Sdes echo hppa1.1-hp-bsd 64563012Sdes exit 0 ;; 64663012Sdes 9000/8??:4.3bsd:*:*) 64763012Sdes echo hppa1.0-hp-bsd 64863012Sdes exit 0 ;; 64963012Sdes *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 65063012Sdes echo hppa1.0-hp-mpeix 65163012Sdes exit 0 ;; 65263012Sdes hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 65363012Sdes echo hppa1.1-hp-osf 65463012Sdes exit 0 ;; 65563012Sdes hp8??:OSF1:*:*) 65663012Sdes echo hppa1.0-hp-osf 65763012Sdes exit 0 ;; 65863012Sdes i*86:OSF1:*:*) 65963012Sdes if [ -x /usr/sbin/sysversion ] ; then 66063012Sdes echo ${UNAME_MACHINE}-unknown-osf1mk 66163012Sdes else 66263012Sdes echo ${UNAME_MACHINE}-unknown-osf1 66363012Sdes fi 66463012Sdes exit 0 ;; 66563012Sdes parisc*:Lites*:*:*) 66663012Sdes echo hppa1.1-hp-lites 66763012Sdes exit 0 ;; 66863012Sdes C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 66963012Sdes echo c1-convex-bsd 67063012Sdes exit 0 ;; 67163012Sdes C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 67263012Sdes if getsysinfo -f scalar_acc 67363012Sdes then echo c32-convex-bsd 67463012Sdes else echo c2-convex-bsd 67563012Sdes fi 67663012Sdes exit 0 ;; 67763012Sdes C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 67863012Sdes echo c34-convex-bsd 67963012Sdes exit 0 ;; 68063012Sdes C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 68163012Sdes echo c38-convex-bsd 68263012Sdes exit 0 ;; 68363012Sdes C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 68463012Sdes echo c4-convex-bsd 68563012Sdes exit 0 ;; 68663012Sdes CRAY*Y-MP:*:*:*) 68763012Sdes echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 68863012Sdes exit 0 ;; 68963012Sdes CRAY*[A-Z]90:*:*:*) 69060737Sume echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 69163012Sdes | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 69260737Sume -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 69363012Sdes -e 's/\.[^.]*$/.X/' 69455544Sdes exit 0 ;; 69555544Sdes CRAY*TS:*:*:*) 69663012Sdes echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 69760737Sume exit 0 ;; 69863012Sdes CRAY*T3D:*:*:*) 69960737Sume echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 70041862Sdes exit 0 ;; 70137535Sdes CRAY*T3E:*:*:*) 70260189Sdes echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 70360189Sdes exit 0 ;; 70460189Sdes CRAY*SV1:*:*:*) 70563012Sdes echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 70660587Sume exit 0 ;; 70760587Sume F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 70860587Sume FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 70960587Sume FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 71060587Sume FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 71160189Sdes echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 71260587Sume exit 0 ;; 71360587Sume i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 71460587Sume echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 71560587Sume exit 0 ;; 71660189Sdes sparc*:BSD/OS:*:*) 71737535Sdes echo sparc-unknown-bsdi${UNAME_RELEASE} 71863012Sdes exit 0 ;; 71963012Sdes *:BSD/OS:*:*) 72063012Sdes echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 72163012Sdes exit 0 ;; 72263012Sdes *:FreeBSD:*:*) 72363012Sdes echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 72463012Sdes exit 0 ;; 72563012Sdes i*:CYGWIN*:*) 72663012Sdes echo ${UNAME_MACHINE}-pc-cygwin 72763012Sdes exit 0 ;; 72863012Sdes i*:MINGW*:*) 72960189Sdes echo ${UNAME_MACHINE}-pc-mingw32 73063012Sdes exit 0 ;; 73163012Sdes i*:PW*:*) 73263012Sdes echo ${UNAME_MACHINE}-pc-pw32 73363012Sdes exit 0 ;; 73437535Sdes x86:Interix*:3*) 73537535Sdes echo i386-pc-interix3 73663012Sdes exit 0 ;; 73760376Sdes i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 73860376Sdes # How do we know it's Interix rather than the generic POSIX subsystem? 73963012Sdes # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 74063012Sdes # UNAME_MACHINE based on the output of uname instead of i386? 74163012Sdes echo i386-pc-interix 74260954Sdes exit 0 ;; 74360954Sdes i*:UWIN*:*) 74460954Sdes echo ${UNAME_MACHINE}-pc-uwin 74563012Sdes exit 0 ;; 74660376Sdes p*:CYGWIN*:*) 74763012Sdes echo powerpcle-unknown-cygwin 74863012Sdes exit 0 ;; 74960376Sdes prep*:SunOS:5.*:*) 75063012Sdes echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 75163012Sdes exit 0 ;; 75263012Sdes *:GNU:*:*) 75363012Sdes echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 75463012Sdes exit 0 ;; 75563012Sdes i*86:Minix:*:*) 75663012Sdes echo ${UNAME_MACHINE}-pc-minix 75760737Sume exit 0 ;; 75860737Sume arm*:Linux:*:*) 75960737Sume echo ${UNAME_MACHINE}-unknown-linux-gnu 76060737Sume exit 0 ;; 76163012Sdes ia64:Linux:*:*) 76263012Sdes echo ${UNAME_MACHINE}-unknown-linux 76360376Sdes exit 0 ;; 76460737Sume m68*:Linux:*:*) 76563012Sdes echo ${UNAME_MACHINE}-unknown-linux-gnu 76663012Sdes exit 0 ;; 76763069Sdes mips:Linux:*:*) 76863069Sdes eval $set_cc_for_build 76963012Sdes sed 's/^ //' << EOF >$dummy.c 77063012Sdes #undef CPU 77163012Sdes #undef mips 77263012Sdes #undef mipsel 77363012Sdes #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 77463069Sdes CPU=mipsel 77563340Sdes #else 77663340Sdes #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 77763340Sdes CPU=mips 77863340Sdes #else 77963069Sdes CPU= 78063012Sdes #endif 78163069Sdes #endif 78263012SdesEOF 78363012Sdes eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` 78463012Sdes rm -f $dummy.c 78563012Sdes test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 78663012Sdes ;; 78763012Sdes ppc:Linux:*:*) 78860737Sume echo powerpc-unknown-linux-gnu 78963012Sdes exit 0 ;; 79063012Sdes ppc64:Linux:*:*) 79163012Sdes echo powerpc64-unknown-linux-gnu 79263012Sdes exit 0 ;; 79360737Sume alpha:Linux:*:*) 79437535Sdes case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 79563012Sdes EV5) UNAME_MACHINE=alphaev5 ;; 79663012Sdes EV56) UNAME_MACHINE=alphaev56 ;; 79763012Sdes PCA56) UNAME_MACHINE=alphapca56 ;; 79863012Sdes PCA57) UNAME_MACHINE=alphapca56 ;; 79963012Sdes EV6) UNAME_MACHINE=alphaev6 ;; 80063012Sdes EV67) UNAME_MACHINE=alphaev67 ;; 80163012Sdes EV68*) UNAME_MACHINE=alphaev68 ;; 80263012Sdes esac 80363012Sdes objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 80463012Sdes if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 80563012Sdes echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 80637535Sdes exit 0 ;; 80763012Sdes parisc:Linux:*:* | hppa:Linux:*:*) 80863012Sdes # Look for CPU level 80963012Sdes case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 81063012Sdes PA7*) echo hppa1.1-unknown-linux-gnu ;; 81163012Sdes PA8*) echo hppa2.0-unknown-linux-gnu ;; 81263012Sdes *) echo hppa-unknown-linux-gnu ;; 81363012Sdes esac 81463012Sdes exit 0 ;; 81563012Sdes parisc64:Linux:*:* | hppa64:Linux:*:*) 81663012Sdes echo hppa64-unknown-linux-gnu 81763012Sdes exit 0 ;; 81863012Sdes s390:Linux:*:* | s390x:Linux:*:*) 81963012Sdes echo ${UNAME_MACHINE}-ibm-linux 82063012Sdes exit 0 ;; 82163012Sdes sh*:Linux:*:*) 82263012Sdes echo ${UNAME_MACHINE}-unknown-linux-gnu 82363012Sdes exit 0 ;; 82460376Sdes sparc:Linux:*:* | sparc64:Linux:*:*) 82563012Sdes echo ${UNAME_MACHINE}-unknown-linux-gnu 82663012Sdes exit 0 ;; 82763012Sdes x86_64:Linux:*:*) 82863012Sdes echo x86_64-unknown-linux-gnu 82963012Sdes exit 0 ;; 83063012Sdes i*86:Linux:*:*) 83163012Sdes # The BFD linker knows what the default object file format is, so 83260376Sdes # first see if it will tell us. cd to the root directory to prevent 83363012Sdes # problems with other programs or directories called `ld' in the path. 83463012Sdes # Set LC_ALL=C to ensure ld outputs messages in English. 83563012Sdes ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ 83663012Sdes | sed -ne '/supported targets:/!d 83763012Sdes s/[ ][ ]*/ /g 83863012Sdes s/.*supported targets: *// 83963012Sdes s/ .*// 84063012Sdes p'` 84163012Sdes case "$ld_supported_targets" in 84263012Sdes elf32-i386) 84363012Sdes TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" 84463012Sdes ;; 84563012Sdes a.out-i386-linux) 84663012Sdes echo "${UNAME_MACHINE}-pc-linux-gnuaout" 84763012Sdes exit 0 ;; 84863012Sdes coff-i386) 84963012Sdes echo "${UNAME_MACHINE}-pc-linux-gnucoff" 85063012Sdes exit 0 ;; 85163012Sdes "") 85263012Sdes # Either a pre-BFD a.out linker (linux-gnuoldld) or 85363012Sdes # one that does not give us useful --help. 85463012Sdes echo "${UNAME_MACHINE}-pc-linux-gnuoldld" 85563012Sdes exit 0 ;; 85663012Sdes esac 85763012Sdes # Determine whether the default compiler is a.out or elf 85863012Sdes eval $set_cc_for_build 85963012Sdes sed 's/^ //' << EOF >$dummy.c 86063012Sdes #include <features.h> 86163012Sdes #ifdef __ELF__ 86263012Sdes # ifdef __GLIBC__ 86363012Sdes # if __GLIBC__ >= 2 86463012Sdes LIBC=gnu 86563012Sdes # else 86663012Sdes LIBC=gnulibc1 86763012Sdes # endif 86863012Sdes # else 86963012Sdes LIBC=gnulibc1 87063012Sdes # endif 87163012Sdes #else 87263012Sdes #ifdef __INTEL_COMPILER 87363012Sdes LIBC=gnu 87463012Sdes #else 87563012Sdes LIBC=gnuaout 87663012Sdes #endif 87763012Sdes #endif 87863012SdesEOF 87963012Sdes eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` 88063012Sdes rm -f $dummy.c 88163012Sdes test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 88263012Sdes test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 88363012Sdes ;; 88463012Sdes i*86:DYNIX/ptx:4*:*) 88563012Sdes # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 88663012Sdes # earlier versions are messed up and put the nodename in both 88763012Sdes # sysname and nodename. 88863340Sdes echo i386-sequent-sysv4 88963340Sdes exit 0 ;; 89063012Sdes i*86:UNIX_SV:4.2MP:2.*) 89163012Sdes # Unixware is an offshoot of SVR4, but it has its own version 89263012Sdes # number series starting with 2... 89363012Sdes # I am not positive that other SVR4 systems won't match this, 89463012Sdes # I just have to hope. -- rms. 89563340Sdes # Use sysv4.2uw... so that sysv4* matches it. 89663340Sdes echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 89763012Sdes exit 0 ;; 89863012Sdes i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 89963012Sdes UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 90063012Sdes if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 90163069Sdes echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 90263069Sdes else 90363012Sdes echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 90463012Sdes fi 90563069Sdes exit 0 ;; 90663069Sdes i*86:*:5:[78]*) 90763069Sdes case `/bin/uname -X | grep "^Machine"` in 90863069Sdes *486*) UNAME_MACHINE=i486 ;; 90963069Sdes *Pentium) UNAME_MACHINE=i586 ;; 91063069Sdes *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 91163069Sdes esac 91263069Sdes echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 91363069Sdes exit 0 ;; 91463012Sdes i*86:*:3.2:*) 91563069Sdes if test -f /usr/options/cb.name; then 91663012Sdes UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 91763012Sdes echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 91863012Sdes elif /bin/uname -X 2>/dev/null >/dev/null ; then 91963012Sdes UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` 92063012Sdes (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 92163012Sdes (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ 92263069Sdes && UNAME_MACHINE=i586 92363012Sdes (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ 92463012Sdes && UNAME_MACHINE=i686 92563012Sdes (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ 92663012Sdes && UNAME_MACHINE=i686 92763012Sdes echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 92863012Sdes else 92963012Sdes echo ${UNAME_MACHINE}-pc-sysv32 93063012Sdes fi 93163012Sdes exit 0 ;; 93263012Sdes i*86:*DOS:*:*) 93363012Sdes echo ${UNAME_MACHINE}-pc-msdosdjgpp 93460376Sdes exit 0 ;; 93563069Sdes pc:*:*:*) 93663069Sdes # Left here for compatibility: 93763012Sdes # uname -m prints for DJGPP always 'pc', but it prints nothing about 93863069Sdes # the processor, so we play safe by assuming i386. 93963069Sdes echo i386-pc-msdosdjgpp 94063069Sdes exit 0 ;; 94163337Sdes Intel:Mach:3*:*) 94263069Sdes echo i386-pc-mach3 94363069Sdes exit 0 ;; 94463069Sdes paragon:*:*:*) 94560376Sdes echo i860-intel-osf1 94660376Sdes exit 0 ;; 94763012Sdes i860:*:4.*:*) # i860-SVR4 94863012Sdes if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 94963012Sdes echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 95063012Sdes else # Add other i860-SVR4 vendors below as they are discovered. 95137571Sdes echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 95237535Sdes fi 95363012Sdes exit 0 ;; 95463012Sdes mini*:CTIX:SYS*5:*) 95563012Sdes # "miniframe" 95663012Sdes echo m68010-convergent-sysv 95763012Sdes exit 0 ;; 95863012Sdes M68*:*:R3V[567]*:*) 95963012Sdes test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 96063012Sdes 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 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) 96163012Sdes OS_REL='' 96260954Sdes test -r /etc/.relid \ 96363012Sdes && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 96437535Sdes /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 96563012Sdes && echo i486-ncr-sysv4.3${OS_REL} && exit 0 96663012Sdes /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 96763012Sdes && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 96863012Sdes 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 96963012Sdes /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 97037535Sdes && echo i486-ncr-sysv4 && exit 0 ;; 97163012Sdes m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 97263012Sdes echo m68k-unknown-lynxos${UNAME_RELEASE} 97363012Sdes exit 0 ;; 97463012Sdes mc68030:UNIX_System_V:4.*:*) 97563012Sdes echo m68k-atari-sysv4 97663012Sdes exit 0 ;; 97763012Sdes i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 97860189Sdes echo i386-unknown-lynxos${UNAME_RELEASE} 97963012Sdes exit 0 ;; 98063012Sdes TSUNAMI:LynxOS:2.*:*) 98163012Sdes echo sparc-unknown-lynxos${UNAME_RELEASE} 98263012Sdes exit 0 ;; 98363012Sdes rs6000:LynxOS:2.*:*) 98463012Sdes echo rs6000-unknown-lynxos${UNAME_RELEASE} 98563340Sdes exit 0 ;; 98663340Sdes PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 98763340Sdes echo powerpc-unknown-lynxos${UNAME_RELEASE} 98863340Sdes exit 0 ;; 98963340Sdes SM[BE]S:UNIX_SV:*:*) 99063340Sdes echo mips-dde-sysv${UNAME_RELEASE} 99163340Sdes exit 0 ;; 99263340Sdes RM*:ReliantUNIX-*:*:*) 99363340Sdes echo mips-sni-sysv4 99463012Sdes exit 0 ;; 99563012Sdes RM*:SINIX-*:*:*) 99663012Sdes echo mips-sni-sysv4 99763012Sdes exit 0 ;; 99863012Sdes *:SINIX-*:*:*) 99963340Sdes if uname -p 2>/dev/null >/dev/null ; then 100037535Sdes UNAME_MACHINE=`(uname -p) 2>/dev/null` 100137535Sdes echo ${UNAME_MACHINE}-sni-sysv4 100263340Sdes else 100363340Sdes echo ns32k-sni-sysv 100463340Sdes fi 100537535Sdes exit 0 ;; 100640975Sdes PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 100737535Sdes # says <Richard.M.Bartel@ccMail.Census.GOV> 100837535Sdes echo i586-unisys-sysv4 100937535Sdes exit 0 ;; 101037535Sdes *:UNIX_System_V:4*:FTX*) 101140975Sdes # From Gerald Hewes <hewes@openmarket.com>. 101240975Sdes # How about differentiating between stratus architectures? -djm 101340975Sdes echo hppa1.1-stratus-sysv4 101440975Sdes exit 0 ;; 101540975Sdes *:*:*:FTX*) 101660376Sdes # From seanf@swdc.stratus.com. 101740975Sdes echo i860-stratus-sysv4 101860376Sdes exit 0 ;; 101960376Sdes *:VOS:*:*) 102063012Sdes # From Paul.Green@stratus.com. 102160376Sdes echo hppa1.1-stratus-vos 102260581Sdes exit 0 ;; 102360376Sdes mc68*:A/UX:*:*) 102440975Sdes echo m68k-apple-aux${UNAME_RELEASE} 102541989Sdes exit 0 ;; 102641989Sdes news*:NEWS-OS:6*:*) 102741989Sdes echo mips-sony-newsos6 102841989Sdes exit 0 ;; 102941989Sdes R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 103041989Sdes if [ -d /usr/nec ]; then 103141989Sdes echo mips-nec-sysv${UNAME_RELEASE} 103241989Sdes else 103341989Sdes echo mips-unknown-sysv${UNAME_RELEASE} 103441989Sdes fi 1035 exit 0 ;; 1036 BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 1037 echo powerpc-be-beos 1038 exit 0 ;; 1039 BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 1040 echo powerpc-apple-beos 1041 exit 0 ;; 1042 BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 1043 echo i586-pc-beos 1044 exit 0 ;; 1045 SX-4:SUPER-UX:*:*) 1046 echo sx4-nec-superux${UNAME_RELEASE} 1047 exit 0 ;; 1048 SX-5:SUPER-UX:*:*) 1049 echo sx5-nec-superux${UNAME_RELEASE} 1050 exit 0 ;; 1051 Power*:Rhapsody:*:*) 1052 echo powerpc-apple-rhapsody${UNAME_RELEASE} 1053 exit 0 ;; 1054 *:Rhapsody:*:*) 1055 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 1056 exit 0 ;; 1057 *:Darwin:*:*) 1058 echo `uname -p`-apple-darwin${UNAME_RELEASE} 1059 exit 0 ;; 1060 *:procnto*:*:* | *:QNX:[0123456789]*:*) 1061 if test "${UNAME_MACHINE}" = "x86pc"; then 1062 UNAME_MACHINE=pc 1063 echo i386-${UNAME_MACHINE}-nto-qnx 1064 else 1065 echo `uname -p`-${UNAME_MACHINE}-nto-qnx 1066 fi 1067 exit 0 ;; 1068 *:QNX:*:4*) 1069 echo i386-pc-qnx 1070 exit 0 ;; 1071 NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) 1072 echo nsr-tandem-nsk${UNAME_RELEASE} 1073 exit 0 ;; 1074 *:NonStop-UX:*:*) 1075 echo mips-compaq-nonstopux 1076 exit 0 ;; 1077 BS2000:POSIX*:*:*) 1078 echo bs2000-siemens-sysv 1079 exit 0 ;; 1080 DS/*:UNIX_System_V:*:*) 1081 echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 1082 exit 0 ;; 1083 *:Plan9:*:*) 1084 # "uname -m" is not consistent, so use $cputype instead. 386 1085 # is converted to i386 for consistency with other x86 1086 # operating systems. 1087 if test "$cputype" = "386"; then 1088 UNAME_MACHINE=i386 1089 else 1090 UNAME_MACHINE="$cputype" 1091 fi 1092 echo ${UNAME_MACHINE}-unknown-plan9 1093 exit 0 ;; 1094 i*86:OS/2:*:*) 1095 # If we were able to find `uname', then EMX Unix compatibility 1096 # is probably installed. 1097 echo ${UNAME_MACHINE}-pc-os2-emx 1098 exit 0 ;; 1099 *:TOPS-10:*:*) 1100 echo pdp10-unknown-tops10 1101 exit 0 ;; 1102 *:TENEX:*:*) 1103 echo pdp10-unknown-tenex 1104 exit 0 ;; 1105 KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 1106 echo pdp10-dec-tops20 1107 exit 0 ;; 1108 XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 1109 echo pdp10-xkl-tops20 1110 exit 0 ;; 1111 *:TOPS-20:*:*) 1112 echo pdp10-unknown-tops20 1113 exit 0 ;; 1114 *:ITS:*:*) 1115 echo pdp10-unknown-its 1116 exit 0 ;; 1117 i*86:XTS-300:*:STOP) 1118 echo ${UNAME_MACHINE}-unknown-stop 1119 exit 0 ;; 1120 i*86:atheos:*:*) 1121 echo ${UNAME_MACHINE}-unknown-atheos 1122 exit 0 ;; 1123esac 1124 1125#echo '(No uname command or uname output not recognized.)' 1>&2 1126#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 1127 1128eval $set_cc_for_build 1129cat >$dummy.c <<EOF 1130#ifdef _SEQUENT_ 1131# include <sys/types.h> 1132# include <sys/utsname.h> 1133#endif 1134main () 1135{ 1136#if defined (sony) 1137#if defined (MIPSEB) 1138 /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 1139 I don't know.... */ 1140 printf ("mips-sony-bsd\n"); exit (0); 1141#else 1142#include <sys/param.h> 1143 printf ("m68k-sony-newsos%s\n", 1144#ifdef NEWSOS4 1145 "4" 1146#else 1147 "" 1148#endif 1149 ); exit (0); 1150#endif 1151#endif 1152 1153#if defined (__arm) && defined (__acorn) && defined (__unix) 1154 printf ("arm-acorn-riscix"); exit (0); 1155#endif 1156 1157#if defined (hp300) && !defined (hpux) 1158 printf ("m68k-hp-bsd\n"); exit (0); 1159#endif 1160 1161#if defined (NeXT) 1162#if !defined (__ARCHITECTURE__) 1163#define __ARCHITECTURE__ "m68k" 1164#endif 1165 int version; 1166 version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 1167 if (version < 4) 1168 printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 1169 else 1170 printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 1171 exit (0); 1172#endif 1173 1174#if defined (MULTIMAX) || defined (n16) 1175#if defined (UMAXV) 1176 printf ("ns32k-encore-sysv\n"); exit (0); 1177#else 1178#if defined (CMU) 1179 printf ("ns32k-encore-mach\n"); exit (0); 1180#else 1181 printf ("ns32k-encore-bsd\n"); exit (0); 1182#endif 1183#endif 1184#endif 1185 1186#if defined (__386BSD__) 1187 printf ("i386-pc-bsd\n"); exit (0); 1188#endif 1189 1190#if defined (sequent) 1191#if defined (i386) 1192 printf ("i386-sequent-dynix\n"); exit (0); 1193#endif 1194#if defined (ns32000) 1195 printf ("ns32k-sequent-dynix\n"); exit (0); 1196#endif 1197#endif 1198 1199#if defined (_SEQUENT_) 1200 struct utsname un; 1201 1202 uname(&un); 1203 1204 if (strncmp(un.version, "V2", 2) == 0) { 1205 printf ("i386-sequent-ptx2\n"); exit (0); 1206 } 1207 if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 1208 printf ("i386-sequent-ptx1\n"); exit (0); 1209 } 1210 printf ("i386-sequent-ptx\n"); exit (0); 1211 1212#endif 1213 1214#if defined (vax) 1215# if !defined (ultrix) 1216# include <sys/param.h> 1217# if defined (BSD) 1218# if BSD == 43 1219 printf ("vax-dec-bsd4.3\n"); exit (0); 1220# else 1221# if BSD == 199006 1222 printf ("vax-dec-bsd4.3reno\n"); exit (0); 1223# else 1224 printf ("vax-dec-bsd\n"); exit (0); 1225# endif 1226# endif 1227# else 1228 printf ("vax-dec-bsd\n"); exit (0); 1229# endif 1230# else 1231 printf ("vax-dec-ultrix\n"); exit (0); 1232# endif 1233#endif 1234 1235#if defined (alliant) && defined (i860) 1236 printf ("i860-alliant-bsd\n"); exit (0); 1237#endif 1238 1239 exit (1); 1240} 1241EOF 1242 1243$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 1244rm -f $dummy.c $dummy 1245 1246# Apollos put the system type in the environment. 1247 1248test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } 1249 1250# Convex versions that predate uname can use getsysinfo(1) 1251 1252if [ -x /usr/convex/getsysinfo ] 1253then 1254 case `getsysinfo -f cpu_type` in 1255 c1*) 1256 echo c1-convex-bsd 1257 exit 0 ;; 1258 c2*) 1259 if getsysinfo -f scalar_acc 1260 then echo c32-convex-bsd 1261 else echo c2-convex-bsd 1262 fi 1263 exit 0 ;; 1264 c34*) 1265 echo c34-convex-bsd 1266 exit 0 ;; 1267 c38*) 1268 echo c38-convex-bsd 1269 exit 0 ;; 1270 c4*) 1271 echo c4-convex-bsd 1272 exit 0 ;; 1273 esac 1274fi 1275 1276cat >&2 <<EOF 1277$0: unable to guess system type 1278 1279This script, last modified $timestamp, has failed to recognize 1280the operating system you are using. It is advised that you 1281download the most up to date version of the config scripts from 1282 1283 ftp://ftp.gnu.org/pub/gnu/config/ 1284 1285If the version you run ($0) is already up to date, please 1286send the following data and any information you think might be 1287pertinent to <config-patches@gnu.org> in order to provide the needed 1288information to handle your system. 1289 1290config.guess timestamp = $timestamp 1291 1292uname -m = `(uname -m) 2>/dev/null || echo unknown` 1293uname -r = `(uname -r) 2>/dev/null || echo unknown` 1294uname -s = `(uname -s) 2>/dev/null || echo unknown` 1295uname -v = `(uname -v) 2>/dev/null || echo unknown` 1296 1297/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 1298/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 1299 1300hostinfo = `(hostinfo) 2>/dev/null` 1301/bin/universe = `(/bin/universe) 2>/dev/null` 1302/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 1303/bin/arch = `(/bin/arch) 2>/dev/null` 1304/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 1305/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 1306 1307UNAME_MACHINE = ${UNAME_MACHINE} 1308UNAME_RELEASE = ${UNAME_RELEASE} 1309UNAME_SYSTEM = ${UNAME_SYSTEM} 1310UNAME_VERSION = ${UNAME_VERSION} 1311EOF 1312 1313exit 1 1314 1315# Local variables: 1316# eval: (add-hook 'write-file-hooks 'time-stamp) 1317# time-stamp-start: "timestamp='" 1318# time-stamp-format: "%:y-%02m-%02d" 1319# time-stamp-end: "'" 1320# End: 1321