[FFmpeg-cvslog] configure: add option to select use of response files
Gyan Doshi
git at videolan.org
Sun Mar 30 17:09:55 EEST 2025
ffmpeg | branch: master | Gyan Doshi <ffmpeg at gyani.pro> | Fri Mar 21 13:28:40 2025 +0530| [64087171f67bab220c4d3001eb6b074cf488284c] | committer: Gyan Doshi
configure: add option to select use of response files
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=64087171f67bab220c4d3001eb6b074cf488284c
---
configure | 25 +++++++++++++++++--------
ffbuild/library.mak | 4 ++--
2 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/configure b/configure
index 225a235de7..4559962a4a 100755
--- a/configure
+++ b/configure
@@ -427,6 +427,7 @@ Toolchain options:
--enable-thumb compile for Thumb instruction set
--enable-lto[=arg] use link-time optimization
--env="ENV=override" override the environment variables
+ --disable-response-files Don't pass the list of objects to linker in a file [autodetect]
Advanced options (experts only):
--malloc-prefix=PREFIX prefix malloc and related names with PREFIX
@@ -2661,6 +2662,7 @@ CMDLINE_SELECT="
extra_warnings
logging
optimizations
+ response_files
rpath
stripping
version_tracking
@@ -4131,6 +4133,7 @@ objformat="elf32"
x86asmexe_default="nasm"
windres_default="windres"
striptype="direct"
+response_files_default="auto"
# OS
target_os_default=$(tolower $(uname -s))
@@ -5176,7 +5179,7 @@ test -n "$cc_type" && enable $cc_type ||
: ${dep_cc_default:=$cc}
: ${ld_default:=$cc}
: ${host_ld_default:=$host_cc}
-set_default ar as objcc dep_cc ld ln_s host_ld windres
+set_default ar as objcc dep_cc ld ln_s host_ld windres response_files
probe_cc as "$as"
asflags_filter=$_flags_filter
@@ -7736,12 +7739,18 @@ case $ld_type in
;;
esac
-{
-ar_out=${FFTMPDIR}/test$LIBSUF
-respfile="@/dev/null"
-out_arg="$(echo $ar_o | sed "s;\$@;$ar_out;g")"
-test_cmd $ar $arflags $out_arg $respfile && ar_objs="true" || ar_objs=""
-}
+if [ "$response_files" != "no" ]; then
+ ar_out=${FFTMPDIR}/test$LIBSUF
+ respfile="@/dev/null"
+ out_arg="$(echo $ar_o | sed "s;\$@;$ar_out;g")"
+ if test_cmd $ar $arflags $out_arg $respfile; then
+ response_files="yes"
+ elif [ "$response_files" = "auto" ]; then
+ response_files="no"
+ else
+ die "Response files are not available with this toolchain. Exiting"
+ fi
+fi
enable frame_thread_encoder
@@ -8119,7 +8128,7 @@ DEPX86ASM=$x86asmexe
DEPX86ASMFLAGS=\$(X86ASMFLAGS)
AR=$ar
ARFLAGS=$arflags
-AR_OBJS=$ar_objs
+RESPONSE_FILES=$response_files
AR_O=$ar_o
AR_CMD=$ar
NM_CMD=$nm
diff --git a/ffbuild/library.mak b/ffbuild/library.mak
index 7e1871b74c..288c82a177 100644
--- a/ffbuild/library.mak
+++ b/ffbuild/library.mak
@@ -35,7 +35,7 @@ OBJS += $(SHLIBOBJS)
endif
$(SUBDIR)$(LIBNAME): $(OBJS) $(STLIBOBJS)
$(RM) $@
-ifeq ($(AR_OBJS),true)
+ifeq ($(RESPONSE_FILES),yes)
$(Q)echo $^ > $@.objs
$(AR) $(ARFLAGS) $(AR_O) @$@.objs
else
@@ -72,7 +72,7 @@ $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SHLIBOBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
$(SLIB_CREATE_DEF_CMD)
-ifeq ($(AR_OBJS),true)
+ifeq ($(RESPONSE_FILES),yes)
$(Q)echo $$(filter %.o,$$^) > $$@.objs
$$(LD) $(SHFLAGS) $(LDFLAGS) $(LDSOFLAGS) $$(LD_O) @$$@.objs $(FFEXTRALIBS)
else
More information about the ffmpeg-cvslog
mailing list