configure, meson: convert virgl detection to meson

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2021-06-03 11:31:35 +02:00
parent c23d7b4e57
commit 587d59d6cc
4 changed files with 15 additions and 38 deletions

35
configure vendored
View File

@ -409,7 +409,7 @@ nettle="auto"
gcrypt="auto"
auth_pam="auto"
vte="auto"
virglrenderer="$default_feature"
virglrenderer="auto"
tpm="$default_feature"
libssh="$default_feature"
live_block_migration=${default_feature:-yes}
@ -1399,9 +1399,9 @@ for opt do
;;
--enable-vte) vte="enabled"
;;
--disable-virglrenderer) virglrenderer="no"
--disable-virglrenderer) virglrenderer="disabled"
;;
--enable-virglrenderer) virglrenderer="yes"
--enable-virglrenderer) virglrenderer="enabled"
;;
--disable-tpm) tpm="no"
;;
@ -4036,28 +4036,6 @@ EOF
fi
fi
##########################################
# virgl renderer probe
if test "$virglrenderer" != "no" ; then
cat > $TMPC << EOF
#include <virglrenderer.h>
int main(void) { virgl_renderer_poll(); return 0; }
EOF
virgl_cflags=$($pkg_config --cflags virglrenderer 2>/dev/null)
virgl_libs=$($pkg_config --libs virglrenderer 2>/dev/null)
virgl_version=$($pkg_config --modversion virglrenderer 2>/dev/null)
if $pkg_config virglrenderer >/dev/null 2>&1 && \
compile_prog "$virgl_cflags" "$virgl_libs" ; then
virglrenderer="yes"
else
if test "$virglrenderer" = "yes" ; then
feature_not_found "virglrenderer"
fi
virglrenderer="no"
fi
fi
##########################################
# capstone
@ -5466,11 +5444,6 @@ fi
if test "$have_copy_file_range" = "yes" ; then
echo "HAVE_COPY_FILE_RANGE=y" >> $config_host_mak
fi
if test "$virglrenderer" = "yes" ; then
echo "CONFIG_VIRGL=y" >> $config_host_mak
echo "VIRGL_CFLAGS=$virgl_cflags" >> $config_host_mak
echo "VIRGL_LIBS=$virgl_libs" >> $config_host_mak
fi
if test "$xen" = "enabled" ; then
echo "CONFIG_XEN_BACKEND=y" >> $config_host_mak
echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=$xen_ctrl_version" >> $config_host_mak
@ -6137,7 +6110,7 @@ if test "$skip_meson" = no; then
-Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \
-Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \
-Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \
-Dattr=$attr -Ddefault_devices=$default_devices \
-Dattr=$attr -Ddefault_devices=$default_devices -Dvirglrenderer=$virglrenderer \
-Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
-Dvhost_user_blk_server=$vhost_user_blk_server -Dmultiprocess=$multiprocess \
-Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi -Dbpf=$bpf\

View File

@ -61,7 +61,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_GPU')
hw_display_modules += {'virtio-gpu': virtio_gpu_ss}
virtio_gpu_gl_ss = ss.source_set()
virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRGL', opengl],
virtio_gpu_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', virgl, opengl],
if_true: [files('virtio-gpu-gl.c', 'virtio-gpu-virgl.c'), pixman, virgl])
hw_display_modules += {'virtio-gpu-gl': virtio_gpu_gl_ss}
endif
@ -75,7 +75,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_PCI')
hw_display_modules += {'virtio-gpu-pci': virtio_gpu_pci_ss}
virtio_gpu_pci_gl_ss = ss.source_set()
virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI', 'CONFIG_VIRGL', opengl],
virtio_gpu_pci_gl_ss.add(when: ['CONFIG_VIRTIO_GPU', 'CONFIG_VIRTIO_PCI', virgl, opengl],
if_true: [files('virtio-gpu-pci-gl.c'), pixman])
hw_display_modules += {'virtio-gpu-pci-gl': virtio_gpu_pci_gl_ss}
endif
@ -89,7 +89,7 @@ if config_all_devices.has_key('CONFIG_VIRTIO_VGA')
hw_display_modules += {'virtio-vga': virtio_vga_ss}
virtio_vga_gl_ss = ss.source_set()
virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', 'CONFIG_VIRGL', opengl],
virtio_vga_gl_ss.add(when: ['CONFIG_VIRTIO_VGA', virgl, opengl],
if_true: [files('virtio-vga-gl.c'), pixman])
hw_display_modules += {'virtio-vga-gl': virtio_vga_gl_ss}
endif

View File

@ -471,9 +471,11 @@ if 'CONFIG_GBM' in config_host
link_args: config_host['GBM_LIBS'].split())
endif
virgl = not_found
if 'CONFIG_VIRGL' in config_host
virgl = declare_dependency(compile_args: config_host['VIRGL_CFLAGS'].split(),
link_args: config_host['VIRGL_LIBS'].split())
if not get_option('virglrenderer').auto() or have_system
virgl = dependency('virglrenderer',
method: 'pkg-config',
required: get_option('virglrenderer'),
kwargs: static_kwargs)
endif
curl = not_found
if not get_option('curl').auto() or have_block
@ -2768,7 +2770,7 @@ summary_info += {'PAM': pam.found()}
summary_info += {'iconv support': iconv.found()}
summary_info += {'curses support': curses.found()}
# TODO: add back version
summary_info += {'virgl support': config_host.has_key('CONFIG_VIRGL')}
summary_info += {'virgl support': virgl.found()}
summary_info += {'curl support': curl.found()}
summary_info += {'Multipath support': mpathpersist.found()}
summary_info += {'VNC support': vnc.found()}

View File

@ -110,6 +110,8 @@ option('u2f', type : 'feature', value : 'auto',
description: 'U2F emulation support')
option('usb_redir', type : 'feature', value : 'auto',
description: 'libusbredir support')
option('virglrenderer', type : 'feature', value : 'auto',
description: 'virgl rendering support')
option('vnc', type : 'feature', value : 'enabled',
description: 'VNC server')
option('vnc_jpeg', type : 'feature', value : 'auto',