[Spice-devel] [PATCH spice-server 1/3] build: Move spice-common to subprojects/ directory
Eduardo Lima (Etrunko)
etrunko at redhat.com
Mon Jul 23 16:55:20 UTC 2018
On 22/07/18 11:15, Frediano Ziglio wrote:
>>
>> On 20/07/18 18:23, Eduardo Lima (Etrunko) wrote:
>>> The reason for this commit is that Meson expects all submodules to be
>>> placed in this subdirectory, and since autotools build is more flexible
>>> in this case, we make some small adjustments to configure.ac and
>>> Makefile.am files to accommodate for this change.
>>>
>>
>> CI is happy OK this change:
>>
>> https://gitlab.freedesktop.org/etrunko/spice/pipelines/2359
>>
>>> Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
>>> ---
>>> .gitmodules | 2 +-
>>> Makefile.am | 2 +-
>>> autogen.sh | 2 +-
>>> configure.ac | 6 +++---
>>> server/Makefile.am | 4 ++--
>>> server/tests/Makefile.am | 4 ++--
>>> spice-common => subprojects/spice-common | 0
>>> 7 files changed, 10 insertions(+), 10 deletions(-)
>>> rename spice-common => subprojects/spice-common (100%)
>>>
>>> diff --git a/.gitmodules b/.gitmodules
>>> index ef8d8f9a..53f2e3a2 100644
>>> --- a/.gitmodules
>>> +++ b/.gitmodules
>>> @@ -1,3 +1,3 @@
>>> [submodule "spice-common"]
>>> - path = spice-common
>>> + path = subprojects/spice-common
>>> url = ../spice-common.git
>>> diff --git a/Makefile.am b/Makefile.am
>>> index 8acc019b..3845f2b5 100644
>>> --- a/Makefile.am
>>> +++ b/Makefile.am
>>> @@ -1,7 +1,7 @@
>>> NULL =
>>> ACLOCAL_AMFLAGS = -I m4
>>>
>>> -SUBDIRS = spice-common server docs tools
>>> +SUBDIRS = subprojects/spice-common server docs tools
>>>
>>> check-valgrind:
>>> $(MAKE) -C server check-valgrind
>>> diff --git a/autogen.sh b/autogen.sh
>>> index e9080fe8..025189a6 100755
>>> --- a/autogen.sh
>>> +++ b/autogen.sh
>>> @@ -8,7 +8,7 @@ test -z "$srcdir" && srcdir=.
>>> olddir=`pwd`
>>> cd "$srcdir"
>>>
>>> -git submodule update --init --recursive
>>> +git submodule update --init --recursive subprojects/spice-common
>>>
>
> I think that if you don't specify the directories it takes all
> of them specified under .gitmodules.
> I tried to remove the "subprojects/spice-common" and is still
> working.
>
You are right, this is not necessary. I am not sure why I changed this
line, for some reason, while trying to get it right and experimenting
with different stuff, I might have left this over.
>>> mkdir -p m4
>>> autoreconf --verbose --force --install
>>> diff --git a/configure.ac b/configure.ac
>>> index 56485938..31bc8a44 100644
>>> --- a/configure.ac
>>> +++ b/configure.ac
>>> @@ -30,7 +30,7 @@ SPICE_SERVER_VERSION=`printf "0x%02x%02x%02x" $major
>>> $minor $micro`
>>> AC_SUBST(SPICE_SERVER_VERSION)
>>>
>>> AC_CONFIG_MACRO_DIR([m4])
>>> -m4_include([spice-common/m4/spice-deps.m4])
>>> +m4_include([subprojects/spice-common/m4/spice-deps.m4])
>>> AM_CONFIG_HEADER([config.h])
>>> AC_CONFIG_AUX_DIR(.)
>>>
>>> @@ -139,8 +139,8 @@ AM_CONDITIONAL(HAVE_SASL, test "x$have_sasl" = "xyes")
>>> dnl
>>> =========================================================================
>>> dnl Check deps
>>>
>>> -AC_CONFIG_SUBDIRS([spice-common])
>>> -COMMON_CFLAGS='-I ${top_srcdir}/spice-common/ -I
>>> ${top_builddir}/spice-common/'
>>> +AC_CONFIG_SUBDIRS([subprojects/spice-common])
>>> +COMMON_CFLAGS='-I ${top_srcdir}/subprojects/spice-common/ -I
>>> ${top_builddir}/subprojects/spice-common/'
>>> COMMON_CFLAGS="$COMMON_CFLAGS -DG_LOG_DOMAIN=\\\"Spice\\\""
>>> AC_SUBST(COMMON_CFLAGS)
>>>
>>> diff --git a/server/Makefile.am b/server/Makefile.am
>>> index 2fee378f..94051760 100644
>>> --- a/server/Makefile.am
>>> +++ b/server/Makefile.am
>>> @@ -40,8 +40,8 @@ EXTRA_libspice_server_la_DEPENDENCIES =
>>> $(srcdir)/spice-server.syms
>>> endif
>>>
>>> libserver_la_LIBADD = \
>>> - $(top_builddir)/spice-common/common/libspice-common.la \
>>> - $(top_builddir)/spice-common/common/libspice-common-server.la \
>>> + $(top_builddir)/subprojects/spice-common/common/libspice-common.la \
>>> + $(top_builddir)/subprojects/spice-common/common/libspice-common-server.la
>>> \
>
> These are no aligned as they were before.
> I would define (here and below) a "spice_common_dir" to make these shorter like
>
> spice_common_dir = $(top_buildir)/subprojects/spice-common
>
> ...
> libserver_la_LIBADD = \
> $(spice_common_dir)/common/libspice-common.la ...
>
Okay, as it is used in tests/Makefile.am I added this variable in
configure.ac, so it can be reused everywhere.
>>> $(GL_LIBS) \
>>> $(GLIB2_LIBS) \
>>> $(GOBJECT2_LIBS) \
>>> diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
>>> index ffeb8fc0..4d5c4038 100644
>>> --- a/server/tests/Makefile.am
>>> +++ b/server/tests/Makefile.am
>>> @@ -38,7 +38,7 @@ libtest_a_SOURCES = \
>>>
>>> LDADD = \
>>> libtest.a \
>>> - $(top_builddir)/spice-common/common/libspice-common.la \
>>> + $(top_builddir)/subprojects/spice-common/common/libspice-common.la \
>>> $(top_builddir)/server/libserver.la \
>>> $(GIO_UNIX_LIBS) \
>>> $(GLIB2_LIBS) \
>>> @@ -87,7 +87,7 @@ spice_server_replay_SOURCES = replay.c \
>>> basic-event-loop.h
>>>
>>> spice_server_replay_LDADD = \
>>> - $(top_builddir)/spice-common/common/libspice-common.la \
>>> + $(top_builddir)/subprojects/spice-common/common/libspice-common.la \
>>> $(top_builddir)/server/libspice-server.la \
>>> $(GLIB2_LIBS) \
>>> $(GOBJECT2_LIBS) \
>>> diff --git a/spice-common b/subprojects/spice-common
>>> similarity index 100%
>>> rename from spice-common
>>> rename to subprojects/spice-common
>>>
>>
>
> Frediano
>
--
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com
More information about the Spice-devel
mailing list