Use pkg-config to determine FFmpeg linker flags (for Debian, see #758337)

This commit is contained in:
ejurgensen 2014-10-02 23:08:38 +02:00
parent 88fcfa061d
commit d0685aed6f

View File

@ -158,11 +158,15 @@ fi
PKG_CHECK_MODULES(LIBAV, [ libavformat libavcodec libswscale libavutil $libxxresample ])
dnl For ffmpeg compability
PKG_CHECK_MODULES([LIBAVCODEC], [libavcodec])
avc_name=`echo $LIBAVCODEC_LIBS | sed 's/-l//'`
save_LIBS="$LIBS"
dnl Check for av_lock_manager (ffmpeg >= 0.5.1)
AC_CHECK_LIB([avcodec], [av_lockmgr_register], , AC_MSG_ERROR([libav (ffmpeg) >= 0.5.1 required]))
AC_CHECK_LIB([$avc_name], [av_lockmgr_register], , AC_MSG_ERROR([libav (ffmpeg) >= 0.5.1 required]))
dnl Check for avcodec_find_best_pix_fmt_of_list (is only in ffmpeg, not libav)
AC_CHECK_LIB([avcodec], [avcodec_find_best_pix_fmt_of_list],
AC_CHECK_LIB([$avc_name], [avcodec_find_best_pix_fmt_of_list],
AC_DEFINE(FFMPEG_INCOMPATIBLE_API, 1, [Define to 1 if you have ffmpeg (and not libav).]))
LIBS="$save_LIBS"