From 4f6c5ee6e7c4b7145e2469c13aabcfa0196b6138 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 8 Mar 2015 16:01:35 +0100 Subject: [PATCH] Add --with-luajit configure option 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 | 6 +++++- m4/pdns_with_luajit.m4 | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 m4/pdns_with_luajit.m4 diff --git a/configure.ac b/configure.ac index 85f0c4139b..4f146f572b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 0000000000..264c082811 --- /dev/null +++ b/m4/pdns_with_luajit.m4 @@ -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"]) +]) -- 2.47.2