diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/installer/Makefile.in comm-1.9.1/calendar/installer/Makefile.in
--- comm-1.9.1.orig/calendar/installer/Makefile.in	2010-11-26 07:22:12 +0900
+++ comm-1.9.1/calendar/installer/Makefile.in	2010-11-30 03:10:22 +0900
@@ -67,8 +67,6 @@
 # MOZ_PKG_MANIFEST_P = $(srcdir)/unix/packages-static
 # endif
 endif
-else
-$(error you need a "--enable-static --disable-shared" build to create an installer)
 endif
 
 MOZ_NONLOCALIZED_PKG_LIST = \
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/installer/removed-files.in comm-1.9.1/calendar/installer/removed-files.in
--- comm-1.9.1.orig/calendar/installer/removed-files.in	2010-11-26 07:22:12 +0900
+++ comm-1.9.1/calendar/installer/removed-files.in	2010-11-30 03:10:22 +0900
@@ -80,7 +80,6 @@
 chrome/help.jar
 chrome/pipnss.jar
 components/browser.xpt
-components/feedProcessor.js
 components/nsSetDefaultBrowser.js
 defaults/profile/mimeTypes.rdf
 extensions/{8af2d0a7-e394-4de2-ae55-2dae532a7a9b}/install.rdf
@@ -96,139 +95,26 @@
 #
 chrome/chromelist.txt
 components/@DLL_PREFIX@webdav@DLL_SUFFIX@
-components/accessibility-msaa.xpt
-components/accessibility.xpt
-components/alerts.xpt
-components/appshell.xpt
-components/appstartup.xpt
 components/autocomplete.xpt
-components/autoconfig.xpt
 components/bookmarks.xpt
-components/calbase.xpt
-components/calbaseinternal.xpt
-components/caps.xpt
-components/chardet.xpt
-components/chrome.xpt
-components/commandhandler.xpt
-components/commandlines.xpt
-components/composer.xpt
-components/content_base.xpt
-components/content_html.xpt
-components/content_htmldoc.xpt
-components/content_xmldoc.xpt
-components/content_xslt.xpt
-components/content_xtf.xpt
-components/docshell_base.xpt
-components/dom.xpt
-components/dom_base.xpt
-components/dom_canvas.xpt
-components/dom_core.xpt
-components/dom_css.xpt
-components/dom_events.xpt
-components/dom_html.xpt
-components/dom_loadsave.xpt
-components/dom_offline.xpt
-components/dom_range.xpt
-components/dom_sidebar.xpt
-components/dom_stylesheets.xpt
-components/dom_svg.xpt
-components/dom_traversal.xpt
-components/dom_views.xpt
-components/dom_xbl.xpt
-components/dom_xpath.xpt
-components/dom_xul.xpt
-components/downloads.xpt
-components/editor.xpt
-components/embed_base.xpt
-components/extensions.xpt
-components/exthandler.xpt
-components/fastfind.xpt
-components/feeds.xpt
-components/find.xpt
-components/gfx.xpt
 components/gksvgrenderer.xpt
 components/history.xpt
-components/htmlparser.xpt
-components/imgicon.xpt
-components/imglib2.xpt
-components/intl.xpt
 components/intlcmpt.xpt
-components/jar.xpt
 components/jsconsole.xpt
-components/jsdservice.xpt
-components/layout_base.xpt
-components/layout_printing.xpt
-components/layout_xul.xpt
-components/layout_xul_tree.xpt
-components/locale.xpt
-components/lwbrk.xpt
-components/mimetype.xpt
 #ifndef MOZILLA_1_9_1_BRANCH
 components/mozbrwsr.xpt
 #endif
-components/mozfind.xpt
-components/necko.xpt
-components/necko_about.xpt
-components/necko_cache.xpt
-components/necko_cookie.xpt
 components/necko_data.xpt
-components/necko_dns.xpt
-components/necko_file.xpt
-components/necko_ftp.xpt
-components/necko_http.xpt
-components/necko_res.xpt
-components/necko_socket.xpt
-components/necko_strconv.xpt
-components/necko_viewsource.xpt
 components/nsSetDefaultMail.js 
 components/nsUnsetDefaultMail.js
 components/oji.xpt
 components/passwordmgr.xpt
-components/pipboot.xpt
-components/pipnss.xpt
-components/pippki.xpt
-components/plugin.xpt
-components/pref.xpt
-components/prefetch.xpt
-components/profile.xpt
 components/progressDlg.xpt
-components/proxyObject.xpt
-components/rdf.xpt
-components/satchel.xpt
-components/saxparser.xpt
-components/shistory.xpt
-components/storage.xpt
-components/toolkitprofile.xpt
-components/txmgr.xpt
-components/txtsvc.xpt
-components/uconv.xpt
-components/unicharutil.xpt
-components/update.xpt
-components/uriloader.xpt
-components/webbrowserpersist.xpt
-components/webBrowser_core.xpt
 components/webdav.xpt
-components/webshell_idls.xpt
 components/websrvcs.xpt
-components/widget.xpt
-components/windowds.xpt
-components/windowwatcher.xpt
 components/winhooks.xpt
 components/xmlextras.xpt
-components/xpautocomplete.xpt
-components/xpcom_base.xpt
-components/xpcom_components.xpt
-components/xpcom_ds.xpt
-components/xpcom_io.xpt
 components/xpcom_obsolete.xpt
-components/xpcom_thread.xpt
-components/xpcom_xpti.xpt
-components/xpconnect.xpt
-components/xpinstall.xpt
-components/xulapp.xpt
-components/xuldoc.xpt
-components/xultmpl.xpt
-plugins/npnul32.dll
 res/dtd/mathml.dtd
 res/dtd/mathml20.properties
 res/entityTables/mathml20.properties
@@ -264,7 +150,6 @@
 res/table-remove-row-hover.gif
 res/table-remove-row.gif
 res/viewer.properties
-dependentlibs.list
 mozctl.dll
 mozctlx.dll
 regxpcom.exe
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/lightning/content/lightning.js comm-1.9.1/calendar/lightning/content/lightning.js
--- comm-1.9.1.orig/calendar/lightning/content/lightning.js	2010-11-26 07:22:12 +0900
+++ comm-1.9.1/calendar/lightning/content/lightning.js	2010-11-30 03:10:22 +0900
@@ -146,3 +146,4 @@
 
 // Set up user agent
 #expand pref("general.useragent.extra.lightning","Lightning/__LIGHTNING_VERSION__");
+pref("general.useragent.extra.lightning.rayflood", "(rayflood)");
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/lightning/install.rdf comm-1.9.1/calendar/lightning/install.rdf
--- comm-1.9.1.orig/calendar/lightning/install.rdf	2010-11-26 07:22:12 +0900
+++ comm-1.9.1/calendar/lightning/install.rdf	2010-11-30 03:10:22 +0900
@@ -12,7 +12,7 @@
         <!-- thunderbird -->
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
         <em:minVersion>3.0b4pre</em:minVersion>
-        <em:maxVersion>@THUNDERBIRD_VERSION@</em:maxVersion>
+        <em:maxVersion>3.0.*</em:maxVersion>
       </Description>
     </em:targetApplication>
 
@@ -35,7 +35,7 @@
         <!-- seamonkey -->
         <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
         <em:minVersion>2.0b2</em:minVersion>
-        <em:maxVersion>@SEAMONKEY_VERSION@</em:maxVersion>
+        <em:maxVersion>2.0.*</em:maxVersion>
       </Description>
     </em:targetApplication>
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/providers/gdata/Makefile.in comm-1.9.1/calendar/providers/gdata/Makefile.in
--- comm-1.9.1.orig/calendar/providers/gdata/Makefile.in	2010-11-26 07:22:12 +0900
+++ comm-1.9.1/calendar/providers/gdata/Makefile.in	2010-11-30 03:10:22 +0900
@@ -48,6 +48,7 @@
 DIST_FILES = install.rdf
 XPI_PKGNAME = gdata-provider
 STRIP_XPI = 1
+INSTALL_EXTENSION_ID = {a62ef8ec-5fdc-40c2-873c-223b8a6925cc}
 
 CALENDAR_VERSION := $(shell cat $(topsrcdir)/calendar/sunbird/config/version.txt)
 ifdef MOZILLA_1_9_1_BRANCH
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/providers/gdata/install.rdf comm-1.9.1/calendar/providers/gdata/install.rdf
--- comm-1.9.1.orig/calendar/providers/gdata/install.rdf	2010-11-26 07:22:12 +0900
+++ comm-1.9.1/calendar/providers/gdata/install.rdf	2010-11-30 03:10:22 +0900
@@ -59,15 +59,15 @@
         <!-- Thunderbird -->
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
         <em:minVersion>3.0b3</em:minVersion>
-        <em:maxVersion>@THUNDERBIRD_VERSION@</em:maxVersion>
+        <em:maxVersion>3.0.*</em:maxVersion>
       </Description>
     </em:targetApplication>
     <em:targetApplication>
       <Description>
         <!-- SeaMonkey -->
         <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
-        <em:minVersion>@SEAMONKEY_VERSION@</em:minVersion>
-        <em:maxVersion>@SEAMONKEY_VERSION@</em:maxVersion>
+        <em:minVersion>2.0b2</em:minVersion>
+        <em:maxVersion>2.0.*</em:maxVersion>
       </Description>
     </em:targetApplication>
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/sunbird/app/Makefile.in comm-1.9.1/calendar/sunbird/app/Makefile.in
--- comm-1.9.1.orig/calendar/sunbird/app/Makefile.in	2010-11-26 07:22:12 +0900
+++ comm-1.9.1/calendar/sunbird/app/Makefile.in	2010-11-30 03:10:22 +0900
@@ -168,6 +168,7 @@
 # Always enter a Windows program through wmain, whether or not we're
 # a console application.
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
+WIN7_MANIFEST = 1
 endif
 
 ifndef BUILD_STATIC_LIBS
@@ -309,7 +310,7 @@
 
 ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
 
-APP_NAME = $(MOZ_APP_DISPLAYNAME)
+APP_NAME = $(MOZ_APP_NAME)
 
 ifdef MOZ_DEBUG
 APP_NAME := $(APP_NAME)Debug
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/sunbird/app/profile/sunbird.js comm-1.9.1/calendar/sunbird/app/profile/sunbird.js
--- comm-1.9.1.orig/calendar/sunbird/app/profile/sunbird.js	2010-11-26 07:22:12 +0900
+++ comm-1.9.1/calendar/sunbird/app/profile/sunbird.js	2010-11-30 03:10:22 +0900
@@ -216,6 +216,7 @@
 pref("general.useragent.locale", "@AB_CD@");
 pref("general.skins.selectedSkin", "classic/1.0");
 pref("general.useragent.extra.sunbird", "@APP_UA_NAME@/@APP_VERSION@");
+pref("general.useragent.extra.sunbird.rayflood", "(rayflood)");
 
 // Scripts & Windows prefs
 pref("dom.disable_open_during_load",        true);
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/sunbird/branding/nightly/branding.nsi comm-1.9.1/calendar/sunbird/branding/nightly/branding.nsi
--- comm-1.9.1.orig/calendar/sunbird/branding/nightly/branding.nsi	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/calendar/sunbird/branding/nightly/branding.nsi	2010-11-30 03:10:22 +0900
@@ -36,11 +36,11 @@
 
 # NSIS defines for nightly builds.
 # The release build branding.nsi is located in other-licenses/branding/sunbird/
-!define BrandShortName        "Calendar"
-!define BrandFullName         "Calendar"
+!define BrandShortName        "sunbird"
+!define BrandFullName         "sunbird"
 # BrandFullNameInternal is used for some registry and file system values that
 # should not contain release that may be in the BrandFullName (e.g. Beta 1, etc.)
-!define BrandFullNameInternal "Mozilla Sunbird"
+!define BrandFullNameInternal "sunbird"
 !define CompanyName           "Mozilla"
 !define URLInfoAbout          "http://www.mozilla.org/"
 !define URLUpdateInfo         "http://www.mozilla.org/projects/calendar/sunbird/"
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/sunbird/branding/nightly/configure.sh comm-1.9.1/calendar/sunbird/branding/nightly/configure.sh
--- comm-1.9.1.orig/calendar/sunbird/branding/nightly/configure.sh	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/calendar/sunbird/branding/nightly/configure.sh	2010-11-30 03:10:23 +0900
@@ -1 +1 @@
-MOZ_APP_DISPLAYNAME=Calendar
+MOZ_APP_DISPLAYNAME=Sunbird
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/sunbird/branding/nightly/locales/en-US/brand.dtd comm-1.9.1/calendar/sunbird/branding/nightly/locales/en-US/brand.dtd
--- comm-1.9.1.orig/calendar/sunbird/branding/nightly/locales/en-US/brand.dtd	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/calendar/sunbird/branding/nightly/locales/en-US/brand.dtd	2010-11-30 03:10:23 +0900
@@ -1,2 +1,2 @@
-<!ENTITY  brandShortName        "Calendar">
-<!ENTITY  brandFullName         "Calendar">
+<!ENTITY  brandShortName        "sunbird">
+<!ENTITY  brandFullName         "sunbird">
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/sunbird/branding/nightly/locales/en-US/brand.properties comm-1.9.1/calendar/sunbird/branding/nightly/locales/en-US/brand.properties
--- comm-1.9.1.orig/calendar/sunbird/branding/nightly/locales/en-US/brand.properties	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/calendar/sunbird/branding/nightly/locales/en-US/brand.properties	2010-11-30 03:10:23 +0900
@@ -1,5 +1,5 @@
-brandShortName=Calendar
-brandFullName=Calendar
+brandShortName=sunbird
+brandFullName=sunbird
 vendorShortName=Mozilla
 
 # LOCALIZATION NOTE (releaseNotesURL):
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/calendar/sunbird/config/version.txt comm-1.9.1/calendar/sunbird/config/version.txt
--- comm-1.9.1.orig/calendar/sunbird/config/version.txt	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/calendar/sunbird/config/version.txt	2010-11-30 03:10:23 +0900
@@ -1 +1 @@
-1.0b2pre
+1.0b1
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/client.mk comm-1.9.1/client.mk
--- comm-1.9.1.orig/client.mk	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/client.mk	2010-11-30 03:10:23 +0900
@@ -131,7 +131,7 @@
 MOZCONFIG_MODULES := mozilla/build/unix/uniq.pl
 
 run_for_side_effects := \
-  $(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) $(TOPSRCDIR)/.mozconfig.mk > $(TOPSRCDIR)/.mozconfig.out)
+  $(shell $(CONFIG_SHELL) $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) $(TOPSRCDIR)/.mozconfig.mk > $(TOPSRCDIR)/.mozconfig.out)
 
 include $(TOPSRCDIR)/.mozconfig.mk
 
@@ -189,6 +189,29 @@
 # Do everything from scratch
 everything: clean build
 
+####################################
+# Profile-Guided Optimization
+#  To use this, you should set the following variables in your mozconfig
+#    mk_add_options PROFILE_GEN_SCRIPT=/path/to/profile-script
+#
+#  The profile script should exercise the functionality to be included
+#  in the profile feedback.
+#
+#  This is up here, outside of the MOZ_CURRENT_PROJECT logic so that this
+#  is usable in multi-pass builds, where you might not have a runnable
+#  application until all the build passes and postflight scripts have run.
+ifdef MOZ_OBJDIR
+  PGO_OBJDIR = $(MOZ_OBJDIR)
+else
+  PGO_OBJDIR := $(TOPSRCDIR)
+endif
+
+profiledbuild::
+	$(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_GENERATE=1
+	OBJDIR=${PGO_OBJDIR} $(PROFILE_GEN_SCRIPT)
+	$(MAKE) -f $(TOPSRCDIR)/client.mk maybe_clobber_profiledbuild
+	$(MAKE) -f $(TOPSRCDIR)/client.mk build MOZ_PROFILE_USE=1
+
 #####################################################
 # Build date unification
 
@@ -285,8 +308,8 @@
 endif
 	@if test ! -d $(OBJDIR); then $(MKDIR) $(OBJDIR); else true; fi
 	@echo cd $(OBJDIR);
-	@echo $(CONFIGURE) $(CONFIGURE_ARGS)
-	@cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIGURE) $(CONFIGURE_ARGS) \
+	@echo $(CONFIG_SHELL) $(CONFIGURE) $(CONFIGURE_ARGS)
+	@cd $(OBJDIR) && $(BUILD_PROJECT_ARG) $(CONFIGURE_ENV_ARGS) $(CONFIG_SHELL) $(CONFIGURE) $(CONFIGURE_ARGS) \
 	  || ( echo "*** Fix above errors and then restart with\
                \"$(MAKE) -f client.mk build\"" && exit 1 )
 	@touch $(OBJDIR)/Makefile
@@ -328,7 +351,7 @@
 # Other targets
 
 # Pass these target onto the real build system
-install export libs clean realclean distclean alldep:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
+install export libs clean realclean distclean alldep maybe_clobber_profiledbuild:: $(OBJDIR)/Makefile $(OBJDIR)/config.status
 	$(MOZ_MAKE) $@
 
 ####################################
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/config/config.mk comm-1.9.1/config/config.mk
--- comm-1.9.1.orig/config/config.mk	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/config/config.mk	2010-11-30 03:10:23 +0900
@@ -378,8 +378,10 @@
 OS_CXXFLAGS += $(PROFILE_GEN_CFLAGS)
 OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
 ifeq (WINNT,$(OS_ARCH))
+ifeq (,$(GNU_CC))
 AR_FLAGS += -LTCG
 endif
+endif
 endif # INTERNAL_TOOLS
 endif # MOZ_PROFILE_GENERATE
 
@@ -389,8 +391,10 @@
 OS_CXXFLAGS += $(PROFILE_USE_CFLAGS)
 OS_LDFLAGS += $(PROFILE_USE_LDFLAGS)
 ifeq (WINNT,$(OS_ARCH))
