]> granicus.if.org Git - pdns/commitdiff
Add support for using LuaJIT in dnsdist
authorRemi Gacogne <rgacogne-github@coredump.fr>
Mon, 7 Dec 2015 10:28:26 +0000 (11:28 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 7 Dec 2015 10:28:26 +0000 (11:28 +0100)
LuaJIT support can be enabled with --with-luajit during configure.

m4/pdns_with_luajit.m4
pdns/dnsdistdist/configure.ac
pdns/dnsdistdist/m4/dnsdist_lua.m4 [deleted file]
pdns/dnsdistdist/m4/pdns_with_luajit.m4 [new symlink]

index 264c082811478ef671808093dd8ce3975ddbf105..66394732d9358de7e6fa544720b4d5c20da723d6 100644 (file)
@@ -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])]
     )
   ])
 
index 026c9f4ba3ebfe1affc9a98c15d26dd887d5eaa9..ae4bf1b4c023692a6570abd28689e889c215673a 100644 (file)
@@ -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 (file)
index 581802c..0000000
+++ /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 (symlink)
index 0000000..2f9477d
--- /dev/null
@@ -0,0 +1 @@
+../../../m4/pdns_with_luajit.m4
\ No newline at end of file