meson.build: Fix header detection on FreeBSD

FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
includes when checking for headers.
Instead of splitting out the check for sys/sysctl.h from the other
header checks, just add sys/types.h to all header checks.

v2 [Emil]
 - add inline comment
 - drop bash/sh hunk

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
main
Niclas Zeising 2019-06-16 14:23:43 +01:00 committed by Eric Engestrom
parent 7e46f4dc80
commit 4083e8f2c6
1 changed files with 4 additions and 1 deletions

View File

@ -179,9 +179,12 @@ 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']
config.set('HAVE_' + header.underscorify().to_upper(),
cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)))
cc.compiles('#include <sys/types.h>\n#include <@0@>'.format(header), name : '@0@ works'.format(header)))
endforeach
if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
cc.has_header_symbol('sys/sysmacros.h', 'minor') and