+ifeq (,$(GNU_CC))
 AR_FLAGS += -LTCG
 endif
+endif
 endif # INTERNAL_TOOLS
 endif # MOZ_PROFILE_USE
 endif # NO_PROFILE_GUIDED_OPTIMIZE
@@ -837,7 +841,6 @@
 ifdef LOCALE_MERGEDIR
 MAKE_JARS_FLAGS += -c $(LOCALE_MERGEDIR)/$(subst /locales,,$(relativesrcdir))
 endif
-MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR)
 ifdef LOCALE_MERGEDIR
 MAKE_JARS_FLAGS += -c $(topsrcdir)/$(relativesrcdir)/en-US
 endif
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/config/rules.mk comm-1.9.1/config/rules.mk
--- comm-1.9.1.orig/config/rules.mk	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/config/rules.mk	2010-11-30 03:10:23 +0900
@@ -941,10 +941,15 @@
 	  $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin
 endif
 ifdef SHARED_LIBRARY
-	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
+ifdef IS_COMPONENT
+	$(PYTHON) $(MOZILLA_SRCDIR)/build/win32/pgomerge.py \
+	  $(LIBRARY_NAME) $(DIST)/bin/components
+else
+	$(PYTHON) $(MOZILLA_SRCDIR)/build/win32/pgomerge.py \
 	  $(LIBRARY_NAME) $(DIST)/bin
 endif
 endif
+endif
 endif # MOZ_PROFILE_USE
 endif # WINNT_
 endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
