2009-07-21 12:08:52 +02:00
|
|
|
From: Hans Petter Jansson <hpj@copyleft.no>
|
|
|
|
Wolfgang Rosenauer <wr@rosenauer.org>
|
|
|
|
Subject: use libnsssharedhelper if available at compile time
|
|
|
|
(can be disabled by exporting MOZ_XRE_NO_NSSHELPER=1)
|
|
|
|
References:
|
|
|
|
|
|
|
|
diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in
|
|
|
|
--- a/config/autoconf.mk.in
|
|
|
|
+++ b/config/autoconf.mk.in
|
2010-12-10 10:44:42 +01:00
|
|
|
@@ -561,16 +561,20 @@ MOZ_ENABLE_LIBNOTIFY = @MOZ_ENABLE_LIBNO
|
2010-07-24 17:36:48 +02:00
|
|
|
|
|
|
|
GLIB_CFLAGS = @GLIB_CFLAGS@
|
|
|
|
GLIB_LIBS = @GLIB_LIBS@
|
|
|
|
GLIB_GMODULE_LIBS = @GLIB_GMODULE_LIBS@
|
|
|
|
LIBIDL_CFLAGS = @LIBIDL_CFLAGS@
|
2009-07-21 12:08:52 +02:00
|
|
|
LIBIDL_LIBS = @LIBIDL_LIBS@
|
|
|
|
STATIC_LIBIDL = @STATIC_LIBIDL@
|
2009-01-09 01:36:46 +01:00
|
|
|
|
2009-07-21 12:08:52 +02:00
|
|
|
+MOZ_ENABLE_NSSHELPER = @MOZ_ENABLE_NSSHELPER@
|
|
|
|
+NSSHELPER_CFLAGS = @NSSHELPER_CFLAGS@
|
|
|
|
+NSSHELPER_LIBS = @NSSHELPER_LIBS@
|
2009-01-09 01:36:46 +01:00
|
|
|
+
|
2009-07-21 12:08:52 +02:00
|
|
|
MOZ_NATIVE_MAKEDEPEND = @SYSTEM_MAKEDEPEND@
|
2009-01-09 01:36:46 +01:00
|
|
|
|
2010-07-24 17:36:48 +02:00
|
|
|
MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@
|
|
|
|
COMPILER_DEPEND = @COMPILER_DEPEND@
|
|
|
|
MDDEPDIR := @MDDEPDIR@
|
|
|
|
|
|
|
|
MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@
|
|
|
|
|
2009-07-21 12:08:52 +02:00
|
|
|
diff --git a/configure.in b/configure.in
|
|
|
|
--- a/configure.in
|
|
|
|
+++ b/configure.in
|
2010-12-10 10:44:42 +01:00
|
|
|
@@ -8016,16 +8016,32 @@ AC_SUBST(QCMS_LIBS)
|
2010-07-24 17:36:48 +02:00
|
|
|
|
|
|
|
dnl ========================================================
|
2010-12-10 10:44:42 +01:00
|
|
|
dnl OTS
|
|
|
|
dnl ========================================================
|
|
|
|
MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
|
|
|
|
AC_SUBST(MOZ_OTS_LIBS)
|
2010-07-24 17:36:48 +02:00
|
|
|
|
|
|
|
dnl ========================================================
|
2009-01-09 01:36:46 +01:00
|
|
|
+dnl Check for nss-shared-helper
|
|
|
|
+dnl ========================================================
|
|
|
|
+
|
2010-12-10 10:44:42 +01:00
|
|
|
+ PKG_CHECK_MODULES(NSSHELPER, nss-shared-helper,
|
2009-07-21 12:08:52 +02:00
|
|
|
+ [MOZ_ENABLE_NSSHELPER=1],
|
|
|
|
+ [MOZ_ENABLE_NSSHELPER=])
|
2009-01-09 01:36:46 +01:00
|
|
|
+
|
|
|
|
+if test "$MOZ_ENABLE_NSSHELPER"; then
|
|
|
|
+ AC_DEFINE(MOZ_ENABLE_NSSHELPER)
|
|
|
|
+fi
|
|
|
|
+AC_SUBST(MOZ_ENABLE_NSSHELPER)
|
|
|
|
+AC_SUBST(NSSHELPER_CFLAGS)
|
|
|
|
+AC_SUBST(NSSHELPER_LIBS)
|
2010-07-24 17:36:48 +02:00
|
|
|
+
|
2010-12-10 10:44:42 +01:00
|
|
|
+
|
2010-07-24 17:36:48 +02:00
|
|
|
+dnl ========================================================
|
2009-07-21 12:08:52 +02:00
|
|
|
dnl disable xul
|
2010-07-24 17:36:48 +02:00
|
|
|
dnl ========================================================
|
|
|
|
MOZ_ARG_DISABLE_BOOL(xul,
|
|
|
|
[ --disable-xul Disable XUL],
|
|
|
|
MOZ_XUL= )
|
|
|
|
if test "$MOZ_XUL"; then
|
|
|
|
AC_DEFINE(MOZ_XUL)
|
|
|
|
else
|
2009-07-21 12:08:52 +02:00
|
|
|
diff --git a/security/manager/ssl/src/Makefile.in b/security/manager/ssl/src/Makefile.in
|
|
|
|
--- a/security/manager/ssl/src/Makefile.in
|
|
|
|
+++ b/security/manager/ssl/src/Makefile.in
|
2010-07-24 17:36:48 +02:00
|
|
|
@@ -133,19 +133,20 @@ REQUIRES = nspr \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
EXTRA_DEPS = $(NSS_DEP_LIBS)
|
|
|
|
|
|
|
|
DEFINES += -DNSS_ENABLE_ECC
|
2009-01-09 01:36:46 +01:00
|
|
|
|
|
|
|
# Use local includes because they are inserted before INCLUDES
|
|
|
|
# so that Mozilla's nss.h is used, not glibc's
|
|
|
|
-LOCAL_INCLUDES += $(NSS_CFLAGS)
|
|
|
|
+LOCAL_INCLUDES += $(NSS_CFLAGS) $(NSSHELPER_CFLAGS)
|
|
|
|
|
|
|
|
EXTRA_DSO_LDOPTS += \
|
|
|
|
$(MOZ_UNICHARUTIL_LIBS) \
|
|
|
|
$(MOZ_COMPONENT_LIBS) \
|
|
|
|
$(MOZ_JS_LIBS) \
|
|
|
|
+ $(NSSHELPER_LIBS) \
|
|
|
|
$(NSS_LIBS) \
|
|
|
|
$(NULL)
|
|
|
|
|
2010-07-24 17:36:48 +02:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
2009-07-21 12:08:52 +02:00
|
|
|
diff --git a/security/manager/ssl/src/nsNSSComponent.cpp b/security/manager/ssl/src/nsNSSComponent.cpp
|
|
|
|
--- a/security/manager/ssl/src/nsNSSComponent.cpp
|
|
|
|
+++ b/security/manager/ssl/src/nsNSSComponent.cpp
|
2010-07-24 17:36:48 +02:00
|
|
|
@@ -39,16 +39,23 @@
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2009-01-09 01:36:46 +01:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2010-07-24 17:36:48 +02:00
|
|
|
|
2009-01-09 01:36:46 +01:00
|
|
|
+#ifdef MOZ_ENABLE_NSSHELPER
|
|
|
|
+#pragma GCC visibility push(default)
|
|
|
|
+#include <nss-shared-helper.h>
|
|
|
|
+#pragma GCC visibility pop
|
|
|
|
+#include "prenv.h"
|
|
|
|
+#endif
|
2010-07-24 17:36:48 +02:00
|
|
|
+
|
2009-01-09 01:36:46 +01:00
|
|
|
#include "nsNSSComponent.h"
|
|
|
|
#include "nsNSSCallbacks.h"
|
2010-07-24 17:36:48 +02:00
|
|
|
#include "nsNSSIOLayer.h"
|
|
|
|
#include "nsSSLThread.h"
|
|
|
|
#include "nsCertVerificationThread.h"
|
|
|
|
|
|
|
|
#include "nsNetUtil.h"
|
|
|
|
#include "nsAppDirectoryServiceDefs.h"
|
2010-12-10 10:44:42 +01:00
|
|
|
@@ -1606,17 +1613,31 @@ nsNSSComponent::InitializeNSS(PRBool sho
|
2010-07-24 17:36:48 +02:00
|
|
|
// The call to ConfigureInternalPKCS11Token needs to be done before NSS is initialized,
|
|
|
|
// but affects only static data.
|
|
|
|
// If we could assume i18n will not change between profiles, one call per application
|
|
|
|
// run were sufficient. As I can't predict what happens in the future, let's repeat
|
|
|
|
// this call for every re-init of NSS.
|
2009-01-09 01:36:46 +01:00
|
|
|
|
|
|
|
ConfigureInternalPKCS11Token();
|
|
|
|
|
|
|
|
- SECStatus init_rv = ::NSS_InitReadWrite(profileStr.get());
|
|
|
|
+ SECStatus init_rv = SECFailure;
|
|
|
|
+#ifdef MOZ_ENABLE_NSSHELPER
|
2010-12-10 10:44:42 +01:00
|
|
|
+ if (PR_GetEnv("MOZ_TB_NO_NSSHELPER")) {
|
2009-01-09 01:36:46 +01:00
|
|
|
+ init_rv = ::NSS_InitReadWrite(profileStr.get());
|
|
|
|
+ } else {
|
2009-07-21 12:08:52 +02:00
|
|
|
+ init_rv = ::nsshelp_open_db ("Thunderbird", profileStr.get(), 0);
|
2009-01-09 01:36:46 +01:00
|
|
|
+
|
|
|
|
+ if (init_rv != SECSuccess) {
|
|
|
|
+ PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS using nsshelp_open_db in %s\n", profileStr.get()));
|
|
|
|
+ init_rv = ::NSS_InitReadWrite(profileStr.get());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+#else
|
|
|
|
+ init_rv = ::NSS_InitReadWrite(profileStr.get());
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
if (init_rv != SECSuccess) {
|
|
|
|
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS r/w in %s\n", profileStr.get()));
|
2010-07-24 17:36:48 +02:00
|
|
|
|
|
|
|
if (supress_warning_preference) {
|
|
|
|
which_nss_problem = problem_none;
|
|
|
|
}
|
|
|
|
else {
|
2009-07-21 12:08:52 +02:00
|
|
|
diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in
|
|
|
|
--- a/toolkit/library/Makefile.in
|
|
|
|
+++ b/toolkit/library/Makefile.in
|
2010-07-24 17:36:48 +02:00
|
|
|
@@ -189,17 +189,17 @@ else
|
|
|
|
EXTRA_DSO_LDOPTS += \
|
|
|
|
$(MOZ_COMPONENT_LIBS) \
|
|
|
|
$(MOZ_JS_LIBS) \
|
|
|
|
$(NULL)
|
|
|
|
endif
|
2009-07-21 12:08:52 +02:00
|
|
|
|
|
|
|
DEFINES += -DIMPL_XREAPI
|
|
|
|
|
|
|
|
-EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
|
|
|
|
+EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(NSSHELPER_LIBS)
|
2009-01-09 01:36:46 +01:00
|
|
|
|
2009-07-21 12:08:52 +02:00
|
|
|
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
|
|
|
CXXFLAGS += $(TK_CFLAGS)
|
2010-07-24 17:36:48 +02:00
|
|
|
EXTRA_DSO_LDOPTS += \
|
|
|
|
-framework SystemConfiguration \
|
|
|
|
-framework QuickTime \
|
|
|
|
-framework IOKit \
|
|
|
|
-lcrypto \
|