[PATCH weston 3/3] build: make libdrm a hard build-time dependency

Pekka Paalanen ppaalanen at gmail.com
Fri Apr 7 09:16:05 UTC 2017


On Thu, 6 Apr 2017 15:22:39 +0200
Quentin Glidic <sardemff7+wayland at sardemff7.net> wrote:

> On 4/6/17 2:09 PM, Pekka Paalanen wrote:
> > From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > 
> > Libdrm provides headers that are useful even without libdrm.so itself,
> > particularly drm_fourcc.h. Therefore promote libdrm as a hard build-time
> > dependency of libweston core so that we can always rely on libdrm
> > headers.
> > 
> > This does not affect any runtime dependencies. Specifically, no runtime
> > dependency to libdrm.so is added in any build configuration.
> > 
> > Currently only gl-renderer is using drm_fourcc.h. Now we can drop the
> > GL_RENDERER check from configure.ac and just use LIBDRM_CFLAGS.
> > 
> > Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>  
> 
> Nice(ly documented) cleanup :-)
> Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>
> 
> (Nitpick below, for the sake of nitpicking. ;-) )
> 
> Thanks,
> 
> > ---
> >   Makefile.am  |  2 +-
> >   configure.ac | 12 +++++++++---
> >   2 files changed, 10 insertions(+), 4 deletions(-)
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index ff927c1..8ecc90c 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -324,7 +324,7 @@ gl_renderer_la_LIBADD =				\
> >   gl_renderer_la_CFLAGS =				\
> >   	$(COMPOSITOR_CFLAGS)			\
> >   	$(EGL_CFLAGS)				\
> > -	$(GL_RENDERER_CFLAGS)			\
> > +	$(LIBDRM_CFLAGS)			\
> >   	$(AM_CFLAGS)
> >   gl_renderer_la_SOURCES =			\
> >   	libweston/gl-renderer.h			\
> > diff --git a/configure.ac b/configure.ac
> > index 39c0531..2da3e05 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -105,6 +105,15 @@ AC_CHECK_HEADERS([execinfo.h])
> >   
> >   AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
> >   
> > +# check for libdrm as a build-time dependency only
> > +# libdrm 2.4.30 introduced drm_fourcc.h.
> > +PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.30], have_libdrm=yes, have_libdrm=no)
> > +AS_IF([test "x$have_libdrm" != "xyes"],
> > +      [AC_MSG_ERROR([libdrm is a hard build-time dependency for libweston core,
> > +                     but a sufficient version was not found. However, libdrm
> > +                     is not a runtime dependency unless you have features
> > +                     enabled that require it.])])
> > +  
> 
> FTR, as said on IRC, could have been
> 
> PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.30], [], [AC_MSG_ERROR([
>      libdrm is a hard build-time dependency for libweston core,
>      but a sufficient version was not found. However, libdrm
>      is not a runtime dependency unless you have features
>      enabled that require it.])])
> 
> or similar.

Hi Quentin,

I like that, the runtime output actually flows much better than I
thought:

checking for LIBDRM... no
configure: error: 
     libdrm is a hard build-time dependency for libweston core,
     but a sufficient version was not found. However, libdrm
     is not a runtime dependency unless you have features
     enabled that require it.

I used your suggestion as is, and pushed all three:
   c394179..b030897  master -> master


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170407/f4b18740/attachment.sig>


More information about the wayland-devel mailing list