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

[Xen-devel] [PATCH v2 11/17] tools: provide pkg-config file for libxendevicemodel



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

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 .gitignore                                  |  1 +
 tools/libs/devicemodel/Makefile             | 21 ++++++++++++++++++++-
 tools/libs/devicemodel/xendevicemodel.pc.in | 10 ++++++++++
 3 files changed, 31 insertions(+), 1 deletion(-)
 create mode 100644 tools/libs/devicemodel/xendevicemodel.pc.in

diff --git a/.gitignore b/.gitignore
index af41e7a..ba0f2e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -107,6 +107,7 @@ tools/libs/call/xencall.pc
 tools/libs/foreignmemory/headers.chk
 tools/libs/foreignmemory/xenforeignmemory.pc
 tools/libs/devicemodel/headers.chk
+tools/libs/devicemodel/xendevicemodel.pc
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff --git a/tools/libs/devicemodel/Makefile b/tools/libs/devicemodel/Makefile
index 1803942..55626a5 100644
--- a/tools/libs/devicemodel/Makefile
+++ b/tools/libs/devicemodel/Makefile
@@ -25,6 +25,23 @@ ifneq ($(nosharedlibs),y)
 LIB += libxendevicemodel.so
 endif
 
+PKG_CONFIG := xendevicemodel.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_LIBXENDEVICEMODEL)/include
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
+
 .PHONY: all
 all: build
 
@@ -33,7 +50,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)
 
@@ -57,6 +74,7 @@ install: build
        $(SYMLINK_SHLIB) libxendevicemodel.so.$(MAJOR).$(MINOR) 
$(DESTDIR)$(libdir)/libxendevicemodel.so.$(MAJOR)
        $(SYMLINK_SHLIB) libxendevicemodel.so.$(MAJOR) 
$(DESTDIR)$(libdir)/libxendevicemodel.so
        $(INSTALL_DATA) include/xendevicemodel.h $(DESTDIR)$(includedir)
+       $(INSTALL_DATA) xendevicemodel.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: TAGS
 TAGS:
@@ -67,6 +85,7 @@ clean:
        rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
        rm -f libxendevicemodel.so.$(MAJOR).$(MINOR) 
libxendevicemodel.so.$(MAJOR)
        rm -f headers.chk
+       rm -f xendevicemodel.pc
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/libs/devicemodel/xendevicemodel.pc.in 
b/tools/libs/devicemodel/xendevicemodel.pc.in
new file mode 100644
index 0000000..ed08f83
--- /dev/null
+++ b/tools/libs/devicemodel/xendevicemodel.pc.in
@@ -0,0 +1,10 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xendevicemodel
+Description: The Xendevicemodel library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir} @@cflagslocal@@
+Libs: @@libsflag@@${libdir} -lxendevicemodel
+Requires.private: xentoollog,xencall
-- 
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®.