test/configure.in
author Sam Lantinga <slouken@libsdl.org>
Fri, 17 Feb 2006 08:43:23 +0000
changeset 1367 e440d5c488c1
parent 991 12b13601a544
child 1380 d94b080ff6ce
permissions -rw-r--r--
Fixes for BeOS and Solaris builds
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@1367
    21
FIXME: add math library for testsprite
slouken@1367
    22
slouken@0
    23
dnl Figure out which math library to use
slouken@0
    24
case "$target" in
slouken@0
    25
    *-*-cygwin* | *-*-mingw32*)
slouken@0
    26
        MATHLIB=""
slouken@0
    27
        SYS_GL_LIBS="-lopengl32"
slouken@0
    28
        ;;
slouken@0
    29
    *-*-beos*)
slouken@0
    30
        MATHLIB=""
slouken@0
    31
        SYS_GL_LIBS="-lGL"
slouken@0
    32
        ;;
patmandin@991
    33
    *-*-darwin* )
slouken@0
    34
        MATHLIB=""
slouken@0
    35
        SYS_GL_LIBS=""
slouken@0
    36
        ;;
slouken@0
    37
    *-*-aix*)
slouken@0
    38
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    39
            CFLAGS="-mthreads"
patmandin@978
    40
        fi
slouken@0
    41
        SYS_GL_LIBS=""
slouken@0
    42
        ;;
patmandin@991
    43
    *-*-mint*)
patmandin@991
    44
        MATHLIB=""
patmandin@991
    45
        AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
patmandin@991
    46
        if test "x$OSMESA_CONFIG" = "xyes"; then
patmandin@991
    47
            OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
patmandin@991
    48
            OSMESA_LIBS=`$OSMESA_CONFIG --libs`
patmandin@991
    49
            CFLAGS="$CFLAGS $OSMESA_CFLAGS"
patmandin@991
    50
            SYS_GL_LIBS="$OSMESA_LIBS"
patmandin@991
    51
        else
patmandin@991
    52
            SYS_GL_LIBS="-lOSMesa"
patmandin@991
    53
        fi
patmandin@991
    54
		;;
slouken@0
    55
    *)
slouken@0
    56
        MATHLIB="-lm"
slouken@0
    57
        AC_PATH_X
slouken@0
    58
        AC_PATH_XTRA
slouken@0
    59
        if test x$have_x = xyes; then
slouken@0
    60
            CFLAGS="$CFLAGS $X_CFLAGS"
slouken@0
    61
            SYS_GL_LIBS="$X_LIBS -lGL"
slouken@0
    62
        else
slouken@0
    63
            SYS_GL_LIBS="-lGL"
slouken@0
    64
        fi
slouken@0
    65
        ;;
slouken@0
    66
esac
slouken@0
    67
AC_SUBST(MATHLIB)
slouken@0
    68
slouken@0
    69
dnl Check for SDL
slouken@0
    70
slouken@0
    71
AM_PATH_SDL($SDL_VERSION,
slouken@0
    72
            :,
slouken@0
    73
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@0
    74
)
slouken@0
    75
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    76
LIBS="$LIBS $SDL_LIBS"
slouken@0
    77
slouken@0
    78
dnl Check for OpenGL
slouken@0
    79
AC_MSG_CHECKING(for OpenGL support)
slouken@0
    80
have_opengl=no
slouken@0
    81
AC_TRY_COMPILE([
slouken@292
    82
 #include "SDL_opengl.h"
slouken@0
    83
],[
slouken@0
    84
],[
slouken@0
    85
have_opengl=yes
slouken@0
    86
])
slouken@0
    87
AC_MSG_RESULT($have_opengl)
slouken@0
    88
if test x$have_opengl = xyes; then
slouken@0
    89
    CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
    90
    GL_LIBS="$SYS_GL_LIBS"
slouken@0
    91
else
slouken@0
    92
    GL_LIBS=""
slouken@0
    93
fi
slouken@0
    94
AC_SUBST(GL_LIBS)
slouken@0
    95
slouken@0
    96
# Finally create all the generated files
slouken@0
    97
AC_OUTPUT([Makefile])