php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch php-fpm-systemd-pkg-config.patch for Compile Failure Bug #67635

Patch version 2014-07-16 17:53 UTC

Return to Bug #67635 | Download this patch
Patch Revisions:

Developer: pacho@gentoo.org

diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index bd6d649..85eff65 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -567,14 +567,26 @@ if test "$PHP_FPM" != "no"; then
   [  --with-fpm-systemd      Activate systemd integration], no, no)
 
   if test "$PHP_FPM_SYSTEMD" != "no" ; then
-    AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
-    AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"])
+    if test -z "$PKG_CONFIG"; then
+      AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+    fi
+    unset SYSTEMD_LIBS
+    unset SYSTEMD_INCS
+    if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd; then
+      SYSTEMD_LIBS=`$PKG_CONFIG --libs libsystemd`
+      SYSTEMD_INCS=`$PKG_CONFIG --cflags-only-I libsystemd`
+      HAVE_SD_DAEMON_H="yes"
+    else
+      AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
+      AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"])
+    fi
     if test $HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; 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_ADD_LIBRARY(systemd-daemon)
+      PHP_EVAL_LIBLINE($SYSTEMD_LIBS)
+      PHP_EVAL_INCLINE($SYSTEMD_INCS)
       php_fpm_systemd=notify
     fi
   else
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 18 06:01:23 2020 UTC