Bug 825872 - Port bug 780561 - Overhaul the packager - and bug 785871 - make config.status importable. r=Standard8 CLOSED TREE
authorNomis101@web.de
Fri, 11 Jan 2013 23:12:44 +0100
changeset 14744 ead82f3bfe13bf7c748624563a81c3ccf0aef9ce
parent 14743 c7a3a5bc8a1d531fce055729125b4146d6fd62db
child 14745 32a5b24c900d17f7497bfbdc6fb4fa031a5f381a
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs825872, 780561, 785871
Bug 825872 - Port bug 780561 - Overhaul the packager - and bug 785871 - make config.status importable. r=Standard8 CLOSED TREE
Makefile.in
build/macosx/universal/flight.mk
build/macosx/universal/mozconfig.common
calendar/installer/Makefile.in
config/config.mk
configure.in
mail/installer/Makefile.in
mail/installer/removed-files.in
suite/installer/Makefile.in
suite/installer/removed-files.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -81,16 +81,16 @@ endif
 buildsymbols :: $(SUBMAKEFILES)
 	$(MAKE) -C mozilla MAKE_SYM_STORE_PATH=$(MAKE_SYM_STORE_PATH) SYM_STORE_SOURCE_DIRS="$(topsrcdir)/mozilla/extensions/inspector $(topsrcdir)/ldap/sdks $(topsrcdir)/mozilla $(topsrcdir)" $@
 
 include $(topsrcdir)/config/rules.mk
 
 # defined in (mozilla/.../)package-name.mk
 export MOZ_SOURCE_STAMP
 
-DIST_GARBAGE = config.cache config.log config.status config-defs.h \
+DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
    config/autoconf.mk \
    unallmakefiles comm-config.h \
    $(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
 
 distclean::
 	cat unallmakefiles | $(XARGS) rm -f
 	rm -f $(DIST_GARBAGE)
--- a/build/macosx/universal/flight.mk
+++ b/build/macosx/universal/flight.mk
@@ -17,68 +17,21 @@ endif
 
 topsrcdir = $(TOPSRCDIR)
 include $(OBJDIR)/config/autoconf.mk
 
 core_abspath = $(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1))
 
 DIST = $(OBJDIR)/mozilla/dist
 
-ifdef LIBXUL_SDK # {
-APP_CONTENTS = Contents/Frameworks/XUL.framework
-else # } {
-APP_CONTENTS = Contents/MacOS
-endif # } LIBXUL_SDK
-
-MOZ_PKG_APPNAME = $(MOZ_APP_NAME)
-APPNAME = $(MOZ_MACBUNDLE_NAME)
-INSTALLER_DIR = $(MOZ_BUILD_APP)/installer
-BUILDCONFIG_BASE = $(APP_CONTENTS)/chrome
-
-ifeq ($(MOZ_CHROME_FILE_FORMAT),jar)
-BUILDCONFIG = $(BUILDCONFIG_BASE)/toolkit.jar
-FIX_MODE = jar
-else
-BUILDCONFIG = $(BUILDCONFIG_BASE)/toolkit/
-FIX_MODE = file
-endif
-
 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_ARCH_1)/$(INSTALLER_DIR) \
-	        UNIVERSAL_BINARY= SIGN_NSS= PKG_SKIP_STRIP=1 stage-package
-	$(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_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 $(FIX_MODE) \
-	  $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG) \
-	  $(DIST_ARCH_2)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG)
+ifdef ENABLE_TESTS
 	mkdir -p $(DIST_UNI)/$(MOZ_PKG_APPNAME)
 	rm -f $(DIST_ARCH_2)/universal
 	ln -s $(call core_abspath,$(DIST_UNI)) $(DIST_ARCH_2)/universal
-	rm -rf $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
-	$(TOPSRCDIR)/mozilla/build/macosx/universal/unify \
-	    --unify-with-sort "\.manifest$$" \
-	    --unify-with-sort "components\.list$$" \
-	    $(DIST_ARCH_1)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
-	    $(DIST_ARCH_2)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
-	    $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
-ifdef ENABLE_TESTS
-# 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_ARCH_1) UNIVERSAL_BINARY= CHROME_JAR= package-tests
 	$(MAKE) -C $(OBJDIR_ARCH_2) UNIVERSAL_BINARY= CHROME_JAR= 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_ARCH_1)/test-package-stage -a                 \
                 -d $(DIST_ARCH_2)/test-package-stage; then              \
