[Privoxy-commits] [privoxy] 02/02: Fix detection and use of pcre2.h from a subdirectory

User Git git at git.privoxy.org
Thu Jun 26 13:23:19 CEST 2025


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

commit 3c2c435d6fce92e051fa7ee4a0a784e124660499
Author: Jakub Kulik <kulikjak at gmail.com>
AuthorDate: Thu Jun 26 12:39:32 2025 +0200

    Fix detection and use of pcre2.h from a subdirectory
    
    SF bug #946.
---
 configure.in | 4 ++--
 pcrs.h       | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/configure.in b/configure.in
index 094ccaa6..a363a601 100644
--- a/configure.in
+++ b/configure.in
@@ -887,8 +887,8 @@ AC_CHECK_LIB(pcre2-8, pcre2_compile_8, [
       AC_EGREP_HEADER(pcre2_pattern_info, pcre2.h,[have_pcre2=yes; AC_DEFINE(HAVE_PCRE2)], [AC_MSG_WARN([[pcre2 old version installed]]); have_pcre2=no])
    ], [
       AC_CHECK_HEADER(pcre2/pcre2.h, [
-         AC_EGREP_HEADER(pcre2_pattern_info, pcre2/pcre2.h, [have_pcre2=yes; AC_DEFINE(PCRE2_H_IN_SUBDIR)], [AC_MSG_WARN([[pcre2 old version installed]]); have_pcre2=no])
-      ], [have_pcre2=no])
+         AC_EGREP_HEADER(pcre2_pattern_info, pcre2/pcre2.h, [have_pcre2=yes; AC_DEFINE(HAVE_PCRE2) AC_DEFINE(PCRE2_H_IN_SUBDIR)], [AC_MSG_WARN([[pcre2 old version installed]]); have_pcre2=no])
+      ], [have_pcre2=no], [#define PCRE2_CODE_UNIT_WIDTH 8])
    ], [#define PCRE2_CODE_UNIT_WIDTH 8])
 ], [have_pcre2=no])
 
diff --git a/pcrs.h b/pcrs.h
index 8e2fb968..507d6970 100644
--- a/pcrs.h
+++ b/pcrs.h
@@ -36,7 +36,11 @@
 #define PCRE2_CODE_UNIT_WIDTH 8
 #define PCREn(x) PCRE2_ ## x
 #ifndef _PCRE2_H
-#include <pcre2.h>
+#  ifdef PCRE2_H_IN_SUBDIR
+#    include <pcre2/pcre2.h>
+#  else
+#    include <pcre2.h>
+#  endif
 #endif
 
 /*

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list