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

[Xen-devel] [PATCH 09/16] tools: provide pkg-config file for libxenforeignmemory



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

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 .gitignore                                      |  1 +
 tools/libs/foreignmemory/Makefile               | 21 ++++++++++++++++++++-
 tools/libs/foreignmemory/xenforeignmemory.pc.in | 10 ++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 tools/libs/foreignmemory/xenforeignmemory.pc.in

diff --git a/.gitignore b/.gitignore
index 86b003f..9a1ced7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -105,6 +105,7 @@ tools/libs/gnttab/xengnttab.pc
 tools/libs/call/headers.chk
 tools/libs/call/xencall.pc
 tools/libs/foreignmemory/headers.chk
+tools/libs/foreignmemory/xenforeignmemory.pc
 tools/libs/devicemodel/headers.chk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
diff --git a/tools/libs/foreignmemory/Makefile 
b/tools/libs/foreignmemory/Makefile
index f062f45..55677e8 100644
--- a/tools/libs/foreignmemory/Makefile
+++ b/tools/libs/foreignmemory/Makefile
@@ -24,6 +24,23 @@ ifneq ($(nosharedlibs),y)
 LIB += libxenforeignmemory.so
 endif
 
+PKG_CONFIG := xenforeignmemory.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_LIBXENFOREIGNMEMORY)/include
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
+
 .PHONY: all
 all: build
 
@@ -32,7 +49,7 @@ build:
        $(MAKE) libs
 
 .PHONY: libs
-libs: headers.chk $(LIB)
+libs: headers.chk $(LIB) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL)
 
 headers.chk: $(wildcard include/*.h)
 
@@ -56,6 +73,7 @@ install: build
        $(SYMLINK_SHLIB) libxenforeignmemory.so.$(MAJOR).$(MINOR) 
$(DESTDIR)$(libdir)/libxenforeignmemory.so.$(MAJOR)
        $(SYMLINK_SHLIB) libxenforeignmemory.so.$(MAJOR) 
$(DESTDIR)$(libdir)/libxenforeignmemory.so
        $(INSTALL_DATA) include/xenforeignmemory.h $(DESTDIR)$(includedir)
+       $(INSTALL_DATA) xenforeignmemory.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: TAGS
 TAGS:
@@ -66,6 +84,7 @@ clean:
        rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
        rm -f libxenforeignmemory.so.$(MAJOR).$(MINOR) 
libxenforeignmemory.so.$(MAJOR)
        rm -f headers.chk
+       rm -f xenforeignmemory.pc
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/libs/foreignmemory/xenforeignmemory.pc.in 
b/tools/libs/foreignmemory/xenforeignmemory.pc.in
new file mode 100644
index 0000000..63432dc
--- /dev/null
+++ b/tools/libs/foreignmemory/xenforeignmemory.pc.in
@@ -0,0 +1,10 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xenforeignmemory
+Description: The Xenforeignmemory library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir} @@cflagslocal@@
+Libs: @@libsflag@@${libdir} -lxenforeignmemory
+Requires.private: xentoollog
-- 
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®.