PKG_CONFIG_PATH can't be seen by configure

Questions that occur when trying to compile FFmpeg.
Post Reply
Hashim
Posts: 1
Joined: Fri Mar 22, 2019 11:27 pm

PKG_CONFIG_PATH can't be seen by configure

Post by Hashim » Fri Mar 22, 2019 11:35 pm

I'm using Cygwin to compile a MinGW version of FFmpeg (I already use Cygwin so it didn't make sense to use anything else to build).

I was originally getting an error that someone on the Doom9 forums suggested might be due to mixing MinGW-64 and Cygwin dependencies. I then compiled or sourced MinGW-64 versions of all of the required dependencies (as some dependencies could not be compiled with Cygwin alone), and FFmpeg still fails to configure, with the same error.

This error is always a variation of "package not found using pkg-config" - if libaom is enabled, I get:

ERROR: aom >= 1.0.0 not found using pkg-config

If I don't add --enable-libaom in the configure script, I get:

ERROR: libass not found using pkg-config

I'm running the following on the command line, in a single shell, to compile FFmpeg:

Code: Select all

cd /ffmpeg_sources/ffmpeg && export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" && 
./configure --arch=x86_64 --cross-prefix=x86_64-w64-mingw32- --target-os=mingw32 \
--prefix="/usr/local" \
--extra-cflags="-I/usr/local/include -static" \
--extra-ldflags="-L/usr/local/lib -static" \
--pkg-config-flags="--static" \
--extra-libs="-pthread -lm" \
--enable-libaom \
--enable-libass \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-gpl \
--enable-nonfree \
--enable-static  \
--disable-shared && 
make -j$(nproc) && 
make install
A similar question here indicates that this is an issue with PKG_CONFIG_PATH not seeing the packages in /usr/local/lib/pkgconfig, but when I do:

Code: Select all

cd /ffmpeg_sources/ffmpeg && PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" && pkg-config --exists --print-errors aom && echo $?
...it returns a 0, indicating aom.pc was found in the PKG_CONFIG_PATH - which either rules out an issue with PKG_CONFIG_PATH or makes it a very specific one in which only configure and make aren't able to see PKG_CONFIG_PATH, despite being run from the same shell just a moment after.

How can I resolve this?

EDIT:

I did some further investigation by looking into ffbuild/config.log, and noticed that it shows a warning:

WARNING: x86_64-w64-mingw32-pkg-config not found, library detection may fail.

However, doing apt-cyg search x86_64-w64-mingw32-pkg-config shows that particular package as being installed.

Sure enough, in the /bin folder, there is an extensionless file called x86_64-w64-mingw32-pkg-config, with the following contents:

Code: Select all

#!/bin/sh
exec pkgconf --personality=x86_64-w64-mingw32 [email protected]
I'm now back to being lost on this issue again, though I think this may be a bug in FFmpeg, due to the fact I've found the following related issues, the first of which is a patch that evidently was never implemented (and my own experience with the FFmpeg mailing lists for this issue a few weeks ago indicated they're resistant to change, at the very least):

https://ffmpeg.org/pipermail/ffmpeg-dev ... 26683.html

Warning "i686-mingw32-pkg-config not found, library detection may fail" while cross compiling ffmpeg

https://github.com/Microsoft/FFmpegInterop/issues/106

https://gitlab.gnome.org/GNOME/librsvg/issues/239

viewtopic.php?t=2041

Post Reply
'