--- a/build/macosx/universal/mozconfig.common
+++ b/build/macosx/universal/mozconfig.common
@@ -4,16 +4,18 @@
 
 mk_add_options MOZ_UNIFY_BDATE=1
 
 mk_add_options MOZ_POSTFLIGHT_ALL+=build/macosx/universal/flight.mk
 
 DARWIN_VERSION=`uname -r`
 ac_add_app_options i386 --target=i386-apple-darwin$DARWIN_VERSION
 ac_add_app_options x86_64 --target=x86_64-apple-darwin$DARWIN_VERSION
+ac_add_app_options i386 --with-unify-dist=../x86_64/dist
+ac_add_app_options x86_64 --with-unify-dist=../i386/dist
 
 ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk
 
 . $topsrcdir/build/macosx/mozconfig.common
 
 # $MOZ_BUILD_APP is only defined when sourced by configure.  That's not a
 # problem, because the variables it affects only need to be set for
 # configure.
--- a/calendar/installer/Makefile.in
+++ b/calendar/installer/Makefile.in
@@ -73,17 +73,17 @@ endif
 
 package-compare::
 ifdef MOZ_PKG_MANIFEST_P
 	cd $(DIST); find $(PKGCOMP_FIND_OPTS) bin -type f | sort > bin-list.txt
 	grep "^bin" $(MOZ_PKG_MANIFEST) | sed -e 's/\\/\//g' | sort > $(DIST)/pack-list.txt
 	-diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 endif
 
-installer: removed-files
+installer:
 ifdef INSTALLER_DIR
 	$(MAKE) -C $(INSTALLER_DIR)
 endif
 
 make-package : removed-files-checked
 
 removed-files-checked : removed-files stage-package
 	$(PERL) $(srcdir)/check-remove-files.pl removed-files $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)
--- a/config/config.mk
+++ b/config/config.mk
@@ -683,18 +683,16 @@ RUN_TEST_PROGRAM = $(DIST)/bin/run-mozil
 endif # ! WINNT
 endif # ! OS2
 
 ifdef TIERS
 DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs))
 STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs))
 endif
 
-OPTIMIZE_JARS_CMD = $(PYTHON) $(call core_abspath,$(MOZILLA_SRCDIR)/config/optimizejars.py)
-
 CREATE_PRECOMPLETE_CMD = $(PYTHON) $(call core_abspath,$(MOZILLA_SRCDIR)/config/createprecomplete.py)
 
 # MDDEPDIR is the subdirectory where dependency files are stored
 MDDEPDIR := .deps
 
 EXPAND_LIBS = $(PYTHON) $(MOZILLA_SRCDIR)/config/expandlibs.py
 EXPAND_LIBS_EXEC = $(PYTHON) $(MOZILLA_SRCDIR)/config/expandlibs_exec.py $(if $@,--depend $(MDDEPDIR)/$(basename $(@F)).pp --target $@)
 EXPAND_LIBS_GEN = $(PYTHON) $(MOZILLA_SRCDIR)/config/expandlibs_gen.py $(if $@,--depend $(MDDEPDIR)/$(basename $(@F)).pp)
--- a/configure.in
+++ b/configure.in
@@ -763,16 +763,33 @@ from building Mozilla. Upgrade to Xcode 
 esac
 
 AC_SUBST(GCC_VERSION)
 
 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
 dnl that a universal binary is being produced.
 AC_SUBST(UNIVERSAL_BINARY)
 
