1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/pcntl/config.m4
Peter Kokot dcdcb3cbfe Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE (#15209)
This replaces the AC_MSG_ERROR with AC_MSG_FAILURE, where appropriate.

The AC_MSG_ERROR outputs given message and exits the configure step. The
AC_MSG_FAILURE does the same but also automatically outputs additional
message "See 'config.log' for more details." which might help directing
the user where to look further.

The AC_MSG_ERROR is used for errors where current test step isn't logged
in the config.log and wouldn't make sense, and AC_MSG_FAILURE is mostly
used in cases of library checks, compilation tests, headers checked with
AC_CHECK_HEADER* and similar tests that are also logged in the
config.log.

AC_MSG_ERROR([Sanity check failed.]) output:

```
configure: error: Sanity check failed.
```

AC_MSG_FAILURE([Sanity check failed.]) output:

```
configure: error: in '/path/to/php-src':
configure: error: Sanity check failed.
See 'config.log' for more details
```
2024-08-04 07:36:37 +02:00

63 lines
1.6 KiB
Plaintext

PHP_ARG_ENABLE([pcntl],
[whether to enable pcntl support],
[AS_HELP_STRING([--enable-pcntl],
[Enable pcntl support (CLI/CGI only)])])
if test "$PHP_PCNTL" != "no"; then
for function in fork sigaction waitpid; do
AC_CHECK_FUNC([$function],,
[AC_MSG_FAILURE([ext/pcntl: required function $function() not found.])])
done
AC_CHECK_FUNCS(m4_normalize([
forkx
getcpuid
getpriority
pidfd_open
pset_bind
pthread_set_qos_class_self_np
rfork
sched_setaffinity
setpriority
sigwaitinfo
sigtimedwait
unshare
wait3
wait4
waitid
]))
AC_CHECK_FUNCS([WIFCONTINUED],,
[AC_CHECK_DECL([WIFCONTINUED], [AC_DEFINE([HAVE_WIFCONTINUED], [1])],,
[#include <sys/wait.h>])])
AC_CHECK_DECLS([WCONTINUED, WEXITED, WSTOPPED, WNOWAIT, P_ALL, P_PIDFD, P_UID, P_JAILID],,,
[#include <sys/wait.h>])
dnl if unsupported, -1 means automatically ENOSYS in this context
AC_CACHE_CHECK([if sched_getcpu is supported], [php_cv_func_sched_getcpu],
[AC_RUN_IFELSE([AC_LANG_SOURCE([
#include <sched.h>
int main(void) {
if (sched_getcpu() == -1) {
return 1;
}
return 0;
}
])],
[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],
[Define to 1 if the 'sched_getcpu' function is properly supported.])])
AC_CHECK_TYPE([siginfo_t],[PCNTL_CFLAGS="-DHAVE_STRUCT_SIGINFO_T"],,[#include <signal.h>])
PHP_NEW_EXTENSION([pcntl],
[pcntl.c php_signal.c],
[$ext_shared],
[cli],
[$PCNTL_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
fi