Commit 7cf09354 authored by Thomas Roessler's avatar Thomas Roessler

Removing the built-in charset support.

parent 049139e3
......@@ -9,16 +9,7 @@ IMAP_SUBDIR = imap
IMAP_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/imap
endif
if BUILD_ICONV
ICONV_SUBDIR = iconv
ICONV_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/iconv
if BUILD_CHARMAPS
CHARMAP_SUBDIR = charmaps
endif
endif
SUBDIRS = m4 po intl doc contrib $(CHARMAP_SUBDIR) $(IMAP_SUBDIR) $(ICONV_SUBDIR)
SUBDIRS = m4 po intl doc contrib $(IMAP_SUBDIR)
if NEEDS_PGPEWRAP
bin_SCRIPTS = pgpewrap muttbug
......@@ -45,7 +36,7 @@ mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
$(INTLLIBS) $(LIBICONV)
mutt_DEPENDENCIES = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAPDEPS) \
$(INTLDEPS) $(LIBICONVDEPS)
$(INTLDEPS)
makedoc_SOURCES = makedoc.c
......@@ -55,7 +46,7 @@ DEFS=-DSHAREDIR=\"$(sharedir)\" -DSYSCONFDIR=\"$(sysconfdir)\" \
-DBINDIR=\"$(bindir)\" -DHAVE_CONFIG_H=1
# top_srcdir is for building outside of the source tree
INCLUDES=-I$(top_srcdir) -I. $(IMAP_INCLUDES) $(ICONV_INCLUDES) \
INCLUDES=-I$(top_srcdir) -I. $(IMAP_INCLUDES) \
-Iintl -I$(includedir)
non_us_sources = pgp.c pgpinvoke.c pgpkey.c pgplib.c sha1dgst.c \
......
......@@ -138,9 +138,6 @@
/* Where's mixmaster located? */
#undef MIXMASTER
/* Where are the character set definitions located? */
#undef CHARMAPS_DIR
/* Define to `int' if <signal.h> doesn't define. */
#undef sig_atomic_t
......@@ -195,4 +192,8 @@
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#undef HAVE_LANGINFO_CODESET
/* 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
Makefile
Makefile.in
## Process this file with automake to produce Makefile.in
noinst_DATA = charmap_notice
charmap_notice:
@echo ; echo "For charmap support, please read INSTALL" ; echo
......@@ -396,12 +396,7 @@ sharedir=$mutt_cv_sharedir
AC_SUBST(sharedir)
LIBICONV=
LIBICONVDEPS=
need_iconv=no
AC_ARG_WITH(included-iconv,
[ --with-included-iconv Use the iconv implementation included here],
need_iconv=yes,
AC_CACHE_CHECK(for iconv, mutt_cv_func_iconv,
AC_CACHE_CHECK(for iconv, mutt_cv_func_iconv,
[ mutt_cv_func_iconv=no
mutt_cv_lib_iconv=no
AC_TRY_LINK([#include <stdlib.h>
......@@ -419,55 +414,81 @@ AC_ARG_WITH(included-iconv,
LIBS="$mutt_save_LIBS"
fi
])
if test "$mutt_cv_func_iconv" = no; then
need_iconv=yes
fi
if test "$mutt_cv_lib_iconv" = yes; then
LIBICONV="-liconv"
fi
)
if test "$need_iconv" = yes ; then
LIBICONV="-Liconv -liconv"
LIBICONVDEPS="\$(top_srcdir)/iconv/iconv.h iconv/libiconv.a"
if test "$mutt_cv_func_iconv" = no; then
AC_MSG_ERROR(Unable to find iconv library)
fi
if test "$mutt_cv_lib_iconv" = yes; then
LIBICONV="-liconv"
fi
AM_CONDITIONAL(BUILD_ICONV, test "$need_iconv" = yes)
AC_SUBST(LIBICONV)
AC_SUBST(LIBICONVDEPS)
if test "$need_iconv" = yes ; then
mutt_cv_charmaps=/usr/share/i18n/charmaps
AC_ARG_WITH(charmaps, [ --with-charmaps=PATH Where to find character set definitions],
[if test x$withval != x -a $withval != yes ; then
mutt_cv_charmaps=$withval
fi])
AC_CACHE_CHECK([whether iconv is seriously broken], mutt_cv_iconv_broken,
mutt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_TRY_RUN([
#include <iconv.h>
#include <string.h>
int main()
{
iconv_t cd;
const char *ib;
char *ob;
size_t ibl, obl;
const char *s = "\304\211";
changequote(, )dnl
char t[3];
changequote([, ])dnl
ib = s, ibl = 2, ob = t, obl = 3; /* glibc-2.1 needs space for '\0'? */
return ((cd = iconv_open("UTF-8", "UTF-8")) == (iconv_t)(-1) ||
iconv(cd, &ib, &ibl, &ob, &obl) == (size_t)(-1) ||
iconv_close(cd) ||
!(ib == s + 2 && ibl == 0 && ob == t + 2 && obl == 1) ||
memcmp(s, t, 2));
}
],
mutt_cv_iconv_broken=no,
mutt_cv_iconv_broken=yes,
mutt_cv_iconv_broken=no)
LIBS="$mutt_save_LIBS")
if test "$mutt_cv_iconv_broken" = yes; then
AC_MSG_ERROR(Try using libiconv instead)
fi
AC_MSG_CHECKING(whether character set definitions are desired and usable)
if test ! -f $mutt_cv_charmaps/ISO_10646 ; then
AC_MSG_RESULT(no)
mutt_cv_charmaps=$mutt_cv_sharedir/charmaps
echo "Mutt will expect character map definitions under $mutt_cv_charmaps." >&AC_FD_MSG
if test \( -d $srcdir/charmaps \) -a \( -d $srcdir/charmaps/maps \) ; then
echo "We will install the included character set definitions." >&AC_FD_MSG
mutt_cv_add_subdirs="charmaps"
else
mutt_cv_add_subdirs=""
echo "If you want character set support, read INSTALL". >& AC_FD_MSG
fi
need_charmaps=yes
dnl This is to detect implementations such as the one in glibc-2.1,
dnl which always convert exactly but return the number of characters
dnl converted instead of the number converted inexactly.
AC_CACHE_CHECK([whether iconv is non-transcribing], mutt_cv_iconv_nontrans,
mutt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBICONV"
AC_TRY_RUN([
#include <iconv.h>
#include <string.h>
int main()
{
iconv_t cd;
const char *ib;
char *ob;
size_t ibl, obl;
const char *s = "\304\211";
changequote(, )dnl
char t[3];
changequote([, ])dnl
ib = s, ibl = 2, ob = t, obl = 3;
return ((cd = iconv_open("UTF-8", "UTF-8")) == (iconv_t)(-1) ||
iconv(cd, &ib, &ibl, &ob, &obl));
}
],
mutt_cv_iconv_nontrans=no,
mutt_cv_iconv_nontrans=yes,
mutt_cv_iconv_nontrans=no)
LIBS="$mutt_save_LIBS")
if test "$mutt_cv_iconv_nontrans" = yes; then
AC_DEFINE(ICONV_NONTRANS, 1)
else
AC_MSG_RESULT(yes)
AC_DEFINE(ICONV_NONTRANS, 0)
fi
AC_DEFINE_UNQUOTED(CHARMAPS_DIR, "$mutt_cv_charmaps")
charmaps=$mutt_cv_charmaps
AC_SUBST(charmaps)
AM_CONDITIONAL(BUILD_CHARMAPS, test x$need_charmaps = xyes)
fi # /* need_iconv */
AC_ARG_WITH(docdir, [ --with-docdir=PATH Specify where to put the documentation],
[mutt_cv_docdir=$withval],
[ AC_CACHE_CHECK(where to put the documentation,
......@@ -787,5 +808,5 @@ fi
AC_OUTPUT(Makefile intl/Makefile m4/Makefile dnl
po/Makefile.in doc/Makefile contrib/Makefile dnl
muttbug.sh dnl
charmaps/Makefile imap/Makefile iconv/Makefile dnl
imap/Makefile dnl
Muttrc.head)
Makefile.in
Makefile
.deps
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = foreign
INCLUDES = -I$(top_srcdir)
noinst_LIBRARIES = libiconv.a
noinst_HEADERS = iconv.h
libiconv_a_SOURCES = iconv.c
This diff is collapsed.
#ifndef _ICONV_H
#define _ICONV_H
#include <unistd.h>
typedef void * iconv_t;
iconv_t iconv_open (const char *, const char *);
size_t iconv (iconv_t, const char **, size_t *, char **, size_t *);
int iconv_close (iconv_t);
#endif /* _ICONV_H */
......@@ -359,12 +359,6 @@ static void show_version (void)
);
#ifdef CHARMAPS_DIR
printf ("+BUILD_ICONV CHARMAPS_DIR=\"%s\"\n", CHARMAPS_DIR);
#else
puts ("-BUILD_ICONV -CHARMAPS_DIR");
#endif
#ifdef ISPELL
printf ("ISPELL=\"%s\"\n", ISPELL);
#else
......
......@@ -81,7 +81,7 @@ int iswprint (wint_t wc)
#endif /* !HAVE_WC_FUNCS */
#if !defined(HAVE_MBYTE) || !defined(HAVE_ICONV)
#ifndef HAVE_MBYTE
size_t utf8rtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *_ps)
{
......@@ -170,7 +170,7 @@ size_t utf8rtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *_ps)
return (size_t)-2;
}
#endif /* !defined(HAVE_MBYTE) || !defined(HAVE_ICONV) */
#endif /* !HAVE_MBYTE */
wchar_t replacement_char ()
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment