]> 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>
Wed, 17 Apr 2024 16:56:09 +0000 (11:56 -0500)
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
meson.build

index c0300a64fe484e7b36d2c8bbcaf3394a96be9e70..19f11c6d430811a30db7576e6f7d2bac885d0167 100644 (file)
@@ -1387,7 +1387,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,
@@ -1402,7 +1404,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,
@@ -1417,7 +1419,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,