diff mbox series

[3/5] meson: add docdir option and pass pre-prefix qemu_docdir

Message ID 20200825150409.346957-4-marcandre.lureau@redhat.com
State New
Headers show
Series None | expand

Commit Message

Marc-André Lureau Aug. 25, 2020, 3:04 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

When cross-compiling, by default qemu_docdir is 'c:\Program Files\QEMU\'
which is not recognized as being an absolute path, and meson will end up
adding the prefix again.

Add an option to pass docdir location to meson, pre-prefixed like we do
with other directories and use that instead of config_host['qemu_docdir'].

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure         | 1 +
 docs/meson.build  | 4 ++--
 meson.build       | 3 ++-
 meson_options.txt | 1 +
 4 files changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/configure b/configure
index e19e2de2f0..e644841299 100755
--- a/configure
+++ b/configure
@@ -8223,6 +8223,7 @@  NINJA=$PWD/ninjatool $meson setup \
         --sysconfdir "${pre_prefix}$sysconfdir" \
         --localstatedir "${pre_prefix}$local_statedir" \
         -Dconfsuffix="$confsuffix" \
+        -Ddocdir="${pre_prefix}$qemu_docdir" \
         -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
         -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \
         -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \
diff --git a/docs/meson.build b/docs/meson.build
index 8b059a8e39..e27f4632dc 100644
--- a/docs/meson.build
+++ b/docs/meson.build
@@ -10,7 +10,7 @@  if build_docs
   configure_file(output: 'index.html',
                  input: files('index.html.in'),
                  configuration: {'VERSION': meson.project_version()},
-                 install_dir: config_host['qemu_docdir'])
+                 install_dir: get_option('docdir'))
   manuals = [ 'devel', 'interop', 'tools', 'specs', 'system', 'user' ]
   man_pages = {
     'interop' : {
@@ -48,7 +48,7 @@  if build_docs
                           input_dir, output_dir])
     sphinxdocs += this_manual
     if build_docs and manual != 'devel'
-      install_subdir(output_dir, install_dir: config_host['qemu_docdir'])
+      install_subdir(output_dir, install_dir: get_option('docdir'))
     endif
 
     these_man_pages = []
diff --git a/meson.build b/meson.build
index 20f20a7bfc..33281cecc3 100644
--- a/meson.build
+++ b/meson.build
@@ -1170,7 +1170,7 @@  if build_docs
                       input: input,
                       output: output,
                       install: true,
-                      install_dir: config_host['qemu_docdir'] / 'interop',
+                      install_dir: get_option('docdir') / 'interop',
                       command: cmd + args)
       endforeach
       alias_target(ext, t)
@@ -1233,6 +1233,7 @@  if targetos != 'windows'
 else
   summary_info += {'local state directory': 'queried at runtime'}
 endif
+summary_info += {'Doc directory':     get_option('docdir')}
 summary_info += {'Build directory':   meson.current_build_dir()}
 summary_info += {'Source path':       meson.current_source_dir()}
 summary_info += {'GIT binary':        config_host['GIT']}
diff --git a/meson_options.txt b/meson_options.txt
index 7bb2c0fca9..fb9312fddd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,5 @@ 
 option('confsuffix', type : 'string', value: 'qemu')
+option('docdir', type : 'string', value : 'doc/qemu')
 option('gettext', type : 'boolean', value : true)
 option('sdl', type : 'feature', value : 'auto')
 option('sdl_image', type : 'feature', value : 'auto')