]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
musl: meson: add libutmps support
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 16 Nov 2025 21:57:44 +0000 (06:57 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 17 Nov 2025 03:18:44 +0000 (12:18 +0900)
musl only provides fake functions, hence even with -Dutmp=true,
utmp/wtmp functionalities do not work. Let's allow to build with
libutmps.

meson.build
src/login/meson.build
src/shared/meson.build
src/test/meson.build

index 055ee31ee4c556ee7e755b19e067f7a46e926480..fc305a85652d2502570c31d7b64d6b8a0b2d978a 100644 (file)
@@ -1028,6 +1028,7 @@ threads = dependency('threads')
 librt = cc.find_library('rt')
 libm = cc.find_library('m')
 libdl = cc.find_library('dl')
+libutmps = dependency('libutmps', required : false)
 
 # On some distributions that use musl (e.g. Alpine), libintl.h may be provided by gettext rather than musl.
 # In that case, we need to explicitly link with libintl.so.
index 0ad9beb16784add728b6a4b7fdc717a21bd6e505..e6cd002c6cc1ded34627add2029f51f16aba7c3f 100644 (file)
@@ -49,6 +49,7 @@ executables += [
                 'include_directories' : [libexec_template['include_directories'], include_directories('.')],
                 'extract' : systemd_logind_extract_sources,
                 'dependencies' : [
+                        libutmps,
                         threads,
                 ],
         },
index acc80d3e347c3d19ea38f7bd9ca87034dd6bfc2d..eebadf6d3f1226bdead931aced5d105d29d43f4f 100644 (file)
@@ -385,6 +385,7 @@ libshared_deps = [threads,
                   librt,
                   libseccomp_cflags,
                   libselinux_cflags,
+                  libutmps,
                   libxenctrl_cflags,
                   libxz_cflags,
                   libzstd_cflags,
index 9f89ce8e58a20978dece8acb9004cb13716a39a0..919d622ac660ba5429aa25fe8108c29c8bd67b6e 100644 (file)
@@ -472,6 +472,7 @@ executables += [
         test_template + {
                 'sources' : files('test-utmp.c'),
                 'conditions' : ['ENABLE_UTMP'],
+                'dependencies' : libutmps,
         },
         test_template + {
                 'sources' : files('test-varlink.c'),