Commit 9a57d1af1ab for php.net
commit 9a57d1af1ab641800a5b9cd25ed54bb44a4f87d0
Author: Peter Kokot <peterkokot@gmail.com>
Date: Fri Jun 19 20:24:19 2026 +0200
Autotools: Fix out-of-source builds and epoll_pwait2 check (#22334)
* 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).
diff --git a/build/php.m4 b/build/php.m4
index 74c069f5887..83375bec5aa 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 <sys/epoll.h>])
+ AC_CHECK_FUNCS([epoll_pwait2], [],
+ [AC_CHECK_DECL([epoll_pwait2],
+ [AC_DEFINE([HAVE_EPOLL_PWAIT2], [1])],
+ [],
+ [#include <sys/epoll.h>])])
])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
diff --git a/configure.ac b/configure.ac
index 63c00f508c1..b61b909b67b 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