Bug 673083 - Create a buildsymbols target for Lightning. r=Fallen,a=Standard8
authorMark Banner <bugzilla@standard8.plus.com>
Fri, 09 Sep 2011 16:38:01 +0100
changeset 8442 c32f3ca7db265b102cee0831cd6fc4f2f02a668c
parent 8437 fe74f461b4b8357818fa289765b2ae053b3237fb
child 8443 fe8402fdeb163f73cb534b3085d120d7b735dcda
push idunknown
push userunknown
push dateunknown
reviewersFallen, Standard8
bugs673083
Bug 673083 - Create a buildsymbols target for Lightning. r=Fallen,a=Standard8
calendar/lightning/Makefile.in
calendar/lightning/lightning-symbols.mk
calendar/providers/gdata/Makefile.in
calendar/timezones/Makefile.in
--- a/calendar/lightning/Makefile.in
+++ b/calendar/lightning/Makefile.in
@@ -39,25 +39,27 @@
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
+# Calendar builders currently use STRIP_XPI to reduce the binary component in
+# Lightning.
+
 MODULE		= lightning
 
 export XPI_NAME = lightning
 export USE_EXTENSION_MANIFEST = 1
 XPI_PKGNAME = lightning
 
 XPI_EM_ID = {e2fda1a4-762b-4020-b5ad-a41df1933103}
 
-STRIP_XPI = 1
 DIST_FILES = install.rdf application.ini
 PREF_JS_EXPORTS = $(srcdir)/content/lightning.js
 
 # Lighting version number
 LIGHTNING_VERSION := $(shell cat $(srcdir)/../sunbird/config/version.txt)
 THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
 SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
 
@@ -159,8 +161,10 @@ ident:
 	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
 	    $(FINAL_TARGET)/application.ini App SourceStamp
 	@printf "moz_revision "
 	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
 	    $(FINAL_TARGET)/application.ini Build SourceStamp
 	@printf "buildid "
 	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
 	    $(FINAL_TARGET)/application.ini App BuildID
+
+include $(srcdir)/lightning-symbols.mk
new file mode 100644
--- /dev/null
+++ b/calendar/lightning/lightning-symbols.mk
@@ -0,0 +1,74 @@
+###################################
+# Warning this code is copied
+# from mozilla-central/Makefile.in
+# and needs to be kept in sync.
+###################################
+SYMBOL_INDEX_NAME = \
+   $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
+
+include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
+
+ifeq ($(OS_ARCH),WINNT)
+# we want to copy PDB files on Windows
+MAKE_SYM_STORE_ARGS := -c --vcs-info
+ifdef PDBSTR_PATH
+MAKE_SYM_STORE_ARGS += -i
+endif
+DUMP_SYMS_BIN ?= $(topsrcdir)/toolkit/crashreporter/tools/win32/dump_syms_vc$(_MSC_VER).exe
+# PDB files don't get moved to dist, so we need to scan the whole objdir
+MAKE_SYM_STORE_PATH := .
+endif
+ifeq ($(OS_ARCH),Darwin)
+# need to pass arch flags for universal builds
+ifdef UNIVERSAL_BINARY
+MAKE_SYM_STORE_ARGS := -c -a "i386 x86_64" --vcs-info
+MAKE_SYM_STORE_PATH := $(DIST)/universal/xpi-stage/lightning
+else
+MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST) --vcs-info
+MAKE_SYM_STORE_PATH := $(DIST)/xpi-stage/lightning
+endif
+DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
+endif
+ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
+MAKE_SYM_STORE_ARGS := -c --vcs-info
+DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
+MAKE_SYM_STORE_PATH := $(DIST)/bin
+endif
+
+SYM_STORE_SOURCE_DIRS := $(topsrcdir)
+
+buildsymbols:
+ifdef MOZ_CRASHREPORTER
+ifdef USE_ELF_HACK
+	$(MAKE) -C $(MOZ_BUILD_APP)/installer elfhack
+endif
+	echo building symbol store
+	$(RM) -r $(DIST)/crashreporter-symbols
+	$(RM) "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
+	$(NSINSTALL) -D $(DIST)/crashreporter-symbols
+	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/crashreporter/tools/symbolstore.py \
+	  $(MAKE_SYM_STORE_ARGS)                                          \
+	  $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir))               \
+	  $(DUMP_SYMS_BIN)                                                \
+	  $(DIST)/crashreporter-symbols                                   \
+	  $(MAKE_SYM_STORE_PATH) >                                        \
+	  $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
+	echo packing symbols
+	$(NSINSTALL) -D $(DIST)/$(PKG_PATH)
+	cd $(DIST)/crashreporter-symbols && \
+          zip -r9D "../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip" .
+	cd $(DIST)/crashreporter-symbols && \
+	grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
+	  mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
+	cd $(DIST)/crashreporter-symbols && \
+          zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"
+endif # MOZ_CRASHREPORTER
+
+uploadsymbols:
+ifdef MOZ_CRASHREPORTER
+	$(SHELL) $(MOZILLA_SRCDIR)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
+endif
+
+###################################
+# END Warning
+###################################
--- a/calendar/providers/gdata/Makefile.in
+++ b/calendar/providers/gdata/Makefile.in
@@ -42,17 +42,16 @@ VPATH = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = gdata-provider
 
 export USE_EXTENSION_MANIFEST = 1
 export XPI_NAME = gdata-provider
 DIST_FILES = install.rdf
 XPI_PKGNAME = gdata-provider
-STRIP_XPI = 1
 
 CALENDAR_VERSION := $(shell cat $(topsrcdir)/calendar/sunbird/config/version.txt)
 THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
 SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
 DEFINES += -DAB_CD=$(AB_CD) \
            -DCALENDAR_VERSION=$(CALENDAR_VERSION) \
            -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
            -DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
--- a/calendar/timezones/Makefile.in
+++ b/calendar/timezones/Makefile.in
@@ -61,17 +61,16 @@ VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = timezones
 export USE_EXTENSION_MANIFEST = 1
 export XPI_NAME = calendar-timezones
 DIST_FILES = install.rdf
 XPI_PKGNAME = calendar-timezones
-STRIP_XPI = 1
 
 PREF_JS_EXPORTS = $(srcdir)/defaults/preferences.js
 DIRS = locales
 
 ifndef DISABLE_LIGHTNING_INSTALL
 # install as a global extension in dist/bin/extensions/
 INSTALL_EXTENSION_ID = calendar-timezones@mozilla.org
 endif