]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
configure: new option `enable-logind`
authorIker Pedrosa <ipedrosa@redhat.com>
Tue, 18 Jul 2023 09:33:02 +0000 (11:33 +0200)
committerSerge Hallyn <serge@hallyn.com>
Wed, 2 Aug 2023 15:13:28 +0000 (10:13 -0500)
Create new configuration option `enable-logind` to select which session
support functionality to build, logind or utmp. By default the option is
logind.

Resolves: https://github.com/shadow-maint/shadow/issues/674

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
configure.ac

index b32f15139778b437352cf6e891a0e47c29297903..d598e3125cc1787e5a45384a2b88865fb342b1f1 100644 (file)
@@ -212,6 +212,13 @@ AC_ARG_ENABLE(lastlog,
        [enable_lastlog="no"]
 )
 
+AC_ARG_ENABLE(logind,
+       [AS_HELP_STRING([--enable-logind],
+               [enable logind @<:@default=yes@:>@])],
+       [enable_logind="${enableval}"],
+       [enable_logind="yes"]
+)
+
 AC_ARG_WITH(audit,
        [AS_HELP_STRING([--with-audit], [use auditing support @<:@default=yes if found@:>@])],
        [with_audit=$withval], [with_audit=maybe])
@@ -387,6 +394,16 @@ if test "$enable_lastlog" = "yes" && test "$ac_cv_header_lastlog_h" = "yes"; the
 fi
 AM_CONDITIONAL(ENABLE_LASTLOG, test "x$enable_lastlog" != "xno")
 
+AC_SUBST(LIBSYSTEMD)
+if test "$enable_logind" = "yes"; then
+       AC_CHECK_LIB(systemd, sd_session_get_remote_host,
+               [enable_logind="yes"; [LIBSYSTEMD=-lsystemd];
+               AC_DEFINE(ENABLE_LOGIND, 1,
+                       [Define to manage session support with logind.])],
+               [enable_logind="no"])
+fi
+AM_CONDITIONAL(ENABLE_LOGIND, test "x$enable_logind" != "xno")
+
 AC_SUBST(LIBCRYPT)
 AC_CHECK_LIB(crypt, crypt, [LIBCRYPT=-lcrypt],
        [AC_MSG_ERROR([crypt() not found])])
@@ -760,6 +777,7 @@ echo "      nscd support:                   $with_nscd"
 echo " sssd support:                   $with_sssd"
 echo " subordinate IDs support:        $enable_subids"
 echo " enable lastlog:                 $enable_lastlog"
+echo " enable logind:                  $enable_logind"
 echo " use file caps:                  $with_fcaps"
 echo " install su:                     $with_su"
 echo " enabled vendor dir:             $enable_vendordir"