--- /dev/null
+From 7a4168062fbab2e33ef9a42bca9f87a5921afac2 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Tue, 9 Aug 2016 11:49:56 +0200
+Subject: [PATCH] acinclude.m4: don't unset variables
+
+Unsetting ac_cv_{func,lib}_* is bad, you can't feed the configure cache.
+Terminate them with extreme prejudice.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+---
+ acinclude.m4 | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 28506b6..af4aa06 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -1898,8 +1898,6 @@ define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,]))
+ dnl
+ AC_DEFUN([PHP_CHECK_FUNC_LIB],[
+ ifelse($2,,:,[
+- unset ac_cv_lib_$2[]_$1
+- unset ac_cv_lib_$2[]___$1
+ unset found
+ AC_CHECK_LIB($2, $1, [found=yes], [
+ AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
+@@ -1931,8 +1929,6 @@ dnl in the default libraries and as a fall back in the specified library.
+ dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS.
+ dnl
+ AC_DEFUN([PHP_CHECK_FUNC],[
+- unset ac_cv_func_$1
+- unset ac_cv_func___$1
+ unset found
+
+ AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
+--
+2.7.4
+
+++ /dev/null
-Unsetting ac_cv_{func,lib}_* is bad, you can't feed the configure cache.
-Terminate them with extreme prejudice.
-
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-
-diff -Nura php-5.6.8.orig/acinclude.m4 php-5.6.8/acinclude.m4
---- php-5.6.8.orig/acinclude.m4 2015-04-15 20:05:57.000000000 +0200
-+++ php-5.6.8/acinclude.m4 2015-05-18 20:03:50.833099001 +0200
-@@ -1897,8 +1897,6 @@
- dnl
- AC_DEFUN([PHP_CHECK_FUNC_LIB],[
- ifelse($2,,:,[
-- unset ac_cv_lib_$2[]_$1
-- unset ac_cv_lib_$2[]___$1
- unset found
- AC_CHECK_LIB($2, $1, [found=yes], [
- AC_CHECK_LIB($2, __$1, [found=yes], [found=no])
-@@ -1930,8 +1928,6 @@
- dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS.
- dnl
- AC_DEFUN([PHP_CHECK_FUNC],[
-- unset ac_cv_func_$1
-- unset ac_cv_func___$1
- unset found
-
- AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])
--- /dev/null
+From 1357df0196806d5697b1f84497ef72aab5faa8a3 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Tue, 9 Aug 2016 11:50:49 +0200
+Subject: [PATCH] iconv: tweak iconv detection
+
+Tweak PHP_SETUP_ICONV from aclocal/acinclude.m4 to not
+PHP_ADD_INCLUDE $ICONV_DIR/include since the tests use
+test instead of AC_TRY_LINK to find headers which is bad,
+specially when adding /usr and /usr/local to the mix.
+Do basically the same with ext/iconv/config.m4 by tweaking
+PHP_ICONV_H_PATH which, again, uses test and absolute paths.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+[Gustavo: convert to nice m4 instead of patching configure]
+[Gustavo: update for 5.6.10]
+---
+ acinclude.m4 | 2 +-
+ ext/iconv/config.m4 | 22 ----------------------
+ 2 files changed, 1 insertion(+), 23 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index af4aa06..1bd2652 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -2471,7 +2471,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
+ dnl
+ if test "$found_iconv" = "no"; then
+
+- for i in $PHP_ICONV /usr/local /usr; do
++ for i in $PHP_ICONV; do
+ if test -r $i/include/giconv.h; then
+ AC_DEFINE(HAVE_GICONV_H, 1, [ ])
+ ICONV_DIR=$i
+diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
+index 6a05697..694fcb8 100644
+--- a/ext/iconv/config.m4
++++ b/ext/iconv/config.m4
+@@ -14,28 +14,6 @@ if test "$PHP_ICONV" != "no"; then
+ ])
+
+ if test "$iconv_avail" != "no"; then
+- if test -z "$ICONV_DIR"; then
+- for i in /usr/local /usr; do
+- if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
+- PHP_ICONV_PREFIX="$i"
+- break
+- fi
+- done
+- if test -z "$PHP_ICONV_PREFIX"; then
+- PHP_ICONV_PREFIX="/usr"
+- fi
+- else
+- PHP_ICONV_PREFIX="$ICONV_DIR"
+- fi
+-
+- CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
+- LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
+-
+- if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
+- PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
+- else
+- PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
+- fi
+
+ AC_MSG_CHECKING([if iconv is glibc's])
+ AC_TRY_LINK([#include <gnu/libc-version.h>],[gnu_get_libc_version();],
+--
+2.7.4
+
+++ /dev/null
-Tweak PHP_SETUP_ICONV from aclocal/acinclude.m4 to not
-PHP_ADD_INCLUDE $ICONV_DIR/include since the tests use
-test instead of AC_TRY_LINK to find headers which is bad,
-specially when adding /usr and /usr/local to the mix.
-Do basically the same with ext/iconv/config.m4 by tweaking
-PHP_ICONV_H_PATH which, again, uses test and absolute paths.
-
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-[Gustavo: convert to nice m4 instead of patching configure]
-[Gustavo: update for 5.6.10]
-
-diff -Nura php-5.6.10.orig/acinclude.m4 php-5.6.10/acinclude.m4
---- php-5.6.10.orig/acinclude.m4 2015-06-12 16:09:06.274355813 -0300
-+++ php-5.6.10/acinclude.m4 2015-06-12 16:10:10.884544865 -0300
-@@ -2474,7 +2474,7 @@
- dnl
- if test "$found_iconv" = "no"; then
-
-- for i in $PHP_ICONV /usr/local /usr; do
-+ for i in $PHP_ICONV; do
- if test -r $i/include/giconv.h; then
- AC_DEFINE(HAVE_GICONV_H, 1, [ ])
- ICONV_DIR=$i
-diff -Nura php-5.6.10.orig/ext/iconv/config.m4 php-5.6.10/ext/iconv/config.m4
---- php-5.6.10.orig/ext/iconv/config.m4 2015-06-12 16:09:07.792407246 -0300
-+++ php-5.6.10/ext/iconv/config.m4 2015-06-12 16:11:07.752471600 -0300
-@@ -14,28 +14,6 @@
- ])
-
- if test "$iconv_avail" != "no"; then
-- if test -z "$ICONV_DIR"; then
-- for i in /usr/local /usr; do
-- if test -f "$i/include/iconv.h" || test -f "$i/include/giconv.h"; then
-- PHP_ICONV_PREFIX="$i"
-- break
-- fi
-- done
-- if test -z "$PHP_ICONV_PREFIX"; then
-- PHP_ICONV_PREFIX="/usr"
-- fi
-- else
-- PHP_ICONV_PREFIX="$ICONV_DIR"
-- fi
--
-- CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
-- LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
--
-- if test -r "$PHP_ICONV_PREFIX/include/giconv.h"; then
-- PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
-- else
-- PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"
-- fi
-
- AC_MSG_CHECKING([if iconv is glibc's])
- AC_TRY_LINK([#include <gnu/libc-version.h>],[gnu_get_libc_version();],
--- /dev/null
+From 5ba6355e489f647c88ca48afbc75965468193181 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Tue, 9 Aug 2016 11:51:53 +0200
+Subject: [PATCH] configure: disable the 'phar' tool
+
+Disable the 'phar' command-line tool build/installation since it requires
+php to run and pack up phar itself in phar format. This would require
+a host-php instance and really probably nobody needs the phar tool
+on the target.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+[Gustavo: update for autoreconf/configure.in]
+---
+ configure.in | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 25c8abf..4dc8a09 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1445,13 +1445,8 @@ CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
+ INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
+ CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
+
+-if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
+- pharcmd=pharcmd
+- pharcmd_install=install-pharcmd
+-else
+- pharcmd=
+- pharcmd_install=
+-fi;
++pharcmd=
++pharcmd_install=
+
+ all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_BINARIES) $pharcmd"
+ install_targets="$install_sapi $install_modules $install_binaries install-build install-headers install-programs $install_pear $pharcmd_install"
+--
+2.7.4
+
+++ /dev/null
-Disable the 'phar' command-line tool build/installation since it requires
-php to run and pack up phar itself in phar format. This would require
-a host-php instance and really probably nobody needs the phar tool
-on the target.
-
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-[Gustavo: update for autoreconf/configure.in]
-
-diff -Nura php-5.6.7.orig/configure.in php-5.6.7/configure.in
---- php-5.6.7.orig/configure.in 2015-04-08 11:08:10.815835010 -0300
-+++ php-5.6.7/configure.in 2015-04-08 11:16:20.460467444 -0300
-@@ -1437,13 +1437,8 @@
- INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
- CXXFLAGS="$CXXFLAGS $standard_libtool_flag"
-
--if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
-- pharcmd=pharcmd
-- pharcmd_install=install-pharcmd
--else
-- pharcmd=
-- pharcmd_install=
--fi;
-+pharcmd=
-+pharcmd_install=
-
- all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_BINARIES) $pharcmd"
- install_targets="$install_sapi $install_modules $install_binaries install-build install-headers install-programs $install_pear $pharcmd_install"
--- /dev/null
+From bedbd41ef0a5ce80b83a6f6eaebd7c90f0bc5615 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Tue, 9 Aug 2016 11:52:19 +0200
+Subject: [PATCH] OPcache: flock mechanism is obviously linux so force it.
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+---
+ ext/opcache/config.m4 | 34 ++--------------------------------
+ 1 file changed, 2 insertions(+), 32 deletions(-)
+
+diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
+index fbb9b21..ffddc8e 100644
+--- a/ext/opcache/config.m4
++++ b/ext/opcache/config.m4
+@@ -343,38 +343,8 @@ int main() {
+ msg=yes,msg=no,msg=no)
+ AC_MSG_RESULT([$msg])
+
+-flock_type=unknown
+-AC_MSG_CHECKING("whether flock struct is linux ordered")
+-AC_TRY_RUN([
+- #include <fcntl.h>
+- struct flock lock = { 1, 2, 3, 4, 5 };
+- int main() {
+- if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) {
+- return 0;
+- }
+- return 1;
+- }
+-], [
+- flock_type=linux
+- AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
+- AC_MSG_RESULT("yes")
+-], AC_MSG_RESULT("no") )
+-
+-AC_MSG_CHECKING("whether flock struct is BSD ordered")
+-AC_TRY_RUN([
+- #include <fcntl.h>
+- struct flock lock = { 1, 2, 3, 4, 5 };
+- int main() {
+- if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
+- return 0;
+- }
+- return 1;
+- }
+-], [
+- flock_type=bsd
+- AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
+- AC_MSG_RESULT("yes")
+-], AC_MSG_RESULT("no") )
++flock_type=linux
++AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
+
+ if test "$flock_type" = "unknown"; then
+ AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
+--
+2.7.4
+
+++ /dev/null
-OPcache: flock mechanism is obviously linux so force it.
-
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-
-diff -Nura php-5.6.7.orig/ext/opcache/config.m4 php-5.6.7/ext/opcache/config.m4
---- php-5.6.7.orig/ext/opcache/config.m4 2015-04-08 11:08:11.125845540 -0300
-+++ php-5.6.7/ext/opcache/config.m4 2015-04-08 11:57:23.648831436 -0300
-@@ -326,38 +326,8 @@
- msg=yes,msg=no,msg=no)
- AC_MSG_RESULT([$msg])
-
--flock_type=unknown
--AC_MSG_CHECKING("whether flock struct is linux ordered")
--AC_TRY_RUN([
-- #include <fcntl.h>
-- struct flock lock = { 1, 2, 3, 4, 5 };
-- int main() {
-- if(lock.l_type == 1 && lock.l_whence == 2 && lock.l_start == 3 && lock.l_len == 4) {
-- return 0;
-- }
-- return 1;
-- }
--], [
-- flock_type=linux
-- AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
-- AC_MSG_RESULT("yes")
--], AC_MSG_RESULT("no") )
--
--AC_MSG_CHECKING("whether flock struct is BSD ordered")
--AC_TRY_RUN([
-- #include <fcntl.h>
-- struct flock lock = { 1, 2, 3, 4, 5 };
-- int main() {
-- if(lock.l_start == 1 && lock.l_len == 2 && lock.l_type == 4 && lock.l_whence == 5) {
-- return 0;
-- }
-- return 1;
-- }
--], [
-- flock_type=bsd
-- AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
-- AC_MSG_RESULT("yes")
--], AC_MSG_RESULT("no") )
-+flock_type=linux
-+AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
-
- if test "$flock_type" == "unknown"; then
- AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
+++ /dev/null
-Allow cache answer for strcasestr discovery.
-
-Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
-
-diff -Nura php-5.6.7.orig/ext/fileinfo/config.m4 php-5.6.7/ext/fileinfo/config.m4
---- php-5.6.7.orig/ext/fileinfo/config.m4 2015-04-08 22:19:45.798770792 -0300
-+++ php-5.6.7/ext/fileinfo/config.m4 2015-04-08 22:26:33.110654338 -0300
-@@ -14,6 +14,7 @@
- libmagic/readcdf.c libmagic/softmagic.c"
-
- AC_MSG_CHECKING([for strcasestr])
-+ AC_CACHE_VAL(ac_cv_func_strcasestr,
- AC_TRY_RUN([
- #include <string.h>
- #include <strings.h>
-@@ -46,7 +47,7 @@
- AC_MSG_RESULT(no)
- AC_MSG_NOTICE(using libmagic strcasestr implementation)
- libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
-- ])
-+ ]))
-
- PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
- PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
--- /dev/null
+From a874ba472151c6811018de322a5787d0ca6148c9 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Tue, 9 Aug 2016 11:52:51 +0200
+Subject: [PATCH] ext/fileinfo/config.m4: allow cache answer for strcasestr
+ discovery
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+---
+ ext/fileinfo/config.m4 | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/ext/fileinfo/config.m4 b/ext/fileinfo/config.m4
+index 7e98d62..8561962 100644
+--- a/ext/fileinfo/config.m4
++++ b/ext/fileinfo/config.m4
+@@ -14,6 +14,7 @@ if test "$PHP_FILEINFO" != "no"; then
+ libmagic/readcdf.c libmagic/softmagic.c"
+
+ AC_MSG_CHECKING([for strcasestr])
++ AC_CACHE_VAL(ac_cv_func_strcasestr,
+ AC_TRY_RUN([
+ #include <string.h>
+ #include <strings.h>
+@@ -46,7 +47,7 @@ int main(void)
+ AC_MSG_RESULT(no)
+ AC_MSG_NOTICE(using libmagic strcasestr implementation)
+ libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
+- ])
++ ]))
+
+ PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
+ PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
+--
+2.7.4
+
--- /dev/null
+From 1a8714d0b56e06301b3c261eaef93d897ec5d834 Mon Sep 17 00:00:00 2001
+From: Floris Bos <bos@je-eigen-domein.nl>
+Date: Fri, 1 May 2015 15:28:55 +0200
+Subject: [PATCH] Fix php-fpm.service.in
+
+- Expand file paths.
+- Remove obsolete After=syslog.target. Syslog is socket activated nowadays.
+
+Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
+---
+ sapi/fpm/php-fpm.service.in | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in
+index a2df30e..c135f04 100644
+--- a/sapi/fpm/php-fpm.service.in
++++ b/sapi/fpm/php-fpm.service.in
+@@ -1,11 +1,11 @@
+ [Unit]
+ Description=The PHP FastCGI Process Manager
+-After=syslog.target network.target
++After=network.target
+
+ [Service]
+ Type=@php_fpm_systemd@
+-PIDFile=@localstatedir@/run/php-fpm.pid
+-ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
++PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid
++ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf
+ ExecReload=/bin/kill -USR2 $MAINPID
+
+ [Install]
+--
+2.7.4
+
+++ /dev/null
-From bb19125781c0794da9a63fee62e263ff4efff661 Mon Sep 17 00:00:00 2001
-From: Floris Bos <bos@je-eigen-domein.nl>
-Date: Fri, 1 May 2015 15:28:55 +0200
-Subject: [PATCH] Fix php-fpm.service.in
-
-- Expand file paths.
-- Remove obsolete After=syslog.target. Syslog is socket activated nowadays.
-
-Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
----
- sapi/fpm/php-fpm.service.in | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in
-index a2df30e..c135f04 100644
---- a/sapi/fpm/php-fpm.service.in
-+++ b/sapi/fpm/php-fpm.service.in
-@@ -1,11 +1,11 @@
- [Unit]
- Description=The PHP FastCGI Process Manager
--After=syslog.target network.target
-+After=network.target
-
- [Service]
- Type=@php_fpm_systemd@
--PIDFile=@localstatedir@/run/php-fpm.pid
--ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
-+PIDFile=@EXPANDED_LOCALSTATEDIR@/run/php-fpm.pid
-+ExecStart=@EXPANDED_SBINDIR@/php-fpm --nodaemonize --fpm-config @EXPANDED_SYSCONFDIR@/php-fpm.conf
- ExecReload=/bin/kill -USR2 $MAINPID
-
- [Install]
---
-2.1.4
-