[Spice-devel] [spice-gtk] build-sys:tests: Error out unless --enable-static is used

Christophe Fergeau cfergeau at redhat.com
Tue Oct 13 02:54:15 PDT 2015


On Tue, Oct 13, 2015 at 11:39:17AM +0200, Victor Toso wrote:
> Hey,
> 
> On Tue, Oct 13, 2015 at 10:56:00AM +0200, Christophe Fergeau wrote:
> > The binaries in tests/ need a static build of spice-gtk libraries in
> > order to be built, but by default, we disable static libraries at
> > LT_INIT() time.
> > As the compile failure can be quite cryptic when someone
> > tries to manually run 'make -C tests', this commit adds an explicit
> > error message when trying to build the tests without --enable-static.
> > ---
> >  tests/Makefile.am | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/tests/Makefile.am b/tests/Makefile.am
> > index 19c02b6..144bc38 100644
> > --- a/tests/Makefile.am
> > +++ b/tests/Makefile.am
> > @@ -1,3 +1,6 @@
> > +if !BUILD_TESTS
> > +$(error Building tests requires using --enable-static)
> > +endif
> >  NULL =
> >
> >  noinst_PROGRAMS =				\
> > --
> > 2.5.0
> 
> ack as well.
> 
> I really don't understand why we do tests on when --enable-static only.
> Personally I prefer --enable-debug and do the linking...
> 
> http://lists.freedesktop.org/archives/spice-devel/2015-February/019049.html

Ah hmm some version of this could work too indeed. I'd rather that we
don't hardcode ./libs/xxx.o though. Maybe the .lo files can be used?
Alternatively, adding the needed C files from src/ to coroutine_SOURCES
may work?

coroutine_SOURCES=$(top_srcdir)/src/coroutine_ucontext.c $(top_srcdir)/src/continuation.c

Writing this makes me realize that coroutine are not necessarily
implemented using ucontext, but can use gthread or the win32 API, and
all this logic is already present in src/Makefile.am, so linking with
the resulting library means we benefit from this logic for free.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20151013/5e22d4bf/attachment.sig>


More information about the Spice-devel mailing list