]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Only pick up the rt library once
authorJordan Williams <jordan@jwillikers.com>
Mon, 1 Apr 2024 17:18:52 +0000 (12:18 -0500)
committerJordan Williams <jordan@jwillikers.com>
Tue, 9 Apr 2024 21:58:28 +0000 (16:58 -0500)
Require the rt library for the build-lsfd feature.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 243950279f413e3844d13a2d87b3853c1242f437)

meson.build

index d2a1654762c3aa149e29425dabde6c48d6022492..bd8d0e394b4ab8b75cc885e7ffb1081e1116d8ba 100644 (file)
@@ -729,10 +729,10 @@ if not cc.has_function('socket')
   endif
 endif
 
+lib_rt = cc.find_library('rt', required : false)
 realtime_libs = []
 have = cc.has_function('clock_gettime')
 if not have
-  lib_rt = cc.find_library('rt', required : false)
   if lib_rt.found()
     realtime_libs += lib_rt
     have = cc.has_function('clock_gettime',
@@ -745,7 +745,6 @@ thread_libs = dependency('threads')
 
 have = cc.has_function('timer_create')
 if not have
-  lib_rt = cc.find_library('rt', required : false)
   if lib_rt.found()
     realtime_libs = [lib_rt]
     have = cc.has_function('timer_create',
@@ -2714,9 +2713,7 @@ endif
 mq_libs = []
 mq_libs += cc.find_library('rt', required : true)
 
-lib_rt = cc.find_library('rt', required : get_option('build-lsfd'))
-
-opt = not get_option('build-lsfd').disabled()
+opt = not get_option('build-lsfd').require(lib_rt.found()).disabled()
 exe = executable(
   'lsfd',
   lsfd_sources,