diff --git a/.pick_status.json b/.pick_status.json index 74f2b879fd7..a5f1845b2bd 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3028,7 +3028,7 @@ "description": "meson: unbreak sysctl.h detection on BSDs", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/meson.build b/meson.build index 703e7fc75ac..92f1da12886 100644 --- a/meson.build +++ b/meson.build @@ -1162,7 +1162,14 @@ if (cc.has_header_symbol('sys/mkdev.h', 'major') and pre_args += '-DMAJOR_IN_MKDEV' endif -foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h', 'cet.h'] +if not ['linux'].contains(host_machine.system()) + # Deprecated on Linux and requires on FreeBSD and OpenBSD + if cc.compiles('#include \n#include ', name : 'sys/sysctl.h') + pre_args += '-DHAVE_SYS_SYSCTL_H' + endif +endif + +foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'execinfo.h', 'sys/shm.h', 'cet.h'] if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h)) pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify()) endif