View | Details | Raw Unified | Return to bug 201769 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-6 / +7 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	thunderbird
4
PORTNAME=	thunderbird
5
DISTVERSION=	31.7.0
5
DISTVERSION=	38.1.0
6
PORTREVISION=	1
6
PORTREVISION=	1
7
CATEGORIES=	mail news net-im ipv6
7
CATEGORIES=	mail news net-im ipv6
8
MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
8
MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
Lines 21-27 Link Here
21
		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
21
		harfbuzz>=0.9.25:${PORTSDIR}/print/harfbuzz \
22
		graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \
22
		graphite2>=1.2.4:${PORTSDIR}/graphics/graphite2 \
23
		libvorbis>=1.3.5:${PORTSDIR}/audio/libvorbis \
23
		libvorbis>=1.3.5:${PORTSDIR}/audio/libvorbis \
24
		opus>=1.1:${PORTSDIR}/audio/opus \
25
		libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \
24
		libvpx>=1.3.0:${PORTSDIR}/multimedia/libvpx \
26
		sqlite3>=3.8.4.2:${PORTSDIR}/databases/sqlite3 \
25
		sqlite3>=3.8.4.2:${PORTSDIR}/databases/sqlite3 \
27
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
26
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:${PORTSDIR}/databases/py-sqlite3 \
Lines 29-43 Link Here
29
		autoconf-2.13:${PORTSDIR}/devel/autoconf213 \
28
		autoconf-2.13:${PORTSDIR}/devel/autoconf213 \
30
		zip:${PORTSDIR}/archivers/zip \
29
		zip:${PORTSDIR}/archivers/zip \
31
		unzip:${PORTSDIR}/archivers/unzip
30
		unzip:${PORTSDIR}/archivers/unzip
31
#		opus>=1.1:${PORTSDIR}/audio/opus \
32
32
33
LIB_DEPENDS=	libv4l2.so:${PORTSDIR}/multimedia/libv4l
33
LIB_DEPENDS=	libv4l2.so:${PORTSDIR}/multimedia/libv4l
34
34
35
EM_VERSION=	1.8.2
35
EM_VERSION=	1.8.2
36
L_VERSION=	3.3.7
36
L_VERSION=	4.0.1
37
37
38
SSP_UNSAFE=	yes
38
SSP_UNSAFE=	yes
39
USE_GECKO=	gecko
39
USE_GECKO=	gecko
40
USE_MOZILLA=	# empty
40
# USE_MOZILLA=	# empty
41
USE_MOZILLA=	-opus
41
42
42
USE_QT5=	# empty
43
USE_QT5=	# empty
43
QT_NONSTANDARD=	yes
44
QT_NONSTANDARD=	yes
Lines 67-73 Link Here
67
68
68
.include <bsd.port.pre.mk>
69
.include <bsd.port.pre.mk>
69
70
70
WRKSRC=		${WRKDIR}/comm-esr31
71
WRKSRC=		${WRKDIR}/comm-esr38
71
MOZSRC:=	${WRKSRC}/mozilla
72
MOZSRC:=	${WRKSRC}/mozilla
72
73
73
XPI_LIBDIR=	${PREFIX}/lib/xpi
74
XPI_LIBDIR=	${PREFIX}/lib/xpi
Lines 103-109 Link Here
103
MOZ_OPTIONS+=	--enable-calendar
104
MOZ_OPTIONS+=	--enable-calendar
104
MOZ_MK_OPTIONS+=	MOZ_CO_PROJECT=calendar
105
MOZ_MK_OPTIONS+=	MOZ_CO_PROJECT=calendar
105
LIGHTNING_DIR=	share/lightning
106
LIGHTNING_DIR=	share/lightning
106
XPI_FILE=	${MOZ_OBJDIR}/mozilla/dist/xpi-stage/lightning-${L_VERSION}.en-US.${OPSYS:tl}${OSREL}-${ARCH:S/amd64/x86_64/}.xpi
107
XPI_FILE=	${MOZ_OBJDIR}/dist/xpi-stage/lightning-${L_VERSION}.en-US.${OPSYS:tl}${OSREL}-${ARCH:S/amd64/x86_64/}.xpi
107
XPI_ORIG_ID=	{e2fda1a4-762b-4020-b5ad-a41df1933103}
108
XPI_ORIG_ID=	{e2fda1a4-762b-4020-b5ad-a41df1933103}
108
XPI_ID=		lightning@thunderbird.mozilla.org
109
XPI_ID=		lightning@thunderbird.mozilla.org
109
.else
110
.else
(-)distinfo (-2 / +2 lines)
Lines 1-4 Link Here
1
SHA256 (thunderbird-31.7.0.source.tar.bz2) = dc3a6afaab486ba09745898f55986f98cc9bf7647cd992849f9c7ead563479b7
1
SHA256 (thunderbird-38.1.0.source.tar.bz2) = ddf1fd6048f07370bb0375eac76e687c19d29100c19e9f86fc04bb88d4409787
2
SIZE (thunderbird-31.7.0.source.tar.bz2) = 171059989
2
SIZE (thunderbird-38.1.0.source.tar.bz2) = 204161689
3
SHA256 (enigmail-1.8.2.tar.gz) = 1d2700799bc52aaa8e8c9f7a0f5111281ff9fbdffc093cdff070657d574eb2a6
3
SHA256 (enigmail-1.8.2.tar.gz) = 1d2700799bc52aaa8e8c9f7a0f5111281ff9fbdffc093cdff070657d574eb2a6
4
SIZE (enigmail-1.8.2.tar.gz) = 1604159
4
SIZE (enigmail-1.8.2.tar.gz) = 1604159
(-)files/patch-bug1013675 (-88 lines)
Lines 1-88 Link Here
1
diff --git xpcom/base/nsDebugImpl.cpp xpcom/base/nsDebugImpl.cpp
2
index 13a286f..293bd73 100644
3
--- mozilla/xpcom/base/nsDebugImpl.cpp
4
+++ mozilla/xpcom/base/nsDebugImpl.cpp
5
@@ -45,12 +45,43 @@
6
 #endif
7
 #endif
8
 
9
-#if defined(XP_MACOSX)
10
+#if defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
11
+ || defined(__NetBSD__) || defined(__OpenBSD__)
12
 #include <stdbool.h>
13
 #include <unistd.h>
14
+#include <sys/param.h>
15
 #include <sys/sysctl.h>
16
 #endif
17
 
18
+#if defined(__OpenBSD__)
19
+#include <sys/proc.h>
20
+#endif
21
+
22
+#if defined(__DragonFly__) || defined(__FreeBSD__)
23
+#include <sys/user.h>
24
+#endif
25
+
26
+#if defined(__NetBSD__)
27
+#undef KERN_PROC
28
+#define KERN_PROC KERN_PROC2
29
+#define KINFO_PROC struct kinfo_proc2
30
+#else
31
+#define KINFO_PROC struct kinfo_proc
32
+#endif
33
+
34
+#if defined(XP_MACOSX)
35
+#define KP_FLAGS kp_proc.p_flag
36
+#elif defined(__DragonFly__)
37
+#define KP_FLAGS kp_flags
38
+#elif defined(__FreeBSD__)
39
+#define KP_FLAGS ki_flag
40
+#elif defined(__OpenBSD__) && !defined(_P_TRACED)
41
+#define KP_FLAGS p_psflags
42
+#define P_TRACED PS_TRACED
43
+#else
44
+#define KP_FLAGS p_flag
45
+#endif
46
+
47
 #include "mozilla/mozalloc_abort.h"
48
 
49
 static void
50
@@ -144,16 +175,22 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
51
 
52
 #if defined(XP_WIN)
53
   *aResult = ::IsDebuggerPresent();
54
-#elif defined(XP_MACOSX)
55
+#elif defined(XP_MACOSX) || defined(__DragonFly__) || defined(__FreeBSD__) \
56
+   || defined(__NetBSD__) || defined(__OpenBSD__)
57
   // Specify the info we're looking for
58
-  int mib[4];
59
-  mib[0] = CTL_KERN;
60
-  mib[1] = KERN_PROC;
61
-  mib[2] = KERN_PROC_PID;
62
-  mib[3] = getpid();
63
+  int mib[] = {
64
+    CTL_KERN,
65
+    KERN_PROC,
66
+    KERN_PROC_PID,
67
+    getpid(),
68
+#if defined(__NetBSD__) || defined(__OpenBSD__)
69
+    sizeof(KINFO_PROC),
70
+    1,
71
+#endif
72
+  };
73
   size_t mibSize = sizeof(mib) / sizeof(int);
74
 
75
-  struct kinfo_proc info;
76
+  KINFO_PROC info;
77
   size_t infoSize = sizeof(info);
78
   memset(&info, 0, infoSize);
79
 
80
@@ -163,7 +200,7 @@ nsDebugImpl::GetIsDebuggerAttached(bool* aResult)
81
     return NS_OK;
82
   }
83
 
84
-  if (info.kp_proc.p_flag & P_TRACED) {
85
+  if (info.KP_FLAGS & P_TRACED) {
86
     *aResult = true;
87
   }
88
 #endif
(-)files/patch-bug1015547 (-95 lines)
Lines 1-95 Link Here
1
diff --git configure.in configure.in
2
index 7bed45f..053de17 100644
3
--- mozilla/configure.in
4
+++ mozilla/configure.in
5
@@ -2950,7 +2950,7 @@ dnl Checks for library functions.
6
 dnl ========================================================
7
 AC_PROG_GCC_TRADITIONAL
8
 AC_FUNC_MEMCMP
9
-AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r)
10
+AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize localtime_r arc4random arc4random_buf)
11
 
12
 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
13
 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
14
diff --git xpcom/base/nsUUIDGenerator.cpp xpcom/base/nsUUIDGenerator.cpp
15
index 0687344..ca3ff8b 100644
16
--- mozilla/xpcom/base/nsUUIDGenerator.cpp
17
+++ mozilla/xpcom/base/nsUUIDGenerator.cpp
18
@@ -15,6 +15,10 @@
19
 
20
 #include "nsUUIDGenerator.h"
21
 
22
+#ifdef ANDROID
23
+extern "C" NS_EXPORT void arc4random_buf(void *, size_t);
24
+#endif
25
+
26
 using namespace mozilla;
27
 
28
 NS_IMPL_ISUPPORTS1(nsUUIDGenerator, nsIUUIDGenerator)
29
@@ -34,7 +38,7 @@ nsUUIDGenerator::Init()
30
     // We're a service, so we're guaranteed that Init() is not going
31
     // to be reentered while we're inside Init().
32
     
33
-#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(ANDROID)
34
+#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(HAVE_ARC4RANDOM)
35
     /* initialize random number generator using NSPR random noise */
36
     unsigned int seed;
37
 
38
@@ -67,7 +71,7 @@ nsUUIDGenerator::Init()
39
         return NS_ERROR_FAILURE;
40
 #endif
41
 
42
-#endif /* non XP_WIN and non XP_MACOSX */
43
+#endif /* non XP_WIN and non XP_MACOSX and non ARC4RANDOM */
44
 
45
     return NS_OK;
46
 }
47
@@ -114,13 +118,16 @@ nsUUIDGenerator::GenerateUUIDInPlace(nsID* id)
48
      * back to it; instead, we use the value returned when we called
49
      * initstate, since older glibc's have broken setstate() return values
50
      */
51
-#ifndef ANDROID
52
+#ifndef HAVE_ARC4RANDOM
53
     setstate(mState);
54
 #endif
55
 
56
+#ifdef HAVE_ARC4RANDOM_BUF
57
+    arc4random_buf(id, sizeof(nsID));
58
+#else /* HAVE_ARC4RANDOM_BUF */
59
     size_t bytesLeft = sizeof(nsID);
60
     while (bytesLeft > 0) {
61
-#ifdef ANDROID
62
+#ifdef HAVE_ARC4RANDOM
63
         long rval = arc4random();
64
         const size_t mRBytes = 4;
65
 #else
66
@@ -141,6 +148,7 @@ nsUUIDGenerator::GenerateUUIDInPlace(nsID* id)
67
 
68
         bytesLeft -= toWrite;
69
     }
70
+#endif /* HAVE_ARC4RANDOM_BUF */
71
 
72
     /* Put in the version */
73
     id->m2 &= 0x0fff;
74
@@ -150,7 +158,7 @@ nsUUIDGenerator::GenerateUUIDInPlace(nsID* id)
75
     id->m3[0] &= 0x3f;
76
     id->m3[0] |= 0x80;
77
 
78
-#ifndef ANDROID
79
+#ifndef HAVE_ARC4RANDOM
80
     /* Restore the previous RNG state */
81
     setstate(mSavedState);
82
 #endif
83
diff --git xpcom/base/nsUUIDGenerator.h xpcom/base/nsUUIDGenerator.h
84
index 6a24212..68ed6f2 100644
85
--- mozilla/xpcom/base/nsUUIDGenerator.h
86
+++ mozilla/xpcom/base/nsUUIDGenerator.h
87
@@ -27,7 +27,7 @@ private:
88
 protected:
89
 
90
     mozilla::Mutex mLock;
91
-#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(ANDROID)
92
+#if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(HAVE_ARC4RANDOM)
93
     char mState[128];
94
     char *mSavedState;
95
     uint8_t mRBytes;
(-)files/patch-bug1021171 (-193 lines)
Lines 1-193 Link Here
1
commit dd19f59
2
Author: Trevor Saunders <trev.saunders@gmail.com>
3
Date:   Fri Jun 6 15:31:30 2014 -0400
4
5
    bug 1021171 - don't return nulllptr in functions returning bool r=bz,waldo
6
---
7
 js/src/builtin/TypedObject.cpp        | 32 ++++++++++++++++----------------
8
 js/src/frontend/BytecodeCompiler.cpp  |  2 +-
9
 js/xpconnect/wrappers/XrayWrapper.cpp |  2 +-
10
 netwerk/ipc/NeckoParent.cpp           |  2 +-
11
 4 files changed, 19 insertions(+), 19 deletions(-)
12
13
diff --git js/src/builtin/TypedObject.cpp js/src/builtin/TypedObject.cpp
14
index 9e284b9..7a0a7fc 100644
15
--- mozilla/js/src/builtin/TypedObject.cpp
16
+++ mozilla/js/src/builtin/TypedObject.cpp
17
@@ -710,12 +710,12 @@ ArrayMetaTypeDescr::construct(JSContext *cx, unsigned argc, Value *vp)
18
     contents.append(")");
19
     RootedAtom stringRepr(cx, contents.finishAtom());
20
     if (!stringRepr)
21
-        return nullptr;
22
+        return false;
23
 
24
     // Extract ArrayType.prototype
25
     RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal));
26
     if (!arrayTypePrototype)
27
-        return nullptr;
28
+        return false;
29
 
30
     // Create the instance of ArrayType
31
     Rooted<UnsizedArrayTypeDescr *> obj(cx);
32
@@ -728,7 +728,7 @@ ArrayMetaTypeDescr::construct(JSContext *cx, unsigned argc, Value *vp)
33
     if (!JSObject::defineProperty(cx, obj, cx->names().length,
34
                                   UndefinedHandleValue, nullptr, nullptr,
35
                                   JSPROP_READONLY | JSPROP_PERMANENT))
36
-        return nullptr;
37
+        return false;
38
 
39
     args.rval().setObject(*obj);
40
     return true;
41
@@ -762,7 +762,7 @@ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
42
     if (!size.isValid()) {
43
         JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr,
44
                              JSMSG_TYPEDOBJECT_TOO_BIG);
45
-        return nullptr;
46
+        return false;
47
     }
48
 
49
     // Construct a canonical string `new ArrayType(<elementType>).dimension(N)`:
50
@@ -775,7 +775,7 @@ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
51
     contents.append(")");
52
     RootedAtom stringRepr(cx, contents.finishAtom());
53
     if (!stringRepr)
54
-        return nullptr;
55
+        return false;
56
 
57
     // Create the sized type object.
58
     Rooted<SizedArrayTypeDescr*> obj(cx);
59
@@ -793,7 +793,7 @@ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
60
     if (!JSObject::defineProperty(cx, obj, cx->names().length,
61
                                   lengthVal, nullptr, nullptr,
62
                                   JSPROP_READONLY | JSPROP_PERMANENT))
63
-        return nullptr;
64
+        return false;
65
 
66
     // Add `unsized` property, which is a link from the sized
67
     // array to the unsized array.
68
@@ -801,7 +801,7 @@ UnsizedArrayTypeDescr::dimension(JSContext *cx, unsigned int argc, jsval *vp)
69
     if (!JSObject::defineProperty(cx, obj, cx->names().unsized,
70
                                   unsizedTypeDescrValue, nullptr, nullptr,
71
                                   JSPROP_READONLY | JSPROP_PERMANENT))
72
-        return nullptr;
73
+        return false;
74
 
75
     args.rval().setObject(*obj);
76
     return true;
77
@@ -1253,7 +1253,7 @@ DefineSimpleTypeDescr(JSContext *cx,
78
     Rooted<TypedProto*> proto(cx);
79
     proto = NewObjectWithProto<TypedProto>(cx, objProto, nullptr, TenuredObject);
80
     if (!proto)
81
-        return nullptr;
82
+        return false;
83
     proto->initTypeDescrSlot(*descr);
84
     descr->initReservedSlot(JS_DESCR_SLOT_TYPROTO, ObjectValue(*proto));
85
 
86
@@ -1358,14 +1358,14 @@ GlobalObject::initTypedObjectModule(JSContext *cx, Handle<GlobalObject*> global)
87
 #define BINARYDATA_SCALAR_DEFINE(constant_, type_, name_)                       \
88
     if (!DefineSimpleTypeDescr<ScalarTypeDescr>(cx, global, module, constant_,      \
89
                                             cx->names().name_))                 \
90
-        return nullptr;
91
+        return false;
92
     JS_FOR_EACH_SCALAR_TYPE_REPR(BINARYDATA_SCALAR_DEFINE)
93
 #undef BINARYDATA_SCALAR_DEFINE
94
 
95
 #define BINARYDATA_REFERENCE_DEFINE(constant_, type_, name_)                    \
96
     if (!DefineSimpleTypeDescr<ReferenceTypeDescr>(cx, global, module, constant_,   \
97
                                                cx->names().name_))              \
98
-        return nullptr;
99
+        return false;
100
     JS_FOR_EACH_REFERENCE_TYPE_REPR(BINARYDATA_REFERENCE_DEFINE)
101
 #undef BINARYDATA_REFERENCE_DEFINE
102
 
103
@@ -1375,14 +1375,14 @@ GlobalObject::initTypedObjectModule(JSContext *cx, Handle<GlobalObject*> global)
104
     arrayType = DefineMetaTypeDescr<ArrayMetaTypeDescr>(
105
         cx, global, module, TypedObjectModuleObject::ArrayTypePrototype);
106
     if (!arrayType)
107
-        return nullptr;
108
+        return false;
109
 
110
     RootedValue arrayTypeValue(cx, ObjectValue(*arrayType));
111
     if (!JSObject::defineProperty(cx, module, cx->names().ArrayType,
112
                                   arrayTypeValue,
113
                                   nullptr, nullptr,
114
                                   JSPROP_READONLY | JSPROP_PERMANENT))
115
-        return nullptr;
116
+        return false;
117
 
118
     // StructType.
119
 
120
@@ -1390,14 +1390,14 @@ GlobalObject::initTypedObjectModule(JSContext *cx, Handle<GlobalObject*> global)
121
     structType = DefineMetaTypeDescr<StructMetaTypeDescr>(
122
         cx, global, module, TypedObjectModuleObject::StructTypePrototype);
123
     if (!structType)
124
-        return nullptr;
125
+        return false;
126
 
127
     RootedValue structTypeValue(cx, ObjectValue(*structType));
128
     if (!JSObject::defineProperty(cx, module, cx->names().StructType,
129
                                   structTypeValue,
130
                                   nullptr, nullptr,
131
                                   JSPROP_READONLY | JSPROP_PERMANENT))
132
-        return nullptr;
133
+        return false;
134
 
135
     // Everything is setup, install module on the global object:
136
     RootedValue moduleValue(cx, ObjectValue(*module));
137
@@ -1407,7 +1407,7 @@ GlobalObject::initTypedObjectModule(JSContext *cx, Handle<GlobalObject*> global)
138
                                   nullptr, nullptr,
139
                                   0))
140
     {
141
-        return nullptr;
142
+        return false;
143
     }
144
 
145
     return module;
146
@@ -2449,7 +2449,7 @@ TypedObject::constructUnsized(JSContext *cx, unsigned int argc, Value *vp)
147
         if (length < 0) {
148
             JS_ReportErrorNumber(cx, js_GetErrorMessage,
149
                                  nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS);
150
-            return nullptr;
151
+            return false;
152
         }
153
         Rooted<TypedObject*> obj(cx, createZeroed(cx, callee, length));
154
         if (!obj)
155
diff --git js/src/frontend/BytecodeCompiler.cpp js/src/frontend/BytecodeCompiler.cpp
156
index 5aacc23..aed45ca 100644
157
--- mozilla/js/src/frontend/BytecodeCompiler.cpp
158
+++ mozilla/js/src/frontend/BytecodeCompiler.cpp
159
@@ -544,7 +544,7 @@ CompileFunctionBody(JSContext *cx, MutableHandleFunction fun, const ReadOnlyComp
160
 
161
     RootedScriptSource sourceObject(cx, CreateScriptSourceObject(cx, options));
162
     if (!sourceObject)
163
-        return nullptr;
164
+        return false;
165
     ScriptSource* ss = sourceObject->source();
166
 
167
     SourceCompressionTask sct(cx);
168
diff --git js/xpconnect/wrappers/XrayWrapper.cpp js/xpconnect/wrappers/XrayWrapper.cpp
169
index fd6458b..ab48770 100644
170
--- mozilla/js/xpconnect/wrappers/XrayWrapper.cpp
171
+++ mozilla/js/xpconnect/wrappers/XrayWrapper.cpp
172
@@ -363,7 +363,7 @@ public:
173
         {
174
             JSAutoCompartment ac(cx, target);
175
             if (!JS_GetClassPrototype(cx, key, protop))
176
-                return nullptr;
177
+                return false;
178
         }
179
         return JS_WrapObject(cx, protop);
180
     }
