configure: Improve pkg-config tests for FFmpeg libraries

Tests for libavcodec, libavformat, libavutil and libswscale used the
CFLAGS from pkg-config in a test compile but did not add them to the
flags used during the main build, so the compiler could fail to find
the headers then. Add the flags to the commands used during the main
build too. libpostproc had no pkg-config test at all. Add one.
This commit is contained in:
Uoti Urpala 2009-07-22 02:48:21 +03:00
parent a009d56d4d
commit a810867d04
1 changed files with 10 additions and 5 deletions

15
configure vendored
View File

@ -6908,7 +6908,7 @@ EOF
if $_pkg_config --exists libavutil ; then
_inc_libavutil=$($_pkg_config --cflags libavutil)
_ld_tmp=$($_pkg_config --libs libavutil)
cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libavutil" \
&& _libavutil_so=yes
elif cc_check -lavutil $_ld_lm ; then
extra_ldflags="$extra_ldflags -lavutil"
@ -6947,7 +6947,7 @@ EOF
if $_pkg_config --exists libavcodec ; then
_inc_libavcodec=$($_pkg_config --cflags libavcodec)
_ld_tmp=$($_pkg_config --libs libavcodec)
cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavcodec" \
&& _libavcodec_so=yes
elif cc_check -lavcodec $_ld_lm ; then
extra_ldflags="$extra_ldflags -lavcodec"
@ -6991,7 +6991,7 @@ 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 && extra_ldflags="$extra_ldflags $_ld_tmp" \
cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavformat" \
&& _libavformat_so=yes
elif cc_check $_ld_lm -lavformat ; then
extra_ldflags="$extra_ldflags -lavformat"
@ -7024,7 +7024,12 @@ elif test "$_libpostproc_so" = auto ; then
#include <libpostproc/postprocess.h>
int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
EOF
if cc_check -lpostproc $_ld_lm ; then
if $_pkg_config --exists libpostproc ; then
_inc_libpostproc=$($_pkg_config --cflags libpostproc)
_ld_tmp=$($_pkg_config --libs libpostproc)
cc_check $_inc_libpostproc $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libpostproc" \
&& _libpostproc_so=yes
elif cc_check -lpostproc $_ld_lm ; then
extra_ldflags="$extra_ldflags -lpostproc"
_libpostproc_so=yes
_res_comment="using libpostproc.so, but static libpostproc is recommended"
@ -7058,7 +7063,7 @@ EOF
if $_pkg_config --exists libswscale ; then
_inc_libswscale=$($_pkg_config --cflags libswscale)
_ld_tmp=$($_pkg_config --libs libswscale)
cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libswscale" \
&& _libswscale_so=yes
elif cc_check -lswscale ; then
extra_ldflags="$extra_ldflags -lswscale"