2
2
# Attempt to guess a canonical system name.
3
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
4
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5
# 2011, 2012, 2013 Free Software Foundation, Inc.
5
# 2011, 2012 Free Software Foundation, Inc.
9
9
# This file is free software; you can redistribute it and/or modify it
10
10
# under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 3 of the License, or
11
# the Free Software Foundation; either version 2 of the License, or
12
12
# (at your option) any later version.
14
14
# This program is distributed in the hope that it will be useful, but
22
22
# As a special exception to the GNU General Public License, if you
23
23
# distribute this file as part of a program that contains a
24
24
# configuration script generated by Autoconf, you may include it under
25
# the same distribution terms that you use for the rest of that
26
# program. This Exception is an additional permission under section 7
27
# of the GNU General Public License, version 3 ("GPLv3").
25
# the same distribution terms that you use for the rest of that program.
28
# Originally written by Per Bothner. Please send patches (context
29
# diff format) to <config-patches@gnu.org> and include a ChangeLog
29
# Originally written by Per Bothner.
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.
31
36
# You can get the latest version of this script from:
32
37
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
34
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
37
39
me=`echo "$0" | sed -e 's,.*/,,'`
54
56
Originally written by Per Bothner.
55
57
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
56
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
57
2012, 2013 Free Software Foundation, Inc.
58
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
59
Free Software Foundation, Inc.
59
61
This is free software; see the source for copying conditions. There is NO
60
62
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
136
138
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
137
139
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
139
case "${UNAME_SYSTEM}" in
141
eval $set_cc_for_build
142
cat <<-EOF > $dummy.c
143
#include <features.h>
145
# ifdef __UCLIBC_CONFIG_VERSION__
146
LIBC=uclibc __UCLIBC_CONFIG_VERSION__
158
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
162
141
# Note: order is significant - the case branches are not exclusive.
164
143
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
221
200
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
222
201
echo "${machine}-${os}${release}"
225
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
226
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
229
204
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
230
205
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
327
302
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
328
303
echo arm-acorn-riscix${UNAME_RELEASE}
330
arm*:riscos:*:*|arm*:RISCOS:*:*)
305
arm:riscos:*:*|arm:RISCOS:*:*)
331
306
echo arm-unknown-riscos
333
308
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
883
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
855
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
886
858
# other systems with GNU libc and userland
887
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
859
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
890
862
echo ${UNAME_MACHINE}-pc-minix
892
864
aarch64:Linux:*:*)
893
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
865
echo ${UNAME_MACHINE}-unknown-linux-gnu
895
867
aarch64_be:Linux:*:*)
896
868
UNAME_MACHINE=aarch64_be
897
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
869
echo ${UNAME_MACHINE}-unknown-linux-gnu
900
872
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
907
879
EV68*) UNAME_MACHINE=alphaev68 ;;
909
881
objdump --private-headers /bin/sh | grep -q ld.so.1
910
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
911
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
882
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
883
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
914
886
eval $set_cc_for_build
915
887
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
916
888
| grep -q __ARM_EABI__
918
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
890
echo ${UNAME_MACHINE}-unknown-linux-gnu
920
892
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
921
893
| grep -q __ARM_PCS_VFP
923
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
895
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
925
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
897
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
929
901
avr32*:Linux:*:*)
930
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
902
echo ${UNAME_MACHINE}-unknown-linux-gnu
933
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
905
echo ${UNAME_MACHINE}-axis-linux-gnu
935
907
crisv32:Linux:*:*)
936
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
908
echo ${UNAME_MACHINE}-axis-linux-gnu
939
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
911
echo ${UNAME_MACHINE}-unknown-linux-gnu
941
913
hexagon:Linux:*:*)
942
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
914
echo ${UNAME_MACHINE}-unknown-linux-gnu
945
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
918
eval $set_cc_for_build
919
sed 's/^ //' << EOF >$dummy.c
924
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
925
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
948
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
928
echo ${UNAME_MACHINE}-unknown-linux-gnu
951
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
931
echo ${UNAME_MACHINE}-unknown-linux-gnu
954
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
934
echo ${UNAME_MACHINE}-unknown-linux-gnu
956
936
mips:Linux:*:* | mips64:Linux:*:*)
957
937
eval $set_cc_for_build
972
952
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
973
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
953
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
976
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
956
echo ${UNAME_MACHINE}-unknown-linux-gnu
979
echo sparc-unknown-linux-${LIBC}
959
echo sparc-unknown-linux-gnu
981
961
parisc64:Linux:*:* | hppa64:Linux:*:*)
982
echo hppa64-unknown-linux-${LIBC}
962
echo hppa64-unknown-linux-gnu
984
964
parisc:Linux:*:* | hppa:Linux:*:*)
985
965
# Look for CPU level
986
966
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
987
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
988
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
989
*) echo hppa-unknown-linux-${LIBC} ;;
967
PA7*) echo hppa1.1-unknown-linux-gnu ;;
968
PA8*) echo hppa2.0-unknown-linux-gnu ;;
969
*) echo hppa-unknown-linux-gnu ;;
993
echo powerpc64-unknown-linux-${LIBC}
973
echo powerpc64-unknown-linux-gnu
996
echo powerpc-unknown-linux-${LIBC}
976
echo powerpc-unknown-linux-gnu
998
978
s390:Linux:*:* | s390x:Linux:*:*)
999
979
echo ${UNAME_MACHINE}-ibm-linux
1001
981
sh64*:Linux:*:*)
1002
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
982
echo ${UNAME_MACHINE}-unknown-linux-gnu
1005
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
985
echo ${UNAME_MACHINE}-unknown-linux-gnu
1007
987
sparc:Linux:*:* | sparc64:Linux:*:*)
1008
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
988
echo ${UNAME_MACHINE}-unknown-linux-gnu
1010
990
tile*:Linux:*:*)
1011
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
991
echo ${UNAME_MACHINE}-unknown-linux-gnu
1014
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
994
echo ${UNAME_MACHINE}-dec-linux-gnu
1016
996
x86_64:Linux:*:*)
1017
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
997
echo ${UNAME_MACHINE}-unknown-linux-gnu
1019
999
xtensa*:Linux:*:*)
1020
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1000
echo ${UNAME_MACHINE}-unknown-linux-gnu
1022
1002
i*86:DYNIX/ptx:4*:*)
1023
1003
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1279
1256
NEO-?:NONSTOP_KERNEL:*:*)
1280
1257
echo neo-tandem-nsk${UNAME_RELEASE}
1282
NSE-*:NONSTOP_KERNEL:*:*)
1259
NSE-?:NONSTOP_KERNEL:*:*)
1283
1260
echo nse-tandem-nsk${UNAME_RELEASE}
1285
1262
NSR-?:NONSTOP_KERNEL:*:*)