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: default avatarDavid Zeuthen <davidz@redhat.com>
parent 674357c2
...@@ -147,6 +147,26 @@ if test "x$GCC" = "xyes"; then ...@@ -147,6 +147,26 @@ if test "x$GCC" = "xyes"; then
LDFLAGS="-Wl,--as-needed $LDFLAGS" LDFLAGS="-Wl,--as-needed $LDFLAGS"
fi 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 ---------------------------------------------------------------------------
dnl - Select which authentication framework to use dnl - Select which authentication framework to use
dnl --------------------------------------------------------------------------- dnl ---------------------------------------------------------------------------
...@@ -449,7 +469,8 @@ echo " ...@@ -449,7 +469,8 @@ echo "
introspection: ${found_introspection} introspection: ${found_introspection}
Distribution/OS: ${with_os_type} Distribution/OS: ${with_os_type}
authentication framework: ${POLKIT_AUTHFW} Authentication framework: ${POLKIT_AUTHFW}
Session tracking: ${SESSION_TRACKING}
PAM support: ${have_pam}" PAM support: ${have_pam}"
if test "$have_pam" = yes ; then if test "$have_pam" = yes ; then
...@@ -459,7 +480,6 @@ echo " ...@@ -459,7 +480,6 @@ echo "
PAM file password: ${PAM_FILE_INCLUDE_PASSWORD} PAM file password: ${PAM_FILE_INCLUDE_PASSWORD}
PAM file session: ${PAM_FILE_INCLUDE_SESSION}" PAM file session: ${PAM_FILE_INCLUDE_SESSION}"
fi fi
echo " echo "
Maintainer mode: ${USE_MAINTAINER_MODE} Maintainer mode: ${USE_MAINTAINER_MODE}
Building verbose mode: ${enable_verbose_mode} Building verbose mode: ${enable_verbose_mode}
......
...@@ -69,7 +69,6 @@ libpolkit_gobject_1_la_SOURCES = \ ...@@ -69,7 +69,6 @@ libpolkit_gobject_1_la_SOURCES = \
polkiterror.c polkiterror.h \ polkiterror.c polkiterror.h \
polkitsubject.c polkitsubject.h \ polkitsubject.c polkitsubject.h \
polkitunixprocess.c polkitunixprocess.h \ polkitunixprocess.c polkitunixprocess.h \
polkitunixsession.c polkitunixsession.h \
polkitsystembusname.c polkitsystembusname.h \ polkitsystembusname.c polkitsystembusname.h \
polkitidentity.c polkitidentity.h \ polkitidentity.c polkitidentity.h \
polkitunixuser.c polkitunixuser.h \ polkitunixuser.c polkitunixuser.h \
...@@ -82,13 +81,23 @@ libpolkit_gobject_1_la_SOURCES = \ ...@@ -82,13 +81,23 @@ libpolkit_gobject_1_la_SOURCES = \
polkitpermission.c polkitpermission.h \ polkitpermission.c polkitpermission.h \
$(NULL) $(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 = \ libpolkit_gobject_1_la_CFLAGS = \
-D_POLKIT_COMPILATION \ -D_POLKIT_COMPILATION \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(SYSTEMD_CFLAGS) \
$(NULL) $(NULL)
libpolkit_gobject_1_la_LIBADD = \ libpolkit_gobject_1_la_LIBADD = \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(SYSTEMD_LIBS) \
$(NULL) $(NULL)
libpolkit_gobject_1_la_LDFLAGS = -export-symbols-regex '(^polkit_.*)' libpolkit_gobject_1_la_LDFLAGS = -export-symbols-regex '(^polkit_.*)'
......
This diff is collapsed.
...@@ -38,20 +38,29 @@ libpolkit_backend_1_la_SOURCES = \ ...@@ -38,20 +38,29 @@ libpolkit_backend_1_la_SOURCES = \
polkitbackendinteractiveauthority.h polkitbackendinteractiveauthority.c \ polkitbackendinteractiveauthority.h polkitbackendinteractiveauthority.c \
polkitbackendlocalauthority.h polkitbackendlocalauthority.c \ polkitbackendlocalauthority.h polkitbackendlocalauthority.c \
polkitbackendactionpool.h polkitbackendactionpool.c \ polkitbackendactionpool.h polkitbackendactionpool.c \
polkitbackendsessionmonitor.h polkitbackendsessionmonitor.c \
polkitbackendconfigsource.h polkitbackendconfigsource.c \ polkitbackendconfigsource.h polkitbackendconfigsource.c \
polkitbackendactionlookup.h polkitbackendactionlookup.c \ polkitbackendactionlookup.h polkitbackendactionlookup.c \
polkitbackendlocalauthorizationstore.h polkitbackendlocalauthorizationstore.c \ polkitbackendlocalauthorizationstore.h polkitbackendlocalauthorizationstore.c \
$(NULL) $(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 = \ libpolkit_backend_1_la_CFLAGS = \
-D_POLKIT_COMPILATION \ -D_POLKIT_COMPILATION \
-D_POLKIT_BACKEND_COMPILATION \ -D_POLKIT_BACKEND_COMPILATION \
$(GLIB_CFLAGS) \ $(GLIB_CFLAGS) \
$(SYSTEMD_CFLAGS) \
$(NULL) $(NULL)
libpolkit_backend_1_la_LIBADD = \ libpolkit_backend_1_la_LIBADD = \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(SYSTEMD_LIBS) \
$(top_builddir)/src/polkit/libpolkit-gobject-1.la \ $(top_builddir)/src/polkit/libpolkit-gobject-1.la \
$(EXPAT_LIBS) \ $(EXPAT_LIBS) \
$(NULL) $(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