Bug 1265460 - Don't allow building with VS2013 unless a configure argument is present; r?ted
We don't have automation coverage of VS2013 any more. We want developers
to be using the same toolchain we use in automation.
This patch prods people towards VS2015 by requiring the newly-introduced
--enable-legacy-toolchain flag to build with VS2013.
Yes, the version checking should live in toolchain.configure. However,
the existing code is in old-configure.in and I didn't want to bloat
scope by porting the code to toolchain.configure.
MozReview-Commit-ID: FCyUacwMo09
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -143,16 +143,20 @@ def toolchain_prefix(value, target, host
return '%s-' % target.toolchain
set_config('TOOLCHAIN_PREFIX', toolchain_prefix)
add_old_configure_assignment('TOOLCHAIN_PREFIX', toolchain_prefix)
# Compilers
# ==============================================================
+option('--enable-legacy-toolchain', env='MOZ_ENABLE_LEGACY_TOOLCHAIN',
+ help='Allow building with legacy toolchains')
+
+@depends('--enable-legacy-toolchain')
@imports('os')
@imports('subprocess')
@imports(_from='mozbuild.configure.util', _import='LineIO')
@imports(_from='mozbuild.shellutil', _import='quote')
@imports(_from='tempfile', _import='mkstemp')
@imports(_from='textwrap', _import='dedent')
def check_compiler(compiler, language):
check = dedent('''\
--- a/old-configure.in
+++ b/old-configure.in
@@ -359,16 +359,19 @@ case "$target" in
AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
fi
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI.
if test "$_CC_MAJOR_VERSION" = "18" -a "$_CC_BUILD_VERSION" -ge "30723"; then
+ if [ -z "$MOZ_ENABLE_LEGACY_TOOLCHAIN" ]; then
+ AC_MSG_ERROR([Visual Studio 2015 is required to build; override this warning by adding --enable-legacy-toolchain])
+ fi
_CC_SUITE=12
MSVS_VERSION=2013
MSVC_C_RUNTIME_DLL=msvcr120.dll
MSVC_CXX_RUNTIME_DLL=msvcp120.dll
elif test "$_CC_MAJOR_VERSION" = "19" -a "$_CC_BUILD_VERSION" -ge "23506"; then
_CC_SUITE=14
MSVS_VERSION=2015
MSVC_C_RUNTIME_DLL=vcruntime140.dll