[PATCH] configure: add check for pkg-config return value

Stefano Sabatini stefano.sabatini-lala
Mon Feb 28 11:54:44 CET 2011


This ensures that the result of pkg-config is correct. Avoid spurious
success during configuration, which may lead to compilation errors.
---
 configure |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 4a49f3e..7ba68f7 100755
--- a/configure
+++ b/configure
@@ -2822,7 +2822,7 @@ check_mathfunc truncf
 # these are off by default, so fail if requested and not available
 enabled avisynth   && require2 vfw32 "windows.h vfw.h" AVIFileInit -lavifil32
 enabled frei0r     && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
-enabled libdirac   && add_cflags $(pkg-config --cflags dirac) &&
+enabled libdirac   && pkg-config --cflags --libs dirac > /dev/null && add_cflags $(pkg-config --cflags dirac) &&
                       require  libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init $(pkg-config --libs dirac) &&
                       require  libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init $(pkg-config --libs dirac)
 enabled libfaac    && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
@@ -2831,12 +2831,15 @@ enabled libmp3lame && require  "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_q
 enabled libnut     && require  libnut libnut.h nut_demuxer_init -lnut
 enabled libopencore_amrnb  && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
 enabled libopencore_amrwb  && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
-enabled libopencv  && { check_lib opencv/cv.h cvCreateImageHeader $(pkg-config --libs opencv) ||
+enabled libopencv  && { pkg-config --libs opencv > /dev/null &&
+                        check_lib opencv/cv.h cvCreateImageHeader $(pkg-config --libs opencv) ||
                         die "ERROR: libopencv not found"; }
 enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg
-enabled librtmp    && { check_lib librtmp/rtmp.h RTMP_Socket $(pkg-config --libs librtmp) ||
+enabled librtmp    && { pkg-config --libs librtmp > /dev/null &&
+                        check_lib librtmp/rtmp.h RTMP_Socket $(pkg-config --libs librtmp) ||
                         die "ERROR: librtmp not found or RTMP_Socket() missing, librtmp version must be >= 2.2.f"; }
-enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
+enabled libschroedinger && pkg-config --libs schroedinger-1.0 > /dev/null &&
+                           add_cflags $(pkg-config --cflags schroedinger-1.0) &&
                            require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
 enabled libspeex   && require  libspeex speex/speex.h speex_decoder_init -lspeex
 enabled libtheora  && require  libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
-- 
1.7.2.3


--envbJBWh7q8WU6mo--



More information about the ffmpeg-devel mailing list