* [PATCH] configure / meson: Move the GBM handling to meson.build
@ 2021-07-13 11:15 Thomas Huth
2021-07-13 12:29 ` Paolo Bonzini
2021-07-14 10:53 ` Paolo Bonzini
0 siblings, 2 replies; 5+ messages in thread
From: Thomas Huth @ 2021-07-13 11:15 UTC (permalink / raw)
To: qemu-devel, Paolo Bonzini; +Cc: Gerd Hoffmann
The GBM library detection does not need to be in the configure script,
since it does not have any user-facing options (there are no
--enable-gbm or --disable-gbm switches). Let's move it to meson.build
instead, so we don't have to clutter config-host.mak with the related
switches.
Additionally, only check for GBM if it is really required, i.e. if we
either compile with OpenGL or with virglrenderer support.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
configure | 14 --------------
contrib/vhost-user-gpu/meson.build | 5 ++---
meson.build | 13 +++++++------
3 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/configure b/configure
index 85db248ac1..7d86b481e2 100755
--- a/configure
+++ b/configure
@@ -3372,13 +3372,6 @@ esac
##########################################
# opengl probe (for sdl2, gtk)
-gbm="no"
-if $pkg_config gbm; then
- gbm_cflags="$($pkg_config --cflags gbm)"
- gbm_libs="$($pkg_config --libs gbm)"
- gbm="yes"
-fi
-
if test "$opengl" != "no" ; then
epoxy=no
if $pkg_config epoxy; then
@@ -4673,13 +4666,6 @@ if test "$opengl" = "yes" ; then
echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
fi
-if test "$gbm" = "yes" ; then
- echo "CONFIG_GBM=y" >> $config_host_mak
- echo "GBM_LIBS=$gbm_libs" >> $config_host_mak
- echo "GBM_CFLAGS=$gbm_cflags" >> $config_host_mak
-fi
-
-
if test "$avx2_opt" = "yes" ; then
echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
fi
diff --git a/contrib/vhost-user-gpu/meson.build b/contrib/vhost-user-gpu/meson.build
index 4cb52a91d7..92c8f3a86a 100644
--- a/contrib/vhost-user-gpu/meson.build
+++ b/contrib/vhost-user-gpu/meson.build
@@ -1,6 +1,5 @@
-if 'CONFIG_TOOLS' in config_host and virgl.found() \
- and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \
- and pixman.found()
+if 'CONFIG_TOOLS' in config_host and virgl.found() and gbm.found() \
+ and 'CONFIG_LINUX' in config_host and pixman.found()
executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, opengl],
install: true,
diff --git a/meson.build b/meson.build
index 6cd2dc582a..be7a7b0f69 100644
--- a/meson.build
+++ b/meson.build
@@ -469,11 +469,6 @@ if not get_option('zstd').auto() or have_block
required: get_option('zstd'),
method: 'pkg-config', kwargs: static_kwargs)
endif
-gbm = not_found
-if 'CONFIG_GBM' in config_host
- gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
- link_args: config_host['GBM_LIBS'].split())
-endif
virgl = not_found
if not get_option('virglrenderer').auto() or have_system
virgl = dependency('virglrenderer',
@@ -813,11 +808,16 @@ coreaudio = not_found
if 'CONFIG_AUDIO_COREAUDIO' in config_host
coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split())
endif
+
opengl = not_found
if 'CONFIG_OPENGL' in config_host
opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
link_args: config_host['OPENGL_LIBS'].split())
endif
+gbm = not_found
+if virgl.found() or 'CONFIG_OPENGL' in config_host
+ gbm = dependency('gbm', method: 'pkg-config', kwargs: static_kwargs)
+endif
gnutls = not_found
if not get_option('gnutls').auto() or have_system
@@ -1214,6 +1214,7 @@ config_host_data.set('CONFIG_MPATH', mpathpersist.found())
config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
config_host_data.set('CONFIG_CURL', curl.found())
config_host_data.set('CONFIG_CURSES', curses.found())
+config_host_data.set('CONFIG_GBM', gbm.found())
config_host_data.set('CONFIG_GLUSTERFS', glusterfs.found())
if glusterfs.found()
config_host_data.set('CONFIG_GLUSTERFS_XLATOR_OPT', glusterfs.version().version_compare('>=4'))
@@ -3036,7 +3037,7 @@ summary_info += {'U2F support': u2f.found()}
summary_info += {'libusb': libusb.found()}
summary_info += {'usb net redir': usbredir.found()}
summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
-summary_info += {'GBM': config_host.has_key('CONFIG_GBM')}
+summary_info += {'GBM': gbm.found()}
summary_info += {'libiscsi support': libiscsi.found()}
summary_info += {'libnfs support': libnfs.found()}
if targetos == 'windows'
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] configure / meson: Move the GBM handling to meson.build
2021-07-13 11:15 [PATCH] configure / meson: Move the GBM handling to meson.build Thomas Huth
@ 2021-07-13 12:29 ` Paolo Bonzini
2021-07-14 7:12 ` Thomas Huth
2021-07-14 10:53 ` Paolo Bonzini
1 sibling, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2021-07-13 12:29 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: Gerd Hoffmann
On 13/07/21 13:15, Thomas Huth wrote:
> The GBM library detection does not need to be in the configure script,
> since it does not have any user-facing options (there are no
> --enable-gbm or --disable-gbm switches). Let's move it to meson.build
> instead, so we don't have to clutter config-host.mak with the related
> switches.
>
> Additionally, only check for GBM if it is really required, i.e. if we
> either compile with OpenGL or with virglrenderer support.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] configure / meson: Move the GBM handling to meson.build
2021-07-13 12:29 ` Paolo Bonzini
@ 2021-07-14 7:12 ` Thomas Huth
2021-07-14 8:52 ` Thomas Huth
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2021-07-14 7:12 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: Gerd Hoffmann
On 13/07/2021 14.29, Paolo Bonzini wrote:
> On 13/07/21 13:15, Thomas Huth wrote:
>> The GBM library detection does not need to be in the configure script,
>> since it does not have any user-facing options (there are no
>> --enable-gbm or --disable-gbm switches). Let's move it to meson.build
>> instead, so we don't have to clutter config-host.mak with the related
>> switches.
>>
>> Additionally, only check for GBM if it is really required, i.e. if we
>> either compile with OpenGL or with virglrenderer support.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>
> Queued, thanks.
Drat, sorry, I sent it out too early, one of the CI pipelines finally failed:
https://gitlab.com/thuth/qemu/-/jobs/1420060624#L100
... thus please drop it again, I have to fix that first.
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] configure / meson: Move the GBM handling to meson.build
2021-07-14 7:12 ` Thomas Huth
@ 2021-07-14 8:52 ` Thomas Huth
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2021-07-14 8:52 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: Gerd Hoffmann
On 14/07/2021 09.12, Thomas Huth wrote:
> On 13/07/2021 14.29, Paolo Bonzini wrote:
>> On 13/07/21 13:15, Thomas Huth wrote:
>>> The GBM library detection does not need to be in the configure script,
>>> since it does not have any user-facing options (there are no
>>> --enable-gbm or --disable-gbm switches). Let's move it to meson.build
>>> instead, so we don't have to clutter config-host.mak with the related
>>> switches.
>>>
>>> Additionally, only check for GBM if it is really required, i.e. if we
>>> either compile with OpenGL or with virglrenderer support.
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>
>> Queued, thanks.
>
> Drat, sorry, I sent it out too early, one of the CI pipelines finally failed:
>
> https://gitlab.com/thuth/qemu/-/jobs/1420060624#L100
>
> ... thus please drop it again, I have to fix that first.
It was just a missing "required: false" in the gbm dependency() statement.
I've just sent out a v2 which should be fine now.
Thomas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] configure / meson: Move the GBM handling to meson.build
2021-07-13 11:15 [PATCH] configure / meson: Move the GBM handling to meson.build Thomas Huth
2021-07-13 12:29 ` Paolo Bonzini
@ 2021-07-14 10:53 ` Paolo Bonzini
1 sibling, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2021-07-14 10:53 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: Gerd Hoffmann
On 13/07/21 13:15, Thomas Huth wrote:
> +if virgl.found() or 'CONFIG_OPENGL' in config_host
> + gbm = dependency('gbm', method: 'pkg-config', kwargs: static_kwargs)
> +endif
>
> gnutls = not_found
Tweaked to add "required: false".
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-07-14 10:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-13 11:15 [PATCH] configure / meson: Move the GBM handling to meson.build Thomas Huth
2021-07-13 12:29 ` Paolo Bonzini
2021-07-14 7:12 ` Thomas Huth
2021-07-14 8:52 ` Thomas Huth
2021-07-14 10:53 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.