First commit for patches still under review. BUG1168917_BRANCH
authorElio Maldonado <emaldona@redhat.com>
Sun, 22 Nov 2015 19:18:04 -0800
branchBUG1168917_BRANCH
changeset 11736 5173fccc1bc394172c5a01160da57fe7373d2e9f
parent 11735 6a631abbf25d5622fe282f88d3db258e56a85286
child 11738 0c58dc6caa4123599188a87a0380584ea45618e3
push id866
push useremaldona@redhat.com
push dateMon, 23 Nov 2015 03:21:53 +0000
First commit for patches still under review.
Makefile
cmd/manifest.mn
lib/Makefile
lib/manifest.mn
tests/all.sh
--- a/Makefile
+++ b/Makefile
@@ -21,16 +21,21 @@ include $(CORE_DEPTH)/coreconf/config.mk
 #######################################################################
 
 
 
 #######################################################################
 # (4) Include "local" platform-dependent assignments (OPTIONAL).      #
 #######################################################################
 
+# Note for downstream package maintainers: if building with
+# NSS_BUILD_UTIL_ONLY or NSS_BUILD_SOFTOKEN_ONLY set up
+# export NSS_DISABLE_GTESTS=1 via the spec files or other
+# mechanism controling the build
+
 ifdef NSS_DISABLE_GTESTS
 DIRS := $(filter-out external_tests,$(DIRS))
 endif
 
 #######################################################################
 # (5) Execute "global" rules. (OPTIONAL)                              #
 #######################################################################
 
--- a/cmd/manifest.mn
+++ b/cmd/manifest.mn
@@ -1,18 +1,32 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DEPTH	= ..
 # MODULE	= seccmd
 
+ifdef NSS_BUILD_UTIL_ONLY
+REQUIRES = nspr
+
+DIRS = \
+ $(NULL)
+else
 REQUIRES = nss nspr libdbm
 
+ifdef NSS_BUILD_SOFTOKEN_ONLY
+DIRS = lib  \
+ $(BLTEST_SRCDIR) \
+ $(FIPSTEST_SRCDIR)  \
+ $(LOWHASHTEST_SRCDIR)  \
+ $(SHLIBSIGN_SRCDIR) \
+ $(NULL)
+else
 DIRS = lib  \
  addbuiltin \
  atob  \
  $(BLTEST_SRCDIR) \
  btoa  \
  certcgi \
  certutil  \
  checkcert  \
@@ -53,16 +67,18 @@ DIRS = lib  \
  strsclnt \
  symkeyutil \
  tests \
  tstclnt  \
  vfychain \
  vfyserv \
  modutil \
  $(NULL)
+endif
+endif
 
 TEMPORARILY_DONT_BUILD = \
  $(NULL)
 
 # rsaperf  \
 #
 #       needs to look at what needs to happen to make jar build in
 # the binary release environment.
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -41,35 +41,53 @@ ifeq ($(OS_ARCH),Linux)
 SYSINIT_SRCDIR = sysinit  # Add the sysinit directory to DIRS.
 endif
 endif
 
 ifndef NSS_DISABLE_DBM
 DBM_SRCDIR = dbm  # Add the dbm directory to DIRS.
 endif
 
+ifeq ($(NSS_BUILD_UTIL_ONLY),1)
+SYSINIT_SRCDIR=
+endif
+
 #######################################################################
 # (5) Execute "global" rules. (OPTIONAL)                              #
 #######################################################################
 
 include $(CORE_DEPTH)/coreconf/rules.mk
 
 #######################################################################
 # (6) Execute "component" rules. (OPTIONAL)                           #
 #######################################################################
 
 
 
 #######################################################################
 # (7) Execute "local" rules. (OPTIONAL).                              #
 #######################################################################
 
-ifeq ($(NSS_BUILD_WITHOUT_SOFTOKEN),1)
-# Not included when building nss without softoken
-UTIL_SRCDIR =
-FREEBL_SRCDIR =
-SOFTOKEN_SRCDIR =
+ifeq ($(NSS_BUILD_UTIL_ONLY),1)
+  UTIL_SRCDIR = util
+  FREEBL_SRCDIR =
+  SOFTOKEN_SRCDIR =
 else
