NSS Shared DB Test

From MozillaWiki
Jump to: navigation, search

Building NSS with shared DB

1. Getting the shared DB sources:

The majority of the code for building with the shared DB is located under softoken. In the branch BOB_SHARED_DB. This branch is kept up to date with the tip, so you should be able to just pull the branch on top of your standard NSS build.

  1. . checkout NSS as normal.
  2. . cd mozilla/security/nss/lib
  3. . mv softoken softoken.orig
  4. . cvs checkout -r NSS_BOB_SHARED softoken

2. Getting sqlite3. If you don't have a system version of sqlite3, you will need to build it. (If you have a system version you can skip this step:

  1. . in mozilla/security/nss/lib: cvs checkout -r NSS_BOB_SHARED sqlite
  2. . Patch the makefile as follows:
Index: Makefile
RCS file: /cvsroot/mozilla/security/nss/lib/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- Makefile    25 Apr 2004 15:03:01 -0000      1.9
+++ Makefile    31 May 2007 01:23:13 -0000
@@ -62,6 +62,24 @@
DIRS := $(filter-out fortcrypt,$(DIRS))
+# automatically determine if we need to build our own sqlite
+# or if we can use the system version. This is one thing configure
+# would be good for.
+INCLUDEDIR=$(patsubst -I%,%,$(INCLUDES) -I/usr/include)
+sqlitesearch=$(addsuffix /sqlite3.h,$(INCLUDEDIR))
+ifeq ($(wildcard $(sqlitesearch)),)
+DIRS := sqlite $(DIRS)

3. This should be enough to build the nss shared libraries. If you want to build the commands, patch the command line directory with the patch from bug 217538 (https://bugzilla.mozilla.org/show_bug.cgi?id=217538) (the patch is https://bugzilla.mozilla.org/attachment.cgi?id=266699 )

4. If you want to test the shared library, then apply the test patch from the same bug (https://bugzilla.mozilla.org/attachment.cgi?id=266700)

Build and test NSS as normal.