]> git.puffer.fish Git - mirror/frr.git/commitdiff
configure: Adopt for Lua 5.4
authorDonatas Abraitis <donatas@opensourcerouting.org>
Thu, 9 Jan 2025 07:25:11 +0000 (09:25 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 13 Jan 2025 14:34:14 +0000 (16:34 +0200)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
configure.ac

index e8036fcff1f57d2656b17909ade0edf8ba4379ec..e04c0b6d4693d0411fab9fdc8488dcdc8fbc246d 100644 (file)
@@ -375,26 +375,45 @@ fi
 AM_CONDITIONAL([SCRIPTING], [test "$enable_scripting" = "yes"])
 
 if test "$enable_scripting" = "yes"; then
-   AX_PROG_LUA([5.3], [5.4], [], [
-     AC_MSG_ERROR([Lua 5.3 is required to build with Lua support. No other version is supported.])
+   AX_PROG_LUA([5.3], [], [], [
+     AC_MSG_ERROR([Lua >= 5.3 is required to build with Lua support. No other version is supported.])
    ])
    AX_LUA_HEADERS([], [
-     AC_MSG_ERROR([Lua 5.3 headers are required to build with Lua support. No other version is supported.])
+     AC_MSG_ERROR([Lua >= 5.3 headers are required to build with Lua support. No other version is supported.])
    ])
-   PKG_CHECK_MODULES([LUA], [lua5.3], [
-     AC_DEFINE([HAVE_SCRIPTING], [1], [Have support for scripting])
-     LIBS="$LIBS $LUA_LIBS"
-     SCRIPTING=true
-   ], [
-      AX_LUA_LIBS([
-        AC_DEFINE([HAVE_SCRIPTING], [1], [Have support for scripting])
-        LIBS="$LIBS $LUA_LIB"
-        SCRIPTING=true
-      ], [
-        SCRIPTING=false
-        AC_MSG_ERROR([Lua 5.3 libraries are required to build with Lua support. No other version is supported.])
-      ])
-    ])
+  
+   for version in 5.3 5.4; do
+     PKG_CHECK_MODULES([LUA], [lua >= $version], [
+       AC_DEFINE([HAVE_SCRIPTING], [1], [Have support for scripting])
+         LIBS="$LIBS $LUA_LIBS"
+         SCRIPTING=true
+         break
+     ], [
+       PKG_CHECK_MODULES([LUA], [lua$version], [
+         AC_DEFINE([HAVE_SCRIPTING], [1], [Have support for scripting])
+           LIBS="$LIBS $LUA_LIBS"
+           SCRIPTING=true
+           break
+       ], [
+         PKG_CHECK_MODULES([LUA], [lua-$version], [
+           AC_DEFINE([HAVE_SCRIPTING], [1], [Have support for scripting])
+             LIBS="$LIBS $LUA_LIBS"
+             SCRIPTING=true
+             break
+         ], [])
+       ])
+     ])
+   done
+
+   if [ "$SCRIPTING" != "true" ]; then
+     AX_LUA_LIBS([
+       AC_DEFINE([HAVE_SCRIPTING], [1], [Have support for scripting])
+         LIBS="$LIBS $LUA_LIB"
+         SCRIPTING=true
+     ], [
+       AC_MSG_ERROR([Lua >= 5.3 libraries are required to build with Lua support. No other version is supported.])
+     ])
+   fi
 fi
 
 dnl the following flags go in CFLAGS rather than AC_CFLAGS since they make