X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=configure.ac;h=2c54741ac9c4817d4a5eb21b30b931a125a8c746;hp=4c980b75263595b50c41a95b29c5487d9ef9885d;hb=fb0de7e2db97b1fe0882a31135b2fe4c1bae1821;hpb=8cf8034a805e70fb34b170e9ceefdf99a2797e60 diff --git a/configure.ac b/configure.ac index 4c980b7..2c54741 100644 --- a/configure.ac +++ b/configure.ac @@ -6,9 +6,7 @@ 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']) +AM_INIT_AUTOMAKE(madmutt, devel) AC_GNU_SOURCE @@ -62,7 +60,11 @@ 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. ]) -OPS="\$(srcdir)/OPS" +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 ---------------- @@ -71,27 +73,13 @@ AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--enable-gpgme], [Enable GPGME support]),[ 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) + AC_MSG_ERROR([could not find gpgme]) fi ]) -dnl ---------------- mixmaster ---------------- - -AC_ARG_WITH(mixmaster, AC_HELP_STRING([--with-mixmaster[=PATH]], [Include Mixmaster support]), [ - MIXMASTER=${withval:-"mixmaster"} - OPS="$OPS \$(srcdir)/OPS.MIX" - MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS remailer.o" - AC_DEFINE_UNQUOTED(MIXMASTER,"$MIXMASTER",[Where to find mixmaster on your system.]) -]) - -AC_SUBST([OPS]) - -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_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, @@ -114,7 +102,7 @@ main () 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" + MUTTLIBS="$MUTTLIBS -L${mutt_cv_slang}/objs" else if test -d ${prefix}/include/slang; then CFLAGS="$CFLAGS -I${prefix}/include/slang" @@ -128,7 +116,7 @@ main () 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" + MUTTLIBS="$MUTTLIBS -L${mutt_cv_slang}/objs" else dnl ---Must be installed somewhere mutt_cv_slang=$withval @@ -137,7 +125,7 @@ main () elif test -d $withval/include; then CFLAGS="$CFLAGS -I${withval}/include" fi - LDFLAGS="$LDFLAGS -L${withval}/lib" + MUTTLIBS="$MUTTLIBS -L${withval}/lib" fi fi AC_MSG_RESULT($mutt_cv_slang) @@ -145,7 +133,6 @@ main () AC_CHECK_LIB(termlib, main) fi AC_DEFINE(USE_SLANG_CURSES,1, [ Define if you compile with SLang instead of curses/ncurses. ]) - AC_DEFINE(HAVE_COLOR,1,[ Define if your curses library supports color. ]) dnl --- now that we've found it, check the link @@ -159,7 +146,7 @@ main () mutt_cv_curses=$withval fi if test x$mutt_cv_curses != x/usr; then - LDFLAGS="-L${mutt_cv_curses}/lib $LDFLAGS" + MUTTLIBS="-L${mutt_cv_curses}/lib $MUTTLIBS" CPPFLAGS="$CPPFLAGS -I${mutt_cv_curses}/include" fi ]) @@ -185,14 +172,13 @@ main () [CF_CURSES_LIBS]) ]) - old_LIBS="$LIBS" - LIBS="$LIBS $MUTTLIBS" + 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_DEFINE(HAVE_COLOR,1,[ Define if your curses library supports color. ]) + if test "$ac_cv_func_decl_start_color" != yes; then + AC_MSG_ERROR([Your curses library does not supports color.]) fi - LIBS="$old_LIBS" + LIBS="" ]) AC_CHECK_HEADERS(stdarg.h sys/ioctl.h ioctl.h sysexits.h) @@ -250,7 +236,6 @@ if test x$with_homespool != x; then relative the the home directory. use: configure --with-homespool=FILE ]) - AC_DEFINE(USE_DOTLOCK,1,[ Define to use dotlocking for mailboxes. ]) mutt_cv_setgid=no else AC_ARG_WITH(mailpath, AC_HELP_STRING([--with-mailpath=DIR], [Directory where spool mailboxes are located]), @@ -285,9 +270,7 @@ int main (int argc, char **argv) }], mutt_cv_worldwrite=yes, mutt_cv_worldwrite=no, mutt_cv_worldwrite=no)]) mutt_cv_setgid=no - if test $mutt_cv_worldwrite = yes; then - AC_DEFINE(USE_DOTLOCK,1,[ Define to use dotlocking for mailboxes. ]) - else + 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 @@ -301,7 +284,6 @@ int main (int argc, char **argv) }], mutt_cv_groupwrite=yes, mutt_cv_groupwrite=no, mutt_cv_groupwrite=no)]) if test $mutt_cv_groupwrite = yes; then - AC_DEFINE(USE_DOTLOCK,1,[ Define to use dotlocking for mailboxes. ]) AC_DEFINE(USE_SETGID,1,[ Define if mutt should run setgid "mail". ]) mutt_cv_setgid=yes fi @@ -349,77 +331,14 @@ 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 +AM_PATH_LIBGNUTLS(,[ + CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS" + MUTTLIBS="$MUTTLIBS $LIBGNUTLS_LIBS"],[AC_MSG_ERROR([could not find libgnutls]) ]) -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_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 @@ -428,7 +347,8 @@ AC_ARG_WITH(idn, AC_HELP_STRING([--with-idn], [Use GNU libidn for domain names]) AC_MSG_ERROR([libidn is too old, want 0.6 at least]) fi CPPFLAGS="$CPPFLAGS $IDN_CFLAGS" - LDFLAGS="$LDFLAGS $IDN_LIBS" + MUTTLIBS="$MUTTLIBS $IDN_LIBS" + AC_DEFINE(HAVE_LIBIDN, 1, [IDN Support]) ],[AC_MSG_ERROR([could not find libidn])]) fi ]) @@ -457,19 +377,11 @@ if test x$ac_cv_dirent_d_ino = xyes ; then fi AC_MSG_RESULT($ac_cv_dirent_d_ino) -AC_ARG_ENABLE(buffy-size, AC_HELP_STRING([--enable-buffy-size], [Use file size attribute instead of access time]), - [if test x$enableval = xyes; then - AC_DEFINE(BUFFY_SIZE,1,[ Define to enable the "buffy_size" feature. ]) - fi]) - 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 @@ -491,7 +403,7 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching]) GDBM_INC="-I$d/include" GDBM_LIB="-L$d/lib" CPPFLAGS="$OLDCPPFLAGS $GDBM_INC" - LIBS="$OLDLIBS $GDBM_LIB -lgdbm" + LIBS="$MUTTLIBS $GDBM_LIB -lgdbm" AC_TRY_LINK([#include ],[gdbm_open(0,0,0,0,0);],[ac_cv_gdbmopen=yes]) fi done @@ -525,7 +437,7 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching]) 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" + LIBS="$MUTTLIBS -L$BDB_LIB_DIR -l$l" AC_TRY_LINK([ #include #include @@ -553,24 +465,24 @@ AC_ARG_ENABLE(hcache, AC_HELP_STRING([--enable-hcache], [Enable header caching]) if test x$ac_qdbm_here = xyes; then CPPFLAGS="$OLDCPPFLAGS $QDBM_CFLAGS" - LIBS="$OLDLIBS $QDBM_LIBS" + MUTTLIBS="$MUTTLIBS $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"; + MUTTLIBS="$MUTTLIBS $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" + MUTTLIBS="$MUTTLIBS -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 + LIBS="" fi]) dnl -- end cache -- AC_SUBST(MUTTLIBS) -AC_SUBST(MUTT_LIB_OBJECTS) AC_SUBST(LIBNNTP) AC_SUBST(LIBNNTPDEPS) @@ -600,8 +512,7 @@ else 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" + LIBS="$LIBICONV" AC_TRY_RUN([ #include int main() @@ -622,7 +533,7 @@ changequote([, ])dnl mutt_cv_iconv_good=yes, mutt_cv_iconv_good=no, mutt_cv_iconv_good=yes) - LIBS="$mutt_save_LIBS") + LIBS="") if test "$mutt_cv_iconv_good" = no; then AC_MSG_ERROR(Try using libiconv instead) fi @@ -661,8 +572,8 @@ 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" + dnl HACK MUTTLIBS="$MUTTLIBS $mutt_libesmtp_libs" + MUTTLIBS="$MUTTLIBS -lesmtp" AC_DEFINE(USE_LIBESMTP, 1, [Define to enable the use of libesmtp]) fi dnl -- end libesmtp -- @@ -725,21 +636,46 @@ else fi AC_SUBST(HTMLCLEAN_CMD) -AC_OUTPUT(Makefile - Madmuttrc.head +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 m4/Makefile po/Makefile.in - doc/Makefile doc/instdoc.sh - contrib/Makefile + apidoc/Makefile apidoc/doxygen.cfg lib-lib/Makefile + lib-lua/Makefile lib-mime/Makefile - lib-crypt/Makefile lib-hash/Makefile + lib-mx/Makefile lib-sys/Makefile lib-ui/Makefile - lib/Makefile imap/Makefile pop/Makefile nntp/Makefile