Browse Source

[build] pcre2: use pkg-config before pcre2-config

master
Glenn Strauss 5 months ago
parent
commit
fa82e03749
  1. 15
      configure.ac
  2. 10
      src/CMakeLists.txt

15
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

10
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}")

Loading…
Cancel
Save