]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Require the seminfo type for ipcmk, ipcrm, and ipcs
authorJordan Williams <jordan@jwillikers.com>
Wed, 17 Apr 2024 16:56:09 +0000 (11:56 -0500)
committerJordan Williams <jordan@jwillikers.com>
Thu, 18 Apr 2024 11:57:57 +0000 (06:57 -0500)
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 023950b1b623e6c3598d244a5569eeb0d5141237)

meson.build

index 724d580c44d2d5cf8774d01c6f254fd4d9e43446..8d92e58b49d17aa96a3b3a904bf98a7cfa210b92 100644 (file)
@@ -1376,7 +1376,9 @@ exe = executable(
 exes += exe
 manadocs += ['sys-utils/choom.1.adoc']
 
-opt = get_option('build-ipcmk').allowed()
+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,
@@ -1391,7 +1393,7 @@ if opt and not is_disabler(exe)
   bashcompletions += ['ipcmk']
 endif
 
-opt = get_option('build-ipcrm').allowed()
+opt = get_option('build-ipcrm').require(has_seminfo_type).allowed()
 exe = executable(
   'ipcrm',
   ipcrm_sources,
@@ -1406,7 +1408,7 @@ if opt and not is_disabler(exe)
   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,