qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-1.5] configure: Detect uuid on MacOSX (fixes compile failure)
@ 2013-05-14 20:36 Peter Maydell
  2013-05-16 12:50 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Maydell @ 2013-05-14 20:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, Andreas Färber, patches

Commit 7791dba3ec broke compilation on MacOSX, because it introduced
a new include of util.h. On MacOSX this includes pwd.h which in turn
includes the system uuid/uuid.h, which causes a compile failure if
QEMU was configured without CONFIG_UUID due to a conflict between
the system header and our fallback versions:
  block/vdi.c:124:20: error: static declaration of 'uuid_generate'
  follows non-static declaration
  static inline void uuid_generate(uuid_t out)
                     ^
  /usr/include/uuid/uuid.h:63:6: note: previous declaration is here
  void uuid_generate(uuid_t out);
       ^

Fix this breakage by improving configure's check for uuid to work on
MacOSX (where there is no need to link in a separate libuuid).

Note that if the user explicitly runs configure with '--disable-uuid'
on MacOSX then QEMU will fail to compile.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
For 1.5 because the commit that broke us just went in today :-)

 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index cab6332..29b5589 100755
--- a/configure
+++ b/configure
@@ -1948,6 +1948,8 @@ fi
 
 ##########################################
 # uuid_generate() probe, used for vdi block driver
+# Note that on some systems (notably MacOSX) no extra library
+# need be linked to get the uuid functions.
 if test "$uuid" != "no" ; then
   uuid_libs="-luuid"
   cat > $TMPC << EOF
@@ -1959,7 +1961,9 @@ int main(void)
     return 0;
 }
 EOF
-  if compile_prog "" "$uuid_libs" ; then
+  if compile_prog "" "" ; then
+    uuid="yes"
+  elif compile_prog "" "$uuid_libs" ; then
     uuid="yes"
     libs_softmmu="$uuid_libs $libs_softmmu"
     libs_tools="$uuid_libs $libs_tools"
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH for-1.5] configure: Detect uuid on MacOSX (fixes compile failure)
  2013-05-14 20:36 [Qemu-devel] [PATCH for-1.5] configure: Detect uuid on MacOSX (fixes compile failure) Peter Maydell
@ 2013-05-16 12:50 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2013-05-16 12:50 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, None, patches

Applied.  Thanks.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-16 12:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14 20:36 [Qemu-devel] [PATCH for-1.5] configure: Detect uuid on MacOSX (fixes compile failure) Peter Maydell
2013-05-16 12:50 ` Anthony Liguori

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).