|
@@ -60,10 +60,31 @@ author = 'The kernel development community'
|
|
# |version| and |release|, also used in various other places throughout the
|
|
# |version| and |release|, also used in various other places throughout the
|
|
# built documents.
|
|
# built documents.
|
|
#
|
|
#
|
|
-# The short X.Y version.
|
|
|
|
-version = '4.5'
|
|
|
|
-# The full version, including alpha/beta/rc tags.
|
|
|
|
-release = '4.5'
|
|
|
|
|
|
+# In a normal build, version and release are are set to KERNELVERSION and
|
|
|
|
+# KERNELRELEASE, respectively, from the Makefile via Sphinx command line
|
|
|
|
+# arguments.
|
|
|
|
+#
|
|
|
|
+# The following code tries to extract the information by reading the Makefile,
|
|
|
|
+# when Sphinx is run directly (e.g. by Read the Docs).
|
|
|
|
+try:
|
|
|
|
+ makefile_version = None
|
|
|
|
+ makefile_patchlevel = None
|
|
|
|
+ for line in open('../Makefile'):
|
|
|
|
+ key, val = [x.strip() for x in line.split('=', 2)]
|
|
|
|
+ if key == 'VERSION':
|
|
|
|
+ makefile_version = val
|
|
|
|
+ elif key == 'PATCHLEVEL':
|
|
|
|
+ makefile_patchlevel = val
|
|
|
|
+ if makefile_version and makefile_patchlevel:
|
|
|
|
+ break
|
|
|
|
+except:
|
|
|
|
+ pass
|
|
|
|
+finally:
|
|
|
|
+ if makefile_version and makefile_patchlevel:
|
|
|
|
+ version = release = makefile_version + '.' + makefile_patchlevel
|
|
|
|
+ else:
|
|
|
|
+ sys.stderr.write('Warning: Could not extract kernel version\n')
|
|
|
|
+ version = release = "unknown version"
|
|
|
|
|
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
# for a list of supported languages.
|
|
# for a list of supported languages.
|