with_shader_cache = true
endif
endif
-if with_amd_vk and not with_shader_cache
- error('Radv requires shader cache support')
-endif
# Check for GCC style builtins
foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs',
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 <sys/types.h> on FreeBSD and OpenBSD
+ if cc.check_header('sys/sysctl.h', prefix : '#include <sys/types.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.check_header(h)
pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify())
endif