From f4bc388f1e4adb1b9dde5f3af77785101ad19857 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 12 Nov 2020 16:28:42 +0000 Subject: Snuffleupagus now uses pcre2 by default --- src/config.m4 | 2 +- src/php_snuffleupagus.h | 3 +-- src/sp_pcre_compat.h | 8 +++++--- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/config.m4 b/src/config.m4 index 52b6d04..e4cc1f5 100644 --- a/src/config.m4 +++ b/src/config.m4 @@ -24,7 +24,7 @@ CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter" CFLAGS="$CFLAGS -Wformat=2 -Wformat-security -D_FORTIFY_SOURCE=2" CFLAGS="$CFLAGS -fstack-protector" -LDFLAGS="$LDFLAGS -lpcre" +LDFLAGS="$LDFLAGS `pcre2-config --libs8`" if test "$PHP_DEBUG" = "yes"; then AC_DEFINE(SP_DEBUG, 1, [Wether you want to enable debug messages]) diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h index 213e27e..532516f 100644 --- a/src/php_snuffleupagus.h +++ b/src/php_snuffleupagus.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include "sp_pcre_compat.h" #include #include #include @@ -34,7 +34,6 @@ #include "ext/standard/info.h" #include "ext/standard/url.h" #include "ext/standard/php_var.h" -#include "ext/pcre/php_pcre.h" #include "ext/session/php_session.h" #include "php.h" #include "php_ini.h" diff --git a/src/sp_pcre_compat.h b/src/sp_pcre_compat.h index 093a9c3..b429683 100644 --- a/src/sp_pcre_compat.h +++ b/src/sp_pcre_compat.h @@ -7,17 +7,19 @@ #undef pcre_exec #undef pcre_compile -/* We're not supporting pcre2 when it's not bundled with php7, +/* We're not supporting pcre when it's not bundled with php7, * yet. Pull-requests are welcome. */ #if HAVE_BUNDLED_PCRE #if PHP_VERSION_ID >= 70300 #define SP_HAS_PCRE2 -#include "ext/pcre/pcre2lib/pcre2.h" +#include "ext/pcre/php_pcre.h" #else #include "ext/pcre/pcrelib/pcre.h" #endif #else -#include "pcre.h" +#define SP_HAS_PCRE2 +#define PCRE2_CODE_UNIT_WIDTH 8 +#include "pcre2.h" #endif #ifdef SP_HAS_PCRE2 -- cgit v1.3