bug 511743 - add way to apply NSS patches to source at build time. r=bsmedberg

This commit is contained in:
Ted Mielczarek 2009-09-02 09:35:14 -04:00
parent 8609abaa76
commit 150c8d5be2
3 changed files with 35 additions and 32 deletions

View File

@ -170,6 +170,7 @@ NS_PRINTING = @NS_PRINTING@
MOZ_CRASHREPORTER = @MOZ_CRASHREPORTER@
MOZ_HELP_VIEWER = @MOZ_HELP_VIEWER@
MOC= @MOC@
MOZ_NSS_PATCH = @MOZ_NSS_PATCH@
MOZ_JAVAXPCOM = @MOZ_JAVAXPCOM@
JAVA_INCLUDE_PATH="@JAVA_INCLUDE_PATH@"

View File

@ -8158,6 +8158,7 @@ AC_SUBST(CC_VERSION)
AC_SUBST(CXX_VERSION)
AC_SUBST(MSMANIFEST_TOOL)
AC_SUBST(NS_ENABLE_TSF)
AC_SUBST(MOZ_NSS_PATCH)
if test "$USING_HCC"; then
CC='${topsrcdir}/build/hcc'

View File

@ -42,6 +42,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
MODULE = psm
@ -132,7 +133,7 @@ FREEBL_64FPU_LIB = libfreebl_64fpu_3$(DLL_SUFFIX)
FREEBL_64FPU_CHK = libfreebl_64fpu_3.chk
endif
ABS_DIST := $(shell cd $(DIST) && pwd)
ABS_DIST := $(call core_abspath,$(DIST))
ifeq ($(HOST_OS_ARCH),WINNT)
ifdef CYGDRIVE_MOUNT
ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g')
@ -182,7 +183,7 @@ DEFAULT_GMAKE_FLAGS += IMPORT_LIB_SUFFIX=".$(IMPORT_LIB_SUFFIX)"
ifdef NSS_DISABLE_DBM
DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
endif
ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
ABS_topsrcdir := $(call core_abspath,$(topsrcdir))
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
DEFAULT_GMAKE_FLAGS += BUILD_TREE=$(MOZ_BUILD_ROOT)
endif
@ -279,25 +280,25 @@ SUBMAKEFILES = boot/Makefile ssl/Makefile pki/Makefile locales/Makefile
include $(topsrcdir)/config/rules.mk
# Attempt to properly handle NSS' refusal to implement a dependency system
export:: .nss.cleaned
ifdef MOZ_NSS_PATCH
# If we're applying a patch, we'll copy the NSS source to the objdir
# and build it from there.
NSS_SRCDIR = $(CURDIR)/nss
.nss.cleaned: .nss.checkout
ifndef MOZ_NATIVE_NSS
$(NSSMAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
$(NSSMAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
ifndef SKIP_CHK
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
endif
touch $@
endif
GARBAGE += .nss.cleaned
.nss.checkout:
ifndef MOZ_NATIVE_NSS
touch $(srcdir)/$@
# This will copy and patch the NSS source for every build.
# Since we "cp -p", it won't force rebuilds for most files, just
# for patched files, but that's easier than trying to track
# dependencies for patched files.
export::
rm -rf $(NSS_SRCDIR)
$(NSINSTALL) -D $(NSS_SRCDIR)/security
cp -Rp $(topsrcdir)/security/nss $(NSS_SRCDIR)/security
cp -Rp $(topsrcdir)/security/coreconf $(NSS_SRCDIR)/security
cp -Rp $(topsrcdir)/security/dbm $(NSS_SRCDIR)/security
cp -Rp $(topsrcdir)/dbm $(NSS_SRCDIR)
(cd $(NSS_SRCDIR) && patch -p1 < $(call core_abspath,$(MOZ_NSS_PATCH)))
else
NSS_SRCDIR = $(topsrcdir)
endif
dependclean export packages chrome::
@ -310,22 +311,22 @@ endif
libs::
ifndef MOZ_NATIVE_NSS
$(NSSMAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(NSS_SRCDIR)/security/coreconf $(DEFAULT_GMAKE_FLAGS)
ifndef NSS_DISABLE_DBM
$(NSSMAKE) -C $(topsrcdir)/security/dbm $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(NSS_SRCDIR)/security/dbm $(DEFAULT_GMAKE_FLAGS)
endif
$(NSSMAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
ifdef ENABLE_TESTS
# Need certutil binary for mochitest certificates generation
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/certutil $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/pk12util $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/certutil $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/pk12util $(DEFAULT_GMAKE_FLAGS)
endif
ifndef SKIP_CHK
ifndef ENABLE_TESTS # Just avoid secondary compile
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS)
endif
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS)
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS)
endif
$(INSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DIST)/bin
ifndef SKIP_CHK
@ -447,11 +448,11 @@ ifdef MOZ_XUL
$(MAKE) -C pki $@
endif
ifndef MOZ_NATIVE_NSS
$(NSSMAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
$(NSSMAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
$(NSSMAKE) -C $(NSS_SRCDIR)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean
ifndef SKIP_CHK
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
$(NSSMAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean
$(NSSMAKE) -C $(NSS_SRCDIR)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean
endif
endif