Commit 6d86f206 authored by Thomas Guillem's avatar Thomas Guillem

build: split vlcjni into 2 libs: vlc and vlcjni

parent 59175896
......@@ -619,19 +619,23 @@ EOF
BUILTINS="$BUILTINS vlc_entry__$name,\n";
done;
BUILTINS="$BUILTINS NULL\n};\n"; \
printf "/* Autogenerated from the list of modules */\n$DEFINITION\n$BUILTINS\n" > libvlc/jni/libvlcjni-modules.h
rm ${REDEFINED_VLC_MODULES_DIR}/syms
printf "/* Autogenerated from the list of modules */\n#include <unistd.h>\n$DEFINITION\n$BUILTINS\n" > libvlc/jni/libvlcjni-modules.c
DEFINITION=""
BUILTINS="const void *libvlc_functions[] = {\n";
for func in `cat vlc/lib/libvlc.sym`
do
DEFINITION=$DEFINITION"int $func(void);\n";
BUILTINS="$BUILTINS $func,\n";
done
BUILTINS="$BUILTINS NULL\n};\n"; \
printf "/* Autogenerated from the list of modules */\n#include <unistd.h>\n$DEFINITION\n$BUILTINS\n" > libvlc/jni/libvlcjni-symbols.c
# Generating the .ver file like libvlc.so upstream
VER_FILE="vlc/$VLC_BUILD_DIR/lib/.libs/libvlc.ver"
echo "{ global:" > $VER_FILE
cat vlc/lib/libvlc.sym libvlc/libvlcjni.sym | sed -e "s/\(.*\)/\1;/" >> $VER_FILE
echo "__gmp_binvert_limb_table;" >> $VER_FILE # FIXME
echo "local: *; };" >> $VER_FILE
rm ${REDEFINED_VLC_MODULES_DIR}/syms
###############################
# NDK-Build for libvlcjni.so #
###############################
############################################
# NDK-Build for libvlc.so and libvlcjni.so #
############################################
LIBVLC_LIBS="libvlcjni"
VLC_MODULES=$(find_modules ${REDEFINED_VLC_MODULES_DIR})
......@@ -661,7 +665,7 @@ $ANDROID_NDK/ndk-build -C libvlc \
VLC_CONTRIB="$VLC_CONTRIB" \
VLC_MODULES="$VLC_MODULES" \
TARGET_CFLAGS="$EXTRA_CFLAGS" \
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-soname -Wl,libvlc.so.5 -Wl,-version-script -Wl,$SRC_DIR/$VER_FILE" \
EXTRA_LDFLAGS="$EXTRA_LDFLAGS" \
LIBVLC_LIBS="$LIBVLC_LIBS" \
LIBIOMX_LIBS="$LIBIOMX_LIBS" \
LIBANW_LIBS="$LIBANW_LIBS" \
......
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
ANDROID_PRIVATE_LIBDIR := $(LOCAL_PATH)/../../android-libs
LOCAL_MODULE := libvlcjni
LOCAL_SRC_FILES := libvlcjni.c
LOCAL_SRC_FILES += libvlcjni-mediaplayer.c
LOCAL_SRC_FILES += libvlcjni-vlcobject.c
LOCAL_SRC_FILES += libvlcjni-media.c libvlcjni-medialist.c libvlcjni-mediadiscoverer.c
LOCAL_SRC_FILES += libvlcjni-dialog.c
LOCAL_SRC_FILES += native_crash_handler.c thumbnailer.c
LOCAL_SRC_FILES += std_logger.c
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include
include $(CLEAR_VARS)
LOCAL_MODULE := libvlc
ARCH=$(APP_ABI)
LOCAL_CFLAGS := -std=gnu99
ifeq ($(ARCH), armeabi)
LOCAL_CFLAGS += -DHAVE_ARMEABI
# Needed by ARMv6 Thumb1 (the System Control coprocessor/CP15 is mandatory on ARMv6)
# On newer ARM architectures we can use Thumb2
LOCAL_ARM_MODE := arm
endif
ifeq ($(ARCH), armeabi-v7a)
LOCAL_CFLAGS += -DHAVE_ARMEABI_V7A
endif
LOCAL_SRC_FILES += libvlcjni-modules.c libvlcjni-symbols.c
LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
$(VLC_MODULES) \
$(VLC_BUILD_DIR)/lib/.libs/libvlc.a \
......@@ -56,8 +38,37 @@ LOCAL_LDLIBS := -L$(VLC_CONTRIB)/lib \
$(EXTRA_LDFLAGS)
LOCAL_SHARED_LIBRARIES:= libcompat.7
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libvlcjni
LOCAL_SRC_FILES := libvlcjni.c
LOCAL_SRC_FILES += libvlcjni-mediaplayer.c
LOCAL_SRC_FILES += libvlcjni-vlcobject.c
LOCAL_SRC_FILES += libvlcjni-media.c libvlcjni-medialist.c libvlcjni-mediadiscoverer.c
LOCAL_SRC_FILES += libvlcjni-dialog.c
LOCAL_SRC_FILES += native_crash_handler.c thumbnailer.c
LOCAL_SRC_FILES += std_logger.c
LOCAL_LDLIBS := -llog
LOCAL_C_INCLUDES := $(VLC_SRC_DIR)/include
ARCH=$(APP_ABI)
LOCAL_CFLAGS := -std=gnu99
ifeq ($(ARCH), armeabi)
LOCAL_CFLAGS += -DHAVE_ARMEABI
# Needed by ARMv6 Thumb1 (the System Control coprocessor/CP15 is mandatory on ARMv6)
# On newer ARM architectures we can use Thumb2
LOCAL_ARM_MODE := arm
endif
ifeq ($(ARCH), armeabi-v7a)
LOCAL_CFLAGS += -DHAVE_ARMEABI_V7A
endif
LOCAL_SHARED_LIBRARIES:= libvlc
$(TARGET_OUT)/$(LOCAL_MODULE).so: $(ANDROID_PRIVATE_LIBS)
include $(BUILD_SHARED_LIBRARY)
####################
......
......@@ -188,6 +188,7 @@ public class LibVLC extends VLCObject<LibVLC.Event> {
}
try {
System.loadLibrary("vlc");
System.loadLibrary("vlcjni");
} catch (UnsatisfiedLinkError ule) {
Log.e(TAG, "Can't load vlcjni library: " + ule);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment