diff options
Diffstat (limited to 'tools/build/v2/build_system.py')
-rw-r--r-- | tools/build/v2/build_system.py | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/tools/build/v2/build_system.py b/tools/build/v2/build_system.py index 55d8b806ca..cc1a61b2fb 100644 --- a/tools/build/v2/build_system.py +++ b/tools/build/v2/build_system.py @@ -20,6 +20,7 @@ from b2.util.sequence import unique import b2.build.build_request from b2.build.errors import ExceptionWithUserContext import b2.tools.common +from b2.build.toolset import using import b2.build.project as project import b2.build.virtual_target as virtual_target @@ -290,6 +291,9 @@ def load_configuration_files(): initialize_config_module('user-config') if not test_config and not legacy_ignore_config: + # Here, user_config has value of None if nothing is explicitly + # specified, and value of '' if user explicitly does not want + # to load any user config. user_config = None for a in sys.argv: m = re.match("--user-config=(.*)$", a) @@ -297,30 +301,32 @@ def load_configuration_files(): user_config = m.group(1) break - if not user_config: + if user_config is None: user_config = os.getenv("BOOST_BUILD_USER_CONFIG") # Special handling for the case when the OS does not strip the quotes # around the file name, as is the case when using Cygwin bash. user_config = b2.util.unquote(user_config) explicitly_requested = user_config - if not user_config: + + if user_config is None: user_config = "user-config.jam" - if explicitly_requested: + if user_config: + if explicitly_requested: - user_config = os.path.abspath(user_config) + user_config = os.path.abspath(user_config) - if debug_config: - print "notice: Loading explicitly specified user configuration file:" - print " " + user_config + if debug_config: + print "notice: Loading explicitly specified user configuration file:" + print " " + user_config - load_config('user-config', os.path.basename(user_config), [os.path.dirname(user_config)], True) + load_config('user-config', os.path.basename(user_config), [os.path.dirname(user_config)], True) + else: + load_config('user-config', os.path.basename(user_config), user_path) else: - load_config('user-config', os.path.basename(user_config), user_path) - - elif debug_config: - print "notice: User configuration file loading explicitly disabled." ; + if debug_config: + print "notice: User configuration file loading explicitly disabled." # We look for project-config.jam from "." upward. # I am not sure this is 100% right decision, we might as well check for @@ -381,7 +387,10 @@ def process_explicit_toolset_requests(): if debug_config: print "notice: [cmdline-cfg] toolset '%s' not previously configured; attempting to auto-configure now" % toolset_version - toolset.using(toolset, version) + if version is not None: + using(toolset, version) + else: + using(toolset) else: @@ -515,7 +524,7 @@ def main_real(): print "warning: For more configuration options, please consult" print "warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html" - toolset.using(dt, dtv) + using(dt, dtv) # Parse command line for targets and properties. Note that this requires # that all project files already be loaded. |