view test/configure.in @ 1544:ab1e4c41ab71

Fixed bug #33 Mike Frysinger wrote: > with libsdl-1.2.9, some games (like bomberclone) started > segfaulting in Gentoo [...snip...] > the last change in the last hunk: [...snip...] > if i change the statement to read: > (table[which].blit_features & GetBlitFeatures()) == GetBlitFeatures() > bomberclone no longer segfaults on my box Alex Volkov wrote: > The test "(table[which].blit_features & GetBlitFeatures()) == > table[which].blit_features)" is correct, and the previous > "(table[which].cpu_mmx == SDL_HasMMX())" was actually broken. I think there is potentially a slightly different cause of the above problem. During the introduction of the Altivec code, the blit_table struct field 'alpha' got changed from a straightforward enum to a bitmask, which makes perfect sense by itself. However, now the table driven blitter selection code in SDL_CalculateBlitN() can choose the wrong blitters when searching for a NO_ALPHA blitter because of the following code: int a_need = 0; ... (a_need & table[which].alpha) == a_need && When searching through the normal_blit_2[] table, a SET_ALPHA blitter (like Blit_RGB565_ARGB8888) can now be selected instead of a NO_ALPHA one, causing alpha channel bits to appear in a non-alpha destination surface. I suppose this could theoretically be an indirect cause of the segfault mentioned above. I *think* this can be fixed by changing to int a_need = NO_ALPHA;
author Sam Lantinga <slouken@libsdl.org>
date Wed, 15 Mar 2006 15:47:49 +0000
parents 835c1831f903
children 31c2b8e4885e
line wrap: on
line source

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

dnl Detect the canonical host and target build environment
AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
AC_CANONICAL_SYSTEM

dnl Check for tools

AC_PROG_CC

dnl Check for compiler environment

AC_C_CONST

dnl Figure out which math library to use
case "$target" in
    *-*-cygwin* | *-*-mingw32*)
        EXE=".exe"
        MATHLIB=""
        SYS_GL_LIBS="-lopengl32"
        ;;
    *-*-beos*)
        EXE=""
        MATHLIB=""
        SYS_GL_LIBS="-lGL"
        ;;
    *-*-darwin* )
        EXE=""
        MATHLIB=""
        SYS_GL_LIBS=""
        ;;
    *-*-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 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="$SYS_GL_LIBS"
else
    GLLIB=""
fi
AC_SUBST(GLLIB)

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