From: Sebastian Schuberth Date: Thu, 05 Feb 2015 20:52:44 GMT Subject: Re: [PATCH 1/2] Makefile: Use the same source directory for "ln -s" as for "ln" / "cp" Message-ID: In-Reply-To: <20150205204534.GE15326@peff.net> On Thu, Feb 5, 2015 at 9:45 PM, Jeff King wrote: >> endif >> ········$(RM)·"$$execdir/$$p"·&&·\ >> ········test·-z·"$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)"·&&·\ >> ········ln·"$$bindir/$$p"·"$$execdir/$$p"·2>/dev/null·||·\ >> +········ln·-s·"../$$p"·"$$execdir/$$p"·2>/dev/null·||·\ >> ········cp·"$$bindir/$$p"·"$$execdir/$$p"·||·exit;·\ >> ······done;·\ >> ····}·&&·\ >> --· >> >> does not seem to be correct in all cases. > > Ah, I see. Yeah, you'd have to calculate that relative path between > $bindir and $execdir. We have C code already to do that (see > relative_path() in path.c), so in theory you could build a wrapper > during the build phase and then run: > > ln -s $(./my-wrapper "$bindir" "$execdir")/$p $execdir/$p > > or something during the install phase. Thanks for pointing out the C code to do that. But IMO creating and using such a wrapper is not worth the effort. -- Sebastian Schuberth