[Android] Fix ndk-build call on Msys/Windows

Steve Lhomme git at videolan.org
Fri Oct 21 15:24:47 CEST 2016


vlc-android | branch: master | Steve Lhomme <robux4 at videolabs.io> | Tue Oct 18 08:44:52 2016 +0200| [945f34cdd7c1bbdce7891927df678cd4fa8560a4] | committer: Thomas Guillem

Fix ndk-build call on Msys/Windows

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 compile-libvlc.sh | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index f97b23c..76ffb0f 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -330,6 +330,13 @@ CROSS_TOOLS=${NDK_TOOLCHAIN_PATH}/${TARGET_TUPLE}-
 
 export PATH=${NDK_TOOLCHAIN_PATH}:${PATH}
 
+ON_WINDOWS=0
+if [ ! -z "$MSYSTEM_PREFIX" ] ; then
+    # The make.exe and awk.exe from the toolchain don't work in msys
+    export PATH=$MSYSTEM_PREFIX/bin:/usr/bin:${NDK_TOOLCHAIN_PATH}:${PATH}
+    ON_WINDOWS=1
+fi
+
 ###############
 # DISPLAY ABI #
 ###############
@@ -674,7 +681,11 @@ fi
 
 echo "Building NDK"
 
-$ANDROID_NDK/ndk-build -C libvlc \
+if [ $ON_WINDOWS -eq 1 ]; then
+    OSCMD=.cmd
+fi
+
+$ANDROID_NDK/ndk-build$OSCMD -C libvlc \
     APP_STL="c++_shared" \
     LOCAL_CPP_FEATURES="rtti exceptions" \
     VLC_SRC_DIR="$VLC_SRC_DIR" \
@@ -694,7 +705,7 @@ $ANDROID_NDK/ndk-build -C libvlc \
 
 checkfail "ndk-build failed"
 
-$ANDROID_NDK/ndk-build -C libvlc \
+$ANDROID_NDK/ndk-build$OSCMD -C libvlc \
     VLC_SRC_DIR="$VLC_SRC_DIR" \
     ANDROID_SYS_HEADERS="$ANDROID_SYS_HEADERS" \
     LIBIOMX_LIBS="$LIBIOMX_LIBS" \



More information about the Android mailing list