[Spice-devel,1/3] qxl-virtio: add compilation support for qxl-virtio and for debugging stuffs

Submitted by Erlon Cruz on Aug. 24, 2012, 7:10 p.m.

Details

Message ID 1345835460-23061-2-git-send-email-erlon.cruz@br.flextronics.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Erlon Cruz Aug. 24, 2012, 7:10 p.m.
Signed-off-by: Erlon R. Cruz <erlon.cruz@fit-tecnologia.org.br>
Signed-off-by: Fabiano FidĂȘncio <fabiano.fidencio@fit-tecnologia.org.br>
Signed-off-by: Rafael F. Santos <fonsecasantos.rafael@gmail.com>
---
 Makefile.am     |    5 ++++-
 configure.ac    |   34 ++++++++++++++++++++++++++++++++++
 src/Makefile.am |   34 ++++++++++++++++++++++++++++++++--
 3 files changed, 70 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/Makefile.am b/Makefile.am
index c19e659..fe0c686 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,4 +35,7 @@  EXTRA_DIST = \
 	README			\
 	README.xspice
 
-DISTCHECK_CONFIGURE_FLAGS=--enable-xspice
+DISTCHECK_CONFIGURE_FLAGS = \
+	--enable-xspice \
+	--enable-virtio-qxl
+	
diff --git a/configure.ac b/configure.ac
index a18910a..735f640 100644
--- a/configure.ac
+++ b/configure.ac
@@ -102,6 +102,38 @@  if test "x$enable_xspice" = "xyes"; then
 else
     enable_xspice=no
 fi
+
+AC_ARG_ENABLE(virtio_qxl,
+[  --enable-virtio-qxl[[=(no|yes|only)]]  Build the virtio-qxl driver
+                   no      (default) Do not build
+                   yes     Build in addition to qxl
+                   only    Only build virtio-qxl],
+[  if test "x$enableval" = "xyes"; then
+        enable_virtio_qxl=yes
+   elif test "x$enableval" = "xonly"; then
+        enable_virtio_qxl=yes
+        enable_qxl=no
+   else
+        enable_virtio_qxl=no
+   fi
+])
+
+if test ! "x$enable_virtio_qxl" = "xyes"; then
+    enable_virtio_qxl=no
+fi
+
+AC_ARG_ENABLE(debug,
+[  --enable-debug Compile with extra debug information],
+[enable_debug=yes])
+
+if test ! "x$enable_debug" = "xyes"; then
+    enable_debug=no
+fi
+
+
+AM_CONDITIONAL(BUILD_VIRTIO_QXL, test "x$enable_virtio_qxl" = "xyes")
+AM_CONDITIONAL(BUILD_DUMP_COMMANDS, test "x$enable_cmd_dump" = "xyes")
+AM_CONDITIONAL(ENABLE_DEBUG, test "x$enable_debug" = "xyes")
 AM_CONDITIONAL(BUILD_XSPICE, test "x$enable_xspice" = "xyes")
 AM_CONDITIONAL(BUILD_QXL, test "x$enable_qxl" = "xyes")
 
@@ -136,4 +168,6 @@  echo "
 
         Build qxl:                ${enable_qxl}
         Build xspice:             ${enable_xspice}
+        Build virtio-qxl:         ${enable_virtio_qxl}
+        Debug:                    ${enable_debug}
 "
diff --git a/src/Makefile.am b/src/Makefile.am
index 79ea3cc..fe8f5f0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,12 +29,20 @@  SUBDIRS=uxa
 
 AM_CFLAGS = $(SPICE_PROTOCOL_CFLAGS) $(XORG_CFLAGS) $(PCIACCESS_CFLAGS) $(CWARNFLAGS)
 
+if ENABLE_DEBUG
+DEBUGFLAGS = -DENABLE_DEBUG -O0 -g
+endif
+
+if BUILD_DUMP_COMMANDS
+DUMPFLAGS = -DDUMP_COMMANDS
+endif
+
 if BUILD_QXL
 qxl_drv_la_LTLIBRARIES = qxl_drv.la
 qxl_drv_la_LDFLAGS = -module -avoid-version
 qxl_drv_ladir = @moduledir@/drivers
-
 qxl_drv_la_LIBADD = uxa/libuxa.la
+qxl_drv_la_CFLAGS = $(AM_CFLAGS) $(DEBUGFLAGS) $(DUMPFLAGS)
 
 qxl_drv_la_SOURCES =				\
 	qxl.h					\
@@ -51,12 +59,34 @@  qxl_drv_la_SOURCES =				\
 	compat-api.h
 endif
 
+if BUILD_VIRTIO_QXL
+
+virtioqxl_drv_la_LTLIBRARIES = virtioqxl_drv.la
+virtioqxl_drv_la_LDFLAGS = -module -avoid-version
+virtioqxl_drv_ladir = @moduledir@/drivers
+virtioqxl_drv_la_CFLAGS = -DVIRTIO_QXL $(AM_CFLAGS) $(DEBUGFLAGS) $(DUMPFLAGS)
+virtioqxl_drv_la_LIBADD = uxa/libuxa.la
+
+virtioqxl_drv_la_SOURCES =			\
+	qxl.h					\
+	qxl_driver.c				\
+	qxl_image.c				\
+	qxl_surface.c				\
+	qxl_ring.c				\
+	qxl_mem.c				\
+	mspace.c				\
+	mspace.h				\
+	murmurhash3.c				\
+	murmurhash3.h				\
+	qxl_cursor.c
+endif
+
 if BUILD_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_CFLAGS = -DXSPICE $(AM_CFLAGS) $(SPICE_CFLAGS) $(DEBUGFLAGS) $(DUMPFLAGS)
 
 spiceqxl_drv_la_LIBADD = uxa/libuxa.la