From bd702ffc506b62623bb5c246f7b706be098038b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Mon, 9 Mar 2020 13:24:53 +0100 Subject: [PATCH] configure: Fix building with SASL on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The Simple Authentication and Security Layer (SASL) library re-defines the struct iovec on Win32 [*]. QEMU also re-defines it in "qemu/osdep.h". The two definitions then clash on a MinGW build. We can avoid the SASL definition by defining STRUCT_IOVEC_DEFINED. Since QEMU already defines 'struct iovec' if it is missing, add the definition to vnc_sasl_cflags to avoid SASL re-defining it. [*] https://github.com/cyrusimap/cyrus-sasl/blob/cyrus-sasl-2.1.27/include/sasl.h#L187 Cc: Alexey Pavlov Cc: Biswapriyo Nath Reported-by: Youry Metlitsky Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20200309122454.22551-2-philmd@redhat.com> Signed-off-by: Paolo Bonzini --- configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index a7f2c3edd8..44a70cfa8c 100755 --- a/configure +++ b/configure @@ -3367,7 +3367,9 @@ if test "$vnc" = "yes" && test "$vnc_sasl" != "no" ; then int main(void) { sasl_server_init(NULL, "qemu"); return 0; } EOF # Assuming Cyrus-SASL installed in /usr prefix - vnc_sasl_cflags="" + # QEMU defines struct iovec in "qemu/osdep.h", + # we don't want libsasl to redefine it in . + vnc_sasl_cflags="-DSTRUCT_IOVEC_DEFINED" vnc_sasl_libs="-lsasl2" if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then vnc_sasl=yes -- 2.30.2