From: Evgeny Grin (Karlson2k) Date: Thu, 10 Jul 2025 16:38:48 +0000 (+0200) Subject: configure.ac: Make sure that logind is enabled if requested, make --enable-logind... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=324d070ff853b6c283a57b99c376a4d02fade36f;p=thirdparty%2Fshadow.git configure.ac: Make sure that logind is enabled if requested, make --enable-logind default 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) --- diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index 7dd52a71c..634863bbf 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -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 diff --git a/.github/workflows/runner.yml b/.github/workflows/runner.yml index 18fca18e7..0327dfcac 100644 --- a/.github/workflows/runner.yml +++ b/.github/workflows/runner.yml @@ -62,7 +62,7 @@ jobs: tar -zxf $f d=$(basename $f .tar.gz) cd $d - ./configure + ./configure --disable-logind make -j5 make check diff --git a/Makefile.am b/Makefile.am index 00e1fcbc7..778d2ea77 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/autogen.sh b/autogen.sh index bf67df0c7..825386593 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 \ diff --git a/configure.ac b/configure.ac index ea6a26370..9495fe5aa 100644 --- a/configure.ac +++ b/configure.ac @@ -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