+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")