diff --git a/build/php.m4 b/build/php.m4 index 345e05c06d3..9735f6592dc 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -1411,14 +1411,18 @@ AC_DEFUN([PHP_FOPENCOOKIE], [ if test "$have_glibc_fopencookie" = "yes"; then dnl glibcs (since 2.1.2?) have a type called cookie_io_functions_t. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include ]], [[cookie_io_functions_t cookie;]])],[have_cookie_io_functions_t=yes],[]) if test "$have_cookie_io_functions_t" = "yes"; then dnl Newer glibcs have a different seeker definition. AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include #include @@ -2211,7 +2215,9 @@ crypt_r("passwd", "hash", &buffer); if test "$php_cv_crypt_r_style" = "none"; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _REENTRANT 1 +#ifndef _GNU_SOURCE #define _GNU_SOURCE +#endif #include ]],[[ struct crypt_data buffer; diff --git a/ext/posix/config.m4 b/ext/posix/config.m4 index ff4a421542d..72deacc42ed 100644 --- a/ext/posix/config.m4 +++ b/ext/posix/config.m4 @@ -38,7 +38,9 @@ int main(int argc, char *argv[]) AC_CACHE_CHECK([for utsname.domainname], ac_cv_have_utsname_domainname, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #ifndef _GNU_SOURCE #define _GNU_SOURCE + #endif #include ]],[[ return sizeof(((struct utsname *)0)->domainname); diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4 index d261b4df468..807357a001f 100644 --- a/sapi/fpm/config.m4 +++ b/sapi/fpm/config.m4 @@ -230,7 +230,9 @@ AC_DEFUN([AC_FPM_TRACE], AC_MSG_CHECKING([for proc mem file]) AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #ifndef _GNU_SOURCE #define _GNU_SOURCE + #endif #define _FILE_OFFSET_BITS 64 #include #include