Commit f761a82b authored by mru's avatar mru

Use LD for linking, default to same as CC

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19407 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 644e0dea
...@@ -65,10 +65,10 @@ ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS) ...@@ -65,10 +65,10 @@ ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS)
ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS) ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)
%_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
$(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS) $(LD) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
tools/%$(EXESUF): tools/%.c tools/%$(EXESUF): tools/%.c
$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS) $(LD) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS) ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS)
...@@ -304,8 +304,8 @@ tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF) ...@@ -304,8 +304,8 @@ tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF)
tests/%$(HOSTEXESUF): tests/%.c tests/%$(HOSTEXESUF): tests/%.c
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS) $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS)
tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS) tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS)
$(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS) $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
.PHONY: documentation *test regtest-* zlib-error alltools check config .PHONY: documentation *test regtest-* zlib-error alltools check config
...@@ -190,6 +190,7 @@ show_help(){ ...@@ -190,6 +190,7 @@ show_help(){
echo " --nm=NM use nm tool" echo " --nm=NM use nm tool"
echo " --as=AS use assembler AS [$as_default]" echo " --as=AS use assembler AS [$as_default]"
echo " --cc=CC use C compiler CC [$cc_default]" echo " --cc=CC use C compiler CC [$cc_default]"
echo " --ld=LD use linker LD"
echo " --host-cc=HOSTCC use host C compiler HOSTCC" echo " --host-cc=HOSTCC use host C compiler HOSTCC"
echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host" echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host"
echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host" echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host"
...@@ -579,7 +580,7 @@ check_ld(){ ...@@ -579,7 +580,7 @@ check_ld(){
for f; do for f; do
test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f" test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
done done
check_cmd $cc $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
} }
check_cppflags(){ check_cppflags(){
...@@ -1000,6 +1001,7 @@ CMDLINE_SET=" ...@@ -1000,6 +1001,7 @@ CMDLINE_SET="
host_ldflags host_ldflags
host_libs host_libs
host_os host_os
ld
logfile logfile
nm nm
source_path source_path
...@@ -1485,7 +1487,8 @@ fi ...@@ -1485,7 +1487,8 @@ fi
test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc" test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
set_default as : ${ld_default:=$cc}
set_default as ld
if test -n "$sysroot"; then if test -n "$sysroot"; then
case "$cc_type" in case "$cc_type" in
...@@ -2476,6 +2479,7 @@ echo "SRC_PATH_BARE=$source_path" >> config.mak ...@@ -2476,6 +2479,7 @@ echo "SRC_PATH_BARE=$source_path" >> config.mak
echo "BUILD_ROOT=\"$PWD\"" >> config.mak echo "BUILD_ROOT=\"$PWD\"" >> config.mak
echo "CC=$cc" >> config.mak echo "CC=$cc" >> config.mak
echo "AS=$as" >> config.mak echo "AS=$as" >> config.mak
echo "LD=$ld" >> config.mak
echo "YASM=$yasmexe" >> config.mak echo "YASM=$yasmexe" >> config.mak
echo "AR=$ar" >> config.mak echo "AR=$ar" >> config.mak
echo "RANLIB=$ranlib" >> config.mak echo "RANLIB=$ranlib" >> config.mak
......
...@@ -22,7 +22,7 @@ THIS_LIB := $(SUBDIR)$($(BUILD_SHARED:yes=S)LIBNAME) ...@@ -22,7 +22,7 @@ THIS_LIB := $(SUBDIR)$($(BUILD_SHARED:yes=S)LIBNAME)
define RULES define RULES
$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
$(CC) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
$(SUBDIR)%-test.o: $(SUBDIR)%.c $(SUBDIR)%-test.o: $(SUBDIR)%.c
$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
...@@ -54,7 +54,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) ...@@ -54,7 +54,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS)
$(SLIB_CREATE_DEF_CMD) $(SLIB_CREATE_DEF_CMD)
$(CC) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS) $(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
$(SLIB_EXTRA_CMD) $(SLIB_EXTRA_CMD)
ifdef SUBDIR ifdef SUBDIR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment