diff options
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | utils/check-sphinx/README | 17 | ||||
-rw-r--r-- | utils/check-sphinx/conf.py | 12 | ||||
-rw-r--r-- | utils/check-sphinx/contents.rst | 3 |
4 files changed, 37 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 68e44661ef..2711840ddb 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/utils/check-sphinx/README b/utils/check-sphinx/README new file mode 100644 index 0000000000..acbf1afd45 --- /dev/null +++ b/utils/check-sphinx/README @@ -0,0 +1,17 @@ +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. diff --git a/utils/check-sphinx/conf.py b/utils/check-sphinx/conf.py new file mode 100644 index 0000000000..981a1c3464 --- /dev/null +++ b/utils/check-sphinx/conf.py @@ -0,0 +1,12 @@ +# 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) diff --git a/utils/check-sphinx/contents.rst b/utils/check-sphinx/contents.rst new file mode 100644 index 0000000000..3a344c041e --- /dev/null +++ b/utils/check-sphinx/contents.rst @@ -0,0 +1,3 @@ + +This is a dummy content. + |