]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: gate switch_root on sys/statfs.h
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 29 Apr 2026 11:51:57 +0000 (13:51 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 12 May 2026 11:55:58 +0000 (13:55 +0200)
The target needs this header, encode this in the build system.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
meson.build

index d8d82183ad6a7bd44fadde27eee60be8f312cb1d..41217c8d4b827e9f3a0aba4e52b3799312be4d6c 100644 (file)
@@ -2139,10 +2139,10 @@ if opt and not is_disabler(exe)
   bashcompletions += ['pivot_root']
 endif
 
-opt = get_option('build-switch_root').allowed()
-if opt and not have_dirfd and not have_ddfd
-  error('neither dirfd nor ddfd are available')
-endif
+opt = get_option('build-switch_root') \
+      .require(have_dirfd or have_ddfd) \
+      .require(conf.get('HAVE_SYS_STATFS_H').to_string() == '1') \
+      .allowed()
 exe = executable(
   'switch_root',
   switch_root_sources,