diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/calendar/installer/Makefile.in comm-1.9.2/calendar/installer/Makefile.in
--- comm-1.9.2.orig/calendar/installer/Makefile.in	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/installer/Makefile.in	2011-03-06 02:11:49 +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.2.orig/calendar/installer/removed-files.in comm-1.9.2/calendar/installer/removed-files.in
--- comm-1.9.2.orig/calendar/installer/removed-files.in	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/installer/removed-files.in	2011-03-06 02:11:49 +0900
@@ -78,7 +78,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
@@ -94,137 +93,23 @@
 #
 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
-components/mozbrwsr.xpt
-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
@@ -260,7 +145,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.2.orig/calendar/lightning/content/lightning.js comm-1.9.2/calendar/lightning/content/lightning.js
--- comm-1.9.2.orig/calendar/lightning/content/lightning.js	2011-03-03 20:35:44 +0900
+++ comm-1.9.2/calendar/lightning/content/lightning.js	2011-03-06 02:11:49 +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.2.orig/calendar/providers/gdata/Makefile.in comm-1.9.2/calendar/providers/gdata/Makefile.in
--- comm-1.9.2.orig/calendar/providers/gdata/Makefile.in	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/providers/gdata/Makefile.in	2011-03-06 02:11:49 +0900
@@ -48,6 +48,7 @@
 DIST_FILES = install.rdf
 XPI_PKGNAME = gdata-provider
 STRIP_XPI = 1
