Skip to content

Refactor systemd library check for FPM #13595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions sapi/fpm/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,18 @@ if test "$PHP_FPM" != "no"; then
if test "$PHP_FPM_SYSTEMD" != "no" ; then
PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209])

AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"])
if test $HAVE_SD_DAEMON_H = "no"; then
AC_MSG_ERROR([Your system does not support systemd.])
else
AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration])
PHP_FPM_SD_FILES="fpm/fpm_systemd.c"
PHP_EVAL_LIBLINE($SYSTEMD_LIBS)
PHP_EVAL_INCLINE($SYSTEMD_CFLAGS)
php_fpm_systemd=notify
fi
AC_DEFINE([HAVE_SYSTEMD], [1], [Whether FPM has systemd integration])
PHP_FPM_SD_FILES="fpm/fpm_systemd.c"
PHP_EVAL_LIBLINE([$SYSTEMD_LIBS])
PHP_EVAL_INCLINE([$SYSTEMD_CFLAGS])
php_fpm_systemd=notify

dnl Sanity check.
CFLAGS_save="$CFLAGS"
CFLAGS="$INCLUDES $CFLAGS"
AC_CHECK_HEADER([systemd/sd-daemon.h],,
[AC_MSG_ERROR([Required systemd/sd-daemon.h not found.])])
CFLAGS="$CFLAGS_save"
else
php_fpm_systemd=simple
fi
Expand Down