ia64/xen-unstable

view tools/blktap2/vhd/lib/Makefile @ 19817:b7f73a7f3078

blktap2: portability fixes for NetBSD

- Use standard off_t and lseek() instead of non-portable off64_t and
lseek64()
- Use uuid API as documented in DCE 1.1 RPC specification
- Add NetBSD implementation for blk_getimagesize() and
blk_getsectorsize()
- Use blk_getimagesize() and blk_getsectorsize()
- Fix uuid header check

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 17:24:14 2009 +0100 (2009-06-23)
parents 241607f414c8
children
line source
1 XEN_ROOT=../../../../
2 BLKTAP_ROOT := ../../
3 include $(XEN_ROOT)/tools/Rules.mk
5 LIBVHD-MAJOR = 1.0
6 LIBVHD-MINOR = 0
7 LIBVHD-SONAME = libvhd.so.$(LIBVHD-MAJOR)
9 LVM-UTIL-OBJ := $(BLKTAP_ROOT)lvm/lvm-util.o
11 LIBVHD-BUILD := libvhd.a
13 INST-DIR = $(LIBDIR)
15 CFLAGS += -Werror
16 CFLAGS += -Wno-unused
17 CFLAGS += -I../../include
18 CFLAGS += -D_GNU_SOURCE
19 CFLAGS += -fPIC
20 CFLAGS += -g
22 ifeq ($(CONFIG_Linux),y)
23 LIBS := -luuid
24 endif
26 # Get gcc to generate the dependencies for us.
27 CFLAGS += -Wp,-MD,.$(@F).d
28 DEPS = .*.d
30 LIB-SRCS := libvhd.c
31 LIB-SRCS += libvhd-journal.c
32 LIB-SRCS += vhd-util-coalesce.c
33 LIB-SRCS += vhd-util-create.c
34 LIB-SRCS += vhd-util-fill.c
35 LIB-SRCS += vhd-util-modify.c
36 LIB-SRCS += vhd-util-query.c
37 LIB-SRCS += vhd-util-read.c
38 LIB-SRCS += vhd-util-repair.c
39 LIB-SRCS += vhd-util-resize.c
40 LIB-SRCS += vhd-util-revert.c
41 LIB-SRCS += vhd-util-set-field.c
42 LIB-SRCS += vhd-util-snapshot.c
43 LIB-SRCS += vhd-util-scan.c
44 LIB-SRCS += vhd-util-check.c
45 LIB-SRCS += relative-path.c
46 LIB-SRCS += atomicio.c
48 LIB-OBJS = $(patsubst %.c,%.o,$(LIB-SRCS))
49 LIB-OBJS += $(LVM-UTIL-OBJ)
51 LIBVHD = libvhd.a libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR)
53 all: build
55 build: $(LIBVHD-BUILD)
57 libvhd.a: $(LIB-OBJS)
58 $(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG),$(LIBVHD-SONAME) $(SHLIB_CFLAGS) \
59 $(LDFLAGS) -o libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(LIBS) $^
60 ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) libvhd.so.$(LIBVHD-MAJOR)
61 ln -sf libvhd.so.$(LIBVHD-MAJOR) libvhd.so
62 $(AR) rc $@ $^
64 install: all
65 $(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR)
66 $(INSTALL_DATA) $(LIBVHD) $(DESTDIR)$(INST-DIR)
67 ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
68 ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so
70 clean:
71 rm -rf *.a *.so* *.o *~ $(DEPS) $(LIBVHD)
73 .PHONY: all build clean install libvhd
75 -include $(DEPS)