bug 475111 - port bug 471685, bug 469558, bug 464190, bug 467579, bug 397227, bug 463420, bug 466492, bug 471188, bug 467271, bug 466486 to comm-central, r=Standard8
authorRobert Kaiser <kairo@kairo.at>
Thu, 29 Jan 2009 21:09:08 +0100
changeset 1792 4189e950a5a17c93ac6820fc3c1a327a8b173aef
parent 1791 880b549a8c3171b41010f4402959d0bd0e9b9838
child 1793 efe8315bc045d03278e287add14f84feef895e25
push idunknown
push userunknown
push dateunknown
reviewersStandard8
bugs475111, 471685, 469558, 464190, 467579, 397227, 463420, 466492, 471188, 467271, 466486
bug 475111 - port bug 471685, bug 469558, bug 464190, bug 467579, bug 397227, bug 463420, bug 466492, bug 471188, bug 467271, bug 466486 to comm-central, r=Standard8
config/autoconf.mk.in
config/config.mk
config/rules.mk
config/static-checking-config.mk
configure.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -412,24 +412,19 @@ PNG_CFLAGS	= @PNG_CFLAGS@
 PNG_LIBS	= @PNG_LIBS@
 PNG_REQUIRES	=
 else
 PNG_CFLAGS	= @MOZ_PNG_CFLAGS@
 PNG_LIBS	= @MOZ_PNG_LIBS@
 PNG_REQUIRES	= png
 endif
 
-MOZ_NATIVE_LCMS	= @MOZ_NATIVE_LCMS@
 LCMS_CFLAGS	= @LCMS_CFLAGS@
 LCMS_LIBS	= @LCMS_LIBS@
-ifdef MOZ_NATIVE_LCMS
-LCMS_REQUIRES	=
-else
 LCMS_REQUIRES	= lcms
-endif
 
 MOZ_NATIVE_SQLITE = @MOZ_NATIVE_SQLITE@
 SQLITE_CFLAGS     = @SQLITE_CFLAGS@
 SQLITE_LIBS       = @SQLITE_LIBS@
 
 NSPR_CONFIG	= @NSPR_CONFIG@
 NSPR_CFLAGS	= @NSPR_CFLAGS@
 NSPR_LIBS	= @NSPR_LIBS@
@@ -579,16 +574,17 @@ endif
 # Codesighs tools option, enables win32 mapfiles.
 MOZ_MAPINFO	= @MOZ_MAPINFO@
 
 MOZ_THUNDERBIRD = @MOZ_THUNDERBIRD@
 MOZ_STATIC_MAIL_BUILD = @MOZ_STATIC_MAIL_BUILD@
 MOZ_SUNBIRD	= @MOZ_SUNBIRD@
 MOZ_SUITE	= @MOZ_SUITE@
 WINCE		= @WINCE@
+WINCE_SDK      = @WINCE_SDK@
 
 MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
 
 MACOS_SDK_DIR	= @MACOS_SDK_DIR@
 NEXT_ROOT	= @NEXT_ROOT@
 GCC_VERSION	= @GCC_VERSION@
 XCODEBUILD_VERSION= @XCODEBUILD_VERSION@
 HAS_XCODE_2_1	= @HAS_XCODE_2_1@
