Bug 970745 - Move USE_STATIC_LIBS to moz.build; r=glandium
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 11 Feb 2014 09:12:33 -0500
changeset 185252 3e252a679f72adfdd5fc2a8d527add97b4e312d1
parent 185251 97d852db7e3a7f849938cb04309eee56e3db8e7c
child 185253 af35bd7bd9a83d3ca0451fe2e0be293a4b4d8e0a
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs970745
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 970745 - Move USE_STATIC_LIBS to moz.build; r=glandium
browser/metro/shell/testing/Makefile.in
browser/metro/shell/testing/moz.build
build/win32/Makefile.in
build/win32/crashinjectdll/Makefile.in
build/win32/crashinjectdll/moz.build
build/win32/moz.build
build/win32/vmwarerecordinghelper/Makefile.in
build/win32/vmwarerecordinghelper/moz.build
dom/plugins/test/testplugin/testplugin.mk
dom/plugins/test/testplugin/testplugin.mozbuild
intl/unicharutil/tests/Makefile.in
intl/unicharutil/tests/moz.build
intl/unicharutil/util/Makefile.in
intl/unicharutil/util/moz.build
media/omx-plugin/Makefile.in
media/omx-plugin/froyo/Makefile.in
media/omx-plugin/gb/Makefile.in
media/omx-plugin/gb235/Makefile.in
media/omx-plugin/hc/Makefile.in
media/omx-plugin/kk/Makefile.in
media/omx-plugin/lib/froyo/libstagefright/Makefile.in
media/omx-plugin/lib/gb/libstagefright/Makefile.in
media/omx-plugin/lib/gb/libstagefright_color_conversion/Makefile.in
media/omx-plugin/lib/gb/libutils/Makefile.in
media/omx-plugin/lib/gb235/libstagefright/Makefile.in
media/omx-plugin/lib/hc/libstagefright/Makefile.in
media/omx-plugin/lib/ics/libstagefright/Makefile.in
media/omx-plugin/lib/ics/libutils/Makefile.in
media/omx-plugin/lib/ics/libvideoeditorplayer/Makefile.in
modules/libbz2/src/Makefile.in
modules/libbz2/src/moz.build
modules/libmar/sign/Makefile.in
modules/libmar/sign/moz.build
modules/libmar/src/Makefile.in
modules/libmar/src/moz.build
modules/libmar/tool/Makefile.in
modules/libmar/tool/moz.build
modules/libmar/verify/Makefile.in
modules/libmar/verify/moz.build
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/frontend/sandbox_symbols.py
python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
python/mozbuild/mozbuild/test/frontend/test_emitter.py
testing/tools/screenshot/Makefile.in
testing/tools/screenshot/moz.build
toolkit/components/maintenanceservice/Makefile.in
toolkit/components/maintenanceservice/moz.build
toolkit/crashreporter/breakpad-windows-standalone/Makefile.in
toolkit/crashreporter/breakpad-windows-standalone/moz.build
toolkit/crashreporter/injector/Makefile.in
toolkit/crashreporter/injector/moz.build
toolkit/mozapps/plugins/tests/Makefile.in
toolkit/mozapps/plugins/tests/moz.build
toolkit/mozapps/update/common-standalone/Makefile.in
toolkit/mozapps/update/common-standalone/moz.build
toolkit/mozapps/update/tests/Makefile.in
toolkit/mozapps/update/tests/moz.build
toolkit/mozapps/update/updater/Makefile.in
toolkit/mozapps/update/updater/moz.build
toolkit/xre/test/win/Makefile.in
toolkit/xre/test/win/moz.build
webapprt/win/Makefile.in
webapprt/win/moz.build
xpcom/glue/nomozalloc/Makefile.in
xpcom/glue/nomozalloc/moz.build
xpcom/glue/standalone/staticruntime/Makefile.in
xpcom/glue/standalone/staticruntime/moz.build
xpcom/glue/staticruntime/Makefile.in
xpcom/glue/staticruntime/moz.build
xulrunner/stub/Makefile.in
xulrunner/stub/moz.build
--- a/browser/metro/shell/testing/Makefile.in
+++ b/browser/metro/shell/testing/Makefile.in
@@ -1,15 +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/.
 
-# static win runtime linking
-USE_STATIC_LIBS = 1
-
 # don't use moz glue libs
 MOZ_GLUE_LDFLAGS =
 MOZ_GLUE_PROGRAM_LDFLAGS =
 
 include $(topsrcdir)/config/config.mk
 
 OS_LIBS = \
 	kernel32.lib \
