[Android] build: add --no-ml to disable medialibrary

Thomas Guillem git at videolan.org
Fri Oct 27 18:33:04 CEST 2017


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Oct 27 17:28:23 2017 +0200| [52c1f9d35113126731a683a75d0bb491ff02c7c6] | committer: Thomas Guillem

build: add --no-ml to disable medialibrary

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

 compile-libvlc.sh     | 11 ++++++++++-
 compile.sh            |  6 ++++++
 libvlc/jni/Android.mk |  7 ++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index e1c47cd21..260f327ec 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -18,6 +18,7 @@ checkfail()
 
 MEDIALIBRARY_HASH=6bfe3c19
 
+BUILD_ML=1
 RELEASE=0
 ASAN=0
 while [ $# -gt 0 ]; do
@@ -37,6 +38,9 @@ while [ $# -gt 0 ]; do
         --asan)
             ASAN=1
             ;;
+        --no-ml)
+            BUILD_ML=0
+            ;;
         release|--release)
             RELEASE=1
             ;;
@@ -705,6 +709,8 @@ fi
 # MEDIALIBRARY #
 ################
 
+if [ ${BUILD_ML} = "1" ];then
+
 if [ ! -d "${SRC_DIR}/medialibrary" ]; then
     mkdir "${SRC_DIR}/medialibrary"
 fi
@@ -849,6 +855,8 @@ fi
 # LINKING #
 ###########
 
+fi # ${BUILD_ML} = "1"
+
 echo -e "ndk-build vlc"
 
 $ANDROID_NDK/ndk-build$OSCMD -C libvlc \
@@ -867,7 +875,8 @@ $ANDROID_NDK/ndk-build$OSCMD -C libvlc \
     APP_ABI=${ANDROID_ABI} \
     NDK_PROJECT_PATH=jni \
     NDK_TOOLCHAIN_VERSION=clang \
-    NDK_DEBUG=${NDK_DEBUG}
+    NDK_DEBUG=${NDK_DEBUG} \
+    BUILD_ML=${BUILD_ML}
 
 $ANDROID_NDK/ndk-build$OSCMD -C libvlc \
     APP_BUILD_SCRIPT=jni/loader/Android.mk \
diff --git a/compile.sh b/compile.sh
index aea9ed935..8af3dea2c 100755
--- a/compile.sh
+++ b/compile.sh
@@ -68,6 +68,9 @@ while [ $# -gt 0 ]; do
         --asan)
             ASAN=1
             ;;
+        --no-ml)
+            NO_ML=1
+            ;;
         *)
             diagnostic "$0: Invalid option '$1'."
             diagnostic "$0: Try --help for more information."
@@ -260,6 +263,9 @@ fi
 if [ "$ASAN" = 1 ]; then
     OPTS="$OPTS --asan"
 fi
+if [ "$NO_ML" = 1 ]; then
+    OPTS="$OPTS --no-ml"
+fi
 
 ./compile-libvlc.sh $OPTS
 
diff --git a/libvlc/jni/Android.mk b/libvlc/jni/Android.mk
index 06d6a04b2..93d2adc9b 100644
--- a/libvlc/jni/Android.mk
+++ b/libvlc/jni/Android.mk
@@ -37,9 +37,14 @@ LOCAL_LDLIBS := \
 	$(VLC_LDFLAGS) \
 	-llog
 
-LOCAL_WHOLE_STATIC_LIBRARIES := libvlcjni_static libmla
+LOCAL_WHOLE_STATIC_LIBRARIES := libvlcjni_static
+ifeq ($(BUILD_ML), 1)
+LOCAL_WHOLE_STATIC_LIBRARIES += libmla
+endif
 include $(BUILD_SHARED_LIBRARY)
 
+ifeq ($(BUILD_ML), 1)
 JNILOADER_INCLUDES := $(LOCAL_PATH)/loader
 $(call import-add-path, $(MEDIALIBRARY_JNI_DIR))
 $(call import-module, .)
+endif



More information about the Android mailing list