* 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
This commit is contained in:
Joe Orton
2025-12-18 09:54:28 +00:00
parent efd77789fc
commit 6859a96df8

View File

@ -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
;;