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, devel)
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"
26 AC_PATH_PROG(GPERF, gperf, AC_MSG_ERROR([Could not find gperf]))
27 AC_CHECK_TOOL(AR, ar, ar)
31 AC_CHECK_SIZEOF(off_t)
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.])
54 dnl ---------------- sendmail ----------------
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. ])
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])])
66 dnl ---------------- gpgme ----------------
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])
74 AC_MSG_ERROR([could not find gpgme])
78 AC_PATH_PROG(MIXMASTER, mixmaster, mixmaster)
79 AC_DEFINE_UNQUOTED(MIXMASTER,"$MIXMASTER",[Where to find mixmaster on your system.])
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>
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"
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"
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"
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"
125 MUTTLIBS="$MUTTLIBS -L${withval}/lib"
128 AC_MSG_RESULT($mutt_cv_slang)
129 if test $mutt_cv_bsdish = yes; then
130 AC_CHECK_LIB(termlib, main)
132 AC_DEFINE(USE_SLANG_CURSES,1, [ Define if you compile with SLang instead of curses/ncurses. ])
134 dnl --- now that we've found it, check the link
136 AC_CHECK_LIB(slang, SLtt_get_terminfo,
137 [MUTTLIBS="$MUTTLIBS -lslang -lm"],
138 [AC_MSG_ERROR(unable to compile. check config.log)], -lm)
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
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"
151 AC_CHECK_FUNC(initscr,,[
153 for lib in ncursesw ncurses; do
154 AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break])
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"
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"])
166 AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])
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.])
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)
185 AC_CHECK_FUNCS(setrlimit getsid isctype)
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,
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])])
198 AC_CHECK_TYPE(sig_atomic_t, int)
199 is_sig_atomic_t_volatile=no
201 if test $is_sig_atomic_t_volatile = 'yes'
203 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
205 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
211 AC_CHECK_FUNC(getopt)
212 if test $ac_cv_func_getopt = yes; then
213 AC_CHECK_HEADERS(getopt.h)
216 AC_CHECK_FUNC(regcomp)
217 if test $ac_cv_func_regcomp = yes; then
218 AC_CHECK_HEADERS(regex.h)
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
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
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,
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
252 if test "$mutt_cv_mailpath" = no; then
253 AC_MSG_ERROR("Could not determine where new mail is stored.")
255 AC_DEFINE_UNQUOTED(MAILPATH,"$mutt_cv_mailpath",[ Where new mail is spooled. ])
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>
260 int main (int argc, char **argv)
264 stat ("$mutt_cv_mailpath", &s);
265 if (s.st_mode & S_IWOTH) exit (0);
267 }], mutt_cv_worldwrite=yes, mutt_cv_worldwrite=no, mutt_cv_worldwrite=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>
274 int main (int argc, char **argv)
278 stat ("$mutt_cv_mailpath", &s);
279 if (s.st_mode & S_IWGRP) exit (0);
281 }], mutt_cv_groupwrite=yes, mutt_cv_groupwrite=no, mutt_cv_groupwrite=no)])
283 if test $mutt_cv_groupwrite = yes; then
284 AC_DEFINE(USE_SETGID,1,[ Define if mutt should run setgid "mail". ])
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)
296 docdir=$mutt_cv_docdir
299 if test x$mutt_cv_setgid = xyes; then
301 DOTLOCK_PERMISSION=2755
304 DOTLOCK_PERMISSION=755
306 AC_SUBST(DOTLOCK_GROUP)
307 AC_SUBST(DOTLOCK_PERMISSION)
309 dnl -- socket dependencies --
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"
319 AM_CONDITIONAL(BUILD_NNTP, test x$need_nntp = xyes)
321 AC_MSG_CHECKING([for socklen_t])
322 AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]),
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])])
329 dnl -- imap dependencies --
332 CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
333 MUTTLIBS="$MUTTLIBS $LIBGNUTLS_LIBS"],[AC_MSG_ERROR([could not find libgnutls])
336 AC_CHECK_LIB(sasl2, sasl_client_init,,AC_MSG_ERROR([could not find libsasl2]))
337 MUTTLIBS="$MUTTLIBS $LIBS"
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])
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])])
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. ])
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])
364 if test $mutt_cv_fcntl = yes; then
365 AC_DEFINE(USE_FCNTL,1, [ Define to use fcntl() to lock folders. ])
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])
375 AC_MSG_RESULT($ac_cv_dirent_d_ino)
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"
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])
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
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"
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])
406 if test x$ac_cv_gdbmopen = xyes; then
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])
422 AC_MSG_ERROR([You need one of: QDBM, GDBM or Sleepycat DB4 for --enable-hcache])
430 AC_SUBST(LIBNNTPDEPS)
432 dnl -- iconv/gettext --
434 AC_ARG_ENABLE(iconv, AC_HELP_STRING([--disable-iconv], [Disable iconv support]),
435 [if test x$enableval = xno ; then
442 if test "$am_cv_func_iconv" != "yes"; then
443 AC_MSG_WARN([Configuring without iconv support. See INSTALL for details])
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,
449 AC_DEFINE(HAVE_ICONV_T_DEF, 1,
450 [Define if <iconv.h> defines iconv_t.])],
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)
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).])
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).])
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])
489 dnl -- end libesmtp --
491 AC_ARG_ENABLE(doc, [ --enable-doc build documentation (needs doxygen and LaTeX)])
492 # Build documentation?
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
504 AC_MSG_CHECKING(for a4wide.sty)
505 if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
507 elif test -f /usr/share/texmf-tetex/tex/latex/a4wide/a4wide.sty; then
515 AM_CONDITIONAL(BUILD_DOCUMENTATION, test "${DOXYGEN}" != "no")
516 AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
521 apidoc/Makefile apidoc/doxygen.cfg