2007-03-22 10:30:00 -07:00
|
|
|
#
|
2012-05-21 04:12:37 -07:00
|
|
|
# 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/.
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
2014-08-06 22:21:03 -07:00
|
|
|
ifdef MOZ_BUILD_NSPR
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
# Copy NSPR to the SDK
|
2013-10-16 15:55:16 -07:00
|
|
|
ABS_DIST = $(abspath $(DIST))
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-03-16 23:53:39 -07:00
|
|
|
ifdef MOZ_FOLD_LIBS
|
|
|
|
# Trick the nspr build system into not building shared libraries.
|
|
|
|
# bug #851869.
|
|
|
|
EXTRA_MAKE_FLAGS := SHARED_LIBRARY= IMPORT_LIBRARY= SHARED_LIB_PDB=
|
|
|
|
|
|
|
|
# Work around libVersionPoint conflict between all three libraries.
|
|
|
|
# See bug #838566.
|
|
|
|
EXTRA_MAKE_FLAGS += XP_DEFINE=-DlibVersionPoint='libVersionPoint$$(LIBRARY_NAME)'
|
2013-09-09 15:12:10 -07:00
|
|
|
else
|
|
|
|
# nspr's make export compiles and links everything, but linking can't happen
|
|
|
|
# during export on platforms where nspr is linked against mozcrt/mozglue.
|
2015-05-28 00:47:19 -07:00
|
|
|
export:: EXTRA_MAKE_FLAGS += SHARED_LIBRARY= IMPORT_LIBRARY= SHARED_LIB_PDB=
|
2013-03-16 23:53:39 -07:00
|
|
|
endif
|
|
|
|
|
2015-05-28 00:47:19 -07:00
|
|
|
MOZ_BUILDID := $(shell cat $(DEPTH)/config/buildid)
|
|
|
|
|
|
|
|
# The NSPR build system uses build-time generated dates for public API
|
|
|
|
# exposed data structures. Use the buildid as forced date, to avoid
|
|
|
|
# having to deal with what changing NSPR itself might mean.
|
|
|
|
|
|
|
|
# SH_DATE is a date with the format "%Y-%m-%d %T"
|
|
|
|
EXTRA_MAKE_FLAGS += SH_DATE="$(shell $(PYTHON) -c 'd = "$(MOZ_BUILDID)"; print d[0:4]+"-"+d[4:6]+"-"+d[6:8]+" "+d[8:10]+":"+d[10:12]+":"+d[12:14]')"
|
|
|
|
|
|
|
|
# SH_NOW is a date as a unix timestamp in µseconds
|
|
|
|
EXTRA_MAKE_FLAGS += SH_NOW="$(shell $(PYTHON) -c 'import time, calendar; print calendar.timegm(time.strptime("$(MOZ_BUILDID)", "%Y%m%d%H%M%S"))')000000"
|
|
|
|
|
2014-07-24 15:14:40 -07:00
|
|
|
clean distclean export::
|
2013-03-16 23:53:39 -07:00
|
|
|
$(MAKE) -C $(DEPTH)/nsprpub $@ $(EXTRA_MAKE_FLAGS)
|
|
|
|
|
2014-07-24 15:14:40 -07:00
|
|
|
target::
|
2014-07-28 16:53:48 -07:00
|
|
|
# nspr's libs and install rule re-export headers, and that can race with other
|
|
|
|
# compilations, so use a separate directory here. The headers are exported
|
|
|
|
# during export anyways.
|
|
|
|
$(MAKE) -C $(DEPTH)/nsprpub libs $(EXTRA_MAKE_FLAGS) dist_includedir=$(ABS_DIST)/nspr-include
|
|
|
|
$(MAKE) -C $(DEPTH)/nsprpub install prefix=$(ABS_DIST)/sdk exec_prefix=$(ABS_DIST)/sdk bindir=$(ABS_DIST)/sdk/dummy includedir=$(ABS_DIST)/nspr-include libdir=$(ABS_DIST)/sdk/lib datadir=$(ABS_DIST)/sdk/dummy DESTDIR= $(EXTRA_MAKE_FLAGS)
|
2011-01-16 17:36:25 -08:00
|
|
|
$(INSTALL) $(DEPTH)/nsprpub/config/nspr-config $(DIST)/sdk/bin
|
2007-03-22 10:30:00 -07:00
|
|
|
$(RM) -rf $(DIST)/sdk/dummy
|
2014-02-10 14:57:01 -08:00
|
|
|
ifneq (,$(filter WINNT,$(OS_ARCH))) # {
|
2007-03-22 10:30:00 -07:00
|
|
|
$(RM) -f $(DIST)/sdk/lib/$(DLL_PREFIX)nspr4$(DLL_SUFFIX) $(DIST)/sdk/lib/$(DLL_PREFIX)plc4$(DLL_SUFFIX) $(DIST)/sdk/lib/$(DLL_PREFIX)plds4$(DLL_SUFFIX)
|
|
|
|
$(RM) -f $(DIST)/sdk/lib/$(LIB_PREFIX)nspr4_s.$(LIB_SUFFIX) $(DIST)/sdk/lib/$(LIB_PREFIX)plc4_s.$(LIB_SUFFIX) $(DIST)/sdk/lib/$(LIB_PREFIX)plds4_s.$(LIB_SUFFIX)
|
|
|
|
else # } {
|
|
|
|
$(RM) -f $(DIST)/sdk/lib/$(LIB_PREFIX)nspr4.$(LIB_SUFFIX) $(DIST)/sdk/lib/$(LIB_PREFIX)plc4.$(LIB_SUFFIX) $(DIST)/sdk/lib/$(LIB_PREFIX)plds4.$(LIB_SUFFIX)
|
|
|
|
endif # }
|
2014-08-06 22:21:03 -07:00
|
|
|
|
|
|
|
endif
|