diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 index 5e2b47245dc..37f82eb4796 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 @@ -14,7 +14,8 @@ if test "$PHP_ICONV" != "no"; then ]) if test "$iconv_avail" != "no"; then - + iconv_cflags_save="$CFLAGS" + CFLAGS="$CFLAGS $INCLUDES" AC_MSG_CHECKING([if iconv supports errno]) AC_TRY_RUN([ #define LIBICONV_PLUG @@ -107,6 +108,8 @@ int main() { ;; esac + CFLAGS="$iconv_cflags_save" + PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared) PHP_SUBST(ICONV_SHARED_LIBADD) else