summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>2023-04-22 02:03:48 -0700
committerJim Meyering <meyering@meta.com>2023-04-22 21:29:57 -0700
commit92585cde9b5938d433738a873c8d44713d005f2c (patch)
treeab9a35f58c2eee48a93a05fae6f6b2f53e990115 /m4
parent0f2c2c256fd807f5ecd744135e3734b8dfa1b7b1 (diff)
downloadgrep-92585cde9b5938d433738a873c8d44713d005f2c.tar.gz
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
Diffstat (limited to 'm4')
-rw-r--r--m4/pcre.m45
1 files changed, 4 insertions, 1 deletions
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