aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2024-04-18 09:42:25 +0200
committerKarel Zak <kzak@redhat.com>2024-04-18 09:42:25 +0200
commita8491d9eae3dc1b5378ecd178d22c995d708ca57 (patch)
treecda0642ee2429721d55f0bcd53dca32c1dd15156
parent493f50e95508ee67d8e316e96b26fd86e5866303 (diff)
parent023950b1b623e6c3598d244a5569eeb0d5141237 (diff)
downloadutil-linux-a8491d9eae3dc1b5378ecd178d22c995d708ca57.tar.gz
Merge branch 'meson-fix-build-ipcrm-option' of https://github.com/jwillikers/util-linux
* 'meson-fix-build-ipcrm-option' of https://github.com/jwillikers/util-linux: meson: Require the seminfo type for ipcmk, ipcrm, and ipcs meson: Add build-ipcmk option meson: Add missing check for build-ipcrm option
-rw-r--r--meson.build28
-rw-r--r--meson_options.txt2
2 files changed, 21 insertions, 9 deletions
diff --git a/meson.build b/meson.build
index 0cb879c3a8..19f11c6d43 100644
--- a/meson.build
+++ b/meson.build
@@ -1387,29 +1387,39 @@ exe = executable(
exes += exe
manadocs += ['sys-utils/choom.1.adoc']
+has_seminfo_type = cc.has_type('struct seminfo', args : '-D_GNU_SOURCE', prefix : '#include <sys/sem.h>')
+
+opt = get_option('build-ipcmk').require(has_seminfo_type).allowed()
exe = executable(
'ipcmk',
ipcmk_sources,
include_directories : includes,
link_with : [lib_common],
install_dir : usrbin_exec_dir,
- install : true)
-exes += exe
-manadocs += ['sys-utils/ipcmk.1.adoc']
-bashcompletions += ['ipcmk']
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
+ exes += exe
+ manadocs += ['sys-utils/ipcmk.1.adoc']
+ bashcompletions += ['ipcmk']
+endif
+opt = get_option('build-ipcrm').require(has_seminfo_type).allowed()
exe = executable(
'ipcrm',
ipcrm_sources,
include_directories : includes,
link_with : [lib_common],
install_dir : usrbin_exec_dir,
- install : true)
-exes += exe
-manadocs += ['sys-utils/ipcrm.1.adoc']
-bashcompletions += ['ipcrm']
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
+ exes += exe
+ manadocs += ['sys-utils/ipcrm.1.adoc']
+ bashcompletions += ['ipcrm']
+endif
-opt = not get_option('build-ipcs').disabled()
+opt = not get_option('build-ipcs').require(has_seminfo_type).disabled()
exe = executable(
'ipcs',
ipcs_sources,
diff --git a/meson_options.txt b/meson_options.txt
index 95cfb820da..332f2b7ca6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -127,6 +127,8 @@ option('build-irqtop', type : 'feature',
description : 'build irqtop')
option('build-chmem', type : 'feature',
description : 'build chmem')
+option('build-ipcmk', type : 'feature',
+ description : 'build ipcmk')
option('build-ipcrm', type : 'feature',
description : 'build ipcrm')
option('build-ipcs', type : 'feature',