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

sardemff7+wayland at sardemff7.net sardemff7+wayland at sardemff7.net
Fri Oct 31 08:43:02 PDT 2014


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.

-- 

Quentin “Sardem FF7” Glidic


More information about the wayland-devel mailing list