]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools: provide pkg-config file for libxenvchan
authorJuergen Gross <jgross@suse.com>
Tue, 14 Mar 2017 13:31:22 +0000 (14:31 +0100)
committerWei Liu <wei.liu2@citrix.com>
Tue, 14 Mar 2017 14:13:14 +0000 (14:13 +0000)
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@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
.gitignore
tools/libvchan/Makefile
tools/libvchan/xenvchan.pc.in [new file with mode: 0644]

index 778bc3f15150e686956428279a409b829767d1c4..0f3f8a5f40166717f82e880a5804dfa63929994c 100644 (file)
@@ -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
index df70cf2929210b7a88ac976344f96e2530352f1f..b816eb785bb5ffec0b071bea8a978467d51c1745 100644 (file)
@@ -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 (file)
index 0000000..605e42b
--- /dev/null
@@ -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