Commit 2027302e authored by Matthias Clasen's avatar Matthias Clasen Committed by David Zeuthen

Add optional systemd support

When configured with --enable-systemd, this patch makes
polkit use systemd for session tracking instead of ConsoleKit.
Signed-off-by: 's avatarDavid Zeuthen <davidz@redhat.com>
parent 674357c2
......@@ -147,6 +147,26 @@ if test "x$GCC" = "xyes"; then
LDFLAGS="-Wl,--as-needed $LDFLAGS"
fi
dnl ---------------------------------------------------------------------------
dnl - Select wether to use systemd or ConsoleKit for session tracking
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([systemd],
AS_HELP_STRING([--enable-systemd], [Use systemd]),
[with_systemd=$enableval],
[with_systemd=no])
if test "$with_systemd" = "yes" ; then
PKG_CHECK_MODULES(SYSTEMD, [libsystemd-login])
SESSION_TRACKING=systemd
else
SESSION_TRACKING=ConsoleKit
fi
AC_SUBST(SYSTEMD_CFLAGS)
AC_SUBST(SYSTEMD_LIBS)
AM_CONDITIONAL(HAVE_SYSTEMD, [test "$with_systemd" = "yes"], [Using systemd])
dnl ---------------------------------------------------------------------------
dnl - Select which authentication framework to use
dnl ---------------------------------------------------------------------------
......@@ -449,7 +469,8 @@ echo "
introspection: ${found_introspection}
Distribution/OS: ${with_os_type}
authentication framework: ${POLKIT_AUTHFW}
Authentication framework: ${POLKIT_AUTHFW}
Session tracking: ${SESSION_TRACKING}
PAM support: ${have_pam}"
if test "$have_pam" = yes ; then
......@@ -459,7 +480,6 @@ echo "
PAM file password: ${PAM_FILE_INCLUDE_PASSWORD}
PAM file session: ${PAM_FILE_INCLUDE_SESSION}"
fi
echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
Building verbose mode: ${enable_verbose_mode}
......
......@@ -69,7 +69,6 @@ libpolkit_gobject_1_la_SOURCES = \
polkiterror.c polkiterror.h \
polkitsubject.c polkitsubject.h \
polkitunixprocess.c polkitunixprocess.h \
polkitunixsession.c polkitunixsession.h \
polkitsystembusname.c polkitsystembusname.h \
polkitidentity.c polkitidentity.h \
polkitunixuser.c polkitunixuser.h \
......@@ -82,13 +81,23 @@ libpolkit_gobject_1_la_SOURCES = \
polkitpermission.c polkitpermission.h \
$(NULL)
if HAVE_SYSTEMD
libpolkit_gobject_1_la_SOURCES += \
polkitunixsession-systemd.c polkitunixsession.h
else
libpolkit_gobject_1_la_SOURCES += \
polkitunixsession.c polkitunixsession.h
endif
libpolkit_gobject_1_la_CFLAGS = \
-D_POLKIT_COMPILATION \
$(GLIB_CFLAGS) \
$(SYSTEMD_CFLAGS) \
$(NULL)
libpolkit_gobject_1_la_LIBADD = \
$(GLIB_LIBS) \
$(SYSTEMD_LIBS) \
$(NULL)
libpolkit_gobject_1_la_LDFLAGS = -export-symbols-regex '(^polkit_.*)'
......
This diff is collapsed.
......@@ -38,20 +38,29 @@ libpolkit_backend_1_la_SOURCES = \
polkitbackendinteractiveauthority.h polkitbackendinteractiveauthority.c \
polkitbackendlocalauthority.h polkitbackendlocalauthority.c \
polkitbackendactionpool.h polkitbackendactionpool.c \
polkitbackendsessionmonitor.h polkitbackendsessionmonitor.c \
polkitbackendconfigsource.h polkitbackendconfigsource.c \
polkitbackendactionlookup.h polkitbackendactionlookup.c \
polkitbackendlocalauthorizationstore.h polkitbackendlocalauthorizationstore.c \
$(NULL)
if HAVE_SYSTEMD
libpolkit_backend_1_la_SOURCES += \
polkitbackendsessionmonitor.h polkitbackendsessionmonitor-systemd.c
else
libpolkit_backend_1_la_SOURCES += \
polkitbackendsessionmonitor.h polkitbackendsessionmonitor.c
endif
libpolkit_backend_1_la_CFLAGS = \
-D_POLKIT_COMPILATION \
-D_POLKIT_BACKEND_COMPILATION \
$(GLIB_CFLAGS) \
$(SYSTEMD_CFLAGS) \
$(NULL)
libpolkit_backend_1_la_LIBADD = \
$(GLIB_LIBS) \
$(SYSTEMD_LIBS) \
$(top_builddir)/src/polkit/libpolkit-gobject-1.la \
$(EXPAT_LIBS) \
$(NULL)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment