Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2014 03:17:36 GMT
From:      svn-freebsd-gecko@chruetertee.ch
To:        freebsd-gecko@freebsd.org
Subject:   [SVN-Commit] r1512 - in trunk: Mk mail/thunderbird mail/thunderbird/files www/firefox www/firefox-esr www/firefox-esr/files www/firefox-nightly www/firefox-nightly/files www/firefox/files www/libxul www/libxul/files www/seamonkey www/seamonkey/files
Message-ID:  <201402260317.s1Q3Haab076010@trillian.chruetertee.ch>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Wed Feb 26 03:17:35 2014
New Revision: 1512

Log:
build against system vorbis/opus

Added:
   trunk/mail/thunderbird/files/patch-zz-bug517422
   trunk/www/firefox-esr/files/patch-zz-bug517422
   trunk/www/firefox-nightly/files/patch-z-bug517422
   trunk/www/firefox/files/patch-z-bug517422
   trunk/www/libxul/files/patch-zz-bug517422
   trunk/www/seamonkey/files/patch-z-bug517422
Modified:
   trunk/Mk/bsd.gecko.mk
   trunk/mail/thunderbird/Makefile
   trunk/www/firefox-esr/Makefile
   trunk/www/firefox-nightly/Makefile
   trunk/www/firefox/Makefile
   trunk/www/libxul/Makefile
   trunk/www/seamonkey/Makefile

Modified: trunk/Mk/bsd.gecko.mk
==============================================================================
--- trunk/Mk/bsd.gecko.mk	Wed Feb 26 03:17:25 2014	(r1511)
+++ trunk/Mk/bsd.gecko.mk	Wed Feb 26 03:17:35 2014	(r1512)
@@ -567,7 +567,7 @@
 .endif
 
 # Standard depends
-_ALL_DEPENDS=	cairo event ffi harfbuzz hunspell icu jpeg nspr nss png sqlite vpx zip
+_ALL_DEPENDS=	cairo event ffi harfbuzz hunspell icu jpeg nspr nss opus png sqlite vorbis vpx zip
 
 cairo_LIB_DEPENDS=	cairo:${PORTSDIR}/graphics/cairo
 cairo_MOZ_OPTIONS=	--enable-system-cairo --enable-system-pixman
@@ -608,6 +608,10 @@
 						--exclude mozilla*/security/coreconf \
 						--exclude mozilla*/security/nss
 
+opus_LIB_DEPENDS=	opus:${PORTSDIR}/audio/opus
+opus_MOZ_OPTIONS=	--with-system-opus
+opus_EXTRACT_AFTER_ARGS=	--exclude mozilla*/media/libopus
+
 png_LIB_DEPENDS=	png15:${PORTSDIR}/graphics/png
 png_MOZ_OPTIONS=	--with-system-png=${LOCALBASE}
 png_EXTRACT_AFTER_ARGS=	--exclude mozilla*/media/libpng
@@ -616,6 +620,11 @@
 sqlite_MOZ_OPTIONS=	--enable-system-sqlite
 sqlite_EXTRACT_AFTER_ARGS=	--exclude mozilla*/db/sqlite3
 
+vorbis_LIB_DEPENDS=	vorbis:${PORTSDIR}/audio/libvorbis
+vorbis_MOZ_OPTIONS=	--with-system-vorbis --with-system-ogg
+vorbis_EXTRACT_AFTER_ARGS=	--exclude mozilla*/media/libvorbis \
+							--exclude mozilla*/media/libogg
+
 -vpx_BUILD_DEPENDS=	yasm:${PORTSDIR}/devel/yasm
 vpx_LIB_DEPENDS=	vpx:${PORTSDIR}/multimedia/libvpx
 vpx_MOZ_OPTIONS=	--with-system-libvpx