181
diff --git netwerk/ipc/NeckoParent.cpp netwerk/ipc/NeckoParent.cpp
182
index 96dbb1d..ef3293b 100644
183
--- mozilla/netwerk/ipc/NeckoParent.cpp
184
+++ mozilla/netwerk/ipc/NeckoParent.cpp
185
@@ -365,7 +365,7 @@ NeckoParent::RecvPRtspChannelConstructor(
186
   RtspChannelParent* p = static_cast<RtspChannelParent*>(aActor);
187
   return p->Init(aConnectArgs);
188
 #else
189
-  return nullptr;
190
+  return false;
191
 #endif
192
 }
193
 
(-)files/patch-bug1021761 (-124 / +95 lines)
Lines 1-8 Link Here
1
diff --git configure.in configure.in
1
--- ./mozilla/configure.in.orig	2015-07-07 19:45:45.000000000 +0200
2
index 48e60c0..ec08417 100644
2
+++ ./mozilla/configure.in	2015-07-20 17:24:10.000000000 +0200
3
--- mozilla/configure.in
3
@@ -5606,6 +5606,67 @@
4
+++ mozilla/configure.in
5
@@ -5591,6 +5591,67 @@ fi
6
 AC_SUBST(MOZ_WEBM_ENCODER)
4
 AC_SUBST(MOZ_WEBM_ENCODER)
7
 
5
 
8
 dnl ==================================
6
 dnl ==================================
Lines 70-89 Link Here
70
 dnl = Check alsa availability on Linux
68
 dnl = Check alsa availability on Linux
71
 dnl ==================================
69
 dnl ==================================
72
 
70
 
73
diff --git media/libcubeb/AUTHORS media/libcubeb/AUTHORS
71
--- ./mozilla/media/libcubeb/AUTHORS.orig	2015-07-07 19:45:45.000000000 +0200
74
index b441e8a..950d9e5 100644
72
+++ ./mozilla/media/libcubeb/AUTHORS	2015-07-20 17:24:33.000000000 +0200
75
--- mozilla/media/libcubeb/AUTHORS
73
@@ -4,3 +4,4 @@
76
+++ mozilla/media/libcubeb/AUTHORS
77
@@ -4,3 +4,4 @@ Michael Wu <mwu@mozilla.com>
78
 Paul Adenot <paul@paul.cx>
74
 Paul Adenot <paul@paul.cx>
79
 David Richards <drichards@mozilla.com>
75
 David Richards <drichards@mozilla.com>
80
 Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
76
 Sebastien Alaiwan <sebastien.alaiwan@gmail.com>
81
+Evgeniy Vodolazskiy <waterlaz@gmail.com>
77
+Evgeniy Vodolazskiy <waterlaz@gmail.com>
82
diff --git media/libcubeb/src/cubeb.c media/libcubeb/src/cubeb.c
78
--- ./mozilla/media/libcubeb/src/cubeb.c.orig	2015-07-07 19:45:45.000000000 +0200
83
index 9c3adcc..45d765b 100644
79
+++ ./mozilla/media/libcubeb/src/cubeb.c	2015-07-20 17:24:51.000000000 +0200
84
--- mozilla/media/libcubeb/src/cubeb.c
80
@@ -56,6 +56,9 @@
85
+++ mozilla/media/libcubeb/src/cubeb.c
86
@@ -54,6 +54,9 @@ int opensl_init(cubeb ** context, char const * context_name);
87
 #if defined(USE_AUDIOTRACK)
81
 #if defined(USE_AUDIOTRACK)
88
 int audiotrack_init(cubeb ** context, char const * context_name);
82
 int audiotrack_init(cubeb ** context, char const * context_name);
89
 #endif
83
 #endif
Lines 93-99 Link Here
93
 
87
 
94
 int
88
 int
95
 validate_stream_params(cubeb_stream_params stream_params)
89
 validate_stream_params(cubeb_stream_params stream_params)
96
@@ -120,6 +123,9 @@ cubeb_init(cubeb ** context, char const * context_name)
90
@@ -122,6 +125,9 @@
97
 #if defined(USE_AUDIOTRACK)
91
 #if defined(USE_AUDIOTRACK)
98
     audiotrack_init,
92
     audiotrack_init,
99
 #endif
93
 #endif
Lines 103-113 Link Here
103
   };
97
   };
104
   int i;
98
   int i;
105
 
99
 
106
diff --git media/libcubeb/src/cubeb_alsa.c media/libcubeb/src/cubeb_alsa.c
100
--- ./mozilla/media/libcubeb/src/cubeb_alsa.c.orig	2015-07-20 19:30:37.000000000 +0200
107
index a962553..1f780f4 100644
101
+++ ./mozilla/media/libcubeb/src/cubeb_alsa.c	2015-07-20 19:29:38.000000000 +0200
108
--- mozilla/media/libcubeb/src/cubeb_alsa.c
102
@@ -12,6 +12,7 @@
109
+++ mozilla/media/libcubeb/src/cubeb_alsa.c
110
@@ -11,6 +11,7 @@
111
 #include <sys/time.h>
103
 #include <sys/time.h>
112
 #include <assert.h>
104
 #include <assert.h>
113
 #include <limits.h>
105
 #include <limits.h>
Lines 115-121 Link Here
115
 #include <poll.h>
107
 #include <poll.h>
116
 #include <unistd.h>
108
 #include <unistd.h>
117
 #include <alsa/asoundlib.h>
109
 #include <alsa/asoundlib.h>
118
@@ -24,6 +25,50 @@
110
@@ -25,6 +26,50 @@
119
 
111
 
120
 #define ALSA_PA_PLUGIN "ALSA <-> PulseAudio PCM I/O Plugin"
112
 #define ALSA_PA_PLUGIN "ALSA <-> PulseAudio PCM I/O Plugin"
121
 
113
 
Lines 166-172 Link Here
166
 /* ALSA is not thread-safe.  snd_pcm_t instances are individually protected
158
 /* ALSA is not thread-safe.  snd_pcm_t instances are individually protected
167
    by the owning cubeb_stream's mutex.  snd_pcm_t creation and destruction
159
    by the owning cubeb_stream's mutex.  snd_pcm_t creation and destruction
168
    is not thread-safe until ALSA 1.0.24 (see alsa-lib.git commit 91c9c8f1),
160
    is not thread-safe until ALSA 1.0.24 (see alsa-lib.git commit 91c9c8f1),
169
@@ -64,6 +109,8 @@ struct cubeb {
161
@@ -65,6 +110,8 @@
170
      workaround is not required. */
162
      workaround is not required. */
171
   snd_config_t * local_config;
163
   snd_config_t * local_config;
172
   int is_pa;
164
   int is_pa;
Lines 175-181 Link Here
175
 };
167
 };
176
 
168
 
177
 enum stream_state {
169
 enum stream_state {
178
@@ -262,7 +309,7 @@ alsa_refill_stream(cubeb_stream * stm)
170
@@ -263,7 +310,7 @@
179
 
171
 
180
   pthread_mutex_lock(&stm->mutex);
172
   pthread_mutex_lock(&stm->mutex);
181
 
173
 
Lines 184-190 Link Here
184
   if (r < 0 || revents != POLLOUT) {
176
   if (r < 0 || revents != POLLOUT) {
185
     /* This should be a stream error; it makes no sense for poll(2) to wake
177
     /* This should be a stream error; it makes no sense for poll(2) to wake
186
        for this stream and then have the stream report that it's not ready.
178
        for this stream and then have the stream report that it's not ready.
187
@@ -271,10 +318,10 @@ alsa_refill_stream(cubeb_stream * stm)
179
@@ -272,10 +319,10 @@
188
     return RUNNING;
180
     return RUNNING;
189
   }
181
   }
190
 
182
 
Lines 198-204 Link Here
198
   }
190
   }
199
 
191
 
200
   /* Failed to recover from an xrun, this stream must be broken. */
192
   /* Failed to recover from an xrun, this stream must be broken. */
201
@@ -293,8 +340,8 @@ alsa_refill_stream(cubeb_stream * stm)
193
@@ -294,8 +341,8 @@
202
      available to write.  If avail is still zero here, the stream must be in
194
      available to write.  If avail is still zero here, the stream must be in
203
      a funky state, so recover and try again. */
195
      a funky state, so recover and try again. */
204
   if (avail == 0) {
196
   if (avail == 0) {
Lines 209-229 Link Here
209
     if (avail <= 0) {
201
     if (avail <= 0) {
210
       pthread_mutex_unlock(&stm->mutex);
202
       pthread_mutex_unlock(&stm->mutex);
211
       stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
203
       stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
212
@@ -302,7 +349,7 @@ alsa_refill_stream(cubeb_stream * stm)
204
@@ -303,7 +350,7 @@
213
     }
205
     }
214
   }
206
   }
215
 
207
 
216
-  p = calloc(1, snd_pcm_frames_to_bytes(stm->pcm, avail));
208
-  p = calloc(1, snd_pcm_frames_to_bytes(stm->pcm, avail));
217
+  p = calloc(1, WRAP(snd_pcm_frames_to_bytes)(stm->pcm, avail));
209
+  p = calloc(1, WRAP(snd_pcm_frames_to_bytes(stm->pcm, avail)));
218
   assert(p);
210
   assert(p);
219
 
211
 
220
   pthread_mutex_unlock(&stm->mutex);
212
   pthread_mutex_unlock(&stm->mutex);
221
@@ -313,10 +360,10 @@ alsa_refill_stream(cubeb_stream * stm)
213
@@ -328,10 +375,10 @@
222
     return ERROR;
214
         b[i] *= stm->volume;
223
   }
215
       }
224
   if (got > 0) {
216
     }
225
-    snd_pcm_sframes_t wrote = snd_pcm_writei(stm->pcm, p, got);
217
-    wrote = snd_pcm_writei(stm->pcm, p, got);
226
+    snd_pcm_sframes_t wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
218
+    wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
227
     if (wrote == -EPIPE) {
219
     if (wrote == -EPIPE) {
228
-      snd_pcm_recover(stm->pcm, wrote, 1);
220
-      snd_pcm_recover(stm->pcm, wrote, 1);
229
-      wrote = snd_pcm_writei(stm->pcm, p, got);
221
-      wrote = snd_pcm_writei(stm->pcm, p, got);
Lines 232-238 Link Here
232
     }
224
     }
233
     assert(wrote >= 0 && wrote == got);
225
     assert(wrote >= 0 && wrote == got);
234
     stm->write_position += wrote;
226
     stm->write_position += wrote;
235
@@ -342,7 +389,7 @@ alsa_refill_stream(cubeb_stream * stm)
227
@@ -343,7 +390,7 @@
236
 
228
 
237
     /* Fill the remaining buffer with silence to guarantee one full period
229
     /* Fill the remaining buffer with silence to guarantee one full period
238
        has been written. */
230
        has been written. */
Lines 241-247 Link Here
241
 
233
 
242
     set_timeout(&stm->drain_timeout, buffer_time * 1000);
234
     set_timeout(&stm->drain_timeout, buffer_time * 1000);
243
 
235
 
244
@@ -453,26 +500,26 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
236
@@ -454,26 +501,26 @@
245
 
237
 
246
   slave_def = NULL;
238
   slave_def = NULL;
247
 
239
 
Lines 273-279 Link Here
273
     if (r < 0) {
265
     if (r < 0) {
274
       break;
266
       break;
275
     }
267
     }
276
@@ -481,7 +528,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
268
@@ -482,7 +529,7 @@
277
     if (r < 0 || r > (int) sizeof(node_name)) {
269
     if (r < 0 || r > (int) sizeof(node_name)) {
278
       break;
270
       break;
279
     }
271
     }
Lines 282-288 Link Here
282
     if (r < 0) {
274
     if (r < 0) {
283
       break;
275
       break;
284
     }
276
     }
285
@@ -490,7 +537,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm)
277
@@ -491,7 +538,7 @@
286
   } while (0);
278
   } while (0);
287
 
279
 
288
   if (slave_def) {
280
   if (slave_def) {
Lines 291-297 Link Here
291
   }
283
   }
292
 
284
 
293
   return NULL;
285
   return NULL;
294
@@ -513,22 +560,22 @@ init_local_config_with_workaround(char const * pcm_name)
286
@@ -514,22 +561,22 @@
295
 
287
 
296
   lconf = NULL;
288
   lconf = NULL;
297
 
289
 
Lines 301-307 Link Here
301
   }
293
   }
302
 
294
 
303
-  r = snd_config_copy(&lconf, snd_config);
295
-  r = snd_config_copy(&lconf, snd_config);
304
+  r = WRAP(snd_config_copy)(&lconf, *WRAP(snd_config));
296
+  r = WRAP(snd_config_copy)(&lconf, snd_config);
305
   if (r < 0) {
297
   if (r < 0) {
306
     return NULL;
298
     return NULL;
307
   }
299
   }
Lines 318-324 Link Here
318
     if (r < 0) {
310
     if (r < 0) {
319
       break;
311
       break;
320
     }
312
     }
321
@@ -537,7 +584,7 @@ init_local_config_with_workaround(char const * pcm_name)
313
@@ -538,7 +585,7 @@
322
     if (r < 0 || r > (int) sizeof(node_name)) {
314
     if (r < 0 || r > (int) sizeof(node_name)) {
323
       break;
315
       break;
324
     }
316
     }
Lines 327-333 Link Here
327
     if (r < 0) {
319
     if (r < 0) {
328
       break;
320
       break;
329
     }
321
     }
330
@@ -548,12 +595,12 @@ init_local_config_with_workaround(char const * pcm_name)
322
@@ -549,12 +596,12 @@
331
     }
323
     }
332
 
324
 
333
     /* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */
325
     /* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */
Lines 342-348 Link Here
342
     if (r < 0) {
334
     if (r < 0) {
343
       break;
335
       break;
344
     }
336
     }
345
@@ -564,18 +611,18 @@ init_local_config_with_workaround(char const * pcm_name)
337
@@ -565,18 +612,18 @@
346
 
338
 
347
     /* Don't clobber an explicit existing handle_underrun value, set it only
339
     /* Don't clobber an explicit existing handle_underrun value, set it only
348
        if it doesn't already exist. */
340
        if it doesn't already exist. */
Lines 364-370 Link Here
364
     if (r < 0) {
356
     if (r < 0) {
365
       break;
357
       break;
366
     }
358
     }
367
@@ -583,7 +630,7 @@ init_local_config_with_workaround(char const * pcm_name)
359
@@ -584,7 +631,7 @@
368
     return lconf;
360
     return lconf;
369
   } while (0);
361
   } while (0);
370
 
362
 
Lines 373-379 Link Here
373
 
365
 
374
   return NULL;
366
   return NULL;
375
 }
367
 }
376
@@ -595,9 +642,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, snd_pcm_stream_t stream, snd_config_t * l
368
@@ -596,9 +643,9 @@
377
 
369
 
378
   pthread_mutex_lock(&cubeb_alsa_mutex);
370
   pthread_mutex_lock(&cubeb_alsa_mutex);
379
   if (local_config) {
371
   if (local_config) {
Lines 385-391 Link Here
385
   }
377
   }
386
   pthread_mutex_unlock(&cubeb_alsa_mutex);
378
   pthread_mutex_unlock(&cubeb_alsa_mutex);
387
 
379
 
388
@@ -610,7 +657,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm)
380
@@ -611,7 +658,7 @@
389
   int r;
381
   int r;
390
 
382
 
391
   pthread_mutex_lock(&cubeb_alsa_mutex);
383
   pthread_mutex_lock(&cubeb_alsa_mutex);
Lines 394-400 Link Here
394
   pthread_mutex_unlock(&cubeb_alsa_mutex);
386
   pthread_mutex_unlock(&cubeb_alsa_mutex);
395
 
387
 
396
   return r;
388
   return r;
397
@@ -667,12 +714,65 @@ alsa_init(cubeb ** context, char const * context_name)
389
@@ -668,12 +715,65 @@
398
   pthread_attr_t attr;
390
   pthread_attr_t attr;
399
   snd_pcm_t * dummy;
391
   snd_pcm_t * dummy;
400
 
392
 
Lines 461-467 Link Here
461
     cubeb_alsa_error_handler_set = 1;
453
     cubeb_alsa_error_handler_set = 1;
462
   }
454
   }
463
   pthread_mutex_unlock(&cubeb_alsa_mutex);
455
   pthread_mutex_unlock(&cubeb_alsa_mutex);
464
@@ -680,6 +780,8 @@ alsa_init(cubeb ** context, char const * context_name)
456
@@ -681,6 +781,8 @@
465
   ctx = calloc(1, sizeof(*ctx));
457
   ctx = calloc(1, sizeof(*ctx));
466
   assert(ctx);
458
   assert(ctx);
467
 
459
 
Lines 470-476 Link Here
470
   ctx->ops = &alsa_ops;
462
   ctx->ops = &alsa_ops;
471
 
463
 
472
   r = pthread_mutex_init(&ctx->mutex, NULL);
464
   r = pthread_mutex_init(&ctx->mutex, NULL);
473
@@ -729,7 +831,7 @@ alsa_init(cubeb ** context, char const * context_name)
465
@@ -730,7 +832,7 @@
474
        config fails with EINVAL, the PA PCM is too old for this workaround. */
466
        config fails with EINVAL, the PA PCM is too old for this workaround. */
475
     if (r == -EINVAL) {
467
     if (r == -EINVAL) {
476
       pthread_mutex_lock(&cubeb_alsa_mutex);
468
       pthread_mutex_lock(&cubeb_alsa_mutex);
Lines 479-485 Link Here
479
       pthread_mutex_unlock(&cubeb_alsa_mutex);
471
       pthread_mutex_unlock(&cubeb_alsa_mutex);
480
       ctx->local_config = NULL;
472
       ctx->local_config = NULL;
481
     } else if (r >= 0) {
473
     } else if (r >= 0) {
482
@@ -768,9 +870,13 @@ alsa_destroy(cubeb * ctx)
474
@@ -769,9 +871,13 @@
483
   pthread_mutex_destroy(&ctx->mutex);
475
   pthread_mutex_destroy(&ctx->mutex);
484
   free(ctx->fds);
476
   free(ctx->fds);
485
 
477
 
Lines 494-500 Link Here
494
     pthread_mutex_unlock(&cubeb_alsa_mutex);
486
     pthread_mutex_unlock(&cubeb_alsa_mutex);
495
   }
487
   }
496
 
488
 
497
@@ -838,7 +944,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name,
489
@@ -839,7 +945,7 @@
498
     return CUBEB_ERROR;
490
     return CUBEB_ERROR;
499
   }
491
   }
500
 
492
 
Lines 503-509 Link Here
503
   assert(r == 0);
495
   assert(r == 0);
504
 
496
 
505
   /* Ugly hack: the PA ALSA plugin allows buffer configurations that can't
497
   /* Ugly hack: the PA ALSA plugin allows buffer configurations that can't
506
@@ -848,23 +954,23 @@ alsa_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name,
498
@@ -849,23 +955,23 @@
507
     latency = latency < 500 ? 500 : latency;
499
     latency = latency < 500 ? 500 : latency;
508
   }
500
   }
509
 
501
 
Lines 533-586 Link Here
533
   assert((nfds_t) r == stm->nfds);
525
   assert((nfds_t) r == stm->nfds);
534
 
526
 
535
   r = pthread_cond_init(&stm->cond, NULL);
527
   r = pthread_cond_init(&stm->cond, NULL);
536
@@ -937,12 +1043,12 @@ alsa_get_max_channel_count(cubeb * ctx, uint32_t * max_channels)
528
@@ -938,7 +1044,7 @@
537
     return CUBEB_ERROR;
529
     return CUBEB_ERROR;
538
   }
530
   }
539
 
531
 
540
-  rv = snd_pcm_hw_params_any(stm->pcm, hw_params);
532
-  r = snd_pcm_hw_params_any(stm->pcm, hw_params);
541
+  rv = WRAP(snd_pcm_hw_params_any)(stm->pcm, hw_params);
533
+  r = WRAP(snd_pcm_hw_params_any)(stm->pcm, hw_params);
542
   if (rv < 0) {
534
   if (r < 0) {
543
     return CUBEB_ERROR;
535
     return CUBEB_ERROR;
544
   }
536
   }
537
@@ -963,18 +1069,18 @@
545
 
538
 
546
-  rv = snd_pcm_hw_params_get_channels_max(hw_params, max_channels);
547
+  rv = WRAP(snd_pcm_hw_params_get_channels_max)(hw_params, max_channels);
548
   if (rv < 0) {
549
     return CUBEB_ERROR;
550
   }
551
@@ -962,34 +1068,34 @@ alsa_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate) {
552
 
553
   /* get a pcm, disabling resampling, so we get a rate the
539
   /* get a pcm, disabling resampling, so we get a rate the
554
    * hardware/dmix/pulse/etc. supports. */
540
    * hardware/dmix/pulse/etc. supports. */
