Skip to content

Commit 3dd0c11

Browse files
authored
Autotools: Use FPM_EXTRA_LIBS for systemd library (#14883)
Instead of appending -lsystemd to global LIBS variable, this adds it as needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM invocation. Move php_fpm_systemd substitution after its check. Follow-up of GH-14881
1 parent 1a07bb9 commit 3dd0c11

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

sapi/fpm/config.m4

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ if test "$PHP_FPM" != "no"; then
406406
[nobody],
407407
[no])
408408

409-
PHP_ARG_WITH([fpm-systemd],,
409+
PHP_ARG_WITH([fpm-systemd],
410+
[whether to enable systemd integration in PHP-FPM],
410411
[AS_HELP_STRING([--with-fpm-systemd],
411412
[Activate systemd integration])],
412413
[no],
@@ -431,24 +432,26 @@ if test "$PHP_FPM" != "no"; then
431432
[no],
432433
[no])
433434

434-
if test "$PHP_FPM_SYSTEMD" != "no" ; then
435+
AS_VAR_IF([PHP_FPM_SYSTEMD], [no], [php_fpm_systemd=simple], [
435436
PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209])
436437
437-
AC_DEFINE([HAVE_SYSTEMD], [1], [Whether FPM has systemd integration])
438+
AC_DEFINE([HAVE_SYSTEMD], [1],
439+
[Define to 1 if FPM has systemd integration.])
438440
PHP_FPM_SD_FILES="fpm/fpm_systemd.c"
439-
PHP_EVAL_LIBLINE([$SYSTEMD_LIBS])
441+
PHP_EVAL_LIBLINE([$SYSTEMD_LIBS], [FPM_EXTRA_LIBS], [yes])
440442
PHP_EVAL_INCLINE([$SYSTEMD_CFLAGS])
443+
441444
php_fpm_systemd=notify
442445
443446
dnl Sanity check.
444-
CFLAGS_save="$CFLAGS"
447+
CFLAGS_save=$CFLAGS
445448
CFLAGS="$INCLUDES $CFLAGS"
446449
AC_CHECK_HEADER([systemd/sd-daemon.h],,
447450
[AC_MSG_ERROR([Required systemd/sd-daemon.h not found.])])
448-
CFLAGS="$CFLAGS_save"
449-
else
450-
php_fpm_systemd=simple
451-
fi
451+
CFLAGS=$CFLAGS_save
452+
])
453+
454+
AC_SUBST([php_fpm_systemd])
452455

453456
AS_VAR_IF([PHP_FPM_ACL], [no],, [
454457
AC_CHECK_HEADERS([sys/acl.h])
@@ -516,8 +519,6 @@ if test "$PHP_FPM" != "no"; then
516519
CFLAGS="$CFLAGS_save"
517520
fi
518521

519-
AC_SUBST([php_fpm_systemd])
520-
521522
if test -z "$PHP_FPM_USER" || test "$PHP_FPM_USER" = "yes" || test "$PHP_FPM_USER" = "no"; then
522523
php_fpm_user="nobody"
523524
else

0 commit comments

Comments
 (0)