Final part of Bug 668869 - port ffox work to lazily load libxul to speed up start-up perf and remove wrapper startup script - finish the Linux port which creates a thunderbird executable. Also tidy up and match the files as far as possible to Firefox's versions. The duplication of thunderbird-bin will be dealt with by bug 697218. r=gozer
authorMark Banner <bugzilla@standard8.plus.com>
Mon, 27 Feb 2012 20:46:11 +0000
changeset 9506 8fecb303de4b2ad2d01cb11f90d6764f77898620
parent 9505 f2fb318dd98befa2009d3b3f181ecaa907b052cc
child 9507 94b5ff26eda9f6a36fe51c4bf0cf98e325f98951
push id7265
push userbugzilla@standard8.plus.com
push dateMon, 27 Feb 2012 20:46:31 +0000
treeherdercomm-central@8fecb303de4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgozer
bugs668869, 697218
Final part of Bug 668869 - port ffox work to lazily load libxul to speed up start-up perf and remove wrapper startup script - finish the Linux port which creates a thunderbird executable. Also tidy up and match the files as far as possible to Firefox's versions. The duplication of thunderbird-bin will be dealt with by bug 697218. r=gozer
mail/app/Makefile.in
mail/app/nsMailApp.cpp
mail/app/profile/all-thunderbird.js
mail/app/splash.rc
mail/app/splashos2.rc
mail/confvars.sh
mail/extradependlibs.mk
mail/installer/package-manifest.in
--- a/mail/app/Makefile.in
+++ b/mail/app/Makefile.in
@@ -42,83 +42,72 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 AB_CD = $(MOZ_UI_LOCALE) 
 
 GRE_MILESTONE = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
 GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
 
-DEFINES += \
-  -DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\" \
-  -DAB_CD=$(AB_CD) \
-  -DGRE_MILESTONE=$(GRE_MILESTONE) \
-  -DGRE_BUILDID=$(GRE_BUILDID) \
-   $(NULL)
-
 MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
 endif
 
 SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
 endif
 
 ifdef MOZILLA_OFFICIAL
-DEFINES += -DOFFICIAL_BUILD=1
+DEFINES += -DMOZILLA_OFFICIAL
 endif
 
 DIRS		= profile
 
-GARBAGE += \
-	$(FINAL_TARGET)/license.html \
-	$(NULL)
-
 PREF_JS_EXPORTS = \
     $(srcdir)/profile/all-thunderbird.js \
     $(srcdir)/profile/channel-prefs.js \
     $(NULL)
 
-ifneq (,$(filter OS2 Darwin WINNT,$(OS_ARCH)))
-PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
+DEFINES += \
+  -DAB_CD=$(AB_CD) \
+  -DAPP_VERSION="$(MOZ_APP_VERSION)" \
+  -DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\" \
+  -DGRE_MILESTONE=$(GRE_MILESTONE) \
+  -DGRE_BUILDID=$(GRE_BUILDID) \
+   $(NULL)
+
+ifdef LIBXUL_SDK
+include $(topsrcdir)/config/rules.mk
 else
-PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
-endif
+# Build a binary bootstrapping with XRE_main
 
+PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX)
 
 CPPSRCS = nsMailApp.cpp
 
 DIST_FILES = application.ini
 
 LOCAL_INCLUDES += \
   -I$(MOZILLA_SRCDIR)/toolkit/xre \
   -I$(MOZILLA_SRCDIR)/xpcom/base \
   -I$(MOZILLA_SRCDIR)/xpcom/build \
   $(NULL)
 
 DEFINES += -DXPCOM_GLUE
 STL_FLAGS=
 
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-TK_LIBS := -framework Cocoa $(TK_LIBS)
-endif
-
 LIBS += \
 	$(EXTRA_DSO_LIBS) \
 	$(XPCOM_STANDALONE_GLUE_LDOPTS) \
 	$(NULL)
 
-ifdef MOZ_JPROF
-LIBS += -ljprof
-endif
-
-ifdef MOZ_ENABLE_DBUS
-LIBS += $(MOZ_DBUS_GLIB_LIBS)
+ifdef MOZ_LINKER
+LIBS += $(ZLIB_LIBS)
 endif
 
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
 MOZ_WINCONSOLE = 0
 endif
@@ -142,63 +131,61 @@ mailtoolbar = $(topsrcdir)/mail/themes/q
 # Each icon is 18x18 in the toolbar, and we want a 16x16 icon here, so we cut
 # off a pixel at each end.
 libs::
 	$(call png2ico,$(mailtoolbar),19,1,16,write-message.ico)
 	$(call png2ico,$(mailtoolbar),37,1,16,address-book.ico)
 
 GARBAGE += write-message.ico address-book.ico
 
-OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
-OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
 RCINCLUDE = splash.rc
 ifndef GNU_CC
 RCFLAGS += -DMOZ_THUNDERBIRD -I$(srcdir)
 else
 RCFLAGS += -DMOZ_THUNDERBIRD --include-dir $(srcdir)
 endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
 RESFILE=splashos2.res
 RCFLAGS += -DMOZ_THUNDERBIRD
-ifdef DEBUG
-RCFLAGS += -DDEBUG
-endif
 RCFLAGS += -DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\"
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DMOZILLA_OFFICIAL
-endif
-
-DEFINES += -DAPP_VERSION="$(MOZ_APP_VERSION)"
-
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-LIBS	+= -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 #
 # Control the default heap size.
 # This is the heap returned by GetProcessHeap().
 # As we use the CRT heap, the default size is too large and wastes VM.
 #
 # The default heap size is 1MB on Win32.
 # The heap will grow if need be.
 #
 # Set it to 256k.  See bug 127069.
 #
 ifndef GNU_CC
 LDFLAGS += /HEAP:0x40000
+ifeq ($(OS_TEST),x86_64)
+# set stack to 2MB on x64 build.  See bug 582910                                
+LDFLAGS += -STACK:2097152
+endif
 endif
 endif
 
+ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
+libs::
+	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
+
+GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, all.js all-thunderbird.js channel-prefs.js mailnews.js)
+endif # ! OS 2 or WinNT
+
+endif # LIBXUL_SDK
+
 ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT)))
 ICON_SUFFIX=.ico
 
 DESKTOP_ICONS = \
 	abcardWindow \
 	addressbookWindow \
 	msgcomposeWindow \
 	$(NULL) 
@@ -227,87 +214,88 @@ endif
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 libs::
 	$(INSTALL) $(IFLAGS1) $(DIST)/branding/default* $(DIST)/bin/chrome/icons/default
 
 install::
 	$(SYSINSTALL) $(IFLAGS1) $(DIST)/branding/default* $(DESTDIR)$(mozappdir)/chrome/icons/default
 endif
 
-ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
-ifneq (,$(filter-out Darwin,$(OS_ARCH)))
-$(MOZ_APP_NAME):: $(MOZILLA_DIR)/build/unix/mozilla.in $(GLOBAL_DEPS) $(DEPTH)/config/autoconf.mk
-	cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \
-		-e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@
-	chmod +x $@
-
-libs:: $(MOZ_APP_NAME)
-	$(INSTALL) $< $(DIST)/bin
-
-install:: $(MOZ_APP_NAME)
-	$(SYSINSTALL) $< $(DESTDIR)$(bindir)
-
-GARBAGE += $(MOZ_APP_NAME)
-else
-libs::
-	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
-
-endif # ! Mac
-GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, all.js all-thunderbird.js channel-prefs.js mailnews.js)
-endif # ! OS 2 or WinNT
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
-LIBS += -lphexlib
-endif
-
 libs:: $(srcdir)/profile/prefs.js
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
 
-libs:: blocklist.xml
+libs:: $(srcdir)/blocklist.xml
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin
 
 ifdef ENABLE_TESTS
 # XXX This is a hack to ensure that we get the right xpcshell.ini for our tests
 # and that we can share the core mozilla-central xpcshell.ini.
 # mozilla-central does this in testing/xpcshell-tests which means that it is
 # very hard for anyone to specify anything else.
 libs::
 	$(NSINSTALL) -D $(MOZDEPTH)/_tests/xpcshell
 	cp $(MOZILLA_SRCDIR)/testing/xpcshell/xpcshell.ini $(MOZDEPTH)/_tests/xpcshell/xpcshell-core.ini
 	$(INSTALL) $(topsrcdir)/mail/test/xpcshell.ini $(MOZDEPTH)/_tests/xpcshell
 	cp $(topsrcdir)/mail/test/xpcshell.ini $(MOZDEPTH)/_tests/xpcshell/all-test-dirs.list
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
-AB := $(firstword $(subst -, ,$(AB_CD)))
-
 MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)
 
 ifdef MOZ_DEBUG
 MAC_APP_NAME := $(MAC_APP_NAME)Debug
 endif
 
 LOWER_MAC_APP_NAME = $(shell echo $(MAC_APP_NAME) | tr '[A-Z]' '[a-z]')
 
