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

Filip Roséen filip at atch.se
Fri Aug 5 21:31:03 CEST 2016


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.

---

The current implementation caused be a slight headache when trying to
build using "Pkg.Revision = 12.1.2977051".
---
 compile-libvlc.sh | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index 381e4ee..b9a3bbd 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -279,19 +279,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
-- 
2.9.2



More information about the Android mailing list