summaryrefslogtreecommitdiffstats
path: root/php-5.4.38-systemd.patch
blob: 4e8ff0f05cd3500ce3627024979c062cc19b0fe8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From 7b6031567251ad47132de23f47eb57951fd9b563 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Sat, 19 Jul 2014 18:40:20 +0200
Subject: [PATCH] Fixed bug #67635 php links to systemd libraries without using
 pkg-config

Patch from pacho at gentoo dot org

Rely on pkg-config for systemd >= 209
Failback on old check
---
 sapi/fpm/config.m4 | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index bd6d649..e1c740d 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
-- 
2.1.4

From 144a08395408506fa700c71e74c360160da3bd99 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Sat, 19 Jul 2014 18:42:40 +0200
Subject: [PATCH] improve previous, add message during configure

---
 sapi/fpm/config.m4 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index e1c740d..96b0edf 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -573,9 +573,12 @@ if test "$PHP_FPM" != "no"; then
     unset SYSTEMD_LIBS
     unset SYSTEMD_INCS
     if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libsystemd; then
+      AC_MSG_CHECKING([for libsystemd])
       SYSTEMD_LIBS=`$PKG_CONFIG --libs libsystemd`
       SYSTEMD_INCS=`$PKG_CONFIG --cflags-only-I libsystemd`
+      SYSTEMD_VERS=`$PKG_CONFIG --modversion libsystemd`
       HAVE_SD_DAEMON_H="yes"
+      AC_MSG_RESULT([version $SYSTEMD_VERS])
     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"])
-- 
2.1.4