qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] build: Build and install the info manual.


From: Maxim Cournoyer
Subject: [PATCH] build: Build and install the info manual.
Date: Thu, 24 Sep 2020 22:41:43 -0400

Take advantage of the Sphinx texinfo backend to generate a QEMU info
manual.  The texinfo format allows for more structure and info readers
provide more advanced navigation capabilities compared to manpages
readers.

* configure (infodir): Add the --infodir option, which allows
configuring the directory under which the info manuals are installed.
* docs/index.rst: Include the top level documents to prevent
warnings (treated as errors by sphinx-build).
* docs/meson.build (sphinxinfo): Add new target.
---
 configure        |  3 +++
 docs/index.rst   |  2 ++
 docs/meson.build | 13 +++++++++++++
 meson.build      |  4 +++-
 4 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index e8e8e984f2..9dfd10e063 100755
--- a/configure
+++ b/configure
@@ -1069,6 +1069,8 @@ for opt do
     static="yes"
     QEMU_PKG_CONFIG_FLAGS="--static $QEMU_PKG_CONFIG_FLAGS"
   ;;
+  --infodir=*) infodir="$optarg"
+  ;;
   --mandir=*) mandir="$optarg"
   ;;
   --bindir=*) bindir="$optarg"
@@ -1786,6 +1788,7 @@ Advanced options (experts only):
   --smbd=SMBD              use specified smbd [$smbd]
   --with-git=GIT           use specified git [$git]
   --static                 enable static build [$static]
+  --infodir=PATH           install info manual in PATH
   --mandir=PATH            install man pages in PATH
   --datadir=PATH           install firmware in PATH/$qemu_suffix
   --docdir=PATH            install documentation in PATH/$qemu_suffix
diff --git a/docs/index.rst b/docs/index.rst
index 763e3d0426..4f155b51d7 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -9,6 +9,7 @@ Welcome to QEMU's documentation!
 .. toctree::
    :maxdepth: 2
    :caption: Contents:
+   :glob:
 
    system/index
    user/index
@@ -16,3 +17,4 @@ Welcome to QEMU's documentation!
    interop/index
    specs/index
    devel/index
+   *
diff --git a/docs/meson.build b/docs/meson.build
index 50f367349b..eb94e4f3cf 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -32,10 +32,13 @@ if build_docs
 
   sphinxdocs = []
   sphinxmans = []
+  conf_py_files = [files('conf.py')]
+
   foreach manual : manuals
     private_dir = meson.current_build_dir() / (manual + '.p')
     output_dir = meson.current_build_dir() / manual
     input_dir = meson.current_source_dir() / manual
+    conf_py_files += files(manual / 'conf.py')
 
     this_manual = custom_target(manual + ' manual',
                 build_by_default: build_docs,
@@ -70,4 +73,14 @@ if build_docs
   endforeach
   alias_target('sphinxdocs', sphinxdocs)
   alias_target('man', sphinxmans)
+
+  sphinxinfo = custom_target(
+    'QEMU info manual generated source',
+    output: ['QEMU.texi', 'sphinxinfo.stamp'],
+    input: conf_py_files,
+    depfile: 'sphinxinfo.d',
+    command: [SPHINX_ARGS, '-Ddepfile=@DEPFILE@', '-Ddepfile_stamp=@OUTPUT1@',
+             '-b', 'texinfo',
+             meson.current_source_dir(), meson.current_build_dir()])
+  alias_target('sphinxinfo', sphinxinfo)
 endif
diff --git a/meson.build b/meson.build
index f4d1ab1096..4156b585ba 100644
--- a/meson.build
+++ b/meson.build
@@ -1218,6 +1218,7 @@ if build_docs
                                               'qemu_confdir': 
config_host['qemu_confdir']})
 
   texi = {
+    'QEMU': sphinxinfo,
     'qemu-qmp-ref': ['docs/interop/qemu-qmp-ref.texi', qapi_doc_texi, 
version_texi],
   }
   if 'CONFIG_GUEST_AGENT' in config_host
@@ -1241,7 +1242,8 @@ if build_docs
                       input: input,
                       output: output,
                       install: true,
-                      install_dir: qemu_docdir / 'interop',
+                      install_dir: ext == 'info' ? get_option('infodir') \
+                                                 : qemu_docdir / 'interop',
                       command: cmd + args)
       endforeach
       alias_target(ext, t)
-- 
2.28.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]