From e9f69e067da3e096e1e64be70ec2b6de30f71d2c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 7 Apr 2021 11:33:05 +0200 Subject: Register environment variables for hermetic build configurations --- build2/b-options.cxx | 5 +++-- build2/b.cli | 8 +++++++- build2/b.cxx | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'build2') diff --git a/build2/b-options.cxx b/build2/b-options.cxx index 17b791e..096aebc 100644 --- a/build2/b-options.cxx +++ b/build2/b-options.cxx @@ -1634,8 +1634,9 @@ namespace build2 << ::std::endl << "\033[1mEXIT STATUS\033[0m" << ::std::endl << ::std::endl - << "Non-zero exit status is returned in case of an error." << ::std::endl - << ::std::endl + << "Non-zero exit status is returned in case of an error." << ::std::endl; + + os << std::endl << "\033[1mENVIRONMENT\033[0m" << ::std::endl << ::std::endl << "The \033[1mHOME\033[0m environment variable is used to determine the user's home directory." << ::std::endl diff --git a/build2/b.cli b/build2/b.cli index a24837c..0ce0f9e 100644 --- a/build2/b.cli +++ b/build2/b.cli @@ -724,7 +724,12 @@ namespace build2 \h|EXIT STATUS| Non-zero exit status is returned in case of an error. + " + // NOTE: remember to update --build2-metadata output if adding any relevant + // new environment variables. + // + " \h|ENVIRONMENT| The \cb{HOME} environment variable is used to determine the user's home @@ -739,5 +744,6 @@ namespace build2 The \cb{BUILD2_DEF_OPT} environment variable is used to suppress loading of default options files in nested build system driver invocations. Its values - are \cb{false} or \cb{0} to suppress and \cb{true} or \cb{1} to load." + are \cb{false} or \cb{0} to suppress and \cb{true} or \cb{1} to load. + " } diff --git a/build2/b.cxx b/build2/b.cxx index ba89931..b07dd0e 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -606,6 +606,7 @@ main (int argc, char* argv[]) << "b.name = [string] b" << endl << "b.version = [string] '" << LIBBUILD2_VERSION_FULL << '\'' << endl << "b.checksum = [string] '" << LIBBUILD2_VERSION_FULL << '\'' << endl + << "b.environment = [strings] BUILD2_VAR_OVR BUILD2_DEF_OPT" << endl << "b.static = [bool] " << #ifdef LIBBUILD2_STATIC "true" -- cgit v1.1