last tweaks
[apps/madmutt.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
3 dnl !!! WHEN ADDING NEW CONFIGURE TESTS, PLEASE ADD CODE TO MAIN.C !!!
4 dnl !!! TO DUMP THEIR RESULTS WHEN MUTT -V IS CALLED            !!!
5
6 AC_PREREQ([2.50])
7 AC_INIT([mutt.h])
8 AM_CONFIG_HEADER(config.h)
9 AM_INIT_AUTOMAKE(madmutt, devel)
10
11 AC_GNU_SOURCE
12
13 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"
14
15 AC_CANONICAL_HOST
16
17 AC_PROG_CPP
18 AC_PROG_CC_C99
19 AC_ISC_POSIX
20 AC_HEADER_STDC
21
22 PKG_PROG_PKG_CONFIG
23 AC_PROG_MAKE_SET
24 AC_PROG_INSTALL
25 AC_PROG_RANLIB
26 AC_PATH_PROG(GPERF, gperf, AC_MSG_ERROR([Could not find gperf]))
27 AC_CHECK_TOOL(AR, ar, ar)
28
29 AC_SYS_LARGEFILE
30 AC_FUNC_FSEEKO
31 AC_CHECK_SIZEOF(off_t)
32
33 AH_TEMPLATE([sig_atomic_t],
34             [Define to 'int' if <signal.h> doesn't define.])
35 AH_TEMPLATE([HAVE_START_COLOR],
36             [Define if you have start_color, as a function or macro.])
37 AH_TEMPLATE([HAVE_TYPEAHEAD],
38             [Define if you have typeahead, as a function or macro.])
39 AH_TEMPLATE([HAVE_BKGDSET],
40             [Define if you have bkgdset, as a function or macro.])
41 AH_TEMPLATE([HAVE_CURS_SET],
42             [Define if you have curs_set, as a function or macro.])
43 AH_TEMPLATE([HAVE_META],
44             [Define if you have meta, as a function or macro.])
45 AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS],
46             [Define if you have use_default_colors, as a function or macro.])
47 AH_TEMPLATE([HAVE_RESIZETERM],
48             [Define if you have resizeterm, as a function or macro.])
49 AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
50             [Some systems declare sig_atomic_t as volatile, some others -- no.
51              This define will have value `sig_atomic_t' or
52              `volatile sig_atomic_t' accordingly.])
53
54 dnl ---------------- sendmail ----------------
55
56 ac_aux_path_sendmail=/usr/sbin:/usr/lib
57 AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, $PATH:$ac_aux_path_sendmail)
58 AC_DEFINE_UNQUOTED(SENDMAIL,"$ac_cv_path_SENDMAIL",[ Where to find sendmail on your system. ])
59
60 dnl ---------------- lua5.1 ----------------
61 PKG_CHECK_MODULES(LUA,lua5.1,[
62     CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
63     MUTTLIBS="$MUTTLIBS $LUA_LIBS"
64 ],[AC_MSG_ERROR([could not find lua5.1])])
65
66 dnl ---------------- gpgme ----------------
67
68 AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--enable-gpgme], [Enable GPGME support]),[
69     if test x$enableval = xyes; then
70         AM_PATH_GPGME(,,[AC_MSG_ERROR(GPGME not found)])
71         MUTTLIBS="$MUTTLIBS $GPGME_LIBS"
72         AC_DEFINE(CRYPT_BACKEND_GPGME, 1, [Defined, if GPGME support is enabled])
73     else
74         AC_MSG_ERROR([could not find gpgme])
75     fi
76 ])
77
78 AC_PATH_PROG(MIXMASTER, mixmaster, mixmaster)
79 AC_DEFINE_UNQUOTED(MIXMASTER,"$MIXMASTER",[Where to find mixmaster on your system.])
80
81 AC_ARG_WITH(slang, AC_HELP_STRING([--with-slang[=DIR]], [Use S-Lang instead of ncurses]),
82     [AC_CACHE_CHECK([if this is a BSD system], mutt_cv_bsdish,
83         [AC_TRY_RUN([#include <sys/param.h>
84
85 main ()
86 {
87 #ifdef BSD
88         exit (0);
89 #else
90         exit (1);
91 #endif
92 }],
93         mutt_cv_bsdish=yes,
94         mutt_cv_bsdish=no,
95         mutt_cv_bsdish=no)])
96
97         AC_MSG_CHECKING(for S-Lang)
98         if test $withval = yes; then
99             if test -d $srcdir/../slang; then
100                 mutt_cv_slang=$srcdir/../slang/src
101                 CFLAGS="$CFLAGS -I${mutt_cv_slang}"
102                 MUTTLIBS="$MUTTLIBS -L${mutt_cv_slang}/objs"
103             else
104                 if test -d ${prefix}/include/slang; then
105                     CFLAGS="$CFLAGS -I${prefix}/include/slang"
106                 elif test -d /usr/include/slang; then
107                     CFLAGS="$CFLAGS -I/usr/include/slang"
108                 fi
109                 mutt_cv_slang=yes
110             fi
111         else
112             dnl ---Check to see if $withval is a source directory
113             if test -f $withval/src/slang.h; then
114                 mutt_cv_slang=$withval/src
115                 CFLAGS="$CFLAGS -I${mutt_cv_slang}"
116                 MUTTLIBS="$MUTTLIBS -L${mutt_cv_slang}/objs"
117             else
118                 dnl ---Must be installed somewhere
119                 mutt_cv_slang=$withval
120                 if test -d $withval/include/slang; then
121                         CFLAGS="$CFLAGS -I${withval}/include/slang"
122                 elif test -d $withval/include; then
123                         CFLAGS="$CFLAGS -I${withval}/include"
124                 fi
125                 MUTTLIBS="$MUTTLIBS -L${withval}/lib"
126             fi
127         fi
128         AC_MSG_RESULT($mutt_cv_slang)
129         if test $mutt_cv_bsdish = yes; then
130             AC_CHECK_LIB(termlib, main)
131         fi
132         AC_DEFINE(USE_SLANG_CURSES,1, [ Define if you compile with SLang instead of curses/ncurses. ])
133
134         dnl --- now that we've found it, check the link
135
136         AC_CHECK_LIB(slang, SLtt_get_terminfo,
137             [MUTTLIBS="$MUTTLIBS -lslang -lm"],
138             [AC_MSG_ERROR(unable to compile.  check config.log)], -lm)
139     ],
140     [   mutt_cv_curses=/usr
141         AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses=DIR], [Where ncurses is installed]), [
142             if test $withval != yes; then
143                 mutt_cv_curses=$withval
144             fi
145             if test x$mutt_cv_curses != x/usr; then
146                 MUTTLIBS="-L${mutt_cv_curses}/lib $MUTTLIBS"
147                 CPPFLAGS="$CPPFLAGS -I${mutt_cv_curses}/include"
148             fi
149         ])
150
151         AC_CHECK_FUNC(initscr,,[
152         cf_ncurses="ncurses"
153         for lib in ncursesw ncurses; do
154             AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break])
155         done
156         AC_CHECK_LIB($cf_ncurses, initscr,
157             [   MUTTLIBS="$MUTTLIBS -l$cf_ncurses"
158                 if test x$mutt_cv_curses = x/usr -a -d /usr/include/ncurses; then
159                     CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
160                 fi
161
162                 if test "$cf_ncurses" = ncursesw; then
163                     AC_CHECK_HEADERS(ncurses/ncurses.h,[cf_cv_ncurses_header="ncurses/ncurses.h"])
164                     AC_CHECK_HEADERS(ncursesw/ncurses.h,[cf_cv_ncurses_header="ncursesw/ncurses.h"])
165                 else
166                     AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])
167                 fi
168             ],
169             [CF_CURSES_LIBS])
170         ])
171
172         LIBS="$MUTTLIBS"
173         CF_CHECK_FUNCDECLS([#include <${cf_cv_ncurses_header-curses.h}>],
174                            [start_color typeahead bkgdset curs_set meta use_default_colors resizeterm])
175         if test "$ac_cv_func_decl_start_color" != yes; then
176             AC_MSG_ERROR([Your curses library does not supports color.])
177         fi
178         LIBS=""
179     ])
180
181 AC_CHECK_HEADERS(stdarg.h sys/ioctl.h ioctl.h sysexits.h)
182 AC_CHECK_HEADERS(sys/time.h sys/resource.h)
183 AC_CHECK_HEADERS(unix.h)
184
185 AC_CHECK_FUNCS(setrlimit getsid isctype)
186
187 AC_TYPE_SIGNAL
188
189 AC_MSG_CHECKING(for sig_atomic_t in signal.h)
190 AC_EGREP_HEADER(sig_atomic_t,signal.h,
191     [   ac_cv_type_sig_atomic_t=yes;
192         AC_EGREP_HEADER(volatile.*sig_atomic_t,
193                         signal.h,
194                         [is_sig_atomic_t_volatile=yes; AC_MSG_RESULT([yes, volatile])],
195                         [is_sig_atomic_t_volatile=no;  AC_MSG_RESULT([yes, non volatile])])
196     ],
197     [   AC_MSG_RESULT(no)
198         AC_CHECK_TYPE(sig_atomic_t, int)
199         is_sig_atomic_t_volatile=no
200     ])
201 if test $is_sig_atomic_t_volatile = 'yes'
202 then
203     AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
204 else
205     AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
206 fi
207
208 AC_DECL_SYS_SIGLIST
209 AC_TYPE_PID_T
210
211 AC_CHECK_FUNC(getopt)
212 if test $ac_cv_func_getopt = yes; then
213     AC_CHECK_HEADERS(getopt.h)
214 fi
215
216 AC_CHECK_FUNC(regcomp)
217 if test $ac_cv_func_regcomp = yes; then
218    AC_CHECK_HEADERS(regex.h)
219 fi
220
221 AC_ARG_WITH(homespool,
222             AC_HELP_STRING([--with-homespool[=FILE]],
223                            [File in user's directory where new mail is spooled]),
224                            with_homespool=${withval})
225 if test x$with_homespool != x; then
226     if test $with_homespool = yes; then
227             with_homespool=mailbox
228     fi
229     AC_DEFINE_UNQUOTED(MAILPATH,"$with_homespool",[ Where new mail is spooled. ])
230     AC_DEFINE(HOMESPOOL,1,
231     [   Is mail spooled to the user's home directory?  If defined,
232         MAILPATH should be set to the filename of the spool mailbox
233         relative the the home directory.
234         use: configure --with-homespool=FILE
235     ])
236     mutt_cv_setgid=no
237 else
238     AC_ARG_WITH(mailpath, AC_HELP_STRING([--with-mailpath=DIR], [Directory where spool mailboxes are located]),
239         [mutt_cv_mailpath=$withval],
240         [ AC_CACHE_CHECK(where new mail is stored, mutt_cv_mailpath,
241             [mutt_cv_mailpath=no
242             if test -d /var/mail; then
243                 mutt_cv_mailpath=/var/mail
244             elif test -d /var/spool/mail; then
245                 mutt_cv_mailpath=/var/spool/mail
246             elif test -d /usr/spool/mail; then
247                 mutt_cv_mailpath=/usr/spool/mail
248             elif test -d /usr/mail; then
249                 mutt_cv_mailpath=/usr/mail
250             fi])
251         ])
252     if test "$mutt_cv_mailpath" = no; then
253         AC_MSG_ERROR("Could not determine where new mail is stored.")
254     fi
255     AC_DEFINE_UNQUOTED(MAILPATH,"$mutt_cv_mailpath",[ Where new mail is spooled. ])
256
257     AC_CACHE_CHECK(if $mutt_cv_mailpath is world writable, mutt_cv_worldwrite, [AC_TRY_RUN([#include <sys/types.h>
258 #include <sys/stat.h>
259
260 int main (int argc, char **argv)
261 {
262         struct stat s;
263
264         stat ("$mutt_cv_mailpath", &s);
265         if (s.st_mode & S_IWOTH) exit (0);
266         exit (1);
267 }], mutt_cv_worldwrite=yes, mutt_cv_worldwrite=no, mutt_cv_worldwrite=no)])
268
269         mutt_cv_setgid=no
270         if test $mutt_cv_worldwrite != yes; then
271                 AC_CACHE_CHECK(if $mutt_cv_mailpath is group writable, mutt_cv_groupwrite, [AC_TRY_RUN([#include <sys/types.h>
272 #include <sys/stat.h>
273
274 int main (int argc, char **argv)
275 {
276         struct stat s;
277
278         stat ("$mutt_cv_mailpath", &s);
279         if (s.st_mode & S_IWGRP) exit (0);
280         exit (1);
281 }], mutt_cv_groupwrite=yes, mutt_cv_groupwrite=no, mutt_cv_groupwrite=no)])
282
283         if test $mutt_cv_groupwrite = yes; then
284             AC_DEFINE(USE_SETGID,1,[ Define if mutt should run setgid "mail". ])
285             mutt_cv_setgid=yes
286         fi
287     fi
288 fi
289
290 AC_MSG_CHECKING(where to put the documentation)
291 AC_ARG_WITH(docdir, AC_HELP_STRING([--with-docdir=PATH], [Specify where to put the documentation]),
292         [mutt_cv_docdir=$withval],
293         [mutt_cv_docdir="${prefix}/doc/madmutt"])
294 AC_MSG_RESULT($mutt_cv_docdir)
295
296 docdir=$mutt_cv_docdir
297 AC_SUBST(docdir)
298
299 if test x$mutt_cv_setgid = xyes; then
300     DOTLOCK_GROUP='mail'
301     DOTLOCK_PERMISSION=2755
302 else
303     DOTLOCK_GROUP=''
304     DOTLOCK_PERMISSION=755
305 fi
306 AC_SUBST(DOTLOCK_GROUP)
307 AC_SUBST(DOTLOCK_PERMISSION)
308
309 dnl -- socket dependencies --
310
311 AC_ARG_ENABLE(nntp, AC_HELP_STRING([--enable-nntp],[Enable NNTP support]),[
312     if test x$enableval = xyes ; then
313         AC_DEFINE(USE_NNTP,1,[ Compiling with newsreading support with NNTP ])
314         LIBNNTP="-Lnntp -lnntp"
315         LIBNNTPDEPS="\$(top_srcdir)/nntp/nntp.h nntp/libnntp.a"
316         need_nntp="yes"
317     fi
318 ])
319 AM_CONDITIONAL(BUILD_NNTP, test x$need_nntp = xyes)
320
321 AC_MSG_CHECKING([for socklen_t])
322 AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]),
323         AC_MSG_RESULT([no])
324         AC_DEFINE(socklen_t,int, [ Define to 'int' if <sys/socket.h> doesn't have it. ]))
325 AC_CHECK_FUNC(gethostent,,AC_CHECK_LIB(nsl, gethostent))
326 AC_CHECK_FUNC(setsockopt,,AC_CHECK_LIB(socket, setsockopt))
327 AC_CHECK_FUNC(getaddrinfo,,[AC_MSG_ERROR([cannot find getaddrinfo])])
328
329 dnl -- imap dependencies --
330
331 AM_PATH_LIBGNUTLS(,[
332     CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
333     MUTTLIBS="$MUTTLIBS $LIBGNUTLS_LIBS"],[AC_MSG_ERROR([could not find libgnutls])
334 ])
335
336 AC_CHECK_LIB(sasl2, sasl_client_init,,AC_MSG_ERROR([could not find libsasl2]))
337 MUTTLIBS="$MUTTLIBS $LIBS"
338 LIBS=""
339
340 AC_ARG_WITH(idn, AC_HELP_STRING([--with-idn], [Use GNU libidn for domain names]),[
341     if test x$with_idn != xno ; then
342         PKG_CHECK_MODULES(IDN,libidn,[
343             if $PKG_CONFIG --atleast-version=0.6; then
344                 AC_MSG_ERROR([libidn is too old, want 0.6 at least])
345             fi
346             CPPFLAGS="$CPPFLAGS $IDN_CFLAGS"
347             MUTTLIBS="$MUTTLIBS $IDN_LIBS"
348             AC_DEFINE(HAVE_LIBIDN, 1, [IDN Support])
349         ],[AC_MSG_ERROR([could not find libidn])])
350     fi
351 ])
352
353 dnl -- end socket --
354
355 AC_ARG_ENABLE(flock, AC_HELP_STRING([--enable-flock], [Use flock() to lock files]),
356         [if test $enableval = yes; then
357                 AC_DEFINE(USE_FLOCK,1, [ Define to use flock() to lock mailboxes. ])
358         fi])
359
360 mutt_cv_fcntl=yes
361 AC_ARG_ENABLE(fcntl, AC_HELP_STRING([--disable-fcntl], [Do NOT use fcntl() to lock files]),
362         [if test $enableval = no; then mutt_cv_fcntl=no; fi])
363
364 if test $mutt_cv_fcntl = yes; then
365         AC_DEFINE(USE_FCNTL,1, [ Define to use fcntl() to lock folders. ])
366 fi
367
368 AC_MSG_CHECKING(whether struct dirent defines d_ino)
369 ac_cv_dirent_d_ino=no
370 AC_TRY_LINK([#include <dirent.h>],[struct dirent dp; (void)dp.d_ino],[ac_cv_dirent_d_ino=yes])
371 if test x$ac_cv_dirent_d_ino = xyes ; then
372   AC_DEFINE(HAVE_DIRENT_D_INO,1,
373             [Define to 1 if your system has the dirent::d_ino member])
374 fi
375 AC_MSG_RESULT($ac_cv_dirent_d_ino)
376
377 dnl -- start cache --
378 AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching]),
379 [if test x$enableval = xyes; then
380     AC_DEFINE(USE_HCACHE, 1, [Enable header caching])
381     OLDCPPFLAGS="$CPPFLAGS"
382
383     ac_prefer_qdbm=yes
384     AC_ARG_WITH(qdbm, AC_HELP_STRING([--without-qdbm], [Don't use qdbm even if it is available]),
385         ac_prefer_qdbm=$withval)
386     if test x$ac_prefer_qdbm != xno; then
387         PKG_CHECK_MODULES(QDBM,qdbm,[ac_qdbm_here=yes],[ac_qdbm_here=no])
388     fi
389
390     ac_prefer_gdbm=yes
391     AC_ARG_WITH(gdbm, AC_HELP_STRING([--without-gdbm], [Don't use gdbm even if it is available]),
392         ac_prefer_gdbm=$withval)
393     if test x$ac_prefer_gdbm != xno -a x$ac_qdbm_here != xyes; then
394         ac_cv_gdbmopen=no
395         GDBM_DIRS="${prefix} /usr/local /usr"
396         AC_MSG_CHECKING([for gdbm_open])
397         for d in $GDBM_DIRS; do
398           if test x$ac_cv_gdbmopen = xno && test -d "$d/include" && test -d "$d/lib"; then
399             GDBM_INC="-I$d/include"
400             GDBM_LIB="-L$d/lib"
401             CPPFLAGS="$OLDCPPFLAGS $GDBM_INC"
402             LIBS="$MUTTLIBS $GDBM_LIB -lgdbm"
403             AC_TRY_LINK([#include <gdbm.h>],[gdbm_open(0,0,0,0,0);],[ac_cv_gdbmopen=yes])
404           fi
405         done
406         if test x$ac_cv_gdbmopen = xyes; then
407           AC_MSG_RESULT(yes)
408         else
409           AC_MSG_RESULT(no)
410         fi
411     fi
412
413     if test x$ac_qdbm_here = xyes; then
414         CPPFLAGS="$OLDCPPFLAGS $QDBM_CFLAGS"
415         MUTTLIBS="$MUTTLIBS -lqdbm"
416         AC_DEFINE(HAVE_QDBM, 1, [QDBM Support])
417     elif test x$ac_cv_gdbmopen = xyes; then
418         CPPFLAGS="$OLDCPPFLAGS $GDBM_INC"
419         MUTTLIBS="$MUTTLIBS $GDBM_LIB -lgdbm";
420         AC_DEFINE(HAVE_GDBM, 1, [GDBM Support])
421     else
422         AC_MSG_ERROR([You need one of: QDBM, GDBM or Sleepycat DB4 for --enable-hcache])
423     fi
424     LIBS=""
425 fi])
426 dnl -- end cache --
427
428 AC_SUBST(MUTTLIBS)
429 AC_SUBST(LIBNNTP)
430 AC_SUBST(LIBNNTPDEPS)
431
432 dnl -- iconv/gettext --
433
434 AC_ARG_ENABLE(iconv, AC_HELP_STRING([--disable-iconv], [Disable iconv support]),
435         [if test x$enableval = xno ; then
436                 am_cv_func_iconv=no
437         fi
438 ])
439
440 AM_GNU_GETTEXT
441
442 if test "$am_cv_func_iconv" != "yes"; then
443     AC_MSG_WARN([Configuring without iconv support. See INSTALL for details])
444 else
445     AC_CHECK_HEADERS(iconv.h,
446         [AC_MSG_CHECKING(whether iconv.h defines iconv_t)
447          AC_EGREP_HEADER([typedef.*iconv_t],iconv.h,
448                 [AC_MSG_RESULT(yes)
449                  AC_DEFINE(HAVE_ICONV_T_DEF, 1,
450                         [Define if <iconv.h> defines iconv_t.])],
451                  AC_MSG_RESULT(no))])
452 fi # libiconv
453
454 dnl -- locales --
455
456 AC_CHECK_HEADERS(locale.h wchar.h wctype.h)
457 AC_CHECK_FUNCS(iswalnum iswalpha  iswcntrl iswdigit)
458 AC_CHECK_FUNCS(iswgraph iswlower iswprint iswpunct iswspace iswupper)
459 AC_CHECK_FUNCS(iswxdigit towupper towlower)
460 AC_TYPE_MBSTATE_T
461
462 AC_CACHE_CHECK([for nl_langinfo and CODESET], mutt_cv_langinfo_codeset,
463                [AC_TRY_LINK([#include <langinfo.h>],
464                             [char* cs = nl_langinfo(CODESET);],
465                             mutt_cv_langinfo_codeset=yes,
466                             mutt_cv_langinfo_codeset=no)])
467 if test $mutt_cv_langinfo_codeset = yes; then
468     AC_DEFINE(HAVE_LANGINFO_CODESET,1,
469               [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
470 fi
471
472 AC_CACHE_CHECK([for nl_langinfo and YESEXPR], mutt_cv_langinfo_yesexpr,
473                [AC_TRY_LINK([#include <langinfo.h>],
474                             [char* cs = nl_langinfo(YESEXPR);],
475                             mutt_cv_langinfo_yesexpr=yes,
476                             mutt_cv_langinfo_yesexpr=no)])
477 if test $mutt_cv_langinfo_yesexpr = yes; then
478     AC_DEFINE(HAVE_LANGINFO_YESEXPR,1,
479               [Define if you have <langinfo.h> and nl_langinfo(YESEXPR).])
480 fi
481
482 dnl -- libesmtp --
483 MUTT_AM_LIBESMTP
484 if test x$use_libesmtp = xyes; then
485     CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
486     MUTTLIBS="$MUTTLIBS -lesmtp"
487     AC_DEFINE(USE_LIBESMTP, 1, [Define to enable the use of libesmtp])
488 fi
489 dnl -- end libesmtp --
490
491 AC_ARG_ENABLE(doc, [  --enable-doc            build documentation (needs doxygen and LaTeX)])
492 # Build documentation?
493 DOXYGEN="no"
494 LATEX="no"
495 if test "${enable_doc}" != "no"; then
496     AC_PATH_PROG(DOXYGEN, doxygen, no)
497     if test "${DOXYGEN}" != "no"; then
498         # Build LaTeX documentation?
499         AC_PATH_PROG(LATEX, pdflatex, no)
500         AC_PATH_PROG(DVIPS, dvips, no)
501         if test "${DVIPS}" = "no"; then
502             LATEX="no"
503         fi
504         AC_MSG_CHECKING(for a4wide.sty)
505         if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
506             AC_MSG_RESULT(yes)
507         elif test -f /usr/share/texmf-tetex/tex/latex/a4wide/a4wide.sty; then
508             AC_MSG_RESULT(yes)
509         else
510             LATEX="no"
511             AC_MSG_RESULT(no)
512         fi
513     fi
514 fi
515 AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
516 AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
517
518 AC_OUTPUT(Makefile
519           intl/Makefile
520           po/Makefile.in
521           apidoc/Makefile apidoc/doxygen.cfg
522           lib-lib/Makefile
523           lib-lua/Makefile
524           lib-mime/Makefile
525           lib-mx/Makefile
526           lib-sys/Makefile
527           lib-ui/Makefile
528           imap/Makefile
529           nntp/Makefile
530 )