work some nifty hacks to work as if we had in tree building.
[apps/madmutt.git] / legacy / configure.ac
diff --git a/legacy/configure.ac b/legacy/configure.ac
new file mode 100644 (file)
index 0000000..8076e94
--- /dev/null
@@ -0,0 +1,530 @@
+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, devel)
+
+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_PATH_PROG(GPERF, gperf, AC_MSG_ERROR([Could not find 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 <signal.h> 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.])
+
+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 ---------------- lua5.1 ----------------
+PKG_CHECK_MODULES(LUA,lua5.1,[
+    CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
+    MUTTLIBS="$MUTTLIBS $LUA_LIBS"
+],[AC_MSG_ERROR([could not find lua5.1])])
+
+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])
+    else
+        AC_MSG_ERROR([could not find gpgme])
+    fi
+])
+
+AC_PATH_PROG(MIXMASTER, mixmaster, mixmaster)
+AC_DEFINE_UNQUOTED(MIXMASTER,"$MIXMASTER",[Where to find mixmaster on your system.])
+
+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 <sys/param.h>
+
+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}"
+                MUTTLIBS="$MUTTLIBS -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}"
+                MUTTLIBS="$MUTTLIBS -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
+                MUTTLIBS="$MUTTLIBS -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
+                MUTTLIBS="-L${mutt_cv_curses}/lib $MUTTLIBS"
+                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])
+        ])
+
+        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=""
+    ])
+
+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 <sys/types.h>
+#include <sys/stat.h>
+
+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 <sys/types.h>
+#include <sys/stat.h>
+
+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 <sys/socket.h> doesn't have it. ]))
+AC_CHECK_FUNC(gethostent,,AC_CHECK_LIB(nsl, gethostent))
+AC_CHECK_FUNC(setsockopt,,AC_CHECK_LIB(socket, setsockopt))
+AC_CHECK_FUNC(getaddrinfo,,[AC_MSG_ERROR([cannot find getaddrinfo])])
+
+dnl -- imap dependencies --
+
+AM_PATH_LIBGNUTLS(,[
+    CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
+    MUTTLIBS="$MUTTLIBS $LIBGNUTLS_LIBS"],[AC_MSG_ERROR([could not find libgnutls])
+])
+
+AC_CHECK_LIB(sasl2, sasl_client_init,,AC_MSG_ERROR([could not find libsasl2]))
+MUTTLIBS="$MUTTLIBS $LIBS"
+LIBS=""
+
+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"
+            MUTTLIBS="$MUTTLIBS $IDN_LIBS"
+            AC_DEFINE(HAVE_LIBIDN, 1, [IDN Support])
+        ],[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 <dirent.h>],[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"
+
+    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="$MUTTLIBS $GDBM_LIB -lgdbm"
+            AC_TRY_LINK([#include <gdbm.h>],[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
+
+    if test x$ac_qdbm_here = xyes; then
+        CPPFLAGS="$OLDCPPFLAGS $QDBM_CFLAGS"
+        MUTTLIBS="$MUTTLIBS -lqdbm"
+        AC_DEFINE(HAVE_QDBM, 1, [QDBM Support])
+    elif test x$ac_cv_gdbmopen = xyes; then
+        CPPFLAGS="$OLDCPPFLAGS $GDBM_INC"
+        MUTTLIBS="$MUTTLIBS $GDBM_LIB -lgdbm";
+        AC_DEFINE(HAVE_GDBM, 1, [GDBM Support])
+    else
+        AC_MSG_ERROR([You need one of: QDBM, GDBM or Sleepycat DB4 for --enable-hcache])
+    fi
+    LIBS=""
+fi])
+dnl -- end cache --
+
+AC_SUBST(MUTTLIBS)
+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 <iconv.h> defines iconv_t.])],
+                 AC_MSG_RESULT(no))])
+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 <langinfo.h>],
+                            [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 <langinfo.h> and nl_langinfo(CODESET).])
+fi
+
+AC_CACHE_CHECK([for nl_langinfo and YESEXPR], mutt_cv_langinfo_yesexpr,
+               [AC_TRY_LINK([#include <langinfo.h>],
+                            [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 <langinfo.h> and nl_langinfo(YESEXPR).])
+fi
+
+dnl -- libesmtp --
+MUTT_AM_LIBESMTP
+if test x$use_libesmtp = xyes; then
+    CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
+    MUTTLIBS="$MUTTLIBS -lesmtp"
+    AC_DEFINE(USE_LIBESMTP, 1, [Define to enable the use of libesmtp])
+fi
+dnl -- end libesmtp --
+
+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
+          intl/Makefile
+          po/Makefile.in
+          apidoc/Makefile apidoc/doxygen.cfg
+          lib-lib/Makefile
+          lib-lua/Makefile
+          lib-mime/Makefile
+          lib-mx/Makefile
+          lib-sys/Makefile
+          lib-ui/Makefile
+          imap/Makefile
+          nntp/Makefile
+)