Bug 1265460 - Don't allow building with VS2013 unless a configure argument is present; r?ted draft
authorGregory Szorc <gps@mozilla.com>
Mon, 18 Apr 2016 10:07:20 -0700
changeset 352751 7ee2b24fa9fcadbc03db73e19b2f22e7bd316b2f
parent 352736 d53b301a14e1dfa05324072a7159796a4f5e24c7
child 518726 4d61db44da4ab432f46e4781eda48ff0edd739bc
push id15778
push usergszorc@mozilla.com
push dateMon, 18 Apr 2016 17:08:14 +0000
reviewersted
bugs1265460
milestone48.0a1
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
build/moz.configure/toolchain.configure
old-configure.in
--- 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