Bug 1341222 - Fix building in-tree NSS against system NSPR. r=froydnj
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 15 Aug 2018 11:17:34 +0900
changeset 487599 f3c1b09b9477b6f03fc0ecce5568401d7161ce8b
parent 487598 b0a7377f4f600a81faf8951d374945dc7882c6f4
child 487600 17e156ebb40afa32f91d0b8b6463c43e4c467653
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1341222
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1341222 - Fix building in-tree NSS against system NSPR. r=froydnj
security/moz.build
--- a/security/moz.build
+++ b/security/moz.build
@@ -52,17 +52,17 @@ else:
         Library('nss')
         USE_LIBS += [
             'nss3',
             'nssutil3',
             'smime3',
             'sqlite',
             'ssl3',
         ]
-        gyp_vars['nspr_libs'] = 'nspr4 plc4 plds4'
+        gyp_vars['nspr_libs'] = 'nspr'
 
     # This disables building some NSS tools.
     gyp_vars['mozilla_client'] = 1
     # We run shlibsign as part of packaging, not build.
     gyp_vars['sign_libs'] = 0
     gyp_vars['python'] = CONFIG['PYTHON']
     # The NSS gyp files do not have a default for this.
     gyp_vars['nss_dist_dir'] = '$PRODUCT_DIR/dist'
@@ -80,18 +80,25 @@ else:
     # pkg-config won't reliably find zlib on our builders, so just force it.
     # System zlib is only used for modutil and signtool unless
     # SSL zlib is enabled, which we are disabling immediately below this.
     gyp_vars['zlib_libs'] = '-lz'
     gyp_vars['ssl_enable_zlib'] = 0
     # System sqlite here is the in-tree mozsqlite.
     gyp_vars['use_system_sqlite'] = 1
     gyp_vars['sqlite_libs'] = 'sqlite'
-    gyp_vars['nspr_include_dir'] = CONFIG['NSPR_INCLUDE_DIR']
-    gyp_vars['nspr_lib_dir'] = CONFIG['NSPR_LIB_DIR']
+
+    if CONFIG['MOZ_SYSTEM_NSPR']:
+        gyp_vars['nspr_include_dir'] = '%' + CONFIG['NSPR_INCLUDE_DIR']
+        gyp_vars['nspr_lib_dir'] = '%' + CONFIG['NSPR_LIB_DIR']
+    else:
+        gyp_vars['nspr_include_dir'] = '!/dist/include/nspr'
+        gyp_vars['nspr_lib_dir'] = ''  # gyp wants a value, but we don't need
+                                       # it to be valid.
+
     # The Python scripts that detect clang need it to be set as CC
     # in the environment, which isn't true here. I don't know that
     # setting that would be harmful, but we already have this information
     # anyway.
     if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
         gyp_vars['cc_is_clang'] = 1
     if CONFIG['GCC_USE_GNU_LD']:
         gyp_vars['cc_use_gnu_ld'] = 1