[PATCH xserver] meson: Require libdrm for dri1/2/3 when configured 'auto' as well as 'true'

Jon Turney jon.turney at dronecode.org.uk
Thu Mar 8 12:34:26 UTC 2018


If dri1/2/3 are configured for auto-detection, libdrm is required, as well
as the corresponding proto.  (Practically we will always have the
corresponding protos now, as they are part of xorgproto).

Signed-off-by: Jon Turney <jon.turney at dronecode.org.uk>
---
 meson.build | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index 3579d078a..32d72045b 100644
--- a/meson.build
+++ b/meson.build
@@ -279,20 +279,22 @@ endif
 
 build_glx = get_option('glx')
 
+libdrm_dep = dependency('libdrm', version: '>= 2.4.89', required: false)
+
 if get_option('dri1') == 'auto'
-    build_dri1 = xf86driproto_dep.found()
+    build_dri1 = xf86driproto_dep.found() and libdrm_dep.found()
 else
     build_dri1 = get_option('dri1') == 'true'
 endif
 
 if get_option('dri2') == 'auto'
-    build_dri2 = dri2proto_dep.found()
+    build_dri2 = dri2proto_dep.found() and libdrm_dep.found()
 else
     build_dri2 = get_option('dri2') == 'true'
 endif
 
 if get_option('dri3') == 'auto'
-    build_dri3 = dri3proto_dep.found() and xshmfence_dep.found()
+    build_dri3 = dri3proto_dep.found() and xshmfence_dep.found() and libdrm_dep.found()
 else
     build_dri3 = get_option('dri3') == 'true'
     if build_dri3
@@ -302,8 +304,11 @@ else
     endif
 endif
 
-libdrm_required = (get_option('dri1') == 'true') or (get_option('dri2') == 'true') or (get_option('dri3') == 'true')
-libdrm_dep = dependency('libdrm', version: '>= 2.4.89', required: libdrm_required)
+libdrm_required = build_dri1 or build_dri2 or build_dri3
+if not libdrm_dep.found() and libdrm_required
+    error('DRI requested, but LIBDRM not found')
+endif
+
 build_modesetting = libdrm_dep.found()
 
 build_vbe = false
-- 
2.16.2



More information about the xorg-devel mailing list