]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools: provide pkg-config file for libxencall
authorJuergen Gross <jgross@suse.com>
Tue, 14 Mar 2017 13:31:16 +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 xencall.pc file.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
.gitignore
tools/libs/call/Makefile
tools/libs/call/xencall.pc.in [new file with mode: 0644]
tools/libs/evtchn/Makefile
tools/libs/evtchn/xenevtchn.pc.in

index 6acac6892b10412db7da0601e17cf9d9577abf0c..cb514799382d68e67e9ae911aa3313e1812b98af 100644 (file)
@@ -103,6 +103,7 @@ tools/libs/gnttab/headers.chk
 tools/libs/gnttab/xengntshr.pc
 tools/libs/gnttab/xengnttab.pc
 tools/libs/call/headers.chk
+tools/libs/call/xencall.pc
 tools/libs/foreignmemory/headers.chk
 tools/libs/devicemodel/headers.chk
 tools/blktap2/daemon/blktapctrl
index 9402ea5af63fb0697151dbbd2c079a7af0babcc2..30f84378d7b7221499b0a3e10d1dfc5d08ce8be4 100644 (file)
@@ -24,6 +24,23 @@ ifneq ($(nosharedlibs),y)
 LIB += libxencall.so
 endif
 
+PKG_CONFIG := xencall.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_LIBXENCALL)/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) libxencall.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxencall.so.$(MAJOR)
        $(SYMLINK_SHLIB) libxencall.so.$(MAJOR) $(DESTDIR)$(libdir)/libxencall.so
        $(INSTALL_DATA) include/xencall.h $(DESTDIR)$(includedir)
+       $(INSTALL_DATA) xencall.pc $(DESTDIR)$(PKG_INSTALLDIR)
 
 .PHONY: TAGS
 TAGS:
@@ -66,6 +84,7 @@ clean:
        rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
        rm -f libxencall.so.$(MAJOR).$(MINOR) libxencall.so.$(MAJOR)
        rm -f headers.chk
+       rm -f xencall.pc
 
 .PHONY: distclean
 distclean: clean
diff --git a/tools/libs/call/xencall.pc.in b/tools/libs/call/xencall.pc.in
new file mode 100644 (file)
index 0000000..475c133
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@@prefix@@
+includedir=@@incdir@@
+libdir=@@libdir@@
+
+Name: Xencall
+Description: The Xencall library for Xen hypervisor
+Version: @@version@@
+Cflags: -I${includedir} @@cflagslocal@@
+Libs: @@libsflag@@${libdir} -lxencall
+Requires.private: xentoollog
index 5da2693edf1e2f8425a66afb3e81e9db239ddd64..cbd42193ec376bce354f1c746382b52f4ee29620 100644 (file)
@@ -39,7 +39,6 @@ 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
index da8bf161de94b1cd959cdc9a5710c77d3035b951..c74af1ece4801c41308d787ac21503cdb6db53a5 100644 (file)
@@ -5,6 +5,6 @@ libdir=@@libdir@@
 Name: Xenevtchn
 Description: The Xenevtchn library for Xen hypervisor
 Version: @@version@@
-Cflags: -I${includedir} @@cflagslocal@@
+Cflags: -I${includedir}
 Libs: @@libsflag@@${libdir} -lxenevtchn
 Requires.private: xentoollog