configure: Adopt for Lua 5.4

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2025-01-09 09:25:11 +02:00
parent b330e6d3eb
commit 708f2ca620

View File

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