Commit 97f9674b authored by Takenobu Tani's avatar Takenobu Tani Committed by Marge Bot

configure: Add checking python3-sphinx

This checks the configuration about python3-sphinx.
We need python3-sphinx instead of python2-sphinx to build documentation.

The approach is as follows:
* Check python3 version with custom `conf.py` invoked from
  sphinx-build` executable
* Place custom `conf.py` into new `utils/check-sphinx` directory

If sphinx is for python2 not python3, it's treated as config ERROR
instead of WARN.

See also #17346 and #17356.
parent ce9e2a1a
Pipeline #12296 passed with stages
in 507 minutes and 33 seconds
......@@ -840,6 +840,11 @@ changequote([, ])dnl
])
FP_COMPARE_VERSIONS([$fp_cv_sphinx_version],-lt,1.0.0,
[AC_MSG_WARN([Sphinx version 1.0.0 or later is required to build documentation]); SPHINXBUILD=;])
if test -n "$SPHINXBUILD"; then
if "$SPHINXBUILD" -b text utils/check-sphinx utils/check-sphinx/dist > /dev/null 2>&1; then true; else
AC_MSG_ERROR([Sphinx for python3 is required to build documentation.])
fi
fi
dnl ** check for xelatex
AC_PATH_PROG(XELATEX,xelatex)
......
This utility is intended to be used by $(TOP)/configure to check
sphinx's python version.
We need python3-sphinx instead of python2-sphinx to build documentation,
such as GHC user's guide.
However, it can't be confirmed with the command line option of sphinx-build.
This utility performs a version check via conf.py invoked from sphinx-build.
Usage:
$SPHINXBUILD -b text . dist > /dev/null 2>&1
echo $?
If your python for sphinx is python2, it returns error status code 1.
See description in $(TOP)/configure.ac.
# Sphinx's configuration file
#
# This is used by $(TOP)/configure to check if the sphinx is for
# python3 or later.
#
import sys
if (sys.version_info >= (3, 0)):
pass
else:
sys.exit(1)
This is a dummy content.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment