configure: Move remaining detection of p2v features to m4/guestfs-v2v.m4.

./configure output now contains a distinct section for v2v and p2v:

  --- Checking the virt-v2v and virt-p2v dependencies ---
  checking for the nbdkit python plugin name... python3
  checking for --with-gtk option... 2
  checking for GTK... yes
  checking for DBUS... yes
  checking if we can build virt-p2v... yes, with Gtk 2

Thanks: Pino Toscano.
This commit is contained in:
Richard W.M. Jones
2019-01-16 11:39:33 +00:00
parent 61b86bac2e
commit d1ff62f3e0
2 changed files with 50 additions and 50 deletions

View File

@@ -85,53 +85,3 @@ PKG_CHECK_MODULES([LIBCONFIG], [libconfig],[
],
[AC_MSG_WARN([libconfig not found, some features will be disabled])])
AM_CONDITIONAL([HAVE_LIBCONFIG],[test "x$LIBCONFIG_LIBS" != "x"])
dnl Check for Gtk 2 or 3 library, used by virt-p2v.
AC_MSG_CHECKING([for --with-gtk option])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2|3|check|no],
[prefer Gtk version 2 or 3. @<:@default=check@:>@])],
[with_gtk="$withval"
AC_MSG_RESULT([$withval])],
[with_gtk="check"
AC_MSG_RESULT([not set, will check for installed Gtk])]
)
if test "x$with_gtk" = "x3"; then
PKG_CHECK_MODULES([GTK], [gtk+-3.0], [
GTK_VERSION=3
])
elif test "x$with_gtk" = "x2"; then
PKG_CHECK_MODULES([GTK], [gtk+-2.0], [
GTK_VERSION=2
], [])
elif test "x$with_gtk" = "xcheck"; then
PKG_CHECK_MODULES([GTK], [gtk+-3.0], [
GTK_VERSION=3
], [
PKG_CHECK_MODULES([GTK], [gtk+-2.0], [
GTK_VERSION=2
], [:])
])
fi
dnl D-Bus is an optional dependency of virt-p2v.
PKG_CHECK_MODULES([DBUS], [dbus-1], [
AC_SUBST([DBUS_CFLAGS])
AC_SUBST([DBUS_LIBS])
AC_DEFINE([HAVE_DBUS],[1],[D-Bus found at compile time.])
],[
AC_MSG_WARN([D-Bus not found, virt-p2v will not be able to inhibit power saving during P2V conversions])
])
dnl Can we build virt-p2v?
AC_MSG_CHECKING([if we can build virt-p2v])
if test "x$GTK_LIBS" != "x"; then
AC_MSG_RESULT([yes, with Gtk $GTK_VERSION])
AC_SUBST([GTK_CFLAGS])
AC_SUBST([GTK_LIBS])
AC_SUBST([GTK_VERSION])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_P2V], [test "x$GTK_LIBS" != "x"])

View File

@@ -26,3 +26,53 @@ AC_ARG_WITH([virt-v2v-nbdkit-python-plugin],
[VIRT_V2V_NBDKIT_PYTHON_PLUGIN=python])
AC_MSG_RESULT([$VIRT_V2V_NBDKIT_PYTHON_PLUGIN])
AC_SUBST([VIRT_V2V_NBDKIT_PYTHON_PLUGIN])
dnl Check for Gtk 2 or 3 library, used by virt-p2v.
AC_MSG_CHECKING([for --with-gtk option])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2|3|check|no],
[prefer Gtk version 2 or 3. @<:@default=check@:>@])],
[with_gtk="$withval"
AC_MSG_RESULT([$withval])],
[with_gtk="check"
AC_MSG_RESULT([not set, will check for installed Gtk])]
)
if test "x$with_gtk" = "x3"; then
PKG_CHECK_MODULES([GTK], [gtk+-3.0], [
GTK_VERSION=3
])
elif test "x$with_gtk" = "x2"; then
PKG_CHECK_MODULES([GTK], [gtk+-2.0], [
GTK_VERSION=2
], [])
elif test "x$with_gtk" = "xcheck"; then
PKG_CHECK_MODULES([GTK], [gtk+-3.0], [
GTK_VERSION=3
], [
PKG_CHECK_MODULES([GTK], [gtk+-2.0], [
GTK_VERSION=2
], [:])
])
fi
dnl D-Bus is an optional dependency of virt-p2v.
PKG_CHECK_MODULES([DBUS], [dbus-1], [
AC_SUBST([DBUS_CFLAGS])
AC_SUBST([DBUS_LIBS])
AC_DEFINE([HAVE_DBUS],[1],[D-Bus found at compile time.])
],[
AC_MSG_WARN([D-Bus not found, virt-p2v will not be able to inhibit power saving during P2V conversions])
])
dnl Can we build virt-p2v?
AC_MSG_CHECKING([if we can build virt-p2v])
if test "x$GTK_LIBS" != "x"; then
AC_MSG_RESULT([yes, with Gtk $GTK_VERSION])
AC_SUBST([GTK_CFLAGS])
AC_SUBST([GTK_LIBS])
AC_SUBST([GTK_VERSION])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL([HAVE_P2V], [test "x$GTK_LIBS" != "x"])