From 72dc38dbaea6bef3043c89701953274a9ad41099 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Tue, 16 Jun 2026 20:29:09 +0200 Subject: [PATCH] Autotools: Fix out-of-source builds and epoll_pwait2 check * Added main/poll to build directories to enable out-of-source builds. * AC_CHECK_FUNCS() Autoconf macro doesn't accept 4th argument (it's a link check). Instead, added a AC_CHECK_DECL() fallback check if epoll_pwait2 is defined as a macro (as in glibc at the time of writing in certain scenarios). --- build/php.m4 | 6 +++++- configure.ac | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build/php.m4 b/build/php.m4 index 74c069f5887b..83375bec5aa2 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -1396,7 +1396,11 @@ AC_DEFUN([PHP_POLL_MECHANISMS], AC_DEFINE([HAVE_EPOLL], [1], [Define if epoll is available]) poll_mechanisms="$poll_mechanisms epoll" - AC_CHECK_FUNCS([epoll_pwait2], [], [], [#include ]) + AC_CHECK_FUNCS([epoll_pwait2], [], + [AC_CHECK_DECL([epoll_pwait2], + [AC_DEFINE([HAVE_EPOLL_PWAIT2], [1])], + [], + [#include ])]) ]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ diff --git a/configure.ac b/configure.ac index 63c00f508c1c..b61b909b67b7 100644 --- a/configure.ac +++ b/configure.ac @@ -1817,6 +1817,7 @@ AC_DEFINE([HAVE_BUILD_DEFS_H], [1], PHP_ADD_BUILD_DIR([ main + main/poll main/streams scripts scripts/man1