test/configure.in
author Patrice Mandin <patmandin@gmail.com>
Wed, 17 Nov 2004 23:13:15 +0000
changeset 978 3b1ba22f5a28
parent 796 dec19b813b04
child 981 8ba1b9cf9f12
permissions -rw-r--r--
Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
slouken@0
     1
dnl Process this file with autoconf to produce a configure script.
slouken@0
     2
AC_INIT(README)
slouken@0
     3
slouken@0
     4
dnl Setup for automake
slouken@796
     5
SDL_VERSION=1.2.7
slouken@0
     6
slouken@0
     7
dnl Detect the canonical host and target build environment
patmandin@978
     8
AC_CANONICAL_SYSTEM
slouken@0
     9
slouken@51
    10
dnl Setup for automake
slouken@51
    11
AM_INIT_AUTOMAKE(SDL_tests, $SDL_VERSION)
slouken@51
    12
slouken@0
    13
dnl Check for tools
slouken@0
    14
slouken@0
    15
AC_PROG_CC
slouken@0
    16
slouken@0
    17
dnl Check for compiler environment
slouken@0
    18
slouken@0
    19
AC_C_CONST
slouken@0
    20
slouken@0
    21
dnl Figure out which math library to use
slouken@0
    22
case "$target" in
slouken@0
    23
    *-*-cygwin* | *-*-mingw32*)
slouken@0
    24
        MATHLIB=""
slouken@0
    25
        SYS_GL_LIBS="-lopengl32"
slouken@0
    26
        ;;
slouken@0
    27
    *-*-beos*)
slouken@0
    28
        MATHLIB=""
slouken@0
    29
        SYS_GL_LIBS="-lGL"
slouken@0
    30
        ;;
slouken@0
    31
    *-*-darwin*)
slouken@0
    32
        MATHLIB=""
slouken@0
    33
        SYS_GL_LIBS=""
slouken@0
    34
        ;;
slouken@0
    35
    *-*-aix*)
slouken@0
    36
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    37
            CFLAGS="-mthreads"
patmandin@978
    38
        fi
slouken@0
    39
        SYS_GL_LIBS=""
slouken@0
    40
        ;;
patmandin@978
    41
    *-*-mint*)
patmandin@978
    42
        MATHLIB="-lm"
patmandin@978
    43
        SYS_GL_LIBS="-lOSMesa"
patmandin@978
    44
        ;;
slouken@0
    45
    *)
slouken@0
    46
        MATHLIB="-lm"
slouken@0
    47
        AC_PATH_X
slouken@0
    48
        AC_PATH_XTRA
slouken@0
    49
        if test x$have_x = xyes; then
slouken@0
    50
            CFLAGS="$CFLAGS $X_CFLAGS"
slouken@0
    51
            SYS_GL_LIBS="$X_LIBS -lGL"
slouken@0
    52
        else
slouken@0
    53
            SYS_GL_LIBS="-lGL"
slouken@0
    54
        fi
slouken@0
    55
        ;;
slouken@0
    56
esac
slouken@0
    57
AC_SUBST(MATHLIB)
slouken@0
    58
slouken@0
    59
dnl Check for SDL
slouken@0
    60
slouken@0
    61
AM_PATH_SDL($SDL_VERSION,
slouken@0
    62
            :,
slouken@0
    63
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@0
    64
)
slouken@0
    65
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    66
LIBS="$LIBS $SDL_LIBS"
slouken@0
    67
slouken@0
    68
dnl Check for OpenGL
slouken@0
    69
AC_MSG_CHECKING(for OpenGL support)
slouken@0
    70
have_opengl=no
slouken@0
    71
AC_TRY_COMPILE([
slouken@292
    72
 #include "SDL_opengl.h"
slouken@0
    73
],[
slouken@0
    74
],[
slouken@0
    75
have_opengl=yes
slouken@0
    76
])
slouken@0
    77
AC_MSG_RESULT($have_opengl)
slouken@0
    78
if test x$have_opengl = xyes; then
slouken@0
    79
    CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
    80
    GL_LIBS="$SYS_GL_LIBS"
slouken@0
    81
else
slouken@0
    82
    GL_LIBS=""
slouken@0
    83
fi
slouken@0
    84
AC_SUBST(GL_LIBS)
slouken@0
    85
slouken@0
    86
# Finally create all the generated files
slouken@0
    87
AC_OUTPUT([Makefile])