Bug 1416052 - Pass TOPSRCDIR into client.mk; r=nalexander
MozReview-Commit-ID: B5TfneZRan7
--- a/client.mk
+++ b/client.mk
@@ -27,24 +27,16 @@ endif
CWD := $(CURDIR)
ifeq "$(CWD)" "/"
CWD := /.
endif
-ifndef TOPSRCDIR
-ifeq (,$(wildcard client.mk))
-TOPSRCDIR := $(patsubst %/,%,$(dir $(MAKEFILE_LIST)))
-else
-TOPSRCDIR := $(CWD)
-endif
-endif
-
PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
CONFIG_GUESS := $(shell $(TOPSRCDIR)/build/autoconf/config.guess)
####################################
# Sanity checks
# Windows checks.
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -1313,16 +1313,19 @@ class BuildDriver(MozbuildObject):
self._run_make(target='install-test-files', pass_thru=True,
print_directory=False)
else:
install_test_files(mozpath.normpath(self.topsrcdir), self.topobjdir,
'_tests', test_objs)
def _run_client_mk(self, target=None, line_handler=None, jobs=0,
verbose=None, keep_going=False, append_env=None):
+ append_env = dict(append_env or {})
+ append_env['TOPSRCDIR'] = self.topsrcdir
+
return self._run_make(srcdir=True,
filename='client.mk',
allow_parallel=False,
ensure_exit_code=False,
print_directory=False,
target=target,
line_handler=line_handler,
log=False,