aboutsummaryrefslogtreecommitdiff
path: root/build2/config/utility
diff options
context:
space:
mode:
Diffstat (limited to 'build2/config/utility')
-rw-r--r--build2/config/utility42
1 files changed, 23 insertions, 19 deletions
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 <typename T>
pair<reference_wrapper<const value>, 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);
}
}