Bug 573244 Make flight.mk for universal binaries not specific to PPC/i386 on comm-central. r=Standard8
authorNomis101@web.de
Mon, 21 Jun 2010 15:52:34 +0100
changeset 5866 b66b6eef9cb2bd6cf7b40fa851589ecf779a8b91
parent 5865 2ccca7f5586b46428559a3f740017209c8f460e9
child 5867 dc24b1578cc44ddd40239e8060631fda0f68a1f6
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs573244
Bug 573244 Make flight.mk for universal binaries not specific to PPC/i386 on comm-central. r=Standard8
build/macosx/universal/flight.mk
--- a/build/macosx/universal/flight.mk
+++ b/build/macosx/universal/flight.mk
@@ -34,22 +34,22 @@
 #
 # ***** END LICENSE BLOCK *****
 
 # BE CAREFUL!  This makefile handles a postflight_all rule for a
 # multi-project build, so DON'T rely on anything that might differ between
 # the two OBJDIRs.
 
 ifndef OBJDIR
-OBJDIR_PPC = $(MOZ_OBJDIR)/ppc
-OBJDIR_X86 = $(MOZ_OBJDIR)/i386
-DIST_PPC = $(OBJDIR_PPC)/mozilla/dist
-DIST_X86 = $(OBJDIR_X86)/mozilla/dist
-DIST_UNI = $(DIST_PPC)/universal
-OBJDIR = $(OBJDIR_PPC)
+OBJDIR_ARCH_1 = $(MOZ_OBJDIR)/$(firstword $(MOZ_BUILD_PROJECTS))
+OBJDIR_ARCH_2 = $(MOZ_OBJDIR)/$(word 2,$(MOZ_BUILD_PROJECTS))
+DIST_ARCH_1 = $(OBJDIR_ARCH_1)/mozilla/dist
+DIST_ARCH_2 = $(OBJDIR_ARCH_2)/mozilla/dist
+DIST_UNI = $(DIST_ARCH_1)/universal
+OBJDIR = $(OBJDIR_ARCH_1)
 endif
 
 include $(OBJDIR)/config/autoconf.mk
 
 DIST = $(OBJDIR)/mozilla/dist
 
 ifdef MOZ_DEBUG
 DBGTAG = Debug
