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

[Xen-devel] [PATCH 7 of 8] blktap3/vhd: Compile libvhd



This patch imports from blktap2 the Makefile that compiles libvhd, with changes
coming from blktap2.5. I have left out vhd-util related stuff as they are not
necessary at this point, they will be introduced by a later patch. Also, libvhd
is installed under a different name in order to avoid conflicts with the one
used by blktap2.

Signed-off-by: Thanos Makatos <thanos.makatos@xxxxxxxxxx>

diff --git a/tools/blktap2/vhd/lib/Makefile b/tools/blktap3/vhd/lib/Makefile
copy from tools/blktap2/vhd/lib/Makefile
copy to tools/blktap3/vhd/lib/Makefile
--- a/tools/blktap2/vhd/lib/Makefile
+++ b/tools/blktap3/vhd/lib/Makefile
@@ -3,21 +3,27 @@ BLKTAP_ROOT := ../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 LIBVHD-MAJOR     = 1.0
-LIBVHD-MINOR     = 0
+LIBVHD-MINOR     = 3
 LIBVHD-SONAME    = libvhd.so.$(LIBVHD-MAJOR)
 
-LVM-UTIL-OBJ    := $(BLKTAP_ROOT)/lvm/lvm-util.o
-
 LIBVHD-BUILD    := libvhd.a
 
 INST-DIR         = $(LIBDIR)
 
-CFLAGS          += -Werror
-CFLAGS          += -Wno-unused
-CFLAGS          += -I../../include
-CFLAGS          += -D_GNU_SOURCE
-CFLAGS          += -fPIC
-CFLAGS          += -g
+override CFLAGS += \
+       -I$(BLKTAP_ROOT)/include \
+       -I$(BLKTAP_ROOT)/part \
+       -D_GNU_SOURCE \
+       -fPIC \
+       $(CFLAGS_xeninclude) \
+    -Wall \
+    -Wextra \
+    -Werror
+
+# FIXME cause trouble
+override CFLAGS += \
+    -Wno-sign-compare \
+    -Wno-type-limits
 
 ifeq ($(CONFIG_Linux),y)
 LIBS            := -luuid
@@ -28,26 +34,12 @@ LIBS            += -liconv
 endif
 
 LIB-SRCS        := libvhd.c
-LIB-SRCS        += libvhd-journal.c
-LIB-SRCS        += vhd-util-coalesce.c
-LIB-SRCS        += vhd-util-create.c
-LIB-SRCS        += vhd-util-fill.c
-LIB-SRCS        += vhd-util-modify.c
-LIB-SRCS        += vhd-util-query.c
-LIB-SRCS        += vhd-util-read.c
-LIB-SRCS        += vhd-util-repair.c
-LIB-SRCS        += vhd-util-resize.c
-LIB-SRCS        += vhd-util-revert.c
-LIB-SRCS        += vhd-util-set-field.c
-LIB-SRCS        += vhd-util-snapshot.c
-LIB-SRCS        += vhd-util-scan.c
-LIB-SRCS        += vhd-util-check.c
-LIB-SRCS        += vhd-util-uuid.c
+# TODO Not in Citrix blktap2, import it.
+#LIB-SRCS += vhd-util-uuid.c
 LIB-SRCS        += relative-path.c
 LIB-SRCS        += atomicio.c
 
 LIB-OBJS         = $(patsubst %.c,%.o,$(LIB-SRCS))
-LIB-OBJS        += $(LVM-UTIL-OBJ)
 
 LIB-PICOBJS      = $(patsubst %.o,%.opic,$(LIB-OBJS))
 
@@ -55,7 +47,10 @@ LIBVHD           = libvhd.a libvhd.so.$(
 
 all: build
 
-build: libvhd.a libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR)
+build: libvhd.a libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) libvhdio.so
+
+libvhdio.so: libvhdio.o
+       $(CC) -Wl,$(SONAME_LDFLAG) $(SHLIB_LDFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 libvhd.a: $(LIB-OBJS)
        $(AR) rc $@ $^
@@ -70,6 +65,7 @@ install: all
        $(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR)
        $(INSTALL_DATA) libvhd.a $(DESTDIR)$(INST-DIR)
        $(INSTALL_PROG) libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) 
$(DESTDIR)$(INST-DIR)
+       $(INSTALL_PROG) libvhdio.so $(DESTDIR)$(INST-DIR)       
        ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) 
$(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
        ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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