[Spice-devel] [RFCv2 06/21] xspice: add configure option and make target

Alon Levy alevy at redhat.com
Fri Apr 29 02:49:44 PDT 2011


adds --enable-xspice, which builds an spiceqxl_drv.so target,
and defines SUPPORT_XSPICE. Fails build if spice-server not found.
---
 configure.ac    |   13 +++++++++++++
 src/Makefile.am |   23 +++++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index ce67b41..23da822 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,19 @@ AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
 
 # Checks for libraries.
 
+use_gui=no
+AC_ARG_ENABLE(xspice,
+[  --enable-xspice         Build the xspice driver spiceqxl_drv.so],
+[  enable_xspice=yes])
+AM_CONDITIONAL(SUPPORT_XSPICE, test "x$enable_xspice" = "xyes")
+
+if test x"$enable_xspice" != "xno"; then
+    PKG_CHECK_MODULES([SPICE], [spice-server >= 0.6.3],
+    [
+        AC_SUBST(SPICE_CFLAGS)
+        AC_SUBST(SPICE_LIBS)
+    ])
+fi
 PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >= 0.7.0])
 
 DRIVER_NAME=qxl
diff --git a/src/Makefile.am b/src/Makefile.am
index ff4fa14..67bb639 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,3 +47,26 @@ qxl_drv_la_SOURCES =				\
 	lookup3.c				\
 	lookup3.h				\
 	qxl_cursor.c
+
+if SUPPORT_XSPICE
+spiceqxl_drv_la_LTLIBRARIES = spiceqxl_drv.la
+spiceqxl_drv_la_LDFLAGS = -module -avoid-version $(SPICE_LIBS)
+spiceqxl_drv_ladir = @moduledir@/drivers
+
+spiceqxl_drv_la_CFLAGS = -DXSPICE $(AM_CFLAGS) $(SPICE_CFLAGS)
+
+spiceqxl_drv_la_LIBADD = uxa/libuxa.la
+
+spiceqxl_drv_la_SOURCES =				\
+	qxl.h					\
+	qxl_driver.c				\
+	qxl_image.c				\
+	qxl_surface.c				\
+	qxl_ring.c				\
+	qxl_mem.c				\
+	mspace.c				\
+	mspace.h				\
+	lookup3.c				\
+	lookup3.h				\
+	qxl_cursor.c
+endif
-- 
1.7.4.4



More information about the Spice-devel mailing list