aboutsummaryrefslogtreecommitdiff
path: root/docs/meson.build
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2020-10-17 20:52:55 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-10-17 20:52:55 +0100
commit782d7b30dd8e27ba24346e7c411b476db88b59e7 (patch)
treec0210a939d942717719a7249639b8149f9d9c248 /docs/meson.build
parente12ce85b2c79d83a340953291912875c30b3af06 (diff)
parentc47110d90fa5401bcc42c17f8ae0724a1c96599a (diff)
downloadqemu-782d7b30dd8e27ba24346e7c411b476db88b59e7.zip
qemu-782d7b30dd8e27ba24346e7c411b476db88b59e7.tar.gz
qemu-782d7b30dd8e27ba24346e7c411b476db88b59e7.tar.bz2
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
* Drop ninjatool and just require ninja (Paolo) * Fix docs build under msys2 (Yonggang) * HAX snafu fix (Claudio) * Disable signal handlers during fuzzing (Alex) * Miscellaneous fixes (Bruce, Greg) # gpg: Signature made Sat 17 Oct 2020 15:45:56 BST # gpg: using RSA key F13338574B662389866C7682BFFBD25F78C7AE83 # gpg: issuer "pbonzini@redhat.com" # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini-gitlab/tags/for-upstream: (22 commits) ci: include configure and meson logs in all jobs if configure fails hax: unbreak accelerator cpu code after cpus.c split fuzz: Disable QEMU's SIG{INT,HUP,TERM} handlers cirrus: Enable doc build on msys2/mingw meson: Move the detection logic for sphinx to meson meson: move SPHINX_ARGS references within "if build_docs" docs: Fix Sphinx configuration for msys2/mingw meson: Only install icons and qemu.desktop if have_system configure: fix handling of --docdir parameter meson: cleanup curses/iconv test meson.build: don't condition iconv detection on library detection build: add --enable/--disable-libudev build: replace ninjatool with ninja build: cleanups to Makefile add ninja to dockerfiles, CI configurations and test VMs dockerfiles: enable Centos 8 PowerTools configure: move QEMU_INCLUDES to meson tests: add missing generated sources to testqapi make: run shell with pipefail tests/Makefile.include: unbreak non-tcg builds ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'docs/meson.build')
-rw-r--r--docs/meson.build46
1 files changed, 46 insertions, 0 deletions
diff --git a/docs/meson.build b/docs/meson.build
index 0340d48..8c222f9 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -1,4 +1,50 @@
+if get_option('sphinx_build') == ''
+ sphinx_build = find_program(['sphinx-build-3', 'sphinx-build'],
+ required: get_option('docs'))
+else
+ sphinx_build = find_program(get_option('sphinx_build'),
+ required: get_option('docs'))
+endif
+
+# Check if tools are available to build documentation.
+build_docs = false
+if sphinx_build.found()
+ SPHINX_ARGS = [sphinx_build]
+ # If we're making warnings fatal, apply this to Sphinx runs as well
+ if get_option('werror')
+ SPHINX_ARGS += [ '-W' ]
+ endif
+
+ # This is a bit awkward but works: create a trivial document and
+ # try to run it with our configuration file (which enforces a
+ # version requirement). This will fail if sphinx-build is too old.
+ run_command('mkdir', ['-p', tmpdir / 'sphinx'])
+ run_command('touch', [tmpdir / 'sphinx/index.rst'])
+ sphinx_build_test_out = run_command(SPHINX_ARGS + [
+ '-c', meson.current_source_dir(),
+ '-b', 'html', tmpdir / 'sphinx',
+ tmpdir / 'sphinx/out'])
+ build_docs = (sphinx_build_test_out.returncode() == 0)
+
+ if not build_docs
+ warning('@0@ exists but it is either too old or uses too old a Python version'.format(get_option('sphinx_build')))
+ if get_option('docs').enabled()
+ error('Install a Python 3 version of python-sphinx')
+ endif
+ endif
+endif
+
if build_docs
+ SPHINX_ARGS += ['-Dversion=' + meson.project_version(), '-Drelease=' + config_host['PKGVERSION']]
+
+ sphinx_extn_depends = [ meson.source_root() / 'docs/sphinx/depfile.py',
+ meson.source_root() / 'docs/sphinx/hxtool.py',
+ meson.source_root() / 'docs/sphinx/kerneldoc.py',
+ meson.source_root() / 'docs/sphinx/kernellog.py',
+ meson.source_root() / 'docs/sphinx/qapidoc.py',
+ meson.source_root() / 'docs/sphinx/qmp_lexer.py',
+ qapi_gen_depends ]
+
configure_file(output: 'index.html',
input: files('index.html.in'),
configuration: {'VERSION': meson.project_version()},