Bug 835919 - Allow optionally building nss without softoken in the tree, r=wtc
authorElio Maldonado <emaldona@redhat.com>
Mon, 06 May 2013 13:23:52 -0700
changeset 10765 6fb9ff40d0548e3b3289e580091b668a37003a63
parent 10764 753e9555853d8cd70c35833d6fedacbea2e41e22
child 10766 cf3b9b27172ea4466692024944054748ad88d876
push id75
push useremaldona@redhat.com
push dateMon, 06 May 2013 20:24:20 +0000
reviewerswtc
bugs835919
Bug 835919 - Allow optionally building nss without softoken in the tree, r=wtc - Remove unneede changes in to the test scrips - Add needed comments for package maintainers and reviewers - Fix whitespace usage on the makefiles
cmd/Makefile
cmd/manifest.mn
cmd/platlibs.mk
lib/Makefile
lib/manifest.mn
tests/cipher/cipher.sh
tests/common/init.sh
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -10,21 +10,23 @@ DEPTH = ..
 include manifest.mn
 include $(CORE_DEPTH)/coreconf/config.mk
 
 ifdef BUILD_LIBPKIX_TESTS
 DIRS += libpkix
 endif
 
 ifeq ($(NSS_BUILD_WITHOUT_SOFTOKEN),1)
-BLTEST_SRCDIR=
-FIPSTEST_SRCDIR=
+BLTEST_SRCDIR =
+FIPSTEST_SRCDIR =
+SHLIBSIGN_SRCDIR =
 else
-BLTEST_SRCDIR      = bltest
-FIPSTEST_SRCDIR    = fipstest
+BLTEST_SRCDIR = bltest
+FIPSTEST_SRCDIR = fipstest
+SHLIBSIGN_SRCDIR = shlibsign
 endif
 
 LOWHASHTEST_SRCDIR=
 ifeq ($(FREEBL_LOWHASH),1)
 LOWHASHTEST_SRCDIR = lowhashtest  # Add the lowhashtest directory to DIRS.
 endif
 
 INCLUDES += \
--- a/cmd/manifest.mn
+++ b/cmd/manifest.mn
@@ -42,17 +42,17 @@ DIRS = lib  \
  pkix-errcodes \
  pp  \
  pwdecrypt \
  rsaperf \
  sdrtest \
  selfserv  \
  signtool \
  signver \
- shlibsign \
+ $(SHLIBSIGN_SRCDIR) \
  smimetools  \
  ssltap  \
  strsclnt \
  symkeyutil \
  tests \
  tstclnt  \
  vfychain \
  vfyserv \
--- a/cmd/platlibs.mk
+++ b/cmd/platlibs.mk
@@ -31,21 +31,23 @@ DBMLIB = $(NULL)
 else
 DBMLIB = $(DIST)/lib/$(LIB_PREFIX)dbm.$(LIB_SUFFIX) 
 endif
 
 ifdef USE_STATIC_LIBS
 
 DEFINES += -DNSS_USE_STATIC_LIBS
 # $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
-ifndef USE_SYSTEM_FREEBL
+ifndef NSS_USE_SYSTEM_FREEBL
 CRYPTOLIB=$(DIST)/lib/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
 SOFTOKENLIB=$(DIST)/lib/$(LIB_PREFIX)softokn.$(LIB_SUFFIX)
 else
-# Use the system freebl and softoken libraries
+# Use the system installed freebl static library and set softoken one to empty.
+# Some tools need to link statically with freebl but none with softoken. Only
+# the softoken shared library, not the static one, is installed in the system.
 CRYPTOLIB=$(FREEBL_LIB_DIR)/$(LIB_PREFIX)freebl.$(LIB_SUFFIX)
 SOFTOKENLIB=
 EXTRA_SHARED_LIBS += \
 	-L$(SOFTOKEN_LIB_DIR) \
 	-lsoftokn3 \
 	$(NULL)
 endif
 
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -59,17 +59,17 @@ include $(CORE_DEPTH)/coreconf/rules.mk
 
 
 #######################################################################
 # (7) Execute "local" rules. (OPTIONAL).                              #
 #######################################################################
 
 ifeq ($(NSS_BUILD_WITHOUT_SOFTOKEN),1)
 # Not included when building nss without softoken
