Signed-off-by: Łukasz Stelmach <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: MyungJoo Ham <[email protected]>
Cc: Piort Bereza <[email protected]>
Cc: Karol Lewandowski <[email protected]>
Cc: Lennart Poettering <[email protected]>
Cc: Zbigniew Jędrzejewski-Szmek <[email protected]>
Cc: Peter Hutterer <[email protected]>
Cc: walter harms <[email protected]>
Cc: Alan Coopersmith <[email protected]>
---
 configure.ac            |   28 ++++++++++++++++++++++++++++
 include/dix-config.h.in |    3 +++
 2 files changed, 31 insertions(+)

diff --git a/configure.ac b/configure.ac
index 89a7a9d..c1c4dc0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -832,6 +832,34 @@ AC_SUBST(SDK_REQUIRED_MODULES)
 
 REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO 
$SDK_REQUIRED_MODULES"
 
+#
+# systemd socket activation
+#
+# activate the code in libxtrans that grabs sockets' file-descriptors
+# instead of creating them.
+#
+AC_ARG_WITH([systemd],
+       AS_HELP_STRING([--with-systemd], [support systemd socket activation]),
+       [], [with_systemd=check])
+have_systemd=check
+if test "x$with_systemd" != "xno"; then
+       PKG_CHECK_MODULES([systemd], [libsystemd-daemon],
+               [AC_DEFINE(HAVE_SYSTEMD, 1, [Define if libsystemd-daemon is 
available])
+               have_systemd=yes;],
+               [have_systemd=no])
+       if test "x$with_systemd" = "xyes" -a "x$have_systemd" = "xno"; then
+               AC_MSG_ERROR([systemd support requested but no library has been 
found])
+       fi
+fi
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$have_systemd" = "xyes"])
+if test "x$have_systemd" = "xyes"; then
+       SAVE_LIBS=$LIBS
+       LIBS="$systemd_LIBS"
+       AC_CHECK_FUNCS([sd_listen_fds], [], [AC_MSG_ERROR([sd_listen_fds() is 
missing from libsystemd-daemon])])
+       LIBS=$SAVE_LIBS
+       REQUIRED_LIBS="$REQUIRED_LIBS libsystemd-daemon"
+fi
+
 if test "x$CONFIG_UDEV" = xyes &&
  { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then
        AC_MSG_ERROR([Hotplugging through both libudev and dbus/hal not 
allowed])
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index a643dfc..841d4ed 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -196,6 +196,9 @@
 /* Define to 1 if you have the `strndup' function. */
 #undef HAVE_STRNDUP
 
+/* Define if libsystemd-daemon is available */
+#undef HAVE_SYSTEMD
+
 /* Define to 1 if SYSV IPC is available */
 #undef HAVE_SYSV_IPC
 
-- 
1.7.9.5

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to