From d8f26e8402bbe19820545db90394f657ae42e598 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Jul 2016 10:04:18 +0200 Subject: Save default/hinted ar/ld/rc values as commented out This way, when we, for example, change the C++ compiler (which hinted these values), they will be automatically adjusted as well. --- build2/config/utility | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'build2/config/utility') diff --git a/build2/config/utility b/build2/config/utility index c47cecf..c1ccc0f 100644 --- a/build2/config/utility +++ b/build2/config/utility @@ -22,6 +22,7 @@ namespace build2 // 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" to the default value on this root scope. + // See save_variable() for more information on save_flags. // // Return the reference to the value as well as the indication of whether // the value is "new", that is, it was set to the default value (inherited @@ -34,25 +35,30 @@ namespace build2 required (scope& root, const variable&, const T& default_value, - bool override = false); + bool override = false, + uint64_t save_flags = 0); template inline pair, bool> required (scope& root, const string& name, const T& default_value, - bool override = false) + bool override = false, + uint64_t save_flags = 0) { - return required (root, var_pool.find (name), default_value, override); + return required ( + root, var_pool.find (name), default_value, override, save_flags); } inline pair, bool> required (scope& root, const string& name, const char* default_value, - bool override = false) + bool override = false, + uint64_t save_flags = 0) { - return required (root, name, string (default_value), override); + return required ( + root, name, string (default_value), override, save_flags); } // As above, but leave the unspecified value as undefined (and return @@ -116,8 +122,10 @@ namespace build2 unconfigured (scope& root, const string& ns, bool); // Enter the variable so that it is saved during configuration. See - // config::module. + // config::module for details. // + const uint64_t save_commented = 0x01; // Save default value as commented. + void save_variable (scope& root, const variable&, uint64_t flags = 0); } -- cgit v1.1