blob: 8bffc312939067f5b7e258deef385e584927c780 [file] [log] [blame]
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001From 464cfc64201b21386030b8f353fe9724a3413a85 Mon Sep 17 00:00:00 2001
2From: Paolo Bonzini <pbonzini@redhat.com>
3Date: Wed, 5 May 2021 10:15:34 -0400
4Subject: [PATCH] configure: fix detection of gdbus-codegen
5
6"pkg-config --variable=gdbus_codegen gio-2.0" returns "gdbus-codegen",
7and it does not pass test -x (which does not walk the path).
8
9Meson 0.58.0 notices that something is iffy, as the dbus_vmstate1
10assignment in tests/qtest/meson.build uses an empty string as the
11command, and fails very eloquently:
12
13../tests/qtest/meson.build:92:2: ERROR: No program name specified.
14
15Use the "has" function instead of test -x, and fix the generation
16of config-host.mak since meson.build expects that GDBUS_CODEGEN
17is absent, rather than empty, if the tool is unavailable.
18
19Reported-by: Sebastian Mitterle <smitterl@redhat.com>
20Fixes: #178
21Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
22Upstream-Status: Backport [https://git.qemu.org/?p=qemu.git;a=commitdiff;h=5ecfb76ccc056eb6127e44268e475827ae73b9e0]
23(not in 6.0.0, should be kept when upgrading)
24Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
25---
26 configure | 4 +++-
27 1 file changed, 3 insertions(+), 1 deletion(-)
28
29Index: qemu-6.0.0/configure
30===================================================================
31--- qemu-6.0.0.orig/configure
32+++ qemu-6.0.0/configure
33@@ -3366,7 +3366,7 @@ if ! test "$gio" = "no"; then
34 gio_cflags=$($pkg_config --cflags gio-2.0)
35 gio_libs=$($pkg_config --libs gio-2.0)
36 gdbus_codegen=$($pkg_config --variable=gdbus_codegen gio-2.0)
37- if [ ! -x "$gdbus_codegen" ]; then
38+ if ! has "$gdbus_codegen"; then
39 gdbus_codegen=
40 fi
41 # Check that the libraries actually work -- Ubuntu 18.04 ships
42@@ -5704,6 +5704,8 @@ if test "$gio" = "yes" ; then
43 echo "CONFIG_GIO=y" >> $config_host_mak
44 echo "GIO_CFLAGS=$gio_cflags" >> $config_host_mak
45 echo "GIO_LIBS=$gio_libs" >> $config_host_mak
46+fi
47+if test "$gdbus_codegen" != "" ; then
48 echo "GDBUS_CODEGEN=$gdbus_codegen" >> $config_host_mak
49 fi
50 echo "CONFIG_TLS_PRIORITY=\"$tls_priority\"" >> $config_host_mak