Skip to content

Commit fd7342f

Browse files
committed
Fix _GNU_SOURCE redefined warnings in config.log
_GNU_SOURCE is already defined when doing these checks and warnings are emitted otherwise in the configuration step.
1 parent b667616 commit fd7342f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

build/php.m4

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,14 +1411,18 @@ AC_DEFUN([PHP_FOPENCOOKIE], [
14111411
if test "$have_glibc_fopencookie" = "yes"; then
14121412
dnl glibcs (since 2.1.2?) have a type called cookie_io_functions_t.
14131413
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1414+
#ifndef _GNU_SOURCE
14141415
#define _GNU_SOURCE
1416+
#endif
14151417
#include <stdio.h>
14161418
]], [[cookie_io_functions_t cookie;]])],[have_cookie_io_functions_t=yes],[])
14171419
14181420
if test "$have_cookie_io_functions_t" = "yes"; then
14191421
dnl Newer glibcs have a different seeker definition.
14201422
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1423+
#ifndef _GNU_SOURCE
14211424
#define _GNU_SOURCE
1425+
#endif
14221426
#include <stdio.h>
14231427
#include <stdlib.h>
14241428
@@ -2211,7 +2215,9 @@ crypt_r("passwd", "hash", &buffer);
22112215
if test "$php_cv_crypt_r_style" = "none"; then
22122216
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
22132217
#define _REENTRANT 1
2218+
#ifndef _GNU_SOURCE
22142219
#define _GNU_SOURCE
2220+
#endif
22152221
#include <crypt.h>
22162222
]],[[
22172223
struct crypt_data buffer;

ext/posix/config.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ int main(int argc, char *argv[])
3838

3939
AC_CACHE_CHECK([for utsname.domainname], ac_cv_have_utsname_domainname, [
4040
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
41+
#ifndef _GNU_SOURCE
4142
#define _GNU_SOURCE
43+
#endif
4244
#include <sys/utsname.h>
4345
]],[[
4446
return sizeof(((struct utsname *)0)->domainname);

sapi/fpm/config.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ AC_DEFUN([AC_FPM_TRACE],
230230
AC_MSG_CHECKING([for proc mem file])
231231
232232
AC_RUN_IFELSE([AC_LANG_SOURCE([[
233+
#ifndef _GNU_SOURCE
233234
#define _GNU_SOURCE
235+
#endif
234236
#define _FILE_OFFSET_BITS 64
235237
#include <stdint.h>
236238
#include <unistd.h>

0 commit comments

Comments
 (0)