mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00

To fix part of GH-15381. gcc nor clang provides a constant to distinguish illumos and solaris not the system provides a kernel version stamp like the BSD. thus, we simply check the symbol and remaing purposely conservative in the existing logic, using it only for solaris to avoid unexpected breakages for other systems. would need a different fix for higher branches. Close GH-15390
37 lines
801 B
Text
37 lines
801 B
Text
dnl
|
|
dnl Check for arc4random on BSD systems
|
|
dnl
|
|
AC_CHECK_DECLS([arc4random_buf])
|
|
|
|
dnl
|
|
dnl Check for CCRandomGenerateBytes
|
|
dnl header absent in previous macOs releases
|
|
dnl
|
|
AC_CHECK_HEADERS([CommonCrypto/CommonRandom.h], [], [],
|
|
[
|
|
#include <sys/types.h>
|
|
#include <Availability.h>
|
|
#include <CommonCrypto/CommonCryptoError.h>
|
|
])
|
|
|
|
dnl
|
|
dnl Mostly for non Linux systems
|
|
dnl
|
|
AC_CHECK_FUNCS([getrandom])
|
|
|
|
dnl
|
|
dnl Setup extension
|
|
dnl
|
|
PHP_NEW_EXTENSION(random,
|
|
random.c \
|
|
csprng.c \
|
|
engine_combinedlcg.c \
|
|
engine_mt19937.c \
|
|
engine_pcgoneseq128xslrr64.c \
|
|
engine_xoshiro256starstar.c \
|
|
engine_secure.c \
|
|
engine_user.c \
|
|
gammasection.c \
|
|
randomizer.c,
|
|
no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
|
PHP_INSTALL_HEADERS([ext/random], [php_random.h])
|