# Build Knot DNS documentation
AC_ARG_ENABLE([documentation],
AS_HELP_STRING([--disable-documentation], [Don't build Knot DNS documentation]), [], [enable_documentation=yes])
-AS_IF([test "$enable_documentation" = "yes"], [
+AS_IF([test "$enable_documentation" != "no"], [
AC_PATH_PROG([SPHINXBUILD], [sphinx-build], [false])
- AS_IF([test "$SPHINXBUILD" = "false"],
- [AC_MSG_WARN([missing 'sphinx-build' executable for documentation generation])
- enable_documentation=no]
- )
- AC_PATH_PROG([PDFLATEX], [pdflatex], [false])
+ AS_IF([test "$SPHINXBUILD" != "false"], [
+ enable_documentation="man html epub"
+ AC_PATH_PROG([PDFLATEX], [pdflatex], [false])
+ AS_IF([test "$PDFLATEX" != "false"], [
+ enable_documentation="$enable_documentation pdf"
+ ])
+ ])
])
-AM_CONDITIONAL([HAVE_DOCS], [test "$enable_documentation" = "yes"])
+AM_CONDITIONAL([HAVE_DOCS], [test "$enable_documentation" != "no"])
+AM_CONDITIONAL([HAVE_SPHINX], [test "$SPHINXBUILD" != "false"])
AM_CONDITIONAL([HAVE_PDFLATEX], test "$PDFLATEX" != "false")
######################
endif # ENABLE_XDP
endif # HAVE_UTILS
+if HAVE_SPHINX
html-local:
$(AM_V_SPHINX)$(SPHINXBUILD) -b html -d $(SPHINXBUILDDIR)/doctrees/html $(ALLSPHINXOPTS) $(SPHINXBUILDDIR)/html
@echo "The HTML documentation has been built in $(SPHINXBUILDDIR)/html/"
html-local singlehtml pdf-local epub man install-html-local install-singlehtml install-pdf-local install-epub:
@echo "Install 'sphinx-build' and re-run configure to be able to generate documentation!"
+$(man_MANS)&:
+ @if [ ! -f "$@" ]; then \
+ echo "Install 'sphinx-build' or disable documentation and re-run configure to generate man pages!"; \
+ fi
+endif # HAVE_SPHINX
+
endif # HAVE_DOCS
EXTRA_DIST += \