changeset 4295:d62725f761a1 SDL-1.2

Debian patch: 020_libcaca_new_api.diff
author Sam Lantinga <slouken@libsdl.org>
date Sat, 10 Oct 2009 08:46:06 +0000
parents 5b31c369820b
children f9fb7284991d
files configure.in include/SDL_config.h.in src/video/SDL_sysvideo.h src/video/SDL_video.c
diffstat 4 files changed, 40 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Sat Oct 10 08:11:36 2009 +0000
+++ b/configure.in	Sat Oct 10 08:46:06 2009 +0000
@@ -1518,6 +1518,38 @@
     fi
 }
 
+dnl Find the libcaca includes
+CheckCaca()
+{
+    AC_ARG_ENABLE(video-caca,
+AC_HELP_STRING([--enable-video-caca], [use libcaca video driver [[default=no]]]),
+                  , enable_video_caca=no)
+    if test x$enable_video = xyes -a x$enable_video_caca = xyes; then
+        video_caca=no
+        AC_PATH_PROG(CACACONFIG, caca-config, no)
+        if test x$CACACONFIG != xno; then
+            AC_MSG_CHECKING(for libcaca support)
+            CACA_CFLAGS=`$CACACONFIG --cflags`
+            CACA_LDFLAGS=`$CACACONFIG --libs`
+            save_CFLAGS="$CFLAGS"
+            AC_TRY_COMPILE([
+             #include <caca.h>
+            ],[
+            ],[
+             video_caca=yes
+            ])
+            CFLAGS="$save_CFLAGS"
+            AC_MSG_RESULT($video_caca)
+            if test x$video_caca = xyes; then
+                AC_DEFINE(SDL_VIDEO_DRIVER_CACA)
+                EXTRA_CFLAGS="$EXTRA_CFLAGS $CACA_CFLAGS"
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $CACA_LDFLAGS"
+                SOURCES="$SOURCES $srcdir/src/video/caca/*.c"
+            fi
+        fi
+    fi
+}
+
 dnl Set up the QTopia video driver if enabled
 CheckQtopia()
 {
@@ -2347,6 +2379,7 @@
         CheckVGL
         CheckWscons
         CheckAAlib
+        CheckCaca
         CheckQtopia
         CheckPicoGUI
         CheckOpenGLX11
--- a/include/SDL_config.h.in	Sat Oct 10 08:11:36 2009 +0000
+++ b/include/SDL_config.h.in	Sat Oct 10 08:46:06 2009 +0000
@@ -254,6 +254,7 @@
 /* Enable various video drivers */
 #undef SDL_VIDEO_DRIVER_AALIB
 #undef SDL_VIDEO_DRIVER_BWINDOW
+#undef SDL_VIDEO_DRIVER_CACA
 #undef SDL_VIDEO_DRIVER_DC
 #undef SDL_VIDEO_DRIVER_DDRAW
 #undef SDL_VIDEO_DRIVER_DGA
--- a/src/video/SDL_sysvideo.h	Sat Oct 10 08:11:36 2009 +0000
+++ b/src/video/SDL_sysvideo.h	Sat Oct 10 08:46:06 2009 +0000
@@ -407,6 +407,9 @@
 #if SDL_VIDEO_DRIVER_AALIB
 extern VideoBootStrap AALIB_bootstrap;
 #endif
+#if SDL_VIDEO_DRIVER_CACA
+extern VideoBootStrap CACA_bootstrap;
+#endif
 #if SDL_VIDEO_DRIVER_DUMMY
 extern VideoBootStrap DUMMY_bootstrap;
 #endif
--- a/src/video/SDL_video.c	Sat Oct 10 08:11:36 2009 +0000
+++ b/src/video/SDL_video.c	Sat Oct 10 08:46:06 2009 +0000
@@ -123,6 +123,9 @@
 #if SDL_VIDEO_DRIVER_AALIB
 	&AALIB_bootstrap,
 #endif
+#if SDL_VIDEO_DRIVER_CACA
+	&CACA_bootstrap,
+#endif
 #if SDL_VIDEO_DRIVER_DUMMY
 	&DUMMY_bootstrap,
 #endif