[MPlayer-dev-eng] [PATCH] theora detection

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Nov 3 19:35:36 CET 2005


Hi,
the attached patch changes the theora detection code:
1) it tries just -ltheora, not just pkg-config. At least under gentoo it
won't detect it otherwise
2) it sets _ld_theora to -ltheora when --enable is used. I admit this is
rather ugly, but there seems to be no better way in this case - I'm
compiling MPlayer with theora under windows, but using the ogg functions
in our tremor instead of an external libogg. I see no (easy) way that
would make our autodetection cope with that.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.1096
diff -u -r1.1096 configure
--- configure	26 Oct 2005 20:40:19 -0000	1.1096
+++ configure	3 Nov 2005 18:29:46 -0000
@@ -5389,10 +5393,10 @@
 fi
 echores "$_vorbis"
 
 echocheck "OggTheora support"
+_ld_theora=-ltheora
 if test "$_theora" = auto ; then
   _theora=no
-  if ( pkg-config --exists 'theora' ) >> "$TMPLOG" 2>&1 ; then
     cat > $TMPC << EOF
 #include <theora/theora.h>
 #include <string.h>
@@ -5427,16 +5454,17 @@
   return 0;
 }
 EOF
-    cc_check `pkg-config --libs --cflags theora` && _theora=yes
-  fi
+  for _ld_theora in "-ltheora" "`pkg-config --silence-errors --libs --cflags theora`"; do
+    cc_check $_ld_theora && _theora=yes && break
+  done
 fi
 if test "$_theora" = yes ; then
   _def_theora='#define HAVE_OGGTHEORA 1'
   _codecmodules="libtheora $_codecmodules"
-  _ld_theora=`pkg-config --libs --cflags theora`
 else
   _def_theora='#undef HAVE_OGGTHEORA'
   _nocodecmodules="libtheora $_nocodecmodules"
+  _ld_theora=""
 fi
 echores "$_theora"
 


More information about the MPlayer-dev-eng mailing list