aboutsummaryrefslogtreecommitdiff
path: root/build2/bin
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-04-04 10:58:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-04-04 10:58:36 +0200
commit39a17ba7ef506192218f24047f129cb635efb02b (patch)
tree454ce4d2a11554a47c7f7dc6ecb4efe9d91199fc /build2/bin
parent6e126ac30038502acf7016f0e76b3183f1304042 (diff)
Add ability to disable automatic rpath, support for custom rpath-link
Specifically, the new config.bin.rpath.auto variable can be used to disable automatic addition of prerequisite library rpaths, for example: $ b config.bin.rpath.auto=false Note that in this case rpath-link is still added where normally required and for targets that support it (Linux and *BSD). The new config.bin.rpath_link and config.bin.rpath_link.auto have the same semantics as config.bin.rpath* but for rpath-link.
Diffstat (limited to 'build2/bin')
-rw-r--r--build2/bin/init.cxx47
1 files changed, 43 insertions, 4 deletions
diff --git a/build2/bin/init.cxx b/build2/bin/init.cxx
index 52197d2..f334769 100644
--- a/build2/bin/init.cxx
+++ b/build2/bin/init.cxx
@@ -61,11 +61,25 @@ namespace build2
vp.insert<string> ("config.bin.target", true);
vp.insert<string> ("config.bin.pattern", true);
+ // Library types to build.
+ //
vp.insert<string> ("config.bin.lib", true);
+
+ // Library types to use (in priority order).
+ //
vp.insert<strings> ("config.bin.exe.lib", true);
vp.insert<strings> ("config.bin.liba.lib", true);
vp.insert<strings> ("config.bin.libs.lib", true);
- vp.insert<dir_paths> ("config.bin.rpath", true);
+
+ // The rpath[_link].auto flag controls automatic rpath behavior, for
+ // example, addition of rpaths for prerequisite libraries (see the cc
+ // module for an example). Default is true.
+ //
+ vp.insert<dir_paths> ("config.bin.rpath", true);
+ vp.insert<bool> ("config.bin.rpath.auto", true);
+
+ vp.insert<dir_paths> ("config.bin.rpath_link", true);
+ vp.insert<bool> ("config.bin.rpath_link.auto", true);
vp.insert<string> ("config.bin.prefix", true);
vp.insert<string> ("config.bin.suffix", true);
@@ -75,10 +89,16 @@ namespace build2
vp.insert<string> ("config.bin.exe.suffix", true);
vp.insert<string> ("bin.lib");
+
vp.insert<strings> ("bin.exe.lib");
vp.insert<strings> ("bin.liba.lib");
vp.insert<strings> ("bin.libs.lib");
+
vp.insert<dir_paths> ("bin.rpath");
+ vp.insert<bool> ("bin.rpath.auto");
+
+ vp.insert<dir_paths> ("bin.rpath_link");
+ vp.insert<bool> ("bin.rpath_link.auto");
// Link whole archive. Note: non-overridable with target visibility.
//
@@ -183,14 +203,33 @@ namespace build2
v = *required (rs, "config.bin.libs.lib", libs_lib).first;
}
- // config.bin.rpath
+ // config.bin.rpath[_link]
//
- // This one is optional and we merge it into bin.rpath, if any.
- // See the cxx module for details on merging.
+ // These ones are optional and we merge them into bin.rpath[_link], if
+ // any.
//
rs.assign ("bin.rpath") += cast_null<dir_paths> (
optional (rs, "config.bin.rpath"));
+ rs.assign ("bin.rpath_link") += cast_null<dir_paths> (
+ optional (rs, "config.bin.rpath_link"));
+
+ // config.bin.rpath[_link].auto
+ //
+ {
+ lookup l;
+
+ rs.assign ("bin.rpath.auto") =
+ (l = omitted (rs, "config.bin.rpath.auto").first)
+ ? cast<bool> (l)
+ : true;
+
+ rs.assign ("bin.rpath_link.auto") =
+ (l = omitted (rs, "config.bin.rpath_link.auto").first)
+ ? cast<bool> (l)
+ : true;
+ }
+
// config.bin.{lib,exe}.{prefix,suffix}
//
// These ones are not used very often so we will omit them from the