view test/configure.in @ 4106:12bb6311fd5d SDL-1.2

Hans de Goede fixed bug #495 When running boswars: http://www.boswars.org/ on a machine with intel integrathed graphics it crashes when it tries to play the initial theora splashscreen video: X Error of failed request: BadAlloc (insufficient resources for operation) Major opcode of failed request: 140 (XVideo) Minor opcode of failed request: 19 () Serial number of failed request: 25 Current serial number in output stream: 26 boswars: xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed. Aborted I recognized this problem from a few years back, when I encountered it while working on the Xv blitter for xmame. The problem is that for some reason creation the Xvport and XvImage succeeds, and failure (lack of resources / hw capability?) is only indicated during the first XvPut[Shm]Image. I've written a patch for SDL using the work around for this I developed for xmame (and which is still used successfully in xmame after many years of usage). I'll admit it isn't very pretty, but after investigating several possibilities this was the best option, any other fixes would need changes to the SDL api and abi.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 29 Dec 2007 02:23:48 +0000
parents 1164b2b282a2
children 7a4c511c980a
line wrap: on
line source

dnl Process this file with autoconf to produce a configure script.
AC_INIT(README)

dnl Detect the canonical build and host environments
AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
AC_CANONICAL_HOST

dnl Check for tools

AC_PROG_CC

dnl Check for compiler environment

AC_C_CONST

dnl Figure out which math library to use
case "$host" in
    *-*-cygwin* | *-*-mingw32*)
        EXE=".exe"
        MATHLIB=""
        SYS_GL_LIBS="-lopengl32"
        ;;
    *-*-beos*)
        EXE=""
        MATHLIB=""
        SYS_GL_LIBS="-lGL"
        ;;
    *-*-darwin* )
        EXE=""
        MATHLIB=""
        SYS_GL_LIBS="-Wl,-framework,OpenGL"
        ;;
    *-*-aix*)
        EXE=""
        if test x$ac_cv_prog_gcc = xyes; then
            CFLAGS="-mthreads"
        fi
        SYS_GL_LIBS=""
        ;;
    *-*-mint*)
        EXE=""
        MATHLIB=""
        AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
        if test "x$OSMESA_CONFIG" = "xyes"; then
            OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
            OSMESA_LIBS=`$OSMESA_CONFIG --libs`
            CFLAGS="$CFLAGS $OSMESA_CFLAGS"
            SYS_GL_LIBS="$OSMESA_LIBS"
        else
            SYS_GL_LIBS="-lOSMesa"
        fi
		;;
    *)
        EXE=""
        MATHLIB="-lm"
        SYS_GL_LIBS="-lGL"
        ;;
esac
AC_SUBST(EXE)
AC_SUBST(MATHLIB)

dnl Check for SDL
SDL_VERSION=1.2.10
AM_PATH_SDL($SDL_VERSION,
            :,
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

dnl Check for X11 path, needed for OpenGL on some systems
AC_PATH_X
if test x$have_x = xyes; then
    if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
        :
    else
        CFLAGS="$CFLAGS -I$ac_x_includes"
    fi
    if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
        :
    else
        XPATH="-L$ac_x_libraries"
    fi
fi

dnl Check for OpenGL
AC_MSG_CHECKING(for OpenGL support)
have_opengl=no
AC_TRY_COMPILE([
 #include "SDL_opengl.h"
],[
],[
have_opengl=yes
])
AC_MSG_RESULT($have_opengl)
if test x$have_opengl = xyes; then
    CFLAGS="$CFLAGS -DHAVE_OPENGL"
    GLLIB="$XPATH $SYS_GL_LIBS"
else
    GLLIB=""
fi
AC_SUBST(GLLIB)

dnl Finally create all the generated files
AC_OUTPUT([Makefile])