From 9a92758660f91cb9b3c72d82ea2be5422edaefb0 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 14 Jun 2016 13:04:14 +0200 Subject: [PATCH] Check for lua.hpp when using luajit --- configure.ac | 1 + m4/pdns_check_lua_hpp.m4 | 8 ++++++++ m4/pdns_with_lua.m4 | 6 ++---- pdns/dnsdistdist/configure.ac | 1 + pdns/dnsdistdist/m4/pdns_check_lua_hpp.m4 | 1 + pdns/recursordist/configure.ac | 1 + pdns/recursordist/m4/pdns_check_lua_hpp.m4 | 1 + 7 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 m4/pdns_check_lua_hpp.m4 create mode 120000 pdns/dnsdistdist/m4/pdns_check_lua_hpp.m4 create mode 120000 pdns/recursordist/m4/pdns_check_lua_hpp.m4 diff --git a/configure.ac b/configure.ac index 903c37df53..4317fe557a 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,7 @@ PDNS_WITH_LUAJIT AS_IF([test "x$with_luajit" = "xno"], [ PDNS_WITH_LUA ]) +PDNS_CHECK_LUA_HPP AX_CXX_COMPILE_STDCXX_11 diff --git a/m4/pdns_check_lua_hpp.m4 b/m4/pdns_check_lua_hpp.m4 new file mode 100644 index 0000000000..7317153984 --- /dev/null +++ b/m4/pdns_check_lua_hpp.m4 @@ -0,0 +1,8 @@ +AC_DEFUN([PDNS_CHECK_LUA_HPP],[ + AC_REQUIRE([PDNS_WITH_LUA]) + AC_REQUIRE([PDNS_WITH_LUAJIT]) + AS_IF([test "x$LUAPC" != "x" -o "x$LUAJITPC" != "x" ], [ + AC_CHECK_HEADER([lua.hpp], [ have_lua_hpp=y ]) + ]) + AM_CONDITIONAL([HAVE_LUA_HPP], [ test x"$have_lua_hpp" = "xy" ]) +]) diff --git a/m4/pdns_with_lua.m4 b/m4/pdns_with_lua.m4 index 1494e195a0..18bb1b9d8b 100644 --- a/m4/pdns_with_lua.m4 +++ b/m4/pdns_with_lua.m4 @@ -28,10 +28,8 @@ AC_DEFUN([PDNS_WITH_LUA],[ AS_IF([test "x$with_lua" = "xyes"], [AC_MSG_ERROR([cannot find lua])], [AC_MSG_RESULT([not found])] - )], - [AC_MSG_RESULT([$LUAPC]) - AC_CHECK_HEADER([lua.hpp], [ have_lua_hpp=y ]) - AM_CONDITIONAL([HAVE_LUA_HPP], [ test x"$have_lua_hpp" = "xy" ]) + )],[ + AC_MSG_RESULT([$LUAPC]) ]) ]) AM_CONDITIONAL([LUA], [test "x$with_lua" = "xyes"]) diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index f8d183b65e..cded42e425 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -48,6 +48,7 @@ AS_IF([test "x$with_luajit" = "xno"], [ AS_IF([test "x$LUAPC" = "x" -a "x$LUAJITPC" = "x"], [ AC_MSG_ERROR([Neither Lua nor LuaJIT found, Lua support is not optional]) ]) +PDNS_CHECK_LUA_HPP AX_CXX_COMPILE_STDCXX_11([ext], [mandatory]) diff --git a/pdns/dnsdistdist/m4/pdns_check_lua_hpp.m4 b/pdns/dnsdistdist/m4/pdns_check_lua_hpp.m4 new file mode 120000 index 0000000000..4ed8acd723 --- /dev/null +++ b/pdns/dnsdistdist/m4/pdns_check_lua_hpp.m4 @@ -0,0 +1 @@ +../../../m4/pdns_check_lua_hpp.m4 \ No newline at end of file diff --git a/pdns/recursordist/configure.ac b/pdns/recursordist/configure.ac index b376001975..86c0d36e0c 100644 --- a/pdns/recursordist/configure.ac +++ b/pdns/recursordist/configure.ac @@ -89,6 +89,7 @@ PDNS_WITH_LUAJIT AS_IF([test "x$with_luajit" = "xno"], [ PDNS_WITH_LUA ]) +PDNS_CHECK_LUA_HPP PDNS_ENABLE_VERBOSE_LOGGING diff --git a/pdns/recursordist/m4/pdns_check_lua_hpp.m4 b/pdns/recursordist/m4/pdns_check_lua_hpp.m4 new file mode 120000 index 0000000000..4ed8acd723 --- /dev/null +++ b/pdns/recursordist/m4/pdns_check_lua_hpp.m4 @@ -0,0 +1 @@ +../../../m4/pdns_check_lua_hpp.m4 \ No newline at end of file -- 2.47.2