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

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



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

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

diff --git a/.gitignore b/.gitignore
index 4567de7..d017254 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,6 +96,7 @@ config/Tools.mk
 config/Stubdom.mk
 config/Docs.mk
 tools/libs/toollog/headers.chk
+tools/libs/toollog/xentoollog.pc
 tools/libs/evtchn/headers.chk
 tools/libs/gnttab/headers.chk
 tools/libs/call/headers.chk
diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile
index fb701be..7361194 100644
--- a/tools/libs/toollog/Makefile
+++ b/tools/libs/toollog/Makefile
@@ -19,6 +19,22 @@ ifneq ($(nosharedlibs),y)
 LIB += libxentoollog.so
 endif
 
+PKG_CONFIG := xentoollog.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_LIBXENTOOLLOG)/include
+$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR)
+
 .PHONY: all
 all: build
 
@@ -27,7 +43,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)
 
@@ -51,6 +67,7 @@ install: build
        $(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) 
$(DESTDIR)$(libdir)/libxentoollog.so.$(MAJOR)
        $(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR) 
$(DESTDIR)$(libdir)/libxentoollog.so
        $(INSTALL_DATA) include/xentoollog.h $(DESTDIR)$(includedir)
+       $(INSTALL_DATA) xentoollog.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: TAGS
 TAGS:
@@ -61,6 +78,7 @@ clean:
        rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
        rm -f libxentoollog.so.$(MAJOR).$(MINOR) libxentoollog.so.$(MAJOR)
        rm -f headers.chk
+       rm -f xentoollog.pc
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/libs/toollog/xentoollog.pc.in 
b/tools/libs/toollog/xentoollog.pc.in
new file mode 100644
index 0000000..554e4d5
--- /dev/null
+++ b/tools/libs/toollog/xentoollog.pc.in
@@ -0,0 +1,9 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xentoollog
+Description: The Xentoollog library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir}
+Libs: @@libsflag@@${libdir} -lxentoollog
--
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®.