From: David Carlier Date: Mon, 10 Aug 2020 20:16:10 +0000 (+0100) Subject: Fix crypt_r detection under BSD system X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6ca6e9f89163f4160ade12eb516e0e29f3c3fa15;p=php Fix crypt_r detection under BSD system For BSD systems, crypt.h does not exist, instead we need to include unistd.h. Closes GH-5971. --- diff --git a/build/php.m4 b/build/php.m4 index 0d0fb61fbe..1797b38382 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -2217,6 +2217,17 @@ crypt_r("passwd", "hash", &buffer); fi ]) + if test "$php_cv_crypt_r_style" = "none"; then + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +]],[[ +struct crypt_data buffer; +crypt_r("passwd", "hash", &buffer); +]])],[php_cv_crypt_r_style=struct_crypt_data],[]) + fi + ]) + if test "$php_cv_crypt_r_style" = "cryptd"; then AC_DEFINE(CRYPT_R_CRYPTD, 1, [Define if crypt_r has uses CRYPTD]) fi