Checking for spu-progs and libs. gsoc2009_ps3
authorMartin Lowinski <martin@goldtopf.org>
Tue, 11 Aug 2009 14:37:19 +0000
branchgsoc2009_ps3
changeset 3155abc49915ccb2
parent 3154 95e48f7a3a93
child 3156 4ead4cef6b7b
Checking for spu-progs and libs.
Makefile.in
configure.in
src/video/ps3/spulibs/Makefile
     1.1 --- a/Makefile.in	Mon Aug 10 18:05:33 2009 +0000
     1.2 +++ b/Makefile.in	Tue Aug 11 14:37:19 2009 +0000
     1.3 @@ -41,6 +41,8 @@
     1.4  SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@
     1.5  
     1.6  # SPU programs
     1.7 +SPU_GCC = @SPU_GCC@
     1.8 +EMBEDSPU = @EMBEDSPU@
     1.9  include $(srcdir)/src/video/ps3/spulibs/Makefile
    1.10  
    1.11  DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-OS2.zip Watcom-Win32.zip WhatsNew Xcode
     2.1 --- a/configure.in	Mon Aug 10 18:05:33 2009 +0000
     2.2 +++ b/configure.in	Tue Aug 11 14:37:19 2009 +0000
     2.3 @@ -1508,24 +1508,36 @@
     2.4                  AC_HELP_STRING([--enable-video-ps3], [use PlayStation 3 Cell driver [[default=yes]]]),
     2.5                  , enable_video_ps3=yes)
     2.6    if test x$enable_video = xyes -a x$enable_video_ps3 = xyes; then 
     2.7 -    AC_MSG_CHECKING(for PlayStation 3 Cell support)
     2.8      video_ps3=no
     2.9 -    AC_TRY_COMPILE([
    2.10 -      #include <linux/fb.h>
    2.11 -      #include <asm/ps3fb.h>
    2.12 -    ],[  
    2.13 -    ],[  
    2.14 -      video_ps3=yes
    2.15 -    ])   
    2.16 -    AC_MSG_RESULT($video_ps3)
    2.17 -    if test x$video_ps3 = xyes; then 
    2.18 -      AC_DEFINE(SDL_VIDEO_DRIVER_PS3)
    2.19 -      SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
    2.20 -      EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
    2.21 -      EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/cell/sdk/usr/lib -lspe2 -lfb_writer_spu -lyuv2rgb_spu -lbilin_scaler_spu"
    2.22 -	  echo "*** Before building SDL please run make ps3libs"
    2.23 -      have_video=yes
    2.24 -    fi   
    2.25 +    AC_CHECK_HEADER([linux/fb.h])
    2.26 +    AC_CHECK_HEADER([asm/ps3fb.h], [have_ps3fb_hdr=yes], [],
    2.27 +			[#ifndef _LINUX_TYPES_H
    2.28 +				#include <linux/types.h>
    2.29 +			#endif])
    2.30 +    AC_CHECK_HEADER([libspe2.h], have_libspe2_hdr=yes)
    2.31 +    AC_CHECK_LIB([spe2], spe_context_create, have_spe2_lib=yes)
    2.32 +
    2.33 +	AC_CHECK_PROGS(SPU_GCC, [spu-gcc])
    2.34 +	AC_CHECK_PROGS(EMBEDSPU, [embedspu])
    2.35 +
    2.36 +	have_spu_libs=yes
    2.37 +	AC_CHECK_LIB([fb_writer_spu], [main], [], [have_spu_libs=no])
    2.38 +	AC_CHECK_LIB([yuv2rgb_spu], [main], [], [have_spu_libs=no])
    2.39 +	AC_CHECK_LIB([bilin_scaler_spu], [main], [], [have_spu_libs=no])
    2.40 +    if test x$have_ps3fb_hdr = xyes -a x$have_libspe2_hdr = xyes -a x$have_spe2_lib = xyes -a "$SPU_GCC" -a "$EMBEDSPU"; then
    2.41 +		AC_DEFINE(SDL_VIDEO_DRIVER_PS3)
    2.42 +		video_ps3=yes
    2.43 +		have_video=yes
    2.44 +		SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
    2.45 +		EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
    2.46 +		EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/cell/sdk/usr/lib -lspe2 -lfb_writer_spu -lyuv2rgb_spu -lbilin_scaler_spu"
    2.47 +
    2.48 +		if test x$have_spu_libs = xno; then 
    2.49 +  			AC_MSG_WARN([ps3libs missing, please run make ps3libs])
    2.50 +		fi
    2.51 +	fi
    2.52 +    AC_MSG_CHECKING([for PlayStation 3 Cell support])
    2.53 +	AC_MSG_RESULT([$video_ps3])
    2.54    fi
    2.55  }
    2.56  
     3.1 --- a/src/video/ps3/spulibs/Makefile	Mon Aug 10 18:05:33 2009 +0000
     3.2 +++ b/src/video/ps3/spulibs/Makefile	Tue Aug 11 14:37:19 2009 +0000
     3.3 @@ -2,9 +2,6 @@
     3.4  # libfb_writer_spu.so, libyuv2rgb_spu.so, libbilin_scaler_spu.so
     3.5  
     3.6  # Toolchain
     3.7 -SPU_GCC=/usr/bin/spu-gcc
     3.8 -PPU_EMBEDSPU=/usr/bin/embedspu
     3.9 -PPU_AR=/usr/bin/ar
    3.10  PPU_LD=/usr/bin/ld
    3.11  SPU_SRCDIR=$(srcdir)/src/video/ps3/spulibs
    3.12  SPU_LIBDIR=$(srcdir)/src/video/ps3/spulibs/libs
    3.13 @@ -21,10 +18,10 @@
    3.14  # fb_writer (basically copying from a to b)
    3.15  $(SPU_LIBDIR)/fb_writer_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/fb_writer.c $(SPU_SRCDIR)/spu_common.h
    3.16  	$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/fb_writer_spu $(SPU_SRCDIR)/fb_writer.c -lm
    3.17 -	$(PPU_EMBEDSPU) -m32 fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu-embed.o
    3.18 +	$(EMBEDSPU) -m32 fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu-embed.o
    3.19  
    3.20  $(SPU_LIBDIR)/libfb_writer_spu.a: $(SPU_LIBDIR)/fb_writer_spu-embed.o
    3.21 -	$(PPU_AR) -qcs $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/fb_writer_spu-embed.o
    3.22 +	$(AR) -qcs $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/fb_writer_spu-embed.o
    3.23  
    3.24  $(SPU_LIBDIR)/libfb_writer_spu.so: $(SPU_LIBDIR)/fb_writer_spu-embed.o
    3.25  	$(PPU_LD) -o $(SPU_LIBDIR)/libfb_writer_spu.so -shared -soname=libfb_writer_spu.so $(SPU_LIBDIR)/fb_writer_spu-embed.o
    3.26 @@ -33,10 +30,10 @@
    3.27  # yuv2rgb_converter (converting YV12/IYUV to RGB)
    3.28  $(SPU_LIBDIR)/yuv2rgb_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/yuv2rgb_converter.c $(SPU_SRCDIR)/spu_common.h
    3.29  	$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_SRCDIR)/yuv2rgb_converter.c -lm
    3.30 -	$(PPU_EMBEDSPU) -m32 yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    3.31 +	$(EMBEDSPU) -m32 yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    3.32  
    3.33  $(SPU_LIBDIR)/libyuv2rgb_spu.a: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    3.34 -	$(PPU_AR) -qcs $(SPU_LIBDIR)/libyuv2rgb_spu.a $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    3.35 +	$(AR) -qcs $(SPU_LIBDIR)/libyuv2rgb_spu.a $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    3.36  
    3.37  $(SPU_LIBDIR)/libyuv2rgb_spu.so: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    3.38  	$(PPU_LD) -o $(SPU_LIBDIR)/libyuv2rgb_spu.so -shared -soname=libyuv2rgb_spu.so $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
    3.39 @@ -45,10 +42,10 @@
    3.40  # bilin_scaler (scaling bilinear YV12/IYUV pictures with resolutions /16)
    3.41  $(SPU_LIBDIR)/bilin_scaler_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/bilin_scaler.c $(SPU_SRCDIR)/spu_common.h
    3.42  	$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_SRCDIR)/bilin_scaler.c -lm
    3.43 -	$(PPU_EMBEDSPU) -m32 bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    3.44 +	$(EMBEDSPU) -m32 bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    3.45  
    3.46  $(SPU_LIBDIR)/libbilin_scaler_spu.a: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    3.47 -	$(PPU_AR) -qcs $(SPU_LIBDIR)/libbilin_scaler_spu.a $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    3.48 +	$(AR) -qcs $(SPU_LIBDIR)/libbilin_scaler_spu.a $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    3.49  
    3.50  $(SPU_LIBDIR)/libbilin_scaler_spu.so: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
    3.51  	$(PPU_LD) -o $(SPU_LIBDIR)/libbilin_scaler_spu.so -shared -soname=libbilin_scaler_spu.so $(SPU_LIBDIR)/bilin_scaler_spu-embed.o