configure: bootstrap sphinx with mkvenv

When docs are explicitly requested, require Sphinx>=1.6.0. When docs are
explicitly disabled, don't bother to check for Sphinx at all. If docs
are set to "auto", attempt to locate Sphinx, but continue onward if it
wasn't located.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20230511035435.734312-22-jsnow@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
John Snow
2023-05-10 23:54:29 -04:00
committed by Paolo Bonzini
parent 6b0cedcdc7
commit 6f6652ebc2
5 changed files with 20 additions and 17 deletions
Vendored
+19 -2
View File
@@ -1115,9 +1115,9 @@ fi
# Suppress writing compiled files
python="$python -B"
mkvenv="$python ${source_path}/python/scripts/mkvenv.py"
if ! $python "${source_path}/python/scripts/mkvenv.py" ensure \
if ! $mkvenv ensure \
--dir "${source_path}/python/wheels" \
--diagnose "meson" \
"meson>=0.61.5" ;
@@ -1132,6 +1132,23 @@ fi
meson="$(cd pyvenv/bin; pwd)/meson"
# Conditionally ensure Sphinx is installed.
if test "$docs" != "disabled" ; then
if ! $mkvenv ensure \
--diagnose "sphinx-build" \
"sphinx>=1.6.0" "sphinx-rtd-theme>=0.5.0";
then
if test "$docs" = "enabled" ; then
exit 1
fi
echo "Sphinx not found/usable, disabling docs."
docs=disabled
else
docs=enabled
fi
fi
# Probe for ninja
if test -z "$ninja"; then