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.
This commit is contained in:
Peter Kokot 2024-01-10 08:39:29 +01:00
parent b667616fe0
commit fd7342f62f
3 changed files with 10 additions and 0 deletions

View File

@ -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 <stdio.h>
]], [[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 <stdio.h>
#include <stdlib.h>
@ -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 <crypt.h>
]],[[
struct crypt_data buffer;

View File

@ -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 <sys/utsname.h>
]],[[
return sizeof(((struct utsname *)0)->domainname);

View File

@ -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 <stdint.h>
#include <unistd.h>