]> 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>
Thu, 25 Apr 2024 12:30:55 +0000 (07:30 -0500)
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 3ba934c9c411795cca50e55cb3fc1309c3469827)

meson.build
meson_options.txt

index 0a2f0622e19039319a77cdd67150dffc51ef5776..621ff710ca87a5583510f5cb58b122b6fb37e216 100644 (file)
@@ -3062,14 +3062,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 77da35d99a394c3e4d7f3d434bb6ee02f771053c..1850d1d174c8bbf629b8af8bf6585758906b221e 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',