Skip to content

Commit

Permalink
MFH
Browse files Browse the repository at this point in the history
  • Loading branch information
foobar committed Jul 30, 2003
1 parent 8b2dc68 commit 8caea61
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
13 changes: 8 additions & 5 deletions ext/iconv/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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 <errno.h>
int main() {
Expand All @@ -97,7 +97,7 @@ int main() {
if (cd == (iconv_t)(-1)) {
if (errno == EINVAL) {
return 0;
} else {
} else {
return 1;
}
}
Expand All @@ -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
Expand Down
9 changes: 5 additions & 4 deletions ext/iconv/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@
#include "php_ini.h"

#include <errno.h>

#include "php_iconv.h"

#ifdef HAVE_ICONV

#ifdef HAVE_GICONV_H
#include <giconv.h>
#else
#include <iconv.h>
#ifndef PHP_ICONV_H_PATH
#define PHP_ICONV_H_PATH <iconv.h>
#endif

#include PHP_ICONV_H_PATH

#ifdef HAVE_GLIBC_ICONV
#include <gnu/libc-version.h>
#endif
Expand Down
1 change: 1 addition & 0 deletions ext/iconv/php_iconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 8caea61

Please sign in to comment.