Commit e6c7d058 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Move libvlcjni.so compilation to compile-libvlc.sh

parent a933dc0a
...@@ -26,19 +26,12 @@ LIBVLC_LIBS += libanw.10 libanw.13 libanw.14 libanw.18 libanw.21 ...@@ -26,19 +26,12 @@ LIBVLC_LIBS += libanw.10 libanw.13 libanw.14 libanw.18 libanw.21
LIBVLCJNI= $(addprefix $(SRC)/obj/local/$(ARCH)/,$(addsuffix .so,$(LIBVLC_LIBS))) LIBVLCJNI= $(addprefix $(SRC)/obj/local/$(ARCH)/,$(addsuffix .so,$(LIBVLC_LIBS)))
LIBVLCJNI_H=$(SRC)/jni/libvlcjni.h
PRIVATE_LIBDIR=android-libs PRIVATE_LIBDIR=android-libs
PRIVATE_LIBS=$(PRIVATE_LIBDIR)/libstagefright.so $(PRIVATE_LIBDIR)/libmedia.so $(PRIVATE_LIBDIR)/libutils.so $(PRIVATE_LIBDIR)/libcutils.so $(PRIVATE_LIBDIR)/libbinder.so $(PRIVATE_LIBDIR)/libui.so $(PRIVATE_LIBDIR)/libhardware.so PRIVATE_LIBS=$(PRIVATE_LIBDIR)/libstagefright.so $(PRIVATE_LIBDIR)/libmedia.so $(PRIVATE_LIBDIR)/libutils.so $(PRIVATE_LIBDIR)/libcutils.so $(PRIVATE_LIBDIR)/libbinder.so $(PRIVATE_LIBDIR)/libui.so $(PRIVATE_LIBDIR)/libhardware.so
ifneq ($(V),)
ANT_OPTS += -v ANT_OPTS += -v
VERBOSE = VERBOSE =
GEN = GEN =
else
VERBOSE = @
GEN = @echo "Generating" $@;
endif
ifeq ($(RELEASE),1) ifeq ($(RELEASE),1)
ANT_TARGET = release ANT_TARGET = release
...@@ -64,22 +57,6 @@ endef ...@@ -64,22 +57,6 @@ endef
$(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES) $(VLC_APK): $(LIBVLCJNI) $(JAVA_SOURCES)
$(call build_apk) $(call build_apk)
VLC_MODULES=`./find_modules.sh $(VLC_BUILD_DIR)`
$(LIBVLCJNI_H):
$(VERBOSE)if [ -z "$(VLC_BUILD_DIR)" ]; then echo "VLC_BUILD_DIR not defined" ; exit 1; fi
$(GEN)modules="$(VLC_MODULES)" ; \
if [ -z "$$modules" ]; then echo "No VLC modules found in $(VLC_BUILD_DIR)/modules"; exit 1; fi; \
DEFINITION=""; \
BUILTINS="const void *vlc_static_modules[] = {\n"; \
for file in $$modules; do \
name=`echo $$file | sed 's/.*\.libs\/lib//' | sed 's/_plugin\.a//'`; \
DEFINITION=$$DEFINITION"int vlc_entry__$$name (int (*)(void *, void *, int, ...), void *);\n"; \
BUILTINS="$$BUILTINS vlc_entry__$$name,\n"; \
done; \
BUILTINS="$$BUILTINS NULL\n};\n"; \
printf "/* Autogenerated from the list of modules */\n $$DEFINITION\n $$BUILTINS\n" > $@
$(PRIVATE_LIBDIR)/%.so: $(PRIVATE_LIBDIR)/%.c $(PRIVATE_LIBDIR)/%.so: $(PRIVATE_LIBDIR)/%.c
$(GEN)$(TARGET_TUPLE)-gcc $< -shared -o $@ --sysroot=$(SYSROOT) $(GEN)$(TARGET_TUPLE)-gcc $< -shared -o $@ --sysroot=$(SYSROOT)
...@@ -87,30 +64,6 @@ $(PRIVATE_LIBDIR)/%.c: $(PRIVATE_LIBDIR)/%.symbols ...@@ -87,30 +64,6 @@ $(PRIVATE_LIBDIR)/%.c: $(PRIVATE_LIBDIR)/%.symbols
$(VERBOSE)rm -f $@ $(VERBOSE)rm -f $@
$(GEN)for s in `cat $<`; do echo "void $$s() {}" >> $@; done $(GEN)for s in `cat $<`; do echo "void $$s() {}" >> $@; done
$(LIBVLCJNI): $(JNI_SOURCES) $(LIBVLCJNI_H) $(PRIVATE_LIBS)
@if [ -z "$(VLC_BUILD_DIR)" ]; then echo "VLC_BUILD_DIR not defined" ; exit 1; fi
@if [ -z "$(ANDROID_NDK)" ]; then echo "ANDROID_NDK not defined" ; exit 1; fi
@echo
@echo "=== Building libvlcjni ==="
@echo
$(VERBOSE)if [ -z "$(VLC_SRC_DIR)" ] ; then VLC_SRC_DIR=./vlc; fi ; \
if [ -z "$(VLC_CONTRIB)" ] ; then VLC_CONTRIB="$$VLC_SRC_DIR/contrib/$(TARGET_TUPLE)"; fi ; \
vlc_modules="$(VLC_MODULES)" ; \
if [ `echo "$(VLC_BUILD_DIR)" | head -c 1` != "/" ] ; then \
vlc_modules="`echo $$vlc_modules|sed \"s|$(VLC_BUILD_DIR)|../$(VLC_BUILD_DIR)|g\"`" ; \
VLC_BUILD_DIR="../$(VLC_BUILD_DIR)"; \
fi ; \
[ `echo "$$VLC_CONTRIB" | head -c 1` != "/" ] && VLC_CONTRIB="../$$VLC_CONTRIB"; \
[ `echo "$$VLC_SRC_DIR" | head -c 1` != "/" ] && VLC_SRC_DIR="../$$VLC_SRC_DIR"; \
$(ANDROID_NDK)/ndk-build -C $(SRC) \
VLC_SRC_DIR="$$VLC_SRC_DIR" \
VLC_CONTRIB="$$VLC_CONTRIB" \
VLC_BUILD_DIR="$$VLC_BUILD_DIR" \
VLC_MODULES="$$vlc_modules" \
NDK_DEBUG=$(NDK_DEBUG) \
TARGET_CFLAGS="$$VLC_EXTRA_CFLAGS" \
LIBVLC_LIBS="$(LIBVLC_LIBS)"
apk: apk:
$(call build_apk) $(call build_apk)
...@@ -126,7 +79,7 @@ clean: lightclean ...@@ -126,7 +79,7 @@ clean: lightclean
rm -rf $(APP_SRC)/gen java-libs/*/gen java-libs/*/bin .sdk vlc-sdk/ vlc-sdk.7z rm -rf $(APP_SRC)/gen java-libs/*/gen java-libs/*/bin .sdk vlc-sdk/ vlc-sdk.7z
jniclean: lightclean jniclean: lightclean
rm -rf $(LIBVLCJNI) $(LIBVLCJNI_H) $(APP_SRC)/libs/ rm -rf $(LIBVLCJNI) $(APP_SRC)/libs/
distclean: clean jniclean distclean: clean jniclean
......
...@@ -429,3 +429,34 @@ cd ../.. ...@@ -429,3 +429,34 @@ cd ../..
###################################################################################### ######################################################################################
echo "Generating static module list"
VLC_MODULES=`./find_modules.sh vlc/$VLC_BUILD_DIR`
echo $VLC_MODULES
DEFINITION="";
BUILTINS="const void *vlc_static_modules[] = {\n";
for file in $VLC_MODULES; do
name=`echo $file | sed 's/.*\.libs\/lib//' | sed 's/_plugin\.a//'`; \
DEFINITION=$DEFINITION"int vlc_entry__$name (int (*)(void *, void *, int, ...), void *);\n"; \
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.h
echo "Generating static modules object files"
echo $VLC_BUILD_DIR
LIBVLC_LIBS="libvlcjni"
VLC_MODULES=`echo $VLC_MODULES|sed "s|vlc/$VLC_BUILD_DIR|../vlc/$VLC_BUILD_DIR|g"`
VLC_SRC_DIR="../vlc"
VLC_CONTRIB="$VLC_SRC_DIR/contrib/$TARGET_TUPLE"
$ANDROID_NDK/ndk-build -C libvlc \
VLC_SRC_DIR="$VLC_SRC_DIR" \
VLC_BUILD_DIR="$VLC_SRC_DIR/$VLC_BUILD_DIR" \
VLC_CONTRIB="$VLC_CONTRIB" \
VLC_MODULES="$VLC_MODULES" \
TARGET_CFLAGS="$VLC_EXTRA_CFLAGS" \
LIBVLC_LIBS="$LIBVLC_LIBS" V=1
...@@ -170,7 +170,6 @@ export ANDROID_SYS_HEADERS=${PWD}/android-headers # Android.mk ...@@ -170,7 +170,6 @@ export ANDROID_SYS_HEADERS=${PWD}/android-headers # Android.mk
export ANDROID_LIBS=${PWD}/android-libs # Android.mk export ANDROID_LIBS=${PWD}/android-libs # Android.mk
export VLC_BUILD_DIR=vlc/build-android-${TARGET_TUPLE} # Android.mk export VLC_BUILD_DIR=vlc/build-android-${TARGET_TUPLE} # Android.mk
make $CLEAN
make -j1 TARGET_TUPLE=$TARGET_TUPLE SYSROOT=$SYSROOT GCCVER=$GCCVER RELEASE=$RELEASE $TARGET make -j1 TARGET_TUPLE=$TARGET_TUPLE SYSROOT=$SYSROOT GCCVER=$GCCVER RELEASE=$RELEASE $TARGET
# #
......
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