From 0cfc87bd32822e5ba22d8c2b1a26fa60f63ad7fa Mon Sep 17 00:00:00 2001
From: rudb <office@database.ru>
Date: Fri, 19 Jun 2026 15:11:53 +0000
Subject: [PATCH] СУБД RuDB - релиз 2

---
 configure.ac |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3b87da0..8c1a4b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1189,6 +1189,32 @@
     esac
   done
 fi
+
+#
+# PCRE2
+#
+AC_MSG_CHECKING([whether to build with PCRE2 support])
+PGAC_ARG_BOOL(with, pcre2, no, [build with PCRE2 support],
+              [AC_DEFINE([USE_PCRE2], 1, [Define to 1 to build with PCRE2 support (--with-pcre2)])])
+AC_MSG_RESULT([$with_pcre2])
+AC_SUBST(with_pcre2)
+if test "$with_pcre2" = yes; then
+  PKG_CHECK_MODULES(PCRE2, libpcre2-8)
+  # We only care about -I, -D, and -L switches;
+  # note that -lpcre2-8 will be added by AC_CHECK_LIB below.
+  for pgac_option in $PCRE2_CFLAGS; do
+    case $pgac_option in
+      -I*|-D*) INCLUDES="$INCLUDES $pgac_option";;
+    esac
+  done
+  INCLUDES="$INCLUDES -DPCRE2_CODE_UNIT_WIDTH=8"
+  for pgac_option in $PCRE2_LIBS; do
+    case $pgac_option in
+      -L*) LIBDIRS="$LIBDIRS $pgac_option";;
+    esac
+  done
+fi
+
 #
 # Assignments
 #
@@ -1438,6 +1464,10 @@
   AC_CHECK_LIB(zstd, ZSTD_compress, [], [AC_MSG_ERROR([library 'zstd' is required for ZSTD support])])
 fi
 
+if test "$with_pcre2" = yes ; then
+  AC_CHECK_LIB(pcre2-8, pcre2_compile_8, [], [AC_MSG_ERROR([library 'pcre2-8' is required for PCRE2 support])])
+fi
+
 # Note: We can test for libldap_r only after we know PTHREAD_LIBS
 if test "$with_ldap" = yes ; then
   _LIBS="$LIBS"
@@ -1580,6 +1610,11 @@
   AC_CHECK_HEADER(zstd.h, [], [AC_MSG_ERROR([zstd.h header file is required for ZSTD])])
 fi
 
+PGAC_PATH_PROGS(PCRE2, pcre2)
+if test "$with_pcre2" = yes; then
+  AC_CHECK_HEADER(pcre2.h, [], [AC_MSG_ERROR([pcre2.h header file is required for PCRE2])])
+fi
+
 if test "$with_gssapi" = yes ; then
   AC_CHECK_HEADERS(gssapi/gssapi.h, [],
 	[AC_CHECK_HEADERS(gssapi.h, [], [AC_MSG_ERROR([gssapi.h header file is required for GSSAPI])])])

--
Gitblit v1.10.0