diff --git a/configure b/configure index 377ef9a4a0..c8a3e66cd6 100755 --- a/configure +++ b/configure @@ -6235,16 +6235,35 @@ _libavcodec=no test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes echores "$_libavcodec" -echocheck "FFmpeg libavformat (static)" +echocheck "FFmpeg libavformat" if test "$_libavformat_a" = auto ; then # Note: static linking is preferred to dynamic linking _libavformat_a=no if test -d libavformat && test -f libavformat/utils.c ; then - _libavformat=yes _libavformat_a=yes + _res_comment="static" + fi +elif test "$_libavformat_so" = auto ; then + _libavformat_so=no + cat > $TMPC < + #include + int main(void) { av_alloc_format_context(); return 0; } +EOF + if $_pkg_config --exists libavformat ; then + _inc_libavformat=`$_pkg_config --cflags libavformat` + _ld_tmp=`$_pkg_config --libs libavformat` + cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \ + && _libavformat_so=yes + elif cc_check $_ld_lm -lavformat ; then + _ld_extra="$_ld_extra -lavformat" + _libavformat_so=yes + _res_comment="using libavformat.so, but static libavformat is recommended" fi fi -echores "$_libavformat_a" +_libavformat=no +test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes +echores "$_libavformat" echocheck "FFmpeg libpostproc (static)" if test "$_libpostproc_a" = auto ; then @@ -6257,30 +6276,6 @@ fi echores "$_libpostproc_a" -if test "$_libavformat_a" != yes ; then -echocheck "FFmpeg libavformat (dynamic)" -if test "$_libavformat_so" = auto ; then - _libavformat_so=no - cat > $TMPC < - #include - int main(void) { av_alloc_format_context(); return 0; } -EOF - if $_pkg_config --exists libavformat ; then - _inc_libavformat=`$_pkg_config --cflags libavformat` - _ld_tmp=`$_pkg_config --libs libavformat` - cc_check $_inc_libavformat $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \ - && _libavformat=yes && _libavformat_so=yes - elif cc_check $_ld_lm -lavformat ; then - _ld_extra="$_ld_extra -lavformat" - _libavformat=yes - _libavformat_so=yes - _res_comment="using libavformat.so, but static libavformat is recommended" - fi -fi -echores "$_libavformat_so" -fi #if test "$_libavformat" != yes ; then - if test "$_libpostproc_a" != yes ; then echocheck "FFmpeg libpostproc (dynamic)" if test "$_libpostproc_so" = auto ; then