From b030897b380be4ac8089deecc3db6967dfe7923e Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Thu, 6 Apr 2017 14:06:20 +0300 Subject: [PATCH] build: make libdrm a hard build-time dependency 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, from Quentin: just drop have_libdrm var completely] Reviewed-by: Quentin Glidic --- Makefile.am | 2 +- configure.ac | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index ff927c15..8ecc90cd 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 39c05318..db757f20 100644 --- a/configure.ac +++ b/configure.ac @@ -105,6 +105,14 @@ 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], [], [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.])]) + COMPOSITOR_MODULES="wayland-server >= $WAYLAND_PREREQ_VERSION pixman-1 >= 0.25.2" AC_CONFIG_FILES([doc/doxygen/tools.doxygen doc/doxygen/tooldev.doxygen]) @@ -133,7 +141,6 @@ if test x$enable_egl = xyes; then AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support]) PKG_CHECK_MODULES(EGL, [egl glesv2]) PKG_CHECK_MODULES([EGL_TESTS], [egl glesv2 wayland-client wayland-egl]) - PKG_CHECK_MODULES([GL_RENDERER], [libdrm]) fi AC_ARG_ENABLE(xkbcommon, @@ -177,8 +184,6 @@ if test x$enable_xwayland = xyes; then fi fi -PKG_CHECK_MODULES(LIBDRM, [libdrm], have_libdrm=yes, have_libdrm=no) - AC_ARG_ENABLE(x11-compositor, [ --enable-x11-compositor],, enable_x11_compositor=yes) AM_CONDITIONAL(ENABLE_X11_COMPOSITOR, test x$enable_x11_compositor = xyes)