]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
configure.ac: Make sure that logind is enabled if requested, make --enable-logind...
authorEvgeny Grin (Karlson2k) <k2k@drgrin.dev>
Thu, 10 Jul 2025 16:38:48 +0000 (18:38 +0200)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Sat, 2 Aug 2025 10:09:13 +0000 (12:09 +0200)
Before this commit, if configured with --enable-logind, but libsystemd
is not found, configure silently succeed, however logind is efficiently
disabled.
With this commit, the configure fails if logind is not explicitly
disabled and libsystemd is not found.
--disable-logind is mandatory if logind integration should not be used.

Automatic detection is disabled by Alejandro Colomar's request.
Extra help in the error message is added by lslebodn's request.

Signed-off-by: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
.github/actions/install-dependencies/action.yml
.github/workflows/runner.yml
Makefile.am
autogen.sh
configure.ac

index 7dd52a71c09945230e780898253cac27e275c2bc..634863bbfda7f779d890f921a8f3191b52b51c24 100644 (file)
@@ -22,5 +22,5 @@ runs:
       sudo apt-mark hold grub-efi-amd64-bin grub-efi-amd64-signed
       sudo apt-get update
       sudo apt-get -y dist-upgrade
-      sudo apt-get -y install ubuntu-dev-tools automake autopoint xsltproc gettext expect libtool libbsd-dev libltdl-dev pkgconf
+      sudo apt-get -y install ubuntu-dev-tools automake autopoint xsltproc gettext expect libtool libbsd-dev libltdl-dev libsystemd-dev pkgconf
       sudo apt-get -y build-dep shadow
index 18fca18e7f5c4c087985587e824b62e1b0ae4640..0327dfcac8ca1633671392b9b964b9df7fa5ecef 100644 (file)
@@ -62,7 +62,7 @@ jobs:
         tar -zxf $f
         d=$(basename $f .tar.gz)
         cd $d
-        ./configure
+        ./configure --disable-logind
         make -j5
         make check
 
index 00e1fcbc78809f9dad31165ed8bec153c9114067..778d2ea77a5c6eb44e402a357c84186b5e1d4258 100644 (file)
@@ -1,6 +1,8 @@
 ## Process this file with automake to produce Makefile.in
 ACLOCAL_AMFLAGS = -I m4
 
+AM_DISTCHECK_CONFIGURE_FLAGS = --disable-logind
+
 SUBDIRS = lib
 
 if ENABLE_SUBIDS
index bf67df0c7f221c87ca5975daa304340b01de913e..8253865937bc7d3c45edf53f72629f988439e5c4 100755 (executable)
@@ -18,6 +18,7 @@ CFLAGS="$CFLAGS -Wno-unknown-warning-option"
 "$(dirname "$0")"/configure \
        CFLAGS="$CFLAGS" \
        --enable-lastlog \
+       --disable-logind \
        --enable-man \
        --enable-maintainer-mode \
        --enable-shared \
index ea6a26370d96dde69ed1ecb87a55fe23a7a72116..9495fe5aa2399ee979dbb6e84337fa8bde2fdea7 100644 (file)
@@ -152,13 +152,14 @@ AC_ARG_ENABLE([lastlog],
 )
 
 AC_ARG_ENABLE([logind],
-       [AS_HELP_STRING([--enable-logind],
-               [enable logind @<:@default=yes if found@:>@])],
+       [AS_HELP_STRING([--disable-logind],
+               [disable logind integration])],
        [
                AS_CASE([${enableval}],
                        [yes],[],
                        [no],[],
-                       [AC_MSG_ERROR([bad parameter value for --enable-logind=${enableval}])]
+                       [AC_MSG_ERROR([bad parameter value for --enable-logind=${enableval}.  ]dnl
+[Supported values are: --enable-logind (or --enable-logind=yes) and --disable-logind (or --enable-logind=no).])]
                )
        ],
        [enable_logind="yes"]
@@ -347,11 +348,11 @@ AC_SUBST([LIBSYSTEMD])
 if test "X$enable_logind" = "Xyes"; 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"
+                       AC_MSG_ERROR([libsystemd not found.  If logind integration is not required, disable it using the --disable-logind option. ]dnl
+[ If logind integration is required, consider installing systemd or another package that provides libsystemd.])
                ]
        )
 fi