From 29af16abf1d9c324dd118a3918d9ed6d3668788c Mon Sep 17 00:00:00 2001 From: Ihor Aleksandrychiev Date: Wed, 4 Nov 2026 19:50:01 +0200 Subject: [PATCH] Added PCRE2 declarations check to configure.ac libutils/buffer.c uses PCRE2_SUBSTITUTE_MATCHED and PCRE2_SUBSTITUTE_LITERAL (PCRE2 10.34+). configure only checked that PCRE2 exists, so with an older PCRE2 (RHEL 8 ships 10.32) the build failed later in buffer.c. Added AC_CHECK_DECLS for both so configure fails early. Ticket: ENT-14716 Changelog: none Signed-off-by: Ihor Aleksandrychiev --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 04a6ab31..71091eb8 100644 --- a/configure.ac +++ b/configure.ac @@ -329,7 +329,14 @@ if test "x$with_pcre" != "xno" && test "x$with_pcre2" != "xno"; then [], AC_MSG_ERROR(Cannot find PCRE2), [#define PCRE2_CODE_UNIT_WIDTH 8] - )] + ) + dnl libutils/buffer.c uses these substitute options (PCRE2 10.34+). + dnl core's ci/dependencies.sh reads this line to check the system PCRE2 has them. + AC_CHECK_DECLS([PCRE2_SUBSTITUTE_MATCHED, PCRE2_SUBSTITUTE_LITERAL], [], + [AC_MSG_ERROR(This release of CFEngine requires PCRE2 with PCRE2_SUBSTITUTE_MATCHED and PCRE2_SUBSTITUTE_LITERAL (10.34+))], + [[#define PCRE2_CODE_UNIT_WIDTH 8 +#include ]]) + ] ) AC_DEFINE(WITH_PCRE2, 1, [Define if PCRE2 is being used]) AM_CONDITIONAL(WITH_PCRE2, true)