[Spice-commits] configure.ac Makefile.am src/Makefile.am tests/Makefile.am

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 22 13:50:23 UTC 2018


 Makefile.am       |    6 +-----
 configure.ac      |    2 --
 src/Makefile.am   |   34 +++++++++++++++++++---------------
 tests/Makefile.am |    4 ++--
 4 files changed, 22 insertions(+), 24 deletions(-)

New commits:
commit eab33dca15c507570ccc4fec5ffd2e4c23355243
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Wed Nov 21 09:04:35 2018 +0100

    build: Remove need for --enable-static for building tests
    
    Currently, spice-gtk tests are disabled if build of static libraries is
    disabled. This commit introduces an intermediate
    spice-client-glib-impl.la convenience library which will be used both
    for generating the spice-client-glib-2.0 shared library (after applying
    the version script), and to link the tests with.
    This is better than using --enable-static as we don't need to rebuild
    each object twice (static and shared).
    
    This was inspired by similar work Fabiano Fidencio did in libosinfo:
    https://www.redhat.com/archives/libosinfo/2018-November/msg00231.html
    
    Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/Makefile.am b/Makefile.am
index e9dfbe4..6881007 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,7 @@
 ACLOCAL_AMFLAGS = -I m4
 NULL =
 
-SUBDIRS = subprojects/spice-common src man po doc data tools
-
-if BUILD_TESTS
-SUBDIRS += tests
-endif
+SUBDIRS = subprojects/spice-common src man po doc data tools tests
 
 if HAVE_INTROSPECTION
 if WITH_VALA
diff --git a/configure.ac b/configure.ac
index e686d76..69c03da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -571,8 +571,6 @@ AC_SUBST(SPICE_GTK_REQUIRES)
 
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
-AM_CONDITIONAL([BUILD_TESTS], [test x"$enable_static" = xyes])
-
 AC_OUTPUT([
 Makefile
 spice-client-glib-2.0.pc
diff --git a/src/Makefile.am b/src/Makefile.am
index 1bb6f9b..b876530 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -44,6 +44,7 @@ acldir = $(ACL_HELPER_DIR)
 acl_PROGRAMS = spice-client-glib-usb-acl-helper
 endif
 
+noinst_LTLIBRARIES = libspice-client-glib-impl.la
 lib_LTLIBRARIES = libspice-client-glib-2.0.la
 
 if WITH_GTK
@@ -175,7 +176,9 @@ libspice_client_glib_2_0_la_LDFLAGS =	\
 	$(GLIB_SYMBOLS_LDFLAGS)		\
 	$(NULL)
 
-libspice_client_glib_2_0_la_LIBADD =					\
+libspice_client_glib_2_0_la_LIBADD = libspice-client-glib-impl.la
+
+libspice_client_glib_impl_la_LIBADD =					\
 	$(SPICE_COMMON_DIR)/common/libspice-common.la			\
 	$(SPICE_COMMON_DIR)/common/libspice-common-client.la		\
 	$(GLIB2_LIBS)							\
@@ -208,7 +211,8 @@ else
 USB_ACL_HELPER_SRCS =
 endif
 
-libspice_client_glib_2_0_la_SOURCES =			\
+libspice_client_glib_2_0_la_SOURCES =
+libspice_client_glib_impl_la_SOURCES =			\
 	bio-gio.c					\
 	bio-gio.h					\
 	spice-audio.c					\
@@ -270,7 +274,7 @@ libspice_client_glib_2_0_la_SOURCES =			\
 	spice-glib-main.c				\
 	$(NULL)
 
-nodist_libspice_client_glib_2_0_la_SOURCES =	\
+nodist_libspice_client_glib_impl_la_SOURCES =	\
 	spice-glib-enums.c			\
 	spice-marshal.c				\
 	spice-marshal.h				\
@@ -308,49 +312,49 @@ nodist_libspice_client_glibinclude_HEADERS =	\
 	$(NULL)
 
 if HAVE_PULSE
-libspice_client_glib_2_0_la_SOURCES +=	\
+libspice_client_glib_impl_la_SOURCES +=	\
 	spice-pulse.c			\
 	spice-pulse.h			\
 	$(NULL)
 endif
 
 if HAVE_GSTAUDIO
-libspice_client_glib_2_0_la_SOURCES +=	\
+libspice_client_glib_impl_la_SOURCES +=	\
 	spice-gstaudio.c		\
 	spice-gstaudio.h		\
 	$(NULL)
 endif
 
 if HAVE_BUILTIN_MJPEG
-libspice_client_glib_2_0_la_SOURCES +=	\
+libspice_client_glib_impl_la_SOURCES +=	\
 	channel-display-mjpeg.c		\
 	$(NULL)
 endif
 
 if HAVE_GSTVIDEO
-libspice_client_glib_2_0_la_SOURCES +=	\
+libspice_client_glib_impl_la_SOURCES +=	\
 	channel-display-gst.c		\
 	$(NULL)
 endif
 
 if WITH_PHODAV
-libspice_client_glib_2_0_la_SOURCES +=	\
+libspice_client_glib_impl_la_SOURCES +=	\
 	giopipe.c			\
 	giopipe.h			\
 	$(NULL)
 endif
 
 if WITH_UCONTEXT
-libspice_client_glib_2_0_la_SOURCES += continuation.h continuation.c coroutine_ucontext.c
+libspice_client_glib_impl_la_SOURCES += continuation.h continuation.c coroutine_ucontext.c
 endif
 
 if WITH_WINFIBER
-libspice_client_glib_2_0_la_SOURCES += coroutine_winfibers.c
+libspice_client_glib_impl_la_SOURCES += coroutine_winfibers.c
 endif
 
 if WITH_GTHREAD
-libspice_client_glib_2_0_la_SOURCES += coroutine_gthread.c
-libspice_client_glib_2_0_la_LIBADD += $(GTHREAD_LIBS)
+libspice_client_glib_impl_la_SOURCES += coroutine_gthread.c
+libspice_client_glib_impl_la_LIBADD += $(GTHREAD_LIBS)
 endif
 
 
@@ -363,10 +367,10 @@ WIN_USB_FILES= \
 
 if OS_WIN32
 if WITH_USBREDIR
-libspice_client_glib_2_0_la_SOURCES += \
+libspice_client_glib_impl_la_SOURCES += \
 	$(WIN_USB_FILES)
 endif
-libspice_client_glib_2_0_la_LIBADD += -lws2_32 -lgdi32
+libspice_client_glib_impl_la_LIBADD += -lws2_32 -lgdi32
 endif
 
 if WITH_POLKIT
@@ -397,7 +401,7 @@ install-data-hook:
 endif
 
 
-$(libspice_client_glib_2_0_la_SOURCES): spice-glib-enums.h spice-marshal.h
+$(libspice_client_glib_impl_la_SOURCES): spice-glib-enums.h spice-marshal.h
 
 if WITH_GTK
 $(libspice_client_gtk_3_0_la_SOURCES): spice-glib-enums.h spice-widget-enums.h
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bfa43a3..1bb0a25 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -30,10 +30,10 @@ AM_CPPFLAGS =					\
 	-DG_LOG_DOMAIN=\"GSpice\"		\
 	$(NULL)
 
-AM_LDFLAGS = $(GIO_LIBS) -static
+AM_LDFLAGS = $(GIO_LIBS)
 
 LDADD =							\
-	$(top_builddir)/src/libspice-client-glib-2.0.la	\
+	$(top_builddir)/src/libspice-client-glib-impl.la\
 	$(NULL)
 
 test_util_SOURCES = util.c


More information about the Spice-commits mailing list