[Android] buildsystem: libvlc: move lua linkage hack

Alexandre Janniaux git at videolan.org
Fri Nov 6 10:25:03 CET 2020


vlc-android | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Sun Oct 25 14:58:32 2020 +0100| [fd4d934ad31d37f3eeaa834214ca16eb0d4ecb6a] | committer: Nicolas Pomepuy

buildsystem: libvlc: move lua linkage hack

In libVLC 3.x, the lua contrib didn't expose a pkg-config file so it
wasn't picked by the pkg-config probing in the compile-libvlc.sh script.

The plan is to expose it on libVLC 4.x, so to keep compatibility with
both version only add the lua link library if the pkg-config file
doesn't exist.

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

 buildsystem/compile-libvlc.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/buildsystem/compile-libvlc.sh b/buildsystem/compile-libvlc.sh
index 2f87071fb..e17e73887 100755
--- a/buildsystem/compile-libvlc.sh
+++ b/buildsystem/compile-libvlc.sh
@@ -645,6 +645,14 @@ rm ${REDEFINED_VLC_MODULES_DIR}/syms
 
 VLC_MODULES=$(avlc_find_modules ${REDEFINED_VLC_MODULES_DIR})
 VLC_CONTRIB_LDFLAGS=$(for i in $(/bin/ls $VLC_CONTRIB/lib/pkgconfig/*.pc); do avlc_pkgconfig --libs $i; done |xargs)
+
+# Lua contrib doesn't expose a pkg-config file with libvlc 3.x and is
+# not probed by the previous command in VLC_CONTRIB_LDFLAGS, so probe
+# whether it was detected or add it manually to the LDFLAGS.
+if ! avlc_pkgconfig --exists lua; then
+    VLC_CONTRIB_LDFLAGS="$VLC_CONTRIB_LDFLAGS '$VLC_CONTRIB/lib/liblua.a'"
+fi
+
 echo -e "ndk-build vlc"
 
 touch $VLC_OUT_PATH/dummy.cpp
@@ -666,7 +674,6 @@ LOCAL_LDLIBS := \
     $(VLC_CONTRIB_LDFLAGS) \
     -ldl -lz -lm -llog \
     -la52 -ljpeg \
-    -llua \
     $(VLC_LDFLAGS)
 LOCAL_CXXFLAGS := -std=c++11
 include $(BUILD_SHARED_LIBRARY)



More information about the Android mailing list