+INSTALL_EXTENSION_ID = {a62ef8ec-5fdc-40c2-873c-223b8a6925cc}
 
 ifdef MOZILLA_1_9_2_BRANCH
 CALENDAR_VERSION := $(shell cat $(topsrcdir)/calendar/sunbird/config/version-192.txt)
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/calendar/sunbird/app/Makefile.in comm-1.9.2/calendar/sunbird/app/Makefile.in
--- comm-1.9.2.orig/calendar/sunbird/app/Makefile.in	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/sunbird/app/Makefile.in	2011-03-06 02:11:49 +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
@@ -305,7 +306,7 @@
 
 ifeq (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.2.orig/calendar/sunbird/app/profile/sunbird.js comm-1.9.2/calendar/sunbird/app/profile/sunbird.js
--- comm-1.9.2.orig/calendar/sunbird/app/profile/sunbird.js	2011-03-03 20:35:44 +0900
+++ comm-1.9.2/calendar/sunbird/app/profile/sunbird.js	2011-03-06 02:11:49 +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.2.orig/calendar/sunbird/branding/nightly/branding.nsi comm-1.9.2/calendar/sunbird/branding/nightly/branding.nsi
--- comm-1.9.2.orig/calendar/sunbird/branding/nightly/branding.nsi	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/sunbird/branding/nightly/branding.nsi	2011-03-06 02:11:49 +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.2.orig/calendar/sunbird/branding/nightly/configure.sh comm-1.9.2/calendar/sunbird/branding/nightly/configure.sh
--- comm-1.9.2.orig/calendar/sunbird/branding/nightly/configure.sh	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/sunbird/branding/nightly/configure.sh	2011-03-06 02:11:49 +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.2.orig/calendar/sunbird/branding/nightly/locales/en-US/brand.dtd comm-1.9.2/calendar/sunbird/branding/nightly/locales/en-US/brand.dtd
--- comm-1.9.2.orig/calendar/sunbird/branding/nightly/locales/en-US/brand.dtd	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/sunbird/branding/nightly/locales/en-US/brand.dtd	2011-03-06 02:11:49 +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.2.orig/calendar/sunbird/branding/nightly/locales/en-US/brand.properties comm-1.9.2/calendar/sunbird/branding/nightly/locales/en-US/brand.properties
--- comm-1.9.2.orig/calendar/sunbird/branding/nightly/locales/en-US/brand.properties	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/sunbird/branding/nightly/locales/en-US/brand.properties	2011-03-06 02:11:49 +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.2.orig/calendar/sunbird/config/version-192.txt comm-1.9.2/calendar/sunbird/config/version-192.txt
--- comm-1.9.2.orig/calendar/sunbird/config/version-192.txt	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/sunbird/config/version-192.txt	2011-03-06 02:11:49 +0900
@@ -1 +1 @@
-1.0b3pre
+1.0b2
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/calendar/sunbird/config/version.txt comm-1.9.2/calendar/sunbird/config/version.txt
--- comm-1.9.2.orig/calendar/sunbird/config/version.txt	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/calendar/sunbird/config/version.txt	2011-03-06 02:11:49 +0900
@@ -1 +1 @@
-1.1a1pre
+1.0b2
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/client.mk comm-1.9.2/client.mk
--- comm-1.9.2.orig/client.mk	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/client.mk	2011-03-06 02:11:49 +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
 
@@ -308,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
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/config/config.mk comm-1.9.2/config/config.mk
--- comm-1.9.2.orig/config/config.mk	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/config/config.mk	2011-03-06 02:11:49 +0900
@@ -404,8 +404,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
 
@@ -415,8 +417,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
@@ -848,7 +852,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.2.orig/config/rules.mk comm-1.9.2/config/rules.mk
--- comm-1.9.2.orig/config/rules.mk	2011-03-03 20:35:11 +0900
+++ comm-1.9.2/config/rules.mk	2011-03-06 02:11:49 +0900
@@ -961,9 +961,14 @@
 	  $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin
 endif
 ifdef SHARED_LIBRARY
+ifdef IS_COMPONENT
+	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
+	  $(SHARED_LIBRARY_NAME) $(DIST)/bin/components
+else
 	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(SHARED_LIBRARY_NAME) $(DIST)/bin
 endif
+endif
 endif # SHARED_LIBRARY || PROGRAM
 endif # WINNT_
 endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
@@ -1000,7 +1005,6 @@
 # creates OBJS, links with LIBS to create Foo
 #
 $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
-	@rm -f $@.manifest
 ifeq (WINCE,$(OS_ARCH))
 	$(LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 else
@@ -1008,17 +1012,13 @@
 	$(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 \
-			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
-			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		else \
 			echo "Embedding manifest from $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		fi; \
-	elif test -f "$(srcdir)/$@.manifest"; then \
-		echo "Embedding manifest from $(srcdir)/$@.manifest"; \
-		mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" -OUTPUTRESOURCE:$@\;1; \
+		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
 ifdef MOZ_PROFILE_GENERATE
 # touch it a few seconds into the future to work around FAT's
@@ -1055,16 +1055,8 @@
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
-		if test -f "$(srcdir)/$@.manifest"; then \
-			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
-			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		else \
 			echo "Embedding manifest from $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		fi; \
-	elif test -f "$(srcdir)/$@.manifest"; then \
-		echo "Embedding manifest from $(srcdir)/$@.manifest"; \
-		mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" -OUTPUTRESOURCE:$@\;1; \
 	fi
 endif	# MSVC with manifest tool
 else
@@ -1846,10 +1838,26 @@
 ifneq (,$(wildcard $(JAR_MANIFEST)))
 ifndef NO_DIST_INSTALL
 libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
+	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.2.orig/configure comm-1.9.2/configure
--- comm-1.9.2.orig/configure	2011-03-03 20:43:15 +0900
+++ comm-1.9.2/configure	2011-03-06 02:11:49 +0900
@@ -3508,6 +3508,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 }'`
@@ -6997,7 +6998,7 @@
         XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc'
 fi
         DLL_PREFIX=
-        IMPORT_LIB_SUFFIX=dll.a
+        IMPORT_LIB_SUFFIX=a
     else
         TARGET_COMPILER_ABI=msvc
         HOST_CC='$(CC)'
@@ -16667,9 +16668,6 @@
 #define MOZ_MEMORY_WINDOWS 1
 EOF
 
-        if test "$CC_VERSION" != "14.00.50727.762" -a "$CC_VERSION" != "15.00.30729.01"; then
-        { echo "configure: error: Building jemalloc requires exactly Visual C++ 2005 SP1 or 2008 SP1 currently." 1>&2; exit 1; }
-    fi
     if test -z "$WIN32_CRT_SRC_DIR"; then
       if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
         { echo "configure: error: When building jemalloc, set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src, but VCINSTALLDIR is not set, so I can't autodetect it for you)." 1>&2; exit 1; }
@@ -17496,7 +17494,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:17503: checking whether C compiler supports -fprofile-generate" >&5
@@ -17510,7 +17508,7 @@
 EOF
 if { (eval echo configure:17512: \"$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
@@ -17522,9 +17520,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.2.orig/directory/sdks/c-sdk/config/WIN32.mk comm-1.9.2/directory/sdks/c-sdk/config/WIN32.mk
--- comm-1.9.2.orig/directory/sdks/c-sdk/config/WIN32.mk	2011-03-03 20:43:12 +0900
+++ comm-1.9.2/directory/sdks/c-sdk/config/WIN32.mk	2011-03-06 02:11:49 +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.2.orig/directory/sdks/c-sdk/config/config.mk comm-1.9.2/directory/sdks/c-sdk/config/config.mk
--- comm-1.9.2.orig/directory/sdks/c-sdk/config/config.mk	2011-03-03 20:43:13 +0900
+++ comm-1.9.2/directory/sdks/c-sdk/config/config.mk	2011-03-06 02:11:49 +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.2.orig/directory/sdks/c-sdk/config/rules.mk comm-1.9.2/directory/sdks/c-sdk/config/rules.mk
--- comm-1.9.2.orig/directory/sdks/c-sdk/config/rules.mk	2011-03-03 20:43:12 +0900
+++ comm-1.9.2/directory/sdks/c-sdk/config/rules.mk	2011-03-06 02:11:49 +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.2.orig/directory/sdks/c-sdk/config/win16.mk comm-1.9.2/directory/sdks/c-sdk/config/win16.mk
--- comm-1.9.2.orig/directory/sdks/c-sdk/config/win16.mk	2011-03-03 20:43:12 +0900
+++ comm-1.9.2/directory/sdks/c-sdk/config/win16.mk	2011-03-06 02:11:49 +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.2.orig/directory/sdks/c-sdk/ldap/examples/win32.mak comm-1.9.2/directory/sdks/c-sdk/ldap/examples/win32.mak
--- comm-1.9.2.orig/directory/sdks/c-sdk/ldap/examples/win32.mak	2011-03-03 20:43:12 +0900
+++ comm-1.9.2/directory/sdks/c-sdk/ldap/examples/win32.mak	2011-03-06 02:11:49 +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.2.orig/mail/app/Makefile.in comm-1.9.2/mail/app/Makefile.in
--- comm-1.9.2.orig/mail/app/Makefile.in	2011-03-03 20:35:44 +0900
+++ comm-1.9.2/mail/app/Makefile.in	2011-03-06 02:11:49 +0900
@@ -172,6 +172,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
@@ -347,7 +348,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.2.orig/mail/app/profile/all-thunderbird.js comm-1.9.2/mail/app/profile/all-thunderbird.js
--- comm-1.9.2.orig/mail/app/profile/all-thunderbird.js	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/app/profile/all-thunderbird.js	2011-03-06 02:11:50 +0900
@@ -45,6 +45,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.2.orig/mail/branding/nightly/branding.nsi comm-1.9.2/mail/branding/nightly/branding.nsi
--- comm-1.9.2.orig/mail/branding/nightly/branding.nsi	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/branding/nightly/branding.nsi	2011-03-06 02:11:50 +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.2.orig/mail/branding/nightly/configure.sh comm-1.9.2/mail/branding/nightly/configure.sh
--- comm-1.9.2.orig/mail/branding/nightly/configure.sh	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/branding/nightly/configure.sh	2011-03-06 02:11:50 +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.2.orig/mail/branding/nightly/locales/en-US/brand.dtd comm-1.9.2/mail/branding/nightly/locales/en-US/brand.dtd
--- comm-1.9.2.orig/mail/branding/nightly/locales/en-US/brand.dtd	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/branding/nightly/locales/en-US/brand.dtd	2011-03-06 02:11:50 +0900
@@ -1,4 +1,4 @@
-<!ENTITY  brandShortName        "Shredder">
-<!ENTITY  brandFullName         "Shredder">
+<!ENTITY  brandShortName        "thunderbird">
+<!ENTITY  brandFullName         "thunderbird">
 <!ENTITY  vendorShortName       "mozilla.org">
 <!ENTITY  logoTrademark         " ">
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mail/branding/nightly/locales/en-US/brand.properties comm-1.9.2/mail/branding/nightly/locales/en-US/brand.properties
--- comm-1.9.2.orig/mail/branding/nightly/locales/en-US/brand.properties	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/branding/nightly/locales/en-US/brand.properties	2011-03-06 02:11:50 +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.2.orig/mail/branding/unofficial/branding.nsi comm-1.9.2/mail/branding/unofficial/branding.nsi
--- comm-1.9.2.orig/mail/branding/unofficial/branding.nsi	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/branding/unofficial/branding.nsi	2011-03-06 02:11:50 +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 "Lanikai"
+!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.2.orig/mail/branding/unofficial/configure.sh comm-1.9.2/mail/branding/unofficial/configure.sh
--- comm-1.9.2.orig/mail/branding/unofficial/configure.sh	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/branding/unofficial/configure.sh	2011-03-06 02:11:50 +0900
@@ -1 +1 @@
-MOZ_APP_DISPLAYNAME=Lanikai
+MOZ_APP_DISPLAYNAME=Thunderbird
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mail/branding/unofficial/locales/en-US/brand.dtd comm-1.9.2/mail/branding/unofficial/locales/en-US/brand.dtd
--- comm-1.9.2.orig/mail/branding/unofficial/locales/en-US/brand.dtd	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/branding/unofficial/locales/en-US/brand.dtd	2011-03-06 02:11:50 +0900
@@ -1,4 +1,4 @@
-<!ENTITY  brandShortName        "Lanikai">
-<!ENTITY  brandFullName         "Lanikai">
+<!ENTITY  brandShortName        "thunderbird">
+<!ENTITY  brandFullName         "thunderbird">
 <!ENTITY  vendorShortName       "mozilla.org">
 <!ENTITY  logoTrademark         " ">
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mail/branding/unofficial/locales/en-US/brand.properties comm-1.9.2/mail/branding/unofficial/locales/en-US/brand.properties
--- comm-1.9.2.orig/mail/branding/unofficial/locales/en-US/brand.properties	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/branding/unofficial/locales/en-US/brand.properties	2011-03-06 02:11:50 +0900
@@ -1,3 +1,3 @@
-brandShortName=Lanikai
-brandFullName=Lanikai
+brandShortName=thunderbird
+brandFullName=thunderbird
 vendorShortName=mozilla.org
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mail/installer/Makefile.in comm-1.9.2/mail/installer/Makefile.in
--- comm-1.9.2.orig/mail/installer/Makefile.in	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/installer/Makefile.in	2011-03-06 02:11:50 +0900
@@ -46,7 +46,9 @@
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
+ifneq (,$(BUILD_STATIC_LIBS)$(MOZ_ENABLE_LIBXUL))
 MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
+endif
 
 MOZ_NONLOCALIZED_PKG_LIST = \
 	xpcom \
@@ -92,7 +94,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.2.orig/mail/installer/windows/nsis/defines.nsi.in comm-1.9.2/mail/installer/windows/nsis/defines.nsi.in
--- comm-1.9.2.orig/mail/installer/windows/nsis/defines.nsi.in	2011-03-03 20:35:12 +0900
+++ comm-1.9.2/mail/installer/windows/nsis/defines.nsi.in	2011-03-06 02:11:50 +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.2.orig/mozconfig comm-1.9.2/mozconfig
--- comm-1.9.2.orig/mozconfig	1970-01-01 09:00:00 +0900
+++ comm-1.9.2/mozconfig	2011-03-06 02:11:50 +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.2.orig/mozilla/Makefile.in comm-1.9.2/mozilla/Makefile.in
--- comm-1.9.2.orig/mozilla/Makefile.in	2011-03-03 20:42:22 +0900
+++ comm-1.9.2/mozilla/Makefile.in	2011-03-06 02:11:50 +0900
@@ -93,7 +93,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.2.orig/mozilla/build/automation-build.mk comm-1.9.2/mozilla/build/automation-build.mk
--- comm-1.9.2.orig/mozilla/build/automation-build.mk	2011-03-03 20:42:23 +0900
+++ comm-1.9.2/mozilla/build/automation-build.mk	2011-03-06 02:11:50 +0900
@@ -11,9 +11,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.2.orig/mozilla/client.mk comm-1.9.2/mozilla/client.mk
--- comm-1.9.2.orig/mozilla/client.mk	2011-03-03 20:42:23 +0900
+++ comm-1.9.2/mozilla/client.mk	2011-03-06 02:11:50 +0900
@@ -136,7 +136,7 @@
 
 
 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
 
@@ -316,8 +316,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
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/config/config.mk comm-1.9.2/mozilla/config/config.mk
--- comm-1.9.2.orig/mozilla/config/config.mk	2011-03-03 20:42:23 +0900
+++ comm-1.9.2/mozilla/config/config.mk	2011-03-06 02:11:50 +0900
@@ -392,8 +392,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
 
@@ -403,8 +405,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
@@ -843,7 +847,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.2.orig/mozilla/config/rules.mk comm-1.9.2/mozilla/config/rules.mk
--- comm-1.9.2.orig/mozilla/config/rules.mk	2011-03-03 20:42:23 +0900
+++ comm-1.9.2/mozilla/config/rules.mk	2011-03-06 02:11:50 +0900
@@ -933,10 +933,15 @@
 	  $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin
 endif
 ifdef SHARED_LIBRARY
+ifdef IS_COMPONENT
+	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
+	  $(SHARED_LIBRARY_NAME) $(DIST)/bin/components
+else
 	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(SHARED_LIBRARY_NAME) $(DIST)/bin
 endif
 endif
+endif
 endif # MOZ_PROFILE_USE
 endif # WINNT_
 endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
@@ -973,7 +978,6 @@
 # creates OBJS, links with LIBS to create Foo
 #
 $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
-	@rm -f $@.manifest
 ifeq (WINCE,$(OS_ARCH))
 	$(LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 else
@@ -981,17 +985,13 @@
 	$(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 \
-			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
-			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		else \
 			echo "Embedding manifest from $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		fi; \
-	elif test -f "$(srcdir)/$@.manifest"; then \
-		echo "Embedding manifest from $(srcdir)/$@.manifest"; \
-		mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" -OUTPUTRESOURCE:$@\;1; \
+		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)
@@ -1023,12 +1023,7 @@
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_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; \
 	fi
 endif	# MSVC with manifest tool
 else
@@ -1872,10 +1867,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.2.orig/mozilla/config/uiAccess.manifest comm-1.9.2/mozilla/config/uiAccess.manifest
--- comm-1.9.2.orig/mozilla/config/uiAccess.manifest	1970-01-01 09:00:00 +0900
+++ comm-1.9.2/mozilla/config/uiAccess.manifest	2011-03-06 02:11:52 +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.2.orig/mozilla/config/win7.manifest comm-1.9.2/mozilla/config/win7.manifest
--- comm-1.9.2.orig/mozilla/config/win7.manifest	1970-01-01 09:00:00 +0900
+++ comm-1.9.2/mozilla/config/win7.manifest	2011-03-06 02:11:52 +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.2.orig/mozilla/configure comm-1.9.2/mozilla/configure
--- comm-1.9.2.orig/mozilla/configure	2011-03-03 20:43:15 +0900
+++ comm-1.9.2/mozilla/configure	2011-03-06 02:11:50 +0900
@@ -3263,6 +3263,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
@@ -3534,6 +3547,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 }'`
@@ -7038,7 +7052,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)'
@@ -20134,7 +20148,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:20141: checking whether C compiler supports -fprofile-generate" >&5
@@ -20148,7 +20162,7 @@
 EOF
 if { (eval echo configure:20150: \"$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
@@ -20160,9 +20174,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
@@ -21948,7 +21970,7 @@
     fi
     if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
         WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
-        if test -z "$WINCE"; then
+        if test -z "$WINCE" && test -z "$MOZ_TREE_FREETYPE"; then
             WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
         else
             WIN32_FONT_FEATURE=
@@ -21959,7 +21981,6 @@
 #include "confdefs.h"
 #include <ddraw.h>
 int main() {
-int foo = DDLOCK_WAITNOTBUSY;
 ; return 0; }
 EOF
 if { (eval echo configure:21966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
@@ -21972,8 +21993,8 @@
   HAS_DDRAW=
 fi
 rm -f conftest*
-        if test -z "$HAS_DDRAW"; then
-            echo "configure: warning: DirectDraw ddraw.h header not found or it's missing DDLOCK_WAITNOTBUSY, disabling DirectDraw surface.  If you have an older SDK (such as the CE5 SDK), try copying in ddraw.lib and ddraw.h from the WM6 SDK." 1>&2
+        if test -z "$HAS_DDRAW" || test -z "$MOZ_TREE_FREETYPE"; then
+            echo "configure: warning: DirectDraw ddraw.h header not found or --enable-tree-freetype not used, disabling DirectDraw surface.  If you have an older SDK (such as the CE5 SDK), try copying in ddraw.lib and ddraw.h from the WM6 SDK. and use --enable-tree-freetype." 1>&2
             DDRAW_SURFACE_FEATURE=
         else
             DDRAW_SURFACE_FEATURE="#define CAIRO_HAS_DDRAW_SURFACE 1"
@@ -24343,9 +24364,7 @@
     if test -n "$DSO_PIC_CFLAGS"; then
       ac_configure_args="$ac_configure_args --with-pic"
     fi
-    if test -n "$CROSS_COMPILE"; then
       ac_configure_args="$ac_configure_args --build=$build --host=$target"
-    fi
     if test "$SOLARIS_SUNPRO_CC"; then
       # Always use gcc for libffi on Solaris
       old_cache_file=$cache_file
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/Makefile.in comm-1.9.2/mozilla/gfx/cairo/cairo/src/Makefile.in
--- comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/Makefile.in	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/cairo/src/Makefile.in	2011-03-06 02:11:50 +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) \
@@ -157,7 +152,7 @@
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 CSRCS	+=	cairo-win32-surface.c
 
-ifndef WINCE
+ifeq (,$(WINCE)$(MOZ_TREE_FREETYPE))
 CSRCS	+=	cairo-win32-font.c
 else
 CSRCS	+=	cairo-ddraw-surface.c
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-ddraw-surface.c comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-ddraw-surface.c
--- comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-ddraw-surface.c	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-ddraw-surface.c	2011-03-06 02:11:50 +0900
@@ -48,11 +48,15 @@
 #include <ddraw.h>
 #include <stddef.h>
 #include <stdarg.h>
+#ifdef WINCE
 #include <cmnintrin.h>
+#endif
 
 #ifndef DDLOCK_WAITNOTBUSY
-#error Your DirectDraw header is too old.  Copy in ddraw.h from the WM6 SDK over your SDK's ddraw.h.
-#error Otherwise, you can fix this code to use IDirectDraw4 and IDirectDrawSurface5.
+#define DDLOCK_WAITNOTBUSY DDLOCK_WAIT
+#endif
+#ifndef DDBLT_WAITNOTBUSY
+#define DDBLT_WAITNOTBUSY DDBLT_WAIT
 #endif
 
 /* DirectDraw helper macros */
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-font-options.c comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-font-options.c
--- comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-font-options.c	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-font-options.c	2011-03-06 02:11:50 +0900
@@ -38,6 +38,8 @@
 
 static const cairo_font_options_t _cairo_font_options_nil = {
     CAIRO_ANTIALIAS_DEFAULT,
+    CAIRO_FONT_SLANT_NORMAL,
+    CAIRO_FONT_WEIGHT_NORMAL,
     CAIRO_SUBPIXEL_ORDER_DEFAULT,
     CAIRO_HINT_STYLE_DEFAULT,
     CAIRO_HINT_METRICS_DEFAULT
@@ -53,6 +55,8 @@
 _cairo_font_options_init_default (cairo_font_options_t *options)
 {
     options->antialias = CAIRO_ANTIALIAS_DEFAULT;
+    options->font_slant = CAIRO_FONT_SLANT_NORMAL;
+    options->font_weight = CAIRO_FONT_WEIGHT_NORMAL;
     options->subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
     options->hint_style = CAIRO_HINT_STYLE_DEFAULT;
     options->hint_metrics = CAIRO_HINT_METRICS_DEFAULT;
@@ -63,6 +67,8 @@
 			       const cairo_font_options_t	*other)
 {
     options->antialias = other->antialias;
+    options->font_slant = other->font_slant;
+    options->font_weight = other->font_weight;
     options->subpixel_order = other->subpixel_order;
     options->hint_style = other->hint_style;
     options->hint_metrics = other->hint_metrics;
@@ -187,6 +193,10 @@
 
     if (other->antialias != CAIRO_ANTIALIAS_DEFAULT)
 	options->antialias = other->antialias;
+    if (other->font_slant != CAIRO_FONT_SLANT_NORMAL)
+	options->font_slant = other->font_slant;
+    if (other->font_weight != CAIRO_FONT_WEIGHT_NORMAL)
+	options->font_weight = other->font_weight;
     if (other->subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT)
 	options->subpixel_order = other->subpixel_order;
     if (other->hint_style != CAIRO_HINT_STYLE_DEFAULT)
@@ -220,6 +230,8 @@
 	return TRUE;
 
     return (options->antialias == other->antialias &&
+	    options->font_slant == other->font_slant &&
+	    options->font_weight == other->font_weight &&
 	    options->subpixel_order == other->subpixel_order &&
 	    options->hint_style == other->hint_style &&
 	    options->hint_metrics == other->hint_metrics);
@@ -245,6 +257,8 @@
 	options = &_cairo_font_options_nil; /* force default values */
 
     return ((options->antialias) |
+	    (options->font_slant << 28) |
+	    (options->font_weight << 30) |
 	    (options->subpixel_order << 4) |
 	    (options->hint_style << 8) |
 	    (options->hint_metrics << 16));
@@ -288,6 +302,66 @@
 }
 
 /**
+ * cairo_font_options_set_font_slant:
+ * @options: a #cairo_font_options_t
+ * @font_slant: the new font slant
+ **/
+void
+cairo_font_options_set_font_slant (cairo_font_options_t *options,
+				   cairo_font_slant_t    font_slant)
+{
+    if (cairo_font_options_status (options))
+	return;
+
+    options->font_slant = font_slant;
+}
+slim_hidden_def (cairo_font_options_set_font_slant);
+
+/**
+ * cairo_font_options_get_font_slant:
+ * @options: a #cairo_font_options_t
+ * Return value: the font slant
+ **/
+cairo_font_slant_t
+cairo_font_options_get_font_slant (const cairo_font_options_t *options)
+{
+    if (cairo_font_options_status ((cairo_font_options_t *) options))
+	return CAIRO_FONT_SLANT_NORMAL;
+
+    return options->font_slant;
+}
+
+/**
+ * cairo_font_options_set_font_weight:
+ * @options: a #cairo_font_options_t
+ * @font_weight: the new font weight
+ **/
+void
+cairo_font_options_set_font_weight (cairo_font_options_t *options,
+				   cairo_font_weight_t   font_weight)
+{
+    if (cairo_font_options_status (options))
+	return;
+
+    options->font_weight = font_weight;
+}
+slim_hidden_def (cairo_font_options_set_font_weight);
+
+/**
+ * cairo_font_options_get_font_weight:
+ * @options: a #cairo_font_options_t
+ * Return value: the font weight
+ **/
+cairo_font_weight_t
+cairo_font_options_get_font_weight (const cairo_font_options_t *options)
+{
+    if (cairo_font_options_status ((cairo_font_options_t *) options))
+	return CAIRO_FONT_WEIGHT_NORMAL;
+
+    return options->font_weight;
+}
+
+/**
  * cairo_font_options_set_subpixel_order:
  * @options: a #cairo_font_options_t
  * @subpixel_order: the new subpixel order
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-ft-font.c comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-ft-font.c
--- comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-ft-font.c	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-ft-font.c	2011-03-06 02:11:50 +0900
@@ -1567,6 +1567,13 @@
     _cairo_font_options_init_copy (&scaled_font->ft_options.base, options);
     _cairo_ft_options_merge (&scaled_font->ft_options, &ft_options);
 
+#if defined(XP_WIN) && !defined(WINCE)
+    scaled_font->ft_options.load_flags |= FT_LOAD_NO_BITMAP;
+    if (options->font_weight == CAIRO_FONT_WEIGHT_BOLD) {
+        scaled_font->ft_options.extra_flags |= CAIRO_FT_OPTIONS_EMBOLDEN;
+    }
+#endif
+
     status = _cairo_scaled_font_init (&scaled_font->base,
 			              font_face,
 				      font_matrix, ctm, options,
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-rename.h comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-rename.h
--- comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-rename.h	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-rename.h	2011-03-06 02:11:51 +0900
@@ -35,6 +35,8 @@
 #define cairo_font_options_destroy _moz_cairo_font_options_destroy
 #define cairo_font_options_equal _moz_cairo_font_options_equal
 #define cairo_font_options_get_antialias _moz_cairo_font_options_get_antialias
+#define cairo_font_options_get_font_slant _moz_cairo_font_options_get_font_slant
+#define cairo_font_options_get_font_weight _moz_cairo_font_options_get_font_weight
 #define cairo_font_options_get_hint_metrics _moz_cairo_font_options_get_hint_metrics
 #define cairo_font_options_get_hint_style _moz_cairo_font_options_get_hint_style
 #define cairo_font_options_get_lcd_filter _moz_cairo_font_options_get_lcd_filter
@@ -42,6 +44,8 @@
 #define cairo_font_options_hash _moz_cairo_font_options_hash
 #define cairo_font_options_merge _moz_cairo_font_options_merge
 #define cairo_font_options_set_antialias _moz_cairo_font_options_set_antialias
+#define cairo_font_options_get_font_slant _moz_cairo_font_options_get_font_slant
+#define cairo_font_options_set_font_weight _moz_cairo_font_options_set_font_weight
 #define cairo_font_options_set_hint_metrics _moz_cairo_font_options_set_hint_metrics
 #define cairo_font_options_set_hint_style _moz_cairo_font_options_set_hint_style
 #define cairo_font_options_set_lcd_filter _moz_cairo_font_options_set_lcd_filter
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-types-private.h comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-types-private.h
--- comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo-types-private.h	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo-types-private.h	2011-03-06 02:11:51 +0900
@@ -117,6 +117,8 @@
 
 struct _cairo_font_options {
     cairo_antialias_t antialias;
+    cairo_font_slant_t font_slant;
+    cairo_font_weight_t font_weight;
     cairo_subpixel_order_t subpixel_order;
     cairo_hint_style_t hint_style;
     cairo_hint_metrics_t hint_metrics;
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo.h comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo.h
--- comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairo.h	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairo.h	2011-03-06 02:11:51 +0900
@@ -1155,6 +1155,18 @@
 cairo_font_options_get_antialias (const cairo_font_options_t *options);
 
 cairo_public void
+cairo_font_options_set_font_slant (cairo_font_options_t *options,
+				   cairo_font_slant_t    font_slant);
+cairo_public cairo_font_slant_t
+cairo_font_options_get_font_slant (const cairo_font_options_t *options);
+
+cairo_public void
+cairo_font_options_set_font_weight (cairo_font_options_t *options,
+				   cairo_font_weight_t   font_weight);
+cairo_public cairo_font_weight_t
+cairo_font_options_get_font_weight (const cairo_font_options_t *options);
+
+cairo_public void
 cairo_font_options_set_subpixel_order (cairo_font_options_t   *options,
 				       cairo_subpixel_order_t  subpixel_order);
 cairo_public cairo_subpixel_order_t
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairoint.h comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairoint.h
--- comm-1.9.2.orig/mozilla/gfx/cairo/cairo/src/cairoint.h	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/cairo/src/cairoint.h	2011-03-06 02:11:51 +0900
@@ -2619,6 +2619,8 @@
 slim_hidden_proto (cairo_font_options_hash);
 slim_hidden_proto (cairo_font_options_merge);
 slim_hidden_proto (cairo_font_options_set_antialias);
+slim_hidden_proto (cairo_font_options_set_font_slant);
+slim_hidden_proto (cairo_font_options_set_font_weight);
 slim_hidden_proto (cairo_font_options_set_hint_metrics);
 slim_hidden_proto (cairo_font_options_set_hint_style);
 slim_hidden_proto (cairo_font_options_set_subpixel_order);
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/libpixman/src/Makefile.in comm-1.9.2/mozilla/gfx/cairo/libpixman/src/Makefile.in
--- comm-1.9.2.orig/mozilla/gfx/cairo/libpixman/src/Makefile.in	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/libpixman/src/Makefile.in	2011-03-06 02:11:51 +0900
@@ -54,11 +54,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
 
 # Build MMX code either with VC or with gcc-on-x86
@@ -159,7 +154,13 @@
 
 LOCAL_INCLUDES	+= -I$(srcdir) -I$(srcdir)/../../cairo/src
 
+ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+MAPFILE	= $(LIBRARY_NAME).map
+DEFFILE	= $(win_srcdir)/$(LIBRARY_NAME).def
+NO_PROFILE_GUIDED_OPTIMIZE = 1
+else
 FORCE_STATIC_LIB = 1
+endif
 # This library is used by other shared libs in a static build
 FORCE_USE_PIC = 1
 
@@ -197,3 +198,7 @@
 	$(REPORT_BUILD)
 	@$(MAKE_DEPS_AUTO_CC)
 	$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(ARM_NEON_CFLAGS) $(_VPATH_SRCS)
+
+#$(DEFFILE): $(OBJS)
+#	echo EXPORTS > $(DEFFILE)
+#	dumpbin -SYMBOLS *.obj | gawk '$$3 ~ /^SECT/ && $$5 == "()" && $$6 == "External" {print $$8}' | sed 's/^_//' >> $(DEFFILE)
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/cairo/libpixman/src/mozlibpixman.def comm-1.9.2/mozilla/gfx/cairo/libpixman/src/mozlibpixman.def
--- comm-1.9.2.orig/mozilla/gfx/cairo/libpixman/src/mozlibpixman.def	1970-01-01 09:00:00 +0900
+++ comm-1.9.2/mozilla/gfx/cairo/libpixman/src/mozlibpixman.def	2011-03-06 02:11:52 +0900
@@ -0,0 +1,35 @@
+EXPORTS
+_moz_pixman_image_set_component_alpha
+pixman_image_get_component_alpha
+_moz_pixman_image_composite
+_moz_pixman_image_set_repeat
+_moz_pixman_image_set_transform
+_moz_pixman_image_set_filter
+_moz_pixman_image_unref
+_moz_pixman_image_create_radial_gradient
+_moz_pixman_image_create_linear_gradient
+_moz_pixman_image_get_depth
+_moz_pixman_image_get_stride
+_moz_pixman_image_get_height
+_moz_pixman_image_get_width
+_moz_pixman_image_get_data
+_moz_pixman_image_create_bits
+_moz_pixman_image_fill_rectangles
+_moz_pixman_add_trapezoids
+_moz_pixman_image_set_clip_region32
+_moz_pixman_format_supported_destination
+_moz_pixman_transform_point_3d
+_moz_pixman_region32_copy
+_moz_pixman_region32_init
+_moz_pixman_region32_init_rect
+_moz_pixman_region32_fini
+_moz_pixman_region32_n_rects
+_moz_pixman_region32_rectangles
+_moz_pixman_region32_extents
+_moz_pixman_region32_subtract
+_moz_pixman_region32_intersect
+_moz_pixman_region32_union
+_moz_pixman_region32_not_empty
+_moz_pixman_region32_translate
+_moz_pixman_region32_contains_rectangle
+_moz_pixman_region32_contains_point
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/thebes/public/Makefile.in comm-1.9.2/mozilla/gfx/thebes/public/Makefile.in
--- comm-1.9.2.orig/mozilla/gfx/thebes/public/Makefile.in	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/thebes/public/Makefile.in	2011-03-06 02:11:51 +0900
@@ -44,7 +44,7 @@
 		$(NULL)
 EXPORTS +=	gfxPDFSurface.h
 
-ifdef WINCE
+ifneq (,$(WINCE)$(MOZ_TREE_FREETYPE))
 EXPORTS +=	gfxFT2Fonts.h \
 		gfxFT2FontBase.h \
 		gfxDDrawSurface.h \
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/thebes/public/gfxWindowsPlatform.h comm-1.9.2/mozilla/gfx/thebes/public/gfxWindowsPlatform.h
--- comm-1.9.2.orig/mozilla/gfx/thebes/public/gfxWindowsPlatform.h	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/thebes/public/gfxWindowsPlatform.h	2011-03-06 02:11:51 +0900
@@ -39,7 +39,7 @@
 #ifndef GFX_WINDOWS_PLATFORM_H
 #define GFX_WINDOWS_PLATFORM_H
 
-#if defined(WINCE)
+#if defined(WINCE) || defined(MOZ_TREE_FREETYPE)
 #define MOZ_FT2_FONTS 1
 #endif
 
@@ -159,6 +159,7 @@
     FT_Library GetFTLibrary();
 private:
     void AppendFacesFromFontFile(const PRUnichar *aFileName);
+    void AppendFacesFromFontFileByUnicodeName(FontEntry* fe);
     void FindFonts();
 #endif
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/thebes/src/Makefile.in comm-1.9.2/mozilla/gfx/thebes/src/Makefile.in
--- comm-1.9.2.orig/mozilla/gfx/thebes/src/Makefile.in	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/thebes/src/Makefile.in	2011-03-06 02:11:51 +0900
@@ -63,13 +63,12 @@
 		nsUnicodeRange.cpp \
 		$(NULL)
 
-ifdef WINCE
+ifneq (,$(WINCE)$(MOZ_TREE_FREETYPE))
 CPPSRCS	+= gfxFT2Fonts.cpp \
 	   gfxFT2FontBase.cpp \
 	   gfxFT2Utils.cpp \
 	   gfxDDrawSurface.cpp \
 	   $(NULL)
-EXTRA_DSO_LDOPTS += ddraw.lib
 else
 CPPSRCS	+= gfxWindowsFonts.cpp 
 endif
@@ -190,8 +189,15 @@
 CFLAGS += $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-ifdef WINCE
+ifneq (,$(WINCE)$(MOZ_TREE_FREETYPE))
 CXXFLAGS += $(CAIRO_FT_CFLAGS)
+ifndef WINCE
+OS_LIBS += shell32.lib
+endif
+OS_LIBS += ddraw.lib
+endif
+ifdef MOZ_TREE_FREETYPE
+LDFLAGS += $(FT2_LIBS)
 endif
 endif
 
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/thebes/src/gfxFT2Fonts.cpp comm-1.9.2/mozilla/gfx/thebes/src/gfxFT2Fonts.cpp
--- comm-1.9.2.orig/mozilla/gfx/thebes/src/gfxFT2Fonts.cpp	2011-03-03 20:42:31 +0900
+++ comm-1.9.2/mozilla/gfx/thebes/src/gfxFT2Fonts.cpp	2011-03-06 02:11:51 +0900
@@ -175,6 +175,10 @@
         FT_Done_Face(aFace);
         return nsnull;
     }
+    if (!strcmp("Meiryo", aFace->family_name) && (aFace->style_flags & FT_STYLE_FLAG_ITALIC)) {
+        FT_Done_Face(aFace);
+        return nsnull;
+    }
     // Construct font name from family name and style name, regular fonts
     // do not have the modifier by convention.
     NS_ConvertUTF8toUTF16 fontName(aFace->family_name);
@@ -862,6 +866,19 @@
     }
 
     cairo_font_options_t *fontOptions = cairo_font_options_create();
+
+#if defined(XP_WIN) && !defined(WINCE)
+    PRBool needsEmbolden = (!aFontEntry->IsBold() && (aStyle->weight > FONT_WEIGHT_NORMAL));
+    if (needsEmbolden) {
+        const double width = 1.03125;
+        const double widthByStyle = (aStyle->size + 1.0) / aStyle->size;
+        cairo_matrix_t identityStyle;
+        cairo_matrix_init_scale(&identityStyle, (width > widthByStyle) ? width : widthByStyle, 1.0);
+        cairo_matrix_multiply(&identityMatrix, &identityMatrix, &identityStyle);
+        cairo_font_options_set_font_weight(fontOptions, CAIRO_FONT_WEIGHT_BOLD);
+    }
+#endif
+
     scaledFont = cairo_scaled_font_create(aFontEntry->CairoFontFace(),
                                           &sizeMatrix,
                                           &identityMatrix, fontOptions);
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/gfx/thebes/src/gfxWindowsPlatform.cpp comm-1.9.2/mozilla/gfx/thebes/src/gfxWindowsPlatform.cpp
--- comm-1.9.2.orig/mozilla/gfx/thebes/src/gfxWindowsPlatform.cpp	2011-03-03 20:42:32 +0900
+++ comm-1.9.2/mozilla/gfx/thebes/src/gfxWindowsPlatform.cpp	2011-03-06 02:11:51 +0900
@@ -67,13 +67,20 @@
 /*XXX to get CAIRO_HAS_DDRAW_SURFACE */
 #include "cairo.h"
 
+#ifdef MOZ_FT2_FONTS
+#include "freetype/ftsnames.h"
+#include "freetype/ttnameid.h"
 #ifdef WINCE
 #include <shlwapi.h>
+#else
+#include <ShlObj.h>
+#define FindNextFile FindNextFileW
+#endif
+#endif
 
 #ifdef CAIRO_HAS_DDRAW_SURFACE
 #include "gfxDDrawSurface.h"
 #endif
-#endif
 
 #include "gfxUserFontSet.h"
 
@@ -303,14 +310,17 @@
             FontEntry* fe = FontEntry::CreateFontEntryFromFace(face);
             if (fe) {
                 NS_ConvertUTF8toUTF16 name(face->family_name);
+                nsString family_name(name);
                 BuildKeyNameFromFontName(name);       
                 nsRefPtr<FontFamily> ff;
                 if (!mFonts.Get(name, &ff)) {
-                    ff = new FontFamily(name);
+                    ff = new FontFamily(family_name);
                     mFonts.Put(name, ff);
                 }
                 ff->AddFontEntry(fe);
                 ff->SetHasStyles(PR_TRUE);
+
+                AppendFacesFromFontFileByUnicodeName(fe);
             }
         }
         FT_Done_Face(dummy);
@@ -318,6 +328,53 @@
 }
 
 void
+gfxWindowsPlatform::AppendFacesFromFontFileByUnicodeName(FontEntry* fe)
+{
+    FT_SfntName sfnt;
+    int bufsize;
+    unsigned char* string;
+    PRUnichar* namebuf;
+
+    FT_Face face = fe->mFTFace;
+    int n = FT_Get_Sfnt_Name_Count(face);
+    for (int i = 0; i < n; i++) {
+        if (FT_Get_Sfnt_Name(face, i, &sfnt)) {
+            continue;
+        }
+        if(!sfnt.string_len || sfnt.name_id != TT_NAME_ID_FONT_FAMILY){
+            continue;
+        }
+        if (!(sfnt.platform_id == TT_PLATFORM_APPLE_UNICODE && sfnt.encoding_id == TT_APPLE_ID_UNICODE_2_0)
+                && !(sfnt.platform_id == TT_PLATFORM_MICROSOFT && sfnt.encoding_id == TT_MS_ID_UNICODE_CS)
+                && !(sfnt.platform_id == TT_PLATFORM_MICROSOFT && sfnt.encoding_id == TT_MS_ID_UCS_4)
+                && !(sfnt.platform_id == TT_PLATFORM_ISO && sfnt.encoding_id == TT_ISO_ID_10646) ) {
+            continue;
+        }
+
+        bufsize = sfnt.string_len / 2;
+        string = (unsigned char*)sfnt.string;
+        namebuf = new PRUnichar[bufsize + 1];
+        for (int b = 0; b < bufsize; b++) {
+            namebuf[b] = (PRUnichar)(string[b * 2 + 0] << 8) | (PRUnichar)(string[b * 2 + 1]);
+        }
+        namebuf[bufsize] = 0;
+
+        nsString name(namebuf);
+        nsString family_name(name);
+        BuildKeyNameFromFontName(name);
+        nsRefPtr<FontFamily> ff;
+        if (!mFonts.Get(name, &ff)) {
+            ff = new FontFamily(family_name);
+            mFonts.Put(name, ff);
+        }
+        ff->AddFontEntry(fe);
+        ff->SetHasStyles(PR_TRUE);
+
+        delete [] namebuf;
+    }
+}
+
+void
 gfxWindowsPlatform::FindFonts()
 {
     nsTArray<nsString> searchPaths(3);
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/jpeg/Makefile.in comm-1.9.2/mozilla/jpeg/Makefile.in
--- comm-1.9.2.orig/mozilla/jpeg/Makefile.in	2011-03-03 20:42:33 +0900
+++ comm-1.9.2/mozilla/jpeg/Makefile.in	2011-03-06 02:11:51 +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.2.orig/mozilla/js/src/Makefile.in comm-1.9.2/mozilla/js/src/Makefile.in
--- comm-1.9.2.orig/mozilla/js/src/Makefile.in	2011-03-03 20:42:33 +0900
+++ comm-1.9.2/mozilla/js/src/Makefile.in	2011-03-06 02:11:51 +0900
@@ -54,10 +54,12 @@
 DIRS += editline
 endif
 
+ifneq (,$(GNU_CC)$(findstring --enable-application=xulrunner,$(ac_configure_args)))
 # editline needs to get built before the shell
 ifndef JS_DISABLE_SHELL
 DIRS += shell
 endif
+endif
 
 # FIXME: bug 515383 covers getting these working on wince
 ifndef WINCE
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/js/src/config/rules.mk comm-1.9.2/mozilla/js/src/config/rules.mk
--- comm-1.9.2.orig/mozilla/js/src/config/rules.mk	2011-03-03 20:42:33 +0900
+++ comm-1.9.2/mozilla/js/src/config/rules.mk	2011-03-06 02:11:51 +0900
@@ -973,7 +973,6 @@
 # creates OBJS, links with LIBS to create Foo
 #
 $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
-	@rm -f $@.manifest
 ifeq (WINCE,$(OS_ARCH))
 	$(LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 else
@@ -981,16 +980,9 @@
 	$(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 \
-			echo "Embedding manifest from $(srcdir)/$@.manifest and $@.manifest"; \
-			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		else \
 			echo "Embedding manifest from $@.manifest"; \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
-		fi; \
-	elif test -f "$(srcdir)/$@.manifest"; then \
-		echo "Embedding manifest from $(srcdir)/$@.manifest"; \
-		mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" -OUTPUTRESOURCE:$@\;1; \
+		mt.exe -NOLOGO -INPUTRESOURCE:$@\;1 -MANIFEST $(WIN_TOP_SRC)/../../config/uiAccess.manifest -OUTPUTRESOURCE:$@\;1; \
 	fi
 endif	# MSVC with manifest tool
 else
@@ -1023,12 +1015,7 @@
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(HOST_PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_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; \
 	fi
 endif	# MSVC with manifest tool
 else
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/js/src/configure comm-1.9.2/mozilla/js/src/configure
--- comm-1.9.2.orig/mozilla/js/src/configure	2011-03-03 20:43:16 +0900
+++ comm-1.9.2/mozilla/js/src/configure	2011-03-06 02:11:51 +0900
@@ -2764,6 +2764,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
@@ -7177,6 +7190,10 @@
     ENABLE_JIT=1
     NANOJIT_ARCH=i386
     ;;
+x86_64*-*)
+    ENABLE_JIT=1
+    NANOJIT_ARCH=X64
+    ;;
 arm*-*)
     ENABLE_JIT=1
     NANOJIT_ARCH=ARM
@@ -7219,6 +7236,14 @@
 
     ;;
 
+x86_64*-*)
+    cat >> confdefs.h <<\EOF
+#define AVMPLUS_AMD64 1
+#define AVMPLUS_64BIT 1
+EOF
+
+    ;;
+
 arm*-*)
     cat >> confdefs.h <<\EOF
 #define AVMPLUS_ARM 1
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/modules/freetype2/Makefile.in comm-1.9.2/mozilla/modules/freetype2/Makefile.in
--- comm-1.9.2.orig/mozilla/modules/freetype2/Makefile.in	2011-03-03 20:42:43 +0900
+++ comm-1.9.2/mozilla/modules/freetype2/Makefile.in	2011-03-06 02:11:51 +0900
@@ -48,6 +48,11 @@
 LIBXUL_LIBRARY = 1
 DIST_INSTALL = 1
 
+ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
+MAPFILE	= $(LIBRARY_NAME).map
+DEFFILE	= $(win_srcdir)/$(LIBRARY_NAME).def
+endif
+
 VPATH += @srcdir@/src/autofit 	\
 	@srcdir@/src/base 	\
 	@srcdir@/src/bdf/ 	\
@@ -79,7 +84,6 @@
 	ftbitmap.c	\
 	ftdebug.c	\
 	ftgasp.c	\
-	ftgloadr.c	\
 	ftglyph.c	\
 	ftinit.c	\
 	ftmm.c		\
@@ -127,7 +131,7 @@
 	$(NULL)
 
 
-DEFINES += -DFT2_BUILD_LIBRARY -DFT_OPTION_AUTOFIT2 -FI $(srcdir)/include/freetype/config/ftstdlib.h
+DEFINES += -DFT2_BUILD_LIBRARY -DFT_OPTION_AUTOFIT2
 
 ifdef WINCE
 DEFINES += -DCHAR_BIT=8
@@ -137,3 +141,8 @@
 
 include $(topsrcdir)/config/rules.mk
 
+COMPILE_CFLAGS +=  -FI $(srcdir)/include/freetype/config/ftstdlib.h
+
+#$(DEFFILE): $(OBJS)
+#	echo EXPORTS > $(DEFFILE)
+#	dumpbin -SYMBOLS *.obj | gawk '$$3 ~ /^SECT/ && $$5 == "()" && $$6 == "External" {print $$8}' | sed 's/^_//' >> $(DEFFILE)
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/modules/freetype2/freetype2.def comm-1.9.2/mozilla/modules/freetype2/freetype2.def
--- comm-1.9.2.orig/mozilla/modules/freetype2/freetype2.def	1970-01-01 09:00:00 +0900
+++ comm-1.9.2/mozilla/modules/freetype2/freetype2.def	2011-03-06 02:11:52 +0900
@@ -0,0 +1,29 @@
+EXPORTS
+FT_Done_Face
+FT_New_Face
+FT_Init_FreeType
+FT_Load_Sfnt_Table
+FT_Load_Glyph
+FT_Get_Char_Index
+FT_Get_Kerning
+FT_Get_Sfnt_Table
+FT_New_Memory_Face
+FT_MulFix
+FT_Set_Pixel_Sizes
+FT_Set_Char_Size
+FT_Set_Transform
+FT_Outline_Get_Bitmap
+FT_Outline_Translate
+FT_Outline_Transform
+FT_Outline_Get_CBox
+FT_Render_Glyph
+FT_Outline_Decompose
+FT_Vector_Transform
+FT_Done_FreeType
+FT_GlyphSlot_Embolden
+FT_Get_Next_Char
+FT_Get_First_Char
+FT_Get_PS_Font_Info
+FT_Get_Glyph_Name
+FT_Get_Sfnt_Name_Count
+FT_Get_Sfnt_Name
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/modules/libimg/png/Makefile.in comm-1.9.2/mozilla/modules/libimg/png/Makefile.in
--- comm-1.9.2.orig/mozilla/modules/libimg/png/Makefile.in	2011-03-03 20:42:44 +0900
+++ comm-1.9.2/mozilla/modules/libimg/png/Makefile.in	2011-03-06 02:11:51 +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.2.orig/mozilla/modules/libpref/src/init/all.js comm-1.9.2/mozilla/modules/libpref/src/init/all.js
--- comm-1.9.2.orig/mozilla/modules/libpref/src/init/all.js	2011-03-03 20:42:44 +0900
+++ comm-1.9.2/mozilla/modules/libpref/src/init/all.js	2011-03-06 02:11:51 +0900
@@ -1679,7 +1679,7 @@
 pref("ui.panel.default_level_parent", false);
 #endif
 
-pref("mousewheel.system_scroll_override_on_root_content.enabled", true);
+pref("mousewheel.system_scroll_override_on_root_content.enabled", false);
 
 // Bug 514927
 // Enables or disabled the TrackPoint hack, -1 is autodetect, 0 is off,
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/security/coreconf/Darwin.mk comm-1.9.2/mozilla/security/coreconf/Darwin.mk
--- comm-1.9.2.orig/mozilla/security/coreconf/Darwin.mk	2011-03-03 20:42:47 +0900
+++ comm-1.9.2/mozilla/security/coreconf/Darwin.mk	2011-03-06 02:11:51 +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.2.orig/mozilla/security/coreconf/Linux.mk comm-1.9.2/mozilla/security/coreconf/Linux.mk
--- comm-1.9.2.orig/mozilla/security/coreconf/Linux.mk	2011-03-03 20:42:47 +0900
+++ comm-1.9.2/mozilla/security/coreconf/Linux.mk	2011-03-06 02:11:51 +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.2.orig/mozilla/security/coreconf/WIN32.mk comm-1.9.2/mozilla/security/coreconf/WIN32.mk
--- comm-1.9.2.orig/mozilla/security/coreconf/WIN32.mk	2011-03-03 20:42:47 +0900
+++ comm-1.9.2/mozilla/security/coreconf/WIN32.mk	2011-03-06 02:11:51 +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.2.orig/mozilla/security/coreconf/WINCE.mk comm-1.9.2/mozilla/security/coreconf/WINCE.mk
--- comm-1.9.2.orig/mozilla/security/coreconf/WINCE.mk	2011-03-03 20:42:47 +0900
+++ comm-1.9.2/mozilla/security/coreconf/WINCE.mk	2011-03-06 02:11:51 +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.2.orig/mozilla/security/coreconf/command.mk comm-1.9.2/mozilla/security/coreconf/command.mk
--- comm-1.9.2.orig/mozilla/security/coreconf/command.mk	2011-03-03 20:42:47 +0900
+++ comm-1.9.2/mozilla/security/coreconf/command.mk	2011-03-06 02:11:51 +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.2.orig/mozilla/security/manager/Makefile.in comm-1.9.2/mozilla/security/manager/Makefile.in
--- comm-1.9.2.orig/mozilla/security/manager/Makefile.in	2011-03-03 20:42:47 +0900
+++ comm-1.9.2/mozilla/security/manager/Makefile.in	2011-03-06 02:11:51 +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
@@ -264,7 +266,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.2.orig/mozilla/security/nss/lib/freebl/config.mk comm-1.9.2/mozilla/security/nss/lib/freebl/config.mk
--- comm-1.9.2.orig/mozilla/security/nss/lib/freebl/config.mk	2011-03-03 20:42:48 +0900
+++ comm-1.9.2/mozilla/security/nss/lib/freebl/config.mk	2011-03-06 02:11:51 +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.2.orig/mozilla/toolkit/components/places/src/Makefile.in comm-1.9.2/mozilla/toolkit/components/places/src/Makefile.in
--- comm-1.9.2.orig/mozilla/toolkit/components/places/src/Makefile.in	2011-03-03 20:42:49 +0900
+++ comm-1.9.2/mozilla/toolkit/components/places/src/Makefile.in	2011-03-06 02:11:51 +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.2.orig/mozilla/toolkit/library/Makefile.in comm-1.9.2/mozilla/toolkit/library/Makefile.in
--- comm-1.9.2.orig/mozilla/toolkit/library/Makefile.in	2011-03-03 20:42:51 +0900
+++ comm-1.9.2/mozilla/toolkit/library/Makefile.in	2011-03-06 02:11:51 +0900
@@ -265,6 +265,11 @@
 ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME,imagehlp)
 endif
+ifdef MOZ_ENABLE_LIBXUL
+ifdef MOZ_TREE_FREETYPE
+EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME,ddraw)
+endif
+endif
 endif # WINNT
 ifeq ($(OS_ARCH),WINCE)
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME, aygshell uuid ole32 oleaut32 Ws2 ddraw)
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/toolkit/mozapps/installer/packager.mk comm-1.9.2/mozilla/toolkit/mozapps/installer/packager.mk
--- comm-1.9.2.orig/mozilla/toolkit/mozapps/installer/packager.mk	2011-03-03 20:43:07 +0900
+++ comm-1.9.2/mozilla/toolkit/mozapps/installer/packager.mk	2011-03-06 02:11:52 +0900
@@ -137,9 +137,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
@@ -171,7 +171,7 @@
 endif
 MAKE_PACKAGE	= $(_ABS_MOZSRCDIR)/build/package/mac_osx/pkg-dmg \
   --source "$(PKG_DMG_SOURCE)" --target "$(PACKAGE)" \
-  --volname "$(MOZ_APP_DISPLAYNAME)" $(PKG_DMG_FLAGS)
+  --volname "$(MOZ_APP_NAME)" $(PKG_DMG_FLAGS)
 _ABS_DIST = $(call core_abspath,$(DIST))
 UNMAKE_PACKAGE	= \
   set -ex; \
@@ -389,10 +389,6 @@
 endif
 else
 	@cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_DIR); tar -xf -)
