[Spice-devel] [RFC] top-level-spice: Build all of SPICE from top-level

Christophe de Dinechin christophe at dinechin.org
Thu Sep 27 15:49:18 UTC 2018


From: Christophe de Dinechin <dinechin at redhat.com>

This is a new repository that makes it easier to build all
of SPICE with a single 'make' command. It also optimizes
the build of 'common' and 'protocol', which are built only once
and then used by both spice-gtk and spice-server. This makes
it easier and safer to develop code that impacts these shared
components.

This build system was also designed to be compatible with the
standard build system. You can run ./autogen.sh, and it will
switch to auto-tools. I have not tested that feature in a while.

I have not yet attempted to do anything similar with Meson/Ninja.

Gitlab review link: https://github.com/c3d/spice/commits/c3d-build

Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
---
 .gitignore       |  2 ++
 .gitlab-ci.yml   | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 .gitmodules      | 21 +++++++++++++++++++++
 Makefile         | 41 ++++++++++++++++++++++++++++++++++++++++
 README.md        | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
 autogen.sh       | 21 +++++++++++++++++++++
 clients/Makefile |  5 +++++
 clients/gtk      |  1 +
 common           |  1 +
 make-it-quick    |  1 +
 protocol         |  1 +
 server           |  1 +
 streaming-agent  |  1 +
 vd_agent         |  1 +
 14 files changed, 205 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 .gitlab-ci.yml
 create mode 100644 .gitmodules
 create mode 100644 Makefile
 create mode 100644 README.md
 create mode 100755 autogen.sh
 create mode 100644 clients/Makefile
 create mode 160000 clients/gtk
 create mode 160000 common
 create mode 160000 make-it-quick
 create mode 160000 protocol
 create mode 160000 server
 create mode 160000 streaming-agent
 create mode 160000 vd_agent

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d68eccb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.objects/
+.logs/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..0881384
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,57 @@
+image: fedora:latest
+
+variables:
+  GIT_SUBMODULE_STRATEGY: recursive
+
+before_script:
+  - dnf install git libtool make pyparsing python2-six python3-six gcc-c++ redhat-rpm-config -y
+  - dnf install pkg-config glib2-devel gtk3-devel celt051-devel opus-devel pixman-devel openssl-devel libjpeg-devel cyrus-sasl-devel lz4-devel gstreamer1-devel gstreamer1-plugins-base-devel orc-devel   -y
+  - git submodule sync --recursive
+  - git submodule update --init --recursive
+
+test:
+  script:
+  - make test
+  - make debug-test
+  - make opt-test
+  - make release-test
+
+make_only:
+  script:
+  - make
+  - make opt
+  - make release
+  - make debug
+  - make opt
+  - make release
+  - make debug
+
+statistics:
+  script:
+  - make opt-test
+
+rebuild:
+  script:
+  - make debug
+  - make debug
+  - make nuke
+  - make debug
+  - make debug-restart
+
+help:
+  script:
+  - make help
+
+build_scalability:
+  script:
+  - make -j4 debug
+  - make -j4 debug
+  - make nuke
+  - make -j8 debug
+  - make -j8 debug
+
+autogen:
+  script:
+  - time ./autogen.sh "make install"
+  - make restore
+  - time make -j
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..117787d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,21 @@
+[submodule "protocol"]
+	path = protocol
+	url = ../spice-protocol.git
+[submodule "clients/gtk"]
+	path = clients/gtk
+	url = ../spice-gtk.git
+[submodule "server"]
+	path = server
+	url = ../spice-server.git
+[submodule "streaming-agent"]
+	path = streaming-agent
+	url = ../spice-streaming-agent.git
+[submodule "make-it-quick"]
+	path = make-it-quick
+	url = ../make-it-quick.git
+[submodule "common"]
+	path = common
+	url = ../spice-common.git
+[submodule "vd_agent"]
+	path = vd_agent
+	url = ../vd_agent.git
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7149e99
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,41 @@
+MIQ=make-it-quick/
+
+export SPICE_PROTOCOL=$(abspath protocol)/
+export SPICE_COMMON=$(abspath common)/
+export SPICE_STREAMING_AGENT=$(abspath streaming-agent)/
+
+SUBDIRS=	protocol			\
+		common				\
+		clients				\
+		server				\
+		streaming-agent			\
+		vd_agent			\
+		$(wildcard *-streaming-plugin)
+
+-include autogen.mk
+include $(MIQ)rules.mk
+
+$(MIQ)rules.mk:
+	git submodule update --init --recursive
+
+all install: $(AUTOGEN:%=%.autogen)
+
+gitclean restore: $(AUTOGEN:%=%.autorestore)
+	$(PRINT_COMMAND) git clean -dfx
+	$(PRINT_COMMAND) git submodule foreach 'git clean -dfx'
+distclean: gitclean
+
+help:	top-level-help
+top-level-help:
+	@echo "Specific top-level target:"
+	@echo "  make gitclean		: Cleanup recursively using git clean"
+	@echo "  make restore		: Restore the c3d/build build system"
+	@echo "Using autoconf:"
+	@echo "  ./autogen.sh		: Run autoconf in all submodules"
+	@echo "  ./autogen.sh 'make -j'	: Run autogen and make submodules"
+	@echo "  (After this, 'make' builds using auto-generated makefiles)"
+
+%.autogen:
+	cd $* && make $(MAKECMDGOAL)
+%.autorestore:
+	cd $* && for I in `git status | grep -i 'modified:.*Makefile' | sed -e 's|modified:||g' `; do echo Restoring $$I in $* ; git checkout $$I; done
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9553b6d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,51 @@
+# SPICE: Simple Protocol for Independent Computing Environments
+
+SPICE is a protocol for remote access to computers.
+It consists of several separate components:
+
+* A server which captures frames and sends them to the clients
+* Clients render the captured frames and displays them on the local computer
+* Agents that run in the (possibly virtual) computer and facilitate
+  some aspects of the remote interaction, such as copy-pasting or file
+  transfers.
+* A special kind of agent, the streaming agent, is designed to capture
+  frames as a live video stream using hardware acceleration if
+  available in the given computing environment.
+
+
+This repository is simply a way to access all SPICE components from a
+single location.
+
+## Building SPICE
+
+SPICE can be built using two methods at the moment:
+
+* Using just `make`, in which case all dependencies and configurations
+  are dealt with using the `c3d/build` makefile-based build system.
+  This approach requires `pkg-config`, but not `autoconf` or
+  `automake`. It has been tested successfully on Fedora 27 and macOS
+  High Sierra. It is generally much faster, and does not require any
+  package installation, which makes it the recommended method for
+  development that impact multiple components (e.g. protocol changes).
+  To use this method, simply type (from the top level):
+
+       make -j
+
+  You can get help about the available build targets with:
+
+       make help
+
+  Additional tips on using this system can be found at
+  https://github.com/c3d/build
+
+* Using `autotools`, which will be more familiar for many long-time
+  software maintainers. This approach is more suited to installation,
+  and requires early-stage components (e.g. spice-protocol) to be
+  installed in order to satisfy the dependencies of later modules.
+  To build using `autotools`, simply type (form the top level):
+
+       ./autogen.sh "make -j install"
+
+Once you have built with `autogen.sh`, subsequent invokations of
+`make` will use the `autotool`-generated makefiles. You can revert at
+any time to the `c3d/build` build system using `make restore`.
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..9381e13
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+git submodule update --init
+
+echo RECURSE=all                                        >  autogen.mk
+echo SUBDIRS=                                           >> autogen.mk
+
+export PKG_CONFIG_PATH=/usr/local/share/pkgconfig:$PKG_CONFIG_PATH
+
+BUILD_STEP=
+if [ "x$1" != "x" ]; then
+    BUILD_STEP="$1"
+    shift
+fi
+
+for DIR in protocol common clients/gtk server streaming-agent
+do
+    echo Entering $DIR
+    (cd $DIR && ./autogen.sh ${1+"$@"} && ([ -z "$BUILD_STEP" ] || $BUILD_STEP))
+    echo "AUTOGEN+=$DIR"                            >> autogen.mk
+done
diff --git a/clients/Makefile b/clients/Makefile
new file mode 100644
index 0000000..2e94f3a
--- /dev/null
+++ b/clients/Makefile
@@ -0,0 +1,5 @@
+MIQ=../make-it-quick/
+
+SUBDIRS=	gtk
+
+include $(MIQ)rules.mk
diff --git a/clients/gtk b/clients/gtk
new file mode 160000
index 0000000..b3bd0da
--- /dev/null
+++ b/clients/gtk
@@ -0,0 +1 @@
+Subproject commit b3bd0da1dcbba3c11352263dde2465b434edc68c
diff --git a/common b/common
new file mode 160000
index 0000000..c80805e
--- /dev/null
+++ b/common
@@ -0,0 +1 @@
+Subproject commit c80805e373a2b20b43613ec46f2357ed280ee79c
diff --git a/make-it-quick b/make-it-quick
new file mode 160000
index 0000000..741ce20
--- /dev/null
+++ b/make-it-quick
@@ -0,0 +1 @@
+Subproject commit 741ce2047c35ae4a18b695ad9f50360b7df01181
diff --git a/protocol b/protocol
new file mode 160000
index 0000000..3abbada
--- /dev/null
+++ b/protocol
@@ -0,0 +1 @@
+Subproject commit 3abbada96d749871eadc5335cc359dd58ac09dd3
diff --git a/server b/server
new file mode 160000
index 0000000..327c12b
--- /dev/null
+++ b/server
@@ -0,0 +1 @@
+Subproject commit 327c12b884b1febec028c8cbcc5015880cebb977
diff --git a/streaming-agent b/streaming-agent
new file mode 160000
index 0000000..d585c50
--- /dev/null
+++ b/streaming-agent
@@ -0,0 +1 @@
+Subproject commit d585c50bf91b001c58ede5a3e7cf9a7bff4e4ed7
diff --git a/vd_agent b/vd_agent
new file mode 160000
index 0000000..452c8ed
--- /dev/null
+++ b/vd_agent
@@ -0,0 +1 @@
+Subproject commit 452c8ede4c0049a1bdf1ae22a4e9bdc2c22be7f0
--
2.13.5 (Apple Git-94)


More information about the Spice-devel mailing list