summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmar Takhar <amar@rtems.org>2016-01-19 09:55:57 -0500
committerAmar Takhar <verm@darkbeer.org>2016-05-02 20:51:24 -0400
commit14bbcb1ea9315d651849bccff709ce05c3bc9602 (patch)
tree7e22a544952eae9c42439c74472c117267bbbd9f
parentAdd PDF generation support use with --pdf (diff)
downloadrtems-docs-14bbcb1ea9315d651849bccff709ce05c3bc9602.tar.bz2
Add minimum version check for Sphinx.
Some distributions have ancient versions we require at least 1.3.
-rw-r--r--common/waf.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/common/waf.py b/common/waf.py
index 55c7517..aa02722 100644
--- a/common/waf.py
+++ b/common/waf.py
@@ -1,6 +1,9 @@
import sys, os
from waflib.Build import BuildContext
+
+sphinx_min_version = (1,3)
+
def cmd_spell(ctx):
from waflib import Options
from sys import argv
@@ -32,17 +35,37 @@ class spell(BuildContext):
fun = 'cmd_spell'
+
+def check_sphinx_version(ctx, minver):
+# try:
+ version = ctx.cmd_and_log(ctx.env.BIN_SPHINX_BUILD + ['--version']).split(" ")[-1:][0]
+ ver = tuple(map(int, version.split(".")))
+# except Exception:
+# ctx.fatal("Version check failed please report")
+
+ if ver < minver:
+ ctx.fatal("Sphinx version is too old: %s" % ".".join(map(str, ver)))
+
+ return ver
+
def cmd_configure(ctx):
ctx.load('tex')
+
if not ctx.env.PDFLATEX:
conf.fatal('The program LaTex is required')
ctx.find_program("sphinx-build", var="BIN_SPHINX_BUILD", mandatory=True)
-# ctx.find_program("pdflatex", var="BIN_PDFLATEX", mandatory=True)
ctx.find_program("aspell", var="BIN_ASPELL", mandatory=False)
+ ctx.start_msg("Checking if Sphinx is at least %s.%s" % sphinx_min_version)
+ ver = check_sphinx_version(ctx, sphinx_min_version)
+
+ ctx.end_msg("yes (%s)" % ".".join(map(str, ver)))
+
+
+
def cmd_build(ctx, conf_dir=".", source_dir="."):
srcnode = ctx.srcnode.abspath()