1
0
mirror of https://gitlab.com/qemu-project/qemu synced 2024-07-08 20:17:27 +00:00

meson: move pixman detection to meson

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>
This commit is contained in:
Paolo Bonzini 2020-08-26 08:22:58 +02:00
parent fb648e9cac
commit b7612f45da
4 changed files with 15 additions and 26 deletions

21
configure vendored
View File

@ -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
##########################################
# 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"
@ -8056,9 +8042,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

View File

@ -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],

View File

@ -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 have_system or have_tools
pixman = dependency('pixman-1', 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')
@ -981,6 +984,7 @@ foreach target : target_dirs
lib = static_library('qemu-' + target,
sources: arch_srcs + genh,
dependencies: arch_deps,
objects: objects,
include_directories: target_inc,
c_args: c_args,
@ -1102,9 +1106,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
@ -1285,6 +1287,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']}

View File

@ -1,3 +1,6 @@
softmmu_ss.add(pixman)
specific_ss.add(pixman) # for the include path
softmmu_ss.add(files(
'console.c',
'cursor.c',
@ -9,7 +12,6 @@ softmmu_ss.add(files(
'keymaps.c',
'qemu-pixman.c',
))
softmmu_ss.add(pixman)
softmmu_ss.add(when: 'CONFIG_LINUX', if_true: files('input-linux.c'))
softmmu_ss.add(when: 'CONFIG_SPICE', if_true: files('spice-core.c', 'spice-input.c', 'spice-display.c'))