OSDN Git Service

build: add -L flags before existing LDFLAGS
authorMans Rullgard <mans@mansr.com>
Wed, 13 Jul 2011 17:17:54 +0000 (18:17 +0100)
committerMans Rullgard <mans@mansr.com>
Thu, 21 Jul 2011 11:50:31 +0000 (12:50 +0100)
This ensures the linker picks the just built libraries even
if LDFLAGS for some reason contains -L flags pointing at
other directories containing libav libraries.

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

index a27fe28..9d6ec3a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,13 +20,15 @@ $(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
 $(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_PATH)/%=%)); $(INSTALL))
 endif
 
+ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
+
 IFLAGS     := -I. -I$(SRC_PATH)
 CPPFLAGS   := $(IFLAGS) $(CPPFLAGS)
 CFLAGS     += $(ECFLAGS)
 CCFLAGS     = $(CFLAGS)
 YASMFLAGS  += $(IFLAGS) -Pconfig.asm
 HOSTCFLAGS += $(IFLAGS)
-LDFLAGS    += $(ALLFFLIBS:%=-Llib%)
+LDFLAGS    := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
 
 define COMPILE
        $($(1)DEP)
@@ -66,8 +68,6 @@ BASENAMES   = ffmpeg ffplay ffprobe ffserver
 ALLPROGS    = $(BASENAMES:%=%$(EXESUF))
 ALLMANPAGES = $(BASENAMES:%=%.1)
 
-ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
-
 FFLIBS-$(CONFIG_AVDEVICE) += avdevice
 FFLIBS-$(CONFIG_AVFILTER) += avfilter
 FFLIBS-$(CONFIG_AVFORMAT) += avformat