dbus-enable-elogind.patch 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --- a/dbus/dbus-userdb-util.c 2015-09-30 16:48:40.000000000 +0200
  2. +++ b/dbus/dbus-userdb-util.c 2016-11-03 11:09:42.550520587 +0100
  3. @@ -32,6 +32,9 @@
  4. #if HAVE_SYSTEMD
  5. #include <systemd/sd-login.h>
  6. #endif
  7. +#if HAVE_ELOGIND
  8. +#include <elogind/sd-login.h>
  9. +#endif
  10. /**
  11. * @addtogroup DBusInternalsUtils
  12. @@ -54,7 +57,7 @@
  13. const DBusUserInfo *info;
  14. dbus_bool_t result = FALSE;
  15. -#ifdef HAVE_SYSTEMD
  16. +#if defined(HAVE_SYSTEMD) || defined(HAVE_ELOGIND)
  17. /* check if we have logind */
  18. if (access ("/run/systemd/seats/", F_OK) >= 0)
  19. {
  20. --- a/configure.ac 2016-11-03 11:13:58.286528265 +0100
  21. +++ b/configure.ac 2016-11-03 11:22:11.210543063 +0100
  22. @@ -185,6 +185,7 @@
  23. AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
  24. AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
  25. AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
  26. +AC_ARG_ENABLE(elogind, AS_HELP_STRING([--enable-elogind],[build with elogind user seat support]),enable_elogind=$enableval,enable_elogind=auto)
  27. AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
  28. AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
  29. @@ -1184,6 +1185,24 @@
  30. AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
  31. +dnl elogind detection
  32. +if test x$enable_elogind = xno ; then
  33. + have_elogind=no;
  34. +else
  35. + PKG_CHECK_MODULES([ELOGIND],
  36. + [libelogind >= 209],
  37. + [have_elogind=yes],
  38. + [have_elogind=no])
  39. +fi
  40. +
  41. +if test x$have_elogind = xyes; then
  42. + AC_DEFINE(HAVE_ELOGIND,1,[Have elogind])
  43. +fi
  44. +
  45. +if test x$enable_elogind = xyes -a x$have_elogind != xyes ; then
  46. + AC_MSG_ERROR([Explicitly requested elogind support, but libelogind not found])
  47. +fi
  48. +
  49. dnl systemd detection
  50. if test x$enable_systemd = xno ; then
  51. have_systemd=no;
  52. @@ -1290,7 +1309,7 @@
  53. fi
  54. #### Set up final flags
  55. -LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS"
  56. +LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS $ELOGIND_LIBS"
  57. AC_SUBST([LIBDBUS_LIBS])
  58. ### X11 detection
  59. @@ -1949,6 +1968,7 @@
  60. Building AppArmor support: ${have_apparmor}
  61. Building inotify support: ${have_inotify}
  62. Building kqueue support: ${have_kqueue}
  63. + Building elogind support: ${have_elogind}
  64. Building systemd support: ${have_systemd}
  65. Building X11 code: ${have_x11}
  66. Building Doxygen docs: ${enable_doxygen_docs}