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
|
2012-07-16 10:37:53 +02:00
|
|
|
(can be disabled by exporting MOZ_XRE_NO_NSSHELPER=1)
|
2009-07-21 12:08:52 +02:00
|
|
|
References:
|
|
|
|
|
|
|
|
diff --git a/configure.in b/configure.in
|
|
|
|
--- a/configure.in
|
|
|
|
+++ b/configure.in
|
2012-11-20 22:23:42 +01:00
|
|
|
@@ -7987,16 +7987,31 @@ AC_SUBST(QCMS_LIBS)
|
2010-07-24 17:36:48 +02:00
|
|
|
|
|
|
|
dnl ========================================================
|
2011-06-28 20:42:13 +02:00
|
|
|
dnl HarfBuzz
|
2010-12-10 10:44:42 +01:00
|
|
|
dnl ========================================================
|
2011-06-28 20:42:13 +02:00
|
|
|
MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
|
|
|
|
AC_SUBST(MOZ_HARFBUZZ_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,
|
2011-06-28 20:42:13 +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
|
|
|
+
|
|
|
|
+dnl ========================================================
|
2012-03-14 08:47:37 +01:00
|
|
|
dnl SIL Graphite
|
2010-07-24 17:36:48 +02:00
|
|
|
dnl ========================================================
|
2012-03-14 08:47:37 +01:00
|
|
|
if test "$MOZ_GRAPHITE"; then
|
|
|
|
MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
|
|
|
|
AC_DEFINE(MOZ_GRAPHITE)
|
|
|
|
else
|
|
|
|
MOZ_GRAPHITE_LIBS=
|
|
|
|
fi
|
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
|
2012-10-09 13:36:47 +02:00
|
|
|
@@ -90,12 +90,14 @@ DEFINES += \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
EXPORTS += \
|
|
|
|
nsNSSShutDown.h \
|
2012-03-14 08:47:37 +01:00
|
|
|
$(NULL)
|
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)
|
2011-09-26 15:57:38 +02:00
|
|
|
+
|
|
|
|
+EXTRA_DSO_LDOPTS += $(NSSHELPER_LIBS)
|
2009-01-09 01:36:46 +01:00
|
|
|
|
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
|
2012-08-28 21:12:48 +02:00
|
|
|
@@ -1,14 +1,21 @@
|
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2009-01-09 01:36:46 +01:00
|
|
|
*
|
2012-08-28 21:12:48 +02:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
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 "nsCertVerificationThread.h"
|
|
|
|
|
|
|
|
#include "nsNetUtil.h"
|
|
|
|
#include "nsAppDirectoryServiceDefs.h"
|
2012-03-14 08:47:37 +01:00
|
|
|
#include "nsDirectoryService.h"
|
2012-11-20 22:23:42 +01:00
|
|
|
@@ -1731,18 +1738,34 @@ nsNSSComponent::InitializeNSS(bool showW
|
2009-01-09 01:36:46 +01:00
|
|
|
ConfigureInternalPKCS11Token();
|
|
|
|
|
2011-06-28 20:42:13 +02:00
|
|
|
// The NSS_INIT_NOROOTINIT flag turns off the loading of the root certs
|
|
|
|
// module by NSS_Initialize because we will load it in InstallLoadableRoots
|
|
|
|
// later. It also allows us to work around a bug in the system NSS in
|
|
|
|
// Ubuntu 8.04, which loads any nonexistent "<configdir>/libnssckbi.so" as
|
|
|
|
// "/usr/lib/nss/libnssckbi.so".
|
2012-11-20 22:23:42 +01:00
|
|
|
uint32_t init_flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE;
|
2011-06-28 20:42:13 +02:00
|
|
|
- SECStatus init_rv = ::NSS_Initialize(profileStr.get(), "", "",
|
|
|
|
- SECMOD_DB, init_flags);
|
2009-01-09 01:36:46 +01:00
|
|
|
+ SECStatus init_rv = SECFailure;
|
|
|
|
+#ifdef MOZ_ENABLE_NSSHELPER
|
2011-12-20 09:05:23 +01:00
|
|
|
+ if (PR_GetEnv("MOZ_TB_NO_NSSHELPER")) {
|
2011-06-28 20:42:13 +02:00
|
|
|
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "",
|
|
|
|
+ SECMOD_DB, init_flags);
|
2009-01-09 01:36:46 +01:00
|
|
|
+ } else {
|
2011-06-28 20:42:13 +02:00
|
|
|
+ init_rv = ::nsshelp_open_db ("Thunderbird", profileStr.get(), init_flags);
|
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()));
|
2011-06-28 20:42:13 +02:00
|
|
|
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "",
|
|
|
|
+ SECMOD_DB, init_flags);
|
2009-01-09 01:36:46 +01:00
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+#else
|
2011-06-28 20:42:13 +02:00
|
|
|
+ init_rv = ::NSS_Initialize(profileStr.get(), "", "",
|
|
|
|
+ SECMOD_DB, init_flags);
|
2009-01-09 01:36:46 +01:00
|
|
|
+#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
|
2012-11-20 22:23:42 +01:00
|
|
|
@@ -443,17 +443,17 @@ EXTRA_DSO_LDOPTS += -INCREMENTAL:NO
|
2012-02-01 15:14:46 +01:00
|
|
|
endif
|
2011-08-02 14:57:20 +02:00
|
|
|
endif
|
2010-07-24 17:36:48 +02:00
|
|
|
endif
|
2009-07-21 12:08:52 +02:00
|
|
|
|
2011-08-02 14:57:20 +02:00
|
|
|
EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(EXTRA_DSO_LIBS)
|
|
|
|
|
2009-07-21 12:08:52 +02:00
|
|
|
DEFINES += -DIMPL_XREAPI
|
|
|
|
|
2011-06-28 20:42:13 +02:00
|
|
|
-EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB)
|
|
|
|
+EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB) $(NSSHELPER_LIBS)
|
2009-01-09 01:36:46 +01:00
|
|
|
|
2009-07-21 12:08:52 +02:00
|
|
|
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
2012-03-14 08:47:37 +01:00
|
|
|
CXXFLAGS += $(TK_CFLAGS)
|
2011-06-28 20:42:13 +02:00
|
|
|
OS_LIBS += \
|
2012-03-14 08:47:37 +01:00
|
|
|
-framework SystemConfiguration \
|
2012-10-09 13:36:47 +02:00
|
|
|
-framework QTKit \
|
2012-03-14 08:47:37 +01:00
|
|
|
-framework IOKit \
|
|
|
|
-F/System/Library/PrivateFrameworks -framework CoreUI \
|