Bug 716224 - Port bug 643167 and bug 707512 for better pymake support. r=Standard8
authorJens Hatlak <jh@junetz.de>
Sat, 14 Jan 2012 12:01:26 +0100
changeset 10417 36edebf6bd3ba83ff50794d11c12cc7d5dd02830
parent 10416 22615ec6dccb16089d8d272f833905cb672ef52f
child 10418 81c392144bebfb017c254a3fad992de049dbd081
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs716224, 643167, 707512
Bug 716224 - Port bug 643167 and bug 707512 for better pymake support. r=Standard8
client.mk
--- a/client.mk
+++ b/client.mk
@@ -113,17 +113,17 @@ CONFIG_GUESS_SCRIPT := $(wildcard $(TOPS
 ifdef CONFIG_GUESS_SCRIPT
   CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
 endif
 
 
 ####################################
 # Sanity checks
 
-ifneq (,$(filter MINGW%,$(shell uname -s)))
+ifneq (,$(findstring mingw,$(CONFIG_GUESS)))
 # check for CRLF line endings
 ifneq (0,$(shell $(PERL) -e 'binmode(STDIN); while (<STDIN>) { if (/\r/) { print "1"; exit } } print "0"' < $(TOPSRCDIR)/client.mk))
 $(error This source tree appears to have Windows-style line endings. To \
 convert it to Unix-style line endings, run \
 "python mozilla/build/win32/mozilla-dos2unix.py")
 endif
 endif
 
@@ -138,16 +138,23 @@ MOZCONFIG_MODULES := build/unix/uniq.pl
 
 run_for_side_effects := \
   $(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) $(TOPSRCDIR)/.mozconfig.mk > $(TOPSRCDIR)/.mozconfig.out)
 
 include $(TOPSRCDIR)/.mozconfig.mk
 
 ifndef MOZ_OBJDIR
   MOZ_OBJDIR = obj-$(CONFIG_GUESS)
+else
+# On Windows Pymake builds check MOZ_OBJDIR doesn't start with "/"
+  ifneq (,$(findstring mingw,$(CONFIG_GUESS)))
+  ifeq (1_a,$(.PYMAKE)_$(firstword a$(subst /, ,$(MOZ_OBJDIR))))
+  $(error For Windows Pymake builds, MOZ_OBJDIR must be a Windows [and not MSYS] style path.)
+  endif
+  endif
 endif
 
 ifdef MOZ_BUILD_PROJECTS
 
 ifdef MOZ_CURRENT_PROJECT
   OBJDIR = $(MOZ_OBJDIR)/$(MOZ_CURRENT_PROJECT)
   MOZ_MAKE = $(MAKE) $(MOZ_MAKE_FLAGS) -C $(OBJDIR)
   BUILD_PROJECT_ARG = MOZ_BUILD_APP=$(MOZ_CURRENT_PROJECT)
@@ -297,16 +304,20 @@ CONFIG_STATUS_DEPS := \
 	$(TOPSRCDIR)/allmakefiles.sh \
 	$(TOPSRCDIR)/mozilla/allmakefiles.sh \
 	$(wildcard $(TOPSRCDIR)/mozilla/nsprpub/configure) \
 	$(wildcard $(TOPSRCDIR)/mozilla/config/milestone.txt) \
 	$(wildcard $(TOPSRCDIR)/ldap/sdks/c-sdk/configure) \
 	$(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \
 	$(NULL)
 
+CONFIGURE_ENV_ARGS += \
+  MAKE="$(MAKE)" \
+  $(NULL)
+
 # configure uses the program name to determine @srcdir@. Calling it without
 #   $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
 #   path of $(TOPSRCDIR).
 ifeq ($(TOPSRCDIR),$(OBJDIR))
   CONFIGURE = ./configure
 else
   CONFIGURE = $(TOPSRCDIR)/configure
 endif