Modified: trunk/mail/thunderbird/Makefile
==============================================================================
--- trunk/mail/thunderbird/Makefile	Wed Feb 26 03:17:25 2014	(r1511)
+++ trunk/mail/thunderbird/Makefile	Wed Feb 26 03:17:35 2014	(r1512)
@@ -18,6 +18,8 @@
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
 		cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
 		harfbuzz>=0.9.16:${PORTSDIR}/print/harfbuzz \
+		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \
+		opus>=1.1:${PORTSDIR}/audio/opus \
 		v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
 		unzip:${PORTSDIR}/archivers/unzip
 LIB_DEPENDS=	libv4l2.so:${PORTSDIR}/multimedia/libv4l

Added: trunk/mail/thunderbird/files/patch-zz-bug517422
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/mail/thunderbird/files/patch-zz-bug517422	Wed Feb 26 03:17:35 2014	(r1512)
@@ -0,0 +1,271 @@
+# Allow building against system-wide ogg/vorbis/opus.
+
+diff --git config/Makefile.in config/Makefile.in
+index 5383399..67a1a20 100644
+--- mozilla/config/Makefile.in
++++ mozilla/config/Makefile.in
+@@ -79,6 +79,8 @@ export:: $(export-preqs)
+ 		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+ 		-DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
+ 		-DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
++		-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,16 @@ graphite2/Segment.h
+ harfbuzz/hb-ot.h
+ harfbuzz/hb.h
+ #endif
++#if MOZ_NATIVE_OGG==1
++ogg/ogg.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/libvorbis/Makefile.in media/libvorbis/Makefile.in
+new file mode 100644
+index 0000000..1f02dc0
+--- /dev/null
++++ mozilla/media/libvorbis/Makefile.in
+@@ -0,0 +1,9 @@
++# 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/.
++
++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

Modified: trunk/www/firefox-esr/Makefile
==============================================================================
--- trunk/www/firefox-esr/Makefile	Wed Feb 26 03:17:25 2014	(r1511)
+++ trunk/www/firefox-esr/Makefile	Wed Feb 26 03:17:35 2014	(r1512)
@@ -18,6 +18,8 @@
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
 		cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
 		harfbuzz>=0.9.16:${PORTSDIR}/print/harfbuzz \
+		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \
+		opus>=1.1:${PORTSDIR}/audio/opus \
 		v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
 		unzip:${PORTSDIR}/archivers/unzip
 LIB_DEPENDS=	libv4l2.so:${PORTSDIR}/multimedia/libv4l

Added: trunk/www/firefox-esr/files/patch-zz-bug517422
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox-esr/files/patch-zz-bug517422	Wed Feb 26 03:17:35 2014	(r1512)
@@ -0,0 +1,271 @@
+# Allow building against system-wide ogg/vorbis/opus.
+
+diff --git config/Makefile.in config/Makefile.in
+index 5383399..67a1a20 100644
+--- config/Makefile.in
++++ config/Makefile.in
+@@ -79,6 +79,8 @@ export:: $(export-preqs)
+ 		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+ 		-DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
+ 		-DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
++		-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
+--- toolkit/toolkit.mozbuild
++++ 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
+--- config/system-headers
++++ config/system-headers
+@@ -1152,3 +1152,16 @@ graphite2/Segment.h
+ harfbuzz/hb-ot.h
+ harfbuzz/hb.h
+ #endif
++#if MOZ_NATIVE_OGG==1
++ogg/ogg.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
+--- configure.in
++++ 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
+--- content/media/Makefile.in
++++ 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
+--- layout/media/Makefile.in
++++ 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/libvorbis/Makefile.in media/libvorbis/Makefile.in
+new file mode 100644
+index 0000000..1f02dc0
+--- /dev/null
++++ media/libvorbis/Makefile.in
+@@ -0,0 +1,9 @@
++# 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/.
++
++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
+--- media/webrtc/signaling/test/Makefile.in
++++ 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
+--- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
++++ 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
+--- toolkit/library/Makefile.in
++++ 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