@@ -68,71 +68,71 @@ APPNAME = $(MOZ_APP_DISPLAYNAME)$(DBGTAG
 INSTALLER_DIR = $(MOZ_BUILD_APP)/installer
 BUILDCONFIG_JAR = $(APP_CONTENTS)/chrome/toolkit.jar
 
 postflight_all:
 # Build the universal package out of only the bits that would be released.
 # Call the packager to set this up.  Set UNIVERSAL_BINARY= to avoid producing
 # a universal binary too early, before the unified bits have been staged.
 # Set SIGN_NSS= to skip shlibsign.
-	$(MAKE) -C $(OBJDIR_PPC)/$(INSTALLER_DIR) \
+	$(MAKE) -C $(OBJDIR_ARCH_1)/$(INSTALLER_DIR) \
 	        UNIVERSAL_BINARY= SIGN_NSS= PKG_SKIP_STRIP=1 stage-package
-	$(MAKE) -C $(OBJDIR_X86)/$(INSTALLER_DIR) \
+	$(MAKE) -C $(OBJDIR_ARCH_2)/$(INSTALLER_DIR) \
 	        UNIVERSAL_BINARY= SIGN_NSS= PKG_SKIP_STRIP=1 stage-package
 # Remove .chk files that may have been copied from the NSS build.  These will
 # cause unify to warn or fail if present.  New .chk files that are
 # appropriate for the merged libraries will be generated when the universal
 # dmg is built.
-	rm -f $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(APP_CONTENTS)/*.chk \
-	      $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(APP_CONTENTS)/*.chk
+	rm -f $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(APP_CONTENTS)/*.chk \
+	      $(DIST_ARCH_2)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(APP_CONTENTS)/*.chk
 # The only difference betewen the two trees now should be the
 # about:buildconfig page.  Fix it up.
 	$(TOPSRCDIR)/mozilla/build/macosx/universal/fix-buildconfig \
-	    $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR) \
-	    $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR)
+	  $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR) \
+	  $(DIST_ARCH_2)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR)
 	mkdir -p $(DIST_UNI)/$(MOZ_PKG_APPNAME)
-	rm -f $(DIST_X86)/universal
-	ln -s $(DIST_UNI) $(DIST_X86)/universal
+	rm -f $(DIST_ARCH_2)/universal
+	ln -s $(DIST_UNI) $(DIST_ARCH_2)/universal
 	rm -rf $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
 ifdef MOZ_CALENDAR
 ifndef DISABLE_LIGHTNING_INSTALL
 ifndef MOZ_SUNBIRD
 # workaround for different platforms in lightning installrdf
-	$(PYTHON) $(TOPSRCDIR)/build/merge-installrdf.py $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\} $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\} > $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf_
-	mv $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf_ $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf
-	cp $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf
+	$(PYTHON) $(TOPSRCDIR)/build/merge-installrdf.py $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\} $(DIST_ARCH_2)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\} > $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf_
+	mv $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf_ $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf
+	cp $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf $(DIST_ARCH_2)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf
 endif
 endif
 endif
 	$(TOPSRCDIR)/mozilla/build/macosx/universal/unify \
 	    --unify-with-sort "\.manifest$$" \
 	    --unify-with-sort "components\.list$$" \
-	    $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
-	    $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
+	    $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
+	    $(DIST_ARCH_2)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
 	    $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
 ifdef MOZ_CALENDAR
 ifndef DISABLE_LIGHTNING_INSTALL
 ifndef MOZ_SUNBIRD
-	rm $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf \
-	   $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf
+	rm $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf \
+	   $(DIST_ARCH_2)/$(MOZ_PKG_APPNAME)/$(APPNAME)/Contents/MacOS/extensions/\{e2fda1a4-762b-4020-b5ad-a41df1933103\}/install.rdf
 endif
 endif
 endif
 # A universal .dmg can now be produced by making in either architecture's
 # INSTALLER_DIR.
 # Now, repeat the process for the test package.
-	$(MAKE) -C $(OBJDIR_PPC) UNIVERSAL_BINARY= package-tests
-	$(MAKE) -C $(OBJDIR_X86) UNIVERSAL_BINARY= package-tests
+	$(MAKE) -C $(OBJDIR_ARCH_1) UNIVERSAL_BINARY= package-tests
+	$(MAKE) -C $(OBJDIR_ARCH_2) UNIVERSAL_BINARY= package-tests
 	rm -rf $(DIST_UNI)/test-package-stage
 # automation.py differs because it hardcodes a path to
 # dist/bin. It doesn't matter which one we use.
-	if test -d $(DIST_PPC)/test-package-stage -a \
-	        -d $(DIST_X86)/test-package-stage; then \
-	  cp $(DIST_PPC)/test-package-stage/mochitest/automation.py \
-	     $(DIST_X86)/test-package-stage/mochitest/; \
-	  cp $(DIST_PPC)/test-package-stage/reftest/automation.py \
-	     $(DIST_X86)/test-package-stage/reftest/; \
+	if test -d $(DIST_ARCH_1)/test-package-stage -a                 \
+                -d $(DIST_ARCH_2)/test-package-stage; then              \
+           cp $(DIST_ARCH_1)/test-package-stage/mochitest/automation.py \
+             $(DIST_ARCH_2)/test-package-stage/mochitest/;              \
+           cp $(DIST_ARCH_1)/test-package-stage/reftest/automation.py   \
+             $(DIST_ARCH_2)/test-package-stage/reftest/;                \
 	  $(TOPSRCDIR)/mozilla/build/macosx/universal/unify \
 	      --unify-with-sort "all-test-dirs\.list$$" \
-	      $(DIST_PPC)/test-package-stage \
-	      $(DIST_X86)/test-package-stage \
+	      $(DIST_ARCH_1)/test-package-stage                         \
+	      $(DIST_ARCH_2)/test-package-stage                         \
 	      $(DIST_UNI)/test-package-stage; \
 	fi