--- a/browser/metro/shell/testing/moz.build
+++ b/browser/metro/shell/testing/moz.build
@@ -12,8 +12,11 @@ SOURCES += [
 
 # We want this exe in dist/bin
 DIST_SUBDIR = ''
 
 for var in ('UNICODE', '_UNICODE'):
     DEFINES[var] = True
 
 NO_PGO = True
+
+# static win runtime linking
+USE_STATIC_LIBS = True
--- a/build/win32/Makefile.in
+++ b/build/win32/Makefile.in
@@ -1,18 +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/.
 
-ifdef ENABLE_TESTS
-
-USE_STATIC_LIBS = 1
-
-endif # ENABLE_TESTS
-
 MOZ_GLUE_LDFLAGS =
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef WIN32_REDIST_DIR
 ifndef MOZ_DEBUG
 
 ifeq (1600,$(_MSC_VER))
--- a/build/win32/crashinjectdll/Makefile.in
+++ b/build/win32/crashinjectdll/Makefile.in
@@ -1,8 +1,7 @@
 # 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/.
 
 DEFFILE = $(srcdir)/crashinjectdll.def
-USE_STATIC_LIBS = 1
 
 MOZ_GLUE_LDFLAGS =
--- a/build/win32/crashinjectdll/moz.build
+++ b/build/win32/crashinjectdll/moz.build
@@ -6,8 +6,10 @@
 
 SOURCES += [
     'crashinjectdll.cpp',
 ]
 
 LIBRARY_NAME = 'crashinjectdll'
 
 FORCE_SHARED_LIB = True
+
+USE_STATIC_LIBS = True
--- a/build/win32/moz.build
+++ b/build/win32/moz.build
@@ -9,10 +9,11 @@ if CONFIG['_MSC_VER'] and CONFIG['OS_TES
 
 TEST_DIRS += ['crashinjectdll']
 
 if CONFIG['ENABLE_TESTS']:
     PROGRAM = 'crashinject'
     SOURCES += [
         'crashinject.cpp',
     ]
+    USE_STATIC_LIBS = True
 
 NO_PGO = True
--- a/build/win32/vmwarerecordinghelper/Makefile.in
+++ b/build/win32/vmwarerecordinghelper/Makefile.in
@@ -1,9 +1,7 @@
 # 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/.
 
 DEFFILE = $(srcdir)/$(LIBRARY_NAME).def
 
-USE_STATIC_LIBS = 1
-
 MOZ_GLUE_LDFLAGS =
--- a/build/win32/vmwarerecordinghelper/moz.build
+++ b/build/win32/vmwarerecordinghelper/moz.build
@@ -6,8 +6,10 @@
 
 SOURCES += [
     'vmwarerecordinghelper.cpp',
 ]
 
 LIBRARY_NAME = 'vmwarerecordinghelper'
 
 FORCE_SHARED_LIB = True
+
+USE_STATIC_LIBS = True
--- a/dom/plugins/test/testplugin/testplugin.mk
+++ b/dom/plugins/test/testplugin/testplugin.mk
@@ -1,19 +1,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/.
 
 # Don't use STL wrappers; nptest isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; nptest isn't Gecko code
-USE_STATIC_LIBS = 1
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
 include $(topsrcdir)/config/config.mk
 CXXFLAGS        += $(MOZ_QT_CFLAGS)
 CFLAGS          += $(MOZ_QT_CFLAGS)
 EXTRA_DSO_LDOPTS = \
                 $(MOZ_QT_LIBS) \
                 $(XLDFLAGS) \
                 $(XLIBS)
--- a/dom/plugins/test/testplugin/testplugin.mozbuild
+++ b/dom/plugins/test/testplugin/testplugin.mozbuild
@@ -34,11 +34,14 @@ elif toolkit == 'qt':
     ]
 elif toolkit == 'windows':
     UNIFIED_SOURCES += [
         relative_path + '/nptest_windows.cpp',
     ]
 
 FORCE_SHARED_LIB = True
 
+# must link statically with the CRT; nptest isn't Gecko code
+USE_STATIC_LIBS = True
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     RCFILE  = 'nptest.rc'
     RESFILE = 'nptest.res'
--- a/intl/unicharutil/tests/Makefile.in
+++ b/intl/unicharutil/tests/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/.
 
-USE_STATIC_LIBS = 1
-
 LIBS		= \
 	$(XPCOM_STATICRUNTIME_GLUE_LDOPTS) \
 	$(DIST)/lib/$(LIB_PREFIX)unicharutil_external_s.$(LIB_SUFFIX) \
 	$(XPCOM_LIBS) \
 	$(NSPR_LIBS) \
 	$(NULL)
--- a/intl/unicharutil/tests/moz.build
+++ b/intl/unicharutil/tests/moz.build
@@ -14,8 +14,9 @@ SOURCES += [
 SIMPLE_PROGRAMS += [
     "%s" % (fyl[0:-4]) for fyl in SOURCES
 ]
 
 LOCAL_INCLUDES += [
     '../public',
 ]
 
+USE_STATIC_LIBS = True
--- a/intl/unicharutil/util/Makefile.in
+++ b/intl/unicharutil/util/Makefile.in
@@ -5,18 +5,16 @@
 
 # This makefile builds the unicharutil_external_s library which should be used
 # by frozen (dependent) linkage components. Internal-linkage code should use
 # unicharutil_s which is built in the internal/ subdirectory.
 
 DIST_INSTALL = 1
 SDK_LIBRARY = $(LIBRARY)
 
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 ifdef ENABLE_INTL_API
 LOCAL_INCLUDES += $(MOZ_ICU_CFLAGS)
 endif
 
 ifdef _MSC_VER
 # Don't include directives about which CRT to use
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -22,11 +22,12 @@ UNIFIED_SOURCES += intl_unicharutil_util
 LIBRARY_NAME = 'unicharutil_external_s'
 
 FORCE_STATIC_LIB = True
 
 LOCAL_INCLUDES += [
     '../src',
 ]
 
+USE_STATIC_LIBS = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
--- a/media/omx-plugin/Makefile.in
+++ b/media/omx-plugin/Makefile.in
@@ -10,19 +10,16 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 ifdef GNU_CXX
 # Stagefright header files define many multichar constants.
 CXXFLAGS += -Wno-multichar
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
--- a/media/omx-plugin/froyo/Makefile.in
+++ b/media/omx-plugin/froyo/Makefile.in
@@ -10,19 +10,16 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/froyo/libstagefright \
 		-lstagefright \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libstagefright_color_conversion \
--- a/media/omx-plugin/gb/Makefile.in
+++ b/media/omx-plugin/gb/Makefile.in
@@ -10,19 +10,16 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libstagefright \
 		-lstagefright \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libstagefright_color_conversion \
--- a/media/omx-plugin/gb235/Makefile.in
+++ b/media/omx-plugin/gb235/Makefile.in
@@ -10,19 +10,16 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/gb235/libstagefright \
 		-lstagefright \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libstagefright_color_conversion \
--- a/media/omx-plugin/hc/Makefile.in
+++ b/media/omx-plugin/hc/Makefile.in
@@ -10,19 +10,16 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/hc/libstagefright \
 		-lstagefright \
 		$(NULL)
--- a/media/omx-plugin/kk/Makefile.in
+++ b/media/omx-plugin/kk/Makefile.in
@@ -10,19 +10,16 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/ics/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/ics/libstagefright \
 		-lstagefright \
 		-L$(DEPTH)/media/omx-plugin/lib/ics/libvideoeditorplayer \
--- a/media/omx-plugin/lib/froyo/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/froyo/libstagefright/Makefile.in
@@ -10,17 +10,14 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/gb/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/gb/libstagefright/Makefile.in
@@ -10,17 +10,14 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/gb/libstagefright_color_conversion/Makefile.in
+++ b/media/omx-plugin/lib/gb/libstagefright_color_conversion/Makefile.in
@@ -10,17 +10,14 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 # EXTRA_DSO_LDOPTS += \
 # 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 # 		-lutils \
 # 		$(NULL)
--- a/media/omx-plugin/lib/gb/libutils/Makefile.in
+++ b/media/omx-plugin/lib/gb/libutils/Makefile.in
@@ -9,12 +9,8 @@
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
-
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
--- a/media/omx-plugin/lib/gb235/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/gb235/libstagefright/Makefile.in
@@ -10,17 +10,14 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/hc/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/hc/libstagefright/Makefile.in
@@ -10,17 +10,14 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/ics/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/ics/libstagefright/Makefile.in
@@ -10,17 +10,14 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/ics/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/ics/libutils/Makefile.in
+++ b/media/omx-plugin/lib/ics/libutils/Makefile.in
@@ -9,12 +9,8 @@
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
-
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
--- a/media/omx-plugin/lib/ics/libvideoeditorplayer/Makefile.in
+++ b/media/omx-plugin/lib/ics/libvideoeditorplayer/Makefile.in
@@ -10,16 +10,13 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
-# must link statically with the CRT; this isn't Gecko code
-USE_STATIC_LIBS = 1
-
 include $(topsrcdir)/config/rules.mk
 
 INCLUDES        += \
                 -I$(topsrcdir)/media/omx-plugin/include/ics \
                 $(NULL)
--- a/modules/libbz2/src/Makefile.in
+++ b/modules/libbz2/src/Makefile.in
@@ -1,15 +1,11 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 #
 # 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/.
 
-ifeq ($(OS_ARCH),WINNT)
-USE_STATIC_LIBS = 1
-endif
-
 include $(topsrcdir)/config/rules.mk
 
 # The intermediate (.ii/.s) files for host and target can have the same name...
 # disable parallel builds
 .NOTPARALLEL:
--- a/modules/libbz2/src/moz.build
+++ b/modules/libbz2/src/moz.build
@@ -36,8 +36,11 @@ UNIFIED_SOURCES += [
 
 FORCE_STATIC_LIB = True
 
 # This is defined by the bzip2-1.0.3 Makefile.  It appears to be used to
 # configure GLIBC to support large files.  This isn't something we care about
 # at this stage, since we're only interested in the streaming API, but we
 # define it here anyways for consistency.
 DEFINES['_FILE_OFFSET_BITS'] = 64
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    USE_STATIC_LIBS = True
--- a/modules/libmar/sign/Makefile.in
+++ b/modules/libmar/sign/Makefile.in
@@ -1,16 +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/.
 
-ifeq ($(OS_ARCH),WINNT)
-USE_STATIC_LIBS = 1
-endif
-
 # This makefile just builds support for reading archives.
 LOCAL_INCLUDES += -I$(srcdir)/../src \
   -I$(srcdir)/../verify \
   -I$(topsrcdir)/dist/include \
   $(NULL)
 
 CFLAGS += -DMAR_NSS
 
--- a/modules/libmar/sign/moz.build
+++ b/modules/libmar/sign/moz.build
@@ -7,8 +7,11 @@
 LIBRARY_NAME = 'signmar'
 
 UNIFIED_SOURCES += [
     'mar_sign.c',
     'nss_secutil.c',
 ]
 
 FORCE_STATIC_LIB = True
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    USE_STATIC_LIBS = True
--- a/modules/libmar/src/Makefile.in
+++ b/modules/libmar/src/Makefile.in
@@ -1,17 +1,13 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 #
 # 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/.
 
-ifeq ($(OS_ARCH),WINNT)
-USE_STATIC_LIBS = 1
-endif
-
 # This makefile just builds support for reading archives.
 
 include $(topsrcdir)/config/rules.mk
 
 # The intermediate (.ii/.s) files for host and target can have the same name...
 # disable parallel builds
 .NOTPARALLEL:
--- a/modules/libmar/src/moz.build
+++ b/modules/libmar/src/moz.build
@@ -20,8 +20,11 @@ LIBRARY_NAME = 'mar'
 
 UNIFIED_SOURCES += [
     'mar_create.c',
     'mar_extract.c',
     'mar_read.c',
 ]
 
 FORCE_STATIC_LIB = True
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    USE_STATIC_LIBS = True
--- a/modules/libmar/tool/Makefile.in
+++ b/modules/libmar/tool/Makefile.in
@@ -1,18 +1,14 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 #
 # 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/.
 
-ifeq ($(OS_ARCH),WINNT)
-USE_STATIC_LIBS = 1
-endif
-
 # The mar executable is output into dist/host/bin since it is something that
 # would only be used by our build system and should not itself be included in a
 # Mozilla distribution.
 
 # Don't link the against libmozglue because we don't need it.
 MOZ_GLUE_LDFLAGS =
 MOZ_GLUE_PROGRAM_LDFLAGS =
 
--- a/modules/libmar/tool/moz.build
+++ b/modules/libmar/tool/moz.build
@@ -14,8 +14,11 @@ HOST_SOURCES += SOURCES
 
 HOST_PROGRAM = 'mar'
 
 for var in ('MAR_CHANNEL_ID', 'MOZ_APP_VERSION'):
     DEFINES[var] = '"%s"' % CONFIG[var]
 
 if not CONFIG['MOZ_ENABLE_SIGNMAR']:
     DEFINES['NO_SIGN_VERIFY'] = True
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    USE_STATIC_LIBS = True
--- a/modules/libmar/verify/Makefile.in
+++ b/modules/libmar/verify/Makefile.in
@@ -1,16 +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/.
 
-ifeq ($(OS_ARCH),WINNT)
-USE_STATIC_LIBS = 1
-endif
-
 # This makefile just builds support for reading archives.
 LOCAL_INCLUDES += -I$(srcdir)/../src
 
 ifneq ($(OS_ARCH),WINNT)
 LOCAL_INCLUDES += -I$(srcdir)/../sign
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/modules/libmar/verify/moz.build
+++ b/modules/libmar/verify/moz.build
@@ -8,10 +8,12 @@ LIBRARY_NAME = 'verifymar'
 
 UNIFIED_SOURCES += [
     'cryptox.c',
     'mar_verify.c',
 ]
 
 FORCE_STATIC_LIB = True
 
-if CONFIG['OS_ARCH'] != 'WINNT':
+if CONFIG['OS_ARCH'] == 'WINNT':
+    USE_STATIC_LIBS = True
+else:
     DEFINES['MAR_NSS'] = True
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -221,16 +221,17 @@ class TreeMetadataEmitter(LoggingMixin):
             'EXTRA_COMPONENTS',
             'EXTRA_JS_MODULES',
             'EXTRA_PP_COMPONENTS',
             'EXTRA_PP_JS_MODULES',
             'FAIL_ON_WARNINGS',
             'FILES_PER_UNIFIED_FILE',
             'FORCE_SHARED_LIB',
             'FORCE_STATIC_LIB',
+            'USE_STATIC_LIBS',
             'GENERATED_FILES',
             'HOST_LIBRARY_NAME',
             'IS_COMPONENT',
             'IS_GYP_DIR',
             'JS_MODULES_PATH',
             'LIBS',
             'LIBXUL_LIBRARY',
             'MSVC_ENABLE_PGO',
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -226,16 +226,23 @@ VARIABLES = {
     'FORCE_SHARED_LIB': (bool, bool,
         """Whether the library in this directory is a shared library.
         """, None),
 
     'FORCE_STATIC_LIB': (bool, bool,
         """Whether the library in this directory is a static library.
         """, None),
 
+    'USE_STATIC_LIBS': (bool, bool,
+        """Whether the code in this directory is a built against the static
+        runtime library.
+
+        This variable only has an effect when building with MSVC.
+        """, None),
+
     'GENERATED_INCLUDES' : (StrictOrderingOnAppendList, list,
         """Directories generated by the build system to be searched for include
         files by the compiler.
         """, None),
 
     'HOST_SOURCES': (StrictOrderingOnAppendList, list,
         """Source code files to compile with the host compiler.
 
--- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build
@@ -33,8 +33,10 @@ FAIL_ON_WARNINGS = True
 LIBXUL_LIBRARY = True
 MSVC_ENABLE_PGO = True
 NO_VISIBILITY_FLAGS = True
 
 DELAYLOAD_DLLS = ['foo.dll', 'bar.dll']
 
 RCFILE = 'foo.rc'
 RESFILE = 'bar.res'
+
+USE_STATIC_LIBS = True
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -329,16 +329,19 @@ class TestRecursiveMakeBackend(BackendTe
                 'USE_DELAYIMP := 1',
             ],
             'RCFILE': [
                 'RCFILE := foo.rc',
             ],
             'RESFILE': [
                 'RESFILE := bar.res',
             ],
+            'USE_STATIC_LIBS': [
+                'USE_STATIC_LIBS := 1',
+            ],
         }
 
         for var, val in expected.items():
             # print("test_variable_passthru[%s]" % (var))
             found = [str for str in lines if str.startswith(var)]
             self.assertEqual(found, val)
 
     def test_exports(self):
--- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
+++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build
@@ -39,8 +39,10 @@ FORCE_SHARED_LIB = True
 EXPORT_LIBRARY = True
 IS_COMPONENT = True
 NO_VISIBILITY_FLAGS = True
 
 DELAYLOAD_DLLS = ['foo.dll', 'bar.dll']
 
 RCFILE = 'foo.rc'
 RESFILE = 'bar.res'
+
+USE_STATIC_LIBS = True
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -168,16 +168,17 @@ class TestEmitterBasic(unittest.TestCase
             OS_LIBS=['foo.so', '-l123', 'aaa.a'],
             SDK_LIBRARY=['fans.sdk', 'tans.sdk'],
             SSRCS=['bans.S', 'fans.S'],
             VISIBILITY_FLAGS='',
             DELAYLOAD_LDFLAGS=['-DELAYLOAD:foo.dll', '-DELAYLOAD:bar.dll'],
             USE_DELAYIMP=True,
             RCFILE='foo.rc',
             RESFILE='bar.res',
+            USE_STATIC_LIBS=True,
         )
 
         variables = objs[0].variables
         maxDiff = self.maxDiff
         self.maxDiff = None
         self.assertEqual(wanted, variables)
         self.maxDiff = maxDiff
 
--- a/testing/tools/screenshot/Makefile.in
+++ b/testing/tools/screenshot/Makefile.in
@@ -10,15 +10,14 @@ OS_LIBS = $(TK_LIBS) $(XSS_LIBS)
 
 endif # X11
 endif # GTK
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 
 OS_LIBS += $(call EXPAND_LIBNAME,gdiplus)
 MOZ_GLUE_PROGRAM_LDFLAGS =
-USE_STATIC_LIBS = 1
 
 ifdef GNU_CC
 WIN32_EXE_LDFLAGS = -municode
 endif
 
 endif # windows
--- a/testing/tools/screenshot/moz.build
+++ b/testing/tools/screenshot/moz.build
@@ -9,8 +9,9 @@ if CONFIG['MOZ_WIDGET_GTK'] and CONFIG['
     SOURCES += [
         'gdk-screenshot.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     PROGRAM = 'screenshot'
     SOURCES += [
         'win32-screenshot.cpp',
     ]
+    USE_STATIC_LIBS = True
--- a/toolkit/components/maintenanceservice/Makefile.in
+++ b/toolkit/components/maintenanceservice/Makefile.in
@@ -11,17 +11,16 @@ MOZ_GLUE_PROGRAM_LDFLAGS =
 STL_FLAGS=
 
 ifeq ($(OS_ARCH),WINNT)
 LIBS += $(call EXPAND_LIBNAME_PATH,updatecommon-standalone,../../mozapps/update/common-standalone)
 else
 LIBS += $(call EXPAND_LIBNAME_PATH,updatecommon,../../mozapps/update/common)
 endif
 
-USE_STATIC_LIBS = 1
 RCINCLUDE = maintenanceservice.rc
 
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 ws2_32 shell32)
 ifndef GNU_CC
 RCFLAGS += -I$(srcdir)
 else
 RCFLAGS += --include-dir $(srcdir)
 endif
--- a/toolkit/components/maintenanceservice/moz.build
+++ b/toolkit/components/maintenanceservice/moz.build
@@ -16,8 +16,10 @@ SOURCES += [
 ]
 
 # For debugging purposes only
 #DEFINES['DISABLE_UPDATER_AUTHENTICODE_CHECK'] = True
 
 DEFINES['UNICODE'] = True
 DEFINES['_UNICODE'] = True
 DEFINES['NS_NO_XPCOM'] = True
+
+USE_STATIC_LIBS = True
--- a/toolkit/crashreporter/breakpad-windows-standalone/Makefile.in
+++ b/toolkit/crashreporter/breakpad-windows-standalone/Makefile.in
@@ -1,8 +1,7 @@
 # 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/.
 
-USE_STATIC_LIBS = 1
 MOZ_GLUE_LDFLAGS =
 
 STL_FLAGS =
--- a/toolkit/crashreporter/breakpad-windows-standalone/moz.build
+++ b/toolkit/crashreporter/breakpad-windows-standalone/moz.build
@@ -15,8 +15,10 @@ LOCAL_INCLUDES += [
 
 include('/toolkit/crashreporter/google-breakpad/src/common/windows/objs.mozbuild')
 include('/toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mozbuild')
 include('/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mozbuild')
 
 SOURCES += objs_common
 SOURCES += objs_crash_generation
 SOURCES += objs_handler
+
+USE_STATIC_LIBS = True
--- a/toolkit/crashreporter/injector/Makefile.in
+++ b/toolkit/crashreporter/injector/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/.
 
-USE_STATIC_LIBS = 1
 STL_FLAGS =
 MOZ_GLUE_LDFLAGS =
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src
 ifndef GNU_CC
 LDFLAGS += -ENTRY:DummyEntryPoint
--- a/toolkit/crashreporter/injector/moz.build
+++ b/toolkit/crashreporter/injector/moz.build
@@ -8,8 +8,10 @@ SOURCES += [
     'injector.cpp',
 ]
 
 LIBRARY_NAME = 'breakpadinjector'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FORCE_SHARED_LIB = True
+
+USE_STATIC_LIBS = True
--- a/toolkit/mozapps/plugins/tests/Makefile.in
+++ b/toolkit/mozapps/plugins/tests/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/.
 
 TESTROOT = $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
-USE_STATIC_LIBS = 1
 
 MOCHITEST_BROWSER_FILES = \
   $(filter disabled-for-leaks--bug-751100, browser_bug435788.js) \
   pfs_bug435788_1.rdf \
   pfs_bug435788_2.rdf \
   GoodExtension.xpi \
   BadExtension.xpi \
   $(NULL)
--- a/toolkit/mozapps/plugins/tests/moz.build
+++ b/toolkit/mozapps/plugins/tests/moz.build
@@ -7,8 +7,10 @@
 SIMPLE_PROGRAMS = [
     'BadPlugin',
     'GoodPlugin',
 ]
 
 SOURCES += [
     '%s.cpp' % s for s in SIMPLE_PROGRAMS
 ]
+
+USE_STATIC_LIBS = True
deleted file mode 100644
--- a/toolkit/mozapps/update/common-standalone/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/.
-
-ifeq ($(OS_ARCH),WINNT)
-USE_STATIC_LIBS = 1
-endif
--- a/toolkit/mozapps/update/common-standalone/moz.build
+++ b/toolkit/mozapps/update/common-standalone/moz.build
@@ -2,8 +2,11 @@
 # 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 = 'updatecommon-standalone'
 
 srcdir = '../common'
 
 include('../common/sources.mozbuild')
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+    USE_STATIC_LIBS = True
--- a/toolkit/mozapps/update/tests/Makefile.in
+++ b/toolkit/mozapps/update/tests/Makefile.in
@@ -74,19 +74,16 @@ LOCAL_INCLUDES += \
 MOZ_WINCONSOLE = 1
 
 ifeq ($(OS_ARCH),WINNT)
 LIBS += $(call EXPAND_LIBNAME_PATH,updatecommon-standalone,../common-standalone)
 else
 LIBS += $(call EXPAND_LIBNAME_PATH,updatecommon,../common)
 endif
 
-ifeq ($(OS_ARCH),WINNT)
-USE_STATIC_LIBS = 1
-endif # WINNT
 endif # Not Android
 
 include $(topsrcdir)/config/rules.mk
 
 ifneq (android,$(MOZ_WIDGET_TOOLKIT))
 # TestAUSReadStrings runs during check in the following directory with a Unicode
 # char in order to test bug 473417 on Windows.
 ifeq ($(OS_ARCH),WINNT)
--- a/toolkit/mozapps/update/tests/moz.build
+++ b/toolkit/mozapps/update/tests/moz.build
@@ -32,8 +32,9 @@ if CONFIG['MOZ_MAINTENANCE_SERVICE']:
     DEFINES['MOZ_MAINTENANCE_SERVICE'] = CONFIG['MOZ_MAINTENANCE_SERVICE']
 
 # For debugging purposes only
 #DEFINES['DISABLE_UPDATER_AUTHENTICODE_CHECK'] = True
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DEFINES['UNICODE'] = True
     DEFINES['_UNICODE'] = True
+    USE_STATIC_LIBS = True
--- a/toolkit/mozapps/update/updater/Makefile.in
+++ b/toolkit/mozapps/update/updater/Makefile.in
@@ -20,17 +20,16 @@ endif
 
 LIBS += \
   $(call EXPAND_LIBNAME_PATH,mar,$(DEPTH)/modules/libmar/src) \
   $(MOZ_BZ2_LIBS) \
   $(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 LIBS += $(call EXPAND_LIBNAME_PATH,verifymar,$(DEPTH)/modules/libmar/verify)
-USE_STATIC_LIBS = 1
 RCINCLUDE = updater.rc
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 ws2_32 shell32 shlwapi)
 ifndef GNU_CC
 RCFLAGS += -I$(srcdir)
 else
 RCFLAGS += --include-dir $(srcdir)
 endif
 
--- a/toolkit/mozapps/update/updater/moz.build
+++ b/toolkit/mozapps/update/updater/moz.build
@@ -17,16 +17,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     have_progressui = 1
     SOURCES += [
         'loaddlls.cpp',
         'progressui_win.cpp',
         'win_dirent.cpp',
     ]
     DEFINES['UNICODE'] = True
     DEFINES['_UNICODE'] = True
+    USE_STATIC_LIBS = True
 
 if CONFIG['MOZ_ENABLE_GTK']:
     have_progressui = 1
     SOURCES += [
         'progressui_gtk.cpp',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
--- a/toolkit/xre/test/win/Makefile.in
+++ b/toolkit/xre/test/win/Makefile.in
@@ -6,17 +6,16 @@ OS_LIBS += $(call EXPAND_LIBNAME,comctl3
 
 LOCAL_INCLUDES += \
   -I$(srcdir) \
   -I$(topsrcdir)/toolkit/xre \
   -I$(topsrcdir)/config \
   $(NULL)
 
 MOZ_WINCONSOLE = 1
-USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
 libs:: TestXREMakeCommandLineWin.ini
 	$(INSTALL) $^ $(FINAL_TARGET)/
 
 check::
 	@echo 'Running TestXREMakeCommandLineWin tests'
--- a/toolkit/xre/test/win/moz.build
+++ b/toolkit/xre/test/win/moz.build
@@ -9,8 +9,10 @@ SIMPLE_PROGRAMS = [
     'TestXREMakeCommandLineWin',
 ]
 
 SOURCES += [
     '%s.cpp' % s for s in SIMPLE_PROGRAMS
 ]
 
 DEFINES['NS_NO_XPCOM'] = True
+
+USE_STATIC_LIBS = True
--- a/webapprt/win/Makefile.in
+++ b/webapprt/win/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/.
 
-# Statically link against the CRT
-USE_STATIC_LIBS = 1
 # Don't create a dependency on mozglue, which is impossible (difficult?)
 # to dynamically link into our executable, as we copy it to arbitrary locations.
 MOZ_GLUE_LDFLAGS =
 
 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build
 LOCAL_INCLUDES += -I$(DEPTH)/build
--- a/webapprt/win/moz.build
+++ b/webapprt/win/moz.build
@@ -6,8 +6,11 @@
 
 PROGRAM = 'webapprt-stub'
 
 SOURCES += [
     'webapprt.cpp',
 ]
 
 DEFINES['XPCOM_GLUE'] = True
+
+# Statically link against the CRT
+USE_STATIC_LIBS = True
--- a/xpcom/glue/nomozalloc/Makefile.in
+++ b/xpcom/glue/nomozalloc/Makefile.in
@@ -1,21 +1,16 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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/.
 
 
 DIST_INSTALL	= 1
 
-# Pretend we're statically linking the CRT, even though we might not be: this
-# avoids "msvcrp" and assembly dependencies from creeping into the directives
-# for this library on Windows.
-USE_STATIC_LIBS = 1
-
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 STL_FLAGS       =
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
--- a/xpcom/glue/nomozalloc/moz.build
+++ b/xpcom/glue/nomozalloc/moz.build
@@ -30,8 +30,12 @@ if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
 
 DEFINES['MOZ_NO_MOZALLOC'] = True
 
 LOCAL_INCLUDES += [
     '../../build',
 ]
 
+# Pretend we're statically linking the CRT, even though we might not be: this
+# avoids "msvcrp" and assembly dependencies from creeping into the directives
+# for this library on Windows.
+USE_STATIC_LIBS = True
--- a/xpcom/glue/standalone/staticruntime/Makefile.in
+++ b/xpcom/glue/standalone/staticruntime/Makefile.in
@@ -1,18 +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/.
 
 
 DIST_INSTALL	= 1
 
-# Statically link to the CRT on Windows
-USE_STATIC_LIBS = 1
-
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 STL_FLAGS	=
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives in obj files about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
--- a/xpcom/glue/standalone/staticruntime/moz.build
+++ b/xpcom/glue/standalone/staticruntime/moz.build
@@ -29,8 +29,10 @@ DEFINES['XPCOM_GLUE'] = True
 
 if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
 
 LOCAL_INCLUDES += [
     '../../../build',
 ]
 
+# Statically link to the CRT on Windows
+USE_STATIC_LIBS = True
--- a/xpcom/glue/staticruntime/Makefile.in
+++ b/xpcom/glue/staticruntime/Makefile.in
@@ -1,19 +1,16 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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/.
 
 
 DIST_INSTALL	= 1
 
-# Statically link to the CRT on Windows
-USE_STATIC_LIBS = 1
-
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 STL_FLAGS	=
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
--- a/xpcom/glue/staticruntime/moz.build
+++ b/xpcom/glue/staticruntime/moz.build
@@ -27,8 +27,10 @@ if CONFIG['_MSC_VER']:
 
 if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
 
 LOCAL_INCLUDES += [
     '../../build',
 ]
 
+# Statically link to the CRT on Windows
+USE_STATIC_LIBS = True
--- a/xulrunner/stub/Makefile.in
+++ b/xulrunner/stub/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/.
 
-# Statically link against the RTL on windows
-USE_STATIC_LIBS = 1
 # Don't create a dependency on mozglue
 MOZ_GLUE_LDFLAGS =
 
 LOCAL_INCLUDES = \
   -I$(topsrcdir)/xpcom/build \
   -I$(topsrcdir)/xpcom/base \
   $(NULL)
 
--- a/xulrunner/stub/moz.build
+++ b/xulrunner/stub/moz.build
@@ -13,8 +13,11 @@ PROGRAM = CONFIG['XULRUNNER_STUB_NAME']
 SOURCES += [
     'nsXULStub.cpp',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     FINAL_TARGET = 'dist/XUL.framework/Versions/%(MOZILLA_VERSION)s' % CONFIG
 
 DEFINES['XPCOM_GLUE'] = True
+
+# Statically link against the RTL on windows
+USE_STATIC_LIBS = True