configure / meson: Fix building with --disable-system and virglrenderer
PATCH 1/1 configure / meson: Fix building with --disable-system and virglrenderer
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 add a proper CONFIG_PIXMAN switch so we can skip the build of vhost-user-gpu when pixman is not installed or too old.
--- configure | 20 +++++++++++++------- contrib/vhost-user-gpu/meson.build | 3 ++- meson.build | 12 +++++++----- 3 files changed, 22 insertions(+), 13 deletions(-)
configure +13 -7
@@ -3925,15 +3925,18 @@ 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 +if $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then + pixman="yes" pixman_cflags=$($pkg_config --cflags pixman-1) pixman_libs=$($pkg_config --libs pixman-1) else + pixman="no" + pixman_cflags= + pixman_libs= +fi +if test "$softmmu" = "yes" && test "$pixman" = "no"; then error_exit "pixman >= 0.21.8 not present." \ - "Please install the pixman devel package." + "Please install the pixman devel package or use --disable-system." fi ##########################################
@@ -8054,8 +8057,11 @@ fi done # for target in $targets -echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak -echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak +if test "$pixman" = "yes"; then + echo "CONFIG_PIXMAN=y" >> $config_host_mak + echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak + echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak +fi if [ "$fdt" = "git" ]; then subdirs="$subdirs dtc"
contrib/vhost-user-gpu/meson.build +2 -1
@@ -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 'CONFIG_PIXMAN' in config_host executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'), link_with: libvhost_user, dependencies: [qemuutil, pixman, gbm, virgl],
meson.build +7 -5
@@ -113,8 +113,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 'CONFIG_PIXMAN' in config_host + pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(), + link_args: config_host['PIXMAN_LIBS'].split()) +endif pam = not_found if 'CONFIG_AUTH_PAM' in config_host pam = cc.find_library('pam')
@@ -1095,9 +1098,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
@@ -1278,6 +1279,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 support': config_host.has_key('CONFIG_PIXMAN')} # TODO: add back version summary_info += {'VTE support': config_host.has_key('CONFIG_VTE')} summary_info += {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
Signature · 1 line
2.18.2
Sorry, I wrote all this thinking that pixman was mandatory. We could already move the code to detect pixman to meson.build (see docs/devel/build-system.rst), but unless I see a patch for that in 1-2 days I will queue this one.
Paolo
Il mar 25 ago 2020, 18:26 Thomas Huth <[email protected]> ha scritto:
Quoted 121 lines
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 add a proper
CONFIG_PIXMANswitch so we can skip the build of vhost-user-gpu when pixman is not installed or too old.Fixes 9b52b17ba5 ("configure: Allow to build tools without pixman")Reported-by Rafael Kitover <[email protected]>Reported-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Thomas Huth <[email protected]>--- configure | 20 +++++++++++++------- contrib/vhost-user-gpu/meson.build | 3 ++- meson.build | 12 +++++++----- 3 files changed, 22 insertions(+), 13 deletions(-)configure +13
-7@@ -3925,15 +3925,18 @@ 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 +if $pkg_config --atleast-version=0.21.8 pixman-1 > /dev/null 2>&1; then + pixman="yes" pixman_cflags=$($pkg_config --cflags pixman-1) pixman_libs=$($pkg_config --libs pixman-1) else + pixman="no" + pixman_cflags= + pixman_libs= +fi +if test "$softmmu" = "yes" && test "$pixman" = "no"; then error_exit "pixman >= 0.21.8 not present." \ - "Please install the pixman devel package." + "Please install the pixman devel package or use --disable-system." fi ##########################################@@ -8054,8 +8057,11 @@ fi done # for target in $targets -echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak -echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak +if test "$pixman" = "yes"; then + echo "CONFIG_PIXMAN=y" >> $config_host_mak + echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak + echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak +fi if [ "$fdt" = "git" ]; then subdirs="$subdirs dtc"contrib/vhost-user-gpu/meson.build +2
-1@@ -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 'CONFIG_PIXMAN' in config_host executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'), link_with: libvhost_user,dependencies: [qemuutil, pixman, gbm, virgl],
meson.build +3
-2@@ -113,8 +113,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 'CONFIG_PIXMAN' in config_host + pixman = declare_dependency(compile_args:config_host['PIXMAN_CFLAGS'].split(),
+link_args:
config_host['PIXMAN_LIBS'].split())meson.build +3
-3+endif pam = not_found if 'CONFIG_AUTH_PAM' in config_host pam = cc.find_library('pam')@@ -1095,9 +1098,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@@ -1278,6 +1279,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 support': config_host.has_key('CONFIG_PIXMAN')}# TODO: add back version
summary_info+= {'VTE support':config_host.has_key('CONFIG_VTE')}
summary_info+= {'TLS priority': config_host['CONFIG_TLS_PRIORITY']}
--
2.18.2