+Tue May 7 15:42:37 IST 2002 Lars Hecking <lhecking@nmrc.ie>
+
+ * INSTALL: Document new --disable-iconv configure option.
+
+ * charset.h: Conditionalise inclusion of iconv.h. Define iconv_t
+ if not found by configure. Define ICONV_CONST and declare iconv
+ functions if not found by configure.
+
+ * configure.in: New --disable-iconv configure option. Warn instead
+ error if iconv not found. New tests for iconv.h and iconv_t.
+
+ * sendlib.c(convert_file_to): Allow compilation without system
+ iconv and return -1 if no iconv available.
+
Wed May 1 23:21:10 2002 Thomas Roessler <roessler@does-not-exist.org>
* smime.c: From: Thomas Roessler <roessler@does-not-exist.org>
/usr/local/etc.
-If you really want to, you can configure Mutt --without-iconv, but
+If you really want to, you can configure Mutt --disable-iconv, but
there will then be no character set conversion.
#ifndef _CHARSET_H
#define _CHARSET_H
+#ifdef HAVE_ICONV_H
#include <iconv.h>
+#endif
+
+#ifndef HAVE_ICONV_T_DEF
+typedef void *iconv_t;
+#endif
+
+#ifndef HAVE_ICONV
+#define ICONV_CONST /**/
+iconv_t iconv_open (const char *, const char *);
+size_t iconv (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *);
+int iconv_close (iconv_t);
+#endif
int mutt_convert_string (char **, const char *, const char *, int);
dnl -- iconv/gettext --
+AC_ARG_ENABLE(iconv, [ --disable-iconv Disable iconv support],
+ [if test x$enableval = xno ; then
+ am_cv_func_iconv=no
+ fi
+])
+
MUTT_AM_GNU_GETTEXT
+
if test "$am_cv_func_iconv" != "yes"
then
- AC_MSG_ERROR([Unable to find an iconv function. See INSTALL for help])
-fi
+ AC_MSG_WARN([Configuring without iconv support. See INSTALL for details])
+else
+
+AC_CHECK_HEADERS(iconv.h,
+ [AC_MSG_CHECKING(whether iconv.h defines iconv_t)
+ AC_EGREP_HEADER([typedef.*iconv_t],iconv.h,
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_ICONV_T_DEF, 1,
+ [Define if <iconv.h> defines iconv_t.])],
+ AC_MSG_RESULT(no))])
dnl (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
dnl (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
AC_CHECK_FUNCS(bind_textdomain_codeset)
fi
+fi # libiconv
+
dnl -- locales --
AC_CHECK_HEADERS(wchar.h)
int ncodes, const char **tocodes,
int *tocode, CONTENT *info)
{
+#ifdef HAVE_ICONV
iconv_t cd1, *cd;
char bufi[256], bufu[512], bufo[4 * sizeof (bufi)];
ICONV_CONST char *ib, *ub;
safe_free ((void **) &states);
return ret;
+#else
+ return -1;
+#endif /* !HAVE_ICONV */
}
/*