diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-22 10:45:51 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-03-22 10:45:51 +0200 |
commit | f62b8809d827a0474284e75ad5724cf201ed83b1 (patch) | |
tree | d02997fa52b5b5b6d87c128d13c22a09a6cfc68d /libbuild2/install | |
parent | 861c18230d1597c77bb1659b220dd6dfc564b8f2 (diff) |
Initial work on relocatable install: config.install.relocatable and rpath
Diffstat (limited to 'libbuild2/install')
-rw-r--r-- | libbuild2/install/init.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libbuild2/install/init.cxx b/libbuild2/install/init.cxx index 92c2790..a3155d1 100644 --- a/libbuild2/install/init.cxx +++ b/libbuild2/install/init.cxx @@ -421,9 +421,9 @@ namespace build2 using config::lookup_config; using config::specified_config; - // Note: ignore config.install.scope (see below). + // Note: ignore config.install.{scope,manifest} (see below). // - bool s (specified_config (rs, "install", {"scope"})); + bool s (specified_config (rs, "install", {"scope", "manifest"})); // Adjust module priority so that the (numerous) config.install.* // values are saved at the end of config.build. @@ -582,6 +582,27 @@ namespace build2 } } + // Support for relocatable install. + // + // Note that it is false by default since supporting relocatable + // installation may require extra effort and not all projects may + // support it. A project that is known not to support it should assert + // this fact in its root.build, for example: + // + // assert (!$install.relocatable) 'relocatable installation not supported' + // + { + auto& var (vp.insert<bool> ( "install.relocatable")); + auto& cvar (vp.insert<bool> ("config.install.relocatable")); + + value& v (rs.assign (var)); + + // Note: unlike other variables, for ease of assertion set it to + // false if no config.install.* is specified. + // + v = s && cast_false<bool> (lookup_config (rs, cvar, false)); + } + // Global config.install.* values. // set_dir (s, p, rs, "", abs_dir_path (), false, "644", "755", cmd); |