[vlc-commits] configure.ac: look for lua.pc first

Alexandre Janniaux git at videolan.org
Sat Apr 11 09:13:24 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Apr  6 15:14:05 2020 +0200| [9df09a8b47f0463c56add983bcdcf0ce56360de8] | committer: Alexandre Janniaux

configure.ac: look for lua.pc first

If contrib has been built but is not detected first, contrib includes
were used but the final binaries were linked to another library.

In particular, on Archlinux, when using the default lua (5.3) version,
the contrib would be built but it would still link lua5.3 which has no
symbol for the luaL_register function used when header version is less
than or equal to 5.2.

Instead, check for lua.pc that has the most opportunity to be the
lastest on the system and is also the name of the contrib pkg-config
file when installed.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9df09a8b47f0463c56add983bcdcf0ce56360de8
---

 configure.ac | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 55b898f4fc..a844a7b091 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1859,15 +1859,17 @@ AC_ARG_ENABLE([lua],
     [disable LUA scripting support (default enabled)]))
 if test "${enable_lua}" != "no"
 then
-  PKG_CHECK_MODULES(LUA, lua5.2, [ have_lua=yes ], [])
+  dnl Lua from contrib will install a lua.pc pkg-config file  so this must be
+  dnl checked first to avoid mixing contribs includes and system libs
+  PKG_CHECK_MODULES(LUA, lua >= 5.1, [ have_lua=yes ], [])
 
   AS_IF([test "${have_lua}" != "yes"], [
-    AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
-    PKG_CHECK_MODULES(LUA, lua5.1, [ have_lua=yes ], []) ])
+    AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua5.2 instead])
+    PKG_CHECK_MODULES(LUA, lua5.2, [ have_lua=yes ], []) ])
 
   AS_IF([test "${have_lua}" != "yes"], [
-    AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua >= 5.1 instead])
-    PKG_CHECK_MODULES(LUA, lua >= 5.1, [ have_lua=yes ], []) ])
+    AC_MSG_WARN([${LUA_PKG_ERRORS}, trying lua 5.1 instead])
+    PKG_CHECK_MODULES(LUA, lua5.1, [ have_lua=yes ], []) ])
 
   AS_IF([test "${have_lua}" != "yes"], [
      AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])



More information about the vlc-commits mailing list