-UTIL_SRCDIR=
-FREEBL_SRCDIR=
-SOFTOKEN_SRCDIR=
+UTIL_SRCDIR =
+FREEBL_SRCDIR =
+SOFTOKEN_SRCDIR =
 else
 # default is to include all
 UTIL_SRCDIR = util
 FREEBL_SRCDIR = freebl
 SOFTOKEN_SRCDIR = softoken
 endif
--- a/lib/manifest.mn
+++ b/lib/manifest.mn
@@ -11,17 +11,22 @@ DEPTH      = ..
 #  softoken and prereqs.
 #  stan (not a separate dll yet)
 #  libpkix (not a separate dll)
 #  nss base (traditional)
 #  ssl
 #  smime
 #  ckfw (builtins module)
 #  crmf jar (not dll's)
-DIRS = $(UTIL_SRCDIR) $(FREEBL_SRCDIR) $(SQLITE_SRCDIR) $(DBM_SRCDIR) $(SOFTOKEN_SRCDIR) \
+DIRS = \
+	$(UTIL_SRCDIR) \
+	$(FREEBL_SRCDIR) \
+	$(SQLITE_SRCDIR) \
+	$(DBM_SRCDIR) \
+	$(SOFTOKEN_SRCDIR) \
 	base dev pki \
 	libpkix \
 	certdb certhigh pk11wrap cryptohi nss \
 	$(ZLIB_SRCDIR) ssl \
 	pkcs12 pkcs7 smime \
 	crmf jar \
 	ckfw $(SYSINIT_SRCDIR) \
 	$(NULL)
--- a/tests/cipher/cipher.sh
+++ b/tests/cipher/cipher.sh
@@ -61,26 +61,23 @@ cipher_main()
   do
       if [ -n "$EXP_RET" -a "$EXP_RET" != "#" ] ; then
           PARAM=`echo $PARAM | sed -e "s/_-/ -/g"`
           TESTNAME=`echo $TESTNAME | sed -e "s/_/ /g"`
           echo "$SCRIPTNAME: $TESTNAME --------------------------------"
           failedStr=""
           inOff=0
           res=0
-          # If nss was built without softoken use the system installed bltest tool. 
-          # The FREEBL_BINDIR location is platform dependent. See the comments
-          # regarding this location in tests/common/init.sh. 
           while [ $inOff -lt 8 ]
           do
              outOff=0
              while [ $outOff -lt 8 ]
              do
                  echo "bltest -T -m $PARAM -d $CIPHERTESTDIR -1 $inOff -2 $outOff"
-                 ${PROFTOOL} ${FREEBL_BINDIR}/bltest${PROG_SUFFIX} -T -m $PARAM -d $CIPHERTESTDIR -1 $inOff -2 $outOff
+                 ${PROFTOOL} ${BINDIR}/bltest${PROG_SUFFIX} -T -m $PARAM -d $CIPHERTESTDIR -1 $inOff -2 $outOff
                  if [ $? -ne 0 ]; then
                      failedStr="$failedStr[$inOff:$outOff]"
                  fi
                  outOff=`expr $outOff + 1`
              done
              inOff=`expr $inOff + 1`
           done
           if [ -n "$failedStr" ]; then
--- a/tests/common/init.sh
+++ b/tests/common/init.sh
@@ -642,22 +642,11 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOU
         IOPR=1
     fi
     #################################################
 
     if [ "${OS_ARCH}" != "WINNT" -a "${OS_ARCH}" != "Android" ]; then
         ulimit -c unlimited
     fi 
 
-    #################################################################
-    # If we built nss without softoken use the system installed tool.
-    # Fedora, for example, uses /usr/lib${ARCH}/unsupported-tools but
-    # other platform may place the system installed tests somewhere else.
-    # The FREEBL_BINDIR environment variable will have been set by the
-    # package maintainer.
-    if [ ${NSS_BUILD_WITHOUT_SOFTOKEN} = "1" ]; then
-        export FREEBL_BINDIR=${FREEBL_BINDIR}
-    else
-        export FREEBL_BINDIR=${BINDIR}
-    fi
     SCRIPTNAME=$0
     INIT_SOURCED=TRUE   #whatever one does - NEVER export this one please
 fi