--- a/config/config.mk
+++ b/config/config.mk
@@ -483,43 +483,17 @@ REQ_INCLUDES_SDK = $(foreach d,$(REQUIRE
 endif
 
 INCLUDES	= $(LOCAL_INCLUDES) $(REQ_INCLUDES) $(REQ_INCLUDES_SDK) -I$(PUBLIC) $(OS_INCLUDES)
 
 ifndef MOZILLA_INTERNAL_API
 INCLUDES	+= -I$(LIBXUL_DIST)/sdk/include
 endif
 
-# The entire tree should be subject to static analysis using the XPCOM
-# script. Additional scripts may be added by specific subdirectories.
-
-DEHYDRA_SCRIPT = $(MOZILLA_SRCDIR)/xpcom/analysis/static-checking.js
-
-DEHYDRA_MODULES = \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/final.js \
-  $(NULL)
-
-TREEHYDRA_MODULES = \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/outparams.js \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/stack.js \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/flow.js \
-  $(NULL)
-
-DEHYDRA_ARGS = \
-  --topsrcdir=$(topsrcdir) \
-  --objdir=$(DEPTH) \
-  --dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
-  --treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
-  $(NULL)
-
-DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) -fplugin-arg='$(DEHYDRA_SCRIPT) $(DEHYDRA_ARGS)'
-
-ifdef DEHYDRA_PATH
-OS_CXXFLAGS += $(DEHYDRA_FLAGS)
-endif
+include $(topsrcdir)/config/static-checking-config.mk
 
 CFLAGS		= $(OS_CFLAGS)
 CXXFLAGS	= $(OS_CXXFLAGS)
 LDFLAGS		= $(OS_LDFLAGS) $(MOZ_FIX_LINK_PATHS)
 
 # Allow each module to override the *default* optimization settings
 # by setting MODULE_OPTIMIZE_FLAGS if the developer has not given
 # arguments to --enable-optimize
@@ -863,8 +837,12 @@ ifdef LOCALE_MERGEDIR
 MAKE_JARS_FLAGS += -c $(topsrcdir)/$(relativesrcdir)/en-US
 endif
 endif
 
 ifeq (,$(filter WINCE WINNT OS2,$(OS_ARCH)))
 RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
 endif
 
+ifdef TIERS
+DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs))
+STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs))
+endif
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -108,16 +108,116 @@ EXPAND_LIBNAME = $(addprefix -l,$(1))
 EXPAND_LIBNAME_PATH = -L$(2) $(addprefix -l,$(1))
 EXPAND_MOZLIBNAME = $(addprefix -l,$(1))
 endif
 
 ifdef EXTRA_DSO_LIBS
 EXTRA_DSO_LIBS	:= $(call EXPAND_MOZLIBNAME,$(EXTRA_DSO_LIBS))
 endif
 
