php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25281 specifying --with-iconv=<dir> causes compile failure
Submitted: 2003-08-27 18:53 UTC Modified: 2004-02-11 12:39 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: phpbugs at rickbradley dot com Assigned: moriyoshi (profile)
Status: Wont fix Package: ICONV related
PHP Version: 4.3.3 OS: FreeBSD
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: phpbugs at rickbradley dot com
New email:
PHP Version: OS:

 

 [2003-08-27 18:53 UTC] phpbugs at rickbradley dot com
Description:
------------
When building PHP-4.3.3 if --with-iconv-dir=<iconvdir> is specified the build of PHP fails with the following error:

gcc  -Iext/iconv/ -I/home/eastcore/sites/build/src/php-4.3.3/ext/iconv/ -DPHP_ATOM_INC -I/home/eastcore/sites/build/src/php-4.3.3/include -I/home/eastcore/sites/build/src/php-4.3.3/main -I/home/eastcore/sites/build/src/php-4.3.3 -I/home/eastcore/sites/build/src/php-4.3.3/Zend -I/home/eastcore/sites/server//openssl/include -I/home/eastcore/sites/server//iconv/include -I/usr/local/include/mysql -I/home/eastcore/sites/server//expat/include  -I/home/eastcore/sites/build/src/php-4.3.3/TSRM  -g -O2  -c /home/eastcore/sites/build/src/php-4.3.3/ext/iconv/iconv.c -o ext/iconv/iconv.o  && echo > ext/iconv/iconv.lo
/home/eastcore/sites/build/src/php-4.3.3/ext/iconv/iconv.c:40: `#include' expects "FILENAME" or <FILENAME>
gmake: *** [ext/iconv/iconv.lo] Error 1

The problem is that the iconv.c file in question contains the following around line 40:

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

I'm running gcc version 2.95.4, with cpp version 2.95.4.  Granted, GNU's cpp is a piece of shit, but back where I come from doing #include <MACRO> is a no-no.

Anyway, my configure line is like so:

./configure  --prefix=/home/eastcore/sites/server//php --with-apache=/home/eastcore/sites/build/src/apache_1.3.28 --with-mysql=/usr/local --with-openssl=/home/eastcore/sites/server//openssl --enable-trans-sid --with-expat-dir=/home/eastcore/sites/server//expat --with-xml --enable-xslt --with-xslt-sablot=/home/eastcore/sites/server//expat --with-iconv=/home/eastcore/sites/server//iconv --with-pear=/home/eastcore/sites/server//php

This is FreeBSD 4.8-RELEASE, with the following versions of hand-compiled software (of interest to my PHP build):

VERSIONPHP      =       php-4.3.3
VERSIONAPACHE   =       apache_1.3.28
VERSIONMODSSL   =       mod_ssl-2.8.15-1.3.28
VERSIONOPENSSL  =       openssl-0.9.7b
VERSIONEXPAT    =       expat-1.95.2
VERSIONSABLOT   =       Sablot-1.0
VERSIONLIBXML   =       libxml2-2.4.30
VERSIONZLIB     =       zlib-1.1.3
VERSIONICONV    =       libiconv-1.7

Yes, that's from a Makefile.in.  I build self-contained (as in everything under one base directory) server installations for multiple distinct servers on a single system.  Being able to install each library version with the server it was built with is important.

I haven't tried this on my Linux servers yet but I see no reason why it won't fail there as well.

Reproduce code:
---------------
# gmake


Expected result:
----------------
I expected it to compile.

Actual result:
--------------
It didn't compile.

If I apply this patch:

--- php-4.3.3/ext/iconv/iconv.c Wed Aug 13 13:22:17 2003
+++ php-4.3.3-patched/ext/iconv/iconv.c Wed Aug 27 18:19:42 2003
@@ -36,11 +36,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>

PHP 4.3.3 will build, but it is not using the same iconv I specified in the --with-iconv=<iconvdir> configure argument.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-28 02:22 UTC] sniper@php.net
Moriyoshi, can I now say "I told you so" ? :)
#include MACRO _does_not_work_everywhere_, period.
(removed all the comments since they didn't give any info we didn't already know)

 [2003-11-17 21:55 UTC] sniper@php.net
See also bug #26264

 [2004-02-11 12:39 UTC] sniper@php.net
Plain and simple: Update your gcc. (works fine with 3.3.1 for example)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 07:01:30 2024 UTC