[FFmpeg-cvslog] r19407 - in trunk: Makefile configure subdir.mak

mru subversion
Sun Jul 12 15:29:40 CEST 2009


Author: mru
Date: Sun Jul 12 15:29:40 2009
New Revision: 19407

Log:
Use LD for linking, default to same as CC

Modified:
   trunk/Makefile
   trunk/configure
   trunk/subdir.mak

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	Sun Jul 12 15:29:38 2009	(r19406)
+++ trunk/Makefile	Sun Jul 12 15:29:40 2009	(r19407)
@@ -65,10 +65,10 @@ ffplay_g$(EXESUF): FF_EXTRALIBS += $(SDL
 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$(H
 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

Modified: trunk/configure
==============================================================================
--- trunk/configure	Sun Jul 12 15:29:38 2009	(r19406)
+++ trunk/configure	Sun Jul 12 15:29:40 2009	(r19407)
@@ -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" >> con
 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

Modified: trunk/subdir.mak
==============================================================================
--- trunk/subdir.mak	Sun Jul 12 15:29:38 2009	(r19406)
+++ trunk/subdir.mak	Sun Jul 12 15:29:40 2009	(r19407)
@@ -22,7 +22,7 @@ THIS_LIB := $(SUBDIR)$($(BUILD_SHARED:ye
 
 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)$(SLIBNAM
 
 $(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



More information about the ffmpeg-cvslog mailing list