aboutsummaryrefslogtreecommitdiffstats
path: root/www/firefox-esr/files/patch-z-bug847568
blob: 14f7e151aa9430cf27007e4c0a36bfc165a0692c (plain) (blame)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# Allow building against system-wide graphite2/harfbuzz.

diff --git config/Makefile.in config/Makefile.in
index 14bfc0d..5383399 100644
--- config/Makefile.in
+++ config/Makefile.in
@@ -77,6 +77,8 @@ export:: $(export-preqs)
        -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
        -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
        -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+       -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
+       -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
        $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
    $(INSTALL) system_wrappers $(DIST)
 
diff --git config/system-headers config/system-headers
index 126391e..b711fc3 100644
--- config/system-headers
+++ config/system-headers
@@ -1144,3 +1144,11 @@ unicode/utypes.h
 #endif
 libutil.h
 unwind.h
+#if MOZ_NATIVE_GRAPHITE2==1
+graphite2/Font.h
+graphite2/Segment.h
+#endif
+#if MOZ_NATIVE_HARFBUZZ==1
+harfbuzz/hb-ot.h
+harfbuzz/hb.h
+#endif
diff --git configure.in configure.in
index bbc7b40..1747206 100644
--- configure.in
+++ configure.in
@@ -7830,6 +7830,38 @@ if test "$USE_FC_FREETYPE"; then
 fi
 
 dnl ========================================================
