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 --- libbuild2/install/init.cxx | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'libbuild2/install') diff --git a/libbuild2/install/init.cxx b/libbuild2/install/init.cxx index 769b106..74e9301 100644 --- a/libbuild2/install/init.cxx +++ b/libbuild2/install/init.cxx @@ -313,6 +313,40 @@ namespace build2 vp.insert ("install.subdirs"); } + // Environment. + // + // Installation may involve executing the following programs: + // + // install + // + // GNU coreutils install recognizes the SIMPLE_BACKUP_SUFFIX and + // VERSION_CONTROL variables but they only matter with --backup which + // we do not specify and assume unlikely to be specified via .options. + // + // FreeBSD install recognizes STRIPBIN and DONTSTRIP variables that + // only matter with -s which we do not specify but which could be + // specified with .options. NetBSD and OpenBSD use STRIP (Mac OS man + // page doesn't list anything). + // + // sudo + // + // While sudo has a bunch of SUDO_* variables, none of them appear to + // matter (either not used in the modes that we invoke sudo in or do + // not affect the result). + // + // ln, rm, rmdir + // + // GNU coreutils ln recognizes the SIMPLE_BACKUP_SUFFIX and + // VERSION_CONTROL variables but they only matter with --backup which + // we do not specify. + // +#if defined(__FreeBSD__) + config::save_environment (rs, {"STRIPBIN", "DONTSTRIP"}); +#elif defined(__NetBSD__) || \ + defined(__OpenBSD__) + config::save_environment (rs, "STRIP"); +#endif + // Register our rules. // { -- cgit v1.1