@@ -83,6 +83,8 @@ int main(void) {
8383 AS_VAR_IF ( [ php_cv_iconv_errno] , [ yes] ,,
8484 [ AC_MSG_FAILURE ( [ The iconv check failed, 'errno' is missing.] ) ] )
8585
86+ dnl iconv on some platforms (NetBSD pre-10, Solaris) may have a non-standard
87+ dnl const input parameter; libiconv may imitate this on those platforms.
8688 AC_CACHE_CHECK ( [ if iconv input parameter is const (non-standard)] , [ php_cv_iconv_const] ,
8789 [ AC_COMPILE_IFELSE ( [ AC_LANG_SOURCE ( [
8890#include <iconv.h>
@@ -91,8 +93,6 @@ size_t iconv(iconv_t cd, const char **src, size_t *srcleft, char **dst, size_t *
9193 ] ) ] ,
9294 [ php_cv_iconv_const=const] ,
9395 [ php_cv_iconv_const=] ) ] )
94- AC_DEFINE_UNQUOTED ( [ ICONV_CONST] , [ $php_cv_iconv_const] ,
95- [ Define to const if iconv's input is const.] )
9696
9797 AC_CACHE_CHECK ( [ if iconv supports //IGNORE] , [ php_cv_iconv_ignore] ,
9898 [ AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [
@@ -131,7 +131,7 @@ int main(void) {
131131 PHP_NEW_EXTENSION([ iconv] ,
132132 [ iconv.c] ,
133133 [ $ext_shared] ,,
134- [ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1] )
134+ [ -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DICONV_CONST=$php_cv_iconv_const ] )
135135 PHP_SUBST([ ICONV_SHARED_LIBADD] )
136136 PHP_INSTALL_HEADERS([ ext/iconv] , [ php_iconv.h] )
137137fi
0 commit comments