changeset 23106:f47defd03fa8

Merge static and shared libavformat checks.
author diego
date Thu, 26 Apr 2007 12:20:36 +0000
parents e06073016699
children 18b824724eea
files configure
diffstat 1 files changed, 23 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Thu Apr 26 12:09:20 2007 +0000
+++ b/configure	Thu Apr 26 12:20:36 2007 +0000
@@ -6235,16 +6235,35 @@
 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
-fi
-echores "$_libavformat_a"
+elif test "$_libavformat_so" = auto ; then
+  _libavformat_so=no
+  cat > $TMPC <<EOF
+  #include <ffmpeg/avformat.h>
+  #include <ffmpeg/opt.h>
+  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
+_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 @@
 echores "$_libpostproc_a"
 
 
-if test "$_libavformat_a" != yes ; then
-echocheck "FFmpeg libavformat (dynamic)"
-if test "$_libavformat_so" = auto ; then
-  _libavformat_so=no
-  cat > $TMPC <<EOF
-  #include <ffmpeg/avformat.h>
-  #include <ffmpeg/opt.h>
-  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