Skip to content

Commit 354b263

Browse files
authored
Wrap iconv errno check in AC_CACHE_CHECK (#14438)
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.
1 parent 75033c0 commit 354b263

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

ext/iconv/config.m4

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ if test "$PHP_ICONV" != "no"; then
7676
;;
7777
esac
7878

79-
AC_MSG_CHECKING([if iconv supports errno])
80-
AC_RUN_IFELSE([AC_LANG_SOURCE([[
79+
AC_CACHE_CHECK([if iconv supports errno], [php_cv_iconv_errno],
80+
[AC_RUN_IFELSE([AC_LANG_SOURCE([
8181
#include <iconv.h>
8282
#include <errno.h>
8383
@@ -94,14 +94,12 @@ int main(void) {
9494
iconv_close( cd );
9595
return 2;
9696
}
97-
]])],[
98-
AC_MSG_RESULT(yes)
99-
],[
100-
AC_MSG_RESULT(no)
101-
AC_MSG_ERROR(iconv does not support errno)
102-
],[
103-
AC_MSG_RESULT(yes, cross-compiling)
104-
])
97+
])],
98+
[php_cv_iconv_errno=yes],
99+
[php_cv_iconv_errno=no],
100+
[php_cv_iconv_errno=yes])])
101+
AS_VAR_IF([php_cv_iconv_errno], [yes],,
102+
[AC_MSG_ERROR([iconv does not support errno])])
105103

106104
AC_CACHE_CHECK([if iconv supports //IGNORE], [php_cv_iconv_ignore],
107105
[AC_RUN_IFELSE([AC_LANG_SOURCE([[

0 commit comments

Comments
 (0)