Bug 648911 - Remove support for non-libxul builds. r=ted,joedrew
authorMatheus Kerschbaum <matjk7@gmail.com>
Mon, 23 May 2011 18:54:47 +0200
changeset 70003 8e846d7f21eab5f93d9efb8612661a7a1ebd81e5
parent 70002 02ecb8fb01c50a09bc1ea40568c6c7b50863f0e4
child 70004 5e204a657cac6a80679f8633b88e5b7d7995828b
push idunknown
push userunknown
push dateunknown
reviewersted, joedrew
bugs648911
milestone6.0a1
Bug 648911 - Remove support for non-libxul builds. r=ted,joedrew
browser/app/Makefile.in
browser/components/build/Makefile.in
browser/confvars.sh
browser/installer/Makefile.in
browser/installer/removed-files.in
config/Makefile.in
config/autoconf.mk.in
config/config.mk
config/rules.mk
config/static-config.mk
config/static-rules.mk
config/system-headers
configure.in
content/svg/content/src/nsSVGSVGElement.cpp
content/svg/content/src/nsSVGSVGElement.h
db/morkreader/Makefile.in
docshell/build/Makefile.in
dom/plugins/test/testplugin/Makefile.in
embedding/tests/Makefile.in
gfx/Makefile.in
gfx/angle/Makefile.in
gfx/angle/angle-shared.patch
gfx/angle/include/GLSLANG/ShaderLang.h
gfx/cairo/cairo/src/Makefile.in
gfx/cairo/cairo/src/cairo-platform.h
gfx/cairo/cairo/src/cairo-spline.c
gfx/cairo/libpixman/src/Makefile.in
gfx/cairo/libpixman/src/pixman-compiler.h
gfx/cairo/pixman-export.patch
gfx/harfbuzz/src/Makefile.in
gfx/layers/opengl/LayerManagerOGLProgram.h
gfx/src/gfxCore.h
gfx/src/gfxCrashReporterUtils.cpp
gfx/tests/Makefile.in
gfx/thebes/GLContext.h
gfx/thebes/Makefile.in
gfx/thebes/gfxDllDeps.cpp
intl/uconv/tests/Makefile.in
js/jsd/Makefile.in
js/src/config/Makefile.in
js/src/config/autoconf.mk.in
js/src/config/config.mk
js/src/config/rules.mk
js/src/config/system-headers
js/src/configure.in
js/src/xpconnect/Makefile.in
js/src/xpconnect/loader/mozJSComponentLoader.cpp
js/src/xpconnect/loader/mozJSComponentLoader.h
js/src/xpconnect/shell/xpcshell.cpp
js/src/xpconnect/src/Makefile.in
js/src/xpconnect/tests/Makefile.in
layout/base/nsPresShell.cpp
layout/build/Makefile.in
layout/generic/nsIFrame.h
layout/style/test/Makefile.in
mobile/app/Makefile.in
mobile/confvars.sh
mobile/installer/Makefile.in
modules/libpr0n/src/SVGDocumentWrapper.cpp
modules/libpref/src/Makefile.in
modules/zlib/src/Makefile.in
modules/zlib/src/mozzconf.h
netwerk/test/Makefile.in
parser/htmlparser/tests/Makefile.in
rdf/build/Makefile.in
toolkit/components/places/Makefile.in
toolkit/components/startup/nsAppStartup.cpp
toolkit/components/url-classifier/tests/Makefile.in
toolkit/crashreporter/test/Makefile.in
toolkit/library/Makefile.in
toolkit/library/libxul-config.mk
toolkit/library/libxul-rules.mk
toolkit/toolkit-tiers.mk
toolkit/xre/Makefile.in
toolkit/xre/nsAppRunner.cpp
tools/trace-malloc/Makefile.in
widget/src/android/GfxInfo.cpp
widget/src/cocoa/GfxInfo.mm
widget/src/os2/Makefile.in
widget/src/windows/GfxInfo.cpp
widget/src/windows/Makefile.in
widget/src/windows/nsToolkit.cpp
widget/src/windows/tests/Makefile.in
widget/src/xpwidgets/GfxInfoBase.cpp
widget/src/xpwidgets/nsNativeTheme.cpp
xpcom/Makefile.in
xpcom/base/nsDebugImpl.cpp
xpcom/base/nscore.h
xpcom/build/Makefile.in
xpcom/build/dlldeps.cpp
xpcom/build/nsXPComInit.cpp
xpcom/components/nsComponentManager.cpp
xpcom/glue/nsCycleCollectorUtils.cpp
xpcom/glue/nsCycleCollectorUtils.h
xpcom/glue/nsThreadUtils.cpp
xpcom/glue/nsThreadUtils.h
xpcom/io/nsSegmentedBuffer.cpp
xpcom/stub/Makefile.in
xpcom/tests/Makefile.in
xpcom/tests/TestPipes.cpp
xpcom/tests/bug656331_component/Makefile.in
xpcom/tests/component/Makefile.in
xpfe/components/autocomplete/src/Makefile.in
xpinstall/src/Makefile.in
xulrunner/app/Makefile.in
xulrunner/confvars.sh
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -97,61 +97,30 @@ else
 PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 endif
 
 CPPSRCS = nsBrowserApp.cpp
 
 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 
-ifdef BUILD_STATIC_LIBS
-ifdef _MSC_VER
-STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(DEPTH)/staticlib
-else
-STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
-endif
-LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
-else
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 LIBS += $(DIST)/bin/XUL
+TK_LIBS := $(TK_LIBS)
 else
 EXTRA_DSO_LIBS += xul
 endif
-endif
-
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-TK_LIBS := $(TK_LIBS)
-endif
-
-ifdef MOZ_ENABLE_LIBXUL
-APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
-else
-MOZILLA_INTERNAL_API = 1
-APP_XPCOM_LIBS = $(XPCOM_LIBS)
-endif
 
 LIBS += \
 	$(STATIC_COMPONENTS_LINKER_PATH) \
 	$(EXTRA_DSO_LIBS) \
-	$(APP_XPCOM_LIBS) \
+	$(XPCOM_GLUE_LDOPTS) \
 	$(NSPR_LIBS) \
 	$(NULL)
 
-ifdef BUILD_STATIC_LIBS
-LIBS += \
-	$(MOZ_JS_LIBS) \
-	$(TK_LIBS) \
-	$(NULL)
-
-# Add explicit X11 dependency when building against X11 toolkits
-ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
-LIBS += $(XLDFLAGS) $(XLIBS) $(ZLIB_LIBS)
-endif
-endif
-
 ifdef MOZ_JPROF
 LIBS += -ljprof
 endif
 
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
@@ -166,68 +135,44 @@ NSDISTMODE = copy
 include $(topsrcdir)/config/config.mk
 
 ifdef _MSC_VER
 # Always enter a Windows program through wmain, whether or not we're
 # a console application.
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
 
-ifdef BUILD_STATIC_LIBS
-include $(topsrcdir)/config/static-config.mk
-
-EXTRA_DEPS	+= \
-	$(STATIC_EXTRA_DEPS) \
-	$(NULL)
-DEFINES		+= $(STATIC_DEFINES)
-CPPSRCS		+= $(STATIC_CPPSRCS)
-EXTRA_DSO_LIBS	+= $(STATIC_EXTRA_DSO_LIBS)
-EXTRA_LIBS	+= $(STATIC_EXTRA_LIBS)
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
 OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 RCINCLUDE = splash.rc
 ifndef GNU_CC
 RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
 else
 RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir)
 endif
-ifdef BUILD_STATIC_LIBS
-RCFLAGS += -DMOZ_STATIC_BUILD
-endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
 RESFILE=splashos2.res
 RCFLAGS += -DMOZ_PHOENIX
-ifdef BUILD_STATIC_LIBS
-RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include
-endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 RCFLAGS += -DFIREFOX_ICO=\"$(DIST)/branding/firefox-os2.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document-os2.ico\"
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef BUILD_STATIC_LIBS
-include $(topsrcdir)/config/static-rules.mk
-
-DEFINES += -DIMPL_XREAPI
-endif
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
 LIBS += -lphexlib
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 #
 # Control the default heap size.
 # This is the heap returned by GetProcessHeap().
--- a/browser/components/build/Makefile.in
+++ b/browser/components/build/Makefile.in
@@ -69,17 +69,9 @@ EXTRA_DSO_LDOPTS += \
 # Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
 # GTK2: Need to link with glib for GNOME shell service
 ifneq (,$(filter cocoa gtk2,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += \
   $(TK_LIBS) \
   $(NULL)
 endif
 
-ifndef MOZ_ENABLE_LIBXUL
-ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-# Doesn't work, couldn't figure out why
-#EXTRA_DSO_LIBS += thebes
-EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/lib/$(LIB_PREFIX)thebes.$(IMPORT_LIB_SUFFIX)
-endif
-endif
-
 include $(topsrcdir)/config/rules.mk
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -36,19 +36,17 @@
 #
 # ***** END LICENSE BLOCK *****
 
 MOZ_APP_BASENAME=Firefox
 MOZ_APP_VENDOR=Mozilla
 MOZ_UPDATER=1
 MOZ_PHOENIX=1
 
-MOZ_ENABLE_LIBXUL=1
 MOZ_CHROME_FILE_FORMAT=omni
-MOZ_STATIC_BUILD_UNSUPPORTED=1
 # always enabled for form history
 MOZ_MORKREADER=1
 MOZ_SAFE_BROWSING=1
 MOZ_SERVICES_SYNC=1
 MOZ_APP_VERSION=$FIREFOX_VERSION
 MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
 # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
 # Changing either of these values requires a clobber to ensure correct results,
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -42,26 +42,17 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/rules.mk
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
-ifdef MOZ_ENABLE_LIBXUL
 MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
-else
-define message
-You need to build with --enable-libxul (the default, unless you specify
---disable-libxul or --enable-shared or --enable-debug) to package a build.
-endef
-default libs installer::
-	$(error $(message))
-endif
 
 MOZ_NONLOCALIZED_PKG_LIST = \
 	xpcom \
 	browser \
 	$(NULL)
 
 MOZ_LOCALIZED_PKG_LIST = $(AB_CD)
 
--- a/browser/installer/removed-files.in
+++ b/browser/installer/removed-files.in
@@ -1272,31 +1272,23 @@ xpicleanup@BIN_SUFFIX@
     Microsoft.VC80.CRT.manifest
     msvcm80.dll
     msvcp80.dll
     msvcr80.dll
   #else
     mozcrt19.dll
   #endif
 #endif
-#ifdef MOZ_ENABLE_LIBXUL
-  @DLL_PREFIX@xpcom_core@DLL_SUFFIX@
-  components/@DLL_PREFIX@jar50@DLL_SUFFIX@
-  #ifdef XP_WIN
-    components/xpinstal.dll
-  #else
-    components/@DLL_PREFIX@jsd@DLL_SUFFIX@
-    components/@DLL_PREFIX@xpinstall@DLL_SUFFIX@
-  #endif
+@DLL_PREFIX@xpcom_core@DLL_SUFFIX@
+components/@DLL_PREFIX@jar50@DLL_SUFFIX@
+#ifdef XP_WIN
+  components/xpinstal.dll
 #else
-  #ifdef XP_MACOSX
-    XUL
-  #else
-    @DLL_PREFIX@xul@DLL_SUFFIX@
-  #endif
+  components/@DLL_PREFIX@jsd@DLL_SUFFIX@
+  components/@DLL_PREFIX@xpinstall@DLL_SUFFIX@
 #endif
 #ifndef MOZ_UPDATER
   components/nsUpdateService.js
   components/nsUpdateServiceStub.js
 #endif
 #Talkback
 #ifdef XP_WIN
   extensions/talkback@mozilla.org/components/BrandRes.dll
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -117,20 +117,18 @@ ifdef MOZ_BUILD_DATE
 else
 	$(PYTHON) $(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid > buildid
 endif
 
 ifdef WRAP_SYSTEM_INCLUDES
 export::
 	if test ! -d system_wrappers; then mkdir system_wrappers; fi
 	$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) \
-		-DBUILD_STATIC_LIBS=$(BUILD_STATIC_LIBS) \
 		-DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
 		-DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
-		-DMOZ_ENABLE_LIBXUL=$(MOZ_ENABLE_LIBXUL) \
 		-DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
 		-DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
 		-DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
 		-DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
 		-DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
 		-DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
 		-DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
 		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -119,18 +119,16 @@ DEHYDRA_PATH    = @DEHYDRA_PATH@
 
 NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
 USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@
 USE_ELF_HACK = @USE_ELF_HACK@
 STDCXX_COMPAT = @STDCXX_COMPAT@
 INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
 MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
 MOZ_MAIL_NEWS	= @MOZ_MAIL_NEWS@
-BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
-MOZ_ENABLE_LIBXUL = @MOZ_ENABLE_LIBXUL@
 ENABLE_TESTS	= @ENABLE_TESTS@
 IBMBIDI = @IBMBIDI@
 MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
 ACCESSIBILITY = @ACCESSIBILITY@
 MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
 XPCOM_USE_LEA = @XPCOM_USE_LEA@
 MOZ_INSTALLER	= @MOZ_INSTALLER@
 MOZ_UPDATER	= @MOZ_UPDATER@
@@ -450,21 +448,17 @@ JPEG_REQUIRES	= jpeg
 endif
 
 ifdef MOZ_NATIVE_ZLIB
 ZLIB_CFLAGS	= @ZLIB_CFLAGS@
 ZLIB_LIBS	= @ZLIB_LIBS@
 ZLIB_REQUIRES	=
 else
 ZLIB_CFLAGS	= @MOZ_ZLIB_CFLAGS@
-ifdef MOZ_ENABLE_LIBXUL
 MOZ_ZLIB_LIBS = @MOZ_ZLIB_LIBS@
-else
-ZLIB_LIBS = @MOZ_ZLIB_LIBS@
-endif
 ZLIB_REQUIRES	= zlib
 endif
 
 ifdef MOZ_NATIVE_BZ2
 BZ2_CFLAGS	= @BZ2_CFLAGS@
 BZ2_LIBS	= @BZ2_LIBS@
 BZ2_REQUIRES	=
 else
--- a/config/config.mk
+++ b/config/config.mk
@@ -240,85 +240,46 @@ OS_LDFLAGS = -DEBUG -PDB:NONE -OPT:REF
 endif
 endif # NS_TRACE_MALLOC
 
 endif # MOZ_DEBUG
 endif # WINNT && !GNU_CC
 
 #
 # Build using PIC by default
-# Do not use PIC if not building a shared lib (see exceptions below)
 #
-
-ifndef BUILD_STATIC_LIBS
-_ENABLE_PIC=1
-endif
-ifneq (,$(FORCE_SHARED_LIB)$(FORCE_USE_PIC))
 _ENABLE_PIC=1
-endif
-
-# If module is going to be merged into the nsStaticModule, 
-# make sure that the entry points are translated and 
-# the module is built static.
-
-ifdef IS_COMPONENT
-ifdef EXPORT_LIBRARY
-ifneq (,$(BUILD_STATIC_LIBS))
-ifdef MODULE_NAME
-DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
-FORCE_STATIC_LIB=1
-endif
-endif
-endif
-endif
 
 # Determine if module being compiled is destined 
 # to be merged into libxul
 
-ifdef MOZ_ENABLE_LIBXUL
 ifdef LIBXUL_LIBRARY
 ifdef IS_COMPONENT
 ifdef MODULE_NAME
 DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
 else
 $(error Component makefile does not specify MODULE_NAME.)
 endif
 endif
 FORCE_STATIC_LIB=1
-_ENABLE_PIC=1
 SHORT_LIBNAME=
 endif
-endif
 
 # If we are building this component into an extension/xulapp, it cannot be
 # statically linked. In the future we may want to add a xulapp meta-component
 # build option.
 
 ifdef XPI_NAME
-_ENABLE_PIC=1
 ifdef IS_COMPONENT
 EXPORT_LIBRARY=
 FORCE_STATIC_LIB=
 FORCE_SHARED_LIB=1
 endif
 endif
 
-#
-# Disable PIC if necessary
-#
-
-ifndef _ENABLE_PIC
-DSO_CFLAGS=
-ifeq ($(OS_ARCH)_$(HAVE_GCC3_ABI),Darwin_1)
-DSO_PIC_CFLAGS=-mdynamic-no-pic
-else
-DSO_PIC_CFLAGS=
-endif
-endif
-
 ifndef SHARED_LIBRARY_NAME
 ifdef LIBRARY_NAME
 SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
 endif
 endif
 
 ifndef STATIC_LIBRARY_NAME
 ifdef LIBRARY_NAME
@@ -366,47 +327,32 @@ endif # NO_PROFILE_GUIDED_OPTIMIZE
 
 # Does the makefile specifies the internal XPCOM API linkage?
 ifneq (,$(MOZILLA_INTERNAL_API)$(LIBXUL_LIBRARY))
 DEFINES += -DMOZILLA_INTERNAL_API
 endif
 
 # Force XPCOM/widget/gfx methods to be _declspec(dllexport) when we're
 # building libxul libraries
-ifdef MOZ_ENABLE_LIBXUL
 ifdef LIBXUL_LIBRARY
 DEFINES += \
 		-D_IMPL_NS_COM \
 		-DEXPORT_XPT_API \
 		-DEXPORT_XPTC_API \
 		-D_IMPL_NS_GFX \
 		-D_IMPL_NS_WIDGET \
 		-DIMPL_XREAPI \
 		-DIMPL_NS_NET \
 		-DIMPL_THEBES \
 		$(NULL)
 
 ifndef JS_SHARED_LIBRARY
 DEFINES += -DSTATIC_EXPORTABLE_JS_API
 endif
 endif
-endif
-
-# Force _all_ exported methods to be |_declspec(dllexport)| when we're
-# building them into the executable.
-
-ifeq (,$(filter-out WINNT OS2, $(OS_ARCH)))
-ifdef BUILD_STATIC_LIBS
-DEFINES += \
-        -D_IMPL_NS_GFX \
-        -D_IMPL_NS_MSG_BASE \
-        -D_IMPL_NS_WIDGET \
-        $(NULL)
-endif
-endif
 
 # Flags passed to JarMaker.py
 MAKE_JARS_FLAGS = \
 	-t $(topsrcdir) \
 	-f $(MOZ_CHROME_FILE_FORMAT) \
 	$(NULL)
 
 ifdef USE_EXTENSION_MANIFEST
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -211,17 +211,17 @@ endif # CPP_UNIT_TESTS
 .PHONY: check xpcshell-tests check-interactive check-one
 
 endif # ENABLE_TESTS
 
 
 #
 # Library rules
 #
-# If BUILD_STATIC_LIBS or FORCE_STATIC_LIB is set, build a static library.
+# If FORCE_STATIC_LIB is set, build a static library.
 # Otherwise, build a shared library.
 #
 
 ifndef LIBRARY
 ifdef STATIC_LIBRARY_NAME
 _LIBRARY		:= $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
 # Only build actual library if it is installed in DIST/lib or SDK
 ifeq (,$(SDK_LIBRARY)$(DIST_INSTALL)$(NO_EXPAND_LIBS))
@@ -234,17 +234,17 @@ endif # LIBRARY
 
 ifndef HOST_LIBRARY
 ifdef HOST_LIBRARY_NAME
 HOST_LIBRARY		:= $(LIB_PREFIX)$(HOST_LIBRARY_NAME).$(LIB_SUFFIX)
 endif
 endif
 
 ifdef LIBRARY
-ifneq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS))
+ifdef FORCE_SHARED_LIB
 ifdef MKSHLIB
 
 ifdef LIB_IS_C_ONLY
 MKSHLIB			= $(MKCSHLIB)
 endif
 
 ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 IMPORT_LIBRARY		:= $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
@@ -261,45 +261,33 @@ SHARED_LIBRARY		:= $(SHARED_LIBRARY_NAME
 else
 SHARED_LIBRARY		:= $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX)
 endif
 
 ifeq ($(OS_ARCH),OS2)
 DEF_FILE		:= $(SHARED_LIBRARY:.dll=.def)
 endif
 
-ifdef MOZ_ENABLE_LIBXUL
 EMBED_MANIFEST_AT=2
-endif
 
 endif # MKSHLIB
-endif # FORCE_SHARED_LIB && !BUILD_STATIC_LIBS
+endif # FORCE_SHARED_LIB
 endif # LIBRARY
 
-ifeq (,$(BUILD_STATIC_LIBS)$(FORCE_STATIC_LIB))
-LIBRARY			:= $(NULL)
-endif
-
-ifeq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS))
-SHARED_LIBRARY		:= $(NULL)
-DEF_FILE		:= $(NULL)
-IMPORT_LIBRARY		:= $(NULL)
-endif
-
 ifdef FORCE_STATIC_LIB
 ifndef FORCE_SHARED_LIB
 SHARED_LIBRARY		:= $(NULL)
 DEF_FILE		:= $(NULL)
 IMPORT_LIBRARY		:= $(NULL)
 endif
 endif
 
 ifdef FORCE_SHARED_LIB
 ifndef FORCE_STATIC_LIB
-LIBRARY			:= $(NULL)
+LIBRARY := $(NULL)
 endif
 endif
 
 ifdef JAVA_LIBRARY_NAME
 JAVA_LIBRARY := $(JAVA_LIBRARY_NAME).jar
 endif
 
 ifeq ($(OS_ARCH),WINNT)
@@ -780,22 +768,16 @@ endif
 
 #
 # Rule to create list of libraries for final link
 #
 export::
 ifdef LIBRARY_NAME
 ifdef EXPORT_LIBRARY
 ifdef IS_COMPONENT
-ifdef BUILD_STATIC_LIBS
-	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMPS) $(STATIC_LIBRARY_NAME)
-ifdef MODULE_NAME
-	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
-endif
-endif # BUILD_STATIC_LIBS
 else # !IS_COMPONENT
 	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
 endif # IS_COMPONENT
 endif # EXPORT_LIBRARY
 endif # LIBRARY_NAME
 
 ifneq (,$(filter-out %.$(LIB_SUFFIX),$(SHARED_LIBRARY_LIBS)))
 $(error SHARED_LIBRARY_LIBS must contain .$(LIB_SUFFIX) files only)
