From 8c9a91e39f512bf422ccddff67353039f97da343 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 6 Mar 2025 15:48:55 +0000 Subject: [PATCH] configure: Make Lua check work on Fedora, too Signed-off-by: Michael Tremer --- configure.ac | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) 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])]) ], ) -- 2.39.5