summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2016-04-06 12:41:36 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-04-15 15:18:01 +0100
commit844a86bebe3673037414398f758aab7c2a013e0a (patch)
tree09df64d2c057645fc6cf12b235cde7a7e01e5715 /SConstruct
parentdf35458a85c99c3838858cd3981fda1ba4ddd2a7 (diff)
downloadmongo-844a86bebe3673037414398f758aab7c2a013e0a.tar.gz
SERVER-23719 Control verbosity with a VERBOSE variable
Also removes the --mute flag (cherry picked from commit 7850673c0303b740ecdd2b8718d8c745e25884b3)
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct32
1 files changed, 23 insertions, 9 deletions
diff --git a/SConstruct b/SConstruct
index 6a53a8f4079..dbf1fb5d824 100644
--- a/SConstruct
+++ b/SConstruct
@@ -129,11 +129,6 @@ def make_variant_dir_generator():
# using the nargs='const' mechanism.
#
-add_option('mute',
- help='do not display commandlines for compiling and linking, to reduce screen noise',
- nargs=0,
-)
-
add_option('prefix',
default='$BUILD_ROOT/install',
help='installation prefix',
@@ -449,8 +444,6 @@ def find_mongo_custom_variables():
for path in sys.path:
probe = os.path.join(path, 'mongo_custom_variables.py')
if os.path.isfile(probe):
- if not has_option('mute'):
- print "Using mongo variable customization file {0}".format(probe)
files.append(probe)
return files
@@ -569,8 +562,12 @@ def variable_distsrc_converter(val):
return val + "/"
return val
+variables_files = variable_shlex_converter(get_option('variables-files'))
+for file in variables_files:
+ print "Using variable customization file %s" % file
+
env_vars = Variables(
- files=variable_shlex_converter(get_option('variables-files')),
+ files=variables_files,
args=ARGUMENTS
)
@@ -710,6 +707,11 @@ env_vars.Add('VARIANT_DIR',
default=default_variant_dir_generator,
)
+env_vars.Add('VERBOSE',
+ help='Control build verbosity (auto, on/off true/false 1/0)',
+ default='auto',
+)
+
# don't run configure if user calls --help
if GetOption('help'):
Return()
@@ -850,6 +852,18 @@ def conf_error(env, msg, *args):
env.AddMethod(fatal_error, 'FatalError')
env.AddMethod(conf_error, 'ConfError')
+# Normalize the VERBOSE Option, and make its value available as a
+# function.
+if env['VERBOSE'] == "auto":
+ env['VERBOSE'] = not sys.stdout.isatty()
+elif env['VERBOSE'] in ('1', "ON", "on", "True", "true", True):
+ env['VERBOSE'] = True
+elif env['VERBOSE'] in ('0', "OFF", "off", "False", "false", False):
+ env['VERBOSE'] = False
+else:
+ env.FatalError("Invalid value {0} for VERBOSE Variable", env['VERBOSE'])
+env.AddMethod(lambda env: env['VERBOSE'], 'Verbose')
+
if has_option('variables-help'):
print env_vars.GenerateHelpText(env)
Exit(0)
@@ -1192,7 +1206,7 @@ if get_option('build-fast-and-loose') == "on" and \
env.Decider('MD5-timestamp')
env.SetOption('max_drift', 1)
-if has_option('mute'):
+if not env.Verbose():
env.Append( CCCOMSTR = "Compiling $TARGET" )
env.Append( CXXCOMSTR = env["CCCOMSTR"] )
env.Append( SHCCCOMSTR = "Compiling $TARGET" )