Bug 1629553 Prefix pk11wrap (SHLIB|LIBRARY)_VERSION with NSS_ r=rrelyea
authorJan-Marek Glogowski <glogow@fbihome.de>
Tue, 05 May 2020 12:29:44 +0000
changeset 15597 cbb737bc6c0ccda559c9e7b34fd5d5004dbe3316
parent 15596 f3a0ef69c0569c8512845075a48e796bc08bf636
child 15598 45db681898be760e53c70206912456dd296bb629
push id3740
push userjjones@mozilla.com
push dateMon, 11 May 2020 21:08:39 +0000
reviewersrrelyea
bugs1629553
Bug 1629553 Prefix pk11wrap (SHLIB|LIBRARY)_VERSION with NSS_ r=rrelyea In the manifest.mn the LIBRARY_VERSION is normally used to define the major version of the build shared library. This ust works for the pk11wrap case, because pk11wrap is a static library. But it's still very confusing when reading the manifest.mn. Also the referenced define in the code is just named SHLIB_VERSION. So this prefixes the defines and the variables with NSS_, because it tries to load the NSS library, just as the SOFTOKEN_.*_VERSION is used to load the versioned softokn library. Differential Revision: https://phabricator.services.mozilla.com/D70689
lib/pk11wrap/manifest.mn
lib/pk11wrap/pk11load.c
lib/pk11wrap/pk11wrap.gyp
--- a/lib/pk11wrap/manifest.mn
+++ b/lib/pk11wrap/manifest.mn
@@ -44,20 +44,20 @@ CSRCS = \
 	pk11sdr.c \
 	pk11skey.c \
 	pk11slot.c \
 	pk11util.c \
 	$(NULL)
 
 LIBRARY_NAME = pk11wrap
 
-LIBRARY_VERSION = 3
+NSS_LIBRARY_VERSION = 3
 SOFTOKEN_LIBRARY_VERSION = 3
 DEFINES += -DSHLIB_SUFFIX=\"$(DLL_SUFFIX)\" -DSHLIB_PREFIX=\"$(DLL_PREFIX)\" \
-        -DSHLIB_VERSION=\"$(LIBRARY_VERSION)\" \
+        -DNSS_SHLIB_VERSION=\"$(NSS_LIBRARY_VERSION)\" \
         -DSOFTOKEN_SHLIB_VERSION=\"$(SOFTOKEN_LIBRARY_VERSION)\"
 
 # only add module debugging in opt builds if DEBUG_PKCS11 is set
 ifdef DEBUG_PKCS11
   DEFINES += -DDEBUG_MODULE -DFORCE_PR_LOG
 endif
 
 # This part of the code, including all sub-dirs, can be optimized for size
--- a/lib/pk11wrap/pk11load.c
+++ b/lib/pk11wrap/pk11load.c
@@ -350,17 +350,17 @@ SECMOD_SetRootCerts(PK11SlotInfo *slot, 
             mod->slotInfoCount++;
         }
         psi->hasRootCerts = 1;
     }
 }
 
 #ifndef NSS_STATIC_SOFTOKEN
 static const char *my_shlib_name =
-    SHLIB_PREFIX "nss" SHLIB_VERSION "." SHLIB_SUFFIX;
+    SHLIB_PREFIX "nss" NSS_SHLIB_VERSION "." SHLIB_SUFFIX;
 static const char *softoken_shlib_name =
     SHLIB_PREFIX "softokn" SOFTOKEN_SHLIB_VERSION "." SHLIB_SUFFIX;
 static const PRCallOnceType pristineCallOnce;
 static PRCallOnceType loadSoftokenOnce;
 static PRLibrary *softokenLib;
 static PRInt32 softokenLoadCount;
 
 /* This function must be run only once. */
--- a/lib/pk11wrap/pk11wrap.gyp
+++ b/lib/pk11wrap/pk11wrap.gyp
@@ -55,16 +55,16 @@
         ],
       },
     },
   ],
   'target_defaults': {
     'defines': [
       'SHLIB_SUFFIX=\"<(dll_suffix)\"',
       'SHLIB_PREFIX=\"<(dll_prefix)\"',
-      'SHLIB_VERSION=\"3\"',
+      'NSS_SHLIB_VERSION=\"3\"',
       'SOFTOKEN_SHLIB_VERSION=\"3\"'
     ]
   },
   'variables': {
     'module': 'nss'
   }
 }