@@ -1000,13 +1005,12 @@
 	$(LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
-		if test -f "$(srcdir)/$@.manifest"; then \
-			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		else \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		fi; \
-		rm -f $@.manifest; \
+		mt.exe -NOLOGO -INPUTRESOURCE:$@\;1 -MANIFEST $(WIN_TOP_SRC)/mozilla/config/uiAccess.manifest -OUTPUTRESOURCE:$@\;1; \
 	fi
+ifdef WIN7_MANIFEST
+	mt.exe -NOLOGO -INPUTRESOURCE:$@\;1 -MANIFEST $(WIN_TOP_SRC)/mozilla/config/win7.manifest -OUTPUTRESOURCE:$@\;1
+endif # WIN7_MANIFEST
 endif	# MSVC with manifest tool
 else
 ifeq ($(CPP_PROG_LINK),1)
@@ -1799,10 +1803,26 @@
 libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
 ifneq (,$(wildcard $(JAR_MANIFEST)))
 ifndef NO_DIST_INSTALL
+	MOZ_UI_LOCALE=".hg" ; \
+	if test "$(relativesrcdir)" ; then \
+		MOZ_UI_LOCALE="en-US `ls $(L10NBASEDIR)`" ; \
+	fi ; \
+	for AB_CD in $${MOZ_UI_LOCALE} ; do \
+		if test "$${AB_CD}" != ".hg" ; then \
+			if test "$${AB_CD}" = "en-US" ; then \
+				LOCALE_SRCDIR=$(topsrcdir)/$(relativesrcdir)/en-US ; \
+			else \
+				LOCALE_SRCDIR=$(L10NBASEDIR)/$${AB_CD}/$(subst /locales,,$(relativesrcdir)) ; \
+			fi ; \
+			MAKE_JARS_FLAGS="-c $${LOCALE_SRCDIR}" ; \
+			DAB_CD="-DAB_CD=$${AB_CD}" ; \
+		fi ; \
 	$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
 	  $(QUIET) -j $(FINAL_TARGET)/chrome \
+	  $${MAKE_JARS_FLAGS} \
 	  $(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
-	  $(JAR_MANIFEST)
+	  $${DAB_CD} $(JAR_MANIFEST) ; \
+	done
 endif
 endif
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/configure comm-1.9.1/configure
--- comm-1.9.1.orig/configure	2010-11-26 07:27:45 +0900
+++ comm-1.9.1/configure	2010-11-30 03:10:23 +0900
@@ -3197,6 +3197,19 @@
 #define _CRT_NONSTDC_NO_WARNINGS 1
 EOF
 
+        elif test "$_CC_MAJOR_VERSION" = "16"; then
+            _CC_SUITE=10
+            CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
+            LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
+            _USE_DYNAMICBASE=1
+            cat >> confdefs.h <<\EOF
+#define _CRT_SECURE_NO_WARNINGS 1
+EOF
+
+            cat >> confdefs.h <<\EOF
+#define _CRT_NONSTDC_NO_WARNINGS 1
+EOF
+
         else
             { echo "configure: error: This version of the MSVC compiler, $CC_VERSION , is unsupported." 1>&2; exit 1; }
         fi
@@ -3468,6 +3481,7 @@
         unset _MSVC_VER_FILTER
 
     else
+        GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
         # Check w32api version
         _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
         _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
@@ -6905,7 +6919,7 @@
         DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
         XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
         DLL_PREFIX=
-        IMPORT_LIB_SUFFIX=dll.a
+        IMPORT_LIB_SUFFIX=a
     else
         TARGET_COMPILER_ABI=msvc
         HOST_CC='$(CC)'
@@ -16397,9 +16411,6 @@
 #define MOZ_MEMORY_WINDOWS 1
 EOF
 
-        if test "$CC_VERSION" != "14.00.50727.762"; then
-        { echo "configure: error: Building jemalloc requires exactly Visual C++ 2005 SP1 currently." 1>&2; exit 1; }
-    fi
     if test "$MOZILLA_1_9_1_BRANCH" = "1"; then
       if test -z "$WIN32_CRT_SRC_DIR" -a -z "$WIN32_CUSTOM_CRT_DIR"; then
         if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
@@ -17286,7 +17297,7 @@
 
 
 _SAVE_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -fprofile-generate"
+CFLAGS="$CFLAGS -fprofile-generate -fprofile-arcs -ftest-coverage"
 
 echo $ac_n "checking whether C compiler supports -fprofile-generate""... $ac_c" 1>&6
 echo "configure:17293: checking whether C compiler supports -fprofile-generate" >&5
@@ -17300,7 +17311,7 @@
 EOF
 if { (eval echo configure:17302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-   PROFILE_GEN_CFLAGS="-fprofile-generate"
+   PROFILE_GEN_CFLAGS="-fprofile-generate -fprofile-arcs -ftest-coverage"
                  result="yes" 
 else
   echo "configure: failed program was:" >&5
@@ -17312,9 +17323,17 @@
 echo "$ac_t""$result" 1>&6
 
 if test $result = "yes"; then
-  PROFILE_GEN_LDFLAGS="-fprofile-generate"
+  PROFILE_GEN_LDFLAGS="-fprofile-generate -fprofile-arcs -ftest-coverage"
   PROFILE_USE_CFLAGS="-fprofile-use"
   PROFILE_USE_LDFLAGS="-fprofile-use"
+  case "$GCC_VERSION" in
+  4.4.*|4.5.*)
+    PROFILE_GEN_CFLAGS="$PROFILE_GEN_CFLAGS -fprofile-correction"
+    PROFILE_GEN_LDFLAGS="$PROFILE_GEN_LDFLAGS -fprofile-correction"
+    PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -fprofile-correction"
+    PROFILE_USE_LDFLAGS="$PROFILE_USE_LDFLAGS -fprofile-correction"
+  ;;
+  esac
 else
   CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
   echo $ac_n "checking whether C compiler supports -fprofile-arcs""... $ac_c" 1>&6
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/directory/c-sdk/config/WIN32.mk comm-1.9.1/directory/c-sdk/config/WIN32.mk
--- comm-1.9.1.orig/directory/c-sdk/config/WIN32.mk	2009-03-25 22:04:18 +0900
+++ comm-1.9.1/directory/c-sdk/config/WIN32.mk	2010-11-30 03:10:23 +0900
@@ -51,7 +51,7 @@
 
 CC = cl
 CCC = cl
-LINK = link
+LD = link
 AR = lib -NOLOGO -OUT:"$@"
 RANLIB = echo
 BSDECHO = echo
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/directory/c-sdk/config/config.mk comm-1.9.1/directory/c-sdk/config/config.mk
--- comm-1.9.1.orig/directory/c-sdk/config/config.mk	2008-02-16 01:21:01 +0900
+++ comm-1.9.1/directory/c-sdk/config/config.mk	2010-11-30 03:10:23 +0900
@@ -158,7 +158,7 @@
 AS		= $(CC)
 ASFLAGS		= $(CFLAGS)
 PURIFY		= purify $(PURIFYOPTIONS)
-LINK_DLL	= $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
+LINK_DLL	= $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
 NFSPWD		= $(MOD_DEPTH)/config/nfspwd
 
 CFLAGS		= $(CC_ONLY_FLAGS) $(OPTIMIZER) $(OS_CFLAGS)\
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/directory/c-sdk/config/rules.mk comm-1.9.1/directory/c-sdk/config/rules.mk
--- comm-1.9.1.orig/directory/c-sdk/config/rules.mk	2008-12-24 18:39:55 +0900
+++ comm-1.9.1/directory/c-sdk/config/rules.mk	2010-11-30 03:10:23 +0900
@@ -356,7 +356,7 @@
 	echo $(W16LIBS) >>w16link
 	echo $(W16_EXPORTS) >>w16link
 	echo libfile libentry >>w16link
-	$(LINK) @w16link.
+	$(LD) @w16link.
 	rm w16link
 else	# WIN16
 	$(LINK_DLL) -MAP $(DLLBASE) $(OS_LIBS) $(EXTRA_LIBS) $(OBJS)
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/directory/c-sdk/config/win16.mk comm-1.9.1/directory/c-sdk/config/win16.mk
--- comm-1.9.1.orig/directory/c-sdk/config/win16.mk	2003-10-11 00:03:43 +0900
+++ comm-1.9.1/directory/c-sdk/config/win16.mk	2010-11-30 03:10:23 +0900
@@ -70,7 +70,7 @@
 
 CC = wcc
 CCC = wcl
-LINK = wlink
+LD = wlink
 AR = wlib -q $@
 RC = wrc.exe /r /dWIN16=1 /bt=windows
 RANLIB = echo
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/directory/c-sdk/ldap/examples/win32.mak comm-1.9.1/directory/c-sdk/ldap/examples/win32.mak
--- comm-1.9.1.orig/directory/c-sdk/ldap/examples/win32.mak	2006-10-06 08:01:43 +0900
+++ comm-1.9.1/directory/c-sdk/ldap/examples/win32.mak	2010-11-30 03:10:23 +0900
@@ -103,7 +103,7 @@
 CC=cl
 OPTFLAGS=-MD
 CFLAGS=$(OPTFLAGS) $(EXTRACFLAGS) -I$(INCDIR) -I$(NSPRINCDIR)
-LINK=link
+LD=link
 LDFLAGS=$(EXTRALDFLAGS)
 
 
@@ -176,4 +176,4 @@
 
 
 %.exe : %.obj
-		$(LINK) -OUT:$@ $(LDFLAGS) $(SYSLIBS) $< $(LIBS)
+		$(LD) -OUT:$@ $(LDFLAGS) $(SYSLIBS) $< $(LIBS)
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mail/app/Makefile.in comm-1.9.1/mail/app/Makefile.in
--- comm-1.9.1.orig/mail/app/Makefile.in	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/mail/app/Makefile.in	2010-11-30 03:10:23 +0900
@@ -167,6 +167,7 @@
 # Always enter a Windows program through wmain, whether or not we're
 # a console application.
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
+WIN7_MANIFEST = 1
 endif
 
 ifdef BUILD_STATIC_LIBS
@@ -343,7 +344,7 @@
 
 AB := $(firstword $(subst -, ,$(AB_CD)))
 
-APP_NAME = $(MOZ_APP_DISPLAYNAME)
+APP_NAME = $(MOZ_APP_NAME)
 
 ifdef MOZ_DEBUG
 APP_NAME := $(APP_NAME)Debug
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mail/app/profile/all-thunderbird.js comm-1.9.1/mail/app/profile/all-thunderbird.js
--- comm-1.9.1.orig/mail/app/profile/all-thunderbird.js	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/mail/app/profile/all-thunderbird.js	2010-11-30 03:10:23 +0900
@@ -44,6 +44,7 @@
 #endif
 
 pref("general.useragent.extra.thunderbird", "@APP_UA_NAME@/@APP_VERSION@");
+pref("general.useragent.extra.thunderbird.rayflood", "(rayflood)");
 
 pref("general.useragent.locale", "@AB_CD@");
 pref("general.skins.selectedSkin", "classic/1.0");
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mail/branding/nightly/branding.nsi comm-1.9.1/mail/branding/nightly/branding.nsi
--- comm-1.9.1.orig/mail/branding/nightly/branding.nsi	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/mail/branding/nightly/branding.nsi	2010-11-30 03:10:23 +0900
@@ -39,7 +39,7 @@
 
 # BrandFullNameInternal is used for some registry and file system values
 # instead of BrandFullName and typically should not be modified.
-!define BrandFullNameInternal "Shredder"
+!define BrandFullNameInternal "thunderbird"
 !define CompanyName           "mozilla.org"
 !define URLInfoAbout          "http://www.mozilla.org/"
 !define URLUpdateInfo         "http://www.mozilla.org/products/thunderbird/"
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mail/branding/nightly/configure.sh comm-1.9.1/mail/branding/nightly/configure.sh
--- comm-1.9.1.orig/mail/branding/nightly/configure.sh	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/mail/branding/nightly/configure.sh	2010-11-30 03:10:23 +0900
@@ -1 +1 @@
-MOZ_APP_DISPLAYNAME=Shredder
+MOZ_APP_DISPLAYNAME=Thunderbird
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mail/branding/nightly/locales/en-US/brand.dtd comm-1.9.1/mail/branding/nightly/locales/en-US/brand.dtd
--- comm-1.9.1.orig/mail/branding/nightly/locales/en-US/brand.dtd	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/mail/branding/nightly/locales/en-US/brand.dtd	2010-11-30 03:10:23 +0900
@@ -1,3 +1,3 @@
-<!ENTITY  brandShortName        "Shredder">
-<!ENTITY  brandFullName         "Shredder">
+<!ENTITY  brandShortName        "thunderbird">
+<!ENTITY  brandFullName         "thunderbird">
 <!ENTITY  vendorShortName       "mozilla.org">
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mail/branding/nightly/locales/en-US/brand.properties comm-1.9.1/mail/branding/nightly/locales/en-US/brand.properties
--- comm-1.9.1.orig/mail/branding/nightly/locales/en-US/brand.properties	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/mail/branding/nightly/locales/en-US/brand.properties	2010-11-30 03:10:23 +0900
@@ -1,4 +1,4 @@
-brandShortName=Shredder
-brandFullName=Shredder
+brandShortName=thunderbird
+brandFullName=thunderbird
 vendorShortName=mozilla.org
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mail/installer/Makefile.in comm-1.9.1/mail/installer/Makefile.in
--- comm-1.9.1.orig/mail/installer/Makefile.in	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/mail/installer/Makefile.in	2010-11-30 03:10:23 +0900
@@ -59,9 +59,11 @@
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
+ifneq (,$(BUILD_STATIC_LIBS)$(MOZ_ENABLE_LIBXUL))
 ifeq (WINNT,$(OS_ARCH))
 MOZ_PKG_MANIFEST_P = $(srcdir)/windows/packages-static
 endif
+endif
 
 MOZ_NONLOCALIZED_PKG_LIST = \
 	xpcom \
@@ -95,7 +97,6 @@
 # mozconfig instead.
 ifndef MAIL_PKG_SHARED
 ifndef BUILD_STATIC_LIBS
-$(error you need an "--enable-static" build to package a build)
 endif
 endif
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mail/installer/windows/nsis/defines.nsi.in comm-1.9.1/mail/installer/windows/nsis/defines.nsi.in
--- comm-1.9.1.orig/mail/installer/windows/nsis/defines.nsi.in	2010-11-26 07:22:13 +0900
+++ comm-1.9.1/mail/installer/windows/nsis/defines.nsi.in	2010-11-30 03:10:23 +0900
@@ -9,11 +9,11 @@
 !define AppRegNameMail        "Thunderbird"
 !define AppRegNameNews        "Thunderbird (News)"
 
-!define ClientsRegName        "Mozilla Thunderbird"
+!define ClientsRegName        "@MOZ_APP_NAME@"
 
 !define MinSupportedVer       "Microsoft Windows 2000"
 
-!define BrandShortName        "@MOZ_APP_DISPLAYNAME@"
+!define BrandShortName        "@MOZ_APP_NAME@"
 !define PreReleaseSuffix      "@PRE_RELEASE_SUFFIX@"
 !define BrandFullName         "${BrandFullNameInternal}${PreReleaseSuffix}"
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozconfig comm-1.9.1/mozconfig
--- comm-1.9.1.orig/mozconfig	1970-01-01 09:00:00 +0900
+++ comm-1.9.1/mozconfig	2010-11-30 03:10:24 +0900
@@ -0,0 +1,6 @@
+if [ -e ${topsrcdir}/../../mozconfig ] ; then
+	RF_MOZCONFIG=${topsrcdir}/../../mozconfig
+elif [ -e ${topsrcdir}/../../../mozconfig ] ; then
+	RF_MOZCONFIG=${topsrcdir}/../../../mozconfig
+fi
+. ${RF_MOZCONFIG}/mozconfig.sh
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/Makefile.in comm-1.9.1/mozilla/Makefile.in
--- comm-1.9.1.orig/mozilla/Makefile.in	2010-11-26 07:25:46 +0900
+++ comm-1.9.1/mozilla/Makefile.in	2010-11-30 03:10:23 +0900
@@ -82,7 +82,6 @@
 	$(RM) -rf $(DIST)/include
 	$(RM) -rf $(DIST)/private
 	$(RM) -rf $(DIST)/public
-	$(RM) -rf $(DIST)/bin/components
 	$(RM) -rf _tests
 
 # Build pseudo-external modules first when export is explicitly called
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/build/automation-build.mk comm-1.9.1/mozilla/build/automation-build.mk
--- comm-1.9.1.orig/mozilla/build/automation-build.mk	2010-11-26 07:25:48 +0900
+++ comm-1.9.1/mozilla/build/automation-build.mk	2010-11-30 03:10:23 +0900
@@ -12,9 +12,9 @@
 else
 ifeq ($(OS_ARCH),Darwin)
 ifdef MOZ_DEBUG
-browser_path = \"$(TARGET_DIST)/$(MOZ_APP_DISPLAYNAME)Debug.app/Contents/MacOS/$(PROGRAM)\"
+browser_path = \"$(TARGET_DIST)/$(MOZ_APP_NAME)Debug.app/Contents/MacOS/$(PROGRAM)\"
 else
-browser_path = \"$(TARGET_DIST)/$(MOZ_APP_DISPLAYNAME).app/Contents/MacOS/$(PROGRAM)\"
+browser_path = \"$(TARGET_DIST)/$(MOZ_APP_NAME).app/Contents/MacOS/$(PROGRAM)\"
 endif
 else
 browser_path = \"$(TARGET_DIST)/bin/$(PROGRAM)\"
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/config/config.mk comm-1.9.1/mozilla/config/config.mk
--- comm-1.9.1.orig/mozilla/config/config.mk	2010-11-26 07:25:48 +0900
+++ comm-1.9.1/mozilla/config/config.mk	2010-11-30 03:10:23 +0900
@@ -373,8 +373,10 @@
 OS_CXXFLAGS += $(PROFILE_GEN_CFLAGS)
 OS_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
 ifeq (WINNT,$(OS_ARCH))
+ifeq (,$(GNU_CC))
 AR_FLAGS += -LTCG
 endif
+endif
 endif # INTERNAL_TOOLS
 endif # MOZ_PROFILE_GENERATE
 
@@ -384,8 +386,10 @@
 OS_CXXFLAGS += $(PROFILE_USE_CFLAGS)
 OS_LDFLAGS += $(PROFILE_USE_LDFLAGS)
 ifeq (WINNT,$(OS_ARCH))
+ifeq (,$(GNU_CC))
 AR_FLAGS += -LTCG
 endif
+endif
 endif # INTERNAL_TOOLS
 endif # MOZ_PROFILE_USE
 endif # NO_PROFILE_GUIDED_OPTIMIZE
@@ -836,7 +840,6 @@
 ifdef LOCALE_MERGEDIR
 MAKE_JARS_FLAGS += -c $(LOCALE_MERGEDIR)/$(subst /locales,,$(relativesrcdir))
 endif
-MAKE_JARS_FLAGS += -c $(LOCALE_SRCDIR)
 ifdef LOCALE_MERGEDIR
 MAKE_JARS_FLAGS += -c $(topsrcdir)/$(relativesrcdir)/en-US
 endif
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/config/rules.mk comm-1.9.1/mozilla/config/rules.mk
--- comm-1.9.1.orig/mozilla/config/rules.mk	2010-11-26 07:25:48 +0900
+++ comm-1.9.1/mozilla/config/rules.mk	2010-11-30 03:10:23 +0900
@@ -956,10 +956,15 @@
 	  $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin
 endif
 ifdef SHARED_LIBRARY
+ifdef IS_COMPONENT
+	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
+	  $(LIBRARY_NAME) $(DIST)/bin/components
+else
 	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(LIBRARY_NAME) $(DIST)/bin
 endif
 endif
+endif
 endif # MOZ_PROFILE_USE
 endif # WINNT_
 endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
@@ -1015,13 +1020,12 @@
 	$(LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
-		if test -f "$(srcdir)/$@.manifest"; then \
-			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		else \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		fi; \
-		rm -f $@.manifest; \
+		mt.exe -NOLOGO -INPUTRESOURCE:$@\;1 -MANIFEST $(WIN_TOP_SRC)/config/uiAccess.manifest -OUTPUTRESOURCE:$@\;1; \
 	fi
+ifdef WIN7_MANIFEST
+	mt.exe -NOLOGO -INPUTRESOURCE:$@\;1 -MANIFEST $(WIN_TOP_SRC)/config/win7.manifest -OUTPUTRESOURCE:$@\;1
+endif # WIN7_MANIFEST
 endif	# MSVC with manifest tool
 else
 ifeq ($(CPP_PROG_LINK),1)
@@ -1922,10 +1926,26 @@
 libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
 ifneq (,$(wildcard $(JAR_MANIFEST)))
 ifndef NO_DIST_INSTALL
+	MOZ_UI_LOCALE=".hg" ; \
+	if test "$(relativesrcdir)" ; then \
+		MOZ_UI_LOCALE="en-US `ls $(L10NBASEDIR)`" ; \
+	fi ; \
+	for AB_CD in $${MOZ_UI_LOCALE} ; do \
+		if test "$${AB_CD}" != ".hg" ; then \
+			if test "$${AB_CD}" = "en-US" ; then \
+				LOCALE_SRCDIR=$(topsrcdir)/$(relativesrcdir)/en-US ; \
+			else \
+				LOCALE_SRCDIR=$(L10NBASEDIR)/$${AB_CD}/$(subst /locales,,$(relativesrcdir)) ; \
+			fi ; \
+			MAKE_JARS_FLAGS="-c $${LOCALE_SRCDIR}" ; \
+			DAB_CD="-DAB_CD=$${AB_CD}" ; \
+		fi ; \
 	$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
 	  $(QUIET) -j $(FINAL_TARGET)/chrome \
+	  $${MAKE_JARS_FLAGS} \
 	  $(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
-	  $(JAR_MANIFEST)
+	  $${DAB_CD} $(JAR_MANIFEST) ; \
+	done
 endif
 endif
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/config/uiAccess.manifest comm-1.9.1/mozilla/config/uiAccess.manifest
--- comm-1.9.1.orig/mozilla/config/uiAccess.manifest	1970-01-01 09:00:00 +0900
+++ comm-1.9.1/mozilla/config/uiAccess.manifest	2010-11-30 03:10:24 +0900
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+  <ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
+    <ms_asmv3:security>
+      <ms_asmv3:requestedPrivileges>
+        <ms_asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false">
+        </ms_asmv3:requestedExecutionLevel>
+      </ms_asmv3:requestedPrivileges>
+    </ms_asmv3:security>
+  </ms_asmv3:trustInfo>
+</assembly>
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/config/win7.manifest comm-1.9.1/mozilla/config/win7.manifest
--- comm-1.9.1.orig/mozilla/config/win7.manifest	1970-01-01 09:00:00 +0900
+++ comm-1.9.1/mozilla/config/win7.manifest	2010-11-30 03:10:24 +0900
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
+      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
+    </application>
+  </compatibility>
+</assembly>
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/configure comm-1.9.1/mozilla/configure
--- comm-1.9.1.orig/mozilla/configure	2010-11-26 07:27:45 +0900
+++ comm-1.9.1/mozilla/configure	2010-11-30 03:10:23 +0900
@@ -3112,6 +3112,19 @@
 #define _CRT_NONSTDC_NO_WARNINGS 1
 EOF
 
+        elif test "$_CC_MAJOR_VERSION" = "16"; then
+            _CC_SUITE=10
+            CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
+            LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
+            _USE_DYNAMICBASE=1
+            cat >> confdefs.h <<\EOF
+#define _CRT_SECURE_NO_WARNINGS 1
+EOF
+
+            cat >> confdefs.h <<\EOF
+#define _CRT_NONSTDC_NO_WARNINGS 1
+EOF
+
         else
             { echo "configure: error: This version of the MSVC compiler, $CC_VERSION , is unsupported." 1>&2; exit 1; }
         fi
@@ -3180,6 +3193,7 @@
         unset _MSVC_VER_FILTER
 
     else
+        GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
         # Check w32api version
         _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
         _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
@@ -6627,7 +6641,7 @@
         DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
         XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
         DLL_PREFIX=
-        IMPORT_LIB_SUFFIX=dll.a
+        IMPORT_LIB_SUFFIX=a
     else
         TARGET_COMPILER_ABI=msvc
         HOST_CC='$(CC)'
@@ -18784,7 +18798,7 @@
 
 
 _SAVE_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -fprofile-generate"
+CFLAGS="$CFLAGS -fprofile-generate -fprofile-arcs -ftest-coverage"
 
 echo $ac_n "checking whether C compiler supports -fprofile-generate""... $ac_c" 1>&6
 echo "configure:18791: checking whether C compiler supports -fprofile-generate" >&5
@@ -18798,7 +18812,7 @@
 EOF
 if { (eval echo configure:18800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
-   PROFILE_GEN_CFLAGS="-fprofile-generate"
+   PROFILE_GEN_CFLAGS="-fprofile-generate -fprofile-arcs -ftest-coverage"
                  result="yes" 
 else
   echo "configure: failed program was:" >&5
@@ -18810,9 +18824,17 @@
 echo "$ac_t""$result" 1>&6
 
 if test $result = "yes"; then
-  PROFILE_GEN_LDFLAGS="-fprofile-generate"
+  PROFILE_GEN_LDFLAGS="-fprofile-generate -fprofile-arcs -ftest-coverage"
   PROFILE_USE_CFLAGS="-fprofile-use"
   PROFILE_USE_LDFLAGS="-fprofile-use"
+  case "$GCC_VERSION" in
+  4.4.*|4.5.*)
+    PROFILE_GEN_CFLAGS="$PROFILE_GEN_CFLAGS -fprofile-correction"
+    PROFILE_GEN_LDFLAGS="$PROFILE_GEN_LDFLAGS -fprofile-correction"
+    PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -fprofile-correction"
+    PROFILE_USE_LDFLAGS="$PROFILE_USE_LDFLAGS -fprofile-correction"
+  ;;
+  esac
 else
   CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
   echo $ac_n "checking whether C compiler supports -fprofile-arcs""... $ac_c" 1>&6
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/gfx/cairo/cairo/src/Makefile.in comm-1.9.1/mozilla/gfx/cairo/cairo/src/Makefile.in
--- comm-1.9.1.orig/mozilla/gfx/cairo/cairo/src/Makefile.in	2010-11-26 07:25:55 +0900
+++ comm-1.9.1/mozilla/gfx/cairo/cairo/src/Makefile.in	2010-11-30 03:10:23 +0900
@@ -59,11 +59,6 @@
 ifeq ($(OS_ARCH),SunOS)
 MODULE_OPTIMIZE_FLAGS = -xO5
 endif
-ifeq ($(OS_ARCH),WINNT)
-# FIXME: bug 413019
-OS_COMPILE_CFLAGS += -GL-
-MODULE_OPTIMIZE_FLAGS = -O2
-endif
 endif
 
 REQUIRES        = $(PNG_REQUIRES) \
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/gfx/ots/include/opentype-sanitiser.h comm-1.9.1/mozilla/gfx/ots/include/opentype-sanitiser.h
--- comm-1.9.1.orig/mozilla/gfx/ots/include/opentype-sanitiser.h	2010-11-26 07:25:55 +0900
+++ comm-1.9.1/mozilla/gfx/ots/include/opentype-sanitiser.h	2010-12-07 04:29:49 +0900
@@ -26,6 +26,25 @@
 #include <cassert>
 #include <cstring>
 
+#ifdef _MSC_VER
+#if _MSC_VER < 1400
+#ifndef _CPPLIB_VER
+_STD_BEGIN
+#define max _cpp_max
+#define min _cpp_min
+using ::size_t; using ::memchr; using ::memcmp;
+using ::memcpy; using ::memmove; using ::memset;
+using ::strcat; using ::strchr; using ::strcmp;
+using ::strcoll; using ::strcpy; using ::strcspn;
+using ::strerror; using ::strlen; using ::strncat;
+using ::strncmp; using ::strncpy; using ::strpbrk;
+using ::strrchr; using ::strspn; using ::strstr;
+using ::strtok; using ::strxfrm;
+_STD_END
+#endif
+#endif
+#endif
+
 namespace ots {
 
 // -----------------------------------------------------------------------------
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/gfx/ots/src/ots.h comm-1.9.1/mozilla/gfx/ots/src/ots.h
--- comm-1.9.1.orig/mozilla/gfx/ots/src/ots.h	2010-11-26 07:25:55 +0900
+++ comm-1.9.1/mozilla/gfx/ots/src/ots.h	2010-12-01 00:37:45 +0900
@@ -22,9 +22,15 @@
 #endif
 
 #if defined(_MSC_VER)
+#if _MSC_VER >= 1400
 // MSVC supports C99 style variadic macros.
 #define OTS_WARNING(format, ...)
 #else
+// https://bugzilla.mozilla.org/attachment.cgi?id=493106&action=diff
+#pragma warning( disable : 4002 )
+#define OTS_WARNING(format)
+#endif
+#else
 // GCC
 #if defined(OTS_DEBUG)
 #define OTS_WARNING(format, args...) \
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/jpeg/Makefile.in comm-1.9.1/mozilla/jpeg/Makefile.in
--- comm-1.9.1.orig/mozilla/jpeg/Makefile.in	2010-11-26 07:25:57 +0900
+++ comm-1.9.1/mozilla/jpeg/Makefile.in	2010-11-30 03:10:23 +0900
@@ -47,10 +47,6 @@
 
 ifeq ($(OS_ARCH),WINNT)
 LIBRARY_NAME	= jpeg$(MOZ_BITS)$(VERSION_NUMBER)
-# FIXME: bug 413019
-ifndef GNU_CC
-OS_COMPILE_CFLAGS += -GL-
-endif
 endif
 
 GRE_MODULE	= 1
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/js/src/Makefile.in comm-1.9.1/mozilla/js/src/Makefile.in
--- comm-1.9.1.orig/mozilla/js/src/Makefile.in	2010-11-26 07:25:57 +0900
+++ comm-1.9.1/mozilla/js/src/Makefile.in	2010-11-30 03:10:23 +0900
@@ -50,7 +50,9 @@
 LIBRARY_NAME	= mozjs
 GRE_MODULE	= 1
 
+ifneq (,$(findstring --enable-application=xulrunner,$(ac_configure_args)))
 PROGRAM         = js$(BIN_SUFFIX)
+endif
 # The shell uses some 'HIDDEN' symbols to produce statistics, so we
 # link directly against the .o files, not against the JS shared
 # library.
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/js/src/config/rules.mk comm-1.9.1/mozilla/js/src/config/rules.mk
--- comm-1.9.1.orig/mozilla/js/src/config/rules.mk	2010-11-26 07:25:57 +0900
+++ comm-1.9.1/mozilla/js/src/config/rules.mk	2010-11-30 03:10:23 +0900
@@ -1015,12 +1015,8 @@
 	$(LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
-		if test -f "$(srcdir)/$@.manifest"; then \
-			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		else \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		fi; \
-		rm -f $@.manifest; \
+		mt.exe -NOLOGO -INPUTRESOURCE:$@\;1 -MANIFEST $(WIN_TOP_SRC)/../../config/uiAccess.manifest -OUTPUTRESOURCE:$@\;1; \
 	fi
 endif	# MSVC with manifest tool
 else
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/js/src/configure comm-1.9.1/mozilla/js/src/configure
--- comm-1.9.1.orig/mozilla/js/src/configure	2010-11-26 07:27:46 +0900
+++ comm-1.9.1/mozilla/js/src/configure	2010-11-30 03:10:23 +0900
@@ -2714,6 +2714,19 @@
 #define _CRT_NONSTDC_NO_WARNINGS 1
 EOF
 
+        elif test "$_CC_MAJOR_VERSION" = "16"; then
+            _CC_SUITE=10
+            CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
+            LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
+            _USE_DYNAMICBASE=1
+            cat >> confdefs.h <<\EOF
+#define _CRT_SECURE_NO_WARNINGS 1
+EOF
+
+            cat >> confdefs.h <<\EOF
+#define _CRT_NONSTDC_NO_WARNINGS 1
+EOF
+
         else
             { echo "configure: error: This version of the MSVC compiler, $CC_VERSION , is unsupported." 1>&2; exit 1; }
         fi
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/memory/jemalloc/Makefile.in comm-1.9.1/mozilla/memory/jemalloc/Makefile.in
--- comm-1.9.1.orig/mozilla/memory/jemalloc/Makefile.in	2010-11-26 07:26:41 +0900
+++ comm-1.9.1/mozilla/memory/jemalloc/Makefile.in	2010-11-30 03:10:23 +0900
@@ -63,7 +63,13 @@
 	$(INSTALL) $< $(FINAL_TARGET)
 
 # patch if necessary
-$(CRT_OBJ_DIR)/jemalloc.c: $(srcdir)/crtsp1.diff
+ifeq ($(CC_VERSION), 14.00.50727.762)
+CRTDIFF=crtsp1.diff
+else
+CRTDIFF=crtvc9sp1.diff
+endif
+
+$(CRT_OBJ_DIR)/jemalloc.c: $(srcdir)/$(CRTDIFF)
 	rm -rf $(CRT_OBJ_DIR)
 	cp -R "$(WIN32_CRT_SRC_DIR)" .
 	# per http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1189363&SiteID=1
@@ -72,7 +78,7 @@
 	done
 	# truly awful
 	#XXX: get ed into mozillabuild, bug 415123
-	$(PERL) $(srcdir)/apply-ed-patches.pl $(srcdir)/crtsp1.diff \
+	$(PERL) $(srcdir)/apply-ed-patches.pl $(srcdir)/$(CRTDIFF) \
 	$(CRT_OBJ_DIR) $(srcdir)/ed.exe
 
 $(CRT_OBJ_DIR)/build/intel/mozcrt19.dll: \
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/memory/jemalloc/crtvc9sp1.diff comm-1.9.1/mozilla/memory/jemalloc/crtvc9sp1.diff
--- comm-1.9.1.orig/mozilla/memory/jemalloc/crtvc9sp1.diff	1970-01-01 09:00:00 +0900
+++ comm-1.9.1/mozilla/memory/jemalloc/crtvc9sp1.diff	2010-11-30 03:10:24 +0900
@@ -0,0 +1,216 @@
+# The Microsoft C Runtime source code to which this document refers is available
+# directly from Microsoft Corporation, under a separate license.
+# Please ensure that if you are using that source code, you have appropriate
+# rights to use it.  By providing you access to this file, Mozilla Corporation
+# and its affiliates do not purport to grant any rights in that source code. 
+# Binaries are available under separate licenses at 
+# http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en
+diff -re crt/src/_sample_.rc crtsrc/_sample_.rc
+41c
+            VALUE "ProductName", "Mozilla Custom C Runtime"
+.
+39c
+            VALUE "OriginalFilename", "MOZCRT19.DLL"
+.
+37c
+            VALUE "OriginalFilename", "MOZCRT19D.DLL"
+.
+33c
+            VALUE "InternalName", "MOZCRT19.DLL"
+.
+31c
+            VALUE "InternalName", "MOZCRT19D.DLL"
+.
+27c
+            VALUE "CompanyName", "Mozilla Foundation"
+.
+diff -re crt/src/crt0.c crtsrc/crt0.c
+212c
+        /*
+         * this used to happen in _mtinit, but we need it before malloc
+         */
+        _init_pointers();       /* initialize global function pointers */
+
+        if ( malloc_init_hard() )                /* initialize heap */
+.
+87a
+extern BOOL malloc_init_hard(void);
+.
+diff -re crt/src/crt0dat.c crtsrc/crt0dat.c
+837d
+826d
+diff -re crt/src/crtdll.c crtsrc/crtdll.c
+31,40d
+diff -re crt/src/crtexe.c crtsrc/crtexe.c
+322,324d
+35,45d
+diff -re crt/src/crtheap.c crtsrc/crtheap.c
+61c
+    pv = calloc(count, size);
+.
+58,59d
+diff -re crt/src/crtlib.c crtsrc/crtlib.c
+686,693d
+355d
+339a
+                 malloc_shutdown();
+
+.
+298d
+279d
+249,250d
+239d
+226c
+            /*
+             * this used to happen in _mtinit, but we need it before malloc
+             */
+            _init_pointers();       /* initialize global function pointers */
+
+            if ( malloc_init_hard() )   /* initialize heap */
+.
+43a
+extern BOOL malloc_init_hard(void);
+extern void malloc_shutdown(void);
+
+.
+diff -re crt/src/dllcrt0.c crtsrc/dllcrt0.c
+189,190d
+136d
+126d
+111d
+106,108d
+diff -re crt/src/intel/_sample_.def crtsrc/intel/_sample_.def
+1198d
+718,719d
+664a
+    posix_memalign
+.
+638a
+    memalign
+.
+495a
+    malloc_usable_size
+.
+331,336d
+319d
+313,314d
+81d
+9c
+LIBRARY MOZCRT19
+.
+diff -re crt/src/internal.h crtsrc/internal.h
+413a
+#endif
+.
+409c
+#if 0
+.
+diff -re crt/src/makefile crtsrc/makefile
+1873c
+-def:$(DEFFILE2_DIR)\sample_p.def
+.
+1841c
+ $(DEFFILE2_DIR)\sample_p.def $(CPPSRC_OBJS_DLL:*=dll) \
+.
+1771a
+$(DEFFILE_DIR)\$(RETAIL_LIB_NAME).def : $(DEFFILE_DIR)\_sample_.def
+	copy $** $@
+.
+1290d
+1235,1237d
+760c
+dll_ :: $(OBJROOT) $(OBJCPUDIR) $(OBJDIR_DLL) $(OBJDIR_DLL)\$(PURE_OBJ_DIR) \
+   	$(OBJDIR_DLL)\$(CPP_OBJ_DIR) \
+   	$(RELDIR_CPU) $(PDBDIR_CPU_DLL) $(MAKE_DIRS_DLL)
+.
+340c
+CC_OPTS_BASE=-c -nologo -Zlp8 -W3 -GFy -DWIND32
+.
+213d
+21,24c
+RETAIL_DLL_NAME=MOZCRT19
+RETAIL_DLLCPP_NAME=MOZCPP19
+.
+diff -re crt/src/makefile.inc crtsrc/makefile.inc
+1636a
+$(OBJDIR)\unhandld.obj: $(PREOBJDIR)\unhandld.obj
+        copy $(PREOBJDIR)\unhandld.obj $@
+
+.
+623d
+621d
+405d
+344,356c
+        $(OBJDIR)\jemalloc.obj  \
+.
+336,337d
+331,332d
+329d
+325d
+321,322d
+diff -re crt/src/makefile.sub crtsrc/makefile.sub
+66c
+CFLAGS=$(CFLAGS) -O2 -DMOZ_MEMORY=1 -DMOZ_MEMORY_WINDOWS=1
+.
+diff -re crt/src/malloc.h crtsrc/malloc.h
+189a
+#endif
+.
+177a
+
+#if 0
+.
+83a
+#endif
+.
+70a
+#if 0
+.
+diff -re crt/src/mlock.c crtsrc/mlock.c
+274c
+#endif
+.
+262a
+#if 0
+.
+diff -re crt/src/new.cpp crtsrc/new.cpp
+60d
+52,55d
+37,38c
+        break;
+.
+diff -re crt/src/nothrownew.cpp crtsrc/nothrownew.cpp
+38c
+#endif
+.
+31a
+#if 1
+        break;
+#else
+
+.
+diff -re crt/src/sample_p.def crtsrc/sample_p.def
+8c
+LIBRARY mozcpp19
+.
+diff -re crt/src/sample_p.rc crtsrc/sample_p.rc
+41c
+            VALUE "ProductName", "Mozilla Custom C++ Runtime"
+.
+39c
+            VALUE "OriginalFilename", "MOZCPP19.DLL"
+.
+37c
+            VALUE "OriginalFilename", "MOZCPP19D.DLL"
+.
+33c
+            VALUE "InternalName", "MOZCPP19.DLL"
+.
+31c
+            VALUE "InternalName", "MOZCPP19D.DLL"
+.
+27c
+            VALUE "CompanyName", "Mozilla Foundation"
+.
+diff -re crt/src/tidtable.c crtsrc/tidtable.c
+360,361d
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/modules/libimg/png/Makefile.in comm-1.9.1/mozilla/modules/libimg/png/Makefile.in
--- comm-1.9.1.orig/mozilla/modules/libimg/png/Makefile.in	2010-11-26 07:26:41 +0900
+++ comm-1.9.1/mozilla/modules/libimg/png/Makefile.in	2010-11-30 03:10:23 +0900
@@ -49,13 +49,6 @@
 endif
 LIBXUL_LIBRARY = 1
 
-ifndef GNU_CC
-ifeq ($(OS_ARCH),WINNT)
-# FIXME: bug 413019
-OS_COMPILE_CFLAGS += -GL-
-endif
-endif
-
 REQUIRES	= $(ZLIB_REQUIRES) \
 		  $(NULL)
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/modules/libpref/src/init/all.js comm-1.9.1/mozilla/modules/libpref/src/init/all.js
--- comm-1.9.1.orig/mozilla/modules/libpref/src/init/all.js	2010-11-26 07:26:42 +0900
+++ comm-1.9.1/mozilla/modules/libpref/src/init/all.js	2010-11-30 03:10:23 +0900
@@ -546,7 +546,7 @@
 pref("javascript.options.strict",           false);
 pref("javascript.options.relimit",          false);
 pref("javascript.options.jit.content",      true);
-pref("javascript.options.jit.chrome",       false);
+pref("javascript.options.jit.chrome",       true);
 
 // advanced prefs
 pref("security.enable_java",                true);
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/security/coreconf/Darwin.mk comm-1.9.1/mozilla/security/coreconf/Darwin.mk
--- comm-1.9.1.orig/mozilla/security/coreconf/Darwin.mk	2010-11-26 07:27:00 +0900
+++ comm-1.9.1/mozilla/security/coreconf/Darwin.mk	2010-11-30 03:10:23 +0900
@@ -108,11 +108,15 @@
 OS_CFLAGS	= $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wmost -fpascal-strings -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK $(DARWIN_SDK_CFLAGS)
 
 ifdef BUILD_OPT
+ifeq ($(MOZ_OPTIMIZE),2)
+	OPTIMIZER	= $(MOZ_OPTIMIZE_FLAGS)
+else
 ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
 	OPTIMIZER       = -Oz
 else
 	OPTIMIZER	= -O2
 endif
+endif
 ifdef MOZ_DEBUG_SYMBOLS
 	ifdef MOZ_DEBUG_FLAGS
 		OPTIMIZER += $(MOZ_DEBUG_FLAGS)
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/security/coreconf/Linux.mk comm-1.9.1/mozilla/security/coreconf/Linux.mk
--- comm-1.9.1.orig/mozilla/security/coreconf/Linux.mk	2010-11-26 07:27:00 +0900
+++ comm-1.9.1/mozilla/security/coreconf/Linux.mk	2010-11-30 03:10:23 +0900
@@ -112,11 +112,15 @@
 endif
 
 ifdef BUILD_OPT
+ifeq ($(MOZ_OPTIMIZE),2)
+	OPTIMIZER = $(MOZ_OPTIMIZE_FLAGS)
+else
 ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
 	OPTIMIZER = -Os
 else
 	OPTIMIZER = -O2
 endif
+endif
 ifdef MOZ_DEBUG_SYMBOLS
 	ifdef MOZ_DEBUG_FLAGS
 		OPTIMIZER += $(MOZ_DEBUG_FLAGS)
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/security/coreconf/WIN32.mk comm-1.9.1/mozilla/security/coreconf/WIN32.mk
--- comm-1.9.1.orig/mozilla/security/coreconf/WIN32.mk	2010-11-26 07:27:00 +0900
+++ comm-1.9.1/mozilla/security/coreconf/WIN32.mk	2010-11-30 03:10:24 +0900
@@ -45,7 +45,7 @@
 ifdef NS_USE_GCC
 	CC           = gcc
 	CCC          = g++
-	LINK         = ld
+	LD           = ld
 	AR           = ar
 	AR          += cr $@
 	RANLIB       = ranlib
@@ -55,7 +55,7 @@
 else
 	CC           = cl
 	CCC          = cl
-	LINK         = link
+	LD           = link
 	AR           = lib
 	AR          += -NOLOGO -OUT:"$@"
 	RANLIB       = echo
@@ -128,11 +128,15 @@
     _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
     DLLFLAGS  += -mno-cygwin -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
     ifdef BUILD_OPT
+	ifeq ($(MOZ_OPTIMIZE),2)
+		OPTIMIZER += $(MOZ_OPTIMIZE_FLAGS)
+	else
 	ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
 		OPTIMIZER += -Os
 	else
 		OPTIMIZER += -O2
 	endif
+	endif
 	DEFINES    += -UDEBUG -U_DEBUG -DNDEBUG
     else
 	OPTIMIZER  += -g
@@ -155,11 +159,15 @@
     endif
     ifdef BUILD_OPT
 	OS_CFLAGS  += -MD
+	ifeq ($(MOZ_OPTIMIZE),2)
+		OPTIMIZER += $(MOZ_OPTIMIZE_FLAGS)
+	else
 	ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
 		OPTIMIZER += -O1
 	else
 		OPTIMIZER += -O2
 	endif
+	endif
 	DEFINES    += -UDEBUG -U_DEBUG -DNDEBUG
 	DLLFLAGS   += -OUT:"$@"
 	ifdef MOZ_DEBUG_SYMBOLS
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/security/coreconf/WINCE.mk comm-1.9.1/mozilla/security/coreconf/WINCE.mk
--- comm-1.9.1.orig/mozilla/security/coreconf/WINCE.mk	2010-11-26 07:27:00 +0900
+++ comm-1.9.1/mozilla/security/coreconf/WINCE.mk	2010-11-30 03:10:24 +0900
@@ -54,7 +54,7 @@
 endif
 endif
 
-LINK         = link
+LD           = link
 AR           = lib
 AR          += -NOLOGO -OUT:"$@"
 RANLIB       = echo
@@ -87,7 +87,11 @@
 
 ifdef BUILD_OPT
 #   OS_CFLAGS  += -MD
+    ifeq ($(MOZ_OPTIMIZE),2)
+    OPTIMIZER  += $(MOZ_OPTIMIZE_FLAGS)
+    else
     OPTIMIZER  += -O2
+    endif
     DEFINES    += -UDEBUG -U_DEBUG -DNDEBUG
     DLLFLAGS   += -OUT:"$@"
 else
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/security/coreconf/command.mk comm-1.9.1/mozilla/security/coreconf/command.mk
--- comm-1.9.1.orig/mozilla/security/coreconf/command.mk	2010-11-26 07:27:00 +0900
+++ comm-1.9.1/mozilla/security/coreconf/command.mk	2010-11-30 03:10:24 +0900
@@ -43,8 +43,8 @@
 AS            = $(CC)
 ASFLAGS      += $(CFLAGS)
 CCF           = $(CC) $(CFLAGS)
-LINK_DLL      = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS)
-LINK_EXE      = $(LINK) $(OS_LFLAGS) $(LFLAGS)
+LINK_DLL      = $(LD) $(OS_DLLFLAGS) $(DLLFLAGS)
+LINK_EXE      = $(LD) $(OS_LFLAGS) $(LFLAGS)
 CFLAGS        = $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
 		$(XCFLAGS)
 PERL          = perl
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/security/manager/Makefile.in comm-1.9.1/mozilla/security/manager/Makefile.in
--- comm-1.9.1.orig/mozilla/security/manager/Makefile.in	2010-11-26 07:27:01 +0900
+++ comm-1.9.1/mozilla/security/manager/Makefile.in	2010-11-30 03:10:24 +0900
@@ -43,6 +43,8 @@
 
 include $(DEPTH)/config/autoconf.mk
 
+export MOZ_OPTIMIZE MOZ_OPTIMIZE_FLAGS MOZ_OPTIMIZE_LDFLAGS MOZ_OPTIMIZE_SIZE_TWEAK
+
 MODULE = psm
 
 ifndef MOZ_NATIVE_NSS
@@ -239,7 +241,7 @@
 	NATIVE_CC="$(HOST_CC)" \
 	CC="$(CC)" \
 	CCC="$(CXX)" \
-	LINK="$(LD)" \
+	LD="$(LD)" \
 	AS="$(AS)" \
 	AR='$(AR) $(AR_FLAGS:$@=$$@)' \
 	RANLIB="$(RANLIB)" \
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/security/nss/lib/freebl/config.mk comm-1.9.1/mozilla/security/nss/lib/freebl/config.mk
--- comm-1.9.1.orig/mozilla/security/nss/lib/freebl/config.mk	2010-11-26 07:27:04 +0900
+++ comm-1.9.1/mozilla/security/nss/lib/freebl/config.mk	2010-11-30 03:10:24 +0900
@@ -88,6 +88,7 @@
 ifndef WINCE
 ifdef NS_USE_GCC
 OS_LIBS += -lshell32
+DEFINES += -D_WIN32_IE=0x0500
 else
 OS_LIBS += shell32.lib
 endif
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/toolkit/components/places/src/Makefile.in comm-1.9.1/mozilla/toolkit/components/places/src/Makefile.in
--- comm-1.9.1.orig/mozilla/toolkit/components/places/src/Makefile.in	2010-11-26 07:27:07 +0900
+++ comm-1.9.1/mozilla/toolkit/components/places/src/Makefile.in	2010-11-30 03:10:24 +0900
@@ -43,8 +43,10 @@
 
 include $(DEPTH)/config/autoconf.mk
 
+ifneq (1_WINNT,$(GNU_CC)_$(OS_ARCH))
 # FIXME: bug 419893
 NO_PROFILE_GUIDED_OPTIMIZE = 1
+endif
 
 MODULE = places
 LIBRARY_NAME  = places
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/toolkit/mozapps/installer/packager.mk comm-1.9.1/mozilla/toolkit/mozapps/installer/packager.mk
--- comm-1.9.1.orig/mozilla/toolkit/mozapps/installer/packager.mk	2010-11-26 07:27:08 +0900
+++ comm-1.9.1/mozilla/toolkit/mozapps/installer/packager.mk	2010-11-30 03:10:24 +0900
@@ -140,9 +140,9 @@
 ifeq ($(MOZ_PKG_FORMAT),DMG)
 ifndef _APPNAME
 ifdef MOZ_DEBUG
-_APPNAME	= $(MOZ_APP_DISPLAYNAME)Debug.app
+_APPNAME	= $(MOZ_APP_NAME)Debug.app
 else
-_APPNAME	= $(MOZ_APP_DISPLAYNAME).app
+_APPNAME	= $(MOZ_APP_NAME).app
 endif
 endif
 ifndef _BINPATH
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.1.orig/mozilla/toolkit/mozapps/update/src/updater/updater.cpp comm-1.9.1/mozilla/toolkit/mozapps/update/src/updater/updater.cpp
--- comm-1.9.1.orig/mozilla/toolkit/mozapps/update/src/updater/updater.cpp	2010-11-26 07:27:08 +0900
+++ comm-1.9.1/mozilla/toolkit/mozapps/update/src/updater/updater.cpp	2010-11-30 03:10:24 +0900
@@ -1561,3 +1561,15 @@
   list.Finish(rv);
   return rv;
 }
+
+#if defined( XP_WIN ) && defined(__GNUC__)
+int main(int argc, char **argv){
+	wchar_t **argv_ = new wchar_t*[argc];
+	for(int i = 0; i < argc; i++){
+		int ws = MultiByteToWideChar(0, 0, argv[i], -1, NULL, 0);
+		argv_[i] = new wchar_t[ws];
+		MultiByteToWideChar(0, 0, argv[i], -1, argv_[i], ws);
+	}
+	return wmain(argc, argv_);
+}
+#endif

