]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl: fallback to lib probe if pkgconfig file not found
authorJim Fehlig <jfehlig@suse.com>
Wed, 19 Sep 2018 16:16:23 +0000 (10:16 -0600)
committerJim Fehlig <jfehlig@suse.com>
Thu, 20 Sep 2018 13:59:26 +0000 (07:59 -0600)
With the assumption that all Xen >= 4.6 contains a pkgconfig file for
libxenlight, commit 5bdcef13 dropped the fallback check to probe
libxenlight with LIBVIRT_CHECK_LIB. At the time it was not known that
the various Xen pkgconfig files are in the -runtime package in Fedora,
instead of the traditional -devel package. This bug [1] was fixed in
Fedora > 28, but until Fedora 28 reaches EOL we'll need to re-introduce
the fallback check.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1629643

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
m4/virt-driver-libxl.m4

index 422ff27022b14d34f42087e487f3e4189513b770..479d9116a4bd2bb04693e705cb30e54bf24491c9 100644 (file)
@@ -29,11 +29,31 @@ AC_DEFUN([LIBVIRT_DRIVER_CHECK_LIBXL], [
   LIBXL_API_VERSION="-DLIBXL_API_VERSION=0x040500"
 
   dnl search for libxl, aka libxenlight
-  LIBVIRT_CHECK_PKG([LIBXL], [xenlight], [4.6.0])
+  old_with_libxl="$with_libxl"
+  LIBVIRT_CHECK_PKG([LIBXL], [xenlight], [4.6.0], [true])
   if test "x$with_libxl" = "xyes" ; then
     LIBXL_FIRMWARE_DIR=$($PKG_CONFIG --variable xenfirmwaredir xenlight)
     LIBXL_EXECBIN_DIR=$($PKG_CONFIG --variable libexec_bin xenlight)
+  fi
+
+  dnl In Fedora <= 28, the xenlight pkgconfig file is in the -runtime package
+  dnl https://bugzilla.redhat.com/show_bug.cgi?id=1629643
+  dnl Until Fedora 28 reaches EOL, fallback to lib probe if xenlight.pc is
+  dnl not found
+  if test "x$with_libxl" = "xno" ; then
+    with_libxl="$old_with_libxl"
+
+    save_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS $LIBXL_API_VERSION"
+    LIBVIRT_CHECK_LIB([LIBXL], [xenlight], [libxl_cpupool_cpuadd_cpumap], [libxl.h], [fail="1"])
+    CFLAGS="$save_CFLAGS"
+
+    if test $fail = 1; then
+      AC_MSG_ERROR([You must install the libxl Library from Xen >= 4.6 to compile libxenlight driver with -lxl])
+    fi
+  fi
 
+  if test "$with_libxl" = "yes"; then
     LIBXL_CFLAGS="$LIBXL_CFLAGS $LIBXL_API_VERSION"
 
     dnl If building with libxl, use the libxl utility header and lib too