From ce9d96d6a17282fda5d5434db47ffb9bf906d315 Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Tue, 18 Aug 2015 14:17:15 -0400 Subject: SERVER-18432 Fail doomed attempts to use SCons Variables when building 2.6 --- SConstruct | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 6657d605904..bc1fc314f7b 100644 --- a/SConstruct +++ b/SConstruct @@ -450,7 +450,17 @@ asio = has_option( "asio" ) usePCH = has_option( "usePCH" ) -env = Environment( BUILD_DIR=variantDir, +# On 3.0 and beyond, we honor several scons Variables on the command +# line. Those don't exist on 2.6, but it is easy to get in the habit +# of using them. By default SCons silently ignores them, which can be +# very confusing if you say 'scons CC=clang' on the v2.6 branch, for +# instance. We create an empty Variables object here and feed it to +# the Environment constructor so that we can ask for any unknown +# variables (and all should be), below. +env_vars = Variables() + +env = Environment( variables=env_vars, + BUILD_DIR=variantDir, DIST_ARCHIVE_SUFFIX='.tgz', EXTRAPATH=get_option("extrapath"), MODULE_BANNERS=[], @@ -472,6 +482,12 @@ env = Environment( BUILD_DIR=variantDir, CONFIGURELOG = '#' + scons_data_dir + '/config.log' ) +# Report any unknown variables as an error. +unknown_vars = env_vars.UnknownVariables() +if unknown_vars: + print "Unknown variables specified: {0}".format(", ".join(unknown_vars.keys())) + Exit(1) + if has_option("cache"): EnsureSConsVersion( 2, 3, 0 ) if has_option("release"): -- cgit v1.2.1