systemd generators: Install depending on location for systemd unit files

While it is possible to configure the systemd unit files directory on
configure time with --with-systemd=unit-dir-path, this path is not taken
into account for installing the systemd unit generators, as they are
installed unconditionally in /usr/lib/systemd/system-generators.

Signed-off-by: Salvatore Bonaccorso <>
Signed-off-by: Steve Dickson <>
diff --git a/systemd/ b/systemd/
index dd94f02..e7f5d81 100644
--- a/systemd/
+++ b/systemd/
@@ -53,7 +53,7 @@
 man7_MANS	=
 EXTRA_DIST = $(unit_files) $(man5_MANS) $(man7_MANS)
-generator_dir = /usr/lib/systemd/system-generators
+generator_dir = $(unitdir)/../system-generators
 EXTRA_PROGRAMS	= nfs-server-generator rpc-pipefs-generator
 genexecdir = $(generator_dir)