aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-03-07 14:26:46 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-03-07 14:26:46 +0000
commit5f71eac06e15b9a3fa1134d446f0ca2d52e45f0a (patch)
treeeb460874bb0b2ef0dfd36985097ab4ecd7adf496 /configure
parentf8cf7147f10a3cee64396614218b08e3c9161d4a (diff)
downloadqemu-5f71eac06e15b9a3fa1134d446f0ca2d52e45f0a.zip
qemu-5f71eac06e15b9a3fa1134d446f0ca2d52e45f0a.tar.gz
qemu-5f71eac06e15b9a3fa1134d446f0ca2d52e45f0a.tar.bz2
Makefile, configure: Support building rST documentation
Add support to our configure and makefile machinery for building our rST docs into HTML files. Building the documentation now requires that sphinx-build is available; this seems better than allowing half the docs to be built if it is not present but having half of them missing. (In particular it means that assuming that distros configured with --enable-docs they'll get a helpful error from configure telling them the new build dependency.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20190305172139.32662-10-peter.maydell@linaro.org Message-id: 20190228145624.24885-10-peter.maydell@linaro.org
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure15
1 files changed, 13 insertions, 2 deletions
diff --git a/configure b/configure
index cefeb8f..47bf617 100755
--- a/configure
+++ b/configure
@@ -4589,13 +4589,24 @@ if compile_prog "" "" ; then
syncfs=yes
fi
+# Check we have a new enough version of sphinx-build
+has_sphinx_build() {
+ # This is a bit awkward but works: create a trivial document and
+ # try to run it with our configuration file (which enforces a
+ # version requirement). This will fail if either
+ # sphinx-build doesn't exist at all or if it is too old.
+ mkdir -p "$TMPDIR1/sphinx"
+ touch "$TMPDIR1/sphinx/index.rst"
+ sphinx-build -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMPDIR1/sphinx/out" >/dev/null 2>&1
+}
+
# Check if tools are available to build documentation.
if test "$docs" != "no" ; then
- if has makeinfo && has pod2man; then
+ if has makeinfo && has pod2man && has_sphinx_build; then
docs=yes
else
if test "$docs" = "yes" ; then
- feature_not_found "docs" "Install texinfo and Perl/perl-podlators"
+ feature_not_found "docs" "Install texinfo, Perl/perl-podlators and python-sphinx"
fi
docs=no
fi