ID: 11654
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: Sablotron XSL
Operating system: NetBSD/Alpha 1.5W-current
PHP Version: 4.0.6
Description: configure fails on iconv_open

here are the patches to fix this. dev team, please close this case after you have 
patched php-4.0.7-dev.

--- iconv/config.m4.orig        Mon Jun 25 08:42:44 2001
+++ iconv/config.m4     Mon Jun 25 09:30:37 2001
@@ -29,7 +29,7 @@

   if test -e $ICONV_DIR/lib/libconv.a -o -e $ICONV_DIR/lib/libiconv.so ; then
     PHP_ADD_LIBRARY_WITH_PATH(iconv, $ICONV_DIR/lib, ICONV_SHARED_LIBADD)
-    AC_CHECK_LIB(iconv, iconv_open, AC_DEFINE(HAVE_ICONV, 1, [ ]))
+    AC_CHECK_LIB(iconv, libiconv_open, AC_DEFINE(HAVE_LIBICONV, 1, [ ]))
   else
     AC_CHECK_LIB(c, iconv_open, AC_DEFINE(HAVE_ICONV, 1, [ ]))
   fi

--- sablot/config.m4.orig       Mon Jun 25 10:10:56 2001
+++ sablot/config.m4    Mon Jun 25 10:10:22 2001
@@ -49,7 +49,11 @@
   fi

   found_iconv=no
-  AC_CHECK_LIB(c, iconv_open, found_iconv=yes)
+  if test -e $ICONV_DIR/lib/libconv.a -o -e $ICONV_DIR/lib/libiconv.so ; then
+    AC_CHECK_LIB(iconv, libiconv_open, found_iconv=yes)
+  else
+    AC_CHECK_LIB(c, iconv_open, found_iconv=yes)
+  fi
   if test "$found_iconv" = "no"; then
     if test "$PHP_ICONV" = "no"; then
       for i in /usr /usr/local; do

--- xslt/config.m4.orig Mon Jun 25 10:11:57 2001
+++ xslt/config.m4      Mon Jun 25 10:13:13 2001
@@ -65,7 +65,11 @@
     fi

     found_iconv=no
-    AC_CHECK_LIB(c, iconv_open, found_iconv=yes)
+    if test -e $ICONV_DIR/lib/libconv.a -o -e $ICONV_DIR/lib/libiconv.so ; then
+      AC_CHECK_LIB(iconv, libiconv_open, found_iconv=yes)
+    else
+      AC_CHECK_LIB(c, iconv_open, found_iconv=yes)
+    fi
     if test "$found_iconv" = "no"; then
       if test "$PHP_ICONV" = "no"; then
         for i in /usr /usr/local; do


Previous Comments:
---------------------------------------------------------------------------

[2001-06-25 06:21:49] [EMAIL PROTECTED]
Sablot-0.60 (also 0.5x), PHP-4.0.7-dev

i tried 'configure' with and without --iconv-dir=/usr/pkg flag. in either case, i get 
the following error:

---cut---
configure:46596: checking for iconv_open in -lc
configure:46615: gcc -o conftest -DLIBICONV_PLUG  -DNETBSD -DEAPI -DUSE_EXPAT 
-I/usr/pkg/include
-Wl,-export-dynamic   -Wl,-R/usr/lib -L/usr/lib   -Wl,-R/usr/pkg/lib -L/usr/pkg/lib   
-Wl,-R/usr/
local/lib -L/usr/local/lib   -Wl,-R/usr/X11R6/lib -L/usr/X11R6/lib -L/usr/pkg/lib 
-R/usr/pkg/lib
-L/usr/pkg/lib -R/usr/local/lib/mysql -L/usr/local/lib/mysql -R/usr/local/lib 
-L/usr/local/lib co
nftest.c -lc  -lexpat -lexpat -lsablot -lpq -lmysqlclient -lz -lgd -lttf -lz -lcrypt 
-lresolv -lm
 -lz -lpng -lm -lc -lpng -ljpeg -lttf -lintl -lXpm -lX11 -lresolv -lgcc 1>&5
/tmp/ccpa03fT.o: In function `main':
conftest.c(.text+0x18): undefined reference to `iconv_open'
conftest.c(.text+0x1c): undefined reference to `iconv_open'
collect2: ld returned 1 exit status
configure: failed program was:
#line 46604 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char iconv_open();

int main() {
iconv_open()
; return 0; }
---cut---

the type declared above doesn't match with libiconv's type for iconv_open (should be 
iconv_t instead of char). in addition, iconv_open is an alias function for 
libiconv_open and therefore will fail if "#include <iconv.h>" isn't included.

here is my env setup:

---cut---
rm config.cache 
export LIBS="-lz -lpng -lm -lc -lpng -ljpeg -lttf -lintl -lXpm -lX11" && 
export LDFLAGS="-Wl,-export-dynamic 
  -Wl,-R/usr/lib -L/usr/lib 
  -Wl,-R/usr/pkg/lib -L/usr/pkg/lib 
  -Wl,-R/usr/local/lib -L/usr/local/lib 
  -Wl,-R/usr/X11R6/lib -L/usr/X11R6/lib"

./configure 
--with-apxs 
--disable-pear 
--with-gd=/usr/pkg 
--with-sablot=/usr/local 
--with-expat-dir=/usr/local 
--without-iconv  <== tried w/ --with-iconv=/usr/local also
--with-pgsql=/usr/local 
--with-mysql=/usr/local 
--enable-libgcc 
--with-gnu-ld 
--with-zlib 
--with-system-regex 
--with-config-file-path=/usr/local/etc 
--enable-track-vars 
--enable-force-cgi-redirect 
--enable-discard-path 
--enable-memory-limit 
--enable-sysvsem 
--enable-sysvshm 
--enable-sockets 
--with-ttf=/usr/pkg 
--enable-freetype-4bit-antialias-hack

---cut---

please note, according to the docs from Sablot, iconv support is optional. i think 
php's config needs to change to reflect the use of libiconv with Sablot 0.5X - 0.60.

---------------------------------------------------------------------------


Full Bug description available at: http://bugs.php.net/?id=11654


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to