From 684b28e09c868d185cdec2713c9df4e30f9d7260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5ns=20Rullg=C3=A5rd?= Date: Sun, 12 Jul 2009 13:29:40 +0000 Subject: [PATCH] Use LD for linking, default to same as CC Originally committed as revision 19407 to svn://svn.ffmpeg.org/ffmpeg/trunk --- Makefile | 8 ++++---- configure | 8 ++++++-- subdir.mak | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 7361ce31d2..1d36e66d1b 100644 --- a/Makefile +++ b/Makefile @@ -65,10 +65,10 @@ ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL_LIBS) ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS) %_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 - $(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS) + $(LD) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS) ffplay.o ffplay.d: CFLAGS += $(SDL_CFLAGS) @@ -304,8 +304,8 @@ tests/data/asynth1.sw: tests/audiogen$(HOSTEXESUF) tests/%$(HOSTEXESUF): tests/%.c $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $< $(HOSTLIBS) -tests/seek_test$(EXESUF): tests/seek_test.c $(FF_DEP_LIBS) - $(CC) $(FF_LDFLAGS) $(CFLAGS) -o $@ $< $(FF_EXTRALIBS) +tests/seek_test$(EXESUF): tests/seek_test.o $(FF_DEP_LIBS) + $(LD) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS) .PHONY: documentation *test regtest-* zlib-error alltools check config diff --git a/configure b/configure index 41ef72fe06..b6956412d1 100755 --- a/configure +++ b/configure @@ -190,6 +190,7 @@ show_help(){ echo " --nm=NM use nm tool" echo " --as=AS use assembler AS [$as_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-cflags=HCFLAGS use HCFLAGS when compiling for host" echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host" @@ -579,7 +580,7 @@ check_ld(){ for f; do test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f" done - check_cmd $cc $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs + check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs } check_cppflags(){ @@ -1000,6 +1001,7 @@ CMDLINE_SET=" host_ldflags host_libs host_os + ld logfile nm source_path @@ -1485,7 +1487,8 @@ fi 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 case "$cc_type" in @@ -2476,6 +2479,7 @@ echo "SRC_PATH_BARE=$source_path" >> config.mak echo "BUILD_ROOT=\"$PWD\"" >> config.mak echo "CC=$cc" >> config.mak echo "AS=$as" >> config.mak +echo "LD=$ld" >> config.mak echo "YASM=$yasmexe" >> config.mak echo "AR=$ar" >> config.mak echo "RANLIB=$ranlib" >> config.mak diff --git a/subdir.mak b/subdir.mak index f7d719a2b2..65d9c6f382 100644 --- a/subdir.mak +++ b/subdir.mak @@ -22,7 +22,7 @@ THIS_LIB := $(SUBDIR)$($(BUILD_SHARED:yes=S)LIBNAME) define RULES $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o - $(CC) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) + $(LD) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS) $(SUBDIR)%-test.o: $(SUBDIR)%.c $(CC) $(CFLAGS) -DTEST -c -o $$@ $$^ @@ -54,7 +54,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIB_CREATE_DEF_CMD) - $(CC) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS) + $(LD) $(SHFLAGS) $(FFLDFLAGS) -o $$@ $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS) $(SLIB_EXTRA_CMD) ifdef SUBDIR