aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/install
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/install')
-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)
{