[Spice-devel] [PATCH spice-gtk] RFC: Use spice protocol as a submodule

Marc-André Lureau marcandre.lureau at gmail.com
Tue Feb 21 03:22:43 PST 2012


Spice protocol contains only headers. We would like to be able to use
a protocol update without having to wait for the release, a git
submodule works well for this purpose.
---
 .gitmodules    |    3 +++
 autogen.sh     |    3 +++
 configure.ac   |   12 +++++++-----
 spice-protocol |    1 +
 4 files changed, 14 insertions(+), 5 deletions(-)
 create mode 100644 .gitmodules
 create mode 160000 spice-protocol

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..b628a96
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "spice-protocol"]
+	path = spice-protocol
+	url = git://anongit.freedesktop.org/spice/spice-protocol
diff --git a/autogen.sh b/autogen.sh
index 2724d7e..f36bb6f 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -5,6 +5,9 @@ set -e # exit on errors
 srcdir=`dirname $0`
 test -z "$srcdir" && srcdir=.
 
+git submodule init
+git submodule update
+
 gtkdocize
 autoreconf -v --force --install
 intltoolize -f
diff --git a/configure.ac b/configure.ac
index 7876378..7332b6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,14 +59,16 @@ AM_CONDITIONAL([OS_WIN32],[test "$os_win32" = "yes"])
 AC_CHECK_HEADERS([sys/ipc.h sys/shm.h])
 AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h])
 
-dnl =========================================================================
-dnl Chek optional features
-PKG_CHECK_MODULES(PROTOCOL, spice-protocol >= 0.10.2)
-AC_SUBST(PROTOCOL_CFLAGS)
-
 AC_CHECK_LIBM
 AC_SUBST(LIBM)
 
+AC_CONFIG_SUBDIRS([spice-protocol])
+PROTOCOL_CFLAGS='-I ${top_srcdir}/spice-protocol'
+AC_SUBST(PROTOCOL_CFLAGS)
+
+dnl =========================================================================
+dnl Chek optional features
+
 srcdir="$(dirname $0)"
 if test ! -e "$srcdir/gtk/generated_marshallers.c"; then
   AC_MSG_CHECKING([for pyparsing python module])
diff --git a/spice-protocol b/spice-protocol
new file mode 160000
index 0000000..d9de921
--- /dev/null
+++ b/spice-protocol
@@ -0,0 +1 @@
+Subproject commit d9de9213f26f43492fb329715aa8707e70a7cd56
-- 
1.7.7.6



More information about the Spice-devel mailing list