From: Michael Tremer Date: Thu, 6 Mar 2025 15:48:55 +0000 (+0000) Subject: configure: Make Lua check work on Fedora, too X-Git-Tag: 0.9.18~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8c9a91e39f512bf422ccddff67353039f97da343;p=location%2Flibloc.git configure: Make Lua check work on Fedora, too Signed-off-by: Michael Tremer --- diff --git a/configure.ac b/configure.ac index 522afc7..550b942 100644 --- a/configure.ac +++ b/configure.ac @@ -198,19 +198,31 @@ AS_IF( PKG_CHECK_MODULES([LUA], [${lua}], [break], [true]) done - AX_PROG_LUA_MODULES([luaunit], [enable_lua_tests=yes], [AC_MSG_WARN([luaunit is missing, won't run tests])]) - LUA_VERSION=$($PKG_CONFIG --variable=major_version ${lua}) + if test -z "${LUA_VERSION}"; then + LUA_VERSION=$($PKG_CONFIG --variable=V ${lua}) + fi + + # Fail if we could not find anything to link against + if test "x${LUA_VERSION}" = "x"; then + AC_MSG_ERROR([Could not find Lua]) + fi + AC_SUBST(LUA_VERSION) + LUA_INSTALL_LMOD=$($PKG_CONFIG --define-variable=prefix=${prefix} --variable=INSTALL_LMOD ${lua}) + if test -z "${LUA_INSTALL_LMOD}"; then + LUA_INSTALL_LMOD="${datadir}/lua/${LUA_VERSION}" + fi AC_SUBST(LUA_INSTALL_LMOD) + LUA_INSTALL_CMOD=$($PKG_CONFIG --define-variable=prefix=${prefix} --variable=INSTALL_CMOD ${lua}) + if test -z "${LUA_INSTALL_CMOD}"; then + LUA_INSTALL_CMOD="${libdir}/lua/${LUA_VERSION}" + fi AC_SUBST(LUA_INSTALL_CMOD) - # Fail if we could not find anything to link against - if test "x${LUA_VERSION}" = "x"; then - AC_MSG_ERROR([Could not find Lua]) - fi + AX_PROG_LUA_MODULES([luaunit], [enable_lua_tests=yes], [AC_MSG_WARN([luaunit is missing, won't run tests])]) ], )