diff options
author | Eric Engestrom | 2018-03-12 11:17:55 -0500 |
---|---|---|
committer | Eric Engestrom | 2018-03-14 04:47:39 -0500 |
commit | 2bd461e32a5fd50169704786ba975324ddc11cb2 (patch) | |
tree | cfd8d7cd651ed2e7d357b32719578083f744c950 | |
parent | 0663dbd3efc7e6d644662c903722d1fc4a199cfa (diff) | |
download | external-libdrm-2bd461e32a5fd50169704786ba975324ddc11cb2.tar.gz external-libdrm-2bd461e32a5fd50169704786ba975324ddc11cb2.tar.xz external-libdrm-2bd461e32a5fd50169704786ba975324ddc11cb2.zip |
meson: make it easy to add headers to check
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
-rw-r--r-- | meson.build | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/meson.build b/meson.build index a0c79e30..b85f1d7a 100644 --- a/meson.build +++ b/meson.build | |||
@@ -186,12 +186,11 @@ else | |||
186 | dep_rt = [] | 186 | dep_rt = [] |
187 | endif | 187 | endif |
188 | dep_m = cc.find_library('m', required : false) | 188 | dep_m = cc.find_library('m', required : false) |
189 | if cc.compiles('#include <sys/sysctl.h>', name : 'sys/sysctl.h works') | 189 | foreach header : ['sys/sysctl.h', 'sys/select.h'] |
190 | config.set10('HAVE_SYS_SYSCTL_H', true) | 190 | if cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)) |
191 | endif | 191 | config.set10('HAVE_' + header.underscorify().to_upper(), true) |
192 | if cc.compiles('#include <sys/select.h>', name : 'sys/select.h works') | 192 | endif |
193 | config.set10('HAVE_SYS_SELECT_H', true) | 193 | endforeach |
194 | endif | ||
195 | if cc.has_header_symbol('sys/sysmacros.h', 'major') | 194 | if cc.has_header_symbol('sys/sysmacros.h', 'major') |
196 | config.set10('MAJOR_IN_SYSMACROS', true) | 195 | config.set10('MAJOR_IN_SYSMACROS', true) |
197 | elif cc.has_header_symbol('sys/mkdev.h', 'major') | 196 | elif cc.has_header_symbol('sys/mkdev.h', 'major') |