Skip to content

Commit 9a57d1a

Browse files
authored
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).
1 parent e71b4e5 commit 9a57d1a

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

build/php.m4

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,11 @@ AC_DEFUN([PHP_POLL_MECHANISMS],
13961396
AC_DEFINE([HAVE_EPOLL], [1], [Define if epoll is available])
13971397
poll_mechanisms="$poll_mechanisms epoll"
13981398
1399-
AC_CHECK_FUNCS([epoll_pwait2], [], [], [#include <sys/epoll.h>])
1399+
AC_CHECK_FUNCS([epoll_pwait2], [],
1400+
[AC_CHECK_DECL([epoll_pwait2],
1401+
[AC_DEFINE([HAVE_EPOLL_PWAIT2], [1])],
1402+
[],
1403+
[#include <sys/epoll.h>])])
14001404
])
14011405
14021406
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,6 +1817,7 @@ AC_DEFINE([HAVE_BUILD_DEFS_H], [1],
18171817

18181818
PHP_ADD_BUILD_DIR([
18191819
main
1820+
main/poll
18201821
main/streams
18211822
scripts
18221823
scripts/man1

0 commit comments

Comments
 (0)