From d0f3cf1389e809cd0b4e5ca658aca6706117b96e Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Sun, 25 Feb 2024 22:01:07 +0100 Subject: [PATCH] Replace obsolete macros --- build/lua.m4 | 21 +++++++++++---------- build/pcre.m4 | 8 +++++--- configure.ac | 3 +-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/build/lua.m4 b/build/lua.m4 index 4780d32fc9..c644ff8af3 100644 --- a/build/lua.m4 +++ b/build/lua.m4 @@ -192,29 +192,30 @@ AC_DEFUN([CHECK_FOR_LUA_AT], [ LUA_DISPLAY="${lua_lib_file}, ${lua_inc_path}" # Double checking version from lua.h... - AC_TRY_COMPILE([ #include > ], - [ #if (LUA_VERSION_NUM < 502) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ], + [ #if (LUA_VERSION_NUM == 502) return 0; #else - #error Lua 5.1 not detected - #endif ], - [ LUA_VERSION=501 ], [ lua_5_1=0 ] + #error Lua 5.2 not detected + #endif ]])], + [ LUA_VERSION=502 ], [ lua_5_2=0 ] ) - AC_TRY_COMPILE([ #include ], - [ #if (LUA_VERSION_NUM == 502) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ], + [ #if (LUA_VERSION_NUM == 502) return 0; #else #error Lua 5.2 not detected - #endif ], + #endif ]])], [ LUA_VERSION=502 ], [ lua_5_2=0 ] ) - AC_TRY_COMPILE([ #include ], + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ], [ #if (LUA_VERSION_NUM == 504) return 0; #else #error Lua 5.4 not detected - #endif ], + #endif ]])], [ LUA_VERSION=504 ], [ lua_5_4=0 ] ) diff --git a/build/pcre.m4 b/build/pcre.m4 index f338aa5022..5575797ff2 100644 --- a/build/pcre.m4 +++ b/build/pcre.m4 @@ -77,9 +77,11 @@ else CFLAGS="${PCRE_CFLAGS} ${CFLAGS}" LDFLAGS="${PCRE_LDADD} ${LDFLAGS}" LIBS="${PCRE_LDADD} ${LIBS}" - AC_TRY_LINK([ #include ], - [ pcre_jit_exec(NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL); ], - [ pcre_jit_available=yes ], [:] + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[ #include ]], + [[ pcre_jit_exec(NULL, NULL, NULL, 0, 0, 0, NULL, 0, NULL); ]])], + [ pcre_jit_available=yes ], + [:] ) if test "x$pcre_jit_available" = "xyes"; then diff --git a/configure.ac b/configure.ac index 66d6f4f2de..32570456a7 100644 --- a/configure.ac +++ b/configure.ac @@ -137,7 +137,6 @@ AM_CONDITIONAL([PCRE2_CFLAGS], [test "PCRE2_CFLAGS" != ""]) # Checks for header files. -AC_HEADER_STDC AC_CHECK_HEADERS([string]) AC_CHECK_HEADERS([iostream]) AC_CHECK_HEADERS([sys/utsname.h]) @@ -304,7 +303,7 @@ fi if test $buildParser = true; then AC_PROG_YACC - AC_PROG_LEX + AC_PROG_LEX(noyywrap) AC_PATH_PROG([FLEX], [flex]) test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build ModSecurity])