]> granicus.if.org Git - php/commitdiff
Check for the existance of the iconv library
authorSterling Hughes <sterling@php.net>
Tue, 1 May 2001 03:26:04 +0000 (03:26 +0000)
committerSterling Hughes <sterling@php.net>
Tue, 1 May 2001 03:26:04 +0000 (03:26 +0000)
# Not sure if this is correct, I can verify that it doesn't break anything
# and it logically looks like it would work.  Can someone test this (BSD
# and/or Windows)

ext/sablot/config.m4
ext/xslt/config.m4

index aa4500472587424cbde6a891a8ce014522634e2c..1d13c282c8827d0720f774097499bd5ec65018f3 100644 (file)
@@ -49,6 +49,24 @@ if test "$PHP_SABLOT" != "no"; then
     PHP_ADD_LIBRARY(xmlparse)
     PHP_ADD_LIBRARY(xmltok)
   fi
+
+  found_iconv=no
+  AC_CHECK_LIB(c, iconv_open, found_iconv=yes)
+   if test "$found_iconv" = "no"; then
+    if test "$PHP_ICONV" = "no"; then
+      for i in /usr /usr/local; do
+       if test -f $i/lib/libconv.a -o -f $i/lib/libiconv.so; then
+         PHP_ADD_LIBRARY_WITH_PATH(iconv, $i/lib)
+         found_iconv=yes
+       fi
+      done
+    fi
+   fi
+  
+    if test "$found_iconv" = "no"; then
+      AC_MSG_ERROR(iconv not found, in order to build sablotron you need the iconv library)
+    fi
+
   
   AC_DEFINE(HAVE_SABLOT,1,[ ])
 
index f1685069b185a80d3fa157fb6aab95f4c44ea53e..e398a1adbec1cc31e6a11837342d4f2cb692f528 100644 (file)
@@ -72,6 +72,23 @@ if test "$PHP_XSLT" != "no"; then
                        PHP_ADD_LIBRARY(xmltok)
                fi
 
+               found_iconv=no
+               AC_CHECK_LIB(c, iconv_open, found_iconv=yes)
+               if test "$found_iconv" = "no"; then
+                       if test "$PHP_ICONV" = "no"; then
+                               for i in /usr /usr/local; do
+                                       if test -f $i/lib/libconv.a -o -f $i/lib/libiconv.so; then
+                                               PHP_ADD_LIBRARY_WITH_PATH(iconv, $i/lib)
+                                               found_iconv=yes
+                                       fi
+                               done
+                       fi
+               fi
+
+               if test "$found_iconv" = "no"; then
+                       AC_MSG_ERROR(iconv not found, in order to build sablotron you need the iconv library)
+               fi
                AC_DEFINE(HAVE_SABLOT, 1, [ ])
                AC_CHECK_LIB(sablot, SablotSetEncoding, AC_DEFINE(HAVE_SABLOT_SET_ENCODING, 1, [ ]))
        fi