From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
Date: Sat, 2 May 2015 10:26:55 +0200
Subject: php-5.3.9-gnusrc

---
 Zend/zend_language_parser.c        | 2 ++
 configure.ac                       | 2 ++
 ext/interbase/interbase.c          | 1 -
 ext/pdo_firebird/firebird_driver.c | 1 -
 ext/standard/file.c                | 3 ---
 ext/zlib/zlib_fopen_wrapper.c      | 2 --
 main/php.h                         | 1 +
 main/streams/cast.c                | 1 -
 main/streams/memory.c              | 1 -
 main/streams/streams.c             | 1 -
 10 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/Zend/zend_language_parser.c b/Zend/zend_language_parser.c
index d7a51f0..160073f 100644
--- a/Zend/zend_language_parser.c
+++ b/Zend/zend_language_parser.c
@@ -69,6 +69,8 @@
 
 /* Copy the first part of user declarations.  */
 
+#include <string.h>
+
 
 /*
    +----------------------------------------------------------------------+
diff --git a/configure.ac b/configure.ac
index 162610e..662a859 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,6 +124,8 @@ AC_DEFUN([PHP_EXT_DIR],[$config_m4_dir])dnl
 AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir/$config_m4_dir])dnl
 AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl
 
+AC_DEFINE([_GNU_SOURCE], 1, [Define to enable GNU C Library extensions])
+
 dnl Setting up the PHP version based on the information above.
 dnl -------------------------------------------------------------------------
 
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index d62085c..eb89f03 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -22,7 +22,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 
 #include "php.h"
 
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
index e2c5ea9..0a63df1 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -20,7 +20,6 @@
 #include "config.h"
 #endif
 
-#define _GNU_SOURCE
 
 #include "php.h"
 #include "zend_exceptions.h"
diff --git a/ext/standard/file.c b/ext/standard/file.c
index dca9cf4..3a60b07 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -105,9 +105,6 @@ php_file_globals file_globals;
 #endif
 
 #if defined(HAVE_FNMATCH) && !defined(PHP_WIN32)
-# ifndef _GNU_SOURCE
-#  define _GNU_SOURCE
-# endif
 # include <fnmatch.h>
 #endif
 
diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c
index 433ba15..4eb56cd 100644
--- a/ext/zlib/zlib_fopen_wrapper.c
+++ b/ext/zlib/zlib_fopen_wrapper.c
@@ -17,8 +17,6 @@
    +----------------------------------------------------------------------+
  */
 
-#define _GNU_SOURCE
-
 #include "php.h"
 #include "php_zlib.h"
 #include "fopen_wrappers.h"
diff --git a/main/php.h b/main/php.h
index 0b5a904..c933188 100644
--- a/main/php.h
+++ b/main/php.h
@@ -29,6 +29,7 @@
 #define YYDEBUG 0
 #define PHP_DEFAULT_CHARSET "UTF-8"
 
+#include "php_config.h"
 #include "php_version.h"
 #include "zend.h"
 #include "zend_sort.h"
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 6cfa651..1fae8ff 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -16,7 +16,6 @@
    +----------------------------------------------------------------------+
  */
 
-#define _GNU_SOURCE
 #include "php.h"
 #include "php_globals.h"
 #include "php_network.h"
diff --git a/main/streams/memory.c b/main/streams/memory.c
index d088f43..56d3a67 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -16,7 +16,6 @@
    +----------------------------------------------------------------------+
  */
 
-#define _GNU_SOURCE
 #include "php.h"
 #include "ext/standard/base64.h"
 
diff --git a/main/streams/streams.c b/main/streams/streams.c
index fb9c680..beb1489 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -19,7 +19,6 @@
    +----------------------------------------------------------------------+
  */
 
-#define _GNU_SOURCE
 #include "php.h"
 #include "php_globals.h"
 #include "php_memory_streams.h"