+dnl Check for graphite2 and harfbuzz
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-harfbuzz,
+[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],
+MOZ_NATIVE_HARFBUZZ=1,
+MOZ_NATIVE_HARFBUZZ= )
+
+if test -n "$MOZ_NATIVE_HARFBUZZ"; then
+    PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.16)
+else
+    MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
+fi
+AC_SUBST(MOZ_NATIVE_HARFBUZZ)
+AC_SUBST(MOZ_HARFBUZZ_CFLAGS)
+AC_SUBST(MOZ_HARFBUZZ_LIBS)
+
+MOZ_ARG_WITH_BOOL(system-graphite2,
+[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
+MOZ_NATIVE_GRAPHITE2=1,
+MOZ_NATIVE_GRAPHITE2= )
+
+if test -n "$MOZ_NATIVE_GRAPHITE2"; then
+    PKG_CHECK_MODULES(MOZ_GRAPHITE, graphite2 >= 1.2.3)
+else
+    MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
+fi
+AC_SUBST(MOZ_NATIVE_GRAPHITE2)
+AC_SUBST(MOZ_GRAPHITE_CFLAGS)
+AC_SUBST(MOZ_GRAPHITE_LIBS)
+
+dnl ========================================================
 dnl Check for pixman and cairo
 dnl ========================================================
 
@@ -8379,18 +8412,6 @@ QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFI
 AC_SUBST(QCMS_LIBS)
 
 dnl ========================================================
-dnl HarfBuzz
-dnl ========================================================
-MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
-AC_SUBST(MOZ_HARFBUZZ_LIBS)
-
-dnl ========================================================
-dnl SIL Graphite
-dnl ========================================================
-MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
-AC_SUBST(MOZ_GRAPHITE_LIBS)
-
-dnl ========================================================
 dnl OTS
 dnl ========================================================
 MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
diff --git content/base/src/Makefile.in content/base/src/Makefile.in
index a618096..596901a 100644
--- content/base/src/Makefile.in
+++ content/base/src/Makefile.in
@@ -5,6 +5,10 @@
 
 include $(topsrcdir)/config/rules.mk
 
+ifdef MOZ_NATIVE_HARFBUZZ
+nsContentUtils.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
+endif
+
 # gcc requires -msse2 for this file since it uses SSE2 intrinsics.  (See bug
 # 585538 comment 12.)
 ifneq (,$(INTEL_ARCHITECTURE))
diff --git gfx/moz.build gfx/moz.build
index 519aa46..6929751 100644
--- gfx/moz.build
+++ gfx/moz.build
@@ -7,6 +7,12 @@
 if CONFIG['MOZ_TREE_CAIRO']:
     DIRS += ['cairo']
 
+if not CONFIG['MOZ_NATIVE_GRAPHITE2']:
+    DIRS += ['graphite2/src' ]
+
+if not CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    DIRS += ['harfbuzz/src']
+
 DIRS += [
     '2d',
     'ycbcr',
@@ -15,8 +21,6 @@ DIRS += [
     'qcms',
     'gl',
     'layers',
-    'graphite2/src',
-    'harfbuzz/src',
     'ots/src',
     'thebes',
     'ipc',
diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
index 07a77a3..067f7bd 100644
--- gfx/skia/Makefile.in
+++ gfx/skia/Makefile.in
@@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
 OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PANGO_CFLAGS) $(CAIRO_FT_CFLAGS)
 endif
 
+ifdef MOZ_NATIVE_HARFBUZZ
+OS_CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
+endif
+
 include $(topsrcdir)/config/rules.mk
 
 ifneq (,$(INTEL_ARCHITECTURE))
diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
index e9f6b6c..0df2d8d 100644
--- gfx/thebes/Makefile.in
+++ gfx/thebes/Makefile.in
@@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
 CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
 CFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
 
+ifdef MOZ_NATIVE_GRAPHITE2
+CXXFLAGS += $(MOZ_GRAPHITE_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_HARFBUZZ
+CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
+endif
+
 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
 CXXFLAGS += $(CAIRO_FT_CFLAGS)
 endif
diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
index f6b9f7c..11c44f4 100644
--- intl/unicharutil/util/Makefile.in
+++ intl/unicharutil/util/Makefile.in
@@ -21,3 +21,7 @@ ifdef _MSC_VER
 OS_COMPILE_CXXFLAGS += -Zl
 OS_COMPILE_CFLAGS += -Zl
 endif
+
+ifdef MOZ_NATIVE_HARFBUZZ
+nsUnicodePropertyData.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
+endif
diff --git layout/media/Makefile.in layout/media/Makefile.in
index 1cacbd7..a8cd156 100644
--- layout/media/Makefile.in
+++ layout/media/Makefile.in
@@ -18,10 +18,16 @@ endif
 SHARED_LIBRARY_LIBS = \
     $(MOZ_OTS_LIBS) \
     $(QCMS_LIBS) \
-    $(MOZ_GRAPHITE_LIBS) \
-    $(MOZ_HARFBUZZ_LIBS) \
     $(NULL)
 
+ifndef MOZ_NATIVE_GRAPHITE2
+SHARED_LIBRARY_LIBS += $(MOZ_GRAPHITE_LIBS)
+endif
+
+ifndef MOZ_NATIVE_HARFBUZZ
+SHARED_LIBRARY_LIBS += $(MOZ_HARFBUZZ_LIBS)
+endif
+
 ifdef MOZ_TREE_CAIRO
 SHARED_LIBRARY_LIBS += $(MOZ_CAIRO_LIBS)
 endif
diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
index 1cacbd7..a8cd156 100644
--- netwerk/dns/Makefile.in
+++ netwerk/dns/Makefile.in
@@ -9,3 +9,7 @@ include $(topsrcdir)/config/rules.mk
 # for effective TLD data.
 etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
    $(PYTHON) $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat > etld_data.inc
+
+ifdef MOZ_NATIVE_HARFBUZZ
+nsIDNService.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
+endif
diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
index 007f272..27f488e 100644
--- toolkit/library/Makefile.in
+++ toolkit/library/Makefile.in
@@ -103,6 +103,14 @@ ifndef MOZ_TREE_PIXMAN
 EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
 endif
 
+ifdef MOZ_NATIVE_GRAPHITE2
+EXTRA_DSO_LDOPTS += $(MOZ_GRAPHITE_LIBS)
+endif
+
+ifdef MOZ_NATIVE_HARFBUZZ
+EXTRA_DSO_LDOPTS += $(MOZ_HARFBUZZ_LIBS)
+endif
+
 ifdef MOZ_DMD
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,dmd,$(DIST)/lib)
 endif