1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Simplify nanosleep Autoconf check (#13490)

The nanosleep() is mostly found in libc, except on systems, such as
Solaris <= 10 or the discontinued OpenSolaris, it is in the rt library.

This checks if nanosleep() exists in the libc, then it checks if rt
library has nanosleep, prepends it to LIBS and defines the
HAVE_NANOSLEEP symbol with the template from the AC_CHECK_FUNCS.
This commit is contained in:
Peter Kokot
2024-02-25 18:28:33 +01:00
committed by GitHub
parent 6d721b21a1
commit d024dd3abd

View File

@@ -620,7 +620,6 @@ usleep \
utime \
vasprintf \
asprintf \
nanosleep \
memmem \
memrchr \
mempcpy \
@@ -638,8 +637,9 @@ AC_CHECK_HEADER([sys/procctl.h], [AC_CHECK_FUNCS([procctl])])
AX_FUNC_WHICH_GETHOSTBYNAME_R
dnl Some systems (like OpenSolaris) do not have nanosleep in libc.
PHP_CHECK_FUNC_LIB(nanosleep, rt)
dnl Some systems (Solaris 10) do not have nanosleep in libc.
AC_CHECK_FUNCS([nanosleep],,
[AC_SEARCH_LIBS([nanosleep], [rt], [AC_DEFINE([HAVE_NANOSLEEP], [1])])])
dnl Haiku does not have network api in libc.
PHP_CHECK_FUNC_LIB(setsockopt, network)