Bug 668058 - Add a DIR_INSTALL command and allow NSDISTMODE to be target-specific. r=Callek
authorSiddharth Agarwal <sid.bugzilla@gmail.com>
Wed, 13 Jul 2011 00:30:11 -0700
changeset 8560 4579fdf3d43674cc5774113a1e5a4a0b1df3c307
parent 8559 004c3d95bb3e6c85c5fcc898bb21132a68824147
child 8561 7c0c838f516de331f7aca8ecba0707906920fd92
push id158
push userbugzilla@standard8.plus.com
push dateTue, 27 Sep 2011 19:18:14 +0000
treeherdercomm-beta@e47b99c61e4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek
bugs668058
Bug 668058 - Add a DIR_INSTALL command and allow NSDISTMODE to be target-specific. r=Callek
config/config.mk
config/rules.mk
--- a/config/config.mk
+++ b/config/config.mk
@@ -621,41 +621,43 @@ NSINSTALL	= $(CYGWIN_WRAPPER) $(NSINSTAL
 else
 ifeq (OS2,$(CROSS_COMPILE)$(OS_ARCH))
 NSINSTALL	= $(MOZ_TOOLS_DIR)/nsinstall
 else
 NSINSTALL	= $(CONFIG_TOOLS)/nsinstall$(HOST_BIN_SUFFIX)
 endif # OS2
 endif # NSINSTALL_BIN
 
-
 ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2, $(OS_ARCH)))
 INSTALL		= $(NSINSTALL)
 else
-ifeq ($(NSDISTMODE),copy)
-# copy files, but preserve source mtime
-INSTALL		= $(NSINSTALL) -t
-else
-ifeq ($(NSDISTMODE),absolute_symlink)
-# install using absolute symbolic links
+
 ifeq ($(OS_ARCH),Darwin)
-INSTALL		= $(NSINSTALL) -L $(PWD)
-else
-INSTALL		= $(NSINSTALL) -L `$(NFSPWD)`
-endif # Darwin
+INSTALL_PWD     = $(PWD)
 else
-# install using relative symbolic links
-INSTALL		= $(NSINSTALL) -R
-endif # absolute_symlink
-endif # copy
+INSTALL_PWD     = `$(NFSPWD)`
+endif # Darwin
+
+# This isn't laid out as conditional directives so that NSDISTMODE can be
+# target-specific.
+INSTALL         = $(if $(filter copy, $(NSDISTMODE)), $(NSINSTALL) -t, $(if $(filter absolute_symlink, $(NSDISTMODE)), $(NSINSTALL) -L $(INSTALL_PWD), $(NSINSTALL) -R))
+
 endif # WINNT/OS2
 
 # Use nsinstall in copy mode to install files on the system
 SYSINSTALL	= $(NSINSTALL) -t
 
+# Directory nsinstall. Windows and OS/2 nsinstall can't recursively copy
+# directories.
+ifneq (,$(filter WINNT os2-emx,$(HOST_OS_ARCH)))
+DIR_INSTALL = $(PYTHON) $(MOZILLA_SRCDIR)/config/nsinstall.py
+else
+DIR_INSTALL = $(INSTALL)
+endif # WINNT
+
 ifeq ($(OS_ARCH),WINNT)
 ifneq (,$(CYGDRIVE_MOUNT))
 export CYGDRIVE_MOUNT
 endif
 endif
 
 #
 # Localization build automation
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -148,26 +148,18 @@ ifdef ENABLE_TESTS
 
 ifdef XPCSHELL_TESTS
 ifndef relativesrcdir
 $(error Must define relativesrcdir when defining XPCSHELL_TESTS.)
 endif
 
 testxpcobjdir = $(MOZDEPTH)/_tests/xpcshell
 
-# Test file installation
-ifneq (,$(filter WINNT os2-emx,$(HOST_OS_ARCH)))
-# Windows and OS/2 nsinstall can't recursively copy directories, so use nsinstall.py
-TEST_INSTALLER = $(PYTHON) $(MOZILLA_SRCDIR)/config/nsinstall.py
-else
-TEST_INSTALLER = $(INSTALL)
-endif
-
 define _INSTALL_TESTS
-$(TEST_INSTALLER) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(relativesrcdir)/$(dir)
+$(DIR_INSTALL) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(relativesrcdir)/$(dir)
 
 endef # do not remove the blank line!
 
 SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-interactive or check-one)
 
 libs::
 	$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
 	$(PYTHON) $(MOZILLA_DIR)/build/xpccheck.py \