From 8caea61bd3804d34db53f327b9d452f5a3b4e94f Mon Sep 17 00:00:00 2001 From: foobar Date: Wed, 30 Jul 2003 21:57:02 +0000 Subject: [PATCH] MFH --- ext/iconv/config.m4 | 13 ++++++++----- ext/iconv/iconv.c | 9 +++++---- ext/iconv/php_iconv.h | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 index a136cc9c6c..5700cc91ad 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 @@ -27,10 +27,10 @@ if test "$PHP_ICONV" != "no"; then LDFLAGS="-L$PHP_ICONV_PREFIX/lib $LDFLAGS" if test -r $PHP_ICONV_PREFIX/include/giconv.h; then - PHP_ICONV_H="giconv.h" + PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h" else - PHP_ICONV_H="iconv.h" - fi + PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h" + fi if test -z "$iconv_lib_name"; then AC_MSG_CHECKING([if iconv is glibc's]) @@ -88,7 +88,7 @@ if test "$PHP_ICONV" != "no"; then AC_MSG_CHECKING([if iconv supports errno]) AC_TRY_RUN([ -#include <$PHP_ICONV_H> +#include <$PHP_ICONV_H_PATH> #include int main() { @@ -97,7 +97,7 @@ int main() { if (cd == (iconv_t)(-1)) { if (errno == EINVAL) { return 0; - } else { + } else { return 1; } } @@ -117,6 +117,9 @@ int main() { CFLAGS="$iconv_cflags_save" LDFLAGS="$iconv_ldflags_save" + PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>]) + AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h]) + PHP_NEW_EXTENSION(iconv, iconv.c, $ext_shared) PHP_SUBST(ICONV_SHARED_LIBADD) else diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 42e1ab7066..282ef41d3d 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -31,16 +31,17 @@ #include "php_ini.h" #include + #include "php_iconv.h" #ifdef HAVE_ICONV -#ifdef HAVE_GICONV_H -#include -#else -#include +#ifndef PHP_ICONV_H_PATH +#define PHP_ICONV_H_PATH #endif +#include PHP_ICONV_H_PATH + #ifdef HAVE_GLIBC_ICONV #include #endif diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h index db8c9d65bd..cd6fe83a25 100644 --- a/ext/iconv/php_iconv.h +++ b/ext/iconv/php_iconv.h @@ -35,6 +35,7 @@ #include "php_have_bsd_iconv.h" #include "php_iconv_supports_errno.h" #include "php_php_iconv_impl.h" +#include "php_php_iconv_h_path.h" #endif -- 2.50.1