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>
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])
)
)
])