From 8abb66e356c5ca1aafffcfb50f8d0d5b748ada2c Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Sun, 25 Oct 2020 14:58:32 +0100 Subject: [PATCH] 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. (cherry picked from 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)