Bug 659205 - tier_platform_dirs doesn't include APP_LIBXUL_DIRS (mailnews/ etc) -- mailnews, xpfe autocomplete etc aren't getting built - Fix BUILD_STATIC_LIBS rs=standard8
authorIan Neal <iann_cvs@blueyonder.co.uk>
Fri, 03 Jun 2011 21:43:40 +0100
changeset 8099 78cbb0581f0fef8c2d9cef5d82e12ca786730776
parent 8098 f250c280616213b4e8059c6bfc72bdeeb45b06f7
child 8100 2367dffaa3cb381c816c5bc56f32204bc0965ee7
push idunknown
push userunknown
push dateunknown
reviewersstandard8
bugs659205
Bug 659205 - tier_platform_dirs doesn't include APP_LIBXUL_DIRS (mailnews/ etc) -- mailnews, xpfe autocomplete etc aren't getting built - Fix BUILD_STATIC_LIBS rs=standard8
config/autoconf.mk.in
config/config.mk
config/rules.mk
config/static-config.mk
configure.in
mail/app/Makefile.in
mail/components/search/Makefile.in
mailnews/base/src/Makefile.in
suite/app/Makefile.in
suite/build/Makefile.in
suite/shell/src/Makefile.in
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -108,17 +108,16 @@ DEHYDRA_PATH    = @DEHYDRA_PATH@
 NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
 USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@
 INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
 MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
 MOZ_MAIL_NEWS	= @MOZ_MAIL_NEWS@
 MOZ_CALENDAR	= @MOZ_CALENDAR@
 MOZ_PLAINTEXT_EDITOR_ONLY = @MOZ_PLAINTEXT_EDITOR_ONLY@
 MOZ_COMPOSER = @MOZ_COMPOSER@
-BUILD_STATIC_LIBS = @BUILD_STATIC_LIBS@
 ENABLE_TESTS	= @ENABLE_TESTS@
 IBMBIDI = @IBMBIDI@
 MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
 ACCESSIBILITY = @ACCESSIBILITY@
 MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
 MOZ_LDAP_XPCOM = @MOZ_LDAP_XPCOM@
 MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
 MOZ_INSTALLER	= @MOZ_INSTALLER@
--- a/config/config.mk
+++ b/config/config.mk
@@ -222,85 +222,43 @@ endif
 ifdef NS_TRACE_MALLOC
 MOZ_OPTIMIZE_FLAGS=-Zi -Od -UDEBUG -DNDEBUG
 OS_LDFLAGS = -DEBUG -PDB:NONE -OPT:REF -OPT:nowin98
 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 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
 
 # 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
@@ -363,29 +321,16 @@ DEFINES += \
 		-DIMPL_THEBES \
 		$(NULL)
 
 ifndef MOZ_NATIVE_ZLIB
 DEFINES += -DZLIB_INTERNAL
 endif
 endif
 
-# Force _all_ exported methods to be |_declspec(dllexport)| when we're
-# building them into the executable.
-
-ifeq (,$(filter-out WINNT WINCE 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
@@ -239,17 +239,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)
 ifdef MOZ_FAKELIBS
 ifndef SUPPRESS_FAKELIB
@@ -261,17 +261,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 WINCE,$(OS_ARCH)))
 IMPORT_LIBRARY		:= $(LIB_PREFIX)$(SHARED_LIBRARY_NAME).$(IMPORT_LIB_SUFFIX)
@@ -291,29 +291,19 @@ endif
 
 ifeq ($(OS_ARCH),OS2)
 DEF_FILE		:= $(SHARED_LIBRARY:.dll=.def)
 endif
 
 EMBED_MANIFEST_AT=2
 
 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
 
@@ -825,26 +815,19 @@ ifneq (,$(strip $(TOOL_DIRS)))
 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
+ifndef IS_COMPONENT
 	$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_LIBS) $(STATIC_LIBRARY_NAME)
