meson: don't detect <sys/sysctl.h> on Linux
The header is not required on Linux, and is in fact deprecated in glibc 2.30+ Reported-by: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Niclas Zeising <zeising@daemonic.se> Signed-off-by: Eric Engestrom <eric@engestrom.ch> Tested-by: Niclas Zeising <zeising@daemonc.se>main
parent
8cef557062
commit
1f8ada8023
20
meson.build
20
meson.build
|
@ -183,13 +183,23 @@ else
|
||||||
dep_rt = []
|
dep_rt = []
|
||||||
endif
|
endif
|
||||||
dep_m = cc.find_library('m', required : false)
|
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
|
# The header is not required on Linux, and is in fact deprecated in glibc 2.30+
|
||||||
# includes when checking for headers.
|
if ['linux'].contains(host_machine.system())
|
||||||
foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
|
config.set10('HAVE_SYS_SYSCTL_H', false)
|
||||||
|
else
|
||||||
|
# From Niclas Zeising:
|
||||||
|
# FreeBSD requires sys/types.h for sys/sysctl.h, so add it as part of
|
||||||
|
# the includes when checking for headers.
|
||||||
|
config.set10('HAVE_SYS_SYSCTL_H',
|
||||||
|
cc.compiles('#include <sys/types.h>\n#include <sys/sysctl.h>', name : 'sys/sysctl.h works'))
|
||||||
|
endif
|
||||||
|
|
||||||
|
foreach header : ['sys/select.h', 'alloca.h']
|
||||||
config.set10('HAVE_' + header.underscorify().to_upper(),
|
config.set10('HAVE_' + header.underscorify().to_upper(),
|
||||||
cc.compiles('#include <sys/types.h>\n#include <@0@>'.format(header), name : '@0@ works'.format(header)))
|
cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)))
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
|
if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
|
||||||
cc.has_header_symbol('sys/sysmacros.h', 'minor') and
|
cc.has_header_symbol('sys/sysmacros.h', 'minor') and
|
||||||
cc.has_header_symbol('sys/sysmacros.h', 'makedev'))
|
cc.has_header_symbol('sys/sysmacros.h', 'makedev'))
|
||||||
|
|
Loading…
Reference in New Issue