xref: /PHP-8.1/ext/pcntl/config.m4 (revision 28382aa1)
1PHP_ARG_ENABLE([pcntl],
2  [whether to enable pcntl support],
3  [AS_HELP_STRING([--enable-pcntl],
4    [Enable pcntl support (CLI/CGI only)])])
5
6if test "$PHP_PCNTL" != "no"; then
7  AC_CHECK_FUNCS([fork], [], [AC_MSG_ERROR([pcntl: fork() not supported by this platform])])
8  AC_CHECK_FUNCS([waitpid], [], [AC_MSG_ERROR([pcntl: waitpid() not supported by this platform])])
9  AC_CHECK_FUNCS([sigaction], [], [AC_MSG_ERROR([pcntl: sigaction() not supported by this platform])])
10  AC_CHECK_FUNCS([getpriority setpriority wait3 wait4 sigwaitinfo sigtimedwait unshare rfork])
11
12  AC_MSG_CHECKING([for siginfo_t])
13  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
14    #include <signal.h>
15    #ifdef HAVE_SIGINFO_H
16      #include <siginfo.h>
17    #endif
18  ]],[[
19    siginfo_t info;
20  ]])],[
21    AC_MSG_RESULT([yes])
22    PCNTL_CFLAGS="-DHAVE_STRUCT_SIGINFO_T"
23  ], [
24    AC_MSG_RESULT([no])
25  ])
26
27  PHP_NEW_EXTENSION(pcntl, pcntl.c php_signal.c, $ext_shared, cli, $PCNTL_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
28fi
29