From: Joe Orton Date: Thu, 18 Dec 2025 09:54:28 +0000 (+0000) Subject: * acinclude.m4 (APACHE_CHECK_SYSTEMD): Define AP_SYSTEMD_VERSION if X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6859a96df8897ed98743b53d05dda11c8c512c13;p=thirdparty%2Fapache%2Fhttpd.git * acinclude.m4 (APACHE_CHECK_SYSTEMD): Define AP_SYSTEMD_VERSION if the version of libsystemd is available from pkg-config. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1930703 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/acinclude.m4 b/acinclude.m4 index c40cbd2304..98d7c9831e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -819,11 +819,14 @@ AC_DEFUN([APACHE_CHECK_SYSTEMD], [ dnl Check for systemd support for listen.c's socket activation. case $host in *-linux-*) - if test -n "$PKGCONFIG" && $PKGCONFIG --exists libsystemd; then - SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd` - elif test -n "$PKGCONFIG" && $PKGCONFIG --exists libsystemd-daemon; then - SYSTEMD_LIBS=`$PKGCONFIG --libs libsystemd-daemon` - else + for libsd in libsystemd libsystemd-daemon; do + if test -n "$PKGCONFIG" && $PKGCONFIG --exists $libsd; then + SYSTEMD_LIBS=`$PKGCONFIG --libs $libsd` + SYSTEMD_VERS=`$PKGCONFIG --modversion $libsd` + break + fi + done + if test -n "$SYSTEMD_LIBS"; then AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon") fi if test -n "$SYSTEMD_LIBS"; then @@ -832,6 +835,10 @@ case $host in AC_MSG_WARN([Your system does not support systemd.]) else AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is supported]) + if test -n "$SYSTEMD_VERS" -a "$SYSTEMD_VERS" -gt 0; then + AC_DEFINE_UNQUOTED([AP_SYSTEMD_VERSION], [$SYSTEMD_VERS], + [Define to the systemd version if available]) + fi fi fi ;;