[PATCH libdrm 1/2] meson: make it easy to add headers to check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Eric Engestrom <eric.engestrom@xxxxxxxxxx>
---
 meson.build | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/meson.build b/meson.build
index f4c95394c52e65672f24..3a33928d02a6dce5f075 100644
--- a/meson.build
+++ b/meson.build
@@ -186,12 +186,11 @@ else
   dep_rt = []
 endif
 dep_m = cc.find_library('m', required : false)
-if cc.compiles('#include <sys/sysctl.h>', name : 'sys/sysctl.h works')
-  config.set10('HAVE_SYS_SYSCTL_H', true)
-endif
-if cc.compiles('#include <sys/select.h>', name : 'sys/select.h works')
-  config.set10('HAVE_SYS_SELECT_H', true)
-endif
+foreach header : ['sys/sysctl.h', 'sys/select.h']
+  if cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header))
+    config.set10('HAVE_' + header.underscorify().to_upper(), true)
+  endif
+endforeach
 if cc.has_header_symbol('sys/sysmacros.h', 'major')
   config.set10('MAJOR_IN_SYSMACROS', true)
 elif cc.has_header_symbol('sys/mkdev.h', 'major')
-- 
Cheers,
  Eric

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux