Skip to content

Commit 8bc5184

Browse files
committed
configure / meson: Move the GBM handling to meson.build
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. Message-Id: <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent 6c22853 commit 8bc5184

File tree

3 files changed

+10
-23
lines changed

3 files changed

+10
-23
lines changed

configure

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3451,13 +3451,6 @@ esac
34513451
##########################################
34523452
# opengl probe (for sdl2, gtk)
34533453

3454-
gbm="no"
3455-
if $pkg_config gbm; then
3456-
gbm_cflags="$($pkg_config --cflags gbm)"
3457-
gbm_libs="$($pkg_config --libs gbm)"
3458-
gbm="yes"
3459-
fi
3460-
34613454
if test "$opengl" != "no" ; then
34623455
epoxy=no
34633456
if $pkg_config epoxy; then
@@ -4688,13 +4681,6 @@ if test "$opengl" = "yes" ; then
46884681
echo "OPENGL_LIBS=$opengl_libs" >> $config_host_mak
46894682
fi
46904683

4691-
if test "$gbm" = "yes" ; then
4692-
echo "CONFIG_GBM=y" >> $config_host_mak
4693-
echo "GBM_LIBS=$gbm_libs" >> $config_host_mak
4694-
echo "GBM_CFLAGS=$gbm_cflags" >> $config_host_mak
4695-
fi
4696-
4697-
46984684
if test "$avx2_opt" = "yes" ; then
46994685
echo "CONFIG_AVX2_OPT=y" >> $config_host_mak
47004686
fi

contrib/vhost-user-gpu/meson.build

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
if 'CONFIG_TOOLS' in config_host and virgl.found() \
2-
and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \
3-
and pixman.found()
1+
if 'CONFIG_TOOLS' in config_host and virgl.found() and gbm.found() \
2+
and 'CONFIG_LINUX' in config_host and pixman.found()
43
executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
54
dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, opengl],
65
install: true,

meson.build

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,6 @@ if not get_option('zstd').auto() or have_block
472472
required: get_option('zstd'),
473473
method: 'pkg-config', kwargs: static_kwargs)
474474
endif
475-
gbm = not_found
476-
if 'CONFIG_GBM' in config_host
477-
gbm = declare_dependency(compile_args: config_host['GBM_CFLAGS'].split(),
478-
link_args: config_host['GBM_LIBS'].split())
479-
endif
480475
virgl = not_found
481476
if not get_option('virglrenderer').auto() or have_system
482477
virgl = dependency('virglrenderer',
@@ -816,11 +811,17 @@ coreaudio = not_found
816811
if 'CONFIG_AUDIO_COREAUDIO' in config_host
817812
coreaudio = declare_dependency(link_args: config_host['COREAUDIO_LIBS'].split())
818813
endif
814+
819815
opengl = not_found
820816
if 'CONFIG_OPENGL' in config_host
821817
opengl = declare_dependency(compile_args: config_host['OPENGL_CFLAGS'].split(),
822818
link_args: config_host['OPENGL_LIBS'].split())
823819
endif
820+
gbm = not_found
821+
if (have_system or have_tools) and (virgl.found() or opengl.found())
822+
gbm = dependency('gbm', method: 'pkg-config', required: false,
823+
kwargs: static_kwargs)
824+
endif
824825

825826
gnutls = not_found
826827
gnutls_crypto = not_found
@@ -1244,6 +1245,7 @@ config_host_data.set('CONFIG_MPATH', mpathpersist.found())
12441245
config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api)
12451246
config_host_data.set('CONFIG_CURL', curl.found())
12461247
config_host_data.set('CONFIG_CURSES', curses.found())
1248+
config_host_data.set('CONFIG_GBM', gbm.found())
12471249
config_host_data.set('CONFIG_GLUSTERFS', glusterfs.found())
12481250
if glusterfs.found()
12491251
config_host_data.set('CONFIG_GLUSTERFS_XLATOR_OPT', glusterfs.version().version_compare('>=4'))
@@ -3086,7 +3088,7 @@ summary_info += {'U2F support': u2f.found()}
30863088
summary_info += {'libusb': libusb.found()}
30873089
summary_info += {'usb net redir': usbredir.found()}
30883090
summary_info += {'OpenGL support': config_host.has_key('CONFIG_OPENGL')}
3089-
summary_info += {'GBM': config_host.has_key('CONFIG_GBM')}
3091+
summary_info += {'GBM': gbm.found()}
30903092
summary_info += {'libiscsi support': libiscsi.found()}
30913093
summary_info += {'libnfs support': libnfs.found()}
30923094
if targetos == 'windows'

0 commit comments

Comments
 (0)