From 7e00eb9b98ba98963a669c72e43b06c41917f368 Mon Sep 17 00:00:00 2001 From: aliguori Date: Sat, 2 Aug 2008 01:57:02 +0000 Subject: [PATCH] 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 Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4982 c046a42c-6fe2-441c-8c8c-71466251a162 --- Makefile | 4 ++++ nbd.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index fcf8a58..0472e16 100644 --- 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 e9308ee..9bebe4a 100644 --- a/nbd.c +++ b/nbd.c @@ -22,6 +22,9 @@ #include #include #include +#ifdef __sun__ +#include +#endif #include #include #include -- 2.7.4