aboutsummaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorBeat Gaetzi <beat@FreeBSD.org>2012-09-10 19:19:32 +0000
committerBeat Gaetzi <beat@FreeBSD.org>2012-09-10 19:19:32 +0000
commit734349b51e45b3b7ca3962ef3081939860edc649 (patch)
treeee00a96c55d6989c6d1c276075efa6edf489ad90 /www
parente6d638b4ac3b463304cc25a4335ed6b5ad5d57e6 (diff)
downloadports-734349b51e45b3b7ca3962ef3081939860edc649.tar.gz
ports-734349b51e45b3b7ca3962ef3081939860edc649.zip
Notes
Diffstat (limited to 'www')
-rw-r--r--www/Makefile1
-rw-r--r--www/gecko-mediaplayer/Makefile4
-rw-r--r--www/gecko-sharp20/Makefile4
-rw-r--r--www/helixplugin/Makefile6
-rw-r--r--www/libxul/Makefile61
-rw-r--r--www/libxul/distinfo4
-rw-r--r--www/libxul/files/patch-alsapulse75
-rw-r--r--www/libxul/files/patch-bug54324114
-rw-r--r--www/libxul/files/patch-bug65355115
-rw-r--r--www/libxul/files/patch-bug6852588
-rw-r--r--www/libxul/files/patch-bug691898285
-rw-r--r--www/libxul/files/patch-bug71431273
-rw-r--r--www/libxul/files/patch-bug72565553
-rw-r--r--www/libxul/files/patch-bug72896850
-rw-r--r--www/libxul/files/patch-bug72915518
-rw-r--r--www/libxul/files/patch-bug74173790
-rw-r--r--www/libxul/files/patch-bug7530461201
-rw-r--r--www/libxul/files/patch-bug76107726
-rw-r--r--www/libxul/files/patch-bug77805621
-rw-r--r--www/libxul/files/patch-bug7780784
-rw-r--r--www/libxul/files/patch-bug77984728
-rw-r--r--www/libxul/files/patch-bug7814574
-rw-r--r--www/libxul/files/patch-bug78346320
-rw-r--r--www/libxul/files/patch-bug78477622
-rw-r--r--www/libxul/files/patch-bug785638168
-rw-r--r--www/libxul/files/patch-bug78803959
-rw-r--r--www/libxul/files/patch-bug78810820
-rw-r--r--www/libxul/files/patch-bug78943627
-rw-r--r--www/libxul/files/patch-build-pgo-profileserver.py18
-rw-r--r--www/libxul/files/patch-build_unix_run-mozilla.sh12
-rw-r--r--www/libxul/files/patch-clang32-libc++-visibility-hack38
-rw-r--r--www/libxul/files/patch-config_autoconf.mk.in6
-rw-r--r--www/libxul/files/patch-dom-ipc-ContentChild.cpp10
-rw-r--r--www/libxul/files/patch-gfx-qcms-qcmstypes.h11
-rw-r--r--www/libxul/files/patch-ipc-chromium-Makefile.in28
-rw-r--r--www/libxul/files/patch-ipc-chromium-src-base-message_pump_libevent.cc11
-rw-r--r--www/libxul/files/patch-js-src-configure.in10
-rw-r--r--www/libxul/files/patch-js-src-methodjit-MethodJIT.cpp20
-rw-r--r--www/libxul/files/patch-toolkit-xre-nsEmbedFunctions.cpp10
-rw-r--r--www/libxul/files/patch-toolkit_xre_Makefile.in8
-rw-r--r--www/libxul/files/patch-xulrunner-stub-nsXULStub.cpp11
-rw-r--r--www/libxul19/Makefile98
-rw-r--r--www/libxul19/distinfo2
-rw-r--r--www/libxul19/files/patch-alsapulse122
-rw-r--r--www/libxul19/files/patch-bug351181 (renamed from www/libxul/files/patch-bug351181)0
-rw-r--r--www/libxul19/files/patch-bug65355124
-rw-r--r--www/libxul19/files/patch-bug68525817
-rw-r--r--www/libxul19/files/patch-bug761077110
-rw-r--r--www/libxul19/files/patch-bug77807811
-rw-r--r--www/libxul19/files/patch-bug78145710
-rw-r--r--www/libxul19/files/patch-config_autoconf.mk.in21
-rw-r--r--www/libxul19/files/patch-content-xslt-public-txDouble.h (renamed from www/libxul/files/patch-content-xslt-public-txDouble.h)0
-rw-r--r--www/libxul19/files/patch-embedding_base_nsEmbedAPI.cpp (renamed from www/libxul/files/patch-embedding_base_nsEmbedAPI.cpp)0
-rw-r--r--www/libxul19/files/patch-gfx-ots-src-os2.cc (renamed from www/libxul/files/patch-gfx-ots-src-os2.cc)0
-rw-r--r--www/libxul19/files/patch-js-ctypes-libffi-configure (renamed from www/libxul/files/patch-js-ctypes-libffi-configure)0
-rw-r--r--www/libxul19/files/patch-js-src-jslock.cpp (renamed from www/libxul/files/patch-js-src-jslock.cpp)0
-rw-r--r--www/libxul19/files/patch-media-liboggz-include-oggz-oggz_off_t_generated.h (renamed from www/libxul/files/patch-media-liboggz-include-oggz-oggz_off_t_generated.h)0
-rw-r--r--www/libxul19/files/patch-media-libsydneyaudio-src-Makefile.in (renamed from www/libxul/files/patch-media-libsydneyaudio-src-Makefile.in)0
-rw-r--r--www/libxul19/files/patch-media-libsydneyaudio-src-sydney_audio_oss.c13
-rw-r--r--www/libxul19/files/patch-modules-libpr0n-encoders-png-nsPNGDecoder.cpp (renamed from www/libxul/files/patch-modules-libpr0n-encoders-png-nsPNGDecoder.cpp)0
-rw-r--r--www/libxul19/files/patch-modules-libpr0n-encoders-png-nsPNGEncoder.cpp (renamed from www/libxul/files/patch-modules-libpr0n-encoders-png-nsPNGEncoder.cpp)0
-rw-r--r--www/libxul19/files/patch-modules-libpref-src-prefapi.cpp (renamed from www/libxul/files/patch-modules-libpref-src-prefapi.cpp)0
-rw-r--r--www/libxul19/files/patch-security_manager_ssl_src_nsNSSComponent.cpp10
-rw-r--r--www/libxul19/files/patch-toolkit_library_Makefile.in (renamed from www/libxul/files/patch-toolkit_library_Makefile.in)0
-rw-r--r--www/libxul19/files/patch-xpcom_base_nsStackWalk.cpp (renamed from www/libxul/files/patch-xpcom_base_nsStackWalk.cpp)0
-rw-r--r--www/libxul19/files/patch-xulrunner_installer_libxul-embedding.pc.in9
-rw-r--r--www/libxul19/files/patch-xulrunner_installer_libxul.pc.in9
-rw-r--r--www/libxul19/pkg-descr7
-rw-r--r--www/moonshine/Makefile4
-rw-r--r--www/openvrml/Makefile10
-rw-r--r--www/xpi-conkeror/Makefile4
-rw-r--r--www/xpi-gwt-dev-plugin/Makefile2
72 files changed, 2906 insertions, 131 deletions
diff --git a/www/Makefile b/www/Makefile
index c3f61227c7f4..9fd7b2f76daa 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -388,6 +388,7 @@
SUBDIR += libmicrohttpd
SUBDIR += libwww
SUBDIR += libxul
+ SUBDIR += libxul19
SUBDIR += lifetype
SUBDIR += lightsquid
SUBDIR += lighttpd
diff --git a/www/gecko-mediaplayer/Makefile b/www/gecko-mediaplayer/Makefile
index d33d108f21c1..bfc665827e10 100644
--- a/www/gecko-mediaplayer/Makefile
+++ b/www/gecko-mediaplayer/Makefile
@@ -7,7 +7,7 @@
PORTNAME= gecko-mediaplayer
PORTVERSION= 1.0.0
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www multimedia gnome
MASTER_SITES= GOOGLE_CODE
@@ -23,7 +23,7 @@ OPTIONS= GCONF "Use Gconf to store preferences" off \
GNU_CONFIGURE= yes
USE_GETTEXT= yes
USE_GNOME= glib20 pkgconfig
-USE_GECKO= libxul
+USE_GECKO= libxul19
USE_WEBPLUGINS= native
WEBPLUGINS_FILES= ${PORTNAME}-dvx.so ${PORTNAME}-qt.so ${PORTNAME}-rm.so \
${PORTNAME}-wmp.so ${PORTNAME}.so
diff --git a/www/gecko-sharp20/Makefile b/www/gecko-sharp20/Makefile
index 0cfc28b539f3..9fcba6e3e59e 100644
--- a/www/gecko-sharp20/Makefile
+++ b/www/gecko-sharp20/Makefile
@@ -8,7 +8,7 @@
PORTNAME= gecko-sharp
PORTVERSION= 0.13
-PORTREVISION= 5
+PORTREVISION= 6
CATEGORIES= www
MASTER_SITES= ftp://ftp.novell.com/pub/mono/sources/${PORTNAME}2/
DISTNAME= ${PORTNAME}-2.0-${PORTVERSION}
@@ -16,7 +16,7 @@ DISTNAME= ${PORTNAME}-2.0-${PORTVERSION}
MAINTAINER= mono@FreeBSD.org
COMMENT= Mono bindings to embed Mozilla
-USE_GECKO= libxul
+USE_GECKO= libxul19
USE_GNOME= gtksharp20
LATEST_LINK= gecko-sharp20
GNU_CONFIGURE= yes
diff --git a/www/helixplugin/Makefile b/www/helixplugin/Makefile
index 7fb6c96c7b59..a8dce0e69245 100644
--- a/www/helixplugin/Makefile
+++ b/www/helixplugin/Makefile
@@ -7,7 +7,7 @@
PORTNAME= hxplugin
PORTVERSION= 20080318
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www multimedia
MASTER_SITES= http://virtual-estates.net/~mi/port-stuff/
@@ -17,8 +17,8 @@ COMMENT= Browser plugin for Real or Helix Players
USE_BZIP2 = yes
USE_DOS2UNIX = yes
MAKEFILE = ${FILESDIR}/BSDmakefile
-USE_GECKO = libxul
-MAKE_ENV += TOP="${WRKSRC}" GECKO=${GECKO}
+USE_GECKO = libxul19
+MAKE_ENV += TOP="${WRKSRC}" GECKO=${GECKO:S/19//}
MAKE_JOBS_UNSAFE = yes
USE_WEBPLUGINS= native
diff --git a/www/libxul/Makefile b/www/libxul/Makefile
index 5996f7fc619a..27adaa856207 100644
--- a/www/libxul/Makefile
+++ b/www/libxul/Makefile
@@ -6,53 +6,50 @@
#
PORTNAME= libxul
-DISTVERSION= 1.9.2.28
-PORTREVISION= 1
+DISTVERSION= 10.0.7
CATEGORIES?= www devel
MASTER_SITES= ${MASTER_SITE_MOZILLA}
-MASTER_SITE_SUBDIR= firefox/releases/3.6.28/source
-DISTNAME= firefox-3.6.28.source
+MASTER_SITE_SUBDIR= firefox/releases/${DISTVERSION}esr/source
+DISTNAME= firefox-${DISTVERSION}esr.source
MAINTAINER?= gecko@FreeBSD.org
COMMENT?= Mozilla runtime package that can be used to bootstrap XUL+XPCOM apps
-WRKSRC= ${WRKDIR}/mozilla-1.9.2
-CONFLICTS= mozilla-[0-9]* libxul-[0-9][0-9].*
-GECKO_PLIST_PRE_DIRS= lib/${MOZILLA}/bin lib/${MOZILLA}/idl \
- lib/${MOZILLA}/include lib/${MOZILLA}/lib
+BUILD_DEPENDS= nspr>=4.8.8:${PORTSDIR}/devel/nspr \
+ nss>=3.13.1:${PORTSDIR}/security/nss \
+ sqlite3>=3.7.7.1:${PORTSDIR}/databases/sqlite3 \
+ cairo>=1.10.2_1,1:${PORTSDIR}/graphics/cairo \
+ unzip:${PORTSDIR}/archivers/unzip
+
+WRKSRC= ${WRKDIR}/mozilla-esr10
+CONFLICTS= mozilla-[0-9]* libxul-1.9.*
USE_AUTOTOOLS= autoconf213:env
WANT_GNOME= yes
+USE_QT4= # empty
+QT_NONSTANDARD= yes
WANT_PERL= yes
ALL_TARGET= default
GNU_CONFIGURE= yes
USE_BZIP2= yes
USE_GMAKE= yes
+USE_GL= gl
MAKE_JOBS_SAFE= yes
MAKE_ENV= SKIP_GRE_REGISTRATION=1 mozappdir=${PREFIX}/lib/${MOZILLA}
LDFLAGS+= -Wl,-rpath,${PREFIX}/lib/${MOZ_RPATH}
USE_LDCONFIG= ${PREFIX}/lib/${MOZILLA}
-MOZ_OPTIONS?= --enable-application=xulrunner \
- --disable-ipc
+MOZ_OPTIONS?= --enable-application=xulrunner
MOZ_EXTENSIONS= default,cookie,permissions
USE_GECKO= gecko
MOZILLA_EXEC_NAME=xulrunner
-USE_MOZILLA= -event -ffi -vpx
-MOZ_CHROME= jar
+USE_MOZILLA= # empty
MOZILLA_PLIST_DIRS= bin include lib share/idl
PLIST_DIRSTRY= share/idl
-MOZ_PKGCONFIG_FILES= libxul-embedding libxul mozilla-gtkmozembed-embedding \
- mozilla-gtkmozembed mozilla-js mozilla-plugin
-
-OPTIONS_DEFINE= JAVA
-JAVA_DESC?= JAVA xpcom
+MOZ_PKGCONFIG_FILES= libxul-embedding libxul mozilla-js \
+ mozilla-plugin
.include "${.CURDIR}/../../www/firefox/Makefile.options"
-
-OPTIONS_DEFINE:=${OPTIONS_DEFINE:NLIBPROXY}
-OPTIONS_SINGLE:=${OPTIONS_SINGLE:NTOOLKIT}
-
.include <bsd.port.pre.mk>
.if ${USE_MOZILLA:M-nss}
@@ -70,19 +67,17 @@ CFLAGS+= -mminimal-toc
.endif
.endif
-.if ${PORT_OPTIONS:MJAVA}
-USE_JAVA= yes
-JAVA_VERSION+= 1.5+
-JAVA_OS+= native
-MOZ_EXPORT+= JAVA_HOME="${JAVA_HOME}"
-MOZ_OPTIONS+= --enable-javaxpcom
-.else
-MOZ_OPTIONS+= --disable-javaxpcom
+.if ${ARCH} == amd64 || ${ARCH} == i386
+BUILD_DEPENDS+= yasm:${PORTSDIR}/devel/yasm
+.endif
+
+.if !empty(CXX:M*clang++*)
+CXXFLAGS+= -Wno-return-type-c-linkage
.endif
post-patch:
- ${REINPLACE_CMD} -e 's|/usr/local/include|${LOCALBASE}/include|' \
- ${WRKSRC}/js/src/config/mkdepend/Makefile.in
+ @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
+ ${WRKSRC}/xulrunner/stub/nsXULStub.cpp
pre-configure:
(cd ${WRKSRC} && ${AUTOCONF})
@@ -90,8 +85,8 @@ pre-configure:
post-build:
@${REINPLACE_CMD} -e "s|\(Libs:.*\)\($$\)|\1 -Wl,-rpath,${PREFIX}/lib/${MOZ_RPATH}\2| ; \
- s|%sdkdir%|%sdkdir%/sdk|g ; \
+ s|%sdkdir%|%sdkdir%/sdk|g ; \
s|%%MOZ_LIBDIR%%|${PREFIX}/lib/${MOZILLA}|g" \
- ${WRKSRC}/xulrunner/installer/*.pc.in || ${TRUE}
+ ${WRKSRC}/xulrunner/installer/*.pc.in || ${TRUE}
.include <bsd.port.post.mk>
diff --git a/www/libxul/distinfo b/www/libxul/distinfo
index 83cfbc26e75c..4302c68e47ba 100644
--- a/www/libxul/distinfo
+++ b/www/libxul/distinfo
@@ -1,2 +1,2 @@
-SHA256 (firefox-3.6.28.source.tar.bz2) = a6c4bc52095194428cf3b17341b68ac473b7654984000c45d1be3eae55d78260
-SIZE (firefox-3.6.28.source.tar.bz2) = 51698958
+SHA256 (firefox-10.0.7esr.source.tar.bz2) = 91b0dab3168d75a4f157dabfdf6a95367cd3a8767298d88fb43be251f37f4423
+SIZE (firefox-10.0.7esr.source.tar.bz2) = 75624327
diff --git a/www/libxul/files/patch-alsapulse b/www/libxul/files/patch-alsapulse
index f3e0ffb31f6d..175b41680977 100644
--- a/www/libxul/files/patch-alsapulse
+++ b/www/libxul/files/patch-alsapulse
@@ -1,50 +1,49 @@
--- config/autoconf.mk.in~
+++ config/autoconf.mk.in
-@@ -555,6 +555,14 @@ MOZ_LIBNOTIFY_CFLAGS = @MOZ_LIBNOTIFY_CF
+@@ -568,7 +568,13 @@ MOZ_LIBNOTIFY_CFLAGS = @MOZ_LIBNOTIFY_CF
MOZ_LIBNOTIFY_LIBS = @MOZ_LIBNOTIFY_LIBS@
MOZ_ENABLE_LIBNOTIFY = @MOZ_ENABLE_LIBNOTIFY@
+MOZ_ALSA = @MOZ_ALSA@
-+MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS@
+ MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS@
+MOZ_ALSA_CFLAGS = @MOZ_ALSA_CFLAGS@
+
+MOZ_PULSEAUDIO = @MOZ_PULSEAUDIO@
+MOZ_PULSEAUDIO_LIBS = @MOZ_PULSEAUDIO_LIBS@
+MOZ_PULSEAUDIO_CFLAGS = @MOZ_PULSEAUDIO_CFLAGS@
-+
+
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
- GLIB_GMODULE_LIBS = @GLIB_GMODULE_LIBS@
--- configure.in~
+++ configure.in
-@@ -5660,15 +5660,49 @@ dnl ====================================
+@@ -5758,17 +5775,48 @@ dnl ====================================
+ dnl = Check alsa availability on Linux if using sydneyaudio
+ dnl ========================================================
- dnl If using sydneyaudio with Linux, ensure that the alsa library is available
- if test "$COMPILE_ENVIRONMENT"; then
--if test -n "$MOZ_SYDNEYAUDIO"; then
+MOZ_ARG_ENABLE_BOOL(alsa,
+[ --enable-alsa Enable Alsa support],
+MOZ_ALSA=1,
+MOZ_ALSA= MOZ_ALSA_FORCE=$enableval)
+
+ dnl If using sydneyaudio with Linux, ensure that the alsa library is available
+-if test -n "$MOZ_SYDNEYAUDIO"; then
+if test -n "$MOZ_SYDNEYAUDIO" -a "$MOZ_ALSA_FORCE" != "no"; then
case "$target_os" in
linux*)
-- AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
+ MOZ_ALSA=1
- ;;
- esac
- fi
++ ;;
++ esac
++fi
+
+if test -n "$MOZ_ALSA"; then
-+ PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
-+ [echo "$MOZ_ALSA_PKG_ERRORS"
-+ AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
-+fi
+ PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
+ [echo "$MOZ_ALSA_PKG_ERRORS"
+ AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
+- ;;
+- esac
fi
+AC_SUBST(MOZ_ALSA_CFLAGS)
-+AC_SUBST(MOZ_ALSA_LIBS)
+AC_SUBST(MOZ_ALSA)
+
+dnl ========================================================
@@ -67,25 +66,23 @@
+AC_SUBST(MOZ_PULSEAUDIO)
+
dnl ========================================================
- dnl Splashscreen
+ dnl Permissions System
dnl ========================================================
--- media/libsydneyaudio/src/Makefile.in~
+++ media/libsydneyaudio/src/Makefile.in
-@@ -45,12 +45,6 @@ MODULE = sydneyaudio
- LIBRARY_NAME = sydneyaudio
- FORCE_STATIC_LIB= 1
-
--ifeq ($(OS_ARCH),Linux)
+@@ -30,10 +30,6 @@ else ifeq ($(MOZ_WIDGET_TOOLKIT),android)
+ CSRCS = \
+ sydney_audio_android.c \
+ $(NULL)
+-else ifeq ($(OS_ARCH),Linux)
-CSRCS = \
- sydney_audio_alsa.c \
- $(NULL)
--endif
--
- ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
- CSRCS = \
- sydney_audio_waveapi.c \
-@@ -83,6 +83,18 @@ CSRCS = \
- $(NULL)
+ endif
+
+ ifeq ($(OS_ARCH),WINNT)
+@@ -68,6 +64,18 @@ CSRCS = \
+ $(NULL)
endif
+ifdef MOZ_ALSA
@@ -105,18 +102,18 @@
endif
--- toolkit/library/libxul-config.mk~
+++ toolkit/library/libxul-config.mk
-@@ -90,6 +90,14 @@ endif
- LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/os2
+@@ -348,10 +348,12 @@ ifdef MOZ_NATIVE_LIBVPX
+ EXTRA_DSO_LDOPTS += $(MOZ_LIBVPX_LIBS)
endif
+-ifdef MOZ_SYDNEYAUDIO
+-ifeq ($(OS_ARCH),Linux)
+ifdef MOZ_ALSA
-+EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
-+endif
+ EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
+ endif
+
+ifdef MOZ_PULSEAUDIO
+EXTRA_DSO_LDOPTS += $(MOZ_PULSEAUDIO_LIBS)
-+endif
-+
- # dependent libraries
- ifdef MOZ_IPC
- STATIC_LIBS += \
+ endif
+
+ ifdef HAVE_CLOCK_MONOTONIC
diff --git a/www/libxul/files/patch-bug543241 b/www/libxul/files/patch-bug543241
new file mode 100644
index 000000000000..73db2c3a785e
--- /dev/null
+++ b/www/libxul/files/patch-bug543241
@@ -0,0 +1,14 @@
+--- ./xpcom/threads/nsThreadManager.cpp.orig 2011-08-25 02:37:45.000000000 +0200
++++ ./xpcom/threads/nsThreadManager.cpp 2011-08-28 17:14:14.000000000 +0200
+@@ -89,6 +89,11 @@
+ nsresult
+ nsThreadManager::Init()
+ {
++#if defined(NS_TLS) && (__FreeBSD_version < 802513 \
++ || (__FreeBSD_version >= 900000 && __FreeBSD_version < 900045))
++ if (!gTLSThreadID)
++ gTLSThreadID = mozilla::threads::Generic;
++#endif
+ if (!mThreadsByPRThread.Init())
+ return NS_ERROR_OUT_OF_MEMORY;
+
diff --git a/www/libxul/files/patch-bug653551 b/www/libxul/files/patch-bug653551
index 733da79a9fd8..f9316f0f725b 100644
--- a/www/libxul/files/patch-bug653551
+++ b/www/libxul/files/patch-bug653551
@@ -11,14 +11,19 @@ diff --git js/src/configure.in js/src/configure.in
index 84390cf..d663c46 100644
--- js/src/configure.in
+++ js/src/configure.in
-@@ -2471,8 +2471,10 @@ arm*-*)
- NANOJIT_ARCH=ARM
+@@ -2806,13 +2806,15 @@ arm*-*)
+ AC_DEFINE(JS_NUNBOX32)
;;
sparc*-*)
+ if test ! "$HAVE_64BIT_OS" ; then
- ENABLE_JIT=1
NANOJIT_ARCH=Sparc
+ ENABLE_METHODJIT=1
+ ENABLE_MONOIC=1
+ ENABLE_POLYIC=1
+ ENABLE_METHODJIT_TYPED_ARRAY=1
+ AC_DEFINE(JS_CPU_SPARC)
+ AC_DEFINE(JS_NUNBOX32)
+ fi
;;
- esac
-
+ mips*-*)
+ ENABLE_METHODJIT=1
diff --git a/www/libxul/files/patch-bug685258 b/www/libxul/files/patch-bug685258
index 598a6ea5f3d5..ead2d3858209 100644
--- a/www/libxul/files/patch-bug685258
+++ b/www/libxul/files/patch-bug685258
@@ -6,12 +6,12 @@ Bug 685258 - Pulse audio backend does not check provided playback and crashes r=
diff --git a/content/media/nsAudioStream.cpp b/content/media/nsAudioStream.cpp
--- content/media/nsAudioStream.cpp
+++ content/media/nsAudioStream.cpp
-@@ -83,7 +83,7 @@ void nsAudioStream::Init(PRInt32 aNumCha
- mChannels = aNumChannels;
+@@ -429,7 +429,7 @@ nsresult nsNativeAudioStream::Init(PRInt32 aNumChannels, PRInt32 aRate, SampleFo
mFormat = aFormat;
+
if (sa_stream_create_pcm(reinterpret_cast<sa_stream_t**>(&mAudioHandle),
-- NULL,
+- NULL,
+ "Mozilla",
- SA_MODE_WRONLY,
+ SA_MODE_WRONLY,
SA_PCM_FORMAT_S16_NE,
aRate,
diff --git a/www/libxul/files/patch-bug691898 b/www/libxul/files/patch-bug691898
new file mode 100644
index 000000000000..977cae2b5bff
--- /dev/null
+++ b/www/libxul/files/patch-bug691898
@@ -0,0 +1,285 @@
+From: Mike Hommey <mh@glandium.org>
+Date: Sat, 24 Dec 2011 09:56:58 +0100
+Subject: Bug 691898 - Use YARR interpreter instead of PCRE on platforms where
+ YARR JIT is not supported
+
+---
+ js/src/Makefile.in | 21 +++++++++++++--------
+ js/src/vm/RegExpObject-inl.h | 28 ++++++----------------------
+ js/src/vm/RegExpObject.cpp | 36 ------------------------------------
+ js/src/vm/RegExpObject.h | 27 ++++++---------------------
+ js/src/yarr/wtfbridge.h | 2 --
+ 5 files changed, 25 insertions(+), 89 deletions(-)
+
+diff --git a/js/src/Makefile.in b/js/src/Makefile.in
+index fc48cbd..49f0bdc 100644
+--- js/src/Makefile.in
++++ js/src/Makefile.in
+@@ -416,15 +416,20 @@ CPPSRCS += checks.cc \
+
+ ifeq (,$(filter arm% sparc %86 x86_64,$(TARGET_CPU)))
+
+-VPATH += $(srcdir)/yarr/pcre \
++VPATH += $(srcdir)/assembler \
++ $(srcdir)/assembler/wtf \
++ $(srcdir)/yarr \
+ $(NULL)
+
+ CPPSRCS += \
+- pcre_compile.cpp \
+- pcre_exec.cpp \
+- pcre_tables.cpp \
+- pcre_xclass.cpp \
+- pcre_ucp_searchfuncs.cpp \
++ Assertions.cpp \
++ OSAllocatorOS2.cpp \
++ OSAllocatorPosix.cpp \
++ OSAllocatorWin.cpp \
++ PageBlock.cpp \
++ YarrInterpreter.cpp \
++ YarrPattern.cpp \
++ YarrSyntaxChecker.cpp \
+ $(NULL)
+ else
+
+@@ -1015,10 +1020,10 @@ endif
+ # Needed to "configure" it correctly. Unfortunately these
+ # flags wind up being applied to all code in js/src, not just
+ # the code in js/src/assembler.
+-CXXFLAGS += -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1
++CXXFLAGS += -DUSE_SYSTEM_MALLOC=1
+
+ ifneq (,$(ENABLE_YARR_JIT)$(ENABLE_TRACEJIT)$(ENABLE_METHODJIT))
+-CXXFLAGS += -DENABLE_JIT=1
++CXXFLAGS += -DENABLE_JIT=1 -DENABLE_ASSEMBLER=1
+ endif
+
+ INCLUDES += -I$(srcdir)/assembler -I$(srcdir)/yarr
+diff --git a/js/src/vm/RegExpObject-inl.h b/js/src/vm/RegExpObject-inl.h
+index 5f7817d..91108a7 100644
+--- js/src/vm/RegExpObject-inl.h
++++ js/src/vm/RegExpObject-inl.h
+@@ -327,6 +327,7 @@ RegExpPrivate::create(JSContext *cx, JSString *source, RegExpFlag flags, TokenSt
+ return RetType(self);
+ }
+
++#if ENABLE_YARR_JIT
+ /* This function should be deleted once bad Android platforms phase out. See bug 604774. */
+ inline bool
+ RegExpPrivateCode::isJITRuntimeEnabled(JSContext *cx)
+@@ -337,12 +338,12 @@ RegExpPrivateCode::isJITRuntimeEnabled(JSContext *cx)
+ return true;
+ #endif
+ }
++#endif
+
+ inline bool
+ RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream *ts,
+ uintN *parenCount, RegExpFlag flags)
+ {
+-#if ENABLE_YARR_JIT
+ /* Parse the pattern. */
+ ErrorCode yarrError;
+ YarrPattern yarrPattern(pattern, bool(flags & IgnoreCaseFlag), bool(flags & MultilineFlag),
+@@ -359,7 +360,7 @@ RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream *
+ * case we have to bytecode compile it.
+ */
+
+-#ifdef JS_METHODJIT
++#if ENABLE_YARR_JIT && defined(JS_METHODJIT)
+ if (isJITRuntimeEnabled(cx) && !yarrPattern.m_containsBackreferences) {
+ if (!cx->compartment->ensureJaegerCompartmentExists(cx))
+ return false;
+@@ -371,21 +372,11 @@ RegExpPrivateCode::compile(JSContext *cx, JSLinearString &pattern, TokenStream *
+ }
+ #endif
+
++#if ENABLE_YARR_JIT
+ codeBlock.setFallBack(true);
++#endif
+ byteCode = byteCompile(yarrPattern, cx->compartment->regExpAllocator).get();
+ return true;
+-#else /* !defined(ENABLE_YARR_JIT) */
+- int error = 0;
+- compiled = jsRegExpCompile(pattern.chars(), pattern.length(),
+- ignoreCase() ? JSRegExpIgnoreCase : JSRegExpDoNotIgnoreCase,
+- multiline() ? JSRegExpMultiline : JSRegExpSingleLine,
+- parenCount, &error);
+- if (error) {
+- reportPCREError(cx, error);
+- return false;
+- }
+- return true;
+-#endif
+ }
+
+ inline bool
+@@ -431,19 +422,12 @@ RegExpPrivateCode::execute(JSContext *cx, const jschar *chars, size_t start, siz
+ else
+ result = JSC::Yarr::execute(codeBlock, chars, start, length, output);
+ #else
+- result = jsRegExpExecute(cx, compiled, chars, length, start, output, outputCount);
++ result = JSC::Yarr::interpret(byteCode, chars, start, length, output);
+ #endif
+
+ if (result == -1)
+ return Success_NotFound;
+
+-#if !ENABLE_YARR_JIT
+- if (result < 0) {
+- reportPCREError(cx, result);
+- return Error;
+- }
+-#endif
+-
+ JS_ASSERT(result >= 0);
+ return Success;
+ }
+diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
+index f75c6a5..7631dd5 100644
+--- js/src/vm/RegExpObject.cpp
++++ js/src/vm/RegExpObject.cpp
+@@ -251,7 +251,6 @@ Class js::RegExpClass = {
+ NULL /* trace */
+ };
+
+-#if ENABLE_YARR_JIT
+ void
+ RegExpPrivateCode::reportYarrError(JSContext *cx, TokenStream *ts, ErrorCode error)
+ {
+@@ -283,41 +282,6 @@ RegExpPrivateCode::reportYarrError(JSContext *cx, TokenStream *ts, ErrorCode err
+ }
+ }
+
+-#else /* !ENABLE_YARR_JIT */
+-
+-void
+-RegExpPrivateCode::reportPCREError(JSContext *cx, int error)
+-{
+-#define REPORT(msg_) \
+- JS_ReportErrorFlagsAndNumberUC(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL, msg_); \
+- return
+- switch (error) {
+- case -2: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
+- case 0: JS_NOT_REACHED("Precondition violation: an error must have occurred.");
+- case 1: REPORT(JSMSG_TRAILING_SLASH);
+- case 2: REPORT(JSMSG_TRAILING_SLASH);
+- case 3: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
+- case 4: REPORT(JSMSG_BAD_QUANTIFIER);
+- case 5: REPORT(JSMSG_BAD_QUANTIFIER);
+- case 6: REPORT(JSMSG_BAD_CLASS_RANGE);
+- case 7: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
+- case 8: REPORT(JSMSG_BAD_CLASS_RANGE);
+- case 9: REPORT(JSMSG_BAD_QUANTIFIER);
+- case 10: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN);
+- case 11: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
+- case 12: REPORT(JSMSG_UNMATCHED_RIGHT_PAREN);
+- case 13: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
+- case 14: REPORT(JSMSG_MISSING_PAREN);
+- case 15: REPORT(JSMSG_BAD_BACKREF);
+- case 16: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
+- case 17: REPORT(JSMSG_REGEXP_TOO_COMPLEX);
+- default:
+- JS_NOT_REACHED("Precondition violation: unknown PCRE error code.");
+- }
+-#undef REPORT
+-}
+-#endif /* ENABLE_YARR_JIT */
+-
+ bool
+ js::ParseRegExpFlags(JSContext *cx, JSString *flagStr, RegExpFlag *flagsOut)
+ {
+diff --git a/js/src/vm/RegExpObject.h b/js/src/vm/RegExpObject.h
+index 1449d56..279f3c0 100644
+--- js/src/vm/RegExpObject.h
++++ js/src/vm/RegExpObject.h
+@@ -49,8 +49,6 @@
+ #include "yarr/Yarr.h"
+ #if ENABLE_YARR_JIT
+ #include "yarr/YarrJIT.h"
+-#else
+-#include "yarr/pcre/pcre.h"
+ #endif
+
+ namespace js {
+@@ -153,48 +151,39 @@ ResetRegExpObject(JSContext *cx, AlreadyIncRefed<RegExpPrivate> rep);
+ /* Abstracts away the gross |RegExpPrivate| backend details. */
+ class RegExpPrivateCode
+ {
+-#if ENABLE_YARR_JIT
+ typedef JSC::Yarr::BytecodePattern BytecodePattern;
+ typedef JSC::Yarr::ErrorCode ErrorCode;
++ typedef JSC::Yarr::YarrPattern YarrPattern;
++#if ENABLE_YARR_JIT
+ typedef JSC::Yarr::JSGlobalData JSGlobalData;
+ typedef JSC::Yarr::YarrCodeBlock YarrCodeBlock;
+- typedef JSC::Yarr::YarrPattern YarrPattern;
+
+ /* Note: Native code is valid only if |codeBlock.isFallBack() == false|. */
+ YarrCodeBlock codeBlock;
+- BytecodePattern *byteCode;
+-#else
+- JSRegExp *compiled;
+ #endif
++ BytecodePattern *byteCode;
+
+ public:
+ RegExpPrivateCode()
+ :
+ #if ENABLE_YARR_JIT
+ codeBlock(),
+- byteCode(NULL)
+-#else
+- compiled(NULL)
+ #endif
++ byteCode(NULL)
+ { }
+
+ ~RegExpPrivateCode() {
+ #if ENABLE_YARR_JIT
+ codeBlock.release();
++#endif
+ if (byteCode)
+ Foreground::delete_<BytecodePattern>(byteCode);
+-#else
+- if (compiled)
+- jsRegExpFree(compiled);
+-#endif
+ }
+
+ #if ENABLE_YARR_JIT
+ static inline bool isJITRuntimeEnabled(JSContext *cx);
+- void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error);
+-#else
+- void reportPCREError(JSContext *cx, int error);
+ #endif
++ void reportYarrError(JSContext *cx, TokenStream *ts, JSC::Yarr::ErrorCode error);
+
+ inline bool compile(JSContext *cx, JSLinearString &pattern, TokenStream *ts, uintN *parenCount,
+ RegExpFlag flags);
+@@ -205,11 +194,7 @@ class RegExpPrivateCode
+ int *output, size_t outputCount);
+
+ static size_t getOutputSize(size_t pairCount) {
+-#if ENABLE_YARR_JIT
+ return pairCount * 2;
+-#else
+- return pairCount * 3; /* Should be x2, but PCRE has... needs. */
+-#endif
+ }
+ };
+
+diff --git a/js/src/yarr/wtfbridge.h b/js/src/yarr/wtfbridge.h
+index ac41d08..fb8eb86 100644
+--- js/src/yarr/wtfbridge.h
++++ js/src/yarr/wtfbridge.h
+@@ -49,9 +49,7 @@
+ #include "jsprvtd.h"
+ #include "vm/String.h"
+ #include "assembler/wtf/Platform.h"
+-#if ENABLE_YARR_JIT
+ #include "assembler/jit/ExecutableAllocator.h"
+-#endif
+
+ namespace JSC { namespace Yarr {
+
diff --git a/www/libxul/files/patch-bug714312 b/www/libxul/files/patch-bug714312
new file mode 100644
index 000000000000..114144d18388
--- /dev/null
+++ b/www/libxul/files/patch-bug714312
@@ -0,0 +1,73 @@
+commit c104d9b
+Author: Landry Breuil <landry@openbsd.org>
+Date: Mon Jan 9 17:32:00 2012 -0600
+
+ Bug 714312 - Use <machine/endian.h> to get endianess on BSD systems, fixing the BSD build. r=ted
+
+ --HG--
+ extra : rebase_source : 8b418bdb2d713093d138ffed20bf1630c05f396b
+---
+ js/src/configure.in | 5 +++++
+ js/src/js-config.h.in | 4 ++++
+ js/src/jscpucfg.h | 17 +++++++++++++++++
+ 3 files changed, 26 insertions(+)
+
+diff --git js/src/configure.in js/src/configure.in
+index 164c896..361b29e 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -2934,6 +2934,11 @@ if test "$ac_cv_header_endian_h" = yes;
+ AC_DEFINE(JS_HAVE_ENDIAN_H)
+ fi
+
++AC_CHECK_HEADERS(machine/endian.h)
++if test "$ac_cv_header_machine_endian_h" = yes; then
++ AC_DEFINE(JS_HAVE_MACHINE_ENDIAN_H)
++fi
++
+ AC_CHECK_HEADERS(sys/isa_defs.h)
+ if test "$ac_cv_header_sys_isa_defs_h" = yes; then
+ AC_DEFINE(JS_HAVE_SYS_ISA_DEFS_H)
+diff --git js/src/js-config.h.in js/src/js-config.h.in
+index fb009fa..402262e 100644
+--- js/src/js-config.h.in
++++ js/src/js-config.h.in
+@@ -59,6 +59,10 @@
+ useable. See jscpucfg.h. */
+ #undef JS_HAVE_ENDIAN_H
+
++/* Define to 1 if the <machine/endian.h> header is present and
++ useable. See jscpucfg.h. */
++#undef JS_HAVE_MACHINE_ENDIAN_H
++
+ /* Define to 1 if the <sys/isa_defs.h> header is present and
+ useable. See jscpucfg.h. */
+ #undef JS_HAVE_SYS_ISA_DEFS_H
+diff --git js/src/jscpucfg.h js/src/jscpucfg.h
+index dd32bce..5fd8415 100644
+--- js/src/jscpucfg.h
++++ js/src/jscpucfg.h
+@@ -92,6 +92,23 @@
+ # error "endian.h does not define __BYTE_ORDER. Cannot determine endianness."
+ # endif
+
++/* BSDs */
++#elif defined(JS_HAVE_MACHINE_ENDIAN_H)
++# include <sys/types.h>
++# include <machine/endian.h>
++
++# if defined(_BYTE_ORDER)
++# if _BYTE_ORDER == _LITTLE_ENDIAN
++# define IS_LITTLE_ENDIAN 1
++# undef IS_BIG_ENDIAN
++# elif _BYTE_ORDER == _BIG_ENDIAN
++# undef IS_LITTLE_ENDIAN
++# define IS_BIG_ENDIAN 1
++# endif
++# else /* !defined(_BYTE_ORDER) */
++# error "machine/endian.h does not define _BYTE_ORDER. Cannot determine endianness."
++# endif
++
+ #elif defined(JS_HAVE_SYS_ISA_DEFS_H)
+ # include <sys/isa_defs.h>
+
diff --git a/www/libxul/files/patch-bug725655 b/www/libxul/files/patch-bug725655
new file mode 100644
index 000000000000..ec331a5ccb73
--- /dev/null
+++ b/www/libxul/files/patch-bug725655
@@ -0,0 +1,53 @@
+commit 18b9c9d
+Author: Martin Stránský <stransky@redhat.com>
+Date: Fri Feb 10 16:07:41 2012 +0100
+
+ Bug 725655 - gcc 4.7 build failures (missing headers). r=benjamin
+---
+ ipc/chromium/src/base/file_util_linux.cc | 3 +++
+ ipc/chromium/src/base/message_pump_libevent.cc | 3 +++
+ ipc/chromium/src/base/time_posix.cc | 3 +++
+ 3 files changed, 9 insertions(+)
+
+diff --git ipc/chromium/src/base/file_util_linux.cc ipc/chromium/src/base/file_util_linux.cc
+index cca706f..171e44f 100644
+--- ipc/chromium/src/base/file_util_linux.cc
++++ ipc/chromium/src/base/file_util_linux.cc
+@@ -5,6 +5,9 @@
+ #include "base/file_util.h"
+
+ #include <fcntl.h>
++#if defined(ANDROID) || defined(OS_POSIX)
++#include <unistd.h>
++#endif
+
+ #include <string>
+ #include <vector>
+diff --git ipc/chromium/src/base/message_pump_libevent.cc ipc/chromium/src/base/message_pump_libevent.cc
+index 6194f79..9f31dbb 100644
+--- ipc/chromium/src/base/message_pump_libevent.cc
++++ ipc/chromium/src/base/message_pump_libevent.cc
+@@ -6,6 +6,9 @@
+
+ #include <errno.h>
+ #include <fcntl.h>
++#if defined(ANDROID) || defined(OS_POSIX)
++#include <unistd.h>
++#endif
+
+ #include "eintr_wrapper.h"
+ #include "base/logging.h"
+diff --git ipc/chromium/src/base/time_posix.cc ipc/chromium/src/base/time_posix.cc
+index 8d1a1d5..abf2a56 100644
+--- ipc/chromium/src/base/time_posix.cc
++++ ipc/chromium/src/base/time_posix.cc
+@@ -13,6 +13,9 @@
+ #else
+ #include <time.h>
+ #endif
++#if defined(ANDROID) || defined(OS_POSIX)
++#include <unistd.h>
++#endif
+
+ #include <limits>
+
diff --git a/www/libxul/files/patch-bug728968 b/www/libxul/files/patch-bug728968
new file mode 100644
index 000000000000..01638e8fd119
--- /dev/null
+++ b/www/libxul/files/patch-bug728968
@@ -0,0 +1,50 @@
+commit 4075972
+Author: Mike Hommey <mh+mozilla@glandium.org>
+Date: Thu Feb 23 11:00:46 2012 +0100
+
+ Bug 728968 - Detect clock_gettime when it's not in -lrt. r=khuey
+---
+ configure.in | 29 ++++++++++++++++-------------
+ 1 file changed, 16 insertions(+), 13 deletions(-)
+
+diff --git configure.in configure.in
+index 3ba7e2f..3d0614c 100644
+--- configure.in
++++ configure.in
+@@ -3728,20 +3728,23 @@ AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat6
+ AC_CHECK_FUNCS(flockfile getpagesize)
+ AC_CHECK_FUNCS(localtime_r strtok_r)
+
+-dnl check for clock_gettime(), the CLOCK_MONOTONIC clock, and -lrt
+-_SAVE_LDFLAGS=$LDFLAGS
+-LDFLAGS="$LDFLAGS -lrt"
+-AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC) and -lrt,
+- ac_cv_have_clock_monotonic,
+- [AC_TRY_LINK([#include <time.h>],
+- [ struct timespec ts;
+- clock_gettime(CLOCK_MONOTONIC, &ts); ],
+- ac_cv_have_clock_monotonic=yes,
+- ac_cv_have_clock_monotonic=no)])
+-LDFLAGS=$_SAVE_LDFLAGS
+-if test "$ac_cv_have_clock_monotonic" = "yes"; then
++dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
++AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
++ ac_cv_clock_monotonic,
++ [for libs in "" -lrt; do
++ _SAVE_LDFLAGS="$LDFLAGS"
++ LDFLAGS="$LDFLAGS $libs"
++ AC_TRY_LINK([#include <time.h>],
++ [ struct timespec ts;
++ clock_gettime(CLOCK_MONOTONIC, &ts); ],
++ ac_cv_clock_monotonic=$libs
++ break,
++ ac_cv_clock_monotonic=no)
++ LDFLAGS="$_SAVE_LDFLAGS"
++ done])
++if test "$ac_cv_clock_monotonic" != "no"; then
+ HAVE_CLOCK_MONOTONIC=1
+- REALTIME_LIBS=-lrt
++ REALTIME_LIBS=$ac_cv_clock_monotonic
+ AC_DEFINE(HAVE_CLOCK_MONOTONIC)
+ AC_SUBST(HAVE_CLOCK_MONOTONIC)
+ AC_SUBST(REALTIME_LIBS)
diff --git a/www/libxul/files/patch-bug729155 b/www/libxul/files/patch-bug729155
new file mode 100644
index 000000000000..a8f2a6623493
--- /dev/null
+++ b/www/libxul/files/patch-bug729155
@@ -0,0 +1,18 @@
+--- dom/plugins/ipc/PluginMessageUtils.cpp
++++ dom/plugins/ipc/PluginMessageUtils.cpp
+@@ -114,6 +114,7 @@ MediateRace(const RPCChannel::Message& parent,
+ }
+ }
+
++#if defined(OS_LINUX)
+ static string
+ ReplaceAll(const string& haystack, const string& needle, const string& with)
+ {
+@@ -127,6 +128,7 @@ ReplaceAll(const string& haystack, const string& needle, const string& with)
+
+ return munged;
+ }
++#endif
+
+ string
+ MungePluginDsoPath(const string& path)
diff --git a/www/libxul/files/patch-bug741737 b/www/libxul/files/patch-bug741737
new file mode 100644
index 000000000000..b00aef3d1382
--- /dev/null
+++ b/www/libxul/files/patch-bug741737
@@ -0,0 +1,90 @@
+changeset: 91900:eee73897136b
+user: Martin Stransky <stransky@redhat.com>
+date: Tue Apr 17 19:57:40 2012 -0400
+summary: Bug 741737 - Configure libvpx with pkgconfig. r=khuey, a=npotb
+
+diff --git a/configure.in b/configure.in
+--- configure.in
++++ configure.in
+@@ -5588,12 +5588,10 @@ MOZ_ARG_DISABLE_BOOL(webm,
+
+ dnl system libvpx Support
+ dnl ========================================================
+-MOZ_ARG_WITH_STRING(system-libvpx,
+-[ --with-system-libvpx=[PFX]
+- Use system libvpx [installed at prefix PFX]],
+- LIBVPX_DIR=$withval)
++MOZ_ARG_WITH_BOOL(system-libvpx,
++[ --with-system-libvpx Use system libvpx (located with pkgconfig)],
++ MOZ_NATIVE_LIBVPX=1)
+
+-MOZ_NATIVE_LIBVPX=
+ MOZ_LIBVPX_INCLUDES=
+ MOZ_LIBVPX_LIBS=
+
+@@ -5606,53 +5604,18 @@ if test -n "$MOZ_WEBM"; then
+ AC_DEFINE(MOZ_VP8_ENCODER)
+ fi
+
+- if test -n "$LIBVPX_DIR" -a "$LIBVPX_DIR" != no; then
+- _SAVE_CFLAGS=$CFLAGS
+- _SAVE_LDFLAGS=$LDFLAGS
+- _SAVE_LIBS=$LIBS
+- if test "${LIBVPX_DIR}" = "yes"; then
+- LIBVPX_DIR=/usr
+- fi
+- CFLAGS="-I${LIBVPX_DIR}/include $CFLAGS"
+- LDFLAGS="-L${LIBVPX_DIR}/lib $LDFLAGS"
+- MOZ_NATIVE_LIBVPX_DEC_TEST=
+- MOZ_CHECK_HEADER(vpx/vpx_decoder.h,
+- [if test ! -f "${LIBVPX_DIR}/include/vpx/vpx_decoder.h"; then
+- AC_MSG_ERROR([vpx/vpx_decoder.h found, but is not in ${LIBVPX_DIR}/include])
+- fi],
+- AC_MSG_ERROR([--with-system-libvpx requested but vpx/vpx_decoder.h not found]))
+- AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver,
+- [MOZ_NATIVE_LIBVPX_DEC_TEST=1],
+- ([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found]))
+- if test -n "$MOZ_NATIVE_LIBVPX_DEC_TEST" ; then
+- AC_MSG_CHECKING([for libvpx version >= v0.9.7])
+- dnl We need at least v0.9.7 to fix several crash bugs (for which we
+- dnl had local patches prior to v0.9.7).
+- dnl
+- dnl This is a terrible test for the library version, but we don't
+- dnl have a good one. There is no version number in a public header,
+- dnl and testing the headers still doesn't guarantee we link against
+- dnl the right version. While we could call vpx_codec_version() at
+- dnl run-time, that would break cross-compiling. There are no
+- dnl additional exported symbols between the v0.9.7 release and the
+- dnl v0.9.6 one to check for.
+- AC_TRY_COMPILE([
+- #include <vpx/vpx_decoder.h>
+- #if !defined(VPX_CODEC_USE_INPUT_PARTITION)
+- #error "test failed."
+- #endif
+- ],
+- [return 0;],
+- [AC_MSG_RESULT([yes])
+- MOZ_NATIVE_LIBVPX=1
+- MOZ_LIBVPX_INCLUDES="-I${LIBVPX_DIR}/include"
+- MOZ_LIBVPX_LIBS="-L${LIBVPX_DIR}/lib -lvpx"],
+- [AC_MSG_RESULT([no])
+- AC_MSG_ERROR([--with-system-libvpx requested but it is not v0.9.7 or later])])
+- fi
+- CFLAGS=$_SAVE_CFLAGS
+- LDFLAGS=$_SAVE_LDFLAGS
+- LIBS=$_SAVE_LIBS
++ if test -n "$MOZ_NATIVE_LIBVPX"; then
++ dnl ============================
++ dnl === libvpx Version check ===
++ dnl ============================
++ dnl Check to see if we have a system libvpx package.
++ PKG_CHECK_MODULES(LIBVPX, vpx >= 0.9.7)
++
++ 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.])])
++
++ 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])])
+ fi
+ fi
+
diff --git a/www/libxul/files/patch-bug753046 b/www/libxul/files/patch-bug753046
new file mode 100644
index 000000000000..48c16e5db2e1
--- /dev/null
+++ b/www/libxul/files/patch-bug753046
@@ -0,0 +1,1201 @@
+# Bug 753046 - Add support for DragonFly/NetBSD
+
+$NetBSD: patch-dom_plugins_ipc_PluginModuleChild.cpp,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- dom/plugins/ipc/PluginModuleChild.cpp.orig 2011-12-20 23:28:14.000000000 +0000
++++ dom/plugins/ipc/PluginModuleChild.cpp
+@@ -5,6 +5,7 @@
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h> // for _exit()
+ #include <QtCore/QTimer>
+ #include "nsQAppInstance.h"
+ #include "NestedLoopTimer.h"
+@@ -228,7 +228,7 @@ PluginModuleChild::Init(const std::strin
+
+ // TODO: use PluginPRLibrary here
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ mShutdownFunc =
+ (NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
+
+@@ -1790,7 +1790,7 @@ PluginModuleChild::AnswerNP_GetEntryPoin
+ PLUGIN_LOG_DEBUG_METHOD;
+ AssertPluginThread();
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ return true;
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
+ *_retval = mGetEntryPointsFunc(&mFunctions);
+@@ -1823,7 +1823,7 @@ PluginModuleChild::AnswerNP_Initialize(N
+ SendBackUpXResources(FileDescriptor(xSocketFd, false/*don't close*/));
+ #endif
+
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ *_retval = mInitializeFunc(&sBrowserFuncs, &mFunctions);
+ return true;
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
+$NetBSD: patch-dom_plugins_ipc_PluginModuleChild.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- dom/plugins/ipc/PluginModuleChild.h.orig 2011-12-20 23:28:14.000000000 +0000
++++ dom/plugins/ipc/PluginModuleChild.h
+@@ -340,7 +340,7 @@ private:
+
+ // we get this from the plugin
+ NP_PLUGINSHUTDOWN mShutdownFunc;
+-#ifdef OS_LINUX
++#if defined(OS_LINUX) || defined(OS_BSD)
+ NP_PLUGINUNIXINIT mInitializeFunc;
+ #elif defined(OS_WIN) || defined(OS_MACOSX)
+ NP_PLUGININIT mInitializeFunc;
+$NetBSD: patch-ipc_chromium_Makefile.in,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/Makefile.in.orig 2012-02-16 06:40:33.000000000 +0000
++++ ipc/chromium/Makefile.in
+@@ -278,6 +278,34 @@ endif
+
+ endif # } OS_LINUX
+
++ifdef OS_BSD # {
++
++CPPSRCS += \
++ atomicops_internals_x86_gcc.cc \
++ file_util_linux.cc \
++ process_util_bsd.cc \
++ time_posix.cc \
++ $(NULL)
++
++ifdef MOZ_ENABLE_GTK2
++CPPSRCS += \
++ message_pump_glib.cc \
++ $(NULL)
++endif
++
++ifdef MOZ_ENABLE_QT
++MOCSRCS = \
++ moc_message_pump_qt.cc \
++ $(NULL)
++
++CPPSRCS += \
++ $(MOCSRCS) \
++ message_pump_qt.cc \
++ $(NULL)
++endif
++
++endif # } OS_BSD
++
+ # libevent
+
+ ifndef MOZ_NATIVE_LIBEVENT # {
+$NetBSD: patch-ipc_chromium_chromium-config.mk,v 1.2 2012/03/15 08:30:06 ryoon Exp $
+
+--- ipc/chromium/chromium-config.mk.orig 2012-02-16 07:40:33.000000000 +0100
++++ ipc/chromium/chromium-config.mk 2012-03-11 11:05:40.397182000 +0100
+@@ -56,17 +56,6 @@
+ -I$(DEPTH)/ipc/ipdl/_ipdlheaders \
+ $(NULL)
+
+-ifeq ($(OS_ARCH),Darwin) # {
+-
+-OS_MACOSX = 1
+-OS_POSIX = 1
+-
+-DEFINES += \
+- -DOS_MACOSX=1 \
+- -DOS_POSIX=1 \
+- $(NULL)
+-
+-else # } {
+ ifeq ($(OS_ARCH),WINNT) # {
+ OS_LIBS += $(call EXPAND_LIBNAME,psapi shell32 dbghelp)
+
+@@ -93,13 +82,65 @@
+ endif
+
+ else # } {
+-
+-OS_LINUX = 1
+ OS_POSIX = 1
++DEFINES += -DOS_POSIX=1
++
++ifeq ($(OS_ARCH),Darwin) # {
++
++OS_MACOSX = 1
++DEFINES += \
++ -DOS_MACOSX=1 \
++ $(NULL)
++
++else # } {
++ifeq ($(OS_ARCH),DragonFly) # {
++
++OS_DRAGONFLY = 1
++OS_BSD = 1
++OS_LIBS += $(call EXPAND_LIBNAME,kvm)
++DEFINES += \
++ -DOS_DRAGONFLY=1 \
++ -DOS_BSD=1 \
++ $(NULL)
++
++else # } {
++ifeq ($(OS_ARCH),FreeBSD) # {
++
++OS_FREEBSD = 1
++OS_BSD = 1
++OS_LIBS += $(call EXPAND_LIBNAME,kvm)
++DEFINES += \
++ -DOS_FREEBSD=1 \
++ -DOS_BSD=1 \
++ $(NULL)
+
++else # } {
++ifeq ($(OS_ARCH),NetBSD) # {
++
++OS_NETBSD = 1
++OS_BSD = 1
++OS_LIBS += $(call EXPAND_LIBNAME,kvm)
++DEFINES += \
++ -DOS_NETBSD=1 \
++ -DOS_BSD=1 \
++ $(NULL)
++
++else # } {
++ifeq ($(OS_ARCH),OpenBSD) # {
++
++OS_OPENBSD = 1
++OS_BSD = 1
++OS_LIBS += $(call EXPAND_LIBNAME,kvm)
++DEFINES += \
++ -DOS_OPENBSD=1 \
++ -DOS_BSD=1 \
++ $(NULL)
++
++else # } {
++
++OS_LINUX = 1
+ DEFINES += \
+ -DOS_LINUX=1 \
+- -DOS_POSIX=1 \
+ $(NULL)
+
+ # NB: to stop gcc warnings about exporting template instantiation
+@@ -107,4 +147,8 @@
+
+ endif # }
+ endif # }
++endif # }
++endif # }
++endif # }
++endif # }
+
+$NetBSD: patch-ipc_chromium_src_base_base__paths.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/base/base_paths.h.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/chromium/src/base/base_paths.h
+@@ -13,7 +13,7 @@
+ #include "base/base_paths_win.h"
+ #elif defined(OS_MACOSX)
+ #include "base/base_paths_mac.h"
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_BSD)
+ #include "base/base_paths_linux.h"
+ #endif
+ #include "base/path_service.h"
+$NetBSD: patch-ipc_chromium_src_base_debug__util__posic.cc,v 1.3 2012/04/01 15:18:45 ryoon Exp $
+
+--- ipc/chromium/src/base/debug_util_posix.cc.orig 2012-03-13 01:36:53.000000000 +0000
++++ ipc/chromium/src/base/debug_util_posix.cc
+@@ -5,7 +5,7 @@
+ #include "build/build_config.h"
+ #include "base/debug_util.h"
+
+-#define MOZ_HAVE_EXECINFO_H (!defined(ANDROID) && !defined(__OpenBSD__))
++#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID))
+
+ #include <errno.h>
+ #include <fcntl.h>
+@@ -17,9 +17,16 @@
+ #include <unistd.h>
+ #if MOZ_HAVE_EXECINFO_H
+ #include <execinfo.h>
++#endif
++
++#if defined(OS_MACOSX) || defined(OS_BSD)
+ #include <sys/sysctl.h>
+ #endif
+
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
++#include <sys/user.h>
++#endif
++
+ #include "base/basictypes.h"
+ #include "base/eintr_wrapper.h"
+ #include "base/logging.h"
+@@ -32,7 +37,7 @@ bool DebugUtil::SpawnDebuggerOnProcess(u
+ return false;
+ }
+
+-#if defined(OS_MACOSX)
++#if defined(OS_MACOSX) || defined(OS_BSD)
+
+ // Based on Apple's recommended method as described in
+ // http://developer.apple.com/qa/qa2004/qa1361.html
+@@ -71,7 +76,15 @@ bool DebugUtil::BeingDebugged() {
+
+ // This process is being debugged if the P_TRACED flag is set.
+ is_set = true;
++#if defined(OS_DRAGONFLY)
++ being_debugged = (info.kp_flags & P_TRACED) != 0;
++#elif defined(OS_FREEBSD)
++ being_debugged = (info.ki_flag & P_TRACED) != 0;
++#elif defined(OS_OPENBSD)
++ being_debugged = (info.p_flag & P_TRACED) != 0;
++#else
+ being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
++#endif
+ return being_debugged;
+ }
+
+diff --git ipc/chromium/src/base/dir_reader_bsd.h ipc/chromium/src/base/dir_reader_bsd.h
+new file mode 100644
+index 0000000..3fc1a87
+--- /dev/null
++++ ipc/chromium/src/base/dir_reader_bsd.h
+@@ -0,0 +1,112 @@
++// Copyright (c) 2010 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++// derived from dir_reader_linux.h
++
++#ifndef BASE_DIR_READER_BSD_H_
++#define BASE_DIR_READER_BSD_H_
++#pragma once
++
++#include <dirent.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <stdint.h>
++#include <unistd.h>
++
++#include "base/logging.h"
++#include "base/eintr_wrapper.h"
++
++// See the comments in dir_reader_posix.h about this.
++
++namespace base {
++
++class DirReaderBSD {
++ public:
++ explicit DirReaderBSD(const char* directory_path)
++#ifdef O_DIRECTORY
++ : fd_(open(directory_path, O_RDONLY | O_DIRECTORY)),
++#else
++ : fd_(open(directory_path, O_RDONLY)),
++#endif
++ offset_(0),
++ size_(0) {
++ memset(buf_, 0, sizeof(buf_));
++ }
++
++ ~DirReaderBSD() {
++ if (fd_ >= 0) {
++ if (HANDLE_EINTR(close(fd_)))
++ DLOG(ERROR) << "Failed to close directory handle";
++ }
++ }
++
++ bool IsValid() const {
++ return fd_ >= 0;
++ }
++
++ // Move to the next entry returning false if the iteration is complete.
++ bool Next() {
++ if (size_) {
++ struct dirent* dirent = reinterpret_cast<struct dirent*>(&buf_[offset_]);
++#ifdef OS_DRAGONFLY
++ offset_ += _DIRENT_DIRSIZ(dirent);
++#else
++ offset_ += dirent->d_reclen;
++#endif
++ }
++
++ if (offset_ != size_)
++ return true;
++
++#ifdef OS_OPENBSD
++ const int r = getdirentries(fd_, buf_, sizeof(buf_), basep_);
++#else
++ const int r = getdents(fd_, buf_, sizeof(buf_));
++#endif
++ if (r == 0)
++ return false;
++ if (r == -1) {
++#ifdef OS_OPENBSD
++ DLOG(ERROR) << "getdirentries returned an error: " << errno;
++#else
++ DLOG(ERROR) << "getdents returned an error: " << errno;
++#endif
++ return false;
++ }
++ size_ = r;
++ offset_ = 0;
++ return true;
++ }
++
++ const char* name() const {
++ if (!size_)
++ return NULL;
++
++ const struct dirent* dirent =
++ reinterpret_cast<const struct dirent*>(&buf_[offset_]);
++ return dirent->d_name;
++ }
++
++ int fd() const {
++ return fd_;
++ }
++
++ static bool IsFallback() {
++ return false;
++ }
++
++ private:
++ const int fd_;
++ char buf_[512];
++#ifdef OS_OPENBSD
++ off_t *basep_;
++#endif
++ size_t offset_, size_;
++
++ DISALLOW_COPY_AND_ASSIGN(DirReaderBSD);
++};
++
++} // namespace base
++
++#endif // BASE_DIR_READER_BSD_H_
+diff --git ipc/chromium/src/base/dir_reader_posix.h ipc/chromium/src/base/dir_reader_posix.h
+index 9a34492..62b280c 100644
+--- ipc/chromium/src/base/dir_reader_posix.h
++++ ipc/chromium/src/base/dir_reader_posix.h
+@@ -18,6 +18,8 @@
+
+ #if defined(OS_LINUX)
+ #include "base/dir_reader_linux.h"
++#elif defined(OS_BSD)
++#include "base/dir_reader_bsd.h"
+ #else
+ #include "base/dir_reader_fallback.h"
+ #endif
+@@ -26,6 +28,8 @@
+
+ #if defined(OS_LINUX)
+ typedef DirReaderLinux DirReaderPosix;
++#elif defined(OS_BSD)
++typedef DirReaderBSD DirReaderPosix;
+ #else
+ typedef DirReaderFallback DirReaderPosix;
+ #endif
+diff --git ipc/chromium/src/base/file_util_linux.cc ipc/chromium/src/base/file_util_linux.cc
+index 171e44f..0c6dfcc 100644
+--- ipc/chromium/src/base/file_util_linux.cc
++++ ipc/chromium/src/base/file_util_linux.cc
+@@ -28,7 +28,7 @@ bool GetTempDir(FilePath* path) {
+ }
+
+ bool GetShmemTempDir(FilePath* path) {
+-#ifdef ANDROID
++#if defined(ANDROID) || defined(OS_BSD)
+ return GetTempDir(path);
+ #else
+ *path = FilePath("/dev/shm");
+$NetBSD: patch-ipc_chromium_src_base_file__util__posix.cc,v 1.2 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/base/file_util_posix.cc.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/chromium/src/base/file_util_posix.cc
+@@ -31,7 +31,7 @@
+ #include "base/time.h"
+
+ // FreeBSD/OpenBSD lacks stat64, but its stat handles files >2GB just fine
+-#if defined(OS_FREEBSD) || defined(OS_OPENBSD)
++#ifndef HAVE_STAT64
+ #define stat64 stat
+ #endif
+
+$NetBSD: patch-ipc_chromium_src_base_message__loop.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/base/message_loop.cc.orig 2012-02-16 07:40:33.000000000 +0100
++++ ipc/chromium/src/base/message_loop.cc 2012-02-21 21:24:41.000000000 +0100
+@@ -19,7 +19,7 @@
+ #if defined(OS_POSIX)
+ #include "base/message_pump_libevent.h"
+ #endif
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_BSD)
+ #ifdef MOZ_WIDGET_GTK2
+ #include "base/message_pump_glib.h"
+ #endif
+@@ -119,7 +119,7 @@
+ if (type_ == TYPE_UI) {
+ #if defined(OS_MACOSX)
+ pump_ = base::MessagePumpMac::Create();
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_BSD)
+ pump_ = new base::MessagePumpForUI();
+ #endif // OS_LINUX
+ } else if (type_ == TYPE_IO) {
+$NetBSD: patch-ipc_chromium_src_base_platform__thread.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/base/platform_thread.h.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/chromium/src/base/platform_thread.h
+@@ -22,9 +22,11 @@ typedef void* PlatformThreadHandle; // HANDLE
+ #elif defined(OS_POSIX)
+ #include <pthread.h>
+ typedef pthread_t PlatformThreadHandle;
+-#if defined(OS_LINUX)
++#if defined(OS_LINUX) || defined(OS_OPENBSD)
+ #include <unistd.h>
+ typedef pid_t PlatformThreadId;
++#elif defined(OS_BSD)
++typedef lwpid_t PlatformThreadId;
+ #elif defined(OS_MACOSX)
+ #include <mach/mach.h>
+ typedef mach_port_t PlatformThreadId;
+$NetBSD: patch-ipc_chromium_src_base_platform__thread__posix.cc,v 1.4 2012/04/01 15:18:45 ryoon Exp $
+
+--- ipc/chromium/src/base/platform_thread_posix.cc.orig 2012-03-13 01:36:53.000000000 +0000
++++ ipc/chromium/src/base/platform_thread_posix.cc
+@@ -9,9 +9,23 @@
+
+ #if defined(OS_MACOSX)
+ #include <mach/mach.h>
++#elif defined(OS_NETBSD)
++#include <lwp.h>
+ #elif defined(OS_LINUX)
+ #include <sys/syscall.h>
+ #include <unistd.h>
++#elif defined(OS_DRAGONFLY)
++#include <unistd.h>
++#elif defined(OS_FREEBSD)
++#include <sys/param.h>
++#if __FreeBSD_version > 802500
++#include <sys/thr.h>
++#else
++_Pragma("GCC visibility push(default)")
++extern "C" int thr_self(long *);
++_Pragma("GCC visibility pop")
++#endif
++#include <pthread_np.h>
+ #endif
+
+ #if defined(OS_MACOSX)
+@@ -38,9 +45,20 @@
+ // into the kernel.
+ #if defined(OS_MACOSX)
+ return mach_thread_self();
+-#elif defined (__OpenBSD__)
++#elif defined(OS_NETBSD)
++ return _lwp_self();
++#elif defined(OS_DRAGONFLY)
++ return lwp_gettid();
++#elif defined(OS_FREEBSD)
++# if __FreeBSD_version > 900030
++ return pthread_getthreadid_np();
++# else
++ long lwpid;
++ thr_self(&lwpid);
++ return lwpid;
++# endif
++#elif defined(OS_OPENBSD)
+- // TODO(BSD): find a better thread ID
+- return (intptr_t)(pthread_self());
++ return (intptr_t) (pthread_self());
+ #elif defined(OS_LINUX)
+ return syscall(__NR_gettid);
+ #endif
+$NetBSD: patch-ipc_chromium_src_base_process__util.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/base/process_util.h.orig 2011-12-21 00:28:19.000000000 +0100
++++ ipc/chromium/src/base/process_util.h 2012-01-31 13:14:54.000000000 +0100
+@@ -280,6 +280,7 @@ class NamedProcessIterator {
+ const ProcessEntry* NextProcessEntry();
+
+ private:
++#if !defined(OS_BSD)
+ // Determines whether there's another process (regardless of executable)
+ // left in the list of all processes. Returns true and sets entry_ to
+ // that process's info if there is one, false otherwise.
+@@ -292,18 +292,24 @@
+ void InitProcessEntry(ProcessEntry* entry);
+
+ std::wstring executable_name_;
++#endif
+
+ #if defined(OS_WIN)
+ HANDLE snapshot_;
+ bool started_iteration_;
+ #elif defined(OS_LINUX)
+ DIR *procfs_dir_;
++#elif defined(OS_BSD)
++ std::vector<ProcessEntry> content;
++ size_t nextEntry;
+ #elif defined(OS_MACOSX)
+ std::vector<kinfo_proc> kinfo_procs_;
+ size_t index_of_kinfo_proc_;
+ #endif
++#if !defined(OS_BSD)
+ ProcessEntry entry_;
+ const ProcessFilter* filter_;
++#endif
+
+ DISALLOW_EVIL_CONSTRUCTORS(NamedProcessIterator);
+ };
+$NetBSD: patch-ipc_chromium_src_base_process__util__bsd.cc,v 1.4 2012/04/01 15:18:45 ryoon Exp $
+
+--- ipc/chromium/src/base/process_util_bsd.cc.orig 2012-04-01 00:04:28.000000000 +0000
++++ ipc/chromium/src/base/process_util_bsd.cc
+@@ -0,0 +1,318 @@
++// Copyright (c) 2008 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++// derived from process_util_linux.cc and process_util_mac.cc
++
++#include "base/process_util.h"
++
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <sys/wait.h>
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
++#include <sys/user.h>
++#endif
++
++#include <ctype.h>
++#include <fcntl.h>
++#include <kvm.h>
++#include <unistd.h>
++
++#include <string>
++
++#include "base/debug_util.h"
++#include "base/eintr_wrapper.h"
++#include "base/file_util.h"
++#include "base/logging.h"
++#include "base/string_tokenizer.h"
++#include "base/string_util.h"
++
++#if (defined(_POSIX_SPAWN) && _POSIX_SPAWN > 0) \
++ || (defined(OS_NETBSD) && __NetBSD_Version__ >= 599006500)
++#define HAVE_POSIX_SPAWN 1
++#endif
++
++#ifndef __dso_public
++# ifdef __exported
++# define __dso_public __exported
++# else
++# define __dso_public __attribute__((__visibility__("default")))
++# endif
++#endif
++
++#ifdef HAVE_POSIX_SPAWN
++#include <spawn.h>
++extern "C" char **environ __dso_public;
++#endif
++
++namespace {
++
++enum ParsingState {
++ KEY_NAME,
++ KEY_VALUE
++};
++
++static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG");
++
++} // namespace
++
++namespace base {
++
++#ifdef HAVE_POSIX_SPAWN
++
++void FreeEnvVarsArray(char* array[], int length)
++{
++ for (int i = 0; i < length; i++) {
++ free(array[i]);
++ }
++ delete[] array;
++}
++
++bool LaunchApp(const std::vector<std::string>& argv,
++ const file_handle_mapping_vector& fds_to_remap,
++ bool wait, ProcessHandle* process_handle) {
++ return LaunchApp(argv, fds_to_remap, environment_map(),
++ wait, process_handle);
++}
++
++bool LaunchApp(const std::vector<std::string>& argv,
++ const file_handle_mapping_vector& fds_to_remap,
++ const environment_map& env_vars_to_set,
++ bool wait, ProcessHandle* process_handle,
++ ProcessArchitecture arch) {
++ bool retval = true;
++
++ char* argv_copy[argv.size() + 1];
++ for (size_t i = 0; i < argv.size(); i++) {
++ argv_copy[i] = const_cast<char*>(argv[i].c_str());
++ }
++ argv_copy[argv.size()] = NULL;
++
++ // Make sure we don't leak any FDs to the child process by marking all FDs
++ // as close-on-exec.
++ SetAllFDsToCloseOnExec();
++
++ // Copy environment to a new char array and add the variables
++ // in env_vars_to_set.
++ // Existing variables are overwritten by env_vars_to_set.
++ int pos = 0;
++ environment_map combined_env_vars = env_vars_to_set;
++ while(environ[pos] != NULL) {
++ std::string varString = environ[pos];
++ std::string varName = varString.substr(0, varString.find_first_of('='));
++ std::string varValue = varString.substr(varString.find_first_of('=') + 1);
++ if (combined_env_vars.find(varName) == combined_env_vars.end()) {
++ combined_env_vars[varName] = varValue;
++ }
++ pos++;
++ }
++ int varsLen = combined_env_vars.size() + 1;
++
++ char** vars = new char*[varsLen];
++ int i = 0;
++ for (environment_map::const_iterator it = combined_env_vars.begin();
++ it != combined_env_vars.end(); ++it) {
++ std::string entry(it->first);
++ entry += "=";
++ entry += it->second;
++ vars[i] = strdup(entry.c_str());
++ i++;
++ }
++ vars[i] = NULL;
++
++ posix_spawn_file_actions_t file_actions;
++ if (posix_spawn_file_actions_init(&file_actions) != 0) {
++ FreeEnvVarsArray(vars, varsLen);
++ return false;
++ }
++
++ // Turn fds_to_remap array into a set of dup2 calls.
++ for (file_handle_mapping_vector::const_iterator it = fds_to_remap.begin();
++ it != fds_to_remap.end();
++ ++it) {
++ int src_fd = it->first;
++ int dest_fd = it->second;
++
++ if (src_fd == dest_fd) {
++ int flags = fcntl(src_fd, F_GETFD);
++ if (flags != -1) {
++ fcntl(src_fd, F_SETFD, flags & ~FD_CLOEXEC);
++ }
++ } else {
++ if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 0) {
++ posix_spawn_file_actions_destroy(&file_actions);
++ FreeEnvVarsArray(vars, varsLen);
++ return false;
++ }
++ }
++ }
++
++ pid_t pid = 0;
++ int spawn_succeeded = (posix_spawnp(&pid,
++ argv_copy[0],
++ &file_actions,
++ NULL,
++ argv_copy,
++ vars) == 0);
++
++ FreeEnvVarsArray(vars, varsLen);
++
++ posix_spawn_file_actions_destroy(&file_actions);
++
++ bool process_handle_valid = pid > 0;
++ if (!spawn_succeeded || !process_handle_valid) {
++ retval = false;
++ } else {
++ if (wait)
++ HANDLE_EINTR(waitpid(pid, 0, 0));
++
++ if (process_handle)
++ *process_handle = pid;
++ }
++
++ return retval;
++}
++
++bool LaunchApp(const CommandLine& cl,
++ bool wait, bool start_hidden, ProcessHandle* process_handle) {
++ // TODO(playmobil): Do we need to respect the start_hidden flag?
++ file_handle_mapping_vector no_files;
++ return LaunchApp(cl.argv(), no_files, wait, process_handle);
++}
++
++#else // no posix_spawn, use fork/exec
++
++bool LaunchApp(const std::vector<std::string>& argv,
++ const file_handle_mapping_vector& fds_to_remap,
++ bool wait, ProcessHandle* process_handle) {
++ return LaunchApp(argv, fds_to_remap, environment_map(),
++ wait, process_handle);
++}
++
++bool LaunchApp(const std::vector<std::string>& argv,
++ const file_handle_mapping_vector& fds_to_remap,
++ const environment_map& env_vars_to_set,
++ bool wait, ProcessHandle* process_handle,
++ ProcessArchitecture arch) {
++ scoped_array<char*> argv_cstr(new char*[argv.size() + 1]);
++ // Illegal to allocate memory after fork and before execvp
++ InjectiveMultimap fd_shuffle1, fd_shuffle2;
++ fd_shuffle1.reserve(fds_to_remap.size());
++ fd_shuffle2.reserve(fds_to_remap.size());
++
++ pid_t pid = fork();
++ if (pid < 0)
++ return false;
++
++ if (pid == 0) {
++ for (file_handle_mapping_vector::const_iterator
++ it = fds_to_remap.begin(); it != fds_to_remap.end(); ++it) {
++ fd_shuffle1.push_back(InjectionArc(it->first, it->second, false));
++ fd_shuffle2.push_back(InjectionArc(it->first, it->second, false));
++ }
++
++ if (!ShuffleFileDescriptors(&fd_shuffle1))
++ _exit(127);
++
++ CloseSuperfluousFds(fd_shuffle2);
++
++ for (environment_map::const_iterator it = env_vars_to_set.begin();
++ it != env_vars_to_set.end(); ++it) {
++ if (setenv(it->first.c_str(), it->second.c_str(), 1/*overwrite*/))
++ _exit(127);
++ }
++
++ for (size_t i = 0; i < argv.size(); i++)
++ argv_cstr[i] = const_cast<char*>(argv[i].c_str());
++ argv_cstr[argv.size()] = NULL;
++ execvp(argv_cstr[0], argv_cstr.get());
++ // if we get here, we're in serious trouble and should complain loudly
++ DLOG(ERROR) << "FAILED TO exec() CHILD PROCESS, path: " << argv_cstr[0];
++ exit(127);
++ } else {
++ gProcessLog.print("==> process %d launched child process %d\n",
++ GetCurrentProcId(), pid);
++ if (wait)
++ HANDLE_EINTR(waitpid(pid, 0, 0));
++
++ if (process_handle)
++ *process_handle = pid;
++ }
++
++ return true;
++}
++
++bool LaunchApp(const CommandLine& cl,
++ bool wait, bool start_hidden,
++ ProcessHandle* process_handle) {
++ file_handle_mapping_vector no_files;
++ return LaunchApp(cl.argv(), no_files, wait, process_handle);
++}
++
++#endif
++
++NamedProcessIterator::NamedProcessIterator(const std::wstring& executable_name,
++ const ProcessFilter* filter)
++{
++ int numEntries;
++ kvm_t *kvm;
++ std::string exe(WideToASCII(executable_name));
++
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD)
++ kvm = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL);
++ struct kinfo_proc* procs = kvm_getprocs(kvm, KERN_PROC_UID, getuid(), &numEntries);
++ if (procs != NULL && numEntries > 0) {
++ for (int i = 0; i < numEntries; i++) {
++# if defined(OS_DRAGONFLY)
++ if (exe != procs[i].kp_comm) continue;
++ if (filter && !filter->Includes(procs[i].kp_pid, procs[i].kp_ppid)) continue;
++ ProcessEntry e;
++ e.pid = procs[i].kp_pid;
++ e.ppid = procs[i].kp_ppid;
++ strlcpy(e.szExeFile, procs[i].kp_comm, sizeof e.szExeFile);
++ content.push_back(e);
++# elif defined(OS_FREEBSD)
++ if (exe != procs[i].ki_comm) continue;
++ if (filter && !filter->Includes(procs[i].ki_pid, procs[i].ki_ppid)) continue;
++ ProcessEntry e;
++ e.pid = procs[i].ki_pid;
++ e.ppid = procs[i].ki_ppid;
++ strlcpy(e.szExeFile, procs[i].ki_comm, sizeof e.szExeFile);
++ content.push_back(e);
++# endif
++#else
++ kvm = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, NULL);
++#if defined(OS_OPENBSD)
++ struct kinfo_proc* procs = kvm_getprocs(kvm, KERN_PROC_UID, getuid(), sizeof(struct kinfo_proc), &numEntries);
++#else
++ struct kinfo_proc2* procs = kvm_getproc2(kvm, KERN_PROC_UID, getuid(), sizeof(struct kinfo_proc2), &numEntries);
++#endif
++ if (procs != NULL && numEntries > 0) {
++ for (int i = 0; i < numEntries; i++) {
++ if (exe != procs[i].p_comm) continue;
++ if (filter && !filter->Includes(procs[i].p_pid, procs[i].p_ppid)) continue;
++ ProcessEntry e;
++ e.pid = procs[i].p_pid;
++ e.ppid = procs[i].p_ppid;
++ strlcpy(e.szExeFile, procs[i].p_comm, sizeof e.szExeFile);
++ content.push_back(e);
++#endif
++ }
++ }
++ nextEntry = 0;
++ kvm_close(kvm);
++}
++
++NamedProcessIterator::~NamedProcessIterator() {
++}
++
++const ProcessEntry* NamedProcessIterator::NextProcessEntry() {
++ if (nextEntry >= content.size()) return NULL;
++ return &content[nextEntry++];
++}
++
++bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
++ return false;
++}
++
++} // namespace base
+$NetBSD: patch-ipc_chromium_src_base_process__util__posix.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/base/process_util_posix.cc.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/chromium/src/base/process_util_posix.cc
+@@ -116,6 +116,11 @@ void CloseSuperfluousFds(const base::Inj
+ #elif defined(OS_MACOSX)
+ static const rlim_t kSystemDefaultMaxFds = 256;
+ static const char kFDDir[] = "/dev/fd";
++#elif defined(OS_BSD)
++ // the getrlimit below should never fail, so whatever ..
++ static const rlim_t kSystemDefaultMaxFds = 1024;
++ // at least /dev/fd will exist
++ static const char kFDDir[] = "/dev/fd";
+ #endif
+
+ // Get the maximum number of FDs possible.
+@@ -199,7 +204,7 @@ void CloseSuperfluousFds(const base::Inj
+ void SetAllFDsToCloseOnExec() {
+ #if defined(OS_LINUX)
+ const char fd_dir[] = "/proc/self/fd";
+-#elif defined(OS_MACOSX)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
+ const char fd_dir[] = "/dev/fd";
+ #endif
+ ScopedDIR dir_closer(opendir(fd_dir));
+$NetBSD: patch-ipc_chromium_src_base_sys__info__posix.cc,v 1.2 2011/11/27 13:09:00 tnn Exp $
+
+--- ipc/chromium/src/base/sys_info_posix.cc.orig 2011-11-04 21:34:00.000000000 +0000
++++ ipc/chromium/src/base/sys_info_posix.cc
+@@ -18,6 +18,11 @@
+ #include <mach/mach_init.h>
+ #endif
+
++#if defined(OS_NETBSD)
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#endif
++
+ #include "base/logging.h"
+ #include "base/string_util.h"
+
+@@ -26,7 +31,11 @@ namespace base {
+ int SysInfo::NumberOfProcessors() {
+ // It seems that sysconf returns the number of "logical" processors on both
+ // mac and linux. So we get the number of "online logical" processors.
++#ifdef _SC_NPROCESSORS_ONLN
+ static long res = sysconf(_SC_NPROCESSORS_ONLN);
++#else
++ static long res = 1;
++#endif
+ if (res == -1) {
+ NOTREACHED();
+ return 1;
+@@ -52,6 +61,20 @@ int64 SysInfo::AmountOfPhysicalMemory()
+ }
+
+ return static_cast<int64>(hostinfo.max_mem);
++#elif defined(OS_NETBSD)
++ int mib[2];
++ int rc;
++ int64_t memSize;
++ size_t len = sizeof(memSize);
++
++ mib[0] = CTL_HW;
++ mib[1] = HW_PHYSMEM64;
++ rc = sysctl( mib, 2, &memSize, &len, NULL, 0 );
++ if (-1 != rc) {
++ return memSize;
++ }
++ return 0;
++
+ #else
+ long pages = sysconf(_SC_PHYS_PAGES);
+ long page_size = sysconf(_SC_PAGE_SIZE);
+$NetBSD: patch-ipc_chromium_src_base_third__party_nspr_prcpucfg.h,v 1.2 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/base/third_party/nspr/prcpucfg.h.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/chromium/src/base/third_party/nspr/prcpucfg.h
+@@ -34,7 +34,7 @@
+ #include "base/third_party/nspr/prcpucfg_win.h"
+ #elif defined(__APPLE__)
+ #include "base/third_party/nspr/prcpucfg_mac.h"
+-#elif defined(__linux__) || defined(ANDROID)
++#elif defined(__linux__) || defined(ANDROID) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+ #include "base/third_party/nspr/prcpucfg_linux.h"
+ #elif defined(__OpenBSD__)
+ #include "base/third_party/nspr/prcpucfg_openbsd.h"
+$NetBSD: patch-ipc_chromium_src_base_third__party_nspr_prtime.cc,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/base/third_party/nspr/prtime.cc.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/chromium/src/base/third_party/nspr/prtime.cc
+@@ -212,7 +212,7 @@ PR_ImplodeTime(const PRExplodedTime *exp
+ LL_ADD(retVal, retVal, temp);
+
+ return retVal;
+-#elif defined(OS_LINUX)
++#elif defined(OS_LINUX) || defined(OS_DRAGONFLY)
+ struct tm exp_tm = {0};
+ exp_tm.tm_sec = exploded->tm_sec;
+ exp_tm.tm_min = exploded->tm_min;
+@@ -245,6 +245,24 @@ PR_ImplodeTime(const PRExplodedTime *exp
+ result *= kSecondsToMicroseconds;
+ result += exploded->tm_usec;
+ return result;
++#elif defined(OS_FREEBSD) || defined(OS_NETBSD)
++ struct tm exp_tm = {0};
++ exp_tm.tm_sec = exploded->tm_sec;
++ exp_tm.tm_min = exploded->tm_min;
++ exp_tm.tm_hour = exploded->tm_hour;
++ exp_tm.tm_mday = exploded->tm_mday;
++ exp_tm.tm_mon = exploded->tm_month;
++ exp_tm.tm_year = exploded->tm_year - 1900;
++
++ // time_t is 64bit
++ time_t absolute_time = timegm(&exp_tm);
++
++ PRTime result = static_cast<PRTime>(absolute_time);
++ result -= exploded->tm_params.tp_gmt_offset +
++ exploded->tm_params.tp_dst_offset;
++ result *= kSecondsToMicroseconds;
++ result += exploded->tm_usec;
++ return result;
+ #else
+ #error No PR_ImplodeTime implemented on your platform.
+ #endif
+diff --git ipc/chromium/src/base/time_posix.cc ipc/chromium/src/base/time_posix.cc
+index abf2a56..48791f6 100644
+--- ipc/chromium/src/base/time_posix.cc
++++ ipc/chromium/src/base/time_posix.cc
+@@ -167,7 +167,7 @@ TimeTicks TimeTicks::Now() {
+ // With numer and denom = 1 (the expected case), the 64-bit absolute time
+ // reported in nanoseconds is enough to last nearly 585 years.
+
+-#elif defined(__OpenBSD__) || defined(OS_POSIX) && \
++#elif defined(OS_OPENBSD) || defined(OS_POSIX) && \
+ defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0
+
+ struct timespec ts;
+$NetBSD: patch-ipc_chromium_src_build_build__config.h,v 1.4 2012/04/01 15:18:45 ryoon Exp $
+
+--- ipc/chromium/src/build/build_config.h.orig 2012-03-13 01:36:53.000000000 +0000
++++ ipc/chromium/src/build/build_config.h
+@@ -19,6 +19,12 @@
+ #define OS_MACOSX 1
+ #elif defined(__linux__) || defined(ANDROID)
+ #define OS_LINUX 1
++#elif defined(__DragonFly__)
++#define OS_DRAGONFLY 1
++#elif defined(__FreeBSD__)
++#define OS_FREEBSD 1
++#elif defined(__NetBSD__)
++#define OS_NETBSD 1
+ #elif defined(__OpenBSD__)
+ #define OS_OPENBSD 1
+ #elif defined(_WIN32)
+@@ -27,9 +33,16 @@
+ #error Please add support for your platform in build/build_config.h
+ #endif
+
++// For access to standard BSD features, use OS_BSD instead of a
++// more specific macro.
++#if defined(OS_DRAGONFLY) || defined(OS_FREEBSD) \
++ || defined(OS_NETBSD) || defined(OS_OPENBSD)
++#define OS_BSD 1
++#endif
++
+ // For access to standard POSIX features, use OS_POSIX instead of a more
+ // specific macro.
+-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_OPENBSD)
++#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD)
+ #define OS_POSIX 1
+ #endif
+
+diff --git ipc/chromium/src/chrome/common/ipc_channel_posix.cc ipc/chromium/src/chrome/common/ipc_channel_posix.cc
+index bd866ee..2ea5b19 100644
+--- ipc/chromium/src/chrome/common/ipc_channel_posix.cc
++++ ipc/chromium/src/chrome/common/ipc_channel_posix.cc
+@@ -7,6 +7,7 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <stddef.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+$NetBSD: patch-ipc_chromium_src_chrome_common_ipc__channel__posix.h,v 1.1 2011/07/11 12:46:14 tnn Exp $
+
+--- ipc/chromium/src/chrome/common/ipc_channel_posix.h.orig 2011-06-15 21:57:27.000000000 +0000
++++ ipc/chromium/src/chrome/common/ipc_channel_posix.h
+@@ -92,7 +92,7 @@ class Channel::ChannelImpl : public Mess
+ };
+
+ // This is a control message buffer large enough to hold kMaxReadFDs
+-#if defined(OS_MACOSX)
++#if defined(OS_MACOSX) || defined(OS_NETBSD)
+ // TODO(agl): OSX appears to have non-constant CMSG macros!
+ char input_cmsg_buf_[1024];
+ #else
+$NetBSD: patch-ipc_chromium_src_chrome_common_ipc__message__utils.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/chrome/common/ipc_message_utils.h.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/chromium/src/chrome/common/ipc_message_utils.h
+@@ -195,7 +195,7 @@
+ };
+ #endif
+
+-#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || (defined(OS_LINUX) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
++#if !(defined(OS_MACOSX) || defined(OS_OPENBSD) || defined(OS_WIN) || ((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS)) || defined(ARCH_CPU_S390))
+ // There size_t is a synonym for |unsigned long| ...
+ template <>
+ struct ParamTraits<size_t> {
+@@ -248,7 +248,7 @@
+ };
+ #endif // defined(OS_MACOSX)
+
+-#if !(defined(OS_LINUX) && defined(ARCH_CPU_64_BITS))
++#if !((defined(OS_BSD) || defined(OS_LINUX)) && defined(ARCH_CPU_64_BITS))
+ // int64 is |long int| on 64-bit systems, uint64 is |unsigned long|
+ template <>
+ struct ParamTraits<int64> {
+$NetBSD: patch-ipc_chromium_src_chrome_common_transport__dib.h,v 1.1 2012/03/06 12:34:09 ryoon Exp $
+
+--- ipc/chromium/src/chrome/common/transport_dib.h.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/chromium/src/chrome/common/transport_dib.h
+@@ -7,7 +7,7 @@
+
+ #include "base/basictypes.h"
+
+-#if defined(OS_WIN) || defined(OS_MACOSX)
++#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
+ #include "base/shared_memory.h"
+ #endif
+
+@@ -66,7 +66,7 @@ class TransportDIB {
+ uint32 sequence_num;
+ };
+ typedef HandleAndSequenceNum Id;
+-#elif defined(OS_MACOSX)
++#elif defined(OS_MACOSX) || defined(OS_BSD)
+ typedef base::SharedMemoryHandle Handle;
+ // On Mac, the inode number of the backing file is used as an id.
+ typedef base::SharedMemoryId Id;
+@@ -108,7 +108,7 @@ class TransportDIB {
+
+ private:
+ TransportDIB();
+-#if defined(OS_WIN) || defined(OS_MACOSX)
++#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
+ explicit TransportDIB(base::SharedMemoryHandle dib);
+ base::SharedMemory shared_memory_;
+ uint32 sequence_num_;
+$NetBSD: patch-ipc_glue_GeckoChildProcessHost.cpp,v 1.2 2012/03/15 08:30:06 ryoon Exp $
+
+--- ipc/glue/GeckoChildProcessHost.cpp.orig 2011-12-20 23:28:19.000000000 +0000
++++ ipc/glue/GeckoChildProcessHost.cpp
+@@ -430,7 +430,7 @@
+ // and passing wstrings from one config to the other is unsafe. So
+ // we split the logic here.
+
+-#if defined(OS_LINUX) || defined(OS_MACOSX)
++#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
+ base::environment_map newEnvVars;
+ // XPCOM may not be initialized in some subprocesses. We don't want
+ // to initialize XPCOM just for the directory service, especially
+@@ -445,8 +445,8 @@
+ if (NS_SUCCEEDED(rv)) {
+ nsCString path;
+ greDir->GetNativePath(path);
+-# ifdef OS_LINUX
+-# ifdef ANDROID
++# if defined(OS_LINUX) || defined(OS_BSD)
++# if defined(ANDROID) || defined(OS_BSD)
+ path += "/lib";
+ # endif // ANDROID
+ const char *ld_library_path = PR_GetEnv("LD_LIBRARY_PATH");
+@@ -557,7 +557,7 @@
+ childArgv.push_back(pidstring);
+
+ #if defined(MOZ_CRASHREPORTER)
+-# if defined(OS_LINUX)
++# if defined(OS_LINUX) || defined(OS_BSD)
+ int childCrashFd, childCrashRemapFd;
+ if (!CrashReporter::CreateNotificationPipeForChild(
+ &childCrashFd, &childCrashRemapFd))
+@@ -594,7 +594,7 @@
+ #endif
+
+ base::LaunchApp(childArgv, mFileMap,
+-#if defined(OS_LINUX) || defined(OS_MACOSX)
++#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD)
+ newEnvVars,
+ #endif
+ false, &process, arch);
+diff --git ipc/glue/SharedMemorySysV.h ipc/glue/SharedMemorySysV.h
+index f37998d..b05dc7b 100644
+--- ipc/glue/SharedMemorySysV.h
++++ ipc/glue/SharedMemorySysV.h
+@@ -8,7 +8,7 @@
+ #ifndef mozilla_ipc_SharedMemorySysV_h
+ #define mozilla_ipc_SharedMemorySysV_h
+
+-#if defined(OS_LINUX) && !defined(ANDROID)
++#if (defined(OS_LINUX) && !defined(ANDROID)) || defined(OS_BSD)
+
+ // SysV shared memory isn't available on Windows, but we define the
+ // following macro so that #ifdefs are clearer (compared to #ifdef
+$NetBSD: patch-mm,v 1.13 2012/06/05 18:09:21 ryoon Exp $
+
+--- toolkit/library/Makefile.in.orig 2012-05-23 18:57:09.000000000 +0000
++++ toolkit/library/Makefile.in
+@@ -534,6 +538,12 @@ EXTRA_DSO_LDOPTS += -lelf -ldemangle
+ endif
+ endif
+
++ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_ARCH)))
++OS_LIBS += $(call EXPAND_LIBNAME,kvm)
++# keep `environ' unresolved, see bug 14426 for binutils
++EXTRA_DSO_LDOPTS += -Wl,--warn-unresolved-symbols
++endif
++
+ ifeq ($(OS_ARCH),WINNT)
+ OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 version winspool comdlg32 imm32 msimg32 shlwapi psapi ws2_32 dbghelp rasapi32 rasdlg iphlpapi uxtheme setupapi secur32 sensorsapi portabledeviceguids windowscodecs wininet)
+ ifdef ACCESSIBILITY
diff --git a/www/libxul/files/patch-bug761077 b/www/libxul/files/patch-bug761077
index fb12c5b15021..922fa55131e8 100644
--- a/www/libxul/files/patch-bug761077
+++ b/www/libxul/files/patch-bug761077
@@ -28,15 +28,6 @@ diff --git xpcom/reflect/xptcall/src/md/unix/Makefile.in xpcom/reflect/xptcall/s
index ae6ed66..2783957 100644
--- xpcom/reflect/xptcall/src/md/unix/Makefile.in
+++ xpcom/reflect/xptcall/src/md/unix/Makefile.in
-@@ -85,7 +85,7 @@
- # New code for Linux, et. al., with gcc
- # Migrate other platforms here after testing
- #
--ifneq (,$(filter Linux GNU_%,$(OS_ARCH)))
-+ifneq (,$(filter Linux FreeBSD GNU_%,$(OS_ARCH)))
- # Linux/x86-64
- ifeq (x86_64,$(OS_TEST))
- CPPSRCS := xptcinvoke_x86_64_unix.cpp xptcstubs_x86_64_linux.cpp
@@ -70,7 +70,7 @@ endif
endif
endif
@@ -46,20 +37,7 @@ index ae6ed66..2783957 100644
ifneq (,$(findstring ia64,$(OS_TEST)))
CPPSRCS := xptcinvoke_ipf64.cpp xptcstubs_ipf64.cpp
ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s
-@@ -109,12 +109,6 @@ ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDx86_64
- CPPSRCS := xptcinvoke_amd64_openbsd.cpp xptcstubs_amd64_openbsd.cpp
- endif
- #
--# FreeBSD/amd64
--#
--ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDx86_64)
--CPPSRCS := xptcinvoke_amd64_linux.cpp xptcstubs_amd64_linux.cpp
--endif
--#
- # BeOS/Intel (uses the same unixish_x86 code)
- #
- ifeq ($(OS_ARCH)$(OS_TEST),BeOSBePC)
-@@ -341,7 +356,7 @@
+@@ -269,7 +269,7 @@ endif
#
# Linux/PPC
#
@@ -68,7 +46,7 @@ index ae6ed66..2783957 100644
CPPSRCS := xptcinvoke_ppc_linux.cpp xptcstubs_ppc_linux.cpp
ASFILES := xptcinvoke_asm_ppc_linux.s xptcstubs_asm_ppc_linux.s
AS := $(CC) -c -x assembler-with-cpp
-@@ -350,7 +365,7 @@
+@@ -278,7 +278,7 @@ endif
#
# Linux/PPC64
#
diff --git a/www/libxul/files/patch-bug778056 b/www/libxul/files/patch-bug778056
new file mode 100644
index 000000000000..2730ffbfc594
--- /dev/null
+++ b/www/libxul/files/patch-bug778056
@@ -0,0 +1,21 @@
+--- memory/mozalloc/mozalloc.cpp~
++++ memory/mozalloc/mozalloc.cpp
+@@ -52,6 +52,9 @@
+ #if defined(XP_UNIX)
+ # include <unistd.h> // for valloc on *BSD
+ #endif //if defined(XP_UNIX)
++#ifdef __FreeBSD__
++# include <malloc_np.h> // for malloc_usable_size
++#endif
+
+ #if defined(MOZ_MEMORY)
+ // jemalloc.h doesn't redeclare symbols if they're provided by the OS
+@@ -259,7 +262,7 @@ moz_malloc_usable_size(void *ptr)
+
+ #if defined(XP_MACOSX)
+ return malloc_size(ptr);
+-#elif defined(MOZ_MEMORY)
++#elif defined(MOZ_MEMORY) || defined(__FreeBSD__)
+ return malloc_usable_size(ptr);
+ #elif defined(XP_WIN)
+ return _msize(ptr);
diff --git a/www/libxul/files/patch-bug778078 b/www/libxul/files/patch-bug778078
index c3d42c391a98..a68f07ab34ed 100644
--- a/www/libxul/files/patch-bug778078
+++ b/www/libxul/files/patch-bug778078
@@ -1,7 +1,7 @@
--- toolkit/xre/nsAppRunner.cpp~
+++ toolkit/xre/nsAppRunner.cpp
-@@ -3046,7 +3046,7 @@ XRE_main(int argc, char* argv[], const n
- QApplication app(gArgc, gArgv);
+@@ -3133,7 +3133,7 @@ XRE_main(int argc, char* argv[], const n
+ gQtOnlyArgv[gQtOnlyArgc] = nsnull;
#endif
#if defined(MOZ_WIDGET_GTK2)
-#ifdef MOZ_MEMORY
diff --git a/www/libxul/files/patch-bug779847 b/www/libxul/files/patch-bug779847
new file mode 100644
index 000000000000..f431c4a8d3c5
--- /dev/null
+++ b/www/libxul/files/patch-bug779847
@@ -0,0 +1,28 @@
+--- gfx/ycbcr/Makefile.in
++++ gfx/ycbcr/Makefile.in
+@@ -54,23 +54,13 @@ CPPSRCS += yuv_row_win.cpp \
+ $(NULL)
+ endif
+ else
+-ifeq ($(OS_ARCH),Linux)
+-CPPSRCS += yuv_row_posix.cpp \
+- $(NULL)
+-else
+-ifeq ($(OS_ARCH),SunOS)
+-CPPSRCS += yuv_row_posix.cpp \
+- $(NULL)
+-else
+-ifeq ($(OS_ARCH),Darwin)
++ifneq (,$(filter Linux SunOS Darwin DragonFly FreeBSD NetBSD OpenBSD, $(OS_ARCH)))
+ CPPSRCS += yuv_row_posix.cpp \
+ $(NULL)
+ else
+ CPPSRCS += yuv_row_other.cpp \
+ $(NULL)
+-endif # Darwin
+-endif # SunOS
+-endif # linux
++endif # posix
+ endif # windows
+
+ ifeq (arm,$(findstring arm,$(OS_TEST)))
diff --git a/www/libxul/files/patch-bug781457 b/www/libxul/files/patch-bug781457
index 8a790ccf84a9..8cf3cfb70c14 100644
--- a/www/libxul/files/patch-bug781457
+++ b/www/libxul/files/patch-bug781457
@@ -1,5 +1,5 @@
---- xpcom/base/nsStackWalk.cpp.orig 2012-05-29 00:57:31.000000000 +0200
-+++ xpcom/base/nsStackWalk.cpp 2012-06-03 12:33:40.000000000 +0200
+--- xpcom/base/nsStackWalk.cpp.orig 2010-12-15 02:03:41.000000000 +0100
++++ xpcom/base/nsStackWalk.cpp 2010-12-15 11:28:20.000000000 +0100
@@ -1123,6 +1123,7 @@ NS_StackWalk(NS_WalkStackCallback aCallb
#elif defined(HAVE__UNWIND_BACKTRACE)
diff --git a/www/libxul/files/patch-bug783463 b/www/libxul/files/patch-bug783463
new file mode 100644
index 000000000000..56ec54b3fcc3
--- /dev/null
+++ b/www/libxul/files/patch-bug783463
@@ -0,0 +1,20 @@
+--- widget/src/qt/nsNativeThemeQt.cpp~
++++ widget/src/qt/nsNativeThemeQt.cpp
+@@ -25,7 +25,6 @@
+ #include "nsThemeConstants.h"
+ #include "nsIServiceManager.h"
+ #include "nsIDOMHTMLInputElement.h"
+-#include <malloc.h>
+
+
+ #include "gfxASurface.h"
+--- widget/src/qt/nsSound.cpp~
++++ widget/src/qt/nsSound.cpp
+@@ -40,6 +40,7 @@
+ #include <QSound>
+
+ #include <string.h>
++#include <unistd.h>
+
+ #include "nscore.h"
+ #include "plstr.h"
diff --git a/www/libxul/files/patch-bug784776 b/www/libxul/files/patch-bug784776
new file mode 100644
index 000000000000..2036b3d441e3
--- /dev/null
+++ b/www/libxul/files/patch-bug784776
@@ -0,0 +1,22 @@
+--- intl/locale/src/unix/nsDateTimeFormatUnix.cpp~
++++ intl/locale/src/unix/nsDateTimeFormatUnix.cpp
+@@ -100,7 +100,7 @@ void nsDateTimeFormatUnix::LocalePreferr
+ struct tm *tmc;
+ int i;
+
+- tt = time((time_t)NULL);
++ tt = time(NULL);
+ tmc = localtime(&tt);
+
+ tmc->tm_hour=22; // put the test sample hour to 22:00 which is 10PM
+--- xpcom/glue/nsBaseHashtable.h~
++++ xpcom/glue/nsBaseHashtable.h
+@@ -147,7 +147,7 @@ public:
+ {
+ EntryType* ent = this->GetEntry(aKey);
+ if (!ent)
+- return NULL;
++ return 0;
+
+ return ent->mData;
+ }
diff --git a/www/libxul/files/patch-bug785638 b/www/libxul/files/patch-bug785638
new file mode 100644
index 000000000000..6e1f63d64971
--- /dev/null
+++ b/www/libxul/files/patch-bug785638
@@ -0,0 +1,168 @@
+diff --git configure.in configure.in
+index cef992b..3bd39ca 100644
+--- configure.in
++++ configure.in
+@@ -5353,22 +5353,6 @@ if test -n "$MOZ_VP8" -a -z "$MOZ_NATIVE_LIBVPX"; then
+
+ dnl See if we have assembly on this platform.
+ case "$OS_ARCH:$CPU_ARCH" in
+- Linux:x86)
+- VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
+- VPX_X86_ASM=1
+- ;;
+- Linux:x86_64)
+- VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
+- VPX_X86_ASM=1
+- ;;
+- SunOS:x86)
+- VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
+- VPX_X86_ASM=1
+- ;;
+- SunOS:x86_64)
+- VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
+- VPX_X86_ASM=1
+- ;;
+ Darwin:x86)
+ VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
+ VPX_X86_ASM=1
+@@ -5412,6 +5388,19 @@ if test -n "$MOZ_VP8" -a -z "$MOZ_NATIVE_LIBVPX"; then
+ VPX_ASM_SUFFIX="$ASM_SUFFIX"
+ VPX_ARM_ASM=1
+ fi
++ ;;
++ *:x86)
++ if $CC -E -dM -</dev/null | grep -q __ELF__; then
++ VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
++ VPX_X86_ASM=1
++ fi
++ ;;
++ *:x86_64)
++ if $CC -E -dM -</dev/null | grep -q __ELF__; then
++ VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
++ VPX_X86_ASM=1
++ fi
++ ;;
+ esac
+
+ if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then
+@@ -5843,22 +5832,6 @@ if test -n "$MOZ_LIBJPEG_TURBO"; then
+
+ dnl Do we support libjpeg-turbo on this platform?
+ case "$OS_ARCH:$OS_TEST" in
+- Linux:x86|Linux:i?86)
+- LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
+- LIBJPEG_TURBO_X86_ASM=1
+- ;;
+- Linux:x86_64)
+- LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
+- LIBJPEG_TURBO_X64_ASM=1
+- ;;
+- SunOS:i?86)
+- LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
+- LIBJPEG_TURBO_X86_ASM=1
+- ;;
+- SunOS:x86_64)
+- LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
+- LIBJPEG_TURBO_X64_ASM=1
+- ;;
+ Darwin:i?86)
+ LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
+ LIBJPEG_TURBO_X86_ASM=1
+@@ -5879,6 +5852,18 @@ if test -n "$MOZ_LIBJPEG_TURBO"; then
+ LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon"
+ LIBJPEG_TURBO_ARM_ASM=1
+ ;;
++ *:x86|*:i?86)
++ if $CC -E -dM -</dev/null | grep -q __ELF__; then
++ LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
++ LIBJPEG_TURBO_X86_ASM=1
++ fi
++ ;;
++ *:x86_64)
++ if $CC -E -dM -</dev/null | grep -q __ELF__; then
++ LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
++ LIBJPEG_TURBO_X64_ASM=1
++ fi
++ ;;
+ esac
+
+ fi
+diff --git media/libvpx/update.sh media/libvpx/update.sh
+index 79e0fb1..51956af 100755
+--- media/libvpx/update.sh
++++ media/libvpx/update.sh
+@@ -363,12 +363,12 @@ cp $1/objdir/x86-win32-vs8/vpx_config.h vpx_config_x86-win32-vs8.h
+ # Should be same for all platforms...
+ cp $1/objdir/x86-win32-vs8/vpx_version.h vpx_version.h
+
+-# Config files for x86-linux-gcc and Solaris x86
++# Config files for x86-linux-gcc and other x86 elf platforms
+ cp $1/objdir/x86-linux-gcc/vpx_config.c vpx_config_x86-linux-gcc.c
+ cp $1/objdir/x86-linux-gcc/vpx_config.asm vpx_config_x86-linux-gcc.asm
+ cp $1/objdir/x86-linux-gcc/vpx_config.h vpx_config_x86-linux-gcc.h
+
+-# Config files for x86_64-linux-gcc and Solaris x86_64
++# Config files for x86_64-linux-gcc and other x86_64 elf platforms
+ cp $1/objdir/x86_64-linux-gcc/vpx_config.c vpx_config_x86_64-linux-gcc.c
+ cp $1/objdir/x86_64-linux-gcc/vpx_config.asm vpx_config_x86_64-linux-gcc.asm
+ cp $1/objdir/x86_64-linux-gcc/vpx_config.h vpx_config_x86_64-linux-gcc.h
+diff --git media/libvpx/vpx_config.h media/libvpx/vpx_config.h
+index 55433f3..36e1780 100644
+--- media/libvpx/vpx_config.h
++++ media/libvpx/vpx_config.h
+@@ -16,20 +16,12 @@
+ /* 32 bit MacOS. */
+ #include "vpx_config_x86-darwin9-gcc.h"
+
+-#elif defined(__linux__) && defined(__i386__)
+-/* 32 bit Linux. */
++#elif defined(__ELF__) && (defined(__i386) || defined(__i386__))
++/* 32 bit ELF platforms. */
+ #include "vpx_config_x86-linux-gcc.h"
+
+-#elif defined(__linux__) && defined(__x86_64__)
+-/* 64 bit Linux. */
+-#include "vpx_config_x86_64-linux-gcc.h"
+-
+-#elif defined(__sun) && defined(__i386)
+-/* 32 bit Solaris. */
+-#include "vpx_config_x86-linux-gcc.h"
+-
+-#elif defined(__sun) && defined(__x86_64)
+-/* 64 bit Solaris. */
++#elif defined(__ELF__) && (defined(__x86_64) || defined(__x86_64__))
++/* 64 bit ELF platforms. */
+ #include "vpx_config_x86_64-linux-gcc.h"
+
+ #else
+diff --git media/libvpx/vpx_config_c.c media/libvpx/vpx_config_c.c
+index eedd515..c8b5375 100644
+--- media/libvpx/vpx_config_c.c
++++ media/libvpx/vpx_config_c.c
+@@ -12,22 +12,14 @@
+ /* 32 bit MacOS. */
+ #include "vpx_config_x86-darwin9-gcc.c"
+
+-#elif defined(__linux__) && defined(__i386__)
+-/* 32 bit Linux. */
++#elif defined(__ELF__) && (defined(__i386) || defined(__i386__))
++/* 32 bit ELF platforms. */
+ #include "vpx_config_x86-linux-gcc.c"
+
+-#elif defined(__linux__) && defined(__x86_64__)
+-/* 64 bit Linux. */
++#elif defined(__ELF__) && (defined(__x86_64) || defined(__x86_64__))
++/* 64 bit ELF platforms. */
+ #include "vpx_config_x86_64-linux-gcc.c"
+
+-#elif defined(__sun) && defined(__i386)
+-/* 32 bit Solaris. */
+-#include "vpx_config_x86-linux-gcc.h"
+-
+-#elif defined(__sun) && defined(__x86_64)
+-/* 64 bit Solaris. */
+-#include "vpx_config_x86_64-linux-gcc.h"
+-
+ #elif defined(_MSC_VER) && defined(_M_X64)
+ #include "vpx_config_x86_64-win64-vs8.c"
+
diff --git a/www/libxul/files/patch-bug788039 b/www/libxul/files/patch-bug788039
new file mode 100644
index 000000000000..678f0d493eae
--- /dev/null
+++ b/www/libxul/files/patch-bug788039
@@ -0,0 +1,59 @@
+# Bug 788039 - With no prefix search libevent via pkg-config.
+
+--- config/autoconf.mk.in~
++++ config/autoconf.mk.in
+@@ -227,7 +227,7 @@ MOZ_HUNSPELL_CFLAGS = @MOZ_HUNSPELL_CFLA
+
+ MOZ_NATIVE_LIBEVENT = @MOZ_NATIVE_LIBEVENT@
+ MOZ_LIBEVENT_LIBS = @MOZ_LIBEVENT_LIBS@
+-MOZ_LIBEVENT_INCLUDES = @MOZ_LIBEVENT_INCLUDES@
++MOZ_LIBEVENT_CFLAGS = @MOZ_LIBEVENT_CFLAGS@
+
+ MOZ_NATIVE_LIBVPX = @MOZ_NATIVE_LIBVPX@
+ MOZ_LIBVPX_LIBS = @MOZ_LIBVPX_LIBS@
+--- configure.in~
++++ configure.in
+@@ -3854,7 +3854,7 @@ fi
+ dnl system libevent Support
+ dnl ========================================================
+ MOZ_ARG_WITH_STRING(system-libevent,
+-[ --with-system-libevent=[PFX]
++[ --with-system-libevent[=PFX]
+ Use system libevent [installed at prefix PFX]],
+ LIBEVENT_DIR=$withval)
+
+@@ -3863,10 +3863,11 @@ _SAVE_LDFLAGS=$LDFLAGS
+ _SAVE_LIBS=$LIBS
+ if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
+ MOZ_NATIVE_LIBEVENT=
++elif test "$LIBEVENT_DIR" = yes; then
++ PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
++ MOZ_NATIVE_LIBEVENT=1,
++ AC_MSG_ERROR([--with-system-libevent requested but libevent package not found]))
+ else
+- if test "${LIBEVENT_DIR}" = "yes"; then
+- LIBEVENT_DIR=/usr
+- fi
+ CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
+ LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
+ MOZ_CHECK_HEADER(event.h,
+@@ -3876,16 +3877,16 @@ else
+ AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
+ AC_CHECK_LIB(event, event_init,
+ [MOZ_NATIVE_LIBEVENT=1
+- MOZ_LIBEVENT_INCLUDES="${LIBEVENT_DIR}/include"
++ MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
+ MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
+- [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_INCLUDES= MOZ_LIBEVENT_LIBS=])
++ [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
+ fi
+ CFLAGS=$_SAVE_CFLAGS
+ LDFLAGS=$_SAVE_LDFLAGS
+ LIBS=$_SAVE_LIBS
+
+ AC_SUBST(MOZ_NATIVE_LIBEVENT)
+-AC_SUBST(MOZ_LIBEVENT_INCLUDES)
++AC_SUBST(MOZ_LIBEVENT_CFLAGS)
+ AC_SUBST(MOZ_LIBEVENT_LIBS)
+
+ dnl ========================================================
diff --git a/www/libxul/files/patch-bug788108 b/www/libxul/files/patch-bug788108
new file mode 100644
index 000000000000..746146760c62
--- /dev/null
+++ b/www/libxul/files/patch-bug788108
@@ -0,0 +1,20 @@
+--- content/base/public/nsContentUtils.h~
++++ content/base/public/nsContentUtils.h
+@@ -18,17 +18,6 @@
+ #include <ieeefp.h>
+ #endif
+
+-//A trick to handle IEEE floating point exceptions on FreeBSD - E.D.
+-#ifdef __FreeBSD__
+-#include <ieeefp.h>
+-#ifdef __alpha__
+-static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP;
+-#else
+-static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP|FP_X_DNML;
+-#endif
+-static fp_except_t oldmask = fpsetmask(~allmask);
+-#endif
+-
+ #include "nsAString.h"
+ #include "nsIStatefulFrame.h"
+ #include "nsNodeInfoManager.h"
diff --git a/www/libxul/files/patch-bug789436 b/www/libxul/files/patch-bug789436
new file mode 100644
index 000000000000..6d1e7069b858
--- /dev/null
+++ b/www/libxul/files/patch-bug789436
@@ -0,0 +1,27 @@
+--- toolkit/xre/nsAppRunner.cpp~
++++ toolkit/xre/nsAppRunner.cpp
+@@ -1388,11 +1388,6 @@ static int MSCRTReportHook( int aReportType, char *aMessage, int *oReturnValue)
+
+ #endif
+
+-#if defined(FREEBSD)
+-// pick up fpsetmask prototype.
+-#include <ieeefp.h>
+-#endif
+-
+ static inline void
+ DumpVersion()
+ {
+@@ -4136,12 +4131,5 @@ SetupErrorHandling(const char* progname)
+
+ // Unbuffer stdout, needed for tinderbox tests.
+ setbuf(stdout, 0);
+-
+-#if defined(FREEBSD)
+- // Disable all SIGFPE's on FreeBSD, as it has non-IEEE-conformant fp
+- // trap behavior that trips up on floating-point tests performed by
+- // the JS engine. See bugzilla bug 9967 details.
+- fpsetmask(0);
+-#endif
+ }
+
diff --git a/www/libxul/files/patch-build-pgo-profileserver.py b/www/libxul/files/patch-build-pgo-profileserver.py
new file mode 100644
index 000000000000..0571eb19903d
--- /dev/null
+++ b/www/libxul/files/patch-build-pgo-profileserver.py
@@ -0,0 +1,18 @@
+--- build/pgo/profileserver.py.orig 2011-02-24 21:49:47.000000000 +0100
++++ build/pgo/profileserver.py 2011-02-24 21:50:30.000000000 +0100
+@@ -77,13 +77,13 @@
+ t.setDaemon(True) # don't hang on exit
+ t.start()
+
+- automation.setServerInfo("localhost", PORT)
++ automation.setServerInfo("127.0.0.1", PORT)
+ automation.initializeProfile(PROFILE_DIRECTORY)
+ browserEnv = automation.environment()
+ browserEnv["XPCOM_DEBUG_BREAK"] = "warn"
+ browserEnv["MOZ_JAR_LOG_DIR"] = MOZ_JAR_LOG_DIR
+
+- url = "http://localhost:%d/index.html" % PORT
++ url = "http://127.0.0.1:%d/index.html" % PORT
+ appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
+ status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
+ debuggerInfo=debuggerInfo,
diff --git a/www/libxul/files/patch-build_unix_run-mozilla.sh b/www/libxul/files/patch-build_unix_run-mozilla.sh
new file mode 100644
index 000000000000..aae079e55456
--- /dev/null
+++ b/www/libxul/files/patch-build_unix_run-mozilla.sh
@@ -0,0 +1,12 @@
+--- build/unix/run-mozilla.sh.orig Tue Feb 14 19:56:54 2006
++++ build/unix/run-mozilla.sh Fri Dec 8 15:49:48 2006
+@@ -443,6 +443,9 @@
+ export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
+ export SHLIB_PATH LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH
+
++MOZ_PLUGIN_PATH=%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko19:%%LOCALBASE%%/lib/npapi/symlinks/firefox
++export MOZ_PLUGIN_PATH
++
+ if [ $moz_debug -eq 1 ]
+ then
+ moz_debug_program ${1+"$@"}
diff --git a/www/libxul/files/patch-clang32-libc++-visibility-hack b/www/libxul/files/patch-clang32-libc++-visibility-hack
new file mode 100644
index 000000000000..ccada32cbee3
--- /dev/null
+++ b/www/libxul/files/patch-clang32-libc++-visibility-hack
@@ -0,0 +1,38 @@
+--- configure.in~
++++ configure.in
+@@ -2855,6 +2855,7 @@ EOF
+ #pragma GCC visibility push(hidden)
+ #pragma GCC visibility push(default)
+ #include <string.h>
++#include <iterator>
+ #pragma GCC visibility pop
+
+ __attribute__ ((visibility ("default"))) void Func() {
+@@ -2863,7 +2864,7 @@ __attribute__ ((visibility ("default"))) void Func() {
+ }
+ EOF
+ ac_cv_have_visibility_builtin_bug=no
+- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
++ if ! ${CXX-c++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
+ ac_cv_have_visibility_builtin_bug=yes
+ else
+ if test `grep -c "@PLT" conftest.S` = 0; then
+--- js/src/configure.in~
++++ js/src/configure.in
+@@ -2855,6 +2855,7 @@ EOF
+ #pragma GCC visibility push(hidden)
+ #pragma GCC visibility push(default)
+ #include <string.h>
++#include <iterator>
+ #pragma GCC visibility pop
+
+ __attribute__ ((visibility ("default"))) void Func() {
+@@ -2863,7 +2864,7 @@ __attribute__ ((visibility ("default"))) void Func() {
+ }
+ EOF
+ ac_cv_have_visibility_builtin_bug=no
+- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
++ if ! ${CXX-c++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
+ ac_cv_have_visibility_builtin_bug=yes
+ else
+ if test `grep -c "@PLT" conftest.S` = 0; then
diff --git a/www/libxul/files/patch-config_autoconf.mk.in b/www/libxul/files/patch-config_autoconf.mk.in
index b39d9bacf0d7..877c48294fc6 100644
--- a/www/libxul/files/patch-config_autoconf.mk.in
+++ b/www/libxul/files/patch-config_autoconf.mk.in
@@ -1,6 +1,6 @@
---- config/autoconf.mk.in.orig 2007-08-28 12:02:43.000000000 -0400
-+++ config/autoconf.mk.in 2007-09-26 14:21:51.000000000 -0400
-@@ -58,14 +58,14 @@
+--- config/autoconf.mk.in.orig 2009-04-24 03:46:37.000000000 +0200
++++ config/autoconf.mk.in 2009-05-11 15:03:26.000000000 +0200
+@@ -57,14 +57,14 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
diff --git a/www/libxul/files/patch-dom-ipc-ContentChild.cpp b/www/libxul/files/patch-dom-ipc-ContentChild.cpp
new file mode 100644
index 000000000000..5a2826f3a41d
--- /dev/null
+++ b/www/libxul/files/patch-dom-ipc-ContentChild.cpp
@@ -0,0 +1,10 @@
+--- dom/ipc/ContentChild.cpp~
++++ dom/ipc/ContentChild.cpp
+@@ -42,6 +42,7 @@
+ #endif
+
+ #ifdef MOZ_WIDGET_QT
++#include <unistd.h>
+ #include "nsQAppInstance.h"
+ #endif
+
diff --git a/www/libxul/files/patch-gfx-qcms-qcmstypes.h b/www/libxul/files/patch-gfx-qcms-qcmstypes.h
new file mode 100644
index 000000000000..33d9e3356b77
--- /dev/null
+++ b/www/libxul/files/patch-gfx-qcms-qcmstypes.h
@@ -0,0 +1,11 @@
+--- gfx/qcms/qcmstypes.h.orig 2010-11-22 12:01:36.000000000 +0100
++++ gfx/qcms/qcmstypes.h 2010-11-22 12:02:42.000000000 +0100
+@@ -25,7 +25,7 @@
+ #ifdef __OS2__
+ /* OS/2's stdlib typdefs uintptr_t. So we'll just include that so we don't collide */
+ #include <stdlib.h>
+-#elif !defined(__intptr_t_defined) && !defined(_UINTPTR_T_DEFINED)
++#elif !defined(__intptr_t_defined) && !defined(_INTPTR_T_DECLARED)
+ typedef PRUptrdiff uintptr_t;
+ #endif
+ #endif
diff --git a/www/libxul/files/patch-ipc-chromium-Makefile.in b/www/libxul/files/patch-ipc-chromium-Makefile.in
new file mode 100644
index 000000000000..b660c3662bb0
--- /dev/null
+++ b/www/libxul/files/patch-ipc-chromium-Makefile.in
@@ -0,0 +1,28 @@
+--- ipc/chromium/Makefile.in~
++++ ipc/chromium/Makefile.in
+@@ -43,6 +43,14 @@ include $(DEPTH)/config/autoconf.mk
+
+ OS_CXXFLAGS := $(filter-out -fshort-wchar,$(OS_CXXFLAGS))
+
++# workaround IPC hang with libevent2
++ifndef MOZ_DEBUG
++ifneq (,$(filter 4.2.%, $(CXX_VERSION)))
++MOZ_OPTIMIZE_FLAGS = -O1
++OS_CXXFLAGS += $(MOZ_OPTIMIZE_FLAGS)
++endif
++endif
++
+ LIBRARY_NAME = chromium_s
+ FORCE_STATIC_LIB = 1
+ LIBXUL_LIBRARY = 1
+@@ -55,9 +60,7 @@ vpath %.c \
+ $(srcdir)/src/third_party/libevent \
+ $(NULL)
+ else # } else {
+-# message_pump_libevent.cc includes third_party/libevent/event.h,
+-# which we put in $(DIST), see export rule below
+-LOCAL_INCLUDES += -I$(DIST)
++LOCAL_INCLUDES += $(filter %/compat, $(MOZ_LIBEVENT_CFLAGS))
+ endif # }
+
+ vpath %.cc \
diff --git a/www/libxul/files/patch-ipc-chromium-src-base-message_pump_libevent.cc b/www/libxul/files/patch-ipc-chromium-src-base-message_pump_libevent.cc
new file mode 100644
index 000000000000..7d4dc959eedf
--- /dev/null
+++ b/www/libxul/files/patch-ipc-chromium-src-base-message_pump_libevent.cc
@@ -0,0 +1,11 @@
+--- ipc/chromium/src/base/message_pump_libevent.cc~
++++ ipc/chromium/src/base/message_pump_libevent.cc
+@@ -15,7 +15,7 @@
+ #include "base/scoped_nsautorelease_pool.h"
+ #include "base/scoped_ptr.h"
+ #include "base/time.h"
+-#include "third_party/libevent/event.h"
++#include "event.h"
+
+ // Lifecycle of struct event
+ // Libevent uses two main data structures:
diff --git a/www/libxul/files/patch-js-src-configure.in b/www/libxul/files/patch-js-src-configure.in
new file mode 100644
index 000000000000..fc8e66185a87
--- /dev/null
+++ b/www/libxul/files/patch-js-src-configure.in
@@ -0,0 +1,10 @@
+--- js/src/configure.in.orig 2012-01-29 11:24:33.000000000 +0100
++++ js/src/configure.in 2012-01-30 23:30:02.051087215 +0100
+@@ -5946,6 +5946,7 @@ _EGREP_PATTERN="${_EGREP_PATTERN}dummy_n
+ * C++ implementations should define these macros only when __STDC_LIMIT_MACROS
+ * is defined before <stdint.h> is included. */
+ #define __STDC_LIMIT_MACROS
++#define __STDC_CONSTANT_MACROS
+
+ #endif /* _JS_CONFDEFS_H_ */
+
diff --git a/www/libxul/files/patch-js-src-methodjit-MethodJIT.cpp b/www/libxul/files/patch-js-src-methodjit-MethodJIT.cpp
new file mode 100644
index 000000000000..d29c15ccc05a
--- /dev/null
+++ b/www/libxul/files/patch-js-src-methodjit-MethodJIT.cpp
@@ -0,0 +1,20 @@
+--- js/src/methodjit/MethodJIT.cpp~
++++ js/src/methodjit/MethodJIT.cpp
+@@ -171,7 +171,7 @@
+
+ JS_STATIC_ASSERT(offsetof(FrameRegs, sp) == 0);
+
+-#if defined(__linux__) && defined(JS_CPU_X64)
++#if defined(__ELF__) && defined(JS_CPU_X64)
+ # define SYMBOL_STRING_RELOC(name) #name "@plt"
+ #else
+ # define SYMBOL_STRING_RELOC(name) SYMBOL_STRING(name)
+@@ -149,7 +149,7 @@
+
+ #if defined(XP_MACOSX)
+ # define HIDE_SYMBOL(name) ".private_extern _" #name
+-#elif defined(__linux__)
++#elif defined(__ELF__)
+ # define HIDE_SYMBOL(name) ".hidden" #name
+ #else
+ # define HIDE_SYMBOL(name)
diff --git a/www/libxul/files/patch-toolkit-xre-nsEmbedFunctions.cpp b/www/libxul/files/patch-toolkit-xre-nsEmbedFunctions.cpp
new file mode 100644
index 000000000000..6c493d940fe7
--- /dev/null
+++ b/www/libxul/files/patch-toolkit-xre-nsEmbedFunctions.cpp
@@ -0,0 +1,10 @@
+--- toolkit/xre/nsEmbedFunctions.cpp~
++++ toolkit/xre/nsEmbedFunctions.cpp
+@@ -36,6 +36,7 @@
+ * ***** END LICENSE BLOCK ***** */
+
+ #if defined(MOZ_WIDGET_QT)
++#include <unistd.h>
+ #include "nsQAppInstance.h"
+ #endif
+
diff --git a/www/libxul/files/patch-toolkit_xre_Makefile.in b/www/libxul/files/patch-toolkit_xre_Makefile.in
new file mode 100644
index 000000000000..4a9c8533a2f8
--- /dev/null
+++ b/www/libxul/files/patch-toolkit_xre_Makefile.in
@@ -0,0 +1,8 @@
+--- toolkit/xre/Makefile.in.orig 2007-09-10 10:31:53.000000000 -0400
++++ toolkit/xre/Makefile.in 2007-09-10 10:35:00.000000000 -0400
+@@ -263,5 +263,3 @@
+ libs:: platform.ini
+ $(INSTALL) $^ $(DIST)/bin
+
+-install::
+- $(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)
diff --git a/www/libxul/files/patch-xulrunner-stub-nsXULStub.cpp b/www/libxul/files/patch-xulrunner-stub-nsXULStub.cpp
new file mode 100644
index 000000000000..83bda6c59b89
--- /dev/null
+++ b/www/libxul/files/patch-xulrunner-stub-nsXULStub.cpp
@@ -0,0 +1,11 @@
+--- xulrunner/stub/nsXULStub.cpp~
++++ xulrunner/stub/nsXULStub.cpp
+@@ -202,6 +202,8 @@ main(int argc, char **argv)
+ char greDir[MAXPATHLEN];
+ bool greFound = false;
+
++ setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko19:%%LOCALBASE%%/lib/npapi/symlinks/xulrunner", 0);
++
+ #if defined(XP_MACOSX)
+ CFBundleRef appBundle = CFBundleGetMainBundle();
+ if (!appBundle)
diff --git a/www/libxul19/Makefile b/www/libxul19/Makefile
new file mode 100644
index 000000000000..5a95502167a0
--- /dev/null
+++ b/www/libxul19/Makefile
@@ -0,0 +1,98 @@
+# New ports collection makefile for: xulrunner
+# Date created: 2006-02-20
+# Whom: Michael Johnson <ahze@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= libxul
+DISTVERSION= 1.9.2.28
+PORTREVISION= 1
+CATEGORIES?= www devel
+MASTER_SITES= ${MASTER_SITE_MOZILLA}
+MASTER_SITE_SUBDIR= firefox/releases/3.6.28/source
+DISTNAME= firefox-3.6.28.source
+
+MAINTAINER?= gecko@FreeBSD.org
+COMMENT?= Mozilla runtime package that can be used to bootstrap XUL+XPCOM apps
+
+WRKSRC= ${WRKDIR}/mozilla-1.9.2
+CONFLICTS= mozilla-[0-9]* libxul-[0-9][0-9].*
+GECKO_PLIST_PRE_DIRS= lib/${MOZILLA}/bin lib/${MOZILLA}/idl \
+ lib/${MOZILLA}/include lib/${MOZILLA}/lib
+
+LATEST_LINK= libxul19
+USE_AUTOTOOLS= autoconf213:env
+WANT_GNOME= yes
+WANT_PERL= yes
+ALL_TARGET= default
+GNU_CONFIGURE= yes
+USE_BZIP2= yes
+USE_GMAKE= yes
+MAKE_JOBS_SAFE= yes
+MAKE_ENV= SKIP_GRE_REGISTRATION=1 mozappdir=${PREFIX}/lib/${MOZILLA}
+LDFLAGS+= -Wl,-rpath,${PREFIX}/lib/${MOZ_RPATH}
+USE_LDCONFIG= ${PREFIX}/lib/${MOZILLA}
+
+MOZ_OPTIONS?= --enable-application=xulrunner \
+ --disable-ipc
+MOZ_EXTENSIONS= default,cookie,permissions
+USE_GECKO= gecko
+MOZILLA_EXEC_NAME=xulrunner
+USE_MOZILLA= -event -ffi -vpx
+MOZ_CHROME= jar
+MOZILLA_PLIST_DIRS= bin include lib share/idl
+PLIST_DIRSTRY= share/idl
+MOZ_PKGCONFIG_FILES= libxul-embedding libxul mozilla-gtkmozembed-embedding \
+ mozilla-gtkmozembed mozilla-js mozilla-plugin
+
+OPTIONS_DEFINE= JAVA
+JAVA_DESC?= JAVA xpcom
+
+.include "${.CURDIR}/../../www/firefox/Makefile.options"
+
+OPTIONS_DEFINE:=${OPTIONS_DEFINE:NLIBPROXY}
+OPTIONS_SINGLE:=${OPTIONS_SINGLE:NTOOLKIT}
+
+.include <bsd.port.pre.mk>
+
+.if ${USE_MOZILLA:M-nss}
+MOZ_PKGCONFIG_FILES+= mozilla-nss
+.endif
+
+.if ${ARCH} == amd64
+CONFIGURE_TARGET=x86_64-portbld-freebsd${OSREL}
+.elif ${ARCH} == powerpc64
+.if ${OSVERSION} < 900033
+BROKEN= Needs binutils 2.17.50 to build
+.else
+MOZ_EXPORT+= UNAME_m="powerpc64"
+CFLAGS+= -mminimal-toc
+.endif
+.endif
+
+.if ${PORT_OPTIONS:MJAVA}
+USE_JAVA= yes
+JAVA_VERSION+= 1.5+
+JAVA_OS+= native
+MOZ_EXPORT+= JAVA_HOME="${JAVA_HOME}"
+MOZ_OPTIONS+= --enable-javaxpcom
+.else
+MOZ_OPTIONS+= --disable-javaxpcom
+.endif
+
+post-patch:
+ ${REINPLACE_CMD} -e 's|/usr/local/include|${LOCALBASE}/include|' \
+ ${WRKSRC}/js/src/config/mkdepend/Makefile.in
+
+pre-configure:
+ (cd ${WRKSRC} && ${AUTOCONF})
+ (cd ${WRKSRC}/js/src/ && ${AUTOCONF})
+
+post-build:
+ @${REINPLACE_CMD} -e "s|\(Libs:.*\)\($$\)|\1 -Wl,-rpath,${PREFIX}/lib/${MOZ_RPATH}\2| ; \
+ s|%sdkdir%|%sdkdir%/sdk|g ; \
+ s|%%MOZ_LIBDIR%%|${PREFIX}/lib/${MOZILLA}|g" \
+ ${WRKSRC}/xulrunner/installer/*.pc.in || ${TRUE}
+
+.include <bsd.port.post.mk>
diff --git a/www/libxul19/distinfo b/www/libxul19/distinfo
new file mode 100644
index 000000000000..83cfbc26e75c
--- /dev/null
+++ b/www/libxul19/distinfo
@@ -0,0 +1,2 @@
+SHA256 (firefox-3.6.28.source.tar.bz2) = a6c4bc52095194428cf3b17341b68ac473b7654984000c45d1be3eae55d78260
+SIZE (firefox-3.6.28.source.tar.bz2) = 51698958
diff --git a/www/libxul19/files/patch-alsapulse b/www/libxul19/files/patch-alsapulse
new file mode 100644
index 000000000000..f3e0ffb31f6d
--- /dev/null
+++ b/www/libxul19/files/patch-alsapulse
@@ -0,0 +1,122 @@
+--- config/autoconf.mk.in~
++++ config/autoconf.mk.in
+@@ -555,6 +555,14 @@ MOZ_LIBNOTIFY_CFLAGS = @MOZ_LIBNOTIFY_CF
+ MOZ_LIBNOTIFY_LIBS = @MOZ_LIBNOTIFY_LIBS@
+ MOZ_ENABLE_LIBNOTIFY = @MOZ_ENABLE_LIBNOTIFY@
+
++MOZ_ALSA = @MOZ_ALSA@
++MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS@
++MOZ_ALSA_CFLAGS = @MOZ_ALSA_CFLAGS@
++
++MOZ_PULSEAUDIO = @MOZ_PULSEAUDIO@
++MOZ_PULSEAUDIO_LIBS = @MOZ_PULSEAUDIO_LIBS@
++MOZ_PULSEAUDIO_CFLAGS = @MOZ_PULSEAUDIO_CFLAGS@
++
+ GLIB_CFLAGS = @GLIB_CFLAGS@
+ GLIB_LIBS = @GLIB_LIBS@
+ GLIB_GMODULE_LIBS = @GLIB_GMODULE_LIBS@
+--- configure.in~
++++ configure.in
+@@ -5660,15 +5660,49 @@ dnl ====================================
+
+ dnl If using sydneyaudio with Linux, ensure that the alsa library is available
+ if test "$COMPILE_ENVIRONMENT"; then
+-if test -n "$MOZ_SYDNEYAUDIO"; then
++MOZ_ARG_ENABLE_BOOL(alsa,
++[ --enable-alsa Enable Alsa support],
++MOZ_ALSA=1,
++MOZ_ALSA= MOZ_ALSA_FORCE=$enableval)
++
++if test -n "$MOZ_SYDNEYAUDIO" -a "$MOZ_ALSA_FORCE" != "no"; then
+ case "$target_os" in
+ linux*)
+- AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
++ MOZ_ALSA=1
+ ;;
+ esac
+ fi
++
++if test -n "$MOZ_ALSA"; then
++ PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
++ [echo "$MOZ_ALSA_PKG_ERRORS"
++ AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
++fi
+ fi
+
++AC_SUBST(MOZ_ALSA_CFLAGS)
++AC_SUBST(MOZ_ALSA_LIBS)
++AC_SUBST(MOZ_ALSA)
++
++dnl ========================================================
++dnl = Enable PulseAudio
++dnl ========================================================
++
++MOZ_ARG_ENABLE_BOOL(pulseaudio,
++[ --enable-pulseaudio Enable PulseAudio support],
++MOZ_PULSEAUDIO=1,
++MOZ_PULSEAUDIO=)
++
++if test -n "$MOZ_PULSEAUDIO"; then
++ PKG_CHECK_MODULES(MOZ_PULSEAUDIO, libpulse, ,
++ [echo "$MOZ_PULSEAUDIO_PKG_ERRORS"
++ AC_MSG_ERROR([pulseaudio audio backend requires libpulse package])])
++fi
++
++AC_SUBST(MOZ_PULSEAUDIO_CFLAGS)
++AC_SUBST(MOZ_PULSEAUDIO_LIBS)
++AC_SUBST(MOZ_PULSEAUDIO)
++
+ dnl ========================================================
+ dnl Splashscreen
+ dnl ========================================================
+--- media/libsydneyaudio/src/Makefile.in~
++++ media/libsydneyaudio/src/Makefile.in
+@@ -45,12 +45,6 @@ MODULE = sydneyaudio
+ LIBRARY_NAME = sydneyaudio
+ FORCE_STATIC_LIB= 1
+
+-ifeq ($(OS_ARCH),Linux)
+-CSRCS = \
+- sydney_audio_alsa.c \
+- $(NULL)
+-endif
+-
+ ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
+ CSRCS = \
+ sydney_audio_waveapi.c \
+@@ -83,6 +83,18 @@ CSRCS = \
+ $(NULL)
+ endif
+
++ifdef MOZ_ALSA
++CSRCS = \
++ sydney_audio_alsa.c \
++ $(NULL)
++endif
++
++ifdef MOZ_PULSEAUDIO
++CSRCS = \
++ sydney_audio_pulseaudio.c \
++ $(NULL)
++endif
++
+ ifeq ($(OS_ARCH),WINNT)
+ OS_LIBS += winmm.lib
+ endif
+--- toolkit/library/libxul-config.mk~
++++ toolkit/library/libxul-config.mk
+@@ -90,6 +90,14 @@ endif
+ LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/os2
+ endif
+
++ifdef MOZ_ALSA
++EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
++endif
++
++ifdef MOZ_PULSEAUDIO
++EXTRA_DSO_LDOPTS += $(MOZ_PULSEAUDIO_LIBS)
++endif
++
+ # dependent libraries
+ ifdef MOZ_IPC
+ STATIC_LIBS += \
diff --git a/www/libxul/files/patch-bug351181 b/www/libxul19/files/patch-bug351181
index c997f4c6b8ba..c997f4c6b8ba 100644
--- a/www/libxul/files/patch-bug351181
+++ b/www/libxul19/files/patch-bug351181
diff --git a/www/libxul19/files/patch-bug653551 b/www/libxul19/files/patch-bug653551
new file mode 100644
index 000000000000..733da79a9fd8
--- /dev/null
+++ b/www/libxul19/files/patch-bug653551
@@ -0,0 +1,24 @@
+commit 47ea30f
+Author: Landry Breuil <landry@openbsd.org>
+Date: Thu Feb 2 15:31:56 2012 +0900
+
+ Bug 653551 - Jaegermonkey Sparc back-end broken on sparc64. r=leon.sha
+---
+ js/src/configure.in | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git js/src/configure.in js/src/configure.in
+index 84390cf..d663c46 100644
+--- js/src/configure.in
++++ js/src/configure.in
+@@ -2471,8 +2471,10 @@ arm*-*)
+ NANOJIT_ARCH=ARM
+ ;;
+ sparc*-*)
++ if test ! "$HAVE_64BIT_OS" ; then
+ ENABLE_JIT=1
+ NANOJIT_ARCH=Sparc
++ fi
+ ;;
+ esac
+
diff --git a/www/libxul19/files/patch-bug685258 b/www/libxul19/files/patch-bug685258
new file mode 100644
index 000000000000..598a6ea5f3d5
--- /dev/null
+++ b/www/libxul19/files/patch-bug685258
@@ -0,0 +1,17 @@
+# HG changeset patch
+# User Oleg Romashin <romaxa@gmail.com>
+# Parent a2291c212856ad27622416e83c8311b6a33b52f1
+Bug 685258 - Pulse audio backend does not check provided playback and crashes r=derf
+
+diff --git a/content/media/nsAudioStream.cpp b/content/media/nsAudioStream.cpp
+--- content/media/nsAudioStream.cpp
++++ content/media/nsAudioStream.cpp
+@@ -83,7 +83,7 @@ void nsAudioStream::Init(PRInt32 aNumCha
+ mChannels = aNumChannels;
+ mFormat = aFormat;
+ if (sa_stream_create_pcm(reinterpret_cast<sa_stream_t**>(&mAudioHandle),
+- NULL,
++ "Mozilla",
+ SA_MODE_WRONLY,
+ SA_PCM_FORMAT_S16_NE,
+ aRate,
diff --git a/www/libxul19/files/patch-bug761077 b/www/libxul19/files/patch-bug761077
new file mode 100644
index 000000000000..fb12c5b15021
--- /dev/null
+++ b/www/libxul19/files/patch-bug761077
@@ -0,0 +1,110 @@
+diff --git xpcom/reflect/xptcall/public/genstubs.pl xpcom/reflect/xptcall/public/genstubs.pl
+index b8a87a5..918c4cf 100644
+--- xpcom/reflect/xptcall/public/genstubs.pl
++++ xpcom/reflect/xptcall/public/genstubs.pl
+@@ -44,7 +44,7 @@ print OUTFILE "* 0 is QueryInterface\n";
+ print OUTFILE "* 1 is AddRef\n";
+ print OUTFILE "* 2 is Release\n";
+ print OUTFILE "*/\n";
+-print OUTFILE "#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__))\n";
++print OUTFILE "#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__) && !defined(__FreeBSD__))\n";
+ for($i = 0; $i < $entry_count; $i++) {
+ print OUTFILE "NS_IMETHOD Stub",$i+3,"();\n";
+ }
+diff --git xpcom/reflect/xptcall/public/xptcstubsdecl.inc xpcom/reflect/xptcall/public/xptcstubsdecl.inc
+index eb66761..807db26 100644
+--- xpcom/reflect/xptcall/public/xptcstubsdecl.inc
++++ xpcom/reflect/xptcall/public/xptcstubsdecl.inc
+@@ -8,7 +8,7 @@
+ * 1 is AddRef
+ * 2 is Release
+ */
+-#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__))
++#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__) && !defined(__FreeBSD__))
+ NS_IMETHOD Stub3();
+ NS_IMETHOD Stub4();
+ NS_IMETHOD Stub5();
+diff --git xpcom/reflect/xptcall/src/md/unix/Makefile.in xpcom/reflect/xptcall/src/md/unix/Makefile.in
+index ae6ed66..2783957 100644
+--- xpcom/reflect/xptcall/src/md/unix/Makefile.in
++++ xpcom/reflect/xptcall/src/md/unix/Makefile.in
+@@ -85,7 +85,7 @@
+ # New code for Linux, et. al., with gcc
+ # Migrate other platforms here after testing
+ #
+-ifneq (,$(filter Linux GNU_%,$(OS_ARCH)))
++ifneq (,$(filter Linux FreeBSD GNU_%,$(OS_ARCH)))
+ # Linux/x86-64
+ ifeq (x86_64,$(OS_TEST))
+ CPPSRCS := xptcinvoke_x86_64_unix.cpp xptcstubs_x86_64_linux.cpp
+@@ -70,7 +70,7 @@ endif
+ endif
+ endif
+ # IA64 Linux
+-ifneq (,$(filter Linux,$(OS_ARCH)))
++ifneq (,$(filter Linux FreeBSD,$(OS_ARCH)))
+ ifneq (,$(findstring ia64,$(OS_TEST)))
+ CPPSRCS := xptcinvoke_ipf64.cpp xptcstubs_ipf64.cpp
+ ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s
+@@ -109,12 +109,6 @@ ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDx86_64
+ CPPSRCS := xptcinvoke_amd64_openbsd.cpp xptcstubs_amd64_openbsd.cpp
+ endif
+ #
+-# FreeBSD/amd64
+-#
+-ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDx86_64)
+-CPPSRCS := xptcinvoke_amd64_linux.cpp xptcstubs_amd64_linux.cpp
+-endif
+-#
+ # BeOS/Intel (uses the same unixish_x86 code)
+ #
+ ifeq ($(OS_ARCH)$(OS_TEST),BeOSBePC)
+@@ -341,7 +356,7 @@
+ #
+ # Linux/PPC
+ #
+-ifeq ($(OS_ARCH)$(OS_TEST),Linuxpowerpc)
++ifneq (,$(filter Linuxpowerpc FreeBSDpowerpc,$(OS_ARCH)$(OS_TEST)))
+ CPPSRCS := xptcinvoke_ppc_linux.cpp xptcstubs_ppc_linux.cpp
+ ASFILES := xptcinvoke_asm_ppc_linux.s xptcstubs_asm_ppc_linux.s
+ AS := $(CC) -c -x assembler-with-cpp
+@@ -350,7 +365,7 @@
+ #
+ # Linux/PPC64
+ #
+-ifeq ($(OS_ARCH)$(OS_TEST),Linuxpowerpc64)
++ifneq (,$(filter Linuxpowerpc64 FreeBSDpowerpc64,$(OS_ARCH)$(OS_TEST)))
+ CPPSRCS := xptcinvoke_ppc64_linux.cpp xptcstubs_ppc64_linux.cpp
+ ASFILES := xptcinvoke_asm_ppc64_linux.s xptcstubs_asm_ppc64_linux.s
+ AS := $(CC) -c -x assembler-with-cpp
+@@ -350,7 +350,7 @@ endif
+ #
+ # OpenBSD/SPARC64
+ #
+-ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDsparc64)
++ifneq (,$(filter OpenBSDsparc64 FreeBSDsparc64,$(OS_ARCH)$(OS_TEST)))
+ CPPSRCS := xptcinvoke_sparc64_openbsd.cpp xptcstubs_sparc64_openbsd.cpp
+ ASFILES := xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_openbsd.s
+ endif
+diff --git xpcom/reflect/xptcall/src/xptcprivate.h xpcom/reflect/xptcall/src/xptcprivate.h
+index d903ced..e4ec832 100644
+--- xpcom/reflect/xptcall/src/xptcprivate.h
++++ xpcom/reflect/xptcall/src/xptcprivate.h
+@@ -14,7 +14,7 @@
+
+ class xptiInterfaceEntry;
+
+-#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__))
++#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__) && !defined(__FreeBSD__))
+ #define STUB_ENTRY(n) NS_IMETHOD Stub##n() = 0;
+ #else
+ #define STUB_ENTRY(n) NS_IMETHOD Stub##n(PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64) = 0;
+@@ -31,7 +31,7 @@ public:
+ #undef STUB_ENTRY
+ #undef SENTINEL_ENTRY
+
+-#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__))
++#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__) && !defined(__FreeBSD__))
+ #define STUB_ENTRY(n) NS_IMETHOD Stub##n();
+ #else
+ #define STUB_ENTRY(n) NS_IMETHOD Stub##n(PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64);
diff --git a/www/libxul19/files/patch-bug778078 b/www/libxul19/files/patch-bug778078
new file mode 100644
index 000000000000..c3d42c391a98
--- /dev/null
+++ b/www/libxul19/files/patch-bug778078
@@ -0,0 +1,11 @@
+--- toolkit/xre/nsAppRunner.cpp~
++++ toolkit/xre/nsAppRunner.cpp
+@@ -3046,7 +3046,7 @@ XRE_main(int argc, char* argv[], const n
+ QApplication app(gArgc, gArgv);
+ #endif
+ #if defined(MOZ_WIDGET_GTK2)
+-#ifdef MOZ_MEMORY
++#if defined(MOZ_MEMORY) || defined(__FreeBSD__) || defined(__NetBSD__)
+ // Disable the slice allocator, since jemalloc already uses similar layout
+ // algorithms, and using a sub-allocator tends to increase fragmentation.
+ // This must be done before g_thread_init() is called.
diff --git a/www/libxul19/files/patch-bug781457 b/www/libxul19/files/patch-bug781457
new file mode 100644
index 000000000000..8a790ccf84a9
--- /dev/null
+++ b/www/libxul19/files/patch-bug781457
@@ -0,0 +1,10 @@
+--- xpcom/base/nsStackWalk.cpp.orig 2012-05-29 00:57:31.000000000 +0200
++++ xpcom/base/nsStackWalk.cpp 2012-06-03 12:33:40.000000000 +0200
+@@ -1123,6 +1123,7 @@ NS_StackWalk(NS_WalkStackCallback aCallb
+
+ #elif defined(HAVE__UNWIND_BACKTRACE)
+
++#define _GNU_SOURCE
+ // libgcc_s.so symbols _Unwind_Backtrace@@GCC_3.3 and _Unwind_GetIP@@GCC_3.0
+ #include <unwind.h>
+
diff --git a/www/libxul19/files/patch-config_autoconf.mk.in b/www/libxul19/files/patch-config_autoconf.mk.in
new file mode 100644
index 000000000000..b39d9bacf0d7
--- /dev/null
+++ b/www/libxul19/files/patch-config_autoconf.mk.in
@@ -0,0 +1,21 @@
+--- config/autoconf.mk.in.orig 2007-08-28 12:02:43.000000000 -0400
++++ config/autoconf.mk.in 2007-09-26 14:21:51.000000000 -0400
+@@ -58,14 +58,14 @@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ bindir = @bindir@
+-includedir = @includedir@/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
++includedir = @includedir@/%%MOZILLA%%
+ libdir = @libdir@
+ datadir = @datadir@
+ mandir = @mandir@
+-idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
++idldir = $(datadir)/idl/%%MOZILLA%%
+
+-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
++installdir = $(libdir)/%%MOZILLA%%
++sdkdir = $(libdir)/%%MOZILLA%%
+
+ DIST = $(DEPTH)/dist
+ LIBXUL_SDK = @LIBXUL_SDK@
diff --git a/www/libxul/files/patch-content-xslt-public-txDouble.h b/www/libxul19/files/patch-content-xslt-public-txDouble.h
index cd4acfc534bf..cd4acfc534bf 100644
--- a/www/libxul/files/patch-content-xslt-public-txDouble.h
+++ b/www/libxul19/files/patch-content-xslt-public-txDouble.h
diff --git a/www/libxul/files/patch-embedding_base_nsEmbedAPI.cpp b/www/libxul19/files/patch-embedding_base_nsEmbedAPI.cpp
index 2cc9823fed1c..2cc9823fed1c 100644
--- a/www/libxul/files/patch-embedding_base_nsEmbedAPI.cpp
+++ b/www/libxul19/files/patch-embedding_base_nsEmbedAPI.cpp
diff --git a/www/libxul/files/patch-gfx-ots-src-os2.cc b/www/libxul19/files/patch-gfx-ots-src-os2.cc
index 231508b06a6d..231508b06a6d 100644
--- a/www/libxul/files/patch-gfx-ots-src-os2.cc
+++ b/www/libxul19/files/patch-gfx-ots-src-os2.cc
diff --git a/www/libxul/files/patch-js-ctypes-libffi-configure b/www/libxul19/files/patch-js-ctypes-libffi-configure
index 3f6b66e1d628..3f6b66e1d628 100644
--- a/www/libxul/files/patch-js-ctypes-libffi-configure
+++ b/www/libxul19/files/patch-js-ctypes-libffi-configure
diff --git a/www/libxul/files/patch-js-src-jslock.cpp b/www/libxul19/files/patch-js-src-jslock.cpp
index 7aea14d0ebaf..7aea14d0ebaf 100644
--- a/www/libxul/files/patch-js-src-jslock.cpp
+++ b/www/libxul19/files/patch-js-src-jslock.cpp
diff --git a/www/libxul/files/patch-media-liboggz-include-oggz-oggz_off_t_generated.h b/www/libxul19/files/patch-media-liboggz-include-oggz-oggz_off_t_generated.h
index 60d8988b9f17..60d8988b9f17 100644
--- a/www/libxul/files/patch-media-liboggz-include-oggz-oggz_off_t_generated.h
+++ b/www/libxul19/files/patch-media-liboggz-include-oggz-oggz_off_t_generated.h
diff --git a/www/libxul/files/patch-media-libsydneyaudio-src-Makefile.in b/www/libxul19/files/patch-media-libsydneyaudio-src-Makefile.in
index 0812d1af8d4d..0812d1af8d4d 100644
--- a/www/libxul/files/patch-media-libsydneyaudio-src-Makefile.in
+++ b/www/libxul19/files/patch-media-libsydneyaudio-src-Makefile.in
diff --git a/www/libxul19/files/patch-media-libsydneyaudio-src-sydney_audio_oss.c b/www/libxul19/files/patch-media-libsydneyaudio-src-sydney_audio_oss.c
new file mode 100644
index 000000000000..a7fd5f1ffd09
--- /dev/null
+++ b/www/libxul19/files/patch-media-libsydneyaudio-src-sydney_audio_oss.c
@@ -0,0 +1,13 @@
+--- media/libsydneyaudio/src/sydney_audio_oss.c~
++++ media/libsydneyaudio/src/sydney_audio_oss.c
+@@ -446,6 +446,10 @@ static void audio_callback(void* data)
+ printf("!"); /* not enough audio data */
+ #endif
+ bytes = bytes-bytes_to_copy;
++ struct timespec ts = {0, 1000000};
++ pthread_mutex_unlock(&s->mutex);
++ nanosleep(&ts, NULL);
++ pthread_mutex_lock(&s->mutex);
+ break;
+ }
+ free(s->bl_head);
diff --git a/www/libxul/files/patch-modules-libpr0n-encoders-png-nsPNGDecoder.cpp b/www/libxul19/files/patch-modules-libpr0n-encoders-png-nsPNGDecoder.cpp
index c3c6dd3a2a57..c3c6dd3a2a57 100644
--- a/www/libxul/files/patch-modules-libpr0n-encoders-png-nsPNGDecoder.cpp
+++ b/www/libxul19/files/patch-modules-libpr0n-encoders-png-nsPNGDecoder.cpp
diff --git a/www/libxul/files/patch-modules-libpr0n-encoders-png-nsPNGEncoder.cpp b/www/libxul19/files/patch-modules-libpr0n-encoders-png-nsPNGEncoder.cpp
index 9e474153007d..9e474153007d 100644
--- a/www/libxul/files/patch-modules-libpr0n-encoders-png-nsPNGEncoder.cpp
+++ b/www/libxul19/files/patch-modules-libpr0n-encoders-png-nsPNGEncoder.cpp
diff --git a/www/libxul/files/patch-modules-libpref-src-prefapi.cpp b/www/libxul19/files/patch-modules-libpref-src-prefapi.cpp
index 159f0d4340ab..159f0d4340ab 100644
--- a/www/libxul/files/patch-modules-libpref-src-prefapi.cpp
+++ b/www/libxul19/files/patch-modules-libpref-src-prefapi.cpp
diff --git a/www/libxul19/files/patch-security_manager_ssl_src_nsNSSComponent.cpp b/www/libxul19/files/patch-security_manager_ssl_src_nsNSSComponent.cpp
new file mode 100644
index 000000000000..f30d12229ccd
--- /dev/null
+++ b/www/libxul19/files/patch-security_manager_ssl_src_nsNSSComponent.cpp
@@ -0,0 +1,10 @@
+--- security/manager/ssl/src/nsNSSComponent.cpp.orig Mon May 29 23:10:54 2006
++++ security/manager/ssl/src/nsNSSComponent.cpp Mon May 29 23:12:22 2006
+@@ -110,6 +110,7 @@
+ #include "nss.h"
+ #include "pk11func.h"
+ #include "ssl.h"
++#define NSS_ENABLE_ECC 1
+ #include "sslproto.h"
+ #include "secmod.h"
+ #include "sechash.h"
diff --git a/www/libxul/files/patch-toolkit_library_Makefile.in b/www/libxul19/files/patch-toolkit_library_Makefile.in
index d905acd5bf67..d905acd5bf67 100644
--- a/www/libxul/files/patch-toolkit_library_Makefile.in
+++ b/www/libxul19/files/patch-toolkit_library_Makefile.in
diff --git a/www/libxul/files/patch-xpcom_base_nsStackWalk.cpp b/www/libxul19/files/patch-xpcom_base_nsStackWalk.cpp
index 3485b1509ad1..3485b1509ad1 100644
--- a/www/libxul/files/patch-xpcom_base_nsStackWalk.cpp
+++ b/www/libxul19/files/patch-xpcom_base_nsStackWalk.cpp
diff --git a/www/libxul19/files/patch-xulrunner_installer_libxul-embedding.pc.in b/www/libxul19/files/patch-xulrunner_installer_libxul-embedding.pc.in
new file mode 100644
index 000000000000..e7ffbd5d1a9d
--- /dev/null
+++ b/www/libxul19/files/patch-xulrunner_installer_libxul-embedding.pc.in
@@ -0,0 +1,9 @@
+--- xulrunner/installer/libxul-embedding.pc.in~
++++ xulrunner/installer/libxul-embedding.pc.in
+@@ -6,5 +6,5 @@ idldir=%idldir%
+ Name: libxul-embedding
+ Description: Static library for version-independent embedding of the Mozilla runtime
+ Version: %MOZILLA_VERSION%
+-Libs: -L${sdkdir}/lib -lxpcomglue -ldl
++Libs: -L${sdkdir}/lib -L%%MOZ_LIBDIR%% -lxpcomglue
+ Cflags: -DXPCOM_GLUE -I${includedir} %WCHAR_CFLAGS%
diff --git a/www/libxul19/files/patch-xulrunner_installer_libxul.pc.in b/www/libxul19/files/patch-xulrunner_installer_libxul.pc.in
new file mode 100644
index 000000000000..279e6cd2f614
--- /dev/null
+++ b/www/libxul19/files/patch-xulrunner_installer_libxul.pc.in
@@ -0,0 +1,9 @@
+--- xulrunner/installer/libxul.pc.in.orig 2010-01-21 04:31:27.000000000 +0100
++++ xulrunner/installer/libxul.pc.in 2010-06-21 19:39:57.000000000 +0200
+@@ -7,5 +7,5 @@
+ Description: The Mozilla Runtime and Embedding Engine
+ Version: %MOZILLA_VERSION%
+ Requires: %NSPR_NAME% >= %NSPR_VERSION%
+-Libs: -L${sdkdir}/lib -lxpcomglue_s -lxul -lxpcom
++Libs: -L${sdkdir}/lib -L%%MOZ_LIBDIR%% -lxpcomglue_s -lxul -lxpcom
+ Cflags: -I${includedir} %WCHAR_CFLAGS%
diff --git a/www/libxul19/pkg-descr b/www/libxul19/pkg-descr
new file mode 100644
index 000000000000..a4c33d7dfb77
--- /dev/null
+++ b/www/libxul19/pkg-descr
@@ -0,0 +1,7 @@
+Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications
+that are as rich as Firefox and Thunderbird. It will provide mechanisms for
+installing, upgrading, and uninstalling these applications. XULRunner will
+also provide libxul, a solution which allows the embedding of Mozilla
+technologies in other projects and products.
+
+WWW: http://developer.mozilla.org/en/docs/XULRunner
diff --git a/www/moonshine/Makefile b/www/moonshine/Makefile
index c7c73d91ee7a..cadc8a202327 100644
--- a/www/moonshine/Makefile
+++ b/www/moonshine/Makefile
@@ -7,7 +7,7 @@
PORTNAME= moonshine
PORTVERSION= 0.7
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= www multimedia
MASTER_SITES= http://romain.blogreen.org/distfiles/
DISTNAME= abock-${PORTNAME}-${GITCOMMIT}
@@ -19,7 +19,7 @@ BUILD_DEPENDS= bash:${PORTSDIR}/shells/bash
GITCOMMIT= 35085a4
USE_GMAKE= yes
-USE_GECKO= libxul
+USE_GECKO= libxul19
USE_AUTOTOOLS= libtool libtoolize aclocal autoconf autoheader automake
LIBTOOLIZE_ARGS= --force --copy --automake
AUTOMAKE_ARGS= --gnu --add-missing --force --copy -Wno-portability
diff --git a/www/openvrml/Makefile b/www/openvrml/Makefile
index e378353999eb..16bf7a313763 100644
--- a/www/openvrml/Makefile
+++ b/www/openvrml/Makefile
@@ -7,7 +7,7 @@
PORTNAME= openvrml
PORTVERSION= 0.18.9
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= www graphics
MASTER_SITES= SF
@@ -39,7 +39,7 @@ CPPFLAGS+= -I${LOCALBASE}/include -I${JAVA_HOME}/include -I${JAVA_HOME}/include/
LDFLAGS+= -L${LOCALBASE}/lib -L${JAVA_HOME}/jre/lib/${ARCH}/client ${PTHREAD_LIBS}
USE_GMAKE= yes
USE_LDCONFIG= yes
-USE_GECKO= libxul
+USE_GECKO= libxul19
USE_WEBPLUGINS= native
WEBPLUGINS_FILES=openvrml.so
@@ -82,11 +82,11 @@ pre-configure:
${REINPLACE_CMD} -e 's|$$(libdir)/mozilla/plugins|${WEBPLUGINS_DIR}|' \
${WRKSRC}/src/Makefile.in
.if ${GECKO} != "firefox"
- ${REINPLACE_CMD} -e "s|FIREFOX_JS|${GECKO:U}_JS|g;s|firefox-js|${GECKO}-js|" \
+ ${REINPLACE_CMD} -e "s|FIREFOX_JS|${GECKO:S/19//:U}_JS|g;s|firefox-js|${GECKO:S/19//}-js|" \
${WRKSRC}/configure
- ${REINPLACE_CMD} -e "s|firefox-plugin|${GECKO}-plugin|g" \
+ ${REINPLACE_CMD} -e "s|firefox-plugin|${GECKO:S/19//}-plugin|g" \
${WRKSRC}/configure
- ${REINPLACE_CMD} -e "s|mozilla-plugin|${GECKO}|g" \
+ ${REINPLACE_CMD} -e "s|mozilla-plugin|${GECKO:S/19//}|g" \
${WRKSRC}/configure
${REINPLACE_CMD} -e "s|boost_thread-mt|boost_thread|g" \
${WRKSRC}/configure
diff --git a/www/xpi-conkeror/Makefile b/www/xpi-conkeror/Makefile
index bac0f1afb243..ee953d8bdd29 100644
--- a/www/xpi-conkeror/Makefile
+++ b/www/xpi-conkeror/Makefile
@@ -7,7 +7,7 @@
PORTNAME= conkeror
PORTVERSION= 20090821
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= www
MASTER_SITES= http://mirror.4bit.ws/ \
${MASTER_SITE_LOCAL} \
@@ -18,7 +18,7 @@ MAINTAINER= ashish@FreeBSD.org
COMMENT= A completely keyboard driven browser based on firefox
WRKSRC= ${WRKDIR}/conkeror
-USE_GECKO= libxul
+USE_GECKO= libxul19
BUILD_ID=echo -n `whoami`@`hostname`_`date +%s`
diff --git a/www/xpi-gwt-dev-plugin/Makefile b/www/xpi-gwt-dev-plugin/Makefile
index fa8ac9d2e0bd..26f4096556f3 100644
--- a/www/xpi-gwt-dev-plugin/Makefile
+++ b/www/xpi-gwt-dev-plugin/Makefile
@@ -15,7 +15,7 @@ DISTNAME= gwt-dev-plugin-${PORTVERSION}-partial
MAINTAINER= ports@FreeBSD.org
COMMENT= Google Web Toolkit Developer Plugin for Firefox
-BUILD_DEPENDS= ${LOCALBASE}/lib/libxul/xpidl:${PORTSDIR}/www/libxul
+BUILD_DEPENDS= ${LOCALBASE}/lib/libxul/xpidl:${PORTSDIR}/www/libxul19
ONLY_FOR_ARCHS= amd64 i386