-endif # IS_COMPONENT
+endif # !IS_COMPONENT
 endif # EXPORT_LIBRARY
 endif # LIBRARY_NAME
 
 # Create dependencies on static (and shared EXTRA_DSO_LIBS) libraries
 LIBS_DEPS = $(filter %.$(LIB_SUFFIX), $(LIBS))
 HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX), $(HOST_LIBS))
 DSO_LDOPTS_DEPS = $(EXTRA_DSO_LIBS) $(filter %.$(LIB_SUFFIX), $(EXTRA_DSO_LDOPTS))
 
@@ -1154,17 +1137,17 @@ ifndef NO_DIST_INSTALL
 endif
 
 #
 # This allows us to create static versions of the shared libraries
 # that are built using other static libraries.  Confused...?
 #
 ifdef SHARED_LIBRARY_LIBS
 ifeq (,$(GNU_LD)$(filter-out OS2 WINNT WINCE, $(OS_ARCH)))
-ifneq (,$(BUILD_STATIC_LIBS)$(FORCE_STATIC_LIB))
+ifneq (,$(FORCE_STATIC_LIB))
 LOBJS	+= $(SHARED_LIBRARY_LIBS)
 endif
 else
 NONFAKE_SHARED_LIBRARY_LIBS = $(filter-out %.fake,$(call EXPAND_FAKELIBS,$(SHARED_LIBRARY_LIBS)))
 ifeq (,$(NONFAKE_SHARED_LIBRARY_LIBS))
 # All of our SHARED_LIBRARY_LIBS have fake equivalents. Score!
 # Just pass the original object files around.
 # For shared libraries, these are already included in EXTRA_DSO_LDOPTS
deleted file mode 100644
--- a/config/static-config.mk
+++ /dev/null
@@ -1,123 +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 $(MOZDEPTH)/staticlib/components/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_COMPS)))) \
-	$(addsuffix .$(LIB_SUFFIX),$(addprefix $(MOZDEPTH)/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 $(MOZDEPTH)/staticlib/components/$(LIB_PREFIX),$(shell cat $(FINAL_LINK_COMPS)))) $(addsuffix .$(LIB_SUFFIX),$(addprefix $(MOZDEPTH)/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
-
-ifdef MOZ_LDAP_XPCOM
-STATIC_EXTRA_LIBS	+= \
-		$(LDAP_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
-
-ifeq ($(OS_ARCH),Linux)
-STATIC_EXTRA_LIBS += $(MOZ_ALSA_LIBS)
-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
--- a/configure.in
+++ b/configure.in
@@ -4519,17 +4519,16 @@ fi
 dnl ========================================================
 dnl =
 dnl = Application
 dnl =
 dnl ========================================================
 
 MOZ_ARG_HEADER(Application)
 
-BUILD_STATIC_LIBS=
 ENABLE_TESTS=1
 MOZ_BRANDING_DIRECTORY=
 MOZ_OFFICIAL_BRANDING=
 MOZ_CALENDAR=
 MOZ_FEEDS=1
 MOZ_IPC=1
 MOZ_JSDEBUGGER=1
 MOZ_LDAP_XPCOM=
@@ -6599,21 +6598,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 of internal static libs],
-    BUILD_STATIC_LIBS=1,
-    BUILD_STATIC_LIBS=)
-
 # 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.],
     ENABLE_SHARED_JS=1,
@@ -6623,20 +6617,16 @@ 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_APP_NAME. You probably want --enable-libxul.])
-fi
-
 XPCOM_LIBS="$LIBXUL_LIBS"
 
 MOZ_ARG_ENABLE_BOOL(incomplete-external-linkage,
 [  --enable-incomplete-external-linkage Changes some comm-central code to be built with external linkage. Developer only option, incomplete broken builds will result - There are already existing bugs for this. ],
     MOZ_INCOMPLETE_EXTERNAL_LINKAGE=1,
     MOZ_INCOMPLETE_EXTERNAL_LINKAGE= )
 
 AC_SUBST(MOZ_INCOMPLETE_EXTERNAL_LINKAGE)
@@ -6886,17 +6876,16 @@ AC_SUBST(LIBICONV)
 AC_SUBST(MOZ_PLACES_BOOKMARKS)
 AC_SUBST(MOZ_STORAGE)
 AC_SUBST(MOZ_FEEDS)
 AC_SUBST(NS_PRINTING)
 AC_SUBST(MOZ_HELP_VIEWER)
 
 AC_SUBST(MOZ_PROFILELOCKING)
 
