X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fconfigure.ac;h=4a84bcadf114df7b7271eff455441aad643deed0;hb=f5c74b1465827f6bc2dbb77328a0e256dc4e2db3;hp=a10a0d9aa98688e1b2f6f1e109769cf85e5bf8cd;hpb=b96ce49a21b24ac151253af8f839f051c67fb717;p=citadel.git 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