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

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



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

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

diff --git a/.gitignore b/.gitignore
index d017254..ecc6cb7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -98,6 +98,7 @@ config/Docs.mk
 tools/libs/toollog/headers.chk
 tools/libs/toollog/xentoollog.pc
 tools/libs/evtchn/headers.chk
+tools/libs/evtchn/xenevtchn.pc
 tools/libs/gnttab/headers.chk
 tools/libs/call/headers.chk
 tools/libs/foreignmemory/headers.chk
diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile
index 9917864..5da2693 100644
--- a/tools/libs/evtchn/Makefile
+++ b/tools/libs/evtchn/Makefile
@@ -24,6 +24,23 @@ ifneq ($(nosharedlibs),y)
 LIB += libxenevtchn.so
 endif
 
+PKG_CONFIG := xenevtchn.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_LIBXENEVTCHN)/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) libxenevtchn.so.$(MAJOR).$(MINOR) 
$(DESTDIR)$(libdir)/libxenevtchn.so.$(MAJOR)
        $(SYMLINK_SHLIB) libxenevtchn.so.$(MAJOR) 
$(DESTDIR)$(libdir)/libxenevtchn.so
        $(INSTALL_DATA) include/xenevtchn.h $(DESTDIR)$(includedir)
+       $(INSTALL_DATA) xenevtchn.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: TAGS
 TAGS:
@@ -66,6 +84,7 @@ clean:
        rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
        rm -f libxenevtchn.so.$(MAJOR).$(MINOR) libxenevtchn.so.$(MAJOR)
        rm -f headers.chk
+       rm -f xenevtchn.pc
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/libs/evtchn/xenevtchn.pc.in 
b/tools/libs/evtchn/xenevtchn.pc.in
new file mode 100644
index 0000000..da8bf16
--- /dev/null
+++ b/tools/libs/evtchn/xenevtchn.pc.in
@@ -0,0 +1,10 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xenevtchn
+Description: The Xenevtchn library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir} @@cflagslocal@@
+Libs: @@libsflag@@${libdir} -lxenevtchn
+Requires.private: xentoollog
--
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®.