From 99272f1ffaf86cbe7f2a190d4b3591c50fac7a02 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 17 Aug 2016 12:11:23 +0200 Subject: [PATCH] dnsdist: Allow re2 detection without .pc file --- pdns/dnsdistdist/m4/pdns_check_re2.m4 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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.])]) ]) -- 2.47.3