From: Pieter Lexis Date: Wed, 17 Aug 2016 10:11:23 +0000 (+0200) Subject: dnsdist: Allow re2 detection without .pc file X-Git-Tag: rec-4.0.2~16^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99272f1ffaf86cbe7f2a190d4b3591c50fac7a02;p=thirdparty%2Fpdns.git dnsdist: Allow re2 detection without .pc file --- diff --git a/pdns/dnsdistdist/m4/pdns_check_re2.m4 b/pdns/dnsdistdist/m4/pdns_check_re2.m4 index e4a8c9ff63..bb5889ac24 100644 --- a/pdns/dnsdistdist/m4/pdns_check_re2.m4 +++ b/pdns/dnsdistdist/m4/pdns_check_re2.m4 @@ -1,4 +1,5 @@ AC_DEFUN([PDNS_CHECK_RE2], [ + HAVE_RE2=0 AC_MSG_CHECKING([if we should compile in libre2 for dnsdist]) AC_ARG_ENABLE([re2], [AS_HELP_STRING([--enable-re2],[enable libre2 @<:@default=no@:>@])], [enable_re2=$enableval], @@ -6,8 +7,16 @@ AC_DEFUN([PDNS_CHECK_RE2], [ ) AC_MSG_RESULT([$enable_re2]) AS_IF([test "x$enable_re2" = "xyes"], [ - PKG_CHECK_MODULES([RE2], [re2], [HAVE_RE2=1], [AC_MSG_ERROR([Could not find libre2])]) - ], [HAVE_RE2=0]) + PKG_CHECK_MODULES([RE2], [re2], [ + HAVE_RE2=1 ], [ + AC_CHECK_HEADER([re2/re2.h], [ + AC_CHECK_LIB([re2], [main], [ + HAVE_RE2=1 + RE2_LIBS="-lre2" ], [ : ]) + ]) + ]) + AS_IF([test "$HAVE_RE2" -ne 1], [AC_MSG_ERROR([Could not find libre2])]) + ]) AM_CONDITIONAL([HAVE_RE2], [test "$HAVE_RE2" -eq 1]) AS_IF([test "$HAVE_RE2" -eq 1], [AC_DEFINE([HAVE_RE2], [1], [Define if using RE2.])]) ])