[virt-tools-list] [PATCH] build: make spice-gtk dependency optional

Marc-André Lureau marcandre.lureau at redhat.com
Fri Dec 10 11:33:49 UTC 2010


# HG changeset patch
# User Marc-André Lureau <marcandre.lureau at redhat.com>
# Date 1291980168 -3600
# Node ID 4e4b5fe9ad464731c96afd59078d952db3129d9f
# Parent  c70342548912fdd4a7db841dedf54753c756229e
build: make spice-gtk dependency optional

diff -r c70342548912 -r 4e4b5fe9ad46 configure.ac
--- a/configure.ac	Tue Nov 30 15:57:23 2010 +0100
+++ b/configure.ac	Fri Dec 10 12:22:48 2010 +0100
@@ -33,7 +33,21 @@
 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.10.0)
 PKG_CHECK_MODULES(LIBGLADE2, libglade-2.0 >= 2.6.0)
 PKG_CHECK_MODULES(GTKVNC, gtk-vnc-1.0 >= 0.3.8)
-PKG_CHECK_MODULES(SPICEGTK, spice-client-gtk >= 0.1.0.14)
+
+AC_ARG_WITH([spice-gtk],
+    AS_HELP_STRING([--without-spice-gtk], [Ignore presence of spice-gtk and disable it]))
+
+AS_IF([test "x$with_spice_gtk" != "xno"],
+      [PKG_CHECK_MODULES(SPICEGTK, spice-client-gtk >= 0.1.0.14, [have_spice_gtk=yes], [have_spice_gtk=no])],
+      [have_spice_gtk=no])
+
+AS_IF([test "x$have_spice_gtk" = "xyes"],
+      [AC_DEFINE([HAVE_SPICE], 1, [Have spice-gtk?])],
+      [AS_IF([test "x$with_spice_gtk" = "xyes"],
+             [AC_MSG_ERROR([spice-gtk requested but not found])
+      ])
+])
+AM_CONDITIONAL([HAVE_SPICE_GTK], [test "x$have_spice_gtk" = "xyes"])
 
 dnl Decide if this platform can support the SSH tunnel feature.
 AC_CHECK_HEADERS([sys/socket.h sys/un.h windows.h])
diff -r c70342548912 -r 4e4b5fe9ad46 src/Makefile.am
--- a/src/Makefile.am	Tue Nov 30 15:57:23 2010 +0100
+++ b/src/Makefile.am	Fri Dec 10 12:22:48 2010 +0100
@@ -14,8 +14,12 @@
 	viewer.h viewer.c \
 	viewer-priv.h \
 	display.h display.c \
-	display-vnc.h display-vnc.c \
+	display-vnc.h display-vnc.c
+
+if HAVE_SPICE_GTK
+virt_viewer_SOURCES += \
 	display-spice.h display-spice.c
+endif
 
 virt_viewer_LDADD = \
 	@GTKVNC_LIBS@ \
diff -r c70342548912 -r 4e4b5fe9ad46 src/viewer.c
--- a/src/viewer.c	Tue Nov 30 15:57:23 2010 +0100
+++ b/src/viewer.c	Fri Dec 10 12:22:48 2010 +0100
@@ -49,7 +49,10 @@
 #include "events.h"
 #include "auth.h"
 #include "display-vnc.h"
+
+#ifdef HAVE_SPICE_GTK
 #include "display-spice.h"
+#endif
 
 #define SCALE(x) do { x = viewer->fullscreen ? x : x * viewer->zoomlevel / 100; } while (0);
 
@@ -806,8 +809,10 @@
 
 	if (g_strcasecmp(type, "vnc") == 0)
 		viewer->display = VIRT_VIEWER_DISPLAY(virt_viewer_display_vnc_new(viewer));
+#ifdef HAVE_SPICE_GTK
 	else if (g_strcasecmp(type, "spice") == 0)
 		viewer->display = VIRT_VIEWER_DISPLAY(virt_viewer_display_spice_new(viewer));
+#endif
 	else {
 		viewer_simple_message_dialog(viewer->window, _("Unknown graphic type for the guest %s"),
 					     viewer->domkey);




More information about the virt-tools-list mailing list