]> granicus.if.org Git - neomutt/commitdiff
Some changes from EGE.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 10 Jul 2000 09:37:57 +0000 (09:37 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 10 Jul 2000 09:37:57 +0000 (09:37 +0000)
INSTALL
acconfig.h
charset.c
configure.in
main.c

diff --git a/INSTALL b/INSTALL
index 7ad44fd8903248c164cdbcd9105062fd3195b3b5..ac8bc8b2ee33b678897fa7397cf2902c2af4d77d 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -169,21 +169,22 @@ Please note that "VPATH" builds currently do _not_ work.
 Character set support
 =====================
 
-Mutt has extensive support for doing character set conversions.  To
-use this, you'll need the proper character set definition files.
-
-If these files are already installed on your system (glibc 2.0
-includes them), you can tell the configure script this by using the
---with-charmaps option.  As an argument, it takes the directory in
-which the character set definition files have been installed.  By
-default, configure looks into /usr/share/i18n/charmaps.
-
-If these files are not present on your system, you can download a
-charmaps tar-ball from the same place from which you got mutt (e.g.,
-ftp.guug.de/pub/mutt/). Unpack it under the mutt toplevel source
-directory, and re-configure mutt.  configure will detect this; the
-character set definition files should be automatically installed in
-the proper place.
+Mutt no longer contains functions for doing character set conversion.
+Instead, it expects the iconv functions (iconv_open, iconv,
+iconv_close) to be provided. Most up-to-date systems provide these
+functions, often as part of the C library. If you are installing Mutt
+on a system which does not have them, it is recommended that you
+install Bruno Haible's portable libiconv library, which you can obtain
+from:
+
+ftp://ftp.ilog.fr/pub/Users/haible/gnu/
+
+Even if your system does provide the iconv functions, you might want
+to install libiconv, as some systems provide only a very limited
+version of iconv.
+
+If you really want to, you can configure Mutt --without-iconv, but
+there will then be no character set conversion.
 
 
 Platform Notes
index 7cd4151c99e3f811f6cfa4f960fb76b3dedf1712..04e5d59aae67e1bdc6b073941dc9f4b2b534e443 100644 (file)
 /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
 #undef HAVE_LANGINFO_CODESET
 
+/* Define if you have iconv(). */
+#undef HAVE_ICONV
+
 /* Define as 1 if iconv() only converts exactly and we should treat
  * all return values other than (size_t)(-1) as equivalent. */
 #undef ICONV_NONTRANS
index a8ee59851d481fb62d170d8b00de5e50d63fe6a7..4046e6516dfd4653d859ea3ef539143718c1947c 100644 (file)
--- a/charset.c
+++ b/charset.c
@@ -123,6 +123,27 @@ int mutt_is_utf8 (const char *s)
 }
 
 
+#ifndef HAVE_ICONV
+
+iconv_t iconv_open (const char *tocode, const char *fromcode)
+{
+  return (iconv_t)(-1);
+}
+
+size_t iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft,
+             char **outbuf, size_t *outbytesleft)
+{
+  return 0;
+}
+
+int iconv_close (iconv_t cd)
+{
+  return 0;
+}
+
+#endif /* !HAVE_ICONV */
+
+
 /*
  * Like iconv_open, but canonicalises the charsets
  */
index 148ca120cc00096cc3b151f1b5c9fc565cb747cc..743b5b3f7dbab69b6e82fe6a47f85e153ee9247f 100644 (file)
@@ -396,15 +396,16 @@ sharedir=$mutt_cv_sharedir
 AC_SUBST(sharedir)
 
 AC_ARG_WITH(iconv, [  --with-iconv=DIR           Where libiconv is installed ],
-       [if test $withval != yes; then
-               mutt_cv_iconv=$withval
-       fi
-       if test x$mutt_cv_iconv != x/usr; then
+       [mutt_cv_iconv=$withval
+       if test "$mutt_cv_iconv" != yes -a \
+               "$mutt_cv_iconv" != no -a \
+               "$mutt_cv_iconv" != /usr; then
                CPPFLAGS="$CPPFLAGS -I${mutt_cv_iconv}/include"
                LDFLAGS="-L${mutt_cv_iconv}/lib $LDFLAGS"
        fi])
 
 LIBICONV=
+if test "$mutt_cv_iconv" != no; then
 AC_CACHE_CHECK(for iconv, mutt_cv_func_iconv,
     [ mutt_cv_func_iconv=no
       mutt_cv_lib_iconv=no
@@ -429,6 +430,8 @@ fi
 if test "$mutt_cv_lib_iconv" = yes; then
   LIBICONV="-liconv"
 fi
+AC_DEFINE(HAVE_ICONV)
+fi
 
 AC_SUBST(LIBICONV)
 
@@ -449,10 +452,10 @@ changequote([, ])dnl
   char *ob;
   size_t obl;
   ob = buf, obl = sizeof(buf);
-  return ((cd = iconv_open("UTF-8", "UTF-8")) == (iconv_t)(-1) ||
-         iconv(cd, 0, 0, &ob, &obl) ||
-         !(ob == buf && obl == sizeof(buf)) ||
-         iconv_close(cd));
+  return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
+         (iconv(cd, 0, 0, &ob, &obl) ||
+          !(ob == buf && obl == sizeof(buf)) ||
+          iconv_close(cd)));
 }
                ],
                mutt_cv_iconv_good=yes,
diff --git a/main.c b/main.c
index b63752d5d5d4da5556bf306cd26eca4bea633ffb..74c1ce54709c69e681e8afde58e3753bbbecb3e8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -360,6 +360,12 @@ static void show_version (void)
 
        "\n"
 
+#if HAVE_ICONV
+       "+HAVE_ICONV  "
+#else
+       "-HAVE_ICONV  "
+#endif
+
 #if ICONV_NONTRANS
        "+ICONV_NONTRANS  "
 #else