-
Notifications
You must be signed in to change notification settings - Fork 0
/
pcre.patch
79 lines (69 loc) · 3.28 KB
/
pcre.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
https://github.com/pocoproject/poco/issues/120#issuecomment-15488808
Origin: https://github.com/buildroot/buildroot/blob/master/package/poco/0004-fix-unbundled-pcre-usage.patch
From 75636a750ecd93305eabe226ad95d2a58e65117f Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <[email protected]>
Date: Tue, 3 Nov 2015 16:33:33 +0100
Subject: [PATCH] Fix build with unbundled pcre
Poco supports two modes for the pcre library: bundled (the default)
and unbundled. In bundled mode, an internal copy of the pcre library
is used by Poco. Since this isn't really nice, Buildroot uses the
"unbundled" mode. However, Poco pokes into some internal symbols of
pcre, which doesn't play well with unbundled.
To solve this, this commit is an adaptation of the Gentoo patch at
https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/poco/files/poco-1.4.4-patch-for-libpcre-8.32.patch?revision=1.1
to make such symbols available internally in Poco, by using parts of
the bundled Pcre copy.
Signed-off-by: Thomas Petazzoni <[email protected]>
---
Foundation/Makefile | 1 +
Foundation/src/pcre_internal.h | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/Foundation/Makefile b/Foundation/Makefile
index a347daa..9231c51 100644
--- a/Foundation/Makefile
+++ b/Foundation/Makefile
@@ -46,6 +46,7 @@ pcre_utf8_objects = pcre_ucd pcre_tables
ifdef POCO_UNBUNDLED
SYSLIBS += -lpcre -lz
+ objects += $(pcre_utf8_objects)
else
objects += $(zlib_objects) $(pcre_objects) $(pcre_utf8_objects)
endif
diff --git a/Foundation/src/pcre_internal.h b/Foundation/src/pcre_internal.h
index f3e69fc..c6f1d44 100644
--- a/Foundation/src/pcre_internal.h
+++ b/Foundation/src/pcre_internal.h
@@ -2636,6 +2636,20 @@ typedef struct {
} ucp_type_table;
+/* renamed to avoid clashes with system pcre */
+#define _pcre_utf8_table1 _poco__pcre_utf8_table1
+#define _pcre_utf8_table1_size _poco__pcre_utf8_table1_size
+#define _pcre_utf8_table2 _poco__pcre_utf8_table2
+#define _pcre_utf8_table3 _poco__pcre_utf8_table3
+#define _pcre_utf8_table4 _poco__pcre_utf8_table4
+#define _pcre_utt _poco__pcre_utt
+#define _pcre_utt_size _poco__pcre_utt_size
+#define _pcre_utt_names _poco__pcre_utt_names
+#define _pcre_OP_lengths _poco__pcre_OP_lengths
+#define _pcre_ucp_gbtable _poco__pcre_ucp_gbtable
+#define _pcre_vspace_list _poco__pcre_vspace_list
+#define _pcre_hspace_list _poco__pcre_hspace_list
+
/* Internal shared data tables. These are tables that are used by more than one
of the exported public functions. They have to be "external" in the C sense,
but are not part of the PCRE public API. The data for these tables is in the
@@ -2749,6 +2763,13 @@ typedef struct {
pcre_int32 other_case; /* offset to other case, or zero if none */
} ucd_record;
+/* renamed to avoid clashes with system pcre */
+#define _pcre_ucd_records _poco__pcre_ucd_records
+#define _pcre_ucd_stage1 _poco__pcre_ucd_stage1
+#define _pcre_ucd_stage2 _poco__pcre_ucd_stage2
+#define _pcre_ucp_gentype _poco__pcre_ucp_gentype
+#define _pcre_ucd_caseless_sets _poco__pcre_ucd_caseless_sets
+
extern const pcre_uint32 PRIV(ucd_caseless_sets)[];
extern const ucd_record PRIV(ucd_records)[];
extern const pcre_uint8 PRIV(ucd_stage1)[];
--
2.6.2