dnl Process this file with autoconf to produce a configure script. dnl !!! WHEN ADDING NEW CONFIGURE TESTS, PLEASE ADD CODE TO MAIN.C !!! dnl !!! TO DUMP THEIR RESULTS WHEN MUTT -V IS CALLED !!! AC_PREREQ([2.50]) AC_INIT([mutt.h]) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(madmutt, `cat "$srcdir/VERSION.in"`) AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION.in']) AC_GNU_SOURCE 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" AC_CANONICAL_HOST AC_PROG_CPP AC_PROG_CC_C99 AC_ISC_POSIX AC_HEADER_STDC PKG_PROG_PKG_CONFIG AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_GPERF AC_CHECK_TOOL(AR, ar, ar) AC_SYS_LARGEFILE AC_FUNC_FSEEKO AC_CHECK_SIZEOF(off_t) AH_TEMPLATE([sig_atomic_t], [Define to 'int' if doesn't define.]) AH_TEMPLATE([HAVE_START_COLOR], [Define if you have start_color, as a function or macro.]) AH_TEMPLATE([HAVE_TYPEAHEAD], [Define if you have typeahead, as a function or macro.]) AH_TEMPLATE([HAVE_BKGDSET], [Define if you have bkgdset, as a function or macro.]) AH_TEMPLATE([HAVE_CURS_SET], [Define if you have curs_set, as a function or macro.]) AH_TEMPLATE([HAVE_META], [Define if you have meta, as a function or macro.]) AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS], [Define if you have use_default_colors, as a function or macro.]) AH_TEMPLATE([HAVE_RESIZETERM], [Define if you have resizeterm, as a function or macro.]) AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T], [Some systems declare sig_atomic_t as volatile, some others -- no. This define will have value `sig_atomic_t' or `volatile sig_atomic_t' accordingly.]) AH_TEMPLATE([ICONV_NONTRANS], [Define as 1 if iconv() only converts exactly and we should treat all return values other than (size_t)(-1) as equivalent.]) dnl ---------------- sendmail ---------------- ac_aux_path_sendmail=/usr/sbin:/usr/lib AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, $PATH:$ac_aux_path_sendmail) AC_DEFINE_UNQUOTED(SENDMAIL,"$ac_cv_path_SENDMAIL",[ Where to find sendmail on your system. ]) dnl ---------------- gpgme ---------------- AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--enable-gpgme], [Enable GPGME support]),[ if test x$enableval = xyes; then AM_PATH_GPGME(,,[AC_MSG_ERROR(GPGME not found)]) MUTTLIBS="$MUTTLIBS $GPGME_LIBS" AC_DEFINE(CRYPT_BACKEND_GPGME, 1, [Defined, if GPGME support is enabled]) AM_CONDITIONAL(BUILD_GPGME, true) else AM_CONDITIONAL(BUILD_GPGME, false) fi ]) AC_PATH_PROG(MIXMASTER, mixmaster, mixmaster) AC_DEFINE_UNQUOTED(MIXMASTER,"$MIXMASTER",[Where to find mixmaster on your system.]) AC_PATH_PROG(ISPELL, ispell, no) if test $ISPELL != no; then AC_DEFINE_UNQUOTED(ISPELL,"$ISPELL",[Where to find ispell on your system.]) fi AC_ARG_WITH(slang, AC_HELP_STRING([--with-slang[=DIR]], [Use S-Lang instead of ncurses]), [AC_CACHE_CHECK([if this is a BSD system], mutt_cv_bsdish, [AC_TRY_RUN([#include main () { #ifdef BSD exit (0); #else exit (1); #endif }], mutt_cv_bsdish=yes, mutt_cv_bsdish=no, mutt_cv_bsdish=no)]) AC_MSG_CHECKING(for S-Lang) if test $withval = yes; then if test -d $srcdir/../slang; then mutt_cv_slang=$srcdir/../slang/src CFLAGS="$CFLAGS -I${mutt_cv_slang}" LDFLAGS="$LDFLAGS -L${mutt_cv_slang}/objs" else if test -d ${prefix}/include/slang; then CFLAGS="$CFLAGS -I${prefix}/include/slang" elif test -d /usr/include/slang; then CFLAGS="$CFLAGS -I/usr/include/slang" fi mutt_cv_slang=yes fi else dnl ---Check to see if $withval is a source directory if test -f $withval/src/slang.h; then mutt_cv_slang=$withval/src CFLAGS="$CFLAGS -I${mutt_cv_slang}" LDFLAGS="$LDFLAGS -L${mutt_cv_slang}/objs" else dnl ---Must be installed somewhere mutt_cv_slang=$withval if test -d $withval/include/slang; then CFLAGS="$CFLAGS -I${withval}/include/slang" elif test -d $withval/include; then CFLAGS="$CFLAGS -I${withval}/include" fi LDFLAGS="$LDFLAGS -L${withval}/lib" fi fi AC_MSG_RESULT($mutt_cv_slang) if test $mutt_cv_bsdish = yes; then AC_CHECK_LIB(termlib, main) fi AC_DEFINE(USE_SLANG_CURSES,1, [ Define if you compile with SLang instead of curses/ncurses. ]) dnl --- now that we've found it, check the link AC_CHECK_LIB(slang, SLtt_get_terminfo, [MUTTLIBS="$MUTTLIBS -lslang -lm"], [AC_MSG_ERROR(unable to compile. check config.log)], -lm) ], [ mutt_cv_curses=/usr AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses=DIR], [Where ncurses is installed]), [ if test $withval != yes; then mutt_cv_curses=$withval fi if test x$mutt_cv_curses != x/usr; then LDFLAGS="-L${mutt_cv_curses}/lib $LDFLAGS" CPPFLAGS="$CPPFLAGS -I${mutt_cv_curses}/include" fi ]) AC_CHECK_FUNC(initscr,,[ cf_ncurses="ncurses" for lib in ncursesw ncurses; do AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break]) done AC_CHECK_LIB($cf_ncurses, initscr, [ MUTTLIBS="$MUTTLIBS -l$cf_ncurses" if test x$mutt_cv_curses = x/usr -a -d /usr/include/ncurses; then CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses" fi if test "$cf_ncurses" = ncursesw; then AC_CHECK_HEADERS(ncurses/ncurses.h,[cf_cv_ncurses_header="ncurses/ncurses.h"]) AC_CHECK_HEADERS(ncursesw/ncurses.h,[cf_cv_ncurses_header="ncursesw/ncurses.h"]) else AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"]) fi ], [CF_CURSES_LIBS]) ]) old_LIBS="$LIBS" LIBS="$LIBS $MUTTLIBS" CF_CHECK_FUNCDECLS([#include <${cf_cv_ncurses_header-curses.h}>], [start_color typeahead bkgdset curs_set meta use_default_colors resizeterm]) if test "$ac_cv_func_decl_start_color" != yes; then AC_MSG_ERROR([Your curses library does not supports color.]) fi LIBS="$old_LIBS" ]) AC_CHECK_HEADERS(stdarg.h sys/ioctl.h ioctl.h sysexits.h) AC_CHECK_HEADERS(sys/time.h sys/resource.h) AC_CHECK_HEADERS(unix.h) AC_CHECK_FUNCS(setrlimit getsid isctype) AC_TYPE_SIGNAL AC_MSG_CHECKING(for sig_atomic_t in signal.h) AC_EGREP_HEADER(sig_atomic_t,signal.h, [ ac_cv_type_sig_atomic_t=yes; AC_EGREP_HEADER(volatile.*sig_atomic_t, signal.h, [is_sig_atomic_t_volatile=yes; AC_MSG_RESULT([yes, volatile])], [is_sig_atomic_t_volatile=no; AC_MSG_RESULT([yes, non volatile])]) ], [ AC_MSG_RESULT(no) AC_CHECK_TYPE(sig_atomic_t, int) is_sig_atomic_t_volatile=no ]) if test $is_sig_atomic_t_volatile = 'yes' then AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t) else AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t]) fi AC_DECL_SYS_SIGLIST AC_TYPE_PID_T AC_CHECK_FUNC(getopt) if test $ac_cv_func_getopt = yes; then AC_CHECK_HEADERS(getopt.h) fi AC_CHECK_FUNC(regcomp) if test $ac_cv_func_regcomp = yes; then AC_CHECK_HEADERS(regex.h) fi AC_ARG_WITH(homespool, AC_HELP_STRING([--with-homespool[=FILE]], [File in user's directory where new mail is spooled]), with_homespool=${withval}) if test x$with_homespool != x; then if test $with_homespool = yes; then with_homespool=mailbox fi AC_DEFINE_UNQUOTED(MAILPATH,"$with_homespool",[ Where new mail is spooled. ]) AC_DEFINE(HOMESPOOL,1, [ Is mail spooled to the user's home directory? If defined, MAILPATH should be set to the filename of the spool mailbox relative the the home directory. use: configure --with-homespool=FILE ]) mutt_cv_setgid=no else AC_ARG_WITH(mailpath, AC_HELP_STRING([--with-mailpath=DIR], [Directory where spool mailboxes are located]), [mutt_cv_mailpath=$withval], [ AC_CACHE_CHECK(where new mail is stored, mutt_cv_mailpath, [mutt_cv_mailpath=no if test -d /var/mail; then mutt_cv_mailpath=/var/mail elif test -d /var/spool/mail; then mutt_cv_mailpath=/var/spool/mail elif test -d /usr/spool/mail; then mutt_cv_mailpath=/usr/spool/mail elif test -d /usr/mail; then mutt_cv_mailpath=/usr/mail fi]) ]) if test "$mutt_cv_mailpath" = no; then AC_MSG_ERROR("Could not determine where new mail is stored.") fi AC_DEFINE_UNQUOTED(MAILPATH,"$mutt_cv_mailpath",[ Where new mail is spooled. ]) AC_CACHE_CHECK(if $mutt_cv_mailpath is world writable, mutt_cv_worldwrite, [AC_TRY_RUN([#include #include int main (int argc, char **argv) { struct stat s; stat ("$mutt_cv_mailpath", &s); if (s.st_mode & S_IWOTH) exit (0); exit (1); }], mutt_cv_worldwrite=yes, mutt_cv_worldwrite=no, mutt_cv_worldwrite=no)]) mutt_cv_setgid=no if test $mutt_cv_worldwrite != yes; then AC_CACHE_CHECK(if $mutt_cv_mailpath is group writable, mutt_cv_groupwrite, [AC_TRY_RUN([#include #include int main (int argc, char **argv) { struct stat s; stat ("$mutt_cv_mailpath", &s); if (s.st_mode & S_IWGRP) exit (0); exit (1); }], mutt_cv_groupwrite=yes, mutt_cv_groupwrite=no, mutt_cv_groupwrite=no)]) if test $mutt_cv_groupwrite = yes; then AC_DEFINE(USE_SETGID,1,[ Define if mutt should run setgid "mail". ]) mutt_cv_setgid=yes fi fi fi AC_MSG_CHECKING(where to put the documentation) AC_ARG_WITH(docdir, AC_HELP_STRING([--with-docdir=PATH], [Specify where to put the documentation]), [mutt_cv_docdir=$withval], [mutt_cv_docdir="${prefix}/doc/madmutt"]) AC_MSG_RESULT($mutt_cv_docdir) docdir=$mutt_cv_docdir AC_SUBST(docdir) if test x$mutt_cv_setgid = xyes; then DOTLOCK_GROUP='mail' DOTLOCK_PERMISSION=2755 else DOTLOCK_GROUP='' DOTLOCK_PERMISSION=755 fi AC_SUBST(DOTLOCK_GROUP) AC_SUBST(DOTLOCK_PERMISSION) dnl -- socket dependencies -- AC_ARG_ENABLE(nntp, AC_HELP_STRING([--enable-nntp],[Enable NNTP support]),[ if test x$enableval = xyes ; then AC_DEFINE(USE_NNTP,1,[ Compiling with newsreading support with NNTP ]) LIBNNTP="-Lnntp -lnntp" LIBNNTPDEPS="\$(top_srcdir)/nntp/nntp.h nntp/libnntp.a" need_nntp="yes" fi ]) AM_CONDITIONAL(BUILD_NNTP, test x$need_nntp = xyes) AC_MSG_CHECKING([for socklen_t]) AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) AC_DEFINE(socklen_t,int, [ Define to 'int' if doesn't have it. ])) AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent)) AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) AC_CHECK_FUNCS(getaddrinfo) dnl -- imap dependencies -- AC_ARG_WITH(gss, AC_HELP_STRING([--with-gss], [Compile in GSSAPI authentication for IMAP]),[ if test x$with_gss != xno; then PKG_CHECK_MODULES(GSSAPI,libgssapi,[ CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS" MUTTLIBS="$MUTTLIBS $GSSAPI_LIBS" AC_DEFINE(USE_GSS,1,[ Define if you have GSSAPI libraries available ]) AC_CHECK_HEADERS(xom.h) ],[ AC_MSG_ERROR([could not find libgssapi]) ]) fi ]) AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl[=PFX]], [Compile in SSL support for POP/IMAP]), [ if test "$with_ssl" != "no"; then if test "$with_ssl" != "yes"; then LDFLAGS="$LDFLAGS -L$withval/lib" CPPFLAGS="$CPPFLAGS -I$withval/include" fi saved_LIBS="$LIBS" AC_CHECK_LIB(crypto, X509_new,, AC_MSG_ERROR([Unable to find SSL library])) AC_CHECK_LIB(ssl, SSL_new,, AC_MSG_ERROR([Unable to find SSL library]), -lcrypto) AC_CHECK_FUNCS(RAND_status RAND_egd) AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ]) LIBS="$saved_LIBS" MUTTLIBS="$MUTTLIBS -lssl -lcrypto" need_ssl=yes fi ]) AC_ARG_WITH([gnutls], AC_HELP_STRING([--with-gnutls], [Enable SSL support using gnutls]), [gnutls_prefix="$withval"], [gnutls_prefix="no"]) if test "$gnutls_prefix" != "no"; then if test x"$need_ssl" = x"yes"; then AC_MSG_ERROR([Only either OpenSSL or GNUTLS may be used]) fi AM_PATH_LIBGNUTLS(,[ CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS" MUTTLIBS="$MUTTLIBS $LIBGNUTLS_LIBS" AC_DEFINE(USE_GNUTLS, 1, [Define if you want support for SSL via the gnutls library.]) need_ssl=yes], [AC_MSG_ERROR([could not find libgnutls]) ]) fi AM_CONDITIONAL(USE_SSL, test x$need_ssl = xyes) AC_SUBST(MUTT_SSL_OBJECTS) AC_ARG_WITH(sasl2, AC_HELP_STRING([--with-sasl2[=PFX]], [Use Cyrus SASL library version 2 for POP/IMAP authentication]),[ if test "$with_sasl2" != "no"; then if test "$with_sasl2" != "yes"; then CPPFLAGS="$CPPFLAGS -I$with_sasl2/include" LDFLAGS="$LDFLAGS -L$with_sasl2/lib" fi saved_LIBS="$LIBS" AC_CHECK_LIB(sasl2, sasl_client_init,,AC_MSG_ERROR([could not find libsasl2])) MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o" MUTTLIBS="$MUTTLIBS -lsasl2" LIBS="$saved_LIBS" AC_DEFINE(USE_SASL,1, [Define if want to use version 2 of the Cyrus SASL library.]) need_sasl=yes fi ]) AM_CONDITIONAL(USE_SASL, test x$need_sasl = xyes) AC_ARG_WITH(idn, AC_HELP_STRING([--with-idn], [Use GNU libidn for domain names]),[ if test x$with_idn != xno ; then PKG_CHECK_MODULES(IDN,libidn,[ if $PKG_CONFIG --atleast-version=0.6; then AC_MSG_ERROR([libidn is too old, want 0.6 at least]) fi CPPFLAGS="$CPPFLAGS $IDN_CFLAGS" LDFLAGS="$LDFLAGS $IDN_LIBS" ],[AC_MSG_ERROR([could not find libidn])]) fi ]) dnl -- end socket -- AC_ARG_ENABLE(flock, AC_HELP_STRING([--enable-flock], [Use flock() to lock files]), [if test $enableval = yes; then AC_DEFINE(USE_FLOCK,1, [ Define to use flock() to lock mailboxes. ]) fi]) mutt_cv_fcntl=yes AC_ARG_ENABLE(fcntl, AC_HELP_STRING([--disable-fcntl], [Do NOT use fcntl() to lock files]), [if test $enableval = no; then mutt_cv_fcntl=no; fi]) if test $mutt_cv_fcntl = yes; then AC_DEFINE(USE_FCNTL,1, [ Define to use fcntl() to lock folders. ]) fi AC_MSG_CHECKING(whether struct dirent defines d_ino) ac_cv_dirent_d_ino=no AC_TRY_LINK([#include ],[struct dirent dp; (void)dp.d_ino],[ac_cv_dirent_d_ino=yes]) if test x$ac_cv_dirent_d_ino = xyes ; then AC_DEFINE(HAVE_DIRENT_D_INO,1, [Define to 1 if your system has the dirent::d_ino member]) fi AC_MSG_RESULT($ac_cv_dirent_d_ino) dnl -- start cache -- AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching]), [if test x$enableval = xyes; then AC_DEFINE(USE_HCACHE, 1, [Enable header caching]) OLDCPPFLAGS="$CPPFLAGS" OLDLIBS="$LIBS" need_md5="yes" ac_prefer_qdbm=yes AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available]), ac_prefer_qdbm=$withval) if test x$ac_prefer_qdbm != xno; then PKG_CHECK_MODULES(QDBM,qdbm,[ac_qdbm_here=yes],[ac_qdbm_here=no]) fi ac_prefer_gdbm=yes AC_ARG_WITH(gdbm, AC_HELP_STRING([--without-gdbm], [Don't use gdbm even if it is available]), ac_prefer_gdbm=$withval) if test x$ac_prefer_gdbm != xno -a x$ac_qdbm_here != xyes; then ac_cv_gdbmopen=no GDBM_DIRS="${prefix} /usr/local /usr" AC_MSG_CHECKING([for gdbm_open]) for d in $GDBM_DIRS; do if test x$ac_cv_gdbmopen = xno && test -d "$d/include" && test -d "$d/lib"; then GDBM_INC="-I$d/include" GDBM_LIB="-L$d/lib" CPPFLAGS="$OLDCPPFLAGS $GDBM_INC" LIBS="$OLDLIBS $GDBM_LIB -lgdbm" AC_TRY_LINK([#include ],[gdbm_open(0,0,0,0,0);],[ac_cv_gdbmopen=yes]) fi done if test x$ac_cv_gdbmopen = xyes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi ac_bdb_prefix=yes AC_ARG_WITH(bdb, AC_HELP_STRING([--with-bdb[=DIR]], [Use BerkeleyDB4 if gdbm is not available ]), ac_bdb_prefix=$withval) if test x$ac_bdb_prefix != xno -a x$ac_cv_gdbmopen != xyes -a x$ac_qdbm_here != xyes; then test x$ac_bdb_prefix = xyes && ac_bdb_prefix="${prefix} /opt/csw/bdb4 /opt /usr/local /usr" for d in $ac_bdb_prefix; do bdbpfx="$bdbpfx $d" for v in BerkeleyDB.4.3 BerkeleyDB.4.2 BerkeleyDB.4.1; do bdbpfx="$bdbpfx $d/$v" done done BDB_VERSIONS="db-4 db4 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db ''" AC_MSG_CHECKING([for BerkeleyDB > 4.0]) for d in $bdbpfx; do BDB_INCLUDE_DIR="" BDB_LIB_DIR="" for v in / $BDB_VERSIONS; do if test -r "$d/include/$v/db.h"; then BDB_INCLUDE_DIR="$d/include/$v" if test -d "$d/lib/$v"; then BDB_LIB_DIR="$d/lib/$v" for l in `echo $BDB_VERSIONS`; do CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS" LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$l" AC_TRY_LINK([ #include #include ],[ DB *db = NULL; db->open(db,NULL,NULL,NULL,0,0,0); ],[ ac_cv_dbcreate=yes BDB_LIB="$l" break ]) done test x$ac_cv_dbcreate = xyes && break fi fi done test x$BDB_LIB != x && break done if test x$ac_cv_dbcreate = xyes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi fi if test x$ac_qdbm_here = xyes; then CPPFLAGS="$OLDCPPFLAGS $QDBM_CFLAGS" LIBS="$OLDLIBS $QDBM_LIBS" AC_DEFINE(HAVE_QDBM, 1, [QDBM Support]) elif test x$ac_cv_gdbmopen = xyes; then CPPFLAGS="$OLDCPPFLAGS $GDBM_INC" LIBS="$OLDLIBS $GDBM_LIB -lgdbm"; AC_DEFINE(HAVE_GDBM, 1, [GDBM Support]) elif test x$ac_cv_dbcreate = xyes; then CPPFLAGS="-I$BDB_INCLUDE_DIR $OLDCPPFLAGS" LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB" AC_DEFINE(HAVE_DB4, 1, [Sleepycat DB4 Support]) else AC_MSG_ERROR([You need one of: QDBM, GDBM or Sleepycat DB4 for --enable-hcache]) fi fi]) dnl -- end cache -- AC_SUBST(MUTTLIBS) AC_SUBST(MUTT_LIB_OBJECTS) AC_SUBST(LIBNNTP) AC_SUBST(LIBNNTPDEPS) dnl -- iconv/gettext -- AC_ARG_ENABLE(iconv, AC_HELP_STRING([--disable-iconv], [Disable iconv support]), [if test x$enableval = xno ; then am_cv_func_iconv=no fi ]) AM_GNU_GETTEXT if test "$am_cv_func_iconv" != "yes"; then 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 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 dnl obl when args 2 and 3 are 0 (fixed in glibc-2.1.3). AC_CACHE_CHECK([whether this iconv is good enough], mutt_cv_iconv_good, mutt_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_RUN([ #include int main() { iconv_t cd; changequote(, )dnl char buf[4]; 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))); } ], mutt_cv_iconv_good=yes, mutt_cv_iconv_good=no, mutt_cv_iconv_good=yes) LIBS="$mutt_save_LIBS") if test "$mutt_cv_iconv_good" = no; then AC_MSG_ERROR(Try using libiconv instead) fi fi # libiconv dnl -- locales -- AC_CHECK_HEADERS(locale.h wchar.h wctype.h) AC_CHECK_FUNCS(iswalnum iswalpha iswcntrl iswdigit) AC_CHECK_FUNCS(iswgraph iswlower iswprint iswpunct iswspace iswupper) AC_CHECK_FUNCS(iswxdigit towupper towlower) AC_TYPE_MBSTATE_T AC_CACHE_CHECK([for nl_langinfo and CODESET], mutt_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], mutt_cv_langinfo_codeset=yes, mutt_cv_langinfo_codeset=no)]) if test $mutt_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET,1, [Define if you have and nl_langinfo(CODESET).]) fi AC_CACHE_CHECK([for nl_langinfo and YESEXPR], mutt_cv_langinfo_yesexpr, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(YESEXPR);], mutt_cv_langinfo_yesexpr=yes, mutt_cv_langinfo_yesexpr=no)]) if test $mutt_cv_langinfo_yesexpr = yes; then AC_DEFINE(HAVE_LANGINFO_YESEXPR,1, [Define if you have and nl_langinfo(YESEXPR).]) fi dnl -- libesmtp -- MUTT_AM_LIBESMTP if test x$use_libesmtp = xyes; then CFLAGS="$CFLAGS $mutt_libesmtp_cflags" MUTTLIBS="$MUTTLIBS $mutt_libesmtp_libs" MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_libesmtp.o" AC_DEFINE(USE_LIBESMTP, 1, [Define to enable the use of libesmtp]) fi dnl -- end libesmtp -- dnl -- sgml tools -- dnl Documentation tools have_openjade="no" AC_PATH_PROG([OSPCAT], [ospcat], [none]) if test "x$OSPCAT" != "xnone"; then AC_MSG_CHECKING([for openjade docbook stylesheets]) dslosfile=`ospcat --public-id="-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN"` DSLROOT=`echo $dslosfile | sed -n -e "s/.*SOIBASE='\(@<:@^'@:>@*\)\/catalog'.*/\1/p"` # ospcat may spit out an absolute path without an SOIBASE if test -z "$DSLROOT"; then DSLROOT=`echo $dslosfile | sed -e 's|\(.*\)/print/docbook.dsl|\1|'` fi if test -f $DSLROOT/print/docbook.dsl; then AC_MSG_RESULT([in $DSLROOT]) have_openjade="yes" else AC_MSG_RESULT([not found: PDF documentation will not be built.]) fi fi AC_SUBST(DSLROOT) AC_MSG_CHECKING([for lynx]) AC_PATH_PROG([HTML2TXT_CMD], [lynx], [none]) if test x"$HTML2TXT_CMD" = x"none"; then AC_MSG_CHECKING([for w3m]) AC_PATH_PROG([HTML2TXT_CMD], [w3m], [none]) fi if test x"$HTML2TXT_CMD" = x"none"; then AC_MSG_CHECKING([for elinks]) AC_PATH_PROG([HTML2TXT_CMD], [elinks], [none]) fi case "$HTML2TXT_CMD" in *elinks*) HTML2TXT_CMD="$HTML2TXT_CMD -dump -no-numbering -no-references \$^ > \$@" ;; *lynx*) HTML2TXT_CMD="$HTML2TXT_CMD -dump -nolist -with_backspaces \$^ > \$@" ;; *w3m*) HTML2TXT_CMD="$HTML2TXT_CMD -dump \$^ > \$@" ;; *) HTML2TXT_CMD="true" ;; esac AC_SUBST(HTML2TXT_CMD) AC_MSG_CHECKING([for tidy]) AC_PATH_PROG([HTMLCLEAN_CMD], [tidy], [none]) if test x"$HTMLCLEAN_CMD" != x"none"; then HTMLCLEAN_CMD="$HTMLCLEAN_CMD -q -i -m -asxml -utf8 " else HTMLCLEAN_CMD="echo " fi AC_SUBST(HTMLCLEAN_CMD) AC_ARG_ENABLE(doc, [ --enable-doc build documentation (needs doxygen and LaTeX)]) # Build documentation? DOXYGEN="no" LATEX="no" if test "${enable_doc}" != "no"; then AC_PATH_PROG(DOXYGEN, doxygen, no) if test "${DOXYGEN}" != "no"; then # Build LaTeX documentation? AC_PATH_PROG(LATEX, pdflatex, no) AC_PATH_PROG(DVIPS, dvips, no) if test "${DVIPS}" = "no"; then LATEX="no" fi AC_MSG_CHECKING(for a4wide.sty) if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then AC_MSG_RESULT(yes) elif test -f /usr/share/texmf-tetex/tex/latex/a4wide/a4wide.sty; then AC_MSG_RESULT(yes) else LATEX="no" AC_MSG_RESULT(no) fi fi fi AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no") AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no") AC_OUTPUT(Makefile Madmuttrc.head intl/Makefile m4/Makefile po/Makefile.in apidoc/Makefile apidoc/doxygen.cfg doc/Makefile doc/instdoc.sh contrib/Makefile tools/Makefile lib-lib/Makefile lib-mime/Makefile lib-crypt/Makefile lib-hash/Makefile lib-mx/Makefile lib-sys/Makefile lib-ui/Makefile imap/Makefile pop/Makefile nntp/Makefile )