Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Checking for spu-progs and libs.

  • Loading branch information
martinlowinski committed Aug 11, 2009
1 parent 0bc06b1 commit a0446ec4a30b51895a500f6f16f547bcfac24408
Showing with 37 additions and 26 deletions.
  1. +2 −0 Makefile.in
  2. +29 −17 configure.in
  3. +6 −9 src/video/ps3/spulibs/Makefile
@@ -41,6 +41,8 @@ SDLMAIN_SOURCES = @SDLMAIN_SOURCES@
SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@

# SPU programs
SPU_GCC = @SPU_GCC@
EMBEDSPU = @EMBEDSPU@
include $(srcdir)/src/video/ps3/spulibs/Makefile

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
@@ -1508,24 +1508,36 @@ CheckPS3()
AC_HELP_STRING([--enable-video-ps3], [use PlayStation 3 Cell driver [[default=yes]]]),
, enable_video_ps3=yes)
if test x$enable_video = xyes -a x$enable_video_ps3 = xyes; then
AC_MSG_CHECKING(for PlayStation 3 Cell support)
video_ps3=no
AC_TRY_COMPILE([
#include <linux/fb.h>
#include <asm/ps3fb.h>
],[
],[
video_ps3=yes
])
AC_MSG_RESULT($video_ps3)
if test x$video_ps3 = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_PS3)
SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/cell/sdk/usr/lib -lspe2 -lfb_writer_spu -lyuv2rgb_spu -lbilin_scaler_spu"
echo "*** Before building SDL please run make ps3libs"
have_video=yes
fi
AC_CHECK_HEADER([linux/fb.h])
AC_CHECK_HEADER([asm/ps3fb.h], [have_ps3fb_hdr=yes], [],
[#ifndef _LINUX_TYPES_H
#include <linux/types.h>
#endif])
AC_CHECK_HEADER([libspe2.h], have_libspe2_hdr=yes)
AC_CHECK_LIB([spe2], spe_context_create, have_spe2_lib=yes)

AC_CHECK_PROGS(SPU_GCC, [spu-gcc])
AC_CHECK_PROGS(EMBEDSPU, [embedspu])

have_spu_libs=yes
AC_CHECK_LIB([fb_writer_spu], [main], [], [have_spu_libs=no])
AC_CHECK_LIB([yuv2rgb_spu], [main], [], [have_spu_libs=no])
AC_CHECK_LIB([bilin_scaler_spu], [main], [], [have_spu_libs=no])
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
AC_DEFINE(SDL_VIDEO_DRIVER_PS3)
video_ps3=yes
have_video=yes
SOURCES="$SOURCES $srcdir/src/video/ps3/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -I/opt/cell/sdk/usr/include"
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/cell/sdk/usr/lib -lspe2 -lfb_writer_spu -lyuv2rgb_spu -lbilin_scaler_spu"

if test x$have_spu_libs = xno; then
AC_MSG_WARN([ps3libs missing, please run make ps3libs])
fi
fi
AC_MSG_CHECKING([for PlayStation 3 Cell support])
AC_MSG_RESULT([$video_ps3])
fi
}

@@ -2,9 +2,6 @@
# libfb_writer_spu.so, libyuv2rgb_spu.so, libbilin_scaler_spu.so

# Toolchain
SPU_GCC=/usr/bin/spu-gcc
PPU_EMBEDSPU=/usr/bin/embedspu
PPU_AR=/usr/bin/ar
PPU_LD=/usr/bin/ld
SPU_SRCDIR=$(srcdir)/src/video/ps3/spulibs
SPU_LIBDIR=$(srcdir)/src/video/ps3/spulibs/libs
@@ -21,10 +18,10 @@ $(SPU_LIBDIR):
# fb_writer (basically copying from a to b)
$(SPU_LIBDIR)/fb_writer_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/fb_writer.c $(SPU_SRCDIR)/spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/fb_writer_spu $(SPU_SRCDIR)/fb_writer.c -lm
$(PPU_EMBEDSPU) -m32 fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu-embed.o
$(EMBEDSPU) -m32 fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu $(SPU_LIBDIR)/fb_writer_spu-embed.o

$(SPU_LIBDIR)/libfb_writer_spu.a: $(SPU_LIBDIR)/fb_writer_spu-embed.o
$(PPU_AR) -qcs $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/fb_writer_spu-embed.o
$(AR) -qcs $(SPU_LIBDIR)/libfb_writer_spu.a $(SPU_LIBDIR)/fb_writer_spu-embed.o

$(SPU_LIBDIR)/libfb_writer_spu.so: $(SPU_LIBDIR)/fb_writer_spu-embed.o
$(PPU_LD) -o $(SPU_LIBDIR)/libfb_writer_spu.so -shared -soname=libfb_writer_spu.so $(SPU_LIBDIR)/fb_writer_spu-embed.o
@@ -33,10 +30,10 @@ $(SPU_LIBDIR)/libfb_writer_spu.so: $(SPU_LIBDIR)/fb_writer_spu-embed.o
# yuv2rgb_converter (converting YV12/IYUV to RGB)
$(SPU_LIBDIR)/yuv2rgb_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/yuv2rgb_converter.c $(SPU_SRCDIR)/spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_SRCDIR)/yuv2rgb_converter.c -lm
$(PPU_EMBEDSPU) -m32 yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
$(EMBEDSPU) -m32 yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu $(SPU_LIBDIR)/yuv2rgb_spu-embed.o

$(SPU_LIBDIR)/libyuv2rgb_spu.a: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
$(PPU_AR) -qcs $(SPU_LIBDIR)/libyuv2rgb_spu.a $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
$(AR) -qcs $(SPU_LIBDIR)/libyuv2rgb_spu.a $(SPU_LIBDIR)/yuv2rgb_spu-embed.o

$(SPU_LIBDIR)/libyuv2rgb_spu.so: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
$(PPU_LD) -o $(SPU_LIBDIR)/libyuv2rgb_spu.so -shared -soname=libyuv2rgb_spu.so $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
@@ -45,10 +42,10 @@ $(SPU_LIBDIR)/libyuv2rgb_spu.so: $(SPU_LIBDIR)/yuv2rgb_spu-embed.o
# bilin_scaler (scaling bilinear YV12/IYUV pictures with resolutions /16)
$(SPU_LIBDIR)/bilin_scaler_spu-embed.o: $(SPU_LIBDIR) $(SPU_SRCDIR)/bilin_scaler.c $(SPU_SRCDIR)/spu_common.h
$(SPU_GCC) $(SPU_CFLAGS) -o $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_SRCDIR)/bilin_scaler.c -lm
$(PPU_EMBEDSPU) -m32 bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
$(EMBEDSPU) -m32 bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu $(SPU_LIBDIR)/bilin_scaler_spu-embed.o

$(SPU_LIBDIR)/libbilin_scaler_spu.a: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
$(PPU_AR) -qcs $(SPU_LIBDIR)/libbilin_scaler_spu.a $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
$(AR) -qcs $(SPU_LIBDIR)/libbilin_scaler_spu.a $(SPU_LIBDIR)/bilin_scaler_spu-embed.o

$(SPU_LIBDIR)/libbilin_scaler_spu.so: $(SPU_LIBDIR)/bilin_scaler_spu-embed.o
$(PPU_LD) -o $(SPU_LIBDIR)/libbilin_scaler_spu.so -shared -soname=libbilin_scaler_spu.so $(SPU_LIBDIR)/bilin_scaler_spu-embed.o

0 comments on commit a0446ec

Please sign in to comment.