diff options
author | Maxime Dénès <mail@maximedenes.fr> | 2018-03-11 13:55:25 +0100 |
---|---|---|
committer | Maxime Dénès <mail@maximedenes.fr> | 2018-03-13 12:45:31 +0100 |
commit | 815bdef747f7d69f25121f42ec72d109ec92edfe (patch) | |
tree | 4db845dff85346033fee6746b7087acd4d6a033d | |
parent | 8cb2b6a00d71572d60d4dcc4e7ec697fd3933389 (diff) |
[Sphinx] Read version number from configure
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | configure.ml | 10 | ||||
-rwxr-xr-x | doc/sphinx/conf.py | 7 |
3 files changed, 16 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore index b857b754a..267534365 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,7 @@ _build myocamlbuild_config.ml config/Makefile config/coq_config.ml +config/coq_config.py config/Info-*.plist dev/ocamldebug-coq dev/camlp5.dbg diff --git a/configure.ml b/configure.ml index 4726831e4..6c052b63b 100644 --- a/configure.ml +++ b/configure.ml @@ -1371,3 +1371,13 @@ let write_macos_metadata exec = let () = if arch = "Darwin" then List.iter write_macos_metadata distributed_exec + +let write_configpy f = + safe_remove f; + let o = open_out f in + let pr s = fprintf o s in + let pr_s = pr "%s = '%s'\n" in + pr "# DO NOT EDIT THIS FILE: automatically generated by ../configure\n"; + pr_s "version" coq_version + +let _ = write_configpy "config/coq_config.py" diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 0c8797b0e..cfca4ca65 100755 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -32,6 +32,9 @@ sys.setrecursionlimit(1500) # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.append(os.path.abspath('../tools/')) +sys.path.append(os.path.abspath('../../config/')) + +import coq_config # -- General configuration ------------------------------------------------ @@ -72,9 +75,9 @@ author = 'The Coq Development Team' # built documents. # # The short X.Y version. -version = '8.7' +version = coq_config.version # The full version, including alpha/beta/rc tags. -release = '8.7.dev' +release = coq_config.version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. |