have_struct_statx = cc.sizeof('struct statx', prefix : '#include <sys/stat.h>') > 0
conf.set('HAVE_STRUCT_STATX', have_struct_statx ? 1 : false)
-build_libmount = get_option('build-libmount').require(get_option('build-libblkid').allowed()).allowed()
+have_sys_vfs_header = cc.has_header('sys/vfs.h')
+
+build_libmount = get_option('build-libmount').require(
+ get_option('build-libblkid').allowed() \
+ and have_sys_vfs_header \
+).allowed()
conf.set('HAVE_LIBMOUNT', build_libmount ? 1 : false)
conf.set('USE_LIBMOUNT_SUPPORT_NAMESPACES', 1)
bashcompletions += ['tunelp']
endif
-opt = not get_option('build-fstrim').disabled()
+opt = get_option('build-fstrim').require(have_sys_vfs_header).allowed()
exe = executable(
'fstrim',
fstrim_sources,