php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53442 [fix provided] configure --with-iconv=DIR fails due to two faulty tests
Submitted: 2010-12-01 22:50 UTC Modified: 2013-10-01 12:23 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: fransmeulenbroeks at gmail dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.2SVN-2010-12-01 (snap) OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fransmeulenbroeks at gmail dot com
New email:
PHP Version: OS:

 

 [2010-12-01 22:50 UTC] fransmeulenbroeks at gmail dot com
Description:
------------
when trying to cross-compile configure picked up the host iconv, not the target one, resulting in wrong paths later on and configure failing.

configure was called with configure --with-iconv=DIR (where DIR is the dir to find the iconv stuff).

This fails at two places. First one is due to a faulty test in acinclude.m4
It tests PHP_ICONV against "yes". However PHP_ICONV in my case contains the path so we should test against not "no"
(PHP_ICONV can be a dir because otherwise this code later on would not make any sense:     for i in $PHP_ICONV /usr/local /usr; do )

The following patch is for 5.2.13, but I have verified it is also in the 5.2 snap from today.

Index: php-5.2.13/acinclude.m4
===================================================================
--- php-5.2.13.orig/acinclude.m4
+++ php-5.2.13/acinclude.m4
@@ -2430,7 +2430,8 @@ AC_DEFUN([PHP_SETUP_ICONV], [
   dnl
   dnl Check libc first if no path is provided in --with-iconv
   dnl
-  if test "$PHP_ICONV" = "yes"; then
+  dnl must check against no, not against yes as PHP_ICONV can also include a path, which implies yes
+  if test "$PHP_ICONV" != no"; then
     AC_CHECK_FUNC(iconv, [
       found_iconv=yes
     ],[



Patches

acinclude_m4_v2.patch (last revision 2010-12-01 22:05 UTC by fransmeulenbroeks at gmail dot com)
acinclude_m4.patch (last revision 2010-12-01 21:52 UTC by fransmeulenbroeks at gmail dot com)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-01 23:09 UTC] fransmeulenbroeks at gmail dot com
oops, made typo in patch
This line:
+  if test "$PHP_ICONV" != no"; then
is missing a " and must read
+  if test "$PHP_ICONV" != "no"; then

Uploaded a new patch.
Sorry for any inconvenience!
 [2010-12-01 23:10 UTC] fransmeulenbroeks at gmail dot com
oh and the subject line is wrong this reports and fixes only one faulty test, the other one is reported and fixed in 53443
 [2013-06-25 16:35 UTC] felipe@php.net
There is a check right after what you have quoted which handles the supplied path.

...
  dnl
  dnl Check external libs for iconv funcs
  dnl
  if test "$found_iconv" = "no"; then

    for i in $PHP_ICONV /usr/local /usr; do
...
 [2013-10-01 12:23 UTC] mike@php.net
-Status: Open +Status: Not a bug
 [2013-10-01 12:23 UTC] mike@php.net
Anything to add here?
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu May 01 23:01:29 2025 UTC