Skip to contentSkip to conversation

Make qemu-nbd compile on OS X

PATCH In review C.W. Betts 2 participants 2 messages Jun 2, 2008

lore
Share & tools
lore

C.W. Betts

author
#0 lore raw

PATCH 1/1 Make qemu-nbd compile on OS X

The following is a patch to make qemu-nbd compile on Mac OS X Leopard (any other versions are untested)

qemu-nbd.c +4 -0
Index: qemu-nbd.c
===================================================================
@@ -21,7 +21,11 @@
 #include "block_int.h"
 #include "nbd.h"
 
+#ifdef __APPLE__
+#include <malloc/malloc.h>
+#else
 #include <malloc.h>
+#endif
 #include <stdarg.h>
 #include <stdio.h>
 #include <getopt.h>
#1 lore raw
Quoted 8 lines · C.W. Betts

The following is a patch to make qemu-nbd compile on Mac OS X Leopard (any other versions are untested)

Index: qemu-nbd.c
===================================================================

qemu-nbd.c +0 -0
@@ -21,7 +21,11 @@
 #include "block_int.h"

qemu-nbd.c line 31

Quoted 10 lines
qemu-nbd.c +4 -0
 #include "nbd.h"
 
+#ifdef __APPLE__
+#include <malloc/malloc.h>
+#else
 #include <malloc.h>
+#endif
 #include <stdarg.h>
 #include <stdio.h>
 #include <getopt.h>

You must also modify the configure: qemu-nbd is only compiled for linux (because others are not tested). if test expr "$target_list" : ".*softmmu.*" != 0 ; then
tools="qemu-img\$(EXESUF) $tools"
if [ "$linux" = "yes" ] ; then

      tools="qemu-nbd\$(EXESUF) $tools"

fi
fi
Regards,
Laurent
----------------------- Laurent Vivier ---------------------- "The best way to predict the future is to invent it."
- Alan Kay