From b85993fa7dd9c2501b757e9cbd7d98eb5602b8cc Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 2 Jun 2024 15:13:44 +0200 Subject: [PATCH] Wrap iconv errno check in AC_CACHE_CHECK Cross-compiling in this case is passed but for the sake of consistency this check is also cached to enable manual overriding with the php_cv_iconv_errno cache variable. --- ext/iconv/config.m4 | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 index d4edf9d2d82ab..6fd60b90838a4 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 @@ -76,8 +76,8 @@ if test "$PHP_ICONV" != "no"; then ;; esac - AC_MSG_CHECKING([if iconv supports errno]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_CACHE_CHECK([if iconv supports errno], [php_cv_iconv_errno], + [AC_RUN_IFELSE([AC_LANG_SOURCE([ #include #include @@ -94,14 +94,12 @@ int main(void) { iconv_close( cd ); return 2; } - ]])],[ - AC_MSG_RESULT(yes) - ],[ - AC_MSG_RESULT(no) - AC_MSG_ERROR(iconv does not support errno) - ],[ - AC_MSG_RESULT(yes, cross-compiling) - ]) + ])], + [php_cv_iconv_errno=yes], + [php_cv_iconv_errno=no], + [php_cv_iconv_errno=yes])]) + AS_VAR_IF([php_cv_iconv_errno], [yes],, + [AC_MSG_ERROR([iconv does not support errno])]) AC_CACHE_CHECK([if iconv supports //IGNORE], [php_cv_iconv_ignore], [AC_RUN_IFELSE([AC_LANG_SOURCE([[