1 dnl Process this file with autoconf to produce a configure script.
3 dnl !!! WHEN ADDING NEW CONFIGURE TESTS, PLEASE ADD CODE TO MAIN.C !!!
4 dnl !!! TO DUMP THEIR RESULTS WHEN MUTT -V IS CALLED !!!
8 AM_CONFIG_HEADER(config.h)
9 AM_INIT_AUTOMAKE(madmutt, `cat "$srcdir/VERSION.in"`)
11 AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION.in'])
15 ALL_LINGUAS="de ru it es uk fr pl nl cs id sk ko el zh_TW zh_CN pt_BR eo gl sv da lt tr ja hu et ca bg"
29 AC_CHECK_TOOL(AR, ar, ar)
33 AC_CHECK_SIZEOF(off_t)
35 AH_TEMPLATE([sig_atomic_t],
36 [Define to 'int' if <signal.h> doesn't define.])
37 AH_TEMPLATE([HAVE_START_COLOR],
38 [Define if you have start_color, as a function or macro.])
39 AH_TEMPLATE([HAVE_TYPEAHEAD],
40 [Define if you have typeahead, as a function or macro.])
41 AH_TEMPLATE([HAVE_BKGDSET],
42 [Define if you have bkgdset, as a function or macro.])
43 AH_TEMPLATE([HAVE_CURS_SET],
44 [Define if you have curs_set, as a function or macro.])
45 AH_TEMPLATE([HAVE_META],
46 [Define if you have meta, as a function or macro.])
47 AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS],
48 [Define if you have use_default_colors, as a function or macro.])
49 AH_TEMPLATE([HAVE_RESIZETERM],
50 [Define if you have resizeterm, as a function or macro.])
51 AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
52 [Some systems declare sig_atomic_t as volatile, some others -- no.
53 This define will have value `sig_atomic_t' or
54 `volatile sig_atomic_t' accordingly.])
55 AH_TEMPLATE([ICONV_NONTRANS],
56 [Define as 1 if iconv() only converts exactly and we should treat
57 all return values other than (size_t)(-1) as equivalent.])
59 dnl ---------------- sendmail ----------------
61 ac_aux_path_sendmail=/usr/sbin:/usr/lib
62 AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, $PATH:$ac_aux_path_sendmail)
63 AC_DEFINE_UNQUOTED(SENDMAIL,"$ac_cv_path_SENDMAIL",[ Where to find sendmail on your system. ])
65 dnl ---------------- gpgme ----------------
66 PKG_CHECK_MODULES(LUA,lua5.1,[
67 CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
68 LDFLAGS="$LDFLAGS $LUA_LIBS"
69 ],[AC_MSG_ERROR([could not find lua5.1])])
71 dnl ---------------- gpgme ----------------
73 AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--enable-gpgme], [Enable GPGME support]),[
74 if test x$enableval = xyes; then
75 AM_PATH_GPGME(,,[AC_MSG_ERROR(GPGME not found)])
76 MUTTLIBS="$MUTTLIBS $GPGME_LIBS"
77 AC_DEFINE(CRYPT_BACKEND_GPGME, 1, [Defined, if GPGME support is enabled])
78 AM_CONDITIONAL(BUILD_GPGME, true)
80 AM_CONDITIONAL(BUILD_GPGME, false)
84 AC_PATH_PROG(MIXMASTER, mixmaster, mixmaster)
85 AC_DEFINE_UNQUOTED(MIXMASTER,"$MIXMASTER",[Where to find mixmaster on your system.])
87 AC_PATH_PROG(ISPELL, ispell, no)
88 if test $ISPELL != no; then
89 AC_DEFINE_UNQUOTED(ISPELL,"$ISPELL",[Where to find ispell on your system.])
92 AC_ARG_WITH(slang, AC_HELP_STRING([--with-slang[=DIR]], [Use S-Lang instead of ncurses]),
93 [AC_CACHE_CHECK([if this is a BSD system], mutt_cv_bsdish,
94 [AC_TRY_RUN([#include <sys/param.h>
108 AC_MSG_CHECKING(for S-Lang)
109 if test $withval = yes; then
110 if test -d $srcdir/../slang; then
111 mutt_cv_slang=$srcdir/../slang/src
112 CFLAGS="$CFLAGS -I${mutt_cv_slang}"
113 LDFLAGS="$LDFLAGS -L${mutt_cv_slang}/objs"
115 if test -d ${prefix}/include/slang; then
116 CFLAGS="$CFLAGS -I${prefix}/include/slang"
117 elif test -d /usr/include/slang; then
118 CFLAGS="$CFLAGS -I/usr/include/slang"
123 dnl ---Check to see if $withval is a source directory
124 if test -f $withval/src/slang.h; then
125 mutt_cv_slang=$withval/src
126 CFLAGS="$CFLAGS -I${mutt_cv_slang}"
127 LDFLAGS="$LDFLAGS -L${mutt_cv_slang}/objs"
129 dnl ---Must be installed somewhere
130 mutt_cv_slang=$withval
131 if test -d $withval/include/slang; then
132 CFLAGS="$CFLAGS -I${withval}/include/slang"
133 elif test -d $withval/include; then
134 CFLAGS="$CFLAGS -I${withval}/include"
136 LDFLAGS="$LDFLAGS -L${withval}/lib"
139 AC_MSG_RESULT($mutt_cv_slang)
140 if test $mutt_cv_bsdish = yes; then
141 AC_CHECK_LIB(termlib, main)
143 AC_DEFINE(USE_SLANG_CURSES,1, [ Define if you compile with SLang instead of curses/ncurses. ])
145 dnl --- now that we've found it, check the link
147 AC_CHECK_LIB(slang, SLtt_get_terminfo,
148 [MUTTLIBS="$MUTTLIBS -lslang -lm"],
149 [AC_MSG_ERROR(unable to compile. check config.log)], -lm)
151 [ mutt_cv_curses=/usr
152 AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses=DIR], [Where ncurses is installed]), [
153 if test $withval != yes; then
154 mutt_cv_curses=$withval
156 if test x$mutt_cv_curses != x/usr; then
157 LDFLAGS="-L${mutt_cv_curses}/lib $LDFLAGS"
158 CPPFLAGS="$CPPFLAGS -I${mutt_cv_curses}/include"
162 AC_CHECK_FUNC(initscr,,[
164 for lib in ncursesw ncurses; do
165 AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break])
167 AC_CHECK_LIB($cf_ncurses, initscr,
168 [ MUTTLIBS="$MUTTLIBS -l$cf_ncurses"
169 if test x$mutt_cv_curses = x/usr -a -d /usr/include/ncurses; then
170 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
173 if test "$cf_ncurses" = ncursesw; then
174 AC_CHECK_HEADERS(ncurses/ncurses.h,[cf_cv_ncurses_header="ncurses/ncurses.h"])
175 AC_CHECK_HEADERS(ncursesw/ncurses.h,[cf_cv_ncurses_header="ncursesw/ncurses.h"])
177 AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])
184 LIBS="$LIBS $MUTTLIBS"
185 CF_CHECK_FUNCDECLS([#include <${cf_cv_ncurses_header-curses.h}>],
186 [start_color typeahead bkgdset curs_set meta use_default_colors resizeterm])
187 if test "$ac_cv_func_decl_start_color" != yes; then
188 AC_MSG_ERROR([Your curses library does not supports color.])
193 AC_CHECK_HEADERS(stdarg.h sys/ioctl.h ioctl.h sysexits.h)
194 AC_CHECK_HEADERS(sys/time.h sys/resource.h)
195 AC_CHECK_HEADERS(unix.h)
197 AC_CHECK_FUNCS(setrlimit getsid isctype)
201 AC_MSG_CHECKING(for sig_atomic_t in signal.h)
202 AC_EGREP_HEADER(sig_atomic_t,signal.h,
203 [ ac_cv_type_sig_atomic_t=yes;
204 AC_EGREP_HEADER(volatile.*sig_atomic_t,
206 [is_sig_atomic_t_volatile=yes; AC_MSG_RESULT([yes, volatile])],
207 [is_sig_atomic_t_volatile=no; AC_MSG_RESULT([yes, non volatile])])
210 AC_CHECK_TYPE(sig_atomic_t, int)
211 is_sig_atomic_t_volatile=no
213 if test $is_sig_atomic_t_volatile = 'yes'
215 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
217 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
223 AC_CHECK_FUNC(getopt)
224 if test $ac_cv_func_getopt = yes; then
225 AC_CHECK_HEADERS(getopt.h)
228 AC_CHECK_FUNC(regcomp)
229 if test $ac_cv_func_regcomp = yes; then
230 AC_CHECK_HEADERS(regex.h)
233 AC_ARG_WITH(homespool,
234 AC_HELP_STRING([--with-homespool[=FILE]],
235 [File in user's directory where new mail is spooled]),
236 with_homespool=${withval})
237 if test x$with_homespool != x; then
238 if test $with_homespool = yes; then
239 with_homespool=mailbox
241 AC_DEFINE_UNQUOTED(MAILPATH,"$with_homespool",[ Where new mail is spooled. ])
242 AC_DEFINE(HOMESPOOL,1,
243 [ Is mail spooled to the user's home directory? If defined,
244 MAILPATH should be set to the filename of the spool mailbox
245 relative the the home directory.
246 use: configure --with-homespool=FILE
250 AC_ARG_WITH(mailpath, AC_HELP_STRING([--with-mailpath=DIR], [Directory where spool mailboxes are located]),
251 [mutt_cv_mailpath=$withval],
252 [ AC_CACHE_CHECK(where new mail is stored, mutt_cv_mailpath,
254 if test -d /var/mail; then
255 mutt_cv_mailpath=/var/mail
256 elif test -d /var/spool/mail; then
257 mutt_cv_mailpath=/var/spool/mail
258 elif test -d /usr/spool/mail; then
259 mutt_cv_mailpath=/usr/spool/mail
260 elif test -d /usr/mail; then
261 mutt_cv_mailpath=/usr/mail
264 if test "$mutt_cv_mailpath" = no; then
265 AC_MSG_ERROR("Could not determine where new mail is stored.")
267 AC_DEFINE_UNQUOTED(MAILPATH,"$mutt_cv_mailpath",[ Where new mail is spooled. ])
269 AC_CACHE_CHECK(if $mutt_cv_mailpath is world writable, mutt_cv_worldwrite, [AC_TRY_RUN([#include <sys/types.h>
270 #include <sys/stat.h>
272 int main (int argc, char **argv)
276 stat ("$mutt_cv_mailpath", &s);
277 if (s.st_mode & S_IWOTH) exit (0);
279 }], mutt_cv_worldwrite=yes, mutt_cv_worldwrite=no, mutt_cv_worldwrite=no)])
282 if test $mutt_cv_worldwrite != yes; then
283 AC_CACHE_CHECK(if $mutt_cv_mailpath is group writable, mutt_cv_groupwrite, [AC_TRY_RUN([#include <sys/types.h>
284 #include <sys/stat.h>
286 int main (int argc, char **argv)
290 stat ("$mutt_cv_mailpath", &s);
291 if (s.st_mode & S_IWGRP) exit (0);
293 }], mutt_cv_groupwrite=yes, mutt_cv_groupwrite=no, mutt_cv_groupwrite=no)])
295 if test $mutt_cv_groupwrite = yes; then
296 AC_DEFINE(USE_SETGID,1,[ Define if mutt should run setgid "mail". ])
302 AC_MSG_CHECKING(where to put the documentation)
303 AC_ARG_WITH(docdir, AC_HELP_STRING([--with-docdir=PATH], [Specify where to put the documentation]),
304 [mutt_cv_docdir=$withval],
305 [mutt_cv_docdir="${prefix}/doc/madmutt"])
306 AC_MSG_RESULT($mutt_cv_docdir)
308 docdir=$mutt_cv_docdir
311 if test x$mutt_cv_setgid = xyes; then
313 DOTLOCK_PERMISSION=2755
316 DOTLOCK_PERMISSION=755
318 AC_SUBST(DOTLOCK_GROUP)
319 AC_SUBST(DOTLOCK_PERMISSION)
321 dnl -- socket dependencies --
323 AC_ARG_ENABLE(nntp, AC_HELP_STRING([--enable-nntp],[Enable NNTP support]),[
324 if test x$enableval = xyes ; then
325 AC_DEFINE(USE_NNTP,1,[ Compiling with newsreading support with NNTP ])
326 LIBNNTP="-Lnntp -lnntp"
327 LIBNNTPDEPS="\$(top_srcdir)/nntp/nntp.h nntp/libnntp.a"
331 AM_CONDITIONAL(BUILD_NNTP, test x$need_nntp = xyes)
333 AC_MSG_CHECKING([for socklen_t])
334 AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]),
336 AC_DEFINE(socklen_t,int, [ Define to 'int' if <sys/socket.h> doesn't have it. ]))
337 AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
338 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
339 AC_CHECK_FUNCS(getaddrinfo)
341 dnl -- imap dependencies --
343 AC_ARG_WITH(gss, AC_HELP_STRING([--with-gss], [Compile in GSSAPI authentication for IMAP]),[
344 if test x$with_gss != xno; then
345 PKG_CHECK_MODULES(GSSAPI,libgssapi,[
346 CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS"
347 MUTTLIBS="$MUTTLIBS $GSSAPI_LIBS"
348 AC_DEFINE(USE_GSS,1,[ Define if you have GSSAPI libraries available ])
349 AC_CHECK_HEADERS(xom.h)
351 AC_MSG_ERROR([could not find libgssapi])
356 AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl[=PFX]], [Compile in SSL support for POP/IMAP]),
357 [ if test "$with_ssl" != "no"; then
358 if test "$with_ssl" != "yes"; then
359 LDFLAGS="$LDFLAGS -L$withval/lib"
360 CPPFLAGS="$CPPFLAGS -I$withval/include"
364 AC_CHECK_LIB(crypto, X509_new,, AC_MSG_ERROR([Unable to find SSL library]))
365 AC_CHECK_LIB(ssl, SSL_new,, AC_MSG_ERROR([Unable to find SSL library]), -lcrypto)
367 AC_CHECK_FUNCS(RAND_status RAND_egd)
369 AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ])
371 MUTTLIBS="$MUTTLIBS -lssl -lcrypto"
376 AC_ARG_WITH([gnutls], AC_HELP_STRING([--with-gnutls], [Enable SSL support using gnutls]),
377 [gnutls_prefix="$withval"], [gnutls_prefix="no"])
378 if test "$gnutls_prefix" != "no"; then
379 if test x"$need_ssl" = x"yes"; then
380 AC_MSG_ERROR([Only either OpenSSL or GNUTLS may be used])
383 CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
384 MUTTLIBS="$MUTTLIBS $LIBGNUTLS_LIBS"
385 AC_DEFINE(USE_GNUTLS, 1, [Define if you want support for SSL via the gnutls library.])
387 [AC_MSG_ERROR([could not find libgnutls])
390 AM_CONDITIONAL(USE_SSL, test x$need_ssl = xyes)
391 AC_SUBST(MUTT_SSL_OBJECTS)
393 AC_ARG_WITH(sasl2, AC_HELP_STRING([--with-sasl2[=PFX]],
394 [Use Cyrus SASL library version 2 for POP/IMAP authentication]),[
395 if test "$with_sasl2" != "no"; then
396 if test "$with_sasl2" != "yes"; then
397 CPPFLAGS="$CPPFLAGS -I$with_sasl2/include"
398 LDFLAGS="$LDFLAGS -L$with_sasl2/lib"
403 AC_CHECK_LIB(sasl2, sasl_client_init,,AC_MSG_ERROR([could not find libsasl2]))
405 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
406 MUTTLIBS="$MUTTLIBS -lsasl2"
408 AC_DEFINE(USE_SASL,1,
409 [Define if want to use version 2 of the Cyrus SASL library.])
413 AM_CONDITIONAL(USE_SASL, test x$need_sasl = xyes)
415 AC_ARG_WITH(idn, AC_HELP_STRING([--with-idn], [Use GNU libidn for domain names]),[
416 if test x$with_idn != xno ; then
417 PKG_CHECK_MODULES(IDN,libidn,[
418 if $PKG_CONFIG --atleast-version=0.6; then
419 AC_MSG_ERROR([libidn is too old, want 0.6 at least])
421 CPPFLAGS="$CPPFLAGS $IDN_CFLAGS"
422 LDFLAGS="$LDFLAGS $IDN_LIBS"
423 ],[AC_MSG_ERROR([could not find libidn])])
429 AC_ARG_ENABLE(flock, AC_HELP_STRING([--enable-flock], [Use flock() to lock files]),
430 [if test $enableval = yes; then
431 AC_DEFINE(USE_FLOCK,1, [ Define to use flock() to lock mailboxes. ])
435 AC_ARG_ENABLE(fcntl, AC_HELP_STRING([--disable-fcntl], [Do NOT use fcntl() to lock files]),
436 [if test $enableval = no; then mutt_cv_fcntl=no; fi])
438 if test $mutt_cv_fcntl = yes; then
439 AC_DEFINE(USE_FCNTL,1, [ Define to use fcntl() to lock folders. ])
442 AC_MSG_CHECKING(whether struct dirent defines d_ino)
443 ac_cv_dirent_d_ino=no
444 AC_TRY_LINK([#include <dirent.h>],[struct dirent dp; (void)dp.d_ino],[ac_cv_dirent_d_ino=yes])
445 if test x$ac_cv_dirent_d_ino = xyes ; then
446 AC_DEFINE(HAVE_DIRENT_D_INO,1,
447 [Define to 1 if your system has the dirent::d_ino member])
449 AC_MSG_RESULT($ac_cv_dirent_d_ino)
451 dnl -- start cache --
452 AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching]),
453 [if test x$enableval = xyes; then
454 AC_DEFINE(USE_HCACHE, 1, [Enable header caching])
456 OLDCPPFLAGS="$CPPFLAGS"
462 AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available]),
463 ac_prefer_qdbm=$withval)
464 if test x$ac_prefer_qdbm != xno; then
465 PKG_CHECK_MODULES(QDBM,qdbm,[ac_qdbm_here=yes],[ac_qdbm_here=no])
469 AC_ARG_WITH(gdbm, AC_HELP_STRING([--without-gdbm], [Don't use gdbm even if it is available]),
470 ac_prefer_gdbm=$withval)
471 if test x$ac_prefer_gdbm != xno -a x$ac_qdbm_here != xyes; then
473 GDBM_DIRS="${prefix} /usr/local /usr"
474 AC_MSG_CHECKING([for gdbm_open])
475 for d in $GDBM_DIRS; do
476 if test x$ac_cv_gdbmopen = xno && test -d "$d/include" && test -d "$d/lib"; then
477 GDBM_INC="-I$d/include"
479 CPPFLAGS="$OLDCPPFLAGS $GDBM_INC"
480 LIBS="$OLDLIBS $GDBM_LIB -lgdbm"
481 AC_TRY_LINK([#include <gdbm.h>],[gdbm_open(0,0,0,0,0);],[ac_cv_gdbmopen=yes])
484 if test x$ac_cv_gdbmopen = xyes; then
492 AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb[=DIR]], [Use BerkeleyDB4 if gdbm is not available ]),
493 ac_bdb_prefix=$withval)
494 if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes -a x$ac_qdbm_here != xyes; then
495 test x$ac_bdb_prefix = xyes && ac_bdb_prefix="${prefix} /opt/csw/bdb4 /opt /usr/local /usr"
496 for d in $ac_bdb_prefix; do
498 for v in BerkeleyDB.4.3 BerkeleyDB.4.2 BerkeleyDB.4.1; do
499 bdbpfx="$bdbpfx $d/$v"
502 BDB_VERSIONS="db-4 db4 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db ''"
503 AC_MSG_CHECKING([for BerkeleyDB > 4.0])
507 for v in / $BDB_VERSIONS; do
508 if test -r "$d/include/$v/db.h"; then
509 BDB_INCLUDE_DIR="$d/include/$v"
510 if test -d "$d/lib/$v"; then
511 BDB_LIB_DIR="$d/lib/$v"
512 for l in `echo $BDB_VERSIONS`; do
513 CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS"
514 LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$l"
520 db->open(db,NULL,NULL,NULL,0,0,0);
527 test x$ac_cv_dbcreate = xyes && break
531 test x$BDB_LIB != x && break
533 if test x$ac_cv_dbcreate = xyes; then
540 if test x$ac_qdbm_here = xyes; then
541 CPPFLAGS="$OLDCPPFLAGS $QDBM_CFLAGS"
542 LIBS="$OLDLIBS $QDBM_LIBS"
543 AC_DEFINE(HAVE_QDBM, 1, [QDBM Support])
544 elif test x$ac_cv_gdbmopen = xyes; then
545 CPPFLAGS="$OLDCPPFLAGS $GDBM_INC"
546 LIBS="$OLDLIBS $GDBM_LIB -lgdbm";
547 AC_DEFINE(HAVE_GDBM, 1, [GDBM Support])
548 elif test x$ac_cv_dbcreate = xyes; then
549 CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS"
550 LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB"
551 AC_DEFINE(HAVE_DB4, 1, [Sleepycat DB4 Support])
553 AC_MSG_ERROR([You need one of: QDBM, GDBM or Sleepycat DB4 for --enable-hcache])
559 AC_SUBST(MUTT_LIB_OBJECTS)
561 AC_SUBST(LIBNNTPDEPS)
563 dnl -- iconv/gettext --
565 AC_ARG_ENABLE(iconv, AC_HELP_STRING([--disable-iconv], [Disable iconv support]),
566 [if test x$enableval = xno ; then
573 if test "$am_cv_func_iconv" != "yes"; then
574 AC_MSG_WARN([Configuring without iconv support. See INSTALL for details])
577 AC_CHECK_HEADERS(iconv.h,
578 [AC_MSG_CHECKING(whether iconv.h defines iconv_t)
579 AC_EGREP_HEADER([typedef.*iconv_t],iconv.h,
581 AC_DEFINE(HAVE_ICONV_T_DEF, 1,
582 [Define if <iconv.h> defines iconv_t.])],
585 dnl (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
586 dnl (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
587 dnl obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
588 AC_CACHE_CHECK([whether this iconv is good enough], mutt_cv_iconv_good,
589 mutt_save_LIBS="$LIBS"
590 LIBS="$LIBS $LIBICONV"
601 ob = buf, obl = sizeof(buf);
602 return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
603 (iconv(cd, 0, 0, &ob, &obl) ||
604 !(ob == buf && obl == sizeof(buf)) ||
608 mutt_cv_iconv_good=yes,
609 mutt_cv_iconv_good=no,
610 mutt_cv_iconv_good=yes)
611 LIBS="$mutt_save_LIBS")
612 if test "$mutt_cv_iconv_good" = no; then
613 AC_MSG_ERROR(Try using libiconv instead)
620 AC_CHECK_HEADERS(locale.h wchar.h wctype.h)
621 AC_CHECK_FUNCS(iswalnum iswalpha iswcntrl iswdigit)
622 AC_CHECK_FUNCS(iswgraph iswlower iswprint iswpunct iswspace iswupper)
623 AC_CHECK_FUNCS(iswxdigit towupper towlower)
626 AC_CACHE_CHECK([for nl_langinfo and CODESET], mutt_cv_langinfo_codeset,
627 [AC_TRY_LINK([#include <langinfo.h>],
628 [char* cs = nl_langinfo(CODESET);],
629 mutt_cv_langinfo_codeset=yes,
630 mutt_cv_langinfo_codeset=no)])
631 if test $mutt_cv_langinfo_codeset = yes; then
632 AC_DEFINE(HAVE_LANGINFO_CODESET,1,
633 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
636 AC_CACHE_CHECK([for nl_langinfo and YESEXPR], mutt_cv_langinfo_yesexpr,
637 [AC_TRY_LINK([#include <langinfo.h>],
638 [char* cs = nl_langinfo(YESEXPR);],
639 mutt_cv_langinfo_yesexpr=yes,
640 mutt_cv_langinfo_yesexpr=no)])
641 if test $mutt_cv_langinfo_yesexpr = yes; then
642 AC_DEFINE(HAVE_LANGINFO_YESEXPR,1,
643 [Define if you have <langinfo.h> and nl_langinfo(YESEXPR).])
648 if test x$use_libesmtp = xyes; then
649 CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
650 MUTTLIBS="$MUTTLIBS $mutt_libesmtp_libs"
651 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_libesmtp.o"
652 AC_DEFINE(USE_LIBESMTP, 1, [Define to enable the use of libesmtp])
654 dnl -- end libesmtp --
658 dnl Documentation tools
660 AC_PATH_PROG([OSPCAT], [ospcat], [none])
661 if test "x$OSPCAT" != "xnone"; then
662 AC_MSG_CHECKING([for openjade docbook stylesheets])
663 dslosfile=`ospcat --public-id="-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN"`
664 DSLROOT=`echo $dslosfile | sed -n -e "s/.*SOIBASE='\(@<:@^'@:>@*\)\/catalog'.*/\1/p"`
665 # ospcat may spit out an absolute path without an SOIBASE
666 if test -z "$DSLROOT"; then
667 DSLROOT=`echo $dslosfile | sed -e 's|<OSFILE>\(.*\)/print/docbook.dsl|\1|'`
669 if test -f $DSLROOT/print/docbook.dsl; then
670 AC_MSG_RESULT([in $DSLROOT])
673 AC_MSG_RESULT([not found: PDF documentation will not be built.])
678 AC_MSG_CHECKING([for lynx])
679 AC_PATH_PROG([HTML2TXT_CMD], [lynx], [none])
680 if test x"$HTML2TXT_CMD" = x"none"; then
681 AC_MSG_CHECKING([for w3m])
682 AC_PATH_PROG([HTML2TXT_CMD], [w3m], [none])
684 if test x"$HTML2TXT_CMD" = x"none"; then
685 AC_MSG_CHECKING([for elinks])
686 AC_PATH_PROG([HTML2TXT_CMD], [elinks], [none])
688 case "$HTML2TXT_CMD" in
690 HTML2TXT_CMD="$HTML2TXT_CMD -dump -no-numbering -no-references \$^ > \$@"
693 HTML2TXT_CMD="$HTML2TXT_CMD -dump -nolist -with_backspaces \$^ > \$@"
696 HTML2TXT_CMD="$HTML2TXT_CMD -dump \$^ > \$@"
702 AC_SUBST(HTML2TXT_CMD)
704 AC_MSG_CHECKING([for tidy])
705 AC_PATH_PROG([HTMLCLEAN_CMD], [tidy], [none])
707 if test x"$HTMLCLEAN_CMD" != x"none"; then
708 HTMLCLEAN_CMD="$HTMLCLEAN_CMD -q -i -m -asxml -utf8 "
710 HTMLCLEAN_CMD="echo "
712 AC_SUBST(HTMLCLEAN_CMD)
715 [ --enable-doc build documentation (needs doxygen and LaTeX)])
716 # Build documentation?
719 if test "${enable_doc}" != "no"; then
720 AC_PATH_PROG(DOXYGEN, doxygen, no)
721 if test "${DOXYGEN}" != "no"; then
722 # Build LaTeX documentation?
723 AC_PATH_PROG(LATEX, pdflatex, no)
724 AC_PATH_PROG(DVIPS, dvips, no)
725 if test "${DVIPS}" = "no"; then
728 AC_MSG_CHECKING(for a4wide.sty)
729 if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
731 elif test -f /usr/share/texmf-tetex/tex/latex/a4wide/a4wide.sty; then
739 AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
740 AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
747 apidoc/Makefile apidoc/doxygen.cfg
748 doc/Makefile doc/instdoc.sh