[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/17] meson: move pixman detection to meson
From: |
Paolo Bonzini |
Subject: |
[PULL 08/17] meson: move pixman detection to meson |
Date: |
Thu, 27 Aug 2020 12:59:47 -0400 |
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>
---
configure | 21 ++-------------------
contrib/vhost-user-gpu/meson.build | 3 ++-
meson.build | 13 ++++++++-----
ui/meson.build | 4 +++-
4 files changed, 15 insertions(+), 26 deletions(-)
diff --git a/configure b/configure
index 0b78577236..9db9bb89b9 100755
--- a/configure
+++ b/configure
@@ -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
diff --git a/contrib/vhost-user-gpu/meson.build
b/contrib/vhost-user-gpu/meson.build
index 6c1459f54a..12d608c2e7 100644
--- a/contrib/vhost-user-gpu/meson.build
+++ b/contrib/vhost-user-gpu/meson.build
@@ -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],
diff --git a/meson.build b/meson.build
index b44901dfe1..86a6d13192 100644
--- a/meson.build
+++ b/meson.build
@@ -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']}
diff --git a/ui/meson.build b/ui/meson.build
index 018c5698bf..393c9bcb53 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -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'))
--
2.26.2
- [PULL 00/17] Meson fixes for 2020-08-27, Paolo Bonzini, 2020/08/27
- [PULL 01/17] trace: fix creation of systemtap files, Paolo Bonzini, 2020/08/27
- [PULL 02/17] meson: Build qemu-nbd on macOS again, Paolo Bonzini, 2020/08/27
- [PULL 03/17] meson: Don't make object files for dtrace on macOS, Paolo Bonzini, 2020/08/27
- [PULL 04/17] scripts/qemu-version.sh: Add missing space before ']', Paolo Bonzini, 2020/08/27
- [PULL 08/17] meson: move pixman detection to meson,
Paolo Bonzini <=
- [PULL 10/17] configure: add --ninja option, Paolo Bonzini, 2020/08/27
- [PULL 11/17] meson: cleanup xkbcommon detection, Paolo Bonzini, 2020/08/27
- [PULL 06/17] meson: Fix chardev-baum.so name, Paolo Bonzini, 2020/08/27
- [PULL 05/17] meson: Fix meson build with --enable-libdaxctl, Paolo Bonzini, 2020/08/27
- [PULL 09/17] meson: skip SDL2 detection if --disable-system, Paolo Bonzini, 2020/08/27
- [PULL 16/17] meson: set colorout to auto, Paolo Bonzini, 2020/08/27
- [PULL 15/17] meson: Mingw64 gcc doesn't recognize system include_type for sdl2, Paolo Bonzini, 2020/08/27
- [PULL 13/17] ninjatool: quote dollars in variables, Paolo Bonzini, 2020/08/27
- [PULL 07/17] configure: default to PIE disabled on Windows platforms, Paolo Bonzini, 2020/08/27
- [PULL 14/17] meson: fix relpath failure on Win32, Paolo Bonzini, 2020/08/27