]> git.ipfire.org Git - location/libloc.git/commitdiff
configure: Make Lua check work on Fedora, too
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Mar 2025 15:48:55 +0000 (15:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Mar 2025 15:48:55 +0000 (15:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
configure.ac

index 522afc7e2a11e54c8b636364ecde919bd0d95227..550b942680a4afa3e89783ccd17c9463126ddcf3 100644 (file)
@@ -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])])
        ],
 )