[Android] compile-libvlc.sh: fix NDK version check

Filip Roséen git at videolan.org
Wed Aug 24 18:49:53 CEST 2016


vlc-android | branch: master | Filip Roséen <filip at atch.se> | Fri Aug  5 21:31:03 2016 +0200| [6ee40f0aecd203625a409a386edad4ddb62f8c9e] | committer: Thomas Guillem

compile-libvlc.sh: fix NDK version check

The diagnostic certainly implies that the shell script shall abort if
the version of the NDK is less than 11, though the previous case-check
only matched versions matching "11*".

This commit changes the implementation so that we check whether "$REL"
is greater-than-or-equal compared to 11.

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

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

 compile-libvlc.sh | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index 73605de..dca1682 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -281,19 +281,17 @@ fi
 # try to detect NDK version
 GCCVER=4.9
 REL=$(grep -o '^Pkg.Revision.*[0-9]*.*' $ANDROID_NDK/source.properties |cut -d " " -f 3 | cut -d "." -f 1)
-case "$REL" in
-    11*)
-        if [ "${HAVE_64}" = 1 ];then
-            ANDROID_API=android-21
-        else
-            ANDROID_API=android-9
-        fi
-    ;;
-    *)
+
+if [ "$REL" -ge 11 ]; then
+    if [ "${HAVE_64}" = 1 ];then
+        ANDROID_API=android-21
+    else
+        ANDROID_API=android-9
+    fi
+else
     echo "You need the NDKv11 or later"
     exit 1
-    ;;
-esac
+fi
 
 SYSROOT=$ANDROID_NDK/platforms/$ANDROID_API/arch-$PLATFORM_SHORT_ARCH
 SRC_DIR=$PWD



More information about the Android mailing list