View | Details | Raw Unified | Return to bug 34143
Collapse All | Expand All

(-)a/.gear/php-pcre-jit.patch (-1 / +77 lines)
Line 0 Link Here
0
- 
1
From 03119df9e1e03c0f751c746eec42b592368a7281 Mon Sep 17 00:00:00 2001
2
From: Anatol Belski <ab@php.net>
3
Date: Fri, 23 Sep 2016 01:52:42 +0200
4
Subject: [PATCH] Fix bug #73121 Bundled PCRE doesn't compile because JIT isn't
5
 supported on s390
6
7
Adapted for php5 by Michael Shigorin <mike@altlinux.org>
8
through dropping chunks for ext/pcre/php_pcre.[ch]
9
(weren't modified the expected way in the tree).
10
---
11
 ext/pcre/config.w32       |  6 ++++++
12
 ext/pcre/config0.m4       | 12 ++++++++++++
13
 ext/pcre/pcrelib/config.h |  6 +++++-
14
 3 files changed, 23 insertions(+), 1 deletion(-)
15
16
diff --git a/ext/pcre/config.w32 b/ext/pcre/config.w32
17
index 594b1cb..7e9832c 100644
18
--- a/ext/pcre/config.w32
19
+++ b/ext/pcre/config.w32
20
@@ -11,3 +11,9 @@ AC_DEFINE('HAVE_PCRE', 1, 'Have PCRE library');
21
 PHP_PCRE="yes";
22
 PHP_INSTALL_HEADERS("ext/pcre", "php_pcre.h pcrelib/");
23
 ADD_FLAG("CFLAGS_PCRE", " /D HAVE_CONFIG_H");
24
+
25
+ARG_WITH("pcre-jit", "Enable PCRE JIT support", "yes");
26
+if (PHP_PCRE_JIT != "no") {
27
+	AC_DEFINE('HAVE_PCRE_JIT_SUPPORT', 1, 'PCRE library');
28
+}
29
+
30
diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4
31
index bfe2009..9e2c98c 100644
32
--- a/ext/pcre/config0.m4
33
+++ b/ext/pcre/config0.m4
34
@@ -66,3 +66,15 @@ PHP_ARG_WITH(pcre-regex,,
35
     PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
36
     AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
37
   fi
38
+
39
+PHP_ARG_WITH(pcre-jit,,[  --with-pcre-jit         Enable PCRE JIT functionality], yes, no)
40
+  if test "$PHP_PCRE_REGEX" != "no"; then
41
+    AC_MSG_CHECKING([whether to enable PCRE JIT functionality])
42
+    if test "$PHP_PCRE_JIT" != "no"; then
43
+      AC_DEFINE(HAVE_PCRE_JIT_SUPPORT, 1, [ ])
44
+      AC_MSG_RESULT([yes])
45
+    else
46
+      AC_MSG_RESULT([no])
47
+    fi
48
+  fi
49
+
50
diff --git a/ext/pcre/pcrelib/config.h b/ext/pcre/pcrelib/config.h
51
index 0f7a9f7..e3ed148 100644
52
--- a/ext/pcre/pcrelib/config.h
53
+++ b/ext/pcre/pcrelib/config.h
54
@@ -1,7 +1,9 @@
55
 
56
 #include <php_compat.h>
57
 
58
-#ifndef PHP_WIN32
59
+#ifdef PHP_WIN32
60
+# include <config.w32.h>
61
+#else
62
 # include <php_config.h>
63
 #endif
64
 
65
@@ -397,7 +399,9 @@ them both to 0; an emulation function will be used. */
66
 #undef SUPPORT_GCOV
67
 
68
 /* Define to any value to enable support for Just-In-Time compiling. */
69
+#if HAVE_PCRE_JIT_SUPPORT
70
 #define SUPPORT_JIT
71
+#endif
72
 
73
 /* Define to any value to allow pcregrep to be linked with libbz2, so that it
74
    is able to handle .bz2 files. */
75
-- 
76
2.7.4
77

Return to bug 34143