From e3c8fcfba95eab4239ba9754219d7bf060e5a0f5 Mon Sep 17 00:00:00 2001 From: Victor Hora Date: Thu, 20 Sep 2018 15:44:52 -0400 Subject: [PATCH] Allow LuaJIT 2.1 to be used --- CHANGES | 2 ++ build/lua.m4 | 3 ++- src/engine/lua.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 5099c95312..908113be3f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ v3.0.3 - YYYY-MMM-DD (to be released) ------------------------------------- + - Allow LuaJIT 2.1 to be used + [Issue #1909 - @victorhora, @mdunc] - Fix: function m.setvar in Lua scripts and add testcases [Issue #1859 - @nowaits, @victorhora] - Fix SecResponseBodyAccess and ctl:requestBodyAccess directives diff --git a/build/lua.m4 b/build/lua.m4 index 75b2352011..49a54b4852 100644 --- a/build/lua.m4 +++ b/build/lua.m4 @@ -68,7 +68,8 @@ else case $LUA_PKG_VERSION in (5.1*) LUA_CFLAGS="-DWITH_LUA_5_1 ${LUA_CFLAGS}" ; lua_5_1=1 ;; (5.2*) LUA_CFLAGS="-DWITH_LUA_5_2 ${LUA_CFLAGS}" ; lua_5_2=1 ;; - (2.*) LUA_CFLAGS="-DWITH_LUA_5_1 ${LUA_CFLAGS}" ; lua_5_1=1 ;; + (2.0*) LUA_CFLAGS="-DWITH_LUA_5_1 ${LUA_CFLAGS}" ; lua_5_1=1 ;; + (2.1*) LUA_CFLAGS="-DWITH_LUA_5_1 -DWITH_LUA_JIT_2_1 ${LUA_CFLAGS}" ; lua_5_1=1 ;; esac AC_MSG_NOTICE([LUA pkg-config version: ${LUA_PKG_VERSION}]) fi diff --git a/src/engine/lua.h b/src/engine/lua.h index b0972dfc10..b1b77e2d2f 100644 --- a/src/engine/lua.h +++ b/src/engine/lua.h @@ -102,7 +102,7 @@ static const struct luaL_Reg mscLuaLib[] = { } // namespace modsecurity #ifdef WITH_LUA -#if defined LUA_VERSION_NUM && LUA_VERSION_NUM < 502 +#if defined LUA_VERSION_NUM && LUA_VERSION_NUM < 502 && !defined WITH_LUA_JIT_2_1 /* ** Adapted from Lua 5.2.0 */