Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Apr 2014 01:13:55 GMT
From:      svn-freebsd-gecko@chruetertee.ch
To:        freebsd-gecko@freebsd.org
Subject:   [SVN-Commit] r1569 - 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:  <201404110113.s3B1DtD1083540@trillian.chruetertee.ch>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Apr 11 01:13:55 2014
New Revision: 1569

Log:
sync system deps with bugzilla and add soundtouch

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

Added: trunk/Gecko_ChangeLog
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/Gecko_ChangeLog	Fri Apr 11 01:13:55 2014	(r1569)
@@ -0,0 +1,4 @@
+- use port dependency for soundtouch library
+- require recent graphite2 version explicitly [1]
+
+PR:	ports/187939 [1]

Modified: trunk/Mk/bsd.gecko.mk
==============================================================================
--- trunk/Mk/bsd.gecko.mk	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/Mk/bsd.gecko.mk	Fri Apr 11 01:13:55 2014	(r1569)
@@ -547,7 +547,7 @@
 .endif
 
 # Standard depends
-_ALL_DEPENDS=	cairo event ffi graphite harfbuzz hunspell icu jpeg nspr nss opus png pixman sqlite vorbis vpx
+_ALL_DEPENDS=	cairo event ffi graphite harfbuzz hunspell icu jpeg nspr nss opus png pixman soundtouch sqlite vorbis vpx
 
 cairo_LIB_DEPENDS=	libcairo.so:${PORTSDIR}/graphics/cairo
 cairo_MOZ_OPTIONS=	--enable-system-cairo
@@ -607,11 +607,27 @@
 png_MOZ_OPTIONS=	--with-system-png=${LOCALBASE}
 png_EXTRACT_AFTER_ARGS=	--exclude mozilla*/media/libpng
 
+.if exists(${FILESDIR}/patch-z-bug517422) || exists(${FILESDIR}/patch-zz-bug517422)
+soundtouch_LIB_DEPENDS=	libSoundTouch.so:${PORTSDIR}/audio/soundtouch
+soundtouch_MOZ_OPTIONS=	--with-system-soundtouch
+soundtouch_EXTRACT_AFTER_ARGS=	--exclude mozilla*/media/libsoundtouch
+
+# XXX disabled: bug 913854 not yet upstreamed
+speex_LIB_DEPENDS=	libspeexdsp.so:${PORTSDIR}/audio/speex
+speex_MOZ_OPTIONS=	--with-system-speex
+speex_EXTRACT_AFTER_ARGS=	--exclude mozilla*/media/libspeex_resampler
+.endif
+
 sqlite_LIB_DEPENDS=	libsqlite3.so:${PORTSDIR}/databases/sqlite3
 sqlite_MOZ_OPTIONS=	--enable-system-sqlite
 sqlite_EXTRACT_AFTER_ARGS=	--exclude mozilla*/db/sqlite3
 
 .if exists(${FILESDIR}/patch-z-bug517422) || exists(${FILESDIR}/patch-zz-bug517422)
+# XXX disabled: update to 1.2.x or review backported fixes
+theora_LIB_DEPENDS=	libtheora.so:${PORTSDIR}/multimedia/libtheora
+theora_MOZ_OPTIONS=	--with-system-theora
+theora_EXTRACT_AFTER_ARGS=	--exclude mozilla*/media/libtheora
+
 vorbis_LIB_DEPENDS=	libvorbis.so:${PORTSDIR}/audio/libvorbis
 vorbis_MOZ_OPTIONS=	--with-system-vorbis --with-system-ogg
 vorbis_EXTRACT_AFTER_ARGS=	--exclude mozilla*/media/libvorbis \

Modified: trunk/mail/thunderbird/Makefile
==============================================================================
--- trunk/mail/thunderbird/Makefile	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/mail/thunderbird/Makefile	Fri Apr 11 01:13:55 2014	(r1569)
@@ -17,6 +17,7 @@
 		sqlite3>=3.7.17:${PORTSDIR}/databases/sqlite3 \
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
 		cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
+		soundtouch>=1.7.0:${PORTSDIR}/audio/soundtouch \
 		harfbuzz>=0.9.16:${PORTSDIR}/print/harfbuzz \
 		graphite2>=1.2.3:${PORTSDIR}/graphics/graphite2 \
 		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \

Modified: trunk/mail/thunderbird/files/patch-z-bug847568
==============================================================================
--- trunk/mail/thunderbird/files/patch-z-bug847568	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/mail/thunderbird/files/patch-z-bug847568	Fri Apr 11 01:13:55 2014	(r1569)
@@ -14,10 +14,10 @@
  	$(INSTALL) system_wrappers $(DIST)
  
 diff --git config/system-headers config/system-headers
-index 126391e..b711fc3 100644
+index 18e8703..bdc5f82 100644
 --- mozilla/config/system-headers
 +++ mozilla/config/system-headers
-@@ -1144,3 +1144,11 @@ unicode/utypes.h
+@@ -1145,3 +1145,11 @@ unicode/utypes.h
  #endif
  libutil.h
  unwind.h
@@ -30,40 +30,58 @@
 +harfbuzz/hb.h
 +#endif
 diff --git configure.in configure.in
-index bbc7b40..1747206 100644
+index ac38f40..87536b7 100644
 --- mozilla/configure.in
 +++ mozilla/configure.in
-@@ -7830,6 +7830,38 @@ if test "$USE_FC_FREETYPE"; then
+@@ -8032,6 +8032,56 @@ if test "$USE_FC_FREETYPE"; then
  fi
  
  dnl ========================================================
-+dnl Check for graphite2 and harfbuzz
++dnl Check for harfbuzz
 +dnl ========================================================
 +
 +MOZ_ARG_WITH_BOOL(system-harfbuzz,
 +[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],
 +MOZ_NATIVE_HARFBUZZ=1,
-+MOZ_NATIVE_HARFBUZZ= )
++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)
 +
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
 +MOZ_ARG_WITH_BOOL(system-graphite2,
 +[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
 +MOZ_NATIVE_GRAPHITE2=1,
-+MOZ_NATIVE_GRAPHITE2= )
++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)'
++    PKG_CHECK_MODULES(MOZ_GRAPHITE, graphite2)
++
++    dnl graphite2.pc has bogus version, check manually
++    AC_TRY_COMPILE([ #include <graphite2/Font.h>
++                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
++                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
++                               * 100 + GR2_VERSION_BUGFIX >= \
++                               (major) * 10000 + (minor) * 100 + (bugfix) )
++                   ], [
++                     #if !GR2_VERSION_REQUIRE(1,2,3)
++                     #error "Insufficient graphite2 version."
++                     #endif
++                   ], [],
++                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
+++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)
@@ -133,7 +151,7 @@
      'thebes',
      'ipc',
 diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
-index 07a77a3..067f7bd 100644
+index ee0efb2..98e169d6f 100644
 --- mozilla/gfx/skia/Makefile.in
 +++ mozilla/gfx/skia/Makefile.in
 @@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
@@ -146,9 +164,9 @@
 +
  include $(topsrcdir)/config/rules.mk
  
- ifneq (,$(INTEL_ARCHITECTURE))
+ ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
 diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
-index e9f6b6c..0df2d8d 100644
+index 45c36ae..79d32cf 100644
 --- mozilla/gfx/thebes/Makefile.in
 +++ mozilla/gfx/thebes/Makefile.in
 @@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
@@ -167,7 +185,7 @@
  CXXFLAGS += $(CAIRO_FT_CFLAGS)
  endif
 diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
-index f6b9f7c..11c44f4 100644
+index f6b9f7c..60863f4 100644
 --- mozilla/intl/unicharutil/util/Makefile.in
 +++ mozilla/intl/unicharutil/util/Makefile.in
 @@ -21,3 +21,7 @@ ifdef _MSC_VER
@@ -176,7 +194,7 @@
  endif
 +
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsUnicodePropertyData.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
 diff --git layout/media/Makefile.in layout/media/Makefile.in
 index 1cacbd7..a8cd156 100644
@@ -202,22 +220,25 @@
  SHARED_LIBRARY_LIBS += $(MOZ_CAIRO_LIBS)
  endif
 diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
-index 1cacbd7..a8cd156 100644
+index 1cacbd7..f5d72bb 100644
 --- mozilla/netwerk/dns/Makefile.in
 +++ mozilla/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
-+
+@@ -5,6 +5,10 @@
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsIDNService.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
++
+ # Generate the include file containing compact, static definitions
+ # for effective TLD data.
+ etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 007f272..27f488e 100644
+index 67f0db9..d42137a 100644
 --- mozilla/toolkit/library/Makefile.in
 +++ mozilla/toolkit/library/Makefile.in
-@@ -103,6 +103,14 @@ ifndef MOZ_TREE_PIXMAN
+@@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN
  EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
  endif
  

Modified: trunk/mail/thunderbird/files/patch-zz-bug517422
==============================================================================
--- trunk/mail/thunderbird/files/patch-zz-bug517422	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/mail/thunderbird/files/patch-zz-bug517422	Fri Apr 11 01:13:55 2014	(r1569)
@@ -1,16 +1,20 @@
-# Allow building against system-wide ogg/vorbis/opus.
+# Allow more config/external/ libs built against system-wide version.
 
 diff --git config/Makefile.in config/Makefile.in
-index 5383399..4393ae8 100644
+index 5383399..0410004 100644
 --- mozilla/config/Makefile.in
 +++ mozilla/config/Makefile.in
-@@ -79,6 +79,9 @@ export:: $(export-preqs)
+@@ -79,6 +79,13 @@ 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_THEORA=$(MOZ_NATIVE_THEORA) \
 +		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
++		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
 +		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
++		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
++		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
  		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
  	$(INSTALL) system_wrappers $(DIST)
  
@@ -26,7 +30,8 @@
 +if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
      add_tier_dir('platform', 'media/libvorbis')
  
- if CONFIG['MOZ_TREMOR']:
+-if CONFIG['MOZ_TREMOR']:
++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
      add_tier_dir('platform', 'media/libtremor')
  
 -if CONFIG['MOZ_OPUS']:
@@ -34,22 +39,54 @@
      add_tier_dir('platform', 'media/libopus')
  
  if CONFIG['MOZ_WEBM']:
-@@ -82,7 +82,9 @@ if CONFIG['MOZ_VP8'] and not CONFIG['MOZ
+@@ -82,7 +82,10 @@ 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 not CONFIG['MOZ_NATIVE_THEORA']:
++        add_tier_dir('platform', 'media/libtheora')
  
  if CONFIG['MOZ_WEBRTC']:
      add_tier_dir('platform', [
+@@ -92,10 +95,10 @@ if CONFIG['MOZ_WEBRTC']:
+         'media/mtransport/standalone',
+     ])
+ 
+-if CONFIG['MOZ_SPEEX_RESAMPLER']:
++if CONFIG['MOZ_SPEEX_RESAMPLER'] and not CONFIG['MOZ_NATIVE_SPEEX']:
+     add_tier_dir('platform', 'media/libspeex_resampler')
+ 
+-if CONFIG['MOZ_SOUNDTOUCH']:
++if CONFIG['MOZ_SOUNDTOUCH'] and not CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
+     add_tier_dir('platform', 'media/libsoundtouch')
+ 
+ if CONFIG['MOZ_CUBEB']:
 diff --git config/system-headers config/system-headers
-index b711fc3..fd3c14f 100644
+index bef567c..9807c29 100644
 --- mozilla/config/system-headers
 +++ mozilla/config/system-headers
-@@ -1152,3 +1152,17 @@ graphite2/Segment.h
+@@ -1050,8 +1050,6 @@ X11/Xutil.h
+ xpt_struct.h
+ xpt_xdr.h
+ zmouse.h
+-speex/speex_resampler.h
+-soundtouch/SoundTouch.h
+ #if MOZ_NATIVE_PNG==1
+ png.h
+ #endif
+@@ -1119,6 +1117,8 @@ ogg/ogg.h
+ ogg/os_types.h
+ nestegg/nestegg.h
+ cubeb/cubeb.h
++speex/speex_resampler.h
++soundtouch/SoundTouch.h
+ #endif
+ gst/gst.h
+ gst/app/gstappsink.h
+@@ -1155,3 +1155,29 @@ graphite2/Segment.h
  harfbuzz/hb-ot.h
  harfbuzz/hb.h
  #endif
@@ -57,21 +94,33 @@
 +ogg/ogg.h
 +ogg/os_types.h
 +#endif
++#if MOZ_NATIVE_THEORA==1
++theora/theoradec.h
++#endif
 +#if MOZ_NATIVE_VORBIS==1
 +vorbis/codec.h
 +vorbis/vorbisenc.h
 +#endif
++#if MOZ_NATIVE_TREMOR==1
++tremor/ivorbiscodec.h
++#endif
 +#if MOZ_NATIVE_OPUS==1
 +opus.h
 +opus_multistream.h
 +opus/opus.h
 +opus/opus_multistream.h
 +#endif
++#if MOZ_NATIVE_SPEEX==1
++speex/speex_resampler.h
++#endif
++#if MOZ_NATIVE_SOUNDTOUCH==1
++soundtouch/SoundTouch.h
++#endif
 diff --git configure.in configure.in
-index df49287..05e97ff 100644
+index 87db361..7947626 100644
 --- mozilla/configure.in
 +++ mozilla/configure.in
-@@ -5143,6 +5143,40 @@ if test -n "$MOZ_OGG"; then
+@@ -5211,6 +5211,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
  fi
  
  dnl ========================================================
@@ -81,7 +130,7 @@
 +MOZ_ARG_WITH_BOOL(system-ogg,
 +[  --with-system-ogg       Use system libogg (located with pkgconfig)],
 +MOZ_NATIVE_OGG=1,
-+MOZ_NATIVE_OGG= )
++MOZ_NATIVE_OGG=)
 +
 +if test -n "$MOZ_NATIVE_OGG"; then
 +    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
@@ -98,7 +147,7 @@
 +MOZ_ARG_WITH_BOOL(system-vorbis,
 +[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
 +MOZ_NATIVE_VORBIS=1,
-+MOZ_NATIVE_VORBIS= )
++MOZ_NATIVE_VORBIS=)
 +
 +if test -n "$MOZ_NATIVE_VORBIS"; then
 +    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
