From: =?utf-8?q?Ferenc_W=C3=A1gner?= <wferi@debian.org>
Date: Sun, 2 Feb 2025 21:00:08 +0100
Subject: Find libcrmcommon without embedding the build path

The Sphinx call was particularly insidious, because its failure did
not abort the build.
---
 agents/stonith/Makefile.am | 2 ++
 doc/sphinx/Makefile.am     | 1 +
 python/Makefile.am         | 2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/agents/stonith/Makefile.am b/agents/stonith/Makefile.am
index 3e074f1..6bd73ff 100644
--- a/agents/stonith/Makefile.am
+++ b/agents/stonith/Makefile.am
@@ -16,5 +16,7 @@ if BUILD_LHA_SUPPORT
 sbin_SCRIPTS 	+= fence_legacy
 endif
 
+fence_legacy.8: export LD_LIBRARY_PATH=$(top_builddir)/lib/common/.libs
+
 CLEANFILES = $(man7_MANS) \
 	     $(man8_MANS)
diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am
index da93813..0ac38cb 100644
--- a/doc/sphinx/Makefile.am
+++ b/doc/sphinx/Makefile.am
@@ -127,6 +127,7 @@ $(BOOK)/_build: $(STATIC_FILES) $(BOOK)/conf.py $(DEPS_$(BOOK)) $(wildcard $(src
 			pdf) real_format="latex" ;;			\
 			gettext) doctrees="gettext-doctrees" ;;		\
 		esac;							\
+		LD_LIBRARY_PATH=$(top_builddir)/lib/common/.libs        \
 		$(SPHINX) -b "$$real_format" -d "$@/$$doctrees"		\
 			-c "$(builddir)/$(BOOK)"			\
 			-D latex_elements.papersize=$(PAPER)		\
diff --git a/python/Makefile.am b/python/Makefile.am
index 7d25084..5dfe185 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -22,4 +22,4 @@ check-local:
 	if [ "x$(top_srcdir)" != "x$(top_builddir)" ]; then \
 		cp -r $(top_srcdir)/python/* $(abs_top_builddir)/python/; \
 	fi
-	PYTHONPATH=$(top_builddir)/python $(PYTHON) -m unittest discover -v -s $(top_builddir)/python/tests
+	LD_LIBRARY_PATH=$(top_builddir)/lib/common/.libs PYTHONPATH=$(top_builddir)/python $(PYTHON) -m unittest discover -v -s $(top_builddir)/python/tests
