From 5f29fc16fb85a934280e00e54bc6307685c4e05d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Dec 2015 09:43:38 +0200 Subject: Add support for specifying additional rpath's For example: b config.bin.rpath=/usr/local/lib --- build/cxx/link.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'build/cxx') diff --git a/build/cxx/link.cxx b/build/cxx/link.cxx index f489a0d..7d6b15e 100644 --- a/build/cxx/link.cxx +++ b/build/cxx/link.cxx @@ -746,6 +746,7 @@ namespace build scope& rs (t.root_scope ()); cstrings args; string storage1; + strings rpaths; if (lt == type::a) { @@ -767,6 +768,18 @@ namespace build args.push_back ("-o"); args.push_back (relt.string ().c_str ()); + if (auto l = t["bin.rpath"]) + { + const auto& ps (as (*l)); + rpaths.reserve (ps.size ()); // Make sure no reallocations. + + for (const string& p: ps) + { + rpaths.push_back ("-Wl,-rpath," + p); + args.push_back (rpaths.back ().c_str ()); + } + } + append_options (args, t, "cxx.loptions"); } -- cgit v1.1