Skip to contentSkip to conversation

[4982] Fix compilation of nbd on Solaris (Andreas Faerber)

Qemu-devel Anthony Liguori 1 participant 1 message Aug 2, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

Revision: 4982

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4982
Author:   aliguori
Date:     2008-08-02 01:57:02 +0000 (Sat, 02 Aug 2008)

Log Message:
-----------
Fix compilation of nbd on Solaris (Andreas Faerber)

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

Modified Paths:
--------------
trunk/Makefile
trunk/nbd.c

Modified: trunk/Makefile
===================================================================

Makefile +4 -0
@@ -24,6 +24,10 @@
 
 LIBS+=$(AIOLIBS)
 
+ifdef CONFIG_SOLARIS
+LIBS+=-lsocket -lnsl -lresolv
+endif
+
 all: $(TOOLS) $(DOCS) recurse-all 
 
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))

Modified: trunk/nbd.c
===================================================================

nbd.c +3 -0
@@ -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>