diff configure.in @ 3257:94fb40a4a9a7

Merged Martin's code changes from Google Summer of Code 2009
author Sam Lantinga <slouken@libsdl.org>
date Mon, 07 Sep 2009 04:51:29 +0000
parents 5db962a9a991
children 82ce350be859
line wrap: on
line diff
--- a/configure.in	Sun Sep 06 15:04:38 2009 +0000
+++ b/configure.in	Mon Sep 07 04:51:29 2009 +0000
@@ -1509,6 +1509,46 @@
     fi
 }
 
+dnl See if we're running on PlayStation 3 Cell hardware
+CheckPS3()
+{
+  AC_ARG_ENABLE(video-ps3,
+                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 
+    video_ps3=no
+    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
+}
+
 dnl Find the SVGAlib includes and libraries
 CheckSVGA()
 {
@@ -2401,6 +2441,7 @@
         CheckDirectFB
         CheckFusionSound
         CheckPS2GS
+        CheckPS3
         CheckSVGA
         CheckVGL
         CheckWscons