555
-  rv = snd_pcm_open(&pcm, "", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
541
-  r = snd_pcm_open(&pcm, "default", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
556
+  rv = WRAP(snd_pcm_open)(&pcm, "", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
542
+  r = WRAP(snd_pcm_open)(&pcm, "default", SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0);
557
   if (rv < 0) {
543
   if (r < 0) {
558
     return CUBEB_ERROR;
544
     return CUBEB_ERROR;
559
   }
545
   }
560
 
546
 
561
-  rv = snd_pcm_hw_params_any(pcm, hw_params);
547
-  r = snd_pcm_hw_params_any(pcm, hw_params);
562
+  rv = WRAP(snd_pcm_hw_params_any)(pcm, hw_params);
548
+  r = WRAP(snd_pcm_hw_params_any)(pcm, hw_params);
563
   if (rv < 0) {
549
   if (r < 0) {
564
-    snd_pcm_close(pcm);
550
-    snd_pcm_close(pcm);
565
+    WRAP(snd_pcm_close)(pcm);
551
+    WRAP(snd_pcm_close)(pcm);
566
     return CUBEB_ERROR;
552
     return CUBEB_ERROR;
567
   }
553
   }
568
 
554
 
569
-  rv = snd_pcm_hw_params_get_rate(hw_params, rate, &dir);
555
-  r = snd_pcm_hw_params_get_rate(hw_params, rate, &dir);
570
+  rv = WRAP(snd_pcm_hw_params_get_rate)(hw_params, rate, &dir);
556
+  r = WRAP(snd_pcm_hw_params_get_rate)(hw_params, rate, &dir);
571
   if (rv >= 0) {
557
   if (r >= 0) {
572
     /* There is a default rate: use it. */
558
     /* There is a default rate: use it. */
573
-    snd_pcm_close(pcm);
559
     snd_pcm_close(pcm);
574
+    WRAP(snd_pcm_close)(pcm);
560
@@ -984,13 +1090,13 @@
575
     return CUBEB_OK;
576
   }
577
 
578
   /* Use a common rate, alsa may adjust it based on hw/etc. capabilities. */
561
   /* Use a common rate, alsa may adjust it based on hw/etc. capabilities. */
579
   *rate = 44100;
562
   *rate = 44100;
580
 
563
 
581
-  rv = snd_pcm_hw_params_set_rate_near(pcm, hw_params, rate, NULL);
564
-  r = snd_pcm_hw_params_set_rate_near(pcm, hw_params, rate, NULL);
582
+  rv = WRAP(snd_pcm_hw_params_set_rate_near)(pcm, hw_params, rate, NULL);
565
+  r = WRAP(snd_pcm_hw_params_set_rate_near)(pcm, hw_params, rate, NULL);
583
   if (rv < 0) {
566
   if (r < 0) {
584
-    snd_pcm_close(pcm);
567
-    snd_pcm_close(pcm);
585
+    WRAP(snd_pcm_close)(pcm);
568
+    WRAP(snd_pcm_close)(pcm);
586
     return CUBEB_ERROR;
569
     return CUBEB_ERROR;
Lines 591-597 Link Here
591
 
574
 
592
   return CUBEB_OK;
575
   return CUBEB_OK;
593
 }
576
 }
594
@@ -1013,7 +1119,7 @@ alsa_stream_start(cubeb_stream * stm)
577
@@ -1014,7 +1120,7 @@
595
   ctx = stm->context;
578
   ctx = stm->context;
596
 
579
 
597
   pthread_mutex_lock(&stm->mutex);
580
   pthread_mutex_lock(&stm->mutex);
Lines 600-606 Link Here
600
   gettimeofday(&stm->last_activity, NULL);
583
   gettimeofday(&stm->last_activity, NULL);
601
   pthread_mutex_unlock(&stm->mutex);
584
   pthread_mutex_unlock(&stm->mutex);
602
 
585
 
603
@@ -1047,7 +1153,7 @@ alsa_stream_stop(cubeb_stream * stm)
586
@@ -1048,7 +1154,7 @@
604
   pthread_mutex_unlock(&ctx->mutex);
587
   pthread_mutex_unlock(&ctx->mutex);
605
 
588
 
606
   pthread_mutex_lock(&stm->mutex);
589
   pthread_mutex_lock(&stm->mutex);
Lines 609-615 Link Here
609
   pthread_mutex_unlock(&stm->mutex);
592
   pthread_mutex_unlock(&stm->mutex);
610
 
593
 
611
   return CUBEB_OK;
594
   return CUBEB_OK;
612
@@ -1063,8 +1169,8 @@ alsa_stream_get_position(cubeb_stream * stm, uint64_t * position)
595
@@ -1064,8 +1170,8 @@
613
   pthread_mutex_lock(&stm->mutex);
596
   pthread_mutex_lock(&stm->mutex);
614
 
597
 
615
   delay = -1;
598
   delay = -1;
Lines 620-626 Link Here
620
     *position = stm->last_position;
603
     *position = stm->last_position;
621
     pthread_mutex_unlock(&stm->mutex);
604
     pthread_mutex_unlock(&stm->mutex);
622
     return CUBEB_OK;
605
     return CUBEB_OK;
623
@@ -1089,7 +1195,7 @@ alsa_stream_get_latency(cubeb_stream * stm, uint32_t * latency)
606
@@ -1090,7 +1196,7 @@
624
   snd_pcm_sframes_t delay;
607
   snd_pcm_sframes_t delay;
625
   /* This function returns the delay in frames until a frame written using
608
   /* This function returns the delay in frames until a frame written using
626
      snd_pcm_writei is sent to the DAC. The DAC delay should be < 1ms anyways. */
609
      snd_pcm_writei is sent to the DAC. The DAC delay should be < 1ms anyways. */
Lines 629-639 Link Here
629
     return CUBEB_ERROR;
612
     return CUBEB_ERROR;
630
   }
613
   }
631
 
614
 
632
diff --git media/libcubeb/src/cubeb_oss.c media/libcubeb/src/cubeb_oss.c
615
--- ./mozilla/media/libcubeb/src/cubeb_oss.c.orig	2015-07-20 19:42:45.000000000 +0200
633
new file mode 100644
616
+++ ./mozilla/media/libcubeb/src/cubeb_oss.c	2015-07-20 19:42:45.000000000 +0200
634
index 0000000..5e38e27
635
--- /dev/null
636
+++ mozilla/media/libcubeb/src/cubeb_oss.c
637
@@ -0,0 +1,397 @@
617
@@ -0,0 +1,397 @@
638
+/*
618
+/*
639
+ * Copyright © 2014 Mozilla Foundation
619
+ * Copyright © 2014 Mozilla Foundation
Lines 1032-1042 Link Here
1032
+  .stream_get_position = oss_stream_get_position,
1012
+  .stream_get_position = oss_stream_get_position,
1033
+  .stream_get_latency = oss_stream_get_latency
1013
+  .stream_get_latency = oss_stream_get_latency
1034
+};
1014
+};
1035
diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build
1015
--- ./mozilla/media/libcubeb/src/moz.build.orig	2015-07-07 19:45:45.000000000 +0200
1036
index 8b7a0dd..31212ce 100644
1016
+++ ./mozilla/media/libcubeb/src/moz.build	2015-07-20 19:42:58.000000000 +0200
1037
--- mozilla/media/libcubeb/src/moz.build
1017
@@ -17,6 +17,12 @@
1038
+++ mozilla/media/libcubeb/src/moz.build
1039
@@ -17,6 +17,12 @@ if CONFIG['MOZ_ALSA']:
1040
     ]
1018
     ]
1041
     DEFINES['USE_ALSA'] = True
1019
     DEFINES['USE_ALSA'] = True
1042
 
1020
 
Lines 1049-1055 Link Here
1049
 if CONFIG['MOZ_PULSEAUDIO']:
1027
 if CONFIG['MOZ_PULSEAUDIO']:
1050
     SOURCES += [
1028
     SOURCES += [
1051
         'cubeb_pulse.c',
1029
         'cubeb_pulse.c',
1052
@@ -75,5 +81,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
1030
@@ -75,5 +81,6 @@
1053
 
1031
 
1054
 FAIL_ON_WARNINGS = True
1032
 FAIL_ON_WARNINGS = True
1055
 
1033
 
Lines 1056-1091 Link Here
1056
+CFLAGS += CONFIG['MOZ_OSS_CFLAGS']
1034
+CFLAGS += CONFIG['MOZ_OSS_CFLAGS']
1057
 CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
1035
 CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
1058
 CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']
1036
 CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']
1059
diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
1037
--- ./mozilla/media/webrtc/signaling/test/moz.build.orig	2015-07-20 19:43:50.000000000 +0200
1060
index 991f03f..3d99eb5 100644
1038
+++ ./mozilla/media/webrtc/signaling/test/moz.build	2015-07-20 19:45:33.000000000 +0200
1061
--- mozilla/media/webrtc/signaling/test/Makefile.in
1039
@@ -112,8 +112,8 @@
1062
+++ mozilla/media/webrtc/signaling/test/Makefile.in
1040
 OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
1063
@@ -26,9 +26,9 @@ ifdef JS_SHARED_LIBRARY
1041
 OS_LIBS += CONFIG['REALTIME_LIBS']
1064
 LIBS += $(MOZ_JS_LIBS)
1065
 endif
1066
 
1042
 
1067
-ifdef MOZ_ALSA
1043
-if CONFIG['MOZ_ALSA']:
1068
+ifdef MOZ_OSS
1044
-    OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
1069
 LIBS += \
1045
+if CONFIG['MOZ_OSS']:
1070
-  $(MOZ_ALSA_LIBS) \
1046
+    OS_LIBS += CONFIG['MOZ_OSS_LIBS']
1071
+  $(MOZ_OSS_LIBS) \
1072
   $(NULL)
1073
 endif
1074
 
1047
 
1075
diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
1048
 if CONFIG['MOZ_NATIVE_JPEG']:
1076
index e191f13..4fb268a 100644
1049
     OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
1077
--- mozilla/toolkit/library/libxul.mk
1050
--- ./mozilla/toolkit/library/moz.build.orig	2015-07-20 19:41:09.000000000 +0200
1078
+++ mozilla/toolkit/library/libxul.mk
1051
+++ ./mozilla/toolkit/library/moz.build	2015-07-20 19:41:51.000000000 +0200
1079
@@ -146,9 +146,9 @@ OS_LIBS += $(call EXPAND_LIBNAME,secur32
1052
@@ -234,8 +234,8 @@
1080
 endif
1053
 if not CONFIG['MOZ_TREE_PIXMAN']:
1081
 endif
1054
     OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
1082
 
1055
 
1083
-ifdef MOZ_ALSA
1056
-if CONFIG['MOZ_ALSA']:
1084
-EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
1057
-    OS_LIBS += CONFIG['MOZ_ALSA_LIBS']
1085
-endif
1058
+if CONFIG['MOZ_OSS']:
1086
+ifdef MOZ_OSS
1059
+    OS_LIBS += CONFIG['MOZ_OSS_LIBS']
1087
+EXTRA_DSO_LDOPTS += $(MOZ_OSS_LIBS)
1088
+endif
1089
 
1060
 
1090
 ifdef HAVE_CLOCK_MONOTONIC
1061
 if CONFIG['HAVE_CLOCK_MONOTONIC']:
1091
 EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
1062
     OS_LIBS += CONFIG['REALTIME_LIBS']
(-)files/patch-bug1026828 (-20 lines)
Lines 1-20 Link Here
1
diff --git storage/src/moz.build storage/src/moz.build
2
index 4cd2551..5c40536 100644
3
--- mozilla/storage/src/moz.build
4
+++ mozilla/storage/src/moz.build
5
@@ -50,11 +50,14 @@ FINAL_LIBRARY = 'storagecomps'
6
 # (such as NSS) might trigger an initialization of sqlite and allocation
7
 # of memory using the default allocator, prior to the storage service
8
 # registering its allocator, causing memory management failures (bug 938730).
9
+# However, this is not an issue if both the jemalloc allocator and the default
10
+# allocator are the same thing.
11
 #
12
 # Note: On Windows our sqlite build assumes we use jemalloc.  If you disable
13
 # MOZ_STORAGE_MEMORY on Windows, you will also need to change the "ifdef
14
 # MOZ_MEMORY" options in db/sqlite3/src/Makefile.in.
15
-if CONFIG['MOZ_MEMORY'] and not CONFIG['MOZ_NATIVE_SQLITE']:
16
+if CONFIG['MOZ_MEMORY'] and (not CONFIG['MOZ_NATIVE_SQLITE']
17
+                             or CONFIG['MOZ_NATIVE_JEMALLOC']):
18
     if CONFIG['OS_TARGET'] != 'Android':
19
         DEFINES['MOZ_STORAGE_MEMORY'] = True
20
 
(-)files/patch-bug1041795 (-48 lines)
Lines 1-48 Link Here
1
diff --git config/rules.mk config/rules.mk
2
index 4d67eda..783942f 100644
3
--- mozilla/config/rules.mk
4
+++ mozilla/config/rules.mk
5
@@ -858,7 +858,7 @@ ifdef DTRACE_PROBE_OBJ
6
 ifndef DTRACE_LIB_DEPENDENT
7
 NON_DTRACE_OBJS := $(filter-out $(DTRACE_PROBE_OBJ),$(OBJS))
8
 $(DTRACE_PROBE_OBJ): $(NON_DTRACE_OBJS)
9
-	dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS)
10
+	dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS)
11
 endif
12
 endif
13
 endif
14
@@ -876,7 +876,7 @@ ifndef INCREMENTAL_LINKER
15
 endif
16
 ifdef DTRACE_LIB_DEPENDENT
17
 ifndef XP_MACOSX
18
-	dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o  $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
19
+	dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o  $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
20
 endif
21
 	$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE) $(if $(LIB_IS_C_ONLY),,$(STLPORT_LIBS))
22
 	@$(RM) $(DTRACE_PROBE_OBJ)
23
diff --git js/src/Makefile.in js/src/Makefile.in
24
index 28ca5e8..96793d7 100644
25
--- mozilla/js/src/Makefile.in
26
+++ mozilla/js/src/Makefile.in
27
@@ -342,7 +342,7 @@ endif
28
 
29
 ifdef HAVE_DTRACE
30
 $(CURDIR)/javascript-trace.h: $(srcdir)/devtools/javascript-trace.d
31
-	dtrace -h -s $(srcdir)/devtools/javascript-trace.d -o javascript-trace.h.in
32
+	dtrace -x nolibs -h -s $(srcdir)/devtools/javascript-trace.d -o javascript-trace.h.in
33
 	sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
34
 	    -e '/const/!s/char \*/const char */g' \
35
 	    javascript-trace.h.in > javascript-trace.h
36
diff --git probes/Makefile.in probes/Makefile.in
37
index 6d18f34..deec83f 100644
38
--- mozilla/probes/Makefile.in
39
+++ mozilla/probes/Makefile.in
40
@@ -7,7 +7,7 @@ export:: $(DIST)/include/mozilla-trace.h
41
 
42
 # Replace _DTRACE_VERSION with INCLUDE_MOZILLA_DTRACE
43
 $(DIST)/include/mozilla-trace.h: mozilla-trace.d Makefile
44
-	dtrace -h -s $(srcdir)/mozilla-trace.d -o mozilla-trace.h.tmp
45
+	dtrace -x nolibs -h -s $(srcdir)/mozilla-trace.d -o mozilla-trace.h.tmp
46
 	sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
47
 	    mozilla-trace.h.tmp > $(DIST)/include/mozilla-trace.h
48
 	rm mozilla-trace.h.tmp
(-)files/patch-bug1046224 (-26 lines)
Lines 1-26 Link Here
1
diff --git configure.in configure.in
2
index 1853029..559bd45 100644
3
--- mozilla/configure.in
4
+++ mozilla/configure.in
5
@@ -2651,7 +2651,7 @@ if test "$ac_cv_sockaddr_sa_len" = true ; then
6
   AC_DEFINE(HAVE_SA_LEN)
7
 fi
8
 
9
-AC_ARG_ENABLE(dtrace,
10
+MOZ_ARG_ENABLE_BOOL(dtrace,
11
               [  --enable-dtrace         build with dtrace support if available (default=no)],
12
               [enable_dtrace="yes"],)
13
 if test "x$enable_dtrace" = "xyes"; then
14
diff --git js/src/configure.in js/src/configure.in
15
index 134dfd3..682c1fb 100644
16
--- mozilla/js/src/configure.in
17
+++ mozilla/js/src/configure.in
18
@@ -2153,7 +2153,7 @@ dnl Quota support
19
 MOZ_CHECK_HEADERS(sys/quota.h)
20
 MOZ_CHECK_HEADERS(linux/quota.h)
21
 
22
-AC_ARG_ENABLE(dtrace,
23
+MOZ_ARG_ENABLE_BOOL(dtrace,
24
               [  --enable-dtrace         build with dtrace support if available (default=no)],
25
               [enable_dtrace="yes"],)
26
 if test "x$enable_dtrace" = "xyes"; then
(-)files/patch-bug1067377 (-78 lines)
Lines 1-78 Link Here
1
diff --git content/media/encoder/VP8TrackEncoder.cpp content/media/encoder/VP8TrackEncoder.cpp
2
index 452821c..ede21c5 100644
3
--- mozilla/content/media/encoder/VP8TrackEncoder.cpp
4
+++ mozilla/content/media/encoder/VP8TrackEncoder.cpp
5
@@ -84,7 +84,7 @@ VP8TrackEncoder::Init(int32_t aWidth, int32_t aHeight, int32_t aDisplayWidth,
6
   // Creating a wrapper to the image - setting image data to NULL. Actual
7
   // pointer will be set in encode. Setting align to 1, as it is meaningless
8
   // (actual memory is not allocated).
9
-  vpx_img_wrap(mVPXImageWrapper, IMG_FMT_I420,
10
+  vpx_img_wrap(mVPXImageWrapper, VPX_IMG_FMT_I420,
11
                mFrameWidth, mFrameHeight, 1, nullptr);
12
 
13
   config.g_w = mFrameWidth;
14
@@ -239,9 +239,9 @@ void VP8TrackEncoder::PrepareMutedFrame()
15
   uint8_t *cb = mMuteFrame.Elements() + yPlaneSize;
16
   uint8_t *cr = mMuteFrame.Elements() + yPlaneSize + uvPlaneSize;
17
 
18
-  mVPXImageWrapper->planes[PLANE_Y] = y;
19
-  mVPXImageWrapper->planes[PLANE_U] = cb;
20
-  mVPXImageWrapper->planes[PLANE_V] = cr;
21
+  mVPXImageWrapper->planes[VPX_PLANE_Y] = y;
22
+  mVPXImageWrapper->planes[VPX_PLANE_U] = cb;
23
+  mVPXImageWrapper->planes[VPX_PLANE_V] = cr;
24
   mVPXImageWrapper->stride[VPX_PLANE_Y] = mFrameWidth;
25
   mVPXImageWrapper->stride[VPX_PLANE_U] = halfWidth;
26
   mVPXImageWrapper->stride[VPX_PLANE_V] = halfWidth;
27
@@ -297,9 +297,9 @@ nsresult VP8TrackEncoder::PrepareRawFrame(VideoChunk &aChunk)
28
     const PlanarYCbCrImage::Data *data = yuv->GetData();
29
 
30
     if (isYUV420(data) && !data->mCbSkip) { // 420 planar
31
-      mVPXImageWrapper->planes[PLANE_Y] = data->mYChannel;
32
-      mVPXImageWrapper->planes[PLANE_U] = data->mCbChannel;
33
-      mVPXImageWrapper->planes[PLANE_V] = data->mCrChannel;
34
+      mVPXImageWrapper->planes[VPX_PLANE_Y] = data->mYChannel;
35
+      mVPXImageWrapper->planes[VPX_PLANE_U] = data->mCbChannel;
36
+      mVPXImageWrapper->planes[VPX_PLANE_V] = data->mCrChannel;
37
       mVPXImageWrapper->stride[VPX_PLANE_Y] = data->mYStride;
38
       mVPXImageWrapper->stride[VPX_PLANE_U] = data->mCbCrStride;
39
       mVPXImageWrapper->stride[VPX_PLANE_V] = data->mCbCrStride;
40
@@ -355,9 +355,9 @@ nsresult VP8TrackEncoder::PrepareRawFrame(VideoChunk &aChunk)
41
         return NS_ERROR_NOT_IMPLEMENTED;
42
       }
43
 
44
-      mVPXImageWrapper->planes[PLANE_Y] = y;
45
-      mVPXImageWrapper->planes[PLANE_U] = cb;
46
-      mVPXImageWrapper->planes[PLANE_V] = cr;
47
+      mVPXImageWrapper->planes[VPX_PLANE_Y] = y;
48
+      mVPXImageWrapper->planes[VPX_PLANE_U] = cb;
49
+      mVPXImageWrapper->planes[VPX_PLANE_V] = cr;
50
       mVPXImageWrapper->stride[VPX_PLANE_Y] = mFrameWidth;
51
       mVPXImageWrapper->stride[VPX_PLANE_U] = halfWidth;
52
       mVPXImageWrapper->stride[VPX_PLANE_V] = halfWidth;
53
diff --git media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
54
index d9c3a22..75195ae 100644
55
--- mozilla/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
56
+++ mozilla/media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
57
@@ -180,7 +180,7 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst,
58
   // Creating a wrapper to the image - setting image data to NULL. Actual
59
   // pointer will be set in encode. Setting align to 1, as it is meaningless
60
   // (actual memory is not allocated).
61
-  raw_ = vpx_img_wrap(NULL, IMG_FMT_I420, codec_.width, codec_.height,
62
+  raw_ = vpx_img_wrap(NULL, VPX_IMG_FMT_I420, codec_.width, codec_.height,
63
                       1, NULL);
64
   // populate encoder configuration with default values
65
   if (vpx_codec_enc_config_default(vpx_codec_vp8_cx(), config_, 0)) {
66
@@ -349,9 +349,9 @@ int VP8EncoderImpl::Encode(const I420VideoFrame& input_image,
67
   }
68
   // Image in vpx_image_t format.
69
   // Input image is const. VP8's raw image is not defined as const.
70
-  raw_->planes[PLANE_Y] = const_cast<uint8_t*>(input_image.buffer(kYPlane));
71
-  raw_->planes[PLANE_U] = const_cast<uint8_t*>(input_image.buffer(kUPlane));
72
-  raw_->planes[PLANE_V] = const_cast<uint8_t*>(input_image.buffer(kVPlane));
73
+  raw_->planes[VPX_PLANE_Y] = const_cast<uint8_t*>(input_image.buffer(kYPlane));
74
+  raw_->planes[VPX_PLANE_U] = const_cast<uint8_t*>(input_image.buffer(kUPlane));
75
+  raw_->planes[VPX_PLANE_V] = const_cast<uint8_t*>(input_image.buffer(kVPlane));
76
   // TODO(mikhal): Stride should be set in initialization.
77
   raw_->stride[VPX_PLANE_Y] = input_image.stride(kYPlane);
78
   raw_->stride[VPX_PLANE_U] = input_image.stride(kUPlane);
(-)files/patch-bug1073709 (-18 lines)
Lines 1-18 Link Here
1
diff --git mfbt/Atomics.h mfbt/Atomics.h
2
index 495a9d3..c7f7601 100644
3
--- mozilla/mfbt/Atomics.h
4
+++ mozilla/mfbt/Atomics.h
5
@@ -34,10 +34,12 @@
6
     * loose typing of the atomic builtins. GCC 4.5 and 4.6 lacks inline
7
     * definitions for unspecialized std::atomic and causes linking errors.
8
     * Therefore, we require at least 4.7.0 for using libstdc++.
9
+    *
10
+    * libc++ <atomic> is only functional with clang.
11
     */
12
 #  if MOZ_USING_LIBSTDCXX && MOZ_LIBSTDCXX_VERSION_AT_LEAST(4, 7, 0)
13
 #    define MOZ_HAVE_CXX11_ATOMICS
14
-#  elif MOZ_USING_LIBCXX
15
+#  elif MOZ_USING_LIBCXX && defined(__clang__)
16
 #    define MOZ_HAVE_CXX11_ATOMICS
17
 #  endif
18
 /*
(-)files/patch-bug1082199 (-26 lines)
Lines 1-26 Link Here
1
commit 258ec90
2
Author: Guilherme Goncalves <guilherme.p.gonc@gmail.com>
3
Date:   Fri Oct 17 15:55:00 2014 +0200
4
5
    Bug 1082199 - Recompute stats in jemalloc_stats when using jemalloc3. r=glandium
6
---
7
 memory/build/mozjemalloc_compat.c | 6 ++++++
8
 1 file changed, 6 insertions(+)
9
10
diff --git memory/build/mozjemalloc_compat.c memory/build/mozjemalloc_compat.c
11
index 78bb13a..70265a7 100644
12
--- mozilla/memory/build/mozjemalloc_compat.c
13
+++ mozilla/memory/build/mozjemalloc_compat.c
14
@@ -68,6 +68,12 @@ jemalloc_stats_impl(jemalloc_stats_t *stats)
15
   size_t active, allocated, mapped, page, pdirty;
16
   size_t lg_chunk;
17
 
18
+  // Refresh jemalloc's stats by updating its epoch, see ctl_refresh in
19
+  // src/ctl.c
20
+  uint64_t epoch = 0;
21
+  size_t esz = sizeof(epoch);
22
+  int ret = je_(mallctl)("epoch", &epoch, &esz, &epoch, esz);
23
+
24
   CTL_GET("arenas.narenas", narenas);
25
   CTL_GET("arenas.page", page);
26
   CTL_GET("stats.active", active);
(-)files/patch-bug1103858 (-42 lines)
Lines 1-42 Link Here
1
diff --git configure.in configure.in
2
index b2b45e7..dcfdfb7 100644
3
--- mozilla/configure.in
4
+++ mozilla/configure.in
5
@@ -8346,7 +8346,7 @@ case "$OS_TARGET" in
6
       NECKO_WIFI=1
7
     fi
8
     ;;
9
-  Darwin|FreeBSD|SunOS|WINNT)
10
+  Darwin|DragonFly|FreeBSD|SunOS|WINNT)
11
     NECKO_WIFI=1
12
     ;;
13
   Linux)
14
diff --git netwerk/wifi/moz.build netwerk/wifi/moz.build
15
index d4de063..3949380 100644
16
--- mozilla/netwerk/wifi/moz.build
17
+++ mozilla/netwerk/wifi/moz.build
18
@@ -35,7 +35,7 @@ if CONFIG['OS_ARCH'] == 'Darwin':
19
     UNIFIED_SOURCES += [
20
         'osx_corewlan.mm',
21
     ]
22
-elif CONFIG['OS_ARCH'] == 'FreeBSD':
23
+elif CONFIG['OS_ARCH'] in ('DragonFly', 'FreeBSD'):
24
     UNIFIED_SOURCES += [
25
         'nsWifiScannerFreeBSD.cpp',
26
     ]
27
diff --git netwerk/wifi/nsWifiScannerFreeBSD.cpp netwerk/wifi/nsWifiScannerFreeBSD.cpp
28
index bdf171e..4185d69 100644
29
--- mozilla/netwerk/wifi/nsWifiScannerFreeBSD.cpp
30
+++ mozilla/netwerk/wifi/nsWifiScannerFreeBSD.cpp
31
@@ -13,7 +13,11 @@
32
 #include <sys/socket.h>
33
 #include <net/if.h>
34
 #include <net/if_media.h>
35
+#ifdef __DragonFly__
36
+#include <netproto/802_11/ieee80211_ioctl.h>
37
+#else
38
 #include <net80211/ieee80211_ioctl.h>
39
+#endif
40
 
41
 #include <ifaddrs.h>
42
 #include <string.h>
(-)files/patch-bug1125579 (-14 lines)
Lines 1-14 Link Here
1
--- mozilla/js/src/assembler/jit/ExecutableAllocator.h~
2
+++ mozilla/js/src/assembler/jit/ExecutableAllocator.h
3
@@ -454,6 +454,11 @@ public:
4
     {
5
         User::IMB_Range(code, static_cast<char*>(code) + size);
6
     }
7
+#elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_FREEBSD || WTF_OS_NETBSD)
8
+    static void cacheFlush(void* code, size_t size)
9
+    {
10
+	__clear_cache(code, reinterpret_cast<char*>(code) + size);
11
+    }
12
 #elif WTF_CPU_ARM_TRADITIONAL && WTF_OS_LINUX && WTF_COMPILER_RVCT
13
     static __asm void cacheFlush(void* code, size_t size);
14
 #elif WTF_CPU_ARM_TRADITIONAL && (WTF_OS_LINUX || WTF_OS_ANDROID) && WTF_COMPILER_GCC
(-)files/patch-bug1125580 (-11 lines)
Lines 1-11 Link Here
1
--- mozilla/js/src/jit/arm/Architecture-arm.cpp~
2
+++ mozilla/js/src/jit/arm/Architecture-arm.cpp
3
@@ -17,7 +17,7 @@
4
 
5
 #define HWCAP_USE_HARDFP_ABI (1 << 28)
6
 
7
-#if !(defined(ANDROID) || defined(MOZ_B2G)) && !defined(JS_ARM_SIMULATOR)
8
+#if defined(__linux__) && !defined(ANDROID) && !defined(MOZ_B2G) && !defined(JS_ARM_SIMULATOR)
9
 #define HWCAP_ARMv7 (1 << 29)
10
 #include <asm/hwcap.h>
11
 #else
(-)files/patch-bug1130155 (-22 / +14 lines)
Lines 1-16 Link Here
1
commit eab3e3a
1
--- mozilla/media/libcubeb/src/cubeb_alsa.c.orig	2015-07-20 20:17:05.000000000 +0200
2
Author: Mikhail Teterin <mi@aldan.algebra.com>
2
+++ mozilla/media/libcubeb/src/cubeb_alsa.c	2015-07-20 20:30:57.000000000 +0200
3
Date:   Tue Dec 16 19:34:02 2014 -0800
4
5
    Bug 1130155 - Avoid assert failures when consuming only part of buffer.
6
---
7
 media/libcubeb/src/cubeb_alsa.c | 112 ++++++++++++++++++++++++++++++----------
8
 1 file changed, 85 insertions(+), 27 deletions(-)
9
10
diff --git media/libcubeb/src/cubeb_alsa.c media/libcubeb/src/cubeb_alsa.c
11
index 9bbc129..e72944a 100644
12
--- mozilla/media/libcubeb/src/cubeb_alsa.c
13
+++ mozilla/media/libcubeb/src/cubeb_alsa.c
14
@@ -14,6 +14,8 @@
3
@@ -14,6 +14,8 @@
15
 #include <limits.h>
4
 #include <limits.h>
16
 #include <dlfcn.h>
5
 #include <dlfcn.h>
Lines 20-26 Link Here
20
 #include <unistd.h>
9
 #include <unistd.h>
21
 #include <alsa/asoundlib.h>
10
 #include <alsa/asoundlib.h>
22
 #include "cubeb/cubeb.h"
11
 #include "cubeb/cubeb.h"
23
@@ -45,6 +47,7 @@ MAKE_TYPEDEF(snd_pcm_avail_update);
12
@@ -45,6 +47,7 @@
24
 MAKE_TYPEDEF(snd_pcm_close);
13
 MAKE_TYPEDEF(snd_pcm_close);
25
 MAKE_TYPEDEF(snd_pcm_delay);
14
 MAKE_TYPEDEF(snd_pcm_delay);
26
 MAKE_TYPEDEF(snd_pcm_drain);
15
 MAKE_TYPEDEF(snd_pcm_drain);
Lines 28-34 Link Here
28
 MAKE_TYPEDEF(snd_pcm_frames_to_bytes);
17
 MAKE_TYPEDEF(snd_pcm_frames_to_bytes);
29
 MAKE_TYPEDEF(snd_pcm_get_params);
18
 MAKE_TYPEDEF(snd_pcm_get_params);
30
 /* snd_pcm_hw_params_alloca is actually a macro */
19
 /* snd_pcm_hw_params_alloca is actually a macro */
31
@@ -305,32 +308,35 @@ alsa_refill_stream(cubeb_stream * stm)
20
@@ -305,32 +308,34 @@
32
   long got;
21
   long got;
33
   void * p;
22
   void * p;
34
   int draining;
23
   int draining;
Lines 48-55 Link Here
48
-  }
37
-  }
49
+  for (pipefailures = 0;;) {
38
+  for (pipefailures = 0;;) {
50
+    r = WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents);
39
+    r = WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents);
51
+    if (r < 0 || revents != POLLOUT ||
40
+    if (r < 0 || revents != POLLOUT) {
52
+      (avail = WRAP(snd_pcm_avail_update)(stm->pcm)) == 0) {
53
+      /* This should be a stream error; it makes no sense for poll(2) to wake
41
+      /* This should be a stream error; it makes no sense for poll(2) to wake
54
+         for this stream and then have the stream report that it's not ready.
42
+         for this stream and then have the stream report that it's not ready.
55
+         Unfortunately, this does happen, so just bail out and try again. */
43
+         Unfortunately, this does happen, so just bail out and try again. */
Lines 82-88 Link Here
82
 
70
 
83
   /* This should never happen. */
71
   /* This should never happen. */
84
   if ((unsigned int) avail > stm->buffer_size) {
72
   if ((unsigned int) avail > stm->buffer_size) {
85
@@ -355,17 +361,67 @@ alsa_refill_stream(cubeb_stream * stm)
73
@@ -359,6 +364,7 @@
86
   if (got < 0) {
74
   if (got < 0) {
87
     pthread_mutex_unlock(&stm->mutex);
75
     pthread_mutex_unlock(&stm->mutex);
88
     stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
76
     stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
Lines 90-96 Link Here
90
     return ERROR;
78
     return ERROR;
91
   }
79
   }
92
   if (got > 0) {
80
   if (got > 0) {
93
-    snd_pcm_sframes_t wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
81
@@ -375,14 +381,63 @@
82
         b[i] *= stm->volume;
83
       }
84
     }
85
-    wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
94
-    if (wrote == -EPIPE) {
86
-    if (wrote == -EPIPE) {
95
-      WRAP(snd_pcm_recover)(stm->pcm, wrote, 1);
87
-      WRAP(snd_pcm_recover)(stm->pcm, wrote, 1);
96
-      wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
88
-      wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got);
Lines 116-122 Link Here
116
+      case -EAGAIN:
108
+      case -EAGAIN:
117
+        if (againfailures++ > 3) {
109
+        if (againfailures++ > 3) {
118
+          fprintf(stderr, "%s: Too many -EAGAIN errors from snd_pcm_writei, "
110
+          fprintf(stderr, "%s: Too many -EAGAIN errors from snd_pcm_writei, "
119
+	    "giving up\n", __func__);
111
+                  "giving up\n", __func__);
120
+          stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
112
+          stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
121
+          pthread_mutex_unlock(&stm->mutex);
113
+          pthread_mutex_unlock(&stm->mutex);
122
+          free(p);
114
+          free(p);
Lines 144-150 Link Here
144
+      gettimeofday(&stm->last_activity, NULL);
136
+      gettimeofday(&stm->last_activity, NULL);
145
+      if (wrote > towrite) {
137
+      if (wrote > towrite) {
146
+        fprintf(stderr, "%s: snc_pcm_writei wrote %lld frames, which was more "
138
+        fprintf(stderr, "%s: snc_pcm_writei wrote %lld frames, which was more "
147
+	        "than we requested (%lld). This should not happen, giving up\n",
139
+                "than we requested (%lld). This should not happen, giving up\n",
148
+                __func__, (long long)wrote, (long long)towrite);
140
+                __func__, (long long)wrote, (long long)towrite);
149
+        free(p);
141
+        free(p);
150
+        stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
142
+        stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR);
Lines 158-164 Link Here
158
   }
150
   }
159
   if (got != avail) {
151
   if (got != avail) {
160
     long buffer_fill = stm->buffer_size - (avail - got);
152
     long buffer_fill = stm->buffer_size - (avail - got);
161
@@ -1177,7 +1232,10 @@ alsa_stream_get_position(cubeb_stream * stm, uint64_t * position)
153
@@ -1177,7 +1232,10 @@
162
     return CUBEB_OK;
154
     return CUBEB_OK;
163
   }
155
   }
164
 
156
 
(-)files/patch-bug702179 (-32 / +8 lines)
Lines 1-36 Link Here
1
commit 6ddaacd
1
--- mozilla/js/src/Makefile.in.orig	2015-07-20 20:47:30.000000000 +0200
2
Author: Ginn Chen <ginn.chen@oracle.com>
2
+++ mozilla/js/src/Makefile.in	2015-07-20 20:47:38.000000000 +0200
3
Date:   Wed Nov 30 07:23:46 2011 +0800
3
@@ -16,9 +16,6 @@
4
5
    Bug 702179 dtrace probes are not installed on Solaris with static js lib r=glandium
6
---
7
 configure.in       | 2 +-
8
 js/src/Makefile.in | 2 --
9
 2 files changed, 1 insertion(+), 3 deletions(-)
10
11
diff --git configure.in configure.in
12
index 66549c1..75b848d 100644
13
--- mozilla/configure.in
14
+++ mozilla/configure.in
15
@@ -966,7 +966,7 @@ MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
16
 MOZ_PNG_CFLAGS="-I$_objdir/dist/include" # needed for freetype compilation
17
 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)'
18
 
4
 
19
-MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
5
 run_for_side_effects := $(shell echo 'MAKE: $(MAKE)')
20
+MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(DEPTH)/js/src)'
21
 MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
22
 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
23
 XPCOM_FROZEN_LDOPTS='$(call EXPAND_LIBNAME_PATH,xul mozalloc,$(LIBXUL_DIST)/bin)'
24
diff --git js/src/Makefile.in js/src/Makefile.in
25
index e28160a..28ca5e8 100644
26
--- mozilla/js/src/Makefile.in
27
+++ mozilla/js/src/Makefile.in
28
@@ -18,8 +18,6 @@ run_for_side_effects := $(shell echo 'MAKE: $(MAKE)')
29
 STATIC_LIBRARY_NAME = js_static
30
 LIBS		= $(NSPR_LIBS)
31
 
6
 
32
-DIST_INSTALL = 1
7
-DIST_INSTALL = 1
8
-NO_EXPAND_LIBS = 1
33
-
9
-
34
 ifdef JS_STANDALONE
10
 ifdef JS_HAS_CTYPES
35
 SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,mfbt,$(DEPTH)/mfbt)
11
 ifdef MOZ_NATIVE_FFI
36
 ifndef MOZ_NATIVE_ZLIB
12
 LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS)
(-)files/patch-bug779713 (-27 / +15 lines)
Lines 1-5 Link Here
1
--- mozilla/mfbt/Alignment.h
1
--- mozilla/mfbt/Alignment.h.orig	2015-07-20 20:56:53.000000000 +0200
2
+++ mozilla/mfbt/Alignment.h
2
+++ mozilla/mfbt/Alignment.h	2015-07-20 20:57:16.000000000 +0200
3
@@ -9,11 +9,20 @@
3
@@ -9,11 +9,20 @@
4
 #ifndef mozilla_Alignment_h
4
 #ifndef mozilla_Alignment_h
5
 #define mozilla_Alignment_h
5
 #define mozilla_Alignment_h
Lines 21-27 Link Here
21
 /*
21
 /*
22
  * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many
22
  * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many
23
  * bytes of alignment a given type needs.
23
  * bytes of alignment a given type needs.
24
@@ -32,6 +41,7 @@ public:
24
@@ -32,6 +41,7 @@
25
 };
25
 };
26
 
26
 
27
 #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
27
 #define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment
Lines 29-35 Link Here
29
 
29
 
30
 /*
30
 /*
31
  * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
31
  * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
32
@@ -43,7 +53,10 @@ public:
32
@@ -43,7 +53,10 @@
33
  * will declare a two-character array |arr| aligned to 8 bytes.
33
  * will declare a two-character array |arr| aligned to 8 bytes.
34
  */
34
  */
35
 
35
 
Lines 41-51 Link Here
41
 #  define MOZ_ALIGNED_DECL(_type, _align) \
41
 #  define MOZ_ALIGNED_DECL(_type, _align) \
42
      _type __attribute__((aligned(_align)))
42
      _type __attribute__((aligned(_align)))
43
 #elif defined(_MSC_VER)
43
 #elif defined(_MSC_VER)
44
diff --git mfbt/Attributes.h mfbt/Attributes.h
44
--- mozilla/mfbt/Attributes.h.orig	2015-07-20 20:57:38.000000000 +0200
45
index d317766..ddb13da 100644
45
+++ mozilla/mfbt/Attributes.h	2015-07-20 21:06:12.000000000 +0200
46
--- mozilla/mfbt/Attributes.h
46
@@ -50,6 +50,7 @@
47
+++ mozilla/mfbt/Attributes.h
47
  * don't indicate support for them here, due to
48
@@ -54,6 +54,9 @@
48
  * http://stackoverflow.com/questions/20498142/visual-studio-2013-explicit-keyword-bug
49
  */
50
+#  define MOZ_HAVE_CXX11_ALIGNAS
51
 #  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)
52
 #  define MOZ_HAVE_NORETURN              __declspec(noreturn)
53
 #  ifdef __clang__
54
@@ -70,6 +71,9 @@
49
 #  ifndef __has_extension
55
 #  ifndef __has_extension
50
 #    define __has_extension __has_feature /* compatibility, for older versions of clang */
56
 #    define __has_extension __has_feature /* compatibility, for older versions of clang */
51
 #  endif
57
 #  endif
Lines 55-75 Link Here
55
 #  if __has_extension(cxx_constexpr)
61
 #  if __has_extension(cxx_constexpr)
56
 #    define MOZ_HAVE_CXX11_CONSTEXPR
62
 #    define MOZ_HAVE_CXX11_CONSTEXPR
57
 #  endif
63
 #  endif
58
@@ -75,6 +78,9 @@
59
 #  endif
60
 #elif defined(__GNUC__)
61
 #  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
62
+#    if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
63
+#      define MOZ_HAVE_CXX11_ALIGNAS
64
+#    endif
65
 #    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
66
 #      define MOZ_HAVE_CXX11_OVERRIDE
67
 #      define MOZ_HAVE_CXX11_FINAL       final
68
@@ -96,6 +102,7 @@
69
 #  define MOZ_HAVE_NORETURN              __attribute__((noreturn))
70
 #elif defined(_MSC_VER)
71
 #  if _MSC_VER >= 1800
72
+#    define MOZ_HAVE_CXX11_ALIGNAS
73
 #    define MOZ_HAVE_CXX11_DELETE
74
 #  endif
75
 #  if _MSC_VER >= 1700
(-)files/patch-bug826985 (-41 / +38 lines)
Lines 51-68 Link Here
51
     # basic stuff for everything
51
     # basic stuff for everything
52
     'include_internal_video_render': 0,
52
     'include_internal_video_render': 0,
53
     'clang_use_chrome_plugins': 0,
53
     'clang_use_chrome_plugins': 0,
54
diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
54
--- mozilla/media/webrtc/signaling/test/moz.build.orig  2015-07-20 21:16:09.000000000 +0200
55
index b483cd1..f1dd1f0 100644
55
+++ mozilla/media/webrtc/signaling/test/moz.build       2015-07-20 21:16:35.000000000 +0200
56
--- mozilla/media/webrtc/signaling/test/Makefile.in
56
@@ -109,6 +109,7 @@
57
+++ mozilla/media/webrtc/signaling/test/Makefile.in
57
         'js',
58
@@ -7,6 +7,7 @@ LIBS = \
58
     ]
59
   $(NSPR_LIBS) \
59
 
60
   $(NSS_LIBS) \
60
+OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS']
61
   $(REALTIME_LIBS) \
61
 OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
62
+  $(MOZ_LIBV4L2_LIBS) \
62
 OS_LIBS += CONFIG['REALTIME_LIBS']
63
   $(DEPTH)/xpcom/glue/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
63
64
   $(DEPTH)/media/mtransport/standalone/$(LIB_PREFIX)mtransport_s.$(LIB_SUFFIX) \
65
   $(DEPTH)/media/webrtc/signalingtest/signaling_ecc/$(LIB_PREFIX)ecc.$(LIB_SUFFIX) \
66
diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
64
diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
67
index 239a292..bab496c 100644
65
index 239a292..bab496c 100644
68
--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
66
--- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc
Lines 145-179 Link Here
145
   'targets': [
143
   'targets': [
146
     {
144
     {
147
       'target_name': 'video_capture_module',
145
       'target_name': 'video_capture_module',
148
@@ -49,6 +52,16 @@
146
@@ -69,6 +72,19 @@
149
         }, {  # include_internal_video_capture == 1
147
             'linux/video_capture_linux.cc',
150
           'conditions': [
148
             'linux/video_capture_linux.h',
151
             ['include_v4l2_video_capture==1', {
149
           ],
152
+              'conditions': [
150
+          'conditions': [
153
+                ['use_libv4l2==1', {
151
+            ['use_libv4l2==1', {
154
+                  'defines': [
152
+              'defines': [
155
+                    'HAVE_LIBV4L2',
153
+                'HAVE_LIBV4L2',
156
+                  ],
157
+                  'libraries': [
158
+                    '-lv4l2',
159
+                  ],
160
+                }],
161
+              ],
154
+              ],
162
               'include_dirs': [
155
+              'cflags_mozilla': [
163
                 'linux',
156
+                '$(MOZ_LIBV4L2_CFLAGS)',
164
               ],
157
+              ],
165
diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
158
+              'libraries': [
166
index 9c16ffa..1db3794 100644
159
+                '-lv4l2',
167
--- mozilla/toolkit/library/libxul.mk
160
+              ],
168
+++ mozilla/toolkit/library/libxul.mk
161
+            }],
169
@@ -182,6 +182,10 @@ endif
162
+          ],
163
         }],  # linux
164
         ['OS=="mac"', {
165
           'sources': [
166
167
--- mozilla/toolkit/library/moz.build.orig      2015-07-20 21:28:46.000000000 +0200
168
+++ mozilla/toolkit/library/moz.build   2015-07-20 21:29:15.000000000 +0200
169
@@ -214,6 +214,7 @@
170
     ]
170
 
171
 
171
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
172
 OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS']
173
+OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS']
174
 OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS']
172
 
175
 
173
+ifdef MOZ_LIBV4L2_LIBS
176
 if CONFIG['MOZ_NATIVE_JPEG']:
174
+EXTRA_DSO_LDOPTS += $(MOZ_LIBV4L2_LIBS)
175
+endif
176
+
177
 ifdef MOZ_WEBRTC
178
 ifeq (WINNT,$(OS_TARGET))
179
 EXTRA_DSO_LDOPTS += \
(-)files/patch-bug847568 (-105 / +119 lines)
Lines 1-10 Link Here
1
# Allow building against system-wide graphite2/harfbuzz.
1
--- ./mozilla/config/Makefile.in.orig	2015-07-20 21:48:20.000000000 +0200
2
2
+++ ./mozilla/config/Makefile.in	2015-07-20 21:50:14.000000000 +0200
3
diff --git config/Makefile.in config/Makefile.in
3
@@ -77,6 +77,8 @@
4
index 14bfc0d..5383399 100644
5
--- mozilla/config/Makefile.in
6
+++ mozilla/config/Makefile.in
7
@@ -77,6 +77,8 @@ export:: $(export-preqs)
8
 		-DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
4
 		-DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
9
 		-DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
5
 		-DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
10
 		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
6
 		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
Lines 13-23 Link Here
13
 		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
9
 		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
14
 	$(INSTALL) system_wrappers $(DIST)
10
 	$(INSTALL) system_wrappers $(DIST)
15
 
11
 
16
diff --git config/system-headers config/system-headers
12
--- ./mozilla/config/system-headers.orig	2015-07-20 21:50:21.000000000 +0200
17
index 18e8703..bdc5f82 100644
13
+++ ./mozilla/config/system-headers	2015-07-20 22:12:28.000000000 +0200
18
--- mozilla/config/system-headers
14
@@ -1362,3 +1362,11 @@
19
+++ mozilla/config/system-headers
20
@@ -1145,3 +1145,11 @@ unicode/utypes.h
21
 #endif
15
 #endif
22
 libutil.h
16
 libutil.h
23
 unwind.h
17
 unwind.h
Lines 29-39 Link Here
29
+harfbuzz/hb-ot.h
23
+harfbuzz/hb-ot.h
30
+harfbuzz/hb.h
24
+harfbuzz/hb.h
31
+#endif
25
+#endif
32
diff --git configure.in configure.in
26
--- ./mozilla/configure.in.orig	2015-07-20 21:46:13.000000000 +0200
33
index ac38f40..87536b7 100644
27
+++ ./mozilla/configure.in	2015-07-20 22:10:29.000000000 +0200
34
--- mozilla/configure.in
28
@@ -8130,6 +8130,52 @@
35
+++ mozilla/configure.in
36
@@ -8032,6 +8032,52 @@ if test "$USE_FC_FREETYPE"; then
37
 fi
29
 fi
38
 
30
 
39
 dnl ========================================================
31
 dnl ========================================================
Lines 50-57 Link Here
50
+fi
42
+fi
51
+
43
+
52
+AC_SUBST(MOZ_NATIVE_HARFBUZZ)
44
+AC_SUBST(MOZ_NATIVE_HARFBUZZ)
53
+AC_SUBST(MOZ_HARFBUZZ_CFLAGS)
45
+# AC_SUBST(MOZ_HARFBUZZ_CFLAGS)
54
+AC_SUBST(MOZ_HARFBUZZ_LIBS)
46
+# AC_SUBST(MOZ_HARFBUZZ_LIBS)
55
+
47
+
56
+dnl ========================================================
48
+dnl ========================================================
57
+dnl Check for graphite2
49
+dnl Check for graphite2
Lines 79-110 Link Here
79
+fi
71
+fi
80
+
72
+
81
+AC_SUBST(MOZ_NATIVE_GRAPHITE2)
73
+AC_SUBST(MOZ_NATIVE_GRAPHITE2)
82
+AC_SUBST(MOZ_GRAPHITE2_CFLAGS)
74
+# AC_SUBST(MOZ_GRAPHITE2_CFLAGS)
83
+AC_SUBST(MOZ_GRAPHITE2_LIBS)
75
+# AC_SUBST(MOZ_GRAPHITE2_LIBS)
84
+
76
+
85
+dnl ========================================================
77
+dnl ========================================================
86
 dnl Check for pixman and cairo
78
 dnl Check for pixman and cairo
87
 dnl ========================================================
79
 dnl ========================================================
88
 
80
 
89
diff --git content/base/src/moz.build content/base/src/moz.build
81
--- ./mozilla/dom/base/moz.build.orig	2015-07-20 22:14:36.000000000 +0200
90
index d4f6380..0ee55df 100644
82
+++ ./mozilla/dom/base/moz.build	2015-07-20 22:15:45.000000000 +0200
91
--- mozilla/content/base/src/moz.build
83
@@ -368,6 +368,9 @@
92
+++ mozilla/content/base/src/moz.build
84
     SOURCES += ['nsTextFragmentSSE2.cpp']
93
@@ -179,6 +179,9 @@ SOURCES += [
85
     SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
94
     'nsObjectLoadingContent.cpp',
95
 ]
96
 
86
 
97
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
87
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
98
+    SOURCES['nsContentUtils.cpp'].flags += [CONFIG['MOZ_HARFBUZZ_CFLAGS']]
88
+    SOURCES['nsContentUtils.cpp'].flags += CONFIG['MOZ_HARFBUZZ_CFLAGS']
99
+
89
+
100
 EXTRA_COMPONENTS += [
90
 EXTRA_COMPONENTS += [
101
     'contentAreaDropListener.js',
91
     'ConsoleAPI.manifest',
102
     'contentAreaDropListener.manifest',
92
     'ConsoleAPIStorage.js',
103
diff --git gfx/moz.build gfx/moz.build
93
--- ./mozilla/gfx/graphite2/moz-gr-update.sh.orig	2015-07-20 22:16:18.000000000 +0200
104
index 519aa46..6929751 100644
94
+++ ./mozilla/gfx/graphite2/moz-gr-update.sh	2015-07-20 22:17:33.000000000 +0200
105
--- mozilla/gfx/moz.build
95
@@ -23,8 +23,14 @@
106
+++ mozilla/gfx/moz.build
96
 find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
107
@@ -7,6 +7,12 @@
97
 find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
98
 
99
+# closest tag/release to require for system version
100
+TAG=$(cd ../graphitedev/ && hg parents --template {latesttag})
101
+
102
+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$TAG/ and tr/./,/ \
103
+  if /GR2_VERSION_REQUIRE/" configure.in
104
+
105
 # summarize what's been touched
106
-echo Updated to $CHANGESET.
107
+echo Updated to $CHANGESET \($TAG for --with-system-graphite2\)
108
 echo Here is what changed in the gfx/graphite2 directory:
109
 echo
110
 
111
--- ./mozilla/gfx/harfbuzz/README-mozilla.orig	2015-07-20 22:17:50.000000000 +0200
112
+++ ./mozilla/gfx/harfbuzz/README-mozilla	2015-07-20 22:18:20.000000000 +0200
113
@@ -21,3 +21,8 @@
114
 generated from src/Makefile.am (the original harfbuzz version); it is a mozilla-
115
 specific makefile that is maintained by hand. It should only need updating when
116
 new source files or exported headers are added in harfbuzz.
117
+
118
+The in-tree copy may be omitted during build by --with-system-harfbuzz.
119
+Make sure to keep pkg-config version check within configure.in in sync
120
+with checkout version or increment latest tag by one if it's not based
121
+on upstream release.
122
--- ./mozilla/gfx/moz.build.orig	2015-07-20 22:18:31.000000000 +0200
123
+++ ./mozilla/gfx/moz.build	2015-07-20 22:19:11.000000000 +0200
124
@@ -7,6 +7,13 @@
108
 if CONFIG['MOZ_TREE_CAIRO']:
125
 if CONFIG['MOZ_TREE_CAIRO']:
109
     DIRS += ['cairo']
126
     DIRS += ['cairo']
110
 
127
 
Lines 114-123 Link Here
114
+if not CONFIG['MOZ_NATIVE_HARFBUZZ']:
131
+if not CONFIG['MOZ_NATIVE_HARFBUZZ']:
115
+    DIRS += ['harfbuzz/src']
132
+    DIRS += ['harfbuzz/src']
116
+
133
+
134
+
117
 DIRS += [
135
 DIRS += [
118
     '2d',
136
     '2d',
119
     'ycbcr',
137
     'ycbcr',
120
@@ -15,8 +21,6 @@ DIRS += [
138
@@ -15,8 +22,6 @@
121
     'qcms',
139
     'qcms',
122
     'gl',
140
     'gl',
123
     'layers',
141
     'layers',
Lines 126-208 Link Here
126
     'ots/src',
144
     'ots/src',
127
     'thebes',
145
     'thebes',
128
     'ipc',
146
     'ipc',
129
diff --git gfx/skia/Makefile.in gfx/skia/Makefile.in
147
--- ./mozilla/gfx/skia/generate_mozbuild.py.orig	2015-07-20 22:19:33.000000000 +0200
130
index ee0efb2..98e169d6f 100644
148
+++ ./mozilla/gfx/skia/generate_mozbuild.py	2015-07-20 22:20:30.000000000 +0200
131
--- mozilla/gfx/skia/Makefile.in
149
@@ -142,6 +142,9 @@
132
+++ mozilla/gfx/skia/Makefile.in
150
     if not CONFIG['CLANG_CXX']:
133
@@ -15,6 +15,10 @@ ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
151
         CXXFLAGS += ['-Wno-logical-op']
134
 OS_CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PANGO_CFLAGS) $(CAIRO_FT_CFLAGS)
135
 endif
136
 
152
 
137
+ifdef MOZ_NATIVE_HARFBUZZ
153
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
138
+OS_CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
154
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
139
+endif
140
+
155
+
141
 include $(topsrcdir)/config/rules.mk
156
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'):
157
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
158
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
159
--- ./mozilla/gfx/skia/moz.build.orig	2015-07-20 22:20:36.000000000 +0200
160
+++ ./mozilla/gfx/skia/moz.build	2015-07-20 22:21:08.000000000 +0200
161
@@ -970,6 +970,9 @@
162
     if not CONFIG['CLANG_CXX']:
163
         CXXFLAGS += ['-Wno-logical-op']
142
 
164
 
143
 ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1)
165
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
144
diff --git gfx/thebes/Makefile.in gfx/thebes/Makefile.in
166
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
145
index 45c36ae..79d32cf 100644
167
+
146
--- mozilla/gfx/thebes/Makefile.in
168
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'):
147
+++ mozilla/gfx/thebes/Makefile.in
169
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
148
@@ -13,6 +13,14 @@ DEFINES := $(filter-out -DUNICODE,$(DEFINES))
170
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
149
 CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
171
--- ./mozilla/gfx/thebes/moz.build.orig	2015-07-20 22:21:19.000000000 +0200
150
 CFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
172
+++ ./mozilla/gfx/thebes/moz.build	2015-07-20 22:22:14.000000000 +0200
173
@@ -287,6 +287,12 @@
174
 CFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
175
 CFLAGS += CONFIG['TK_CFLAGS']
151
 
176
 
152
+ifdef MOZ_NATIVE_GRAPHITE2
177
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
153
+CXXFLAGS += $(MOZ_GRAPHITE2_CFLAGS)
178
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
154
+endif
155
+
179
+
156
+ifdef MOZ_NATIVE_HARFBUZZ
180
+if CONFIG['MOZ_NATIVE_GRAPHITE2']:
157
+CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
181
+    CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
158
+endif
159
+
182
+
160
 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
183
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk', 'qt'):
161
 CXXFLAGS += $(CAIRO_FT_CFLAGS)
184
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
162
 endif
163
diff --git intl/unicharutil/util/Makefile.in intl/unicharutil/util/Makefile.in
164
index f6b9f7c..60863f4 100644
165
--- mozilla/intl/unicharutil/util/Makefile.in
166
+++ mozilla/intl/unicharutil/util/Makefile.in
167
@@ -21,3 +21,7 @@ ifdef _MSC_VER
168
 OS_COMPILE_CXXFLAGS += -Zl
169
 OS_COMPILE_CFLAGS += -Zl
170
 endif
171
+
172
+ifdef MOZ_NATIVE_HARFBUZZ
173
+CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
174
+endif
175
diff --git netwerk/dns/Makefile.in netwerk/dns/Makefile.in
176
index 1cacbd7..f5d72bb 100644
177
--- mozilla/netwerk/dns/Makefile.in
178
+++ mozilla/netwerk/dns/Makefile.in
179
@@ -5,6 +5,10 @@
180
 
185
 
181
 include $(topsrcdir)/config/rules.mk
186
--- ./mozilla/intl/unicharutil/util/moz.build.orig	2015-07-20 22:22:27.000000000 +0200
187
+++ ./mozilla/intl/unicharutil/util/moz.build	2015-07-20 22:23:08.000000000 +0200
188
@@ -38,5 +38,8 @@
189
 if CONFIG['ENABLE_INTL_API']:
190
     CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
182
 
191
 
183
+ifdef MOZ_NATIVE_HARFBUZZ
192
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
184
+CXXFLAGS += $(MOZ_HARFBUZZ_CFLAGS)
193
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
185
+endif
186
+
194
+
187
 # Generate the include file containing compact, static definitions
195
 if CONFIG['GNU_CXX']:
188
 # for effective TLD data.
196
     FAIL_ON_WARNINGS = True
189
 etld_data.inc: $(srcdir)/prepare_tlds.py $(srcdir)/effective_tld_names.dat
197
--- ./mozilla/netwerk/dns/moz.build.orig	2015-07-20 22:23:23.000000000 +0200
190
diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
198
+++ ./mozilla/netwerk/dns/moz.build	2015-07-20 22:24:12.000000000 +0200
191
index 67f0db9..d42137a 100644
199
@@ -68,5 +68,8 @@
192
--- mozilla/toolkit/library/libxul.mk
200
     '/netwerk/base',
193
+++ mozilla/toolkit/library/libxul.mk
201
 ]
194
@@ -89,6 +89,14 @@ ifndef MOZ_TREE_PIXMAN
195
 EXTRA_DSO_LDOPTS += $(MOZ_PIXMAN_LIBS)
196
 endif
197
 
202
 
198
+ifdef MOZ_NATIVE_GRAPHITE2
203
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
199
+EXTRA_DSO_LDOPTS += $(MOZ_GRAPHITE2_LIBS)
204
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
200
+endif
201
+
205
+
202
+ifdef MOZ_NATIVE_HARFBUZZ
206
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] > '19':
203
+EXTRA_DSO_LDOPTS += $(MOZ_HARFBUZZ_LIBS)
207
     CXXFLAGS += ['-I%s/bionic/libc/dns/include' % CONFIG['ANDROID_SOURCE']]
204
+endif
208
--- ./mozilla/toolkit/library/moz.build.orig	2015-07-20 22:24:20.000000000 +0200
209
+++ ./mozilla/toolkit/library/moz.build	2015-07-20 22:25:30.000000000 +0200
210
@@ -235,6 +235,12 @@
211
 if not CONFIG['MOZ_TREE_PIXMAN']:
212
     OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
213
 
214
+if CONFIG['MOZ_NATIVE_GRAPHITE2']:
215
+    OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
205
+
216
+
206
 ifdef MOZ_DMD
217
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
207
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,dmd,$(DIST)/lib)
218
+    OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
208
 endif
219
+
220
 if CONFIG['MOZ_OSS']:
221
     OS_LIBS += CONFIG['MOZ_OSS_LIBS']
222
 
(-)files/patch-bug858919 (-391 lines)
Lines 1-391 Link Here
1
commit a33d4f7
2
Author: Martin Stransky <stransky@redhat.com>
3
Date:   Fri Nov 14 04:04:00 2014 +0100
4
5
    Bug 858919 - Add support for libnotify calls which was removed for new notification API. r=karlt
6
---
7
 toolkit/components/alerts/nsAlertsService.cpp  | 10 +--
8
 toolkit/system/gnome/moz.build                 |  2 +
9
 toolkit/system/gnome/nsAlertsIconListener.cpp  | 64 ++++++++++++------
10
 toolkit/system/gnome/nsAlertsIconListener.h    | 89 ++++++++++++++++++++++++++
11
 toolkit/system/gnome/nsGnomeModule.cpp         |  5 ++
12
 toolkit/system/gnome/nsSystemAlertsService.cpp | 54 ++++++++++++++++
13
 toolkit/system/gnome/nsSystemAlertsService.h   | 27 ++++++++
14
 7 files changed, 226 insertions(+), 25 deletions(-)
15
16
diff --git toolkit/components/alerts/nsAlertsService.cpp toolkit/components/alerts/nsAlertsService.cpp
17
index 93f4536..f8b5e07 100644
18
--- mozilla/toolkit/components/alerts/nsAlertsService.cpp
19
+++ mozilla/toolkit/components/alerts/nsAlertsService.cpp
20
@@ -100,9 +100,11 @@ NS_IMETHODIMP nsAlertsService::ShowAlertNotification(const nsAString & aImageUrl
21
   nsCOMPtr<nsIAlertsService> sysAlerts(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
22
   nsresult rv;
23
   if (sysAlerts) {
24
-    return sysAlerts->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
25
-                                            aAlertCookie, aAlertListener, aAlertName,
26
-                                            aBidi, aLang, IPC::Principal(aPrincipal));
27
+    rv = sysAlerts->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
28
+                                          aAlertCookie, aAlertListener, aAlertName,
29
+                                          aBidi, aLang, IPC::Principal(aPrincipal));
30
+    if (NS_SUCCEEDED(rv))
31
+      return NS_OK;
32
   }
33
 
34
   if (!ShouldShowAlert()) {
35
diff --git toolkit/system/gnome/moz.build toolkit/system/gnome/moz.build
36
index c033f8b..9242209 100644
37
--- mozilla/toolkit/system/gnome/moz.build
38
+++ mozilla/toolkit/system/gnome/moz.build
39
@@ -5,7 +5,9 @@
40
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
41
 
42
 SOURCES += [
43
+    'nsAlertsIconListener.cpp',
44
     'nsGnomeModule.cpp',
45
+    'nsSystemAlertsService.cpp',
46
 ]
47
 
48
 if CONFIG['MOZ_ENABLE_GCONF']:
49
diff --git toolkit/system/gnome/nsAlertsIconListener.cpp toolkit/system/gnome/nsAlertsIconListener.cpp
50
index f39335e..55f4356 100644
51
--- mozilla/toolkit/system/gnome/nsAlertsIconListener.cpp
52
+++ mozilla/toolkit/system/gnome/nsAlertsIconListener.cpp
53
@@ -51,6 +51,21 @@ static void notify_closed_marshal(GClosure* closure,
54
   NS_RELEASE(alert);
55
 }
56
 
57
+static GdkPixbuf*
58
+GetPixbufFromImgRequest(imgIRequest* aRequest)
59
+{
60
+  nsCOMPtr<imgIContainer> image;
61
+  nsresult rv = aRequest->GetImage(getter_AddRefs(image));
62
+  if (NS_FAILED(rv)) {
63
+    return nullptr;
64
+  }
65
+
66
+  nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
67
+    do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
68
+
69
+  return imgToPixbuf->ConvertImageToPixbuf(image);
70
+}
71
+
72
 NS_IMPL_ISUPPORTS(nsAlertsIconListener, imgINotificationObserver,
73
                   nsIObserver, nsISupportsWeakReference)
74
 
75
@@ -106,47 +121,45 @@ nsAlertsIconListener::Notify(imgIRequest *aRequest, int32_t aType, const nsIntRe
76
 nsresult
77
 nsAlertsIconListener::OnStopRequest(imgIRequest* aRequest)
78
 {
79
+  NS_ASSERTION(mIconRequest == aRequest, "aRequest does not match!");
80
+
81
   uint32_t imgStatus = imgIRequest::STATUS_ERROR;
82
   nsresult rv = aRequest->GetImageStatus(&imgStatus);
83
   NS_ENSURE_SUCCESS(rv, rv);
84
   if (imgStatus == imgIRequest::STATUS_ERROR && !mLoadedFrame) {
85
     // We have an error getting the image. Display the notification with no icon.
86
     ShowAlert(nullptr);
87
-  }
88
 
89
-  if (mIconRequest) {
90
+    // Cancel any pending request
91
     mIconRequest->Cancel(NS_BINDING_ABORTED);
92
     mIconRequest = nullptr;
93
   }
94
+
95
   return NS_OK;
96
 }
97
 
98
 nsresult
99
 nsAlertsIconListener::OnStopFrame(imgIRequest* aRequest)
100
 {
101
-  if (aRequest != mIconRequest)
102
-    return NS_ERROR_FAILURE;
103
+  NS_ASSERTION(mIconRequest == aRequest, "aRequest does not match!");
104
 
105
   if (mLoadedFrame)
106
     return NS_OK; // only use one frame
107
 
108
-  nsCOMPtr<imgIContainer> image;
109
-  nsresult rv = aRequest->GetImage(getter_AddRefs(image));
110
-  if (NS_FAILED(rv))
111
-    return rv;
112
-
113
-  nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
114
-    do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
115
-
116
-  GdkPixbuf* imagePixbuf = imgToPixbuf->ConvertImageToPixbuf(image);
117
-  if (!imagePixbuf)
118
-    return NS_ERROR_FAILURE;
119
+  GdkPixbuf* imagePixbuf = GetPixbufFromImgRequest(aRequest);
120
+  if (!imagePixbuf) {
121
+    ShowAlert(nullptr);
122
+  } else {
123
+    ShowAlert(imagePixbuf);
124
+    g_object_unref(imagePixbuf);
125
+  }
126
 
127
-  ShowAlert(imagePixbuf);
128
+  mLoadedFrame = true;
129
 
130
-  g_object_unref(imagePixbuf);
131
+  // Cancel any pending request (multipart image loading/decoding for instance)
132
+  mIconRequest->Cancel(NS_BINDING_ABORTED);
133
+  mIconRequest = nullptr;
134
 
135
-  mLoadedFrame = true;
136
   return NS_OK;
137
 }
138
 
139
@@ -180,6 +193,9 @@ nsAlertsIconListener::ShowAlert(GdkPixbuf* aPixbuf)
140
   mClosureHandler = g_signal_connect_closure(mNotification, "closed", closure, FALSE);
141
   gboolean result = notify_notification_show(mNotification, nullptr);
142
 
143
+  if (result && mAlertListener)
144
+    mAlertListener->Observe(nullptr, "alertshow", mAlertCookie.get());
145
+
146
   return result ? NS_OK : NS_ERROR_FAILURE;
147
 }
148
 
149
@@ -201,9 +217,15 @@ nsAlertsIconListener::StartRequest(const nsAString & aImageUrl)
150
   if (!il)
151
     return ShowAlert(nullptr);
152
 
153
-  return il->LoadImageXPCOM(imageUri, nullptr, nullptr, nullptr, nullptr,
154
-                            this, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
155
-                            nullptr, getter_AddRefs(mIconRequest));
156
+  nsresult rv = il->LoadImageXPCOM(imageUri, nullptr, nullptr, nullptr, nullptr,
157
+                                   this, nullptr, nsIRequest::LOAD_NORMAL, nullptr,
158
+                                   0 /* use default */, getter_AddRefs(mIconRequest));
159
+  if (NS_FAILED(rv))
160
+    return rv;
161
+
162
+  mIconRequest->StartDecoding();
163
+
164
+  return NS_OK;
165
 }
166
 
167
 void
168
diff --git toolkit/system/gnome/nsAlertsIconListener.h toolkit/system/gnome/nsAlertsIconListener.h
169
new file mode 100644
170
index 0000000..ac96db9
171
--- /dev/null
172
+++ mozilla/toolkit/system/gnome/nsAlertsIconListener.h
173
@@ -0,0 +1,89 @@
174
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
175
+/* This Source Code Form is subject to the terms of the Mozilla Public
176
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
177
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
178
+
179
+#ifndef nsAlertsIconListener_h__
180
+#define nsAlertsIconListener_h__
181
+
182
+#include "nsCOMPtr.h"
183
+#include "imgINotificationObserver.h"
184
+#include "nsStringAPI.h"
185
+#include "nsIObserver.h"
186
+#include "nsWeakReference.h"
187
+
188
+#include <gdk-pixbuf/gdk-pixbuf.h>
189
+
190
+class imgIRequest;
191
+
192
+struct NotifyNotification;
193
+
194
+class nsAlertsIconListener : public imgINotificationObserver,
195
+                             public nsIObserver,
196
+                             public nsSupportsWeakReference
197
+{
198
+public:
199
+  NS_DECL_ISUPPORTS
200
+  NS_DECL_IMGINOTIFICATIONOBSERVER
201
+  NS_DECL_NSIOBSERVER
202
+
203
+  nsAlertsIconListener();
204
+
205
+  nsresult InitAlertAsync(const nsAString & aImageUrl,
206
+                          const nsAString & aAlertTitle, 
207
+                          const nsAString & aAlertText,
208
+                          bool aAlertTextClickable,
209
+                          const nsAString & aAlertCookie,
210
+                          nsIObserver * aAlertListener);
211
+
212
+  void SendCallback();
213
+  void SendClosed();
214
+
215
+protected:
216
+  virtual ~nsAlertsIconListener();
217
+
218
+  nsresult OnStopRequest(imgIRequest* aRequest);
219
+  nsresult OnStopFrame(imgIRequest* aRequest);
220
+
221
+  /**
222
+   * The only difference between libnotify.so.4 and libnotify.so.1 for these symbols
223
+   * is that notify_notification_new takes three arguments in libnotify.so.4 and
224
+   * four in libnotify.so.1.
225
+   * Passing the fourth argument as NULL is binary compatible.
226
+   */
227
+  typedef void (*NotifyActionCallback)(NotifyNotification*, char*, gpointer);
228
+  typedef bool (*notify_is_initted_t)(void);
229
+  typedef bool (*notify_init_t)(const char*);
230
+  typedef GList* (*notify_get_server_caps_t)(void);
231
+  typedef NotifyNotification* (*notify_notification_new_t)(const char*, const char*, const char*, const char*);
232
+  typedef bool (*notify_notification_show_t)(void*, char*);
233
+  typedef void (*notify_notification_set_icon_from_pixbuf_t)(void*, GdkPixbuf*);
234
+  typedef void (*notify_notification_add_action_t)(void*, const char*, const char*, NotifyActionCallback, gpointer, GFreeFunc);
235
+
236
+  nsCOMPtr<imgIRequest> mIconRequest;
237
+  nsCString mAlertTitle;
238
+  nsCString mAlertText;
239
+
240
+  nsCOMPtr<nsIObserver> mAlertListener;
241
+  nsString mAlertCookie;
242
+
243
+  bool mLoadedFrame;
244
+  bool mAlertHasAction;
245
+
246
+  static void* libNotifyHandle;
247
+  static bool libNotifyNotAvail;
248
+  static notify_is_initted_t notify_is_initted;
249
+  static notify_init_t notify_init;
250
+  static notify_get_server_caps_t notify_get_server_caps;
251
+  static notify_notification_new_t notify_notification_new;
252
+  static notify_notification_show_t notify_notification_show;
253
+  static notify_notification_set_icon_from_pixbuf_t notify_notification_set_icon_from_pixbuf;
254
+  static notify_notification_add_action_t notify_notification_add_action;
255
+  NotifyNotification* mNotification;
256
+  gulong mClosureHandler;
257
+
258
+  nsresult StartRequest(const nsAString & aImageUrl);
259
+  nsresult ShowAlert(GdkPixbuf* aPixbuf);
260
+};
261
+
262
+#endif
263
diff --git toolkit/system/gnome/nsGnomeModule.cpp toolkit/system/gnome/nsGnomeModule.cpp
264
index 5ccc8e5..f893893 100644
265
--- mozilla/toolkit/system/gnome/nsGnomeModule.cpp
266
+++ mozilla/toolkit/system/gnome/nsGnomeModule.cpp
267
@@ -22,6 +22,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSService, Init)
268
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService)
269
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init)
270
 #endif
271
+#include "nsSystemAlertsService.h"
272
+NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemAlertsService, Init)
273
 
274
 #ifdef MOZ_ENABLE_GCONF
275
 NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
276
@@ -33,6 +35,7 @@ NS_DEFINE_NAMED_CID(NS_GNOMEVFSSERVICE_CID);
277
 NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
278
 NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID);
279
 #endif
280
+NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
281
 
282
 static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
283
 #ifdef MOZ_ENABLE_GCONF
284
@@ -45,6 +48,7 @@ static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
285
   { &kNS_GIOSERVICE_CID, false, nullptr, nsGIOServiceConstructor },
286
   { &kNS_GSETTINGSSERVICE_CID, false, nullptr, nsGSettingsServiceConstructor },
287
 #endif
288
+  { &kNS_SYSTEMALERTSSERVICE_CID, false, nullptr, nsSystemAlertsServiceConstructor },
289
   { nullptr }
290
 };
291
 
292
@@ -59,6 +63,7 @@ static const mozilla::Module::ContractIDEntry kGnomeContracts[] = {
293
   { NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID },
294
   { NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID },
295
 #endif
296
+  { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
297
   { nullptr }
298
 };
299
 
300
diff --git toolkit/system/gnome/nsSystemAlertsService.cpp toolkit/system/gnome/nsSystemAlertsService.cpp
301
new file mode 100644
302
index 0000000..b91b402
303
--- /dev/null
304
+++ mozilla/toolkit/system/gnome/nsSystemAlertsService.cpp
305
@@ -0,0 +1,53 @@
306
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */
307
+/* This Source Code Form is subject to the terms of the Mozilla Public
308
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
309
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
310
+
311
+#include "nsXULAppAPI.h"
312
+#include "nsSystemAlertsService.h"
313
+#include "nsAlertsIconListener.h"
314
+#include "nsAutoPtr.h"
315
+
316
+NS_IMPL_ADDREF(nsSystemAlertsService)
317
+NS_IMPL_RELEASE(nsSystemAlertsService)
318
+
319
+NS_INTERFACE_MAP_BEGIN(nsSystemAlertsService)
320
+   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAlertsService)
321
+   NS_INTERFACE_MAP_ENTRY(nsIAlertsService)
322
+NS_INTERFACE_MAP_END_THREADSAFE
323
+
324
+nsSystemAlertsService::nsSystemAlertsService()
325
+{
326
+}
327
+
328
+nsSystemAlertsService::~nsSystemAlertsService()
329
+{}
330
+
331
+nsresult
332
+nsSystemAlertsService::Init()
333
+{
334
+  return NS_OK;
335
+}
336
+
337
+NS_IMETHODIMP nsSystemAlertsService::ShowAlertNotification(const nsAString & aImageUrl, const nsAString & aAlertTitle, 
338
+                                                           const nsAString & aAlertText, bool aAlertTextClickable,
339
+                                                           const nsAString & aAlertCookie,
340
+                                                           nsIObserver * aAlertListener,
341
+                                                           const nsAString & aAlertName,
342
+                                                           const nsAString & aBidi,
343
+                                                           const nsAString & aLang,
344
+                                                           nsIPrincipal * aPrincipal)
345
+{
346
+  nsRefPtr<nsAlertsIconListener> alertListener = new nsAlertsIconListener();
347
+  if (!alertListener)
348
+    return NS_ERROR_OUT_OF_MEMORY;
349
+
350
+  return alertListener->InitAlertAsync(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
351
+                                       aAlertCookie, aAlertListener);
352
+}
353
+
354
+NS_IMETHODIMP nsSystemAlertsService::CloseAlert(const nsAString& aAlertName,
355
+                                                nsIPrincipal* aPrincipal)
356
+{
357
+  return NS_ERROR_NOT_IMPLEMENTED;
358
+}
359
diff --git toolkit/system/gnome/nsSystemAlertsService.h toolkit/system/gnome/nsSystemAlertsService.h
360
new file mode 100644
361
index 0000000..b0bd625
362
--- /dev/null
363
+++ mozilla/toolkit/system/gnome/nsSystemAlertsService.h
364
@@ -0,0 +1,27 @@
365
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
366
+/* This Source Code Form is subject to the terms of the Mozilla Public
367
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
368
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
369
+
370
+#ifndef nsSystemAlertsService_h__
371
+#define nsSystemAlertsService_h__
372
+
373
+#include "nsIAlertsService.h"
374
+#include "nsCOMPtr.h"
375
+
376
+class nsSystemAlertsService : public nsIAlertsService
377
+{
378
+public:
379
+  NS_DECL_NSIALERTSSERVICE
380
+  NS_DECL_ISUPPORTS
381
+
382
+  nsSystemAlertsService();
383
+
384
+  nsresult Init();
385
+
386
+protected:
387
+  virtual ~nsSystemAlertsService();
388
+
389
+};
390
+
391
+#endif /* nsSystemAlertsService_h__ */
(-)files/patch-bug961264 (-266 lines)
Lines 1-266 Link Here
1
commit d099acd
2
Author: Trevor Saunders <trev.saunders@gmail.com>
3
Date:   Fri Jan 17 15:08:00 2014 -0800
4
5
    Bug 961264 - Remove obsolete checks for gcc visibility stuff.
6
---
7
 configure.in        | 115 +++-------------------------------------------------
8
 js/src/configure.in | 111 ++------------------------------------------------
9
 2 files changed, 8 insertions(+), 218 deletions(-)
10
11
diff --git configure.in configure.in
12
index dfb8193..33d71b3 100644
13
--- mozilla/configure.in
14
+++ mozilla/configure.in
15
@@ -2507,118 +2507,15 @@ MOZ_CXX11
16
 
17
 AC_LANG_C
18
 
19
-dnl Check for .hidden assembler directive and visibility attribute.
20
-dnl Borrowed from glibc configure.in
21
+dnl Setup default hidden visibility and wrapped system headers.
22
 dnl ===============================================================
23
 if test "$GNU_CC"; then
24
-  AC_CACHE_CHECK(for visibility(hidden) attribute,
25
-                 ac_cv_visibility_hidden,
26
-                 [cat > conftest.c <<EOF
27
-                  int foo __attribute__ ((visibility ("hidden"))) = 1;
28
-EOF
29
-                  ac_cv_visibility_hidden=no
30
-                  if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
31
-                    if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
32
-                      ac_cv_visibility_hidden=yes
33
-                    fi
34
-                  fi
35
-                  rm -f conftest.[cs]
36
-                 ])
37
-  if test "$ac_cv_visibility_hidden" = "yes"; then
38
-    AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
39
-
40
-    AC_CACHE_CHECK(for visibility(default) attribute,
41
-                   ac_cv_visibility_default,
42
-                   [cat > conftest.c <<EOF
43
-                    int foo __attribute__ ((visibility ("default"))) = 1;
44
-EOF
45
-                    ac_cv_visibility_default=no
46
-                    if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
47
-                      if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
48
-                        ac_cv_visibility_default=yes
49
-                      fi
50
-                    fi
51
-                    rm -f conftest.[cs]
52
-                   ])
53
-    if test "$ac_cv_visibility_default" = "yes"; then
54
-      AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
55
-
56
-      AC_CACHE_CHECK(for visibility pragma support,
57
-                     ac_cv_visibility_pragma,
58
-                     [cat > conftest.c <<EOF
59
-#pragma GCC visibility push(hidden)
60
-                      int foo_hidden = 1;
61
-#pragma GCC visibility push(default)
62
-                      int foo_default = 1;
63
-EOF
64
-                      ac_cv_visibility_pragma=no
65
-                      if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
66
-                        if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
67
-                          if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
68
-                            ac_cv_visibility_pragma=yes
69
-                          fi
70
-                        fi
71
-                      fi
72
-                      rm -f conftest.[cs]
73
-                    ])
74
-      if test "$ac_cv_visibility_pragma" = "yes"; then
75
-        AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
76
-                       ac_cv_have_visibility_class_bug,
77
-                       [cat > conftest.c <<EOF
78
-#pragma GCC visibility push(hidden)
79
-struct __attribute__ ((visibility ("default"))) TestStruct {
80
-  static void Init();
81
-};
82
-__attribute__ ((visibility ("default"))) void TestFunc() {
83
-  TestStruct::Init();
84
-}
85
-EOF
86
-                       ac_cv_have_visibility_class_bug=no
87
-                       if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
88
-                         ac_cv_have_visibility_class_bug=yes
89
-                       else
90
-                         if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
91
-                           ac_cv_have_visibility_class_bug=yes
92
-                         fi
93
-                       fi
94
-                       rm -rf conftest.{c,S}
95
-                       ])
96
-
97
-        AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
98
-                       ac_cv_have_visibility_builtin_bug,
99
-                       [cat > conftest.c <<EOF
100
-#pragma GCC visibility push(hidden)
101
-#pragma GCC visibility push(default)
102
-#include <string.h>
103
-#pragma GCC visibility pop
104
-
105
-__attribute__ ((visibility ("default"))) void Func() {
106
-  char c[[100]];
107
-  memset(c, 0, sizeof(c));
108
-}
109
-EOF
110
-                       ac_cv_have_visibility_builtin_bug=no
111
-                       if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
112
-                         ac_cv_have_visibility_builtin_bug=yes
113
-                       else
114
-                         if test `grep -c "@PLT" conftest.S` = 0; then
115
-                           ac_cv_visibility_builtin_bug=yes
116
-                         fi
117
-                       fi
118
-                       rm -f conftest.{c,S}
119
-                       ])
120
-        if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
121
-                "$ac_cv_have_visibility_class_bug" = "no"; then
122
-          VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
123
-          WRAP_SYSTEM_INCLUDES=1
124
-          STL_FLAGS='-I$(DIST)/stl_wrappers'
125
-          WRAP_STL_INCLUDES=1
126
-        else
127
-          VISIBILITY_FLAGS='-fvisibility=hidden'
128
-        fi # have visibility pragma bug
129
-      fi   # have visibility pragma
130
-    fi     # have visibility(default) attribute
131
-  fi       # have visibility(hidden) attribute
132
+  AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
133
+  AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
134
+  VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
135
+  WRAP_SYSTEM_INCLUDES=1
136
+  STL_FLAGS='-I$(DIST)/stl_wrappers'
137
+  WRAP_STL_INCLUDES=1
138
 fi         # GNU_CC
139
 
140
 # visibility hidden flag for Sun Studio on Solaris
141
diff --git js/src/configure.in js/src/configure.in
142
index bddd46d..d4b522e 100644
143
--- mozilla/js/src/configure.in
144
+++ mozilla/js/src/configure.in
145
@@ -2077,116 +2077,13 @@ AC_LANG_CPLUSPLUS
146
 
147
 MOZ_CXX11
148
 
149
-dnl Check for .hidden assembler directive and visibility attribute.
150
-dnl Borrowed from glibc configure.in
151
+dnl Setup default hidden visibility and wrapped system headers.
152
 dnl ===============================================================
153
 if test "$GNU_CC"; then
154
-  AC_CACHE_CHECK(for visibility(hidden) attribute,
155
-                 ac_cv_visibility_hidden,
156
-                 [cat > conftest.c <<EOF
157
-                  int foo __attribute__ ((visibility ("hidden"))) = 1;
158
-EOF
159
-                  ac_cv_visibility_hidden=no
160
-                  if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
161
-                    if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
162
-                      ac_cv_visibility_hidden=yes
163
-                    fi
164
-                  fi
165
-                  rm -f conftest.[cs]
166
-                 ])
167
-  if test "$ac_cv_visibility_hidden" = "yes"; then
168
-    AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
169
-
170
-    AC_CACHE_CHECK(for visibility(default) attribute,
171
-                   ac_cv_visibility_default,
172
-                   [cat > conftest.c <<EOF
173
-                    int foo __attribute__ ((visibility ("default"))) = 1;
174
-EOF
175
-                    ac_cv_visibility_default=no
176
-                    if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
177
-                      if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
178
-                        ac_cv_visibility_default=yes
179
-                      fi
180
-                    fi
181
-                    rm -f conftest.[cs]
182
-                   ])
183
-    if test "$ac_cv_visibility_default" = "yes"; then
184
-      AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
185
-
186
-      AC_CACHE_CHECK(for visibility pragma support,
187
-                     ac_cv_visibility_pragma,
188
-                     [cat > conftest.c <<EOF
189
-#pragma GCC visibility push(hidden)
190
-                      int foo_hidden = 1;
191
-#pragma GCC visibility push(default)
192
-                      int foo_default = 1;
193
-EOF
194
-                      ac_cv_visibility_pragma=no
195
-                      if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
196
-                        if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
197
-                          if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
198
-                            ac_cv_visibility_pragma=yes
199
-                          fi
200
-                        fi
201
-                      fi
202
-                      rm -f conftest.[cs]
203
-                    ])
204
-      if test "$ac_cv_visibility_pragma" = "yes"; then
205
-        AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
206
-                       ac_cv_have_visibility_class_bug,
207
-                       [cat > conftest.c <<EOF
208
-#pragma GCC visibility push(hidden)
209
-struct __attribute__ ((visibility ("default"))) TestStruct {
210
-  static void Init();
211
-};
212
-__attribute__ ((visibility ("default"))) void TestFunc() {
213
-  TestStruct::Init();
214
-}
215
-EOF
216
-                       ac_cv_have_visibility_class_bug=no
217
-                       if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
218
-                         ac_cv_have_visibility_class_bug=yes
219
-                       else
220
-                         if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
221
-                           ac_cv_have_visibility_class_bug=yes
222
-                         fi
223
-                       fi
224
-                       rm -rf conftest.{c,S}
225
-                       ])
226
-
227
-        AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
228
-                       ac_cv_have_visibility_builtin_bug,
229
-                       [cat > conftest.c <<EOF
230
-#pragma GCC visibility push(hidden)
231
-#pragma GCC visibility push(default)
232
-#include <string.h>
233
-#pragma GCC visibility pop
234
-
235
-__attribute__ ((visibility ("default"))) void Func() {
236
-  char c[[100]];
237
-  memset(c, 0, sizeof(c));
238
-}
239
-EOF
240
-                       ac_cv_have_visibility_builtin_bug=no
241
-                       if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
242
-                         ac_cv_have_visibility_builtin_bug=yes
243
-                       else
244
-                         if test `grep -c "@PLT" conftest.S` = 0; then
245
-                           ac_cv_visibility_builtin_bug=yes
246
-                         fi
247
-                       fi
248
-                       rm -f conftest.{c,S}
249
-                       ])
250
-        if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
251
-                "$ac_cv_have_visibility_class_bug" = "no"; then
252
-          VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
253
-          WRAP_SYSTEM_INCLUDES=1
254
-        else
255
-          VISIBILITY_FLAGS='-fvisibility=hidden'
256
-        fi # have visibility pragma bug
257
-      fi   # have visibility pragma
258
-    fi     # have visibility(default) attribute
259
-  fi       # have visibility(hidden) attribute
260
+  AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
261
+  AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
262
+  VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
263
+  WRAP_SYSTEM_INCLUDES=1
264
 fi         # GNU_CC
265
 
266
 # visibility hidden flag for Sun Studio on Solaris
(-)files/patch-config-baseconfig.mk (-6 / +9 lines)
Lines 1-6 Link Here
1
--- config/baseconfig.mk~
1
--- mozilla/config/baseconfig.mk.orig	2015-07-20 22:39:14.000000000 +0200
2
+++ config/baseconfig.mk
2
+++ mozilla/config/baseconfig.mk	2015-07-20 22:39:23.000000000 +0200
3
@@ -1,7 +1,7 @@
3
@@ -2,10 +2,10 @@
4
 # directly in python/mozbuild/mozbuild/base.py for gmake validation.
5
 # We thus use INCLUDED_AUTOCONF_MK to enable/disable some parts depending
6
 # whether a normal build is happening or whether the check is running.
4
-includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
7
-includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
5
-idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
8
-idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
6
-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
9
-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
Lines 9-14 Link Here
9
+idldir = $(datadir)/idl/%%MOZILLA%%
12
+idldir = $(datadir)/idl/%%MOZILLA%%
10
+installdir = $(libdir)/%%MOZILLA%%
13
+installdir = $(libdir)/%%MOZILLA%%
11
+sdkdir = $(libdir)/%%MOZILLA%%
14
+sdkdir = $(libdir)/%%MOZILLA%%
12
 MOZILLA_SRCDIR = $(topsrcdir)/mozilla
15
 ifndef TOP_DIST
13
 MOZDEPTH = $(DEPTH)/mozilla
16
 TOP_DIST = dist
14
 DIST = $(MOZDEPTH)/dist
17
 endif
(-)files/patch-ijg-libjpeg (-45 / +43 lines)
Lines 17-27 Link Here
17
                    MOZ_NATIVE_JPEG=1,
17
                    MOZ_NATIVE_JPEG=1,
18
                    AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
18
                    AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
19
 fi
19
 fi
20
diff --git mozilla/image/decoders/nsJPEGDecoder.cpp mozilla/image/decoders/nsJPEGDecoder.cpp
20
21
index 8fa8200..1d2a259 100644
21
--- mozilla/image/decoders/nsJPEGDecoder.cpp.orig	2015-07-07 19:45:40.000000000 +0200
22
--- mozilla/image/decoders/nsJPEGDecoder.cpp
22
+++ mozilla/image/decoders/nsJPEGDecoder.cpp	2015-07-22 14:59:40.000000000 +0200
23
+++ mozilla/image/decoders/nsJPEGDecoder.cpp
23
@@ -23,13 +23,28 @@
24
@@ -21,13 +21,28 @@
25
 
24
 
26
 extern "C" {
25
 extern "C" {
27
 #include "iccjpeg.h"
26
 #include "iccjpeg.h"
Lines 28-34 Link Here
28
-}
27
-}
29
 
28
 
30
+#ifdef JCS_EXTENSIONS
29
+#ifdef JCS_EXTENSIONS
31
 #if defined(IS_BIG_ENDIAN)
30
 #if MOZ_BIG_ENDIAN
32
 #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_XRGB
31
 #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_XRGB
33
 #else
32
 #else
34
 #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_BGRX
33
 #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_BGRX
Lines 38-76 Link Here
38
+struct jpeg_color_deconverter {
37
+struct jpeg_color_deconverter {
39
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
38
+  JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
40
+  JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
39
+  JMETHOD(void, color_convert, (j_decompress_ptr cinfo,
41
+				JSAMPIMAGE input_buf, JDIMENSION input_row,
40
+          JSAMPIMAGE input_buf, JDIMENSION input_row,
42
+				JSAMPARRAY output_buf, int num_rows));
41
+          JSAMPARRAY output_buf, int num_rows));
43
+};
42
+};
44
+
43
+
45
+METHODDEF(void)
44
+METHODDEF(void)
46
+ycc_rgb_convert_argb (j_decompress_ptr cinfo,
45
+ycc_rgb_convert_argb (j_decompress_ptr cinfo,
47
+                 JSAMPIMAGE input_buf, JDIMENSION input_row,
46
+                      JSAMPIMAGE input_buf, JDIMENSION input_row,
48
+                 JSAMPARRAY output_buf, int num_rows);
47
+                      JSAMPARRAY output_buf, int num_rows);
49
+#endif
48
+#endif
50
+}
49
+}
51
 
