aboutsummaryrefslogtreecommitdiffstats
path: root/mail/thunderbird/files/patch-zz-bug517422
blob: de36705907e29c7689233dc7cfc5490215ac5d37 (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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# Allow building against system-wide ogg/vorbis/opus.

diff --git config/Makefile.in config/Makefile.in
index 5383399..4393ae8 100644
--- mozilla/config/Makefile.in
+++ mozilla/config/Makefile.in
@@ -79,6 +79,9 @@ export:: $(export-preqs)
        -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
        -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
        -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
+       -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \
+       -DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
+       -DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
        $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
    $(INSTALL) system_wrappers $(DIST)
 
diff --git toolkit/toolkit.mozbuild toolkit/toolkit.mozbuild
index c22a36c..2febb45 100644
--- mozilla/toolkit/toolkit.mozbuild
+++ mozilla/toolkit/toolkit.mozbuild
@@ -64,13 +64,13 @@ add_tier_dir('platform', 'rdf')
 if CONFIG['MOZ_JSDEBUGGER']:
     add_tier_dir('platform', 'js/jsd')
 
-if CONFIG['MOZ_VORBIS']:
+if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
     add_tier_dir('platform', 'media/libvorbis')
 
 if CONFIG['MOZ_TREMOR']:
     add_tier_dir('platform', 'media/libtremor')
 
-if CONFIG['MOZ_OPUS']:
+if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']:
     add_tier_dir('platform', 'media/libopus')
 
 if CONFIG['MOZ_WEBM']:
@@ -82,7 +82,9 @@ if CONFIG['MOZ_VP8'] and not CONFIG['MOZ
     add_tier_dir('platform', 'media/libvpx')
 
 if CONFIG['MOZ_OGG']:
-    add_tier_dir('platform', ['media/libogg', 'media/libtheora'])
+    if not CONFIG['MOZ_NATIVE_OGG']:
+        add_tier_dir('platform', 'media/libogg')
+    add_tier_dir('platform', 'media/libtheora')
 
 if CONFIG['MOZ_WEBRTC']:
     add_tier_dir('platform', [
diff --git config/system-headers config/system-headers
index b711fc3..fd3c14f 100644
--- mozilla/config/system-headers
+++ mozilla/config/system-headers
@@ -1152,3 +1152,17 @@ graphite2/Segment.h
 harfbuzz/hb-ot.h
 harfbuzz/hb.h
 #endif
+#if MOZ_NATIVE_OGG==1
+ogg/ogg.h
+ogg/os_types.h
+#endif
+#if MOZ_NATIVE_VORBIS==1
+vorbis/codec.h
+vorbis/vorbisenc.h
+#endif
+#if MOZ_NATIVE_OPUS==1
+opus.h
+opus_multistream.h
+opus/opus.h
+opus/opus_multistream.h
+#endif
diff --git configure.in configure.in
index df49287..05e97ff 100644
--- mozilla/configure.in
+++ mozilla/configure.in
@@ -5143,6 +5143,40 @@ if test -n "$MOZ_OGG"; then
 fi
 
 dnl ========================================================
+dnl Check for libogg
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-ogg,
+[  --with-system-ogg       Use system libogg (located with pkgconfig)],
+MOZ_NATIVE_OGG=1,
+MOZ_NATIVE_OGG= )
+
+if test -n "$MOZ_NATIVE_OGG"; then
+    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
+fi
+
+AC_SUBST(MOZ_NATIVE_OGG)
+AC_SUBST(MOZ_OGG_CFLAGS)
+AC_SUBST(MOZ_OGG_LIBS)
+
+dnl ========================================================
+dnl Check for libvorbis
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-vorbis,
+[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
+MOZ_NATIVE_VORBIS=1,
+MOZ_NATIVE_VORBIS= )
+
+if test -n "$MOZ_NATIVE_VORBIS"; then
+    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
+fi
+
+AC_SUBST(MOZ_NATIVE_VORBIS)
+AC_SUBST(MOZ_VORBIS_CFLAGS)
+AC_SUBST(MOZ_VORBIS_LIBS)
+
+dnl ========================================================
 dnl = Disable Opus audio codec support
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(opus,
@@ -5151,6 +5185,25 @@ MOZ_ARG_DISABLE_BOOL(opus,
     MOZ_OPUS=1)
 
 dnl ========================================================
+dnl Check for libopus
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-opus,
+[  --with-system-opus      Use system libopus (located with pkgconfig)],
+MOZ_NATIVE_OPUS=1,
+MOZ_NATIVE_OPUS= )
+
+if test -n "$MOZ_NATIVE_OPUS"; then
+    PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
+else
+    MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include'
+fi
+
+AC_SUBST(MOZ_NATIVE_OPUS)
+AC_SUBST(MOZ_OPUS_CFLAGS)
+AC_SUBST(MOZ_OPUS_LIBS)
+
+dnl ========================================================
 dnl = Disable VP8 decoder support
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(webm,
diff --git content/media/Makefile.in content/media/Makefile.in
index 68f360e..76f2d57 100644
--- mozilla/content/media/Makefile.in
+++ mozilla/content/media/Makefile.in
@@ -7,4 +7,16 @@ include $(topsrcdir)/config/rules.mk
 CFLAGS   += $(GSTREAMER_CFLAGS)
 CXXFLAGS += $(GSTREAMER_CFLAGS)
 
+ifdef MOZ_NATIVE_OGG
+CXXFLAGS += $(MOZ_OGG_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_VORBIS
+CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_OPUS
+CXXFLAGS += $(MOZ_OPUS_CFLAGS)
+endif
+
 AudioNodeEngineNEON.$(OBJ_SUFFIX): CXXFLAGS += -mfpu=neon
diff --git layout/media/Makefile.in layout/media/Makefile.in
index 1cacbd7..a8cd156 100644
--- mozilla/layout/media/Makefile.in
+++ mozilla/layout/media/Makefile.in
@@ -30,12 +36,21 @@ ifdef MOZ_TREE_PIXMAN
 SHARED_LIBRARY_LIBS += $(MOZ_PIXMAN_LIBS)
 endif
 
+ifdef MOZ_OGG
+ifndef MOZ_NATIVE_OGG
+SHARED_LIBRARY_LIBS    += \
+   $(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
+   $(NULL)
+endif
+endif
+
 ifdef MOZ_VORBIS
+ifndef MOZ_NATIVE_VORBIS
 SHARED_LIBRARY_LIBS    += \
    $(DEPTH)/media/libvorbis/lib/$(LIB_PREFIX)vorbis.$(LIB_SUFFIX) \
-   $(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
    $(NULL)
 endif
+endif
 
 ifdef MOZ_TREMOR
 SHARED_LIBRARY_LIBS    += \
@@ -51,10 +66,12 @@ SHARED_LIBRARY_LIBS     += \
 endif
 
 ifdef MOZ_OPUS
+ifndef MOZ_NATIVE_OPUS
 SHARED_LIBRARY_LIBS += \
   $(DEPTH)/media/libopus/$(LIB_PREFIX)opus.$(LIB_SUFFIX) \
   $(NULL)
 endif
+endif
 
 ifdef MOZ_WEBM
 SHARED_LIBRARY_LIBS    += \
diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
new file mode 100644
index 0000000..1f02dc0
--- /dev/null
+++ mozilla/media/libtheora/Makefile.in
@@ -0,0 +1,16 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DEPTH = @DEPTH@
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/rules.mk
+
+ifdef MOZ_NATIVE_OGG
+CFLAGS += $(MOZ_OGG_CFLAGS)
+endif
diff --git media/libtremor/Makefile.in media/libtremor/Makefile.in
new file mode 100644
index 0000000..1f02dc0
--- /dev/null
+++ mozilla/media/libtremor/Makefile.in
@@ -0,0 +1,16 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DEPTH = @DEPTH@
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/rules.mk
+
+ifdef MOZ_NATIVE_OGG
+CFLAGS += $(MOZ_OGG_CFLAGS)
+endif
diff --git media/libvorbis/Makefile.in media/libvorbis/Makefile.in
new file mode 100644
index 0000000..1f02dc0
--- /dev/null
+++ mozilla/media/libvorbis/Makefile.in
@@ -0,0 +1,16 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+DEPTH = @DEPTH@
+topsrcdir = @top_srcdir@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+include $(topsrcdir)/config/rules.mk
+
+ifdef MOZ_NATIVE_OGG
+CFLAGS += $(MOZ_OGG_CFLAGS)
+endif
diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
index c5e82c4..91ef86a 100644
--- mozilla/media/webrtc/signaling/test/Makefile.in
+++ mozilla/media/webrtc/signaling/test/Makefile.in
@@ -48,6 +48,12 @@ LIBS += \
   $(NULL)
 endif
 
+ifdef MOZ_NATIVE_OPUS
+LIBS += \
+  $(MOZ_OPUS_LIBS) \
+  $(NULL)
+endif
+
 ifdef MOZ_NATIVE_LIBVPX
 LIBS += \
   $(MOZ_LIBVPX_LIBS) \
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
index 00e77e7..55f48ab 100644
--- mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
+++ mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
@@ -14,9 +14,9 @@
       'conditions': [
         ['build_with_mozilla==1', {
           # Mozilla provides its own build of the opus library.
-          'include_dirs': [
-            '$(DIST)/include/opus',
-           ]
+          'cflags_mozilla': [
+            '$(MOZ_OPUS_CFLAGS)',
+          ],
         }, {
           'dependencies': [
             '<(DEPTH)/third_party/opus/opus.gyp:opus'
diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
index 27f488e..cd27084 100644
--- mozilla/toolkit/library/Makefile.in
+++ mozilla/toolkit/library/Makefile.in
@@ -91,6 +91,18 @@ ifdef MOZ_NATIVE_HUNSPELL
 EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
 endif
 
+ifdef MOZ_NATIVE_OGG
+EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
+endif
+
+ifdef MOZ_NATIVE_VORBIS
+EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
+endif
+
+ifdef MOZ_NATIVE_OPUS
+EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
+endif
+
 ifdef MOZ_NATIVE_LIBEVENT
 EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
 endif