-# default is to include all
-UTIL_SRCDIR = util
-FREEBL_SRCDIR = freebl
-SOFTOKEN_SRCDIR = softoken
+  ifeq ($(NSS_BUILD_SOFTOKEN_ONLY),1)
+      UTIL_SRCDIR =
+      FREEBL_SRCDIR = freebl
+      SOFTOKEN_SRCDIR = softoken
+  else
+    ifeq ($(NSS_BUILD_WITHOUT_SOFTOKEN),1)
+      # Not included when building nss without softoken
+      # This build type uses the build results of the prior
+      # NSS_BUILD_UTIL_ONLY and NSS_BUILD_SOFTOKEN_ONLY builds
+      UTIL_SRCDIR =
+      FREEBL_SRCDIR =
+      SOFTOKEN_SRCDIR =
+    else
+      # default is to include all
+      UTIL_SRCDIR = util
+      FREEBL_SRCDIR = freebl
+      SOFTOKEN_SRCDIR = softoken
+    endif
+  endif
 endif
--- a/lib/manifest.mn
+++ b/lib/manifest.mn
@@ -11,29 +11,51 @@ 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 = \
+ifdef NSS_BUILD_UTIL_ONLY
+  DIRS = \
+	$(UTIL_SRCDIR) \
+	$(NULL)
+else
+  ifdef NSS_BUILD_SOFTOKEN_ONLY
+    # Building softoken (and freebl) only requires that the paths
+    # to the locations where the util headers and libraries were
+    # previously installed by a prior util-only build, likely in
+    # in a system location that varies with the distribution. This
+    # cannot be addressed here and requires that downstream package
+    # mantainers add suitable modifications.
+    DIRS = \
+	$(UTIL_SRCDIR) \
+	$(FREEBL_SRCDIR) \
+	$(SQLITE_SRCDIR) \
+	$(DBM_SRCDIR) \
+	$(SOFTOKEN_SRCDIR) \
+	$(NULL)
+  else
+    DIRS = \
 	$(UTIL_SRCDIR) \
 	$(FREEBL_SRCDIR) \
 	$(SQLITE_SRCDIR) \
 	$(DBM_SRCDIR) \
 	$(SOFTOKEN_SRCDIR) \
 	base dev pki \
 	libpkix \
 	certdb certhigh pk11wrap cryptohi nss \
 	$(ZLIB_SRCDIR) ssl \
 	pkcs7 pkcs12 smime \
 	crmf jar \
 	ckfw $(SYSINIT_SRCDIR) \
 	$(NULL)
+  endif
+endif
 
 #  fortcrypt  is no longer built
 
 #
 # these dirs are not built at the moment
 #
 #NOBUILD_DIRS = jar
--- a/tests/all.sh
+++ b/tests/all.sh
@@ -305,19 +305,26 @@ fi
 # last file created.
 if [ "${NSS_BUILD_SOFTOKEN_ONLY}" = "1" ]; then
   LAST_FILE_BUILT=shlibsign
 else
   LAST_FILE_BUILT=modutil
 fi
 
 if [ ! -f ${DIST}/${OBJDIR}/bin/${LAST_FILE_BUILT}${PROG_SUFFIX} ]; then
+  if [ "${NSS_BUILD_UTIL_ONLY}" = "1" ]; then
+    # Currently no tests are run or built when building util only.
+    # This may change in the future, atob and bota are
+    # possible candidates.
+    echo "No tests were built"
+  else
     echo "Build Incomplete. Aborting test." >> ${LOGFILE}
     html_head "Testing Initialization"
     Exit "Checking for build"
+  fi
 fi
 
 # NOTE:
 # Lists of enabled tests and other settings are stored to ${ENV_BACKUP}
 # file and are are restored after every test cycle.
 
 ENV_BACKUP=${HOSTDIR}/env.sh
 env_backup > ${ENV_BACKUP}