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 --- .travis.yml | 6 ++++++ src/config.m4 | 2 +- src/php_snuffleupagus.h | 3 +-- src/sp_pcre_compat.h | 8 +++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index bcad3a7..de7febb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,11 @@ language: php +addons: + apt: + packages: + - libpcre2-dev + - libpcre2-8-0 + env: - secure: "fjx/arfcdoqWUIzlQXzQdW9gqXRG7Vpo8dTwJip0uJH8oFeTfYhw1V9EMS4JtKVGwQo3vaagehMflVr7swaoe9Nf4YoCjaEq8x6ZMJH3bLHNgtigfS03Uqop9FI/a/Jau/BL7ibIEkZRNfEIx8z+NyfY4bAeK35W/Ru5k2BHyp1GLKwBpizHdJsshG/ukM+4W8PY9BAeXVavqxQRywseQEsqmGruGLcYFuuh04D7cnNqyuYgbdaq7YMKZfVGxM7N5eeL5xSlw0Sl9yOutRzkxUmL1WSmYMFrkRLcc37hRTu67tCmP60tiGLGY2Ll8nUh6rkc3RwBgc1wOC7jRMrtoGvlgsLxz7kLOtpQ31PdJKefe99rQMkcYKLwCxXf7WQdOHY4YsTmjqlPyzfTKT3mNtGhUwp1rEvlcygZZK8osHtc46BUD6BKNRCvTyLNyLTx2IoA4WfrzWOaQ+A1gNRD5L9Jbqi0kY6teENCzzlHUe80mH7wBarCTRoDAD73w/EPgSn3+CeLALXXEu+r9Sm/e5YpaFfLdeKDC6fr1KwU69ddHUKWZqjFM8vEHjrIbmAdNwVsuCo8LeWdCCXdQlWrISQ4OUDBBEmnwlKoojSjIYP5SKoH1txZemGok1/TN/tvjlyrx2RYYxy7AdUulENKXXeqlwWsiwVZCZLR4tt+wEQ=" 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