-AC_SUBST(BUILD_STATIC_LIBS)
 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_ANGLE)
--- a/mail/app/Makefile.in
+++ b/mail/app/Makefile.in
@@ -90,59 +90,35 @@ CPPSRCS = nsMailApp.cpp
 
 DIST_FILES = application.ini
 
 LOCAL_INCLUDES += \
   -I$(MOZILLA_SRCDIR)/toolkit/xre \
   -I$(MOZILLA_SRCDIR)/xpcom/base \
   $(NULL)
 
-ifdef BUILD_STATIC_LIBS
-ifdef _MSC_VER
-STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(MOZDEPTH)/staticlib
-else
-STATIC_COMPONENTS_LINKER_PATH = -L$(MOZDEPTH)/staticlib
-endif
-LIBS += $(MOZDEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
-else
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 LIBS += $(DIST)/bin/XUL
 else
 EXTRA_DSO_LIBS += xul
 endif
-endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 TK_LIBS := -framework Cocoa $(TK_LIBS)
-ifdef BUILD_STATIC_LIBS
-TK_LIBS := -framework SystemConfiguration $(TK_LIBS)
-endif
 endif
 
 APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
 
 LIBS += \
 	$(STATIC_COMPONENTS_LINKER_PATH) \
 	$(EXTRA_DSO_LIBS) \
 	$(APP_XPCOM_LIBS) \
 	$(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 gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
-LIBS += $(XLDFLAGS) $(XLIBS)
-endif
-endif
-
 ifdef MOZ_JPROF
 LIBS += -ljprof
 endif
 
 ifdef MOZ_ENABLE_DBUS
 LIBS += $(MOZ_DBUS_GLIB_LIBS)
 endif
 
@@ -161,91 +137,48 @@ 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) \
-	$(MOZ_HARFBUZZ_LIBS) \
-	$(NULL)
-
-# OpenGL is required by (mozilla/)content/canvas: see (mozilla/)layout/build/Makefile.in.
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-OS_LIBS += -framework OpenGL
-endif
-
-endif # BUILD_STATIC_LIBS
-
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
 OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
 RCINCLUDE = splash.rc
 ifndef GNU_CC
 RCFLAGS += -DMOZ_THUNDERBIRD -I$(srcdir)
 else
 RCFLAGS += -DMOZ_THUNDERBIRD --include-dir $(srcdir)
 endif
-ifdef BUILD_STATIC_LIBS
-RCFLAGS += -DMOZ_STATIC_BUILD
-OS_LIBS += $(call EXPAND_LIBNAME,shlwapi)
-endif
-endif
-
-ifeq ($(OS_ARCH),BeOS)
-ifdef BUILD_STATIC_LIBS
-OS_LIBS += -ltracker -lgame
-endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
 RESFILE=splashos2.res
 RCFLAGS += -DMOZ_THUNDERBIRD
-ifdef BUILD_STATIC_LIBS
-RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include
-endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 RCFLAGS += -DTHUNDERBIRD_ICO=\"$(DIST)/branding/thunderbird.ico\"
 endif
 
 LIBS += $(JEMALLOC_LIBS)
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DMOZILLA_OFFICIAL
 endif
 
-ifdef BUILD_STATIC_LIBS
-include $(topsrcdir)/config/static-rules.mk
-
-DEFINES	+= -DIMPL_XREAPI
-endif
-
 APP_UA_NAME = $(shell echo $(MOZ_APP_DISPLAYNAME) | sed -e's/[^A-Za-z]//g')
 DEFINES += -DAPP_VERSION="$(MOZ_APP_VERSION)" -DAPP_UA_NAME="$(APP_UA_NAME)"
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-ifdef BUILD_STATIC_LIBS
-LIBS	+= -lcups
-endif
 LIBS	+= -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 #
 # Control the default heap size.
 # This is the heap returned by GetProcessHeap().
 # As we use the CRT heap, the default size is too large and wastes VM.
@@ -255,22 +188,16 @@ ifeq ($(OS_ARCH),WINNT)
 #
 # Set it to 256k.  See bug 127069.
 #
 ifndef GNU_CC
 LDFLAGS += /HEAP:0x40000
 endif
 endif
 
-ifeq ($(OS_ARCH),AIX)
-ifdef BUILD_STATIC_LIBS
-LDFLAGS += -bbigtoc
-endif
-endif
-
 ifneq (,$(filter windows os2,$(MOZ_WIDGET_TOOLKIT)))
 ICON_SUFFIX=.ico
 
 DESKTOP_ICONS = \
 	abcardWindow \
 	addressbookWindow \
 	msgcomposeWindow \
 	$(NULL) 
--- a/mail/components/search/Makefile.in
+++ b/mail/components/search/Makefile.in
@@ -64,23 +64,19 @@ EXTRA_PP_JS_MODULES += \
   $(NULL)
 endif
 
 # If on Windows, build Windows Search integration
 ifneq (,$(filter windows, $(MOZ_WIDGET_TOOLKIT)))
 MODULE = mailwinsearch
 LIBRARY_NAME = winsearch_s
 MODULE_NAME = nsMailWinSearchHelperModule
-ifdef BUILD_STATIC_LIBS
-MOZILLA_INTERNAL_API = 1
-else
 ifneq ($(MOZ_WIDGET_TOOLKIT), gtk2)
 MOZILLA_INTERNAL_API = 1
 endif
-endif
 
 
 CPPSRCS = \
   nsMailWinSearchHelper.cpp \
   $(NULL)
 
 DIRS += public
 
--- a/mailnews/base/src/Makefile.in
+++ b/mailnews/base/src/Makefile.in
@@ -96,20 +96,16 @@ ifdef NS_PRINTING
 CPPSRCS += nsMsgPrintEngine.cpp
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 CMMSRCS = nsMessengerOSXIntegration.mm
 endif
 
 ifeq ($(OS_ARCH),WINNT)
-ifdef BUILD_STATIC_LIBS
-DEFINES	+= -DMOZ_STATIC_BUILD
-endif
-
 CPPSRCS		+= nsMessengerWinIntegration.cpp 
 endif
 
 ifeq ($(OS_ARCH),OS2)
 CPPSRCS		+= nsMessengerOS2Integration.cpp 
 endif
 
 ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),gtk gtk2))
