PDNS_CHECK_OS
PTHREAD_SET_NAME
-PDNS_WITH_LUA
+PDNS_WITH_LUA([mandatory])
PDNS_CHECK_LUA_HPP
AX_CXX_COMPILE_STDCXX_11
PDNS_CHECK_GEOIP
;;
lua*)
- AS_IF([test "x$with_lua" = "xno"],
- [AC_MSG_ERROR([${a} backend needs lua, run ./configure --with-lua])]
- )
- AS_IF([test "x$LUAPC" = "x"],
- [AC_MSG_ERROR([${a} backend needs lua but we cannot find it])]
- )
+ dnl Lua has been checked above
;;
lmdb)
needlmdb=yes
#include "config.h"
-#if defined(HAVE_LUA)
#include "ext/luawrapper/include/LuaContext.hpp"
-#endif
#include "lua-auth4.hh"
#include "stubresolver.hh"
#include <fstream>
AuthLua4::AuthLua4() { prepareContext(); }
-#if !defined(HAVE_LUA)
-
-bool AuthLua4::updatePolicy(const DNSName &qname, QType qtype, const DNSName &zonename, const DNSPacket& packet) { return false; }
-bool AuthLua4::axfrfilter(const ComboAddress& remote, const DNSName& zone, const DNSResourceRecord& in, vector<DNSResourceRecord>& out) { return false; }
-LuaContext* AuthLua4::getLua() { return nullptr; }
-std::unique_ptr<DNSPacket> AuthLua4::prequery(const DNSPacket& q) { return nullptr; }
-
-AuthLua4::~AuthLua4() { }
-
-void AuthLua4::postPrepareContext()
-{
-}
-
-void AuthLua4::postLoad()
-{
-}
-
-#else
-
LuaContext* AuthLua4::getLua()
{
return d_lw.get();
}
AuthLua4::~AuthLua4() { }
-
-
-#endif
#include "namespaces.hh"
#include "ednssubnet.hh"
#include "lua-base4.hh"
+#include "ext/luawrapper/include/LuaContext.hpp"
#include "dns_random.hh"
BaseLua4::BaseLua4() {
// By default no features
void BaseLua4::getFeatures(Features &) { }
-#if !defined(HAVE_LUA)
-
-void BaseLua4::prepareContext() { return; }
-void BaseLua4::loadStream(std::istream &is) { return; }
-BaseLua4::~BaseLua4() { }
-
-#else
-
-#include "ext/luawrapper/include/LuaContext.hpp"
-
void BaseLua4::prepareContext() {
d_lw = std::unique_ptr<LuaContext>(new LuaContext);
}
BaseLua4::~BaseLua4() { }
-
-#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-
-class LuaContext;
-
-#if defined(HAVE_LUA)
#include "ext/luawrapper/include/LuaContext.hpp"
-#endif
class BaseLua4 : public boost::noncopyable
{
protected:
-#ifdef HAVE_LUA
std::unique_ptr<LuaContext> d_lw; // this is way on top because it must get destroyed _last_
-#endif
public:
BaseLua4();