-	@echo "Linking XPT files..."
-	@rm -rf $(DIST)/xpt
-	@$(NSINSTALL) -D $(DIST)/xpt
-	@($(XPIDL_LINK) $(DIST)/xpt/$(MOZ_PKG_APPNAME).xpt $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)/components/*.xpt && rm -f $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)/components/*.xpt && cp $(DIST)/xpt/$(MOZ_PKG_APPNAME).xpt $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)/components) || echo No *.xpt files found in: $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)/components/.  Continuing...
 endif # DMG
 endif # MOZ_PKG_MANIFEST
 ifndef PKG_SKIP_STRIP
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/toolkit/mozapps/update/src/updater/updater.cpp comm-1.9.2/mozilla/toolkit/mozapps/update/src/updater/updater.cpp
--- comm-1.9.2.orig/mozilla/toolkit/mozapps/update/src/updater/updater.cpp	2011-03-03 20:42:51 +0900
+++ comm-1.9.2/mozilla/toolkit/mozapps/update/src/updater/updater.cpp	2011-03-06 02:11:52 +0900
@@ -1890,3 +1890,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
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/widget/src/build/Makefile.in comm-1.9.2/mozilla/widget/src/build/Makefile.in
--- comm-1.9.2.orig/mozilla/widget/src/build/Makefile.in	2011-03-03 20:42:51 +0900
+++ comm-1.9.2/mozilla/widget/src/build/Makefile.in	2011-03-06 02:11:52 +0900
@@ -85,6 +85,10 @@
 		../xpwidgets/$(LIB_PREFIX)xpwidgets_s.$(LIB_SUFFIX) \
 		$(NULL)
 
+ifneq (,$(WINCE)$(MOZ_TREE_FREETYPE))
+SHARED_LIBRARY_LIBS += $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib
+endif
+
 EXTRA_DSO_LDOPTS = \
 		$(LIBS_DIR) \
 		$(EXTRA_DSO_LIBS) \
@@ -98,3 +102,7 @@
 DEFINES		+= -D_IMPL_NS_WIDGET -DMOZ_UNICODE
 
 CXXFLAGS += $(MOZ_CAIRO_CFLAGS)
+
+ifneq (,$(WINCE)$(MOZ_TREE_FREETYPE))
+OS_LIBS += ddraw.lib
+endif
diff -urN --strip-trailing-cr -x CVS -x '*.pyc' -x '*.stackdump' comm-1.9.2.orig/mozilla/widget/src/windows/nsWindowGfx.cpp comm-1.9.2/mozilla/widget/src/windows/nsWindowGfx.cpp
--- comm-1.9.2.orig/mozilla/widget/src/windows/nsWindowGfx.cpp	2011-03-03 20:42:52 +0900
+++ comm-1.9.2/mozilla/widget/src/windows/nsWindowGfx.cpp	2011-03-06 02:11:52 +0900
@@ -112,6 +112,15 @@
 static LPDIRECTDRAWSURFACE glpDDSecondary         = NULL;
 static nsAutoPtr<gfxDDrawSurface> gpDDSurf        = NULL;
 static DDSURFACEDESC gDDSDSecondary;
+#ifndef DDLOCK_WAITNOTBUSY
+#define DDLOCK_WAITNOTBUSY DDLOCK_WAIT
+#endif
+#ifndef DDBLT_WAITNOTBUSY
+#define DDBLT_WAITNOTBUSY DDBLT_WAIT
+#endif
+#ifndef DDLOCK_DISCARD
+#define DDLOCK_DISCARD DDLOCK_DISCARDCONTENTS
+#endif
 #endif
 
 static NS_DEFINE_CID(kRegionCID,                  NS_REGION_CID);

