[vino] Allow building on non-systemd systems



commit 1538798a89653b8921ca574aebb3f153543b4921
Author: David King <amigadave amigadave com>
Date:   Tue Sep 6 09:36:06 2016 +0200

    Allow building on non-systemd systems
    
    Make installation of the systemd user unit optional, falling back to a
    standard location if the systemd pkg-config file is not available, as
    well as allowing the installation to be entirely disabled.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770759

 .gitignore   |    1 +
 Makefile.am  |    2 ++
 configure.ac |   16 +++++++++-------
 3 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 17d97fd..3bb7495 100644
--- a/.gitignore
+++ b/.gitignore
@@ -53,6 +53,7 @@ Makefile.in
 /server/dbus-interface-glue.h
 /server/vino-server.desktop
 /server/vino-server.desktop.in
+/server/vino-server.service
 /server/org.freedesktop.Telepathy.Client.Vino.service
 /server/libvncserver/*.o
 /server/libvncserver/.deps
diff --git a/Makefile.am b/Makefile.am
index b22ab6f..ddc7538 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -237,12 +237,14 @@ nodist_service_DATA = server/org.freedesktop.Telepathy.Client.Vino.service
 server/org.freedesktop.Telepathy.Client.Vino.service: server/org.freedesktop.Telepathy.Client.Vino.service.in
        $(AM_V_GEN)$(SED) -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@
 
+if INSTALL_USER_UNITS
 systemdservicedir = $(systemduserunitdir)
 systemdservice_in_files = server/vino-server.service.in
 systemdservice_DATA = server/vino-server.service
 
 $(systemdservice_DATA): server/vino-server.service.in Makefile
        $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+endif
 
 applicationsdir = $(datadir)/applications/
 applications_in_files = server/vino-server.desktop.in
diff --git a/configure.ac b/configure.ac
index 7ca22b9..ee04325 100644
--- a/configure.ac
+++ b/configure.ac
@@ -266,14 +266,16 @@ AS_IF([test "x$have_ipv6" = "xyes"],
 AC_MSG_RESULT([$have_ipv6])
 
 dnl systemd user unit directory
-PKG_CHECK_EXISTS([systemd],, [AC_MSG_ERROR([systemd development headers not found])])
 AC_ARG_WITH([systemduserunitdir],
-           AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
-           [],
-           [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)])
-if test x$with_systemduserunitdir != xno; then
-       AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
-fi
+  [AS_HELP_STRING([--with-systemduserunitdir=DIR],
+    [Directory for systemd user service files])],
+  [],
+  [PKG_CHECK_EXISTS([systemd],
+    [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)],
+    [with_systemduserunitdir='${libdir}/systemd/user'])])
+AS_IF([test x$with_systemduserunitdir != xno],
+  [AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])])
+AM_CONDITIONAL([INSTALL_USER_UNITS], [test -n "$with_systemduserunitdir" -a "x$with_systemduserunitdir" != 
xno])
 
 # GNOME libraries
 GTK_VERSION=3.0.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]