]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Fix compilation of nbd on Solaris (Andreas Faerber)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 2 Aug 2008 01:57:02 +0000 (01:57 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Sat, 2 Aug 2008 01:57:02 +0000 (01:57 +0000)
Compilation of QEMU is currently broken on Solaris due to nbd's use of _IO and
due to network libraries not being linked into qemu-img.

The attached patch adds the appropriate libraries (copied from Makefile.target)
and includes an additional Sun-specific header for _IO.

With these fixes it compiles okay, on OpenSolaris snv_93 (amd64).

Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4982 c046a42c-6fe2-441c-8c8c-71466251a162

Makefile
nbd.c

index fcf8a5820f2d16f90afba5113353a82a4e543eac..0472e169c6745f35d45681fefc9c54b4d56712a6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,10 @@ endif
 
 LIBS+=$(AIOLIBS)
 
+ifdef CONFIG_SOLARIS
+LIBS+=-lsocket -lnsl -lresolv
+endif
+
 all: $(TOOLS) $(DOCS) recurse-all 
 
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
diff --git a/nbd.c b/nbd.c
index e9308ee0421c8bc65400bfe6789d4ae79ffa0b81..9bebe4a9bb573651948bd8449f9913b42e23bc9d 100644 (file)
--- a/nbd.c
+++ b/nbd.c
@@ -22,6 +22,9 @@
 #include <errno.h>
 #include <string.h>
 #include <sys/ioctl.h>
+#ifdef __sun__
+#include <sys/ioccom.h>
+#endif
 #include <ctype.h>
 #include <inttypes.h>
 #include <sys/socket.h>