gecko/security/build/Makefile.in
Brian Smith 5776e92058 Bug 858231: Upgrade to NSS 3.15 BETA 1 and adjust security/build to work with new NSS directory layout, r=bsmith
--HG--
rename : security/coreconf/AIX.mk => security/nss/coreconf/AIX.mk
rename : security/coreconf/Android.mk => security/nss/coreconf/Android.mk
rename : security/coreconf/BSD_OS.mk => security/nss/coreconf/BSD_OS.mk
rename : security/coreconf/BeOS.mk => security/nss/coreconf/BeOS.mk
rename : security/coreconf/Darwin.mk => security/nss/coreconf/Darwin.mk
rename : security/coreconf/FreeBSD.mk => security/nss/coreconf/FreeBSD.mk
rename : security/coreconf/HP-UX.mk => security/nss/coreconf/HP-UX.mk
rename : security/coreconf/HP-UXA.09.03.mk => security/nss/coreconf/HP-UXA.09.03.mk
rename : security/coreconf/HP-UXA.09.07.mk => security/nss/coreconf/HP-UXA.09.07.mk
rename : security/coreconf/HP-UXA.09.mk => security/nss/coreconf/HP-UXA.09.mk
rename : security/coreconf/HP-UXB.10.01.mk => security/nss/coreconf/HP-UXB.10.01.mk
rename : security/coreconf/HP-UXB.10.10.mk => security/nss/coreconf/HP-UXB.10.10.mk
rename : security/coreconf/HP-UXB.10.20.mk => security/nss/coreconf/HP-UXB.10.20.mk
rename : security/coreconf/HP-UXB.10.30.mk => security/nss/coreconf/HP-UXB.10.30.mk
rename : security/coreconf/HP-UXB.10.mk => security/nss/coreconf/HP-UXB.10.mk
rename : security/coreconf/HP-UXB.11.00.mk => security/nss/coreconf/HP-UXB.11.00.mk
rename : security/coreconf/HP-UXB.11.11.mk => security/nss/coreconf/HP-UXB.11.11.mk
rename : security/coreconf/HP-UXB.11.20.mk => security/nss/coreconf/HP-UXB.11.20.mk
rename : security/coreconf/HP-UXB.11.22.mk => security/nss/coreconf/HP-UXB.11.22.mk
rename : security/coreconf/HP-UXB.11.23.mk => security/nss/coreconf/HP-UXB.11.23.mk
rename : security/coreconf/HP-UXB.11.mk => security/nss/coreconf/HP-UXB.11.mk
rename : security/coreconf/IRIX.mk => security/nss/coreconf/IRIX.mk
rename : security/coreconf/IRIX5.2.mk => security/nss/coreconf/IRIX5.2.mk
rename : security/coreconf/IRIX5.3.mk => security/nss/coreconf/IRIX5.3.mk
rename : security/coreconf/IRIX5.mk => security/nss/coreconf/IRIX5.mk
rename : security/coreconf/IRIX6.2.mk => security/nss/coreconf/IRIX6.2.mk
rename : security/coreconf/IRIX6.3.mk => security/nss/coreconf/IRIX6.3.mk
rename : security/coreconf/IRIX6.5.mk => security/nss/coreconf/IRIX6.5.mk
rename : security/coreconf/IRIX6.mk => security/nss/coreconf/IRIX6.mk
rename : security/coreconf/Linux.mk => security/nss/coreconf/Linux.mk
rename : security/coreconf/Makefile => security/nss/coreconf/Makefile
rename : security/coreconf/NCR3.0.mk => security/nss/coreconf/NCR3.0.mk
rename : security/coreconf/NEC4.2.mk => security/nss/coreconf/NEC4.2.mk
rename : security/coreconf/NetBSD.mk => security/nss/coreconf/NetBSD.mk
rename : security/coreconf/OS2.mk => security/nss/coreconf/OS2.mk
rename : security/coreconf/OSF1.mk => security/nss/coreconf/OSF1.mk
rename : security/coreconf/OSF1V3.0.mk => security/nss/coreconf/OSF1V2.0.mk
rename : security/coreconf/OSF1V3.0.mk => security/nss/coreconf/OSF1V3.0.mk
rename : security/coreconf/OSF1V3.2.mk => security/nss/coreconf/OSF1V3.2.mk
rename : security/coreconf/OSF1V4.0.mk => security/nss/coreconf/OSF1V4.0.mk
rename : security/coreconf/OSF1V4.0B.mk => security/nss/coreconf/OSF1V4.0B.mk
rename : security/coreconf/OSF1V4.0D.mk => security/nss/coreconf/OSF1V4.0D.mk
rename : security/coreconf/OSF1V5.0.mk => security/nss/coreconf/OSF1V5.0.mk
rename : security/coreconf/OSF1V5.1.mk => security/nss/coreconf/OSF1V5.1.mk
rename : security/coreconf/OpenBSD.mk => security/nss/coreconf/OpenBSD.mk
rename : security/coreconf/OpenUNIX.mk => security/nss/coreconf/OpenUNIX.mk
rename : security/coreconf/QNX.mk => security/nss/coreconf/QNX.mk
rename : security/coreconf/README => security/nss/coreconf/README
rename : security/coreconf/RISCOS.mk => security/nss/coreconf/RISCOS.mk
rename : security/coreconf/ReliantUNIX.mk => security/nss/coreconf/ReliantUNIX.mk
rename : security/coreconf/ReliantUNIX5.4.mk => security/nss/coreconf/ReliantUNIX5.4.mk
rename : security/coreconf/SCOOS5.0.mk => security/nss/coreconf/SCOOS5.0.mk
rename : security/coreconf/SCO_SV3.2.mk => security/nss/coreconf/SCO_SV3.2.mk
rename : security/coreconf/SunOS4.1.3_U1.mk => security/nss/coreconf/SunOS4.1.3_U1.mk
rename : security/coreconf/UNIX.mk => security/nss/coreconf/UNIX.mk
rename : security/coreconf/UNIXWARE2.1.mk => security/nss/coreconf/UNIXWARE2.1.mk
rename : security/coreconf/WIN95.mk => security/nss/coreconf/WIN95.mk
rename : security/coreconf/WINNT.mk => security/nss/coreconf/WINNT.mk
rename : security/coreconf/arch.mk => security/nss/coreconf/arch.mk
rename : security/coreconf/command.mk => security/nss/coreconf/command.mk
rename : security/coreconf/coreconf.pl => security/nss/coreconf/coreconf.pl
rename : security/coreconf/cpdist.pl => security/nss/coreconf/cpdist.pl
rename : security/coreconf/headers.mk => security/nss/coreconf/headers.mk
rename : security/coreconf/import.pl => security/nss/coreconf/import.pl
rename : security/coreconf/jdk.mk => security/nss/coreconf/jdk.mk
rename : security/coreconf/jniregen.pl => security/nss/coreconf/jniregen.pl
rename : security/coreconf/location.mk => security/nss/coreconf/location.mk
rename : security/coreconf/mkdepend/Makefile => security/nss/coreconf/mkdepend/Makefile
rename : security/coreconf/mkdepend/cppsetup.c => security/nss/coreconf/mkdepend/cppsetup.c
rename : security/coreconf/mkdepend/def.h => security/nss/coreconf/mkdepend/def.h
rename : security/coreconf/mkdepend/ifparser.c => security/nss/coreconf/mkdepend/ifparser.c
rename : security/coreconf/mkdepend/ifparser.h => security/nss/coreconf/mkdepend/ifparser.h
rename : security/coreconf/mkdepend/imakemdep.h => security/nss/coreconf/mkdepend/imakemdep.h
rename : security/coreconf/mkdepend/include.c => security/nss/coreconf/mkdepend/include.c
rename : security/coreconf/mkdepend/main.c => security/nss/coreconf/mkdepend/main.c
rename : security/coreconf/mkdepend/mkdepend.man => security/nss/coreconf/mkdepend/mkdepend.man
rename : security/coreconf/mkdepend/parse.c => security/nss/coreconf/mkdepend/parse.c
rename : security/coreconf/mkdepend/pr.c => security/nss/coreconf/mkdepend/pr.c
rename : security/coreconf/module.mk => security/nss/coreconf/module.mk
rename : security/coreconf/nsinstall/Makefile => security/nss/coreconf/nsinstall/Makefile
rename : security/coreconf/nsinstall/nsinstall.c => security/nss/coreconf/nsinstall/nsinstall.c
rename : security/coreconf/nsinstall/pathsub.c => security/nss/coreconf/nsinstall/pathsub.c
rename : security/coreconf/nsinstall/pathsub.h => security/nss/coreconf/nsinstall/pathsub.h
rename : security/coreconf/nsinstall/sunos4.h => security/nss/coreconf/nsinstall/sunos4.h
rename : security/coreconf/outofdate.pl => security/nss/coreconf/outofdate.pl
rename : security/coreconf/prefix.mk => security/nss/coreconf/prefix.mk
rename : security/coreconf/release.pl => security/nss/coreconf/release.pl
rename : security/coreconf/rules.mk => security/nss/coreconf/rules.mk
rename : security/coreconf/ruleset.mk => security/nss/coreconf/ruleset.mk
rename : security/coreconf/source.mk => security/nss/coreconf/source.mk
rename : security/coreconf/suffix.mk => security/nss/coreconf/suffix.mk
rename : security/coreconf/tree.mk => security/nss/coreconf/tree.mk
rename : security/coreconf/version.mk => security/nss/coreconf/version.mk
rename : security/coreconf/version.pl => security/nss/coreconf/version.pl
rename : security/dbm/config/config.mk => security/nss/lib/dbm/config/config.mk
rename : dbm/include/cdefs.h => security/nss/lib/dbm/include/cdefs.h
rename : dbm/include/extern.h => security/nss/lib/dbm/include/extern.h
rename : dbm/include/hash.h => security/nss/lib/dbm/include/hash.h
rename : dbm/include/search.h => security/nss/lib/dbm/include/hsearch.h
rename : dbm/include/mcom_db.h => security/nss/lib/dbm/include/mcom_db.h
rename : dbm/include/mpool.h => security/nss/lib/dbm/include/mpool.h
rename : dbm/include/ncompat.h => security/nss/lib/dbm/include/ncompat.h
rename : dbm/include/page.h => security/nss/lib/dbm/include/page.h
rename : dbm/include/queue.h => security/nss/lib/dbm/include/queue.h
rename : dbm/include/search.h => security/nss/lib/dbm/include/search.h
rename : dbm/include/winfile.h => security/nss/lib/dbm/include/winfile.h
rename : dbm/src/db.c => security/nss/lib/dbm/src/db.c
rename : security/dbm/src/dirent.c => security/nss/lib/dbm/src/dirent.c
rename : security/dbm/src/dirent.h => security/nss/lib/dbm/src/dirent.h
rename : dbm/src/h_bigkey.c => security/nss/lib/dbm/src/h_bigkey.c
rename : dbm/src/h_func.c => security/nss/lib/dbm/src/h_func.c
rename : dbm/src/h_log2.c => security/nss/lib/dbm/src/h_log2.c
rename : dbm/src/h_page.c => security/nss/lib/dbm/src/h_page.c
rename : dbm/src/hash.c => security/nss/lib/dbm/src/hash.c
rename : dbm/src/hash_buf.c => security/nss/lib/dbm/src/hash_buf.c
rename : dbm/src/memmove.c => security/nss/lib/dbm/src/memmove.c
rename : dbm/src/mktemp.c => security/nss/lib/dbm/src/mktemp.c
rename : dbm/src/snprintf.c => security/nss/lib/dbm/src/snprintf.c
rename : dbm/src/strerror.c => security/nss/lib/dbm/src/strerror.c
rename : dbm/tests/dbmtest.pkg => security/nss/lib/dbm/tests/dbmtest.pkg
rename : dbm/tests/lots.c => security/nss/lib/dbm/tests/lots.c
extra : rebase_source : 119dad5f824e8e760182047fd32e2a0d0f944172
extra : amend_source : 98e24aa51f9044d9091a26f013b643925e8f9dcf
2013-04-11 16:46:53 -07:00

496 lines
15 KiB
Makefile

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