@@ -109,10 +158,27 @@
 +AC_SUBST(MOZ_VORBIS_LIBS)
 +
 +dnl ========================================================
++dnl Check for integer-only libvorbis aka tremor
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-tremor,
++[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
++MOZ_NATIVE_TREMOR=1,
++MOZ_NATIVE_TREMOR=)
++
++if test -n "$MOZ_NATIVE_TREMOR"; then
++    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_NATIVE_TREMOR)
++AC_SUBST(MOZ_TREMOR_CFLAGS)
++AC_SUBST(MOZ_TREMOR_LIBS)
++
++dnl ========================================================
  dnl = Disable Opus audio codec support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(opus,
-@@ -5151,6 +5185,25 @@ MOZ_ARG_DISABLE_BOOL(opus,
+@@ -5219,6 +5274,76 @@ MOZ_ARG_DISABLE_BOOL(opus,
      MOZ_OPUS=1)
  
  dnl ========================================================
@@ -122,7 +188,7 @@
 +MOZ_ARG_WITH_BOOL(system-opus,
 +[  --with-system-opus      Use system libopus (located with pkgconfig)],
 +MOZ_NATIVE_OPUS=1,
-+MOZ_NATIVE_OPUS= )
++MOZ_NATIVE_OPUS=)
 +
 +if test -n "$MOZ_NATIVE_OPUS"; then
 +    PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
@@ -135,14 +201,66 @@
 +AC_SUBST(MOZ_OPUS_LIBS)
 +
 +dnl ========================================================
++dnl Check for libtheora
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-theora,
++[  --with-system-theora    Use system libtheora (located with pkgconfig)],
++MOZ_NATIVE_THEORA=1,
++MOZ_NATIVE_THEORA=)
++
++if test -n "$MOZ_NATIVE_THEORA"; then
++    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_THEORA)
++AC_SUBST(MOZ_THEORA_CFLAGS)
++AC_SUBST(MOZ_THEORA_LIBS)
++
++dnl ========================================================
++dnl Check for libspeex resampler
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-speex,
++[  --with-system-speex     Use system libspeex (located with pkgconfig)],
++MOZ_NATIVE_SPEEX=1,
++MOZ_NATIVE_SPEEX=)
++
++if test -n "$MOZ_NATIVE_SPEEX"; then
++    PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_SPEEX)
++AC_SUBST(MOZ_SPEEX_CFLAGS)
++AC_SUBST(MOZ_SPEEX_LIBS)
++
++dnl ========================================================
++dnl Check for libsoundtouch
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-soundtouch,
++[  --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)],
++MOZ_NATIVE_SOUNDTOUCH=1,
++MOZ_NATIVE_SOUNDTOUCH=)
++
++if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then
++    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.7.0)
++fi
++
++AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
++AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
++AC_SUBST(MOZ_SOUNDTOUCH_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
+index fd34449..c6c42c8 100644
 --- mozilla/content/media/Makefile.in
 +++ mozilla/content/media/Makefile.in
-@@ -7,4 +7,16 @@ include $(topsrcdir)/config/rules.mk
+@@ -6,4 +6,31 @@ include $(topsrcdir)/config/rules.mk
+ 
  CFLAGS   += $(GSTREAMER_CFLAGS)
  CXXFLAGS += $(GSTREAMER_CFLAGS)
  
@@ -150,20 +268,48 @@
 +CXXFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++CXXFLAGS += $(MOZ_THEORA_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +CXXFLAGS += $(MOZ_OPUS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
++endif
+diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
+index 4c14494..1cb98e2 100644
+--- mozilla/media/libcubeb/src/Makefile.in
++++ mozilla/media/libcubeb/src/Makefile.in
+@@ -9,3 +9,7 @@ CFLAGS += \
+         $(MOZ_ALSA_CFLAGS) \
+         $(MOZ_PULSEAUDIO_CFLAGS) \
+         $(NULL)
++
++ifdef MOZ_NATIVE_SPEEX
++CFLAGS += $(MOZ_SPEEX_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
+@@ -36,31 +36,45 @@ ifdef MOZ_TREE_PIXMAN
  SHARED_LIBRARY_LIBS += $(MOZ_PIXMAN_LIBS)
  endif
  
@@ -185,9 +331,21 @@
 +endif
  
  ifdef MOZ_TREMOR
++ifndef MOZ_NATIVE_TREMOR
  SHARED_LIBRARY_LIBS	+= \
-@@ -51,10 +66,12 @@ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libtremor/lib/$(LIB_PREFIX)tremor.$(LIB_SUFFIX) \
+-	$(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
+ 	$(NULL)
  endif
++endif
+ 
+ ifdef MOZ_OGG
++ifndef MOZ_NATIVE_THEORA
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libtheora/lib/$(LIB_PREFIX)theora.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
  
  ifdef MOZ_OPUS
 +ifndef MOZ_NATIVE_OPUS
@@ -199,6 +357,27 @@
  
  ifdef MOZ_WEBM
  SHARED_LIBRARY_LIBS 	+= \
+@@ -77,16 +91,20 @@ endif
+ endif
+ 
+ ifdef MOZ_SPEEX_RESAMPLER
++ifndef MOZ_NATIVE_SPEEX
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libspeex_resampler/src/$(LIB_PREFIX)speex_resampler.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
+ 
+ ifdef MOZ_SOUNDTOUCH
++ifndef MOZ_NATIVE_SOUNDTOUCH
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libsoundtouch/src/$(LIB_PREFIX)soundtouch.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
+ 
+ ifdef MOZ_CUBEB
+ SHARED_LIBRARY_LIBS 	+= \
 diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
 new file mode 100644
 index 0000000..1f02dc0
@@ -266,7 +445,7 @@
 +CFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
-index c5e82c4..91ef86a 100644
+index bbc971c..6ed7e41 100644
 --- mozilla/media/webrtc/signaling/test/Makefile.in
 +++ mozilla/media/webrtc/signaling/test/Makefile.in
 @@ -48,6 +48,12 @@ LIBS += \
@@ -300,10 +479,10 @@
            'dependencies': [
              '<(DEPTH)/third_party/opus/opus.gyp:opus'
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 27f488e..cd27084 100644
+index d42137a..695e75a8 100644
 --- mozilla/toolkit/library/Makefile.in
 +++ mozilla/toolkit/library/Makefile.in
-@@ -91,6 +91,18 @@ ifdef MOZ_NATIVE_HUNSPELL
+@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
  EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
  endif
  
@@ -311,14 +490,30 @@
 +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_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 Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox-esr/Makefile	Fri Apr 11 01:13:55 2014	(r1569)
@@ -17,6 +17,7 @@
 		sqlite3>=3.7.17:${PORTSDIR}/databases/sqlite3 \
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
 		cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
+		soundtouch>=1.7.0:${PORTSDIR}/audio/soundtouch \
 		harfbuzz>=0.9.16:${PORTSDIR}/print/harfbuzz \
 		graphite2>=1.2.3:${PORTSDIR}/graphics/graphite2 \
 		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \

Modified: trunk/www/firefox-esr/files/patch-z-bug847568
==============================================================================
--- trunk/www/firefox-esr/files/patch-z-bug847568	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox-esr/files/patch-z-bug847568	Fri Apr 11 01:13:55 2014	(r1569)
@@ -14,10 +14,10 @@
  	$(INSTALL) system_wrappers $(DIST)
  
 diff --git config/system-headers config/system-headers
-index 126391e..b711fc3 100644
+index 18e8703..bdc5f82 100644
 --- config/system-headers
 +++ config/system-headers
-@@ -1144,3 +1144,11 @@ unicode/utypes.h
+@@ -1145,3 +1145,11 @@ unicode/utypes.h
  #endif
  libutil.h
  unwind.h
@@ -30,40 +30,58 @@
 +harfbuzz/hb.h
 +#endif
 diff --git configure.in configure.in
-index bbc7b40..1747206 100644
+index ac38f40..87536b7 100644
 --- configure.in
 +++ configure.in
-@@ -7830,6 +7830,38 @@ if test "$USE_FC_FREETYPE"; then
+@@ -8032,6 +8032,56 @@ if test "$USE_FC_FREETYPE"; then
  fi
  
  dnl ========================================================
-+dnl Check for graphite2 and harfbuzz
++dnl Check for harfbuzz
 +dnl ========================================================
 +
 +MOZ_ARG_WITH_BOOL(system-harfbuzz,
 +[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],
 +MOZ_NATIVE_HARFBUZZ=1,
-+MOZ_NATIVE_HARFBUZZ= )
++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)
 +
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
 +MOZ_ARG_WITH_BOOL(system-graphite2,
 +[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
 +MOZ_NATIVE_GRAPHITE2=1,
-+MOZ_NATIVE_GRAPHITE2= )
++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)'
++    PKG_CHECK_MODULES(MOZ_GRAPHITE, graphite2)
++
++    dnl graphite2.pc has bogus version, check manually
++    AC_TRY_COMPILE([ #include <graphite2/Font.h>
++                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
++                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
++                               * 100 + GR2_VERSION_BUGFIX >= \
++                               (major) * 10000 + (minor) * 100 + (bugfix) )
++                   ], [
++                     #if !GR2_VERSION_REQUIRE(1,2,3)
++                     #error "Insufficient graphite2 version."
++                     #endif
++                   ], [],
++                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
+++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)
@@ -133,7 +151,7 @@
      'thebes',
      'ipc',
 diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
-index 07a77a3..067f7bd 100644
+index ee0efb2..98e169d6f 100644
 --- gfx/skia/Makefile.in
 +++ gfx/skia/Makefile.in
 @@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
@@ -146,9 +164,9 @@
 +
  include $(topsrcdir)/config/rules.mk
  
- ifneq (,$(INTEL_ARCHITECTURE))
+ ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
 diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
-index e9f6b6c..0df2d8d 100644
+index 45c36ae..79d32cf 100644
 --- gfx/thebes/Makefile.in
 +++ gfx/thebes/Makefile.in
 @@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
@@ -167,7 +185,7 @@
  CXXFLAGS += $(CAIRO_FT_CFLAGS)
  endif
 diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
-index f6b9f7c..11c44f4 100644
+index f6b9f7c..60863f4 100644
 --- intl/unicharutil/util/Makefile.in
 +++ intl/unicharutil/util/Makefile.in
 @@ -21,3 +21,7 @@ ifdef _MSC_VER
@@ -176,7 +194,7 @@
  endif
 +
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsUnicodePropertyData.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
 diff --git layout/media/Makefile.in layout/media/Makefile.in
 index 1cacbd7..a8cd156 100644
@@ -202,22 +220,25 @@
  SHARED_LIBRARY_LIBS += $(MOZ_CAIRO_LIBS)
  endif
 diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
-index 1cacbd7..a8cd156 100644
+index 1cacbd7..f5d72bb 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
-+
+@@ -5,6 +5,10 @@
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsIDNService.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
++
+ # Generate the include file containing compact, static definitions
+ # for effective TLD data.
+ etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 007f272..27f488e 100644
+index 67f0db9..d42137a 100644
 --- toolkit/library/Makefile.in
 +++ toolkit/library/Makefile.in
-@@ -103,6 +103,14 @@ ifndef MOZ_TREE_PIXMAN
+@@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN
  EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
  endif
  

Modified: trunk/www/firefox-esr/files/patch-zz-bug517422
==============================================================================
--- trunk/www/firefox-esr/files/patch-zz-bug517422	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox-esr/files/patch-zz-bug517422	Fri Apr 11 01:13:55 2014	(r1569)
@@ -1,16 +1,20 @@
-# Allow building against system-wide ogg/vorbis/opus.
+# Allow more config/external/ libs built against system-wide version.
 
 diff --git config/Makefile.in config/Makefile.in
-index 5383399..4393ae8 100644
+index 5383399..0410004 100644
 --- config/Makefile.in
 +++ config/Makefile.in
-@@ -79,6 +79,9 @@ export:: $(export-preqs)
+@@ -79,6 +79,13 @@ 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_THEORA=$(MOZ_NATIVE_THEORA) \
 +		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
++		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
 +		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
++		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
++		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
  		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
  	$(INSTALL) system_wrappers $(DIST)
  
@@ -26,7 +30,8 @@
 +if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
      add_tier_dir('platform', 'media/libvorbis')
  
- if CONFIG['MOZ_TREMOR']:
+-if CONFIG['MOZ_TREMOR']:
++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
      add_tier_dir('platform', 'media/libtremor')
  
 -if CONFIG['MOZ_OPUS']:
@@ -34,22 +39,54 @@
      add_tier_dir('platform', 'media/libopus')
  
  if CONFIG['MOZ_WEBM']:
-@@ -82,7 +82,9 @@ if CONFIG['MOZ_VP8'] and not CONFIG['MOZ
+@@ -82,7 +82,10 @@ 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 not CONFIG['MOZ_NATIVE_THEORA']:
++        add_tier_dir('platform', 'media/libtheora')
  
  if CONFIG['MOZ_WEBRTC']:
      add_tier_dir('platform', [
+@@ -92,10 +95,10 @@ if CONFIG['MOZ_WEBRTC']:
+         'media/mtransport/standalone',
+     ])
+ 
+-if CONFIG['MOZ_SPEEX_RESAMPLER']:
++if CONFIG['MOZ_SPEEX_RESAMPLER'] and not CONFIG['MOZ_NATIVE_SPEEX']:
+     add_tier_dir('platform', 'media/libspeex_resampler')
+ 
+-if CONFIG['MOZ_SOUNDTOUCH']:
++if CONFIG['MOZ_SOUNDTOUCH'] and not CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
+     add_tier_dir('platform', 'media/libsoundtouch')
+ 
+ if CONFIG['MOZ_CUBEB']:
 diff --git config/system-headers config/system-headers
-index b711fc3..fd3c14f 100644
+index bef567c..9807c29 100644
 --- config/system-headers
 +++ config/system-headers
-@@ -1152,3 +1152,17 @@ graphite2/Segment.h
+@@ -1050,8 +1050,6 @@ X11/Xutil.h
+ xpt_struct.h
+ xpt_xdr.h
+ zmouse.h
+-speex/speex_resampler.h
+-soundtouch/SoundTouch.h
+ #if MOZ_NATIVE_PNG==1
+ png.h
+ #endif
+@@ -1119,6 +1117,8 @@ ogg/ogg.h
+ ogg/os_types.h
+ nestegg/nestegg.h
+ cubeb/cubeb.h
++speex/speex_resampler.h
++soundtouch/SoundTouch.h
+ #endif
+ gst/gst.h
+ gst/app/gstappsink.h
+@@ -1155,3 +1155,29 @@ graphite2/Segment.h
  harfbuzz/hb-ot.h
  harfbuzz/hb.h
  #endif
@@ -57,21 +94,33 @@
 +ogg/ogg.h
 +ogg/os_types.h
 +#endif
++#if MOZ_NATIVE_THEORA==1
++theora/theoradec.h
++#endif
 +#if MOZ_NATIVE_VORBIS==1
 +vorbis/codec.h
 +vorbis/vorbisenc.h
 +#endif
++#if MOZ_NATIVE_TREMOR==1
++tremor/ivorbiscodec.h
++#endif
 +#if MOZ_NATIVE_OPUS==1
 +opus.h
 +opus_multistream.h
 +opus/opus.h
 +opus/opus_multistream.h
 +#endif
++#if MOZ_NATIVE_SPEEX==1
++speex/speex_resampler.h
++#endif
++#if MOZ_NATIVE_SOUNDTOUCH==1
++soundtouch/SoundTouch.h
++#endif
 diff --git configure.in configure.in
-index df49287..05e97ff 100644
+index 87db361..7947626 100644
 --- configure.in
 +++ configure.in
-@@ -5143,6 +5143,40 @@ if test -n "$MOZ_OGG"; then
+@@ -5211,6 +5211,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
  fi
  
  dnl ========================================================
@@ -81,7 +130,7 @@
 +MOZ_ARG_WITH_BOOL(system-ogg,
 +[  --with-system-ogg       Use system libogg (located with pkgconfig)],
 +MOZ_NATIVE_OGG=1,
-+MOZ_NATIVE_OGG= )
++MOZ_NATIVE_OGG=)
 +
 +if test -n "$MOZ_NATIVE_OGG"; then
 +    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
@@ -98,7 +147,7 @@
 +MOZ_ARG_WITH_BOOL(system-vorbis,
 +[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
 +MOZ_NATIVE_VORBIS=1,
-+MOZ_NATIVE_VORBIS= )
++MOZ_NATIVE_VORBIS=)
 +
 +if test -n "$MOZ_NATIVE_VORBIS"; then
 +    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
@@ -109,10 +158,27 @@
 +AC_SUBST(MOZ_VORBIS_LIBS)
 +
 +dnl ========================================================
++dnl Check for integer-only libvorbis aka tremor
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-tremor,
++[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
++MOZ_NATIVE_TREMOR=1,
++MOZ_NATIVE_TREMOR=)
++
++if test -n "$MOZ_NATIVE_TREMOR"; then
++    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_NATIVE_TREMOR)
++AC_SUBST(MOZ_TREMOR_CFLAGS)
++AC_SUBST(MOZ_TREMOR_LIBS)
++
++dnl ========================================================
  dnl = Disable Opus audio codec support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(opus,
-@@ -5151,6 +5185,25 @@ MOZ_ARG_DISABLE_BOOL(opus,
+@@ -5219,6 +5274,76 @@ MOZ_ARG_DISABLE_BOOL(opus,
      MOZ_OPUS=1)
  
  dnl ========================================================
@@ -122,7 +188,7 @@
 +MOZ_ARG_WITH_BOOL(system-opus,
 +[  --with-system-opus      Use system libopus (located with pkgconfig)],
 +MOZ_NATIVE_OPUS=1,
-+MOZ_NATIVE_OPUS= )
++MOZ_NATIVE_OPUS=)
 +
 +if test -n "$MOZ_NATIVE_OPUS"; then
 +    PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
@@ -135,14 +201,66 @@
 +AC_SUBST(MOZ_OPUS_LIBS)
 +
 +dnl ========================================================
++dnl Check for libtheora
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-theora,
++[  --with-system-theora    Use system libtheora (located with pkgconfig)],
++MOZ_NATIVE_THEORA=1,
++MOZ_NATIVE_THEORA=)
++
++if test -n "$MOZ_NATIVE_THEORA"; then
++    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_THEORA)
++AC_SUBST(MOZ_THEORA_CFLAGS)
++AC_SUBST(MOZ_THEORA_LIBS)
++
++dnl ========================================================
++dnl Check for libspeex resampler
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-speex,
++[  --with-system-speex     Use system libspeex (located with pkgconfig)],
++MOZ_NATIVE_SPEEX=1,
++MOZ_NATIVE_SPEEX=)
++
++if test -n "$MOZ_NATIVE_SPEEX"; then
++    PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_SPEEX)
++AC_SUBST(MOZ_SPEEX_CFLAGS)
++AC_SUBST(MOZ_SPEEX_LIBS)
++
++dnl ========================================================
++dnl Check for libsoundtouch
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-soundtouch,
++[  --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)],
++MOZ_NATIVE_SOUNDTOUCH=1,
++MOZ_NATIVE_SOUNDTOUCH=)
++
++if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then
++    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.7.0)
++fi
++
++AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
++AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
++AC_SUBST(MOZ_SOUNDTOUCH_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
+index fd34449..c6c42c8 100644
 --- content/media/Makefile.in
 +++ content/media/Makefile.in
-@@ -7,4 +7,16 @@ include $(topsrcdir)/config/rules.mk
+@@ -6,4 +6,31 @@ include $(topsrcdir)/config/rules.mk
+ 
  CFLAGS   += $(GSTREAMER_CFLAGS)
  CXXFLAGS += $(GSTREAMER_CFLAGS)
  
@@ -150,20 +268,48 @@
 +CXXFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++CXXFLAGS += $(MOZ_THEORA_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +CXXFLAGS += $(MOZ_OPUS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
++endif
+diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
+index 4c14494..1cb98e2 100644
+--- media/libcubeb/src/Makefile.in
++++ media/libcubeb/src/Makefile.in
+@@ -9,3 +9,7 @@ CFLAGS += \
+         $(MOZ_ALSA_CFLAGS) \
+         $(MOZ_PULSEAUDIO_CFLAGS) \
+         $(NULL)
++
++ifdef MOZ_NATIVE_SPEEX
++CFLAGS += $(MOZ_SPEEX_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
+@@ -36,31 +36,45 @@ ifdef MOZ_TREE_PIXMAN
  SHARED_LIBRARY_LIBS += $(MOZ_PIXMAN_LIBS)
  endif
  
@@ -185,9 +331,21 @@
 +endif
  
  ifdef MOZ_TREMOR
++ifndef MOZ_NATIVE_TREMOR
  SHARED_LIBRARY_LIBS	+= \
-@@ -51,10 +66,12 @@ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libtremor/lib/$(LIB_PREFIX)tremor.$(LIB_SUFFIX) \
+-	$(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
+ 	$(NULL)
  endif
++endif
+ 
+ ifdef MOZ_OGG
++ifndef MOZ_NATIVE_THEORA
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libtheora/lib/$(LIB_PREFIX)theora.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
  
  ifdef MOZ_OPUS
 +ifndef MOZ_NATIVE_OPUS
@@ -199,6 +357,27 @@
  
  ifdef MOZ_WEBM
  SHARED_LIBRARY_LIBS 	+= \
+@@ -77,16 +91,20 @@ endif
+ endif
+ 
+ ifdef MOZ_SPEEX_RESAMPLER
++ifndef MOZ_NATIVE_SPEEX
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libspeex_resampler/src/$(LIB_PREFIX)speex_resampler.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
+ 
+ ifdef MOZ_SOUNDTOUCH
++ifndef MOZ_NATIVE_SOUNDTOUCH
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libsoundtouch/src/$(LIB_PREFIX)soundtouch.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
+ 
+ ifdef MOZ_CUBEB
+ SHARED_LIBRARY_LIBS 	+= \
 diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
 new file mode 100644
 index 0000000..1f02dc0
@@ -266,7 +445,7 @@
 +CFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
-index c5e82c4..91ef86a 100644
+index bbc971c..6ed7e41 100644
 --- media/webrtc/signaling/test/Makefile.in
 +++ media/webrtc/signaling/test/Makefile.in
 @@ -48,6 +48,12 @@ LIBS += \
@@ -300,10 +479,10 @@
            'dependencies': [
              '<(DEPTH)/third_party/opus/opus.gyp:opus'
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 27f488e..cd27084 100644
+index d42137a..695e75a8 100644
 --- toolkit/library/Makefile.in
 +++ toolkit/library/Makefile.in
-@@ -91,6 +91,18 @@ ifdef MOZ_NATIVE_HUNSPELL
+@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
  EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
  endif
  
@@ -311,14 +490,30 @@
 +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_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 Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox-nightly/Makefile	Fri Apr 11 01:13:55 2014	(r1569)
@@ -18,6 +18,7 @@
 BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
 		sqlite3>=3.8.4.2:${PORTSDIR}/databases/sqlite3 \
 		v4l_compat>0:${PORTSDIR}/multimedia/v4l_compat \
+		soundtouch>=1.8.0:${PORTSDIR}/audio/soundtouch \
 		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
 		graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \
 		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \

Modified: trunk/www/firefox-nightly/files/patch-bug847568
==============================================================================
--- trunk/www/firefox-nightly/files/patch-bug847568	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox-nightly/files/patch-bug847568	Fri Apr 11 01:13:55 2014	(r1569)
@@ -14,10 +14,10 @@
  	$(INSTALL) system_wrappers $(DIST)
  
 diff --git config/system-headers config/system-headers
-index 126391e..b711fc3 100644
+index 18e8703..bdc5f82 100644
 --- config/system-headers
 +++ config/system-headers
-@@ -1144,3 +1144,11 @@ unicode/utypes.h
+@@ -1145,3 +1145,11 @@ unicode/utypes.h
  #endif
  libutil.h
  unwind.h
@@ -30,36 +30,54 @@
 +harfbuzz/hb.h
 +#endif
 diff --git configure.in configure.in
-index bbc7b40..1747206 100644
+index ac38f40..87536b7 100644
 --- configure.in
 +++ configure.in
-@@ -7848,6 +7848,34 @@ if test "$USE_FC_FREETYPE"; then
+@@ -8032,6 +8032,52 @@ if test "$USE_FC_FREETYPE"; then
  fi
  
  dnl ========================================================
-+dnl Check for graphite2 and harfbuzz
++dnl Check for harfbuzz
 +dnl ========================================================
 +
 +MOZ_ARG_WITH_BOOL(system-harfbuzz,
 +[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],
 +MOZ_NATIVE_HARFBUZZ=1,
-+MOZ_NATIVE_HARFBUZZ= )
++MOZ_NATIVE_HARFBUZZ=)
 +
 +if test -n "$MOZ_NATIVE_HARFBUZZ"; then
 +    PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.25)
 +fi
++
 +AC_SUBST(MOZ_NATIVE_HARFBUZZ)
 +AC_SUBST(MOZ_HARFBUZZ_CFLAGS)
 +AC_SUBST(MOZ_HARFBUZZ_LIBS)
 +
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
 +MOZ_ARG_WITH_BOOL(system-graphite2,
 +[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
 +MOZ_NATIVE_GRAPHITE2=1,
-+MOZ_NATIVE_GRAPHITE2= )
++MOZ_NATIVE_GRAPHITE2=)
 +
 +if test -n "$MOZ_NATIVE_GRAPHITE2"; then
-+    PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2 >= 1.2.4)
++    PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2)
++
++    dnl graphite2.pc has bogus version, check manually
++    AC_TRY_COMPILE([ #include <graphite2/Font.h>
++                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
++                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
++                               * 100 + GR2_VERSION_BUGFIX >= \
++                               (major) * 10000 + (minor) * 100 + (bugfix) )
++                   ], [
++                     #if !GR2_VERSION_REQUIRE(1,2,4)
++                     #error "Insufficient graphite2 version."
++                     #endif
++                   ], [],
++                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
 +fi
++
 +AC_SUBST(MOZ_NATIVE_GRAPHITE2)
 +AC_SUBST(MOZ_GRAPHITE2_CFLAGS)
 +AC_SUBST(MOZ_GRAPHITE2_LIBS)
@@ -69,10 +87,10 @@
  dnl ========================================================
  
 diff --git content/base/src/moz.build content/base/src/moz.build
-index 5868ec2..1313866 100644
+index d4f6380..0ee55df 100644
 --- content/base/src/moz.build
 +++ content/base/src/moz.build
-@@ -176,6 +176,9 @@ SOURCES += [
+@@ -179,6 +179,9 @@ SOURCES += [
      'nsObjectLoadingContent.cpp',
  ]
  
@@ -109,7 +127,7 @@
      'thebes',
      'ipc',
 diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
-index 07a77a3..067f7bd 100644
+index ee0efb2..98e169d6f 100644
 --- gfx/skia/Makefile.in
 +++ gfx/skia/Makefile.in
 @@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
@@ -122,9 +140,9 @@
 +
  include $(topsrcdir)/config/rules.mk
  
- ifneq (,$(INTEL_ARCHITECTURE))
+ ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
 diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
-index e9f6b6c..0df2d8d 100644
+index 45c36ae..79d32cf 100644
 --- gfx/thebes/Makefile.in
 +++ gfx/thebes/Makefile.in
 @@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
@@ -142,38 +160,38 @@
  ifeq ($(MOZ_WIDGET_TOOLKIT),android)
  CXXFLAGS += $(CAIRO_FT_CFLAGS)
  endif
-diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build
-index 508c53f..4fc119a 100644
---- intl/unicharutil/util/moz.build
-+++ intl/unicharutil/util/moz.build
-@@ -31,3 +31,9 @@ USE_STATIC_LIBS = True
- 
- if CONFIG['_MSC_VER']:
-     DEFINES['_USE_ANSI_CPP'] = True
+diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
+index f6b9f7c..60863f4 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
 +
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
-+    for f in ['nsUnicodeProperties.cpp']:
-+        UNIFIED_SOURCES.remove('%s/intl/unicharutil/util/%s' % (TOPSRCDIR, f))
-+        SOURCES += ['%s/intl/unicharutil/util/%s' % (TOPSRCDIR, f)]
-+        SOURCES['%s/intl/unicharutil/util/%s' % (TOPSRCDIR, f)].flags += [CONFIG['MOZ_HARFBUZZ_CFLAGS']]
-diff --git netwerk/dns/moz.build netwerk/dns/moz.build
-index bec4e8a..bd1ed98 100644
---- netwerk/dns/moz.build
-+++ netwerk/dns/moz.build
-@@ -63,3 +63,8 @@ GENERATED_FILES = [
- LOCAL_INCLUDES += [
-     '../base/src',
- ]
++ifdef MOZ_NATIVE_HARFBUZZ
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
++endif
+diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
+index 1cacbd7..f5d72bb 100644
+--- netwerk/dns/Makefile.in
++++ netwerk/dns/Makefile.in
+@@ -5,6 +5,10 @@
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
++ifdef MOZ_NATIVE_HARFBUZZ
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
++endif
 +
-+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
-+    UNIFIED_SOURCES.remove('nsIDNService.cpp')
-+    SOURCES += ['nsIDNService.cpp']
-+    SOURCES['nsIDNService.cpp'].flags += [CONFIG['MOZ_HARFBUZZ_CFLAGS']]
-diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 007f272..27f488e 100644
+ # Generate the include file containing compact, static definitions
+ # for effective TLD data.
+ etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
+diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
+index 67f0db9..d42137a 100644
 --- toolkit/library/libxul.mk
 +++ toolkit/library/libxul.mk
-@@ -103,6 +103,14 @@ ifndef MOZ_TREE_PIXMAN
+@@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN
  EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
  endif
  

Modified: trunk/www/firefox-nightly/files/patch-bug983953
==============================================================================
--- trunk/www/firefox-nightly/files/patch-bug983953	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox-nightly/files/patch-bug983953	Fri Apr 11 01:13:55 2014	(r1569)
@@ -1,34 +1,82 @@
+diff --git config/system-headers config/system-headers
+index bdc5f82..bef567c 100644
+--- config/system-headers
++++ config/system-headers
+@@ -1103,6 +1103,7 @@ vpx/vpx_decoder.h
+ vpx/vpx_encoder.h
+ vpx/vp8cx.h
+ vpx/vp8dx.h
++vpx_mem/vpx_mem.h
+ #endif
+ #ifdef GKMEDIAS_SHARED_LIBRARY
+ vpx/vpx_codec.h
+@@ -1110,6 +1111,7 @@ vpx/vpx_decoder.h
+ vpx/vpx_encoder.h
+ vpx/vp8cx.h
+ vpx/vp8dx.h
++vpx_mem/vpx_mem.h
+ vorbis/codec.h
+ theora/theoradec.h
+ tremor/ivorbiscodec.h
 diff --git configure.in configure.in
-index 1408b8b..fce64c4 100644
+index 22ef945..595b6e4 100644
 --- configure.in
 +++ configure.in
-@@ -5335,6 +5335,7 @@ if test -n "$MOZ_VPX"; then
+@@ -5391,6 +5391,8 @@ if test -n "$MOZ_VPX"; then
+         AC_DEFINE(MOZ_VPX_ERROR_CONCEALMENT)
      fi
  
++    _SAVE_CFLAGS=$CFLAGS
++    _SAVE_LIBS=$LIBS
      if test -n "$MOZ_NATIVE_LIBVPX"; then
-+        AC_DEFINE(MOZ_NATIVE_LIBVPX)
          dnl ============================
          dnl === libvpx Version check ===
-         dnl ============================
+@@ -5398,14 +5400,24 @@ if test -n "$MOZ_VPX"; then
+         dnl Check to see if we have a system libvpx package.
+         PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.3.0)
+ 
++        CFLAGS="$CFLAGS $MOZ_LIBVPX_CFLAGS"
++        LIBS="$LIBS $MOZ_LIBVPX_LIBS"
++
+         MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
+          [AC_MSG_ERROR([Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx.])])
+ 
+-        _SAVE_LIBS=$LIBS
+         AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
+          [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
+-        LIBS=$_SAVE_LIBS
++
++        MOZ_CHECK_HEADER([vpx_mem/vpx_mem.h],
++         [AC_CHECK_FUNC(vpx_mem_set_functions)])
++        if test "$ac_cv_header_vpx_mem_vpx_mem_h" = no -o \
++                "$ac_cv_func_vpx_mem_set_functions" = no; then
++            AC_DEFINE(MOZ_VPX_NO_MEM)
++        fi
+     fi
++    CFLAGS=$_SAVE_CFLAGS
++    LIBS=$_SAVE_LIBS
+ fi
+ 
+ AC_SUBST(MOZ_NATIVE_LIBVPX)
 diff --git xpcom/build/nsXPComInit.cpp xpcom/build/nsXPComInit.cpp
-index 43f86f4..8b43355 100644
+index a836610..2cf281e 100644
 --- xpcom/build/nsXPComInit.cpp
 +++ xpcom/build/nsXPComInit.cpp
-@@ -129,7 +129,7 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
+@@ -131,7 +131,7 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
  #endif
  
  #include "ogg/ogg.h"
 -#ifdef MOZ_VPX
-+#if defined(MOZ_VPX) && !defined(MOZ_NATIVE_LIBVPX)
++#if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM)
  #include "vpx_mem/vpx_mem.h"
  #endif
  
-@@ -704,7 +704,7 @@ NS_InitXPCOM2(nsIServiceManager* *result,
+@@ -708,7 +708,7 @@ NS_InitXPCOM2(nsIServiceManager* *result,
                            OggReporter::Realloc,
                            OggReporter::Free);
  
 -#ifdef MOZ_VPX
-+#if defined(MOZ_VPX) && !defined(MOZ_NATIVE_LIBVPX)
++#if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM)
      // And for VPX.
      vpx_mem_set_functions(VPXReporter::Alloc,
                            VPXReporter::Calloc,

Modified: trunk/www/firefox-nightly/files/patch-z-bug517422
==============================================================================
--- trunk/www/firefox-nightly/files/patch-z-bug517422	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox-nightly/files/patch-z-bug517422	Fri Apr 11 01:13:55 2014	(r1569)
@@ -1,24 +1,28 @@
-# Allow building against system-wide ogg/vorbis/opus.
+# Allow more config/external/ libs built against system-wide version.
 
 diff --git config/Makefile.in config/Makefile.in
-index 5383399..4393ae8 100644
+index 5383399..0410004 100644
 --- config/Makefile.in
 +++ config/Makefile.in
-@@ -79,6 +79,9 @@ export:: $(export-preqs)
+@@ -79,6 +79,13 @@ 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_THEORA=$(MOZ_NATIVE_THEORA) \
 +		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
++		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
 +		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
++		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
++		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
  		$(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
+index f67c5c7..eb909ce 100644
 --- config/external/moz.build
 +++ config/external/moz.build
-@@ -15,13 +15,16 @@ if CONFIG['MOZ_UPDATER']:
+@@ -15,13 +15,19 @@ if CONFIG['MOZ_UPDATER']:
      if not CONFIG['MOZ_NATIVE_BZ2']:
          external_dirs += ['modules/libbz2']
  
@@ -26,10 +30,14 @@
 +if not CONFIG['MOZ_NATIVE_OGG']:
 +    external_dirs += ['media/libogg']
 +
++if not CONFIG['MOZ_NATIVE_THEORA']:
++    external_dirs += ['media/libtheora']
++
 +if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
      external_dirs += ['media/libvorbis']
  
- if CONFIG['MOZ_TREMOR']:
+-if CONFIG['MOZ_TREMOR']:
++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
      external_dirs += ['media/libtremor']
  
 -if CONFIG['MOZ_OPUS']:
@@ -37,19 +45,49 @@
      external_dirs += ['media/libopus']
  
  if CONFIG['MOZ_WEBM']:
-@@ -39,7 +42,6 @@ if not CONFIG['MOZ_NATIVE_PNG']:
+@@ -36,13 +42,15 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']:
+ if not CONFIG['MOZ_NATIVE_PNG']:
+     external_dirs += ['media/libpng']
+ 
++if not CONFIG['MOZ_NATIVE_SPEEX']:
++    external_dirs += ['media/libspeex_resampler']
++
++if not CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
++    external_dirs += ['media/libsoundtouch']
++
  external_dirs += [
      'media/kiss_fft',
      'media/libcubeb',
 -    'media/libogg',
-     'media/libtheora',
-     'media/libspeex_resampler',
-     'media/libsoundtouch',
+-    'media/libtheora',
+-    'media/libspeex_resampler',
+-    'media/libsoundtouch',
+ ]
+ 
+ PARALLEL_DIRS += ['../../' + i for i in external_dirs]
 diff --git config/system-headers config/system-headers
-index b711fc3..fd3c14f 100644
+index bef567c..9807c29 100644
 --- config/system-headers
 +++ config/system-headers
-@@ -1153,3 +1153,17 @@ graphite2/Segment.h
+@@ -1050,8 +1050,6 @@ X11/Xutil.h
+ xpt_struct.h
+ xpt_xdr.h
+ zmouse.h
+-speex/speex_resampler.h
+-soundtouch/SoundTouch.h
+ #if MOZ_NATIVE_PNG==1
+ png.h
+ #endif
+@@ -1119,6 +1117,8 @@ ogg/ogg.h
+ ogg/os_types.h
+ nestegg/nestegg.h
+ cubeb/cubeb.h
++speex/speex_resampler.h
++soundtouch/SoundTouch.h
+ #endif
+ gst/gst.h
+ gst/app/gstappsink.h
+@@ -1155,3 +1155,29 @@ graphite2/Segment.h
  harfbuzz/hb-ot.h
  harfbuzz/hb.h
  #endif
@@ -57,21 +95,33 @@
 +ogg/ogg.h
 +ogg/os_types.h
 +#endif
++#if MOZ_NATIVE_THEORA==1
++theora/theoradec.h
++#endif
 +#if MOZ_NATIVE_VORBIS==1
 +vorbis/codec.h
 +vorbis/vorbisenc.h
 +#endif
++#if MOZ_NATIVE_TREMOR==1
++tremor/ivorbiscodec.h
++#endif
 +#if MOZ_NATIVE_OPUS==1
 +opus.h
 +opus_multistream.h
 +opus/opus.h
 +opus/opus_multistream.h
 +#endif
++#if MOZ_NATIVE_SPEEX==1
++speex/speex_resampler.h
++#endif
++#if MOZ_NATIVE_SOUNDTOUCH==1
++soundtouch/SoundTouch.h
++#endif
 diff --git configure.in configure.in
-index df49287..05e97ff 100644
+index 87db361..7947626 100644
 --- configure.in
 +++ configure.in
-@@ -5130,6 +5130,41 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
+@@ -5211,6 +5211,63 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
  fi
  
  dnl ========================================================
@@ -81,11 +131,16 @@
 +MOZ_ARG_WITH_BOOL(system-ogg,
 +[  --with-system-ogg       Use system libogg (located with pkgconfig)],
 +MOZ_NATIVE_OGG=1,
-+MOZ_NATIVE_OGG= )
++MOZ_NATIVE_OGG=)
 +
 +if test -n "$MOZ_NATIVE_OGG"; then
 +    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
-+    AC_DEFINE(MOZ_NATIVE_OGG)
++
++    _SAVE_LIBS=$LIBS
++    LIBS="$LIBS $MOZ_OGG_LIBS"
++    AC_CHECK_FUNC(ogg_set_mem_functions, [],
++      [AC_DEFINE(MOZ_OGG_NO_MEM)])
++    LIBS=$_SAVE_LIBS
 +fi
 +
 +AC_SUBST(MOZ_NATIVE_OGG)
@@ -99,7 +154,7 @@
 +MOZ_ARG_WITH_BOOL(system-vorbis,
 +[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
 +MOZ_NATIVE_VORBIS=1,
-+MOZ_NATIVE_VORBIS= )
++MOZ_NATIVE_VORBIS=)
 +
 +if test -n "$MOZ_NATIVE_VORBIS"; then
 +    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
@@ -110,10 +165,27 @@
 +AC_SUBST(MOZ_VORBIS_LIBS)
 +
 +dnl ========================================================
++dnl Check for integer-only libvorbis aka tremor
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-tremor,
++[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
++MOZ_NATIVE_TREMOR=1,
++MOZ_NATIVE_TREMOR=)
++
++if test -n "$MOZ_NATIVE_TREMOR"; then
++    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_NATIVE_TREMOR)
++AC_SUBST(MOZ_TREMOR_CFLAGS)
++AC_SUBST(MOZ_TREMOR_LIBS)
++
++dnl ========================================================
  dnl = Disable Opus audio codec support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(opus,
-@@ -5138,6 +5172,25 @@ MOZ_ARG_DISABLE_BOOL(opus,
+@@ -5219,6 +5274,76 @@ MOZ_ARG_DISABLE_BOOL(opus,
      MOZ_OPUS=1)
  
  dnl ========================================================
@@ -123,7 +195,7 @@
 +MOZ_ARG_WITH_BOOL(system-opus,
 +[  --with-system-opus      Use system libopus (located with pkgconfig)],
 +MOZ_NATIVE_OPUS=1,
-+MOZ_NATIVE_OPUS= )
++MOZ_NATIVE_OPUS=)
 +
 +if test -n "$MOZ_NATIVE_OPUS"; then
 +    PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
@@ -136,14 +208,89 @@
 +AC_SUBST(MOZ_OPUS_LIBS)
 +
 +dnl ========================================================
++dnl Check for libtheora
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-theora,
++[  --with-system-theora    Use system libtheora (located with pkgconfig)],
++MOZ_NATIVE_THEORA=1,
++MOZ_NATIVE_THEORA=)
++
++if test -n "$MOZ_NATIVE_THEORA"; then
++    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_THEORA)
++AC_SUBST(MOZ_THEORA_CFLAGS)
++AC_SUBST(MOZ_THEORA_LIBS)
++
++dnl ========================================================
++dnl Check for libspeex resampler
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-speex,
++[  --with-system-speex     Use system libspeex (located with pkgconfig)],
++MOZ_NATIVE_SPEEX=1,
++MOZ_NATIVE_SPEEX=)
++
++if test -n "$MOZ_NATIVE_SPEEX"; then
++    PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_SPEEX)
++AC_SUBST(MOZ_SPEEX_CFLAGS)
++AC_SUBST(MOZ_SPEEX_LIBS)
++
++dnl ========================================================
++dnl Check for libsoundtouch
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-soundtouch,
++[  --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)],
++MOZ_NATIVE_SOUNDTOUCH=1,
++MOZ_NATIVE_SOUNDTOUCH=)
++
++if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then
++    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.8.0)
++fi
++
++AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
++AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
++AC_SUBST(MOZ_SOUNDTOUCH_LIBS)
++
++dnl ========================================================
  dnl = Disable VP8 decoder support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(webm,
+diff --git content/media/AudioStream.cpp content/media/AudioStream.cpp
+index 88c8aa6..6b03288 100644
+--- content/media/AudioStream.cpp
++++ content/media/AudioStream.cpp
+@@ -13,7 +13,6 @@
+ #include "mozilla/Mutex.h"
+ #include <algorithm>
+ #include "mozilla/Preferences.h"
+-#include "soundtouch/SoundTouch.h"
+ #include "Latency.h"
+ 
+ namespace mozilla {
+diff --git content/media/AudioStream.h content/media/AudioStream.h
+index 085676d..00c54fb 100644
+--- content/media/AudioStream.h
++++ content/media/AudioStream.h
+@@ -15,6 +15,7 @@
+ #include "mozilla/StaticMutex.h"
+ 
+ #include "cubeb/cubeb.h"
++#include "soundtouch/SoundTouch.h"
+ 
+ template <>
+ class nsAutoRefTraits<cubeb_stream> : public nsPointerRefTraits<cubeb_stream>
 diff --git content/media/Makefile.in content/media/Makefile.in
-index 68f360e..76f2d57 100644
+index fd34449..c6c42c8 100644
 --- content/media/Makefile.in
 +++ content/media/Makefile.in
-@@ -6,3 +6,15 @@ include $(topsrcdir)/config/rules.mk
+@@ -6,3 +6,31 @@ include $(topsrcdir)/config/rules.mk
  
  CFLAGS   += $(GSTREAMER_CFLAGS)
  CXXFLAGS += $(GSTREAMER_CFLAGS)
@@ -152,13 +299,41 @@
 +CXXFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++CXXFLAGS += $(MOZ_THEORA_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +CXXFLAGS += $(MOZ_OPUS_CFLAGS)
 +endif
++
++ifdef MOZ_NATIVE_SPEEX
++CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
++endif
+diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
+index 4c14494..1cb98e2 100644
+--- media/libcubeb/src/Makefile.in
++++ media/libcubeb/src/Makefile.in
+@@ -9,3 +9,7 @@ CFLAGS += \
+         $(MOZ_ALSA_CFLAGS) \
+         $(MOZ_PULSEAUDIO_CFLAGS) \
+         $(NULL)
++
++ifdef MOZ_NATIVE_SPEEX
++CFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
 diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
 new file mode 100644
 index 0000000..1f02dc0
@@ -205,7 +380,7 @@
 +CFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
-index c5e82c4..91ef86a 100644
+index bbc971c..6ed7e41 100644
 --- media/webrtc/signaling/test/Makefile.in
 +++ media/webrtc/signaling/test/Makefile.in
 @@ -48,6 +48,12 @@ LIBS += \
@@ -238,11 +413,11 @@
          }, {
            'dependencies': [
              '<(DEPTH)/third_party/opus/opus.gyp:opus'
-diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 27f488e..cd27084 100644
+diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
+index d42137a..695e75a8 100644
 --- toolkit/library/libxul.mk
 +++ toolkit/library/libxul.mk
-@@ -91,6 +91,18 @@ ifdef MOZ_NATIVE_HUNSPELL
+@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
  EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
  endif
  
@@ -250,36 +425,52 @@
 +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS)
++endif
++
  ifdef MOZ_NATIVE_LIBEVENT
  EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
  endif
 diff --git xpcom/build/nsXPComInit.cpp xpcom/build/nsXPComInit.cpp
-index d2b353b..1166268 100644
+index 2cf281e..6d7af0e 100644
 --- xpcom/build/nsXPComInit.cpp
 +++ xpcom/build/nsXPComInit.cpp
-@@ -128,7 +128,9 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
+@@ -130,7 +130,9 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
  #include "mozilla/VisualEventTracer.h"
  #endif
  
-+#ifndef MOZ_NATIVE_OGG
++#ifndef MOZ_OGG_NO_MEM
  #include "ogg/ogg.h"
 +#endif
- #if defined(MOZ_VPX) && !defined(MOZ_NATIVE_LIBVPX)
+ #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM)
  #include "vpx_mem/vpx_mem.h"
  #endif
-@@ -622,11 +622,13 @@ NS_InitXPCOM2(nsIServiceManager* *result,
+@@ -702,11 +704,13 @@ NS_InitXPCOM2(nsIServiceManager* *result,
      // this oddness.
      mozilla::SetICUMemoryFunctions();
  
-+#ifndef MOZ_NATIVE_OGG
++#ifndef MOZ_OGG_NO_MEM
      // Do the same for libogg.
      ogg_set_mem_functions(OggReporter::Alloc,
                            OggReporter::Calloc,
@@ -287,5 +478,5 @@
                            OggReporter::Free);
 +#endif
  
- #ifdef MOZ_VPX
+ #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM)
      // And for VPX.

Modified: trunk/www/firefox/Makefile
==============================================================================
--- trunk/www/firefox/Makefile	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox/Makefile	Fri Apr 11 01:13:55 2014	(r1569)
@@ -14,6 +14,7 @@
 
 BUILD_DEPENDS=	nspr>=4.10.3:${PORTSDIR}/devel/nspr \
 		nss>=3.16:${PORTSDIR}/security/nss \
+		soundtouch>=1.7.0:${PORTSDIR}/audio/soundtouch \
 		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
 		graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \
 		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \

Modified: trunk/www/firefox/files/patch-bug847568
==============================================================================
--- trunk/www/firefox/files/patch-bug847568	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox/files/patch-bug847568	Fri Apr 11 01:13:55 2014	(r1569)
@@ -14,10 +14,10 @@
  	$(INSTALL) system_wrappers $(DIST)
  
 diff --git config/system-headers config/system-headers
-index 126391e..b711fc3 100644
+index 18e8703..bdc5f82 100644
 --- config/system-headers
 +++ config/system-headers
-@@ -1144,3 +1144,11 @@ unicode/utypes.h
+@@ -1145,3 +1145,11 @@ unicode/utypes.h
  #endif
  libutil.h
  unwind.h
@@ -30,36 +30,54 @@
 +harfbuzz/hb.h
 +#endif
 diff --git configure.in configure.in
-index bbc7b40..1747206 100644
+index ac38f40..87536b7 100644
 --- configure.in
 +++ configure.in
-@@ -7848,6 +7848,34 @@ if test "$USE_FC_FREETYPE"; then
+@@ -8032,6 +8032,52 @@ if test "$USE_FC_FREETYPE"; then
  fi
  
  dnl ========================================================
-+dnl Check for graphite2 and harfbuzz
++dnl Check for harfbuzz
 +dnl ========================================================
 +
 +MOZ_ARG_WITH_BOOL(system-harfbuzz,
 +[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],
 +MOZ_NATIVE_HARFBUZZ=1,
-+MOZ_NATIVE_HARFBUZZ= )
++MOZ_NATIVE_HARFBUZZ=)
 +
 +if test -n "$MOZ_NATIVE_HARFBUZZ"; then
 +    PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.25)
 +fi
++
 +AC_SUBST(MOZ_NATIVE_HARFBUZZ)
 +AC_SUBST(MOZ_HARFBUZZ_CFLAGS)
 +AC_SUBST(MOZ_HARFBUZZ_LIBS)
 +
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
 +MOZ_ARG_WITH_BOOL(system-graphite2,
 +[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
 +MOZ_NATIVE_GRAPHITE2=1,
-+MOZ_NATIVE_GRAPHITE2= )
++MOZ_NATIVE_GRAPHITE2=)
 +
 +if test -n "$MOZ_NATIVE_GRAPHITE2"; then
-+    PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2 >= 1.2.4)
++    PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2)
++
++    dnl graphite2.pc has bogus version, check manually
++    AC_TRY_COMPILE([ #include <graphite2/Font.h>
++                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
++                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
++                               * 100 + GR2_VERSION_BUGFIX >= \
++                               (major) * 10000 + (minor) * 100 + (bugfix) )
++                   ], [
++                     #if !GR2_VERSION_REQUIRE(1,2,4)
++                     #error "Insufficient graphite2 version."
++                     #endif
++                   ], [],
++                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
 +fi
++
 +AC_SUBST(MOZ_NATIVE_GRAPHITE2)
 +AC_SUBST(MOZ_GRAPHITE2_CFLAGS)
 +AC_SUBST(MOZ_GRAPHITE2_LIBS)
@@ -110,7 +128,7 @@
      'thebes',
      'ipc',
 diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
-index 07a77a3..067f7bd 100644
+index ee0efb2..98e169d6f 100644
 --- gfx/skia/Makefile.in
 +++ gfx/skia/Makefile.in
 @@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
@@ -123,9 +141,9 @@
 +
  include $(topsrcdir)/config/rules.mk
  
- ifneq (,$(INTEL_ARCHITECTURE))
+ ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
 diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
-index e9f6b6c..0df2d8d 100644
+index 45c36ae..79d32cf 100644
 --- gfx/thebes/Makefile.in
 +++ gfx/thebes/Makefile.in
 @@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
@@ -144,7 +162,7 @@
  CXXFLAGS += $(CAIRO_FT_CFLAGS)
  endif
 diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
-index f6b9f7c..11c44f4 100644
+index f6b9f7c..60863f4 100644
 --- intl/unicharutil/util/Makefile.in
 +++ intl/unicharutil/util/Makefile.in
 @@ -21,3 +21,7 @@ ifdef _MSC_VER
@@ -153,25 +171,28 @@
  endif
 +
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsUnicodePropertyData.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
 diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
-index 1cacbd7..a8cd156 100644
+index 1cacbd7..f5d72bb 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
-+
+@@ -5,6 +5,10 @@
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsIDNService.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
++
+ # Generate the include file containing compact, static definitions
+ # for effective TLD data.
+ etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 007f272..27f488e 100644
+index 67f0db9..d42137a 100644
 --- toolkit/library/Makefile.in
 +++ toolkit/library/Makefile.in
-@@ -103,6 +103,14 @@ ifndef MOZ_TREE_PIXMAN
+@@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN
  EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
  endif
  

Modified: trunk/www/firefox/files/patch-z-bug517422
==============================================================================
--- trunk/www/firefox/files/patch-z-bug517422	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/firefox/files/patch-z-bug517422	Fri Apr 11 01:13:55 2014	(r1569)
@@ -1,21 +1,25 @@
-# Allow building against system-wide ogg/vorbis/opus.
+# Allow more config/external/ libs built against system-wide version.
 
 diff --git config/Makefile.in config/Makefile.in
-index 5383399..4393ae8 100644
+index 5383399..0410004 100644
 --- config/Makefile.in
 +++ config/Makefile.in
-@@ -79,6 +79,9 @@ export:: $(export-preqs)
+@@ -79,6 +79,13 @@ 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_THEORA=$(MOZ_NATIVE_THEORA) \
 +		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
++		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
 +		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
++		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
++		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
  		$(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
+index f67c5c7..eb909ce 100644
 --- config/external/moz.build
 +++ config/external/moz.build
 @@ -15,13 +15,13 @@ if CONFIG['MOZ_UPDATER']:
@@ -26,7 +30,8 @@
 +if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
      external_dirs += ['media/libvorbis']
  
- if CONFIG['MOZ_TREMOR']:
+-if CONFIG['MOZ_TREMOR']:
++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
      external_dirs += ['media/libtremor']
  
 -if CONFIG['MOZ_OPUS']:
@@ -34,22 +39,56 @@
      external_dirs += ['media/libopus']
  
  if CONFIG['MOZ_WEBM']:
-@@ -34,7 +34,9 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']:
+@@ -34,16 +34,23 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ
      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_THEORA']:
++        external_dirs += ['media/libtheora']
  
  if not CONFIG['MOZ_NATIVE_PNG']:
      external_dirs += ['media/libpng']
+ 
++if not CONFIG['MOZ_NATIVE_SPEEX']:
++    external_dirs += ['media/libspeex_resampler']
++
++if not CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
++    external_dirs += ['media/libsoundtouch']
++
+ external_dirs += [
+     'media/kiss_fft',
+     'media/libcubeb',
+-    'media/libspeex_resampler',
+-    'media/libsoundtouch',
+ ]
+ 
+ PARALLEL_DIRS += ['../../' + i for i in external_dirs]
 diff --git config/system-headers config/system-headers
-index b711fc3..fd3c14f 100644
+index bef567c..9807c29 100644
 --- config/system-headers
 +++ config/system-headers
-@@ -1153,3 +1153,17 @@ graphite2/Segment.h
+@@ -1050,8 +1050,6 @@ X11/Xutil.h
+ xpt_struct.h
+ xpt_xdr.h
+ zmouse.h
+-speex/speex_resampler.h
+-soundtouch/SoundTouch.h
+ #if MOZ_NATIVE_PNG==1
+ png.h
+ #endif
+@@ -1119,6 +1117,8 @@ ogg/ogg.h
+ ogg/os_types.h
+ nestegg/nestegg.h
+ cubeb/cubeb.h
++speex/speex_resampler.h
++soundtouch/SoundTouch.h
+ #endif
+ gst/gst.h
+ gst/app/gstappsink.h
+@@ -1155,3 +1155,29 @@ graphite2/Segment.h
  harfbuzz/hb-ot.h
  harfbuzz/hb.h
  #endif
@@ -57,21 +96,33 @@
 +ogg/ogg.h
 +ogg/os_types.h
 +#endif
++#if MOZ_NATIVE_THEORA==1
++theora/theoradec.h
++#endif
 +#if MOZ_NATIVE_VORBIS==1
 +vorbis/codec.h
 +vorbis/vorbisenc.h
 +#endif
++#if MOZ_NATIVE_TREMOR==1
++tremor/ivorbiscodec.h
++#endif
 +#if MOZ_NATIVE_OPUS==1
 +opus.h
 +opus_multistream.h
 +opus/opus.h
 +opus/opus_multistream.h
 +#endif
++#if MOZ_NATIVE_SPEEX==1
++speex/speex_resampler.h
++#endif
++#if MOZ_NATIVE_SOUNDTOUCH==1
++soundtouch/SoundTouch.h
++#endif
 diff --git configure.in configure.in
-index df49287..05e97ff 100644
+index 87db361..7947626 100644
 --- configure.in
 +++ configure.in
-@@ -5130,6 +5130,40 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
+@@ -5211,6 +5211,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
  fi
  
  dnl ========================================================
@@ -81,7 +132,7 @@
 +MOZ_ARG_WITH_BOOL(system-ogg,
 +[  --with-system-ogg       Use system libogg (located with pkgconfig)],
 +MOZ_NATIVE_OGG=1,
-+MOZ_NATIVE_OGG= )
++MOZ_NATIVE_OGG=)
 +
 +if test -n "$MOZ_NATIVE_OGG"; then
 +    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
@@ -98,7 +149,7 @@
 +MOZ_ARG_WITH_BOOL(system-vorbis,
 +[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
 +MOZ_NATIVE_VORBIS=1,
-+MOZ_NATIVE_VORBIS= )
++MOZ_NATIVE_VORBIS=)
 +
 +if test -n "$MOZ_NATIVE_VORBIS"; then
 +    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
@@ -109,10 +160,27 @@
 +AC_SUBST(MOZ_VORBIS_LIBS)
 +
 +dnl ========================================================
++dnl Check for integer-only libvorbis aka tremor
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-tremor,
++[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
++MOZ_NATIVE_TREMOR=1,
++MOZ_NATIVE_TREMOR=)
++
++if test -n "$MOZ_NATIVE_TREMOR"; then
++    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_NATIVE_TREMOR)
++AC_SUBST(MOZ_TREMOR_CFLAGS)
++AC_SUBST(MOZ_TREMOR_LIBS)
++
++dnl ========================================================
  dnl = Disable Opus audio codec support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(opus,
-@@ -5138,6 +5172,25 @@ MOZ_ARG_DISABLE_BOOL(opus,
+@@ -5219,6 +5274,76 @@ MOZ_ARG_DISABLE_BOOL(opus,
      MOZ_OPUS=1)
  
  dnl ========================================================
@@ -122,7 +190,7 @@
 +MOZ_ARG_WITH_BOOL(system-opus,
 +[  --with-system-opus      Use system libopus (located with pkgconfig)],
 +MOZ_NATIVE_OPUS=1,
-+MOZ_NATIVE_OPUS= )
++MOZ_NATIVE_OPUS=)
 +
 +if test -n "$MOZ_NATIVE_OPUS"; then
 +    PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
@@ -135,14 +203,89 @@
 +AC_SUBST(MOZ_OPUS_LIBS)
 +
 +dnl ========================================================
++dnl Check for libtheora
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-theora,
++[  --with-system-theora    Use system libtheora (located with pkgconfig)],
++MOZ_NATIVE_THEORA=1,
++MOZ_NATIVE_THEORA=)
++
++if test -n "$MOZ_NATIVE_THEORA"; then
++    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_THEORA)
++AC_SUBST(MOZ_THEORA_CFLAGS)
++AC_SUBST(MOZ_THEORA_LIBS)
++
++dnl ========================================================
++dnl Check for libspeex resampler
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-speex,
++[  --with-system-speex     Use system libspeex (located with pkgconfig)],
++MOZ_NATIVE_SPEEX=1,
++MOZ_NATIVE_SPEEX=)
++
++if test -n "$MOZ_NATIVE_SPEEX"; then
++    PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_SPEEX)
++AC_SUBST(MOZ_SPEEX_CFLAGS)
++AC_SUBST(MOZ_SPEEX_LIBS)
++
++dnl ========================================================
++dnl Check for libsoundtouch
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-soundtouch,
++[  --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)],
++MOZ_NATIVE_SOUNDTOUCH=1,
++MOZ_NATIVE_SOUNDTOUCH=)
++
++if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then
++    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.7.0)
++fi
++
++AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
++AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
++AC_SUBST(MOZ_SOUNDTOUCH_LIBS)
++
++dnl ========================================================
  dnl = Disable VP8 decoder support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(webm,
+diff --git content/media/AudioStream.cpp content/media/AudioStream.cpp
+index 88c8aa6..6b03288 100644
+--- content/media/AudioStream.cpp
++++ content/media/AudioStream.cpp
+@@ -13,7 +13,6 @@
+ #include "mozilla/Mutex.h"
+ #include <algorithm>
+ #include "mozilla/Preferences.h"
+-#include "soundtouch/SoundTouch.h"
+ #include "Latency.h"
+ 
+ namespace mozilla {
+diff --git content/media/AudioStream.h content/media/AudioStream.h
+index 085676d..00c54fb 100644
+--- content/media/AudioStream.h
++++ content/media/AudioStream.h
+@@ -15,6 +15,7 @@
+ #include "mozilla/StaticMutex.h"
+ 
+ #include "cubeb/cubeb.h"
++#include "soundtouch/SoundTouch.h"
+ 
+ template <>
+ class nsAutoRefTraits<cubeb_stream> : public nsPointerRefTraits<cubeb_stream>
 diff --git content/media/Makefile.in content/media/Makefile.in
-index 68f360e..76f2d57 100644
+index fd34449..c6c42c8 100644
 --- content/media/Makefile.in
 +++ content/media/Makefile.in
-@@ -6,3 +6,15 @@ include $(topsrcdir)/config/rules.mk
+@@ -6,3 +6,31 @@ include $(topsrcdir)/config/rules.mk
  
  CFLAGS   += $(GSTREAMER_CFLAGS)
  CXXFLAGS += $(GSTREAMER_CFLAGS)
@@ -151,13 +294,41 @@
 +CXXFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++CXXFLAGS += $(MOZ_THEORA_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +CXXFLAGS += $(MOZ_OPUS_CFLAGS)
 +endif
++
++ifdef MOZ_NATIVE_SPEEX
++CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
++endif
+diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
+index 4c14494..1cb98e2 100644
+--- media/libcubeb/src/Makefile.in
++++ media/libcubeb/src/Makefile.in
+@@ -9,3 +9,7 @@ CFLAGS += \
+         $(MOZ_ALSA_CFLAGS) \
+         $(MOZ_PULSEAUDIO_CFLAGS) \
+         $(NULL)
++
++ifdef MOZ_NATIVE_SPEEX
++CFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
 diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
 new file mode 100644
 index 0000000..1f02dc0
@@ -204,7 +375,7 @@
 +CFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
-index c5e82c4..91ef86a 100644
+index bbc971c..6ed7e41 100644
 --- media/webrtc/signaling/test/Makefile.in
 +++ media/webrtc/signaling/test/Makefile.in
 @@ -48,6 +48,12 @@ LIBS += \
@@ -238,10 +409,10 @@
            'dependencies': [
              '<(DEPTH)/third_party/opus/opus.gyp:opus'
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 27f488e..cd27084 100644
+index d42137a..695e75a8 100644
 --- toolkit/library/Makefile.in
 +++ toolkit/library/Makefile.in
-@@ -91,6 +91,18 @@ ifdef MOZ_NATIVE_HUNSPELL
+@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
  EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
  endif
  
@@ -249,14 +420,30 @@
 +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS)
++endif
++
  ifdef MOZ_NATIVE_LIBEVENT
  EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
  endif

Modified: trunk/www/libxul/Makefile
==============================================================================
--- trunk/www/libxul/Makefile	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/libxul/Makefile	Fri Apr 11 01:13:55 2014	(r1569)
@@ -16,6 +16,7 @@
 		sqlite3>=3.7.17:${PORTSDIR}/databases/sqlite3 \
 		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
 		cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
+		soundtouch>=1.7.0:${PORTSDIR}/audio/soundtouch \
 		harfbuzz>=0.9.16:${PORTSDIR}/print/harfbuzz \
 		graphite2>=1.2.3:${PORTSDIR}/graphics/graphite2 \
 		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \

Modified: trunk/www/libxul/files/patch-z-bug847568
==============================================================================
--- trunk/www/libxul/files/patch-z-bug847568	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/libxul/files/patch-z-bug847568	Fri Apr 11 01:13:55 2014	(r1569)
@@ -14,10 +14,10 @@
  	$(INSTALL) system_wrappers $(DIST)
  
 diff --git config/system-headers config/system-headers
-index 126391e..b711fc3 100644
+index 18e8703..bdc5f82 100644
 --- config/system-headers
 +++ config/system-headers
-@@ -1144,3 +1144,11 @@ unicode/utypes.h
+@@ -1145,3 +1145,11 @@ unicode/utypes.h
  #endif
  libutil.h
  unwind.h
@@ -30,40 +30,58 @@
 +harfbuzz/hb.h
 +#endif
 diff --git configure.in configure.in
-index bbc7b40..1747206 100644
+index ac38f40..87536b7 100644
 --- configure.in
 +++ configure.in
-@@ -7830,6 +7830,38 @@ if test "$USE_FC_FREETYPE"; then
+@@ -8032,6 +8032,56 @@ if test "$USE_FC_FREETYPE"; then
  fi
  
  dnl ========================================================
-+dnl Check for graphite2 and harfbuzz
++dnl Check for harfbuzz
 +dnl ========================================================
 +
 +MOZ_ARG_WITH_BOOL(system-harfbuzz,
 +[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],
 +MOZ_NATIVE_HARFBUZZ=1,
-+MOZ_NATIVE_HARFBUZZ= )
++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)
 +
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
 +MOZ_ARG_WITH_BOOL(system-graphite2,
 +[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
 +MOZ_NATIVE_GRAPHITE2=1,
-+MOZ_NATIVE_GRAPHITE2= )
++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)'
++    PKG_CHECK_MODULES(MOZ_GRAPHITE, graphite2)
++
++    dnl graphite2.pc has bogus version, check manually
++    AC_TRY_COMPILE([ #include <graphite2/Font.h>
++                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
++                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
++                               * 100 + GR2_VERSION_BUGFIX >= \
++                               (major) * 10000 + (minor) * 100 + (bugfix) )
++                   ], [
++                     #if !GR2_VERSION_REQUIRE(1,2,3)
++                     #error "Insufficient graphite2 version."
++                     #endif
++                   ], [],
++                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
+++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)
@@ -133,7 +151,7 @@
      'thebes',
      'ipc',
 diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
-index 07a77a3..067f7bd 100644
+index ee0efb2..98e169d6f 100644
 --- gfx/skia/Makefile.in
 +++ gfx/skia/Makefile.in
 @@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
@@ -146,9 +164,9 @@
 +
  include $(topsrcdir)/config/rules.mk
  
- ifneq (,$(INTEL_ARCHITECTURE))
+ ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
 diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
-index e9f6b6c..0df2d8d 100644
+index 45c36ae..79d32cf 100644
 --- gfx/thebes/Makefile.in
 +++ gfx/thebes/Makefile.in
 @@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
@@ -167,7 +185,7 @@
  CXXFLAGS += $(CAIRO_FT_CFLAGS)
  endif
 diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
-index f6b9f7c..11c44f4 100644
+index f6b9f7c..60863f4 100644
 --- intl/unicharutil/util/Makefile.in
 +++ intl/unicharutil/util/Makefile.in
 @@ -21,3 +21,7 @@ ifdef _MSC_VER
@@ -176,7 +194,7 @@
  endif
 +
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsUnicodePropertyData.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
 diff --git layout/media/Makefile.in layout/media/Makefile.in
 index 1cacbd7..a8cd156 100644
@@ -202,22 +220,25 @@
  SHARED_LIBRARY_LIBS += $(MOZ_CAIRO_LIBS)
  endif
 diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
-index 1cacbd7..a8cd156 100644
+index 1cacbd7..f5d72bb 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
-+
+@@ -5,6 +5,10 @@
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsIDNService.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
++
+ # Generate the include file containing compact, static definitions
+ # for effective TLD data.
+ etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 007f272..27f488e 100644
+index 67f0db9..d42137a 100644
 --- toolkit/library/Makefile.in
 +++ toolkit/library/Makefile.in
-@@ -103,6 +103,14 @@ ifndef MOZ_TREE_PIXMAN
+@@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN
  EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
  endif
  

Modified: trunk/www/libxul/files/patch-zz-bug517422
==============================================================================
--- trunk/www/libxul/files/patch-zz-bug517422	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/libxul/files/patch-zz-bug517422	Fri Apr 11 01:13:55 2014	(r1569)
@@ -1,16 +1,20 @@
-# Allow building against system-wide ogg/vorbis/opus.
+# Allow more config/external/ libs built against system-wide version.
 
 diff --git config/Makefile.in config/Makefile.in
-index 5383399..4393ae8 100644
+index 5383399..0410004 100644
 --- config/Makefile.in
 +++ config/Makefile.in
-@@ -79,6 +79,9 @@ export:: $(export-preqs)
+@@ -79,6 +79,13 @@ 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_THEORA=$(MOZ_NATIVE_THEORA) \
 +		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
++		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
 +		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
++		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
++		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
  		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
  	$(INSTALL) system_wrappers $(DIST)
  
@@ -26,7 +30,8 @@
 +if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
      add_tier_dir('platform', 'media/libvorbis')
  
- if CONFIG['MOZ_TREMOR']:
+-if CONFIG['MOZ_TREMOR']:
++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
      add_tier_dir('platform', 'media/libtremor')
  
 -if CONFIG['MOZ_OPUS']:
@@ -34,22 +39,54 @@
      add_tier_dir('platform', 'media/libopus')
  
  if CONFIG['MOZ_WEBM']:
-@@ -82,7 +82,9 @@ if CONFIG['MOZ_VP8'] and not CONFIG['MOZ
+@@ -82,7 +82,10 @@ 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 not CONFIG['MOZ_NATIVE_THEORA']:
++        add_tier_dir('platform', 'media/libtheora')
  
  if CONFIG['MOZ_WEBRTC']:
      add_tier_dir('platform', [
+@@ -92,10 +95,10 @@ if CONFIG['MOZ_WEBRTC']:
+         'media/mtransport/standalone',
+     ])
+ 
+-if CONFIG['MOZ_SPEEX_RESAMPLER']:
++if CONFIG['MOZ_SPEEX_RESAMPLER'] and not CONFIG['MOZ_NATIVE_SPEEX']:
+     add_tier_dir('platform', 'media/libspeex_resampler')
+ 
+-if CONFIG['MOZ_SOUNDTOUCH']:
++if CONFIG['MOZ_SOUNDTOUCH'] and not CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
+     add_tier_dir('platform', 'media/libsoundtouch')
+ 
+ if CONFIG['MOZ_CUBEB']:
 diff --git config/system-headers config/system-headers
-index b711fc3..fd3c14f 100644
+index bef567c..9807c29 100644
 --- config/system-headers
 +++ config/system-headers
-@@ -1152,3 +1152,17 @@ graphite2/Segment.h
+@@ -1050,8 +1050,6 @@ X11/Xutil.h
+ xpt_struct.h
+ xpt_xdr.h
+ zmouse.h
+-speex/speex_resampler.h
+-soundtouch/SoundTouch.h
+ #if MOZ_NATIVE_PNG==1
+ png.h
+ #endif
+@@ -1119,6 +1117,8 @@ ogg/ogg.h
+ ogg/os_types.h
+ nestegg/nestegg.h
+ cubeb/cubeb.h
++speex/speex_resampler.h
++soundtouch/SoundTouch.h
+ #endif
+ gst/gst.h
+ gst/app/gstappsink.h
+@@ -1155,3 +1155,29 @@ graphite2/Segment.h
  harfbuzz/hb-ot.h
  harfbuzz/hb.h
  #endif
@@ -57,21 +94,33 @@
 +ogg/ogg.h
 +ogg/os_types.h
 +#endif
++#if MOZ_NATIVE_THEORA==1
++theora/theoradec.h
++#endif
 +#if MOZ_NATIVE_VORBIS==1
 +vorbis/codec.h
 +vorbis/vorbisenc.h
 +#endif
++#if MOZ_NATIVE_TREMOR==1
++tremor/ivorbiscodec.h
++#endif
 +#if MOZ_NATIVE_OPUS==1
 +opus.h
 +opus_multistream.h
 +opus/opus.h
 +opus/opus_multistream.h
 +#endif
++#if MOZ_NATIVE_SPEEX==1
++speex/speex_resampler.h
++#endif
++#if MOZ_NATIVE_SOUNDTOUCH==1
++soundtouch/SoundTouch.h
++#endif
 diff --git configure.in configure.in
-index df49287..05e97ff 100644
+index 87db361..7947626 100644
 --- configure.in
 +++ configure.in
-@@ -5143,6 +5143,40 @@ if test -n "$MOZ_OGG"; then
+@@ -5211,6 +5211,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
  fi
  
  dnl ========================================================
@@ -81,7 +130,7 @@
 +MOZ_ARG_WITH_BOOL(system-ogg,
 +[  --with-system-ogg       Use system libogg (located with pkgconfig)],
 +MOZ_NATIVE_OGG=1,
-+MOZ_NATIVE_OGG= )
++MOZ_NATIVE_OGG=)
 +
 +if test -n "$MOZ_NATIVE_OGG"; then
 +    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
@@ -98,7 +147,7 @@
 +MOZ_ARG_WITH_BOOL(system-vorbis,
 +[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
 +MOZ_NATIVE_VORBIS=1,
-+MOZ_NATIVE_VORBIS= )
++MOZ_NATIVE_VORBIS=)
 +
 +if test -n "$MOZ_NATIVE_VORBIS"; then
 +    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
@@ -109,10 +158,27 @@
 +AC_SUBST(MOZ_VORBIS_LIBS)
 +
 +dnl ========================================================
++dnl Check for integer-only libvorbis aka tremor
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-tremor,
++[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
++MOZ_NATIVE_TREMOR=1,
++MOZ_NATIVE_TREMOR=)
++
++if test -n "$MOZ_NATIVE_TREMOR"; then
++    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_NATIVE_TREMOR)
++AC_SUBST(MOZ_TREMOR_CFLAGS)
++AC_SUBST(MOZ_TREMOR_LIBS)
++
++dnl ========================================================
  dnl = Disable Opus audio codec support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(opus,
-@@ -5151,6 +5185,25 @@ MOZ_ARG_DISABLE_BOOL(opus,
+@@ -5219,6 +5274,76 @@ MOZ_ARG_DISABLE_BOOL(opus,
      MOZ_OPUS=1)
  
  dnl ========================================================
@@ -122,7 +188,7 @@
 +MOZ_ARG_WITH_BOOL(system-opus,
 +[  --with-system-opus      Use system libopus (located with pkgconfig)],
 +MOZ_NATIVE_OPUS=1,
-+MOZ_NATIVE_OPUS= )
++MOZ_NATIVE_OPUS=)
 +
 +if test -n "$MOZ_NATIVE_OPUS"; then
 +    PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
@@ -135,14 +201,66 @@
 +AC_SUBST(MOZ_OPUS_LIBS)
 +
 +dnl ========================================================
++dnl Check for libtheora
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-theora,
++[  --with-system-theora    Use system libtheora (located with pkgconfig)],
++MOZ_NATIVE_THEORA=1,
++MOZ_NATIVE_THEORA=)
++
++if test -n "$MOZ_NATIVE_THEORA"; then
++    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_THEORA)
++AC_SUBST(MOZ_THEORA_CFLAGS)
++AC_SUBST(MOZ_THEORA_LIBS)
++
++dnl ========================================================
++dnl Check for libspeex resampler
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-speex,
++[  --with-system-speex     Use system libspeex (located with pkgconfig)],
++MOZ_NATIVE_SPEEX=1,
++MOZ_NATIVE_SPEEX=)
++
++if test -n "$MOZ_NATIVE_SPEEX"; then
++    PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_SPEEX)
++AC_SUBST(MOZ_SPEEX_CFLAGS)
++AC_SUBST(MOZ_SPEEX_LIBS)
++
++dnl ========================================================
++dnl Check for libsoundtouch
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-soundtouch,
++[  --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)],
++MOZ_NATIVE_SOUNDTOUCH=1,
++MOZ_NATIVE_SOUNDTOUCH=)
++
++if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then
++    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.7.0)
++fi
++
++AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
++AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
++AC_SUBST(MOZ_SOUNDTOUCH_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
+index fd34449..c6c42c8 100644
 --- content/media/Makefile.in
 +++ content/media/Makefile.in
-@@ -7,4 +7,16 @@ include $(topsrcdir)/config/rules.mk
+@@ -6,4 +6,31 @@ include $(topsrcdir)/config/rules.mk
+ 
  CFLAGS   += $(GSTREAMER_CFLAGS)
  CXXFLAGS += $(GSTREAMER_CFLAGS)
  
@@ -150,20 +268,48 @@
 +CXXFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++CXXFLAGS += $(MOZ_THEORA_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +CXXFLAGS += $(MOZ_OPUS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
++endif
+diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
+index 4c14494..1cb98e2 100644
+--- media/libcubeb/src/Makefile.in
++++ media/libcubeb/src/Makefile.in
+@@ -9,3 +9,7 @@ CFLAGS += \
+         $(MOZ_ALSA_CFLAGS) \
+         $(MOZ_PULSEAUDIO_CFLAGS) \
+         $(NULL)
++
++ifdef MOZ_NATIVE_SPEEX
++CFLAGS += $(MOZ_SPEEX_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
+@@ -36,31 +36,45 @@ ifdef MOZ_TREE_PIXMAN
  SHARED_LIBRARY_LIBS += $(MOZ_PIXMAN_LIBS)
  endif
  
@@ -185,9 +331,21 @@
 +endif
  
  ifdef MOZ_TREMOR
++ifndef MOZ_NATIVE_TREMOR
  SHARED_LIBRARY_LIBS	+= \
-@@ -51,10 +66,12 @@ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libtremor/lib/$(LIB_PREFIX)tremor.$(LIB_SUFFIX) \
+-	$(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
+ 	$(NULL)
  endif
++endif
+ 
+ ifdef MOZ_OGG
++ifndef MOZ_NATIVE_THEORA
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libtheora/lib/$(LIB_PREFIX)theora.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
  
  ifdef MOZ_OPUS
 +ifndef MOZ_NATIVE_OPUS
@@ -199,6 +357,27 @@
  
  ifdef MOZ_WEBM
  SHARED_LIBRARY_LIBS 	+= \
+@@ -77,16 +91,20 @@ endif
+ endif
+ 
+ ifdef MOZ_SPEEX_RESAMPLER
++ifndef MOZ_NATIVE_SPEEX
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libspeex_resampler/src/$(LIB_PREFIX)speex_resampler.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
+ 
+ ifdef MOZ_SOUNDTOUCH
++ifndef MOZ_NATIVE_SOUNDTOUCH
+ SHARED_LIBRARY_LIBS 	+= \
+ 	$(DEPTH)/media/libsoundtouch/src/$(LIB_PREFIX)soundtouch.$(LIB_SUFFIX) \
+ 	$(NULL)
+ endif
++endif
+ 
+ ifdef MOZ_CUBEB
+ SHARED_LIBRARY_LIBS 	+= \
 diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
 new file mode 100644
 index 0000000..1f02dc0
@@ -266,7 +445,7 @@
 +CFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
-index c5e82c4..91ef86a 100644
+index bbc971c..6ed7e41 100644
 --- media/webrtc/signaling/test/Makefile.in
 +++ media/webrtc/signaling/test/Makefile.in
 @@ -48,6 +48,12 @@ LIBS += \
@@ -300,10 +479,10 @@
            'dependencies': [
              '<(DEPTH)/third_party/opus/opus.gyp:opus'
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 27f488e..cd27084 100644
+index d42137a..695e75a8 100644
 --- toolkit/library/Makefile.in
 +++ toolkit/library/Makefile.in
-@@ -91,6 +91,18 @@ ifdef MOZ_NATIVE_HUNSPELL
+@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
  EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
  endif
  
@@ -311,14 +490,30 @@
 +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS)
++endif
++
  ifdef MOZ_NATIVE_LIBEVENT
  EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
  endif

Modified: trunk/www/seamonkey/Makefile
==============================================================================
--- trunk/www/seamonkey/Makefile	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/seamonkey/Makefile	Fri Apr 11 01:13:55 2014	(r1569)
@@ -14,6 +14,7 @@
 
 BUILD_DEPENDS=	nspr>=4.10.3:${PORTSDIR}/devel/nspr \
 		nss>=3.16:${PORTSDIR}/security/nss \
+		soundtouch>=1.7.0:${PORTSDIR}/audio/soundtouch \
 		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
 		graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \
 		libvorbis>=1.3.4:${PORTSDIR}/audio/libvorbis \

Modified: trunk/www/seamonkey/files/patch-bug847568
==============================================================================
--- trunk/www/seamonkey/files/patch-bug847568	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/seamonkey/files/patch-bug847568	Fri Apr 11 01:13:55 2014	(r1569)
@@ -14,10 +14,10 @@
  	$(INSTALL) system_wrappers $(DIST)
  
 diff --git config/system-headers config/system-headers
-index 126391e..b711fc3 100644
+index 18e8703..bdc5f82 100644
 --- mozilla/config/system-headers
 +++ mozilla/config/system-headers
-@@ -1144,3 +1144,11 @@ unicode/utypes.h
+@@ -1145,3 +1145,11 @@ unicode/utypes.h
  #endif
  libutil.h
  unwind.h
@@ -30,36 +30,54 @@
 +harfbuzz/hb.h
 +#endif
 diff --git configure.in configure.in
-index bbc7b40..1747206 100644
+index ac38f40..87536b7 100644
 --- mozilla/configure.in
 +++ mozilla/configure.in
-@@ -7848,6 +7848,34 @@ if test "$USE_FC_FREETYPE"; then
+@@ -8032,6 +8032,52 @@ if test "$USE_FC_FREETYPE"; then
  fi
  
  dnl ========================================================
-+dnl Check for graphite2 and harfbuzz
++dnl Check for harfbuzz
 +dnl ========================================================
 +
 +MOZ_ARG_WITH_BOOL(system-harfbuzz,
 +[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],
 +MOZ_NATIVE_HARFBUZZ=1,
-+MOZ_NATIVE_HARFBUZZ= )
++MOZ_NATIVE_HARFBUZZ=)
 +
 +if test -n "$MOZ_NATIVE_HARFBUZZ"; then
 +    PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 0.9.25)
 +fi
++
 +AC_SUBST(MOZ_NATIVE_HARFBUZZ)
 +AC_SUBST(MOZ_HARFBUZZ_CFLAGS)
 +AC_SUBST(MOZ_HARFBUZZ_LIBS)
 +
++dnl ========================================================
++dnl Check for graphite2
++dnl ========================================================
 +MOZ_ARG_WITH_BOOL(system-graphite2,
 +[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
 +MOZ_NATIVE_GRAPHITE2=1,
-+MOZ_NATIVE_GRAPHITE2= )
++MOZ_NATIVE_GRAPHITE2=)
 +
 +if test -n "$MOZ_NATIVE_GRAPHITE2"; then
-+    PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2 >= 1.2.4)
++    PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2)
++
++    dnl graphite2.pc has bogus version, check manually
++    AC_TRY_COMPILE([ #include <graphite2/Font.h>
++                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
++                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
++                               * 100 + GR2_VERSION_BUGFIX >= \
++                               (major) * 10000 + (minor) * 100 + (bugfix) )
++                   ], [
++                     #if !GR2_VERSION_REQUIRE(1,2,4)
++                     #error "Insufficient graphite2 version."
++                     #endif
++                   ], [],
++                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
 +fi
++
 +AC_SUBST(MOZ_NATIVE_GRAPHITE2)
 +AC_SUBST(MOZ_GRAPHITE2_CFLAGS)
 +AC_SUBST(MOZ_GRAPHITE2_LIBS)
@@ -110,7 +128,7 @@
      'thebes',
      'ipc',
 diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
-index 07a77a3..067f7bd 100644
+index ee0efb2..98e169d6f 100644
 --- mozilla/gfx/skia/Makefile.in
 +++ mozilla/gfx/skia/Makefile.in
 @@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
@@ -123,9 +141,9 @@
 +
  include $(topsrcdir)/config/rules.mk
  
- ifneq (,$(INTEL_ARCHITECTURE))
+ ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
 diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
-index e9f6b6c..0df2d8d 100644
+index 45c36ae..79d32cf 100644
 --- mozilla/gfx/thebes/Makefile.in
 +++ mozilla/gfx/thebes/Makefile.in
 @@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
@@ -144,7 +162,7 @@
  CXXFLAGS += $(CAIRO_FT_CFLAGS)
  endif
 diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
-index f6b9f7c..11c44f4 100644
+index f6b9f7c..60863f4 100644
 --- mozilla/intl/unicharutil/util/Makefile.in
 +++ mozilla/intl/unicharutil/util/Makefile.in
 @@ -21,3 +21,7 @@ ifdef _MSC_VER
@@ -153,25 +171,28 @@
  endif
 +
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsUnicodePropertyData.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
 diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
-index 1cacbd7..a8cd156 100644
+index 1cacbd7..f5d72bb 100644
 --- mozilla/netwerk/dns/Makefile.in
 +++ mozilla/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
-+
+@@ -5,6 +5,10 @@
+ 
+ include $(topsrcdir)/config/rules.mk
+ 
 +ifdef MOZ_NATIVE_HARFBUZZ
-+nsIDNService.$(OBJ_SUFFIX): CXXFLAGS+=$(MOZ_HARFBUZZ_CFLAGS)
++CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
 +endif
++
+ # Generate the include file containing compact, static definitions
+ # for effective TLD data.
+ etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 007f272..27f488e 100644
+index 67f0db9..d42137a 100644
 --- mozilla/toolkit/library/Makefile.in
 +++ mozilla/toolkit/library/Makefile.in
-@@ -103,6 +103,14 @@ ifndef MOZ_TREE_PIXMAN
+@@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN
  EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
  endif
  

Modified: trunk/www/seamonkey/files/patch-z-bug517422
==============================================================================
--- trunk/www/seamonkey/files/patch-z-bug517422	Wed Apr  9 04:57:57 2014	(r1568)
+++ trunk/www/seamonkey/files/patch-z-bug517422	Fri Apr 11 01:13:55 2014	(r1569)
@@ -1,21 +1,25 @@
-# Allow building against system-wide ogg/vorbis/opus.
+# Allow more config/external/ libs built against system-wide version.
 
 diff --git config/Makefile.in config/Makefile.in
-index 5383399..4393ae8 100644
+index 5383399..0410004 100644
 --- mozilla/config/Makefile.in
 +++ mozilla/config/Makefile.in
-@@ -79,6 +79,9 @@ export:: $(export-preqs)
+@@ -79,6 +79,13 @@ 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_THEORA=$(MOZ_NATIVE_THEORA) \
 +		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
++		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
 +		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
++		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
++		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
  		$(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
+index f67c5c7..eb909ce 100644
 --- mozilla/config/external/moz.build
 +++ mozilla/config/external/moz.build
 @@ -15,13 +15,13 @@ if CONFIG['MOZ_UPDATER']:
@@ -26,7 +30,8 @@
 +if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
      external_dirs += ['media/libvorbis']
  
- if CONFIG['MOZ_TREMOR']:
+-if CONFIG['MOZ_TREMOR']:
++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
      external_dirs += ['media/libtremor']
  
 -if CONFIG['MOZ_OPUS']:
@@ -34,22 +39,56 @@
      external_dirs += ['media/libopus']
  
  if CONFIG['MOZ_WEBM']:
-@@ -34,7 +34,9 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']:
+@@ -34,16 +34,23 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ
      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_THEORA']:
++        external_dirs += ['media/libtheora']
  
  if not CONFIG['MOZ_NATIVE_PNG']:
      external_dirs += ['media/libpng']
+ 
++if not CONFIG['MOZ_NATIVE_SPEEX']:
++    external_dirs += ['media/libspeex_resampler']
++
++if not CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
++    external_dirs += ['media/libsoundtouch']
++
+ external_dirs += [
+     'media/kiss_fft',
+     'media/libcubeb',
+-    'media/libspeex_resampler',
+-    'media/libsoundtouch',
+ ]
+ 
+ PARALLEL_DIRS += ['../../' + i for i in external_dirs]
 diff --git config/system-headers config/system-headers
-index b711fc3..fd3c14f 100644
+index bef567c..9807c29 100644
 --- mozilla/config/system-headers
 +++ mozilla/config/system-headers
-@@ -1153,3 +1153,17 @@ graphite2/Segment.h
+@@ -1050,8 +1050,6 @@ X11/Xutil.h
+ xpt_struct.h
+ xpt_xdr.h
+ zmouse.h
+-speex/speex_resampler.h
+-soundtouch/SoundTouch.h
+ #if MOZ_NATIVE_PNG==1
+ png.h
+ #endif
+@@ -1119,6 +1117,8 @@ ogg/ogg.h
+ ogg/os_types.h
+ nestegg/nestegg.h
+ cubeb/cubeb.h
++speex/speex_resampler.h
++soundtouch/SoundTouch.h
+ #endif
+ gst/gst.h
+ gst/app/gstappsink.h
+@@ -1155,3 +1155,29 @@ graphite2/Segment.h
  harfbuzz/hb-ot.h
  harfbuzz/hb.h
  #endif
@@ -57,21 +96,33 @@
 +ogg/ogg.h
 +ogg/os_types.h
 +#endif
++#if MOZ_NATIVE_THEORA==1
++theora/theoradec.h
++#endif
 +#if MOZ_NATIVE_VORBIS==1
 +vorbis/codec.h
 +vorbis/vorbisenc.h
 +#endif
++#if MOZ_NATIVE_TREMOR==1
++tremor/ivorbiscodec.h
++#endif
 +#if MOZ_NATIVE_OPUS==1
 +opus.h
 +opus_multistream.h
 +opus/opus.h
 +opus/opus_multistream.h
 +#endif
++#if MOZ_NATIVE_SPEEX==1
++speex/speex_resampler.h
++#endif
++#if MOZ_NATIVE_SOUNDTOUCH==1
++soundtouch/SoundTouch.h
++#endif
 diff --git configure.in configure.in
-index df49287..05e97ff 100644
+index 87db361..7947626 100644
 --- mozilla/configure.in
 +++ mozilla/configure.in
-@@ -5130,6 +5130,40 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
+@@ -5211,6 +5211,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
  fi
  
  dnl ========================================================
@@ -81,7 +132,7 @@
 +MOZ_ARG_WITH_BOOL(system-ogg,
 +[  --with-system-ogg       Use system libogg (located with pkgconfig)],
 +MOZ_NATIVE_OGG=1,
-+MOZ_NATIVE_OGG= )
++MOZ_NATIVE_OGG=)
 +
 +if test -n "$MOZ_NATIVE_OGG"; then
 +    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
@@ -98,7 +149,7 @@
 +MOZ_ARG_WITH_BOOL(system-vorbis,
 +[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
 +MOZ_NATIVE_VORBIS=1,
-+MOZ_NATIVE_VORBIS= )
++MOZ_NATIVE_VORBIS=)
 +
 +if test -n "$MOZ_NATIVE_VORBIS"; then
 +    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
@@ -109,10 +160,27 @@
 +AC_SUBST(MOZ_VORBIS_LIBS)
 +
 +dnl ========================================================
++dnl Check for integer-only libvorbis aka tremor
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-tremor,
++[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
++MOZ_NATIVE_TREMOR=1,
++MOZ_NATIVE_TREMOR=)
++
++if test -n "$MOZ_NATIVE_TREMOR"; then
++    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
++fi
++
++AC_SUBST(MOZ_NATIVE_TREMOR)
++AC_SUBST(MOZ_TREMOR_CFLAGS)
++AC_SUBST(MOZ_TREMOR_LIBS)
++
++dnl ========================================================
  dnl = Disable Opus audio codec support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(opus,
-@@ -5138,6 +5172,25 @@ MOZ_ARG_DISABLE_BOOL(opus,
+@@ -5219,6 +5274,76 @@ MOZ_ARG_DISABLE_BOOL(opus,
      MOZ_OPUS=1)
  
  dnl ========================================================
@@ -122,7 +190,7 @@
 +MOZ_ARG_WITH_BOOL(system-opus,
 +[  --with-system-opus      Use system libopus (located with pkgconfig)],
 +MOZ_NATIVE_OPUS=1,
-+MOZ_NATIVE_OPUS= )
++MOZ_NATIVE_OPUS=)
 +
 +if test -n "$MOZ_NATIVE_OPUS"; then
 +    PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
@@ -135,14 +203,89 @@
 +AC_SUBST(MOZ_OPUS_LIBS)
 +
 +dnl ========================================================
++dnl Check for libtheora
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-theora,
++[  --with-system-theora    Use system libtheora (located with pkgconfig)],
++MOZ_NATIVE_THEORA=1,
++MOZ_NATIVE_THEORA=)
++
++if test -n "$MOZ_NATIVE_THEORA"; then
++    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_THEORA)
++AC_SUBST(MOZ_THEORA_CFLAGS)
++AC_SUBST(MOZ_THEORA_LIBS)
++
++dnl ========================================================
++dnl Check for libspeex resampler
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-speex,
++[  --with-system-speex     Use system libspeex (located with pkgconfig)],
++MOZ_NATIVE_SPEEX=1,
++MOZ_NATIVE_SPEEX=)
++
++if test -n "$MOZ_NATIVE_SPEEX"; then
++    PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2)
++fi
++
++AC_SUBST(MOZ_NATIVE_SPEEX)
++AC_SUBST(MOZ_SPEEX_CFLAGS)
++AC_SUBST(MOZ_SPEEX_LIBS)
++
++dnl ========================================================
++dnl Check for libsoundtouch
++dnl ========================================================
++
++MOZ_ARG_WITH_BOOL(system-soundtouch,
++[  --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)],
++MOZ_NATIVE_SOUNDTOUCH=1,
++MOZ_NATIVE_SOUNDTOUCH=)
++
++if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then
++    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.7.0)
++fi
++
++AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
++AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
++AC_SUBST(MOZ_SOUNDTOUCH_LIBS)
++
++dnl ========================================================
  dnl = Disable VP8 decoder support
  dnl ========================================================
  MOZ_ARG_DISABLE_BOOL(webm,
+diff --git content/media/AudioStream.cpp content/media/AudioStream.cpp
+index 88c8aa6..6b03288 100644
+--- mozilla/content/media/AudioStream.cpp
++++ mozilla/content/media/AudioStream.cpp
+@@ -13,7 +13,6 @@
+ #include "mozilla/Mutex.h"
+ #include <algorithm>
+ #include "mozilla/Preferences.h"
+-#include "soundtouch/SoundTouch.h"
+ #include "Latency.h"
+ 
+ namespace mozilla {
+diff --git content/media/AudioStream.h content/media/AudioStream.h
+index 085676d..00c54fb 100644
+--- mozilla/content/media/AudioStream.h
++++ mozilla/content/media/AudioStream.h
+@@ -15,6 +15,7 @@
+ #include "mozilla/StaticMutex.h"
+ 
+ #include "cubeb/cubeb.h"
++#include "soundtouch/SoundTouch.h"
+ 
+ template <>
+ class nsAutoRefTraits<cubeb_stream> : public nsPointerRefTraits<cubeb_stream>
 diff --git content/media/Makefile.in content/media/Makefile.in
-index 68f360e..76f2d57 100644
+index fd34449..c6c42c8 100644
 --- mozilla/content/media/Makefile.in
 +++ mozilla/content/media/Makefile.in
-@@ -6,3 +6,15 @@ include $(topsrcdir)/config/rules.mk
+@@ -6,3 +6,31 @@ include $(topsrcdir)/config/rules.mk
  
  CFLAGS   += $(GSTREAMER_CFLAGS)
  CXXFLAGS += $(GSTREAMER_CFLAGS)
@@ -151,13 +294,41 @@
 +CXXFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++CXXFLAGS += $(MOZ_THEORA_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +CXXFLAGS += $(MOZ_OPUS_CFLAGS)
 +endif
++
++ifdef MOZ_NATIVE_SPEEX
++CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
++endif
+diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
+index 4c14494..1cb98e2 100644
+--- mozilla/media/libcubeb/src/Makefile.in
++++ mozilla/media/libcubeb/src/Makefile.in
+@@ -9,3 +9,7 @@ CFLAGS += \
+         $(MOZ_ALSA_CFLAGS) \
+         $(MOZ_PULSEAUDIO_CFLAGS) \
+         $(NULL)
++
++ifdef MOZ_NATIVE_SPEEX
++CFLAGS += $(MOZ_SPEEX_CFLAGS)
++endif
 diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
 new file mode 100644
 index 0000000..1f02dc0
@@ -204,7 +375,7 @@
 +CFLAGS += $(MOZ_OGG_CFLAGS)
 +endif
 diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
-index c5e82c4..91ef86a 100644
+index bbc971c..6ed7e41 100644
 --- mozilla/media/webrtc/signaling/test/Makefile.in
 +++ mozilla/media/webrtc/signaling/test/Makefile.in
 @@ -48,6 +48,12 @@ LIBS += \
@@ -238,10 +409,10 @@
            'dependencies': [
              '<(DEPTH)/third_party/opus/opus.gyp:opus'
 diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
-index 27f488e..cd27084 100644
+index d42137a..695e75a8 100644
 --- mozilla/toolkit/library/Makefile.in
 +++ mozilla/toolkit/library/Makefile.in
-@@ -91,6 +91,18 @@ ifdef MOZ_NATIVE_HUNSPELL
+@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
  EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
  endif
  
@@ -249,14 +420,30 @@
 +EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_THEORA
++EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_VORBIS
 +EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_TREMOR
++EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
++endif
++
 +ifdef MOZ_NATIVE_OPUS
 +EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
 +endif
 +
++ifdef MOZ_NATIVE_SPEEX
++EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
++endif
++
++ifdef MOZ_NATIVE_SOUNDTOUCH
++EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_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?201404110113.s3B1DtD1083540>