From: Thomas Huth <thuth@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Rafael Kitover" <rkitover@gmail.com>
Subject: Re: [PATCH] meson: move pixman detection to meson
Date: Thu, 27 Aug 2020 06:52:56 +0200 [thread overview]
Message-ID: <cc6af807-a24f-42bb-b1f7-8c8c5e59200b@redhat.com> (raw)
In-Reply-To: <20200826070243.11969-1-pbonzini@redhat.com>
On 26/08/2020 09.02, Paolo Bonzini wrote:
> When pixman is not installed (or too old), but virglrenderer is available
> and "configure" has been run with "--disable-system", the build currently
> aborts when trying to compile vhost-user-gpu (since it requires pixman).
>
> Let's skip the build of vhost-user-gpu when pixman is not installed or
> too old. Instead of adding CONFIG_PIXMAN, it is simpler to move the
> detection to pixman.
>
> Based on a patch by Thomas Huth. <thuth@redhat.com>
>
> Fixes: 9b52b17ba5 ("configure: Allow to build tools without pixman")
> Reported-by: Rafael Kitover <rkitover@gmail.com>
> Reported-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> configure | 21 ++-------------------
> contrib/vhost-user-gpu/meson.build | 3 ++-
> meson.build | 12 +++++++-----
> 3 files changed, 11 insertions(+), 25 deletions(-)
>
> diff --git a/configure b/configure
> index a5fa472c64..51b6164f69 100755
> --- a/configure
> +++ b/configure
> @@ -3923,20 +3923,6 @@ if test "$modules" = yes; then
> fi
> fi
>
> -##########################################
> -# pixman support probe
> -
> -if test "$softmmu" = "no"; then
> - pixman_cflags=
> - pixman_libs=
> -elif $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then
> - pixman_cflags=$($pkg_config --cflags pixman-1)
> - pixman_libs=$($pkg_config --libs pixman-1)
> -else
> - error_exit "pixman >= 0.21.8 not present." \
> - "Please install the pixman devel package."
> -fi
The "else" part now got completely lost, didn't it? pixman is required
for building the softmmu targets, so we should error out if configure is
run with a softmmu target on systems where pixman is not installed.
Maybe you can simply replace the above check with:
if test "$softmmu" = "yes" && ! $pkg_config --atleast-version=0.21.8
pixman-1 > /dev/null 2>&1; then
error_exit "pixman >= 0.21.8 not present." \
"Please install the pixman devel package."
fi
?
Thomas
> ##########################################
> # libmpathpersist probe
>
> @@ -6649,8 +6635,8 @@ echo_version() {
> fi
> }
>
> -# prepend pixman and ftd flags after all config tests are done
> -QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS"
> +# prepend ftd flags after all config tests are done
> +QEMU_CFLAGS="$fdt_cflags $QEMU_CFLAGS"
> QEMU_LDFLAGS="$fdt_ldflags $QEMU_LDFLAGS"
>
> config_host_mak="config-host.mak"
> @@ -8053,9 +8039,6 @@ fi
>
> done # for target in $targets
>
> -echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak
> -echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak
> -
> if [ "$fdt" = "git" ]; then
> subdirs="$subdirs dtc"
> fi
> diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/meson.build
> index 8df4c13bc5..7d9b29da8b 100644
> --- a/contrib/vhost-user-gpu/meson.build
> +++ b/contrib/vhost-user-gpu/meson.build
> @@ -1,5 +1,6 @@
> if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \
> - and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host
> + and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \
> + and pixman.found()
> executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
> link_with: libvhost_user,
> dependencies: [qemuutil, pixman, gbm, virgl],
> diff --git a/meson.build b/meson.build
> index bcd39b39da..57c2fe2b65 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -114,8 +114,11 @@ if 'CONFIG_GNUTLS' in config_host
> gnutls = declare_dependency(compile_args: config_host['GNUTLS_CFLAGS'].split(),
> link_args: config_host['GNUTLS_LIBS'].split())
> endif
> -pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(),
> - link_args: config_host['PIXMAN_LIBS'].split())
> +pixman = not_found
> +if have_system or have_tools
> + pixman = dependency('pixman', required: have_system, version:'>=0.21.8',
> + static: enable_static)
> +endif
> pam = not_found
> if 'CONFIG_AUTH_PAM' in config_host
> pam = cc.find_library('pam')
> @@ -1094,9 +1097,7 @@ if have_tools
> if 'CONFIG_VHOST_USER' in config_host
> subdir('contrib/libvhost-user')
> subdir('contrib/vhost-user-blk')
> - if 'CONFIG_LINUX' in config_host
> - subdir('contrib/vhost-user-gpu')
> - endif
> + subdir('contrib/vhost-user-gpu')
> subdir('contrib/vhost-user-input')
> subdir('contrib/vhost-user-scsi')
> endif
> @@ -1303,6 +1304,7 @@ summary_info += {'SDL image support': sdl_image.found()}
> # TODO: add back version
> summary_info += {'GTK support': config_host.has_key('CONFIG_GTK')}
> summary_info += {'GTK GL support': config_host.has_key('CONFIG_GTK_GL')}
> +summary_info += {'pixman': pixman.found()}
> # TODO: add back version
> summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')}
> summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
>
next prev parent reply other threads:[~2020-08-27 4:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 7:02 [PATCH] meson: move pixman detection to meson Paolo Bonzini
2020-08-27 4:52 ` Thomas Huth [this message]
2020-08-27 6:14 ` Paolo Bonzini
2020-08-27 7:28 ` Thomas Huth
2020-08-27 8:19 ` Paolo Bonzini
2020-08-27 8:28 ` Thomas Huth
2020-08-30 13:31 ` Stefan Weil
2020-08-30 15:39 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cc6af807-a24f-42bb-b1f7-8c8c5e59200b@redhat.com \
--to=thuth@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rkitover@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).