ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
YASMFLAGS += $(IFLAGS:%=%/) -I$(SRC_PATH)/libavutil/x86/ -Pconfig.asm
HOSTCCFLAGS = $(IFLAGS) $(HOSTCFLAGS)
-LDFLAGS := $(ALLFFLIBS:%=-Llib%) $(LDFLAGS)
+LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
define COMPILE
$(call $(1)DEP,$(1))
FFLIBS := $(FFLIBS-yes) $(FFLIBS)
TESTPROGS += $(TESTPROGS-yes)
-FFEXTRALIBS := $(FFLIBS:%=-l%$(BUILDSUF)) $(EXTRALIBS)
+LDLIBS = $(FFLIBS:%=%$(BUILDSUF))
+FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
EXAMPLES := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
CC_E='-E -o $@'
CC_O='-o $@'
LD_O='-o $@'
+LD_LIB='-l%'
+LD_PATH='-L'
HOSTCC_C='-c'
HOSTCC_O='-o $@'
HOSTLD_O='-o $@'
pfx=$1
_cc=$2
- unset _type _ident _cc_c _cc_e _cc_o _ld_o _flags _cflags _ldflags
+ unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
+ unset _ld_o _ldflags _ld_lib _ld_path
unset _depflags _DEPCMD _DEPFLAGS
_flags_filter=echo
add_ldflags $_flags $_ldflags
test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
LD_O=${_ld_o-$LD_O}
+LD_LIB=${_ld_lib-$LD_LIB}
+LD_PATH=${_ld_path-$LD_PATH}
probe_cc hostld "$host_ld"
host_ldflags_filter=$_flags_filter
CC_C=$CC_C
CC_O=$CC_O
LD_O=$LD_O
+LD_LIB=$LD_LIB
+LD_PATH=$LD_PATH
DLLTOOL=$dlltool
LDFLAGS=$LDFLAGS
LDFLAGS-avserver=$AVSERVERLDFLAGS
pktdumper \
probetest \
-$(SUBDIR)output-example$(EXESUF): ELIBS = -lswscale
+$(SUBDIR)output-example$(EXESUF): ELIBS = $(patsubst %,$(LD_LIB),swscale)
define RULES
$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
- $$(LD) $(LDFLAGS) $$(LD_O) $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
+ $$(LD) $(LDFLAGS) $$(LD_O) $$^ $(FULLNAME:%=$(LD_LIB)) $(FFEXTRALIBS) $$(ELIBS)
$(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)