[Android] build: update toolchain if ndk changes

Thomas Guillem git at videolan.org
Tue Aug 30 15:57:55 CEST 2016


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Aug 30 15:57:45 2016 +0200| [ecb6627074a97e2d320eee44e315f752dd21bccd] | committer: Thomas Guillem

build: update toolchain if ndk changes

> https://code.videolan.org/videolan/vlc-android/commit/ecb6627074a97e2d320eee44e315f752dd21bccd
---

 compile-libvlc.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index bcae273..ff172a9 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -285,19 +285,31 @@ else
     exit 1
 fi
 
+NDK_FORCE_ARG=
 NDK_TOOLCHAIN_DIR=${PWD}/toolchains/${PLATFORM_SHORT_ARCH}
+NDK_TOOLCHAIN_PROPS=${NDK_TOOLCHAIN_DIR}/source.properties
 NDK_TOOLCHAIN_PATH=${NDK_TOOLCHAIN_DIR}/bin
 NDK_SUPPORT_DIR=${NDK_TOOLCHAIN_DIR}/include/support
+
+if [ "`cat \"${NDK_TOOLCHAIN_PROPS}\" 2>/dev/null`" != "`cat \"${ANDROID_NDK}/source.properties\"`" ];then
+     echo "NDK changed, making new toolchain"
+     NDK_FORCE_ARG="--force"
+fi
+
 $ANDROID_NDK/build/tools/make_standalone_toolchain.py \
     --arch ${PLATFORM_SHORT_ARCH} \
     --api ${ANDROID_API} \
     --stl libc++ \
+    ${NDK_FORCE_ARG} \
     --install-dir ${NDK_TOOLCHAIN_DIR} 2> /dev/null
 if [ ! -d ${NDK_TOOLCHAIN_PATH} ];
 then
     echo "make_standalone_toolchain.py failed"
     exit 1
 fi
+if [ ! -z "${NDK_FORCE_ARG}" ];then
+    cp "$ANDROID_NDK/source.properties" "${NDK_TOOLCHAIN_PROPS}"
+fi
 if [ ! -f ${NDK_TOOLCHAIN_DIR}/sysroot/usr/include/uchar.h ];
 then
     cp ${ANDROID_NDK}/platforms/android-24/arch-${PLATFORM_SHORT_ARCH}/usr/include/uchar.h \



More information about the Android mailing list