michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: CC_WRAPPER = michael@0: CXX_WRAPPER = michael@0: michael@0: default:: michael@0: michael@0: include $(topsrcdir)/config/makefiles/functions.mk michael@0: michael@0: NSS_LIBS = \ michael@0: nss3 \ michael@0: nssutil3 \ michael@0: smime3 \ michael@0: ssl3 \ michael@0: $(NULL) michael@0: michael@0: ifdef MOZ_FOLD_LIBS michael@0: NSS_DLLS = $(LIBRARY_NAME) michael@0: else michael@0: NSS_DLLS = $(NSS_LIBS) michael@0: endif michael@0: michael@0: NSS_EXTRA_DLLS = \ michael@0: nssckbi \ michael@0: softokn3 \ michael@0: $(NULL) michael@0: michael@0: ifndef NSS_DISABLE_DBM michael@0: NSS_EXTRA_DLLS += nssdbm3 michael@0: endif michael@0: michael@0: SDK_LIBS = crmf michael@0: michael@0: ifneq (,$(filter WINNT,$(OS_ARCH))) michael@0: SDK_LIBS += $(NSS_DLLS) michael@0: endif michael@0: michael@0: # Default michael@0: HAVE_FREEBL_LIBS = 1 michael@0: michael@0: # 32-bit HP-UX PA-RISC michael@0: ifeq ($(OS_ARCH), HP-UX) michael@0: ifneq ($(OS_TEST), ia64) michael@0: ifndef HAVE_64BIT_OS michael@0: HAVE_FREEBL_LIBS = michael@0: HAVE_FREEBL_LIBS_32INT32 = 1 michael@0: HAVE_FREEBL_LIBS_32FPU = 1 michael@0: endif michael@0: endif michael@0: endif michael@0: michael@0: # SunOS SPARC michael@0: ifeq ($(OS_ARCH), SunOS) michael@0: ifneq (86,$(findstring 86,$(OS_TEST))) michael@0: ifdef HAVE_64BIT_OS michael@0: HAVE_FREEBL_LIBS = michael@0: HAVE_FREEBL_LIBS_64 = 1 michael@0: else michael@0: HAVE_FREEBL_LIBS = michael@0: HAVE_FREEBL_LIBS_32FPU = 1 michael@0: HAVE_FREEBL_LIBS_32INT64 = 1 michael@0: endif michael@0: endif michael@0: endif michael@0: michael@0: ifdef HAVE_FREEBL_LIBS michael@0: NSS_EXTRA_DLLS += freebl3 michael@0: endif michael@0: ifdef HAVE_FREEBL_LIBS_32INT32 michael@0: NSS_EXTRA_DLLS += freebl_32int_3 michael@0: endif michael@0: ifdef HAVE_FREEBL_LIBS_32FPU michael@0: NSS_EXTRA_DLLS += freebl_32fpu_3 michael@0: endif michael@0: ifdef HAVE_FREEBL_LIBS_32INT64 michael@0: NSS_EXTRA_DLLS += freebl_32int64_3 michael@0: endif michael@0: ifdef HAVE_FREEBL_LIBS_64 michael@0: NSS_EXTRA_DLLS += freebl_64int_3 michael@0: NSS_EXTRA_DLLS += freebl_64fpu_3 michael@0: endif michael@0: michael@0: ABS_DIST := $(abspath $(DIST)) michael@0: ifeq ($(HOST_OS_ARCH),WINNT) michael@0: ifdef CYGDRIVE_MOUNT michael@0: ABS_DIST := $(shell cygpath -w $(ABS_DIST) | sed -e 's|\\|/|g') michael@0: endif michael@0: ifneq (,$(filter mingw%,$(host_os))) michael@0: ABS_DIST := $(shell cd $(DIST) && pwd -W) michael@0: endif michael@0: endif michael@0: # For all variables such as DLLFLAGS, that may contain $(DIST) michael@0: DIST := $(ABS_DIST) michael@0: NSPR_INCLUDE_DIR = $(firstword $(filter -I%,$(NSPR_CFLAGS))) michael@0: ifneq (,$(strip $(NSPR_INCLUDE_DIR))) michael@0: NSPR_INCLUDE_DIR := $(subst -I,,$(subst -I$(DIST),-I$(ABS_DIST),$(NSPR_INCLUDE_DIR))) michael@0: else michael@0: NSPR_INCLUDE_DIR = $(ABS_DIST)/include/nspr michael@0: endif michael@0: NSPR_LIB_DIR = $(firstword $(filter -L%,$(NSPR_LIBS))) michael@0: ifneq (,$(strip $(NSPR_LIB_DIR))) michael@0: NSPR_LIB_DIR := $(subst -L,,$(subst -L$(DIST),-L$(ABS_DIST),$(NSPR_LIB_DIR))) michael@0: else michael@0: NSPR_LIB_DIR = $(ABS_DIST)/lib michael@0: endif michael@0: # Can't pass this in DEFAULT_GMAKE_FLAGS because that overrides michael@0: # definitions in NSS, so just export it into the sub-make's environment. michael@0: ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_MEMORY)) michael@0: export DLLFLAGS michael@0: endif michael@0: michael@0: # To get debug symbols from NSS michael@0: export MOZ_DEBUG_SYMBOLS michael@0: michael@0: DEFAULT_GMAKE_FLAGS = michael@0: DEFAULT_GMAKE_FLAGS += CC='$(CC)' michael@0: DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(ABS_DIST) michael@0: DEFAULT_GMAKE_FLAGS += SOURCE_MDHEADERS_DIR=$(NSPR_INCLUDE_DIR) michael@0: DEFAULT_GMAKE_FLAGS += DIST=$(ABS_DIST) michael@0: DEFAULT_GMAKE_FLAGS += NSPR_INCLUDE_DIR=$(NSPR_INCLUDE_DIR) michael@0: DEFAULT_GMAKE_FLAGS += NSPR_LIB_DIR=$(NSPR_LIB_DIR) michael@0: DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1 michael@0: DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1 michael@0: DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ECC=1 michael@0: ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_1) michael@0: DEFAULT_GMAKE_FLAGS += OS_DLLFLAGS='-static-libgcc' michael@0: endif michael@0: ifndef MOZ_NATIVE_SQLITE michael@0: ifdef MOZ_FOLD_LIBS michael@0: DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=nss3 michael@0: else michael@0: DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=mozsqlite3 michael@0: endif # MOZ_FOLD_LIBS michael@0: DEFAULT_GMAKE_FLAGS += SQLITE_INCLUDE_DIR=$(ABS_DIST)/include michael@0: endif michael@0: ifdef NSS_DISABLE_DBM michael@0: DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1 michael@0: endif michael@0: # Hack to force NSS build system to use "normal" object directories michael@0: DEFAULT_GMAKE_FLAGS += topsrcdir='$(topsrcdir)' michael@0: # topsrcdir can't be expanded here because msys path mangling likes to break michael@0: # paths in that case. michael@0: DEFAULT_GMAKE_FLAGS += BUILD='$(MOZ_BUILD_ROOT)/security/$$(subst $$(topsrcdir)/security/,,$$(CURDIR))' michael@0: DEFAULT_GMAKE_FLAGS += BUILD_TREE='$$(BUILD)' OBJDIR='$$(BUILD)' DEPENDENCIES='$$(BUILD)/.deps' SINGLE_SHLIB_DIR='$$(BUILD)' michael@0: DEFAULT_GMAKE_FLAGS += SOURCE_XP_DIR=$(ABS_DIST) michael@0: ifndef MOZ_DEBUG michael@0: DEFAULT_GMAKE_FLAGS += BUILD_OPT=1 OPT_CODE_SIZE=1 michael@0: endif michael@0: ifdef GNU_CC michael@0: DEFAULT_GMAKE_FLAGS += NS_USE_GCC=1 michael@0: else michael@0: DEFAULT_GMAKE_FLAGS += NS_USE_GCC= michael@0: endif michael@0: ifdef USE_N32 michael@0: # It is not really necessary to specify USE_PTHREADS=1. USE_PTHREADS michael@0: # merely adds _PTH to coreconf's OBJDIR name. michael@0: DEFAULT_GMAKE_FLAGS += USE_N32=1 USE_PTHREADS=1 michael@0: endif michael@0: ifdef HAVE_64BIT_OS michael@0: DEFAULT_GMAKE_FLAGS += USE_64=1 michael@0: endif michael@0: ifeq ($(OS_ARCH),WINNT) michael@0: DEFAULT_GMAKE_FLAGS += OS_TARGET=WIN95 michael@0: ifdef MOZ_DEBUG michael@0: ifndef MOZ_NO_DEBUG_RTL michael@0: DEFAULT_GMAKE_FLAGS += USE_DEBUG_RTL=1 michael@0: endif michael@0: endif michael@0: endif # WINNT michael@0: ifeq ($(OS_ARCH),Darwin) michael@0: # Make nsinstall use absolute symlinks by default when building NSS michael@0: # for Mozilla on Mac OS X. (Bugzilla bug 193164) michael@0: ifndef NSDISTMODE michael@0: DEFAULT_GMAKE_FLAGS += NSDISTMODE=absolute_symlink michael@0: endif michael@0: ifdef MACOS_SDK_DIR michael@0: DEFAULT_GMAKE_FLAGS += MACOS_SDK_DIR=$(MACOS_SDK_DIR) michael@0: endif michael@0: endif michael@0: michael@0: # Turn off TLS compression support because it requires system zlib. michael@0: # See bug 580679 comment 18. michael@0: DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ZLIB= michael@0: michael@0: # Disable building of the test programs in security/nss/lib/zlib michael@0: DEFAULT_GMAKE_FLAGS += PROGRAMS= michael@0: michael@0: # Disable creating .chk files. They will be generated from packager.mk michael@0: # When bug 681624 lands, we can replace CHECKLOC= with SKIP_SHLIBSIGN=1 michael@0: DEFAULT_GMAKE_FLAGS += CHECKLOC= michael@0: michael@0: ifdef CROSS_COMPILE michael@0: michael@0: DEFAULT_GMAKE_FLAGS += \ michael@0: NATIVE_CC='$(HOST_CC)' \ michael@0: CC='$(CC)' \ michael@0: CCC='$(CXX)' \ michael@0: LINK='$(LD)' \ michael@0: AS='$(AS)' \ michael@0: AR='$(AR) $(AR_FLAGS:$@=$$@)' \ michael@0: RANLIB='$(RANLIB)' \ michael@0: RC='$(RC) $(RCFLAGS)' \ michael@0: OS_ARCH='$(OS_ARCH)' \ michael@0: OS_TEST='$(OS_TEST)' \ michael@0: CPU_ARCH='$(TARGET_CPU)' \ michael@0: $(NULL) michael@0: michael@0: # Android has pthreads integrated into -lc, so OS_PTHREAD is set to nothing michael@0: ifeq ($(OS_TARGET), Android) michael@0: DEFAULT_GMAKE_FLAGS += \ michael@0: OS_RELEASE='2.6' \ michael@0: OS_PTHREAD= \ michael@0: $(NULL) michael@0: michael@0: DEFAULT_GMAKE_FLAGS += ARCHFLAG='$(CFLAGS) -DCHECK_FORK_GETPID -DRTLD_NOLOAD=0 -include $(topsrcdir)/security/manager/android_stub.h' michael@0: endif michael@0: endif michael@0: michael@0: ifdef WRAP_LDFLAGS michael@0: DEFAULT_GMAKE_FLAGS += \ michael@0: LDFLAGS='$(LDFLAGS) $(WRAP_LDFLAGS)' \ michael@0: DSO_LDOPTS='$(DSO_LDOPTS) $(LDFLAGS) $(WRAP_LDFLAGS)' \ michael@0: $(NULL) michael@0: endif michael@0: michael@0: DEFAULT_GMAKE_FLAGS += FREEBL_NO_DEPEND=0 michael@0: ifeq ($(OS_TARGET),Linux) michael@0: DEFAULT_GMAKE_FLAGS += FREEBL_LOWHASH=1 michael@0: endif michael@0: michael@0: ifdef MOZ_NO_WLZDEFS michael@0: DEFAULT_GMAKE_FLAGS += ZDEFS_FLAG= michael@0: endif michael@0: ifdef MOZ_CFLAGS_NSS michael@0: DEFAULT_GMAKE_FLAGS += XCFLAGS='$(CFLAGS)' michael@0: DEFAULT_GMAKE_FLAGS += DARWIN_DYLIB_VERSIONS='-compatibility_version 1 -current_version 1 $(LDFLAGS)' michael@0: endif michael@0: michael@0: DEFAULT_GMAKE_FLAGS += NSS_NO_PKCS11_BYPASS=1 michael@0: michael@0: # Put NSS headers directly under $(DIST)/include michael@0: DEFAULT_GMAKE_FLAGS += PUBLIC_EXPORT_DIR='$(ABS_DIST)/include/$$(MODULE)' michael@0: DEFAULT_GMAKE_FLAGS += SOURCE_XPHEADERS_DIR='$$(SOURCE_XP_DIR)/include/$$(MODULE)' michael@0: DEFAULT_GMAKE_FLAGS += MODULE_INCLUDES='$$(addprefix -I$$(SOURCE_XP_DIR)/include/,$$(REQUIRES))' michael@0: michael@0: # Work around NSS's MAKE_OBJDIR being racy. See bug #836220 michael@0: DEFAULT_GMAKE_FLAGS += MAKE_OBJDIR='$$(INSTALL) -D $$(OBJDIR)' michael@0: michael@0: # Work around NSS adding IMPORT_LIBRARY to TARGETS with no rule for michael@0: # it, creating race conditions. See bug #836220 michael@0: DEFAULT_GMAKE_FLAGS += TARGETS='$$(LIBRARY) $$(SHARED_LIBRARY) $$(PROGRAM)' michael@0: michael@0: ifdef MOZ_B2G_CERTDATA michael@0: include $(srcdir)/b2g-certdata.mk michael@0: endif michael@0: michael@0: ifdef MOZ_NSS_PATCH michael@0: # If we're applying a patch, we'll copy the NSS source to the objdir michael@0: # and build it from there. michael@0: NSS_SRCDIR = $(CURDIR)/nss michael@0: michael@0: # This will copy and patch the NSS source for every build. michael@0: # Since we "cp -p", it won't force rebuilds for most files, just michael@0: # for patched files, but that's easier than trying to track michael@0: # dependencies for patched files. michael@0: export:: michael@0: rm -rf $(NSS_SRCDIR) michael@0: $(NSINSTALL) -D $(NSS_SRCDIR)/security michael@0: cp -Rp $(topsrcdir)/security/nss $(NSS_SRCDIR)/security michael@0: cp -Rp $(topsrcdir)/security/coreconf $(NSS_SRCDIR)/security michael@0: cp -Rp $(topsrcdir)/security/dbm $(NSS_SRCDIR)/security michael@0: cp -Rp $(topsrcdir)/dbm $(NSS_SRCDIR) michael@0: (cd $(NSS_SRCDIR) && patch -p1 < $(abspath $(MOZ_NSS_PATCH))) michael@0: else michael@0: NSS_SRCDIR = $(topsrcdir) michael@0: endif michael@0: michael@0: NSS_DIRS = michael@0: ifndef MOZ_FOLD_LIBS michael@0: NSS_DIRS += nss/lib michael@0: else michael@0: ifndef NSS_DISABLE_DBM michael@0: NSS_DIRS += nss/lib/dbm michael@0: endif michael@0: endif michael@0: NSS_DIRS += \ michael@0: nss/cmd/lib \ michael@0: nss/cmd/shlibsign \ michael@0: $(NULL) michael@0: michael@0: ifdef ENABLE_TESTS michael@0: NSS_DIRS += \ michael@0: nss/cmd/certutil \ michael@0: nss/cmd/pk12util \ michael@0: nss/cmd/modutil \ michael@0: $(NULL) michael@0: endif michael@0: michael@0: ifneq (,$(filter %--build-id,$(LDFLAGS))) michael@0: DEFAULT_GMAKE_ENV = LDFLAGS=-Wl,--build-id michael@0: endif michael@0: michael@0: ifdef MOZ_FOLD_LIBS michael@0: # TODO: The following can be replaced by something simpler when bug 844880 michael@0: # is fixed. michael@0: # All static libraries required for nss, smime, ssl and nssutil. michael@0: # The strip is needed to remove potential linefeed characters, since they hang michael@0: # around in some cases on Windows. michael@0: NSS_STATIC_LIBS := $(strip $(shell $(MAKE) --no-print-directory -f $(srcdir)/nss.mk DEPTH='$(DEPTH)' topsrcdir='$(topsrcdir)' srcdir='$(srcdir)' echo-variable-libs)) michael@0: # Corresponding build directories michael@0: NSS_STATIC_DIRS := $(foreach lib,$(NSS_STATIC_LIBS),$(patsubst %/,%,$(dir $(lib)))) michael@0: NSS_DIRS += $(NSS_STATIC_DIRS) michael@0: michael@0: # TODO: The following can be replaced by something simpler when bug 844884 michael@0: # is fixed. michael@0: # Remaining nss/lib directories michael@0: NSS_DIRS += nss/lib/freebl nss/lib/softoken nss/lib/jar nss/lib/crmf nss/lib/ckfw nss/lib/libpkix michael@0: ifeq (WINNT,$(OS_TARGET)) michael@0: NSS_DIRS += nss/lib/zlib michael@0: endif michael@0: endif # MOZ_FOLD_LIBS michael@0: michael@0: # Filter-out $(LIBRARY_NAME) because it's already handled in config/rules.mk. michael@0: NSS_DIST_DLL_FILES := $(addprefix $(DIST)/lib/$(DLL_PREFIX),$(addsuffix $(DLL_SUFFIX),$(filter-out $(LIBRARY_NAME),$(NSS_DLLS)) $(NSS_EXTRA_DLLS))) michael@0: NSS_DIST_DLL_DEST := $(DIST)/bin michael@0: INSTALL_TARGETS += NSS_DIST_DLL michael@0: michael@0: ifeq ($(OS_ARCH)_$(1), SunOS_softokn3) michael@0: # has to use copy mode on Solaris, see #665509 michael@0: $(DIST)/bin/$(DLL_PREFIX)softokn3$(DLL_SUFFIX): INSTALL := $(INSTALL) -t michael@0: endif michael@0: michael@0: NSS_SDK_LIB_FILES := \ michael@0: $(addprefix $(DIST)/lib/$(LIB_PREFIX),$(addsuffix .$(LIB_SUFFIX),$(SDK_LIBS))) \ michael@0: $(addprefix $(DIST)/bin/$(DLL_PREFIX),$(addsuffix $(DLL_SUFFIX),$(NSS_DLLS))) \ michael@0: $(NULL) michael@0: NSS_SDK_LIB_DEST := $(DIST)/sdk/lib michael@0: INSTALL_TARGETS += NSS_SDK_LIB michael@0: michael@0: ifdef MOZ_FOLD_LIBS michael@0: ifeq (WINNT,$(OS_TARGET)) michael@0: SUFFIX = _s.$(LIB_SUFFIX) michael@0: else michael@0: SUFFIX = .$(LIB_SUFFIX) michael@0: endif michael@0: michael@0: # Fold NSPR libs michael@0: EXTRA_DSO_LDOPTS += $(DEPTH)/nsprpub/pr/src/$(LIB_PREFIX)nspr4$(SUFFIX) michael@0: EXTRA_DSO_LDOPTS += $(DEPTH)/nsprpub/lib/ds/$(LIB_PREFIX)plds4$(SUFFIX) michael@0: EXTRA_DSO_LDOPTS += $(DEPTH)/nsprpub/lib/libc/src/$(LIB_PREFIX)plc4$(SUFFIX) michael@0: michael@0: # Fold SQLite michael@0: EXTRA_DSO_LDOPTS += $(DEPTH)/db/sqlite3/src/$(LIB_PREFIX)mozsqlite3.$(LIB_SUFFIX) michael@0: michael@0: # Add all static libraries for nss, smime, ssl and nssutil michael@0: SHARED_LIBRARY_LIBS = $(addprefix ../,$(NSS_STATIC_LIBS)) michael@0: michael@0: ifeq (WINNT,$(OS_TARGET)) michael@0: # Create a .def file based on the various .def files for nss, smime, ssl and michael@0: # nssutil. michael@0: NSS_STATIC_LIBS_DEFS := $(wildcard $(addprefix $(srcdir)/../,$(NSS_STATIC_LIBS:.$(LIB_SUFFIX)=.def))) michael@0: michael@0: nss3.def: $(NSS_STATIC_LIBS_DEFS) $(DEPTH)/db/sqlite3/src/sqlite-processed.def michael@0: echo LIBRARY nss3$(DLL_SUFFIX) > $@.tmp michael@0: echo EXPORTS >> $@.tmp michael@0: grep -v -h -e ^LIBRARY -e ^EXPORTS -e ^\; $^ >> $@.tmp michael@0: mv $@.tmp $@ michael@0: endif michael@0: michael@0: ifneq (,$(filter WINNT,$(OS_ARCH))) michael@0: SDK_LIBRARY = $(IMPORT_LIBRARY) michael@0: else michael@0: SDK_LIBRARY = $(SHARED_LIBRARY) michael@0: endif michael@0: michael@0: endif # MOZ_FOLD_LIBS michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: ifdef MOZ_FOLD_LIBS michael@0: # Force the linker to include everything from the static libraries. michael@0: EXPAND_LIBS_EXEC += --extract michael@0: michael@0: $(SHARED_LIBRARY): $(SHARED_LIBRARY_LIBS) michael@0: michael@0: EXTRA_DSO_LDOPTS += $(REALTIME_LIBS) michael@0: michael@0: ifdef IMPORT_LIB_SUFFIX michael@0: IMPORT_PREFIX = $(LIB_PREFIX) michael@0: IMPORT_SUFFIX = .$(IMPORT_LIB_SUFFIX) michael@0: else michael@0: IMPORT_PREFIX = $(DLL_PREFIX) michael@0: IMPORT_SUFFIX = $(DLL_SUFFIX) michael@0: endif michael@0: michael@0: NSPR_IMPORT_LIBS = $(addprefix $(DIST)/lib/$(IMPORT_PREFIX),$(addsuffix $(IMPORT_SUFFIX),nspr4 plc4 plds4)) michael@0: SQLITE_IMPORT_LIB = $(DIST)/lib/$(IMPORT_PREFIX)mozsqlite3$(IMPORT_SUFFIX) michael@0: michael@0: # TODO: The following can be replaced by something simpler when bug 844884 michael@0: # is fixed. michael@0: # Associate target files with the rules that build them. michael@0: $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX): libs-nss/lib/crmf michael@0: $(DIST)/lib/$(DLL_PREFIX)freebl3$(DLL_SUFFIX): libs-nss/lib/freebl michael@0: $(DIST)/lib/$(DLL_PREFIX)nssckbi$(DLL_SUFFIX): libs-nss/lib/ckfw michael@0: $(DIST)/lib/$(DLL_PREFIX)softokn3$(DLL_SUFFIX): libs-nss/lib/softoken michael@0: $(DIST)/lib/$(DLL_PREFIX)nssdbm3$(DLL_SUFFIX): libs-nss/lib/softoken michael@0: $(foreach lib,$(NSS_STATIC_LIBS),$(eval ../$(lib): libs-$(patsubst %/,%,$(dir $(lib))))) michael@0: michael@0: # Create fake import libraries for the folded libraries, so that linking michael@0: # against them works both for the NSS build system (see dependencies below) michael@0: # and for the rest of the mozilla build system. michael@0: $(NSPR_IMPORT_LIBS) \ michael@0: $(SQLITE_IMPORT_LIB) \ michael@0: $(DIST)/lib/$(IMPORT_PREFIX)nssutil3$(IMPORT_SUFFIX) \ michael@0: $(DIST)/lib/$(IMPORT_PREFIX)ssl3$(IMPORT_SUFFIX) \ michael@0: $(DIST)/lib/$(IMPORT_PREFIX)smime3$(IMPORT_SUFFIX): $(DIST)/lib/$(IMPORT_PREFIX)nss3$(IMPORT_SUFFIX) michael@0: ifeq (WINNT,$(OS_TARGET)) michael@0: cp $< $@ michael@0: else michael@0: ln -sf $< $@ michael@0: endif michael@0: michael@0: # Interdependencies between nss sub-directories, and dependencies on NSPR/SQLite michael@0: libs-nss/lib/ckfw: libs-nss/lib/nss/../base $(NSPR_IMPORT_LIBS) michael@0: libs-nss/lib/softoken: $(NSPR_IMPORT_LIBS) $(SQLITE_IMPORT_LIB) michael@0: libs-nss/lib/softoken: libs-nss/lib/freebl michael@0: ifndef NSS_DISABLE_DBM michael@0: libs-nss/lib/softoken: libs-nss/lib/dbm michael@0: endif michael@0: libs-nss/lib/softoken: $(DIST)/lib/$(IMPORT_PREFIX)nssutil3$(IMPORT_SUFFIX) michael@0: libs-nss/lib/freebl: $(DIST)/lib/$(IMPORT_PREFIX)nssutil3$(IMPORT_SUFFIX) $(NSPR_IMPORT_LIBS) michael@0: michael@0: # For each directory where we build static libraries, force the NSS build system michael@0: # to only build static libraries. michael@0: $(addprefix libs-,$(NSS_STATIC_DIRS)): DEFAULT_GMAKE_FLAGS += SHARED_LIBRARY= IMPORT_LIBRARY= michael@0: else michael@0: $(NSS_DIST_DLL_FILES) $(NSS_SDK_LIB_FILES): libs-nss/lib michael@0: endif # MOZ_FOLD_LIBS michael@0: michael@0: ifeq ($(NSINSTALL_PY),$(NSINSTALL)) michael@0: DEFAULT_GMAKE_FLAGS += PYTHON='$(PYTHON)' michael@0: DEFAULT_GMAKE_FLAGS += NSINSTALL_PY='$(abspath $(topsrcdir)/config/nsinstall.py)' michael@0: DEFAULT_GMAKE_FLAGS += NSINSTALL='$$(PYTHON) $$(NSINSTALL_PY)' michael@0: else michael@0: DEFAULT_GMAKE_FLAGS += NSINSTALL='$(NSINSTALL)' michael@0: endif michael@0: ifeq ($(OS_ARCH),WINNT) michael@0: DEFAULT_GMAKE_FLAGS += INSTALL='$$(NSINSTALL) -t' michael@0: endif michael@0: DEFAULT_GMAKE_FLAGS += $(EXTRA_GMAKE_FLAGS) michael@0: michael@0: $(addprefix libs-,$(NSS_DIRS)): libs-%: michael@0: # Work around NSS's export rule being racy when recursing for private_export michael@0: # See bug #836220. michael@0: $(addprefix export-,$(NSS_DIRS)): EXTRA_GMAKE_FLAGS = PRIVATE_EXPORTS= michael@0: $(addprefix export-,$(NSS_DIRS)): export-%: private_export-% michael@0: $(addprefix private_export-,$(NSS_DIRS)): EXTRA_GMAKE_FLAGS = michael@0: $(addprefix private_export-,$(NSS_DIRS)): private_export-%: michael@0: michael@0: # Work around bug #836228 in pymake michael@0: ifdef .PYMAKE michael@0: $(foreach p,libs export private_export,$(addprefix $(p)-,$(NSS_DIRS))): *=$(subst $(NULL) $(NULL),-,$(wordlist 2,$(words $(subst -, ,$@)),$(subst -, ,$@))) michael@0: endif michael@0: michael@0: $(foreach p,libs export private_export,$(addprefix $(p)-,$(NSS_DIRS))): michael@0: $(DEFAULT_GMAKE_ENV) $(MAKE) -C $(NSS_SRCDIR)/security/$* $(@:-$*=) $(DEFAULT_GMAKE_FLAGS) michael@0: michael@0: export:: $(addprefix export-,$(NSS_DIRS)) michael@0: michael@0: $(addprefix clean-,$(NSS_DIRS)): clean-%: michael@0: $(MAKE) -C $(NSS_SRCDIR)/security/$* $(DEFAULT_GMAKE_FLAGS) clean michael@0: michael@0: clean clobber clobber_all realclean distclean depend:: $(addprefix clean-,$(NSS_DIRS)) michael@0: michael@0: NSS_CMD_TARGETS := $(addprefix libs-,$(filter-out nss/cmd/lib,$(filter nss/cmd/%,$(NSS_DIRS)))) michael@0: libs:: $(NSS_CMD_TARGETS) michael@0: michael@0: ifdef MOZ_FOLD_LIBS michael@0: $(NSS_CMD_TARGETS): $(addprefix $(DIST)/lib/$(IMPORT_PREFIX),$(addsuffix $(IMPORT_SUFFIX),$(NSS_LIBS))) michael@0: libs-nss/cmd/modutil: libs-nss/lib/jar michael@0: ifeq (WINNT,$(OS_TARGET)) michael@0: libs-nss/cmd/modutil: libs-nss/lib/zlib michael@0: endif michael@0: $(NSS_CMD_TARGETS): libs-nss/cmd/lib michael@0: else michael@0: $(NSS_CMD_TARGETS): libs-nss/lib libs-nss/cmd/lib michael@0: endif # MOZ_FOLD_LIBS michael@0: michael@0: # Work around NSS build system race condition creating certdata.c in michael@0: # security/nss/lib/ckfw/builtins. See bug #836220. michael@0: libs-nss/lib$(if $(MOZ_FOLD_LIBS),/ckfw): $(call mkdir_deps,../nss/lib/ckfw/builtins)