Modified: trunk/www/firefox-nightly/Makefile
==============================================================================
--- trunk/www/firefox-nightly/Makefile	Wed Feb 26 03:17:25 2014	(r1511)
+++ trunk/www/firefox-nightly/Makefile	Wed Feb 26 03:17:35 2014	(r1512)
@@ -19,6 +19,8 @@
 		sqlite3>=3.8.3.1:${PORTSDIR}/databases/sqlite3 \
 		v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
 		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
+		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \
+		opus>=1.1:${PORTSDIR}/audio/opus \
 		libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \
 		nspr>=4.10.3:${PORTSDIR}/devel/nspr \
 		unzip:${PORTSDIR}/archivers/unzip

Added: trunk/www/firefox-nightly/files/patch-z-bug517422
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox-nightly/files/patch-z-bug517422	Wed Feb 26 03:17:35 2014	(r1512)
@@ -0,0 +1,236 @@
+# Allow building against system-wide ogg/vorbis/opus.
+
+diff --git config/Makefile.in config/Makefile.in
+index 5383399..4393ae8 100644
+--- config/Makefile.in
++++ 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 config/external/moz.build config/external/moz.build
+index c22a36c..740402e 100644
+--- config/external/moz.build
++++ config/external/moz.build
+@@ -15,13 +15,13 @@ if CONFIG['MOZ_UPDATER']:
+     if not CONFIG['MOZ_NATIVE_BZ2']:
+         external_dirs += ['modules/libbz2']
+ 
+-if CONFIG['MOZ_VORBIS']:
++if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
+     external_dirs += ['media/libvorbis']
+ 
+ if CONFIG['MOZ_TREMOR']:
+     external_dirs += ['media/libtremor']
+ 
+-if CONFIG['MOZ_OPUS']:
++if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']:
+     external_dirs += ['media/libopus']
+ 
+ if CONFIG['MOZ_WEBM']:
+@@ -35,11 +35,13 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ
+ 
+ if not CONFIG['MOZ_NATIVE_PNG']:
+     external_dirs += ['media/libpng']
++    
++if not CONFIG['MOZ_NATIVE_OGG']:
++    external_dirs += ['media/libogg']
+ 
+ external_dirs += [
+     'media/kiss_fft',
+     'media/libcubeb',
+-    'media/libogg',
+     'media/libtheora',
+     'media/libspeex_resampler',
+     'media/libsoundtouch',
+diff --git config/system-headers config/system-headers
+index b711fc3..fd3c14f 100644
+--- config/system-headers
++++ config/system-headers
+@@ -1152,3 +1152,16 @@ graphite2/Segment.h
+ harfbuzz/hb-ot.h
+ harfbuzz/hb.h
+ #endif
++#if MOZ_NATIVE_OGG==1
++ogg/ogg.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
+--- configure.in
++++ 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
+--- content/media/Makefile.in
++++ 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 media/libvorbis/Makefile.in media/libvorbis/Makefile.in
+new file mode 100644
+index 0000000..1f02dc0
+--- /dev/null
++++ media/libvorbis/Makefile.in
+@@ -0,0 +1,9 @@
++# 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/.
++
++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
+--- media/webrtc/signaling/test/Makefile.in
++++ 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
+--- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
++++ 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': [
+-            '/media/libopus/include',
+-           ]
++          '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
+--- toolkit/library/Makefile.in
++++ 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

Modified: trunk/www/firefox/Makefile
==============================================================================
--- trunk/www/firefox/Makefile	Wed Feb 26 03:17:25 2014	(r1511)
+++ trunk/www/firefox/Makefile	Wed Feb 26 03:17:35 2014	(r1512)
@@ -15,6 +15,8 @@
 BUILD_DEPENDS=	nspr>=4.10.3:${PORTSDIR}/devel/nspr \
 		nss>=3.15.4:${PORTSDIR}/security/nss \
 		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
