]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add --with-luajit configure option 2338/head
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 8 Mar 2015 15:01:35 +0000 (16:01 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 8 Mar 2015 15:03:52 +0000 (16:03 +0100)
For now we don't do autodetection and you'll need
to explicitly enable it. If it is enabled, we check
for LuaJIT and not for Lua.

configure.ac
m4/pdns_with_luajit.m4 [new file with mode: 0644]

index 85f0c4139b76cd4e721f622f1cfe40f626b91cd7..4f146f572b140d7ae735ccac7a82ebf2cac3ae87 100644 (file)
@@ -42,7 +42,11 @@ AC_DEFINE([_GNU_SOURCE], [1],
   [Define _GNU_SOURCE so that we get all necessary prototypes]
 )
 
-PDNS_WITH_LUA
+PDNS_WITH_LUAJIT
+AS_IF([test "x$with_luajit" = "xno"], [
+  PDNS_WITH_LUA
+])
+
 AX_CXX_COMPILE_STDCXX_11(,optional)
 AM_CONDITIONAL([CXX2011],[test "$HAVE_CXX11" = "1"])
 
diff --git a/m4/pdns_with_luajit.m4 b/m4/pdns_with_luajit.m4
new file mode 100644 (file)
index 0000000..264c082
--- /dev/null
@@ -0,0 +1,18 @@
+AC_DEFUN([PDNS_WITH_LUAJIT],[
+  AC_MSG_CHECKING([whether we will be linking in LuaJIT])
+  AC_ARG_WITH([luajit],
+    [AS_HELP_STRING([--with-luajit], [build LuaJIT bindings @<:@default=auto@:>@])],
+    [with_luajit=$withval],
+    [with_luajit=no]
+  )
+  AC_MSG_RESULT([$with_luajit])
+
+  AS_IF([test "x$with_luajit" = "xyes"], [
+    PKG_CHECK_MODULES([LUA], [luajit],
+      [AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have LuaJIT])],
+      [AC_MSG_ERROR([LuaJIT not found])]
+    )
+  ])
+
+  AM_CONDITIONAL([LUA], [test "x$with_luajit" = "xyes"])
+])