[Android] build: libcompat hack only for armv{6|7}
Thomas Guillem
git at videolan.org
Mon Jun 13 14:11:51 CEST 2016
vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jun 13 14:11:42 2016 +0200| [b331627188a2b2902b52266fc9932c2b4f6a619b] | committer: Thomas Guillem
build: libcompat hack only for armv{6|7}
> https://code.videolan.org/videolan/vlc-android/commit/b331627188a2b2902b52266fc9932c2b4f6a619b
---
compile-libvlc.sh | 10 ++++++++--
libvlc/jni/Android.mk | 4 ++++
libvlc/src/org/videolan/libvlc/LibVLC.java | 3 +++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index 58a5e6e..f17e55e 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -653,6 +653,11 @@ fi
echo "Building NDK"
+HAVE_LIBCOMPAT=
+if [ "${ANDROID_API}" = "android-9" ] && [ "${ANDROID_ABI}" = "armeabi-v7a" -o "${ANDROID_ABI}" = "armeabi" ] ; then
+ HAVE_LIBCOMPAT=1
+fi
+
$ANDROID_NDK/ndk-build -C libvlc \
VLC_SRC_DIR="$VLC_SRC_DIR" \
ANDROID_SYS_HEADERS="$ANDROID_SYS_HEADERS" \
@@ -672,11 +677,12 @@ $ANDROID_NDK/ndk-build -C libvlc \
HAVE_64=${HAVE_64} \
NDK_PROJECT_PATH=jni \
NDK_TOOLCHAIN_VERSION=${GCCVER} \
- NDK_DEBUG=${NDK_DEBUG}
+ NDK_DEBUG=${NDK_DEBUG} \
+ HAVE_LIBCOMPAT=${HAVE_LIBCOMPAT}
checkfail "ndk-build failed"
-if [ "${ANDROID_API}" = "android-9" ] && [ "${ANDROID_ABI}" = "armeabi-v7a" -o "${ANDROID_ABI}" = "armeabi" ] ; then
+if [ "${HAVE_LIBCOMPAT}" = "1" ];then
$ANDROID_NDK/ndk-build -C libvlc \
APP_BUILD_SCRIPT=libcompat/Android.mk \
APP_PLATFORM=${ANDROID_API} \
diff --git a/libvlc/jni/Android.mk b/libvlc/jni/Android.mk
index 87c72f4..7bef5c1 100644
--- a/libvlc/jni/Android.mk
+++ b/libvlc/jni/Android.mk
@@ -46,7 +46,9 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
-lmicrodns \
$(EXTRA_LDFLAGS)
+ifeq ($(HAVE_LIBCOMPAT), 1)
LOCAL_SHARED_LIBRARIES:= libcompat.7
+endif
LOCAL_STATIC_LIBRARIES:= libdemuxdump2_plugin
include $(BUILD_SHARED_LIBRARY)
@@ -85,9 +87,11 @@ include $(BUILD_SHARED_LIBRARY)
# DUMMY COMPAT LIB #
####################
+ifeq ($(HAVE_LIBCOMPAT), 1)
include $(CLEAR_VARS)
LOCAL_MODULE := libcompat.7
include $(BUILD_SHARED_LIBRARY)
+endif
################
# PRIVATE LIBS #
diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index f4a6b5a..7a4ce18 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -188,6 +188,9 @@ public class LibVLC extends VLCObject<LibVLC.Event> {
try {
System.loadLibrary("compat.7");
+ } catch (Throwable ignored) {}
+
+ try {
System.loadLibrary("vlc");
System.loadLibrary("vlcjni");
} catch (UnsatisfiedLinkError ule) {
More information about the Android
mailing list