+		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \
+		opus>=1.1:${PORTSDIR}/audio/opus \
 		libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \
 		sqlite3>=3.8.1:${PORTSDIR}/databases/sqlite3 \
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \

Added: trunk/www/firefox/files/patch-z-bug517422
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/firefox/files/patch-z-bug517422	Wed Feb 26 03:17:35 2014	(r1512)
@@ -0,0 +1,232 @@
+# Allow building against system-wide ogg/vorbis/opus.
+
+diff --git config/Makefile.in config/Makefile.in
+index 5383399..4393ae8 100644
+--- config/Makefile.in
++++ 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 config/external/moz.build config/external/moz.build
+index c22a36c..740402e 100644
+--- config/external/moz.build
++++ config/external/moz.build
+@@ -15,13 +15,13 @@ if CONFIG['MOZ_UPDATER']:
+     if not CONFIG['MOZ_NATIVE_BZ2']:
+         external_dirs += ['modules/libbz2']
+ 
+-if CONFIG['MOZ_VORBIS']:
++if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
+     external_dirs += ['media/libvorbis']
+ 
+ if CONFIG['MOZ_TREMOR']:
+     external_dirs += ['media/libtremor']
+ 
+-if CONFIG['MOZ_OPUS']:
++if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']:
+     external_dirs += ['media/libopus']
+ 
+ if CONFIG['MOZ_WEBM']:
+@@ -34,7 +34,9 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']:
+     external_dirs += ['media/libvpx']
+ 
+ if CONFIG['MOZ_OGG']:
+-    external_dirs += ['media/libogg', 'media/libtheora']
++    if not CONFIG['MOZ_NATIVE_OGG']:
++        external_dirs += ['media/libogg']
++    external_dirs += ['media/libtheora']
+ 
+ if not CONFIG['MOZ_NATIVE_PNG']:
+     external_dirs += ['media/libpng']
+diff --git config/system-headers config/system-headers
+index b711fc3..fd3c14f 100644
+--- config/system-headers
++++ config/system-headers
+@@ -1152,3 +1152,16 @@ graphite2/Segment.h
+ harfbuzz/hb-ot.h
+ harfbuzz/hb.h
+ #endif
++#if MOZ_NATIVE_OGG==1
++ogg/ogg.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
+--- configure.in
++++ 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
+--- content/media/Makefile.in
++++ 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 media/libvorbis/Makefile.in media/libvorbis/Makefile.in
+new file mode 100644
+index 0000000..1f02dc0
+--- /dev/null
++++ media/libvorbis/Makefile.in
+@@ -0,0 +1,9 @@
++# 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/.
++
++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
+--- media/webrtc/signaling/test/Makefile.in
++++ 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
+--- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
++++ 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
+--- toolkit/library/Makefile.in
++++ 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

Modified: trunk/www/libxul/Makefile
==============================================================================
--- trunk/www/libxul/Makefile	Wed Feb 26 03:17:25 2014	(r1511)
+++ trunk/www/libxul/Makefile	Wed Feb 26 03:17:35 2014	(r1512)
@@ -17,6 +17,8 @@
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
 		cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
 		harfbuzz>=0.9.16:${PORTSDIR}/print/harfbuzz \
+		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \
+		opus>=1.1:${PORTSDIR}/audio/opus \
 		v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
 		unzip:${PORTSDIR}/archivers/unzip
 LIB_DEPENDS=	libv4l2.so:${PORTSDIR}/multimedia/libv4l

