]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Add build-fadvise option
authorJordan Williams <jordan@jwillikers.com>
Mon, 22 Apr 2024 19:33:49 +0000 (14:33 -0500)
committerJordan Williams <jordan@jwillikers.com>
Wed, 24 Apr 2024 20:30:30 +0000 (15:30 -0500)
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
meson.build
meson_options.txt

index 391f71d8b43e4147109e39ff4a8e1435886f0d65..97229645c2272e059152dec556887cfffac7decb 100644 (file)
@@ -3123,14 +3123,18 @@ if not is_disabler(exe)
   exes += exe
 endif
 
+have_posix_fadvise = conf.get('HAVE_POSIX_FADVISE').to_string() == '1'
+
+opt = get_option('build-fadvise').require(have_posix_fadvise).allowed()
 exe = executable(
   'fadvise',
   fadvise_sources,
   include_directories : includes,
   link_with : [lib_common],
   install_dir : usrbin_exec_dir,
-  install : true)
-if not is_disabler(exe)
+  install : opt,
+  build_by_default : opt)
+if opt and not is_disabler(exe)
   exes += exe
   manadocs += ['misc-utils/fadvise.1.adoc']
   bashcompletions += ['fadvise']
index 79585236187efc20ce2a3f1607270b197988216c..17f5c59c135c460d91d1c2be78ec969ad07cc95d 100644 (file)
@@ -201,6 +201,8 @@ option('build-pg', type : 'feature',
        description : 'build pg')
 option('build-pipesz', type : 'feature',
        description : 'build pipesz')
+option('build-fadvise', type : 'feature',
+       description : 'build fadvise')
 option('build-setterm', type : 'feature',
        description : 'build setterm')
 option('build-schedutils', type : 'feature',