* if we can't find iconv in the libc, try to find it in a separate library (like...
authorWilfried Göesgens <willi@citadel.org>
Mon, 14 Jan 2008 00:47:31 +0000 (00:47 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 14 Jan 2008 00:47:31 +0000 (00:47 +0000)
webcit/configure.ac

index da9ebee753c8a8e5fe451f54d8847c5fa14a4648..578be2dee11b29ce7d3d17f27b9bd892f0f722f7 100644 (file)
@@ -318,6 +318,26 @@ if test "$ok_nls" != "no"; then
        )
 fi
 
+if test "$ok_iconv" = "no"; then
+       LD_FLAGS_BEFORE=$LDFLAGS
+       LDFLAGS="$LDFLAGS -liconv"
+               AC_TRY_RUN([
+                       #include <iconv.h>
+                       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
+               )
+               if test "$ok_iconv" != "no"; then
+                  LDFLAGS=$LD_FLAGS_BEFORE
+               fi
+fi
+
 if test "$ok_iconv" != "no"; then
        AC_MSG_RESULT(WebCit will be built with character set conversion.)
        AC_DEFINE(HAVE_ICONV,[],[whether we have iconv for charset conversion])