[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] blktap2: Build libblktapctl.so



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1276154845 -3600
# Node ID 556ece996c0eca98fa50db449fed899973c00a50
# Parent  9abf7f50fdc42a80c677c2773b16e1b180033f89
blktap2: Build libblktapctl.so

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
---
 tools/Rules.mk                  |    4 ++++
 tools/blktap2/control/Makefile  |   23 ++++++++++++++++-------
 tools/blktap2/control/tap-ctl.h |    3 +--
 3 files changed, 21 insertions(+), 9 deletions(-)

diff -r 9abf7f50fdc4 -r 556ece996c0e tools/Rules.mk
--- a/tools/Rules.mk    Thu Jun 10 08:26:42 2010 +0100
+++ b/tools/Rules.mk    Thu Jun 10 08:27:25 2010 +0100
@@ -13,6 +13,7 @@ XEN_LIBXC          = $(XEN_ROOT)/tools/l
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
 XEN_LIBXENSTAT     = $(XEN_ROOT)/tools/xenstat/libxenstat/src
+XEN_BLKTAP2        = $(XEN_ROOT)/tools/blktap2
 
 CFLAGS_include = -I$(XEN_INCLUDE)
 
@@ -24,6 +25,9 @@ LDFLAGS_libxenguest = -L$(XEN_LIBXC) -lx
 
 CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_include)
 LDFLAGS_libxenstore = -L$(XEN_XENSTORE) -lxenstore
+
+CFLAGS_libblktapctl = -I$(XEN_BLKTAP2)/control -I$(XEN_BLKTAP2)/include 
$(CFLAGS_include)
+LDFLAGS_libblktapctl = -L$(XEN_BLKTAP2)/control -lblktapctl
 
 X11_LDPATH = -L/usr/X11R6/$(LIBLEAFDIR)
 
diff -r 9abf7f50fdc4 -r 556ece996c0e tools/blktap2/control/Makefile
--- a/tools/blktap2/control/Makefile    Thu Jun 10 08:26:42 2010 +0100
+++ b/tools/blktap2/control/Makefile    Thu Jun 10 08:27:25 2010 +0100
@@ -30,25 +30,34 @@ CTL_OBJS  += tap-ctl-major.o
 CTL_OBJS  += tap-ctl-major.o
 CTL_OBJS  += tap-ctl-check.o
 
-OBJS = $(CTL_OBJS)
-LIBS = libblktapctl.a
+CTL_PICS  = $(patsubst %.o,%.opic,$(CTL_OBJS))
+
+OBJS = $(CTL_OBJS) tap-ctl.o
+PICS = $(CTL_PICS)
+
+LIBS = libblktapctl.a libblktapctl.so
+IBIN = tap-ctl
 
 all: build
 
-build: $(IBIN)
+build: $(IBIN) $(LIBS)
 
-tap-ctl: tap-ctl.o libblktapctl.a
+tap-ctl: tap-ctl.o libblktapctl.so
        $(CC) $(CFLAGS) -o $@ $^
 
 libblktapctl.a: $(CTL_OBJS)
-       ar r $@ $^
+       $(AR) r $@ $^
 
-install: all
+libblktapctl.so: $(CTL_PICS)
+       $(CC) $(CFLAGS) -fPIC -shared -rdynamic $^ -o $@
+
+install: $(IBIN) $(LIBS)
        $(INSTALL_DIR) -p $(DESTDIR)$(SBINDIR)
        $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(SBINDIR)
+       $(INSTALL_PROG) $(LIBS) $(DESTDIR)$(LIBDIR)
 
 clean:
-       rm -f $(OBJS) $(DEPS) $(IBIN) $(LIBS)
+       rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIBS)
        rm -f *~
 
 .PHONY: all build clean install
diff -r 9abf7f50fdc4 -r 556ece996c0e tools/blktap2/control/tap-ctl.h
--- a/tools/blktap2/control/tap-ctl.h   Thu Jun 10 08:26:42 2010 +0100
+++ b/tools/blktap2/control/tap-ctl.h   Thu Jun 10 08:27:25 2010 +0100
@@ -30,8 +30,7 @@
 
 #include <syslog.h>
 #include <errno.h>
-
-#include "tapdisk-message.h"
+#include <tapdisk-message.h>
 
 extern int tap_ctl_debug;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.