From 0342dc2fcdd78ef28a4e59d84193a3807068d726 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Apr 2016 07:57:19 +0200 Subject: New configuration logic, iteration 1 --- build2/config/utility | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'build2/config/utility') diff --git a/build2/config/utility b/build2/config/utility index 9218106..451df30 100644 --- a/build2/config/utility +++ b/build2/config/utility @@ -19,12 +19,14 @@ namespace build2 { // Set, if necessary, a required config.* variable. // - // If override is true and the variable doesn't come from this root - // scope or from the command line, then its value is "overridden" - // for this root scope. + // If override is true and the variable doesn't come from this root scope + // or from the command line (i.e., it is inherited from the amalgamtion), + // then its value is "overridden" for this root scope. // - // Return the reference to the value as well as the indication of - // whether the variable has actually been set. + // Return the reference to the value as well as the indication of whether + // the value is "new", that is, it was either set (including override) or + // it came from the command line and was not inherited. This is usually + // used to test the new value. // template pair, bool> @@ -68,19 +70,6 @@ namespace build2 return optional (root, var_pool.find (var)); } - // As above but assumes the value is dir_path and makes it - // absolute if the value specified on the command line is - // relative. - // - const value& - optional_absolute (scope& root, const variable&); - - inline const value& - optional_absolute (scope& root, const string& var) - { - return optional_absolute (root, var_pool.find (var)); - } - // Check whether there are any variables specified from the config // namespace. The idea is that we can check if there are any, say, // config.install.* values. If there are none, then we can assume @@ -90,10 +79,25 @@ namespace build2 // // Note that this function detects and ignores the special // config.*.configured variable which may be used by a module to - // "remember" that it is unconfigured. + // "remember" that it is unconfigured (e.g., in order to avoid re- + // running the tests, etc). // bool specified (scope& root, const string& ns); + + // + // + bool + unconfigured (scope& root, const string& ns); + + void + unconfigured (scope& root, const string& ns, bool); + + // Enter the variable so that it is saved during configuration. See + // config::module. + // + void + save_variable (scope& root, const variable&, uint64_t flags = 0); } } -- cgit v1.1