forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.m4
48 lines (44 loc) · 1.34 KB
/
config.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
AC_CHECK_FUNCS([fork], [], [AC_MSG_ERROR([pcntl: fork() not supported by this platform])])
AC_CHECK_FUNCS([waitpid], [], [AC_MSG_ERROR([pcntl: waitpid() not supported by this platform])])
AC_CHECK_FUNCS([sigaction], [], [AC_MSG_ERROR([pcntl: sigaction() not supported by this platform])])
AC_CHECK_FUNCS(m4_normalize([
forkx
getcpuid
getpriority
pidfd_open
pthread_set_qos_class_self_np
rfork
sched_setaffinity
setpriority
sigwaitinfo
sigtimedwait
unshare
wait3
wait4
]))
dnl if unsupported, -1 means automatically ENOSYS in this context
AC_MSG_CHECKING([if sched_getcpu is supported])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sched.h>
int main(void) {
if (sched_getcpu() == -1) {
return 1;
}
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])
])
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