-libs:: $(PROGRAM)
-	mkdir -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
-	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(MOZ_MACBUNDLE_NAME) --exclude English.lproj
-	mkdir -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
-	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
+AB_CD = $(MOZ_UI_LOCALE)
+
+AB := $(firstword $(subst -, ,$(AB_CD)))
+
+clean clobber repackage::
+	$(RM) -r $(DIST)/$(MOZ_MACBUNDLE_NAME)
+
+ifdef LIBXUL_SDK
+APPFILES = Resources
+else
+APPFILES = MacOS
+endif
+
+libs repackage:: $(PROGRAM)
+	$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
+	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(MOZ_MACBUNDLE_NAME) --exclude English.lproj
+	$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
+	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
 	sed -e "s/%APP_VERSION%/$(MOZ_APP_VERSION)/" -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" -e "s/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist
 	sed -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj/InfoPlist.strings
-	rsync -a $(DIST)/bin/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
-	rm -f $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)
+	rsync -a $(DIST)/bin/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)
+ifdef LIBXUL_SDK
+	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/thunderbird
+else
+	$(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)
 	rsync -aL $(PROGRAM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
-	mkdir -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight
+endif
+	$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight
 	rsync -a --copy-unsafe-links $(DIST)/package/Thunderbird.mdimporter $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight
 	cp -RL $(DIST)/branding/thunderbird.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/thunderbird.icns
 	printf APPLMOZM > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/PkgInfo
-#       remove CVS dirs from packaged app
-	find $(DIST)/$(MOZ_MACBUNDLE_NAME) -type d -name "CVS" -prune -exec rm -rf {} \;
+else
+ifdef LIBXUL_SDK
+libs::
+	cp $(LIBXUL_DIST)/bin/$(XULRUNNER_STUB_NAME)$(BIN_SUFFIX) $(DIST)/bin/thunderbird$(BIN_SUFFIX)
+endif
+endif
 
-clean clobber::
-	rm -rf $(DIST)/$(MOZ_MACBUNDLE_NAME)
-endif
+ifdef LIBXUL_SDK
+ifndef SKIP_COPY_XULRUNNER
+libs::
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+	rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Frameworks
+else
+	$(NSINSTALL) -D $(DIST)/bin/xulrunner
+	(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
+endif # cocoa
+endif # SKIP_COPY_XULRUNNER
+endif # LIBXUL_SDK
 
 # Note that anything you do to dist/ down here isn't going to make it into the
 # Mac build, since it's already been copied over to the .app, above.
--- a/mail/app/nsMailApp.cpp
+++ b/mail/app/nsMailApp.cpp
@@ -33,17 +33,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsXPCOMGlue.h"
 #include "nsXULAppAPI.h"
-#ifdef XP_WIN
+#if defined(XP_WIN)
 #include <windows.h>
 #include <stdlib.h>
 #elif defined(XP_UNIX)
 #include <sys/time.h>
 #include <sys/resource.h>
 #endif
 
 #ifdef XP_MACOSX
@@ -53,24 +53,21 @@
 #include <stdio.h>
 #include <stdarg.h>
 
 #include "nsCOMPtr.h"
 #include "nsILocalFile.h"
 #include "nsStringGlue.h"
 
 #ifdef XP_WIN
-// we want to use the DLL blocklist if possible
-//#define XRE_WANT_DLL_BLOCKLIST
 // we want a wmain entry point
 #include "nsWindowsWMain.cpp"
 #define snprintf _snprintf
 #define strcasecmp _stricmp
 #endif
-
 #include "BinaryPath.h"
 
 #include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
 
 #include "mozilla/Telemetry.h"
 
 static void Output(const char *fmt, ... )
 {
@@ -130,17 +127,17 @@ static int do_main(const char *exePath, 
 #else
   nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false,
                                       getter_AddRefs(appini));
 #endif
   if (NS_FAILED(rv)) {
     return 255;
   }
 
-  appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini"));
+  appini->AppendNative(NS_LITERAL_CSTRING("application.ini"));
 
   nsXREAppData *appData;
   rv = XRE_CreateAppData(appini, &appData);
   if (NS_FAILED(rv)) {
     Output("Couldn't read application.ini");
     return 255;
   }
 
@@ -188,16 +185,18 @@ int main(int argc, char* argv[])
   }
 
 
   rv = XPCOMGlueStartup(exePath);
   if (NS_FAILED(rv)) {
     Output("Couldn't load XPCOM.\n");
     return 255;
   }
+  // Reset exePath so that it is the directory name and not the xpcom dll name
+  *lastSlash = 0;
 
   rv = XPCOMGlueLoadXULFunctions(kXULFuncs);
   if (NS_FAILED(rv)) {
     Output("Couldn't load XRE functions.\n");
     return 255;
   }
 
 #ifdef XRE_HAS_DLL_BLOCKLIST
--- a/mail/app/profile/all-thunderbird.js
+++ b/mail/app/profile/all-thunderbird.js
@@ -53,17 +53,17 @@ pref("mail.biff.animate_dock_icon", fals
 #endif
 
 pref("mail.rights.version", 0);
 
 // Don't show the about:rights notification in debug or non-official builds.
 #ifdef DEBUG
 pref("mail.rights.override", true);
 #endif
-#ifndef OFFICIAL_BUILD
+#ifndef MOZILLA_OFFICIAL
 pref("mail.rights.override", true);
 #endif
 
 // gtk2 (*nix) lacks transparent/translucent drag support (bug 376238), so we
 // want to disable it so people can see where they are dragging things.
 // (Stock gtk drag icons will be used instead.)
 #ifdef MOZ_WIDGET_GTK2
 pref("nglayout.enable_drag_images", false);
--- a/mail/app/splash.rc
+++ b/mail/app/splash.rc
@@ -37,57 +37,19 @@
  * ***** END LICENSE BLOCK ***** */
 #include <windows.h>
 #include "nsNativeAppSupportWin.h"
 
 1 24 "thunderbird.exe.manifest" 
 
 STRINGTABLE DISCARDABLE
 BEGIN
-#ifdef DEBUG
-    IDS_STARTMENU_APPNAME,              "@MOZ_APP_DISPLAYNAME@ Debug"
-#else
     IDS_STARTMENU_APPNAME,              "@MOZ_APP_DISPLAYNAME@"
-#endif
 END
 
-#ifdef MOZ_STATIC_BUILD
-
-// XXX This code is copied from resource.h and widget.rc.  It's a work-around
-// for the limitation that only one resource file can be used in an .exe.  We
-// should develop a method, for static builds only, to combine multiple .rc
-// files into a single .rc file, and then use that to build the single .res
-// file for the .exe.
-
-#define IDC_GRAB                        4101
-#define IDC_GRABBING                    4102
-#define IDC_CELL                        4103
-#define IDC_COPY                        4104
-#define IDC_ALIAS                       4105
-#define IDC_ZOOMIN                      4106
-#define IDC_ZOOMOUT                     4107
-#define IDC_COLRESIZE                   4108
-#define IDC_ROWRESIZE                   4109
-#define IDC_VERTICALTEXT                4110
-#define IDC_NONE                        4112
-
-IDC_GRAB                CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/grab.cur"
-IDC_GRABBING            CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/grabbing.cur"
-IDC_CELL                CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/cell.cur"
-IDC_COPY                CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/copy.cur"
-IDC_ALIAS               CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/aliasb.cur"
-IDC_ZOOMIN              CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/zoom_in.cur"
-IDC_ZOOMOUT             CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/zoom_out.cur"
-IDC_COLRESIZE           CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/col_resize.cur"
-IDC_ROWRESIZE           CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/row_resize.cur"
-IDC_VERTICALTEXT        CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/vertical_text.cur"
-IDC_NONE                CURSOR  DISCARDABLE     "../../mozilla/widget/src/build/res/none.cur"
-
-#endif
-
 // Program icon.
 IDI_APPLICATION ICON THUNDERBIRD_ICO
 
 // For some reason IDI_MAILBIFF needs to be larger than the value of IDI_APPLICATION for static builds
 #define IDI_MAILBIFF 32576
 IDI_MAILBIFF  ICON  "../../mailnews/build/newmail.ico"
 
 // Windows taskbar icons
--- a/mail/app/splashos2.rc
+++ b/mail/app/splashos2.rc
@@ -50,29 +50,8 @@ ICON 1 THUNDERBIRD_ICO
 DLGTEMPLATE IDD_SPLASH DISCARDABLE 
 BEGIN
     DIALOG "", IDD_SPLASH, 0, 0, 390, 261, , FCF_BORDER
     BEGIN
     END
 END
 
 //BITMAP IDB_SPLASH "splash.bmp"
-
-#ifdef MOZ_STATIC_BUILD
-#include "wdgtos2rc.h"
-
-POINTER IDC_SELECTANCHOR   "..\\..\\mozilla\\widget\\src\\os2\\res\\select.ptr"
-POINTER IDC_GRAB           "..\\..\\mozilla\\widget\\src\\os2\\res\\grab.ptr"
-POINTER IDC_GRABBING       "..\\..\\mozilla\\widget\\src\\os2\\res\\grabbing.ptr"
-POINTER IDC_CELL           "..\\..\\mozilla\\widget\\src\\os2\\res\\cell.ptr"
-POINTER IDC_COPY           "..\\..\\mozilla\\widget\\src\\os2\\res\\copy.ptr"
-POINTER IDC_ALIAS          "..\\..\\mozilla\\widget\\src\\os2\\res\\aliasb.ptr"
-POINTER IDC_ZOOMIN         "..\\..\\mozilla\\widget\\src\\os2\\res\\zoom_in.ptr"
-POINTER IDC_ZOOMOUT        "..\\..\\mozilla\\widget\\src\\os2\\res\\zoom_out.ptr"
-
-POINTER IDC_ARROWWAIT      "..\\..\\mozilla\\widget\\src\\os2\\res\\arrow_wait.ptr"
-POINTER IDC_CROSS          "..\\..\\mozilla\\widget\\src\\os2\\res\\crosshair.ptr"
-POINTER IDC_HELP           "..\\..\\mozilla\\widget\\src\\os2\\res\\help.ptr"
-POINTER IDC_NONE           "..\\..\\mozilla\\widget\\src\\os2\\res\\none.ptr"
-
-ICON    IDC_DNDURL         "..\\..\\mozilla\\widget\\src\\os2\\res\\dndurl.ico"
-ICON    IDC_DNDTEXT        "..\\..\\mozilla\\widget\\src\\os2\\res\\dndtext.ico"
-#endif
--- a/mail/confvars.sh
+++ b/mail/confvars.sh
@@ -43,17 +43,16 @@ MOZ_CHROME_FILE_FORMAT=omni
 MOZ_NO_ACTIVEX_SUPPORT=1
 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
 if [ "$COMM_BUILD" ]; then
   MOZ_LDAP_XPCOM=1
 fi
 MOZ_COMPOSER=1
 MOZ_SAFE_BROWSING=1
 MOZ_MORK=1
-MOZ_STATIC_BUILD_UNSUPPORTED=1
 MOZ_APP_COMPONENT_LIBS="xpautocomplete mailcomps $MAIL_COMPONENT $LDAP_COMPONENT $MORK_COMPONENT"
 MOZ_APP_COMPONENT_MODULES="MODULE(xpAutoComplete) MODULE(nsMailCompsModule) $MAIL_MODULE $LDAP_MODULE $MORK_MODULE"
 MOZ_APP_EXTRA_LIBS="$LDAP_LIBS"
 
 MOZ_APP_VERSION_TXT=${_topsrcdir}/$MOZ_BUILD_APP/config/version.txt
 MOZ_APP_VERSION=`cat $MOZ_APP_VERSION_TXT`
 THUNDERBIRD_VERSION=$MOZ_APP_VERSION
 
new file mode 100644
--- /dev/null
+++ b/mail/extradependlibs.mk
@@ -0,0 +1,16 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this file,
+# You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This file is included from mozilla/xpcom/stub/Makefile.in
+# Presume all mozilla/autoconf.mk is included and that it does not have
+# Direct access to c-c specific vars not present there.
+
+# We don't have access to MOZ_LDAP_XPCOM here, so cheat.
+ifneq (,$(findstring ldap,$(MOZ_APP_COMPONENT_LIBS)))
+DEPENDENT_LIBS_LIST += \
+    $(DLL_PREFIX)ldap60$(DLL_SUFFIX) \
+    $(DLL_PREFIX)prldap60$(DLL_SUFFIX) \
+    $(DLL_PREFIX)ldif60$(DLL_SUFFIX) \
+    $(NULL)
+endif
--- a/mail/installer/package-manifest.in
+++ b/mail/installer/package-manifest.in
@@ -37,16 +37,17 @@
 @BINPATH@/hyphenation/*
 #ifdef XP_WIN32
 @BINPATH@/uninstall/helper.exe
 #endif
 @BINPATH@/update.locale
 @BINPATH@/updater.ini
 
 [xpcom]
+@BINPATH@/dependentlibs.list
 @BINPATH@/@DLL_PREFIX@xpcom@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@plc4@DLL_SUFFIX@
 @BINPATH@/@DLL_PREFIX@plds4@DLL_SUFFIX@
 #ifndef MOZ_STATIC_JS
 @BINPATH@/@DLL_PREFIX@mozjs@DLL_SUFFIX@
 #endif
 #ifdef XP_WIN32