--- a/suite/app/Makefile.in
+++ b/suite/app/Makefile.in
@@ -76,59 +76,35 @@ CPPSRCS = nsSuiteApp.cpp
 
 DIST_FILES = application.ini
 
 LOCAL_INCLUDES += \
   -I$(MOZILLA_SRCDIR)/toolkit/xre \
   -I$(MOZILLA_SRCDIR)/xpcom/base \
   $(NULL)
 
-ifdef BUILD_STATIC_LIBS
-ifdef _MSC_VER
-STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(MOZDEPTH)/staticlib
-else
-STATIC_COMPONENTS_LINKER_PATH = -L$(MOZDEPTH)/staticlib
-endif
-LIBS += $(MOZDEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
-else
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 LIBS += $(DIST)/bin/XUL
 else
 EXTRA_DSO_LIBS += xul
 endif
-endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 TK_LIBS := -framework Cocoa $(TK_LIBS)
-ifdef BUILD_STATIC_LIBS
-TK_LIBS := -framework SystemConfiguration $(TK_LIBS)
-endif
 endif
 
 APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
 
 LIBS += \
 	$(STATIC_COMPONENTS_LINKER_PATH) \
 	$(EXTRA_DSO_LIBS) \
 	$(APP_XPCOM_LIBS) \
 	$(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 gtk gtk2 xlib,$(MOZ_WIDGET_TOOLKIT)))
-LIBS += $(XLDFLAGS) $(XLIBS)
-endif
-endif
-
 ifdef MOZ_JPROF
 LIBS += -ljprof
 endif
 
 ifdef MOZ_ENABLE_DBUS
 LIBS += $(MOZ_DBUS_GLIB_LIBS)
 endif
 
@@ -143,87 +119,50 @@ endif
 NSDISTMODE = copy
 
 include $(topsrcdir)/config/config.mk
 
 ifdef _MSC_VER
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
 
