[PATCH weston 1/3] configure: replace HAVE_LIBDRM with BUILD_DRM_COMPOSITOR

Quentin Glidic sardemff7+wayland at sardemff7.net
Thu Apr 6 13:17:25 UTC 2017


On 4/6/17 2:09 PM, Pekka Paalanen wrote:
> From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> HAVE_LIBDRM was used as a condition for the launcher infrastructure to
> call libdrm.so functions. It was set by an independent test for libdrm,
> which would silently continue if libdrm was not found. It was assumed
> that if you enabled a feature that used libdrm at runtime, the test for
> that feature would imply that HAVE_LIBDRM is also set. This was quite
> subtle.
> 
> The only feature that actually uses libdrm.so at runtime is the DRM
> backend. No other backend needs the libdrm calls in the launcher
> infrastructure.
> 
> Therefore to simplify things, stop using HAVE_LIBDRM and use
> BUILD_DRM_COMPOSITOR instead. If you enable the DRM compositor, you
> automatically also get libdrm support in the launchers.
> 
> There are still things depending on LIBDRM_CFLAGS and LIBDRM_LIBS, so
> the test cannot be removed completely.
> 
> Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

It makes clear these are DRM-specific:
Reviewed-by: Quentin Glidic <sardemff7+git at sardemff7.net>

Thanks,

> ---
>   configure.ac                       | 3 +--
>   libweston/launcher-direct.c        | 2 +-
>   libweston/launcher-weston-launch.c | 2 +-
>   libweston/weston-launch.c          | 2 +-
>   4 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 6cc9f26..39c0531 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -177,8 +177,7 @@ if test x$enable_xwayland = xyes; then
>     fi
>   fi
>   
> -PKG_CHECK_MODULES(LIBDRM, [libdrm],
> -                  [AC_DEFINE(HAVE_LIBDRM, 1, [Define if libdrm is available]) have_libdrm=yes], have_libdrm=no)
> +PKG_CHECK_MODULES(LIBDRM, [libdrm], have_libdrm=yes, have_libdrm=no)
>   
>   AC_ARG_ENABLE(x11-compositor, [  --enable-x11-compositor],,
>   	      enable_x11_compositor=yes)
> diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
> index 3d8f5f6..a5d3ee5 100644
> --- a/libweston/launcher-direct.c
> +++ b/libweston/launcher-direct.c
> @@ -47,7 +47,7 @@
>   #define KDSKBMUTE	0x4B51
>   #endif
>   
> -#ifdef HAVE_LIBDRM
> +#ifdef BUILD_DRM_COMPOSITOR
>   
>   #include <xf86drm.h>
>   
> diff --git a/libweston/launcher-weston-launch.c b/libweston/launcher-weston-launch.c
> index a7535ce..97da18c 100644
> --- a/libweston/launcher-weston-launch.c
> +++ b/libweston/launcher-weston-launch.c
> @@ -55,7 +55,7 @@
>   #define KDSKBMUTE	0x4B51
>   #endif
>   
> -#ifdef HAVE_LIBDRM
> +#ifdef BUILD_DRM_COMPOSITOR
>   
>   #include <xf86drm.h>
>   
> diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
> index eecb911..aa7e071 100644
> --- a/libweston/weston-launch.c
> +++ b/libweston/weston-launch.c
> @@ -73,7 +73,7 @@
>   
>   #define MAX_ARGV_SIZE 256
>   
> -#ifdef HAVE_LIBDRM
> +#ifdef BUILD_DRM_COMPOSITOR
>   
>   #include <xf86drm.h>
>   
> 


-- 

Quentin “Sardem FF7” Glidic


More information about the wayland-devel mailing list