[FFmpeg-devel] [PATCH] lavc: drop support for OpenJPEG 1.3-2.0

James Almer jamrial at gmail.com
Thu Oct 19 01:22:32 EEST 2017


On 10/18/2017 6:56 PM, Michael Bradshaw wrote:
> -DOPJ_STATIC was originally added to ffmpeg's configure script for Windows.
> Unconditionally adding -DOPJ_STATIC would conflict with people who are
> dynamically linking. I'll look into this further. I'll start with the
> following:
> 
> enabled libopenjpeg       && {{require_pkg_config libopenjpeg "libopenjp2
>> = 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags
> -DOPJ_STATIC;} ||
>                               require_pkg_config libopenjpeg "libopenjp2 >=
> 2.1.0" openjpeg.h opj_version;}
> 
> and see if it works for both static and dynamic builds of OpenJPEG.
> Unfortunately, I don't have a Windows system to test on, so if anyone can
> validate the above on Windows I'd appreciate it.

I have a Windows system. With a shared version of OpenJPEG the configure
check seems to succeed with and without -DOPJ_STATIC, but with a static
version it only succeed with it.
Ideally, pkg-config would have something like a "Cflags.private" field,
but it for some reason doesn't, so it's up to us to handle this.

It think the following should be enough:

> enabled libopenjpeg       && { use_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
>                                { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }

To make sure -DOPJ_STATIC is not used unless strictly necessary.


More information about the ffmpeg-devel mailing list