Skip to content

Commit

Permalink
Fix static linking with libsystemd
Browse files Browse the repository at this point in the history
libsystemd requires libcap for static linking.

Add missing macro for function alias.
  • Loading branch information
cgzones authored and BenBE committed Jan 10, 2024
1 parent 2a58f5d commit e59176f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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

# ----------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions linux/SystemdMeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e59176f

Please sign in to comment.