diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-13 13:29:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-13 13:29:54 +0200 |
commit | 2da6777d14a1cf600891cdeee6202d692eae48f9 (patch) | |
tree | 756cf03db8fceebeaec088f1167aad64ce81a74d /build2/cc/install.cxx | |
parent | 8632a68385258e43f73c91a0106b34dcd3f8d733 (diff) |
Implement support for chroot'ed install (aka DESTDIR)
For example:
b config.install.root=/usr config.install.chroot=/tmp/install
The difference between doing just config.install.root=/tmp/install/usr is
that everything is installed "as if" into /usr. So, for example, pkg-config
files will contain -I/usr/include, -L/usr/lib, etc.
Diffstat (limited to 'build2/cc/install.cxx')
-rw-r--r-- | build2/cc/install.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/build2/cc/install.cxx b/build2/cc/install.cxx index 050ab1e..b0f7e14 100644 --- a/build2/cc/install.cxx +++ b/build2/cc/install.cxx @@ -117,11 +117,12 @@ namespace build2 { // Here we may have a bunch of symlinks that we need to install. // + const scope& rs (t.root_scope ()); auto& lp (t.data<link::libs_paths> ()); - auto ln = [&id] (const path& f, const path& l) + auto ln = [&rs, &id] (const path& f, const path& l) { - install_l (id, f.leaf (), l.leaf (), false); + install_l (rs, id, f.leaf (), l.leaf (), false); }; const path& lk (lp.link); @@ -145,11 +146,12 @@ namespace build2 { // Here we may have a bunch of symlinks that we need to uninstall. // + const scope& rs (t.root_scope ()); auto& lp (t.data<link::libs_paths> ()); - auto rm = [&id] (const path& l) + auto rm = [&rs, &id] (const path& l) { - return uninstall_f (id, nullptr, l.leaf (), false); + return uninstall_f (rs, id, nullptr, l.leaf (), false); }; const path& lk (lp.link); |