[libav-commits] build: sanitize linking of tools and test programs

Mans Rullgard git at libav.org
Wed Oct 10 12:29:43 CEST 2012


Module: libav
Branch: master
Commit: 4b895cb294d610fb3bf9e57385e665488e8a9ffa

Author:    Mans Rullgard <mans at mansr.com>
Committer: Mans Rullgard <mans at mansr.com>
Date:      Wed Oct 10 03:24:50 2012 +0100

build: sanitize linking of tools and test programs

This makes sure proper linker arguments are used for the tools and
test programs when shared libraries are enabled.  The tools are
linked using the usual -l flag while for test programs the full
name of the static library is used.

Signed-off-by: Mans Rullgard <mans at mansr.com>

---

 library.mak |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/library.mak b/library.mak
index 7b78e59..98e0c6f 100644
--- a/library.mak
+++ b/library.mak
@@ -34,8 +34,11 @@ install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static
 install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared
 
 define RULES
+$(EXAMPLES) $(TOOLS): LIB = $(FULLNAME:%=$(LD_LIB))
+$(TESTPROGS):         LIB = $(SUBDIR)$(LIBNAME)
+
 $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
-	$$(LD) $(LDFLAGS) $$(LD_O) $$^ $(FFEXTRALIBS) $$(ELIBS)
+	$$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(LIB) $(FFEXTRALIBS) $$(ELIBS)
 
 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
 	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)



More information about the libav-commits mailing list