summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-08-18 14:17:15 -0400
committerAndrew Morrow <acm@mongodb.com>2015-08-18 14:24:12 -0400
commitce9d96d6a17282fda5d5434db47ffb9bf906d315 (patch)
tree6c9111f2be4c0c2d653f804f95ee8d27bf423386
parent4781c5ab81d3da420ff6f5c77da1e18e46d8deaf (diff)
downloadmongo-ce9d96d6a17282fda5d5434db47ffb9bf906d315.tar.gz
SERVER-18432 Fail doomed attempts to use SCons Variables when building 2.6
-rw-r--r--SConstruct18
1 files changed, 17 insertions, 1 deletions
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"):