Bug 935881 - Use FINAL_LIBRARY for all (fake) libraries that end up linked in a single other library. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 19 Nov 2013 11:47:14 +0900
changeset 156195 7161a2d28363197b76f4090900393cb19f201de4
parent 156194 a296036e608fa7b2465eaaf670aa2379504bbc35
child 156196 8a50d16b164500a4116e34a0319c645e8ff96427
push id3522
push userphilringnalda@gmail.com
push dateTue, 19 Nov 2013 04:10:57 +0000
treeherderfx-team@e4b59fdbc9c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs935881
milestone28.0a1
Bug 935881 - Use FINAL_LIBRARY for all (fake) libraries that end up linked in a single other library. r=gps
accessible/src/atk/Makefile.in
accessible/src/atk/moz.build
accessible/src/base/moz.build
accessible/src/generic/moz.build
accessible/src/html/moz.build
accessible/src/mac/Makefile.in
accessible/src/mac/moz.build
accessible/src/other/Makefile.in
accessible/src/other/moz.build
accessible/src/windows/ia2/moz.build
accessible/src/windows/msaa/moz.build
accessible/src/windows/sdn/moz.build
accessible/src/windows/uia/Makefile.in
accessible/src/windows/uia/moz.build
accessible/src/xpcom/moz.build
accessible/src/xul/moz.build
browser/components/about/moz.build
browser/components/build/Makefile.in
browser/components/dirprovider/moz.build
browser/components/feeds/src/moz.build
browser/components/migration/src/moz.build
browser/components/shell/src/moz.build
caps/src/moz.build
chrome/src/moz.build
configure.in
content/base/src/moz.build
content/canvas/src/moz.build
content/events/src/moz.build
content/html/content/src/moz.build
content/html/document/src/moz.build
content/mathml/content/src/moz.build
content/media/apple/moz.build
content/media/directshow/moz.build
content/media/encoder/moz.build
content/media/gstreamer/moz.build
content/media/mediasource/moz.build
content/media/moz.build
content/media/ogg/moz.build
content/media/omx/mediaresourcemanager/moz.build
content/media/omx/moz.build
content/media/plugins/moz.build
content/media/raw/moz.build
content/media/wave/moz.build
content/media/webaudio/blink/moz.build
content/media/webaudio/moz.build
content/media/webm/moz.build
content/media/webrtc/moz.build
content/media/webspeech/recognition/moz.build
content/media/webspeech/synth/moz.build
content/media/webspeech/synth/pico/moz.build
content/media/wmf/moz.build
content/smil/moz.build
content/svg/content/src/moz.build
content/svg/document/src/moz.build
content/xbl/src/moz.build
content/xml/content/src/moz.build
content/xml/document/src/moz.build
content/xslt/src/base/moz.build
content/xslt/src/xml/moz.build
content/xslt/src/xpath/moz.build
content/xslt/src/xslt/moz.build
content/xul/content/src/moz.build
content/xul/document/src/moz.build
content/xul/templates/src/moz.build
docshell/base/moz.build
docshell/build/moz.build
docshell/shistory/src/moz.build
dom/activities/src/moz.build
dom/alarm/moz.build
dom/apps/src/moz.build
dom/audiochannel/moz.build
dom/base/moz.build
dom/battery/moz.build
dom/bindings/moz.build
dom/bluetooth/moz.build
dom/browser-element/moz.build
dom/camera/moz.build
dom/cellbroadcast/src/moz.build
dom/devicestorage/moz.build
dom/encoding/moz.build
dom/file/moz.build
dom/fmradio/ipc/moz.build
dom/fmradio/moz.build
dom/gamepad/moz.build
dom/icc/src/moz.build
dom/indexedDB/ipc/moz.build
dom/indexedDB/moz.build
dom/interfaces/devicestorage/moz.build
dom/ipc/moz.build
dom/media/bridge/moz.build
dom/media/moz.build
dom/mobilemessage/src/moz.build
dom/network/src/moz.build
dom/nfc/moz.build
dom/plugins/base/android/moz.build
dom/plugins/base/moz.build
dom/plugins/ipc/moz.build
dom/power/moz.build
dom/promise/moz.build
dom/quota/moz.build
dom/src/events/moz.build
dom/src/geolocation/moz.build
dom/src/json/moz.build
dom/src/jsurl/moz.build
dom/src/notification/moz.build
dom/src/offline/moz.build
dom/src/storage/moz.build
dom/system/android/moz.build
dom/system/gonk/moz.build
dom/system/mac/moz.build
dom/system/moz.build
dom/system/unix/moz.build
dom/system/windows/moz.build
dom/telephony/moz.build
dom/time/moz.build
dom/voicemail/moz.build
dom/wifi/moz.build
dom/workers/moz.build
editor/composer/src/moz.build
editor/libeditor/base/moz.build
editor/libeditor/html/moz.build
editor/libeditor/text/moz.build
editor/txmgr/src/moz.build
editor/txtsvc/src/moz.build
embedding/browser/build/Makefile.in
embedding/browser/build/moz.build
embedding/browser/webBrowser/moz.build
embedding/components/appstartup/src/moz.build
embedding/components/build/Makefile.in
embedding/components/build/moz.build
embedding/components/commandhandler/src/moz.build
embedding/components/find/src/moz.build
embedding/components/printingui/src/mac/Makefile.in
embedding/components/printingui/src/mac/moz.build
embedding/components/printingui/src/os2/Makefile.in
embedding/components/printingui/src/os2/moz.build
embedding/components/printingui/src/unixshared/Makefile.in
embedding/components/printingui/src/unixshared/moz.build
embedding/components/printingui/src/win/Makefile.in
embedding/components/printingui/src/win/moz.build
embedding/components/webbrowserpersist/src/moz.build
embedding/components/windowwatcher/src/moz.build
extensions/auth/moz.build
extensions/cookie/moz.build
extensions/gio/moz.build
extensions/permissions/moz.build
extensions/pref/autoconfig/src/moz.build
extensions/spellcheck/hunspell/src/moz.build
extensions/spellcheck/src/Makefile.in
extensions/spellcheck/src/moz.build
extensions/universalchardet/src/base/moz.build
extensions/universalchardet/src/xpcom/Makefile.in
extensions/universalchardet/src/xpcom/moz.build
gfx/2d/moz.build
gfx/angle/moz.build
gfx/cairo/cairo/src/moz.build
gfx/cairo/libpixman/src/moz.build
gfx/gl/moz.build
gfx/graphite2/src/moz.build
gfx/harfbuzz/src/moz.build
gfx/ipc/moz.build
gfx/layers/moz.build
gfx/ots/src/moz.build
gfx/qcms/moz.build
gfx/skia/moz.build
gfx/src/moz.build
gfx/thebes/Makefile.in
gfx/thebes/moz.build
gfx/ycbcr/moz.build
hal/moz.build
image/build/Makefile.in
image/build/moz.build
image/decoders/icon/Makefile.in
image/decoders/icon/android/moz.build
image/decoders/icon/gtk/moz.build
image/decoders/icon/mac/moz.build
image/decoders/icon/moz.build
image/decoders/icon/os2/moz.build
image/decoders/icon/qt/moz.build
image/decoders/icon/win/moz.build
image/decoders/moz.build
image/encoders/bmp/moz.build
image/encoders/ico/moz.build
image/encoders/jpeg/moz.build
image/encoders/png/moz.build
image/src/moz.build
intl/build/Makefile.in
intl/build/moz.build
intl/chardet/src/moz.build
intl/hyphenation/src/moz.build
intl/locale/src/mac/moz.build
intl/locale/src/moz.build
intl/locale/src/nsLocaleConstructors.h
intl/locale/src/os2/moz.build
intl/locale/src/unix/moz.build
intl/locale/src/windows/moz.build
intl/lwbrk/src/moz.build
intl/strres/src/moz.build
intl/uconv/src/moz.build
intl/unicharutil/src/moz.build
intl/unicharutil/util/internal/moz.build
ipc/chromium/moz.build
ipc/dbus/moz.build
ipc/glue/moz.build
ipc/ipdl/moz.build
ipc/ipdl/test/cxx/moz.build
ipc/keystore/Makefile.in
ipc/keystore/moz.build
ipc/netd/moz.build
ipc/nfc/moz.build
ipc/ril/moz.build
ipc/testshell/moz.build
ipc/unixsocket/moz.build
js/ductwork/debugger/moz.build
js/ipc/moz.build
js/jsd/moz.build
js/xpconnect/loader/moz.build
js/xpconnect/src/Makefile.in
js/xpconnect/src/moz.build
js/xpconnect/wrappers/moz.build
layout/base/moz.build
layout/build/Makefile.in
layout/build/moz.build
layout/forms/moz.build
layout/generic/moz.build
layout/inspector/src/moz.build
layout/ipc/moz.build
layout/mathml/moz.build
layout/media/Makefile.in
layout/media/webrtc/moz.build
layout/printing/moz.build
layout/style/moz.build
layout/svg/moz.build
layout/tables/moz.build
layout/tools/layout-debug/src/moz.build
layout/xul/base/src/moz.build
layout/xul/grid/moz.build
layout/xul/tree/moz.build
media/kiss_fft/moz.build
media/libcubeb/src/moz.build
media/libjpeg/moz.build
media/libnestegg/src/moz.build
media/libogg/moz.build
media/libopus/moz.build
media/libpng/moz.build
media/libsoundtouch/src/moz.build
media/libspeex_resampler/src/moz.build
media/libtheora/lib/moz.build
media/libtremor/lib/moz.build
media/libvorbis/moz.build
media/libvpx/moz.build
media/mtransport/build/moz.build
memory/build/moz.build
mfbt/moz.build
mobile/android/components/build/moz.build
mobile/android/confvars.sh
modules/libjar/moz.build
modules/libjar/zipwriter/src/moz.build
modules/libpref/src/moz.build
mozglue/android/moz.build
mozglue/build/Makefile.in
mozglue/linker/moz.build
netwerk/base/src/moz.build
netwerk/build/Makefile.in
netwerk/build/moz.build
netwerk/cache/moz.build
netwerk/cache2/moz.build
netwerk/cookie/moz.build
netwerk/dns/moz.build
netwerk/ipc/moz.build
netwerk/mime/moz.build
netwerk/protocol/about/moz.build
netwerk/protocol/app/moz.build
netwerk/protocol/data/moz.build
netwerk/protocol/device/moz.build
netwerk/protocol/file/moz.build
netwerk/protocol/ftp/moz.build
netwerk/protocol/http/moz.build
netwerk/protocol/res/moz.build
netwerk/protocol/rtsp/moz.build
netwerk/protocol/viewsource/moz.build
netwerk/protocol/websocket/moz.build
netwerk/protocol/wyciwyg/moz.build
netwerk/sctp/datachannel/moz.build
netwerk/sctp/src/moz.build
netwerk/socket/moz.build
netwerk/srtp/src/moz.build
netwerk/streamconv/converters/moz.build
netwerk/streamconv/src/moz.build
netwerk/system/android/moz.build
netwerk/system/mac/moz.build
netwerk/system/qt/moz.build
netwerk/system/win32/moz.build
netwerk/wifi/moz.build
other-licenses/android/moz.build
other-licenses/skia-npapi/moz.build
other-licenses/snappy/moz.build
parser/expat/lib/moz.build
parser/html/moz.build
parser/htmlparser/src/Makefile.in
parser/htmlparser/src/moz.build
parser/xml/src/moz.build
rdf/base/src/moz.build
rdf/build/Makefile.in
rdf/build/moz.build
rdf/datasource/src/moz.build
rdf/util/src/internal/moz.build
security/manager/boot/src/moz.build
security/manager/pki/src/moz.build
security/manager/ssl/src/moz.build
security/sandbox/linux/moz.build
services/crypto/component/moz.build
startupcache/moz.build
storage/build/Makefile.in
storage/build/moz.build
storage/src/moz.build
toolkit/components/alerts/moz.build
toolkit/components/autocomplete/moz.build
toolkit/components/build/Makefile.in
toolkit/components/build/moz.build
toolkit/components/commandlines/moz.build
toolkit/components/ctypes/moz.build
toolkit/components/diskspacewatcher/moz.build
toolkit/components/downloads/moz.build
toolkit/components/feeds/moz.build
toolkit/components/filepicker/moz.build
toolkit/components/finalizationwitness/moz.build
toolkit/components/find/moz.build
toolkit/components/intl/moz.build
toolkit/components/jsdownloads/src/moz.build
toolkit/components/mediasniffer/moz.build
toolkit/components/parentalcontrols/moz.build
toolkit/components/perf/moz.build
toolkit/components/places/moz.build
toolkit/components/protobuf/moz.build
toolkit/components/reflect/moz.build
toolkit/components/remote/moz.build
toolkit/components/satchel/moz.build
toolkit/components/startup/moz.build
toolkit/components/statusfilter/moz.build
toolkit/components/telemetry/moz.build
toolkit/components/typeaheadfind/moz.build
toolkit/components/url-classifier/moz.build
toolkit/crashreporter/breakpad-windows-libxul/moz.build
toolkit/crashreporter/breakpad-windows-standalone/moz.build
toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build
toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build
toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
toolkit/crashreporter/google-breakpad/src/client/moz.build
toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
toolkit/crashreporter/google-breakpad/src/common/linux/moz.build
toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
toolkit/crashreporter/google-breakpad/src/common/moz.build
toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build
toolkit/crashreporter/google-breakpad/src/processor/moz.build
toolkit/crashreporter/injector/Makefile.in
toolkit/crashreporter/moz.build
toolkit/devtools/server/moz.build
toolkit/identity/moz.build
toolkit/library/Makefile.in
toolkit/mozapps/update/common/moz.build
toolkit/profile/moz.build
toolkit/system/androidproxy/moz.build
toolkit/system/osxproxy/moz.build
toolkit/system/unixproxy/moz.build
toolkit/system/windowsproxy/moz.build
toolkit/xre/Makefile.in
toolkit/xre/moz.build
tools/profiler/moz.build
tools/trace-malloc/lib/moz.build
uriloader/base/moz.build
uriloader/exthandler/moz.build
uriloader/prefetch/moz.build
view/src/moz.build
widget/android/Makefile.in
widget/android/moz.build
widget/cocoa/Makefile.in
widget/cocoa/moz.build
widget/gonk/Makefile.in
widget/gonk/moz.build
widget/gonk/nativewindow/moz.build
widget/gtk/Makefile.in
widget/gtk/moz.build
widget/gtkxtbin/moz.build
widget/os2/Makefile.in
widget/os2/moz.build
widget/qt/Makefile.in
widget/qt/faststartupqt/moz.build
widget/qt/moz.build
widget/shared/moz.build
widget/shared/x11/moz.build
widget/windows/Makefile.in
widget/windows/moz.build
widget/windows/winrt/moz.build
widget/xpwidgets/Makefile.in
widget/xpwidgets/moz.build
widget/xremoteclient/moz.build
xpcom/base/moz.build
xpcom/build/Makefile.in
xpcom/build/moz.build
xpcom/components/moz.build
xpcom/ds/moz.build
xpcom/io/moz.build
xpcom/reflect/xptcall/src/md/os2/Makefile.in
xpcom/reflect/xptcall/src/md/os2/moz.build
xpcom/reflect/xptcall/src/md/unix/Makefile.in
xpcom/reflect/xptcall/src/md/unix/moz.build
xpcom/reflect/xptcall/src/md/win32/Makefile.in
xpcom/reflect/xptcall/src/md/win32/moz.build
xpcom/reflect/xptcall/src/moz.build
xpcom/reflect/xptinfo/src/moz.build
xpcom/string/src/moz.build
xpcom/threads/moz.build
xpcom/typelib/xpt/src/moz.build
xpfe/appshell/src/moz.build
xpfe/components/build/Makefile.in
xpfe/components/build/moz.build
xpfe/components/directory/moz.build
xpfe/components/windowds/moz.build
--- a/accessible/src/atk/Makefile.in
+++ b/accessible/src/atk/Makefile.in
@@ -1,13 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXPORT_LIBRARY = ..
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_ENABLE_GTK
 CFLAGS      += $(TK_CFLAGS)
 CXXFLAGS    += $(TK_CFLAGS)
 endif
 
 ifdef MOZ_ENABLE_DBUS
--- a/accessible/src/atk/moz.build
+++ b/accessible/src/atk/moz.build
@@ -41,8 +41,9 @@ LOCAL_INCLUDES += [
     '../base',
     '../generic',
     '../html',
     '../xpcom',
     '../xul',
     '/other-licenses/atk-1.0',
 ]
 
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/base/moz.build
+++ b/accessible/src/base/moz.build
@@ -90,8 +90,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '../mac',
     ]
 else:
     LOCAL_INCLUDES += [
         '../other',
     ]
+
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/generic/moz.build
+++ b/accessible/src/generic/moz.build
@@ -51,8 +51,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '../mac',
     ]
 else:
     LOCAL_INCLUDES += [
         '../other',
     ]
+
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/html/moz.build
+++ b/accessible/src/html/moz.build
@@ -42,8 +42,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '../mac',
     ]
 else:
     LOCAL_INCLUDES += [
         '../other',
     ]
+
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/mac/Makefile.in
+++ b/accessible/src/mac/Makefile.in
@@ -1,10 +1,9 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXPORT_LIBRARY = ..
 include $(topsrcdir)/config/rules.mk
 
 ifneq ($(A11Y_LOG),0)
   DEFINES += -DA11Y_LOG
 endif
--- a/accessible/src/mac/moz.build
+++ b/accessible/src/mac/moz.build
@@ -38,8 +38,9 @@ LOCAL_INCLUDES += [
     '../html',
     '../xul',
     '/layout/generic',
     '/layout/xul/base/src',
     '/widget/cocoa',
     '/widget/xpwidgets',
 ]
 
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/other/Makefile.in
+++ b/accessible/src/other/Makefile.in
@@ -1,10 +1,9 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXPORT_LIBRARY = ..
 include $(topsrcdir)/config/rules.mk
 
 ifneq ($(A11Y_LOG),0)
   DEFINES += -DA11Y_LOG
 endif
--- a/accessible/src/other/moz.build
+++ b/accessible/src/other/moz.build
@@ -22,8 +22,9 @@ LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '../base',
     '../generic',
     '../html',
     '../xul',
 ]
 
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/windows/ia2/moz.build
+++ b/accessible/src/windows/ia2/moz.build
@@ -40,10 +40,9 @@ LOCAL_INCLUDES += [
     '../../html',
     '../../xpcom',
     '../../xul',
     '../msaa',
 ]
 
 LIBRARY_NAME = 'accessibility_toolkit_ia2_s'
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/windows/msaa/moz.build
+++ b/accessible/src/windows/msaa/moz.build
@@ -54,12 +54,11 @@ LOCAL_INCLUDES += [
     '../../xul',
     '../ia2',
     '../sdn',
     '../uia',
 ]
 
 LIBRARY_NAME = 'accessibility_toolkit_msaa_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/windows/sdn/moz.build
+++ b/accessible/src/windows/sdn/moz.build
@@ -24,10 +24,9 @@ LOCAL_INCLUDES += [
 ]
 
 # The midl generated code include Windows headers which defines min and max
 # macros which conflicts with std::min/max.  Suppress the macros:
 DEFINES['NOMINMAX'] = True
 
 LIBRARY_NAME = 'accessibility_toolkit_sdn_s'
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/windows/uia/Makefile.in
+++ b/accessible/src/windows/uia/Makefile.in
@@ -1,14 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXPORT_LIBRARY = ..
-
 # The midl generated code include Windows headers which defines min and max
 # macros which conflicts with std::min/max.  Suppress the macros:
 OS_CXXFLAGS += -DNOMINMAX
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef A11Y_LOG
   DEFINES += -DA11Y_LOG
--- a/accessible/src/windows/uia/moz.build
+++ b/accessible/src/windows/uia/moz.build
@@ -18,8 +18,9 @@ LOCAL_INCLUDES += [
     '../../html',
     '../../xpcom',
     '../../xul',
     '../msaa',
 ]
 
 LIBRARY_NAME = 'accessibility_toolkit_uia_s'
 
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/xpcom/moz.build
+++ b/accessible/src/xpcom/moz.build
@@ -43,8 +43,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '../mac',
     ]
 else:
     LOCAL_INCLUDES += [
         '../other',
     ]
+
+FINAL_LIBRARY = 'xul'
--- a/accessible/src/xul/moz.build
+++ b/accessible/src/xul/moz.build
@@ -47,8 +47,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     LOCAL_INCLUDES += [
         '../mac',
     ]
 else:
     LOCAL_INCLUDES += [
         '../other',
     ]
