[Theora-dev] Re: building derf

Adam D. Moss adam at gimp.org
Tue Sep 28 03:11:23 PDT 2004


Timothy B. Terriberry wrote:
> John Kintree wrote:
>> gcc -I../include -I/usr/include/SDL -D_REENTRANT -g -c -o 
>> objs/player_example.o ../examples/player_example.c
>> ../examples/player_example.c:53:17: SDL.h: No such file or directory
> 
> The player example requires SDL. There's currently no autofoo, so if you 
> have it installed somewhere other than the default path, you'll have to 
> edit the hardcoded strings in the Makefile.

I attach a patch which autodetects the SDL includes/libs.
As a bonus, it fixes a build problem with stricter C
compilers (oldish GCCs).

--Adam
-------------- next part --------------
Index: unix/Makefile
===================================================================
--- unix/Makefile	(revision 7882)
+++ unix/Makefile	(working copy)
@@ -17,7 +17,7 @@
 # The location of include files.
 # Modify these to point to your Ogg and Vorbis include directories if they are
 #  not installed in a standard location.
-CINCLUDE = -I/usr/include/SDL -D_REENTRANT
+CINCLUDE = `sdl-config --cflags` -D_REENTRANT
 # Extra compilation flags.
 # You may get speed increases by including flags such as -O2 or -O3 or
 #  -ffast-math, or additional flags, depending on your system and compiler.
@@ -167,7 +167,7 @@
 ${PLAYER_EXAMPLE_TARGET}: ${PLAYER_EXAMPLE_OBJS} ${LIBTHEORABASE_TARGET} \
                            ${LIBTHEORADEC_TARGET}
 	mkdir -p ${TARGETBINDIR}
-	${CC} ${CFLAGS} -o $@ ${PLAYER_EXAMPLE_OBJS} ${LIBS} -lSDL -lpthread \
+	${CC} ${CFLAGS} -o $@ ${PLAYER_EXAMPLE_OBJS} ${LIBS} `sdl-config --libs` \
          ${LIBTHEORADEC_TARGET} ${LIBTHEORABASE_TARGET}
 
 # Remove all targets.
Index: examples/player_example.c
===================================================================
--- examples/player_example.c	(revision 7882)
+++ examples/player_example.c	(working copy)
@@ -332,9 +332,10 @@
   int i;
   theora_ycbcr_buffer ycbcr;
   int crop_offset;
-  theora_decode_ycbcr_out(td,ycbcr);
   int planemap[] = {0,2,1};
 
+  theora_decode_ycbcr_out(td,ycbcr);
+
   /* Lock SDL_yuv_overlay */
   if ( SDL_MUSTLOCK(screen) ) {
     if ( SDL_LockSurface(screen) < 0 ) return;


More information about the Theora-dev mailing list