mirror of
https://git.rtems.org/rtems-docs/
synced 2025-07-24 04:44:18 +08:00
Add a check for Sphinx extensions.
Minor clean up of the configure messages. Do not re-check sphinx in the nested configures.
This commit is contained in:
parent
c1dddacbee
commit
ff9d55501f
@ -134,7 +134,28 @@ def html_resources(ctx, buildtype):
|
|||||||
# )
|
# )
|
||||||
|
|
||||||
|
|
||||||
|
def check_sphinx_extension(ctx, extension):
|
||||||
|
def run_sphinx(bld):
|
||||||
|
rst_node = bld.srcnode.make_node('testbuild/contents.rst')
|
||||||
|
rst_node.parent.mkdir()
|
||||||
|
rst_node.write('.. COMMENT test sphinx\n')
|
||||||
|
bld(rule = bld.kw['rule'], source = rst_node)
|
||||||
|
|
||||||
|
ctx.start_msg("Checking for '%s'" % (extension))
|
||||||
|
try:
|
||||||
|
ctx.run_build(fragment = 'xx',
|
||||||
|
rule = "${BIN_SPHINX_BUILD} -b html -D extensions=%s -C . out" % (extension),
|
||||||
|
build_fun = run_sphinx,
|
||||||
|
env = ctx.env)
|
||||||
|
except ctx.errors.ConfigurationError:
|
||||||
|
ctx.end_msg('not found (see README.txt)', 'RED')
|
||||||
|
ctx.fatal('The configuration failed')
|
||||||
|
ctx.end_msg('found')
|
||||||
|
|
||||||
|
|
||||||
def cmd_configure(ctx):
|
def cmd_configure(ctx):
|
||||||
|
check_sphinx = not ctx.env.BIN_SPHINX_BUILD
|
||||||
|
if check_sphinx:
|
||||||
ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory = True)
|
ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory = True)
|
||||||
ctx.find_program("aspell", var = "BIN_ASPELL", mandatory = False)
|
ctx.find_program("aspell", var = "BIN_ASPELL", mandatory = False)
|
||||||
|
|
||||||
@ -142,13 +163,23 @@ def cmd_configure(ctx):
|
|||||||
ver = check_sphinx_version(ctx, sphinx_min_version)
|
ver = check_sphinx_version(ctx, sphinx_min_version)
|
||||||
ctx.end_msg("yes (%s)" % ".".join(map(str, ver)))
|
ctx.end_msg("yes (%s)" % ".".join(map(str, ver)))
|
||||||
|
|
||||||
ctx.start_msg("Sphinx Verbose: ")
|
ctx.start_msg("Checking Sphinx Verbose ")
|
||||||
if 'SPHINX_VERBOSE' not in ctx.env:
|
if 'SPHINX_VERBOSE' not in ctx.env:
|
||||||
ctx.env.append_value('SPHINX_VERBOSE', ctx.options.sphinx_verbose)
|
ctx.env.append_value('SPHINX_VERBOSE', ctx.options.sphinx_verbose)
|
||||||
level = sphinx_verbose(ctx)
|
level = sphinx_verbose(ctx)
|
||||||
if level == '-Q':
|
if level == '-Q':
|
||||||
level = 'quiet'
|
level = 'quiet'
|
||||||
ctx.end_msg(level)
|
ctx.end_msg(level)
|
||||||
|
#
|
||||||
|
# Check extensions.
|
||||||
|
#
|
||||||
|
check_sphinx_extension(ctx, 'sphinx.ext.autodoc')
|
||||||
|
check_sphinx_extension(ctx, 'sphinx.ext.coverage')
|
||||||
|
check_sphinx_extension(ctx, 'sphinx.ext.doctest')
|
||||||
|
check_sphinx_extension(ctx, 'sphinx.ext.graphviz')
|
||||||
|
check_sphinx_extension(ctx, 'sphinx.ext.intersphinx')
|
||||||
|
check_sphinx_extension(ctx, 'sphinx.ext.mathjax')
|
||||||
|
check_sphinx_extension(ctx, 'sphinxcontrib.bibtex')
|
||||||
|
|
||||||
#
|
#
|
||||||
# Optional builds.
|
# Optional builds.
|
||||||
@ -164,8 +195,6 @@ def cmd_configure(ctx):
|
|||||||
'-shell-escape' not in ctx.env['PDFLATEXFLAGS']:
|
'-shell-escape' not in ctx.env['PDFLATEXFLAGS']:
|
||||||
ctx.env.append_value('PDFLATEXFLAGS', '-shell-escape')
|
ctx.env.append_value('PDFLATEXFLAGS', '-shell-escape')
|
||||||
latex.configure_tests(ctx)
|
latex.configure_tests(ctx)
|
||||||
else:
|
|
||||||
ctx.msg('Check for Tex packages', 'skipping, already checked')
|
|
||||||
ctx.env.BUILD_PDF = 'yes'
|
ctx.env.BUILD_PDF = 'yes'
|
||||||
|
|
||||||
ctx.envBUILD_SINGLEHTML = 'no'
|
ctx.envBUILD_SINGLEHTML = 'no'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user