+
+FINAL_LIBRARY = 'xul'
--- a/browser/components/about/moz.build
+++ b/browser/components/about/moz.build
@@ -12,8 +12,10 @@ EXPORTS.mozilla.browser += [
 
 SOURCES += [
     'AboutRedirector.cpp',
 ]
 
 LIBRARY_NAME = 'browserabout_s'
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'browsercomps'
--- a/browser/components/build/Makefile.in
+++ b/browser/components/build/Makefile.in
@@ -16,38 +16,27 @@ LOCAL_INCLUDES = \
 	-I$(srcdir)/../about \
 	-I$(srcdir)/../dirprovider \
 	$(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,version)
 endif
 
-SHARED_LIBRARY_LIBS = \
-	../feeds/src/$(LIB_PREFIX)browser_feeds_s.$(LIB_SUFFIX) \
-	../about/$(LIB_PREFIX)browserabout_s.$(LIB_SUFFIX) \
-	../dirprovider/$(LIB_PREFIX)browserdir_s.$(LIB_SUFFIX) \
-	$(NULL)
-
-ifneq (,$(filter windows cocoa gtk2 gtk3, $(MOZ_WIDGET_TOOLKIT)))
-SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
-endif
-
 EXTRA_DSO_LDOPTS += \
 	$(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib) \
 	$(XPCOM_STATICRUNTIME_GLUE_LDOPTS) \
 	$(MOZ_COMPONENT_LIBS) \
 	$(NULL)
 
 ifdef JS_SHARED_LIBRARY
 EXTRA_DSO_LDOPTS += $(MOZ_JS_LIBS)
 endif
 
 LOCAL_INCLUDES += -I$(srcdir)/../migration/src
-SHARED_LIBRARY_LIBS += ../migration/src/$(LIB_PREFIX)migration_s.$(LIB_SUFFIX)
 
 # 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 gtk3,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += \
   $(TK_LIBS) \
   $(NULL)
 endif
--- a/browser/components/dirprovider/moz.build
+++ b/browser/components/dirprovider/moz.build
@@ -16,8 +16,10 @@ SOURCES += [
 
 LIBRARY_NAME = 'browserdir_s'
 
 XPCSHELL_TESTS_MANIFESTS += [
     'tests/unit/xpcshell.ini',
 ]
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'browsercomps'
--- a/browser/components/feeds/src/moz.build
+++ b/browser/components/feeds/src/moz.build
@@ -18,8 +18,10 @@ EXTRA_COMPONENTS += [
 
 EXTRA_PP_COMPONENTS += [
     'FeedWriter.js',
 ]
 
 LIBRARY_NAME = 'browser_feeds_s'
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'browsercomps'
--- a/browser/components/migration/src/moz.build
+++ b/browser/components/migration/src/moz.build
@@ -38,8 +38,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
 
 LIBRARY_NAME = 'migration_s'
 
 EXTRA_PP_JS_MODULES += [
     'MigrationUtils.jsm',
 ]
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'browsercomps'
--- a/browser/components/shell/src/moz.build
+++ b/browser/components/shell/src/moz.build
@@ -23,8 +23,10 @@ if SOURCES:
     LIBRARY_NAME = 'shellservice_s'
 
 EXTRA_COMPONENTS += [
     'nsSetDefaultBrowser.js',
     'nsSetDefaultBrowser.manifest',
 ]
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'browsercomps'
--- a/caps/src/moz.build
+++ b/caps/src/moz.build
@@ -23,8 +23,10 @@ LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LOCAL_INCLUDES += [
     '../include',
     '/dom/base',
     '/js/xpconnect/src',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/chrome/src/moz.build
+++ b/chrome/src/moz.build
@@ -20,8 +20,9 @@ SOURCES += [
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'chrome_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xpcom_core'
--- a/configure.in
+++ b/configure.in
@@ -6124,17 +6124,16 @@ if test -n "$MOZ_TREE_FREETYPE"; then
    AC_DEFINE(MOZ_TREE_FREETYPE)
    AC_SUBST(MOZ_TREE_FREETYPE)
    MOZ_ENABLE_CAIRO_FT=1
    FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
    FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
    CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
    FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
    CAIRO_FT_OSLIBS=''
-   CAIRO_FT_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
    AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
    AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
    AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
    AC_SUBST(CAIRO_FT_CFLAGS)
 fi
 
 dnl ========================================================
 dnl Installer
@@ -7949,17 +7948,16 @@ if test "$MOZ_TREE_CAIRO"; then
         fi
         ;;
       os2)
         OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
         FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
         MOZ_ENABLE_CAIRO_FT=1
         CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
         CAIRO_FT_OSLIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
-        CAIRO_FT_LIBS=""
         ;;
     esac
     if test "$USE_FC_FREETYPE"; then
         FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
     fi
     AC_SUBST(MOZ_ENABLE_CAIRO_FT)
     AC_SUBST(MOZ_ENABLE_DWRITE_FONT)
     AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
@@ -7982,17 +7980,16 @@ if test "$MOZ_TREE_CAIRO"; then
     AC_SUBST(WIN32_FONT_FEATURE)
     AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
     AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
     AC_SUBST(QUARTZ_FONT_FEATURE)
     AC_SUBST(PNG_FUNCTIONS_FEATURE)
     AC_SUBST(QT_SURFACE_FEATURE)
     AC_SUBST(TEE_SURFACE_FEATURE)
 
-    MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src)'" $CAIRO_FT_LIBS"
     MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'
 
     if test "$MOZ_X11"; then
         MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
     fi
 
     CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
 else
@@ -8010,64 +8007,35 @@ fi
 
 AC_SUBST(MOZ_TREE_CAIRO)
 AC_SUBST(MOZ_CAIRO_CFLAGS)
 AC_SUBST(MOZ_CAIRO_LIBS)
 AC_SUBST(MOZ_CAIRO_OSLIBS)
 AC_SUBST(MOZ_TREE_PIXMAN)
 
 dnl ========================================================
-dnl qcms
-dnl ========================================================
-
-QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'
-AC_SUBST(QCMS_LIBS)
-
-dnl ========================================================
-dnl HarfBuzz
-dnl ========================================================
-MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
-AC_SUBST(MOZ_HARFBUZZ_LIBS)
-
-dnl ========================================================
-dnl SIL Graphite
-dnl ========================================================
-MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
-AC_SUBST(MOZ_GRAPHITE_LIBS)
-
-dnl ========================================================
-dnl OTS
-dnl ========================================================
-MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
-AC_SUBST(MOZ_OTS_LIBS)
-
-dnl ========================================================
 dnl Skia 
 dnl ========================================================
 if test "$MOZ_ENABLE_SKIA"; then
-  MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
   AC_DEFINE(MOZ_ENABLE_SKIA)
   AC_DEFINE(USE_SKIA)
   if test "${MOZ_WIDGET_TOOLKIT}" = "android" -o x"$MOZ_WIDGET_TOOLKIT" = x"gonk"; then
     AC_DEFINE(SK_BUILD_FOR_ANDROID_NDK)
   elif test "$OS_ARCH" = "WINNT"; then
     AC_DEFINE(SKIA_DLL)
     AC_DEFINE(GR_DLL)
   fi
 
   if test "${CPU_ARCH}" != "ppc" -a "${CPU_ARCH}" != "ppc64"; then
     MOZ_ENABLE_SKIA_GPU=1
     AC_DEFINE(USE_SKIA_GPU)
     AC_SUBST(MOZ_ENABLE_SKIA_GPU)
   fi
-else
-  MOZ_SKIA_LIBS=
 fi
 AC_SUBST(MOZ_ENABLE_SKIA)
-AC_SUBST(MOZ_SKIA_LIBS)
 
 dnl ========================================================
 dnl disable xul
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(xul,
 [  --disable-xul           Disable XUL],
     MOZ_XUL= )
 if test "$MOZ_XUL"; then
--- a/content/base/src/moz.build
+++ b/content/base/src/moz.build
@@ -182,16 +182,17 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkconbase_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/caps/include',
     '/content/events/src',
     '/content/html/content/src',
     '/content/html/document/src',
     '/content/xbl/src',
     '/content/xml/content/src',
     '/content/xml/document/src',
--- a/content/canvas/src/moz.build
+++ b/content/canvas/src/moz.build
@@ -86,16 +86,17 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkconcvs_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/html/content/src',
     '/content/xul/content/src',
     '/dom/base',
     '/image/src',
     '/js/xpconnect/src',
     '/layout/generic',
--- a/content/events/src/moz.build
+++ b/content/events/src/moz.build
@@ -72,16 +72,17 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkconevents_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/html/content/src',
     '/content/xml/content/src',
     '/content/xul/content/src',
     '/dom/base',
     '/dom/settings',
     '/dom/src/storage',
--- a/content/html/content/src/moz.build
+++ b/content/html/content/src/moz.build
@@ -161,16 +161,17 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkconhtmlcon_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/canvas/src',
     '/content/events/src',
     '/content/html/document/src',
     '/content/media/',
     '/content/xbl/src',
     '/content/xul/content/src',
--- a/content/html/document/src/moz.build
+++ b/content/html/document/src/moz.build
@@ -37,8 +37,10 @@ LOCAL_INCLUDES += [
     '../../content/src',
     '/caps/include',
     '/content/base/src',
     '/content/events/src',
     '/dom/base',
     '/layout/style',
     '/xpcom/ds',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/mathml/content/src/moz.build
+++ b/content/mathml/content/src/moz.build
@@ -14,12 +14,13 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkcontentmathml_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
 ]
 
--- a/content/media/apple/moz.build
+++ b/content/media/apple/moz.build
@@ -17,8 +17,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkconapplemedia_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/directshow/moz.build
+++ b/content/media/directshow/moz.build
@@ -35,12 +35,13 @@ if not CONFIG['MOZ_WEBRTC']:
     ]]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkcondirectshow_s'
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/media/webrtc/trunk/webrtc/modules/video_capture/windows',
 ]
 
--- a/content/media/encoder/moz.build
+++ b/content/media/encoder/moz.build
@@ -24,8 +24,9 @@ if CONFIG['MOZ_OPUS']:
     UNIFIED_SOURCES += ['OpusTrackEncoder.cpp']
 
 LIBRARY_NAME = 'gkconencoder_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/gstreamer/moz.build
+++ b/content/media/gstreamer/moz.build
@@ -22,13 +22,14 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkcongstreamer_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/html/content/src',
 ]
 
--- a/content/media/mediasource/moz.build
+++ b/content/media/mediasource/moz.build
@@ -29,8 +29,9 @@ UNIFIED_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconmediasource_s'
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/moz.build
+++ b/content/media/moz.build
@@ -153,16 +153,17 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFI
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkconmedia_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/layout/generic',
     '/layout/xul/base/src',
 ]
 
 if CONFIG['MOZ_DIRECTSHOW']:
     LOCAL_INCLUDES += [
--- a/content/media/ogg/moz.build
+++ b/content/media/ogg/moz.build
@@ -21,8 +21,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkconogg_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/omx/mediaresourcemanager/moz.build
+++ b/content/media/omx/mediaresourcemanager/moz.build
@@ -14,8 +14,10 @@ SOURCES += [
     'MediaResourceManagerService.cpp',
 ]
 
 LIBRARY_NAME = 'mediaresourcemanager'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/omx/moz.build
+++ b/content/media/omx/moz.build
@@ -29,15 +29,16 @@ if 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
     ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconomx_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/html/content/src',
     '/ipc/chromium/src',
     'mediaresourcemanager',
 ]
 
--- a/content/media/plugins/moz.build
+++ b/content/media/plugins/moz.build
@@ -24,8 +24,10 @@ SOURCES += [
 LIBRARY_NAME = 'gkconmediaplugins_s'
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/html/content/src',
     ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/raw/moz.build
+++ b/content/media/raw/moz.build
@@ -22,8 +22,10 @@ LIBRARY_NAME = 'gkconraw_s'
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/html/content/src',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/wave/moz.build
+++ b/content/media/wave/moz.build
@@ -17,8 +17,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkconwave_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/webaudio/blink/moz.build
+++ b/content/media/webaudio/blink/moz.build
@@ -27,12 +27,13 @@ SOURCES += [
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconwebaudio_blink_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/media/webaudio',
 ]
 
--- a/content/media/webaudio/moz.build
+++ b/content/media/webaudio/moz.build
@@ -87,8 +87,9 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconwebaudio_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/webm/moz.build
+++ b/content/media/webm/moz.build
@@ -18,8 +18,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkconwebm_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/webrtc/moz.build
+++ b/content/media/webrtc/moz.build
@@ -42,10 +42,11 @@ UNIFIED_SOURCES += [
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconwebrtc_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 if CONFIG['OS_ARCH'] == 'WINNT':
     DEFINES['NOMINMAX'] = True
--- a/content/media/webspeech/recognition/moz.build
+++ b/content/media/webspeech/recognition/moz.build
@@ -44,8 +44,10 @@ LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconwebspeechrecognition_s'
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/webspeech/synth/moz.build
+++ b/content/media/webspeech/synth/moz.build
@@ -47,15 +47,14 @@ IPDL_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconwebspeechsynth_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     'ipc',
 ]
--- a/content/media/webspeech/synth/pico/moz.build
+++ b/content/media/webspeech/synth/pico/moz.build
@@ -8,12 +8,12 @@ MODULE = 'synthpico'
 
 SOURCES += [
     'nsPicoService.cpp',
     'PicoModule.cpp'
 ]
 
 LIBRARY_NAME = 'synthpico'
 LIBXUL_LIBRARY = True
-EXPORT_LIBRARY = True
 FAIL_ON_WARNINGS = True
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/media/wmf/moz.build
+++ b/content/media/wmf/moz.build
@@ -23,8 +23,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkconwmf_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/content/smil/moz.build
+++ b/content/smil/moz.build
@@ -67,8 +67,10 @@ LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkconsmil_s'
 
 LOCAL_INCLUDES += [
     '../base/src',
     '../events/src',
     '/layout/style',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/svg/content/src/moz.build
+++ b/content/svg/content/src/moz.build
@@ -248,16 +248,17 @@ UNIFIED_SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkcontentsvg_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/events/src',
     '/content/html/content/src',
     '/content/smil',
     '/content/xbl/src',
     '/content/xml/content/src',
     '/dom',
--- a/content/svg/document/src/moz.build
+++ b/content/svg/document/src/moz.build
@@ -24,8 +24,10 @@ LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/events/src',
     '/content/html/document/src',
     '/content/svg/content/src',
     '/content/xml/document/src',
     '/layout/style',
     '/xpcom/ds',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xbl/src/moz.build
+++ b/content/xbl/src/moz.build
@@ -50,8 +50,10 @@ LOCAL_INCLUDES += [
     '/content/html/document/src',
     '/content/xml/document/src',
     '/content/xul/content/src',
     '/content/xul/document/src',
     '/dom/base',
     '/layout/style',
     '/xpcom/ds',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xml/content/src/moz.build
+++ b/content/xml/content/src/moz.build
@@ -23,12 +23,13 @@ SOURCES += [
 LIBRARY_NAME = 'gkconxmlcon_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
 ]
 
--- a/content/xml/document/src/moz.build
+++ b/content/xml/document/src/moz.build
@@ -30,8 +30,10 @@ LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/events/src',
     '/content/html/document/src',
     '/content/xul/content/src',
     '/dom/base',
     '/layout/style',
     '/xpcom/ds',
     ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xslt/src/base/moz.build
+++ b/content/xslt/src/base/moz.build
@@ -21,8 +21,10 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '../../public',
     '../xml',
     '../xpath',
     '../xslt',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xslt/src/xml/moz.build
+++ b/content/xslt/src/xml/moz.build
@@ -18,8 +18,10 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '../base',
     '../xpath',
     '../xslt',
     '/content/base/src',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xslt/src/xpath/moz.build
+++ b/content/xslt/src/xpath/moz.build
@@ -57,8 +57,10 @@ FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '../base',
     '../xml',
     '../xslt',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xslt/src/xslt/moz.build
+++ b/content/xslt/src/xslt/moz.build
@@ -54,8 +54,10 @@ LIBXUL_LIBRARY = True
 LOCAL_INCLUDES += ["/dom/base"]
 
 LOCAL_INCLUDES += [
     '../base',
     '../xml',
     '../xpath',
     '/content/base/src',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xul/content/src/moz.build
+++ b/content/xul/content/src/moz.build
@@ -28,8 +28,10 @@ LOCAL_INCLUDES += [
     '/content/xbl/src',
     '/content/xml/content/src',
     '/content/xml/document/src',
     '/layout/generic',
     '/layout/style',
     '/layout/xul/base/src',
     '/xpcom/ds',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xul/document/src/moz.build
+++ b/content/xul/document/src/moz.build
@@ -36,8 +36,10 @@ LOCAL_INCLUDES += [
     '/content/xul/templates/src',
     '/dom/base',
     '/layout/base',
     '/layout/generic',
     '/layout/style',
     '/layout/xul/base/src',
     '/xpcom/ds',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/content/xul/templates/src/moz.build
+++ b/content/xul/templates/src/moz.build
@@ -42,8 +42,10 @@ LIBXUL_LIBRARY = True
 MSVC_ENABLE_PGO = True
 
 LOCAL_INCLUDES += [
     '../../content/src',
     '/content/base/src',
     '/dom/base',
     '/layout/xul/tree/',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/docshell/base/moz.build
+++ b/docshell/base/moz.build
@@ -67,16 +67,17 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'basedocshell_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../shistory/src',
     '/content/base/src',
     '/dom/base',
     '/layout/base',
     '/layout/generic',
     '/layout/xul/base/src',
     '/netwerk/protocol/viewsource',
--- a/docshell/build/moz.build
+++ b/docshell/build/moz.build
@@ -23,8 +23,10 @@ LOCAL_INCLUDES += [
     '../shistory/src/',
     '/uriloader/base',
     '/uriloader/exthandler',
     '/uriloader/prefetch',
     ]
 
 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
     LOCAL_INCLUDES += ['/uriloader/exthandler/mac']
+
+FINAL_LIBRARY = 'xul'
--- a/docshell/shistory/src/moz.build
+++ b/docshell/shistory/src/moz.build
@@ -23,8 +23,10 @@ FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LOCAL_INCLUDES += [
     '/docshell/base',
 ]
+
+FINAL_LIBRARY = 'xul'
--- a/dom/activities/src/moz.build
+++ b/dom/activities/src/moz.build
@@ -32,8 +32,10 @@ FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_activities_s'
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/alarm/moz.build
+++ b/dom/alarm/moz.build
@@ -36,8 +36,9 @@ EXTRA_JS_MODULES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domalarm_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/dom/apps/src/moz.build
+++ b/dom/apps/src/moz.build
@@ -39,12 +39,14 @@ EXTRA_PP_JS_MODULES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_apps_s'
 
+FINAL_LIBRARY = 'gklayout'
+
 LOCAL_INCLUDES += [
     '/js/xpconnect/wrappers',
 ]
 
--- a/dom/audiochannel/moz.build
+++ b/dom/audiochannel/moz.build
@@ -28,12 +28,11 @@ SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domaudiochannel_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -145,14 +145,16 @@ LOCAL_INCLUDES += [
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     LOCAL_INCLUDES += [
         '../fmradio',
         '../system/gonk',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
+
 LOCAL_INCLUDES += [
     '/js/xpconnect/src',
     '/js/xpconnect/wrappers',
     '/xpcom/ds',
 ]
 
--- a/dom/battery/moz.build
+++ b/dom/battery/moz.build
@@ -18,12 +18,13 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_battery_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/events/src',
 ]
 
--- a/dom/bindings/moz.build
+++ b/dom/bindings/moz.build
@@ -36,18 +36,16 @@ EXPORTS.mozilla.dom += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'dombindings_s'
 
-EXPORT_LIBRARY = True
-
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/canvas/src',
     '/content/events/src',
     '/content/html/content/src',
     '/content/html/document/src',
     '/content/media/webaudio',
     '/content/media/webspeech/recognition',
@@ -77,8 +75,10 @@ LOCAL_INCLUDES += [
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']:
     LOCAL_INCLUDES += [
         '/dom/system/gonk',
     ]
+
+FINAL_LIBRARY = 'xul'
--- a/dom/bluetooth/moz.build
+++ b/dom/bluetooth/moz.build
@@ -63,16 +63,18 @@ if CONFIG['MOZ_B2G_BT']:
             'bluez/BluetoothHfpManager.cpp',
             'bluez/linux/BluetoothDBusService.cpp',
         ]
         LOCAL_INCLUDES += [
             'bluez',
             'bluez/linux',
         ]
 
+    FINAL_LIBRARY = 'gklayout'
+
 EXPORTS.mozilla.dom.bluetooth.ipc += [
     'ipc/BluetoothMessageUtils.h',
 ]
 
 EXPORTS.mozilla.dom.bluetooth += [
     'BluetoothCommon.h',
 ]
 
--- a/dom/browser-element/moz.build
+++ b/dom/browser-element/moz.build
@@ -36,15 +36,17 @@ LIBRARY_NAME = 'dom_browserelement_s'
 
 LOCAL_INCLUDES += [
     '../bluetooth',
     '/content/html/content/src',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
+
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/dom/',
     '/dom/base',
     '/dom/ipc',
 ]
 
--- a/dom/camera/moz.build
+++ b/dom/camera/moz.build
@@ -53,8 +53,10 @@ LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domcamera_s'
 
 LOCAL_INCLUDES += [
     '../base',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/cellbroadcast/src/moz.build
+++ b/dom/cellbroadcast/src/moz.build
@@ -15,8 +15,9 @@ SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_cellbroadcast_s'
 
+FINAL_LIBRARY = 'gklayout'
--- a/dom/devicestorage/moz.build
+++ b/dom/devicestorage/moz.build
@@ -33,15 +33,16 @@ IPDL_SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domdevicestorage_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/events/src',
     '/dom/base',
     '/dom/ipc',
 ]
 
--- a/dom/encoding/moz.build
+++ b/dom/encoding/moz.build
@@ -23,12 +23,13 @@ SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domencoding_s'
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/intl/locale/src',
 ]
 
--- a/dom/file/moz.build
+++ b/dom/file/moz.build
@@ -59,8 +59,10 @@ FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domfile_s'
 
 LOCAL_INCLUDES += [
     '../base',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/fmradio/ipc/moz.build
+++ b/dom/fmradio/ipc/moz.build
@@ -24,12 +24,14 @@ LIBXUL_LIBRARY = True
 LIBRARY_NAME   = 'domfmradio_s'
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
+
 LOCAL_INCLUDES += [
     '/dom/fmradio',
 ]
 
--- a/dom/fmradio/moz.build
+++ b/dom/fmradio/moz.build
@@ -21,16 +21,18 @@ if CONFIG['MOZ_B2G_FM']:
         'FMRadio.cpp',
         'FMRadioService.cpp',
     ]
 
     LIBXUL_LIBRARY = True
 
     LIBRARY_NAME = 'domfmradio_s'
 
+    FINAL_LIBRARY = 'gklayout'
+
 IPDL_SOURCES += [
     'ipc/PFMRadio.ipdl',
     'ipc/PFMRadioRequest.ipdl',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LOCAL_INCLUDES += [
--- a/dom/gamepad/moz.build
+++ b/dom/gamepad/moz.build
@@ -19,12 +19,13 @@ SOURCES = [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domgamepad_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
--- a/dom/icc/src/moz.build
+++ b/dom/icc/src/moz.build
@@ -15,12 +15,13 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_icc_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/events/src',
 ]
 
--- a/dom/indexedDB/ipc/moz.build
+++ b/dom/indexedDB/ipc/moz.build
@@ -35,13 +35,14 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_indexeddb_ipc_s'
 
 MOCHITEST_MANIFESTS += ['mochitest.ini']
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/events/src',
     '/dom/indexedDB',
 ]
 
--- a/dom/indexedDB/moz.build
+++ b/dom/indexedDB/moz.build
@@ -65,16 +65,17 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_indexeddb_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/caps/include',
     '/content/base/src',
     '/content/events/src',
     '/db/sqlite3/src',
     '/dom/base',
     '/dom/quota',
     '/dom/src/storage',
--- a/dom/interfaces/devicestorage/moz.build
+++ b/dom/interfaces/devicestorage/moz.build
@@ -11,9 +11,8 @@ XPIDL_SOURCES += [
 
 XPIDL_MODULE = 'dom_devicestorage'
 
 MODULE = 'dom'
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domdevicestorage_s'
-
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -72,20 +72,19 @@ IPDL_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domipc_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../src/base',
     '../src/geolocation',
     '../src/storage',
     '/chrome/src',
     '/content/base/src',
     '/content/events/src',
     '/content/media/webspeech/synth/ipc',
--- a/dom/media/bridge/moz.build
+++ b/dom/media/bridge/moz.build
@@ -24,10 +24,9 @@ LOCAL_INCLUDES += [
     '/media/webrtc/signaling/src/peerconnection',
     '/media/webrtc/signaling/src/sipcc/include',
 ]
 
 LIBRARY_NAME = 'peerconnection'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -57,8 +57,10 @@ LIBXUL_LIBRARY = True
 LIBRARY_NAME = 'dom_media_s'
 
 LOCAL_INCLUDES += [
     '../base',
     '../camera',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/mobilemessage/src/moz.build
+++ b/dom/mobilemessage/src/moz.build
@@ -75,8 +75,10 @@ MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'dom_mobilemessage_s'
 
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/network/src/moz.build
+++ b/dom/network/src/moz.build
@@ -68,12 +68,13 @@ IPDL_SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_network_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/events/src',
 ]
 
--- a/dom/nfc/moz.build
+++ b/dom/nfc/moz.build
@@ -18,8 +18,10 @@ if CONFIG['MOZ_NFC']:
       'nsNfc.manifest',
     ]
 
 FAIL_ON_WARNINGS = True
 
 LIBRARY_NAME = 'dom_nfc_s'
 
 LIBXUL_LIBRARY = True
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/plugins/base/android/moz.build
+++ b/dom/plugins/base/android/moz.build
@@ -26,20 +26,19 @@ SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkpluginandroid_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/dom/plugins/base',
     '/dom/plugins/base/android/include',
     '/gfx/gl',
     '/widget/android',
     '/widget/xpwidgets',
 ]
 
--- a/dom/plugins/base/moz.build
+++ b/dom/plugins/base/moz.build
@@ -96,18 +96,16 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'andr
     FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkplugin'
 
-EXPORT_LIBRARY = True
-
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/dom/base',
     '/gfx/skia/include/config',
     '/gfx/skia/include/core',
     '/layout/generic',
     '/layout/xul/base/src',
     '/widget/android',
@@ -124,8 +122,9 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     LOCAL_INCLUDES += [
         '/xpcom/base',
     ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 DEFINES['SK_BUILD_FOR_ANDROID_NDK'] = True
 
+FINAL_LIBRARY = 'xul'
--- a/dom/plugins/ipc/moz.build
+++ b/dom/plugins/ipc/moz.build
@@ -113,19 +113,18 @@ IPDL_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domplugins_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../base',
     '/xpcom/base/',
 ]
 
 DEFINES['FORCE_PR_LOG'] = True
 
--- a/dom/power/moz.build
+++ b/dom/power/moz.build
@@ -33,8 +33,9 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_power_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/dom/promise/moz.build
+++ b/dom/promise/moz.build
@@ -24,8 +24,10 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dompromise_s'
 
 LOCAL_INCLUDES += [
     '../base',
     '../workers',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/quota/moz.build
+++ b/dom/quota/moz.build
@@ -45,12 +45,13 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'domquota_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/caps/include',
 ]
 
--- a/dom/src/events/moz.build
+++ b/dom/src/events/moz.build
@@ -17,8 +17,10 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LOCAL_INCLUDES += [
     "/content/base/src",
     "/dom/base",
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/src/geolocation/moz.build
+++ b/dom/src/geolocation/moz.build
@@ -19,16 +19,17 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'jsdomgeolocation_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/events/src',
     '/dom/base',
     '/dom/ipc',
 ]
 
 if CONFIG['MOZ_ENABLE_QTMOBILITY']:
--- a/dom/src/json/moz.build
+++ b/dom/src/json/moz.build
@@ -20,8 +20,10 @@ LIBRARY_NAME = 'json_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '/content/base/src',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/src/jsurl/moz.build
+++ b/dom/src/jsurl/moz.build
@@ -21,8 +21,10 @@ LIBRARY_NAME = 'jsurl_s'
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     "/dom/base",
     "/netwerk/base/src",
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/src/notification/moz.build
+++ b/dom/src/notification/moz.build
@@ -28,15 +28,16 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'jsdomnotification_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/events/src',
     '/dom/base',
     '/dom/ipc',
 ]
 
--- a/dom/src/offline/moz.build
+++ b/dom/src/offline/moz.build
@@ -19,8 +19,10 @@ FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     "/content/base/src",
     "/content/events/src",
     "/dom/base",
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/src/storage/moz.build
+++ b/dom/src/storage/moz.build
@@ -28,15 +28,16 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'jsdomstorage_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/events/src',
     '/dom/base',
 ]
 
 if CONFIG['ENABLE_TESTS']:
     DEFINES['DOM_STORAGE_TESTS'] = True
--- a/dom/system/android/moz.build
+++ b/dom/system/android/moz.build
@@ -12,17 +12,16 @@ SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domsystemandroid_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/content/events/src',
     '/dom/src/geolocation',
 ]
 
--- a/dom/system/gonk/moz.build
+++ b/dom/system/gonk/moz.build
@@ -124,8 +124,9 @@ LOCAL_INCLUDES += [
     '/content/events/src',
     '/dom/base',
     '/dom/bluetooth',
     '/dom/nfc',
     '/dom/src/geolocation',
     '/dom/wifi',
 ]
 
+FINAL_LIBRARY = 'gklayout'
--- a/dom/system/mac/moz.build
+++ b/dom/system/mac/moz.build
@@ -9,16 +9,15 @@ MODULE = 'dom'
 SOURCES += ['CoreLocationLocationProvider.mm']
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domsystemmac_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 LOCAL_INCLUDES += [
     '/dom/src/geolocation',
 ]
 
--- a/dom/system/moz.build
+++ b/dom/system/moz.build
@@ -49,20 +49,19 @@ if CONFIG['OS_TARGET'] != 'Android' or C
     ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domsystem_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
 # We fire the nsDOMDeviceAcceleration
 LOCAL_INCLUDES += [
     '/content/events/src',
     '/dom/base',
     '/dom/bindings',
     '/js/xpconnect/loader',
 ]
 
--- a/dom/system/unix/moz.build
+++ b/dom/system/unix/moz.build
@@ -19,12 +19,11 @@ if CONFIG['MOZ_ENABLE_QTMOBILITY']:
     ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domsystemunix_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/dom/system/windows/moz.build
+++ b/dom/system/windows/moz.build
@@ -16,10 +16,9 @@ LOCAL_INCLUDES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domsystemwindows_s'
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'gklayout'
--- a/dom/telephony/moz.build
+++ b/dom/telephony/moz.build
@@ -56,8 +56,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domtelephony_s'
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/dom/time/moz.build
+++ b/dom/time/moz.build
@@ -29,8 +29,9 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'dom_time_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/dom/voicemail/moz.build
+++ b/dom/voicemail/moz.build
@@ -26,8 +26,10 @@ FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domvoicemail_s'
 
 LOCAL_INCLUDES += [
     '../base',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/dom/wifi/moz.build
+++ b/dom/wifi/moz.build
@@ -33,10 +33,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk
         'WifiProxyService.cpp',
         'WifiUtils.cpp',
     ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'domwifi_s'
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/dom/workers/moz.build
+++ b/dom/workers/moz.build
@@ -60,8 +60,10 @@ MSVC_ENABLE_PGO = True
 
 LOCAL_INCLUDES += [
     '../base',
     '../system',
     '/content/base/src',
     '/content/events/src',
     '/xpcom/build',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/editor/composer/src/moz.build
+++ b/editor/composer/src/moz.build
@@ -18,10 +18,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'composer'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/editor/libeditor/base/moz.build
+++ b/editor/libeditor/base/moz.build
@@ -42,8 +42,10 @@ LIBXUL_LIBRARY = True
 LOCAL_INCLUDES += [
     '../text',
     '/content/base/src',
     '/content/events/src',
     '/editor/txmgr/src',
     '/extensions/spellcheck/src',
     '/layout/style',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/editor/libeditor/html/moz.build
+++ b/editor/libeditor/html/moz.build
@@ -39,8 +39,10 @@ LOCAL_INCLUDES += [
     '../text',
     '/content/base/src',
     '/editor/txmgr/src',
     '/layout/generic',
     '/layout/style',
     '/layout/tables',
     '/layout/xul/base/src',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/editor/libeditor/text/moz.build
+++ b/editor/libeditor/text/moz.build
@@ -23,8 +23,10 @@ FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '../base',
     '/content/base/src',
     '/editor/txmgr/src',
 ]
+
+FINAL_LIBRARY = 'gklayout'
--- a/editor/txmgr/src/moz.build
+++ b/editor/txmgr/src/moz.build
@@ -15,10 +15,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'txmgr'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/editor/txtsvc/src/moz.build
+++ b/editor/txtsvc/src/moz.build
@@ -12,8 +12,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'txtsvc_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
deleted file mode 100644
--- a/embedding/browser/build/Makefile.in
+++ /dev/null
@@ -1,8 +0,0 @@
-# 
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SHARED_LIBRARY_LIBS= \
-		../webBrowser/$(LIB_PREFIX)nsWebBrowser_s.$(LIB_SUFFIX) \
-		$(NULL)
--- a/embedding/browser/build/moz.build
+++ b/embedding/browser/build/moz.build
@@ -11,15 +11,14 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'webbrwsr'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../setup',
     '../webBrowser',
 ]
 
--- a/embedding/browser/webBrowser/moz.build
+++ b/embedding/browser/webBrowser/moz.build
@@ -47,13 +47,14 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'nsWebBrowser_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'webbrwsr'
 LOCAL_INCLUDES += [
     '../../../content/base/src',
     '../../../content/svg/content/src',
 ]
 
--- a/embedding/components/appstartup/src/moz.build
+++ b/embedding/components/appstartup/src/moz.build
@@ -15,8 +15,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'appstartupnotifier_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
deleted file mode 100644
--- a/embedding/components/build/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SHARED_LIBRARY_LIBS = \
-	../windowwatcher/src/$(LIB_PREFIX)windowwatcher_s.$(LIB_SUFFIX) \
-	../appstartup/src/$(LIB_PREFIX)appstartupnotifier_s.$(LIB_SUFFIX) \
-	../find/src/$(LIB_PREFIX)find_s.$(LIB_SUFFIX) \
-	../webbrowserpersist/src/$(LIB_PREFIX)webbrowserpersist_s.$(LIB_SUFFIX) \
-	../commandhandler/src/$(LIB_PREFIX)commandhandler_s.$(LIB_SUFFIX) \
-	$(NULL)
-
-ifdef MOZ_XUL
-ifdef NS_PRINTING
-SHARED_LIBRARY_LIBS += \
-	../printingui/src/$(LIB_PREFIX)printingui_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-endif
-
--- a/embedding/components/build/moz.build
+++ b/embedding/components/build/moz.build
@@ -11,18 +11,17 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'embedcomponents'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '../appstartup/src',
     '../commandhandler/src',
     '../find/src',
     '../webbrowserpersist/src',
     '../windowwatcher/src',
 ]
 
--- a/embedding/components/commandhandler/src/moz.build
+++ b/embedding/components/commandhandler/src/moz.build
@@ -15,8 +15,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'commandhandler_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
--- a/embedding/components/find/src/moz.build
+++ b/embedding/components/find/src/moz.build
@@ -12,8 +12,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'find_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
deleted file mode 100644
--- a/embedding/components/printingui/src/mac/Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-# 
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORT_LIBRARY	= ..
--- a/embedding/components/printingui/src/mac/moz.build
+++ b/embedding/components/printingui/src/mac/moz.build
@@ -16,8 +16,9 @@ LIBRARY_NAME = 'printingui_s'
 SOURCES += [
     'nsPrintingPromptServiceX.mm',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
deleted file mode 100644
--- a/embedding/components/printingui/src/os2/Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-# 
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORT_LIBRARY	= ..
--- a/embedding/components/printingui/src/os2/moz.build
+++ b/embedding/components/printingui/src/os2/moz.build
@@ -11,8 +11,9 @@ SOURCES += [
     'nsPrintProgress.cpp',
     'nsPrintProgressParams.cpp',
 ]
 
 LIBRARY_NAME = 'printingui_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
deleted file mode 100644
--- a/embedding/components/printingui/src/unixshared/Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-# 
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORT_LIBRARY	= ..
--- a/embedding/components/printingui/src/unixshared/moz.build
+++ b/embedding/components/printingui/src/unixshared/moz.build
@@ -13,8 +13,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'printingui_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
deleted file mode 100644
--- a/embedding/components/printingui/src/win/Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-# 
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORT_LIBRARY	= ..
--- a/embedding/components/printingui/src/win/moz.build
+++ b/embedding/components/printingui/src/win/moz.build
@@ -14,8 +14,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'printingui_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
--- a/embedding/components/webbrowserpersist/src/moz.build
+++ b/embedding/components/webbrowserpersist/src/moz.build
@@ -11,13 +11,14 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'webbrowserpersist_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
 LOCAL_INCLUDES += [
     '/content/base/src',
     '/content/html/content/src',
 ]
 
--- a/embedding/components/windowwatcher/src/moz.build
+++ b/embedding/components/windowwatcher/src/moz.build
@@ -17,13 +17,14 @@ if CONFIG['MOZ_XUL']:
     ]
 
 LIBRARY_NAME = 'windowwatcher_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'embedcomponents'
 # For nsJSUtils
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
--- a/extensions/auth/moz.build
+++ b/extensions/auth/moz.build
@@ -22,10 +22,9 @@ else:
     SOURCES += [
         'nsAuthSambaNTLM.cpp',
     ]
 
 LIBRARY_NAME = 'auth'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/extensions/cookie/moz.build
+++ b/extensions/cookie/moz.build
@@ -23,12 +23,11 @@ SOURCES += [
 ]
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'cookie'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/extensions/gio/moz.build
+++ b/extensions/gio/moz.build
@@ -11,10 +11,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'nkgio'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/extensions/permissions/moz.build
+++ b/extensions/permissions/moz.build
@@ -10,10 +10,9 @@ SOURCES += [
     'nsContentBlocker.cpp',
     'nsModuleFactory.cpp',
 ]
 
 LIBRARY_NAME = 'permissions'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/extensions/pref/autoconfig/src/moz.build
+++ b/extensions/pref/autoconfig/src/moz.build
@@ -12,10 +12,9 @@ SOURCES += [
     'nsJSConfigTriggers.cpp',
     'nsReadConfig.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'autoconfig'
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/extensions/spellcheck/hunspell/src/moz.build
+++ b/extensions/spellcheck/hunspell/src/moz.build
@@ -25,8 +25,9 @@ if not CONFIG['MOZ_NATIVE_HUNSPELL']:
         'replist.cpp',
         'suggestmgr.cpp',
     ]
 
 LIBRARY_NAME = 'hunspell_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'spellchecker'
--- a/extensions/spellcheck/src/Makefile.in
+++ b/extensions/spellcheck/src/Makefile.in
@@ -1,13 +1,11 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-SHARED_LIBRARY_LIBS += ../hunspell/src/$(LIB_PREFIX)hunspell_s.$(LIB_SUFFIX)
-
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
 	-I$(srcdir)/../hunspell/src \
 	-I$(topsrcdir)/content/base/src \
 	-I$(topsrcdir)/editor/libeditor/base \
 	$(NULL)
--- a/extensions/spellcheck/src/moz.build
+++ b/extensions/spellcheck/src/moz.build
@@ -16,10 +16,9 @@ SOURCES += [
     'mozSpellCheckerFactory.cpp',
     'mozSpellI18NManager.cpp',
 ]
 
 LIBRARY_NAME = 'spellchecker'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/extensions/universalchardet/src/base/moz.build
+++ b/extensions/universalchardet/src/base/moz.build
@@ -33,8 +33,9 @@ SOURCES += [
     'nsUniversalDetector.cpp',
     'nsUTF8Prober.cpp',
 ]
 
 LIBRARY_NAME = 'universalchardet_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'universalchardet'
--- a/extensions/universalchardet/src/xpcom/Makefile.in
+++ b/extensions/universalchardet/src/xpcom/Makefile.in
@@ -1,10 +1,6 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 LOCAL_INCLUDES = -I$(srcdir)/../base
-
-SHARED_LIBRARY_LIBS = \
-		../base/$(LIB_PREFIX)universalchardet_s.$(LIB_SUFFIX) \
-		$(NULL)
--- a/extensions/universalchardet/src/xpcom/moz.build
+++ b/extensions/universalchardet/src/xpcom/moz.build
@@ -10,10 +10,9 @@ SOURCES += [
     'nsUdetXPCOMWrapper.cpp',
     'nsUniversalCharDetModule.cpp',
 ]
 
 LIBRARY_NAME = 'universalchardet'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/gfx/2d/moz.build
+++ b/gfx/2d/moz.build
@@ -111,12 +111,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gfx2d'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/angle/moz.build
+++ b/gfx/angle/moz.build
@@ -121,8 +121,10 @@ UNIFIED_SOURCES += ['src/compiler/' + sr
 ]]
 
 LIBRARY_NAME = 'angle'
 LIBXUL_LIBRARY = True
 MSVC_ENABLE_PGO = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/cairo/cairo/src/moz.build
+++ b/gfx/cairo/cairo/src/moz.build
@@ -188,8 +188,9 @@ SOURCES += [
     'cairo-user-font.c',
     'cairo-version.c',
     'cairo-wideint.c',
     'cairo.c',
 ]
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/cairo/libpixman/src/moz.build
+++ b/gfx/cairo/libpixman/src/moz.build
@@ -61,8 +61,9 @@ SOURCES += [
     'pixman-x86.c',
     'pixman.c',
 ]
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'mozlibpixman'
 
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/gl/moz.build
+++ b/gfx/gl/moz.build
@@ -113,12 +113,11 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gl'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/gfx/graphite2/src/moz.build
+++ b/gfx/graphite2/src/moz.build
@@ -63,8 +63,10 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'mozgraphite2'
 
 MSVC_ENABLE_PGO = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/harfbuzz/src/moz.build
+++ b/gfx/harfbuzz/src/moz.build
@@ -56,8 +56,9 @@ SOURCES += [
     'hb-unicode.cc',
     'hb-warning.cc',
 ]
 
 LIBRARY_NAME = 'mozharfbuzz'
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/ipc/moz.build
+++ b/gfx/ipc/moz.build
@@ -27,12 +27,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
 SOURCES += [
     'SharedDIB.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gfxipc_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/gfx/layers/moz.build
+++ b/gfx/layers/moz.build
@@ -300,8 +300,9 @@ IPDL_SOURCES = [
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'layers'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'thebes'
--- a/gfx/ots/src/moz.build
+++ b/gfx/ots/src/moz.build
@@ -51,8 +51,10 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'mozots'
 
 MSVC_ENABLE_PGO = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/qcms/moz.build
+++ b/gfx/qcms/moz.build
@@ -20,8 +20,9 @@ SOURCES += [
     'iccread.c',
     'matrix.c',
     'transform.c',
     'transform_util.c',
 ]
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -586,10 +586,9 @@ if not CONFIG['INTEL_ARCHITECTURE'] and 
     ]
 
 LIBRARY_NAME = 'skia'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'gkmedias'
--- a/gfx/src/moz.build
+++ b/gfx/src/moz.build
@@ -62,10 +62,9 @@ SOURCES += [
 LIBRARY_NAME = 'gkgfx'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/gfx/thebes/Makefile.in
+++ b/gfx/thebes/Makefile.in
@@ -5,21 +5,16 @@
 LOCAL_INCLUDES += \
 	-I$(topsrcdir)/content/xml/document/src \
 	$(NULL)
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),$(findstring $(MOZ_WIDGET_TOOLKIT),android gtk2 gtk3 gonk qt))
 DEFINES += -DMOZ_ENABLE_FREETYPE
 endif
 
-SHARED_LIBRARY_LIBS += \
-	../layers/$(LIB_PREFIX)layers.$(LIB_SUFFIX) \
-	$(NULL)
-
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 
 ifdef MOZ_ENABLE_D3D9_LAYER
 DEFINES +=	-DMOZ_ENABLE_D3D9_LAYER
 endif
 
 ifdef MOZ_ENABLE_D3D10_LAYER
 DEFINES +=	-DMOZ_ENABLE_D3D10_LAYER
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -275,12 +275,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
 FAIL_ON_WARNINGS = not CONFIG['_MSC_VER']
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'thebes'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/gfx/ycbcr/moz.build
+++ b/gfx/ycbcr/moz.build
@@ -68,10 +68,9 @@ if CONFIG['CPU_ARCH'] == 'arm' and CONFI
     SOURCES += [
         'yuv_convert_arm.cpp',
     ]
 
 LIBRARY_NAME = 'ycbcr'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/hal/moz.build
+++ b/hal/moz.build
@@ -159,12 +159,11 @@ IPDL_SOURCES = [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'hal_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/image/build/Makefile.in
+++ b/image/build/Makefile.in
@@ -6,17 +6,8 @@
 LOCAL_INCLUDES	= \
 		-I. \
 		-I$(srcdir)/../src \
 		-I$(srcdir)/../encoders/ico \
 		-I$(srcdir)/../encoders/png \
 		-I$(srcdir)/../encoders/jpeg \
 		-I$(srcdir)/../encoders/bmp \
 		$(NULL)
-
-SHARED_LIBRARY_LIBS = \
-		../src/$(LIB_PREFIX)imglib2_s.$(LIB_SUFFIX) \
-		../decoders/$(LIB_PREFIX)imgdecoders_s.$(LIB_SUFFIX) \
-		../encoders/ico/$(LIB_PREFIX)imgicoe_s.$(LIB_SUFFIX) \
-		../encoders/png/$(LIB_PREFIX)imgpnge_s.$(LIB_SUFFIX) \
-		../encoders/jpeg/$(LIB_PREFIX)imgjpege_s.$(LIB_SUFFIX) \
-		../encoders/bmp/$(LIB_PREFIX)imgbmpe_s.$(LIB_SUFFIX) \
-		$(NULL)
--- a/image/build/moz.build
+++ b/image/build/moz.build
@@ -11,10 +11,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'imglib2'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/image/decoders/icon/Makefile.in
+++ b/image/decoders/icon/Makefile.in
@@ -22,11 +22,9 @@ endif
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 PLATFORM = mac
 endif
 
 ifeq ($(OS_TARGET),Android)
 PLATFORM = android
 endif
 
-SHARED_LIBRARY_LIBS = $(PLATFORM)/$(LIB_PREFIX)imgicon$(PLATFORM)_s.$(LIB_SUFFIX)
-
 LOCAL_INCLUDES	= -I$(srcdir)/$(PLATFORM)
--- a/image/decoders/icon/android/moz.build
+++ b/image/decoders/icon/android/moz.build
@@ -13,8 +13,9 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'imgiconandroid_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'imgicon'
--- a/image/decoders/icon/gtk/moz.build
+++ b/image/decoders/icon/gtk/moz.build
@@ -11,8 +11,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'imgicongtk_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'imgicon'
--- a/image/decoders/icon/mac/moz.build
+++ b/image/decoders/icon/mac/moz.build
@@ -11,8 +11,9 @@ LIBRARY_NAME = 'imgiconmac_s'
 SOURCES += [
     'nsIconChannelCocoa.mm',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'imgicon'
--- a/image/decoders/icon/moz.build
+++ b/image/decoders/icon/moz.build
@@ -17,10 +17,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'imgicon'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/image/decoders/icon/os2/moz.build
+++ b/image/decoders/icon/os2/moz.build
@@ -9,8 +9,9 @@ MODULE = 'imgicon'
 SOURCES += [
     'nsIconChannel.cpp',
 ]
 
 LIBRARY_NAME = 'imgiconos2_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'imgicon'
--- a/image/decoders/icon/qt/moz.build
+++ b/image/decoders/icon/qt/moz.build
@@ -19,8 +19,9 @@ EXTRA_COMPONENTS += [
 EXTRA_PP_COMPONENTS += [
     'gtkqticonsconverter.js',
 ]
 
 LIBRARY_NAME = 'imgiconqt_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'imgicon'
--- a/image/decoders/icon/win/moz.build
+++ b/image/decoders/icon/win/moz.build
@@ -11,8 +11,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'imgiconwin_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'imgicon'
--- a/image/decoders/moz.build
+++ b/image/decoders/moz.build
@@ -44,8 +44,10 @@ LIBXUL_LIBRARY = True
 SOURCES += [
     'iccjpeg.c',
 ]
 
 # Decoders need RasterImage.h
 LOCAL_INCLUDES += [
     '/image/src',
 ]
+
+FINAL_LIBRARY = 'imglib2'
--- a/image/encoders/bmp/moz.build
+++ b/image/encoders/bmp/moz.build
@@ -14,8 +14,10 @@ LIBRARY_NAME = 'imgbmpe_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '/image/src',
 ]
+
+FINAL_LIBRARY = 'imglib2'
--- a/image/encoders/ico/moz.build
+++ b/image/encoders/ico/moz.build
@@ -17,8 +17,10 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 # Decoders need RasterImage.h
 LOCAL_INCLUDES += [
     '../bmp',
     '../png',
     '/image/src',
 ]
+
+FINAL_LIBRARY = 'imglib2'
--- a/image/encoders/jpeg/moz.build
+++ b/image/encoders/jpeg/moz.build
@@ -11,8 +11,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'imgjpege_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'imglib2'
--- a/image/encoders/png/moz.build
+++ b/image/encoders/png/moz.build
@@ -14,8 +14,10 @@ LIBRARY_NAME = 'imgpnge_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '/image/src',
 ]
+
+FINAL_LIBRARY = 'imglib2'
--- a/image/src/moz.build
+++ b/image/src/moz.build
@@ -44,8 +44,9 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'imglib2_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'imglib2'
--- a/intl/build/Makefile.in
+++ b/intl/build/Makefile.in
@@ -1,32 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-# see also intl/locale/src/Makefile.in
-ifneq (,$(filter os2 windows, $(MOZ_WIDGET_TOOLKIT)))
-LOCALE_DIR		= $(MOZ_WIDGET_TOOLKIT)
-else
-ifeq ($(OS_ARCH), Darwin)
-LOCALE_DIR		= mac
-else
-LOCALE_DIR		= unix
-endif
-endif
-
 LOCAL_INCLUDES = \
 			-I$(srcdir)/../lwbrk/src \
 			-I$(srcdir)/../unicharutil/src \
 			-I$(srcdir)/../strres/src \
 			-I$(srcdir)/../locale/src \
 			-I$(srcdir)/../locale/src/$(LOCALE_DIR) \
 			-I$(srcdir)/../uconv/src \
 			$(NULL)
-
-SHARED_LIBRARY_LIBS = \
-			../lwbrk/src/$(LIB_PREFIX)lwbrk_s.$(LIB_SUFFIX) \
-			../unicharutil/src/$(LIB_PREFIX)ucharucomp_s.$(LIB_SUFFIX) \
-			../strres/src/$(LIB_PREFIX)strres_s.$(LIB_SUFFIX) \
-			../locale/src/$(LIB_PREFIX)nslocale_s.$(LIB_SUFFIX) \
-			../locale/src/$(LOCALE_DIR)/$(LIB_PREFIX)platlocale_s.$(LIB_SUFFIX) \
-			../hyphenation/src/$(HYPHENATION_DIR)/$(LIB_PREFIX)hyphenation_s.$(LIB_SUFFIX) \
-			$(NULL)
--- a/intl/build/moz.build
+++ b/intl/build/moz.build
@@ -9,10 +9,9 @@ MODULE = 'i18n'
 SOURCES += [
     'nsI18nModule.cpp',
 ]
 
 LIBRARY_NAME = 'i18n'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/intl/chardet/src/moz.build
+++ b/intl/chardet/src/moz.build
@@ -10,10 +10,9 @@ SOURCES += [
     'nsChardetModule.cpp',
     'nsCyrillicDetector.cpp',
 ]
 
 LIBRARY_NAME = 'chardet'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/intl/hyphenation/src/moz.build
+++ b/intl/hyphenation/src/moz.build
@@ -17,8 +17,9 @@ LIBRARY_NAME = 'hyphenation_s'
 LIBXUL_LIBRARY = True
 
 SOURCES += [
     'hyphen.c',
 ]
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'i18n'
--- a/intl/locale/src/mac/moz.build
+++ b/intl/locale/src/mac/moz.build
@@ -11,8 +11,9 @@ SOURCES += [
     'nsDateTimeFormatMac.cpp',
     'nsMacCharset.cpp',
 ]
 
 LIBRARY_NAME = 'platlocale_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'i18n'
--- a/intl/locale/src/moz.build
+++ b/intl/locale/src/moz.build
@@ -34,8 +34,9 @@ LIBRARY_NAME = 'nslocale_s'
 EXTRA_JS_MODULES += [
     'PluralForm.jsm',
 ]
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'i18n'
--- a/intl/locale/src/nsLocaleConstructors.h
+++ b/intl/locale/src/nsLocaleConstructors.h
@@ -20,34 +20,34 @@
 #define USE_MAC_LOCALE
 #endif
 
 #if defined(XP_UNIX) && !defined(XP_MACOSX)
 #define USE_UNIX_LOCALE
 #endif
 
 #ifdef XP_WIN
-#include "nsCollationWin.h"
-#include "nsDateTimeFormatWin.h"
+#include "windows/nsCollationWin.h"
+#include "windows/nsDateTimeFormatWin.h"
 #endif
 
 #ifdef XP_OS2
-#include "nsOS2Locale.h"
-#include "nsCollationOS2.h"
-#include "nsDateTimeFormatOS2.h"
+#include "os2/nsOS2Locale.h"
+#include "os2/nsCollationOS2.h"
+#include "os2/nsDateTimeFormatOS2.h"
 #endif
 
 #ifdef USE_MAC_LOCALE
-#include "nsCollationMacUC.h"
-#include "nsDateTimeFormatMac.h"
+#include "mac/nsCollationMacUC.h"
+#include "mac/nsDateTimeFormatMac.h"
 #endif
 
 #ifdef USE_UNIX_LOCALE
-#include "nsCollationUnix.h"
-#include "nsDateTimeFormatUnix.h"
+#include "unix/nsCollationUnix.h"
+#include "unix/nsDateTimeFormatUnix.h"
 #endif
 
 #define NSLOCALE_MAKE_CTOR(ctor_, iface_, func_)          \
 static nsresult                                           \
 ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) \
 {                                                         \
   *aResult = nullptr;                                      \
   if (aOuter)                                             \
--- a/intl/locale/src/os2/moz.build
+++ b/intl/locale/src/os2/moz.build
@@ -12,10 +12,9 @@ SOURCES += [
     'nsOS2Charset.cpp',
     'nsOS2Locale.cpp',
 ]
 
 LIBRARY_NAME = 'platlocale_s'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'i18n'
--- a/intl/locale/src/unix/moz.build
+++ b/intl/locale/src/unix/moz.build
@@ -20,8 +20,9 @@ else:
     SOURCES += [
         'nsUNIXCharset.cpp',
     ]
 
 LIBRARY_NAME = 'platlocale_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'i18n'
--- a/intl/locale/src/windows/moz.build
+++ b/intl/locale/src/windows/moz.build
@@ -12,8 +12,9 @@ SOURCES += [
     'nsWin32Locale.cpp',
     'nsWinCharset.cpp',
 ]
 
 LIBRARY_NAME = 'platlocale_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'i18n'
--- a/intl/lwbrk/src/moz.build
+++ b/intl/lwbrk/src/moz.build
@@ -34,8 +34,9 @@ else:
 
 
 LIBRARY_NAME = 'lwbrk_s'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'i18n'
--- a/intl/strres/src/moz.build
+++ b/intl/strres/src/moz.build
@@ -12,8 +12,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'strres_s'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'i18n'
--- a/intl/uconv/src/moz.build
+++ b/intl/uconv/src/moz.build
@@ -221,14 +221,13 @@ if CONFIG['INTEL_ARCHITECTURE']:
     ]
 
 LIBRARY_NAME = 'uconv'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
-EXPORT_LIBRARY = True
-
 LOCAL_INCLUDES += [
     '../util',
 ]
 
+FINAL_LIBRARY = 'xul'
--- a/intl/unicharutil/src/moz.build
+++ b/intl/unicharutil/src/moz.build
@@ -13,8 +13,9 @@ UNIFIED_SOURCES += [
     'nsSaveAsCharset.cpp',
     'nsUnicodeNormalizer.cpp',
 ]
 
 LIBRARY_NAME = 'ucharucomp_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'i18n'
--- a/intl/unicharutil/util/internal/moz.build
+++ b/intl/unicharutil/util/internal/moz.build
@@ -8,8 +8,10 @@ MODULE = 'unicharutil'
 
 include('../objs.mozbuild')
 
 UNIFIED_SOURCES += intl_unicharutil_util_cppsrcs
 
 LIBRARY_NAME = 'unicharutil_s'
 
 LIBXUL_LIBRARY = True
+
+FINAL_LIBRARY = 'xul'
--- a/ipc/chromium/moz.build
+++ b/ipc/chromium/moz.build
@@ -276,12 +276,11 @@ if ost.find('86') == -1 and ost.find('ar
     SOURCES += [
         'src/base/atomicops_internals_mutex.cc',
     ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'chromium_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/ipc/dbus/moz.build
+++ b/ipc/dbus/moz.build
@@ -17,12 +17,11 @@ SOURCES += [
     'DBusUtils.cpp',
     'RawDBusConnection.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'mozdbus_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/ipc/glue/moz.build
+++ b/ipc/glue/moz.build
@@ -99,12 +99,11 @@ IPDL_SOURCES = [
     'ProtocolTypes.ipdlh',
     'URIParams.ipdlh',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'mozipc_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/ipc/ipdl/moz.build
+++ b/ipc/ipdl/moz.build
@@ -10,12 +10,11 @@ if CONFIG['MOZ_IPDL_TESTS']:
 MODULE = 'ipdlgen'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'mozipdlgen_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/ipc/ipdl/test/cxx/moz.build
+++ b/ipc/ipdl/test/cxx/moz.build
@@ -120,12 +120,11 @@ IPDL_SOURCES += [
     'PTestSyncHang.ipdl',
     'PTestSyncWakeup.ipdl',
     'PTestSysVShmem.ipdl',
     'PTestUrgency.ipdl',
 ]
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
deleted file mode 100644
--- a/ipc/keystore/Makefile.in
+++ /dev/null
@@ -1,6 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORT_LIBRARY = 1
-include $(topsrcdir)/config/rules.mk
--- a/ipc/keystore/moz.build
+++ b/ipc/keystore/moz.build
@@ -16,8 +16,10 @@ SOURCES += [
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'mozkeystore_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+FINAL_LIBRARY = 'xul'
--- a/ipc/netd/moz.build
+++ b/ipc/netd/moz.build
@@ -13,12 +13,11 @@ EXPORTS.mozilla.ipc += [
 SOURCES += [
     'Netd.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'moznetd_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/ipc/nfc/moz.build
+++ b/ipc/nfc/moz.build
@@ -15,8 +15,9 @@ if CONFIG['MOZ_NFC']:
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'moznfc_s'
 
 EXPORT_LIBRARY = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/ipc/ril/moz.build
+++ b/ipc/ril/moz.build
@@ -13,12 +13,11 @@ EXPORTS.mozilla.ipc += [
 SOURCES += [
     'Ril.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'mozril_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/ipc/testshell/moz.build
+++ b/ipc/testshell/moz.build
@@ -28,12 +28,11 @@ IPDL_SOURCES = [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'ipcshell_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/ipc/unixsocket/moz.build
+++ b/ipc/unixsocket/moz.build
@@ -15,12 +15,11 @@ SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'mozipcunixsocket_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/js/ductwork/debugger/moz.build
+++ b/js/ductwork/debugger/moz.build
@@ -19,10 +19,9 @@ SOURCES += [
 LIBRARY_NAME = 'jsdebugger'
 
 EXTRA_JS_MODULES += [
     'jsdebugger.jsm',
 ]
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/js/ipc/moz.build
+++ b/js/ipc/moz.build
@@ -18,12 +18,11 @@ IPDL_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'jsipc_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/js/jsd/moz.build
+++ b/js/jsd/moz.build
@@ -35,10 +35,9 @@ DEFINES['EXPORT_JSD_API'] = True
 
 if CONFIG['JS_THREADSAFE']:
     DEFINES['JS_THREADSAFE'] = True
 
 LIBRARY_NAME = 'jsd'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/js/xpconnect/loader/moz.build
+++ b/js/xpconnect/loader/moz.build
@@ -20,8 +20,9 @@ EXTRA_JS_MODULES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'xpconnect_s'
--- a/js/xpconnect/src/Makefile.in
+++ b/js/xpconnect/src/Makefile.in
@@ -21,21 +21,16 @@ LOCAL_INCLUDES = \
 		$(NULL)
 
 ifdef MOZ_B2G_BT
 LOCAL_INCLUDES += \
     -I$(topsrcdir)/dom/bluetooth \
     $(NULL)
 endif
 
-SHARED_LIBRARY_LIBS = \
-  ../loader/$(LIB_PREFIX)jsloader_s.$(LIB_SUFFIX) \
-  ../wrappers/$(LIB_PREFIX)xpcwrappers_s.$(LIB_SUFFIX) \
-  $(NULL)
-
 EXTRA_MDDEPEND_FILES = dom_qsgen.pp dictionary_helper_gen.pp event_impl_gen.pp
 
 INSTALL_TARGETS += extra_export_files
 extra_export_files_FILES := \
   DictionaryHelpers.h \
   GeneratedEventClasses.h \
   GeneratedEvents.h \
   $(NULL)
--- a/js/xpconnect/src/moz.build
+++ b/js/xpconnect/src/moz.build
@@ -61,8 +61,9 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'xpconnect_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/js/xpconnect/wrappers/moz.build
+++ b/js/xpconnect/wrappers/moz.build
@@ -27,8 +27,9 @@ LIBRARY_NAME = 'xpcwrappers_s'
 
 # warning C4661 for FilteringWrapper
 FAIL_ON_WARNINGS = not CONFIG['_MSC_VER']
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'xpconnect_s'
--- a/layout/base/moz.build
+++ b/layout/base/moz.build
@@ -112,8 +112,9 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkbase_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -3,220 +3,35 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # Solaris sh blows
 ifeq ($(OS_ARCH),SunOS)
 SHELL := ksh
 endif
 
-SHARED_LIBRARY_LIBS = \
-	../base/$(LIB_PREFIX)gkbase_s.$(LIB_SUFFIX) \
-	../forms/$(LIB_PREFIX)gkforms_s.$(LIB_SUFFIX) \
-	../generic/$(LIB_PREFIX)gkgeneric_s.$(LIB_SUFFIX) \
-	../ipc/$(LIB_PREFIX)gkipc_s.$(LIB_SUFFIX) \
-	../style/$(LIB_PREFIX)gkstyle_s.$(LIB_SUFFIX) \
-	../tables/$(LIB_PREFIX)gktable_s.$(LIB_SUFFIX) \
-	../xul/base/src/$(LIB_PREFIX)gkxulbase_s.$(LIB_SUFFIX) \
-	../mathml/$(LIB_PREFIX)gkmathml_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/base/src/$(LIB_PREFIX)gkconbase_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/canvas/src/$(LIB_PREFIX)gkconcvs_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/events/src/$(LIB_PREFIX)gkconevents_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/html/content/src/$(LIB_PREFIX)gkconhtmlcon_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/html/document/src/$(LIB_PREFIX)gkconhtmldoc_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/media/$(LIB_PREFIX)gkconmedia_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/media/encoder/$(LIB_PREFIX)gkconencoder_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/media/webaudio/$(LIB_PREFIX)gkconwebaudio_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/media/webaudio/blink/$(LIB_PREFIX)gkconwebaudio_blink_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/media/webrtc/$(LIB_PREFIX)gkconwebrtc_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/xml/content/src/$(LIB_PREFIX)gkconxmlcon_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/xml/document/src/$(LIB_PREFIX)gkconxmldoc_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/xslt/src/base/$(LIB_PREFIX)txbase_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/xslt/src/xml/$(LIB_PREFIX)txxml_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/xslt/src/xpath/$(LIB_PREFIX)txxpath_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/xslt/src/xslt/$(LIB_PREFIX)txxslt_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/xbl/src/$(LIB_PREFIX)gkconxbl_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/xul/document/src/$(LIB_PREFIX)gkconxuldoc_s.$(LIB_SUFFIX) \
-	$(DEPTH)/view/src/$(LIB_PREFIX)gkview_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/activities/src/$(LIB_PREFIX)dom_activities_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/apps/src/$(LIB_PREFIX)dom_apps_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/base/$(LIB_PREFIX)jsdombase_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/battery/$(LIB_PREFIX)dom_battery_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/alarm/$(LIB_PREFIX)domalarm_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/devicestorage/$(LIB_PREFIX)domdevicestorage_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/encoding/$(LIB_PREFIX)domencoding_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/file/$(LIB_PREFIX)domfile_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/power/$(LIB_PREFIX)dom_power_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/quota/$(LIB_PREFIX)domquota_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/network/src/$(LIB_PREFIX)dom_network_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/media/$(LIB_PREFIX)dom_media_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/mobilemessage/src/$(LIB_PREFIX)dom_mobilemessage_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/src/events/$(LIB_PREFIX)jsdomevents_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/src/json/$(LIB_PREFIX)json_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/src/jsurl/$(LIB_PREFIX)jsurl_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/src/storage/$(LIB_PREFIX)jsdomstorage_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/src/offline/$(LIB_PREFIX)jsdomoffline_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/src/geolocation/$(LIB_PREFIX)jsdomgeolocation_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/audiochannel/$(LIB_PREFIX)domaudiochannel_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/promise/$(LIB_PREFIX)dompromise_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/src/notification/$(LIB_PREFIX)jsdomnotification_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/system/$(LIB_PREFIX)domsystem_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/telephony/$(LIB_PREFIX)domtelephony_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/workers/$(LIB_PREFIX)domworkers_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/indexedDB/$(LIB_PREFIX)dom_indexeddb_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/indexedDB/ipc/$(LIB_PREFIX)dom_indexeddb_ipc_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/browser-element/$(LIB_PREFIX)dom_browserelement_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/time/$(LIB_PREFIX)dom_time_s.$(LIB_SUFFIX) \
-	$(DEPTH)/editor/libeditor/text/$(LIB_PREFIX)texteditor_s.$(LIB_SUFFIX) \
-	$(DEPTH)/editor/libeditor/base/$(LIB_PREFIX)editorbase_s.$(LIB_SUFFIX) \
-	$(DEPTH)/parser/html/$(LIB_PREFIX)html5p_s.$(LIB_SUFFIX) \
-	$(DEPTH)/caps/src/$(LIB_PREFIX)caps_s.$(LIB_SUFFIX) \
-	$(DEPTH)/editor/libeditor/html/$(LIB_PREFIX)htmleditor_s.$(LIB_SUFFIX) \
-	$(DEPTH)/editor/txtsvc/src/$(LIB_PREFIX)txtsvc_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/mathml/content/src/$(LIB_PREFIX)gkcontentmathml_s.$(LIB_SUFFIX) \
-	$(NULL)
-
 ifneq (,$(filter qt gtk2 gtk3,$(MOZ_WIDGET_TOOLKIT)))
-SHARED_LIBRARY_LIBS += \
-	$(DEPTH)/dom/system/unix/$(LIB_PREFIX)domsystemunix_s.$(LIB_SUFFIX) \
-	$(NULL)
 LOCAL_INCLUDES	+= \
 	-I$(topsrcdir)/dom/system/unix \
 	$(NULL)
 else ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
-SHARED_LIBRARY_LIBS += \
-	$(DEPTH)/dom/system/windows/$(LIB_PREFIX)domsystemwindows_s.$(LIB_SUFFIX) \
-	$(NULL)
 LOCAL_INCLUDES	+= \
 	-I$(topsrcdir)/dom/system/windows \
 	$(NULL)
 else ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
-SHARED_LIBRARY_LIBS += \
-	$(DEPTH)/dom/system/mac/$(LIB_PREFIX)domsystemmac_s.$(LIB_SUFFIX) \
-	$(NULL)
 LOCAL_INCLUDES	+= \
 	-I$(topsrcdir)/dom/system/mac \
 	$(NULL)
 else ifneq (,$(filter android,$(MOZ_WIDGET_TOOLKIT)))
-SHARED_LIBRARY_LIBS += \
-	$(DEPTH)/dom/system/android/$(LIB_PREFIX)domsystemandroid_s.$(LIB_SUFFIX) \
-	$(DEPTH)/dom/plugins/base/android/$(LIB_PREFIX)gkpluginandroid_s.$(LIB_SUFFIX) \
-	$(NULL)
 LOCAL_INCLUDES	+= \
 	-I$(topsrcdir)/dom/system/android \
 	-I$(topsrcdir)/dom/system \
 	$(NULL)
 endif
 
-ifdef MOZ_OMX_DECODER #{
-# include OMX decoder
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/omx/$(LIB_PREFIX)gkconomx_s.$(LIB_SUFFIX) \
-	$(DEPTH)/content/media/omx/mediaresourcemanager/$(LIB_PREFIX)mediaresourcemanager.$(LIB_SUFFIX) \
-	$(NULL)
-endif #}
-
-ifdef MOZ_B2G_FM #{
-SHARED_LIBRARY_LIBS	+= \
-  $(DEPTH)/dom/fmradio/$(LIB_PREFIX)domfmradio_s.$(LIB_SUFFIX) \
-  $(DEPTH)/dom/fmradio/ipc/$(LIB_PREFIX)domfmradio_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif #}
-
-ifdef MOZ_B2G_BT #{
-SHARED_LIBRARY_LIBS += $(DEPTH)/dom/bluetooth/$(LIB_PREFIX)dombluetooth_s.$(LIB_SUFFIX)
-endif #}
-
-SHARED_LIBRARY_LIBS	+= $(DEPTH)/dom/camera/$(LIB_PREFIX)domcamera_s.$(LIB_SUFFIX)
-
-ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
-SHARED_LIBRARY_LIBS	+= \
-  $(DEPTH)/dom/system/gonk/$(LIB_PREFIX)domsystemgonk_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif #}
-
-ifdef MOZ_B2G_RIL #{
-SHARED_LIBRARY_LIBS	+= \
-  $(DEPTH)/dom/icc/src/$(LIB_PREFIX)dom_icc_s.$(LIB_SUFFIX) \
-  $(DEPTH)/dom/cellbroadcast/src/$(LIB_PREFIX)dom_cellbroadcast_s.$(LIB_SUFFIX) \
-  $(DEPTH)/dom/voicemail/$(LIB_PREFIX)domvoicemail_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif #}
-
-ifdef MOZ_OGG
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/ogg/$(LIB_PREFIX)gkconogg_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_RAW
-SHARED_LIBRARY_LIBS     += \
-       $(DEPTH)/content/media/raw/$(LIB_PREFIX)gkconraw_s.$(LIB_SUFFIX)\
-       $(NULL)
-endif
-
-ifdef MOZ_WEBM
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/webm/$(LIB_PREFIX)gkconwebm_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_WMF
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/wmf/$(LIB_PREFIX)gkconwmf_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_DIRECTSHOW
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/directshow/$(LIB_PREFIX)gkcondirectshow_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_APPLEMEDIA
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/apple/$(LIB_PREFIX)gkconapplemedia_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_WAVE
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/wave/$(LIB_PREFIX)gkconwave_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_GSTREAMER
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/gstreamer/$(LIB_PREFIX)gkcongstreamer_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_MEDIA_PLUGINS
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/plugins/$(LIB_PREFIX)gkconmediaplugins_s.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/content/media/mediasource/$(LIB_PREFIX)gkconmediasource_s.$(LIB_SUFFIX) \
-	$(NULL)
-
-ifdef MOZ_WEBSPEECH
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/content/media/webspeech/recognition/$(LIB_PREFIX)gkconwebspeechrecognition_s.$(LIB_SUFFIX) \
-  $(DEPTH)/content/media/webspeech/synth/$(LIB_PREFIX)gkconwebspeechsynth_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
-ifdef MOZ_SYNTH_PICO
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/content/media/webspeech/synth/pico/$(LIB_PREFIX)synthpico.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
 INCLUDES	+= \
 		-I$(srcdir)/../../base/src \
 		-I$(srcdir)/../../html/content/src \
 		-I$(ANDROID_SOURCE)/dalvik/libnativehelper/include/nativehelper \
 		-I$(ANDROID_SOURCE)/frameworks/base/include/ \
 		-I$(ANDROID_SOURCE)/frameworks/base/include/binder/ \
 		-I$(ANDROID_SOURCE)/frameworks/base/include/utils/ \
@@ -226,57 +41,26 @@ INCLUDES	+= \
 		$(NULL)
 
 EXTRA_DSO_LDOPTS += \
 		-lutils -lstagefright -lmedia -lstagefright_omx -lbinder -lui \
 		-lhardware -lcutils \
 		$(NULL)
 endif
 
-ifdef NS_PRINTING
-SHARED_LIBRARY_LIBS += \
-		../printing/$(LIB_PREFIX)gkprinting_s.$(LIB_SUFFIX) \
-		$(NULL)
-endif
-
-ifdef MOZ_XUL
-SHARED_LIBRARY_LIBS += \
-		../xul/tree/$(LIB_PREFIX)gkxultree_s.$(LIB_SUFFIX) \
-		../xul/grid/$(LIB_PREFIX)gkxulgrid_s.$(LIB_SUFFIX) \
-		$(DEPTH)/content/xul/content/src/$(LIB_PREFIX)gkconxulcon_s.$(LIB_SUFFIX) \
-		$(DEPTH)/content/xul/templates/src/$(LIB_PREFIX)gkconxultmpl_s.$(LIB_SUFFIX) \
-		$(NULL)
-endif
-
 LOCAL_INCLUDES  += \
       -I$(srcdir)/../inspector/src \
       $(NULL)
-SHARED_LIBRARY_LIBS += ../inspector/src/$(LIB_PREFIX)inspector_s.$(LIB_SUFFIX)
-
-SHARED_LIBRARY_LIBS += \
-		../svg/$(LIB_PREFIX)gksvgbase_s.$(LIB_SUFFIX) \
-		$(DEPTH)/content/svg/document/src/$(LIB_PREFIX)gkconsvgdoc_s.$(LIB_SUFFIX) \
-		$(DEPTH)/content/svg/content/src/$(LIB_PREFIX)gkcontentsvg_s.$(LIB_SUFFIX) \
-		$(DEPTH)/content/smil/$(LIB_PREFIX)gkconsmil_s.$(LIB_SUFFIX) \
-		$(NULL)
-
-SHARED_LIBRARY_LIBS += \
-	$(DEPTH)/js/xpconnect/src/$(LIB_PREFIX)xpconnect_s.$(LIB_SUFFIX)
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 ifdef MOZ_GSTREAMER
 EXTRA_DSO_LDOPTS += $(GSTREAMER_LIBS)
 endif
 endif
 
-ifdef MOZ_GAMEPAD
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/dom/gamepad/$(LIB_PREFIX)domgamepad_s.$(LIB_SUFFIX)
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES	+= -I$(srcdir)/../base \
 		   -I$(srcdir)/../generic \
 		   -I$(srcdir)/../forms \
 		   -I$(srcdir)/../tables \
 		   -I$(srcdir)/../style \
 		   -I$(srcdir)/../xul/base/src \
--- a/layout/build/moz.build
+++ b/layout/build/moz.build
@@ -14,29 +14,23 @@ EXPORTS += [
 
 UNIFIED_SOURCES += [
     'nsContentDLF.cpp',
     'nsLayoutModule.cpp',
     'nsLayoutStatics.cpp',
 ]
 
 if CONFIG['MOZ_NFC']:
-    SHARED_LIBRARY_LIBS += [
-        '%s/dom/nfc/%sdom_nfc_s.%s' % (TOPOBJDIR, CONFIG['LIB_PREFIX'], CONFIG['LIB_SUFFIX'])
-    ]
-
-if CONFIG['MOZ_NFC']:
     LOCAL_INCLUDES += [
         '/dom/nfc'
     ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gklayout'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/layout/forms/moz.build
+++ b/layout/forms/moz.build
@@ -40,8 +40,9 @@ UNIFIED_SOURCES += [
 LIBRARY_NAME = 'gkforms_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/generic/moz.build
+++ b/layout/generic/moz.build
@@ -106,8 +106,9 @@ FAIL_ON_WARNINGS = not CONFIG['_MSC_VER'
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkgeneric_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/inspector/src/moz.build
+++ b/layout/inspector/src/moz.build
@@ -28,8 +28,9 @@ if CONFIG['MOZ_XUL']:
     ]
 
 LIBRARY_NAME = 'inspector_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/ipc/moz.build
+++ b/layout/ipc/moz.build
@@ -22,12 +22,11 @@ IPDL_SOURCES = [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkipc_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/mathml/moz.build
+++ b/layout/mathml/moz.build
@@ -32,8 +32,9 @@ UNIFIED_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gkmathml_s'
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/media/Makefile.in
+++ b/layout/media/Makefile.in
@@ -3,114 +3,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXPORT_LIBRARY	= $(DIST)/lib
 ifeq (WINNT,$(OS_TARGET))
 FORCE_SHARED_LIB = 1
 endif
 
-SHARED_LIBRARY_LIBS = \
-    $(MOZ_OTS_LIBS) \
-    $(QCMS_LIBS) \
-    $(MOZ_GRAPHITE_LIBS) \
-    $(MOZ_HARFBUZZ_LIBS) \
-    $(NULL)
-
-ifdef MOZ_TREE_CAIRO
-SHARED_LIBRARY_LIBS += $(MOZ_CAIRO_LIBS)
-endif
-
-ifdef MOZ_TREE_PIXMAN
-SHARED_LIBRARY_LIBS += $(MOZ_PIXMAN_LIBS)
-endif
-
-ifdef MOZ_VORBIS
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libvorbis/$(LIB_PREFIX)vorbis.$(LIB_SUFFIX) \
-	$(DEPTH)/media/libogg/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_TREMOR
-SHARED_LIBRARY_LIBS	+= \
-	$(DEPTH)/media/libtremor/lib/$(LIB_PREFIX)tremor.$(LIB_SUFFIX) \
-	$(DEPTH)/media/libogg/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_OGG
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libtheora/lib/$(LIB_PREFIX)theora.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_OPUS
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/media/libopus/$(LIB_PREFIX)opus.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
-ifdef MOZ_WEBM
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libnestegg/src/$(LIB_PREFIX)nestegg.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_VP8
-ifndef MOZ_NATIVE_LIBVPX
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libvpx/$(LIB_PREFIX)vpx.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-endif
-
-ifdef MOZ_SPEEX_RESAMPLER
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libspeex_resampler/src/$(LIB_PREFIX)speex_resampler.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_SOUNDTOUCH
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libsoundtouch/src/$(LIB_PREFIX)soundtouch.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_CUBEB
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libcubeb/src/$(LIB_PREFIX)cubeb.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifndef MOZ_NATIVE_PNG
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libpng/$(LIB_PREFIX)mozpng.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifndef MOZ_NATIVE_JPEG
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libjpeg/$(LIB_PREFIX)mozjpeg.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/gfx/angle/$(LIB_PREFIX)angle.$(LIB_SUFFIX) \
-	$(DEPTH)/parser/expat/lib/$(LIB_PREFIX)mozexpat_s.$(LIB_SUFFIX) \
-	$(NULL)
-
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/gfx/2d/$(LIB_PREFIX)gfx2d.$(LIB_SUFFIX) \
-	$(NULL)
-
-ifdef MOZ_ENABLE_SKIA
-SHARED_LIBRARY_LIBS += $(MOZ_SKIA_LIBS)
-endif
-
 ifeq (WINNT,$(OS_TARGET))
 EXTRA_DSO_LDOPTS = $(MOZALLOC_LIB) $(NSPR_LIBS)
 OS_LIBS += $(call EXPAND_LIBNAME,usp10 ole32)
 DEFFILE = symbols.def
 endif
 
 include $(topsrcdir)/config/rules.mk
 
--- a/layout/media/webrtc/moz.build
+++ b/layout/media/webrtc/moz.build
@@ -1,7 +1,8 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 LIBRARY_NAME = 'webrtc'
+FINAL_LIBRARY = 'xul'
--- a/layout/printing/moz.build
+++ b/layout/printing/moz.build
@@ -23,8 +23,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkprinting_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -132,8 +132,9 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkstyle_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/svg/moz.build
+++ b/layout/svg/moz.build
@@ -49,8 +49,9 @@ UNIFIED_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'gksvgbase_s'
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/tables/moz.build
+++ b/layout/tables/moz.build
@@ -30,8 +30,9 @@ UNIFIED_SOURCES += [
 LIBRARY_NAME = 'gktable_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/tools/layout-debug/src/moz.build
+++ b/layout/tools/layout-debug/src/moz.build
@@ -23,10 +23,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkdebug'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/layout/xul/base/src/moz.build
+++ b/layout/xul/base/src/moz.build
@@ -57,8 +57,9 @@ if CONFIG['MOZ_XUL']:
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'gkxulbase_s'
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/xul/grid/moz.build
+++ b/layout/xul/grid/moz.build
@@ -31,8 +31,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkxulgrid_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/layout/xul/tree/moz.build
+++ b/layout/xul/tree/moz.build
@@ -34,8 +34,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'gkxultree_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/media/kiss_fft/moz.build
+++ b/media/kiss_fft/moz.build
@@ -15,8 +15,10 @@ SOURCES += [
     'kiss_fft.c',
     'kiss_fftr.c',
 ]
 
 LIBRARY_NAME = 'kiss_fft'
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'xul'
--- a/media/libcubeb/src/moz.build
+++ b/media/libcubeb/src/moz.build
@@ -50,8 +50,10 @@ if CONFIG['OS_TARGET'] == 'Android':
 LIBRARY_NAME = 'cubeb'
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libjpeg/moz.build
+++ b/media/libjpeg/moz.build
@@ -150,8 +150,10 @@ LIBRARY_NAME = 'mozjpeg'
 
 MSVC_ENABLE_PGO = True
 
 # need static lib for some of the libimg componentry to link properly
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libnestegg/src/moz.build
+++ b/media/libnestegg/src/moz.build
@@ -14,8 +14,10 @@ UNIFIED_SOURCES += [
 LIBRARY_NAME = 'nestegg'
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libogg/moz.build
+++ b/media/libogg/moz.build
@@ -20,8 +20,10 @@ UNIFIED_SOURCES += [
 ]
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libopus/moz.build
+++ b/media/libopus/moz.build
@@ -13,8 +13,10 @@ EXPORTS.opus += [
     'include/opus_types.h',
 ]
 
 LIBRARY_NAME = 'opus'
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libpng/moz.build
+++ b/media/libpng/moz.build
@@ -48,8 +48,10 @@ if CONFIG['MOZ_PNG_ARM_NEON']:
 LIBRARY_NAME = 'mozpng'
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libsoundtouch/src/moz.build
+++ b/media/libsoundtouch/src/moz.build
@@ -32,8 +32,10 @@ if CONFIG['INTEL_ARCHITECTURE']:
         UNIFIED_SOURCES += [
             'mmx_optimized.cpp',
         ]
 
 LIBRARY_NAME = 'soundtouch'
 
 MSVC_ENABLE_PGO = True
 NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libspeex_resampler/src/moz.build
+++ b/media/libspeex_resampler/src/moz.build
@@ -20,8 +20,10 @@ LIBRARY_NAME = 'speex_resampler'
 
 SOURCES += [
     'resample.c',
 ]
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libtheora/lib/moz.build
+++ b/media/libtheora/lib/moz.build
@@ -60,8 +60,10 @@ if CONFIG['GNU_AS']:
         ]
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libtremor/lib/moz.build
+++ b/media/libtremor/lib/moz.build
@@ -19,8 +19,10 @@ SOURCES += [
     'tremor_registry.c',
     'tremor_res012.c',
     'tremor_sharedbook.c',
     'tremor_synthesis.c',
     'tremor_window.c',
 ]
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libvorbis/moz.build
+++ b/media/libvorbis/moz.build
@@ -46,8 +46,10 @@ if CONFIG['OS_ARCH'] == 'SunOS':
     DEFINES['HAVE_ALLOCA_H'] = True
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/libvpx/moz.build
+++ b/media/libvpx/moz.build
@@ -93,8 +93,10 @@ SOURCES += [
 ]
 
 MSVC_ENABLE_PGO = True
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/media/mtransport/build/moz.build
+++ b/media/mtransport/build/moz.build
@@ -71,8 +71,10 @@ elif CONFIG['OS_TARGET'] == 'Android':
     ]
 elif CONFIG['OS_TARGET'] == 'WINNT':
     LOCAL_INCLUDES += [
         '/media/mtransport/third_party/nrappkit/src/port/win32/include',
     ]
 
 if CONFIG['OS_TARGET'] == 'WINNT':
     NO_VISIBILITY_FLAGS = True
+
+FINAL_LIBRARY = 'xul'
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -29,8 +29,13 @@ if CONFIG['MOZ_JEMALLOC3']:
 if CONFIG['MOZ_REPLACE_MALLOC']:
     SOURCES += [
         'replace_malloc.c',
     ]
 
 LIBRARY_NAME = 'memory'
 
 FORCE_STATIC_LIB = True
+
+# Keep jemalloc separated when mozglue is statically linked
+if CONFIG['MOZ_MEMORY'] and (CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') or
+                             CONFIG['MOZ_NATIVE_JEMALLOC']):
+    FINAL_LIBRARY = 'mozglue'
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -9,8 +9,10 @@ TEST_DIRS += ['tests']
 MODULE = 'mozglue'
 
 LIBRARY_NAME = 'mfbt'
 
 FORCE_STATIC_LIB = True
 
 mfbt_root = '.'
 include('common.mozbuild')
+
+FINAL_LIBRARY = 'mozglue'
--- a/mobile/android/components/build/moz.build
+++ b/mobile/android/components/build/moz.build
@@ -27,10 +27,9 @@ if CONFIG['MOZ_ANDROID_HISTORY']:
         '/content/base/src',
         '/docshell/base',
     ]
 
 LIBRARY_NAME = 'browsercomps'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/mobile/android/confvars.sh
+++ b/mobile/android/confvars.sh
@@ -31,17 +31,16 @@ fi
 MOZ_CAPTURE=1
 MOZ_RAW=1
 MOZ_PLACES=
 MOZ_SOCIAL=
 MOZ_ANDROID_HISTORY=1
 MOZ_DISABLE_EXPORT_JS=1
 
 # Needed for building our components as part of libxul
-MOZ_APP_COMPONENT_LIBS="browsercomps"
 MOZ_APP_COMPONENT_INCLUDE=nsBrowserComponents.h
 
 # use custom widget for html:select
 MOZ_USE_NATIVE_POPUP_WINDOWS=1
 
 MOZ_APP_ID={aa3c5121-dab2-40e2-81ca-7ea25febc110}
 
 MOZ_ANDROID_OMTC=1
--- a/modules/libjar/moz.build
+++ b/modules/libjar/moz.build
@@ -36,12 +36,11 @@ UNIFIED_SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/modules/libjar/zipwriter/src/moz.build
+++ b/modules/libjar/zipwriter/src/moz.build
@@ -16,10 +16,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'zipwriter'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/modules/libpref/src/moz.build
+++ b/modules/libpref/src/moz.build
@@ -15,12 +15,11 @@ SOURCES += [
 ]
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'pref'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/mozglue/android/moz.build
+++ b/mozglue/android/moz.build
@@ -17,8 +17,10 @@ SOURCES += [
     'SQLiteBridge.cpp',
 ]
 
 LIBRARY_NAME = 'android'
 
 FAIL_ON_WARNINGS = True
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'mozglue'
--- a/mozglue/build/Makefile.in
+++ b/mozglue/build/Makefile.in
@@ -6,20 +6,17 @@
 DIST_INSTALL = 1
 
 # Build mozglue as a shared lib on Windows, OSX and Android.
 # If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in
 ifneq (,$(filter WINNT Darwin Android,$(OS_TARGET)))
 FORCE_SHARED_LIB = 1
 endif
 
-# Keep jemalloc separated when mozglue is statically linked
-ifeq (1_1,$(MOZ_MEMORY)_$(or $(MOZ_NATIVE_JEMALLOC),$(FORCE_SHARED_LIB)))
-SHARED_LIBRARY_LIBS = $(call EXPAND_LIBNAME_PATH,memory,$(DEPTH)/memory/build)
-else
+ifneq (1_1,$(MOZ_MEMORY)_$(or $(MOZ_NATIVE_JEMALLOC),$(FORCE_SHARED_LIB)))
 
 ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 SDK_LIBRARY = $(IMPORT_LIBRARY)
 else
 ifdef FORCE_SHARED_LIB
 SDK_LIBRARY = $(SHARED_LIBRARY)
 else
 SDK_LIBRARY = $(REAL_LIBRARY)
@@ -76,40 +73,30 @@ EXTRA_DSO_LDOPTS += \
 ifneq ($(MOZ_REPLACE_MALLOC_LINKAGE),compiler support)
 EXTRA_DSO_LDOPTS += -flat_namespace
 endif
 ifeq ($(MOZ_REPLACE_MALLOC_LINKAGE),dummy library)
 EXTRA_DSO_LDOPTS += -Wl,-weak_library,$(DEPTH)/memory/replace/dummy/$(DLL_PREFIX)replace_malloc$(DLL_SUFFIX)
 endif
 endif
 
-ifeq (Android,$(OS_TARGET))
-SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,android,$(DEPTH)/other-licenses/android)
-endif
-
 ifeq (android, $(MOZ_WIDGET_TOOLKIT))
 # Add Android specific code
 EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
-SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,android,../android)
 # To properly wrap jemalloc's pthread_atfork call.
 EXTRA_DSO_LDOPTS += -Wl,--wrap=pthread_atfork
 endif
 
 ifdef MOZ_LINKER
-# Add custom dynamic linker
-SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,linker,../linker)
-
 ifeq (arm, $(TARGET_CPU))
 EXTRA_DSO_LDOPTS += -Wl,-version-script,$(srcdir)/arm-eabi-filter
 endif
 
 endif
 
-SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,mfbt,$(DEPTH)/mfbt)
-
 ifeq (Android, $(OS_TARGET))
 WRAP_LDFLAGS := $(filter -Wl%,$(WRAP_LDFLAGS))
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_MEMORY
 ifeq (WINNT,$(OS_TARGET))
--- a/mozglue/linker/moz.build
+++ b/mozglue/linker/moz.build
@@ -19,8 +19,10 @@ LIBRARY_NAME = 'linker'
 HOST_SOURCES += [
     'SeekableZStream.cpp',
     'szip.cpp',
 ]
 
 HOST_PROGRAM = 'szip'
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'mozglue'
--- a/netwerk/base/src/moz.build
+++ b/netwerk/base/src/moz.build
@@ -111,16 +111,17 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'neckobase_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
 LOCAL_INCLUDES += [
     '/dom/base',
 ]
 
 if 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
     LOCAL_INCLUDES += [
         '/netwerk/protocol/rtsp/controller',
         '/netwerk/protocol/rtsp/rtsp',
--- a/netwerk/build/Makefile.in
+++ b/netwerk/build/Makefile.in
@@ -1,61 +1,13 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-SHARED_LIBRARY_LIBS = \
-  ../base/src/$(LIB_PREFIX)neckobase_s.$(LIB_SUFFIX) \
-  ../dns/$(LIB_PREFIX)neckodns_s.$(LIB_SUFFIX) \
-  ../socket/$(LIB_PREFIX)neckosocket_s.$(LIB_SUFFIX) \
-  ../streamconv/src/$(LIB_PREFIX)nkconv_s.$(LIB_SUFFIX) \
-  ../streamconv/converters/$(LIB_PREFIX)nkcnvts_s.$(LIB_SUFFIX) \
-  ../mime/$(LIB_PREFIX)nkmime_s.$(LIB_SUFFIX) \
-  ../cache/$(LIB_PREFIX)nkcache_s.$(LIB_SUFFIX) \
-  ../cache2/$(LIB_PREFIX)nkcache2_s.$(LIB_SUFFIX) \
-  ../protocol/about/$(LIB_PREFIX)nkabout_s.$(LIB_SUFFIX) \
-  $(foreach d,$(filter-out about,$(NECKO_PROTOCOLS)), \
-    ../protocol/$(d)/$(LIB_PREFIX)nk$(d)_s.$(LIB_SUFFIX)) \
-  ../ipc/$(LIB_PREFIX)neckoipc_s.$(LIB_SUFFIX) \
-  $(NULL)
-
-ifdef MOZ_SRTP
-SHARED_LIBRARY_LIBS += \
-  ../srtp/src/$(LIB_PREFIX)nksrtp_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
-ifdef MOZ_SCTP
-SHARED_LIBRARY_LIBS += \
-  ../sctp/src/$(LIB_PREFIX)nksctp_s.$(LIB_SUFFIX) \
-  ../sctp/datachannel/$(LIB_PREFIX)nkdatachan_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
-ifeq ($(OS_ARCH),WINNT)
-    SHARED_LIBRARY_LIBS += \
-        ../system/win32/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
-endif
-
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-    SHARED_LIBRARY_LIBS += \
-        ../system/mac/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
-endif
-
-ifdef MOZ_ENABLE_QTNETWORK
-    SHARED_LIBRARY_LIBS += \
-        ../system/qt/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
-endif
-
-ifeq (android,$(MOZ_WIDGET_TOOLKIT))
-    SHARED_LIBRARY_LIBS += \
-        ../system/android/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
-endif
-
 LOCAL_INCLUDES = \
   -I$(srcdir)/../base/src \
   -I$(srcdir)/../dns \
   -I$(srcdir)/../socket \
   -I$(srcdir)/../streamconv/src \
   -I$(srcdir)/../streamconv/converters \
   -I$(srcdir)/../mime \
   -I$(srcdir)/../cache \
@@ -78,23 +30,17 @@ ifdef MOZ_ENABLE_QTNETWORK
     LOCAL_INCLUDES += -I$(srcdir)/../system/qt
 endif
 
 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
     LOCAL_INCLUDES += -I$(srcdir)/../system/android
 endif
 
 ifdef NECKO_COOKIES
-SHARED_LIBRARY_LIBS += \
-  ../cookie/$(LIB_PREFIX)neckocookie_s.$(LIB_SUFFIX) \
-  $(NULL)
 LOCAL_INCLUDES += -I$(srcdir)/../cookie
 endif
 
 ifdef NECKO_WIFI
-SHARED_LIBRARY_LIBS += \
-  ../wifi/$(LIB_PREFIX)neckowifi_s.$(LIB_SUFFIX) \
-  $(NULL)
 LOCAL_INCLUDES += -I$(srcdir)/../wifi
 
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/netwerk/build/moz.build
+++ b/netwerk/build/moz.build
@@ -17,12 +17,11 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'necko'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/netwerk/cache/moz.build
+++ b/netwerk/cache/moz.build
@@ -45,8 +45,9 @@ SOURCES += [
 LIBRARY_NAME = 'nkcache_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/cache2/moz.build
+++ b/netwerk/cache2/moz.build
@@ -48,8 +48,9 @@ LOCAL_INCLUDES += [
 LIBRARY_NAME = 'nkcache2_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/cookie/moz.build
+++ b/netwerk/cookie/moz.build
@@ -45,8 +45,9 @@ if CONFIG['NECKO_COOKIES'] and CONFIG['O
 IPDL_SOURCES = [
     'PCookieService.ipdl',
 ]
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
@@ -38,8 +38,9 @@ SOURCES += [
 LIBRARY_NAME = 'neckodns_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/ipc/moz.build
+++ b/netwerk/ipc/moz.build
@@ -39,12 +39,11 @@ IPDL_SOURCES = [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'neckoipc_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/mime/moz.build
+++ b/netwerk/mime/moz.build
@@ -23,8 +23,9 @@ SOURCES += [
 LIBRARY_NAME = 'nkmime_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/about/moz.build
+++ b/netwerk/protocol/about/moz.build
@@ -27,8 +27,9 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'nkabout_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/app/moz.build
+++ b/netwerk/protocol/app/moz.build
@@ -11,8 +11,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'nkapp_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/data/moz.build
+++ b/netwerk/protocol/data/moz.build
@@ -12,8 +12,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'nkdata_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/device/moz.build
+++ b/netwerk/protocol/device/moz.build
@@ -23,8 +23,9 @@ UNIFIED_SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'nkdevice_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/file/moz.build
+++ b/netwerk/protocol/file/moz.build
@@ -21,8 +21,9 @@ UNIFIED_SOURCES += [
 LIBRARY_NAME = 'nkfile_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/ftp/moz.build
+++ b/netwerk/protocol/ftp/moz.build
@@ -39,8 +39,9 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'nkftp_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/http/moz.build
+++ b/netwerk/protocol/http/moz.build
@@ -98,8 +98,9 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'nkhttp_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/res/moz.build
+++ b/netwerk/protocol/res/moz.build
@@ -21,8 +21,9 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'nkres_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/rtsp/moz.build
+++ b/netwerk/protocol/rtsp/moz.build
@@ -44,8 +44,10 @@ FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'nkrtsp_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/viewsource/moz.build
+++ b/netwerk/protocol/viewsource/moz.build
@@ -18,8 +18,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'nkviewsource_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/websocket/moz.build
+++ b/netwerk/protocol/websocket/moz.build
@@ -36,8 +36,9 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'nkwebsocket_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/protocol/wyciwyg/moz.build
+++ b/netwerk/protocol/wyciwyg/moz.build
@@ -32,8 +32,9 @@ IPDL_SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'nkwyciwyg_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/sctp/datachannel/moz.build
+++ b/netwerk/sctp/datachannel/moz.build
@@ -21,8 +21,9 @@ SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'nkdatachan_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/sctp/src/moz.build
+++ b/netwerk/sctp/src/moz.build
@@ -46,8 +46,9 @@ if CONFIG['OS_TARGET'] == 'Android':
     ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'nksctp_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/socket/moz.build
+++ b/netwerk/socket/moz.build
@@ -24,8 +24,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'neckosocket_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/srtp/src/moz.build
+++ b/netwerk/srtp/src/moz.build
@@ -36,8 +36,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'nksrtp_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/streamconv/converters/moz.build
+++ b/netwerk/streamconv/converters/moz.build
@@ -31,8 +31,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'coco
 LIBRARY_NAME = 'nkcnvts_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/streamconv/src/moz.build
+++ b/netwerk/streamconv/src/moz.build
@@ -13,8 +13,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'nkconv_s'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/system/android/moz.build
+++ b/netwerk/system/android/moz.build
@@ -11,8 +11,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'neckosystem_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/system/mac/moz.build
+++ b/netwerk/system/mac/moz.build
@@ -11,8 +11,9 @@ LIBRARY_NAME = 'neckosystem_s'
 SOURCES += [
     'nsNetworkLinkService.mm',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/system/qt/moz.build
+++ b/netwerk/system/qt/moz.build
@@ -16,8 +16,9 @@ GENERATED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'neckosystem_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/system/win32/moz.build
+++ b/netwerk/system/win32/moz.build
@@ -12,8 +12,9 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     ]
 
 LIBRARY_NAME = 'neckosystem_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/netwerk/wifi/moz.build
+++ b/netwerk/wifi/moz.build
@@ -51,8 +51,9 @@ if CONFIG['NECKO_WIFI_DBUS']:
     UNIFIED_SOURCES += [
         'nsWifiScannerDBus.cpp',
     ]
 
 LIBRARY_NAME = 'neckowifi_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'necko'
--- a/other-licenses/android/moz.build
+++ b/other-licenses/android/moz.build
@@ -23,8 +23,10 @@ SOURCES += [
     'res_debug.c',
     'res_init.c',
     'res_mkquery.c',
     'res_send.c',
     'res_state.c',
 ]
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'mozglue'
--- a/other-licenses/skia-npapi/moz.build
+++ b/other-licenses/skia-npapi/moz.build
@@ -17,10 +17,9 @@ SOURCES += [
     'ANPTypeface.cpp',
     'SkANP.cpp',
 ]
 
 LIBRARY_NAME = 'skia_npapi'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/other-licenses/snappy/moz.build
+++ b/other-licenses/snappy/moz.build
@@ -16,10 +16,9 @@ SOURCES += [
     'src/snappy-stubs-internal.cc',
     'src/snappy.cc',
 ]
 
 LIBRARY_NAME = 'snappy_s'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/parser/expat/lib/moz.build
+++ b/parser/expat/lib/moz.build
@@ -18,8 +18,10 @@ SOURCES += [
     'xmlrole.c',
     'xmltok.c',
 ]
 
 MSVC_ENABLE_PGO = True
 
 # We want only the static lib, not the shared lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'gkmedias'
--- a/parser/html/moz.build
+++ b/parser/html/moz.build
@@ -84,8 +84,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'html5p_s'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'gklayout'
deleted file mode 100644
--- a/parser/htmlparser/src/Makefile.in
+++ /dev/null
@@ -1,7 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SHARED_LIBRARY_LIBS = \
-		$(DEPTH)/parser/xml/src/$(LIB_PREFIX)saxp.$(LIB_SUFFIX) \
-		$(NULL)
--- a/parser/htmlparser/src/moz.build
+++ b/parser/htmlparser/src/moz.build
@@ -23,10 +23,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBRARY_NAME = 'htmlpars'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/parser/xml/src/moz.build
+++ b/parser/xml/src/moz.build
@@ -19,8 +19,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'saxp'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'htmlpars'
--- a/rdf/base/src/moz.build
+++ b/rdf/base/src/moz.build
@@ -22,8 +22,9 @@ SOURCES += [
     'rdfTriplesSerializer.cpp',
     'rdfutil.cpp',
 ]
 
 LIBRARY_NAME = 'rdfbase_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'rdf'
--- a/rdf/build/Makefile.in
+++ b/rdf/build/Makefile.in
@@ -1,17 +1,12 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-SHARED_LIBRARY_LIBS = \
-		../base/src/$(LIB_PREFIX)rdfbase_s.$(LIB_SUFFIX) \
-		../datasource/src/$(LIB_PREFIX)rdfdatasource_s.$(LIB_SUFFIX) \
-		$(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES	= \
 		-I$(srcdir)/../base/src \
 		-I$(srcdir)/../content/src \
 		-I$(srcdir)/../datasource/src \
 		$(NULL)
--- a/rdf/build/moz.build
+++ b/rdf/build/moz.build
@@ -13,10 +13,9 @@ EXPORTS += [
 SOURCES += [
     'nsRDFModule.cpp',
 ]
 
 LIBRARY_NAME = 'rdf'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/rdf/datasource/src/moz.build
+++ b/rdf/datasource/src/moz.build
@@ -10,8 +10,9 @@ SOURCES += [
     'nsFileSystemDataSource.cpp',
     'nsLocalStore.cpp',
 ]
 
 LIBRARY_NAME = 'rdfdatasource_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'rdf'
--- a/rdf/util/src/internal/moz.build
+++ b/rdf/util/src/internal/moz.build
@@ -8,8 +8,10 @@ MODULE = 'rdfutil'
 
 include('../objs.mozbuild')
 
 SOURCES += rdf_util_src_cppsrcs
 
 LIBRARY_NAME = 'rdfutil_s'
 
 LIBXUL_LIBRARY = True
+
+FINAL_LIBRARY = 'xul'
--- a/security/manager/boot/src/moz.build
+++ b/security/manager/boot/src/moz.build
@@ -18,10 +18,9 @@ SOURCES += [
 LIBRARY_NAME = 'pipboot'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/security/manager/pki/src/moz.build
+++ b/security/manager/pki/src/moz.build
@@ -16,10 +16,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'pippki'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/security/manager/ssl/src/moz.build
+++ b/security/manager/ssl/src/moz.build
@@ -86,10 +86,9 @@ if CONFIG['MOZ_XUL']:
 LIBRARY_NAME = 'pipnss'
 
 SOURCES += [
     'md4.c',
 ]
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
@@ -15,12 +15,11 @@ EXPORTS.mozilla += [
 SOURCES += [
     'Sandbox.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'sandbox_s'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/services/crypto/component/moz.build
+++ b/services/crypto/component/moz.build
@@ -19,10 +19,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'services-crypto'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/startupcache/moz.build
+++ b/startupcache/moz.build
@@ -23,10 +23,9 @@ SOURCES += [
     'StartupCacheModule.cpp',
     'StartupCacheUtils.cpp',
 ]
 
 LIBRARY_NAME = 'startupcache'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/storage/build/Makefile.in
+++ b/storage/build/Makefile.in
@@ -1,12 +1,8 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 LOCAL_INCLUDES = \
 	$(SQLITE_CFLAGS) \
 	-I$(srcdir)/../src
-
-SHARED_LIBRARY_LIBS = \
-	../src/$(LIB_PREFIX)storage_s.$(LIB_SUFFIX) \
-	$(NULL)
--- a/storage/build/moz.build
+++ b/storage/build/moz.build
@@ -13,10 +13,9 @@ EXPORTS += [
 SOURCES += [
     'mozStorageModule.cpp',
 ]
 
 LIBRARY_NAME = 'storagecomps'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/storage/src/moz.build
+++ b/storage/src/moz.build
@@ -40,8 +40,9 @@ SOURCES += [
     'mozStorageBindingParams.cpp',
     'mozStorageConnection.cpp',
 ]
 
 LIBRARY_NAME = 'storage_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'storagecomps'
--- a/toolkit/components/alerts/moz.build
+++ b/toolkit/components/alerts/moz.build
@@ -18,8 +18,9 @@ SOURCES += [
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'alerts_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/autocomplete/moz.build
+++ b/toolkit/components/autocomplete/moz.build
@@ -23,10 +23,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'tkautocomplete'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/build/Makefile.in
+++ b/toolkit/components/build/Makefile.in
@@ -13,37 +13,15 @@ LOCAL_INCLUDES = \
   -I$(srcdir)/../protobuf \
   -I$(srcdir)/../startup \
   -I$(srcdir)/../statusfilter \
   -I$(srcdir)/../typeaheadfind \
   -I$(srcdir)/../url-classifier \
   -I$(srcdir)/../../xre \
   $(NULL)
 
-SHARED_LIBRARY_LIBS = \
-  ../alerts/$(LIB_PREFIX)alerts_s.$(LIB_SUFFIX) \
-  ../find/$(LIB_PREFIX)mozfind_s.$(LIB_SUFFIX) \
-  ../typeaheadfind/$(LIB_PREFIX)fastfind_s.$(LIB_SUFFIX) \
-  ../startup/$(LIB_PREFIX)appstartup_s.$(LIB_SUFFIX) \
-  ../statusfilter/$(LIB_PREFIX)mozbrwsr_s.$(LIB_SUFFIX) \
-  ../downloads/$(LIB_PREFIX)download_s.$(LIB_SUFFIX) \
-  ../jsdownloads/src/$(LIB_PREFIX)jsdownloads_s.$(LIB_SUFFIX) \
-  ../protobuf/$(LIB_PREFIX)protobuf_s.$(LIB_SUFFIX) \
-  ../intl/$(LIB_PREFIX)intl_s.$(LIB_SUFFIX) \
-  ../finalizationwitness/$(LIB_PREFIX)finalizationwitness_s.$(LIB_SUFFIX) \
-  $(NULL)
-
 ifndef MOZ_DISABLE_PARENTAL_CONTROLS
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-SHARED_LIBRARY_LIBS += ../parentalcontrols/$(LIB_PREFIX)parentalcontrols_s.$(LIB_SUFFIX)
 LOCAL_INCLUDES += \
   -I$(srcdir)/../parentalcontrols \
   $(NULL)
 endif
 endif
-
-ifdef MOZ_URL_CLASSIFIER
-SHARED_LIBRARY_LIBS += ../url-classifier/$(LIB_PREFIX)urlclassifier_s.$(LIB_SUFFIX)
-endif
-
-ifdef MOZ_FEEDS
-SHARED_LIBRARY_LIBS += ../feeds/$(LIB_PREFIX)feed_s.$(LIB_SUFFIX)
-endif
--- a/toolkit/components/build/moz.build
+++ b/toolkit/components/build/moz.build
@@ -13,10 +13,9 @@ EXPORTS += [
 SOURCES += [
     'nsToolkitCompsModule.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'toolkitcomps'
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/commandlines/moz.build
+++ b/toolkit/components/commandlines/moz.build
@@ -20,10 +20,9 @@ MODULE = 'toolkitcomps'
 SOURCES += [
     'nsCommandLine.cpp',
 ]
 
 LIBRARY_NAME = 'commandlines'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/ctypes/moz.build
+++ b/toolkit/components/ctypes/moz.build
@@ -19,10 +19,9 @@ LOCAL_INCLUDES += [
 LIBRARY_NAME = 'jsctypes'
 
 EXTRA_JS_MODULES += [
     'ctypes.jsm',
 ]
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/diskspacewatcher/moz.build
+++ b/toolkit/components/diskspacewatcher/moz.build
@@ -18,12 +18,11 @@ MODULE = 'toolkitcomps'
 SOURCES = [
     'DiskSpaceWatcher.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'diskspacewatcher'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
@@ -41,8 +41,9 @@ if not CONFIG['MOZ_SUITE']:
     ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'download_s'
 
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/feeds/moz.build
+++ b/toolkit/components/feeds/moz.build
@@ -25,8 +25,9 @@ EXTRA_COMPONENTS += [
     'FeedProcessor.js',
     'FeedProcessor.manifest',
 ]
 
 LIBRARY_NAME = 'feed_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/filepicker/moz.build
+++ b/toolkit/components/filepicker/moz.build
@@ -2,17 +2,16 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if CONFIG['MOZ_XUL'] and \
     CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('android', 'qt', 'os2', 'cocoa', 'windows'):
         LIBXUL_LIBRARY = True
-        EXPORT_LIBRARY = True
         MODULE = 'filepicker'
         LIBRARY_NAME = 'fileview'
         XPIDL_SOURCES += [
             'nsIFileView.idl',
         ]
         SOURCES += [
             'nsFileView.cpp',
         ]
@@ -20,8 +19,9 @@ if CONFIG['MOZ_XUL'] and \
             'nsFilePicker.js',
         ]
         EXTRA_PP_COMPONENTS += [
             'nsFilePicker.manifest',
         ]
         DIRS += [
             'test',
         ]
+        FINAL_LIBRARY = 'xul'
--- a/toolkit/components/finalizationwitness/moz.build
+++ b/toolkit/components/finalizationwitness/moz.build
@@ -21,8 +21,10 @@ EXPORTS.mozilla += [
 ]
 
 LOCAL_INCLUDES += [
     '/js/xpconnect/loader',
 ]
 
 LIBRARY_NAME = 'finalizationwitness_s'
 LIBXUL_LIBRARY = True
+
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/find/moz.build
+++ b/toolkit/components/find/moz.build
@@ -13,8 +13,9 @@ MODULE = 'mozfind'
 SOURCES += [
     'nsFindService.cpp',
 ]
 
 LIBRARY_NAME = 'mozfind_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/intl/moz.build
+++ b/toolkit/components/intl/moz.build
@@ -9,8 +9,9 @@ MODULE = 'intl'
 SOURCES += [
     'nsCharsetMenu.cpp',
 ]
 
 LIBRARY_NAME = 'intl_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/jsdownloads/src/moz.build
+++ b/toolkit/components/jsdownloads/src/moz.build
@@ -26,8 +26,10 @@ EXTRA_JS_MODULES += [
     'Downloads.jsm',
     'DownloadStore.jsm',
 ]
 
 EXTRA_PP_JS_MODULES += [
     'DownloadIntegration.jsm',
     'DownloadUIHelper.jsm',
 ]
+
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/mediasniffer/moz.build
+++ b/toolkit/components/mediasniffer/moz.build
@@ -20,10 +20,9 @@ SOURCES += [
 SOURCES += [
     'mp3sniff.c',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'mediasniffer'
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/parentalcontrols/moz.build
+++ b/toolkit/components/parentalcontrols/moz.build
@@ -11,8 +11,9 @@ XPIDL_SOURCES += [
 MODULE = 'parentalcontrols'
 
 if not CONFIG['MOZ_DISABLE_PARENTAL_CONTROLS'] and CONFIG['OS_ARCH'] == 'WINNT':
     LIBXUL_LIBRARY = True
     LIBRARY_NAME = 'parentalcontrols_s'
     SOURCES += [
         'nsParentalControlsServiceWin.cpp',
     ]
+    FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/perf/moz.build
+++ b/toolkit/components/perf/moz.build
@@ -15,10 +15,9 @@ LIBRARY_NAME = 'jsperf'
 EXTRA_JS_MODULES += [
     'PerfMeasurement.jsm',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/places/moz.build
+++ b/toolkit/components/places/moz.build
@@ -10,17 +10,16 @@ if CONFIG['MOZ_PLACES']:
 XPIDL_SOURCES += [
     'nsINavHistoryService.idl',
 ]
 
 MODULE = 'places'
 
 if CONFIG['MOZ_PLACES']:
     LIBXUL_LIBRARY = True
-    EXPORT_LIBRARY = True
     MSVC_ENABLE_PGO = True
     LIBRARY_NAME = 'places'
 
     XPIDL_SOURCES += [
         'mozIAsyncFavicons.idl',
         'mozIAsyncHistory.idl',
         'mozIAsyncLivemarks.idl',
         'mozIColorAnalyzer.idl',
@@ -84,10 +83,11 @@ if CONFIG['MOZ_PLACES']:
         'PlacesCategoriesStarter.js',
         'toolkitplaces.manifest',
     ]
     if CONFIG['MOZ_XUL']:
         EXTRA_COMPONENTS += [
             'nsPlacesAutoComplete.js',
             'nsPlacesAutoComplete.manifest',
         ]
+    FINAL_LIBRARY = 'xul'
+
 include('/ipc/chromium/chromium-config.mozbuild')
-
--- a/toolkit/components/protobuf/moz.build
+++ b/toolkit/components/protobuf/moz.build
@@ -43,8 +43,10 @@ SOURCES += [
     'google/protobuf/stubs/common.cc',
     'google/protobuf/stubs/once.cc',
     'google/protobuf/wire_format_lite.cc',
 ]
 
 LIBRARY_NAME = 'protobuf_s'
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/reflect/moz.build
+++ b/toolkit/components/reflect/moz.build
@@ -13,10 +13,9 @@ SOURCES += [
 LIBRARY_NAME = 'jsreflect'
 
 EXTRA_JS_MODULES += [
     'reflect.jsm',
 ]
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/remote/moz.build
+++ b/toolkit/components/remote/moz.build
@@ -24,10 +24,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt
     SOURCES += [
         'nsQtRemoteService.cpp',
     ]
 
 LIBRARY_NAME = 'remoteservice'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/satchel/moz.build
+++ b/toolkit/components/satchel/moz.build
@@ -41,10 +41,9 @@ EXTRA_JS_MODULES += [
 ]
 
 EXTRA_PP_JS_MODULES += [
     'FormHistory.jsm',
 ]
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/startup/moz.build
+++ b/toolkit/components/startup/moz.build
@@ -37,8 +37,9 @@ else:
     SOURCES += [
         'nsUserInfoUnix.cpp',
     ]
 
 LIBRARY_NAME = 'appstartup_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/statusfilter/moz.build
+++ b/toolkit/components/statusfilter/moz.build
@@ -9,8 +9,9 @@ MODULE = 'browser'
 SOURCES += [
     'nsBrowserStatusFilter.cpp',
 ]
 
 LIBRARY_NAME = 'mozbrwsr_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/telemetry/moz.build
+++ b/toolkit/components/telemetry/moz.build
@@ -39,12 +39,11 @@ EXTRA_JS_MODULES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'telemetry'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/toolkit/components/typeaheadfind/moz.build
+++ b/toolkit/components/typeaheadfind/moz.build
@@ -13,8 +13,9 @@ MODULE = 'fastfind'
 SOURCES += [
     'nsTypeAheadFind.cpp',
 ]
 
 LIBRARY_NAME = 'fastfind_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/components/url-classifier/moz.build
+++ b/toolkit/components/url-classifier/moz.build
@@ -54,8 +54,10 @@ EXPORTS += [
     'nsUrlClassifierPrefixSet.h',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
+
+FINAL_LIBRARY = 'toolkitcomps'
--- a/toolkit/crashreporter/breakpad-windows-libxul/moz.build
+++ b/toolkit/crashreporter/breakpad-windows-libxul/moz.build
@@ -6,8 +6,10 @@
 
 SOURCES += [
     '../google-breakpad/src/common/windows/http_upload.cc',
 ]
 
 LIBRARY_NAME = 'google_breakpad_libxul_s'
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/breakpad-windows-standalone/moz.build
+++ b/toolkit/crashreporter/breakpad-windows-standalone/moz.build
@@ -2,8 +2,10 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 LIBRARY_NAME = 'google_breakpad_standalone_s'
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'breakpadinjector'
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build
@@ -10,8 +10,10 @@ SOURCES += [
     'crash_generation_client.cc',
     'crash_generation_server.cc',
 ]
 
 LIBRARY_NAME = 'crash_generation_s'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
@@ -13,8 +13,10 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'exception_handler_s'
 
 XPI_NAME = 'crashreporter'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build
@@ -13,8 +13,10 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'minidump_writer_s'
 
 XPI_NAME = 'crashreporter'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
@@ -12,8 +12,10 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'crash_generation_s'
 
 XPI_NAME = 'crashreporter'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
@@ -14,8 +14,10 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'exception_handler_s'
 
 XPI_NAME = 'crashreporter'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/client/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/moz.build
@@ -11,8 +11,10 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'minidump_file_writer_s'
 
 XPI_NAME = 'crashreporter'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
@@ -13,8 +13,10 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'exception_handler_s'
 
 XPI_NAME = 'crashreporter'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build
@@ -31,8 +31,10 @@ if CONFIG['MOZ_CRASHREPORTER']:
         'linux_libc_support.cc',
         'memory_mapped_file.cc',
     ]
 
 LIBRARY_NAME = 'breakpad_linux_common_s'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
@@ -31,8 +31,10 @@ SOURCES += [
     'HTTPMultipartUpload.m',
     'MachIPC.mm',
 ]
 
 LIBRARY_NAME = 'breakpad_mac_common_s'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/common/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/moz.build
@@ -81,8 +81,10 @@ if CONFIG['OS_TARGET'] == 'Android':
     ]
 
 LIBRARY_NAME = 'breakpad_common_s'
 
 MSVC_ENABLE_PGO = True
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build
@@ -21,8 +21,10 @@ LIBRARY_NAME = 'breakpad_solaris_common_
 HOST_SOURCES += [
     'dump_symbols.cc',
     'file_id.cc',
     'guid_creator.cc',
 ]
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/google-breakpad/src/processor/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/processor/moz.build
@@ -22,8 +22,10 @@ SOURCES += [
     'stackwalker_x86.cc',
     'tokenize.cc',
 ]
 
 LIBRARY_NAME = 'breakpad_sps_common_s'
 
 # need static lib
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/crashreporter/injector/Makefile.in
+++ b/toolkit/crashreporter/injector/Makefile.in
@@ -2,18 +2,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 FORCE_SHARED_LIB = 1
 USE_STATIC_LIBS = 1
 STL_FLAGS =
 MOZ_GLUE_LDFLAGS =
 
-SHARED_LIBRARY_LIBS += ../breakpad-windows-standalone/$(LIB_PREFIX)google_breakpad_standalone_s.$(LIB_SUFFIX)
-
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src
 ifndef GNU_CC
 LDFLAGS += -ENTRY:DummyEntryPoint
 else
 LDFLAGS += -Wl,-e,_DummyEntryPoint@12
 endif
--- a/toolkit/crashreporter/moz.build
+++ b/toolkit/crashreporter/moz.build
@@ -81,8 +81,9 @@ EXTRA_JS_MODULES += [
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'exception_handler_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/devtools/server/moz.build
+++ b/toolkit/devtools/server/moz.build
@@ -15,10 +15,9 @@ MODULE = 'jsinspector'
 SOURCES += [
     'nsJSInspector.cpp',
 ]
 
 LIBRARY_NAME = 'jsinspector'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/identity/moz.build
+++ b/toolkit/identity/moz.build
@@ -31,10 +31,9 @@ EXTRA_JS_MODULES += [
     'RelyingParty.jsm',
     'Sandbox.jsm',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -12,62 +12,27 @@ SHARED_LIBRARY_NAME=XUL
 # Setting MAKE_FRAMEWORK makes DLL_PREFIX and DLL_SUFFIX be ignored when
 # setting SHARED_LIBRARY; we need to leave DLL_PREFIX and DLL_SUFFIX
 # as-is so that dependencies of the form -ltracemalloc still work.
 MAKE_FRAMEWORK=1
 endif
 
 VPATH += $(topsrcdir)/build/
 
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/intl/unicharutil/util/internal/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX) \
-  $(DEPTH)/rdf/util/src/internal/$(LIB_PREFIX)rdfutil_s.$(LIB_SUFFIX) \
-  $(DEPTH)/media/kiss_fft/$(LIB_PREFIX)kiss_fft.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) \
-  $(NULL)
-
-ifdef ACCESSIBILITY
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/accessible/src/base/$(LIB_PREFIX)accessibility_base_s.$(LIB_SUFFIX) \
-  $(DEPTH)/accessible/src/generic/$(LIB_PREFIX)accessibility_generic_s.$(LIB_SUFFIX) \
-  $(DEPTH)/accessible/src/html/$(LIB_PREFIX)accessibility_html_s.$(LIB_SUFFIX) \
-  $(DEPTH)/accessible/src/xpcom/$(LIB_PREFIX)accessibility_xpcom_s.$(LIB_SUFFIX) \
-  $(NULL)
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/accessible/src/windows/msaa/$(LIB_PREFIX)accessibility_toolkit_msaa_s.$(LIB_SUFFIX) \
-  $(DEPTH)/accessible/src/windows/ia2/$(LIB_PREFIX)accessibility_toolkit_ia2_s.$(LIB_SUFFIX) \
-  $(DEPTH)/accessible/src/windows/sdn/$(LIB_PREFIX)accessibility_toolkit_sdn_s.$(LIB_SUFFIX) \
-  $(DEPTH)/accessible/src/windows/uia/$(LIB_PREFIX)accessibility_toolkit_uia_s.$(LIB_SUFFIX) \
-  $(NULL)
-else
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/accessible/src/$(LIB_PREFIX)accessibility_toolkit_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
-ifdef MOZ_XUL
-SHARED_LIBRARY_LIBS += $(DEPTH)/accessible/src/xul/$(LIB_PREFIX)accessibility_xul_s.$(LIB_SUFFIX)
-endif
-endif
-
 ifdef MOZ_CONTENT_SANDBOX
 ifeq ($(OS_ARCH),WINNT)
   LOCAL_INCLUDES += -I$(srcdir)/../sandboxbroker
   SHARED_LIBRARY_LIBS += ../../security/sandbox/win/src/sandboxbroker/$(LIB_PREFIX)sandboxbroker.$(LIB_SUFFIX)
 endif
 endif
 
-# XXX bug 903227 COMPONENT_LIBS is useless since bug 886526, but removing it
-# reorders the static libraries which makes msvc use more memory to link
-# xul.dll.
+# COMPONENT_LIBS is mosly useless since bug 935881, but is kept for
+# MOZ_APP_COMPONENT_LIBS, used by comm-central, and gtest linking.
 SHARED_LIBRARY_LIBS += \
   $(foreach component,$(COMPONENT_LIBS),$(DEPTH)/staticlib/$(LIB_PREFIX)$(component).$(LIB_SUFFIX)) \
-  $(foreach lib,$(STATIC_LIBS),$(DEPTH)/staticlib/$(LIB_PREFIX)$(lib).$(LIB_SUFFIX)) \
   $(NULL)
 
 ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 RCINCLUDE = xulrunner.rc
 
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/windows
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 endif
@@ -76,305 +41,81 @@ ifeq ($(OS_ARCH),OS2)
 RESFILE = xulrunos2.res
 RCFLAGS += -i $(topsrcdir)/widget/os2
 
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/os2
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 endif
 
 # dependent libraries
-STATIC_LIBS += \
-  jsipc_s \
-  domipc_s \
-  domplugins_s \
-  mozipc_s \
-  mozipdlgen_s \
-  ipcshell_s \
-  gfxipc_s \
-  hal_s \
-  dombindings_s \
-  $(NULL)
-
-ifdef MOZ_CONTENT_SANDBOX #{
-ifeq ($(OS_ARCH),Linux)
-STATIC_LIBS += sandbox_s
-endif
-endif #}
-
-ifdef MOZ_B2G_RIL #{
-STATIC_LIBS += mozril_s
-endif #}
-
 ifdef MOZ_B2G_BT_BLUEZ #{
-STATIC_LIBS += mozdbus_s
 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
 OS_LIBS += -ldbus
 endif
 endif #}
 
-ifneq ($(strip $(MOZ_B2G_RIL)$(MOZ_B2G_BT)$(filter gonk,$(MOZ_WIDGET_TOOLKIT))),) #{
-STATIC_LIBS += mozipcunixsocket_s
-endif #}
-
-ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
-STATIC_LIBS += moznetd_s mozkeystore_s
-endif
-
 ifdef MOZ_B2G_CAMERA #{
 OS_LIBS += -lstagefright -lstagefright_omx
 endif #}
 
-ifdef MOZ_NFC #{
-STATIC_LIBS += moznfc_s
-endif #}
-
-ifdef MOZ_IPDL_TESTS
-STATIC_LIBS += ipdlunittest_s
-endif
-
 ifeq (Linux,$(OS_ARCH))
 ifneq (Android,$(OS_TARGET))
 OS_LIBS += -lrt
 EXTRA_DSO_LDOPTS += -Wl,-version-script,symverscript
 
 symverscript: symverscript.in
 	$(call py_action,preprocessor, \
 		-DVERSION="$(LIBRARY_NAME)$(MOZILLA_SYMBOLVERSION)" $< -o $@)
 
 EXTRA_DEPS += symverscript
 endif
 endif
 
-STATIC_LIBS += \
-  xpcom_core \
-  chromium_s \
-  snappy_s \
-  $(NULL)
-
 # component libraries
-COMPONENT_LIBS += \
-  necko \
-  uconv \
-  i18n \
-  chardet \
-  jar \
-  startupcache \
-  pref \
-  htmlpars \
-  identity \
-  imglib2 \
-  mediasniffer \
-  gkgfx \
-  gklayout \
-  embedcomponents \
-  webbrwsr \
-  nsappshell \
-  txmgr \
-  commandlines \
-  toolkitcomps \
-  pipboot \
-  pipnss \
-  appcomps \
-  jsreflect \
-  composer \
-  telemetry \
-  jsinspector \
-  jsdebugger \
-  storagecomps \
-  rdf \
-  windowds \
-  diskspacewatcher \
-  $(NULL)
-
-SHARED_LIBRARY_LIBS += \
-	 $(DEPTH)/docshell/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) \
-	 $(DEPTH)/uriloader/prefetch/$(LIB_PREFIX)prefetch_s.$(LIB_SUFFIX) \
-	 $(DEPTH)/docshell/shistory/src/$(LIB_PREFIX)shistory_s.$(LIB_SUFFIX) \
-	 $(DEPTH)/docshell/build/$(LIB_PREFIX)docshell.$(LIB_SUFFIX) \
-  $(NULL)
-
-ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
-COMPONENT_LIBS += \
-  domwifi_s \
-  $(NULL)
-endif
-
-ifdef BUILD_CTYPES
-COMPONENT_LIBS += \
-  jsctypes \
-  $(NULL)
-endif
-
-COMPONENT_LIBS += \
-  jsperf \
-  gkplugin \
-  $(NULL)
-
-ifdef MOZ_XUL
-ifdef MOZ_ENABLE_GTK
-COMPONENT_LIBS += \
-  unixproxy \
-  $(NULL)
-endif
-endif
-
-ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
-COMPONENT_LIBS += \
-  osxproxy \
-  $(NULL)
-endif
-
-ifdef MOZ_XUL
-ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
-COMPONENT_LIBS += \
-        unixproxy \
-        $(NULL)
-endif
-endif
-
-ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
-COMPONENT_LIBS += \
-  windowsproxy \
-  $(NULL)
-endif
-
-ifneq (,$(filter android,$(MOZ_WIDGET_TOOLKIT)))
-COMPONENT_LIBS += \
-  androidproxy \
-  $(NULL)
-endif
-
 ifdef MOZ_JSDEBUGGER
 DEFINES += -DMOZ_JSDEBUGGER
-COMPONENT_LIBS += \
-  jsd \
-  $(NULL)
 endif
 
 ifdef MOZ_PREF_EXTENSIONS
 DEFINES += -DMOZ_PREF_EXTENSIONS
-COMPONENT_LIBS += \
-  autoconfig \
-  $(NULL)
 endif
 
 ifdef MOZ_AUTH_EXTENSION
-COMPONENT_LIBS += auth
 DEFINES += -DMOZ_AUTH_EXTENSION
 endif
 
 ifdef MOZ_PERMISSIONS
-COMPONENT_LIBS += cookie permissions
 DEFINES += -DMOZ_PERMISSIONS
 endif
 
 ifdef MOZ_UNIVERSALCHARDET
-COMPONENT_LIBS += universalchardet
 DEFINES += -DMOZ_UNIVERSALCHARDET
 endif
 
 ifeq (,$(filter android gonk qt os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
 ifdef MOZ_XUL
-COMPONENT_LIBS += fileview
 DEFINES += -DMOZ_FILEVIEW
 endif
 endif
 
-ifdef MOZ_PLACES
-COMPONENT_LIBS += \
-	places \
-	$(NULL)
-endif
-
-ifdef MOZ_XUL
-COMPONENT_LIBS += \
-	tkautocomplete \
-	satchel \
-	pippki \
-	$(NULL)
-endif
-
-ifdef MOZ_ENABLE_GTK3
-COMPONENT_LIBS += widget_gtk3
-endif
-
-ifdef MOZ_ENABLE_GTK2
-COMPONENT_LIBS += widget_gtk2
-endif
-
-ifdef MOZ_ENABLE_GTK2
-ifdef MOZ_X11
-STATIC_LIBS += gtkxtbin
-endif
-endif
-
 # Platform-specific icon channel stuff - supported mostly-everywhere
 ifneq (,$(filter windows os2 mac cocoa gtk2 gtk3 qt android,$(MOZ_WIDGET_TOOLKIT)))
 DEFINES += -DICON_DECODER
-COMPONENT_LIBS += imgicon
-endif
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),android)
-COMPONENT_LIBS += widget_android
-STATIC_LIBS += skia_npapi
-endif
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
-COMPONENT_LIBS += widget_gonk
-endif
-
-STATIC_LIBS += thebes gl ycbcr
-
-ifdef MOZ_ENABLE_PROFILER_SPS
-COMPONENT_LIBS += profiler
-endif
-
-ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
-COMPONENT_LIBS += widget_windows
-ifdef MOZ_METRO
-COMPONENT_LIBS += widget_winrt
-endif
-endif
-ifeq (os2,$(MOZ_WIDGET_TOOLKIT))
-COMPONENT_LIBS += wdgtos2
-endif
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-COMPONENT_LIBS += widget_mac
-endif
-ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
-COMPONENT_LIBS += widget_qt
-endif
-
-ifdef MOZ_ENABLE_XREMOTE
-COMPONENT_LIBS += remoteservice
 endif
 
 ifdef MOZ_SPELLCHECK
 DEFINES += -DMOZ_SPELLCHECK
-COMPONENT_LIBS += spellchecker
 endif
 
 ifdef MOZ_ZIPWRITER
 DEFINES += -DMOZ_ZIPWRITER
-COMPONENT_LIBS += zipwriter
-endif
-
-COMPONENT_LIBS += services-crypto
-
-ifdef MOZ_DEBUG
-ifdef ENABLE_TESTS
-COMPONENT_LIBS += gkdebug
-endif
 endif
 
 ifdef MOZ_GIO_COMPONENT
 DEFINES += -DMOZ_GIO_COMPONENT
-COMPONENT_LIBS += nkgio
 endif
 
 ifdef MOZ_APP_COMPONENT_LIBS
 COMPONENT_LIBS += $(MOZ_APP_COMPONENT_LIBS)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 OS_LIBS += -framework OpenGL -lcups
@@ -419,29 +160,23 @@ endif
 
 ifdef MOZ_DMD
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,dmd,$(DIST)/lib)
 endif
 
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib)
 
 ifdef MOZ_WEBRTC
-ifdef MOZ_PEERCONNECTION
-COMPONENT_LIBS += peerconnection
-endif
 ifdef MOZ_WEBRTC_SIGNALING
 SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/media/mtransport/build/$(LIB_PREFIX)mtransport.$(LIB_SUFFIX) \
   $(DEPTH)/media/webrtc/signaling/signaling_ecc/$(LIB_PREFIX)ecc.$(LIB_SUFFIX) \
   $(DEPTH)/media/webrtc/signaling/signaling_sipcc/$(LIB_PREFIX)sipcc.$(LIB_SUFFIX) \
   $(NULL)
 endif
 
-SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,webrtc,$(DEPTH)/layout/media/webrtc)
-
 ifeq (WINNT,$(OS_TARGET))
 EXTRA_DSO_LDOPTS += \
   -LIBPATH:"$(MOZ_DIRECTX_SDK_PATH)/lib/$(MOZ_DIRECTX_SDK_CPU_SUFFIX)" \
   $(NULL)
 OS_LIBS += $(call EXPAND_LIBNAME,secur32 crypt32 iphlpapi strmiids dmoguids wmcodecdspuuid amstrmid msdmo wininet)
 endif
 endif
 
@@ -471,17 +206,16 @@ OS_LIBS += \
   -lsysutils \
   -lcamera_client \
   -lsensorservice \
   -lstagefright \
   -lstagefright_foundation \
   -lstagefright_omx \
   -lbinder \
   -lgui \
-  $(DEPTH)/widget/gonk/nativewindow/$(LIB_PREFIX)nativewindow.$(LIB_SUFFIX) \
   $(NULL)
 endif
 
 ifneq (,$(filter rtsp,$(NECKO_PROTOCOLS)))
 OS_LIBS += -lstagefright_foundation
 endif
 
 ifdef MOZ_WMF
@@ -527,24 +261,21 @@ ifdef MOZ_WIDGET_GTK
 EXTRA_DSO_LDOPTS += $(TK_LIBS)
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS) $(MOZ_PANGO_LIBS) $(XT_LIBS) -lgthread-2.0
 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
 endif
 
 ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XT_LIBS) $(MOZ_QT_LIBS)
 EXTRA_DSO_LDOPTS += $(FT2_LIBS) $(MOZ_PANGO_LIBS)
-EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/../widget/qt/faststartupqt/$(LIB_PREFIX)faststartupqt.$(LIB_SUFFIX)
 endif
 
 ifdef MOZ_TREE_FREETYPE
-ifndef MOZ_TREE_CAIRO
 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
 endif
-endif
 
 ifdef MOZ_ENABLE_STARTUP_NOTIFICATION
 EXTRA_DSO_LDOPTS += $(MOZ_STARTUP_NOTIFICATION_LIBS)
 endif
 
 ifdef MOZ_ENABLE_LIBPROXY
 EXTRA_DSO_LDOPTS += $(MOZ_LIBPROXY_LIBS)
 endif
--- a/toolkit/mozapps/update/common/moz.build
+++ b/toolkit/mozapps/update/common/moz.build
@@ -22,8 +22,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
 
 LIBRARY_NAME = 'updatecommon'
 
 LIBXUL_LIBRARY = True
 
 srcdir = '.'
 
 include('sources.mozbuild')
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/profile/moz.build
+++ b/toolkit/profile/moz.build
@@ -25,8 +25,10 @@ SOURCES += [
 LIBRARY_NAME = 'profile_s'
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '../xre',
     '/profile/dirserviceprovider/src',
 ]
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/toolkit/system/androidproxy/moz.build
+++ b/toolkit/system/androidproxy/moz.build
@@ -9,10 +9,9 @@ MODULE = 'androidproxy'
 SOURCES += [
     'nsAndroidSystemProxySettings.cpp',
 ]
 
 LIBRARY_NAME = 'androidproxy'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/system/osxproxy/moz.build
+++ b/toolkit/system/osxproxy/moz.build
@@ -9,10 +9,9 @@ MODULE = 'osxproxy'
 SOURCES += [
     'nsOSXSystemProxySettings.mm',
 ]
 
 LIBRARY_NAME = 'osxproxy'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/system/unixproxy/moz.build
+++ b/toolkit/system/unixproxy/moz.build
@@ -14,10 +14,9 @@ else:
     SOURCES += [
         'nsUnixSystemProxySettings.cpp',
     ]
 
 LIBRARY_NAME = 'unixproxy'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/system/windowsproxy/moz.build
+++ b/toolkit/system/windowsproxy/moz.build
@@ -9,10 +9,9 @@ MODULE = 'windowsproxy'
 SOURCES += [
     'nsWindowsSystemProxySettings.cpp',
 ]
 
 LIBRARY_NAME = 'windowsproxy'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -28,90 +28,20 @@ endif
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 DEFINES += -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
 DEFINES += -DANDROID_PACKAGE_NAME='"$(ANDROID_PACKAGE_NAME)"'
 endif
 
-SHARED_LIBRARY_LIBS += \
-  ../profile/$(LIB_PREFIX)profile_s.$(LIB_SUFFIX) \
-  $(NULL)
-
-ifdef MOZ_UPDATER
-ifneq (android,$(MOZ_WIDGET_TOOLKIT))
-SHARED_LIBRARY_LIBS += \
-  ../mozapps/update/common/$(LIB_PREFIX)updatecommon.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-endif
-
 ifdef MOZ_ENABLE_XREMOTE
-SHARED_LIBRARY_LIBS += $(DEPTH)/widget/xremoteclient/$(LIB_PREFIX)xremote_client_s.$(LIB_SUFFIX)
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/xremoteclient
 endif
 
-ifneq (,$(MOZ_CRASHREPORTER)$(MOZ_ENABLE_PROFILER_SPS))
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)breakpad_common_s.$(LIB_SUFFIX) \
-  $(NULL)
-
-ifeq ($(OS_ARCH),Darwin)
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/mac/$(LIB_PREFIX)breakpad_mac_common_s.$(LIB_SUFFIX)
-  $(NULL)
-endif
-ifeq ($(OS_ARCH),Linux)
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/linux/$(LIB_PREFIX)breakpad_linux_common_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-endif
-
-ifdef MOZ_ENABLE_PROFILER_SPS
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/processor/$(LIB_PREFIX)breakpad_sps_common_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
-ifdef MOZ_CRASHREPORTER
-SHARED_LIBRARY_LIBS += $(DEPTH)/toolkit/crashreporter/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX)
-ifeq ($(OS_ARCH),WINNT)
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/toolkit/crashreporter/breakpad-windows-libxul/$(LIB_PREFIX)google_breakpad_libxul_s.$(LIB_SUFFIX)
-endif
-
-ifeq ($(OS_ARCH),Darwin)
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/$(LIB_PREFIX)minidump_file_writer_s.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/$(LIB_PREFIX)crash_generation_s.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/mac/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
-ifeq ($(OS_ARCH),Linux)
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/$(LIB_PREFIX)crash_generation_s.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/linux/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/$(LIB_PREFIX)minidump_writer_s.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/$(LIB_PREFIX)minidump_file_writer_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-
-ifeq ($(OS_ARCH),SunOS)
-SHARED_LIBRARY_LIBS += \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/$(LIB_PREFIX)exception_handler_s.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/client/$(LIB_PREFIX)minidump_file_writer_s.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)breakpad_common_s.$(LIB_SUFFIX) \
-  $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/solaris/$(LIB_PREFIX)breakpad_solaris_common_s.$(LIB_SUFFIX) \
-  $(NULL)
-endif
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/testing/gtest/mozilla \
   -I$(srcdir)/../profile \
   -I$(topsrcdir)/dom/ipc \
   -I$(topsrcdir)/toolkit/crashreporter \
   -I$(topsrcdir)/dom/base \
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -98,8 +98,9 @@ if CONFIG['MOZ_UPDATER']:
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'xulapp_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/tools/profiler/moz.build
+++ b/tools/profiler/moz.build
@@ -3,17 +3,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if CONFIG['MOZ_ENABLE_PROFILER_SPS']:
     FAIL_ON_WARNINGS = not CONFIG['_MSC_VER']
 
     LIBXUL_LIBRARY = True
-    EXPORT_LIBRARY = True
 
     MODULE = 'profiler'
     LIBRARY_NAME = 'profiler'
     XPIDL_SOURCES += [
         'nsIProfiler.idl',
         'nsIProfileSaveEvent.idl',
     ]
     EXPORTS += [
@@ -80,16 +79,18 @@ if CONFIG['MOZ_ENABLE_PROFILER_SPS']:
     if CONFIG['OS_TARGET'] == 'Android':
         LOCAL_INCLUDES += [
             '/toolkit/crashreporter/google-breakpad/src/common/android/include',
         ]
 
     if CONFIG['ANDROID_CPU_ARCH'] == 'armeabi':
         DEFINES['ARCH_ARMV6'] = True
 
+    FINAL_LIBRARY = 'xul'
+
 EXPORTS += [
     'GeckoProfiler.h',
 ]
 
 EXPORTS.mozilla += [
     'IOInterposer.h',
 ]
 
--- a/tools/trace-malloc/lib/moz.build
+++ b/tools/trace-malloc/lib/moz.build
@@ -23,10 +23,9 @@ if CONFIG['OS_ARCH'] == 'WINNT':
         'nsDebugHelpWin32.cpp',
         'nsWinTraceMalloc.cpp',
     ]
 
 LIBRARY_NAME = 'tracemalloc'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xpcom_core'
--- a/uriloader/base/moz.build
+++ b/uriloader/base/moz.build
@@ -31,8 +31,9 @@ SOURCES += [
 LIBRARY_NAME = 'uriloaderbase_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'xul'
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -131,8 +131,9 @@ IPDL_SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'exthandler_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/uriloader/prefetch/moz.build
+++ b/uriloader/prefetch/moz.build
@@ -36,8 +36,9 @@ IPDL_SOURCES += [
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'prefetch_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/view/src/moz.build
+++ b/view/src/moz.build
@@ -14,8 +14,9 @@ SOURCES += [
 LIBRARY_NAME = 'gkview_s'
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'gklayout'
--- a/widget/android/Makefile.in
+++ b/widget/android/Makefile.in
@@ -1,14 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-SHARED_LIBRARY_LIBS = ../xpwidgets/libxpwidgets_s.a
-
 include $(topsrcdir)/config/rules.mk
 
 #DEFINES += -DDEBUG_WIDGETS
 
 LOCAL_INCLUDES += \
 	-I$(topsrcdir)/widget/xpwidgets \
 	-I$(topsrcdir)/widget/shared \
 	-I$(topsrcdir)/dom/system/android \
--- a/widget/android/moz.build
+++ b/widget/android/moz.build
@@ -42,12 +42,11 @@ SOURCES += [
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'widget_android'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/widget/cocoa/Makefile.in
+++ b/widget/cocoa/Makefile.in
@@ -1,15 +1,13 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-SHARED_LIBRARY_LIBS = ../xpwidgets/libxpwidgets_s.a
-
 include $(topsrcdir)/config/rules.mk
 
 NIB_FILES = \
 	classes.nib \
 	info.nib \
 	keyedobjects.nib \
 	$(NULL)
 NIB_DEST = $(DIST)/bin/res/MainMenu.nib
--- a/widget/cocoa/moz.build
+++ b/widget/cocoa/moz.build
@@ -64,10 +64,9 @@ UNIFIED_SOURCES += [
     'WidgetTraceEvent.mm',
 ]
 
 if CONFIG['TARGET_CPU'] == 'x86_64':
     UNIFIED_SOURCES += [
         'ComplexTextInputPanel.mm',
     ]
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/widget/gonk/Makefile.in
+++ b/widget/gonk/Makefile.in
@@ -12,18 +12,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 VPATH           = \
   $(srcdir) \
   $(srcdir)/libui \
   $(NULL)
 
-SHARED_LIBRARY_LIBS = ../xpwidgets/libxpwidgets_s.a
-
 include $(topsrcdir)/config/rules.mk
 
 DEFINES += -DHAVE_OFF64_T -DSK_BUILD_FOR_ANDROID_NDK
 
 ifdef MOZ_OMX_DECODER
 DEFINES += -DMOZ_OMX_DECODER
 endif
 
--- a/widget/gonk/moz.build
+++ b/widget/gonk/moz.build
@@ -58,12 +58,11 @@ SOURCES += [
     'OrientationObserver.cpp',
     'ProcessOrientation.cpp'
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'widget_gonk'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/widget/gonk/nativewindow/moz.build
+++ b/widget/gonk/nativewindow/moz.build
@@ -51,8 +51,9 @@ if CONFIG['MOZ_B2G_CAMERA'] or CONFIG['M
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'nativewindow'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/widget/gtk/Makefile.in
+++ b/widget/gtk/Makefile.in
@@ -2,18 +2,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 NATIVE_THEME_SUPPORT = 1
 
 # build our subdirs, too
 
-SHARED_LIBRARY_LIBS = ../xpwidgets/libxpwidgets_s.a
-
 ifdef NATIVE_THEME_SUPPORT
 DEFINES		+= -DNATIVE_THEME_SUPPORT
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 CFLAGS          += $(MOZ_STARTUP_NOTIFICATION_CFLAGS)
 CXXFLAGS        += $(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS) \
--- a/widget/gtk/moz.build
+++ b/widget/gtk/moz.build
@@ -76,12 +76,11 @@ if CONFIG['MOZ_ENABLE_GTK2']:
     SOURCES += [
         'gtk2drawing.c',
     ]
 else:
     SOURCES += [
         'gtk3drawing.c',
     ]
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/widget/gtkxtbin/moz.build
+++ b/widget/gtkxtbin/moz.build
@@ -14,10 +14,9 @@ LIBRARY_NAME = 'gtkxtbin'
 
 LIBXUL_LIBRARY = True
 
 if CONFIG['MOZ_ENABLE_GTK2']:
     SOURCES += [
         'gtk2xtbin.c',
     ]
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/widget/os2/Makefile.in
+++ b/widget/os2/Makefile.in
@@ -1,17 +1,14 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 RESFILE		= widget.res
-SHARED_LIBRARY_LIBS = \
-	../xpwidgets/$(LIB_PREFIX)xpwidgets_s.$(LIB_SUFFIX) \
-	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += $(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)
 
 DEFINES += -DUSE_OS2_TOOLKIT_HEADERS
 
 DEFINES += -DMOZ_APP_DISPLAYNAME=\"$(MOZ_APP_DISPLAYNAME)\"
--- a/widget/os2/moz.build
+++ b/widget/os2/moz.build
@@ -26,10 +26,9 @@ SOURCES += [
     'nsWindow.cpp',
     'os2FrameWindow.cpp',
 ]
 
 LIBRARY_NAME = 'wdgtos2'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/widget/qt/Makefile.in
+++ b/widget/qt/Makefile.in
@@ -1,15 +1,13 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-SHARED_LIBRARY_LIBS = ../xpwidgets/libxpwidgets_s.a
-
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS	+= $(MOZ_QT_CFLAGS) $(GLIB_CFLAGS) $(MOZ_CAIRO_CFLAGS) \
 		$(MOZ_PIXMAN_CFLAGS)
 CFLAGS		+= $(MOZ_QT_CFLAGS) $(GLIB_CFLAGS) $(MOZ_CAIRO_CFLAGS) \
 		$(MOZ_PIXMAN_CFLAGS)
 
 #DEFINES		+= -DDEBUG_WIDGETS
--- a/widget/qt/faststartupqt/moz.build
+++ b/widget/qt/faststartupqt/moz.build
@@ -19,8 +19,10 @@ SOURCES += [
 
 SOURCES += [
     'nsFastStartupQt.cpp',
 ]
 
 LIBRARY_NAME = 'faststartupqt'
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xul'
--- a/widget/qt/moz.build
+++ b/widget/qt/moz.build
@@ -57,12 +57,11 @@ if CONFIG[' MOZ_ENABLE_QTMOBILITY']:
     GENERATED_SOURCES += [
         'moc_mozqorientationsensorfilter.cpp',
     ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'widget_qt'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/widget/shared/moz.build
+++ b/widget/shared/moz.build
@@ -16,8 +16,9 @@ UNIFIED_SOURCES += [
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'widget_shared'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xpwidgets_s'
--- a/widget/shared/x11/moz.build
+++ b/widget/shared/x11/moz.build
@@ -9,8 +9,9 @@ MODULE = 'widget'
 SOURCES += [
     'keysym2ucs.c',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'widget_shared_x11'
 
+FINAL_LIBRARY = 'xpwidgets_s'
--- a/widget/windows/Makefile.in
+++ b/widget/windows/Makefile.in
@@ -9,20 +9,16 @@ DEFINES		+= -DMOZ_UNICODE
 ifdef MOZ_ENABLE_D3D9_LAYER
 DEFINES		+= -DMOZ_ENABLE_D3D9_LAYER
 endif
 
 ifdef MOZ_ENABLE_D3D10_LAYER
 DEFINES		+= -DMOZ_ENABLE_D3D10_LAYER
 endif
 
-SHARED_LIBRARY_LIBS = \
-  ../xpwidgets/$(LIB_PREFIX)xpwidgets_s.$(LIB_SUFFIX) \
-  $(NULL)
-
 LOCAL_INCLUDES	= \
 		-I. \
 		-I$(srcdir)/../xpwidgets \
 		-I$(srcdir)/../shared \
 		-I$(srcdir) \
 		-I$(topsrcdir)/layout/generic \
 		-I$(topsrcdir)/layout/xul/base/src \
 		-I$(topsrcdir)/toolkit/xre \
--- a/widget/windows/moz.build
+++ b/widget/windows/moz.build
@@ -84,12 +84,11 @@ if CONFIG['NS_ENABLE_TSF']:
     ]
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'widget_windows'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/widget/windows/winrt/moz.build
+++ b/widget/windows/winrt/moz.build
@@ -26,12 +26,11 @@ EXTRA_COMPONENTS += [
     'MetroUIUtils.js',
     'MetroUIUtils.manifest',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'widget_winrt'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/widget/xpwidgets/Makefile.in
+++ b/widget/xpwidgets/Makefile.in
@@ -1,18 +1,13 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-SHARED_LIBRARY_LIBS = ../shared/$(LIB_PREFIX)widget_shared.$(LIB_SUFFIX)
-ifdef MOZ_X11
-SHARED_LIBRARY_LIBS += ../shared/x11/$(LIB_PREFIX)widget_shared_x11.$(LIB_SUFFIX)
-endif
-
 ifdef MOZ_ENABLE_D3D10_LAYER
 DEFINES		+= -DMOZ_ENABLE_D3D10_LAYER
 endif
 
 ifneq (,$(filter gtk3 gtk2,$(MOZ_WIDGET_TOOLKIT)))
 # gtk3 shares includes with gtk2
 LOCAL_INCLUDES	+= \
 		-I$(srcdir)/../gtk \
--- a/widget/xpwidgets/moz.build
+++ b/widget/xpwidgets/moz.build
@@ -68,8 +68,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt'
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'xpwidgets_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+    FINAL_LIBRARY = 'widget_mac'
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gonk', 'android', 'qt', 'gtk2', 'gtk3'):
+    FINAL_LIBRARY = 'widget_%s' % CONFIG['MOZ_WIDGET_TOOLKIT']
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'os2':
+    FINAL_LIBRARY = 'wdgtos2'
--- a/widget/xremoteclient/moz.build
+++ b/widget/xremoteclient/moz.build
@@ -6,8 +6,10 @@
 
 MODULE = 'xremoteclient'
 
 PROGRAM = 'mozilla-xremote-client'
 
 LIBRARY_NAME = 'xremote_client_s'
 
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xulapp_s'
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -130,8 +130,9 @@ SOURCES += [
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'xpcombase_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/build/Makefile.in
+++ b/xpcom/build/Makefile.in
@@ -2,36 +2,16 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
 MOZILLA_INTERNAL_API = 1
 
-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) \
-		../base/$(LIB_PREFIX)xpcombase_s.$(LIB_SUFFIX) \
-		../reflect/xptcall/src/$(LIB_PREFIX)xptcall.$(LIB_SUFFIX) \
-		../reflect/xptcall/src/$(LIB_PREFIX)xptcmd.$(LIB_SUFFIX) \
-		../reflect/xptinfo/src/$(LIB_PREFIX)xptinfo.$(LIB_SUFFIX) \
-		$(DIST)/lib/$(LIB_PREFIX)xpt.$(LIB_SUFFIX) \
-		../string/src/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) \
-		$(NULL)
-
-ifdef NS_TRACE_MALLOC
-SHARED_LIBRARY_LIBS += \
-		$(DEPTH)/tools/trace-malloc/lib/$(LIB_PREFIX)tracemalloc.$(LIB_SUFFIX) \
-		$(NULL)
-endif
-
 LOCAL_INCLUDES	= \
 		-I$(srcdir) \
 		-I.. \
 		-I$(srcdir)/../glue \
 		-I$(srcdir)/../base \
 		-I$(srcdir)/../ds \
 		-I$(srcdir)/../io \
 		-I$(srcdir)/../components \
--- a/xpcom/build/moz.build
+++ b/xpcom/build/moz.build
@@ -60,12 +60,11 @@ SOURCES += [
 ]
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'xpcom_core'
 
-EXPORT_LIBRARY = True
-
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xul'
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
@@ -36,8 +36,9 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'xpcomcomponents_s'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/ds/moz.build
+++ b/xpcom/ds/moz.build
@@ -117,8 +117,10 @@ LIBRARY_NAME = 'xpcomds_s'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LOCAL_INCLUDES += [
     '../io',
 ]
+
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/io/moz.build
+++ b/xpcom/io/moz.build
@@ -125,8 +125,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LIBRARY_NAME = 'xpcomio_s'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/reflect/xptcall/src/md/os2/Makefile.in
+++ b/xpcom/reflect/xptcall/src/md/os2/Makefile.in
@@ -1,14 +1,13 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXPORT_LIBRARY	= ../..
 MOZILLA_INTERNAL_API = 1
 
 LOCAL_INCLUDES = \
 		-I$(srcdir)/../unix \
 		-I$(srcdir)/../../../../xptinfo/src \
 		$(NULL)
 DEFINES		+= -DMOZ_NEED_LEADING_UNDERSCORE
 
--- a/xpcom/reflect/xptcall/src/md/os2/moz.build
+++ b/xpcom/reflect/xptcall/src/md/os2/moz.build
@@ -10,8 +10,10 @@ SOURCES += [
     '../unix/xptcinvoke_gcc_x86_unix.cpp',
     'xptcstubs_gcc_x86_os2.cpp',
 ]
 
 LIBRARY_NAME = 'xptcmd'
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
@@ -1,16 +1,15 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 NO_PROFILE_GUIDED_OPTIMIZE = 1
 
-EXPORT_LIBRARY	= ../..
 MOZILLA_INTERNAL_API = 1
 
 #
 # The default is this buildable, but non-functioning code.
 #
 ifeq ($(OS_ARCH),SunOS)
 ifneq (86,$(findstring 86,$(OS_TEST)))
 # disable PGO for this directory with Sun Studio on SPARC because
--- a/xpcom/reflect/xptcall/src/md/unix/moz.build
+++ b/xpcom/reflect/xptcall/src/md/unix/moz.build
@@ -321,8 +321,10 @@ if CONFIG['OS_ARCH'] == 'Linux':
             'xptcinvoke_linux_s390x.cpp',
             'xptcstubs_linux_s390x.cpp',
         ]
 
 LIBRARY_NAME = 'xptcmd'
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/reflect/xptcall/src/md/win32/Makefile.in
+++ b/xpcom/reflect/xptcall/src/md/win32/Makefile.in
@@ -1,14 +1,13 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-EXPORT_LIBRARY	= ../..
 MOZILLA_INTERNAL_API = 1
 
 LOCAL_INCLUDES += -I$(srcdir)/../../../../xptinfo/src
 
 
 ifneq ($(TARGET_CPU),x86_64)
 ifndef GNU_CXX
 # FIXME: bug 413019
--- a/xpcom/reflect/xptcall/src/md/win32/moz.build
+++ b/xpcom/reflect/xptcall/src/md/win32/moz.build
@@ -35,8 +35,10 @@ else:
             'xptcinvoke.cpp',
             'xptcstubs.cpp',
         ]
 
 LIBRARY_NAME = 'xptcmd'
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/reflect/xptcall/src/moz.build
+++ b/xpcom/reflect/xptcall/src/moz.build
@@ -16,8 +16,10 @@ LIBRARY_NAME = 'xptcall'
 
 MSVC_ENABLE_PGO = True
 
 LIBXUL_LIBRARY = True
 
 LOCAL_INCLUDES += [
     '/xpcom/reflect/xptinfo/src',
 ]
+
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/reflect/xptinfo/src/moz.build
+++ b/xpcom/reflect/xptinfo/src/moz.build
@@ -18,8 +18,10 @@ LIBRARY_NAME = 'xptinfo'
 MSVC_ENABLE_PGO = True
 
 LIBXUL_LIBRARY = True
 
 # For nsManifestLineReader class.
 LOCAL_INCLUDES += [
     '/xpcom/ds',
 ]
+
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/string/src/moz.build
+++ b/xpcom/string/src/moz.build
@@ -31,8 +31,10 @@ LOCAL_INCLUDES += [
 
 LIBRARY_NAME = 'string_s'
 
 MSVC_ENABLE_PGO = True
 
 # we don't want the shared lib, but we want to force the creation of a
 # static lib.
 FORCE_STATIC_LIB = True
+
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/threads/moz.build
+++ b/xpcom/threads/moz.build
@@ -53,8 +53,10 @@ LIBRARY_NAME = 'xpcomthreads_s'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
 LOCAL_INCLUDES += [
     '../build',
 ]
+
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpcom/typelib/xpt/src/moz.build
+++ b/xpcom/typelib/xpt/src/moz.build
@@ -11,8 +11,9 @@ LIBRARY_NAME = 'xpt'
 SOURCES += [
     'xpt_arena.c',
     'xpt_struct.c',
     'xpt_xdr.c',
 ]
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'xpcom_core'
--- a/xpfe/appshell/src/moz.build
+++ b/xpfe/appshell/src/moz.build
@@ -24,10 +24,9 @@ LOCAL_INCLUDES += [
 ]
 
 LIBRARY_NAME = 'nsappshell'
 
 LIBXUL_LIBRARY = True
 
 MSVC_ENABLE_PGO = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/xpfe/components/build/Makefile.in
+++ b/xpfe/components/build/Makefile.in
@@ -1,7 +1,6 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-SHARED_LIBRARY_LIBS += ../directory/$(LIB_PREFIX)directory_s.$(LIB_SUFFIX)
 LOCAL_INCLUDES += -I$(srcdir)/../directory
--- a/xpfe/components/build/moz.build
+++ b/xpfe/components/build/moz.build
@@ -9,10 +9,9 @@ MODULE = 'appcomps'
 SOURCES += [
     'nsModule.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 LIBRARY_NAME = 'appcomps'
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'
--- a/xpfe/components/directory/moz.build
+++ b/xpfe/components/directory/moz.build
@@ -15,8 +15,9 @@ MODULE = 'appcomps'
 SOURCES += [
     'nsDirectoryViewer.cpp',
 ]
 
 LIBRARY_NAME = 'directory_s'
 
 LIBXUL_LIBRARY = True
 
+FINAL_LIBRARY = 'appcomps'
--- a/xpfe/components/windowds/moz.build
+++ b/xpfe/components/windowds/moz.build
@@ -15,10 +15,9 @@ MODULE = 'appcomps'
 SOURCES += [
     'nsWindowDataSource.cpp',
 ]
 
 LIBRARY_NAME = 'windowds'
 
 LIBXUL_LIBRARY = True
 
-EXPORT_LIBRARY = True
-
+FINAL_LIBRARY = 'xul'