[PATCH 3/3] Add pkg-config files to allow deps to build against source tree

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

 



When testing language bindings it is useful to be able to build
them against an uninstalled libvirt source tree. Add a dummy
set of pkg-config files to allow for this. This can be used by
setting

  export PKG_CONFIG_PATH=/path/to/libvirt/git/src

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 .gitignore             |  1 +
 configure.ac           |  3 +++
 src/Makefile.am        |  8 +++++++-
 src/libvirt-lxc.pc.in  | 18 ++++++++++++++++++
 src/libvirt-qemu.pc.in | 18 ++++++++++++++++++
 src/libvirt.pc.in      | 23 +++++++++++++++++++++++
 6 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100644 src/libvirt-lxc.pc.in
 create mode 100644 src/libvirt-qemu.pc.in
 create mode 100644 src/libvirt.pc.in

diff --git a/.gitignore b/.gitignore
index a3d992f..2d4d401 100644
--- a/.gitignore
+++ b/.gitignore
@@ -98,6 +98,7 @@
 /run
 /sc_*
 /src/.*.stamp
+/src/*.pc
 /src/access/org.libvirt.api.policy
 /src/access/viraccessapicheck.c
 /src/access/viraccessapicheck.h
diff --git a/configure.ac b/configure.ac
index c2094d5..060a88a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2730,6 +2730,9 @@ AC_CONFIG_FILES([\
         libvirt.pc \
         libvirt-qemu.pc \
         libvirt-lxc.pc \
+        src/libvirt.pc \
+        src/libvirt-qemu.pc \
+        src/libvirt-lxc.pc \
         libvirt.spec mingw-libvirt.spec \
         po/Makefile.in \
         include/libvirt/Makefile include/libvirt/libvirt.h \
diff --git a/src/Makefile.am b/src/Makefile.am
index 2b9ac61..bcd119b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -45,7 +45,13 @@ AM_LDFLAGS =	$(DRIVER_MODULE_LDFLAGS)			\
 		$(NO_INDIRECT_LDFLAGS)				\
 		$(NULL)
 
-EXTRA_DIST = $(conf_DATA) util/keymaps.csv
+EXTRA_DIST = \
+		$(conf_DATA) \
+		util/keymaps.csv \
+		libvirt.pc \
+		libvirt-qemu.pc \
+		libvirt-lxc.pc \
+		$(NULL)
 
 BUILT_SOURCES =
 CLEANFILES =
diff --git a/src/libvirt-lxc.pc.in b/src/libvirt-lxc.pc.in
new file mode 100644
index 0000000..20f173b
--- /dev/null
+++ b/src/libvirt-lxc.pc.in
@@ -0,0 +1,18 @@
+# Dummy pkg-config file to allow lang bindings
+# to build against a libvirt source tree eg
+# export PKG_CONFIG_PATH=/path/to/libvirt/git/src
+
+prefix=@abs_top_builddir@
+exec_prefix=@abs_top_builddir@
+libdir=@abs_top_builddir@/src
+includedir=@abs_top_builddir@/include
+datarootdir=@abs_top_builddir@
+
+libvirt_lxc_api=@datadir@/docs/libvirt-lxc-api.xml
+
+Name: libvirt
+Version: @VERSION@
+Description: libvirt LXC library
+Requires:
+Libs: -L${libdir} -lvirt-lxc
+Cflags: -I${includedir}
diff --git a/src/libvirt-qemu.pc.in b/src/libvirt-qemu.pc.in
new file mode 100644
index 0000000..1e2cadf
--- /dev/null
+++ b/src/libvirt-qemu.pc.in
@@ -0,0 +1,18 @@
+# Dummy pkg-config file to allow lang bindings
+# to build against a libvirt source tree eg
+# export PKG_CONFIG_PATH=/path/to/libvirt/git/src
+
+prefix=@abs_top_builddir@
+exec_prefix=@abs_top_builddir@
+libdir=@abs_top_builddir@/src
+includedir=@abs_top_builddir@/include
+datarootdir=@abs_top_builddir@
+
+libvirt_qemu_api=@datadir@/docs/libvirt-qemu-api.xml
+
+Name: libvirt
+Version: @VERSION@
+Description: libvirt QEMU library
+Requires:
+Libs: -L${libdir} -lvirt-qemu
+Cflags: -I${includedir}
diff --git a/src/libvirt.pc.in b/src/libvirt.pc.in
new file mode 100644
index 0000000..fa798cf
--- /dev/null
+++ b/src/libvirt.pc.in
@@ -0,0 +1,23 @@
+# Dummy pkg-config file to allow lang bindings
+# to build against a libvirt source tree eg
+# export PKG_CONFIG_PATH=/path/to/libvirt/git/src
+
+prefix=@abs_top_builddir@
+exec_prefix=@abs_top_builddir@
+libdir=@abs_top_builddir@/src
+includedir=@abs_top_builddir@/include
+datarootdir=@abs_top_builddir@
+
+libvirt_api=@datadir@/docs/libvirt-api.xml
+
+# For compat with older versions - also present
+# in libvirt-qemu.pc / libvirt-lxc.pc
+libvirt_qemu_api=@datadir@/docs/libvirt-qemu-api.xml
+libvirt_lxc_api=@datadir@/docs/libvirt-lxc-api.xml
+
+Name: libvirt
+Version: @VERSION@
+Description: libvirt library
+Requires:
+Libs: -L${libdir} -lvirt
+Cflags: -I${includedir}
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]