--- configure.in +++ configure.in @@ -36,22 +36,24 @@ dnl Debian, and possibly other systems, LUA_CFLAGS="`[$LUACONFIG --include]`" LUA_LIBS="`[$LUACONFIG --static]`" else dnl ...otherwise, attempt to guess - LUA_CFLAGS="" - LUA_LIBS="" - AC_CHECK_LIB(lua, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua", - [AC_CHECK_LIB(lua50, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua50", - [AC_CHECK_LIB(lua5.0, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua5.0", - [AC_MSG_ERROR([*** Lua5 is required. - Try --with-lua=PREFIX - You can download lua from http://www.lua.org])], - $LUA_LIBS)], $LUA_LIBS)], $LUA_LIBS) - - AC_CHECK_LIB(lualib, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib", - [AC_CHECK_LIB(lualib50, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib50", - [AC_CHECK_LIB(lualib5.0, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib5.0", - [AC_MSG_ERROR([*** Lualib5 is required. - You can download lua from http://www.lua.org])], - $LUA_LIBS)], $LUA_LIBS)], $LUA_LIBS) + PKG_CHECK_MODULES(LUA, lua, [], [ + LUA_CFLAGS="" + LUA_LIBS="" + AC_CHECK_LIB(lua, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua", + [AC_CHECK_LIB(lua50, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua50", + [AC_CHECK_LIB(lua5.0, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua5.0", + [AC_MSG_ERROR([*** Lua5 is required. + Try --with-lua=PREFIX + You can download lua from http://www.lua.org])], + $LUA_LIBS)], $LUA_LIBS)], $LUA_LIBS) + + AC_CHECK_LIB(lualib, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib", + [AC_CHECK_LIB(lualib50, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib50", + [AC_CHECK_LIB(lualib5.0, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib5.0", + [AC_MSG_ERROR([*** Lualib5 is required. + You can download lua from http://www.lua.org])], + $LUA_LIBS)], $LUA_LIBS)], $LUA_LIBS) + ]) fi fi AC_SUBST(LUA_CFLAGS)