diff --git a/configure.ac b/configure.ac index 4d8aaae..914b880 100644 --- a/configure.ac +++ b/configure.ac @@ -11,6 +11,9 @@ AC_PROG_CXX AC_PROG_MKDIR_P AC_PROG_INSTALL +AC_CHECK_PROGS([DOXYGEN], [doxygen], [false]) +AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [false]) + AC_CANONICAL_BUILD AC_CANONICAL_HOST diff --git a/docs/Makefile.am b/docs/Makefile.am index c79f35a..302a029 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -2,11 +2,8 @@ EXTRA_DIST = Doxyfile conf.py index.rst requirements.txt -# TODO: detect programs by autoconf BUILDDIR = build -DOXYGEN = doxygen PAPER = -SPHINXBUILD = sphinx-build SPHINXOPTS = # Internal variables. diff --git a/docs/conf.py b/docs/conf.py index a494df1..ff9687c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,12 @@ import os +def get_version(filename): + from re import findall + with open(filename) as f: + versions = dict(findall(r'AC_INIT\(\[(.*?)\],\s*\[(.*?)\].*\)', f.read())) + return versions['fsmlite'] + + # https://github.com/rtfd/readthedocs.org/issues/388 if os.environ.get('READTHEDOCS', None) == 'True': from subprocess import call @@ -8,8 +15,8 @@ # TODO: extract from autoconf? project = 'fsmlite' author = 'Thomas Kemmer' -version = '0.2' -release = '0.2.1' +version = get_version(b'../configure.ac') +release = version copyright = '%s, %s' % ('2015-2018', author) master_doc = 'index'