diff --git a/m4/guestfs-misc-libraries.m4 b/m4/guestfs-misc-libraries.m4 index e5d584c72..faf06cc7a 100644 --- a/m4/guestfs-misc-libraries.m4 +++ b/m4/guestfs-misc-libraries.m4 @@ -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"]) diff --git a/m4/guestfs-v2v.m4 b/m4/guestfs-v2v.m4 index dff8f124e..59d502f10 100644 --- a/m4/guestfs-v2v.m4 +++ b/m4/guestfs-v2v.m4 @@ -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"])