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

[Xen-changelog] [xen master] tools: provide pkg-config file for libxenstat



commit 8d3b36373e2d1ebd24cc27910fd288e688013133
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Tue Mar 14 14:31:21 2017 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Tue Mar 14 14:13:14 2017 +0000

    tools: provide pkg-config file for libxenstat
    
    In order to be able to use pkg-config for obtaining linker- and
    compiler-flags provide a xenstat.pc file.
    
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 .gitignore                             |  1 +
 tools/xenstat/libxenstat/Makefile      | 20 +++++++++++++++++++-
 tools/xenstat/libxenstat/xenstat.pc.in | 10 ++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 4caa3d9..778bc3f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -243,6 +243,7 @@ tools/xenmon/xenbaked
 tools/xenpaging/xenpaging
 tools/xenpmd/xenpmd
 tools/xenstat/libxenstat/src/_paths.h
+tools/xenstat/libxenstat/xenstat.pc
 tools/xenstat/xentop/xentop
 tools/xenstore/xenstore
 tools/xenstore/xenstore-chmod
diff --git a/tools/xenstat/libxenstat/Makefile 
b/tools/xenstat/libxenstat/Makefile
index 213d998..85cec63 100644
--- a/tools/xenstat/libxenstat/Makefile
+++ b/tools/xenstat/libxenstat/Makefile
@@ -37,8 +37,24 @@ CFLAGS+=-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) 
$(CFLAGS_xeninclude) -i
 LDLIBS-y = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl)
 LDLIBS-$(CONFIG_SunOS) += -lkstat
 
+PKG_CONFIG := xenstat.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_LIBXENSTAT)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
+
 .PHONY: all
-all: $(LIB) $(SHLIB) $(SHLIB_LINKS)
+all: $(LIB) $(SHLIB) $(SHLIB_LINKS) $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL)
 
 $(OBJECTS-y): src/_paths.h
 
@@ -63,6 +79,7 @@ install: all
        $(INSTALL_PROG) src/libxenstat.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
        ln -sf libxenstat.so.$(MAJOR).$(MINOR) 
$(DESTDIR)$(libdir)/libxenstat.so.$(MAJOR)
        ln -sf libxenstat.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenstat.so
+       $(INSTALL_DATA) xenstat.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 PYLIB=bindings/swig/python/_xenstat.so
 PYMOD=bindings/swig/python/xenstat.py
@@ -138,6 +155,7 @@ endif
 clean:
        rm -f $(LIB) $(SHLIB) $(SHLIB_LINKS) $(OBJECTS-y) \
              $(BINDINGS) $(BINDINGSRC) $(DEPS) src/_paths.h
+       rm -f xenstat.pc
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/xenstat/libxenstat/xenstat.pc.in 
b/tools/xenstat/libxenstat/xenstat.pc.in
new file mode 100644
index 0000000..ad00577
--- /dev/null
+++ b/tools/xenstat/libxenstat/xenstat.pc.in
@@ -0,0 +1,10 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xenstat
+Description: The Xenstat library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir}
+Libs: @@libsflag@@${libdir} -lxenstat
+Requires.private: xencontrol,xenstore
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

 


Rackspace

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