Bug 1074711 - Include m-c's baseconfig.mk check to use mozmake instead of gmake, r=glandium, a=jcranmer
authorJoshua Cranmer <Pidgeot18@gmail.com>
Thu, 13 Nov 2014 21:54:31 -0600
changeset 21306 ae05d0416ab83cffa7a98523c33e08af5eef439d
parent 21305 241282428f09640709283de0722ab5eed8cda2eb
child 21307 4ad64638f1d959353f7f359442d6c15114afee9b
push idunknown
push userunknown
push dateunknown
reviewersglandium, jcranmer
bugs1074711
Bug 1074711 - Include m-c's baseconfig.mk check to use mozmake instead of gmake, r=glandium, a=jcranmer
config/baseconfig.mk
--- a/config/baseconfig.mk
+++ b/config/baseconfig.mk
@@ -1,16 +1,21 @@
 # This file is normally included by autoconf.mk, but it is also used
 # directly in python/mozbuild/mozbuild/base.py for gmake validation.
 # We thus use INCLUDED_AUTOCONF_MK to enable/disable some parts depending
 # whether a normal build is happening or whether the check is running.
 
-MOZILLA_SRCDIR = $(topsrcdir)/mozilla
+# When mach wants to know if we're to use mozmake, it runs:
+# make -f topsrcdir/config/baseconfig.mk
+# The first word of MAKEFILE_LIST is the main file we're running. Grabbing the
+# parent of that directory therefore gets us the topsrcdir of comm-central,
+# whence we get the mozilla directory to run the "real" baseconfig.mk logic.
 ifndef INCLUDED_AUTOCONF_MK
-default::
-else
+topsrcdir := $(dir $(firstword $(MAKEFILE_LIST)))..
+endif
+
+MOZILLA_SRCDIR = $(topsrcdir)/mozilla
 include $(MOZILLA_SRCDIR)/config/baseconfig.mk
-endif
 
 # WIN_TOP_SRC is converted by config.mk to mozilla-central, but this needs to be comm-central.
 ifdef WIN_TOP_SRC
 WIN_TOP_SRC := $(patsubst %/mozilla,%,$(WIN_TOP_SRC))
 endif