From 92585cde9b5938d433738a873c8d44713d005f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Sat, 22 Apr 2023 02:03:48 -0700 Subject: build: prevent pkg-config from overriding PCRE_* settings The use of PCRE_CFLAGS and PCRE_LIBS, as documented in the output of `--help`, is meant to override those settings from pkg-config. * NEWS: mention this * m4/pcre.m4: avoid overriding user provided settings --- m4/pcre.m4 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'm4') diff --git a/m4/pcre.m4 b/m4/pcre.m4 index a8ee55ec..f4c71c73 100644 --- a/m4/pcre.m4 +++ b/m4/pcre.m4 @@ -21,7 +21,10 @@ AC_DEFUN([gl_FUNC_PCRE], use_pcre=no if test $test_pcre != no; then - PKG_CHECK_MODULES([PCRE], [libpcre2-8], [], [: ${PCRE_LIBS=-lpcre2-8}]) + + if test -z "$PCRE_CFLAGS" && test -z "$PCRE_LIBS"; then + PKG_CHECK_MODULES([PCRE], [libpcre2-8], [], [: ${PCRE_LIBS=-lpcre2-8}]) + fi AC_CACHE_CHECK([for pcre2_compile], [pcre_cv_have_pcre2_compile], [pcre_saved_CFLAGS=$CFLAGS -- cgit v1.2.1