From f62b8809d827a0474284e75ad5724cf201ed83b1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 22 Mar 2023 10:45:51 +0200 Subject: Initial work on relocatable install: config.install.relocatable and rpath --- libbuild2/install/init.cxx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'libbuild2/install') 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 ( "install.relocatable")); + auto& cvar (vp.insert ("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 (lookup_config (rs, cvar, false)); + } + // Global config.install.* values. // set_dir (s, p, rs, "", abs_dir_path (), false, "644", "755", cmd); -- cgit v1.1