50
 
52
 static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
51
 static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width);
53
 
52
 
54
@@ -324,6 +340,7 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
53
@@ -373,6 +388,7 @@
55
       case JCS_GRAYSCALE:
54
         case JCS_GRAYSCALE:
56
       case JCS_RGB:
55
         case JCS_RGB:
57
       case JCS_YCbCr:
56
         case JCS_YCbCr:
58
+#ifdef JCS_EXTENSIONS
57
+#ifdef JCS_EXTENSIONS
59
         // if we're not color managing we can decode directly to
58
           // if we're not color managing we can decode directly to
60
         // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
59
           // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB
61
         if (mCMSMode != eCMSMode_All) {
60
           if (mCMSMode != eCMSMode_All) {
62
@@ -332,6 +349,9 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
61
@@ -381,6 +397,9 @@
63
         } else {
62
           } else {
64
             mInfo.out_color_space = JCS_RGB;
63
               mInfo.out_color_space = JCS_RGB;
65
         }
64
           }
66
+#else
65
+#else
67
+        mInfo.out_color_space = JCS_RGB;
66
+          mInfo.out_color_space = JCS_RGB;
68
+#endif
67
+#endif
69
         break;
68
           break;
70
       case JCS_CMYK:
69
         case JCS_CMYK:
71
       case JCS_YCCK:
