From f5c74b1465827f6bc2dbb77328a0e256dc4e2db3 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 11 Feb 2008 18:23:47 +0000 Subject: [PATCH] The external libiconv test in webcit configure was faulty. It set the -libiconv compiler flag even if no external libiconv was available. Fixed this by turning it into an autoconf builtin test. Hopefully this fixes FreeBSD. --- webcit/configure.ac | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/webcit/configure.ac b/webcit/configure.ac index a10a0d9aa..4a84bcadf 100644 --- a/webcit/configure.ac +++ b/webcit/configure.ac @@ -319,25 +319,21 @@ if test "$ok_nls" != "no"; then ) fi -if test "$ok_iconv" = "no"; then - LD_FLAGS_BEFORE=$LDFLAGS - LDFLAGS="$LDFLAGS -liconv" - AC_TRY_RUN([ - #include - main() { - iconv_t ic = (iconv_t)(-1) ; - ic = iconv_open("UTF-8", "us-ascii"); - iconv_close(ic); - exit(0); - } - ], - ok_iconv=yes, - ok_iconv=no +dnl Check for iconv in external libiconv +if test "$ok_nls" != "no"; then + if test "$ok_nls" == "no" ; then + AC_MSG_RESULT(Checking for an external libiconv...) + AC_CHECK_HEADER(iconv.h, + [ + AC_CHECK_LIB(iconv, iconv_open, + [ + LIBS="-liconv $LIBS" + ok_iconv=yes + ] + ) + ] ) - if test "$ok_iconv" != "no"; then - LDFLAGS=$LD_FLAGS_BEFORE - LIBS="$LIBS -liconv" - fi + fi fi if test "$ok_iconv" != "no"; then -- 2.30.2