]> git.pld-linux.org Git - packages/php.git/blob - pcre-shared.patch
- fix building with icu 69
[packages/php.git] / pcre-shared.patch
1 diff -urNp -x '*.orig' php-5.6.40.org/ext/pcre/config0.m4 php-5.6.40/ext/pcre/config0.m4
2 --- php-5.6.40.org/ext/pcre/config0.m4  2019-01-09 10:54:13.000000000 +0100
3 +++ php-5.6.40/ext/pcre/config0.m4      2021-08-23 23:20:07.852416018 +0200
4 @@ -11,7 +11,7 @@ PHP_ARG_WITH(pcre-regex,,
5  
6    if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
7      AC_MSG_CHECKING([for PCRE headers location])
8 -    for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do
9 +    for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include /usr/include; do
10        test -f $i/pcre.h && PCRE_INCDIR=$i
11      done
12  
13 @@ -21,7 +21,7 @@ PHP_ARG_WITH(pcre-regex,,
14      AC_MSG_RESULT([$PCRE_INCDIR])
15  
16      AC_MSG_CHECKING([for PCRE library location])
17 -    for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do
18 +    for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR /usr/$PHP_LIBDIR; do
19        test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
20      done
21      
22 @@ -43,12 +43,13 @@ PHP_ARG_WITH(pcre-regex,,
23        AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 6.6])
24      fi
25  
26 -    PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
27 +    PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
28      
29      AC_DEFINE(HAVE_PCRE, 1, [ ])
30      PHP_ADD_INCLUDE($PCRE_INCDIR)
31 -    PHP_NEW_EXTENSION(pcre, php_pcre.c, no)
32 +    PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared)
33      PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
34 +    EXTRA_LIBS="$EXTRA_LIBS -lpcre"
35    else
36      AC_MSG_CHECKING([for PCRE library to use])
37      AC_MSG_RESULT([bundled])
38 @@ -61,7 +62,7 @@ PHP_ARG_WITH(pcre-regex,,
39                                  pcrelib/pcre_version.c pcrelib/pcre_xclass.c \
40                                  pcrelib/pcre_jit_compile.c"
41      PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib"
42 -    PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
43 +    PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, $ext_shared,,$PHP_PCRE_CFLAGS)
44      PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
45      PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
46      AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
47 diff -urNp -x '*.orig' php-5.6.40.org/ext/pcre/php_pcre.c php-5.6.40/ext/pcre/php_pcre.c
48 --- php-5.6.40.org/ext/pcre/php_pcre.c  2019-01-09 10:54:13.000000000 +0100
49 +++ php-5.6.40/ext/pcre/php_pcre.c      2021-08-23 23:20:07.852416018 +0200
50 @@ -27,6 +27,11 @@
51  
52  #if HAVE_PCRE || HAVE_BUNDLED_PCRE
53  
54 +#if COMPILE_DL_PCRE
55 +#undef pcre_get_compiled_regex
56 +PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC);
57 +#endif
58 +
59  #include "ext/standard/php_string.h"
60  
61  #define PREG_PATTERN_ORDER                     1
62 @@ -158,6 +163,10 @@ static PHP_MINIT_FUNCTION(pcre)
63         REGISTER_LONG_CONSTANT("PREG_BAD_UTF8_OFFSET_ERROR", PHP_PCRE_BAD_UTF8_OFFSET_ERROR, CONST_CS | CONST_PERSISTENT);
64         REGISTER_STRING_CONSTANT("PCRE_VERSION", (char *)pcre_version(), CONST_CS | CONST_PERSISTENT);
65  
66 +#if COMPILE_DL_PCRE
67 +       pcre_get_compiled_regex_p = pcre_get_compiled_regex;
68 +#endif
69 +
70         return SUCCESS;
71  }
72  /* }}} */
73 @@ -497,6 +506,7 @@ PHPAPI pcre_cache_entry* pcre_get_compil
74  }
75  /* }}} */
76  
77 +
78  /* {{{ pcre_get_compiled_regex
79   */
80  PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC)
81 diff -urNp -x '*.orig' php-5.6.40.org/ext/pcre/php_pcre.h php-5.6.40/ext/pcre/php_pcre.h
82 --- php-5.6.40.org/ext/pcre/php_pcre.h  2019-01-09 10:54:13.000000000 +0100
83 +++ php-5.6.40/ext/pcre/php_pcre.h      2021-08-23 23:20:07.852416018 +0200
84 @@ -34,7 +34,12 @@
85  #endif
86  
87  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);
88 +#if COMPILE_DL_PCRE
89 +#define pcre_get_compiled_regex pcre_get_compiled_regex_p
90 +extern PHPAPI pcre* (*pcre_get_compiled_regex)(char *regex, pcre_extra **extra, int *options TSRMLS_DC);
91 +#else
92  PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options TSRMLS_DC);
93 +#endif
94  PHPAPI pcre* pcre_get_compiled_regex_ex(char *regex, pcre_extra **extra, int *preg_options, int *coptions TSRMLS_DC);
95  
96  extern zend_module_entry pcre_module_entry;
97 diff -urNp -x '*.orig' php-5.6.40.org/ext/standard/browscap.c php-5.6.40/ext/standard/browscap.c
98 --- php-5.6.40.org/ext/standard/browscap.c      2019-01-09 10:54:13.000000000 +0100
99 +++ php-5.6.40/ext/standard/browscap.c  2021-08-23 23:20:07.852416018 +0200
100 @@ -51,6 +51,11 @@ ZEND_DECLARE_MODULE_GLOBALS(browscap)
101  #define BROWSCAP_G(v)  (browscap_globals.v)
102  #endif
103  
104 +#if COMPILE_DL_PCRE
105 +// will be visible in here
106 +PHPAPI pcre* (*pcre_get_compiled_regex_p)(char *regex, pcre_extra **extra, int *options TSRMLS_DC);
107 +#endif
108 +
109  #define DEFAULT_SECTION_NAME "Default Browser Capability Settings"
110  
111  /* OBJECTS_FIXME: This whole extension needs going through. The use of objects looks pretty broken here */
112 diff -urNp -x '*.orig' php-5.6.40.org/sapi/cli/tests/018.phpt php-5.6.40/sapi/cli/tests/018.phpt
113 --- php-5.6.40.org/sapi/cli/tests/018.phpt      2019-01-09 10:54:13.000000000 +0100
114 +++ php-5.6.40/sapi/cli/tests/018.phpt  2021-08-23 23:20:07.852416018 +0200
115 @@ -20,8 +20,6 @@ echo "Done\n";
116  --EXPECTF--     
117  [PHP Modules]
118  %a
119 -pcre
120 -%a
121  
122  [Zend Modules]
123  %aDone
This page took 0.049449 seconds and 3 git commands to generate.