I need a review bug #14423 (http://bugs.php.net/bug.php?id=14423&edit=1)

I think I've figured out what is wrong, but unfortunately I cannot do a
buildconf on the machine I'm on currently (libtool is limited to 1.3, not
1.4).

So if someone can try this patch out and comment on any corrections for
it, I'd appriciate it :)  You'll find the patch attached to the email.
While this bug is limited to the FreeBSD platform, this patch will effect
the building on all machines (alters the config.m4).  So if at least one
other OS could test it out as well, I'd appriciate it.


>---------------------------------------------------------------<
Dan Kalowsky                    "Tonight I think I'll walk alone.
http://www.deadmime.org/~dank    I'll find soul as I go home."
[EMAIL PROTECTED]                - "Temptation", New Order
? diff.iconv
Index: config.m4
===================================================================
RCS file: /repository/php4/ext/iconv/config.m4,v
retrieving revision 1.7
diff -u -r1.7 config.m4
--- config.m4   30 Nov 2001 18:59:38 -0000      1.7
+++ config.m4   3 Mar 2002 06:24:44 -0000
@@ -7,15 +7,27 @@
 
 if test "$PHP_ICONV" != "no"; then
 
+dnl This is a fix for why FreeBSD does not work with ICONV
+dnl It seems libtool checks for libiconv_open which only exists in
+dnl the giconv series of files under FreeBSD
+
+  ac_os_uname = `uname -s 2>/dev/null`
+
+  if test "$ac_os_uname" = "FreeBSD"; then
+       lib_name=giconv
+  else
+       lib_name=iconv
+  fi
+
   for i in /usr /usr/local $PHP_ICONV; do
-    test -r $i/include/iconv.h && ICONV_DIR=$i
+    test -r $i/include/${lib_name}.h && ICONV_DIR=$i
   done
 
   if test -z "$ICONV_DIR"; then
     AC_MSG_ERROR(Please reinstall the iconv library.)
   fi
   
-  if test -f $ICONV_DIR/lib/libconv.a -o -f 
$ICONV_DIR/lib/libiconv.$SHLIB_SUFFIX_NAME ; then
+  if test -f $ICONV_DIR/lib/libconv.a -o -f 
+$ICONV_DIR/lib/lib${lib_name}.$SHLIB_SUFFIX_NAME ; then
     PHP_ADD_LIBRARY_WITH_PATH(iconv, $ICONV_DIR/lib, ICONV_SHARED_LIBADD)
     AC_CHECK_LIB(iconv, libiconv_open, [
        AC_DEFINE(HAVE_ICONV, 1, [ ])
Index: php_iconv.h
===================================================================
RCS file: /repository/php4/ext/iconv/php_iconv.h,v
retrieving revision 1.9
diff -u -r1.9 php_iconv.h
--- php_iconv.h 13 Dec 2001 14:31:16 -0000      1.9
+++ php_iconv.h 3 Mar 2002 06:24:44 -0000
@@ -26,8 +26,9 @@
 #define PHP_ICONV_API
 #endif
 
+#if HAVE_ICONV
 extern zend_module_entry iconv_module_entry;
-#define phpext_iconv_ptr &iconv_module_entry
+#define iconv_module_ptr &iconv_module_entry;
 
 PHP_MINIT_FUNCTION(miconv);
 PHP_MSHUTDOWN_FUNCTION(miconv);
@@ -53,6 +54,14 @@
 #define ICONV_INPUT_ENCODING "ISO-8859-1" 
 #define ICONV_OUTPUT_ENCODING "ISO-8859-1"
 #define ICONV_INTERNAL_ENCODING "ISO-8859-1" 
+
+#else
+
+#define iconv_module_ptr NULL
+
+#endif /* HAVE_ICONV */
+
+#define phpext_iconv_ptr iconv_module_entry
 
 #endif /* PHP_ICONV_H */
 
-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to