Skip to content

Commit

Permalink
Remove PHP_ICONV_H_PATH
Browse files Browse the repository at this point in the history
Directly include <iconv.h> instead, now that the giconv.h
distinction no longer exists.
  • Loading branch information
nikic committed Aug 7, 2020
1 parent 2d35974 commit 7bd1d70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 4 additions & 6 deletions ext/iconv/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ if test "$PHP_ICONV" != "no"; then

CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
LDFLAGS="-L$PHP_ICONV_PREFIX/$PHP_LIBDIR $LDFLAGS"
PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/iconv.h"

AC_MSG_CHECKING([if iconv is glibc's])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gnu/libc-version.h>]], [[gnu_get_libc_version();]])],[
Expand All @@ -44,7 +43,7 @@ if test "$PHP_ICONV" != "no"; then
php_iconv_old_ld="$LDFLAGS"
LDFLAGS="-liconv $LDFLAGS"
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <$PHP_ICONV_H_PATH>
#include <iconv.h>
int main() {
printf("%d", _libiconv_version);
return 0;
Expand Down Expand Up @@ -108,7 +107,7 @@ int main() {

AC_MSG_CHECKING([if iconv supports errno])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <$PHP_ICONV_H_PATH>
#include <iconv.h>
#include <errno.h>
int main() {
Expand All @@ -135,7 +134,7 @@ int main() {

AC_MSG_CHECKING([if iconv supports //IGNORE])
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <$PHP_ICONV_H_PATH>
#include <iconv.h>
#include <stdlib.h>
int main() {
Expand Down Expand Up @@ -166,11 +165,10 @@ int main() {

AC_MSG_CHECKING([if your cpp allows macro usage in include lines])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define FOO <$PHP_ICONV_H_PATH>
#define FOO <iconv.h>
#include FOO
]], [])], [
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h])
], [
AC_MSG_RESULT([no])
])
Expand Down
4 changes: 0 additions & 4 deletions ext/iconv/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@

#ifdef HAVE_ICONV

#ifdef PHP_ICONV_H_PATH
#include PHP_ICONV_H_PATH
#else
#include <iconv.h>
#endif

#ifdef HAVE_GLIBC_ICONV
#include <gnu/libc-version.h>
Expand Down

0 comments on commit 7bd1d70

Please sign in to comment.