diff options
-rwxr-xr-x | configure | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -6078,8 +6078,14 @@ int main(void) { return 0; } EOF - if cc_check -lavcodec $_ld_lm ; then + if (pkg-config --exists libavcodec >> "$TMPLOG" 2>&1) ; then + _inc_libavcodec=`pkg-config --cflags libavcodec` + _ld_libavcodec=`pkg-config --libs libavcodec` + cc_check $_inc_libavcodec $_ld_libavcodec && _libavcodec_so=yes + elif cc_check -lavcodec $_ld_lm ; then _libavcodec_so=yes + fi + if test "$_libavcodec_so" == yes ; then _res_comment="using libavcodec.so, but static libavcodec is recommended" fi fi @@ -6094,7 +6100,16 @@ if test "$_libavformat_so" = auto ; then #include <ffmpeg/avformat.h> int main(void) { av_alloc_format_context(); return 0; } EOF - cc_check $_ld_lm -lavformat && _libavformat_so=yes + if (pkg-config --exists libavformat >> "$TMPLOG" 2>&1 ) ; then + _inc_libavformat=`pkg-config --cflags libavformat` + _ld_libavformat=`pkg-config --libs libavformat` + cc_check $_inc_libavformat $_ld_libavformat && _libavformat_so=yes + elif cc_check $_ld_lm -lavformat ; then + _libavformat_so=yes + fi + if test "$_libavformat_so" == yes ; then + _res_comment="using libavformat.so, but static libavformat is recommended" + fi fi echores "$_libavformat_so" fi @@ -6133,7 +6148,7 @@ if test "$_libavcodec" = yes ; then elif test "$_libavcodec_so" = yes ; then _def_libavcodec='#define USE_LIBAVCODEC 1' _def_libavcodec_so='#define USE_LIBAVCODEC_SO 1' - _ld_libavcodec='-lavcodec' + test "$_ld_libavcodec" || _ld_libavcodec='-lavcodec' _codecmodules="libavcodec.so $_codecmodules" else _nocodecmodules="libavcodec $_nocodecmodules" @@ -6152,7 +6167,7 @@ if test "$_libavformat" = yes ; then else if test "$_libavformat_so" = yes ; then _def_libavformat_so='#define USE_LIBAVFORMAT_SO 1' - _ld_libavformat='-lavformat' + test "$_ld_libavformat" || _ld_libavformat='-lavformat' if win32 ; then _def_libavformat_win32='#define CONFIG_WIN32 1' fi |