Autotools: Move crypt_r check (#14832)

The crypt_r() function is required and check can error out separately.
This commit is contained in:
Peter Kokot 2024-07-05 13:14:48 +02:00 committed by GitHub
parent 955c2e60eb
commit fbc329733c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -60,9 +60,9 @@ if test "$PHP_EXTERNAL_LIBCRYPT" != "no"; then
PHP_CHECK_FUNC(crypt, crypt)
PHP_CHECK_FUNC(crypt_r, crypt)
AC_CHECK_HEADERS([crypt.h])
if test "$ac_cv_func_crypt_r" = "yes"; then
PHP_CRYPT_R_STYLE
fi
AS_VAR_IF([ac_cv_func_crypt_r], [yes],
[PHP_CRYPT_R_STYLE],
[AC_MSG_ERROR([Cannot use external libcrypt as crypt_r() is missing.])])
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@ -262,7 +262,7 @@ int main(void) {
])])
if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "$ac_cv_crypt_md5" = "no" || test "$ac_cv_crypt_sha512" = "no" || test "$ac_cv_crypt_sha256" = "no" || test "$ac_cv_func_crypt_r" != "yes"; then
if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "$ac_cv_crypt_md5" = "no" || test "$ac_cv_crypt_sha512" = "no" || test "$ac_cv_crypt_sha256" = "no"; then
AC_MSG_ERROR([Cannot use external libcrypt as some algo are missing])
fi