summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2015-03-31 08:38:52 +0100
committerColin Walters <walters@verbum.org>2015-03-31 08:53:52 -0400
commit2291767a014f5a04a92ca6f0eb472794f212ca67 (patch)
treedf95c18bd0b6e4a65f12108f3d5b984a0f0a0aeb /configure.ac
parentf4d71e0de885010494b8b0b8d62ca910011d7544 (diff)
downloadpolkit-2291767a014f5a04a92ca6f0eb472794f212ca67.tar.gz
Use libsystemd instead of older libsystemd-login if possible
The command-line option is still --enable-libsystemd-login for now. Bug-Debian: https://bugs.debian.org/779756
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac42
1 files changed, 25 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index e783ea5..d9a97bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,39 +187,47 @@ dnl ---------------------------------------------------------------------------
dnl - Select wether to use libsystemd-login or ConsoleKit for session tracking
dnl ---------------------------------------------------------------------------
-have_libsystemd_login=no
+have_libsystemd=no
SESSION_TRACKING=ConsoleKit
AC_ARG_ENABLE([libsystemd-login],
- AS_HELP_STRING([--enable-libsystemd-login[=@<:@auto/yes/no@:>@]], [Use libsystemd-login (auto/yes/no)]),
+ [AS_HELP_STRING([--enable-libsystemd-login[=@<:@auto/yes/no@:>@]], [Use libsystemd (auto/yes/no)])],
[enable_libsystemd_login=$enableval],
[enable_libsystemd_login=auto])
if test "$enable_libsystemd_login" != "no"; then
- PKG_CHECK_MODULES(LIBSYSTEMD_LOGIN,
- [libsystemd-login],
- have_libsystemd_login=yes,
- have_libsystemd_login=no)
- if test "$have_libsystemd_login" = "yes"; then
+ PKG_CHECK_MODULES([LIBSYSTEMD],
+ [libsystemd],
+ [have_libsystemd=yes],
+ dnl if libsystemd is not available, fall back to the older libsystemd-login
+ [PKG_CHECK_MODULES([LIBSYSTEMD_LOGIN],
+ [libsystemd-login],
+ [
+ have_libsystemd=yes
+ LIBSYSTEMD_CFLAGS="$LIBSYSTEMD_LOGIN_CFLAGS"
+ LIBSYSTEMD_LIBS="$LIBSYSTEMD_LOGIN_LIBS"
+ ],
+ [have_libsystemd=no])])
+ if test "$have_libsystemd" = "yes"; then
SESSION_TRACKING=libsystemd-login
- AC_DEFINE([HAVE_LIBSYSTEMD_LOGIN], 1, [Define to 1 if libsystemd-login is available])
+ AC_DEFINE([HAVE_LIBSYSTEMD], 1, [Define to 1 if libsystemd is available])
save_LIBS=$LIBS
- LIBS=$LIBSYSTEMD_LOGIN_LIBS
+ LIBS=$LIBSYSTEMD_LIBS
AC_CHECK_FUNCS(sd_uid_get_display)
LIBS=$save_LIBS
else
if test "$enable_libsystemd_login" = "yes"; then
- AC_MSG_ERROR([libsystemd-login support requested but libsystemd-login library not found])
+ AC_MSG_ERROR([libsystemd support requested but libsystemd or libsystemd-login library not found])
fi
fi
fi
AS_IF([test "x$cross_compiling" != "xyes" ], [
- AS_IF([test "$have_libsystemd_login" = "yes"], [
+ AS_IF([test "$have_libsystemd" = "yes"], [
AS_IF([test ! -d /sys/fs/cgroup/systemd/ ], [
AS_IF([test "$enable_libsystemd_login" = "yes"], [
- AC_MSG_WARN([libsystemd-login requested but system does not appear to be using systemd])
+ AC_MSG_WARN([libsystemd requested but system does not appear to be using systemd])
], [
- AC_MSG_ERROR([libsystemd-login autoconfigured, but system does not appear to use systemd])
+ AC_MSG_ERROR([libsystemd autoconfigured, but system does not appear to use systemd])
])
])
], [
@@ -227,15 +235,15 @@ AS_IF([test "x$cross_compiling" != "xyes" ], [
AS_IF([test "$enable_libsystemd_login" = "no" ], [
AC_MSG_WARN([ConsoleKit requested but system appears to use systemd])
], [
- AC_MSG_ERROR([ConsoleKit autoconfigured, but systemd is in use (missing libsystemd-login pkg-config?)])
+ AC_MSG_ERROR([ConsoleKit autoconfigured, but systemd is in use (missing libsystemd or libsystemd-login pkg-config?)])
])
])
])
])
-AC_SUBST(LIBSYSTEMD_LOGIN_CFLAGS)
-AC_SUBST(LIBSYSTEMD_LOGIN_LIBS)
-AM_CONDITIONAL(HAVE_LIBSYSTEMD_LOGIN, [test "$have_libsystemd_login" = "yes"], [Using libsystemd-login])
+AC_SUBST(LIBSYSTEMD_CFLAGS)
+AC_SUBST(LIBSYSTEMD_LIBS)
+AM_CONDITIONAL(HAVE_LIBSYSTEMD, [test "$have_libsystemd" = "yes"], [Using libsystemd])
dnl ---------------------------------------------------------------------------
dnl - systemd unit / service files