]> git.proxmox.com Git - mirror_lxc.git/commitdiff
Get systemd unit dir from pkg-config
authorMartin Pitt <martin.pitt@ubuntu.com>
Thu, 31 Jul 2014 06:53:52 +0000 (08:53 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 4 Aug 2014 19:24:13 +0000 (15:24 -0400)
Don't install systemd unit files into $(prefix), they won't work there.
Instead, get them from systemd's pkg-config file.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
config/init/systemd/Makefile.am
configure.ac

index fc374c520272c8d062924d04bee611e54d5d0bf1..3bd221fc9a152b6468f026320c24d3087e031850 100644 (file)
@@ -3,8 +3,6 @@ EXTRA_DIST = \
        lxc.service
 
 if INIT_SCRIPT_SYSTEMD
-SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
-
 lxc-autostart-helper: ../sysvinit/lxc.in $(top_builddir)/config.status
        $(AM_V_GEN)sed                                          \
            -e 's|[@]SYSCONFDIR[@]|$(sysconfdir)|g'             \
index 4f39054e126ffb38840daa977bc7d15ba04ff2ca..db8e43a71964a269428ec961b4a7ad683234f65a 100644 (file)
@@ -122,6 +122,18 @@ AM_CONDITIONAL([INIT_SCRIPT_SYSTEMD], [echo "$init_script" |grep -q "systemd"])
 AM_CONDITIONAL([INIT_SCRIPT_UPSTART], [echo "$init_script" |grep -q "upstart"])
 AC_MSG_RESULT($init_script)
 
+# systemd unit dir
+AC_ARG_WITH([systemdsystemunitdir],
+            AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+            [],
+            [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test -z "$with_systemdsystemunitdir"; then
+  with_systemdsystemunitdir=/lib/systemd/system
+fi
+if test "x$with_systemdsystemunitdir" != "xno"; then
+  AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
+fi
+
 # Allow disabling rpath
 AC_ARG_ENABLE([rpath],
        [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])],