From 11961e658529725ffd4fba5ad9a40648e986ae0b Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Tue, 1 May 2001 03:26:04 +0000 Subject: [PATCH] Check for the existance of the iconv library # 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 | 18 ++++++++++++++++++ ext/xslt/config.m4 | 17 +++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/ext/sablot/config.m4 b/ext/sablot/config.m4 index aa45004725..1d13c282c8 100644 --- a/ext/sablot/config.m4 +++ b/ext/sablot/config.m4 @@ -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,[ ]) diff --git a/ext/xslt/config.m4 b/ext/xslt/config.m4 index f1685069b1..e398a1adbe 100644 --- a/ext/xslt/config.m4 +++ b/ext/xslt/config.m4 @@ -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 -- 2.40.0