summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac15
-rw-r--r--src/CMakeLists.txt10
2 files changed, 18 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 2a6d5de1..d458e159 100644
--- a/configure.ac
+++ b/configure.ac
@@ -921,11 +921,16 @@ if test "$WITH_PCRE2" != no; then
PCRE_LIB="-L$WITH_PCRE2/lib -lpcre2-8"
CPPFLAGS="$CPPFLAGS -I$WITH_PCRE/include"
else
- AC_PATH_PROG([PCRE2CONFIG], [pcre2-config])
- if test -n "$PCRE2CONFIG"; then
- PCRE_LIB=`"$PCRE2CONFIG" --libs8`
- CPPFLAGS="$CPPFLAGS `"$PCRE2CONFIG" --cflags`"
- fi
+ PKG_CHECK_MODULES([PCRE2],[libpcre2-8],[
+ PCRE_LIB="$PCRE2_LIBS"
+ CPPFLAGS="$CPPFLAGS $PCRE2_CFLAGS"
+ ],[
+ AC_PATH_PROG([PCRE2CONFIG], [pcre2-config])
+ if test -n "$PCRE2CONFIG"; then
+ PCRE_LIB=`"$PCRE2CONFIG" --libs8`
+ CPPFLAGS="$CPPFLAGS `"$PCRE2CONFIG" --cflags`"
+ fi
+ ])
fi
if test -z "$PCRE_LIB"; then
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 67b3821c..82d1c351 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -477,8 +477,14 @@ if(WITH_GNUTLS)
endif()
if(WITH_PCRE2)
- ## if we have pcre2-config, use it
- xconfig(pcre2-config PCRE_INCDIR PCRE_LIBDIR PCRE_LDFLAGS PCRE_CFLAGS)
+ pkg_check_modules(PCRE2 libpcre2-8)
+ if(PCRE2_FOUND)
+ set(PCRE_LDFLAGS "${PCRE2_LDFLAGS}")
+ set(PCRE_CFLAGS "${PCRE2_CFLAGS}")
+ else()
+ ## if we have pcre2-config, use it
+ xconfig(pcre2-config PCRE_INCDIR PCRE_LIBDIR PCRE_LDFLAGS PCRE_CFLAGS)
+ endif()
if(PCRE_LDFLAGS OR PCRE_CFLAGS)
message(STATUS "found pcre2 at: LDFLAGS: ${PCRE_LDFLAGS} CFLAGS: ${PCRE_CFLAGS}")