From 86b01f47edac5e47f547e674e2885a45afe3bc43 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 27 May 2024 12:27:31 +0200 Subject: [PATCH] Wrap sched_getcpu AC_RUN_IFELSE check in AC_CACHE_CHECK For cross-compiling configuration, this wraps the check with the php_cv_func_sched_getcpu variable. --- ext/pcntl/config.m4 | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ext/pcntl/config.m4 b/ext/pcntl/config.m4 index 4d54d75fb030..a2815f53a195 100644 --- a/ext/pcntl/config.m4 +++ b/ext/pcntl/config.m4 @@ -25,8 +25,8 @@ if test "$PHP_PCNTL" != "no"; then ])) dnl if unsupported, -1 means automatically ENOSYS in this context - AC_MSG_CHECKING([if sched_getcpu is supported]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_CACHE_CHECK([if sched_getcpu is supported], [php_cv_func_sched_getcpu], + [AC_RUN_IFELSE([AC_LANG_SOURCE([ #include int main(void) { if (sched_getcpu() == -1) { @@ -34,14 +34,12 @@ int main(void) { } return 0; } - ]])],[ - AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_SCHED_GETCPU],1,[Whether sched_getcpu is properly supported]) - ],[ - AC_MSG_RESULT(no) - ],[ - AC_MSG_RESULT([no, cross-compiling]) - ]) + ])], + [php_cv_func_sched_getcpu=yes], + [php_cv_func_sched_getcpu=no], + [php_cv_func_sched_getcpu=no])]) + AS_VAR_IF([php_cv_func_sched_getcpu], [yes], + [AC_DEFINE([HAVE_SCHED_GETCPU], [1], [Whether sched_getcpu is properly supported])]) AC_CHECK_TYPE([siginfo_t],[PCNTL_CFLAGS="-DHAVE_STRUCT_SIGINFO_T"],,[#include ])