Added: trunk/www/libxul/files/patch-zz-bug517422
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/libxul/files/patch-zz-bug517422	Wed Feb 26 03:17:35 2014	(r1512)
@@ -0,0 +1,271 @@
+# Allow building against system-wide ogg/vorbis/opus.
+
+diff --git config/Makefile.in config/Makefile.in
+index 5383399..67a1a20 100644
+--- config/Makefile.in
++++ config/Makefile.in
+@@ -79,6 +79,8 @@ export:: $(export-preqs)
+ 		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+ 		-DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
+ 		-DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
++		-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
+--- toolkit/toolkit.mozbuild
++++ 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
+--- config/system-headers
++++ config/system-headers
+@@ -1152,3 +1152,16 @@ graphite2/Segment.h
+ harfbuzz/hb-ot.h
+ harfbuzz/hb.h
+ #endif
++#if MOZ_NATIVE_OGG==1
++ogg/ogg.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
+--- configure.in
++++ 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
+--- content/media/Makefile.in
++++ 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
+--- layout/media/Makefile.in
++++ 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/libvorbis/Makefile.in media/libvorbis/Makefile.in
+new file mode 100644
+index 0000000..1f02dc0
+--- /dev/null
++++ media/libvorbis/Makefile.in
+@@ -0,0 +1,9 @@
++# 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/.
++
++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
+--- media/webrtc/signaling/test/Makefile.in
++++ 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
+--- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
++++ 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
+--- toolkit/library/Makefile.in
++++ 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

Modified: trunk/www/seamonkey/Makefile
==============================================================================
--- trunk/www/seamonkey/Makefile	Wed Feb 26 03:17:25 2014	(r1511)
+++ trunk/www/seamonkey/Makefile	Wed Feb 26 03:17:35 2014	(r1512)
@@ -15,6 +15,8 @@
 BUILD_DEPENDS=	nspr>=4.10.3:${PORTSDIR}/devel/nspr \
 		nss>=3.15.4:${PORTSDIR}/security/nss \
 		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
+		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \
+		opus>=1.1:${PORTSDIR}/audio/opus \
 		libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \
 		sqlite3>=3.8.1:${PORTSDIR}/databases/sqlite3 \
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \

Added: trunk/www/seamonkey/files/patch-z-bug517422
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/www/seamonkey/files/patch-z-bug517422	Wed Feb 26 03:17:35 2014	(r1512)
@@ -0,0 +1,232 @@
+# 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 config/external/moz.build config/external/moz.build
+index c22a36c..740402e 100644
+--- mozilla/config/external/moz.build
++++ mozilla/config/external/moz.build
+@@ -15,13 +15,13 @@ if CONFIG['MOZ_UPDATER']:
+     if not CONFIG['MOZ_NATIVE_BZ2']:
+         external_dirs += ['modules/libbz2']
+ 
+-if CONFIG['MOZ_VORBIS']:
++if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
+     external_dirs += ['media/libvorbis']
+ 
+ if CONFIG['MOZ_TREMOR']:
+     external_dirs += ['media/libtremor']
+ 
+-if CONFIG['MOZ_OPUS']:
++if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']:
+     external_dirs += ['media/libopus']
+ 
+ if CONFIG['MOZ_WEBM']:
+@@ -34,7 +34,9 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']:
+     external_dirs += ['media/libvpx']
+ 
+ if CONFIG['MOZ_OGG']:
+-    external_dirs += ['media/libogg', 'media/libtheora']
++    if not CONFIG['MOZ_NATIVE_OGG']:
++        external_dirs += ['media/libogg']
++    external_dirs += ['media/libtheora']
+ 
+ if not CONFIG['MOZ_NATIVE_PNG']:
+     external_dirs += ['media/libpng']
+diff --git config/system-headers config/system-headers
+index b711fc3..fd3c14f 100644
+--- mozilla/config/system-headers
++++ mozilla/config/system-headers
+@@ -1152,3 +1152,16 @@ graphite2/Segment.h
+ harfbuzz/hb-ot.h
+ harfbuzz/hb.h
+ #endif
++#if MOZ_NATIVE_OGG==1
++ogg/ogg.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 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,9 @@
++# 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/.
++
++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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402260317.s1Q3Haab076010>