Use p_new instead of xmalloc()
[apps/madmutt.git] / configure.ac
index 1fcdb34..42d1806 100644 (file)
@@ -62,8 +62,6 @@ 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 ---------------- gpgme ----------------
 
 AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--enable-gpgme], [Enable GPGME support]),[
@@ -77,16 +75,8 @@ AC_ARG_ENABLE(gpgme, AC_HELP_STRING([--enable-gpgme], [Enable GPGME support]),[
     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(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
@@ -716,12 +706,40 @@ else
 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
           lib-lib/Makefile