configure.ac - lua checks
authorDominique Martinet <asmadeus@via.ecp.fr>
Fri, 28 Aug 2009 11:18:07 +0000 (13:18 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 2 Sep 2009 16:51:19 +0000 (19:51 +0300)
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.

Slightly modified by Rémi Denis-Courmont
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
configure.ac

index 6f0b053..333e542 100644 (file)
@@ -1702,8 +1702,10 @@ then
             AC_CHECK_LIB( lua , luaL_newstate,
               [LUA_LIBS="-llua"],
               [ 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])
           )
         )
       ])