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

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



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

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

diff --git a/.gitignore b/.gitignore
index 778bc3f..0f3f8a5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -187,6 +187,7 @@ tools/include/xen/*
 tools/include/xen-xsm/*
 tools/include/xen-foreign/*.(c|h|size)
 tools/include/xen-foreign/checker
+tools/libvchan/xenvchan.pc
 tools/libxc/*.pc
 tools/libxl/_libxl.api-for-check
 tools/libxl/*.api-ok
diff --git a/tools/libvchan/Makefile b/tools/libvchan/Makefile
index df70cf2..b816eb7 100644
--- a/tools/libvchan/Makefile
+++ b/tools/libvchan/Makefile
@@ -21,8 +21,25 @@ CFLAGS += -I../include -I.
 
 io.o io.opic: CFLAGS += $(CFLAGS_libxenctrl) # for xen_mb et al
 
+PKG_CONFIG := xenvchan.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_LIBVCHAN)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude)
+
 .PHONY: all
-all: libxenvchan.so vchan-node1 vchan-node2 libxenvchan.a
+all: libxenvchan.so vchan-node1 vchan-node2 libxenvchan.a $(PKG_CONFIG_INST) 
$(PKG_CONFIG_LOCAL)
 
 libxenvchan.so: libxenvchan.so.$(MAJOR)
        ln -sf $< $@
@@ -51,10 +68,12 @@ install: all
        ln -sf libxenvchan.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenvchan.so
        $(INSTALL_DATA) libxenvchan.h $(DESTDIR)$(includedir)
        $(INSTALL_DATA) libxenvchan.a $(DESTDIR)$(libdir)
+       $(INSTALL_DATA) xenvchan.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: clean
 clean:
        $(RM) -f *.o *.opic *.so* *.a vchan-node1 vchan-node2 $(DEPS)
+       $(RM) -f xenvchan.pc
 
 distclean: clean
 
diff --git a/tools/libvchan/xenvchan.pc.in b/tools/libvchan/xenvchan.pc.in
new file mode 100644
index 0000000..605e42b
--- /dev/null
+++ b/tools/libvchan/xenvchan.pc.in
@@ -0,0 +1,10 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xenvchan
+Description: The Xenvchan library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir} @@cflagslocal@@
+Libs: @@libsflag@@${libdir} -lxenvchan
+Requires.private: xentoollog,xenstore,xengntshr,xenevtchn,xengnttab
--
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®.