Deleted Added
sdiff udiff text old ( 249141 ) new ( 276605 )
full compact
1#! /bin/sh
2# Attempt to guess a canonical system name.
3# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5# 2011, 2012 Free Software Foundation, Inc.
6
7timestamp='2012-06-10'
8
9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 2 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, see <http://www.gnu.org/licenses/>.
21#
22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a
24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that program.
26
27
28# Originally written by Per Bothner. Please send patches (context
29# diff format) to <config-patches@gnu.org> and include a ChangeLog
30# entry.
31#
32# This script attempts to guess a canonical system name similar to
33# config.sub. If it succeeds, it prints the system name on stdout, and
34# exits with 0. Otherwise, it exits with 1.
35#
36# You can get the latest version of this script from:
37# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
38
39me=`echo "$0" | sed -e 's,.*/,,'`
40
41usage="\
42Usage: $0 [OPTION]
43
44Output the configuration name of the system \`$me' is run on.
45
46Operation modes:
47 -h, --help print this help, then exit
48 -t, --time-stamp print date of last modification, then exit
49 -v, --version print version number, then exit
50
51Report bugs and patches to <config-patches@gnu.org>."
52
53version="\
54GNU config.guess ($timestamp)
55
56Originally written by Per Bothner.
57Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
582001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
59Free Software Foundation, Inc.
60
61This is free software; see the source for copying conditions. There is NO
62warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
63
64help="
65Try \`$me --help' for more information."
66
67# Parse command line

--- 65 unchanged lines hidden (view full) ---

133 PATH=$PATH:/.attbin ; export PATH
134fi
135
136UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
137UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
138UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
139UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140
141# Note: order is significant - the case branches are not exclusive.
142
143case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
144 *:NetBSD:*:*)
145 # NetBSD (nbsd) targets should (where applicable) match one or
146 # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
147 # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
148 # switched to ELF, *-*-netbsd* would select the old

--- 46 unchanged lines hidden (view full) ---

195 release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
196 ;;
197 esac
198 # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199 # contains redundant information, the shorter form:
200 # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201 echo "${machine}-${os}${release}"
202 exit ;;
203 *:OpenBSD:*:*)
204 UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205 echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
206 exit ;;
207 *:ekkoBSD:*:*)
208 echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
209 exit ;;
210 *:SolidBSD:*:*)

--- 86 unchanged lines hidden (view full) ---

297 echo s390-ibm-zvmoe
298 exit ;;
299 *:OS400:*:*)
300 echo powerpc-ibm-os400
301 exit ;;
302 arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
303 echo arm-acorn-riscix${UNAME_RELEASE}
304 exit ;;
305 arm:riscos:*:*|arm:RISCOS:*:*)
306 echo arm-unknown-riscos
307 exit ;;
308 SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
309 echo hppa1.1-hitachi-hiuxmpp
310 exit ;;
311 Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
312 # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
313 if test "`(/bin/universe) 2>/dev/null`" = att ; then

--- 482 unchanged lines hidden (view full) ---

796 echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797 *)
798 echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799 esac
800 exit ;;
801 i*:CYGWIN*:*)
802 echo ${UNAME_MACHINE}-pc-cygwin
803 exit ;;
804 *:MINGW*:*)
805 echo ${UNAME_MACHINE}-pc-mingw32
806 exit ;;
807 i*:MSYS*:*)
808 echo ${UNAME_MACHINE}-pc-msys
809 exit ;;
810 i*:windows32*:*)
811 # uname -m includes "-pc" on this system.

--- 35 unchanged lines hidden (view full) ---

847 p*:CYGWIN*:*)
848 echo powerpcle-unknown-cygwin
849 exit ;;
850 prep*:SunOS:5.*:*)
851 echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
852 exit ;;
853 *:GNU:*:*)
854 # the GNU system
855 echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
856 exit ;;
857 *:GNU/*:*:*)
858 # other systems with GNU libc and userland
859 echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
860 exit ;;
861 i*86:Minix:*:*)
862 echo ${UNAME_MACHINE}-pc-minix
863 exit ;;
864 aarch64:Linux:*:*)
865 echo ${UNAME_MACHINE}-unknown-linux-gnu
866 exit ;;
867 aarch64_be:Linux:*:*)
868 UNAME_MACHINE=aarch64_be
869 echo ${UNAME_MACHINE}-unknown-linux-gnu
870 exit ;;
871 alpha:Linux:*:*)
872 case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
873 EV5) UNAME_MACHINE=alphaev5 ;;
874 EV56) UNAME_MACHINE=alphaev56 ;;
875 PCA56) UNAME_MACHINE=alphapca56 ;;
876 PCA57) UNAME_MACHINE=alphapca56 ;;
877 EV6) UNAME_MACHINE=alphaev6 ;;
878 EV67) UNAME_MACHINE=alphaev67 ;;
879 EV68*) UNAME_MACHINE=alphaev68 ;;
880 esac
881 objdump --private-headers /bin/sh | grep -q ld.so.1
882 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
883 echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
884 exit ;;
885 arm*:Linux:*:*)
886 eval $set_cc_for_build
887 if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
888 | grep -q __ARM_EABI__
889 then
890 echo ${UNAME_MACHINE}-unknown-linux-gnu
891 else
892 if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
893 | grep -q __ARM_PCS_VFP
894 then
895 echo ${UNAME_MACHINE}-unknown-linux-gnueabi
896 else
897 echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
898 fi
899 fi
900 exit ;;
901 avr32*:Linux:*:*)
902 echo ${UNAME_MACHINE}-unknown-linux-gnu
903 exit ;;
904 cris:Linux:*:*)
905 echo ${UNAME_MACHINE}-axis-linux-gnu
906 exit ;;
907 crisv32:Linux:*:*)
908 echo ${UNAME_MACHINE}-axis-linux-gnu
909 exit ;;
910 frv:Linux:*:*)
911 echo ${UNAME_MACHINE}-unknown-linux-gnu
912 exit ;;
913 hexagon:Linux:*:*)
914 echo ${UNAME_MACHINE}-unknown-linux-gnu
915 exit ;;
916 i*86:Linux:*:*)
917 LIBC=gnu
918 eval $set_cc_for_build
919 sed 's/^ //' << EOF >$dummy.c
920 #ifdef __dietlibc__
921 LIBC=dietlibc
922 #endif
923EOF
924 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
925 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
926 exit ;;
927 ia64:Linux:*:*)
928 echo ${UNAME_MACHINE}-unknown-linux-gnu
929 exit ;;
930 m32r*:Linux:*:*)
931 echo ${UNAME_MACHINE}-unknown-linux-gnu
932 exit ;;
933 m68*:Linux:*:*)
934 echo ${UNAME_MACHINE}-unknown-linux-gnu
935 exit ;;
936 mips:Linux:*:* | mips64:Linux:*:*)
937 eval $set_cc_for_build
938 sed 's/^ //' << EOF >$dummy.c
939 #undef CPU
940 #undef ${UNAME_MACHINE}
941 #undef ${UNAME_MACHINE}el
942 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
943 CPU=${UNAME_MACHINE}el
944 #else
945 #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
946 CPU=${UNAME_MACHINE}
947 #else
948 CPU=
949 #endif
950 #endif
951EOF
952 eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
953 test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
954 ;;
955 or32:Linux:*:*)
956 echo ${UNAME_MACHINE}-unknown-linux-gnu
957 exit ;;
958 padre:Linux:*:*)
959 echo sparc-unknown-linux-gnu
960 exit ;;
961 parisc64:Linux:*:* | hppa64:Linux:*:*)
962 echo hppa64-unknown-linux-gnu
963 exit ;;
964 parisc:Linux:*:* | hppa:Linux:*:*)
965 # Look for CPU level
966 case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
967 PA7*) echo hppa1.1-unknown-linux-gnu ;;
968 PA8*) echo hppa2.0-unknown-linux-gnu ;;
969 *) echo hppa-unknown-linux-gnu ;;
970 esac
971 exit ;;
972 ppc64:Linux:*:*)
973 echo powerpc64-unknown-linux-gnu
974 exit ;;
975 ppc:Linux:*:*)
976 echo powerpc-unknown-linux-gnu
977 exit ;;
978 s390:Linux:*:* | s390x:Linux:*:*)
979 echo ${UNAME_MACHINE}-ibm-linux
980 exit ;;
981 sh64*:Linux:*:*)
982 echo ${UNAME_MACHINE}-unknown-linux-gnu
983 exit ;;
984 sh*:Linux:*:*)
985 echo ${UNAME_MACHINE}-unknown-linux-gnu
986 exit ;;
987 sparc:Linux:*:* | sparc64:Linux:*:*)
988 echo ${UNAME_MACHINE}-unknown-linux-gnu
989 exit ;;
990 tile*:Linux:*:*)
991 echo ${UNAME_MACHINE}-unknown-linux-gnu
992 exit ;;
993 vax:Linux:*:*)
994 echo ${UNAME_MACHINE}-dec-linux-gnu
995 exit ;;
996 x86_64:Linux:*:*)
997 echo ${UNAME_MACHINE}-unknown-linux-gnu
998 exit ;;
999 xtensa*:Linux:*:*)
1000 echo ${UNAME_MACHINE}-unknown-linux-gnu
1001 exit ;;
1002 i*86:DYNIX/ptx:4*:*)
1003 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1004 # earlier versions are messed up and put the nodename in both
1005 # sysname and nodename.
1006 echo i386-sequent-sysv4
1007 exit ;;
1008 i*86:UNIX_SV:4.2MP:2.*)

--- 187 unchanged lines hidden (view full) ---

1196 echo powerpc-apple-beos
1197 exit ;;
1198 BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1199 echo i586-pc-beos
1200 exit ;;
1201 BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
1202 echo i586-pc-haiku
1203 exit ;;
1204 SX-4:SUPER-UX:*:*)
1205 echo sx4-nec-superux${UNAME_RELEASE}
1206 exit ;;
1207 SX-5:SUPER-UX:*:*)
1208 echo sx5-nec-superux${UNAME_RELEASE}
1209 exit ;;
1210 SX-6:SUPER-UX:*:*)
1211 echo sx6-nec-superux${UNAME_RELEASE}

--- 10 unchanged lines hidden (view full) ---

1222 Power*:Rhapsody:*:*)
1223 echo powerpc-apple-rhapsody${UNAME_RELEASE}
1224 exit ;;
1225 *:Rhapsody:*:*)
1226 echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1227 exit ;;
1228 *:Darwin:*:*)
1229 UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1230 case $UNAME_PROCESSOR in
1231 i386)
1232 eval $set_cc_for_build
1233 if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1234 if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1235 (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1236 grep IS_64BIT_ARCH >/dev/null
1237 then
1238 UNAME_PROCESSOR="x86_64"
1239 fi
1240 fi ;;
1241 unknown) UNAME_PROCESSOR=powerpc ;;
1242 esac
1243 echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1244 exit ;;
1245 *:procnto*:*:* | *:QNX:[0123456789]*:*)
1246 UNAME_PROCESSOR=`uname -p`
1247 if test "$UNAME_PROCESSOR" = "x86"; then
1248 UNAME_PROCESSOR=i386
1249 UNAME_MACHINE=pc
1250 fi

--- 74 unchanged lines hidden (view full) ---

1325 i*86:AROS:*:*)
1326 echo ${UNAME_MACHINE}-pc-aros
1327 exit ;;
1328 x86_64:VMkernel:*:*)
1329 echo ${UNAME_MACHINE}-unknown-esx
1330 exit ;;
1331esac
1332
1333#echo '(No uname command or uname output not recognized.)' 1>&2
1334#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1335
1336eval $set_cc_for_build
1337cat >$dummy.c <<EOF
1338#ifdef _SEQUENT_
1339# include <sys/types.h>
1340# include <sys/utsname.h>
1341#endif
1342main ()
1343{

--- 187 unchanged lines hidden ---