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

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Nov 3 22:05:28 CET 2005


Hi,
On Thu, Nov 03, 2005 at 07:35:36PM +0100, Reimar Döffinger wrote:
> 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.

Changed number 2), so that at least a static libtheora can now link
against the ogg functions in our tremor copy, so no libogg is needed at
all (you have to hack the theora header a bit though). I want this for
the new "release" of the libs for compiling under MinGW.
I think it's not so ugly anymore, so is it okay to apply?

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 20:54:57 -0000
@@ -5389,7 +5393,6 @@
 echocheck "OggTheora support"
 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 +5453,22 @@
   return 0;
 }
 EOF
-    cc_check `pkg-config --libs --cflags theora` && _theora=yes
+  for _ld_theora in "`pkg-config --silence-errors --libs --cflags theora`" "-ltheora"; do
+    cc_check $_ld_theora && _theora=yes && break
+  done
+  if test "$_theora" = no && test "$_tremor_internal" = yes; then
+    for _ld_theora in "`pkg-config --silence-errors --libs --cflags theora`" "-ltheora"; do
+      cc_check -I. tremor/bitwise.c $_ld_theora && _theora=yes && break
+    done
   fi
 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