qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>, "Alexey Pavlov" <alexpux@gmail.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Алексей Павлов" <alexey.pawlow@gmail.com>,
	"Метлицкий Юрий Викторович" <winaes@narod.ru>,
	"Biswapriyo Nath" <nathbappai@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Youry Metlitsky" <winaes@yandex.ru>
Subject: [PATCH 2/3] configure: Fix building with SASL on Windows
Date: Sat,  7 Mar 2020 18:22:21 +0100	[thread overview]
Message-ID: <20200307172222.14764-3-philmd@redhat.com> (raw)
In-Reply-To: <20200307172222.14764-1-philmd@redhat.com>

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.
Add the definition to vnc_sasl_cflags if we are uing MinGW.

[*] https://github.com/cyrusimap/cyrus-sasl/blob/cyrus-sasl-2.1.27/include/sasl.h#L187

Cc: Alexey Pavlov <alexpux@gmail.com>
Cc: Biswapriyo Nath <nathbappai@gmail.com>
Cc: Youry Metlitsky <winaes@yandex.ru>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 configure | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 0c2dd1eb08..0bc87ce42a 100755
--- a/configure
+++ b/configure
@@ -3375,7 +3375,13 @@ 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=""
+  if test "$mingw32" = "yes" && test "$iovec" != "yes"; then
+    # QEMU defines struct iovec in "qemu/osdep.h",
+    # we don't want libsasl to redefine it in <sasl/sasl.h>.
+    vnc_sasl_cflags="-DSTRUCT_IOVEC_DEFINED"
+  else
+    vnc_sasl_cflags=""
+  fi
   vnc_sasl_libs="-lsasl2"
   if compile_prog "$vnc_sasl_cflags" "$vnc_sasl_libs" ; then
     vnc_sasl=yes
-- 
2.21.1



  parent reply	other threads:[~2020-03-07 17:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-07 17:22 [PATCH 0/3] buildsys: Fix building with SASL on Windows Philippe Mathieu-Daudé
2020-03-07 17:22 ` [PATCH 1/3] configure: Check for <sys/uio.h> header before external libraries Philippe Mathieu-Daudé
2020-03-07 17:22 ` Philippe Mathieu-Daudé [this message]
2020-03-09  9:57   ` [PATCH 2/3] configure: Fix building with SASL on Windows Daniel P. Berrangé
2020-03-09 10:47     ` Philippe Mathieu-Daudé
2020-03-07 17:22 ` [PATCH 3/3] tests/docker: Install SASL library to extend code coverage on amd64 Philippe Mathieu-Daudé
2020-03-09  9:52   ` Daniel P. Berrangé
2020-03-07 17:51 ` [PATCH 0/3] buildsys: Fix building with SASL on Windows no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200307172222.14764-3-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=alexey.pawlow@gmail.com \
    --cc=alexpux@gmail.com \
    --cc=berrange@redhat.com \
    --cc=fam@euphon.net \
    --cc=nathbappai@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=winaes@narod.ru \
    --cc=winaes@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).