[libmd PATCH] Fix out of source build

Michael Haubenwallner michael.haubenwallner at ssi-schaefer.com
Fri Aug 30 11:56:10 UTC 2019


Adding local-link.h as private header file requires $(srcdir) on
AM_CPPFLAGS to be found by generated sources when builddir != srcdir.

Do not use libmd.sym from $(srcdir), as it is a generated file.
Also, do depend on libmd.sym only if it really is used.
---
 src/Makefile.am | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 2559a45..aa19eeb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,6 +2,7 @@
 
 AM_CPPFLAGS = \
 	-I$(top_builddir) \
+	-I$(srcdir) \
 	-I$(top_srcdir)/include \
 	$(nil)
 
@@ -26,18 +27,19 @@ libmd_la_helper_sources = \
 libmd_la_LDFLAGS = \
 	-no-undefined \
 	-version-number $(LIBMD_ABI)
+EXTRA_libmd_la_DEPENDENCIES = \
+	libmd.map \
+	helper.c \
+	$(nil)
 if HAVE_LINKER_VERSION_SCRIPT
 libmd_la_LDFLAGS += \
 	-Wl,--version-script=$(srcdir)/libmd.map
 else
+EXTRA_libmd_la_DEPENDENCIES += \
+	libmd.sym
 libmd_la_LDFLAGS += \
-	-export-symbols $(srcdir)/libmd.sym
+	-export-symbols libmd.sym
 endif
-EXTRA_libmd_la_DEPENDENCIES = \
-	libmd.map \
-	libmd.sym \
-	helper.c \
-	$(nil)
 libmd_la_SOURCES = \
 	local-link.h \
 	md2.c \
-- 
2.21.0



More information about the libbsd mailing list