diff --git a/Makefile.in b/Makefile.in index 7a9d128d8ec3..1a65d798dc68 100644 --- a/Makefile.in +++ b/Makefile.in @@ -221,3 +221,5 @@ ifeq ($(OS_TARGET)_$(TARGET_XPCOM_ABI),Linux_x86-gcc3) scheck:: @relcount=`find $(DIST)/bin -name "*.so" | xargs objdump -R | grep R_386_PC32 | wc -l` && if test $$relcount -gt 0; then echo "FAILED: R_386_PC32 relocations detected in a shared library. Did you use a system header without adding it to config/system-headers?"; exit 1; else echo "PASSED"; fi endif + +js/src/Makefile: subsrcdir := js/src diff --git a/config/rules.mk b/config/rules.mk index 33f3cd753a50..03647b6b9a48 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -1161,7 +1161,7 @@ ifndef NO_SUBMAKEFILES_RULE ifdef SUBMAKEFILES # VPATH does not work on some machines in this case, so add $(srcdir) $(SUBMAKEFILES): % : $(srcdir)/%.in - $(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $@ + $(if $(subsrcdir),cd $(subsrcdir) && )$(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir)$(addprefix /,$(subsrcdir)) -d $(DEPTH) $(@:$(subsrcdir)/%=%) endif endif diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index 33f3cd753a50..03647b6b9a48 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -1161,7 +1161,7 @@ ifndef NO_SUBMAKEFILES_RULE ifdef SUBMAKEFILES # VPATH does not work on some machines in this case, so add $(srcdir) $(SUBMAKEFILES): % : $(srcdir)/%.in - $(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $@ + $(if $(subsrcdir),cd $(subsrcdir) && )$(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir)$(addprefix /,$(subsrcdir)) -d $(DEPTH) $(@:$(subsrcdir)/%=%) endif endif