* Install the Android SDK at `$HOME/lib/android-sdk`. Override this by setting the environment
variable `$ANDROID_HOME` to point at another location.
-* Install the Android NDK, version r10e, at `$HOME/lib/android-ndk`. Override this by setting
+* Install the Android NDK, version r11, at `$HOME/lib/android-ndk`. Override this by setting
the environment variable `$NDK` to point at another location.
Alternatively a Dockerfile is provided which sets up a pristine image
test `uname` = "Darwin" && TERMUX_TOUCH=gtouch
# Compute NDK version. We remove the first character (the r in e.g. r9d) to get a version number which can be used in packages):
-export TERMUX_NDK_VERSION=`cut -d ' ' -f 1 $NDK/RELEASE.TXT | cut -c 2-`
+export TERMUX_NDK_VERSION=11
+if grep -s -q "Pkg.Revision = $TERMUX_NDK_VERSION" $NDK/source.properties; then
+ :
+else
+ echo "Wrong NDK version - we need $TERMUX_NDK_VERSION"
+ exit 1
+fi
export prefix=${TERMUX_PREFIX} # prefix is used by some makefiles
#export ACLOCAL="aclocal -I $TERMUX_PREFIX/share/aclocal"
_TERMUX_NDK_TOOLCHAIN_NAME="$TERMUX_HOST_PLATFORM"
fi
bash $NDK/build/tools/make-standalone-toolchain.sh --platform=android-$TERMUX_API_LEVEL --toolchain=${_TERMUX_NDK_TOOLCHAIN_NAME}-${TERMUX_GCC_VERSION} \
- --install-dir=$TERMUX_STANDALONE_TOOLCHAIN --system=`uname | tr '[:upper:]' '[:lower:]'`-x86_64
+ --install-dir=$TERMUX_STANDALONE_TOOLCHAIN
if [ "arm" = $TERMUX_ARCH ]; then
# Fix to allow e.g. <bits/c++config.h> to be included:
cp $TERMUX_STANDALONE_TOOLCHAIN/include/c++/$TERMUX_GCC_VERSION/arm-linux-androideabi/armv7-a/bits/* $TERMUX_STANDALONE_TOOLCHAIN/include/c++/$TERMUX_GCC_VERSION/bits
#elif defined(__x86_64__)
struct user_fpregs_struct {
-@@ -234,7 +240,18 @@
-
- #elif defined(__aarch64__)
-
--// There are no user structures for 64 bit arm.
-+/* From https://codereview.chromium.org/1291983003 */
-+struct user_regs_struct {
-+ __u64 regs[31];
-+ __u64 sp;
-+ __u64 pc;
-+ __u64 pstate;
-+};
-+struct user_fpsimd_struct {
-+ __uint128_t vregs[32];
-+ __u32 fpsr;
-+ __u32 fpcr;
-+};
-
- #else
-
--- /dev/null
+The r11 of NDK removed dprintf.
+
+diff -u -r ../busybox-1.24.1/include/platform.h ./include/platform.h
+--- ../busybox-1.24.1/include/platform.h 2015-07-13 04:18:47.000000000 +0200
++++ ./include/platform.h 2016-03-10 11:47:06.000000000 +0100
+@@ -480,11 +480,7 @@
+ #endif
+
+ #if defined(ANDROID) || defined(__ANDROID__)
+-# if __ANDROID_API__ < 8
+-# undef HAVE_DPRINTF
+-# else
+-# define dprintf fdprintf
+-# endif
++# undef HAVE_DPRINTF
+ # if __ANDROID_API__ < 21
+ # undef HAVE_TTYNAME_R
+ # undef HAVE_GETLINE
+++ /dev/null
-fdprintf() does not exist in 64-bit bionic.
-
-diff -u -r ../busybox-1.24.1/include/platform.h ./include/platform.h
---- ../busybox-1.24.1/include/platform.h 2015-07-12 22:18:47.000000000 -0400
-+++ ./include/platform.h 2015-11-26 16:14:37.061610995 -0500
-@@ -480,7 +480,7 @@
- #endif
-
- #if defined(ANDROID) || defined(__ANDROID__)
--# if __ANDROID_API__ < 8
-+# if __ANDROID_API__ < 8 || defined(__LP64__)
- # undef HAVE_DPRINTF
- # else
- # define dprintf fdprintf