Commit 7e00eb9b98ba98963a669c72e43b06c41917f368

Authored by aliguori
1 parent 0fd70f8f

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

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
Showing 2 changed files with 7 additions and 0 deletions
Makefile
... ... @@ -24,6 +24,10 @@ endif
24 24  
25 25 LIBS+=$(AIOLIBS)
26 26  
  27 +ifdef CONFIG_SOLARIS
  28 +LIBS+=-lsocket -lnsl -lresolv
  29 +endif
  30 +
27 31 all: $(TOOLS) $(DOCS) recurse-all
28 32  
29 33 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
... ...
... ... @@ -22,6 +22,9 @@
22 22 #include <errno.h>
23 23 #include <string.h>
24 24 #include <sys/ioctl.h>
  25 +#ifdef __sun__
  26 +#include <sys/ioccom.h>
  27 +#endif
25 28 #include <ctype.h>
26 29 #include <inttypes.h>
27 30 #include <sys/socket.h>
... ...