author | Wolfgang Rosenauer <wr@rosenauer.org> |
Sat, 19 Mar 2011 23:14:33 +0100 | |
branch | mozilla-1.9.2 |
changeset 240 | ec8f4a658086 |
parent 202 | 3306109c5899 |
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 |
|
202
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
10 |
@@ -561,16 +561,20 @@ MOZ_ENABLE_LIBNOTIFY = @MOZ_ENABLE_LIBNO |
1 | 11 |
|
12 |
GLIB_CFLAGS = @GLIB_CFLAGS@ |
|
13 |
GLIB_LIBS = @GLIB_LIBS@ |
|
14 |
GLIB_GMODULE_LIBS = @GLIB_GMODULE_LIBS@ |
|
15 |
LIBIDL_CFLAGS = @LIBIDL_CFLAGS@ |
|
16 |
LIBIDL_LIBS = @LIBIDL_LIBS@ |
|
17 |
STATIC_LIBIDL = @STATIC_LIBIDL@ |
|
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 |
||
25 |
MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@ |
|
26 |
COMPILER_DEPEND = @COMPILER_DEPEND@ |
|
27 |
MDDEPDIR := @MDDEPDIR@ |
|
28 |
||
29 |
MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@ |
|
30 |
||
31 |
diff --git a/configure.in b/configure.in |
|
32 |
--- a/configure.in |
|
33 |
+++ b/configure.in |
|
202
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
34 |
@@ -8016,16 +8016,32 @@ AC_SUBST(QCMS_LIBS) |
1 | 35 |
|
36 |
dnl ======================================================== |
|
202
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
37 |
dnl OTS |
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
38 |
dnl ======================================================== |
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
39 |
MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)' |
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
40 |
AC_SUBST(MOZ_OTS_LIBS) |
1 | 41 |
|
42 |
dnl ======================================================== |
|
43 |
+dnl Check for nss-shared-helper |
|
44 |
+dnl ======================================================== |
|
45 |
+ |
|
202
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
46 |
+ PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper, |
1 | 47 |
+ [MOZ_ENABLE_NSSHELPER=1], |
48 |
+ [MOZ_ENABLE_NSSHELPER=]) |
|
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 |
+ |
|
202
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
57 |
+ |
1 | 58 |
+dnl ======================================================== |
59 |
dnl disable xul |
|
60 |
dnl ======================================================== |
|
61 |
MOZ_ARG_DISABLE_BOOL(xul, |
|
62 |
[ --disable-xul Disable XUL], |
|
63 |
MOZ_XUL= ) |
|
64 |
if test "$MOZ_XUL"; then |
|
65 |
AC_DEFINE(MOZ_XUL) |
|
66 |
else |
|
67 |
diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in |
|
68 |
--- a/security/manager/ssl/src/Makefile.in |
|
69 |
+++ b/security/manager/ssl/src/Makefile.in |
|
70 |
@@ -133,19 +133,20 @@ REQUIRES = nspr \ |
|
71 |
$(NULL) |
|
72 |
||
73 |
EXTRA_DEPS = $(NSS_DEP_LIBS) |
|
74 |
||
75 |
DEFINES += -DNSS_ENABLE_ECC |
|
76 |
||
77 |
# Use local includes because they are inserted before INCLUDES |
|
78 |
# so that Mozilla's nss.h is used, not glibc's |
|
79 |
-LOCAL_INCLUDES += $(NSS_CFLAGS) |
|
80 |
+LOCAL_INCLUDES += $(NSS_CFLAGS) $(NSSHELPER_CFLAGS) |
|
81 |
||
82 |
EXTRA_DSO_LDOPTS += \ |
|
83 |
$(MOZ_UNICHARUTIL_LIBS) \ |
|
84 |
$(MOZ_COMPONENT_LIBS) \ |
|
85 |
$(MOZ_JS_LIBS) \ |
|
86 |
+ $(NSSHELPER_LIBS) \ |
|
87 |
$(NSS_LIBS) \ |
|
88 |
$(NULL) |
|
89 |
||
90 |
include $(topsrcdir)/config/rules.mk |
|
91 |
||
92 |
diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp |
|
93 |
--- a/security/manager/ssl/src/nsNSSComponent.cpp |
|
94 |
+++ b/security/manager/ssl/src/nsNSSComponent.cpp |
|
95 |
@@ -39,16 +39,23 @@ |
|
96 |
* use your version of this file under the terms of the MPL, indicate your |
|
97 |
* decision by deleting the provisions above and replace them with the notice |
|
98 |
* and other provisions required by the GPL or the LGPL. If you do not delete |
|
99 |
* the provisions above, a recipient may use your version of this file under |
|
100 |
* the terms of any one of the MPL, the GPL or the LGPL. |
|
101 |
* |
|
102 |
* ***** END LICENSE BLOCK ***** */ |
|
103 |
||
104 |
+#ifdef MOZ_ENABLE_NSSHELPER |
|
105 |
+#pragma GCC visibility push(default) |
|
106 |
+#include <nss-shared-helper.h> |
|
107 |
+#pragma GCC visibility pop |
|
108 |
+#include "prenv.h" |
|
109 |
+#endif |
|
110 |
+ |
|
111 |
#include "nsNSSComponent.h" |
|
112 |
#include "nsNSSCallbacks.h" |
|
113 |
#include "nsNSSIOLayer.h" |
|
114 |
#include "nsSSLThread.h" |
|
115 |
#include "nsCertVerificationThread.h" |
|
116 |
||
117 |
#include "nsNetUtil.h" |
|
118 |
#include "nsAppDirectoryServiceDefs.h" |
|
202
3306109c5899
prepare 1.9.2.13/3.6.13 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
119 |
@@ -1606,17 +1613,31 @@ nsNSSComponent::InitializeNSS(PRBool sho |
1 | 120 |
// The call to ConfigureInternalPKCS11Token needs to be done before NSS is initialized, |
121 |
// but affects only static data. |
|
122 |
// If we could assume i18n will not change between profiles, one call per application |
|
123 |
// run were sufficient. As I can't predict what happens in the future, let's repeat |
|
124 |
// this call for every re-init of NSS. |
|
125 |
||
126 |
ConfigureInternalPKCS11Token(); |
|
127 |
||
128 |
- SECStatus init_rv = ::NSS_InitReadWrite(profileStr.get()); |
|
129 |
+ SECStatus init_rv = SECFailure; |
|
130 |
+#ifdef MOZ_ENABLE_NSSHELPER |
|
131 |
+ if (PR_GetEnv("MOZ_XRE_NO_NSSHELPER")) { |
|
132 |
+ init_rv = ::NSS_InitReadWrite(profileStr.get()); |
|
133 |
+ } else { |
|
134 |
+ init_rv = ::nsshelp_open_db ("mozilla-xul", profileStr.get(), 0); |
|
135 |
+ |
|
136 |
+ if (init_rv != SECSuccess) { |
|
137 |
+ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS using nsshelp_open_db in %s\n", profileStr.get())); |
|
138 |
+ init_rv = ::NSS_InitReadWrite(profileStr.get()); |
|
139 |
+ } |
|
140 |
+ } |
|
141 |
+#else |
|
142 |
+ init_rv = ::NSS_InitReadWrite(profileStr.get()); |
|
143 |
+#endif |
|
144 |
||
145 |
if (init_rv != SECSuccess) { |
|
146 |
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS r/w in %s\n", profileStr.get())); |
|
147 |
||
148 |
if (supress_warning_preference) { |
|
149 |
which_nss_problem = problem_none; |
|
150 |
} |
|
151 |
else { |
|
152 |
diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in |
|
153 |
--- a/toolkit/library/Makefile.in |
|
154 |
+++ b/toolkit/library/Makefile.in |
|
155 |
@@ -189,17 +189,17 @@ else |
|
156 |
EXTRA_DSO_LDOPTS += \ |
|
157 |
$(MOZ_COMPONENT_LIBS) \ |
|
158 |
$(MOZ_JS_LIBS) \ |
|
159 |
$(NULL) |
|
160 |
endif |
|
161 |
||
162 |
DEFINES += -DIMPL_XREAPI |
|
163 |
||
164 |
-EXTRA_DSO_LDOPTS += $(NSPR_LIBS) |
|
165 |
+EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(NSSHELPER_LIBS) |
|
166 |
||
167 |
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) |
|
168 |
CXXFLAGS += $(TK_CFLAGS) |
|
169 |
EXTRA_DSO_LDOPTS += \ |
|
170 |
-framework SystemConfiguration \ |
|
171 |
-framework QuickTime \ |
|
172 |
-framework IOKit \ |
|
173 |
-lcrypto \ |