]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Allow re2 detection without .pc file
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 17 Aug 2016 10:11:23 +0000 (12:11 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 17 Aug 2016 11:57:31 +0000 (13:57 +0200)
pdns/dnsdistdist/m4/pdns_check_re2.m4

index e4a8c9ff63d81acb4a972e268ed6f3e9301b5e56..bb5889ac24f7d34ba206c724362a5e61c3176565 100644 (file)
@@ -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.])])
 ])