From 19b8b1ba2efc3c8ce9988456b5a3c1790800ea08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Wed, 10 Jan 2024 17:12:18 +0100 Subject: [PATCH] Fix static linking with libsystemd libsystemd requires libcap for static linking. Add missing macro for function alias. --- configure.ac | 2 +- linux/SystemdMeter.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fe7f7b399..8de3c1dd0 100644 --- a/configure.ac +++ b/configure.ac @@ -336,7 +336,7 @@ if test "$my_htop_platform" = pcp; then fi if test "$my_htop_platform" = linux && test "x$enable_static" = xyes; then - AC_CHECK_LIB([systemd], [sd_bus_open_system]) + AC_CHECK_LIB([systemd], [sd_bus_open_system], [], [], [-lcap]) fi # ---------------------------------------------------------------------- diff --git a/linux/SystemdMeter.c b/linux/SystemdMeter.c index e13c64618..039e578db 100644 --- a/linux/SystemdMeter.c +++ b/linux/SystemdMeter.c @@ -33,6 +33,7 @@ in the source distribution for its full text. #ifdef BUILD_STATIC #define sym_sd_bus_open_system sd_bus_open_system +#define sym_sd_bus_open_user sd_bus_open_user #define sym_sd_bus_get_property_string sd_bus_get_property_string #define sym_sd_bus_get_property_trivial sd_bus_get_property_trivial #define sym_sd_bus_unref sd_bus_unref