config/external/nspr/Makefile.in
author Mike Hommey <mh+mozilla@glandium.org>
Thu, 07 Aug 2014 02:58:52 +0900
changeset 198222 5bf969f77c3de125f00c3d64d62c1adc16a8501a
parent 196475 config/nspr/Makefile.in@87663bfc852445a67a3a637ba68df039e3777cc3
child 198275 6b285759568cb0b743cb9497e021f6552cc7e349
permissions -rw-r--r--
Bug 1049281 - Move third-party build system "drivers" to config/external, and stop using static dirs. r=gps

#
# 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/.

include $(topsrcdir)/config/rules.mk

ifdef LIBXUL_SDK
$(error config/external/nspr/Makefile.in is not compatible with --enable-libxul-sdk=)
endif
ifdef MOZ_NATIVE_NSPR
$(error config/external/nspr/Makefile.in is not compatible with MOZ_NATIVE_NSPR)
endif

# Copy NSPR to the SDK
ABS_DIST = $(abspath $(DIST))

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)'
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.
export:: EXTRA_MAKE_FLAGS := SHARED_LIBRARY= IMPORT_LIBRARY= SHARED_LIB_PDB=
endif

clean distclean export::
	$(MAKE) -C $(DEPTH)/nsprpub $@ $(EXTRA_MAKE_FLAGS)

target::
# 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)
	$(INSTALL) $(DEPTH)/nsprpub/config/nspr-config $(DIST)/sdk/bin
	$(RM) -rf $(DIST)/sdk/dummy
ifneq (,$(filter WINNT,$(OS_ARCH))) # {
	$(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 # }