-ifdef BUILD_STATIC_LIBS
-
-ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
-LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
-endif
-
-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) \
-	$(MOZ_HARFBUZZ_LIBS) \
-	$(NULL)
-endif
-
 # OpenGL is required by (mozilla/)content/canvas: see (mozilla/)layout/build/Makefile.in.
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 OS_LIBS += -framework OpenGL
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
 RCINCLUDE = splash.rc
 ifndef GNU_CC
 RCFLAGS += -DMOZ_SUITE -I$(srcdir)
 else
 RCFLAGS += -DMOZ_SUITE --include-dir $(srcdir)
 endif
-ifdef BUILD_STATIC_LIBS
-OS_LIBS += $(call EXPAND_LIBNAME, msimg32 shlwapi)
-RCFLAGS += -DMOZ_STATIC_BUILD
-endif
 endif
 
 ifeq ($(OS_ARCH),BeOS)
 BEOS_PROGRAM_RESOURCE = apprunner-beos.rsrc
-ifdef BUILD_STATIC_LIBS
-OS_LIBS += -ltracker -lgame
-endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
 RESFILE = splashos2.res
 RCFLAGS += -i $(MOZILLA_SRCDIR)/toolkit/xre
-ifdef BUILD_STATIC_LIBS
-RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include
-endif
 RCFLAGS += -DSEAMONKEY_ICO=\"$(DIST)/branding/seamonkey.ico\"
 endif
 
 LIBS += $(JEMALLOC_LIBS)
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DMOZILLA_OFFICIAL
 endif
 
-ifdef BUILD_STATIC_LIBS
-include $(topsrcdir)/config/static-rules.mk
-endif
-
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-ifdef BUILD_STATIC_LIBS
-LIBS	+= -lcups
-endif
 LIBS	+= -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 #
 # Control the default heap size.
 # This is the heap returned by GetProcessHeap().
 # As we use the CRT heap, the default size is too large and wastes VM.
--- a/suite/build/Makefile.in
+++ b/suite/build/Makefile.in
@@ -66,26 +66,19 @@ LOCAL_INCLUDES += \
 
 SHARED_LIBRARY_LIBS = \
 	../profile/$(LIB_PREFIX)suiteprofile_s.$(LIB_SUFFIX) \
 	../profile/migration/src/$(LIB_PREFIX)suitemigration_s.$(LIB_SUFFIX) \
 	../feeds/src/$(LIB_PREFIX)suitefeeds_s.$(LIB_SUFFIX) \
 	$(NULL)
 
 # We need to link the windows shell service into seamonkey.exe.
-ifdef BUILD_STATIC_LIBS
-BUILD_STATIC_SHELL = 1
-DEFINES += -DBUILD_STATIC_SHELL=1
-endif
-
-ifndef BUILD_STATIC_SHELL
 ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
 SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
 endif
-endif
 
 EXTRA_DSO_LDOPTS += \
 	$(LIBS_DIR) \
 	$(EXTRA_DSO_LIBS) \
 	$(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib) \
 	$(LIBXUL_DIST)/../modules/libreg/src/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX) \
 	$(MOZ_JS_LIBS) \
 	$(XPCOM_GLUE_LDOPTS) \
--- a/suite/shell/src/Makefile.in
+++ b/suite/shell/src/Makefile.in
@@ -20,23 +20,16 @@ CPPSRCS = nsMacShellService.cpp
 else
 ifeq ($(MOZ_WIDGET_TOOLKIT), gtk2)
 CPPSRCS = nsGNOMEShellService.cpp
 endif
 endif
 endif
 
 # We need to link the windows shell service into seamonkey.exe.
-# DEFINES needs to be set before config.mk is included,
-# because app-config.mk is loaded after config.mk reads DEFINES.
-ifdef BUILD_STATIC_LIBS
-BUILD_STATIC_SHELL = 1
-DEFINES += -DBUILD_STATIC_SHELL=1
-endif
-
 ifdef CPPSRCS
 LIBRARY_NAME = shellservice_s
 ifdef BUILD_STATIC_SHELL
 MOZILLA_INTERNAL_API = 1
 EXPORT_LIBRARY = 1
 IS_COMPONENT = 1
 MODULE_NAME = nsSuiteShellModule
 endif