[Mesa-dev] [PATCH 08/14] meson: fix BSD build

Greg V greg at unrelenting.technology
Sun Dec 31 16:55:22 UTC 2017


---
 meson.build | 43 ++++++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/meson.build b/meson.build
index d9f7ea9b2c..af62baf437 100644
--- a/meson.build
+++ b/meson.build
@@ -199,12 +199,13 @@ if with_dri_i915 or with_gallium_i915
   dep_libdrm_intel = dependency('libdrm_intel', version : '>= 2.4.75')
 endif
 
+is_like_linux = host_machine.system() == 'linux' or host_machine.system().contains('bsd') # FIXME: illumos?
+
 if host_machine.system() == 'darwin'
   with_dri_platform = 'apple'
 elif ['windows', 'cygwin'].contains(host_machine.system())
   with_dri_platform = 'windows'
-elif host_machine.system() == 'linux'
-  # FIXME: This should include BSD and possibly other systems
+elif is_like_linux
   with_dri_platform = 'drm'
 else
   # FIXME: haiku doesn't use dri, and xlib doesn't use dri, probably should
@@ -222,7 +223,7 @@ with_platform_surfaceless = false
 egl_native_platform = ''
 _platforms = get_option('platforms')
 if _platforms == 'auto'
-  if ['linux'].contains(host_machine.system())
+  if is_like_linux
     _platforms = 'x11,wayland,drm,surfaceless'
   else
     error('Unknown OS, no platforms enabled. Patches gladly accepted to fix this.')
@@ -265,9 +266,9 @@ endif
 
 with_gbm = get_option('gbm')
 if with_gbm == 'auto' and with_dri  # TODO: or gallium
-  with_gbm = host_machine.system() == 'linux'
+  with_gbm = is_like_linux
 elif with_gbm == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     error('GBM only supports unix-like platforms')
   endif
   with_gbm = true
@@ -344,7 +345,7 @@ endif
 with_dri2 = (with_dri or with_any_vk) and with_dri_platform == 'drm'
 with_dri3 = get_option('dri3')
 if with_dri3 == 'auto'
-  if host_machine.system() == 'linux' and with_dri2
+  if is_like_linux and with_dri2
     with_dri3 = true
   else
     with_dri3 = false
@@ -367,7 +368,7 @@ endif
 dep_vdpau = []
 _vdpau = get_option('gallium-vdpau')
 if _vdpau == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     with_gallium_vdpau = false
   elif not with_platform_x11
     with_gallium_vdpau = false
@@ -379,7 +380,7 @@ if _vdpau == 'auto'
     with_gallium_vdpau = dep_vdpau.found()
   endif
 elif _vdpau == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     error('VDPAU state tracker can only be build on unix-like OSes.')
   elif not with_platform_x11
     error('VDPAU state tracker requires X11 support.')
@@ -410,7 +411,7 @@ endif
 dep_xvmc = []
 _xvmc = get_option('gallium-xvmc')
 if _xvmc == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     with_gallium_xvmc = false
   elif not with_platform_x11
     with_gallium_xvmc = false
@@ -421,7 +422,7 @@ if _xvmc == 'auto'
     with_gallium_xvmc = dep_xvmc.found()
   endif
 elif _xvmc == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     error('XVMC state tracker can only be build on unix-like OSes.')
   elif not with_platform_x11
     error('XVMC state tracker requires X11 support.')
@@ -448,7 +449,7 @@ endif
 dep_omx = []
 _omx = get_option('gallium-omx')
 if _omx == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     with_gallium_omx = false
   elif not with_platform_x11
     with_gallium_omx = false
@@ -459,7 +460,7 @@ if _omx == 'auto'
     with_gallium_omx = dep_omx.found()
   endif
 elif _omx == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     error('OMX state tracker can only be built on unix-like OSes.')
   elif not (with_platform_x11 or with_platform_drm)
     error('OMX state tracker requires X11 or drm platform support.')
@@ -506,7 +507,7 @@ endif
 dep_va = []
 _va = get_option('gallium-va')
 if _va == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     with_gallium_va = false
   elif not with_platform_x11
     with_gallium_va = false
@@ -517,7 +518,7 @@ if _va == 'auto'
     with_gallium_va = dep_va.found()
   endif
 elif _va == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     error('VA state tracker can only be built on unix-like OSes.')
   elif not (with_platform_x11 or with_platform_drm)
     error('VA state tracker requires X11 or drm or wayland platform support.')
@@ -543,7 +544,7 @@ endif
 
 _xa = get_option('gallium-xa')
 if _xa == 'auto'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     with_gallium_xa = false
   elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
             or with_gallium_svga)
@@ -552,7 +553,7 @@ if _xa == 'auto'
     with_gallium_xa = true
   endif
 elif _xa == 'true'
-  if not ['linux', 'bsd'].contains(host_machine.system())
+  if not is_like_linux
     error('XA state tracker can only be built on unix-like OSes.')
   elif not (with_gallium_nouveau or with_gallium_freedreno or with_gallium_i915
             or with_gallium_svga)
@@ -688,7 +689,7 @@ if cc.compiles('int foo(void) __attribute__((__noreturn__));',
 endif
 
 # TODO: this is very incomplete
-if ['linux', 'cygwin'].contains(host_machine.system())
+if is_like_linux or host_machine.system() == 'cygwin'
   pre_args += '-D_GNU_SOURCE'
 endif
 
@@ -797,23 +798,23 @@ with_asm_arch = ''
 if with_asm
   # TODO: SPARC and PPC
   if host_machine.cpu_family() == 'x86'
-    if ['linux', 'bsd'].contains(host_machine.system()) # FIXME: hurd?
+    if is_like_linux # FIXME: hurd?
       with_asm_arch = 'x86'
       pre_args += ['-DUSE_X86_ASM', '-DUSE_MMX_ASM', '-DUSE_3DNOW_ASM',
                    '-DUSE_SSE_ASM']
     endif
   elif host_machine.cpu_family() == 'x86_64'
-    if host_machine.system() == 'linux'
+    if is_like_linux
       with_asm_arch = 'x86_64'
       pre_args += ['-DUSE_X86_64_ASM']
     endif
   elif host_machine.cpu_family() == 'arm'
-    if host_machine.system() == 'linux'
+    if is_like_linux
       with_asm_arch = 'arm'
       pre_args += ['-DUSE_ARM_ASM']
     endif
   elif host_machine.cpu_family() == 'aarch64'
-    if host_machine.system() == 'linux'
+    if is_like_linux
       with_asm_arch = 'aarch64'
       pre_args += ['-DUSE_AARCH64_ASM']
     endif
-- 
2.15.1



More information about the mesa-dev mailing list