have_sphinx=1
have_rst2man=0
RST2MAN=
+ have_rst2html=0
+ RST2HTML=
else
- printf "No (falling back to rst2man).\n"
+ printf "No (falling back to Docutils).\n"
have_sphinx=0
printf "Checking if rst2man is available... "
RST2MAN=
printf "No (so will not install man pages).\n"
fi
+
+ printf "Checking if rst2html is available... "
+ if rst2html -V > /dev/null 2>&1; then
+ have_rst2html=1
+ RST2HTML=$(command -v rst2html)
+ printf "Yes (${RST2HTML}).\n"
+ elif rst2man.py -V > /dev/null 2>&1; then
+ have_rst2html=1
+ RST2HTML=$(command -v rst2html.py)
+ printf "Yes (${RST2HTML}).\n"
+ else
+ have_rst2html=0
+ RST2HTML=
+ printf "No (so can not build HTML docs).\n"
+ fi
fi
libdir_in_ldconfig=0
# an empty string if no such program is available.
RST2MAN=${RST2MAN}
+# Whether there's a rst2html binary available for building documentation
+HAVE_RST2HTML=${have_rst2html}
+
+# The path to the rst2html program for building documentation. Set to
+# an empty string if no such program is available.
+RST2HTML=${RST2HTML}
+
# The directory to which desktop files should be installed
desktop_dir = \$(prefix)/share/applications
If you don't have Sphinx installed, you can use Docutils_ with the
same targets outlined above for Sphinx. The Docutils converters
-(rst2man, rst2html, etc.) are used instead of Sphinx. Only the man
-targets are currently supported.
+(rst2man, rst2html, etc.) are used instead of Sphinx. Only the HTML
+and man targets are currently supported.
Configuring the builder
-----------------------
``Makefile.config``. If neither ``HAVE_SPHINX`` nor ``HAVE_RST2MAN``
is 1, attempting to build the documentation will fail with an error.
+A parallel set of variables (``HAVE_RST2HTML`` and ``RST2HTML``) is
+used when building HTML docs with Docutills.
+
.. _Sphinx: http://sphinx-doc.org/
.. _Docutils: http://docutils.sourceforge.net/
build-html:
ifeq ($(HAVE_SPHINX),1)
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCBUILDDIR)/html
+else ifeq ($(HAVE_RST2HTML),1)
+ $(prerst2x) "$(RST2HTML)" $(srcdir)/doc $(DOCBUILDDIR)/html html
else
@echo "fatal: no Sphinx, cannot build HTML docs"
@false