]> git.pld-linux.org Git - packages/php.git/blob - pcre-shared.patch
- first batch of rediffed patches
[packages/php.git] / pcre-shared.patch
1 --- php-7.2.0RC4/ext/pcre/config0.m4~   2017-10-15 16:17:20.000000000 +0300
2 +++ php-7.2.0RC4/ext/pcre/config0.m4    2017-10-15 18:34:27.673725678 +0300
3 @@ -11,7 +11,7 @@
4  
5    if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
6      AC_MSG_CHECKING([for PCRE headers location])
7 -    for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do
8 +    for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include /usr/include; do
9        test -f $i/pcre.h && PCRE_INCDIR=$i
10      done
11  
12 @@ -21,7 +21,7 @@
13      AC_MSG_RESULT([$PCRE_INCDIR])
14  
15      AC_MSG_CHECKING([for PCRE library location])
16 -    for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do
17 +    for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR /usr/$PHP_LIBDIR; do
18        test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
19      done
20      
21 @@ -52,12 +52,13 @@
22      ],[
23        -L$PCRE_LIBDIR
24      ])
25 -    PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
26 +    PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
27  
28      AC_DEFINE(HAVE_PCRE, 1, [ ])
29      PHP_ADD_INCLUDE($PCRE_INCDIR)
30 -    PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
31 +    PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
32      PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
33 +    EXTRA_LIBS="$EXTRA_LIBS -lpcre"
34    else
35      AC_MSG_CHECKING([for PCRE library to use])
36      AC_MSG_RESULT([bundled])
37 @@ -61,7 +62,7 @@
38                                  pcrelib/pcre_version.c pcrelib/pcre_xclass.c \
39                                  pcrelib/pcre_jit_compile.c"
40      PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
41 -    PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
42 +    PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, $ext_shared,,$PHP_PCRE_CFLAGS)
43      PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
44      PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
45      AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
46 --- php-7.2.0beta1/ext/pcre/php_pcre.h  2017-07-22 12:35:11.071146616 +0300
47 +++ php-7.2.0beta1/ext/pcre/php_pcre.h  2017-07-22 12:41:01.858859537 +0300
48 @@ -33,7 +33,29 @@
49  #include <locale.h>
50  #endif
51  
52 +#if !defined(COMPILE_DL_PCRE_NOREDIRECT)
53 +#define pcre_get_compiled_regex (*pcre_get_compiled_regex_p)
54 +#define pcre_get_compiled_regex_cache (*pcre_get_compiled_regex_cache_p)
55 +#define php_pcre_replace_impl (*php_pcre_replace_impl_p)
56 +#define php_pcre_match_impl (*php_pcre_match_impl_p)
57 +#define php_pcre_split_impl (*php_pcre_split_impl_p)
58 +#if !defined(COMPILE_DL_PCRE_NOEXTERN)
59 +#      define PCRE_EXTERN extern
60 +#else
61 +#      define PCRE_EXTERN
62 +#endif
63 +#else
64 +// for pcre.c
65 +#define PCRE_EXTERN
66 +extern void *pcre_get_compiled_regex_p;
67 +extern void *pcre_get_compiled_regex_cache_p;
68 +extern void *php_pcre_replace_impl_p;
69 +extern void *php_pcre_match_impl_p;
70 +extern void *php_pcre_split_impl_p;
71 +#endif
72 +
73  PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, char *subject, int subject_len, zend_string *replace_str, int limit, int *replace_count);
74 +PCRE_EXTERN
75  PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options);
76  PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *coptions);
77  
78 @@ -78,18 +78,23 @@ typedef struct {
79         int refcount;
80  } pcre_cache_entry;
81  
82 +PCRE_EXTERN
83  PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex);
84  PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, int locale_aware);
85  
86 +PCRE_EXTERN
87  PHPAPI void  php_pcre_match_impl(  pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
88         zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset);
89  
90 +PCRE_EXTERN
91  PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, char *subject, int subject_len, zend_string *replace_str,
92         int limit, int *replace_count);
93  
94 +PCRE_EXTERN
95  PHPAPI void  php_pcre_split_impl(  pcre_cache_entry *pce, zend_string *subject_str, zval *return_value,
96         zend_long limit_val, zend_long flags);
97  
98 +PCRE_EXTERN
99  PHPAPI void  php_pcre_grep_impl(   pcre_cache_entry *pce, zval *input, zval *return_value,
100         zend_long flags);
101  
102 --- php-5.3.1.pcre/ext/pcre/php_pcre.c  2009-11-30 21:38:01.759684456 +0000
103 +++ php-7.2.0beta1/ext/pcre/php_pcre.c  2017-07-22 12:42:57.878062137 +0300
104 @@ -21,6 +21,9 @@
105  #include "php.h"
106  #include "php_ini.h"
107  #include "php_globals.h"
108 +#if COMPILE_DL_PCRE
109 +#define COMPILE_DL_PCRE_NOREDIRECT
110 +#endif
111  #include "php_pcre.h"
112  #include "ext/standard/info.h"
113  #include "ext/standard/basic_functions.h"
114 @@ -208,6 +211,14 @@
115         REGISTER_LONG_CONSTANT("PREG_JIT_STACKLIMIT_ERROR", PHP_PCRE_JIT_STACKLIMIT_ERROR, CONST_CS | CONST_PERSISTENT);
116         REGISTER_STRING_CONSTANT("PCRE_VERSION", (char *)pcre_version(), CONST_CS | CONST_PERSISTENT);
117  
118 +#if COMPILE_DL_PCRE
119 +       pcre_get_compiled_regex_p = pcre_get_compiled_regex;
120 +       pcre_get_compiled_regex_cache_p = pcre_get_compiled_regex_cache;
121 +       php_pcre_replace_impl_p = php_pcre_replace_impl;
122 +       php_pcre_match_impl_p = php_pcre_match_impl;
123 +       php_pcre_split_impl_p = php_pcre_split_impl;
124 +#endif
125 +
126         return SUCCESS;
127  }
128  /* }}} */
129 --- php-7.2.0RC5/ext/standard/basic_functions.c 2017-10-28 21:08:47.383549141 +0300
130 +++ php-7.2.0RC5/ext/standard/basic_functions.c 2017-10-28 21:10:20.625051932 +0300
131 @@ -113,6 +113,15 @@
132  PHPAPI php_basic_globals basic_globals;
133  #endif
134  
135 +#if COMPILE_DL_PCRE
136 +// for pcre shared patch symbol
137 +void *pcre_get_compiled_regex_p;
138 +void *pcre_get_compiled_regex_cache_p;
139 +void *php_pcre_replace_impl_p;
140 +void *php_pcre_match_impl_p;
141 +void *php_pcre_split_impl_p;
142 +#endif
143 +
144  #include "php_fopen_wrappers.h"
145  #include "streamsfuncs.h"
146  
147 --- php-5.3.2/sapi/cli/tests/018.phpt~  2008-03-17 16:05:39.000000000 +0200
148 +++ php-5.3.2/sapi/cli/tests/018.phpt   2010-03-16 20:41:11.341251246 +0200
149 @@ -20,8 +20,6 @@
150  --EXPECTF--     
151  [PHP Modules]
152  %a
153 -pcre
154 -%a
155  
156  [Zend Modules]
157  %aDone
158 --- php-7.0.0beta3/main/php_ini.c~      2015-08-26 18:50:15.000000000 +0300
159 +++ php-7.0.0beta3/main/php_ini.c       2015-08-26 22:33:59.126957396 +0300
160 @@ -765,8 +765,8 @@
161   */
162  void php_ini_register_extensions(void)
163  {
164 -       zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
165         zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb);
166 +       zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
167  
168         zend_llist_destroy(&extension_lists.engine);
169         zend_llist_destroy(&extension_lists.functions);
170 --- php-5.3.1/ext/phar/Makefile.frag~   2009-07-23 15:48:04.000000000 +0000
171 +++ php-5.3.1/ext/phar/Makefile.frag    2009-11-30 16:10:29.687175948 +0000
172 @@ -10,7 +10,7 @@
173                 $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
174                 if test "x$(PHP_MODULES)" != "x"; then \
175                 $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
176 -               for i in spl bz2 zlib phar; do \
177 +               for i in pcre spl bz2 zlib phar; do \
178                         if test -f "$(top_builddir)/modules/$$i.la"; then \
179                                 . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
180                         fi; \
This page took 0.034677 seconds and 3 git commands to generate.