author | Wolfgang Rosenauer <wr@rosenauer.org> |
Mon, 24 Dec 2012 11:48:38 +0100 | |
changeset 596 | 9124c1a643c5 |
parent 585 | 5a44d417c9b5 |
child 612 | 3006d73ad2fa |
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/configure.in b/configure.in |
|
8 |
--- a/configure.in |
|
9 |
+++ b/configure.in |
|
596 | 10 |
@@ -8108,16 +8108,31 @@ AC_SUBST(QCMS_LIBS) |
1 | 11 |
|
12 |
dnl ======================================================== |
|
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
13 |
dnl HarfBuzz |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
14 |
dnl ======================================================== |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
15 |
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
|
16 |
AC_SUBST(MOZ_HARFBUZZ_LIBS) |
1 | 17 |
|
18 |
dnl ======================================================== |
|
19 |
+dnl Check for nss-shared-helper |
|
20 |
+dnl ======================================================== |
|
21 |
+ |
|
191
14282ac75832
update to FIREFOX_4_0b7_BUILD1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
164
diff
changeset
|
22 |
+ PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper, |
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
23 |
+ [MOZ_ENABLE_NSSHELPER=1], |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
24 |
+ [MOZ_ENABLE_NSSHELPER=]) |
1 | 25 |
+ |
26 |
+if test "$MOZ_ENABLE_NSSHELPER"; then |
|
27 |
+ AC_DEFINE(MOZ_ENABLE_NSSHELPER) |
|
28 |
+fi |
|
29 |
+AC_SUBST(MOZ_ENABLE_NSSHELPER) |
|
30 |
+AC_SUBST(NSSHELPER_CFLAGS) |
|
31 |
+AC_SUBST(NSSHELPER_LIBS) |
|
32 |
+ |
|
33 |
+dnl ======================================================== |
|
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
34 |
dnl SIL Graphite |
191
14282ac75832
update to FIREFOX_4_0b7_BUILD1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
164
diff
changeset
|
35 |
dnl ======================================================== |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
36 |
if test "$MOZ_GRAPHITE"; then |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
37 |
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
|
38 |
AC_DEFINE(MOZ_GRAPHITE) |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
39 |
else |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
40 |
MOZ_GRAPHITE_LIBS= |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
41 |
fi |
1 | 42 |
diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in |
43 |
--- a/security/manager/ssl/src/Makefile.in |
|
44 |
+++ b/security/manager/ssl/src/Makefile.in |
|
596 | 45 |
@@ -93,10 +93,13 @@ DEFINES += \ |
585
5a44d417c9b5
prepare for Beta 18 phase
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
568
diff
changeset
|
46 |
$(NULL) |
515 | 47 |
|
48 |
EXPORTS += \ |
|
596 | 49 |
CryptoTask.h \ |
515 | 50 |
nsNSSShutDown.h \ |
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
541
diff
changeset
|
51 |
ScopedNSSTypes.h \ |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
52 |
$(NULL) |
1 | 53 |
|
585
5a44d417c9b5
prepare for Beta 18 phase
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
568
diff
changeset
|
54 |
+LOCAL_INCLUDES += $(NSSHELPER_CFLAGS) |
5a44d417c9b5
prepare for Beta 18 phase
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
568
diff
changeset
|
55 |
+EXTRA_DSO_LDOPTS += $(NSSHELPER_LIBS) |
294
5330447b83a3
update to aurora (6.99 / 20110721)
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
289
diff
changeset
|
56 |
+ |
1 | 57 |
include $(topsrcdir)/config/rules.mk |
58 |
||
59 |
diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp |
|
60 |
--- a/security/manager/ssl/src/nsNSSComponent.cpp |
|
61 |
+++ b/security/manager/ssl/src/nsNSSComponent.cpp |
|
596 | 62 |
@@ -3,16 +3,23 @@ |
467
a9baaad57fa4
refreshed patches and removed obsolete ones
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
438
diff
changeset
|
63 |
* 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
|
64 |
* 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
|
65 |
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
1 | 66 |
|
596 | 67 |
#ifdef MOZ_LOGGING |
68 |
#define FORCE_PR_LOG 1 |
|
69 |
#endif |
|
70 |
||
1 | 71 |
+#ifdef MOZ_ENABLE_NSSHELPER |
72 |
+#pragma GCC visibility push(default) |
|
73 |
+#include <nss-shared-helper.h> |
|
74 |
+#pragma GCC visibility pop |
|
75 |
+#include "prenv.h" |
|
76 |
+#endif |
|
77 |
+ |
|
78 |
#include "nsNSSComponent.h" |
|
79 |
#include "nsNSSCallbacks.h" |
|
80 |
#include "nsNSSIOLayer.h" |
|
81 |
#include "nsCertVerificationThread.h" |
|
82 |
||
83 |
#include "nsNetUtil.h" |
|
84 |
#include "nsAppDirectoryServiceDefs.h" |
|
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
85 |
#include "nsDirectoryService.h" |
596 | 86 |
@@ -1735,18 +1742,34 @@ nsNSSComponent::InitializeNSS(bool showW |
1 | 87 |
ConfigureInternalPKCS11Token(); |
88 |
||
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
89 |
// 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
|
90 |
// 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
|
91 |
// 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
|
92 |
// 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
|
93 |
// "/usr/lib/nss/libnssckbi.so". |
541
830e50bbfc79
working Aurora 17.0 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
515
diff
changeset
|
94 |
uint32_t init_flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE; |
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
95 |
- SECStatus init_rv = ::NSS_Initialize(profileStr.get(), "", "", |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
96 |
- SECMOD_DB, init_flags); |
1 | 97 |
+ SECStatus init_rv = SECFailure; |
98 |
+#ifdef MOZ_ENABLE_NSSHELPER |
|
99 |
+ if (PR_GetEnv("MOZ_XRE_NO_NSSHELPER")) { |
|
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
100 |
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "", |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
101 |
+ SECMOD_DB, init_flags); |
1 | 102 |
+ } else { |
357
db07eb421d6b
fix nsshelper identifier "mozilla-xul" -> "Firefox"
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
356
diff
changeset
|
103 |
+ init_rv = ::nsshelp_open_db ("Firefox", profileStr.get(), init_flags); |
1 | 104 |
+ |
105 |
+ if (init_rv != SECSuccess) { |
|
106 |
+ 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
|
107 |
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "", |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
108 |
+ SECMOD_DB, init_flags); |
1 | 109 |
+ } |
110 |
+ } |
|
111 |
+#else |
|
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
112 |
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "", |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
113 |
+ SECMOD_DB, init_flags); |
1 | 114 |
+#endif |
115 |
||
116 |
if (init_rv != SECSuccess) { |
|
117 |
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS r/w in %s\n", profileStr.get())); |
|
118 |
||
119 |
if (supress_warning_preference) { |
|
120 |
which_nss_problem = problem_none; |
|
121 |
} |
|
122 |
else { |
|
123 |
diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in |
|
124 |
--- a/toolkit/library/Makefile.in |
|
125 |
+++ b/toolkit/library/Makefile.in |
|
568
2c74c5927ea2
first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
541
diff
changeset
|
126 |
@@ -484,17 +484,17 @@ EXTRA_DSO_LDOPTS += -INCREMENTAL:NO |
367
3fabd9f66322
begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
357
diff
changeset
|
127 |
endif |
1 | 128 |
endif |
289
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
129 |
endif |
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
130 |
|
3c0dff7ca9c4
Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
191
diff
changeset
|
131 |
EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(EXTRA_DSO_LIBS) |
1 | 132 |
|
133 |
DEFINES += -DIMPL_XREAPI |
|
134 |
||
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
135 |
-EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) |
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
136 |
+EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) $(NSSHELPER_LIBS) |
1 | 137 |
|
138 |
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) |
|
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
139 |
CXXFLAGS += $(TK_CFLAGS) |
125
bfef1af1ee28
reenable shared nss stuff
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1
diff
changeset
|
140 |
OS_LIBS += \ |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
141 |
-framework SystemConfiguration \ |
515 | 142 |
-framework QTKit \ |
382
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
143 |
-framework IOKit \ |
67f876aafae8
lift up to Gecko 11beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
367
diff
changeset
|
144 |
-F/System/Library/PrivateFrameworks -framework CoreUI \ |