[PATCH libdrm] meson.build: Don't detect <sys/sysctl.h> header for linux

Seung-Woo Kim sw0312.kim at samsung.com
Fri Jan 10 04:30:41 UTC 2020


The <sys/sysctl.h> header is not required for Linux and GNU libc
2.30 starts to warn about Linux specific <sys/sysctl.h> header
deprecation. Don't detect <sys/sysctl.h> header for linux.

Signed-off-by: Seung-Woo Kim <sw0312.kim at samsung.com>
---
Fix meson.build script instead of code itself as commented below:
https://patchwork.kernel.org/patch/11325345/
---
 meson.build |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/meson.build b/meson.build
index 782b1a3..b1c557a 100644
--- a/meson.build
+++ b/meson.build
@@ -183,10 +183,17 @@ else
   dep_rt = []
 endif
 dep_m = cc.find_library('m', required : false)
-# From Niclas Zeising:
-# FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
-# includes when checking for headers.
-foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
+if not ['linux'].contains(host_machine.system())
+  # From Niclas Zeising:
+  # FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
+  # includes when checking for headers.
+  foreach header : ['sys/sysctl.h']
+    config.set('HAVE_' + header.underscorify().to_upper(),
+      cc.compiles('#include <sys/types.h>\n#include <@0@>'.format(header), name : '@0@ works'.format(header)))
+  endforeach
+endif
+endforeach
+foreach header : ['sys/select.h', 'alloca.h']
   config.set('HAVE_' + header.underscorify().to_upper(),
     cc.compiles('#include <sys/types.h>\n#include <@0@>'.format(header), name : '@0@ works'.format(header)))
 endforeach
-- 
1.7.4.1



More information about the dri-devel mailing list