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

[Xen-devel] [PATCH 15/16] tools: provide pkg-config file for libxenblktapctl



In order to be able to use pkg-config for obtaining linker- and
compiler-flags provide a xenblktapctl.pc file.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 .gitignore                               |  1 +
 tools/blktap2/control/Makefile           | 23 +++++++++++++++++++++--
 tools/blktap2/control/xenblktapctl.pc.in |  9 +++++++++
 3 files changed, 31 insertions(+), 2 deletions(-)
 create mode 100644 tools/blktap2/control/xenblktapctl.pc.in

diff --git a/.gitignore b/.gitignore
index 67d66e2..8606ba1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -108,6 +108,7 @@ tools/libs/foreignmemory/headers.chk
 tools/libs/foreignmemory/xenforeignmemory.pc
 tools/libs/devicemodel/headers.chk
 tools/libs/devicemodel/xendevicemodel.pc
+tools/blktap2/control/xenblktapctl.pc
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/tools/blktap2/control/Makefile b/tools/blktap2/control/Makefile
index 767f52a..0d731f7 100644
--- a/tools/blktap2/control/Makefile
+++ b/tools/blktap2/control/Makefile
@@ -41,9 +41,26 @@ LIB_STATIC = $(LIBNAME).a
 LIB_SHARED = $(LIBSONAME).$(MINOR)
 IBIN = tap-ctl
 
+PKG_CONFIG := xenblktapctl.pc
+PKG_CONFIG_VERSION := $(MAJOR).$(MINOR)
+
+ifneq ($(CONFIG_LIBXC_MINIOS),y)
+PKG_CONFIG_INST := $(PKG_CONFIG)
+$(PKG_CONFIG_INST): PKG_CONFIG_PREFIX = $(prefix)
+$(PKG_CONFIG_INST): PKG_CONFIG_INCDIR = $(includedir)
+$(PKG_CONFIG_INST): PKG_CONFIG_LIBDIR = $(libdir)
+endif
+
+PKG_CONFIG_LOCAL := $(foreach pc,$(PKG_CONFIG),$(PKG_CONFIG_DIR)/$(pc))
+
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_PREFIX = $(XEN_ROOT)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_INCDIR = $(XEN_BLKTAP2)/include
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) 
$(CFLAGS_libxenctrl)
+
 all: build
 
-build: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+build: $(IBIN) $(LIB_STATIC) $(LIB_SHARED) $(PKG_CONFIG_INST) 
$(PKG_CONFIG_LOCAL)
 
 $(LIBNAME).so: $(LIBSONAME)
        ln -sf $< $@
@@ -60,18 +77,20 @@ $(LIB_STATIC): $(CTL_OBJS)
 $(LIB_SHARED): $(CTL_PICS)
        $(CC) $(LDFLAGS) -fPIC  -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) 
$(SHLIB_LDFLAGS) -rdynamic $^ -o $@  $(APPEND_LDFLAGS)
 
-install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+install: build
        $(INSTALL_DIR) -p $(DESTDIR)$(sbindir)
        $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(sbindir)
        $(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(libdir)
        $(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(libdir)
        ln -sf $(LIBSONAME) $(DESTDIR)$(libdir)/$(LIBNAME).so
        ln -sf $(LIB_SHARED) $(DESTDIR)$(libdir)/$(LIBSONAME)
+       $(INSTALL_DATA) xenblktapctl.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 clean:
        rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
        rm -f $(LIBNAME).so $(LIBSONAME)
        rm -f *~
+       rm -f xenblktapctl.pc
 
 distclean: clean
 
diff --git a/tools/blktap2/control/xenblktapctl.pc.in 
b/tools/blktap2/control/xenblktapctl.pc.in
new file mode 100644
index 0000000..81d2747
--- /dev/null
+++ b/tools/blktap2/control/xenblktapctl.pc.in
@@ -0,0 +1,9 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xenblktapctl
+Description: The Xenblktapctl library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir} @@cflagslocal@@
+Libs: @@libsflag@@${libdir} -lxenblktapctl
-- 
2.10.2


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

 


Rackspace

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