[vlc-devel] [PATCH] configure.ac - lua checks

Dominique Martinet asmadeus at via.ecp.fr
Fri Aug 28 13:18:07 CEST 2009


makes the configure throw an error when lua is not found and
--enable-lua has been specified.
also checks for liblua with libmath, so it actually works when there
is no pkgconfig file.

---
 configure.ac |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 748bb21..0989af1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1702,15 +1702,17 @@ then
           [ have_lua=no ] )
         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"],
+          AC_CHECK_LIB( lua51, luaL_newstate,
+            [LUA_LIBS="-llua51 -lm"],
+            AC_CHECK_LIB( lua, luaL_newstate,
+              [LUA_LIBS="-llua -lm"],
               [ have_lua=no
-                AC_MSG_WARN([lua >= 5.1 not found!])
-              ])
-          )
-        )
+                AS_IF([test "x${enable_lua}" = "xyes"],
+                  [AC_MSG_ERROR([lua >= 5.1 not found!])],
+                  [AC_MSG_WARN([lua >= 5.1 not found!])])
+              ], -lm)
+          , -lm)
+        , -lm)
       ])
     ])
   if test "x${have_lua}" = "xyes" ;  then
-- 
1.6.3.3




More information about the vlc-devel mailing list