ID: 35288 User updated by: webmaster at negeta dot com Reported By: webmaster at negeta dot com -Status: Feedback +Status: Open Bug Type: ICONV related Operating System: FreeBSD 5.4 PHP Version: 5.1.0RC6 New Comment:
I ran "./configure" I only installed libiconv-1.9.2 from FreeBSD ports 'converters/libiconv.' libiconv has C function "iconv" in 'lib/iconv.c', and alias name "libiconv" is defined in 'include/iconv.h.' And a program can use "iconv" as "libiconv." 'configure' detects function "iconv" first. And it detects "libiconv" when "iconv" was not found. And HAVE_ICONV is defined and HAVE_LIBICONV is not defined. When 'ext/iconv/iconv.c :line 68' is compiled, PHP_NAMED_FE(iconv,php_if_iconv, ... is understood as PHP_NAMED_FE(libiconv,php_if_iconv, ... by compiler. Because #ifdef HAVE_LIBICONV #undef iconv #endif skips undefine "iconv." To solve this, I thought that HAVE_LIBICONV is necessary. I read acinclude.m4, and found the order of "iconv" and "libiconv." If 'configure' detect "libiconv" first, then it will define HAVE_ICONV and HAVE_LIBICONV. And if system has only "iconv", then it will not define HAVE_LIBICONV. Maybe Linux system is not influenced by this problem. Because these system has iconv of glibc, and there is no "libiconv." Previous Comments: ------------------------------------------------------------------------ [2005-11-21 16:06:49] [EMAIL PROTECTED] What was the configure line used? And where exactly is iconv AND libiconv defined in your system? Do you have 2 different implementations installed under same prefix? If you do, this is not PHP bug and not possible to solve with that patch. ------------------------------------------------------------------------ [2005-11-21 05:35:31] webmaster at negeta dot com > 0. C function "iconv" is exist, and "libiconv" is not. It's not correct and my mistake. Both functions are available in my system. Please check "libiconv" before checking "iconv." Then HAVE_ICONV and HAVE_LIBICONV are defined by configure, and the problem is not reproduce in my system. Please commit this patch if it looks like good. http://www.negeta.com/misc/acinclude.m4.patch ------------------------------------------------------------------------ [2005-11-20 11:32:23] webmaster at negeta dot com Only HAVE_ICONV is exist in my system. Thank you for your patch, but it is not solve the problem. This patch is not undef `iconv' when HAVE_LIBICONV is not defined. As a test, I deleted first "#ifdef HAVE_LIBICONV" and "#endif", it force undef 'iconv', and problem was not reproduce. But I can't estimate about side-effect on other system. ------------------------------------------------------------------------ [2005-11-19 21:41:37] [EMAIL PROTECTED] Also, is HAVE_BSD_ICONV defined on your system? ------------------------------------------------------------------------ [2005-11-19 21:37:17] [EMAIL PROTECTED] Try the following patch: http://bb.prohost.org/patch/iconv.txt ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/35288 -- Edit this bug report at http://bugs.php.net/?id=35288&edit=1