This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[jit] Don't hardcode documentation version/release


Committed to branch dmalcolm/jit:

gcc/jit/ChangeLog.jit:
	* docs/conf.py (__read_file): New helper function, for
	extracting...
	(gcc_BASEVER): New variable, read from "BASE-VER" in gcc src dir.
	(gcc_DEVPHASE): Likewise, from file "DEV-PHASE".
	(gcc_DATESTAMP): Likewise, from file "DATESTAMP".
	(gcc_REVISION): Likewise, from file "REVISION" (if present).
	(version): Rather than hardcoding this variable, extract from file
	BASE-VER, via gcc_BASEVER local.
	(release): Likewise, building it up from the files read above.
	* docs/_build/texinfo/libgccjit.texi: Regenerate.
---
 gcc/jit/ChangeLog.jit                      | 13 +++++++++++++
 gcc/jit/docs/_build/texinfo/libgccjit.texi |  2 +-
 gcc/jit/docs/conf.py                       | 20 ++++++++++++++++++--
 3 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/gcc/jit/ChangeLog.jit b/gcc/jit/ChangeLog.jit
index ca9a44d..2c6e5e3 100644
--- a/gcc/jit/ChangeLog.jit
+++ b/gcc/jit/ChangeLog.jit
@@ -1,3 +1,16 @@
+2014-09-23  David Malcolm  <dmalcolm@redhat.com>
+
+	* docs/conf.py (__read_file): New helper function, for
+	extracting...
+	(gcc_BASEVER): New variable, read from "BASE-VER" in gcc src dir.
+	(gcc_DEVPHASE): Likewise, from file "DEV-PHASE".
+	(gcc_DATESTAMP): Likewise, from file "DATESTAMP".
+	(gcc_REVISION): Likewise, from file "REVISION" (if present).
+	(version): Rather than hardcoding this variable, extract from file
+	BASE-VER, via gcc_BASEVER local.
+	(release): Likewise, building it up from the files read above.
+	* docs/_build/texinfo/libgccjit.texi: Regenerate.
+
 2014-09-22  David Malcolm  <dmalcolm@redhat.com>
 
 	* docs/intro/tutorial01.rst: Remove stray "FIXME".
diff --git a/gcc/jit/docs/_build/texinfo/libgccjit.texi b/gcc/jit/docs/_build/texinfo/libgccjit.texi
index 9d45f5d..d2f6d07 100644
--- a/gcc/jit/docs/_build/texinfo/libgccjit.texi
+++ b/gcc/jit/docs/_build/texinfo/libgccjit.texi
@@ -19,7 +19,7 @@
 
 @copying
 @quotation
-libgccjit 0.1, September 22, 2014
+libgccjit 5.0.0 (experimental 20140909), September 23, 2014
 
 David Malcolm
 
diff --git a/gcc/jit/docs/conf.py b/gcc/jit/docs/conf.py
index 22e763a..c300339 100644
--- a/gcc/jit/docs/conf.py
+++ b/gcc/jit/docs/conf.py
@@ -43,14 +43,30 @@ master_doc = 'index'
 project = u'libgccjit'
 copyright = u'2014, Free Software Foundation'
 
+# GCC-specific: extract version information from "gcc" src subdir for
+# use in "version" and "release" below.
+def __read_file(name):
+    gcc_srcdir = '../..'
+    path = os.path.join(gcc_srcdir, name)
+    if os.path.exists(path):
+        return open(path).read().strip()
+    else:
+        return ''
+gcc_BASEVER = __read_file('BASE-VER')
+gcc_DEVPHASE = __read_file('DEV-PHASE')
+gcc_DATESTAMP = __read_file('DATESTAMP')
+gcc_REVISION = __read_file('REVISION')
+
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
 # The short X.Y version.
-version = '0.1'
+version = gcc_BASEVER
 # The full version, including alpha/beta/rc tags.
-release = '0.1'
+release = ('%s (%s %s%s)'
+           % (gcc_BASEVER, gcc_DEVPHASE, gcc_DATESTAMP,
+              (' %s' % gcc_REVISION) if gcc_REVISION else ''))
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
-- 
1.7.11.7


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]