70
         case JCS_YCCK:
72
@@ -399,6 +419,15 @@ nsJPEGDecoder::WriteInternal(const char *aBuffer, uint32_t aCount)
71
@@ -450,6 +469,15 @@
73
       return; /* I/O suspension */
72
       return; // I/O suspension
74
     }
73
     }
75
 
74
 
76
+#ifndef JCS_EXTENSIONS
75
+#ifndef JCS_EXTENSIONS
Lines 83-106 Link Here
83
+    }
82
+    }
84
+#endif
83
+#endif
85
 
84
 
86
     /* If this is a progressive JPEG ... */
85
     // If this is a progressive JPEG ...
87
     mState = mInfo.buffered_image ? JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL;
86
     mState = mInfo.buffered_image ?
88
@@ -544,7 +573,11 @@ nsJPEGDecoder::OutputScanlines(bool* suspend)
87
@@ -632,7 +660,11 @@
89
       uint32_t *imageRow = ((uint32_t*)mImageData) +
90
                            (mInfo.output_scanline * mInfo.output_width);
91
 
88
 
89
       MOZ_ASSERT(imageRow, "Should have a row buffer here");
90
 
92
+#ifdef JCS_EXTENSIONS
91
+#ifdef JCS_EXTENSIONS
93
       if (mInfo.out_color_space == MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB) {
92
       if (mInfo.out_color_space == MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB) {
94
+#else
93
+#else
95
+      if (mInfo.cconvert->color_convert == ycc_rgb_convert_argb) {
94
+      if (mInfo.cconvert->color_convert == ycc_rgb_convert_argb) {
96
+#endif
95
+#endif
97
         /* Special case: scanline will be directly converted into packed ARGB */
96
         // Special case: scanline will be directly converted into packed ARGB
98
         if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) {
97
         if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) {
99
           *suspend = true; /* suspend */
98
           *suspend = true; // suspend
100
@@ -854,6 +887,282 @@ term_source (j_decompress_ptr jd)
99
@@ -958,6 +990,281 @@
100
 } // namespace image
101
 } // namespace mozilla
101
 } // namespace mozilla
102
 
102
 
103
 
104
+#ifndef JCS_EXTENSIONS
103
+#ifndef JCS_EXTENSIONS
105
+/**************** YCbCr -> Cairo's RGB24/ARGB32 conversion: most common case **************/
104
+/**************** YCbCr -> Cairo's RGB24/ARGB32 conversion: most common case **************/
106
+
105
+
Lines 332-345 Link Here
332
+ */
331
+ */
333
+
332
+
334
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
333
+#ifdef RIGHT_SHIFT_IS_UNSIGNED
335
+#define SHIFT_TEMPS	INT32 shift_temp;
334
+#define SHIFT_TEMPS    INT32 shift_temp;
336
+#define RIGHT_SHIFT(x,shft)  \
335
+#define RIGHT_SHIFT(x,shft)  \
337
+	((shift_temp = (x)) < 0 ? \
336
+   ((shift_temp = (x)) < 0 ? \
338
+	 (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
337
+    (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \
339
+	 (shift_temp >> (shft)))
338
+    (shift_temp >> (shft)))
340
+#else
339
+#else
341
+#define SHIFT_TEMPS
340
+#define SHIFT_TEMPS
342
+#define RIGHT_SHIFT(x,shft)	((x) >> (shft))
341
+#define RIGHT_SHIFT(x,shft)    ((x) >> (shft))
343
+#endif
342
+#endif
344
+
343
+
345
+
344
+
Lines 376-382 Link Here
376
+}
375
+}
377
+#endif
376
+#endif
378
+
377
+
379
+
378
 
380
 /**************** Inverted CMYK -> RGB conversion **************/
379
 ///*************** Inverted CMYK -> RGB conversion *************************
381
 /*
380
 /// Input is (Inverted) CMYK stored as 4 bytes per pixel.
382
  * Input is (Inverted) CMYK stored as 4 bytes per pixel.
(-)files/patch-mail-app-nsMailApp.cpp (-6 / +6 lines)
Lines 1-10 Link Here
1
--- mail/app/nsMailApp.cpp~
1
--- mail/app/nsMailApp.cpp.orig	2015-07-07 19:34:06.000000000 +0200
2
+++ mail/app/nsMailApp.cpp
2
+++ mail/app/nsMailApp.cpp	2015-07-21 22:13:54.000000000 +0200
3
@@ -154,6 +154,7 @@ int main(int argc, char* argv[])
3
@@ -320,6 +320,7 @@
4
   TriggerQuirks();
4
   TriggerQuirks();
5
 #endif
5
 #endif
6
 
6
 
7
+  setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
7
+  setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0);
8
   nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath);
8
   int gotCounters;
9
   if (NS_FAILED(rv)) {
9
 #if defined(XP_UNIX)
10
     Output("Couldn't calculate the application directory.\n");
10
   struct rusage initialRUsage;
(-)files/patch-mozilla_toolkit_mozapps_installer_packager_mk (-6 / +4 lines)
Lines 1-8 Link Here
1
$OpenBSD: patch-toolkit_mozapps_installer_packager_mk,v 1.11 2012/06/11 15:29:56 landry Exp $
1
--- mozilla/toolkit/mozapps/installer/packager.mk.orig	2015-07-07 19:45:55.000000000 +0200
2
install headers/idl/sdk libs only if xulrunner
2
+++ mozilla/toolkit/mozapps/installer/packager.mk	2015-07-21 23:04:19.000000000 +0200
3
--- mozilla/toolkit/mozapps/installer/packager.mk.orig	Fri Jun  1 14:04:20 2012
3
@@ -123,7 +123,7 @@
4
+++ mozilla/toolkit/mozapps/installer/packager.mk	Tue Jun  5 07:55:51 2012
5
@@ -886,7 +886,7 @@ endif
6
 	$(NSINSTALL) -D $(DESTDIR)$(bindir)
4
 	$(NSINSTALL) -D $(DESTDIR)$(bindir)
7
 	$(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
5
 	$(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
8
 	ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
6
 	ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
Lines 9-13 Link Here
9
-ifdef INSTALL_SDK # Here comes the hard part
7
-ifdef INSTALL_SDK # Here comes the hard part
10
+ifeq ($(MOZ_APP_NAME),xulrunner)
8
+ifeq ($(MOZ_APP_NAME),xulrunner)
11
 	$(NSINSTALL) -D $(DESTDIR)$(includedir)
9
 	$(NSINSTALL) -D $(DESTDIR)$(includedir)
12
 	(cd $(DIST)/include && tar $(TAR_CREATE_FLAGS) - .) | \
10
 	(cd $(DIST)/include && $(TAR) $(TAR_CREATE_FLAGS) - .) | \
13
 	  (cd $(DESTDIR)$(includedir) && tar -xf -)
11
 	  (cd $(DESTDIR)$(includedir) && tar -xf -)
(-)files/patch-z-bug517422 (-282 / +329 lines)
Lines 1-35 Link Here
1
# Allow more config/external/ libs built against system-wide version.
1
--- ./mozilla/config/external/moz.build.orig	2015-07-21 22:27:33.000000000 +0200
2
2
+++ ./mozilla/config/external/moz.build	2015-07-21 22:27:40.000000000 +0200
3
diff --git config/Makefile.in config/Makefile.in
3
@@ -19,10 +19,19 @@
4
index 5383399..0410004 100644
4
 # There's no "native brotli" yet, but probably in the future...
5
--- mozilla/config/Makefile.in
5
 external_dirs += ['modules/brotli']
6
+++ mozilla/config/Makefile.in
7
@@ -79,6 +79,13 @@ export:: $(export-preqs)
8
 		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
9
 		-DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
10
 		-DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
11
+		-DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \
12
+		-DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \
13
+		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
14
+		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
15
+		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
16
+		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
17
+		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
18
 		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
19
 	$(INSTALL) system_wrappers $(DIST)
20
 
6
 
21
diff --git config/external/moz.build config/external/moz.build
22
index f67c5c7..eb909ce 100644
23
--- mozilla/config/external/moz.build
24
+++ mozilla/config/external/moz.build
25
@@ -15,13 +15,19 @@ if CONFIG['MOZ_UPDATER']:
26
     if not CONFIG['MOZ_NATIVE_BZ2']:
27
         external_dirs += ['modules/libbz2']
28
 
29
-if CONFIG['MOZ_VORBIS']:
7
-if CONFIG['MOZ_VORBIS']:
30
+if not CONFIG['MOZ_NATIVE_OGG']:
8
+if not CONFIG['MOZ_NATIVE_OGG']:
31
+    external_dirs += ['media/libogg']
9
+    external_dirs += ['media/libogg']
32
+
10
+
11
+if not CONFIG['MOZ_NATIVE_CELT'] or not CONFIG['MOZ_NATIVE_OPUS']:
12
+    external_dirs += ['media/libopus']
13
+
33
+if not CONFIG['MOZ_NATIVE_THEORA']:
14
+if not CONFIG['MOZ_NATIVE_THEORA']:
34
+    external_dirs += ['media/libtheora']
15
+    external_dirs += ['media/libtheora']
35
+
16
+
Lines 40-51 Link Here
40
+if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
21
+if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
41
     external_dirs += ['media/libtremor']
22
     external_dirs += ['media/libtremor']
42
 
23
 
43
-if CONFIG['MOZ_OPUS']:
44
+if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']:
45
     external_dirs += ['media/libopus']
46
 
47
 if CONFIG['MOZ_WEBM']:
24
 if CONFIG['MOZ_WEBM']:
48
@@ -36,13 +42,15 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ_NATIVE_LIBVPX']:
25
@@ -37,15 +46,16 @@
49
 if not CONFIG['MOZ_NATIVE_PNG']:
26
 if not CONFIG['MOZ_NATIVE_PNG']:
50
     external_dirs += ['media/libpng']
27
     external_dirs += ['media/libpng']
51
 
28
 
Lines 59-93 Link Here
59
     'media/kiss_fft',
36
     'media/kiss_fft',
60
     'media/libcubeb',
37
     'media/libcubeb',
61
-    'media/libogg',
38
-    'media/libogg',
39
-    'media/libopus',
62
-    'media/libtheora',
40
-    'media/libtheora',
63
-    'media/libspeex_resampler',
41
-    'media/libspeex_resampler',
42
     'media/libstagefright',
64
-    'media/libsoundtouch',
43
-    'media/libsoundtouch',
65
 ]
44
 ]
66
 
45
 
67
 PARALLEL_DIRS += ['../../' + i for i in external_dirs]
46
 DIRS += ['../../' + i for i in external_dirs]
68
diff --git config/system-headers config/system-headers
47
--- ./mozilla/config/Makefile.in.orig	2015-07-21 22:27:09.000000000 +0200
69
index bef567c..9807c29 100644
48
+++ ./mozilla/config/Makefile.in	2015-07-21 22:27:14.000000000 +0200
70
--- mozilla/config/system-headers
49
@@ -79,6 +79,14 @@
71
+++ mozilla/config/system-headers
50
 		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
72
@@ -1050,8 +1050,6 @@ X11/Xutil.h
51
 		-DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
73
 xpt_struct.h
52
 		-DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
74
 xpt_xdr.h
53
+		-DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \
54
+		-DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \
55
+		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
56
+		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
57
+		-DMOZ_NATIVE_CELT=$(MOZ_NATIVE_CELT) \
58
+		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
59
+		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
60
+		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
61
 		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
62
 	$(INSTALL) system_wrappers $(DIST)
63
 
64
--- ./mozilla/config/system-headers.orig	2015-07-21 22:27:54.000000000 +0200
65
+++ ./mozilla/config/system-headers	2015-07-21 22:29:34.000000000 +0200
66
@@ -1268,7 +1268,6 @@
67
 X11/Xos.h
68
 X11/Xutil.h
75
 zmouse.h
69
 zmouse.h
76
-speex/speex_resampler.h
77
-soundtouch/SoundTouch.h
70
-soundtouch/SoundTouch.h
78
 #if MOZ_NATIVE_PNG==1
71
 #if MOZ_NATIVE_PNG==1
79
 png.h
72
 png.h
80
 #endif
73
 #endif
81
@@ -1119,6 +1117,8 @@ ogg/ogg.h
74
@@ -1330,6 +1329,7 @@
75
 theora/theoradec.h
76
 tremor/ivorbiscodec.h
77
 speex/speex_resampler.h
78
+soundtouch/SoundTouch.h
79
 ogg/ogg.h
82
 ogg/os_types.h
80
 ogg/os_types.h
83
 nestegg/nestegg.h
81
 nestegg/nestegg.h
84
 cubeb/cubeb.h
82
@@ -1371,3 +1371,35 @@
85
+speex/speex_resampler.h
86
+soundtouch/SoundTouch.h
87
 #endif
88
 gst/gst.h
89
 gst/app/gstappsink.h
90
@@ -1155,3 +1155,29 @@ graphite2/Segment.h
91
 harfbuzz/hb-ot.h
83
 harfbuzz/hb-ot.h
92
 harfbuzz/hb.h
84
 harfbuzz/hb.h
93
 #endif
85
 #endif
Lines 105-110 Link Here
105
+#if MOZ_NATIVE_TREMOR==1
97
+#if MOZ_NATIVE_TREMOR==1
106
+tremor/ivorbiscodec.h
98
+tremor/ivorbiscodec.h
107
+#endif
99
+#endif
100
+#if MOZ_NATIVE_CELT==1
101
+celt.h
102
+celt_header.h
103
+celt/celt.h
104
+celt/celt_header.h
105
+#endif
108
+#if MOZ_NATIVE_OPUS==1
106
+#if MOZ_NATIVE_OPUS==1
109
+opus.h
107
+opus.h
110
+opus_multistream.h
108
+opus_multistream.h
Lines 117-127 Link Here
117
+#if MOZ_NATIVE_SOUNDTOUCH==1
115
+#if MOZ_NATIVE_SOUNDTOUCH==1
118
+soundtouch/SoundTouch.h
116
+soundtouch/SoundTouch.h
119
+#endif
117
+#endif
120
diff --git configure.in configure.in
118
--- ./mozilla/media/libspeex_resampler/README_MOZILLA.orig	2015-07-21 22:39:41.000000000 +0200
121
index 87db361..7947626 100644
119
+++ ./mozilla/media/libspeex_resampler/README_MOZILLA	2015-07-21 22:39:53.000000000 +0200
122
--- mozilla/configure.in
120
@@ -3,3 +3,6 @@
123
+++ mozilla/configure.in
121
 
124
@@ -5211,6 +5211,63 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
122
 It consists in the audio resampling code (resampler.c) and its header files
123
 dependancies, imported into the tree using the update.sh script.
124
+
125
+The in-tree copy may be omitted during build by --with-system-speex.
126
+Keep version in configure.in in sync on updates.
127
--- ./mozilla/media/libtheora/README_MOZILLA.orig	2015-07-21 22:40:00.000000000 +0200
128
+++ ./mozilla/media/libtheora/README_MOZILLA	2015-07-21 22:40:13.000000000 +0200
129
@@ -3,3 +3,6 @@
130
 the addition/update of Makefile.in files for the Mozilla build system.
131
 
132
 The subversion revision used was r17578.
133
+
134
+The in-tree copy may be omitted during build by --with-system-theora.
135
+Keep version in configure.in in sync on updates.
136
--- ./mozilla/media/libtheora/moz.build.orig	2015-07-21 22:40:25.000000000 +0200
137
+++ ./mozilla/media/libtheora/moz.build	2015-07-21 22:41:05.000000000 +0200
138
@@ -93,3 +93,5 @@
139
         if CONFIG['OS_TARGET'] == 'Android':
140
             DEFINES['__linux__'] = True
141
 
142
+if CONFIG['MOZ_NATIVE_OGG']:
143
+    CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
144
--- ./mozilla/media/libogg/README_MOZILLA.orig	2015-07-21 22:37:54.000000000 +0200
145
+++ ./mozilla/media/libogg/README_MOZILLA	2015-07-21 22:38:28.000000000 +0200
146
@@ -6,3 +6,6 @@
147
 The int-types.patch address a bug that config_types.h generated from
148
 Linux platform can't be used on OpenSolaris directly see Mozilla bug
149
 449754
150
+
151
+The in-tree copy may be omitted during build by --with-system-ogg.
152
+Keep version in configure.in in sync on updates.
153
--- ./mozilla/media/libopus/README_MOZILLA.orig	2015-07-21 22:38:46.000000000 +0200
154
+++ ./mozilla/media/libopus/README_MOZILLA	2015-07-21 22:39:03.000000000 +0200
155
@@ -9,3 +9,6 @@
156
 The upstream repository is https://git.xiph.org/opus.git
157
 
158
 The git tag/revision used was v1.1.
159
+
160
+The in-tree copy may be omitted during build by --with-system-opus.
161
+So, keep its pkg-config version check within configure.in in sync on updates.
162
--- ./mozilla/media/libvorbis/README_MOZILLA.orig	2015-07-21 22:42:55.000000000 +0200
163
+++ ./mozilla/media/libvorbis/README_MOZILLA	2015-07-21 22:43:08.000000000 +0200
164
@@ -8,3 +8,6 @@
165
 
166
 Some files are renamed during the copy to prevent clashes with object
167
 file names with other Mozilla libraries.
168
+
169
+The in-tree copy may be omitted during build by --with-system-vorbis.
170
+Keep version in configure.in in sync on updates.
171
--- ./mozilla/media/libvorbis/moz.build.orig	2015-07-21 22:43:16.000000000 +0200
172
+++ ./mozilla/media/libvorbis/moz.build	2015-07-21 22:43:55.000000000 +0200
173
@@ -55,3 +55,6 @@
174
 # Suppress warnings in third-party code.
175
 if CONFIG['GNU_CC']:
176
     CFLAGS += ['-Wno-uninitialized']
177
+
178
+if CONFIG['MOZ_NATIVE_OGG']:
179
+    CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
180
--- ./mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi.orig	2015-07-21 22:47:33.000000000 +0200
181
+++ ./mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi	2015-07-21 22:48:34.000000000 +0200
182
@@ -84,19 +84,11 @@
183
           ],
184
 	}],
185
         ['build_with_mozilla==1', {
186
-          'include_dirs': [
187
-            # Need Opus header files for the audio classifier.
188
-            '<(DEPTH)/../../../media/opus/celt',
189
-#            '<(DEPTH)/third_party/opus/src/src',
190
+          'cflags_mozilla': [
191
+            '$(filter -I%, $(MOZ_CELT_CFLAGS))/celt',
192
+            '$(MOZ_OPUS_CFLAGS)',
193
+            '$(filter -I%, $(MOZ_OPUS_CFLAGS))/../src',
194
           ],
195
-          'direct_dependent_settings': {
196
-            'include_dirs': [
197
-              '../../../../../../media/opus/celt',
198
-              # Need Opus header files for the audio classifier.
199
-              '<(DEPTH)/../../../media/opus/celt',
200
-#              '<(DEPTH)/third_party/opus/src/src',
201
-            ],
202
-          },
203
         }],
204
       ],
205
       'sources': [
206
--- ./mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi.orig	2015-07-21 22:45:37.000000000 +0200
207
+++ ./mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi	2015-07-21 22:46:56.000000000 +0200
208
@@ -17,18 +17,11 @@
209
       'conditions': [
210
         ['build_with_mozilla==1', {
211
           # Mozilla provides its own build of the opus library.
212
-          'include_dirs': [
213
-            '/media/libopus/include',
214
-            '/media/libopus/src',
215
-            '/media/libopus/celt',
216
+          'cflags_mozilla': [
217
+            '$(filter -I%, $(MOZ_CELT_CFLAGS))/celt',
218
+            '$(MOZ_OPUS_CFLAGS)',
219
+            '$(filter -I%, $(MOZ_OPUS_CFLAGS))/../src',
220
           ],
221
-          'direct_dependent_settings': {
222
-            'include_dirs': [
223
-              '/media/libopus/include',
224
-              '/media/libopus/src',
225
-              '/media/libopus/celt',
226
-            ],
227
-          },
228
         }, {
229
           'dependencies': [
230
             '<(DEPTH)/third_party/opus/opus.gyp:opus'
231
--- ./mozilla/media/webrtc/signaling/test/moz.build.orig	2015-07-21 22:44:10.000000000 +0200
232
+++ ./mozilla/media/webrtc/signaling/test/moz.build	2015-07-21 22:44:32.000000000 +0200
233
@@ -119,6 +119,9 @@
234
 if CONFIG['MOZ_NATIVE_JPEG']:
235
     OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
236
 
237
+if CONFIG['MOZ_NATIVE_OPUS']:
238
+    OS_LIBS += CONFIG['MOZ_OPUS_LIBS']
239
+
240
 if CONFIG['MOZ_NATIVE_LIBVPX']:
241
     OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
242
 
243
--- ./mozilla/media/libtremor/README_MOZILLA.orig	2015-07-21 22:42:11.000000000 +0200
244
+++ ./mozilla/media/libtremor/README_MOZILLA	2015-07-21 22:42:25.000000000 +0200
245
@@ -5,3 +5,6 @@
246
 
247
 The upstream release used was http://svn.xiph.org/trunk/Tremor/
248
 The subversion revision used was r17547.
249
+
250
+The in-tree copy may be omitted during build by --with-system-tremor.
251
+Keep version in configure.in in sync on updates.
252
--- ./mozilla/media/libtremor/moz.build.orig	2015-07-21 22:42:31.000000000 +0200
253
+++ ./mozilla/media/libtremor/moz.build	2015-07-21 22:42:48.000000000 +0200
254
@@ -6,3 +6,5 @@
255
 
256
 DIRS += ['include/tremor', 'lib']
257
 
258
+if CONFIG['MOZ_NATIVE_OGG']:
259
+    CFLAGS += CONFIG['MOZ_OGG_CFLAGS']
260
--- ./mozilla/media/libsoundtouch/README_MOZILLA.orig	2015-07-21 22:39:12.000000000 +0200
261
+++ ./mozilla/media/libsoundtouch/README_MOZILLA	2015-07-21 22:39:27.000000000 +0200
262
@@ -6,3 +6,5 @@
263
 using the script `update.sh`. Some changes have been made to the files, using
264
 the patch `moz-libsoundtouch.patch`. We also use a custom soundtouch_config.h.
265
 
266
+The in-tree copy may be omitted during build by --with-system-soundtouch.
267
+Keep version in configure.in in sync on updates.
268
--- ./mozilla/media/libcubeb/src/moz.build.orig	2015-07-21 22:37:01.000000000 +0200
269
+++ ./mozilla/media/libcubeb/src/moz.build	2015-07-21 22:37:33.000000000 +0200
270
@@ -71,6 +71,9 @@
271
 
272
 FINAL_LIBRARY = 'gkmedias'
273
 
274
+if CONFIG['MOZ_NATIVE_SPEEX']:
275
+    SOURCES['cubeb_resampler.cpp'].flags += CONFIG['MOZ_SPEEX_CFLAGS']
276
+
277
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
278
     CFLAGS += [
279
         '-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
280
--- ./mozilla/dom/media/AudioStream.h.orig	2015-07-21 22:34:56.000000000 +0200
281
+++ ./mozilla/dom/media/AudioStream.h	2015-07-21 22:35:18.000000000 +0200
282
@@ -17,7 +17,7 @@
283
 #include "CubebUtils.h"
284
 
285
 namespace soundtouch {
286
-class SoundTouch;
287
+class MOZ_IMPORT_API SoundTouch;
288
 }
289
 
290
 namespace mozilla {
291
--- ./mozilla/dom/media/moz.build.orig	2015-07-21 22:35:30.000000000 +0200
292
+++ ./mozilla/dom/media/moz.build	2015-07-21 22:36:41.000000000 +0200
293
@@ -280,6 +280,27 @@
294
 CFLAGS += CONFIG['GSTREAMER_CFLAGS']
295
 CXXFLAGS += CONFIG['GSTREAMER_CFLAGS']
296
 
297
+if CONFIG['MOZ_NATIVE_OGG']:
298
+    CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS']
299
+
300
+if CONFIG['MOZ_NATIVE_THEORA']:
301
+    CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS']
302
+
303
+if CONFIG['MOZ_NATIVE_VORBIS']:
304
+    CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS']
305
+
306
+if CONFIG['MOZ_NATIVE_TREMOR']:
307
+    CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS']
308
+
309
+if CONFIG['MOZ_NATIVE_OPUS']:
310
+    CXXFLAGS += CONFIG['MOZ_OPUS_CFLAGS']
311
+
312
+if CONFIG['MOZ_NATIVE_SPEEX']:
313
+    CXXFLAGS += CONFIG['MOZ_SPEEX_CFLAGS']
314
+
315
+if CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
316
+    CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS']
317
+
318
 include('/ipc/chromium/chromium-config.mozbuild')
319
 
320
 # Suppress some GCC warnings being treated as errors:
321
--- ./mozilla/xpcom/build/XPCOMInit.cpp.orig	2015-07-21 22:50:47.000000000 +0200
322
+++ ./mozilla/xpcom/build/XPCOMInit.cpp	2015-07-21 22:53:32.000000000 +0200
323
@@ -141,7 +141,9 @@
324
 #include "mozilla/VisualEventTracer.h"
325
 #endif
326
 
327
+#ifndef MOZ_OGG_NO_MEM_REPORTING
328
 #include "ogg/ogg.h"
329
+#endif
330
 #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
331
 #if defined(HAVE_STDINT_H)
332
 // mozilla-config.h defines HAVE_STDINT_H, and then it's defined *again* in
333
@@ -669,11 +671,13 @@
334
   // this oddness.
335
   mozilla::SetICUMemoryFunctions();
336
 
337
+#ifndef MOZ_OGG_NO_MEM_REPORTING
338
   // Do the same for libogg.
339
   ogg_set_mem_functions(OggReporter::CountingMalloc,
340
                         OggReporter::CountingCalloc,
341
                         OggReporter::CountingRealloc,
342
                         OggReporter::CountingFree);
343
+#endif
344
 
345
 #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
346
   // And for VPX.
347
--- ./mozilla/toolkit/library/moz.build.orig	2015-07-21 22:49:27.000000000 +0200
348
+++ ./mozilla/toolkit/library/moz.build	2015-07-21 22:50:12.000000000 +0200
349
@@ -226,6 +226,30 @@
350
 if CONFIG['MOZ_NATIVE_HUNSPELL']:
351
     OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
352
 
353
+if CONFIG['MOZ_NATIVE_OGG']:
354
+    OS_LIBS += CONFIG['MOZ_OGG_LIBS']
355
+
356
+if CONFIG['MOZ_NATIVE_THEORA']:
357
+    OS_LIBS += CONFIG['MOZ_THEORA_LIBS']
358
+
359
+if CONFIG['MOZ_NATIVE_VORBIS']:
360
+    OS_LIBS += CONFIG['MOZ_VORBIS_LIBS']
361
+
362
+if CONFIG['MOZ_NATIVE_TREMOR']:
363
+    OS_LIBS += CONFIG['MOZ_TREMOR_LIBS']
364
+
365
+if CONFIG['MOZ_NATIVE_CELT']:
366
+    OS_LIBS += CONFIG['MOZ_CELT_LIBS']
367
+
368
+if CONFIG['MOZ_NATIVE_OPUS']:
369
+    OS_LIBS += CONFIG['MOZ_OPUS_LIBS']
370
+
371
+if CONFIG['MOZ_NATIVE_SPEEX']:
372
+    OS_LIBS += CONFIG['MOZ_SPEEX_LIBS']
373
+
374
+if CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
375
+    OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS']
376
+
377
 if CONFIG['MOZ_NATIVE_LIBEVENT']:
378
     OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']
379
 
380
--- ./mozilla/configure.in.orig	2015-07-21 22:29:55.000000000 +0200
381
+++ ./mozilla/configure.in	2015-07-21 22:34:38.000000000 +0200
382
@@ -5251,6 +5251,157 @@
125
 fi
383
 fi
126
 
384
 
127
 dnl ========================================================
385
 dnl ========================================================
Lines 144-151 Link Here
144
+fi
402
+fi
145
+
403
+
146
+AC_SUBST(MOZ_NATIVE_OGG)
404
+AC_SUBST(MOZ_NATIVE_OGG)
147
+AC_SUBST(MOZ_OGG_CFLAGS)
148
+AC_SUBST(MOZ_OGG_LIBS)
149
+
405
+
150
+dnl ========================================================
406
+dnl ========================================================
151
+dnl Check for libvorbis
407
+dnl Check for libvorbis
Lines 161-168 Link Here
161
+fi
417
+fi
162
+
418
+
163
+AC_SUBST(MOZ_NATIVE_VORBIS)
419
+AC_SUBST(MOZ_NATIVE_VORBIS)
164
+AC_SUBST(MOZ_VORBIS_CFLAGS)
165
+AC_SUBST(MOZ_VORBIS_LIBS)
166
+
420
+
167
+dnl ========================================================
421
+dnl ========================================================
168
+dnl Check for integer-only libvorbis aka tremor
422
+dnl Check for integer-only libvorbis aka tremor
Lines 178-194 Link Here
178
+fi
432
+fi
179
+
433
+
180
+AC_SUBST(MOZ_NATIVE_TREMOR)
434
+AC_SUBST(MOZ_NATIVE_TREMOR)
181
+AC_SUBST(MOZ_TREMOR_CFLAGS)
182
+AC_SUBST(MOZ_TREMOR_LIBS)
183
+
435
+
184
+dnl ========================================================
436
+dnl ========================================================
185
 dnl = Disable Opus audio codec support
437
+dnl Check for libcelt
186
 dnl ========================================================
438
+dnl ========================================================
187
 MOZ_ARG_DISABLE_BOOL(opus,
439
+
188
@@ -5219,6 +5274,97 @@ MOZ_ARG_DISABLE_BOOL(opus,
440
+MOZ_ARG_WITH_BOOL(system-celt,
189
     MOZ_OPUS=1)
441
+[  --with-system-celt      Use system libcelt (located with pkgconfig)],
190
 
442
+MOZ_NATIVE_CELT=1,
191
 dnl ========================================================
443
+MOZ_NATIVE_CELT=)
444
+
445
+if test -n "$MOZ_NATIVE_CELT"; then
446
+    PKG_CHECK_MODULES(MOZ_CELT, celt)
447
+else
448
+    MOZ_CELT_CFLAGS='-I$(topsrcdir)/media/libopus'
449
+fi
450
+
451
+AC_SUBST(MOZ_NATIVE_CELT)
452
+
453
+dnl ========================================================
192
+dnl Check for libopus
454
+dnl Check for libopus
193
+dnl ========================================================
455
+dnl ========================================================
194
+
456
+
Lines 204-211 Link Here
204
+fi
466
+fi
205
+
467
+
206
+AC_SUBST(MOZ_NATIVE_OPUS)
468
+AC_SUBST(MOZ_NATIVE_OPUS)
207
+AC_SUBST(MOZ_OPUS_CFLAGS)
208
+AC_SUBST(MOZ_OPUS_LIBS)
209
+
469
+
210
+dnl ========================================================
470
+dnl ========================================================
211
+dnl Check for libtheora
471
+dnl Check for libtheora
Lines 221-228 Link Here
221
+fi
481
+fi
222
+
482
+
223
+AC_SUBST(MOZ_NATIVE_THEORA)
483
+AC_SUBST(MOZ_NATIVE_THEORA)
224
+AC_SUBST(MOZ_THEORA_CFLAGS)
225
+AC_SUBST(MOZ_THEORA_LIBS)
226
+
484
+
227
+dnl ========================================================
485
+dnl ========================================================
228
+dnl Check for libspeex resampler
486
+dnl Check for libspeex resampler
Lines 238-245 Link Here
238
+fi
496
+fi
239
+
497
+
240
+AC_SUBST(MOZ_NATIVE_SPEEX)
498
+AC_SUBST(MOZ_NATIVE_SPEEX)
241
+AC_SUBST(MOZ_SPEEX_CFLAGS)
242
+AC_SUBST(MOZ_SPEEX_LIBS)
243
+
499
+
244
+dnl ========================================================
500
+dnl ========================================================
245
+dnl Check for libsoundtouch
501
+dnl Check for libsoundtouch
Lines 276-492 Link Here
276
+fi
532
+fi
277
+
533
+
278
+AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
534
+AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
279
+AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
280
+AC_SUBST(MOZ_SOUNDTOUCH_LIBS)
281
+
535
+
282
+dnl ========================================================
536
+dnl ========================================================
283
 dnl = Disable VP8 decoder support
537
 dnl = Disable VP8 decoder support
284
 dnl ========================================================
538
 dnl ========================================================
285
 MOZ_ARG_DISABLE_BOOL(webm,
539
 MOZ_ARG_DISABLE_BOOL(webm,
286
diff --git content/media/AudioStream.h content/media/AudioStream.h
287
index 085676d..00c54fb 100644
288
--- mozilla/content/media/AudioStream.h
289
+++ mozilla/content/media/AudioStream.h
290
@@ -26,7 +26,7 @@ public:
291
 };
292
 
293
 namespace soundtouch {
294
-class SoundTouch;
295
+class MOZ_IMPORT_API SoundTouch;
296
 }
297
 
298
 namespace mozilla {
299
diff --git content/media/Makefile.in content/media/Makefile.in
300
index fd34449..c6c42c8 100644
301
--- mozilla/content/media/Makefile.in
302
+++ mozilla/content/media/Makefile.in
303
@@ -6,3 +6,31 @@ include $(topsrcdir)/config/rules.mk
304
 
305
 CFLAGS   += $(GSTREAMER_CFLAGS)
306
 CXXFLAGS += $(GSTREAMER_CFLAGS)
307
+
308
+ifdef MOZ_NATIVE_OGG
309
+CXXFLAGS += $(MOZ_OGG_CFLAGS)
310
+endif
311
+
312
+ifdef MOZ_NATIVE_THEORA
313
+CXXFLAGS += $(MOZ_THEORA_CFLAGS)
314
+endif
315
+
316
+ifdef MOZ_NATIVE_VORBIS
317
+CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
318
+endif
319
+
320
+ifdef MOZ_NATIVE_TREMOR
321
+CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
322
+endif
323
+
324
+ifdef MOZ_NATIVE_OPUS
325
+CXXFLAGS += $(MOZ_OPUS_CFLAGS)
326
+endif
327
+
328
+ifdef MOZ_NATIVE_SPEEX
329
+CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
330
+endif
331
+
332
+ifdef MOZ_NATIVE_SOUNDTOUCH
333
+CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
334
+endif
335
diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
336
index 4c14494..1cb98e2 100644
337
--- mozilla/media/libcubeb/src/Makefile.in
338
+++ mozilla/media/libcubeb/src/Makefile.in
339
@@ -9,3 +9,7 @@ CFLAGS += \
340
         $(MOZ_ALSA_CFLAGS) \
341
         $(MOZ_PULSEAUDIO_CFLAGS) \
342
         $(NULL)
343
+
344
+ifdef MOZ_NATIVE_SPEEX
345
+CFLAGS += $(MOZ_SPEEX_CFLAGS)
346
+endif
347
diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
348
new file mode 100644
349
index 0000000..1f02dc0
350
--- /dev/null
351
+++ mozilla/media/libtheora/Makefile.in
352
@@ -0,0 +1,9 @@
353
+# This Source Code Form is subject to the terms of the Mozilla Public
354
+# License, v. 2.0. If a copy of the MPL was not distributed with this
355
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
356
+
357
+include $(topsrcdir)/config/rules.mk
358
+
359
+ifdef MOZ_NATIVE_OGG
360
+CFLAGS += $(MOZ_OGG_CFLAGS)
361
+endif
362
diff --git media/libtremor/Makefile.in media/libtremor/Makefile.in
363
new file mode 100644
364
index 0000000..1f02dc0
365
--- /dev/null
366
+++ mozilla/media/libtremor/Makefile.in
367
@@ -0,0 +1,9 @@
368
+# This Source Code Form is subject to the terms of the Mozilla Public
369
+# License, v. 2.0. If a copy of the MPL was not distributed with this
370
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
371
+
372
+include $(topsrcdir)/config/rules.mk
373
+
374
+ifdef MOZ_NATIVE_OGG
375
+CFLAGS += $(MOZ_OGG_CFLAGS)
376
+endif
377
diff --git media/libvorbis/Makefile.in media/libvorbis/Makefile.in
378
new file mode 100644
379
index 0000000..1f02dc0
380
--- /dev/null
381
+++ mozilla/media/libvorbis/Makefile.in
382
@@ -0,0 +1,9 @@
383
+# This Source Code Form is subject to the terms of the Mozilla Public
384
+# License, v. 2.0. If a copy of the MPL was not distributed with this
385
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
386
+
387
+include $(topsrcdir)/config/rules.mk
388
+
389
+ifdef MOZ_NATIVE_OGG
390
+CFLAGS += $(MOZ_OGG_CFLAGS)
391
+endif
392
diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
393
index bbc971c..6ed7e41 100644
394
--- mozilla/media/webrtc/signaling/test/Makefile.in
395
+++ mozilla/media/webrtc/signaling/test/Makefile.in
396
@@ -48,6 +48,12 @@ LIBS += \
397
   $(NULL)
398
 endif
399
 
400
+ifdef MOZ_NATIVE_OPUS
401
+LIBS += \
402
+  $(MOZ_OPUS_LIBS) \
403
+  $(NULL)
404
+endif
405
+
406
 ifdef MOZ_NATIVE_LIBVPX
407
 LIBS += \
408
   $(MOZ_LIBVPX_LIBS) \
409
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
410
index 00e77e7..55f48ab 100644
411
--- mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
412
+++ mozilla/media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
413
@@ -14,9 +14,9 @@
414
       'conditions': [
415
         ['build_with_mozilla==1', {
416
           # Mozilla provides its own build of the opus library.
417
-          'include_dirs': [
418
-            '/media/libopus/include',
419
-           ]
420
+          'cflags_mozilla': [
421
+            '$(MOZ_OPUS_CFLAGS)',
422
+          ],
423
         }, {
424
           'dependencies': [
425
             '<(DEPTH)/third_party/opus/opus.gyp:opus'
426
diff --git toolkit/library/libxul.mk toolkit/library/libxul.mk
427
index d42137a..695e75a8 100644
428
--- mozilla/toolkit/library/libxul.mk
429
+++ mozilla/toolkit/library/libxul.mk
430
@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
431
 EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
432
 endif
433
 
434
+ifdef MOZ_NATIVE_OGG
435
+EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
436
+endif
437
+
438
+ifdef MOZ_NATIVE_THEORA
439
+EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
440
+endif
441
+
442
+ifdef MOZ_NATIVE_VORBIS
443
+EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
444
+endif
445
+
446
+ifdef MOZ_NATIVE_TREMOR
447
+EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
448
+endif
449
+
450
+ifdef MOZ_NATIVE_OPUS
451
+EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
452
+endif
453
+
454
+ifdef MOZ_NATIVE_SPEEX
455
+EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
456
+endif
457
+
458
+ifdef MOZ_NATIVE_SOUNDTOUCH
459
+EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS)
460
+endif
461
+
462
 ifdef MOZ_NATIVE_LIBEVENT
463
 EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
464
 endif
465
diff --git xpcom/build/nsXPComInit.cpp xpcom/build/nsXPComInit.cpp
466
index 2cf281e..6d7af0e 100644
467
--- mozilla/xpcom/build/nsXPComInit.cpp
468
+++ mozilla/xpcom/build/nsXPComInit.cpp
469
@@ -130,7 +130,9 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **)
470
 #include "mozilla/VisualEventTracer.h"
471
 #endif
472
 
473
+#ifndef MOZ_OGG_NO_MEM_REPORTING
474
 #include "ogg/ogg.h"
475
+#endif
476
 #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
477
 #include "vpx_mem/vpx_mem.h"
478
 #endif
479
@@ -571,11 +573,13 @@ NS_InitXPCOM2(nsIServiceManager* *result,
480
     // this oddness.
481
     mozilla::SetICUMemoryFunctions();
482
 
483
+#ifndef MOZ_OGG_NO_MEM_REPORTING
484
     // Do the same for libogg.
485
     ogg_set_mem_functions(OggReporter::CountingMalloc,
486
                           OggReporter::CountingCalloc,
487
                           OggReporter::CountingRealloc,
488
                           OggReporter::CountingFree);
489
+#endif
490
 
491
 #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
492
     // And for VPX.

Return to bug 201769