diff mbox series

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

Message ID 20200825175827.355940-4-marcandre.lureau@redhat.com
State New
Headers show
Series meson: mingw installation fixes & nsis conversion | expand

Commit Message

Marc-André Lureau Aug. 25, 2020, 5:58 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(-)

Comments

Daniel P. Berrangé Aug. 26, 2020, 8:32 a.m. UTC | #1
On Tue, Aug 25, 2020 at 09:58:25PM +0400, marcandre.lureau@redhat.com wrote:
> 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 --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" \

This is passing an absolute path.....


> 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')

...but this default is a relative dir, presumably relative to
datadir.  The code expects an absolute dir.


Regards,
Daniel
Marc-André Lureau Aug. 26, 2020, 8:38 a.m. UTC | #2
Hi

On Wed, Aug 26, 2020 at 12:32 PM Daniel P. Berrangé <berrange@redhat.com>
wrote:

> On Tue, Aug 25, 2020 at 09:58:25PM +0400, marcandre.lureau@redhat.com
> wrote:
> > 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 --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" \
>
> This is passing an absolute path.....
>
>
> > 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')
>
> ...but this default is a relative dir, presumably relative to
> datadir.  The code expects an absolute dir.
>


Meson accepts both absolute and relative path for installation location. If
it's relative, it will be under the $prefix directory.


>
> Regards,
> Daniel
> --
> |: https://berrange.com      -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-
> https://www.instagram.com/dberrange :|
>
>
>
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')