[Libosinfo] [libosinfo 2/2] build: add libraries via _LIBADD, not _LDFLAGS

Christophe Fergeau cfergeau at redhat.com
Wed Dec 18 15:18:45 UTC 2013


From: Ryan Lortie <desrt at desrt.ca>

Make sure we use the _LIBADD variable for adding our dependencies.

Adding libraries via _LDFLAGS means that we have our libraries appearing
before the user's LDFLAGS environment variable, which is bad, because
the LDFLAGS from pkg-config could contain -L for system paths and
jhbuild sets LDFLAGS to -L${prefix}/lib so that we can find the
libraries in the user's jhbuild install path.  If the system path flags
come before the user's directory then we'll get the wrong version.

Also: automake documentation says it's wrong and would actually error
out on this if it wasn't hidden behind a variable substitution.

https://fedorahosted.org/libosinfo/ticket/12
---
 osinfo/Makefile.am | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/osinfo/Makefile.am b/osinfo/Makefile.am
index 20b6a02..21c69e4 100644
--- a/osinfo/Makefile.am
+++ b/osinfo/Makefile.am
@@ -39,12 +39,14 @@ libosinfo_1_0_la_CFLAGS = \
 	-DLOCALEDIR="\"$(datadir)/locale\"" \
 	$(NULL)
 
-libosinfo_1_0_la_LDFLAGS = \
-	$(COVERAGE_LDFLAGS) \
+libosinfo_1_0_la_LIBADD = \
 	$(LIBXML_LIBS) \
 	$(LIBXSLT_LIBS) \
 	$(GOBJECT_LIBS) \
-	$(GIO_LIBS) \
+	$(GIO_LIBS)
+
+libosinfo_1_0_la_LDFLAGS = \
+	$(COVERAGE_LDFLAGS) \
 	$(VERSION_SCRIPT_FLAGS)$(LIBOSINFO_VERSION_FILE) \
         -version-info $(LIBOSINFO_VERSION_INFO) \
 	$(NO_UNDEFINED_FLAGS)
-- 
1.8.4.2




More information about the Libosinfo mailing list