From 1b008e99dc85277b202ff2e7f958522b074b70c4 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Tue, 14 Mar 2017 14:31:20 +0100 Subject: [PATCH] tools: provide pkg-config file for libxenstore In order to be able to use pkg-config for obtaining linker- and compiler-flags provide a xenstore.pc file. Signed-off-by: Juergen Gross Acked-by: Wei Liu --- .gitignore | 1 + tools/xenstore/Makefile | 21 +++++++++++++++++++++ tools/xenstore/xenstore.pc.in | 10 ++++++++++ 3 files changed, 32 insertions(+) create mode 100644 tools/xenstore/xenstore.pc.in diff --git a/.gitignore b/.gitignore index ba0f2e4b47..4caa3d9dec 100644 --- a/.gitignore +++ b/.gitignore @@ -255,6 +255,7 @@ tools/xenstore/xenstore-control tools/xenstore/xenstore-ls tools/xenstore/xenstored tools/xenstore/xenstored_test +tools/xenstore/xenstore.pc tools/xenstore/xs_tdb_dump tools/xentrace/xentrace_setsize tools/xentrace/tbctl diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index bdca108b8b..c4f9cdeec7 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -105,12 +105,32 @@ libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic libxenstore.a: xs.o xs_lib.o $(AR) rcs $@ $^ +PKG_CONFIG := xenstore.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_XENSTORE)/include +$(PKG_CONFIG_LOCAL): PKG_CONFIG_LIBDIR = $(CURDIR) +$(PKG_CONFIG_LOCAL): PKG_CONFIG_CFLAGS_LOCAL = $(CFLAGS_xeninclude) + +$(LIBXENSTORE): $(PKG_CONFIG_INST) $(PKG_CONFIG_LOCAL) + .PHONY: clean clean: rm -f *.a *.o *.opic *.so* xenstored_probes.h rm -f xenstored xs_random xs_stress xs_crashme rm -f xs_tdb_dump xenstore-control init-xenstore-domain rm -f xenstore $(CLIENTS) + rm -f xenstore.pc $(RM) $(DEPS) .PHONY: distclean @@ -150,6 +170,7 @@ endif $(INSTALL_DATA) include/compat/xs_lib.h $(DESTDIR)$(includedir)/xenstore-compat/xs_lib.h ln -sf xenstore-compat/xs.h $(DESTDIR)$(includedir)/xs.h ln -sf xenstore-compat/xs_lib.h $(DESTDIR)$(includedir)/xs_lib.h + $(INSTALL_DATA) xenstore.pc $(DESTDIR)$(PKG_INSTALLDIR) .PHONY: clients-install clients-install: clients diff --git a/tools/xenstore/xenstore.pc.in b/tools/xenstore/xenstore.pc.in new file mode 100644 index 0000000000..45dc6b0085 --- /dev/null +++ b/tools/xenstore/xenstore.pc.in @@ -0,0 +1,10 @@ +prefix=@@prefix@@ +includedir=@@incdir@@ +libdir=@@libdir@@ + +Name: Xenstore +Description: The Xenstore library for Xen hypervisor +Version: @@version@@ +Cflags: -I${includedir} @@cflagslocal@@ +Libs: @@libsflag@@${libdir} -lxenstore +Requires.private: xenevtchn,xencontrol,xengnttab -- 2.30.2