[FFmpeg-devel] [PATCH] configure: Include quotes around pkg_version

Alexander Strasser eclipse7 at gmx.net
Thu Jan 2 10:51:58 EET 2025


On 2024-12-28 12:56 +0100, Alexander Strasser via ffmpeg-devel wrote:
> On 2024-12-27 08:13 -0500, Leo Izen wrote:
[...]
> >
> > I did a bit of testing and I believe the issue is >=, specifically, it's
> > being interpreted as a redirect-out to a file named "=". pkg-config works on
> > my system if I run `pkg-config --libs 'aom >= 2.0'` but also it works if I
> > run `pkg-config --libs aom '>=' 2.0` but if I don't quote the redirect, the
> > shell expands it.
> >
> > I could not say why MSYS appears to be interpreting the redirect differently
> > when expanding the variable, but if I had to guess, it may be a bug in its
> > path-mangling (i.e. converting /foo/bar to C:\foo\bar) where it's
> > interpreting "=" as a filename. I could not say for certain if this is the
> > case.
>
> Leo's theory seems to provide a plausible explanation of the behavior.
>
> According to POSIX[1] the high level algo goes like this:
>
>     4. For each word within a command, the shell processes <backslash>-escape
>        sequences inside dollar-single-quotes (see 2.2.4 Dollar-Single-Quotes)
>        and then performs various word expansions (see 2.6 Word Expansions).
>        In the case of a simple command, the results usually include a list of
>        pathnames and fields to be treated as a command name and arguments;
>        see 2.9 Shell Commands.
>
>     5. The shell performs redirection (see 2.7 Redirection) and removes redirection
>        operators and their operands from the parameter list.
>
> To my understanding word expansions in step 4 should quote results
> and thus >= shouldn't have an effect like it seems it now has on MSYS.
> Presumably that is caused by the suspected MSYS path mangling mechanisms.
>
>
> > In either case, I don't see issue with quoting it as that works on every
> > system.
>
> I would like to look a bit more into this. Especially what is
> documented for pkg-config regarding its argument syntax.
>
> If it's accepting the single argument syntax since a long time,
> than I see no harm in including your patch Joe and would push
> it soon'ish.

Pushed.

The one argument syntax seems to be supported for a long long
time. See the details in the modified commit message.

Thanks for the patch Joe. Might still make sense to report at
MSYS. Maybe pointing to this discussion.


Best regards,
  Alexander


More information about the ffmpeg-devel mailing list