+MOZ_ARG_WITH_STRING(unify-dist,
+[  --with-unify-dist=dir   Location of the dist directory to unify with at packaging time (Mac OS X universal build only)],
+    UNIFY_DIST=$withval)
+if test -n "$UNIVERSAL_BINARY"; then
+    if test -z "$UNIFY_DIST"; then
+        AC_MSG_ERROR([You need to provide the --with-unify-dist=dir argument when performing a universal build])
+    fi
+    case "$UNIFY_DIST" in
+    /*)
+        ;;
+    *)
+        UNIFY_DIST="${MOZ_BUILD_ROOT}/${UNIFY_DIST}"
+        ;;
+    esac
+fi
+AC_SUBST(UNIFY_DIST)
+
 dnl ========================================================
 dnl Check for MacOS deployment target version
 dnl ========================================================
 
 MOZ_ARG_ENABLE_STRING(macos-target,
                       [  --enable-macos-target=VER (default=10.6)
                           Set the minimum MacOS version needed at runtime],
                       [_MACOSX_DEPLOYMENT_TARGET=$enableval])
@@ -1925,16 +1942,18 @@ ia64*-hpux*)
     DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
     LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
     TARGET_MD_ARCH=os2
     _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
     RC=rc.exe
     RCFLAGS='-n'
     MOZ_USER_DIR="Mozilla"
     ZIP="$ZIP -X"
+    STRIP=lxlite
+    STRIP_FLAGS="/yua /ydd /yxd /ynl /anp /b- /cs+ /d /i- /ml1 /mr2 /mf2 /r+ /u+ /x- /zs:0 /zx /zd"
 
     if test "$MOZTOOLS"; then
         MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
     else
         AC_MSG_ERROR([MOZTOOLS is not set])
     fi
     if test -n "$MOZ_OS2_HIGH_MEMORY"; then
         DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
@@ -5438,22 +5457,29 @@ dnl Omnijar packaging is compatible with
 dnl In unpackaged builds, omnijar looks for files as if
 dnl things were flat packaged. After packaging, all files
 dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT
 dnl is set to flat since putting files into jars is only
 dnl done during packaging with omnijar.
 if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
     MOZ_OMNIJAR=1
     AC_DEFINE(MOZ_OMNIJAR)
+fi
+
+MOZ_PACKAGER_FORMAT="$MOZ_CHROME_FILE_FORMAT"
+if test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2" -o "$MOZ_WIDGET_TOOLKIT" = "android"; then
     MOZ_CHROME_FILE_FORMAT=flat
+else
+    MOZ_CHROME_FILE_FORMAT=symlink
 fi
 
 OMNIJAR_NAME=omni.ja
 AC_SUBST(OMNIJAR_NAME)
 AC_SUBST(MOZ_OMNIJAR)
+AC_SUBST(MOZ_PACKAGER_FORMAT)
 
 dnl ========================================================
 dnl = Define default location for MOZILLA_FIVE_HOME
 dnl ========================================================
 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
 [  --with-default-mozilla-five-home
                           Set the default value for MOZILLA_FIVE_HOME],
 [ val=`echo $withval`
--- a/mail/installer/Makefile.in
+++ b/mail/installer/Makefile.in
@@ -32,21 +32,17 @@ endif
 ifeq (gtk2, $(MOZ_WIDGET_TOOLKIT))
 DEFINES += -DMOZ_GTK2=1
 endif
 
 ifdef _MSC_VER
 DEFINES += -D_MSC_VER=$(_MSC_VER)
 endif
 
-ifeq ($(MOZ_CHROME_FILE_FORMAT), jar)
-DEFINES += -DJAREXT=.jar
-else
 DEFINES += -DJAREXT=
-endif
 
 ifdef MOZ_ANGLE_RENDERER
 DEFINES += -DMOZ_ANGLE_RENDERER=$(MOZ_ANGLE_RENDERER)
 DEFINES += -DMOZ_D3DX9_DLL=$(MOZ_D3DX9_DLL)
 DEFINES += -DMOZ_D3DCOMPILER_DLL=$(MOZ_D3DCOMPILER_DLL)
 endif
 
 ifdef MOZ_UPDATER
@@ -106,17 +102,17 @@ endif
 package-compare:: $(MOZ_PKG_MANIFEST)
 ifdef MOZ_PKG_MANIFEST_P
 	cd $(DIST); find $(PKGCOMP_FIND_OPTS) $(FINDPATH) -type f | sort > bin-list.txt
 	grep "^$(BINPATH)" $(MOZ_PKG_MANIFEST) | sed -e 's/^\///' | sort > $(DIST)/pack-list.txt
 	-diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 	rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 endif
 
-installer: removed-files
+installer:
 ifdef INSTALLER_DIR
 	$(MAKE) -C $(INSTALLER_DIR)
 endif
 
 APP_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
 APP_SOURCE_REPO = $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 make-sourcestamp-file::
 	@echo "$(APP_SOURCE_REPO)/rev/$(APP_SOURCE_STAMP)" >> $(MOZ_SOURCESTAMP_FILE)
--- a/mail/installer/removed-files.in
+++ b/mail/installer/removed-files.in
@@ -409,17 +409,17 @@ regxpcom.exe
   chrome/nonlocalized.manifest
   chrome/pippki.jar
   chrome/pippki.manifest
   chrome/toolkit.jar
   chrome/toolkit.manifest
   components/addonManager.js
   components/amContentHandler.js
   components/amWebInstallListener.js
-  components/components.manifest
+  components/binary.manifest
   components/ConsoleAPI.js
   components/contentAreaDropListener.js
   components/contentSecurityPolicy.js
   components/crypto-SDR.js
   components/FeedProcessor.js
   components/glautocomp.js
   components/GPSDGeolocationProvider.js
   components/interfaces.manifest
--- a/suite/installer/Makefile.in
+++ b/suite/installer/Makefile.in
@@ -26,21 +26,17 @@ MOZ_NONLOCALIZED_PKG_LIST = \
 	$(NULL)
 
 MOZ_LOCALIZED_PKG_LIST = \
 	$(AB_CD) \
 	$(NULL)
 
 DEFINES += -DAB_CD=$(AB_CD) -DMOZ_APP_NAME=$(MOZ_APP_NAME) -DPREF_DIR=$(PREF_DIR)
 
-ifeq ($(MOZ_CHROME_FILE_FORMAT), jar)
-DEFINES += -DJAREXT=.jar
-else
 DEFINES += -DJAREXT=
-endif
 
 ifdef ENABLE_TESTS
 DEFINES += -DENABLE_TESTS=1
 endif
 
 ifdef LIBXUL_SDK
 DEFINES += -DLIBXUL_SDK=1
 endif
@@ -175,17 +171,17 @@ endif
 package-compare:: $(MOZ_PKG_MANIFEST)
 ifdef MOZ_PKG_MANIFEST_P
 	cd $(DIST); find $(PKGCOMP_FIND_OPTS) $(FINDPATH) -type f | sort > bin-list.txt
 	grep "^$(BINPATH)" $(MOZ_PKG_MANIFEST) | sed -e 's/^\///' | sort > $(DIST)/pack-list.txt
 	-diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 	rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 endif
 
-installer: removed-files
+installer:
 ifdef INSTALLER_DIR
 	$(MAKE) -C $(INSTALLER_DIR)
 endif
 
 APP_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
 APP_SOURCE_REPO = $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 make-sourcestamp-file::
 	@echo "$(APP_SOURCE_REPO)/rev/$(APP_SOURCE_STAMP)" >> $(MOZ_SOURCESTAMP_FILE)
--- a/suite/installer/removed-files.in
+++ b/suite/installer/removed-files.in
@@ -710,17 +710,17 @@ xpicleanup@BIN_SUFFIX@
   components/storage-Legacy.js
   components/storage-mozStorage.js
   components/TCPSocket.js
   components/txEXSLTRegExFunctions.js
   components/Weave.js
   components/Webapps.js
   components/WebContentConverter.js
   components/browser.xpt
-  components/components.manifest
+  components/binary.manifest
   components/interfaces.manifest
   components/mail.xpt
   defaults/profile/bookmarks.html
   defaults/profile/mimeTypes.rdf
   defaults/profile/chrome/
   defaults/profile/chrome/userChrome-example.css
   defaults/profile/chrome/userContent-example.css
   defaults/pref/browser-prefs.js