author | Wolfgang Rosenauer <wr@rosenauer.org> |
Sat, 09 Jun 2012 20:36:56 +0200 | |
changeset 467 | a9baaad57fa4 |
parent 438 | 7d934b2f5014 |
child 515 | 0f6539389500 |
permissions | -rw-r--r-- |
1 | 1 |
From: Hans Petter Jansson <hpj@copyleft.no> |
2 |
Wolfgang Rosenauer <wr@rosenauer.org> |
|
3 |
Subject: use libnsssharedhelper if available at compile time |
|
4 |
(can be disabled by exporting MOZ_XRE_NO_NSSHELPER=1) |
|
5 |
References: |
|
6 |
||
7 |
diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in |
|
8 |
--- a/config/autoconf.mk.in |
|
9 |
+++ b/config/autoconf.mk.in |
|
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
10 |
@@ -573,16 +573,20 @@ MOZ_ENABLE_LIBNOTIFY = @MOZ_ENABLE_LIBNO |
356 | 11 |
|
12 |
MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS@ |
|
438
7d934b2f5014
rebased and removed upstreamed and obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
382
diff
changeset
|
13 |
MOZ_ALSA_CFLAGS = @MOZ_ALSA_CFLAGS@ |
1 | 14 |
|
15 |
GLIB_CFLAGS = @GLIB_CFLAGS@ |
|
16 |
GLIB_LIBS = @GLIB_LIBS@ |
|
17 |
GLIB_GMODULE_LIBS = @GLIB_GMODULE_LIBS@ |
|
18 |
||
19 |
+MOZ_ENABLE_NSSHELPER = @MOZ_ENABLE_NSSHELPER@ |
|
20 |
+NSSHELPER_CFLAGS = @NSSHELPER_CFLAGS@ |
|
21 |
+NSSHELPER_LIBS = @NSSHELPER_LIBS@ |
|
22 |
+ |
|
23 |
MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@ |
|
24 |
||
164
995e803e8198
rebase patches to snapshot 20100929
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
125
diff
changeset
|
25 |
export CL_INCLUDES_PREFIX = @CL_INCLUDES_PREFIX@ |
995e803e8198
rebase patches to snapshot 20100929
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
125
diff
changeset
|
26 |
|
1 | 27 |
MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@ |
28 |
COMPILER_DEPEND = @COMPILER_DEPEND@ |
|
29 |
MDDEPDIR := @MDDEPDIR@ |
|
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
30 |
CC_WRAPPER = @CC_WRAPPER@ |
1 | 31 |
diff --git a/configure.in b/configure.in |
32 |
--- a/configure.in |
|
33 |
+++ b/configure.in |
|
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
34 |
@@ -8270,16 +8270,31 @@ AC_SUBST(QCMS_LIBS) |
1 | 35 |
|
36 |
dnl ======================================================== |
|
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
37 |
dnl HarfBuzz |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
38 |
dnl ======================================================== |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
39 |
MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)' |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
40 |
AC_SUBST(MOZ_HARFBUZZ_LIBS) |
1 | 41 |
|
42 |
dnl ======================================================== |
|
43 |
+dnl Check for nss-shared-helper |
|
44 |
+dnl ======================================================== |
|
45 |
+ |
|
191
14282ac75832
update to FIREFOX_4_0b7_BUILD1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
164
diff
changeset
|
46 |
+ PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper, |
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
47 |
+ [MOZ_ENABLE_NSSHELPER=1], |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
48 |
+ [MOZ_ENABLE_NSSHELPER=]) |
1 | 49 |
+ |
50 |
+if test "$MOZ_ENABLE_NSSHELPER"; then |
|
51 |
+ AC_DEFINE(MOZ_ENABLE_NSSHELPER) |
|
52 |
+fi |
|
53 |
+AC_SUBST(MOZ_ENABLE_NSSHELPER) |
|
54 |
+AC_SUBST(NSSHELPER_CFLAGS) |
|
55 |
+AC_SUBST(NSSHELPER_LIBS) |
|
56 |
+ |
|
57 |
+dnl ======================================================== |
|
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
58 |
dnl SIL Graphite |
191
14282ac75832
update to FIREFOX_4_0b7_BUILD1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
164
diff
changeset
|
59 |
dnl ======================================================== |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
60 |
if test "$MOZ_GRAPHITE"; then |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
61 |
MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)' |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
62 |
AC_DEFINE(MOZ_GRAPHITE) |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
63 |
else |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
64 |
MOZ_GRAPHITE_LIBS= |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
65 |
fi |
1 | 66 |
diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in |
67 |
--- a/security/manager/ssl/src/Makefile.in |
|
68 |
+++ b/security/manager/ssl/src/Makefile.in |
|
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
69 |
@@ -86,12 +86,14 @@ EXTRA_DEPS = $(NSS_DEP_LIBS) |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
70 |
DEFINES += \ |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
71 |
-DNSS_ENABLE_ECC \ |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
72 |
-DDLL_PREFIX=\"$(DLL_PREFIX)\" \ |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
73 |
-DDLL_SUFFIX=\"$(DLL_SUFFIX)\" \ |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
74 |
$(NULL) |
1 | 75 |
|
76 |
# Use local includes because they are inserted before INCLUDES |
|
77 |
# so that Mozilla's nss.h is used, not glibc's |
|
78 |
-LOCAL_INCLUDES += $(NSS_CFLAGS) |
|
79 |
+LOCAL_INCLUDES += $(NSS_CFLAGS) $(NSSHELPER_CFLAGS) |
|
294
5330447b83a3
update to aurora (6.99 / 20110721)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
289
diff
changeset
|
80 |
+ |
5330447b83a3
update to aurora (6.99 / 20110721)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
289
diff
changeset
|
81 |
+EXTRA_DSO_LDOPTS += $(NSSHELPER_LIBS) |
1 | 82 |
|
83 |
include $(topsrcdir)/config/rules.mk |
|
84 |
||
85 |
diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp |
|
86 |
--- a/security/manager/ssl/src/nsNSSComponent.cpp |
|
87 |
+++ b/security/manager/ssl/src/nsNSSComponent.cpp |
|
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
88 |
@@ -1,14 +1,21 @@ |
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
89 |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
1 | 90 |
* |
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
91 |
* This Source Code Form is subject to the terms of the Mozilla Public |
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
92 |
* License, v. 2.0. If a copy of the MPL was not distributed with this |
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
93 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1 | 94 |
|
95 |
+#ifdef MOZ_ENABLE_NSSHELPER |
|
96 |
+#pragma GCC visibility push(default) |
|
97 |
+#include <nss-shared-helper.h> |
|
98 |
+#pragma GCC visibility pop |
|
99 |
+#include "prenv.h" |
|
100 |
+#endif |
|
101 |
+ |
|
102 |
#include "nsNSSComponent.h" |
|
103 |
#include "nsNSSCallbacks.h" |
|
104 |
#include "nsNSSIOLayer.h" |
|
105 |
#include "nsCertVerificationThread.h" |
|
106 |
||
107 |
#include "nsNetUtil.h" |
|
108 |
#include "nsAppDirectoryServiceDefs.h" |
|
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
109 |
#include "nsDirectoryService.h" |
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
110 |
@@ -1738,18 +1745,34 @@ nsNSSComponent::InitializeNSS(bool showW |
1 | 111 |
ConfigureInternalPKCS11Token(); |
112 |
||
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
113 |
// The NSS_INIT_NOROOTINIT flag turns off the loading of the root certs |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
114 |
// module by NSS_Initialize because we will load it in InstallLoadableRoots |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
115 |
// later. It also allows us to work around a bug in the system NSS in |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
116 |
// Ubuntu 8.04, which loads any nonexistent "<configdir>/libnssckbi.so" as |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
117 |
// "/usr/lib/nss/libnssckbi.so". |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
118 |
PRUint32 init_flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE; |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
119 |
- SECStatus init_rv = ::NSS_Initialize(profileStr.get(), "", "", |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
120 |
- SECMOD_DB, init_flags); |
1 | 121 |
+ SECStatus init_rv = SECFailure; |
122 |
+#ifdef MOZ_ENABLE_NSSHELPER |
|
123 |
+ if (PR_GetEnv("MOZ_XRE_NO_NSSHELPER")) { |
|
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
124 |
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "", |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
125 |
+ SECMOD_DB, init_flags); |
1 | 126 |
+ } else { |
357
db07eb421d6b
fix nsshelper identifier "mozilla-xul" -> "Firefox"
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
127 |
+ init_rv = ::nsshelp_open_db ("Firefox", profileStr.get(), init_flags); |
1 | 128 |
+ |
129 |
+ if (init_rv != SECSuccess) { |
|
130 |
+ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS using nsshelp_open_db in %s\n", profileStr.get())); |
|
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
131 |
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "", |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
132 |
+ SECMOD_DB, init_flags); |
1 | 133 |
+ } |
134 |
+ } |
|
135 |
+#else |
|
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
136 |
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "", |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
137 |
+ SECMOD_DB, init_flags); |
1 | 138 |
+#endif |
139 |
||
140 |
if (init_rv != SECSuccess) { |
|
141 |
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS r/w in %s\n", profileStr.get())); |
|
142 |
||
143 |
if (supress_warning_preference) { |
|
144 |
which_nss_problem = problem_none; |
|
145 |
} |
|
146 |
else { |
|
147 |
diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in |
|
148 |
--- a/toolkit/library/Makefile.in |
|
149 |
+++ b/toolkit/library/Makefile.in |
|
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
150 |
@@ -446,17 +446,17 @@ EXTRA_DSO_LDOPTS += -INCREMENTAL:NO |
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
357
diff
changeset
|
151 |
endif |
1 | 152 |
endif |
289
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
153 |
endif |
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
154 |
|
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
155 |
EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(EXTRA_DSO_LIBS) |
1 | 156 |
|
157 |
DEFINES += -DIMPL_XREAPI |
|
158 |
||
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
159 |
-EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
160 |
+EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) $(NSSHELPER_LIBS) |
1 | 161 |
|
162 |
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) |
|
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
163 |
CXXFLAGS += $(TK_CFLAGS) |
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
164 |
OS_LIBS += \ |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
165 |
-framework SystemConfiguration \ |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
166 |
-framework QuickTime \ |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
167 |
-framework IOKit \ |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
168 |
-F/System/Library/PrivateFrameworks -framework CoreUI \ |