Wouter Verhelst <w...@uter.be> writes: > On Tue, May 24, 2016 at 06:11:47PM +0200, Mathieu Lirzin wrote: >> >> ‘systemdsystemunitdir’ seems not affected by DESTDIR because IIUC >> PKG_CHECK_VAR set it to something like "/lib/systemd/system" instead of >> "${libdir}/systemd/system". >> >> I suppose it would work better to define it manually like >> this: >> >> if SYSTEMD >> systemdunitdir = $(libdir)/systemd/system >> systemdunit_DATA = nbd@.service >> endif > > Well. That would work, yes, but it wouldn't work *better*. The whole > point is that I do not want to hardcode such things, so that if a user > installs systemd units in </usr/local/brokenstuff/systemd> and the > pkg-config files are where they need to be, everything works as expected.
You are right, that would be better. My understanding is that pkg-config files are supposed to define variables in terms of 'prefix' as described in pkg-config(1) --8<---------------cut here---------------start------------->8--- prefix=/home/hp/unst # this defines a variable exec_prefix=${prefix} # defining another variable in terms of the first libdir=${exec_prefix}/lib includedir=${prefix}/include --8<---------------cut here---------------end--------------->8--- but “systemd.pc” isn't doing that. > I was under the impression that automake looks at DESTDIR for every > foodir it looks at, but apparently that's not the case then? That seems > broken; after all, I don't think a staging directory should depend on > whether or not something was part of a given prefix. Is there any > explanation available somewhere on why this behaviour occurs? Would a > patch that changes this behaviour be acceptable? Every default installation directories are expected to be subdirectories of the 'prefix' variable. This is verified by ‘make distcheck’ and specified in GNU coding standards: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html#Directory-Variables So it is unlikely that a patch is going to be accepted in Automake. However I guess the default pkg-config file could be fixed in Systemd. Thanks, -- Mathieu Lirzin