deleted file mode 100644
--- a/config/static-config.mk
+++ /dev/null
@@ -1,119 +0,0 @@
-#
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either of the GNU General Public License Version 2 or later (the "GPL"),
-# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-# Static components makefile
-# 	Include this makefile after config/config.mk & before config/rules.mk
-#	This makefile will provide the defines for statically linking
-#	all of the components into the binary.
-
-STATIC_CPPSRCS	+= nsStaticComponents.cpp
-STATIC_DEFINES	+= -D_BUILD_STATIC_BIN=1
-STATIC_REQUIRES += \
-	xpcom \
-	string \
-	$(NULL)
-
-STATIC_EXTRA_LIBS += \
-	$(addsuffix .$(LIB_SUFFIX),$(addprefix $(DEPTH)/staticlib/components/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_COMPS)))) \
-	$(addsuffix .$(LIB_SUFFIX),$(addprefix $(DEPTH)/staticlib/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_LIBS)))) \
-	$(NULL)
-
-STATIC_COMPONENT_LIST = $(shell cat $(FINAL_LINK_COMP_NAMES))
-
-STATIC_EXTRA_DEPS	+= $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(addsuffix .$(LIB_SUFFIX),$(addprefix $(DEPTH)/staticlib/components/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_COMPS)))) $(addsuffix .$(LIB_SUFFIX),$(addprefix $(DEPTH)/staticlib/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_LIBS))))
-
-STATIC_EXTRA_DEPS	+= \
-	$(topsrcdir)/config/static-config.mk \
-	$(topsrcdir)/config/static-rules.mk \
-	$(NULL)
-
-ifdef MOZ_PSM
-STATIC_EXTRA_DEPS	+= $(NSS_DEP_LIBS)
-endif
-
-STATIC_EXTRA_LIBS	+= \
-		$(PNG_LIBS) \
-		$(JPEG_LIBS) \
-		$(ZLIB_LIBS) \
-		$(NULL)
-
-ifdef MOZ_PSM
-STATIC_EXTRA_LIBS	+= \
-		$(NSS_LIBS) \
-		$(NULL)
-endif
-
-STATIC_EXTRA_LIBS	+= $(MOZ_CAIRO_LIBS)
-
-STATIC_EXTRA_LIBS	+= $(QCMS_LIBS)
-
-ifdef MOZ_ENABLE_GTK2
-STATIC_EXTRA_LIBS	+= $(XLDFLAGS) $(XT_LIBS) -lgthread-2.0
-STATIC_EXTRA_LIBS	+= $(MOZ_PANGO_LIBS)
-endif
-
-ifdef MOZ_STORAGE
-STATIC_EXTRA_LIBS	+= $(SQLITE_LIBS)
-endif
-
-ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
-STATIC_EXTRA_LIBS	+= $(MOZ_STARTUP_NOTIFICATION_LIBS)
-endif
-
-ifdef MOZ_SYDNEYAUDIO
-ifeq ($(OS_ARCH),Linux)
-STATIC_EXTRA_LIBS += $(MOZ_ALSA_LIBS)
-endif
-endif
-
-# Component Makefile always brings in this.
-# STATIC_EXTRA_LIBS	+= $(TK_LIBS)
-
-ifeq ($(OS_ARCH),WINNT)
-STATIC_EXTRA_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool imm32)
-# XXX temporary workaround until link ordering issue is solved
-ifdef GNU_CC
-STATIC_EXTRA_LIBS += $(call EXPAND_LIBNAME,winmm wsock32 gdi32)
-endif
-STATIC_EXTRA_LIBS += $(call EXPAND_LIBNAME, usp10)
-endif
-
-ifeq ($(OS_ARCH),AIX)
-STATIC_EXTRA_LIBS += $(call EXPAND_LIBNAME,odm cfg)
-endif
-
-LOCAL_INCLUDES += -I$(topsrcdir)/config
deleted file mode 100644
--- a/config/static-rules.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-
-ifdef _NO_AUTO_VARS
-_TARGET = $(srcdir)/$(@F)
-else
-_TARGET = $@
-endif
-
-$(warning FINAL_LINK_COMP_NAMES = $(FINAL_LINK_COMP_NAMES))
-$(warning FINAL_LINK_COMPS = $(FINAL_LINK_COMPS))
-
-nsStaticComponents.cpp: $(topsrcdir)/config/nsStaticComponents.cpp.in $(GLOBAL_DEPS) $(FINAL_LINK_COMP_NAMES)
-	rm -f $@
-	cat $< | \
-	sed -e "s|%MODULE_LIST%|$(foreach m, $(STATIC_COMPONENT_LIST),MODULE($(m)))|" \
-	> $(_TARGET)
-
-GARBAGE += nsStaticComponents.cpp
-
-ifeq ($(OS_ARCH),IRIX)
-LDFLAGS	+= -Wl,-LD_LAYOUT:lgot_buffer=80
-endif
-
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-LIBS	+= -framework QuickTime -framework IOKit -lcrypto
-endif
--- a/config/system-headers
+++ b/config/system-headers
@@ -65,19 +65,16 @@ Bitmap.h
 bitset
 blapi.h
 bsd/libc.h
 bsd/syscall.h
 bstring.h
 builtin.h
 Button.h
 byteswap.h
-#if MOZ_ENABLE_LIBXUL!=1
-#define WRAP_CAIRO_HEADERS
-#endif
 #if MOZ_TREE_CAIRO!=1
 #define WRAP_CAIRO_HEADERS
 #endif
 #ifdef WRAP_CAIRO_HEADERS
 pixman.h
 cairo.h
 cairo-atsui.h
 cairo-beos.h
@@ -989,25 +986,16 @@ plarenas.h
 plarena.h
 plhash.h
 #if MOZ_NATIVE_PNG==1
 png.h
 #endif
 #if MOZ_NATIVE_ZLIB==1
 zlib.h
 #endif
-#if MOZ_ENABLE_LIBXUL!=1
-#if BUILD_STATIC_LIBS!=1
-#define WRAP_LCMS_HEADERS
-#endif
-#endif
-#ifdef WRAP_LCMS_HEADERS
-icc34.h
-lcms.h
-#endif
 #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
 libsn/sn.h
 libsn/sn-common.h
 libsn/sn-launchee.h
 libsn/sn-launcher.h
 libsn/sn-monitor.h
 libsn/sn-util.h
 #endif
--- a/configure.in
+++ b/configure.in
@@ -4428,52 +4428,45 @@ fi # SKIP_COMPILER_CHECKS
 
 dnl ========================================================
 dnl =
 dnl = Check for external package dependencies
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(External Packages)
 
-MOZ_ENABLE_LIBXUL=1
-
 MOZ_ARG_WITH_STRING(libxul-sdk,
 [  --with-libxul-sdk=PFX   Use the libXUL SDK at <PFX>],
   LIBXUL_SDK_DIR=$withval)
 
 if test "$LIBXUL_SDK_DIR" = "yes"; then
     AC_MSG_ERROR([--with-libxul-sdk must specify a path])
 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
     LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
 
     if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
         AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
     fi
 
-    MOZ_ENABLE_LIBXUL=1
 fi
 AC_SUBST(LIBXUL_SDK)
 
 if test -n "$LIBXUL_SDK"; then
     LIBXUL_DIST="$LIBXUL_SDK"
 else
     LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
 fi
 AC_SUBST(LIBXUL_DIST)
 
 SYSTEM_LIBXUL=
 
 MOZ_ARG_WITH_BOOL(system-libxul,
 [  --with-system-libxul    Use system installed libxul SDK],
     SYSTEM_LIBXUL=1)
 
-if test -n "$SYSTEM_LIBXUL" -a -z "$MOZ_ENABLE_LIBXUL"; then
-    AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
-fi
-
 dnl ========================================================
 dnl = If NSPR was not detected in the system, 
 dnl = use the one in the source tree (mozilla/nsprpub)
 dnl ========================================================
 MOZ_ARG_WITH_BOOL(system-nspr,
 [  --with-system-nspr      Use system installed NSPR],
     _USE_SYSTEM_NSPR=1 )
 
@@ -4791,17 +4784,16 @@ MOZ_ARG_WITH_STRING(java-bin-path,
 dnl ========================================================
 dnl =
 dnl = Application
 dnl =
 dnl ========================================================
 
 MOZ_ARG_HEADER(Application)
 
-BUILD_STATIC_LIBS=
 ENABLE_TESTS=1
 MOZ_ACTIVEX_SCRIPTING_SUPPORT=
 MOZ_BRANDING_DIRECTORY=
 MOZ_OFFICIAL_BRANDING=
 MOZ_FEEDS=1
 MOZ_INSTALLER=1
 MOZ_JSDEBUGGER=1
 MOZ_MATHML=1
@@ -8096,32 +8088,16 @@ AC_SUBST(CXX_WRAPPER)
 
 dnl ========================================================
 dnl =
 dnl = Static Build Options
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Static build options)
 
-MOZ_ARG_ENABLE_BOOL(static,
-[  --enable-static         Enable building internal static libs],
-    BUILD_STATIC_LIBS=1,
-    BUILD_STATIC_LIBS=)
-
-MOZ_ENABLE_LIBXUL=1
-
-MOZ_ARG_DISABLE_BOOL(libxul,
-[  --disable-libxul        Disable building libxul (not supported)],
-    MOZ_ENABLE_LIBXUL=,
-    MOZ_ENABLE_LIBXUL=1)
-
-if test -z "$MOZ_ENABLE_LIBXUL"; then
-  AC_MSG_ERROR([--disable-libxul is no longer supported.])
-fi
-
 # split JS out by default to avoid VS2005 PGO crash (bug 591836).
 if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" != "x86_64" ; then
   ENABLE_SHARED_JS=1
 fi
 
 MOZ_ARG_ENABLE_BOOL(shared-js,
 [  --enable-shared-js
                           Create a shared JavaScript library.],
@@ -8132,27 +8108,18 @@ if test -n "$ENABLE_SHARED_JS"; then
   JS_SHARED_LIBRARY=1
   MOZ_JS_LIBS=$MOZ_JS_SHARED_LIBS
 else
   MOZ_JS_LIBS=$MOZ_JS_STATIC_LIBS
   AC_DEFINE(MOZ_STATIC_JS)
 fi
 AC_SUBST(JS_SHARED_LIBRARY)
 
-if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
-  AC_MSG_ERROR([--enable-static is not supported for building $MOZ_BUILD_APP.])
-fi
-
-if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
-  AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
-fi
-
 AC_SUBST(LIBXUL_LIBS)
 XPCOM_LIBS="$LIBXUL_LIBS"
-AC_DEFINE(MOZ_ENABLE_LIBXUL)
 
 dnl ========================================================
 dnl =
 dnl = Standalone module options
 dnl = 
 dnl ========================================================
 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
 
@@ -8793,18 +8760,16 @@ AC_SUBST(MOZ_WEBGL)
 AC_SUBST(MOZ_HELP_VIEWER)
 
 AC_SUBST(JAVA)
 AC_SUBST(JAVAC)
 AC_SUBST(JAR)
 
 AC_SUBST(MOZ_PROFILELOCKING)
 
-AC_SUBST(BUILD_STATIC_LIBS)
-AC_SUBST(MOZ_ENABLE_LIBXUL)
 AC_SUBST(ENABLE_TESTS)
 AC_SUBST(IBMBIDI)
 AC_SUBST(MOZ_UNIVERSALCHARDET)
 AC_SUBST(ACCESSIBILITY)
 AC_SUBST(MOZ_SPELLCHECK)
 AC_SUBST(MOZ_USER_DIR)
 AC_SUBST(MOZ_CRASHREPORTER)
 AC_SUBST(MOZ_UPDATER)
--- a/content/svg/content/src/nsSVGSVGElement.cpp
+++ b/content/svg/content/src/nsSVGSVGElement.cpp
@@ -55,17 +55,16 @@
 #include "nsISVGSVGFrame.h" //XXX
 #include "nsSVGRect.h"
 #include "nsISVGValueUtils.h"
 #include "nsDOMError.h"
 #include "nsISVGChildFrame.h"
 #include "nsGUIEvent.h"
 #include "nsSVGUtils.h"
 #include "nsSVGSVGElement.h"
-#include "nsSVGEffects.h" // For nsSVGEffects::RemoveAllRenderingObservers
 #include "nsContentErrors.h" // For NS_PROPTABLE_PROP_OVERWRITTEN
 
 #ifdef MOZ_SMIL
 #include "nsEventDispatcher.h"
 #include "nsSMILTimeContainer.h"
 #include "nsSMILAnimationController.h"
 #include "nsSMILTypes.h"
 #include "nsIContentIterator.h"
@@ -1284,25 +1283,16 @@ nsSVGSVGElement::DidAnimatePreserveAspec
 }
 
 SVGAnimatedPreserveAspectRatio *
 nsSVGSVGElement::GetPreserveAspectRatio()
 {
   return &mPreserveAspectRatio;
 }
 
-#ifndef MOZ_ENABLE_LIBXUL
-// XXXdholbert HACK -- see comment w/ this method's declaration in header file.
-void
-nsSVGSVGElement::RemoveAllRenderingObservers()
-{
-  nsSVGEffects::RemoveAllRenderingObservers(this);
-}
-#endif // !MOZ_LIBXUL
-
 PRBool
 nsSVGSVGElement::ShouldSynthesizeViewBox()
 {
   NS_ABORT_IF_FALSE(!HasValidViewbox(),
                     "Should only be called if we lack a viewBox");
 
   nsIDocument* doc = GetCurrentDoc();
   return doc &&
--- a/content/svg/content/src/nsSVGSVGElement.h
+++ b/content/svg/content/src/nsSVGSVGElement.h
@@ -221,23 +221,16 @@ public:
 
   void SetViewportSize(const svgFloatSize& aSize) {
     mViewportWidth  = aSize.width;
     mViewportHeight = aSize.height;
   }
 
   virtual nsXPCClassInfo* GetClassInfo();
 
-#ifndef MOZ_ENABLE_LIBXUL
-  // XXXdholbert HACK to call static method
-  // nsSVGEffects::RemoveAllRenderingObservers() on myself, on behalf
-  // of imagelib in non-libxul builds.
-  virtual void RemoveAllRenderingObservers();
-#endif // !MOZ_LIBXUL
-
 private:
   // Methods for <image> elements to override my "PreserveAspectRatio" value.
   // These are private so that only our friends (nsSVGImageFrame in
   // particular) have access.
   void SetImageOverridePreserveAspectRatio(const SVGPreserveAspectRatio& aPAR);
   void ClearImageOverridePreserveAspectRatio();
   const SVGPreserveAspectRatio* GetImageOverridePreserveAspectRatio();
 
--- a/db/morkreader/Makefile.in
+++ b/db/morkreader/Makefile.in
@@ -38,20 +38,17 @@
 
 DEPTH = ../..
 topsrcdir = @top_srcdir@
 srcdir = @srcdir@
 VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-ifdef MOZ_ENABLE_LIBXUL
 DIRS = external
-endif
-
 MODULE = morkreader
 LIBRARY_NAME  = morkreader_s
 LIBXUL_LIBRARY = 1
 FORCE_STATIC_LIB = 1
 EXPORT_LIBRARY = 1
 
 
 EXPORTS = nsMorkReader.h
--- a/docshell/build/Makefile.in
+++ b/docshell/build/Makefile.in
@@ -52,21 +52,16 @@ EXPORT_LIBRARY = 1
 GRE_MODULE	= 1
 LIBXUL_LIBRARY	= 1
 
 
 EXPORTS = \
 		  nsDocShellCID.h \
 		  $(NULL)
 
-ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),WINNT)
-EXTRA_DSO_LIBS	= gkgfx
-endif
-
-
 CPPSRCS		= \
 		nsDocShellModule.cpp		\
 		$(NULL)
 
 SHARED_LIBRARY_LIBS= \
 		../base/$(LIB_PREFIX)basedocshell_s.$(LIB_SUFFIX) \
 		$(DEPTH)/uriloader/base/$(LIB_PREFIX)uriloaderbase_s.$(LIB_SUFFIX) \
 		$(DEPTH)/uriloader/exthandler/$(LIB_PREFIX)exthandler_s.$(LIB_SUFFIX) \
--- a/dom/plugins/test/testplugin/Makefile.in
+++ b/dom/plugins/test/testplugin/Makefile.in
@@ -40,16 +40,17 @@ topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE       = nptest
 LIBRARY_NAME = nptest
 MODULE_NAME  = TestPlugin
+FORCE_SHARED_LIB = 1
 
 # Don't use STL wrappers; nptest isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; nptest isn't Gecko code
 USE_STATIC_LIBS = 1
 
 # Need to custom install plugins
--- a/embedding/tests/Makefile.in
+++ b/embedding/tests/Makefile.in
@@ -31,16 +31,12 @@
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 ifeq ($(OS_ARCH),WINNT)
-# disable winembed in non-libxul
-ifndef BUILD_STATIC_LIBS
 DIRS = winEmbed
 endif
 
-endif
-
 include $(topsrcdir)/config/rules.mk
--- a/gfx/Makefile.in
+++ b/gfx/Makefile.in
@@ -43,30 +43,15 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= gfx
 
 ifdef MOZ_TREE_CAIRO
 DIRS		= cairo
 endif
 
-# In static builds, ycbcr must appear after layers in
-# the link line on linux. This order is defined by the
-# order listed in DIRS. On shared builds ycbcr must
-# be built first so the order is reversed.
-ifndef BUILD_STATIC_LIBS
-DIRS		+= ycbcr
-endif
-
-DIRS		+= angle
-
-
-DIRS		+= src qcms layers harfbuzz/src ots/src thebes ipc
-
-ifdef BUILD_STATIC_LIBS
-DIRS		+= ycbcr
-endif
+DIRS		+= ycbcr angle src qcms layers harfbuzz/src ots/src thebes ipc
 
 ifdef ENABLE_TESTS
 TOOL_DIRS	+= tests
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/gfx/angle/Makefile.in
+++ b/gfx/angle/Makefile.in
@@ -116,20 +116,16 @@ CSRCS   = \
         memory.c \
         scanner.c \
         symbols.c \
         tokens.c \
 	$(NULL)
 
 DEFINES += -DANGLE_USE_NSPR -DANGLE_BUILD
 
-ifndef MOZ_ENABLE_LIBXUL
-EXTRA_DSO_LDOPTS = $(MOZ_COMPONENT_LIBS)
-endif
-
 # ANGLE only on Win32 for now, the solution isn't set up
 # for 64-bit yet. This is handled by MOZ_ANGLE which the configure script
 # leaves undefined in the 64-bit case.
 ifdef MOZ_ANGLE
 
 # libEGL depends on (links against!) libGLESv2!
 DIRS = src/libGLESv2 src/libEGL
 
