Bug 485410 - Quote jemalloc patchery a little more carefully, and make it fail if it doesn't work, r=ted
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 20 Mar 2009 10:18:45 -0700
changeset 26774 e4c426478d47101acf9761ce2dc308543aacd095
parent 26773 02e2a5fb86aa656e9951defc0717d6c260192603
child 26775 e1465ef7add6c1e7554dc767ac249b6f0285f512
push id6222
push userbsmedberg@mozilla.com
push dateTue, 31 Mar 2009 16:46:04 +0000
treeherdermozilla-central@e4c426478d47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs485410
milestone1.9.2a1pre
Bug 485410 - Quote jemalloc patchery a little more carefully, and make it fail if it doesn't work, r=ted
memory/jemalloc/Makefile.in
--- a/memory/jemalloc/Makefile.in
+++ b/memory/jemalloc/Makefile.in
@@ -57,37 +57,40 @@ ifeq (WINNT,$(OS_TARGET))
 # Two options for Windows, either you build the CRT from source,
 # or you use a pre-built DLL.
 ifneq (,$(WIN32_CRT_SRC_DIR))
 # Building the CRT from source
 CRT_OBJ_DIR=./$(shell basename "$(WIN32_CRT_SRC_DIR)")
 libs:: $(CRT_OBJ_DIR)/build/intel/mozcrt19.dll
 	$(INSTALL) $< $(FINAL_TARGET)
 
+define EXTRACT_CMD
+cd $(CRT_OBJ_DIR)/intel/$(i)_lib && lib "-extract:..\\build\\intel\\$(i)_obj\\unhandld.obj" eh.lib
+
+endef
+
 # patch if necessary
 $(CRT_OBJ_DIR)/jemalloc.c: $(srcdir)/crtsp1.diff
 	rm -rf $(CRT_OBJ_DIR)
 	cp -R "$(WIN32_CRT_SRC_DIR)" .
-	# per http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1189363&SiteID=1
-	for i in dll mt xdll xmt; do \
-	  pushd $(CRT_OBJ_DIR)/intel/$${i}_lib && lib -extract:..\\build\\intel\\$${i}_obj\\unhandld.obj eh.lib && popd; \
-	done
-	# truly awful
-	#XXX: get ed into mozillabuild, bug 415123
+# per http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1189363&SiteID=1
+	$(foreach i,dll mt xdll xmt,$(EXTRACT_CMD))
+# truly awful
+#XXX: get ed into mozillabuild, bug 415123
 	$(PERL) $(srcdir)/apply-ed-patches.pl $(srcdir)/crtsp1.diff \
 	$(CRT_OBJ_DIR) $(srcdir)/ed.exe
 
 $(CRT_OBJ_DIR)/build/intel/mozcrt19.dll: \
   $(CRT_OBJ_DIR)/jemalloc.c $(srcdir)/jemalloc.c $(srcdir)/jemalloc.h \
   $(srcdir)/ql.h $(srcdir)/qr.h $(srcdir)/rb.h
 	cp $(srcdir)/jemalloc.c $(srcdir)/jemalloc.h $(srcdir)/ql.h \
 	$(srcdir)/qr.h $(srcdir)/rb.h $(CRT_OBJ_DIR)
 # this pretty much sucks, but nmake and make don't play well together
 	$(PYTHON) $(srcdir)/build-crt.py $(CRT_OBJ_DIR)
-	#XXX: these don't link right for some reason
+#XXX: these don't link right for some reason
 	rm $(CRT_OBJ_DIR)/build/intel/{libcmt,libcpmt}.lib
 else
 # Using a pre-built DLL, so just install it.
 libs:: $(WIN32_CUSTOM_CRT_DIR)/mozcrt19.dll
 	$(INSTALL) $< $(FINAL_TARGET)
 endif
 
 else