When building on GNU/Linux with:
./configure --enable-systemd
there are linker errors due to '-lsystemd' not being passed to the
linker. This is used by Gnulib's readutmp module.
$ gnulib-tool --extract-link-directive readutmp
$(READUTMP_LIB)
This patch adds this to the 'LDADD' variable of the necessary
Makefiles.
It has been a while since I used Automake, so I am unsure
if these belong in <program-name>_LDADD instead. It seems
that readutmp is only used by 'syslogd', 'talkd', and
'tests/readutmp.c' if that is any help.
Collin
From 07dbdd580d3b92a5fa78a3d6de12f88d43e89270 Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.fu...@gmail.com>
Date: Thu, 21 Mar 2024 21:55:47 -0700
Subject: [PATCH] maint: Allow gnulib's readutmp module to use systemd.
* src/Makefile.am (LDADD): Link to $(READUTMP_LIB).
* talkd/Makefile.am (LDADD): Likewise.
* tests/Makefile.am (LDADD): Likewise.
---
src/Makefile.am | 3 ++-
talkd/Makefile.am | 2 +-
tests/Makefile.am | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index cb7eecdf..f2ddaebf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,7 +33,8 @@ AM_CPPFLAGS = \
LDADD = \
$(iu_LIBRARIES) \
$(LIBUTIL) \
- $(PTY_LIB)
+ $(PTY_LIB) \
+ $(READUTMP_LIB)
inetdaemondir = @inetdaemondir@
diff --git a/talkd/Makefile.am b/talkd/Makefile.am
index 6dd6c7a2..93a9aa91 100644
--- a/talkd/Makefile.am
+++ b/talkd/Makefile.am
@@ -23,7 +23,7 @@ AM_CPPFLAGS = \
$(PATHDEF_DEV) \
$(PATHDEF_TTY_PFX) $(PATHDEF_UTMP) $(PATHDEF_UTMPX)
-LDADD = $(iu_LIBRARIES) $(LIBTHREAD) $(LIB_MBRTOWC)
+LDADD = $(iu_LIBRARIES) $(LIBTHREAD) $(LIB_MBRTOWC) $(READUTMP_LIB)
inetdaemondir = @inetdaemondir@
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0981bf5d..f1043126 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -18,7 +18,7 @@
AM_CPPFLAGS = $(iu_INCLUDES)
-LDADD = $(iu_LIBRARIES)
+LDADD = $(iu_LIBRARIES) $(READUTMP_LIB)
EXTRA_DIST = tools.sh.in ifconfig_modes.sh crash-tftp-msg2021-12_18.bin \
crash-ftp-msg2021-12_03.bin crash-ftp-msg2021-12_16.bin \
--
2.44.0