deleted file mode 100644
--- a/gfx/angle/angle-shared.patch
+++ /dev/null
@@ -1,205 +0,0 @@
-# HG changeset patch
-# Parent 438b6d09a9fac42fd66235e626a09a0ea4e88b61
-
-diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/ShaderLang.h
---- a/gfx/angle/include/GLSLANG/ShaderLang.h
-+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
-@@ -1,16 +1,36 @@
- //
- // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- //
- #ifndef _COMPILER_INTERFACE_INCLUDED_
- #define _COMPILER_INTERFACE_INCLUDED_
- 
-+#ifdef MOZILLA_VERSION
-+#include "nscore.h"
-+
-+#ifdef WIN32
-+# if !defined(MOZ_ENABLE_LIBXUL) && !defined(MOZ_STATIC_BUILD)
-+#  ifdef ANGLE_BUILD
-+#   define ANGLE_API NS_EXPORT
-+#  else
-+#   define ANGLE_API NS_IMPORT
-+#  endif
-+# else
-+#  define ANGLE_API  /*nothing*/
-+# endif
-+#else
-+# define ANGLE_API NS_EXTERNAL_VIS
-+#endif
-+#else
-+#define ANGLE_API /*nothing*/
-+#endif
-+
- //
- // This is the platform independent interface between an OGL driver
- // and the shading language compiler.
- //
- 
- #ifdef __cplusplus
- extern "C" {
- #endif
-@@ -76,22 +96,22 @@ typedef enum {
-   SH_SOURCE_PATH            = 0x0200,
- } ShCompileOptions;
- 
- //
- // Driver must call this first, once, before doing any other
- // compiler operations.
- // If the function succeeds, the return value is nonzero, else zero.
- //
--int ShInitialize();
-+ANGLE_API int ShInitialize();
- //
- // Driver should call this at shutdown.
- // If the function succeeds, the return value is nonzero, else zero.
- //
--int ShFinalize();
-+ANGLE_API int ShFinalize();
- 
- //
- // Implementation dependent built-in resources (constants and extensions).
- // The names for these resources has been obtained by stripping gl_/GL_.
- //
- typedef struct
- {
-     // Constants.
-@@ -107,17 +127,17 @@ typedef struct
-     // Extensions.
-     // Set to 1 to enable the extension, else 0.
-     int OES_standard_derivatives;
- } ShBuiltInResources;
- 
- //
- // Initialize built-in resources with minimum expected values.
- //
--void ShInitBuiltInResources(ShBuiltInResources* resources);
-+ANGLE_API void ShInitBuiltInResources(ShBuiltInResources* resources);
- 
- //
- // ShHandle held by but opaque to the driver.  It is allocated,
- // managed, and de-allocated by the compiler. It's contents 
- // are defined by and used by the compiler.
- //
- // If handle creation fails, 0 will be returned.
- //
-@@ -127,19 +147,19 @@ typedef void* ShHandle;
- // Driver calls these to create and destroy compiler objects.
- //
- // Returns the handle of constructed compiler.
- // Parameters:
- // type: Specifies the type of shader - SH_FRAGMENT_SHADER or SH_VERTEX_SHADER.
- // spec: Specifies the language spec the compiler must conform to -
- //       SH_GLES2_SPEC or SH_WEBGL_SPEC.
- // resources: Specifies the built-in resources.
--ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
-+ANGLE_API ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
-                              const ShBuiltInResources* resources);
--void ShDestruct(ShHandle handle);
-+ANGLE_API void ShDestruct(ShHandle handle);
- 
- //
- // Compiles the given shader source.
- // If the function succeeds, the return value is nonzero, else zero.
- // Parameters:
- // handle: Specifies the handle of compiler to be used.
- // shaderStrings: Specifies an array of pointers to null-terminated strings
- //                containing the shader source code.
-@@ -156,17 +176,17 @@ void ShDestruct(ShHandle handle);
- // SH_INTERMEDIATE_TREE: Writes intermediate tree to info log.
- //                       Can be queried by calling ShGetInfoLog().
- // SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader.
- //                 Can be queried by calling ShGetObjectCode().
- // SH_ATTRIBUTES_UNIFORMS: Extracts attributes and uniforms.
- //                         Can be queried by calling ShGetActiveAttrib() and
- //                         ShGetActiveUniform().
- //
--int ShCompile(
-+ANGLE_API int ShCompile(
-     const ShHandle handle,
-     const char* const shaderStrings[],
-     const int numStrings,
-     int compileOptions
-     );
- 
- // Returns a parameter from a compiled shader.
- // Parameters:
-@@ -182,53 +202,53 @@ int ShCompile(
- //                                 variable name including the null
- //                                 termination character.
- // SH_ACTIVE_UNIFORMS: the number of active uniform variables.
- // SH_ACTIVE_UNIFORM_MAX_LENGTH: the length of the longest active uniform
- //                               variable name including the null
- //                               termination character.
- // 
- // params: Requested parameter
--void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
-+ANGLE_API void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
- 
- // Returns nul-terminated information log for a compiled shader.
- // Parameters:
- // handle: Specifies the compiler
- // infoLog: Specifies an array of characters that is used to return
- //          the information log. It is assumed that infoLog has enough memory
- //          to accomodate the information log. The size of the buffer required
- //          to store the returned information log can be obtained by calling
- //          ShGetInfo with SH_INFO_LOG_LENGTH.
--void ShGetInfoLog(const ShHandle handle, char* infoLog);
-+ANGLE_API void ShGetInfoLog(const ShHandle handle, char* infoLog);
- 
- // Returns null-terminated object code for a compiled shader.
- // Parameters:
- // handle: Specifies the compiler
- // infoLog: Specifies an array of characters that is used to return
- //          the object code. It is assumed that infoLog has enough memory to
- //          accomodate the object code. The size of the buffer required to
- //          store the returned object code can be obtained by calling
- //          ShGetInfo with SH_OBJECT_CODE_LENGTH.
--void ShGetObjectCode(const ShHandle handle, char* objCode);
-+ANGLE_API void ShGetObjectCode(const ShHandle handle, char* objCode);
- 
- // Returns information about an active attribute variable.
- // Parameters:
- // handle: Specifies the compiler
- // index: Specifies the index of the attribute variable to be queried.
- // length: Returns the number of characters actually written in the string
- //         indicated by name (excluding the null terminator) if a value other
- //         than NULL is passed.
- // size: Returns the size of the attribute variable.
- // type: Returns the data type of the attribute variable.
- // name: Returns a null terminated string containing the name of the
- //       attribute variable. It is assumed that name has enough memory to
- //       accomodate the attribute variable name. The size of the buffer
- //       required to store the attribute variable name can be obtained by
- //       calling ShGetInfo with SH_ACTIVE_ATTRIBUTE_MAX_LENGTH.
--void ShGetActiveAttrib(const ShHandle handle,
-+ANGLE_API void ShGetActiveAttrib(const ShHandle handle,
-                        int index,
-                        int* length,
-                        int* size,
-                        ShDataType* type,
-                        char* name);
- 
- // Returns information about an active uniform variable.
- // Parameters:
-@@ -239,17 +259,17 @@ void ShGetActiveAttrib(const ShHandle ha
- //         other than NULL is passed.
- // size: Returns the size of the uniform variable.
- // type: Returns the data type of the uniform variable.
- // name: Returns a null terminated string containing the name of the
- //       uniform variable. It is assumed that name has enough memory to
- //       accomodate the uniform variable name. The size of the buffer required
- //       to store the uniform variable name can be obtained by calling
- //       ShGetInfo with SH_ACTIVE_UNIFORMS_MAX_LENGTH.
--void ShGetActiveUniform(const ShHandle handle,
-+ANGLE_API void ShGetActiveUniform(const ShHandle handle,
-                         int index,
-                         int* length,
-                         int* size,
-                         ShDataType* type,
-                         char* name);
- 
- #ifdef __cplusplus
- }
--- a/gfx/angle/include/GLSLANG/ShaderLang.h
+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
@@ -1,36 +1,16 @@
 //
 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 #ifndef _COMPILER_INTERFACE_INCLUDED_
 #define _COMPILER_INTERFACE_INCLUDED_
 
-#ifdef MOZILLA_VERSION
-#include "nscore.h"
-
-#ifdef WIN32
-# if !defined(MOZ_ENABLE_LIBXUL) && !defined(MOZ_STATIC_BUILD)
-#  ifdef ANGLE_BUILD
-#   define ANGLE_API NS_EXPORT
-#  else
-#   define ANGLE_API NS_IMPORT
-#  endif
-# else
-#  define ANGLE_API  /*nothing*/
-# endif
-#else
-# define ANGLE_API NS_EXTERNAL_VIS
-#endif
-#else
-#define ANGLE_API /*nothing*/
-#endif
-
 //
 // This is the platform independent interface between an OGL driver
 // and the shading language compiler.
 //
 
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -96,22 +76,22 @@ typedef enum {
   SH_SOURCE_PATH            = 0x0200
 } ShCompileOptions;
 
 //
 // Driver must call this first, once, before doing any other
 // compiler operations.
 // If the function succeeds, the return value is nonzero, else zero.
 //
-ANGLE_API int ShInitialize();
+int ShInitialize();
 //
 // Driver should call this at shutdown.
 // If the function succeeds, the return value is nonzero, else zero.
 //
-ANGLE_API int ShFinalize();
+int ShFinalize();
 
 //
 // Implementation dependent built-in resources (constants and extensions).
 // The names for these resources has been obtained by stripping gl_/GL_.
 //
 typedef struct
 {
     // Constants.
@@ -127,17 +107,17 @@ typedef struct
     // Extensions.
     // Set to 1 to enable the extension, else 0.
     int OES_standard_derivatives;
 } ShBuiltInResources;
 
 //
 // Initialize built-in resources with minimum expected values.
 //
-ANGLE_API void ShInitBuiltInResources(ShBuiltInResources* resources);
+void ShInitBuiltInResources(ShBuiltInResources* resources);
 
 //
 // ShHandle held by but opaque to the driver.  It is allocated,
 // managed, and de-allocated by the compiler. It's contents 
 // are defined by and used by the compiler.
 //
 // If handle creation fails, 0 will be returned.
 //
@@ -147,19 +127,19 @@ typedef void* ShHandle;
 // Driver calls these to create and destroy compiler objects.
 //
 // Returns the handle of constructed compiler.
 // Parameters:
 // type: Specifies the type of shader - SH_FRAGMENT_SHADER or SH_VERTEX_SHADER.
 // spec: Specifies the language spec the compiler must conform to -
 //       SH_GLES2_SPEC or SH_WEBGL_SPEC.
 // resources: Specifies the built-in resources.
-ANGLE_API ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
+ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
                              const ShBuiltInResources* resources);
-ANGLE_API void ShDestruct(ShHandle handle);
+void ShDestruct(ShHandle handle);
 
 //
 // Compiles the given shader source.
 // If the function succeeds, the return value is nonzero, else zero.
 // Parameters:
 // handle: Specifies the handle of compiler to be used.
 // shaderStrings: Specifies an array of pointers to null-terminated strings
 //                containing the shader source code.
@@ -176,17 +156,17 @@ ANGLE_API void ShDestruct(ShHandle handl
 // SH_INTERMEDIATE_TREE: Writes intermediate tree to info log.
 //                       Can be queried by calling ShGetInfoLog().
 // SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader.
 //                 Can be queried by calling ShGetObjectCode().
 // SH_ATTRIBUTES_UNIFORMS: Extracts attributes and uniforms.
 //                         Can be queried by calling ShGetActiveAttrib() and
 //                         ShGetActiveUniform().
 //
-ANGLE_API int ShCompile(
+int ShCompile(
     const ShHandle handle,
     const char* const shaderStrings[],
     const int numStrings,
     int compileOptions
     );
 
 // Returns a parameter from a compiled shader.
 // Parameters:
@@ -202,53 +182,53 @@ ANGLE_API int ShCompile(
 //                                 variable name including the null
 //                                 termination character.
 // SH_ACTIVE_UNIFORMS: the number of active uniform variables.
 // SH_ACTIVE_UNIFORM_MAX_LENGTH: the length of the longest active uniform
 //                               variable name including the null
 //                               termination character.
 // 
 // params: Requested parameter
-ANGLE_API void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
+void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
 
 // Returns nul-terminated information log for a compiled shader.
 // Parameters:
 // handle: Specifies the compiler
 // infoLog: Specifies an array of characters that is used to return
 //          the information log. It is assumed that infoLog has enough memory
 //          to accomodate the information log. The size of the buffer required
 //          to store the returned information log can be obtained by calling
 //          ShGetInfo with SH_INFO_LOG_LENGTH.
-ANGLE_API void ShGetInfoLog(const ShHandle handle, char* infoLog);
+void ShGetInfoLog(const ShHandle handle, char* infoLog);
 
 // Returns null-terminated object code for a compiled shader.
 // Parameters:
 // handle: Specifies the compiler
 // infoLog: Specifies an array of characters that is used to return
 //          the object code. It is assumed that infoLog has enough memory to
 //          accomodate the object code. The size of the buffer required to
 //          store the returned object code can be obtained by calling
 //          ShGetInfo with SH_OBJECT_CODE_LENGTH.
-ANGLE_API void ShGetObjectCode(const ShHandle handle, char* objCode);
+void ShGetObjectCode(const ShHandle handle, char* objCode);
 
 // Returns information about an active attribute variable.
 // Parameters:
 // handle: Specifies the compiler
 // index: Specifies the index of the attribute variable to be queried.
 // length: Returns the number of characters actually written in the string
 //         indicated by name (excluding the null terminator) if a value other
 //         than NULL is passed.
 // size: Returns the size of the attribute variable.
 // type: Returns the data type of the attribute variable.
 // name: Returns a null terminated string containing the name of the
 //       attribute variable. It is assumed that name has enough memory to
 //       accomodate the attribute variable name. The size of the buffer
 //       required to store the attribute variable name can be obtained by
 //       calling ShGetInfo with SH_ACTIVE_ATTRIBUTE_MAX_LENGTH.
-ANGLE_API void ShGetActiveAttrib(const ShHandle handle,
+void ShGetActiveAttrib(const ShHandle handle,
                        int index,
                        int* length,
                        int* size,
                        ShDataType* type,
                        char* name);
 
 // Returns information about an active uniform variable.
 // Parameters:
@@ -259,17 +239,17 @@ ANGLE_API void ShGetActiveAttrib(const S
 //         other than NULL is passed.
 // size: Returns the size of the uniform variable.
 // type: Returns the data type of the uniform variable.
 // name: Returns a null terminated string containing the name of the
 //       uniform variable. It is assumed that name has enough memory to
 //       accomodate the uniform variable name. The size of the buffer required
 //       to store the uniform variable name can be obtained by calling
 //       ShGetInfo with SH_ACTIVE_UNIFORMS_MAX_LENGTH.
-ANGLE_API void ShGetActiveUniform(const ShHandle handle,
+void ShGetActiveUniform(const ShHandle handle,
                         int index,
                         int* length,
                         int* size,
                         ShDataType* type,
                         char* name);
 
 #ifdef __cplusplus
 }
--- a/gfx/cairo/cairo/src/Makefile.in
+++ b/gfx/cairo/cairo/src/Makefile.in
@@ -38,20 +38,16 @@
 
 DEPTH           = ../../../..
 topsrcdir       = @top_srcdir@
 srcdir          = @srcdir@
 VPATH           = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-ifndef MOZ_ENABLE_LIBXUL
-VISIBILITY_FLAGS =
-endif
-
 MODULE          = cairo
 LIBRARY_NAME    = mozcairo
 LIBXUL_LIBRARY = 1
 
 ifdef GNU_CC
 OS_CXXFLAGS := $(filter-out -pedantic,$(OS_CXXFLAGS))
 MODULE_OPTIMIZE_FLAGS = -O2
 else
--- a/gfx/cairo/cairo/src/cairo-platform.h
+++ b/gfx/cairo/cairo/src/cairo-platform.h
@@ -37,49 +37,27 @@
 #ifndef CAIRO_PLATFORM_H
 #define CAIRO_PLATFORM_H
 
 #include "prcpucfg.h"
 
 /* we're replacing any definition from cairoint.h etc */
 #undef cairo_public
 
-#if defined(MOZ_ENABLE_LIBXUL)
-
 #ifdef HAVE_VISIBILITY_HIDDEN_ATTRIBUTE
 #define CVISIBILITY_HIDDEN __attribute__((visibility("hidden")))
 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
 #define CVISIBILITY_HIDDEN __hidden
 #else
 #define CVISIBILITY_HIDDEN
 #endif
 
 /* In libxul builds we don't ever want to export cairo symbols */
 #define cairo_public extern CVISIBILITY_HIDDEN
 
-#else
-
-#ifdef MOZ_STATIC_BUILD
-# define cairo_public
-#else
-# if defined(XP_WIN) || defined(XP_BEOS) || defined(XP_OS2)
-#  define cairo_public extern __declspec(dllexport)
-# else
-#  ifdef HAVE_VISIBILITY_ATTRIBUTE
-#   define cairo_public extern __attribute__((visibility("default")))
-#  elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
-#   define cairo_public extern __global
-#  else
-#   define cairo_public extern
-#  endif
-# endif
-#endif
-
-#endif
-
 #define CCALLBACK
 #define CCALLBACK_DECL
 #define CSTATIC_CALLBACK(__x) static __x
 
 #ifdef MOZILLA_VERSION
 #include "cairo-rename.h"
 #endif
 
--- a/gfx/cairo/cairo/src/cairo-spline.c
+++ b/gfx/cairo/cairo/src/cairo-spline.c
@@ -189,24 +189,22 @@ void CrashSpline(double tolerance, int a
 static cairo_status_t
 _cairo_spline_decompose_into (cairo_spline_knots_t *s1, double tolerance_squared, cairo_spline_t *result)
 {
     static int depth;
     cairo_spline_knots_t s2;
     cairo_status_t status;
 
     depth++;
-#ifdef MOZ_ENABLE_LIBXUL
     if (depth == 200) {
         CrashSpline(tolerance_squared, s1->a.x, s1->a.y,
                 s1->b.x, s1->b.y,
                 s1->c.x, s1->c.y,
                 s1->d.x, s1->d.y);
     }
-#endif
 
     if (_cairo_spline_error_squared (s1) < tolerance_squared) {
         depth--;
 	return _cairo_spline_add_point (result, &s1->a);
     }
 
     _de_casteljau (s1, &s2);
 
@@ -222,26 +220,24 @@ static cairo_status_t
 }
 
 cairo_status_t
 _cairo_spline_decompose (cairo_spline_t *spline, double tolerance)
 {
     cairo_spline_knots_t s1;
     cairo_status_t status;
 
-#ifdef MOZ_ENABLE_LIBXUL
     StoreSpline(spline->knots.a.x,
                 spline->knots.a.y,
                 spline->knots.b.x,
                 spline->knots.b.y,
                 spline->knots.c.x,
                 spline->knots.c.y,
                 spline->knots.d.x,
                 spline->knots.d.y);
-#endif
     s1 = spline->knots;
     spline->last_point = s1.a;
     status = _cairo_spline_decompose_into (&s1, tolerance * tolerance, spline);
     if (unlikely (status))
 	return status;
 
     return _cairo_spline_add_point (spline, &spline->knots.d);
 }
--- a/gfx/cairo/libpixman/src/Makefile.in
+++ b/gfx/cairo/libpixman/src/Makefile.in
@@ -176,28 +176,16 @@ EXPORTS		= pixman.h pixman-version.h
 LOCAL_INCLUDES	+= -I$(srcdir) -I$(srcdir)/../../cairo/src
 
 FORCE_STATIC_LIB = 1
 # This library is used by other shared libs in a static build
 FORCE_USE_PIC = 1
 
 include $(topsrcdir)/config/config.mk
 
-ifndef MOZ_ENABLE_LIBXUL
-ifdef GNU_CC
-# -fvisibility=hidden works fine but PIXMAN_EXPORT is not used in header
-# files, so pixman.h needs to be included before
-# "#pragma GCC visibility -push(hidden)".
-ifdef WRAP_SYSTEM_INCLUDES
-MY_VISIBILITY_FLAGS := -DPIXMAN_USE_INTERNAL_API -include pixman.h $(VISIBILITY_FLAGS)
-COMPILE_CFLAGS += $(MY_VISIBILITY_FLAGS)
-endif # WRAP_SYSTEM_INCLUDES
-endif # GNU_CC
-endif # !MOZ_ENABLE_LIBXUL
-
 include $(topsrcdir)/config/rules.mk
 
 CFLAGS += -DPACKAGE="mozpixman" -D_USE_MATH_DEFINES
 
 # Disable spammy "missing initializer" GCC warning
 ifdef GNU_CC
 CFLAGS += -Wno-missing-field-initializers
 endif # GNU_CC
--- a/gfx/cairo/libpixman/src/pixman-compiler.h
+++ b/gfx/cairo/libpixman/src/pixman-compiler.h
@@ -60,31 +60,31 @@
 #      define force_inline inline
 #   endif
 #   ifndef noinline
 #      define noinline
 #   endif
 #endif
 
 /* In libxul builds we don't ever want to export pixman symbols */
-#ifdef MOZ_ENABLE_LIBXUL
+#if 1
 #   define PIXMAN_EXPORT cairo_public
 #else
 
 /* GCC visibility */
 #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(_WIN32)
 #   define PIXMAN_EXPORT __attribute__ ((visibility("default")))
 /* Sun Studio 8 visibility */
 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
 #   define PIXMAN_EXPORT __global
 #else
 #   define PIXMAN_EXPORT
 #endif
 
-#endif /* MOZ_ENABLE_LIBXUL */
+#endif
 
 /* TLS */
 #if defined(PIXMAN_NO_TLS)
 
 #   define PIXMAN_DEFINE_THREAD_LOCAL(type, name)			\
     static type name
 #   define PIXMAN_GET_THREAD_LOCAL(name)				\
     (&name)
--- a/gfx/cairo/pixman-export.patch
+++ b/gfx/cairo/pixman-export.patch
@@ -6,31 +6,31 @@ diff --git a/gfx/cairo/libpixman/src/pix
  #      define force_inline inline
  #   endif
  #   ifndef noinline
  #      define noinline
  #   endif
  #endif
  
 +/* In libxul builds we don't ever want to export pixman symbols */
-+#ifdef MOZ_ENABLE_LIBXUL
++#if 1
 +#   define PIXMAN_EXPORT cairo_public
 +#else
 +
  /* GCC visibility */
  #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(_WIN32)
  #   define PIXMAN_EXPORT __attribute__ ((visibility("default")))
  /* Sun Studio 8 visibility */
  #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
  #   define PIXMAN_EXPORT __global
  #else
  #   define PIXMAN_EXPORT
  #endif
  
-+#endif /* MOZ_ENABLE_LIBXUL */
++#endif
 +
  /* TLS */
  #if defined(PIXMAN_NO_TLS)
  
  #   define PIXMAN_DEFINE_THREAD_LOCAL(type, name)			\
      static type name
  #   define PIXMAN_GET_THREAD_LOCAL(name)				\
      (&name)
--- a/gfx/harfbuzz/src/Makefile.in
+++ b/gfx/harfbuzz/src/Makefile.in
@@ -27,20 +27,16 @@
 
 DEPTH     = ../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-ifndef MOZ_ENABLE_LIBXUL
-VISIBILITY_FLAGS =
-endif
-
 MODULE         = harfbuzz
 LIBRARY_NAME   = mozharfbuzz
 LIBXUL_LIBRARY = 1
 
 CSRCS =            \
   hb-blob.c        \
   hb-language.c    \
   hb-ot-tag.c      \
--- a/gfx/layers/opengl/LayerManagerOGLProgram.h
+++ b/gfx/layers/opengl/LayerManagerOGLProgram.h
@@ -43,17 +43,17 @@
 #include "prenv.h"
 
 #include "nsString.h"
 #include "GLContext.h"
 
 namespace mozilla {
 namespace layers {
 
-#if defined(DEBUG) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(DEBUG)
 #define CHECK_CURRENT_PROGRAM 1
 #define ASSERT_THIS_PROGRAM                                             \
   do {                                                                  \
     NS_ASSERTION(mGL->GetUserData(&sCurrentProgramKey) == this, \
                  "SetUniform with wrong program active!");              \
   } while (0)
 #else
 #define ASSERT_THIS_PROGRAM
--- a/gfx/src/gfxCore.h
+++ b/gfx/src/gfxCore.h
@@ -45,24 +45,13 @@ namespace mozilla {
   namespace css {
     enum Side {eSideTop, eSideRight, eSideBottom, eSideLeft};
   }
 }
 #define NS_SIDE_TOP     mozilla::css::eSideTop
 #define NS_SIDE_RIGHT   mozilla::css::eSideRight
 #define NS_SIDE_BOTTOM  mozilla::css::eSideBottom
 #define NS_SIDE_LEFT    mozilla::css::eSideLeft
-
-#if defined(MOZ_ENABLE_LIBXUL) || !defined(MOZILLA_INTERNAL_API)
-#  define NS_GFX
-#  define NS_GFX_(type) type
-#  define NS_GFX_STATIC_MEMBER_(type) type
-#elif defined(_IMPL_NS_GFX)
-#  define NS_GFX NS_EXPORT
-#  define NS_GFX_(type) NS_EXPORT_(type)
-#  define NS_GFX_STATIC_MEMBER_(type) NS_EXPORT_STATIC_MEMBER_(type)
-#else
-#  define NS_GFX NS_IMPORT
-#  define NS_GFX_(type) NS_IMPORT_(type)
-#  define NS_GFX_STATIC_MEMBER_(type) NS_IMPORT_STATIC_MEMBER_(type)
-#endif
+#define NS_GFX
+#define NS_GFX_(type) type
+#define NS_GFX_STATIC_MEMBER_(type) type
 
 #endif
--- a/gfx/src/gfxCrashReporterUtils.cpp
+++ b/gfx/src/gfxCrashReporterUtils.cpp
@@ -29,17 +29,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "gfxCrashReporterUtils.h"
 
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
 #define MOZ_GFXFEATUREREPORTER 1
 #endif
 
 #ifdef MOZ_GFXFEATUREREPORTER
 #include "nsExceptionHandler.h"
 #include "nsString.h"
 #include "nsIObserverService.h"
 #include "nsIObserver.h"
--- a/gfx/tests/Makefile.in
+++ b/gfx/tests/Makefile.in
@@ -49,59 +49,58 @@ MOZILLA_INTERNAL_API = 1
 XPCSHELL_TESTS = unit
 
 _TEST_FILES = $(addprefix mochitest/, \
 	test_bug509244.html \
 	test_bug513439.html \
 	test_acceleration.html \
 )
 
-ifndef MOZ_ENABLE_LIBXUL
-ifndef BUILD_STATIC_LIBS
-
-CPP_UNIT_TESTS	= \
-		TestColorNames.cpp \
-		TestRect.cpp \
-		TestRegion.cpp \
-		$(NULL)
-
-# These are built but not run.  gfxColorManagementTest.cpp can't even
-# be built, because it has not been updated for qcms.
-CPP_DISABLED_UNIT_TESTS = \
-		gfxFontSelectionTest.cpp \
-		gfxSurfaceRefCountTest.cpp \
-		gfxTextRunPerfTest.cpp \
-		gfxWordCacheTest.cpp \
-		$(NULL)
-#		gfxColorManagementTest.cpp \
-
-
-# rules.mk will put the CPP_UNIT_TESTS into SIMPLE_PROGRAMS twice if we
-# define SIMPLE_PROGRAMS based on CPPSRCS directly.
-CPPSRCS		= $(CPP_DISABLED_UNIT_TESTS)
-SIMPLE_PROGRAMS	= $(CPP_DISABLED_UNIT_TESTS:.cpp=$(BIN_SUFFIX))
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
-CMMSRCS		= gfxTestCocoaHelper.mm
-HELPER_OBJS	= gfxTestCocoaHelper.$(OBJ_SUFFIX)
-EXTRA_DEPS	+= gfxTestCocoaHelper.$(OBJ_SUFFIX)
-endif
-
-LIBS		= \
-		$(HELPER_OBJS) \
-		$(call EXPAND_LIBNAME_PATH,thebes,../thebes) \
-		$(call EXPAND_LIBNAME_PATH,gkgfx,../src) \
-		$(MOZ_UNICHARUTIL_LIBS) \
-		$(XPCOM_LIBS) \
-		$(MOZ_JS_LIBS) \
-		$(TK_LIBS) \
-		$(NULL)
-
-endif
-endif
+# CPP_UNIT_TESTS disabled for now because they dont work in libxul builds.
+#ifndef BUILD_STATIC_LIBS
+#
+#CPP_UNIT_TESTS	= \
+#		TestColorNames.cpp \
+#		TestRect.cpp \
+#		TestRegion.cpp \
+#		$(NULL)
+#
+## These are built but not run.  gfxColorManagementTest.cpp can't even
+## be built, because it has not been updated for qcms.
+#CPP_DISABLED_UNIT_TESTS = \
+#		gfxFontSelectionTest.cpp \
+#		gfxSurfaceRefCountTest.cpp \
+#		gfxTextRunPerfTest.cpp \
+#		gfxWordCacheTest.cpp \
+#		$(NULL)
+##		gfxColorManagementTest.cpp \
+#
+#
+## rules.mk will put the CPP_UNIT_TESTS into SIMPLE_PROGRAMS twice if we
+## define SIMPLE_PROGRAMS based on CPPSRCS directly.
+#CPPSRCS		= $(CPP_DISABLED_UNIT_TESTS)
+#SIMPLE_PROGRAMS	= $(CPP_DISABLED_UNIT_TESTS:.cpp=$(BIN_SUFFIX))
+#
+#ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
+#CMMSRCS		= gfxTestCocoaHelper.mm
+#HELPER_OBJS	= gfxTestCocoaHelper.$(OBJ_SUFFIX)
+#EXTRA_DEPS	+= gfxTestCocoaHelper.$(OBJ_SUFFIX)
+#endif
+#
+#LIBS		= \
+#		$(HELPER_OBJS) \
+#		$(call EXPAND_LIBNAME_PATH,thebes,../thebes) \
+#		$(call EXPAND_LIBNAME_PATH,gkgfx,../src) \
+#		$(MOZ_UNICHARUTIL_LIBS) \
+#		$(XPCOM_LIBS) \
+#		$(MOZ_JS_LIBS) \
+#		$(TK_LIBS) \
+#		$(NULL)
+#
+#endif
 
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS	+= $(MOZ_CAIRO_CFLAGS) $(TK_CFLAGS)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 OS_LIBS		+= $(call EXPAND_LIBNAME,usp10)
 endif
--- a/gfx/thebes/GLContext.h
+++ b/gfx/thebes/GLContext.h
@@ -786,29 +786,16 @@ public:
      */
     ShaderProgramType UploadSurfaceToTexture(gfxASurface *aSurface, 
                                              const nsIntRegion& aDstRegion,
                                              GLuint& aTexture,
                                              bool aOverwrite = false,
                                              const nsIntPoint& aSrcPoint = nsIntPoint(0, 0),
                                              bool aPixelBuffer = PR_FALSE);
 
-#ifndef MOZ_ENABLE_LIBXUL
-    virtual ShaderProgramType UploadSurfaceToTextureExternal(gfxASurface *aSurface, 
-                                                             const nsIntRect& aSrcRect,
-                                                             GLuint& aTexture,
-                                                             bool aOverwrite = false,
-                                                             const nsIntPoint& aDstPoint = nsIntPoint(0, 0),
-                                                             bool aPixelBuffer = PR_FALSE)
-    {
-      return UploadSurfaceToTexture(aSurface, aSrcRect, aTexture, aOverwrite,
-                                    aDstPoint, aPixelBuffer);
-    }
-#endif
-
     /** Helper for DecomposeIntoNoRepeatTriangles
      */
     struct RectTriangles {
         RectTriangles() { }
 
         void addRect(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1,
                      GLfloat tx0, GLfloat ty0, GLfloat tx1, GLfloat ty1);
 
--- a/gfx/thebes/Makefile.in
+++ b/gfx/thebes/Makefile.in
@@ -199,23 +199,16 @@ endif
 
 endif
 
 SHARED_LIBRARY_LIBS += \
 	../layers/$(LIB_PREFIX)layers.$(LIB_SUFFIX) \
 	$(NULL)
 
 
-ifndef MOZ_ENABLE_LIBXUL
-EXTRA_DSO_LIBS	= gkgfx ycbcr
-ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH)))
-CPPSRCS += gfxDllDeps.cpp
-endif
-endif
-
 EXTRA_DSO_LDOPTS += \
 	$(MOZ_CAIRO_LIBS) \
 	$(LIBS_DIR) \
 	$(EXTRA_DSO_LIBS) \
 	$(MOZ_UNICHARUTIL_LIBS) \
 	$(XPCOM_LIBS) \
 	$(NSPR_LIBS) \
 	$(ZLIB_LIBS) \
deleted file mode 100644
--- a/gfx/thebes/gfxDllDeps.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "Layers.h"
-#include "LayerManagerOGL.h"
-#include "BasicLayers.h"
-#include "ImageLayers.h"
-#ifdef MOZ_ENABLE_D3D9_LAYER
-#include "LayerManagerD3D9.h"
-#endif
-#ifdef MOZ_ENABLE_D3D10_LAYER
-#include "LayerManagerD3D10.h"
-#endif
-
-using namespace mozilla;
-using namespace layers;
-
-void XXXNeverCalled_Layers()
-{
-  BasicLayerManager(nsnull);
-  LayerManagerOGL(nsnull);
-#ifdef MOZ_ENABLE_D3D9_LAYER
-  LayerManagerD3D9(nsnull);
-#endif
-#ifdef MOZ_ENABLE_D3D10_LAYER
-  LayerManagerD3D10(nsnull);
-#endif
-}
--- a/intl/uconv/tests/Makefile.in
+++ b/intl/uconv/tests/Makefile.in
@@ -41,61 +41,38 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir = intl/uconv/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE          = test_intl_uconv
 XPCSHELL_TESTS	= unit
 
-ifndef MOZ_ENABLE_LIBXUL
-MOZILLA_INTERNAL_API = 1
-
-
-CPPSRCS		= \
-		TestUConv.cpp \
-		nsconv.cpp \
-		plattest.cpp \
-		$(NULL)
-
-ifeq ($(OS_ARCH),WINNT)
-CPPSRCS		+= convperf.cpp
-endif
-
-SIMPLE_PROGRAMS	= $(CPPSRCS:.cpp=$(BIN_SUFFIX))
-
-endif # MOZ_ENABLE_LIBXUL
+# Tests disabled because they dont work in libxul builds.
+#MOZILLA_INTERNAL_API = 1
+#
+#
+#CPPSRCS		= \
+#		TestUConv.cpp \
+#		nsconv.cpp \
+#		plattest.cpp \
+#		$(NULL)
+#
+#ifeq ($(OS_ARCH),WINNT)
+#CPPSRCS		+= convperf.cpp
+#endif
+#
+#SIMPLE_PROGRAMS	= $(CPPSRCS:.cpp=$(BIN_SUFFIX))
 
 relativesrcdir	= intl/uconv/tests
 
 _TEST_FILES =	\
 		test_bug335816.html \
 		test_singlebyte_overconsumption.html \
 		test_unicode_noncharacterescapes.html \
 		test_unicode_noncharacters_gb18030.html \
 		test_unicode_noncharacters_utf8.html \
 		test_utf8_overconsumption.html \
 		$(NULL)
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
 
 include $(topsrcdir)/config/rules.mk
-
-ifndef MOZ_ENABLE_LIBXUL
-INCLUDES	+= \
-		-I$(srcdir)/../ucvlatin \
-		-I$(srcdir)/../ucvja \
-		-I$(srcdir)/../util \
-		$(NULL)
-
-LIBS		+= \
-		$(LIBS_DIR) \
-		$(XPCOM_LIBS) \
-		$(NSPR_LIBS) \
-		$(NULL)
-
-# needed for mac linux
-ifeq ($(OS_ARCH),Linux)
-ifneq ($(OS_RELEASE),1.2)
-OS_LIBS		+= -ldl
-endif
-endif
-endif # MOZ_ENABLE_LIBXUL
--- a/js/jsd/Makefile.in
+++ b/js/jsd/Makefile.in
@@ -42,20 +42,24 @@ DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 VPATH		= @srcdir@
 srcdir		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= jsdebug
 LIBRARY_NAME	= jsd
-FORCE_SHARED_LIB= 1
-ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),WINNT)
-LIBRARY_NAME	= jsd32$(VERSION_NUMBER)
-endif
+DIRS	= idl
+CPPSRCS	 = jsd_xpc.cpp
+IS_COMPONENT = 1
+LIBXUL_LIBRARY = 1
+
+MODULE_NAME = JavaScript_Debugger
+EXPORT_LIBRARY = 1
+
 
 # REQUIRES	= java js
 
 
 EXTRA_DSO_LDOPTS += \
 		$(MOZ_COMPONENT_LIBS) \
 		$(MOZ_JS_LIBS) \
 		$(NULL)
@@ -74,30 +78,15 @@ CSRCS		= \
 		  jsd_obj.c \
 		  jsd_scpt.c \
 		  jsd_stak.c \
 		  jsd_step.c \
 		  jsd_text.c \
 		  jsd_val.c \
 		  $(NULL)
 
-ifdef JSD_STANDALONE
-DIRS	+= jsdb
-else
-DIRS	+= idl
-CPPSRCS	 = jsd_xpc.cpp
-IS_COMPONENT = 1
-LIBXUL_LIBRARY = 1
-
-ifdef MOZ_ENABLE_LIBXUL
-FORCE_SHARED_LIB=
-MODULE_NAME = JavaScript_Debugger
-EXPORT_LIBRARY = 1
-endif
-endif
-
 ifdef ENABLE_TESTS
 TOOL_DIRS		+= test
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES		+= -DEXPORT_JSD_API
--- a/js/src/config/Makefile.in
+++ b/js/src/config/Makefile.in
@@ -89,17 +89,16 @@ export:: $(TARGETS)
 ifdef HOST_PROGRAM
 	$(INSTALL) $(HOST_PROGRAM) $(DIST)/bin
 endif
 
 ifdef WRAP_SYSTEM_INCLUDES
 export::
 	if test ! -d system_wrappers_js; then mkdir system_wrappers_js; fi
 	$(PYTHON) $(srcdir)/Preprocessor.py $(DEFINES) $(ACDEFINES) \
-		-DBUILD_STATIC_LIBS=$(BUILD_STATIC_LIBS) \
 		$(srcdir)/system-headers | $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers_js
 	$(INSTALL) system_wrappers_js $(DIST)
 
 GARBAGE_DIRS += system_wrappers_js
 endif
 
 GARBAGE += $(srcdir)/*.pyc *.pyc
 
--- a/js/src/config/autoconf.mk.in
+++ b/js/src/config/autoconf.mk.in
@@ -91,17 +91,16 @@ MOZ_SHARK       = @MOZ_SHARK@
 MOZ_CALLGRIND   = @MOZ_CALLGRIND@
 MOZ_VTUNE       = @MOZ_VTUNE@
 JS_HAS_CTYPES = @JS_HAS_CTYPES@
 DEHYDRA_PATH    = @DEHYDRA_PATH@
 
 NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
 INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
 MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
-BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
 ENABLE_TESTS	= @ENABLE_TESTS@
 
 TAR=@TAR@
 
 RM = rm -f
 
 # The MOZ_UI_LOCALE var is used to build a particular locale. Do *not*
 # use the var to change any binary files. Do *not* use this var unless you
--- a/js/src/config/config.mk
+++ b/js/src/config/config.mk
@@ -240,85 +240,46 @@ OS_LDFLAGS = -DEBUG -PDB:NONE -OPT:REF
 endif
 endif # NS_TRACE_MALLOC
 
 endif # MOZ_DEBUG
 endif # WINNT && !GNU_CC
 
 #
 # Build using PIC by default
-# Do not use PIC if not building a shared lib (see exceptions below)
 #
-
-ifndef BUILD_STATIC_LIBS
-_ENABLE_PIC=1
-endif
-ifneq (,$(FORCE_SHARED_LIB)$(FORCE_USE_PIC))
 _ENABLE_PIC=1
-endif
-
-# If module is going to be merged into the nsStaticModule, 
-# make sure that the entry points are translated and 
-# the module is built static.
-
-ifdef IS_COMPONENT
-ifdef EXPORT_LIBRARY
-ifneq (,$(BUILD_STATIC_LIBS))
-ifdef MODULE_NAME
-DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
-FORCE_STATIC_LIB=1
-endif
-endif
-endif
-endif
 
 # Determine if module being compiled is destined 
 # to be merged into libxul
 
-ifdef MOZ_ENABLE_LIBXUL
 ifdef LIBXUL_LIBRARY
 ifdef IS_COMPONENT
 ifdef MODULE_NAME
 DEFINES += -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1
 else
 $(error Component makefile does not specify MODULE_NAME.)
 endif
 endif
 FORCE_STATIC_LIB=1
-_ENABLE_PIC=1
 SHORT_LIBNAME=
 endif
-endif
 
 # If we are building this component into an extension/xulapp, it cannot be
 # statically linked. In the future we may want to add a xulapp meta-component
 # build option.
 
 ifdef XPI_NAME
-_ENABLE_PIC=1
 ifdef IS_COMPONENT
 EXPORT_LIBRARY=
 FORCE_STATIC_LIB=
 FORCE_SHARED_LIB=1
 endif
 endif
 
-#
-# Disable PIC if necessary
-#
-
-ifndef _ENABLE_PIC
-DSO_CFLAGS=
-ifeq ($(OS_ARCH)_$(HAVE_GCC3_ABI),Darwin_1)
-DSO_PIC_CFLAGS=-mdynamic-no-pic
-else
-DSO_PIC_CFLAGS=
-endif
-endif
-
 ifndef SHARED_LIBRARY_NAME
 ifdef LIBRARY_NAME
 SHARED_LIBRARY_NAME=$(LIBRARY_NAME)
 endif
 endif
 
 ifndef STATIC_LIBRARY_NAME
 ifdef LIBRARY_NAME
@@ -366,47 +327,32 @@ endif # NO_PROFILE_GUIDED_OPTIMIZE
 
 # Does the makefile specifies the internal XPCOM API linkage?
 ifneq (,$(MOZILLA_INTERNAL_API)$(LIBXUL_LIBRARY))
 DEFINES += -DMOZILLA_INTERNAL_API
 endif
 
 # Force XPCOM/widget/gfx methods to be _declspec(dllexport) when we're
 # building libxul libraries
-ifdef MOZ_ENABLE_LIBXUL
 ifdef LIBXUL_LIBRARY
 DEFINES += \
 		-D_IMPL_NS_COM \
 		-DEXPORT_XPT_API \
 		-DEXPORT_XPTC_API \
 		-D_IMPL_NS_GFX \
 		-D_IMPL_NS_WIDGET \
 		-DIMPL_XREAPI \
 		-DIMPL_NS_NET \
 		-DIMPL_THEBES \
 		$(NULL)
 
 ifndef JS_SHARED_LIBRARY
 DEFINES += -DSTATIC_EXPORTABLE_JS_API
 endif
 endif
-endif
-
-# Force _all_ exported methods to be |_declspec(dllexport)| when we're
-# building them into the executable.
-
-ifeq (,$(filter-out WINNT OS2, $(OS_ARCH)))
-ifdef BUILD_STATIC_LIBS
-DEFINES += \
-        -D_IMPL_NS_GFX \
-        -D_IMPL_NS_MSG_BASE \
-        -D_IMPL_NS_WIDGET \
-        $(NULL)
-endif
-endif
 
 # Flags passed to JarMaker.py
 MAKE_JARS_FLAGS = \
 	-t $(topsrcdir) \
 	-f $(MOZ_CHROME_FILE_FORMAT) \
 	$(NULL)
 
 ifdef USE_EXTENSION_MANIFEST
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -211,17 +211,17 @@ endif # CPP_UNIT_TESTS
 .PHONY: check xpcshell-tests check-interactive check-one
 
 endif # ENABLE_TESTS
 
 
 #
 # Library rules
 #
-# If BUILD_STATIC_LIBS or FORCE_STATIC_LIB is set, build a static library.
+# If FORCE_STATIC_LIB is set, build a static library.
 # Otherwise, build a shared library.
 #
 
 ifndef LIBRARY
 ifdef STATIC_LIBRARY_NAME
 _LIBRARY		:= $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
 # Only build actual library if it is installed in DIST/lib or SDK
 ifeq (,$(SDK_LIBRARY)$(DIST_INSTALL)$(NO_EXPAND_LIBS))
@@ -234,17 +234,17 @@ endif # LIBRARY
 
 ifndef HOST_LIBRARY
 ifdef HOST_LIBRARY_NAME
 HOST_LIBRARY		:= $(LIB_PREFIX)$(HOST_LIBRARY_NAME).$(LIB_SUFFIX)
 endif
 endif
 
 ifdef LIBRARY
-ifneq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS))
+ifdef FORCE_SHARED_LIB
 ifdef MKSHLIB
 
 ifdef LIB_IS_C_ONLY
 MKSHLIB			= $(MKCSHLIB)
 endif
 
 ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 IMPORT_LIBRARY		:= $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
@@ -261,45 +261,33 @@ SHARED_LIBRARY		:= $(SHARED_LIBRARY_NAME
 else
 SHARED_LIBRARY		:= $(DLL_PREFIX)$(SHARED_LIBRARY_NAME)$(DLL_SUFFIX)
 endif
 
 ifeq ($(OS_ARCH),OS2)
 DEF_FILE		:= $(SHARED_LIBRARY:.dll=.def)
 endif
 
-ifdef MOZ_ENABLE_LIBXUL
 EMBED_MANIFEST_AT=2
-endif
 
 endif # MKSHLIB
-endif # FORCE_SHARED_LIB && !BUILD_STATIC_LIBS
+endif # FORCE_SHARED_LIB
 endif # LIBRARY
 
-ifeq (,$(BUILD_STATIC_LIBS)$(FORCE_STATIC_LIB))
-LIBRARY			:= $(NULL)
-endif
-
-ifeq (_1,$(FORCE_SHARED_LIB)_$(BUILD_STATIC_LIBS))
-SHARED_LIBRARY		:= $(NULL)
-DEF_FILE		:= $(NULL)
-IMPORT_LIBRARY		:= $(NULL)
-endif
-
 ifdef FORCE_STATIC_LIB
 ifndef FORCE_SHARED_LIB
 SHARED_LIBRARY		:= $(NULL)
 DEF_FILE		:= $(NULL)
 IMPORT_LIBRARY		:= $(NULL)
 endif
 endif
 
 ifdef FORCE_SHARED_LIB
 ifndef FORCE_STATIC_LIB
-LIBRARY			:= $(NULL)
+LIBRARY := $(NULL)
 endif
 endif
 
 ifdef JAVA_LIBRARY_NAME
 JAVA_LIBRARY := $(JAVA_LIBRARY_NAME).jar
 endif
 
 ifeq ($(OS_ARCH),WINNT)
@@ -780,22 +768,16 @@ endif
 
 #
 # Rule to create list of libraries for final link
 #
 export::
 ifdef LIBRARY_NAME
 ifdef EXPORT_LIBRARY
 ifdef IS_COMPONENT
-ifdef BUILD_STATIC_LIBS
-	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMPS) $(STATIC_LIBRARY_NAME)
-ifdef MODULE_NAME
-	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMP_NAMES) $(MODULE_NAME)
-endif
-endif # BUILD_STATIC_LIBS
 else # !IS_COMPONENT
 	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
 endif # IS_COMPONENT
 endif # EXPORT_LIBRARY
 endif # LIBRARY_NAME
 
 ifneq (,$(filter-out %.$(LIB_SUFFIX),$(SHARED_LIBRARY_LIBS)))
 $(error SHARED_LIBRARY_LIBS must contain .$(LIB_SUFFIX) files only)
--- a/js/src/config/system-headers
+++ b/js/src/config/system-headers
@@ -65,19 +65,16 @@ Bitmap.h
 bitset
 blapi.h
 bsd/libc.h
 bsd/syscall.h
 bstring.h
 builtin.h
 Button.h
 byteswap.h
-#if MOZ_ENABLE_LIBXUL!=1
-#define WRAP_CAIRO_HEADERS
-#endif
 #if MOZ_TREE_CAIRO!=1
 #define WRAP_CAIRO_HEADERS
 #endif
 #ifdef WRAP_CAIRO_HEADERS
 pixman.h
 cairo.h
 cairo-atsui.h
 cairo-beos.h
@@ -989,25 +986,16 @@ plarenas.h
 plarena.h
 plhash.h
 #if MOZ_NATIVE_PNG==1
 png.h
 #endif
 #if MOZ_NATIVE_ZLIB==1
 zlib.h
 #endif
-#if MOZ_ENABLE_LIBXUL!=1
-#if BUILD_STATIC_LIBS!=1
-#define WRAP_LCMS_HEADERS
-#endif
-#endif
-#ifdef WRAP_LCMS_HEADERS
-icc34.h
-lcms.h
-#endif
 #ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
 libsn/sn.h
 libsn/sn-common.h
 libsn/sn-launchee.h
 libsn/sn-launcher.h
 libsn/sn-monitor.h
 libsn/sn-util.h
 #endif
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -4387,17 +4387,16 @@ fi
 dnl ========================================================
 dnl =
 dnl = Application
 dnl =
 dnl ========================================================
 
 MOZ_ARG_HEADER(Application)
 
-BUILD_STATIC_LIBS=
 ENABLE_TESTS=1
 
 MOZ_THUMB2=
 USE_ARM_KUSER=
 
 case "${target}" in
     arm-android-eabi)
         USE_ARM_KUSER=1
@@ -5387,28 +5386,16 @@ MDDEPDIR='.deps'
 AC_SUBST(MOZ_AUTO_DEPS)
 AC_SUBST(COMPILER_DEPEND)
 AC_SUBST(MDDEPDIR)
 AC_SUBST(CC_WRAPPER)
 AC_SUBST(CXX_WRAPPER)
 
 
 dnl ========================================================
-dnl =
-dnl = Static Build Options
-dnl =
-dnl ========================================================
-MOZ_ARG_HEADER(Static build options)
-
-MOZ_ARG_ENABLE_BOOL(static,
-[  --enable-static         Enable building of internal static libs],
-    BUILD_STATIC_LIBS=1,
-    BUILD_STATIC_LIBS=)
-
-dnl ========================================================
 dnl = Link js shell to system readline
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(readline,
 [  --enable-readline       Link js shell to system readline library],
     JS_WANT_READLINE=1,
     JS_WANT_READLINE= )
 
 JS_NATIVE_EDITLINE=
@@ -5516,17 +5503,16 @@ AC_SUBST(MOZ_LEAKY)
 AC_SUBST(MOZ_JPROF)
 AC_SUBST(MOZ_SHARK)
 AC_SUBST(MOZ_CALLGRIND)
 AC_SUBST(MOZ_VTUNE)
 AC_SUBST(MOZ_PROFILING)
 AC_SUBST(MOZ_QUANTIFY)
 AC_SUBST(LIBICONV)
 
-AC_SUBST(BUILD_STATIC_LIBS)
 AC_SUBST(ENABLE_TESTS)
 
 AC_SUBST(ENABLE_STRIP)
 AC_SUBST(PKG_SKIP_STRIP)
 AC_SUBST(INCREMENTAL_LINKER)
 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
 
--- a/js/src/xpconnect/Makefile.in
+++ b/js/src/xpconnect/Makefile.in
@@ -41,19 +41,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= xpconnect
 DIRS		= public idl wrappers loader src
 
-ifndef BUILD_STATIC_LIBS
 TOOL_DIRS    += shell
-endif
 
 ifdef ENABLE_TESTS
 TOOL_DIRS    += tests
 endif
 
 ifdef MOZ_XPCTOOLS
 TOOL_DIRS    +=  tools 
 endif
--- a/js/src/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/src/xpconnect/loader/mozJSComponentLoader.cpp
@@ -81,20 +81,18 @@
 #include "nsIStringStream.h"
 #include "prmem.h"
 #if defined(XP_WIN)
 #include "nsILocalFileWin.h"
 #endif
 #include "xpcprivate.h"
 #include "nsIResProtocolHandler.h"
 
-#ifdef MOZ_ENABLE_LIBXUL
 #include "mozilla/scache/StartupCache.h"
 #include "mozilla/scache/StartupCacheUtils.h"
-#endif
 #include "mozilla/Omnijar.h"
 
 #include "jsdbgapi.h"
 
 #include "mozilla/FunctionTimer.h"
 
 static const char kJSRuntimeServiceContractID[] = "@mozilla.org/js/xpc/RuntimeService;1";
 static const char kXPConnectServiceContractID[] = "@mozilla.org/js/xpc/XPConnect;1";
@@ -337,17 +335,16 @@ ReportOnCaller(JSCLContextHelper &helper
     JSContext *cx = helper.Pop();
     if (!cx) {
         return NS_ERROR_FAILURE;
     }
 
     return OutputError(cx, format, ap);
 }
 
-#ifdef MOZ_ENABLE_LIBXUL
 static nsresult
 ReadScriptFromStream(JSContext *cx, nsIObjectInputStream *stream,
                      JSObject **scriptObj)
 {
     *scriptObj = nsnull;
 
     PRUint32 size;
     nsresult rv = stream->Read32(&size);
@@ -439,17 +436,16 @@ WriteScriptToStream(JSContext *cx, JSObj
         }
     } else {
         rv = NS_ERROR_FAILURE; // likely to be a principals serialization error
     }
 
     JS_XDRDestroy(xdr);
     return rv;
 }
-#endif // MOZ_ENABLE_LIBXUL
 
 mozJSComponentLoader::mozJSComponentLoader()
     : mRuntime(nsnull),
       mContext(nsnull),
       mInitialized(PR_FALSE)
 {
     NS_ASSERTION(!sSelf, "mozJSComponentLoader should be a singleton");
 
@@ -927,17 +923,16 @@ PathifyURI(nsIURI *in, nsACString &out)
         }
     }
 
     out.Append(".bin");
     return NS_OK;
 }
 
 /* static */
-#ifdef MOZ_ENABLE_LIBXUL
 nsresult
 mozJSComponentLoader::ReadScript(StartupCache* cache, nsIURI *uri,
                                  JSContext *cx, JSObject **scriptObj)
 {
     nsresult rv;
     
     nsCAutoString spec;
     rv = PathifyURI(uri, spec);
@@ -985,17 +980,16 @@ mozJSComponentLoader::WriteScript(Startu
     PRUint32 len;
     rv = NS_NewBufferFromStorageStream(storageStream, getter_Transfers(buf), 
                                        &len);
     NS_ENSURE_SUCCESS(rv, rv);
  
     rv = cache->PutBuffer(spec.get(), buf, len);
     return rv;
 }
-#endif //MOZ_ENABLE_LIBXUL
 
 nsresult
 mozJSComponentLoader::GlobalForLocation(nsILocalFile *aComponentFile,
                                         nsIURI *aURI,
                                         JSObject **aGlobal,
                                         char **aLocation,
                                         jsval *exception)
 {
@@ -1086,17 +1080,16 @@ mozJSComponentLoader::GlobalForLocation(
     JSString *exposedUri = JS_NewStringCopyN(cx, nativePath.get(), nativePath.Length());
     if (!JS_DefineProperty(cx, global, "__URI__",
                            STRING_TO_JSVAL(exposedUri), nsnull, nsnull, 0))
         return NS_ERROR_FAILURE;
 
 
     JSObject *scriptObj = nsnull;
 
-#ifdef MOZ_ENABLE_LIBXUL  
     // Before compiling the script, first check to see if we have it in
     // the startupcache.  Note: as a rule, startupcache errors are not fatal
     // to loading the script, since we can always slow-load.
     
     PRBool writeToCache = PR_FALSE;
     StartupCache* cache = StartupCache::GetSingleton();
 
     if (cache) {
@@ -1105,17 +1098,16 @@ mozJSComponentLoader::GlobalForLocation(
             LOG(("Successfully loaded %s from startupcache\n", nativePath.get()));
         } else {
             // This is ok, it just means the script is not yet in the
             // cache. Could mean that the cache was corrupted and got removed,
             // but either way we're going to write this out.
             writeToCache = PR_TRUE;
         }
     }
-#endif
 
     if (!scriptObj) {
         // The script wasn't in the cache , so compile it now.
         LOG(("Slow loading %s\n", nativePath.get()));
 
         // If |exception| is non-null, then our caller wants us to propagate
         // any exceptions out to our caller. Ensure that the engine doesn't
         // eagerly report the exception.
@@ -1248,30 +1240,28 @@ mozJSComponentLoader::GlobalForLocation(
         return NS_ERROR_FAILURE;
     }
 
 #ifdef DEBUG_shaver_off
     fprintf(stderr, "mJCL: compiled JS component %s\n",
             nativePath.get());
 #endif
 
-#ifdef MOZ_ENABLE_LIBXUL
     if (writeToCache) {
         // We successfully compiled the script, so cache it. 
         rv = WriteScript(cache, scriptObj, aComponentFile, aURI, cx);
 
         // Don't treat failure to write as fatal, since we might be working
         // with a read-only cache.
         if (NS_SUCCEEDED(rv)) {
             LOG(("Successfully wrote to cache\n"));
         } else {
             LOG(("Failed to write to cache\n"));
         }
     }
-#endif
 
     // Assign aGlobal here so that it's available to recursive imports.
     // See bug 384168.
     *aGlobal = global;
 
     if (!JS_ExecuteScriptVersion(cx, global, scriptObj, NULL, JSVERSION_LATEST)) {
 #ifdef DEBUG_shaver_off
         fprintf(stderr, "mJCL: failed to execute %s\n", nativePath.get());
--- a/js/src/xpconnect/loader/mozJSComponentLoader.h
+++ b/js/src/xpconnect/loader/mozJSComponentLoader.h
@@ -50,21 +50,19 @@
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsITimer.h"
 #include "nsIObserver.h"
 #include "xpcIJSModuleLoader.h"
 #include "nsClassHashtable.h"
 #include "nsDataHashtable.h"
 #include "nsIPrincipal.h"
-#ifdef MOZ_ENABLE_LIBXUL
 #include "mozilla/scache/StartupCache.h"
 
 using namespace mozilla::scache;
-#endif
 
 #include "xpcIJSGetFactory.h"
 
 /* 6bd13476-1dd2-11b2-bbef-f0ccb5fa64b6 (thanks, mozbot) */
 
 #define MOZJSCOMPONENTLOADER_CID \
   {0x6bd13476, 0x1dd2, 0x11b2, \
     { 0xbb, 0xef, 0xf0, 0xcc, 0xb5, 0xfa, 0x64, 0xb6 }}
@@ -126,22 +124,20 @@ class mozJSComponentLoader : public mozi
                                           nsIURI* aComponentURI);
 
     nsresult GlobalForLocation(nsILocalFile* aComponentFile,
                                nsIURI *aComponent,
                                JSObject **aGlobal,
                                char **location,
                                jsval *exception);
 
-#ifdef MOZ_ENABLE_LIBXUL
     nsresult ReadScript(StartupCache *cache, nsIURI *uri, 
                         JSContext *cx, JSObject **scriptObj);
     nsresult WriteScript(StartupCache *cache, JSObject *scriptObj,
                          nsIFile *component, nsIURI *uri, JSContext *cx);
-#endif
 
     nsCOMPtr<nsIComponentManager> mCompMgr;
     nsCOMPtr<nsIJSRuntimeService> mRuntimeService;
     nsCOMPtr<nsIThreadJSContextStack> mContextStack;
     nsCOMPtr<nsIPrincipal> mSystemPrincipal;
     JSRuntime *mRuntime;
     JSContext *mContext;
 
--- a/js/src/xpconnect/shell/xpcshell.cpp
+++ b/js/src/xpconnect/shell/xpcshell.cpp
@@ -1866,19 +1866,17 @@ main(int argc, char **argv, char **envp)
         gOldJSContextCallback = JS_SetContextCallback(rt, ContextCallback);
 
         cx = JS_NewContext(rt, 8192);
         if (!cx) {
             printf("JS_NewContext failed!\n");
             return 1;
         }
 
-#ifdef MOZ_ENABLE_LIBXUL
         xpc_LocalizeContext(cx);
-#endif
 
         nsCOMPtr<nsIXPConnect> xpc = do_GetService(nsIXPConnect::GetCID());
         if (!xpc) {
             printf("failed to get nsXPConnect service!\n");
             return 1;
         }
 
         // Since the caps security system might set a default security manager
--- a/js/src/xpconnect/src/Makefile.in
+++ b/js/src/xpconnect/src/Makefile.in
@@ -48,20 +48,16 @@ MODULE		= xpconnect
 
 ifeq (xpconnect, $(findstring xpconnect, $(BUILD_MODULES)))
 LIBRARY_NAME	= xpconnect
 EXPORT_LIBRARY = 1
 SHORT_LIBNAME	= xpconect
 IS_COMPONENT	= 1
 MODULE_NAME	= xpconnect
 GRE_MODULE	= 1
-ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),WINNT)
-LIBRARY_NAME	= xpc32$(VERSION_NUMBER)
-SHORT_LIBNAME	= xpc32$(VERSION_NUMBER)
-endif
 else
 LIBRARY_NAME    = xpconnect_s
 FORCE_STATIC_LIB = 1
 endif
 LIBXUL_LIBRARY = 1
 EXPORTS = xpcpublic.h
 
 CPPSRCS		= \
--- a/js/src/xpconnect/tests/Makefile.in
+++ b/js/src/xpconnect/tests/Makefile.in
@@ -45,19 +45,19 @@ relativesrcdir = js/src/xpconnect/tests
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= TestXPC
 SIMPLE_PROGRAMS = TestXPC$(BIN_SUFFIX)
 
 
 DIRS		= idl mochitest chrome
 
-ifndef MOZ_ENABLE_LIBXUL
-DIRS += components
-endif
+# XXX Doesn't work in libxul builds.
+#DIRS += components
+#
 
 XPCSHELL_TESTS = unit
 
 CPPSRCS		= TestXPC.cpp
 
 LIBS		= \
 		$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
 		$(LIBS_DIR) \
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -9414,26 +9414,17 @@ nsIFrame* nsIPresShell::GetAbsoluteConta
 {
   return FrameConstructor()->GetAbsoluteContainingBlock(aFrame);
 }
 
 #ifdef ACCESSIBILITY
 nsAccessibilityService*
 nsIPresShell::AccService()
 {
-#ifdef MOZ_ENABLE_LIBXUL
   return GetAccService();
-#else
-  if (gIsAccessibilityActive) {
-    nsCOMPtr<nsIAccessibilityService> srv =
-      do_GetService("@mozilla.org/accessibilityService;1");
-    return static_cast<nsAccessibilityService*>(srv.get());
-  }
-  return nsnull;
-#endif
 }
 #endif
 
 void nsIPresShell::InitializeStatics()
 {
   NS_ASSERTION(sLiveShells == nsnull, "InitializeStatics called multiple times!");
   sLiveShells = new nsTHashtable<PresShellPtrKey>();
   sLiveShells->Init();
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -53,21 +53,16 @@ endif
 MODULE		= layout
 LIBRARY_NAME	= gklayout
 EXPORT_LIBRARY = 1
 IS_COMPONENT	= 1
 MODULE_NAME	= nsLayoutModule
 GRE_MODULE	= 1
 LIBXUL_LIBRARY	= 1
 
-ifndef MOZ_ENABLE_LIBXUL
-EXTRA_DSO_LIBS	= gkgfx
-EXTRA_DSO_LIBS += angle
-endif
-
 EXTRA_DSO_LIBS	+= thebes ycbcr
 
 
 CPPSRCS		= \
 		nsLayoutModule.cpp \
 		nsContentDLF.cpp \
 		nsLayoutStatics.cpp \
 		$(NULL)
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -2019,24 +2019,16 @@ public:
    * We want all callers to *think* about what has changed in the frame and what area might
    * need to be repainted.
    *
    * @param aDamageRect is in the frame's local coordinate space
    */
   void Invalidate(const nsRect& aDamageRect)
   { return InvalidateWithFlags(aDamageRect, 0); }
 
-#ifndef MOZ_ENABLE_LIBXUL
-  /**
-   * Same as InvalidateOverflowRect, just for non-libxul builds.
-   */
-  virtual void InvalidateOverflowRectExternal()
-  { return InvalidateOverflowRect(); }
-#endif
-
   /**
    * As Invalidate above, except that this should be called when the
    * rendering that has changed is performed using layers so we can avoid
    * updating the contents of ThebesLayers.
    * If the frame has a dedicated layer rendering this display item, we
    * return that layer.
    * @param aDisplayItemKey must not be zero; indicates the kind of display
    * item that is being invalidated.
--- a/layout/style/test/Makefile.in
+++ b/layout/style/test/Makefile.in
@@ -57,31 +57,26 @@ HOST_CXXFLAGS	+= -DMOZ_SVG=1
 endif
 
 HOST_CPPSRCS	= \
 		ListCSSProperties.cpp \
 		$(NULL)
 
 HOST_SIMPLE_PROGRAMS	= $(addprefix host_, $(HOST_CPPSRCS:.cpp=$(HOST_BIN_SUFFIX)))
 
-
 # ParseCSS.cpp used to be built as a test program, but it was not
 # being used for anything, and recent changes to the CSS loader have
 # made it fail to link.  Further changes are planned which should make
 # it buildable again.
 #
 # TestCSSPropertyLookup.cpp needs the internal XPCOM APIs and so cannot
 # be built with libxul enabled.
-
-ifndef BUILD_STATIC_LIBS
-ifndef MOZ_ENABLE_LIBXUL
-CPP_UNIT_TESTS = TestCSSPropertyLookup.cpp
-LIBS += ../nsCSSKeywords.$(OBJ_SUFFIX) ../nsCSSProps.$(OBJ_SUFFIX) $(XPCOM_LIBS)
-endif
-endif
+#
+#CPP_UNIT_TESTS = TestCSSPropertyLookup.cpp
+#LIBS += ../nsCSSKeywords.$(OBJ_SUFFIX) ../nsCSSProps.$(OBJ_SUFFIX) $(XPCOM_LIBS)
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DMOZILLA_INTERNAL_API -D_IMPL_NS_LAYOUT
 
 # FIXME: We don't seem to do auto-generated dependencies here.
 host_ListCSSProperties.$(OBJ_SUFFIX): $(srcdir)/../nsCSSPropList.h
 TestCSSPropertyLookup.$(OBJ_SUFFIX): $(srcdir)/../nsCSSProps.h $(srcdir)/../nsCSSKeywords.h
--- a/mobile/app/Makefile.in
+++ b/mobile/app/Makefile.in
@@ -57,40 +57,30 @@ LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/b
 
 LIBS += $(JEMALLOC_LIBS)
 
 ifeq (Linux_1, $(OS_ARCH)_$(GNU_LD))
 OS_LDFLAGS += -Wl,-rpath='$$ORIGIN'
 NSDISTMODE = copy
 endif
 
-ifdef MOZ_ENABLE_LIBXUL
-APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
-else
-MOZILLA_INTERNAL_API = 1
-APP_XPCOM_LIBS = $(XPCOM_LIBS)
-endif
+LIBS += \
+  $(XPCOM_GLUE_LDOPTS) \
+  $(NSPR_LIBS) \
+  $(NULL)
 
-LIBS += $(APP_XPCOM_LIBS) \
-	$(NSPR_LIBS) \
-	$(NULL)
-
-ifdef BUILD_STATIC_LIBS
-LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
-else
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 LIBS += $(DIST)/bin/XUL
 else
 EXTRA_DSO_LIBS += xul
 LIBS += $(EXTRA_DSO_LIBS)
 endif
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,version)
 endif
-endif # BUILD_STATIC_LIBS
 
 ifdef _MSC_VER
 # Always enter a Windows program through wmain, whether or not we're
 # a console application.
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
 endif #LIBXUL_SDK
 
--- a/mobile/confvars.sh
+++ b/mobile/confvars.sh
@@ -42,17 +42,16 @@ MOZ_APP_VERSION=6.0a1
 
 MOZ_BRANDING_DIRECTORY=mobile/branding/unofficial
 MOZ_OFFICIAL_BRANDING_DIRECTORY=mobile/branding/official
 # MOZ_APP_DISPLAYNAME is set by branding/configure.sh
 
 MOZ_SAFE_BROWSING=
 MOZ_SERVICES_SYNC=1
 
-MOZ_ENABLE_LIBXUL=1
 MOZ_DISABLE_DOMCRYPTO=1
 
 if test "$LIBXUL_SDK"; then
 MOZ_XULRUNNER=1
 else
 MOZ_XULRUNNER=
 MOZ_MORK=
 MOZ_PLACES=1
--- a/mobile/installer/Makefile.in
+++ b/mobile/installer/Makefile.in
@@ -47,26 +47,17 @@ include $(DEPTH)/config/autoconf.mk
 ifeq ($(AB_CD),multi)
 PREF_JS_EXPORTS = $(srcdir)/mobile-l10n.js
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
-ifdef MOZ_ENABLE_LIBXUL
 MOZ_PKG_MANIFEST_P = $(srcdir)/package-manifest.in
-else
-define message
-You need to build with --enable-libxul (the default, unless you specify
---disable-libxul or --enable-shared or --enable-debug) to package a build.
-endef
-default libs installer::
-	$(error $(message))
-endif
 
 MOZ_NONLOCALIZED_PKG_LIST = \
 	xpcom \
 	browser \
 	mobile \
 	$(NULL)
 
 MOZ_LOCALIZED_PKG_LIST = $(AB_CD) multilocale
--- a/modules/libpr0n/src/SVGDocumentWrapper.cpp
+++ b/modules/libpr0n/src/SVGDocumentWrapper.cpp
@@ -321,24 +321,17 @@ NS_IMETHODIMP
 SVGDocumentWrapper::Observe(nsISupports* aSubject,
                             const char* aTopic,
                             const PRUnichar *aData)
 {
   if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
     // Sever ties from rendering observers to helper-doc's root SVG node
     nsSVGSVGElement* svgElem = GetRootSVGElem();
     if (svgElem) {
-#ifdef MOZ_ENABLE_LIBXUL
       nsSVGEffects::RemoveAllRenderingObservers(svgElem);
-#else
-      // XXXdholbert Can't call static nsSVGEffects functions from imagelib in
-      // non-libxul builds -- so, this is a hack using a virtual function to
-      // have the SVG element call the method on our behalf.
-      svgElem->RemoveAllRenderingObservers();
-#endif // MOZ_ENABLE_LIBXUL
     }
 
     // Clean up at XPCOM shutdown time.
     DestroyViewer();
     if (mListener)
       mListener = nsnull;
     if (mLoadGroup)
       mLoadGroup = nsnull;
--- a/modules/libpref/src/Makefile.in
+++ b/modules/libpref/src/Makefile.in
@@ -42,19 +42,16 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= pref
 LIBRARY_NAME	= pref
 EXPORT_LIBRARY = 1
 IS_COMPONENT	= 1
 MODULE_NAME	= nsPrefModule
-ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),WINNT)
-LIBRARY_NAME	= xppref32
-endif
 GRE_MODULE	= 1
 LIBXUL_LIBRARY = 1
 
 CPPSRCS		= \
 			  nsPrefBranch.cpp	\
 			  nsPrefsFactory.cpp	\
 			  prefapi.cpp \
 			  prefread.cpp \
--- a/modules/zlib/src/Makefile.in
+++ b/modules/zlib/src/Makefile.in
@@ -44,25 +44,16 @@ include $(DEPTH)/config/autoconf.mk
 include $(srcdir)/objs.mk
 
 MODULE		= zlib
 LIBRARY_NAME	= mozz
 GRE_MODULE	= 1
 LIBXUL_LIBRARY = 1
 DIST_INSTALL = 1
 
-ifndef MOZ_ENABLE_LIBXUL
-ifeq ($(OS_ARCH),WINNT)
-ifndef GNU_CC
-MAPFILE	= $(LIBRARY_NAME).map
-DEFFILE	= $(win_srcdir)/zlib.def
-endif
-endif
-endif
-
 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
 DEFINES	+= -DZLIB_DLL=1
 endif
 
 CSRCS		= $(MODULES_ZLIB_SRC_LCSRCS)
 
 EXPORTS		= zlib.h zconf.h mozzconf.h
 
--- a/modules/zlib/src/mozzconf.h
+++ b/modules/zlib/src/mozzconf.h
@@ -34,20 +34,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef MOZZCONF_H
 #define MOZZCONF_H
 
 #if defined(XP_WIN) && defined(ZLIB_DLL)
 #undef ZLIB_DLL
-#elif defined(HAVE_VISIBILITY_ATTRIBUTE) && !defined(MOZ_ENABLE_LIBXUL)
-#define ZEXTERN __attribute__((visibility ("default"))) extern
-#elif (defined(__SUNPRO_C) || defined(__SUNPRO_CC)) && !defined(MOZ_ENABLE_LIBXUL)
-#define ZEXTERN __global extern
 #endif
 
 /* Exported Symbols */
 #define zlibVersion MOZ_Z_zlibVersion
 #define deflate MOZ_Z_deflate
 #define deflateEnd MOZ_Z_deflateEnd
 #define inflate MOZ_Z_inflate
 #define inflateEnd MOZ_Z_inflateEnd
--- a/netwerk/test/Makefile.in
+++ b/netwerk/test/Makefile.in
@@ -66,28 +66,27 @@ SIMPLE_PROGRAMS	= \
 		TestDNS$(BIN_SUFFIX) \
 		TestOpen$(BIN_SUFFIX) \
 		TestCookie$(BIN_SUFFIX) \
 		TestServ$(BIN_SUFFIX) \
 		ReadNTLM$(BIN_SUFFIX) \
 		TestProtocols$(BIN_SUFFIX) \
 		$(NULL)
 
-ifndef MOZ_ENABLE_LIBXUL
-SIMPLE_PROGRAMS += \
-		TestPerf$(BIN_SUFFIX) \
-		TestIDN$(BIN_SUFFIX) \
-		TestSocketTransport$(BIN_SUFFIX) \
-		TestStreamTransport$(BIN_SUFFIX) \
-		TestStreamChannel$(BIN_SUFFIX) \
-		TestStreamPump$(BIN_SUFFIX) \
-		TestIOThreads$(BIN_SUFFIX) \
-		TestUDPSocketProvider$(BIN_SUFFIX) \
-		$(NULL)
-endif
+# XXX Make this work in libxul builds.
+#SIMPLE_PROGRAMS += \
+#		TestPerf$(BIN_SUFFIX) \
+#		TestIDN$(BIN_SUFFIX) \
+#		TestSocketTransport$(BIN_SUFFIX) \
+#		TestStreamTransport$(BIN_SUFFIX) \
+#		TestStreamChannel$(BIN_SUFFIX) \
+#		TestStreamPump$(BIN_SUFFIX) \
+#		TestIOThreads$(BIN_SUFFIX) \
+#		TestUDPSocketProvider$(BIN_SUFFIX) \
+#		$(NULL)
 
 CPP_UNIT_TESTS = \
 		 TestSTSParser.cpp \
 		 $(NULL)
 
 include $(topsrcdir)/config/config.mk
 
 LIBS		= $(EXTRA_DSO_LIBS) \
--- a/parser/htmlparser/tests/Makefile.in
+++ b/parser/htmlparser/tests/Makefile.in
@@ -43,15 +43,14 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 DIRS = \
 	grabpage \
 	html \
 	mochitest \
 	$(NULL)
 
-ifndef MOZ_ENABLE_LIBXUL
-DIRS += \
-	outsinks \
-	$(NULL)
-endif
+# XXX This doesn't work in libxul builds.
+#DIRS += \
+#	outsinks \
+#	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/rdf/build/Makefile.in
+++ b/rdf/build/Makefile.in
@@ -59,22 +59,16 @@ CPPSRCS		= \
 
 # XXX Note dependencies on implementation headers for factory functions
 
 SHARED_LIBRARY_LIBS = \
 		../base/src/$(LIB_PREFIX)rdfbase_s.$(LIB_SUFFIX) \
 		../datasource/src/$(LIB_PREFIX)rdfdatasource_s.$(LIB_SUFFIX) \
 		$(NULL)
 
-ifndef MOZ_ENABLE_LIBXUL
-SHARED_LIBRARY_LIBS += \
-		../util/src/internal/$(LIB_PREFIX)rdfutil_s.$(LIB_SUFFIX) \
-		$(NULL)
-endif
-
 EXTRA_DSO_LDOPTS = \
 		$(LIBS_DIR) \
 		$(EXTRA_DSO_LIBS) \
 		$(MOZ_UNICHARUTIL_LIBS) \
 		$(MOZ_COMPONENT_LIBS) \
 		$(NULL)
 
 EXPORTS		= nsRDFCID.h
--- a/toolkit/components/places/Makefile.in
+++ b/toolkit/components/places/Makefile.in
@@ -99,22 +99,16 @@ CPPSRCS = \
   $(NULL)
 
 EXTRA_DSO_LDOPTS += \
   $(DEPTH)/db/morkreader/$(LIB_PREFIX)morkreader_s.$(LIB_SUFFIX) \
   $(MOZ_UNICHARUTIL_LIBS) \
   $(MOZ_COMPONENT_LIBS) \
   $(NULL)
 
-ifndef MOZ_ENABLE_LIBXUL
-EXTRA_DSO_LDOPTS += \
-  $(MOZ_JS_LIBS) \
-  $(NULL)
-endif
-
 LOCAL_INCLUDES += -I$(srcdir)/../build
 
 # This is the default value.  Must be in sync with the one defined in SQLite.
 DEFINES += -DSQLITE_DEFAULT_PAGE_SIZE=32768
 
 EXTRA_COMPONENTS = \
   toolkitplaces.manifest \
   nsLivemarkService.js \
--- a/toolkit/components/startup/nsAppStartup.cpp
+++ b/toolkit/components/startup/nsAppStartup.cpp
@@ -92,20 +92,18 @@
 #endif
 
 #ifdef __OpenBSD__
 #include <sys/param.h>
 #include <sys/sysctl.h>
 #endif
 
 static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
-#ifdef MOZ_ENABLE_LIBXUL
 extern PRTime gXRE_mainTimestamp;
 extern PRTime gFirstPaintTimestamp;
-#endif
 // mfinklesessionstore-browser-state-restored might be a better choice than the one below
 static PRTime gRestoredTimestamp = 0;       // Timestamp of sessionstore-windows-restored
 static PRTime gProcessCreationTimestamp = 0;// Timestamp of sessionstore-windows-restored
 
 PRUint32 gRestartMode = 0;
 
 class nsAppExitEvent : public nsRunnable {
 private:
@@ -719,15 +717,13 @@ nsAppStartup::GetStartupInfo()
   char *moz_app_restart = PR_GetEnv("MOZ_APP_RESTART");
   if (moz_app_restart) {
     gProcessCreationTimestamp = nsCRT::atoll(moz_app_restart) * PR_USEC_PER_MSEC;
   } else if (!gProcessCreationTimestamp) {
     gProcessCreationTimestamp = CalculateProcessCreationTimestamp();
   }
 
   MaybeDefineProperty(cx, obj, "process", gProcessCreationTimestamp);
-#ifdef MOZ_ENABLE_LIBXUL
   MaybeDefineProperty(cx, obj, "main", gXRE_mainTimestamp);
   MaybeDefineProperty(cx, obj, "firstPaint", gFirstPaintTimestamp);
-#endif
   MaybeDefineProperty(cx, obj, "sessionRestored", gRestoredTimestamp);
   return NS_OK;
 }
--- a/toolkit/components/url-classifier/tests/Makefile.in
+++ b/toolkit/components/url-classifier/tests/Makefile.in
@@ -51,28 +51,15 @@ MOZILLA_INTERNAL_API = 1
 
 # mochitest tests
 DIRS += mochitest \
 	$(NULL)
 
 # xpcshell tests
 XPCSHELL_TESTS=unit
 
-ifndef MOZ_ENABLE_LIBXUL
-# simple c++ tests (no xpcom)
-CPP_UNIT_TESTS = \
-	TestUrlClassifierUtils.cpp \
-	$(NULL)
-
-LOCAL_INCLUDES = \
-	-I$(srcdir)/../src \
-	-I$(srcdir)/../public \
-	$(NULL)
-
-LIBS = \
-	../src/$(LIB_PREFIX)urlclassifier_s.$(LIB_SUFFIX) \
-	$(MOZ_COMPONENT_LIBS) \
-	$(XPCOM_LIBS) \
-	$(NSPR_LIBS) \
-	$(NULL)
-endif
+# XXX Get this to work in libxul builds.
+## simple c++ tests (no xpcom)
+#CPP_UNIT_TESTS = \
+#	TestUrlClassifierUtils.cpp \
+#	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/toolkit/crashreporter/test/Makefile.in
+++ b/toolkit/crashreporter/test/Makefile.in
@@ -44,16 +44,18 @@ relativesrcdir  = toolkit/crashreporter/
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = crashreporter_test
 XPCSHELL_TESTS = unit
 
 LIBRARY_NAME = testcrasher
 NO_DIST_INSTALL = 1
 
+FORCE_SHARED_LIB = 1
+
 VPATH += \
   $(srcdir)/../google-breakpad/src/processor/ \
   $(srcdir)/../google-breakpad/src/common/ \
   $(topsrcdir)/build/ \
   $(NULL)
 
 CPPSRCS = \
   nsTestCrasher.cpp \
@@ -65,33 +67,17 @@ CPPSRCS = \
   $(STDCXX_COMPAT) \
   $(NULL)
 
 LOCAL_INCLUDES += \
   -I$(XPIDL_GEN_DIR) \
   -I$(srcdir)/../google-breakpad/src/ \
   $(NULL)
 EXTRA_DSO_LIBS += xpcom
-EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(MOZ_COMPONENT_LIBS)
-
-ifdef MOZ_ENABLE_LIBXUL
-EXTRA_DSO_LDOPTS += $(XPCOM_GLUE_LDOPTS)
-else
-
-MOZILLA_INTERNAL_API = 1
-
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-EXTRA_DSO_LDOPTS += $(DIST)/bin/XUL
-else
-EXTRA_DSO_LIBS += xul
-endif
-
-EXTRA_DSO_LDOPTS += $(EXTRA_DSO_LIBS) $(XPCOM_LIBS)
-
-endif
+EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(MOZ_COMPONENT_LIBS) $(XPCOM_GLUE_LDOPTS)
 
 EXTRA_JS_MODULES = CrashTestUtils.jsm
 
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DSHARED_LIBRARY=$(SHARED_LIBRARY) -DNOMINMAX
 
 ifneq (mobile,$(MOZ_BUILD_APP))
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -82,17 +82,16 @@ SHARED_LIBRARY_LIBS += \
 	$(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
 	$(NULL)
 
 SHARED_LIBRARY_LIBS += \
 	$(foreach component,$(COMPONENT_LIBS),$(DEPTH)/staticlib/components/$(LIB_PREFIX)$(component).$(LIB_SUFFIX)) \
 	$(foreach lib,$(STATIC_LIBS),$(DEPTH)/staticlib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX)) \
 	$(NULL)
 
-ifdef MOZ_ENABLE_LIBXUL
 include $(srcdir)/libxul-config.mk
 
 EXTRA_DEPS += \
 	$(srcdir)/libxul-config.mk \
 	$(srcdir)/libxul-rules.mk \
 	$(topsrcdir)/intl/unicharutil/util/objs.mk \
 	$(NULL)
 
@@ -119,17 +118,16 @@ EXTRA_DEPS += \
 CPPSRCS += \
 	$(RDF_UTIL_SRC_LCPPSRCS) \
 	$(NULL)
 
 GARBAGE += \
 	$(RDF_UTIL_SRC_LCPPSRCS) \
 	$(NULL)
 endif
-endif
 
 ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 SDK_LIBRARY = $(IMPORT_LIBRARY)
 else
 SDK_LIBRARY = $(SHARED_LIBRARY)
 endif
 
 # See bug 653662 - some builders are hitting an internal size limit
@@ -139,23 +137,16 @@ endif
 ifeq ($(OS_ARCH),WINNT)
 ifdef MOZ_DEBUG
 EXTRA_DSO_LDOPTS += -INCREMENTAL:NO
 endif
 endif
 
 EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(EXTRA_DSO_LIBS)
 
-ifndef MOZ_ENABLE_LIBXUL
-EXTRA_DSO_LDOPTS += \
-	$(MOZ_COMPONENT_LIBS) \
-	$(MOZ_JS_LIBS) \
-	$(NULL)
-endif
-
 DEFINES += -DIMPL_XREAPI
 
 EXTRA_DSO_LDOPTS += $(NSPR_LIBS) $(MOZALLOC_LIB)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 CXXFLAGS	+= $(TK_CFLAGS)
 OS_LIBS += \
 	-framework SystemConfiguration \
@@ -248,19 +239,17 @@ ifdef MOZ_ENABLE_QT
 EXTRA_DSO_LDOPTS += $(MOZ_QT_LDFLAGS) $(XEXT_LIBS)
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 export:: $(RDF_UTIL_SRC_CPPSRCS) $(INTL_UNICHARUTIL_UTIL_CPPSRCS)
 	$(INSTALL) $^ .
 
-ifdef MOZ_ENABLE_LIBXUL
 include $(srcdir)/libxul-rules.mk
-endif
 
 ifeq ($(OS_ARCH),OpenBSD)
 # Needed by nsAuthGSSAPI
 EXTRA_DSO_LDOPTS += -lkrb5 -lcrypto
 endif
 
 ifdef MOZ_JAVAXPCOM
 dlldeps-javaxpcom.cpp: $(topsrcdir)/extensions/java/xpcom/src/dlldeps-javaxpcom.cpp
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -45,17 +45,16 @@ ifeq ($(OS_ARCH),WINNT)
 REQUIRES += widget gfx
 CPPSRCS += \
 	nsDllMain.cpp \
 	$(NULL)
 endif
 
 ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 CPPSRCS += \
-	dlldeps.cpp \
 	nsGFXDeps.cpp \
 	$(NULL)
 
 RCINCLUDE = xulrunner.rc
 
 ifndef MOZ_NATIVE_ZLIB
 CPPSRCS += dlldeps-zlib.cpp
 endif
@@ -68,28 +67,25 @@ ifneq (,$(filter WINNT OS2,$(OS_ARCH)))
 REQUIRES += libreg
 DEFINES	+= -DZLIB_DLL=1
 endif
 
 ifeq ($(OS_ARCH),OS2)
 REQUIRES += widget gfx
 
 CPPSRCS += \
-	dlldeps.cpp \
 	nsGFXDeps.cpp \
 	$(NULL)
 
 ifndef MOZ_NATIVE_ZLIB
 CPPSRCS += dlldeps-zlib.cpp
 endif
 
-ifdef MOZ_ENABLE_LIBXUL
 RESFILE = xulrunos2.res
 RCFLAGS += -i $(topsrcdir)/widget/src/os2
-endif
 
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/src/os2
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 endif
 
 # dependent libraries
 STATIC_LIBS += \
   jsipc_s \
--- a/toolkit/library/libxul-rules.mk
+++ b/toolkit/library/libxul-rules.mk
@@ -52,15 +52,8 @@ DEFINES += \
 	-DEXPORT_XPTC_API \
 	-D_IMPL_NS_GFX \
 	-D_IMPL_NS_WIDGET \
 	$(NULL)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32)
 endif
-
-export:: dlldeps.cpp
-
-dlldeps.cpp: $(topsrcdir)/xpcom/build/dlldeps.cpp
-	$(INSTALL) $^ .
-
-GARBAGE += dlldeps.cpp
--- a/toolkit/toolkit-tiers.mk
+++ b/toolkit/toolkit-tiers.mk
@@ -221,38 +221,32 @@ tier_platform_dirs	+= security/manager/b
 endif
 
 ifdef MOZ_PREF_EXTENSIONS
 tier_platform_dirs += extensions/pref
 endif
 
 tier_platform_dirs += services/crypto/component
 
-ifdef MOZ_ENABLE_LIBXUL
 tier_platform_dirs += startupcache
-endif
 
-ifndef BUILD_STATIC_LIBS
 ifdef APP_LIBXUL_STATICDIRS
 # Applications can cheat and ask for code to be
 # built before libxul so libxul can be linked against it.
 tier_platform_staticdirs += $(APP_LIBXUL_STATICDIRS)
 endif
 ifdef APP_LIBXUL_DIRS
 # Applications can cheat and ask for code to be
 # built before libxul so it can be linked into libxul.
 tier_platform_dirs += $(APP_LIBXUL_DIRS)
 endif
 
 tier_platform_dirs += toolkit/library
-endif
 
-ifdef MOZ_ENABLE_LIBXUL
 tier_platform_dirs += xpcom/stub
-endif
 
 ifdef NS_TRACE_MALLOC
 tier_platform_dirs += tools/trace-malloc
 endif
 
 ifdef MOZ_ENABLE_GNOME_COMPONENT
 tier_platform_dirs    += toolkit/system/gnome
 endif
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -59,16 +59,17 @@ endif
 
 CPPSRCS = \
   nsAppRunner.cpp \
   nsConsoleWriter.cpp \
   nsXREDirProvider.cpp \
   nsNativeAppSupportBase.cpp \
   nsAppData.cpp \
   nsSigHandlers.cpp \
+  nsEmbedFunctions.cpp \
   $(NULL)
 
 ifdef MOZ_X11
 ifndef MOZ_PLATFORM_MAEMO
 CPPSRCS += glxtest.cpp
 endif
 endif
 
@@ -77,20 +78,16 @@ CPPSRCS += EventTracer.cpp
 endif
 
 ifdef MOZ_SPLASHSCREEN
 CPPSRCS += nsSplashScreenDummy.cpp
 endif
 
 DEFINES += -DIMPL_XREAPI -DMOZ_APP_NAME='"$(MOZ_APP_NAME)"'
 
-ifndef BUILD_STATIC_LIBS
-CPPSRCS += nsEmbedFunctions.cpp
-endif
-
 ifdef MOZ_UPDATER
 ifneq ($(OS_TARGET),Android)
 CPPSRCS += nsUpdateDriver.cpp
 DEFINES += -DMOZ_UPDATER
 endif
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
@@ -191,37 +188,28 @@ include $(topsrcdir)/ipc/chromium/chromi
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/dom/ipc \
   -I$(topsrcdir)/toolkit/crashreporter \
   -I$(topsrcdir)/dom/base \
   $(NULL)
 
-ifdef BUILD_STATIC_LIBS
-export::
-	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMP_NAMES) Apprunner
-endif
-
 LOCAL_INCLUDES += \
   -I$(srcdir) \
   -I$(srcdir)/../profile \
   -I$(topsrcdir)/config \
   $(NULL)
 
 CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 CXXFLAGS += $(MOZ_PANGO_CFLAGS)
 endif
 
-ifdef BUILD_STATIC_LIBS
-DEFINES += -D_BUILD_STATIC_BIN
-endif
-
 DEFINES += \
   -DOS_TARGET=\"$(OS_TARGET)\" \
   -DMOZ_WIDGET_TOOLKIT=\"$(MOZ_WIDGET_TOOLKIT)\"
 
 ifdef TARGET_XPCOM_ABI
 DEFINES += \
   -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\" \
   -DTARGET_OS_ABI=\"$(OS_TARGET)_$(TARGET_XPCOM_ABI)\" \
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1129,26 +1129,16 @@ NSMODULE_DEFN(Apprunner) = &kXREModule;
 
 nsresult
 ScopedXPCOMStartup::Initialize()
 {
   NS_ASSERTION(gDirServiceProvider, "Should not get here!");
 
   nsresult rv;
 
-#ifndef MOZ_ENABLE_LIBXUL
-#ifndef _BUILD_STATIC_BIN
-  XRE_AddStaticComponent(&kXREModule);
-#else
-  for (const mozilla::Module *const *const *staticModules = kPStaticModules;
-       *staticModules; ++staticModules)
-      XRE_AddStaticComponent(**staticModules);
-#endif
-#endif
-
   rv = NS_InitXPCOM2(&mServiceManager, gDirServiceProvider->GetAppDir(),
                      gDirServiceProvider);
   if (NS_FAILED(rv)) {
     NS_ERROR("Couldn't start xpcom!");
     mServiceManager = nsnull;
   }
   else {
     nsCOMPtr<nsIComponentRegistrar> reg =
@@ -1702,19 +1692,17 @@ static nsresult LaunchChild(nsINativeApp
   SaveToEnv("MOZ_LAUNCHED_CHILD=1");
 
 #if defined(ANDROID)
   mozilla::AndroidBridge::Bridge()->ScheduleRestart();
 #else
 #if defined(XP_MACOSX)
   CommandLineServiceMac::SetupMacCommandLine(gRestartArgc, gRestartArgv, PR_TRUE);
   PRUint32 restartMode = 0;
-#if defined(MOZ_ENABLE_LIBXUL)
   restartMode = gRestartMode;
-#endif
   LaunchChildMac(gRestartArgc, gRestartArgv, restartMode);
 #else
   nsCOMPtr<nsILocalFile> lf;
   nsresult rv = XRE_GetBinaryPath(gArgv[0], getter_AddRefs(lf));
   if (NS_FAILED(rv))
     return rv;
 
 #if defined(XP_WIN)
--- a/tools/trace-malloc/Makefile.in
+++ b/tools/trace-malloc/Makefile.in
@@ -73,36 +73,32 @@ PROGRAM		= spacetrace$(BIN_SUFFIX)
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 LOCAL_INCLUDES	+= -I$(topsrcdir)/config/os2
 endif
 
 include $(topsrcdir)/config/config.mk
 
-ifdef MOZ_ENABLE_LIBXUL
 ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 EXTRA_DSO_LIBS	= xul
 endif
-endif
 
 LIBS		+= \
 		$(LIBS_DIR) \
 		tmreader.$(OBJ_SUFFIX) \
 		adreader.$(OBJ_SUFFIX) \
 		$(XPCOM_GLUE_LDOPTS) \
 		$(EXTRA_DSO_LIBS) \
 		$(NSPR_LIBS) \
 		$(NULL)
 
-ifdef MOZ_ENABLE_LIBXUL
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 LIBS += $(DIST)/bin/XUL
 endif
-endif
 
 ifdef HAVE_BOUTELL_GD
 ifeq ($(OS_ARCH),WINNT)
 LOCAL_INCLUDES	+= \
 		-I"$(HAVE_BOUTELL_GD)" \
 		$(NULL)
 LIBS		+= \
 		-lmozz_s \
--- a/widget/src/android/GfxInfo.cpp
+++ b/widget/src/android/GfxInfo.cpp
@@ -38,17 +38,17 @@
 #include "nsPrintfCString.h"
 #include "mozilla/FunctionTimer.h"
 #include "prenv.h"
 #include "prprf.h"
 #include "EGLUtils.h"
 
 #include "AndroidBridge.h"
 
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
 #include "nsExceptionHandler.h"
 #include "nsICrashReporter.h"
 #define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1"
 #include "nsIPrefService.h"
 #endif
 
 using namespace mozilla::widget;
 
@@ -154,17 +154,17 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aA
   *aAdapterDeviceID = 0;
   return NS_OK;
 }
 
 void
 GfxInfo::AddCrashReportAnnotations()
 {
 #if 0
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
   nsCAutoString deviceIDString, vendorIDString;
   PRUint32 deviceID, vendorID;
 
   GetAdapterDeviceID(&deviceID);
   GetAdapterVendorID(&vendorID);
 
   deviceIDString.AppendPrintf("%04x", deviceID);
   vendorIDString.AppendPrintf("%04x", vendorID);
--- a/widget/src/cocoa/GfxInfo.mm
+++ b/widget/src/cocoa/GfxInfo.mm
@@ -39,17 +39,17 @@
 #include <OpenGL/OpenGL.h>
 #include <OpenGL/CGLRenderers.h>
 
 #include "GfxInfo.h"
 #include "nsUnicharUtils.h"
 #include "mozilla/FunctionTimer.h"
 #include "nsToolkit.h"
 
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
 #include "nsExceptionHandler.h"
 #include "nsICrashReporter.h"
 #define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1"
 #include "nsIPrefService.h"
 #endif
 
 using namespace mozilla::widget;
 
@@ -175,17 +175,17 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aA
 {
   *aAdapterDeviceID = 0;
   return NS_OK;
 }
 
 void
 GfxInfo::AddCrashReportAnnotations()
 {
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
   CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AdapterRendererIDs"),
                                      NS_LossyConvertUTF16toASCII(mRendererIDsString));
 
   /* Add an App Note for now so that we get the data immediately. These
    * can go away after we store the above in the socorro db */
   nsCAutoString note;
   /* AppendPrintf only supports 32 character strings, mrghh. */
   note.AppendLiteral("Renderers: ");
--- a/widget/src/os2/Makefile.in
+++ b/widget/src/os2/Makefile.in
@@ -47,20 +47,16 @@ LIBRARY_NAME	= wdgtos2
 EXPORT_LIBRARY	= 1
 IS_COMPONENT	= 1
 RESFILE		= widget.res
 MODULE_NAME	= nsWidgetOS2Module
 GRE_MODULE	= 1
 LIBXUL_LIBRARY = 1
 
 
-ifdef BUILD_STATIC_LIBS
-EXPORTS		= wdgtos2rc.h
-endif
-
 CPPSRCS		= \
 		nsAppShell.cpp \
 		nsBidiKeyboard.cpp \
 		nsClipboard.cpp \
 		nsFilePicker.cpp \
 		os2FrameWindow.cpp \
 		nsLookAndFeel.cpp \
 		nsOS2Uni.cpp \
--- a/widget/src/windows/GfxInfo.cpp
+++ b/widget/src/windows/GfxInfo.cpp
@@ -43,17 +43,17 @@
 #include "GfxInfoWebGL.h"
 #include "nsUnicharUtils.h"
 #include "nsPrintfCString.h"
 #include "mozilla/FunctionTimer.h"
 #include "prenv.h"
 #include "prprf.h"
 #include "GfxDriverInfo.h"
 
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
 #include "nsExceptionHandler.h"
 #include "nsICrashReporter.h"
 #define NS_CRASHREPORTER_CONTRACTID "@mozilla.org/toolkit/crash-reporter;1"
 #include "nsIPrefService.h"
 #endif
 
 
 using namespace mozilla::widget;
@@ -528,17 +528,17 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aA
 /* readonly attribute unsigned long adapterDeviceID; */
 NS_IMETHODIMP
 GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
 {
   *aAdapterDeviceID = mAdapterDeviceID;
   return NS_OK;
 }
 
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
 /* Cisco's VPN software can cause corruption of the floating point state.
  * Make a note of this in our crash reports so that some weird crashes
  * make more sense */
 static void
 CheckForCiscoVPN() {
   LONG result;
   HKEY key;
   /* This will give false positives, but hopefully no false negatives */
@@ -548,17 +548,17 @@ CheckForCiscoVPN() {
     CrashReporter::AppendAppNotesToCrashReport(NS_LITERAL_CSTRING("Cisco VPN\n"));
   }
 }
 #endif
 
 void
 GfxInfo::AddCrashReportAnnotations()
 {
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
   CheckForCiscoVPN();
 
   nsCAutoString deviceIDString, vendorIDString;
   PRUint32 deviceID, vendorID;
   nsAutoString adapterDriverVersionString;
 
   GetAdapterDeviceID(&deviceID);
   GetAdapterVendorID(&vendorID);
--- a/widget/src/windows/Makefile.in
+++ b/widget/src/windows/Makefile.in
@@ -109,20 +109,16 @@ DEFINES		+= -D_IMPL_NS_WIDGET -DMOZ_UNIC
 ifdef MOZ_ENABLE_D3D9_LAYER
 DEFINES		+= -DMOZ_ENABLE_D3D9_LAYER
 endif
 
 ifdef MOZ_ENABLE_D3D10_LAYER
 DEFINES		+= -DMOZ_ENABLE_D3D10_LAYER
 endif
 
-ifdef BUILD_STATIC_LIBS
-DEFINES		+= -DMOZ_STATIC_COMPONENT_LIBS
-endif # BUILD_STATIC_LIBS
-
 
 EXPORTS		= nsdefs.h WindowHook.h
 
 LOCAL_INCLUDES	= \
 		-I. \
 		-I$(srcdir)/../xpwidgets \
 		-I$(srcdir) \
 		-I$(topsrcdir)/toolkit/xre \
--- a/widget/src/windows/nsToolkit.cpp
+++ b/widget/src/windows/nsToolkit.cpp
@@ -70,56 +70,16 @@ static PRBool dummy = nsToolkit::InitVer
 static const unsigned long kD3DUsageDelay = 5000;
 
 static void
 StartAllowingD3D9(nsITimer *aTimer, void *aClosure)
 {
   nsWindow::StartAllowingD3D9(true);
 }
 
-#if !defined(MOZ_STATIC_COMPONENT_LIBS) && !defined(MOZ_ENABLE_LIBXUL)
-//
-// Dll entry point. Keep the dll instance
-//
-
-#if defined(__GNUC__)
-// If DllMain gets name mangled, it won't be seen.
-extern "C" {
-#endif
-
-BOOL APIENTRY DllMain(  HINSTANCE hModule, 
-                        DWORD reason, 
-                        LPVOID lpReserved )
-{
-    switch( reason ) {
-        case DLL_PROCESS_ATTACH:
-            nsToolkit::Startup(hModule);
-            break;
-
-        case DLL_THREAD_ATTACH:
-            break;
-    
-        case DLL_THREAD_DETACH:
-            break;
-    
-        case DLL_PROCESS_DETACH:
-            nsToolkit::Shutdown();
-            break;
-
-    }
-
-    return TRUE;
-}
-
-#if defined(__GNUC__)
-} // extern "C"
-#endif
-
-#endif
-
 //
 // main for the message pump thread
 //
 PRBool gThreadState = PR_FALSE;
 
 struct ThreadInitInfo {
     PRMonitor *monitor;
     nsToolkit *toolkit;
--- a/widget/src/windows/tests/Makefile.in
+++ b/widget/src/windows/tests/Makefile.in
@@ -37,33 +37,30 @@
 
 DEPTH		= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-ifndef BUILD_STATIC_LIBS
-ifndef MOZ_ENABLE_LIBXUL
-LOCAL_INCLUDES =  -I$(srcdir)/../   \
-                  -I$(srcdir)/../../xpwidgets \
-                  $(NULL)
-
-LIBS = ../$(LIB_PREFIX)widget_windows.$(LIB_SUFFIX) \
-       ../../xpwidgets/$(LIB_PREFIX)xpwidgets_s.$(LIB_SUFFIX) \
-       $(DIST)/lib/$(LIB_PREFIX)thebes.$(LIB_SUFFIX) \
-       $(DIST)/lib/$(LIB_PREFIX)gkgfx.$(LIB_SUFFIX) \
-       $(XPCOM_LIBS) \
-       $(MOZ_UNICHARUTIL_LIBS) \
-		   $(QCMS_LIBS) \
-       $(NULL)
-
-EXTRA_DSO_LDOPTS += $(LIBS_DIR)
-
-OS_LIBS += $(call EXPAND_LIBNAME,ole32 oleaut32 shell32 comctl32 comdlg32 imm32 shlwapi winspool msimg32)
-
-CPP_UNIT_TESTS = TestWinDND.cpp \
-                 $(NULL)
-endif
-endif
+# XXX None of these stuff works in libxul builds.
+#LOCAL_INCLUDES =  -I$(srcdir)/../   \
+#                  -I$(srcdir)/../../xpwidgets \
+#                  $(NULL)
+#
+#LIBS = ../$(LIB_PREFIX)widget_windows.$(LIB_SUFFIX) \
+#       ../../xpwidgets/$(LIB_PREFIX)xpwidgets_s.$(LIB_SUFFIX) \
+#       $(DIST)/lib/$(LIB_PREFIX)thebes.$(LIB_SUFFIX) \
+#       $(DIST)/lib/$(LIB_PREFIX)gkgfx.$(LIB_SUFFIX) \
+#       $(XPCOM_LIBS) \
+#       $(MOZ_UNICHARUTIL_LIBS) \
+#		   $(QCMS_LIBS) \
+#       $(NULL)
+#
+#EXTRA_DSO_LDOPTS += $(LIBS_DIR)
+#
+#OS_LIBS += $(call EXPAND_LIBNAME,ole32 oleaut32 shell32 comctl32 comdlg32 imm32 shlwapi winspool msimg32)
+#
+#CPP_UNIT_TESTS = TestWinDND.cpp \
+#                 $(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/widget/src/xpwidgets/GfxInfoBase.cpp
+++ b/widget/src/xpwidgets/GfxInfoBase.cpp
@@ -50,17 +50,17 @@
 #include "nsIObserverService.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMNode.h"
 #include "nsIDOM3Node.h"
 #include "nsIDOMNodeList.h"
 #include "nsTArray.h"
 #include "mozilla/Preferences.h"
 
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
 #include "nsExceptionHandler.h"
 #endif
 
 extern "C" {
   void StoreSpline(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy);
   void CrashSpline(double tolerance, int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy);
 }
 
@@ -82,17 +82,17 @@ StoreSpline(int ax, int ay, int bx, int 
     crash_cx = cx;
     crash_cy = cy;
     crash_dx = dx;
     crash_dy = dy;
 }
 
 void
 CrashSpline(double tolerance, int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy) {
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
   static bool annotated;
 
   if (!annotated) {
     nsCAutoString note;
 
     note.AppendPrintf("curve ");
     note.AppendPrintf("%x ", crash_ax);
     note.AppendPrintf("%x, ", crash_ay);
@@ -639,17 +639,17 @@ GfxInfoBase::EvaluateDownloadedBlacklist
 NS_IMETHODIMP_(void)
 GfxInfoBase::LogFailure(const nsACString &failure)
 {
   /* We only keep the first 9 failures */
   if (mFailureCount < NS_ARRAY_LENGTH(mFailures)) {
     mFailures[mFailureCount++] = failure;
 
     /* record it in the crash notes too */
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
     CrashReporter::AppendAppNotesToCrashReport(failure);
 #endif
   }
 
 }
 
 /* void getFailures ([optional] out unsigned long failureCount, [array, size_is (failureCount), retval] out string failures); */
 /* XPConnect method of returning arrays is very ugly. Would not recommend. Fallable nsMemory::Alloc makes things worse */
--- a/widget/src/xpwidgets/nsNativeTheme.cpp
+++ b/widget/src/xpwidgets/nsNativeTheme.cpp
@@ -552,20 +552,16 @@ nsNativeTheme::Notify(nsITimer* aTimer)
 
   // XXX Assumes that calling nsIFrame::Invalidate won't reenter
   //     QueueAnimatedContentForRefresh.
 
   PRUint32 count = mAnimatedContentList.Length();
   for (PRUint32 index = 0; index < count; index++) {
     nsIFrame* frame = mAnimatedContentList[index]->GetPrimaryFrame();
     if (frame) {
-#ifdef MOZ_ENABLE_LIBXUL
       frame->InvalidateOverflowRect();
-#else
-      frame->InvalidateOverflowRectExternal();
-#endif
     }
   }
 
   mAnimatedContentList.Clear();
   mAnimatedContentTimeout = PR_UINT32_MAX;
   return NS_OK;
 }
--- a/xpcom/Makefile.in
+++ b/xpcom/Makefile.in
@@ -56,40 +56,34 @@ DIRS		= \
 		threads \
 		reflect \
 		proxy \
                 system \
 		../chrome \
 		build \
 		$(NULL)
 
-ifndef MOZ_ENABLE_LIBXUL
-DIRS += stub
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 ifdef MOZ_DEBUG
 DIRS		+= windbgdlg
 endif
 endif
 
 ifdef ENABLE_TESTS
 TOOL_DIRS += \
 	tests \
 	sample \
 	typelib/xpt/tests \
 	proxy/tests
 
 #  Can't build internal xptcall tests that use symbols which are not exported.
-ifndef MOZ_ENABLE_LIBXUL
-TOOL_DIRS += \
-	reflect/xptinfo/tests \
-	reflect/xptcall/tests \
-	$(NULL)
-endif
+#TOOL_DIRS += \
+#	reflect/xptinfo/tests \
+#	reflect/xptcall/tests \
+#	$(NULL)
 endif
 
 # xpcom-config.h is generated by configure
 SDK_HEADERS	= xpcom-config.h
 
 ifdef DEHYDRA_PATH
 DIRS += analysis
 endif
--- a/xpcom/base/nsDebugImpl.cpp
+++ b/xpcom/base/nsDebugImpl.cpp
@@ -324,17 +324,17 @@ NS_DebugBreak(PRUint32 aSeverity, const 
    case NS_DEBUG_WARNING:
      return;
 
    case NS_DEBUG_BREAK:
      Break(buf.buffer);
      return;
 
    case NS_DEBUG_ABORT: {
-#if defined(MOZ_CRASHREPORTER) && defined(MOZ_ENABLE_LIBXUL)
+#if defined(MOZ_CRASHREPORTER)
      nsCString note("xpcom_runtime_abort(");
      note += buf.buffer;
      note += ")";
      CrashReporter::AppendAppNotesToCrashReport(note);
 #endif  // MOZ_CRASHREPORTER
 
 #if defined(DEBUG) && defined(_WIN32)
      RealBreak();
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -290,25 +290,17 @@
 #ifdef _IMPL_NS_COM
 #define XPCOM_API(type) EXPORT_XPCOM_API(type)
 #elif defined(XPCOM_GLUE)
 #define XPCOM_API(type) GLUE_XPCOM_API(type)
 #else
 #define XPCOM_API(type) IMPORT_XPCOM_API(type)
 #endif
 
-#ifdef MOZ_ENABLE_LIBXUL
 #define NS_COM
-#elif defined(_IMPL_NS_COM)
-#define NS_COM NS_EXPORT
-#elif defined(XPCOM_GLUE)
-#define NS_COM
-#else
-#define NS_COM NS_IMPORT
-#endif
 
 #ifdef MOZILLA_INTERNAL_API
 #  define NS_COM_GLUE NS_COM
    /*
      The frozen string API has different definitions of nsAC?String
      classes than the internal API. On systems that explicitly declare
      dllexport symbols this is not a problem, but on ELF systems
      internal symbols can accidentally "shine through"; we rename the
--- a/xpcom/build/Makefile.in
+++ b/xpcom/build/Makefile.in
@@ -45,21 +45,17 @@ include $(DEPTH)/config/autoconf.mk
 include $(srcdir)/../glue/objs.mk
 
 EXTRA_DEPS += $(srcdir)/../glue/objs.mk
 
 MODULE		= xpcom
 LIBRARY_NAME	= xpcom_core
 SHORT_LIBNAME	= xpcomcor
 LIBXUL_LIBRARY = 1
-
-# This is only a static library in libxul builds
-ifdef MOZ_ENABLE_LIBXUL
 EXPORT_LIBRARY = 1
-endif
 
 GRE_MODULE	= 1
 MOZILLA_INTERNAL_API = 1
 
 CSRCS		= \
 		$(XPCOM_GLUE_SRC_LCSRCS) \
 		$(NULL)
 
@@ -67,22 +63,16 @@ CPPSRCS		= \
 		$(XPCOM_GLUE_SRC_LCPPSRCS) \
 		$(XPCOM_GLUENS_SRC_LCPPSRCS) \
 		nsXPComInit.cpp \
 		nsXPCOMStrings.cpp \
 		Services.cpp \
 		Omnijar.cpp \
 		$(NULL)
 
-ifndef MOZ_ENABLE_LIBXUL
-ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
-CPPSRCS += dlldeps.cpp
-endif
-endif
-
 SHARED_LIBRARY_LIBS = \
 		$(DEPTH)/chrome/src/$(LIB_PREFIX)chrome_s.$(LIB_SUFFIX) \
 		../ds/$(LIB_PREFIX)xpcomds_s.$(LIB_SUFFIX) \
 		../io/$(LIB_PREFIX)xpcomio_s.$(LIB_SUFFIX) \
 		../components/$(LIB_PREFIX)xpcomcomponents_s.$(LIB_SUFFIX) \
 		../threads/$(LIB_PREFIX)xpcomthreads_s.$(LIB_SUFFIX) \
 		../proxy/src/$(LIB_PREFIX)xpcomproxy_s.$(LIB_SUFFIX) \
 		../base/$(LIB_PREFIX)xpcombase_s.$(LIB_SUFFIX) \
@@ -133,20 +123,16 @@ EXPORTS_mozilla = \
   Services.h \
   ServiceList.h \
   Omnijar.h \
   $(NULL)
 
 # Force use of PIC
 FORCE_USE_PIC	= 1 
 
-ifndef MOZ_ENABLE_LIBXUL
-FORCE_SHARED_LIB = 1
-endif
-
 # UNIX98 iconv support
 OS_LIBS += $(LIBICONV)
 
 GARBAGE         += $(XPCOM_GLUE_SRC_LCSRCS) $(XPCOM_GLUE_SRC_LCPPSRCS) $(XPCOM_GLUENS_SRC_LCPPSRCS) $(wildcard *.$(OBJ_SUFFIX))
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
@@ -184,15 +170,12 @@ ifdef HAVE_CLOCK_MONOTONIC
 EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,shell32 ole32 uuid version)
 ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
 OS_LIBS += $(call EXPAND_LIBNAME,imagehlp)
 endif
-ifndef MOZ_ENABLE_LIBXUL
-OS_LIBS += $(call EXPAND_LIBNAME,psapi)
-endif
 endif # WINNT
 
 export:: $(XPCOM_GLUE_SRC_CSRCS) $(XPCOM_GLUE_SRC_CPPSRCS) $(XPCOM_GLUENS_SRC_CPPSRCS)
 	$(INSTALL) $^ .
deleted file mode 100644
--- a/xpcom/build/dlldeps.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-// Force references to all of the symbols that we want exported from
-// the dll that are located in the .lib files we link with
-
-#ifdef XP_WIN
-#include <windows.h>
-#include "nsWindowsRegKey.h"
-#include "nsSetDllDirectory.h"
-#ifdef DEBUG
-#include "pure.h"
-#endif
-#endif
-#include "nsXULAppAPI.h"
-#include "nsXPCOMGlue.h"
-#include "nsVoidArray.h"
-#include "nsTArray.h"
-#include "nsIAtom.h"
-#include "nsFixedSizeAllocator.h"
-#include "nsRecyclingAllocator.h"
-#include "nsDeque.h"
-#include "nsTraceRefcnt.h"
-#include "nsTraceRefcntImpl.h"
-#include "nsXPIDLString.h"
-#include "nsIEnumerator.h"
-#include "nsEnumeratorUtils.h"
-#include "nsQuickSort.h"
-#include "nsString.h"
-#include "nsPrintfCString.h"
-#include "nsSupportsArray.h"
-#include "nsArrayEnumerator.h"
-#include "nsProxyRelease.h"
-#include "xpt_xdr.h"
-#include "xptcall.h"
-#include "nsILocalFile.h"
-#include "nsIPipe.h"
-#include "nsStreamUtils.h"
-#include "nsWeakReference.h"
-#include "nsTextFormatter.h"
-#include "nsIStorageStream.h"
-#include "nsStringStream.h"
-#include "nsLinebreakConverter.h"
-#include "nsIBinaryInputStream.h"
-#include "nsIInterfaceRequestor.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsReadableUtils.h"
-#include "nsStaticNameTable.h"
-#include "nsProcess.h"
-#include "nsStringEnumerator.h"
-#include "nsIInputStreamTee.h"
-#include "nsCheapSets.h"
-#include "nsHashKeys.h"
-#include "nsTHashtable.h"
-#include "pldhash.h"
-#include "nsVariant.h"
-#include "nsEscape.h"
-#include "nsStreamUtils.h"
-#include "nsNativeCharsetUtils.h"
-#include "nsInterfaceRequestorAgg.h"
-#include "nsHashPropertyBag.h"
-#include "nsXPCOMStrings.h"
-#include "nsStringBuffer.h"
-#include "nsCategoryCache.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsCycleCollector.h"
-#include "nsThreadUtils.h"
-#include "nsTObserverArray.h"
-#include "nsWildCard.h"
-#include "mozilla/Mutex.h"
-#include "mozilla/Monitor.h"
-#include "mozilla/CondVar.h"
-#include "mozilla/TimeStamp.h"
-
-using namespace mozilla;
-
-class nsCStringContainer : private nsStringContainer_base { };
-class nsStringContainer : private nsStringContainer_base { };
-
-void XXXNeverCalled()
-{
-    nsTextFormatter::snprintf(nsnull,0,nsnull);
-    nsTextFormatter::smprintf(nsnull, nsnull);
-    nsTextFormatter::smprintf_free(nsnull);
-    nsVoidArray();
-    nsSmallVoidArray();
-    {
-      nsTArray<PRBool> array1(1), array2(1);
-      PRBool a, b, c;
-      a = b = c = PR_FALSE;
-      array1.AppendElement(a);
-      array2.InsertElementAt(b, 0);
-      array2.InsertElementAt(c, 0);
-      array1.AppendElements(array2);
-    }
-    {
-      nsTObserverArray<PRBool> dummyObserverArray;
-      PRBool a = PR_FALSE;
-      dummyObserverArray.AppendElement(a);
-      dummyObserverArray.RemoveElement(a);
-      dummyObserverArray.Clear();
-    }
-    nsStringHashSet();
-    nsCStringHashSet();
-    nsInt32HashSet();
-    nsVoidHashSet();
-    nsCheapStringSet();
-    nsCheapInt32Set();
-    nsSupportsArray();
-    NS_GetNumberOfAtoms();
-    NS_NewPipe(nsnull, nsnull, 0, 0, PR_FALSE, PR_FALSE, nsnull);
-    NS_NewPipe2(nsnull, nsnull, PR_FALSE, PR_FALSE, 0, 0, nsnull);
-    NS_NewInputStreamReadyEvent(nsnull, nsnull, nsnull);
-    NS_NewOutputStreamReadyEvent(nsnull, nsnull, nsnull);
-    NS_AsyncCopy(nsnull, nsnull, nsnull, NS_ASYNCCOPY_VIA_READSEGMENTS, 0, nsnull, nsnull);
-    {
-      nsCString temp;
-      NS_ConsumeStream(nsnull, 0, temp);
-    }
-    NS_InputStreamIsBuffered(nsnull);
-    NS_OutputStreamIsBuffered(nsnull);
-    NS_CopySegmentToStream(nsnull, nsnull, nsnull, 0, 0, nsnull);
-    NS_CopySegmentToBuffer(nsnull, nsnull, nsnull, 0, 0, nsnull);
-    NS_DiscardSegment(nsnull, nsnull, nsnull, 0, 0, nsnull);
-    NS_WriteSegmentThunk(nsnull, nsnull, nsnull, 0, 0, 0);
-    NS_NewByteInputStream(nsnull, nsnull, 0, NS_ASSIGNMENT_COPY);
-    NS_NewCStringInputStream(nsnull, nsCString());
-    NS_NewStringInputStream(nsnull, nsString());
-    PL_DHashStubEnumRemove(nsnull, nsnull, nsnull, nsnull);
-    nsIDHashKey::HashKey(nsnull);
-    nsFixedSizeAllocator a;
-    nsRecyclingAllocator recyclingAllocator(2);
-    a.Init(0, 0, 0, 0, 0);
-    a.Alloc(0);
-    a.Free(0, 0);
-    nsDeque d(nsnull);
-    nsDequeIterator di(d);
-    nsTraceRefcnt::LogAddCOMPtr(nsnull, nsnull);
-    nsTraceRefcntImpl::DumpStatistics();
-    NS_NewEmptyEnumerator(nsnull);
-    NS_QuickSort(nsnull, 0, 0, nsnull, nsnull);
-    nsString();
-    NS_ProxyRelease(nsnull, nsnull, PR_FALSE);
-    XPT_DoString(nsnull, nsnull, nsnull);
-    XPT_DoHeader(nsnull, nsnull, nsnull);
-    NS_InvokeByIndex(nsnull, 0, 0, nsnull);
-    NS_GetWeakReference(nsnull);
-    nsCOMPtr<nsISupports> dummyFoo(do_GetInterface(nsnull));
-    NS_NewStorageStream(0,0, nsnull);
-    nsString foo;
-    nsPrintfCString bar("");
-    nsLinebreakConverter::ConvertStringLineBreaks(foo, 
-    nsLinebreakConverter::eLinebreakAny, nsLinebreakConverter::eLinebreakContent);
-    NS_NewLocalFile(EmptyString(), PR_FALSE, nsnull);
-    NS_NewNativeLocalFile(EmptyCString(), PR_FALSE, nsnull);
-    new nsProcess();
-    nsStaticCaseInsensitiveNameTable();
-    nsAutoString str1;
-    str1.AssignWithConversion(nsnull, 0);
-    nsCAutoString str2;
-    ToNewUnicode(str1);
-    ToNewUnicode(str2);
-    ToNewCString(str1);
-    ToNewCString(str2);
-    PL_DHashTableFinish(nsnull);
-    NS_NewInputStreamTee(nsnull, nsnull, nsnull);
-    nsCOMArray<nsISupports> dummyArray;
-    NS_NewArrayEnumerator(nsnull, dummyArray);
-    new nsVariant();
-    nsUnescape(nsnull);
-    nsEscape(nsnull, url_XAlphas);
-    nsTArray<nsString> array;
-    NS_NewStringEnumerator(nsnull, &array);
-    NS_NewAdoptingStringEnumerator(nsnull, &array);
-    nsTArray<nsCString> carray;
-    NS_NewUTF8StringEnumerator(nsnull, &carray);
-    NS_NewAdoptingUTF8StringEnumerator(nsnull, &carray);
-    nsVoidableString str3;
-    {
-      nsAdoptingCString foo, bar;
-      foo = bar;
-    }
-    {
-      nsAdoptingString foo, bar;
-      foo = bar;
-    }
-    NS_CopyNativeToUnicode(str2, str1);
-    NS_CopyUnicodeToNative(str1, str2);
-    {
-      nsID id;
-      CallCreateInstance(id, nsnull, id, nsnull);
-      CallCreateInstance("", nsnull, id, nsnull);
-      CallGetClassObject(id, id, nsnull);
-      CallGetClassObject("", id, nsnull);
-    }
-    NS_NewInterfaceRequestorAggregation(nsnull, nsnull, nsnull);
-    NS_NewHashPropertyBag(nsnull);
-    nsDependentString depstring;
-    depstring.Rebind(nsnull, PRUint32(0));
-    nsDependentCString depcstring;
-    depcstring.Rebind(nsnull, PRUint32(0));
-    // nsStringAPI
-    nsCStringContainer sc1;
-    NS_CStringContainerInit(sc1);
-    NS_CStringContainerInit2(sc1, nsnull, 0, 0);
-    NS_CStringContainerFinish(sc1);
-    NS_CStringGetData(str2, nsnull, nsnull);
-    NS_CStringGetMutableData(str2, 0, nsnull);
-    NS_CStringSetData(str2, nsnull, 0);
-    NS_CStringSetDataRange(str2, 0, 0, nsnull, 0);
-    NS_CStringCopy(str2, str2);
-    NS_CStringCloneData(str2);
-    nsStringContainer sc2;
-    NS_StringContainerInit(sc2);
-    NS_StringContainerInit2(sc2, nsnull, 0, 0);
-    NS_StringContainerFinish(sc2);
-    NS_StringGetData(str1, nsnull, nsnull);
-    NS_StringGetMutableData(str1, 0, nsnull);
-    NS_StringSetData(str1, nsnull, 0);
-    NS_StringSetDataRange(str1, 0, 0, nsnull, 0);
-    NS_StringCopy(str1, str1);
-    NS_StringCloneData(str1);
-    NS_UTF16ToCString(str1, NS_CSTRING_ENCODING_ASCII, str2);
-    NS_CStringToUTF16(str2, NS_CSTRING_ENCODING_ASCII, str1);
-
-    nsCategoryObserver catobs(nsnull, nsnull);
-    nsCategoryCache<nsILocalFile> catcache(nsnull);
-
-    // nsStringBuffer.h
-    {
-      nsString x;
-      nsCString y;
-      nsStringBuffer b;
-      b.AddRef();
-      b.Release();
-      nsStringBuffer::Alloc(0);
-      nsStringBuffer::Realloc(nsnull, 0);
-      nsStringBuffer::FromString(x);
-      nsStringBuffer::FromString(y);
-      b.ToString(0, x);
-      b.ToString(0, y);
-    }
-
-    nsXPCOMCycleCollectionParticipant();
-    nsCycleCollector_collect(nsnull);
-#ifdef XP_WIN
-    sXPCOMHasLoadedNewDLLs = !sXPCOMHasLoadedNewDLLs;
-    NS_SetHasLoadedNewDLLs();
-    NS_NewWindowsRegKey(nsnull);
-    NS_SetDllDirectory(nsnull);
-#if defined (DEBUG)
-    PurePrintf(0);
-#endif
-#endif
-
-    NS_NewThread(nsnull, nsnull);
-    NS_GetCurrentThread(nsnull);
-    NS_GetCurrentThread();
-    NS_GetMainThread(nsnull);
-    NS_DispatchToCurrentThread(nsnull);
-    NS_DispatchToMainThread(nsnull, 0);
-    NS_ProcessPendingEvents(nsnull, 0);
-    NS_HasPendingEvents(nsnull);
-    NS_ProcessNextEvent(nsnull, PR_FALSE);
-    Mutex theMutex("dummy");
-    Monitor theMonitor("dummy2");
-    CondVar theCondVar(theMutex, "dummy3");
-    TimeStamp theTimeStamp = TimeStamp::Now();
-    TimeDuration theTimeDuration = TimeDuration::FromMilliseconds(0);
-
-    NS_WildCardValid((const char *)nsnull);
-    NS_WildCardValid((const PRUnichar *)nsnull);
-    NS_WildCardMatch((const char *)nsnull, (const char *)nsnull, PR_FALSE);
-    NS_WildCardMatch((const PRUnichar *)nsnull, (const PRUnichar *)nsnull, PR_FALSE);
-    XRE_AddStaticComponent(NULL);
-    XRE_AddManifestLocation(NS_COMPONENT_LOCATION, NULL);
-}
--- a/xpcom/build/nsXPComInit.cpp
+++ b/xpcom/build/nsXPComInit.cpp
@@ -140,19 +140,17 @@ extern nsresult nsStringInputStreamConst
 #include <locale.h>
 #include "mozilla/Services.h"
 #include "mozilla/FunctionTimer.h"
 #include "mozilla/Omnijar.h"
 
 #include "nsChromeRegistry.h"
 #include "nsChromeProtocolHandler.h"
 
-#ifdef MOZ_ENABLE_LIBXUL
 #include "mozilla/scache/StartupCache.h"
-#endif
 
 #include "base/at_exit.h"
 #include "base/command_line.h"
 #include "base/message_loop.h"
 
 #include "mozilla/ipc/BrowserProcessSubThread.h"
 
 using base::AtExitManager;
@@ -519,19 +517,17 @@ NS_InitXPCOM2(nsIServiceManager* *result
 
     NS_TIME_FUNCTION_MARK("Next: register category providers");
 
     // After autoreg, but before we actually instantiate any components,
     // add any services listed in the "xpcom-directory-providers" category
     // to the directory service.
     nsDirectoryService::gService->RegisterCategoryProviders();
 
-#ifdef MOZ_ENABLE_LIBXUL
     mozilla::scache::StartupCache::GetSingleton();
-#endif
     NS_TIME_FUNCTION_MARK("Next: create services from category");
 
     // Notify observers of xpcom autoregistration start
     NS_CreateServicesFromCategory(NS_XPCOM_STARTUP_CATEGORY, 
                                   nsnull,
                                   NS_XPCOM_STARTUP_OBSERVER_ID);
 #ifdef XP_WIN
     ScheduleMediaCacheRemover();
@@ -602,19 +598,17 @@ ShutdownXPCOM(nsIServiceManager* servMgr
             {
                 (void) observerService->
                     NotifyObservers(mgr, NS_XPCOM_SHUTDOWN_OBSERVER_ID,
                                     nsnull);
             }
         }
 
         NS_ProcessPendingEvents(thread);
-#ifdef MOZ_ENABLE_LIBXUL
         mozilla::scache::StartupCache::DeleteSingleton();
-#endif
         if (observerService)
             (void) observerService->
                 NotifyObservers(nsnull, NS_XPCOM_SHUTDOWN_THREADS_OBSERVER_ID,
                                 nsnull);
 
         nsCycleCollector_shutdownThreads();
 
         NS_ProcessPendingEvents(thread);
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -301,21 +301,19 @@ nsTArray<const mozilla::Module*>* nsComp
 
 /* static */ void
 nsComponentManagerImpl::InitializeStaticModules()
 {
     if (sStaticModules)
         return;
 
     sStaticModules = new nsTArray<const mozilla::Module*>;
-#ifdef MOZ_ENABLE_LIBXUL
     for (const mozilla::Module *const *const *staticModules = kPStaticModules;
          *staticModules; ++staticModules)
         sStaticModules->AppendElement(**staticModules);
-#endif
 }
 
 nsTArray<nsComponentManagerImpl::ComponentLocation>*
 nsComponentManagerImpl::sModuleLocations;
 
 /* static */ void
 nsComponentManagerImpl::InitializeModuleLocations()
 {
--- a/xpcom/glue/nsCycleCollectorUtils.cpp
+++ b/xpcom/glue/nsCycleCollectorUtils.cpp
@@ -78,17 +78,9 @@ NS_IsCycleCollectorThread()
 extern PRThread* gCycleCollectorThread;
 
 bool
 NS_IsCycleCollectorThread()
 {
   return PR_GetCurrentThread() == gCycleCollectorThread;
 }
 
-#elif !defined(MOZ_ENABLE_LIBXUL)
-
-bool
-NS_IsCycleCollectorThread()
-{
-  return gTLSThreadID == mozilla::threads::CycleCollector;
-}
-
 #endif
--- a/xpcom/glue/nsCycleCollectorUtils.h
+++ b/xpcom/glue/nsCycleCollectorUtils.h
@@ -42,24 +42,20 @@
 
 #if defined(MOZILLA_INTERNAL_API)
 #define NS_IsCycleCollectorThread NS_IsCycleCollectorThread_P
 #if defined(XP_WIN)
 NS_COM bool NS_IsCycleCollectorThread();
 #elif defined(NS_TLS)
 // Defined in nsThreadManager.cpp.
 extern NS_TLS mozilla::threads::ID gTLSThreadID;
-#ifdef MOZ_ENABLE_LIBXUL
 inline bool NS_IsCycleCollectorThread()
 {
   return gTLSThreadID == mozilla::threads::CycleCollector;
 }
 #else
-NS_COM bool NS_IsCycleCollectorThread();
-#endif
-#else
 NS_COM_GLUE bool NS_IsCycleCollectorThread();
 #endif
 #else
 NS_COM_GLUE bool NS_IsCycleCollectorThread();
 #endif
 
 #endif /* nsCycleCollectorUtils_h__ */
--- a/xpcom/glue/nsThreadUtils.cpp
+++ b/xpcom/glue/nsThreadUtils.cpp
@@ -139,21 +139,16 @@ NS_IsMainThread()
 }
 #elif !defined(NS_TLS)
 bool NS_IsMainThread()
 {
   PRBool result = PR_FALSE;
   nsThreadManager::get()->nsThreadManager::GetIsMainThread(&result);
   return bool(result);
 }
-#elif !defined(MOZ_ENABLE_LIBXUL)
-bool NS_IsMainThread()
-{
-  return gTLSThreadID == mozilla::threads::Main;
-}
 #endif
 
 NS_METHOD
 NS_DispatchToCurrentThread(nsIRunnable *event)
 {
 #ifdef MOZILLA_INTERNAL_API
   nsIThread *thread = NS_GetCurrentThread();
   if (!thread) { return NS_ERROR_UNEXPECTED; }
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -101,25 +101,21 @@ extern NS_COM_GLUE NS_METHOD
 NS_GetMainThread(nsIThread **result);
 
 #if defined(MOZILLA_INTERNAL_API) && defined(XP_WIN)
 NS_COM bool NS_IsMainThread();
 #elif defined(MOZILLA_INTERNAL_API) && defined(NS_TLS)
 // This is defined in nsThreadManager.cpp and initialized to `Main` for the
 // main thread by nsThreadManager::Init.
 extern NS_TLS mozilla::threads::ID gTLSThreadID;
-#ifdef MOZ_ENABLE_LIBXUL
 inline bool NS_IsMainThread()
 {
   return gTLSThreadID == mozilla::threads::Main;
 }
 #else
-NS_COM bool NS_IsMainThread();
-#endif
-#else
 /**
  * Test to see if the current thread is the main thread.
  *
  * @returns PR_TRUE if the current thread is the main thread, and PR_FALSE
  * otherwise.
  */
 extern NS_COM_GLUE bool NS_IsMainThread();
 #endif
--- a/xpcom/io/nsSegmentedBuffer.cpp
+++ b/xpcom/io/nsSegmentedBuffer.cpp
@@ -162,17 +162,17 @@ nsSegmentedBuffer::Empty()
         }
         nsMemory::Free(mSegmentArray);
         mSegmentArray = nsnull;
     }
     mSegmentArrayCount = NS_SEGMENTARRAY_INITIAL_COUNT;
     mFirstSegmentIndex = mLastSegmentIndex = 0;
 }
 
-#if !defined(MOZ_ENABLE_LIBXUL) && defined(DEBUG)
+#if 0
 NS_COM void
 TestSegmentedBuffer()
 {
     nsSegmentedBuffer* buf = new nsSegmentedBuffer();
     NS_ASSERTION(buf, "out of memory");
     buf->Init(4, 16);
     char* seg;
     PRBool empty;
--- a/xpcom/stub/Makefile.in
+++ b/xpcom/stub/Makefile.in
@@ -76,18 +76,16 @@ EXTRA_DSO_LDOPTS = $(LIBS_DIR)
 
 DEPENDENT_LIBS_LIST += \
 	$(DLL_PREFIX)nspr4$(DLL_SUFFIX) \
 	$(DLL_PREFIX)plc4$(DLL_SUFFIX) \
 	$(DLL_PREFIX)plds4$(DLL_SUFFIX) \
 	$(DLL_PREFIX)mozalloc$(DLL_SUFFIX) \
 	$(NULL)
 
-ifdef MOZ_ENABLE_LIBXUL
-
 ifndef MOZ_NATIVE_SQLITE
 ifeq ($(OS_TARGET),OS2)
 DEPENDENT_LIBS_LIST += mozsqlt3.dll
 else
 DEPENDENT_LIBS_LIST += $(DLL_PREFIX)mozsqlite3$(DLL_SUFFIX)
 endif
 endif
 
@@ -106,27 +104,16 @@ endif
 ifeq (bundle,$(MOZ_FS_LAYOUT))
 EXTRA_DSO_LDOPTS += $(DIST)/bin/XUL
 DEPENDENT_LIBS_LIST += XUL
 else
 EXTRA_DSO_LIBS = xul
 DEPENDENT_LIBS_LIST += $(DLL_PREFIX)xul$(DLL_SUFFIX)
 endif
 
-else #!MOZ_ENABLE_LIBXUL
-
-EXTRA_DSO_LIBS = xpcom_core
-ifeq ($(OS_TARGET),OS2)
-DEPENDENT_LIBS_LIST += xpcomcor.dll
-else
-DEPENDENT_LIBS_LIST += $(DLL_PREFIX)xpcom_core$(DLL_SUFFIX)
-endif
-
-endif #ifdef MOZ_ENABLE_LIBXUL
-
 EXTRA_DSO_LDOPTS +=				\
 	$(EXTRA_DSO_LIBS)			\
 	$(NSPR_LIBS)				\
 	$(MOZALLOC_LIB)				\
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
--- a/xpcom/tests/Makefile.in
+++ b/xpcom/tests/Makefile.in
@@ -40,20 +40,16 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir = xpcom/tests
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= xpcom
 
-ifndef MOZ_ENABLE_LIBXUL
-MOZILLA_INTERNAL_API = 1
-endif
-
 DIRS		= external component bug656331_component
 
 ifeq ($(OS_ARCH),WINNT)
 DIRS		+= windows
 endif
 
 ifdef DEHYDRA_PATH
 DIRS += static-checker
@@ -95,40 +91,39 @@ CPP_UNIT_TESTS = \
                  TestObserverArray.cpp \
                  TestObserverService.cpp \
                  TestPipe.cpp \
                  TestRefPtr.cpp \
                  TestTextFormatter.cpp \
                  TestCheckedInt.cpp \
                  $(NULL)
 
-ifndef MOZ_ENABLE_LIBXUL
-CPP_UNIT_TESTS += \
-                  TestArray.cpp \
-                  TestCRT.cpp \
-                  TestDeque.cpp \
-                  TestEncoding.cpp \
-                  TestExpirationTracker.cpp \
-                  TestPipes.cpp \
-                  TestPriorityQueue.cpp \
-                  TestProxies.cpp \
-                  TestStorageStream.cpp \
-                  TestStrings.cpp \
-                  TestSynchronization.cpp \
-                  TestTArray.cpp \
-                  TestThreadPool.cpp \
-                  TestThreads.cpp \
-                  TestTimeStamp.cpp \
-                  TestXPIDLString.cpp \
-                  TestUTF.cpp \
-                  TestAtoms.cpp \
-                  $(NULL)
-# FIXME: bug 577500 TestStaticAtoms fails when run in dist/bin
-# TestStaticAtoms.cpp
-endif
+# XXX Make this tests work in libxul builds.
+#CPP_UNIT_TESTS += \
+#                  TestArray.cpp \
+#                  TestCRT.cpp \
+#                  TestDeque.cpp \
+#                  TestEncoding.cpp \
+#                  TestExpirationTracker.cpp \
+#                  TestPipes.cpp \
+#                  TestPriorityQueue.cpp \
+#                  TestProxies.cpp \
+#                  TestStorageStream.cpp \
+#                  TestStrings.cpp \
+#                  TestSynchronization.cpp \
+#                  TestTArray.cpp \
+#                  TestThreadPool.cpp \
+#                  TestThreads.cpp \
+#                  TestTimeStamp.cpp \
+#                  TestXPIDLString.cpp \
+#                  TestUTF.cpp \
+#                  TestAtoms.cpp \
+#                  $(NULL)
+## FIXME: bug 577500 TestStaticAtoms fails when run in dist/bin
+## TestStaticAtoms.cpp
 
 ifdef MOZ_DEBUG
 # FIXME bug 523392: TestDeadlockDetector doesn't like Windows
 # FIXME bug 523378: also fails on OS X
 ifneq (,$(filter-out WINNT Darwin,$(OS_ARCH)))
 CPP_UNIT_TESTS += \
                   TestDeadlockDetector.cpp \
                   TestDeadlockDetectorScalability.cpp \
--- a/xpcom/tests/TestPipes.cpp
+++ b/xpcom/tests/TestPipes.cpp
@@ -466,38 +466,33 @@ RunTests(PRUint32 segSize, PRUint32 segC
     rv = TP_NewPipe(getter_AddRefs(in), getter_AddRefs(out), segSize, bufSize);
     NS_ASSERTION(NS_SUCCEEDED(rv), "TP_NewPipe failed");
     rv = TestShortWrites(in, out);
     NS_ASSERTION(NS_SUCCEEDED(rv), "TestPipe failed");
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
-#if !defined(MOZ_ENABLE_LIBXUL) && defined(DEBUG)
+#if 0
 extern NS_COM void
 TestSegmentedBuffer();
 #endif
 
 int
 main(int argc, char* argv[])
 {
     nsresult rv;
 
     nsCOMPtr<nsIServiceManager> servMgr;
     rv = NS_InitXPCOM2(getter_AddRefs(servMgr), NULL, NULL);
     if (NS_FAILED(rv)) return rv;
 
     if (argc > 1 && nsCRT::strcmp(argv[1], "-trace") == 0)
         gTrace = PR_TRUE;
 
-#if !defined(MOZ_ENABLE_LIBXUL) && defined(DEBUG)
-    printf("Testing segmented buffer...\n");
-    TestSegmentedBuffer();
-#endif
-
     rv = TestChainedPipes();
     NS_ASSERTION(NS_SUCCEEDED(rv), "TestChainedPipes failed");
     RunTests(16, 1);
     RunTests(4096, 16);
 
     servMgr = 0;
     rv = NS_ShutdownXPCOM( NULL );
     NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");
--- a/xpcom/tests/bug656331_component/Makefile.in
+++ b/xpcom/tests/bug656331_component/Makefile.in
@@ -43,16 +43,17 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME	= test656331
 IS_COMPONENT	= 1
 CPPSRCS	= TestComponent.cpp
 NO_DIST_INSTALL = 1
+FORCE_SHARED_LIB = 1
 
 include $(topsrcdir)/config/config.mk
 
 MANIFEST_FILE = bug656331.manifest
 
 EXTRA_DSO_LDOPTS = \
   $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
   $(XPCOM_FROZEN_LDOPTS) \
--- a/xpcom/tests/component/Makefile.in
+++ b/xpcom/tests/component/Makefile.in
@@ -42,16 +42,17 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME	= testcomponent
 IS_COMPONENT	= 1
 CPPSRCS	= TestComponent.cpp
 NO_DIST_INSTALL = 1
+FORCE_SHARED_LIB = 1
 
 include $(topsrcdir)/config/config.mk
 
 MANIFEST_FILE = testcomponent.manifest
 
 EXTRA_DSO_LDOPTS = \
 		$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
 		$(XPCOM_FROZEN_LDOPTS) \
--- a/xpfe/components/autocomplete/src/Makefile.in
+++ b/xpfe/components/autocomplete/src/Makefile.in
@@ -41,17 +41,16 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= appcomps
 MODULE_NAME	= xpAutoComplete
 LIBRARY_NAME	= xpautocomplete
 SHORT_LIBNAME	= xpautoc
-MOZILLA_INTERNAL_API = $(BUILD_STATIC_LIBS)
 EXPORT_LIBRARY	= 1
 LIBXUL_LIBRARY  = 1
 IS_COMPONENT	= 1
 
 CPPSRCS		= nsAutoComplete.cpp
 
 EXTRA_DSO_LDOPTS += \
 	$(XPCOM_GLUE_LDOPTS) \
--- a/xpinstall/src/Makefile.in
+++ b/xpinstall/src/Makefile.in
@@ -44,25 +44,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= xpinstall
 LIBRARY_NAME	= xpinstall
 
-ifndef MOZ_ENABLE_LIBXUL
-# Make this a true dynamic component even in static builds because
-# this component is shared by installer
-FORCE_SHARED_LIB	= 1
-BUILD_STATIC_LIBS=
-SHORT_LIBNAME	= xpinstal
-else
 EXPORT_LIBRARY = 1
-endif
 IS_COMPONENT	= 1
 MODULE_NAME	= nsSoftwareUpdate
 GRE_MODULE	= 1
 LIBXUL_LIBRARY	= 1
 
 
 # XXX shouldn't need to export this
 EXPORTS		= nsXPITriggerInfo.h
@@ -82,12 +74,8 @@ LOCAL_INCLUDES	= -I$(srcdir)/../public
 EXTRA_DSO_LDOPTS = \
 		$(MOZ_JS_LIBS) \
 		$(MOZ_UNICHARUTIL_LIBS) \
 		$(MOZ_COMPONENT_LIBS) \
 		$(ZLIB_LIBS) \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
-
-ifeq ($(OS_ARCH)$(MOZ_ENABLE_LIBXUL),WINNT)
-DEFINES		+= -DZLIB_DLL
-endif
--- a/xulrunner/app/Makefile.in
+++ b/xulrunner/app/Makefile.in
@@ -74,24 +74,16 @@ LOCAL_INCLUDES += \
   -I$(topsrcdir)/toolkit/profile \
   -I$(topsrcdir)/xpcom/base \
   $(NULL)
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 TK_LIBS := -framework Cocoa $(TK_LIBS)
 endif
 
-ifndef MOZ_ENABLE_LIBXUL
-ifeq (bundle,$(MOZ_FS_LAYOUT))
-LIBS += $(DIST)/bin/XUL
-else
-EXTRA_DSO_LIBS += xul
-endif
-endif
-
 LIBS += \
   $(EXTRA_DSO_LIBS) \
   $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
   $(XPCOM_LIBS) \
   $(NSPR_LIBS) \
   $(NULL)
 
 ifdef MOZ_JPROF
--- a/xulrunner/confvars.sh
+++ b/xulrunner/confvars.sh
@@ -35,17 +35,15 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 MOZ_APP_NAME=xulrunner
 MOZ_APP_DISPLAYNAME=XULRunner
 MOZ_UPDATER=1
 MOZ_XULRUNNER=1
-MOZ_ENABLE_LIBXUL=1
 MOZ_CHROME_FILE_FORMAT=omni
-MOZ_STATIC_BUILD_UNSUPPORTED=1
 MOZ_APP_VERSION=$MOZILLA_VERSION
 if test "$MOZ_STORAGE"; then
   MOZ_PLACES=1
 fi
 MOZ_EXTENSIONS_DEFAULT=" gnomevfs"
 MOZ_URL_CLASSIFIER=1