Changeset
m4/virt-driver-xen.m4 | 41 +++++++++++++++++++++++++++++------------
1 file changed, 29 insertions(+), 12 deletions(-)
Git apply log
Switched to a new branch '20180309134731.25570-1-olaf@aepfle.de'
Applying: m4: use pkgconfig to detect xenstore
To https://github.com/patchew-project/libvirt
 * [new tag]             patchew/20180309134731.25570-1-olaf@aepfle.de -> patchew/20180309134731.25570-1-olaf@aepfle.de
Test passed: syntax-check

loading

[libvirt] [PATCH] m4: use pkgconfig to detect xenstore
Posted by Olaf Hering, 15 weeks ago
Since Xen 4.9 a pkgconfig file exists to gather info about building
against libxenstore.so. Use it if available.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 m4/virt-driver-xen.m4 | 41 +++++++++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 12 deletions(-)

diff --git a/m4/virt-driver-xen.m4 b/m4/virt-driver-xen.m4
index 2a26863ca..52d4f5162 100644
--- a/m4/virt-driver-xen.m4
+++ b/m4/virt-driver-xen.m4
@@ -27,25 +27,42 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_XEN], [
   old_CFLAGS="$CFLAGS"
   XEN_LIBS=""
   XEN_CFLAGS=""
+  fail=0
 
   dnl search for the Xen store library
+  dnl Either use the provided path, or make use of pkgconfig
+  dnl Xen versions prior 4.9 had no pkgconfig file
   if test "$with_xen" != "no" ; then
+    xen_path_provided="no"
     if test "$with_xen" != "yes" && test "$with_xen" != "check" ; then
       XEN_CFLAGS="-I$with_xen/include"
       XEN_LIBS="-L$with_xen/lib64 -L$with_xen/lib"
+      xen_path_provided="yes"
+    fi
+
+    if test "$xen_path_provided" = "no" ; then
+      PKG_CHECK_MODULES([XEN], [xenstore], [
+          fail=0
+          with_xen=yes
+        ], [
+          fail=1
+        ])
+    fi
+    dnl manual check if either path was provided or pkgconfig does not exist
+    if test "$xen_path_provided" = "yes" || test "$fail" = 1 ; then
+      CFLAGS="$CFLAGS $XEN_CFLAGS"
+      LIBS="$LIBS $XEN_LIBS"
+      AC_CHECK_LIB([xenstore], [xs_read], [
+             fail=0
+             with_xen=yes
+             XEN_LIBS="$XEN_LIBS -lxenstore"
+         ],[
+             if test "$with_xen" = "yes"; then
+               fail=1
+             fi
+             with_xen=no
+         ])
     fi
-    fail=0
-    CFLAGS="$CFLAGS $XEN_CFLAGS"
-    LIBS="$LIBS $XEN_LIBS"
-    AC_CHECK_LIB([xenstore], [xs_read], [
-           with_xen=yes
-           XEN_LIBS="$XEN_LIBS -lxenstore"
-       ],[
-           if test "$with_xen" = "yes"; then
-             fail=1
-           fi
-           with_xen=no
-       ])
   fi
 
   if test "$with_xen" != "no" ; then

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] m4: use pkgconfig to detect xenstore
Posted by Michal Privoznik, 14 weeks ago
On 03/09/2018 02:47 PM, Olaf Hering wrote:
> Since Xen 4.9 a pkgconfig file exists to gather info about building
> against libxenstore.so. Use it if available.
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>
> ---
>  m4/virt-driver-xen.m4 | 41 +++++++++++++++++++++++++++++------------
>  1 file changed, 29 insertions(+), 12 deletions(-)

ACKed and pushed.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] m4: use pkgconfig to detect xenstore
Posted by Olaf Hering, 14 weeks ago
Am Fri,  9 Mar 2018 14:47:31 +0100
schrieb Olaf Hering <olaf@aepfle.de>:

> Since Xen 4.9 a pkgconfig file exists to gather info about building
> against libxenstore.so. Use it if available.

Any words on that patch?

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