+################################################################################
+# Testing frameworks support
+################################################################################
+
+ifdef ENABLE_TESTS
+
+ifdef XPCSHELL_TESTS
+ifndef MODULE
+$(error Must define MODULE when defining XPCSHELL_TESTS.)
+endif
+
+# Test file installation
+libs::
+	@$(EXIT_ON_ERROR) \
+	for testdir in $(XPCSHELL_TESTS); do \
+	  $(INSTALL) \
+	    $(srcdir)/$$testdir/*.js \
+	    $(MOZDEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir; \
+	done
+
+# Path formats on Windows are hard.  We require a topsrcdir formatted so that
+# it may be passed to nsILocalFile.initWithPath (in other words, an absolute
+# path of the form X:\path\to\topsrcdir), which we store in NATIVE_TOPSRCDIR.
+# We require a forward-slashed path to topsrcdir so that it may be combined
+# with a relative forward-slashed path for loading scripts, both dynamically
+# and statically for head/test/tail JS files.  Of course, on non-Windows none
+# of this matters, and things will work correctly because everything's
+# forward-slashed, everywhere, always.
+ifdef CYGWIN_WRAPPER
+NATIVE_TOPSRCDIR   := `cygpath -wa $(MOZILLA_SRCDIR)`
+FWDSLASH_TOPSRCDIR := `cygpath -ma $(MOZILLA_SRCDIR)`
+else
+FWDSLASH_TOPSRCDIR := $(MOZILLA_SRCDIR)
+ifeq ($(HOST_OS_ARCH),WINNT)
+NATIVE_TOPSRCDIR   := $(subst /,\\,$(WIN_TOP_SRC)/mozilla)
+else 
+NATIVE_TOPSRCDIR   := $(MOZILLA_SRCDIR)
+endif
+endif # CYGWIN_WRAPPER
+
+testxpcdir = $(MOZILLA_SRCDIR)/testing/xpcshell
+
+# Test execution
+check::
+	@$(EXIT_ON_ERROR) \
+	for testdir in $(XPCSHELL_TESTS); do \
+	  $(RUN_TEST_PROGRAM) \
+	    $(testxpcdir)/test_all.sh \
+	      $(DIST)/bin/xpcshell \
+	      $(FWDSLASH_TOPSRCDIR) \
+	      $(NATIVE_TOPSRCDIR) \
+	      $(MOZDEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir; \
+	done
+
+# Test execution
+check-interactive::
+	@$(EXIT_ON_ERROR) \
+	$(RUN_TEST_PROGRAM) \
+	  $(testxpcdir)/test_one.sh \
+	    $(DIST)/bin/xpcshell \
+	    $(FWDSLASH_TOPSRCDIR) \
+	    $(NATIVE_TOPSRCDIR) \
+	    $(MOZDEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \
+	    $(SOLO_FILE) 1;
+
+# Test execution
+check-one::
+	@$(EXIT_ON_ERROR) \
+	$(RUN_TEST_PROGRAM) \
+	  $(testxpcdir)/test_one.sh \
+	    $(DIST)/bin/xpcshell \
+	    $(FWDSLASH_TOPSRCDIR) \
+	    $(NATIVE_TOPSRCDIR) \
+	    $(MOZDEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \
+	    $(SOLO_FILE) 0;
+
+endif # XPCSHELL_TESTS
+
+ifdef CPP_UNIT_TESTS
+
+# Compile the tests to $(DIST)/bin.  Make lots of niceties available by default
+# through TestHarness.h, by modifying the list of includes and the libs against
+# which stuff links.
+CPPSRCS += $(CPP_UNIT_TESTS)
+SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX))
+REQUIRES += testing xpcom
+LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS)
+
+# ...and run them the usual way
+check::
+	@$(EXIT_ON_ERROR) \
+	  for f in $(subst .cpp,,$(CPP_UNIT_TESTS)); do \
+	    XPCOM_DEBUG_BREAK=stack-and-abort $(RUN_TEST_PROGRAM) $(DIST)/bin/$$f; \
+	  done
+
+endif # CPP_UNIT_TESTS
+
+endif # ENABLE_TESTS
+
+
 #
 # Library rules
 #
 # If BUILD_STATIC_LIBS or FORCE_STATIC_LIB is set, build a static library.
 # Otherwise, build a shared library.
 #
 
 ifndef LIBRARY
@@ -189,25 +289,32 @@ ifdef FORCE_SHARED_LIB
 ifndef FORCE_STATIC_LIB
 LIBRARY			:= $(NULL)
 endif
 endif
 
 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
 ifndef GNU_CC
 
-# All C++ files share a PDB file per directory. For parallel builds, this PDB
-# file is shared and locked by MSPDBSRV.EXE, starting with MSVC8 SP1. If
-# you're using MSVC 7.1 or MSVC8 without SP1, don't do parallel builds.
+# Unless we're building SIMPLE_PROGRAMS, all C++ files share a PDB file per
+# directory. For parallel builds, this PDB file is shared and locked by
+# MSPDBSRV.EXE, starting with MSVC8 SP1. If you're using MSVC 7.1 or MSVC8
+# without SP1, don't do parallel builds.
 #
 # The final PDB for libraries and programs is created by the linker and uses
 # a different name from the single PDB file created by the compiler. See
 # bug 462740.
 #
+
+ifdef SIMPLE_PROGRAMS
+COMPILE_PDBFILE = $(basename $(@F)).pdb
+else
 COMPILE_PDBFILE = generated.pdb
+endif
+
 LINK_PDBFILE = $(basename $(@F)).pdb
 ifdef MOZ_DEBUG
 CODFILE=$(basename $(@F)).cod
 endif
 
 ifdef MOZ_MAPINFO
 ifdef LIBRARY_NAME
 MAPFILE=$(LIBRARY_NAME).map
@@ -350,32 +457,40 @@ ifdef MOZ_UPDATE_XTERM
 # makes the make -s output easier to read.  Echo -n does not work on all
 # platforms, but we can trick sed into doing it.
 UPDATE_TITLE = sed -e "s!Y!$@ in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(dir)!" $(MOZILLA_DIR)/config/xterm.str;
 UPDATE_TITLE_export = sed -e "s!Y!export in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
 UPDATE_TITLE_libs = sed -e "s!Y!libs in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
 UPDATE_TITLE_tools = sed -e "s!Y!tools in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$*!" $(MOZILLA_DIR)/config/xterm.str;
 endif
 
+ifneq (,$(strip $(DIRS)))
 LOOP_OVER_DIRS = \
     @$(EXIT_ON_ERROR) \
-    $(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
+    $(foreach dir,$(DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
+endif
 
 # we only use this for the makefiles target and other stuff that doesn't matter
+ifneq (,$(strip $(PARALLEL_DIRS)))
 LOOP_OVER_PARALLEL_DIRS = \
     @$(EXIT_ON_ERROR) \
-    $(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
+    $(foreach dir,$(PARALLEL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
+endif
 
+ifneq (,$(strip $(STATIC_DIRS)))
 LOOP_OVER_STATIC_DIRS = \
     @$(EXIT_ON_ERROR) \
-    $(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
+    $(foreach dir,$(STATIC_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
+endif
 
+ifneq (,$(strip $(TOOL_DIRS)))
 LOOP_OVER_TOOL_DIRS = \
     @$(EXIT_ON_ERROR) \
-    $(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; ) true
+    $(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) $@; )
+endif
 
 ifdef PARALLEL_DIRS
 # create a bunch of fake targets for order-only processing
 PARALLEL_DIRS_export = $(addsuffix _export,$(PARALLEL_DIRS))
 PARALLEL_DIRS_libs = $(addsuffix _libs,$(PARALLEL_DIRS))
 PARALLEL_DIRS_tools = $(addsuffix _tools,$(PARALLEL_DIRS))
 
 .PHONY: $(PARALLEL_DIRS_export) $(PARALLEL_DIRS_libs) $(PARALLEL_DIRS_tools)
@@ -594,29 +709,26 @@ endif
 SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS) $(PARALLEL_DIRS))
 
 # The root makefile doesn't want to do a plain export/libs, because
 # of the tiers and because of libxul. Suppress the default rules in favor
 # of something else. Makefiles which use this var *must* provide a sensible
 # default rule before including rules.mk
 ifndef SUPPRESS_DEFAULT_RULES
 ifdef TIERS
-
-DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs))
-STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs))
-
 default all alldep::
 	$(EXIT_ON_ERROR) \
 	$(foreach tier,$(TIERS),$(MAKE) tier_$(tier); ) true
 
 else
 
 default all::
-	@$(EXIT_ON_ERROR) \
-	$(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); ) true
+ifneq (,$(strip $(STATIC_DIRS)))
+	$(foreach dir,$(STATIC_DIRS),$(MAKE) -C $(dir); )
+endif
 	$(MAKE) export
 	$(MAKE) libs
 	$(MAKE) tools
 
 # Do depend as well
 alldep:: 
 	$(MAKE) export
 	$(MAKE) depend
@@ -708,19 +820,19 @@ ifdef PARALLEL_DIRS
 tools:: $(PARALLEL_DIRS_tools)
 
 $(PARALLEL_DIRS_tools): %_tools: %/Makefile
 	+@$(UPDATE_TITLE_tools) $(MAKE) -C $* tools
 endif
 
 tools:: $(SUBMAKEFILES) $(MAKE_DIRS)
 	+$(LOOP_OVER_DIRS)
-ifdef TOOL_DIRS
+ifneq (,$(strip $(TOOL_DIRS)))
 	@$(EXIT_ON_ERROR) \
-	$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; ) true
+	$(foreach dir,$(TOOL_DIRS),$(UPDATE_TITLE) $(MAKE) -C $(dir) libs; )
 endif
 
 #
 # Rule to create list of libraries for final link
 #
 export::
 ifdef LIBRARY_NAME
 ifdef EXPORT_LIBRARY
@@ -813,31 +925,35 @@ endif # !NO_DIST_INSTALL
 ifndef NO_PROFILE_GUIDED_OPTIMIZE
 ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
 ifeq ($(OS_ARCH)_$(GNU_CC)$(INTERNAL_TOOLS), WINNT_)
 # Force re-linking when building with PGO, since
 # the MSVC linker does all the work.  We force re-link
 # in both stages so you can do depend builds with PGO.
 ifdef SHARED_LIBRARY
 $(SHARED_LIBRARY): FORCE
-BINARY_BASENAME = $(SHARED_LIBRARY:$(DLL_SUFFIX)=)
 endif
 ifdef PROGRAM
 $(PROGRAM): FORCE
-BINARY_BASENAME = $(PROGRAM:$(BIN_SUFFIX)=)
 endif
 
 ifdef MOZ_PROFILE_USE
 # In the second pass, we need to merge the pgc files into the pgd file.
 # The compiler would do this for us automatically if they were in the right
 # place, but they're in dist/bin.
-ifdef BINARY_BASENAME
+ifneq (,$(SHARED_LIBRARY)$(PROGRAM))
 export::
+ifdef PROGRAM
 	$(PYTHON) $(MOZILLA_SRCDIR)/build/win32/pgomerge.py \
-	  $(BINARY_BASENAME) $(DIST)/bin
+	  $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin
+endif
+ifdef SHARED_LIBRARY
+	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
+	  $(LIBRARY_NAME) $(DIST)/bin
+endif
 endif
 endif # MOZ_PROFILE_USE
 endif # WINNT_
 endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
 endif # NO_PROFILE_GUIDED_OPTIMIZE
 
 ##############################################
 
@@ -1400,17 +1516,17 @@ endif
 ###############################################################################
 # Bunch of things that extend the 'export' rule (in order):
 ###############################################################################
 
 ################################################################################
 # Copy each element of EXPORTS to $(PUBLIC)
 
 ifneq ($(EXPORTS)$(XPIDLSRCS)$(SDK_HEADERS)$(SDK_XPIDLSRCS),)
-$(SDK_PUBLIC) $(PUBLIC)::
+$(SDK_PUBLIC) $(PUBLIC):
 	$(NSINSTALL) -D $@
 endif
 
 ifneq ($(XPI_NAME),)
 $(FINAL_TARGET):
 	$(NSINSTALL) -D $@
 
 export:: $(FINAL_TARGET)
@@ -1680,25 +1796,24 @@ chrome::
 	$(MAKE) realchrome
 	+$(LOOP_OVER_PARALLEL_DIRS)
 	+$(LOOP_OVER_DIRS)
 	+$(LOOP_OVER_TOOL_DIRS)
 
 $(FINAL_TARGET)/chrome:
 	$(NSINSTALL) -D $@
 
-libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
+ifneq (,$(wildcard $(JAR_MANIFEST)))
 ifndef NO_DIST_INSTALL
-	@$(EXIT_ON_ERROR) \
-	if test -f $(JAR_MANIFEST); then \
-	  $(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
-	    $(QUIET) -j $(FINAL_TARGET)/chrome \
-	    $(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
-	    $(JAR_MANIFEST); \
-	fi
+libs realchrome:: $(CHROME_DEPS) $(FINAL_TARGET)/chrome
+	$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
+	  $(QUIET) -j $(FINAL_TARGET)/chrome \
+	  $(MAKE_JARS_FLAGS) $(XULPPFLAGS) $(DEFINES) $(ACDEFINES) \
+	  $(JAR_MANIFEST)
+endif
 endif
 
 ifneq ($(DIST_FILES),)
 libs:: $(DIST_FILES)
 	@$(EXIT_ON_ERROR) \
 	for f in $(DIST_FILES); do \
 	  dest=$(FINAL_TARGET)/`basename $$f`; \
 	  $(RM) -f $$dest; \
@@ -1779,97 +1894,16 @@ REGCHROME = $(PERL) -I$(MOZILLA_DIR)/con
 	$(_JAR_REGCHROME_DISABLE_JAR)
 
 REGCHROME_INSTALL = $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/add-chrome.pl \
 	$(if $(filter gtk2,$(MOZ_WIDGET_TOOLKIT)),-x) \
 	$(if $(CROSS_COMPILE),-o $(OS_ARCH)) $(DESTDIR)$(mozappdir)/chrome/installed-chrome.txt \
 	$(_JAR_REGCHROME_DISABLE_JAR)
 
 
-################################################################################
-# Testing frameworks support
-################################################################################
-
-ifdef ENABLE_TESTS
-
-ifdef XPCSHELL_TESTS
-ifndef MODULE
-$(error Must define MODULE when defining XPCSHELL_TESTS.)
-endif
-
-# Test file installation
-libs::
-	@$(EXIT_ON_ERROR) \
-	for testdir in $(XPCSHELL_TESTS); do \
-	  $(INSTALL) \
-	    $(srcdir)/$$testdir/*.js \
-	    $(MOZDEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir; \
-	done
-
-# Path formats on Windows are hard.  We require a topsrcdir formatted so that
-# it may be passed to nsILocalFile.initWithPath (in other words, an absolute
-# path of the form X:\path\to\topsrcdir), which we store in NATIVE_TOPSRCDIR.
-# We require a forward-slashed path to topsrcdir so that it may be combined
-# with a relative forward-slashed path for loading scripts, both dynamically
-# and statically for head/test/tail JS files.  Of course, on non-Windows none
-# of this matters, and things will work correctly because everything's
-# forward-slashed, everywhere, always.
-ifdef CYGWIN_WRAPPER
-NATIVE_TOPSRCDIR   := `cygpath -wa $(MOZILLA_SRCDIR)`
-FWDSLASH_TOPSRCDIR := `cygpath -ma $(MOZILLA_SRCDIR)`
-else
-FWDSLASH_TOPSRCDIR := $(MOZILLA_SRCDIR)
-ifeq ($(HOST_OS_ARCH),WINNT)
-NATIVE_TOPSRCDIR   := $(subst /,\\,$(WIN_TOP_SRC)/mozilla)
-else 
-NATIVE_TOPSRCDIR   := $(MOZILLA_SRCDIR)
-endif
-endif # CYGWIN_WRAPPER
-
-testxpcdir = $(MOZILLA_SRCDIR)/testing/xpcshell
-
-# Test execution
-check::
-	@$(EXIT_ON_ERROR) \
-	for testdir in $(XPCSHELL_TESTS); do \
-	  $(RUN_TEST_PROGRAM) \
-	    $(testxpcdir)/test_all.sh \
-	      $(DIST)/bin/xpcshell \
-	      $(FWDSLASH_TOPSRCDIR) \
-	      $(NATIVE_TOPSRCDIR) \
-	      $(MOZDEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir; \
-	done
-
-# Test execution
-check-interactive::
-	@$(EXIT_ON_ERROR) \
-	$(RUN_TEST_PROGRAM) \
-	  $(testxpcdir)/test_one.sh \
-	    $(DIST)/bin/xpcshell \
-	    $(FWDSLASH_TOPSRCDIR) \
-	    $(NATIVE_TOPSRCDIR) \
-	    $(MOZDEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \
-	    $(SOLO_FILE) 1;
-
-# Test execution
-check-one::
-	@$(EXIT_ON_ERROR) \
-	$(RUN_TEST_PROGRAM) \
-	  $(testxpcdir)/test_one.sh \
-	    $(DIST)/bin/xpcshell \
-	    $(FWDSLASH_TOPSRCDIR) \
-	    $(NATIVE_TOPSRCDIR) \
-	    $(MOZDEPTH)/_tests/xpcshell-simple/$(MODULE)/$$testdir \
-	    $(SOLO_FILE) 0;
-
-endif # XPCSHELL_TESTS
-
-endif # ENABLE_TESTS
-
-
 #############################################################################
 # Dependency system
 #############################################################################
 ifdef COMPILER_DEPEND
 depend::
 	@echo "$(MAKE): No need to run depend target.\
 			Using compiler-based depend." 1>&2
 ifeq ($(GNU_CC)$(GNU_CXX),)
@@ -2024,17 +2058,17 @@ FORCE:
 tags: TAGS
 
 TAGS: $(SUBMAKEFILES) $(CSRCS) $(CPPSRCS) $(wildcard *.h)
 	-etags $(CSRCS) $(CPPSRCS) $(wildcard *.h)
 	+$(LOOP_OVER_PARALLEL_DIRS)
 	+$(LOOP_OVER_DIRS)
 
 echo-variable-%:
-	@echo $($*)
+	@echo "$($*)"
 
 echo-tiers:
 	@echo $(TIERS)
 
 echo-dirs:
 	@echo $(DIRS)
 
 echo-module:
new file mode 100644
--- /dev/null
+++ b/config/static-checking-config.mk
@@ -0,0 +1,28 @@
+# The entire tree should be subject to static analysis using the XPCOM
+# script. Additional scripts may be added by specific subdirectories.
+
+DEHYDRA_SCRIPT = $(MOZILLA_SRCDIR)/config/static-checking.js
+
+DEHYDRA_MODULES = \
+  $(MOZILLA_SRCDIR)/xpcom/analysis/final.js \
+  $(NULL)
+
+TREEHYDRA_MODULES = \
+  $(MOZILLA_SRCDIR)/xpcom/analysis/outparams.js \
+  $(MOZILLA_SRCDIR)/xpcom/analysis/stack.js \
+  $(MOZILLA_SRCDIR)/xpcom/analysis/flow.js \
+  $(MOZILLA_SRCDIR)/js/src/jsstack.js \
+  $(NULL)
+
+DEHYDRA_ARGS = \
+  --topsrcdir=$(topsrcdir) \
+  --objdir=$(MOZDEPTH) \
+  --dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
+  --treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
+  $(NULL)
+
+DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) -fplugin-arg='$(DEHYDRA_SCRIPT) $(DEHYDRA_ARGS)'
+
+ifdef DEHYDRA_PATH
+OS_CXXFLAGS += $(DEHYDRA_FLAGS)
+endif
--- a/configure.in
+++ b/configure.in
@@ -136,17 +136,17 @@ WINDRES_VERSION=2.14.90
 W32API_VERSION=3.8
 GNOMEVFS_VERSION=2.0
 GNOMEUI_VERSION=2.2.0
 GCONF_VERSION=1.2.1
 LIBGNOME_VERSION=2.0
 STARTUP_NOTIFICATION_VERSION=0.8
 DBUS_VERSION=0.60
 LCMS_VERSION=1.17
-SQLITE_VERSION=3.6.4
+SQLITE_VERSION=3.6.7
 
 MSMANIFEST_TOOL=
 
 dnl Set various checks
 dnl ========================================================
 MISSING_X=
 AC_PROG_AWK
 
@@ -236,26 +236,43 @@ dnl Set CROSS_COMPILE in the environment
 dnl to use the cross-compile setup for now
 dnl ========================================================
 
 if test "$COMPILE_ENVIRONMENT"; then
 
 dnl Do some special WinCE toolchain stuff
 case "$target" in
 *wince)
+
+    MOZ_ARG_WITH_STRING(wince-sdk,
+    [  --with-wince-sdk=WINCE_SDK
+                        The path to the windows mobile sdk],
+    WINCE_SDK=$withval)
+
+    export WINCE=1
+    mk_add_options WINCE=1
+
     echo -----------------------------------------------------------------------------
     echo Building Windows CE Shunt Library and Tool Chain
-    echo -----------------------------------------------------------------------------
+    echo Using SDK in:
+    echo $WINCE_SDK
 
     ac_exeext=.exe
 
+
+    rm -f $srcdir/build/wince/shunt/include/windows.h
+
     echo -n "#define TOPSRCDIR \"" > $srcdir/build/wince/tools/topsrcdir.h
     echo `cd "$_topsrcdir" && pwd -W | tr '\n' '\"'` >> $srcdir/build/wince/tools/topsrcdir.h
     make -C $srcdir/build/wince/tools
+
+    echo "#include \"$WINCE_SDK/windows.h\"" > $srcdir/build/wince/shunt/include/windows.h
+    echo "#define GetProcAddress GetProcAddressA" >> $srcdir/build/wince/shunt/include/windows.h
     echo -----------------------------------------------------------------------------
+
     ;;
 esac
 
 if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
     echo "cross compiling from $host to $target"
     cross_compiling=yes
 
     _SAVE_CC="$CC"
@@ -6943,38 +6960,26 @@ fi
 AC_SUBST(MOZ_TREE_CAIRO)
 AC_SUBST(MOZ_CAIRO_CFLAGS)
 AC_SUBST(MOZ_CAIRO_LIBS)
 
 dnl ========================================================
 dnl Check for lcms
 dnl ========================================================
 
-MOZ_NATIVE_LCMS=
-MOZ_ARG_ENABLE_BOOL(system-lcms,
-[ --enable-system-lcms Use system lcms (located with pkgconfig)],
-MOZ_NATIVE_LCMS=1,
-MOZ_NATIVE_LCMS= )
-
-if test -z "$MOZ_NATIVE_LCMS"
-then
-    LCMS_CFLAGS=
-    if test "$_WIN32_MSVC"; then
-        if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
-            LCMS_CFLAGS=-DLCMS_DLL
-        fi
-        LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
-    else
-        LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
-    fi
+LCMS_CFLAGS=
+if test "$_WIN32_MSVC"; then
+    if test -z "$BUILD_STATIC_LIBS" -a -z "$MOZ_ENABLE_LIBXUL"; then
+        LCMS_CFLAGS=-DLCMS_DLL
+    fi
+    LCMS_LIBS='$(LIBXUL_DIST)/lib/mozlcms.lib'
 else
-    PKG_CHECK_MODULES(LCMS, lcms >= $LCMS_VERSION)
-fi
-
-AC_SUBST(MOZ_NATIVE_LCMS)
+    LCMS_LIBS='-L$(LIBXUL_DIST)/bin -lmozlcms'
+fi
+
 AC_SUBST(LCMS_CFLAGS)
 AC_SUBST(LCMS_LIBS)
 
 dnl ========================================================
 dnl disable xul
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(xul,
 [  --disable-xul           Disable XUL],
@@ -7158,16 +7163,17 @@ AC_SUBST(USE_DEPENDENT_LIBS)
 AC_SUBST(MOZ_BUILD_ROOT)
 AC_SUBST(MOZ_OS2_TOOLS)
 AC_SUBST(MOZ_OS2_USE_DECLSPEC)
 
 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
 AC_SUBST(MOZ_TIMELINE)
 AC_SUBST(WINCE)
+AC_SUBST(WINCE_SDK)
 AC_SUBST(TARGET_DEVICE)
 
 AC_SUBST(MOZ_APP_NAME)
 AC_SUBST(MOZ_APP_DISPLAYNAME)
 AC_SUBST(MOZ_APP_VERSION)
 AC_SUBST(FIREFOX_VERSION)
 AC_SUBST(THUNDERBIRD_VERSION)
 AC_SUBST(SUNBIRD_VERSION)