Menu

#946 fix detection and use of pcre2.h from a subdirectory

version 4.0.0
closed-accepted
None
5
2025-06-26
2025-06-26
Jakub Kulik
No

Hi, I've hit several pcre2 related issues when building privoxy 4.0.0 on Solaris (where the header lives in a sub-directory). The configure script for pcre2/pcre2.h has the following issues:

  • the inner header check (for pcre2/pcre2.h) is missing the PCRE2_CODE_UNIT_WIDTH define and hence always fails.
  • the same check doesn't define HAVE_PCRE2 on success.

Here is the patch for the necessary changes:

--- privoxy-4.0.0-stable/configure.in
+++ privoxy-4.0.0-stable/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])

Additionally, pcrs.h doesn't support include from pcre2/pcre2.h (PCRE2_H_IN_SUBDIR is not checked like in project.h).

The patch is attached below.

1 Attachments

Discussion

  • Fabian Keil

    Fabian Keil - 2025-06-26
    • status: open --> closed-accepted
    • assigned_to: Fabian Keil
     
  • Fabian Keil

    Fabian Keil - 2025-06-26

    Thanks for the report and patch.

    Applied and pushed after changing configure.ac to configure.in.

     
    🎉
    1
  • Jakub Kulik

    Jakub Kulik - 2025-06-26

    Thanks!

     

Log in to post a comment.

MongoDB Logo MongoDB