diff -urNp -x '*.orig' php-5.6.40.org/ext/pcre/config0.m4 php-5.6.40/ext/pcre/config0.m4 --- php-5.6.40.org/ext/pcre/config0.m4 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/pcre/config0.m4 2021-08-23 23:20:07.852416018 +0200 @@ -11,7 +11,7 @@ PHP_ARG_WITH(pcre-regex,, if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then AC_MSG_CHECKING([for PCRE headers location]) - for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do + for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include /usr/include; do test -f $i/pcre.h && PCRE_INCDIR=$i done @@ -21,7 +21,7 @@ PHP_ARG_WITH(pcre-regex,, AC_MSG_RESULT([$PCRE_INCDIR]) AC_MSG_CHECKING([for PCRE library location]) - for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do + for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR /usr/$PHP_LIBDIR; do test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j done @@ -43,12 +43,13 @@ PHP_ARG_WITH(pcre-regex,, AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 6.6]) fi - PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR) + PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD) AC_DEFINE(HAVE_PCRE, 1, [ ]) PHP_ADD_INCLUDE($PCRE_INCDIR) - PHP_NEW_EXTENSION(pcre, php_pcre.c, no) + PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared) PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h]) + EXTRA_LIBS="$EXTRA_LIBS -lpcre" else AC_MSG_CHECKING([for PCRE library to use]) AC_MSG_RESULT([bundled]) @@ -61,7 +62,7 @@ PHP_ARG_WITH(pcre-regex,, pcrelib/pcre_version.c pcrelib/pcre_xclass.c \ pcrelib/pcre_jit_compile.c" PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib" - PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS) + PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, $ext_shared,,$PHP_PCRE_CFLAGS) PHP_ADD_BUILD_DIR($ext_builddir/pcrelib) PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/]) AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ]) diff -urNp -x '*.orig' php-5.6.40.org/ext/pcre/php_pcre.c php-5.6.40/ext/pcre/php_pcre.c --- php-5.6.40.org/ext/pcre/php_pcre.c 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/pcre/php_pcre.c 2021-08-23 23:20:07.852416018 +0200 @@ -27,6 +27,11 @@ #if HAVE_PCRE || HAVE_BUNDLED_PCRE +#if COMPILE_DL_PCRE +#undef pcre_get_compiled_regex +PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC); +#endif + #include "ext/standard/php_string.h" #define PREG_PATTERN_ORDER 1 @@ -158,6 +163,10 @@ static PHP_MINIT_FUNCTION(pcre) REGISTER_LONG_CONSTANT("PREG_BAD_UTF8_OFFSET_ERROR", PHP_PCRE_BAD_UTF8_OFFSET_ERROR, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("PCRE_VERSION", (char *)pcre_version(), CONST_CS | CONST_PERSISTENT); +#if COMPILE_DL_PCRE + pcre_get_compiled_regex_p = pcre_get_compiled_regex; +#endif + return SUCCESS; } /* }}} */ @@ -497,6 +506,7 @@ PHPAPI pcre_cache_entry* pcre_get_compil } /* }}} */ + /* {{{ pcre_get_compiled_regex */ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) diff -urNp -x '*.orig' php-5.6.40.org/ext/pcre/php_pcre.h php-5.6.40/ext/pcre/php_pcre.h --- php-5.6.40.org/ext/pcre/php_pcre.h 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/pcre/php_pcre.h 2021-08-23 23:20:07.852416018 +0200 @@ -34,7 +34,12 @@ #endif PHPAPI char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int *result_len, int limit, int *replace_count TSRMLS_DC); +#if COMPILE_DL_PCRE +#define pcre_get_compiled_regex pcre_get_compiled_regex_p +extern PHPAPI pcre* (*pcre_get_compiled_regex)(char *regex, pcre_extra **extra, int *options TSRMLS_DC); +#else PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options TSRMLS_DC); +#endif PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *coptions TSRMLS_DC); extern zend_module_entry pcre_module_entry; diff -urNp -x '*.orig' php-5.6.40.org/ext/standard/browscap.c php-5.6.40/ext/standard/browscap.c --- php-5.6.40.org/ext/standard/browscap.c 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/ext/standard/browscap.c 2021-08-23 23:20:07.852416018 +0200 @@ -51,6 +51,11 @@ ZEND_DECLARE_MODULE_GLOBALS(browscap) #define BROWSCAP_G(v) (browscap_globals.v) #endif +#if COMPILE_DL_PCRE +// will be visible in here +PHPAPI pcre* (*pcre_get_compiled_regex_p)(char *regex, pcre_extra **extra, int *options TSRMLS_DC); +#endif + #define DEFAULT_SECTION_NAME "Default Browser Capability Settings" /* OBJECTS_FIXME: This whole extension needs going through. The use of objects looks pretty broken here */ diff -urNp -x '*.orig' php-5.6.40.org/sapi/cli/tests/018.phpt php-5.6.40/sapi/cli/tests/018.phpt --- php-5.6.40.org/sapi/cli/tests/018.phpt 2019-01-09 10:54:13.000000000 +0100 +++ php-5.6.40/sapi/cli/tests/018.phpt 2021-08-23 23:20:07.852416018 +0200 @@ -20,8 +20,6 @@ echo "Done\n"; --EXPECTF-- [PHP Modules] %a -pcre -%a [Zend Modules] %aDone