[FFmpeg-devel] [PATCH] configure: improve ar test for response files

Martin Storsjö martin at martin.st
Tue Mar 18 16:41:56 EET 2025


On Tue, 18 Mar 2025, Gyan Doshi wrote:

> ---
> configure | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/configure b/configure
> index d84e32196d..2c060b0cd4 100755
> --- a/configure
> +++ b/configure
> @@ -5230,12 +5230,6 @@ else
>     ar_o='$@'
> fi
>
> -if $ar 2>&1 | grep -qi  "@.*file"; then
> -    ar_objs="true"
> -else
> -    ar_objs=""
> -fi
> -
> add_cflags $extra_cflags
> add_cxxflags $extra_cxxflags
> add_objcflags $extra_objcflags
> @@ -7759,6 +7753,13 @@ case $ld_type in
>     ;;
> esac
>
> +{
> +ar_out=${FFTMPDIR}/test$LIBSUF
> +respfile="@/dev/null"

I'm a little bit hesitant about using a special file like /dev/null; I 
wasn't sure about how this would work e.g. with MSVC. It seems to work 
both with msvc-wine, MSVC run through msys2, and both GCC/binutils and 
llvm-mingw in msys2. (I haven't tested MSVC through WSL, but I would 
expect it to work if these other configs work.)

So it's not an issue - this check does work as intended, but I would maybe 
have preferred a real rsp file. (But that requires more temp files to 
clean up.)

> +out_arg="${ar_o/\$@/$ar_out}"

This isn't posix sh syntax; running configure on e.g. ubuntu with /bin/sh 
== dash, gives:

src/configure: 7759: Bad substitution

// Martin



More information about the ffmpeg-devel mailing list