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 <[email protected]>
---
 library.mak | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/library.mak b/library.mak
index 48eb286..4593b11 100644
--- a/library.mak
+++ b/library.mak
@@ -35,8 +35,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)
-- 
1.7.12

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to