From: Pieter Lexis Date: Fri, 5 Jun 2015 07:45:07 +0000 (+0200) Subject: dnsdist: fail if no Lua is found during configure X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~79^2~3^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6308e90a87a014baf9a29cc360418c73232bb37b;p=pdns dnsdist: fail if no Lua is found during configure Fixes #2564 --- diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index d795a89c6..c3a567f97 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -13,7 +13,7 @@ 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']) -PDNS_WITH_LUA +DNSDIST_LUA AX_CXX_COMPILE_STDCXX_11(ext,mandatory) AC_CONFIG_FILES([Makefile diff --git a/pdns/dnsdistdist/m4/dnsdist_lua.m4 b/pdns/dnsdistdist/m4/dnsdist_lua.m4 new file mode 100644 index 000000000..581802c20 --- /dev/null +++ b/pdns/dnsdistdist/m4/dnsdist_lua.m4 @@ -0,0 +1,39 @@ +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/populate b/pdns/dnsdistdist/populate index 12f9a1eb0..66f7b6096 100755 --- a/pdns/dnsdistdist/populate +++ b/pdns/dnsdistdist/populate @@ -16,7 +16,6 @@ ln -fs ../../../m4/pdns_check_libsodium.m4 m4/ ln -fs ../../../m4/pdns_check_readline.m4 m4/ ln -fs ../../../m4/ax_lib_readline.m4 m4/ ln -fs ../../../m4/boost.m4 m4/ -ln -fs ../../../m4/pdns_with_lua.m4 m4/ ln -fs ../../../m4/ax_cxx_compile_stdcxx_11.m4 m4/ ln -fs ../../../m4/pdns_check_clock_gettime.m4 m4/