GNOME Bugzilla – Bug 763940
'configure' using system libav always fails with "Uncompatible libavcodec found"
Last modified: 2016-03-21 11:38:07 UTC
Created attachment 324361 [details] [review] Patch Output from configure: checking for LIBAV... yes checking for SWSCALE... yes checking avi.h usability... no checking avi.h presence... no checking for avi.h... no configure: Using system-installed libav code checking whether libav is provided by FFmpeg... no configure: error: Uncompatible libavcodec found Checked configure.ac and found what it checks version based on <libavcodec/avcodec.h>, and checking LIBAVCODEC_VERSION_MICRO >= 100. But this is ffmpeg 3.0: [nexfwall@VPCYB1S1R-OS00 RPMBuild]$ grep "LIBAVCODEC_VERSION_MICRO" /usr/include/ffmpeg/libavcodec/version.h #define LIBAVCODEC_VERSION_MICRO 102 Also found, what it saves CPPFLAGS to a var, and then appends libav pkg-config flags. But restore them before checking libavcodec version: ... PKG_CHECK_MODULES(SWSCALE, libswscale libavutil) saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBAV_CFLAGS" AC_CHECK_HEADERS([avi.h]) CPPFLAGS="$saved_CPPFLAGS" AC_DEFINE([LIBAV_SOURCE], ["system install"], [Describes where the Libav libraries come from.]) ... But it should restore it only after checking libav provider version. After this: ... AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <libavcodec/avcodec.h> ]],[[ #if LIBAVCODEC_VERSION_MICRO >= 100 /* FFmpeg uses 100+ as its micro version */ #else #error libav provider should be FFmpeg #endif ]])], [is_ffmpeg=yes], [is_ffmpeg=no]) AC_MSG_RESULT([$is_ffmpeg]) ... So here is the patch. Now configure runs properly.
This was introduced by bug #758183. Apparently the ffmpeg and libav people decided back then that libav will have MICRO>=100 and ffmpeg takes the ones before... and now ffmpeg broke that. Great! Reynaldo, what is the correct way to check for this nowadays?
https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/version.h;h=6e42810765c3403a556a7946ace70e37e1fffe07;hb=HEAD#l32 https://git.libav.org/?p=libav.git;a=blob;f=libavcodec/version.h;h=d5045fb2caad425a5c6bc3004ec05d0807f24b3e;hb=HEAD#l32 It's actually the other way around, and the way it is currently. FFMPEG >= 100, libav < 100. So all good commit 6ca5f88ddefed16a017e4c4b6543281da2577557 Author: Egor Zaharov <nexfwall@yandex.ru> Date: Sun Mar 20 13:43:00 2016 +0000 configure: Restore CPPFLAGS after the last check The next checks can also set CPPFLAGS. https://bugzilla.gnome.org/show_bug.cgi?id=763940
(In reply to Sebastian Dröge (slomo) from comment #1) > This was introduced by bug #758183. Apparently the ffmpeg and libav people > decided back then that libav will have MICRO>=100 and ffmpeg takes the ones > before... and now ffmpeg broke that. Great! Yes. They did'nt really broke that. Just configure drops pkg-config flags, necessary for including 'libavcodec/version.h'. Thank you for merging my little patch.
Yeah I was confused first :) Thanks for your patch (should've also updated the commit message a bit, it's confusing now).