Skip to content

Commit fbc3297

Browse files
authored
Autotools: Move crypt_r check (#14832)
The crypt_r() function is required and check can error out separately.
1 parent 955c2e6 commit fbc3297

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/standard/config.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ if test "$PHP_EXTERNAL_LIBCRYPT" != "no"; then
6060
PHP_CHECK_FUNC(crypt, crypt)
6161
PHP_CHECK_FUNC(crypt_r, crypt)
6262
AC_CHECK_HEADERS([crypt.h])
63-
if test "$ac_cv_func_crypt_r" = "yes"; then
64-
PHP_CRYPT_R_STYLE
65-
fi
63+
AS_VAR_IF([ac_cv_func_crypt_r], [yes],
64+
[PHP_CRYPT_R_STYLE],
65+
[AC_MSG_ERROR([Cannot use external libcrypt as crypt_r() is missing.])])
6666

6767
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
6868
AC_RUN_IFELSE([AC_LANG_SOURCE([[
@@ -262,7 +262,7 @@ int main(void) {
262262
])])
263263

264264

265-
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
265+
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
266266
AC_MSG_ERROR([Cannot use external libcrypt as some algo are missing])
267267
fi
268268

0 commit comments

Comments
 (0)