aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/install/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-15 15:21:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-15 15:21:03 +0200
commita0e2979d91d50b175b08b3f35cda7f75fc10bbac (patch)
tree66b0d015538880933385bf13c23e4e5f290bff6f /libbuild2/install/rule.cxx
parent916769d98afdc7912aa90e2443fb2ac06d46d36e (diff)
Fix bug in mkanylink() usage
Diffstat (limited to 'libbuild2/install/rule.cxx')
-rw-r--r--libbuild2/install/rule.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/libbuild2/install/rule.cxx b/libbuild2/install/rule.cxx
index 90ee7cb..fdbbffa 100644
--- a/libbuild2/install/rule.cxx
+++ b/libbuild2/install/rule.cxx
@@ -873,7 +873,15 @@ namespace build2
if (file_exists (target, false /* follow_symlinks */))
try_rmfile (target);
- mkanylink (target, rell, true /* copy */);
+ // We have to go the roundabout way by adding directory to the
+ // target and then asking for a relative symlink because it may be a
+ // hardlink in which case the target path will be interpreted from
+ // CWD.
+ //
+ mkanylink (rell.directory () / target,
+ rell,
+ true /* copy */,
+ true /* relative */);
}
catch (system_error& e)
{