Bug 1034979 - WeaveCrypto unable to initialize on Mac with Brew's system NSS installed. r=rnewman, sr=dolske

This commit is contained in:
Hector Zhao 2014-10-10 18:15:22 +08:00
parent e47e83bb8b
commit 901b4d75a7
2 changed files with 16 additions and 11 deletions

View File

@ -132,17 +132,16 @@ WeaveCrypto.prototype = {
// XXX really want to be able to pass specific dlopen flags here.
var nsslib;
try {
#ifdef MOZ_NATIVE_NSS
// Search platform-dependent library paths for system NSS.
this.log("Trying NSS library without path");
nsslib = ctypes.open(path);
} catch(e) {
// In case opening the library without a full path fails,
// try again with a full path.
#else
let file = Services.dirsvc.get("GreBinD", Ci.nsILocalFile);
file.append(path);
this.log("Trying again with path " + file.path);
this.log("Trying NSS library with path " + file.path);
nsslib = ctypes.open(file.path);
}
#endif
this.log("Initializing NSS types and function declarations...");

View File

@ -9,9 +9,15 @@ TEST_DIRS += ['tests']
EXTRA_JS_MODULES['services-crypto'] += [
'modules/utils.js',
]
EXTRA_PP_JS_MODULES['services-crypto'] += [
'modules/WeaveCrypto.js',
]
EXTRA_COMPONENTS += [
'cryptoComponents.manifest',
]
if CONFIG['MOZ_NATIVE_NSS']:
DEFINES['MOZ_NATIVE_NSS'] = 1