[vlc-commits] configure: detect hosted Lua 5.3

Rémi Denis-Courmont git at videolan.org
Mon Apr 4 20:28:08 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Apr  4 21:24:30 2016 +0300| [e018379644de6c8208163800dfeb9ac44036d4ee] | committer: Rémi Denis-Courmont

configure: detect hosted Lua 5.3

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

 configure.ac |   51 ++++++++++++++++++++++-----------------------------
 1 file changed, 22 insertions(+), 29 deletions(-)

diff --git a/configure.ac b/configure.ac
index dfcc075..1842021 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1522,34 +1522,27 @@ 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 ],
-    [
-    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 lua >= 5.1 instead])
-      PKG_CHECK_MODULES(LUA, lua >= 5.1,
-        [ have_lua=yes ],
-        [
-          AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
-          have_lua=yes
-          AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h],
-            [],
-            [ have_lua=no ] )
-          AC_CHECK_LIB(  lua5.2 , luaL_newstate,
-            [LUA_LIBS="-llua5.2"],
-          AC_CHECK_LIB( lua5.1 , luaL_newstate,
-            [LUA_LIBS="-llua5.1"],
-            AC_CHECK_LIB( lua51 , luaL_newstate,
-              [LUA_LIBS="-llua51"],
-              AC_CHECK_LIB( lua , luaL_newstate,
-                [LUA_LIBS="-llua"],
-                [ have_lua=no
-                ], [-lm])
-            )))
+  PKG_CHECK_MODULES(LUA, lua5.3, [have_lua=yes], [
+    AC_MSG_WARN([${LUA_PKG_ERRORS}, trying Lua 5.2 instead])
+
+    PKG_CHECK_MODULES(LUA, lua5.2, [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 Lua instead])
+        PKG_CHECK_MODULES(LUA, lua >= 5.1, [have_lua=yes], [
+            AC_MSG_WARN([${LUA_PKG_ERRORS}, trying manual detection instead])
+            have_lua=yes
+            AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h], [], [have_lua=no])
+            AC_CHECK_LIB(lua5.2, luaL_newstate, [LUA_LIBS="-llua5.2"], [
+              AC_CHECK_LIB(lua5.1, luaL_newstate, [LUA_LIBS="-llua5.1"], [
+                AC_CHECK_LIB(lua51, luaL_newstate, [LUA_LIBS="-llua51"], [
+                  AC_CHECK_LIB(lua, luaL_newstate, [LUA_LIBS="-llua"], [
+                    have_lua=no], [-lm])
+                ])
+              ])
+            ])
+          ])
         ])
       ])
     ])
@@ -1557,7 +1550,7 @@ then
       AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.])
   fi
   AC_ARG_VAR([LUAC], [LUA byte compiler])
-  AC_CHECK_PROGS(LUAC, [${LUAC} luac], [false])
+  AC_CHECK_PROGS(LUAC, [${LUAC} luac5.3 luac], [false])
   AS_IF([test "${LUAC}" = "false"], [
     AC_MSG_ERROR([Could not find the LUA byte compiler.])
   ])



More information about the vlc-commits mailing list