From: Remi Gacogne Date: Mon, 7 Dec 2015 10:28:26 +0000 (+0100) Subject: Add support for using LuaJIT in dnsdist X-Git-Tag: dnsdist-1.0.0-alpha1~105^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15e9de5a7b29bbe6be0bc473abb2129f06833aa2;p=pdns Add support for using LuaJIT in dnsdist LuaJIT support can be enabled with --with-luajit during configure. --- diff --git a/m4/pdns_with_luajit.m4 b/m4/pdns_with_luajit.m4 index 264c08281..66394732d 100644 --- a/m4/pdns_with_luajit.m4 +++ b/m4/pdns_with_luajit.m4 @@ -8,9 +8,13 @@ AC_DEFUN([PDNS_WITH_LUAJIT],[ AC_MSG_RESULT([$with_luajit]) AS_IF([test "x$with_luajit" = "xyes"], [ + LUAJITPC="$with_luajit" PKG_CHECK_MODULES([LUA], [luajit], [AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have LuaJIT])], - [AC_MSG_ERROR([LuaJIT not found])] + [LUAJITPC=""] + ) + AS_IF([test "x$LUAJITPC" = "x"], [ + AC_MSG_ERROR([LuaJIT not found])] ) ]) diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index 026c9f4ba..ae4bf1b4c 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -13,7 +13,15 @@ BOOST_REQUIRE([1.35]) BOOST_FOREACH AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp']) AC_SUBST([YAHTTP_LIBS], ['-L$(top_builddir)/ext/yahttp/yahttp -lyahttp']) -DNSDIST_LUA + +PDNS_WITH_LUAJIT +AS_IF([test "x$with_luajit" = "xno"], [ + PDNS_WITH_LUA +]) +AS_IF([test "x$LUAPC" = "x" -a "x$LUAJITPC" = "x"], [ + AC_MSG_ERROR([Neither Lua nor LuaJIT found, Lua support is not optional]) +]) + AX_CXX_COMPILE_STDCXX_11(ext,mandatory) AC_DEFINE([HAVE_MBEDTLS2], [1], [Defined if mbed TLS version 2.x.x is used]) diff --git a/pdns/dnsdistdist/m4/dnsdist_lua.m4 b/pdns/dnsdistdist/m4/dnsdist_lua.m4 deleted file mode 100644 index 581802c20..000000000 --- a/pdns/dnsdistdist/m4/dnsdist_lua.m4 +++ /dev/null @@ -1,39 +0,0 @@ -AC_DEFUN([DNSDIST_LUA],[ - AC_MSG_CHECKING([which version of Lua will be linked against]) - AC_ARG_WITH([lua], - [AS_HELP_STRING([--with-lua], [Lua version to build against @<:@default=auto@:>@])], - [with_lua=$withval], - [with_lua=auto] - ) - AC_MSG_RESULT([$with_lua]) - - AS_IF([test "x$with_lua" != "xno"],[ - AS_IF([test "x$with_lua" = "xyes" -o "x$with_lua" = "xauto"],[ - for LUAPC in lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua; do - PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [ - AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have lua]) - with_lua=yes - ],[ - LUAPC="" # otherwise pkg_check will fail - ]) - if test "x$LUA_LIBS" != "x"; then break; fi - done - ],[ - LUAPC="$with_lua" - PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [ - AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have Lua]) - with_lua=yes - ]) - ]) - AC_MSG_CHECKING([for chosen LUA]) - AS_IF([test "x$LUAPC" = "x"], [ - AC_MSG_ERROR([no Lua found]) - ],[ - AC_MSG_RESULT([$LUAPC]) - ]) - ],[ - AC_MSG_ERROR([Lua is not optional]) - ]) - AM_CONDITIONAL([LUA], [test "x$with_lua" = "xyes"]) -]) - diff --git a/pdns/dnsdistdist/m4/pdns_with_luajit.m4 b/pdns/dnsdistdist/m4/pdns_with_luajit.m4 new file mode 120000 index 000000000..2f9477d62 --- /dev/null +++ b/pdns/dnsdistdist/m4/pdns_with_luajit.m4 @@ -0,0 +1 @@ +../../../m4/pdns_with_luajit.m4 \ No newline at end of file