[weston V2 1/2] Check for math (m) and real time (rt) libraries

Pekka Paalanen ppaalanen at gmail.com
Fri Nov 21 04:17:53 PST 2014


On Fri, 31 Oct 2014 16:43:02 +0100
sardemff7+wayland at sardemff7.net wrote:

> On 2014-10-30 15:23, Javier Jardón wrote:
> > ---
> >   Makefile.am  | 19 +++++++++----------
> >   configure.ac |  6 ++++++
> >   2 files changed, 15 insertions(+), 10 deletions(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index 9377774..e78f6c8 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -46,6 +46,12 @@ AC_CHECK_FUNC([dlopen], [],
> >                 AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
> >   AC_SUBST(DLOPEN_LIBS)
> >
> > +AC_SEARCH_LIBS([sqrt], [m], [],
> > +               [AC_MSG_FAILURE([Math library missing])])
> > +
> > +AC_SEARCH_LIBS([clock_gettime], [rt], [],
> > +               [AC_MSG_FAILURE([Real time library missing])])
> > +
> >   AC_CHECK_DECL(SFD_CLOEXEC,[],
> >   	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile weston")],
> >   	      [[#include <sys/signalfd.h>]])
> >
> 
> That will add stuff to $(LIBS) directly, which should be avoided as much 
> as possible. The use of $(LIBS) leads to overlinking most of the time.
> I would recommend adding
> AM_SUBST_NOTMAKE(LIBS)
> to configure.ac, and add all the appropriate *_LIBS and *_CFLAGS 
> variables everywhere needed.

Yeah. We build lots of different binaries in the weston project, and
each have slightly different libraries they need. Especially I'd hate to
see e.g. weston-launch linking to anything unnecessary, since it is a
suid-root binary.

Let's try to link as little as possible, so I'm not taking these two
patches. Sorry.

Instead, as an immediate fix for Javier's original problem, I'll push
the first version of the patch.


Thanks,
pq


More information about the wayland-devel mailing list