test/configure.in
author Sam Lantinga <slouken@libsdl.org>
Fri, 08 Aug 2003 18:00:39 +0000
changeset 670 b8679559e432
parent 292 eadc0746dfaf
child 796 dec19b813b04
permissions -rw-r--r--
*** empty log message ***
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@670
     5
SDL_VERSION=1.2.6
slouken@0
     6
slouken@0
     7
dnl Detect the canonical host and target build environment
slouken@0
     8
AC_CANONICAL_HOST
slouken@0
     9
AC_CANONICAL_TARGET
slouken@0
    10
slouken@51
    11
dnl Setup for automake
slouken@51
    12
AM_INIT_AUTOMAKE(SDL_tests, $SDL_VERSION)
slouken@51
    13
slouken@0
    14
dnl Check for tools
slouken@0
    15
slouken@0
    16
AC_PROG_CC
slouken@0
    17
slouken@0
    18
dnl Check for compiler environment
slouken@0
    19
slouken@0
    20
AC_C_CONST
slouken@0
    21
slouken@0
    22
dnl Figure out which math library to use
slouken@0
    23
case "$target" in
slouken@0
    24
    *-*-cygwin* | *-*-mingw32*)
slouken@0
    25
        MATHLIB=""
slouken@0
    26
        SYS_GL_LIBS="-lopengl32"
slouken@0
    27
        ;;
slouken@0
    28
    *-*-beos*)
slouken@0
    29
        MATHLIB=""
slouken@0
    30
        SYS_GL_LIBS="-lGL"
slouken@0
    31
        ;;
slouken@0
    32
    *-*-darwin*)
slouken@0
    33
        MATHLIB=""
slouken@0
    34
        SYS_GL_LIBS=""
slouken@0
    35
        ;;
slouken@0
    36
    *-*-aix*)
slouken@0
    37
        if test x$ac_cv_prog_gcc = xyes; then
slouken@0
    38
            CFLAGS="-mthreads"
slouken@0
    39
	fi
slouken@0
    40
        SYS_GL_LIBS=""
slouken@0
    41
        ;;
slouken@0
    42
    *)
slouken@0
    43
        MATHLIB="-lm"
slouken@0
    44
        AC_PATH_X
slouken@0
    45
        AC_PATH_XTRA
slouken@0
    46
        if test x$have_x = xyes; then
slouken@0
    47
            CFLAGS="$CFLAGS $X_CFLAGS"
slouken@0
    48
            SYS_GL_LIBS="$X_LIBS -lGL"
slouken@0
    49
        else
slouken@0
    50
            SYS_GL_LIBS="-lGL"
slouken@0
    51
        fi
slouken@0
    52
        ;;
slouken@0
    53
esac
slouken@0
    54
AC_SUBST(MATHLIB)
slouken@0
    55
slouken@0
    56
dnl Check for SDL
slouken@0
    57
slouken@0
    58
AM_PATH_SDL($SDL_VERSION,
slouken@0
    59
            :,
slouken@0
    60
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
slouken@0
    61
)
slouken@0
    62
CFLAGS="$CFLAGS $SDL_CFLAGS"
slouken@0
    63
LIBS="$LIBS $SDL_LIBS"
slouken@0
    64
slouken@0
    65
dnl Check for OpenGL
slouken@0
    66
AC_MSG_CHECKING(for OpenGL support)
slouken@0
    67
have_opengl=no
slouken@0
    68
AC_TRY_COMPILE([
slouken@292
    69
 #include "SDL_opengl.h"
slouken@0
    70
],[
slouken@0
    71
],[
slouken@0
    72
have_opengl=yes
slouken@0
    73
])
slouken@0
    74
AC_MSG_RESULT($have_opengl)
slouken@0
    75
if test x$have_opengl = xyes; then
slouken@0
    76
    CFLAGS="$CFLAGS -DHAVE_OPENGL"
slouken@0
    77
    GL_LIBS="$SYS_GL_LIBS"
slouken@0
    78
else
slouken@0
    79
    GL_LIBS=""
slouken@0
    80
fi
slouken@0
    81
AC_SUBST(GL_LIBS)
slouken@0
    82
slouken@0
    83
# Finally create all the generated files
slouken@0
    84
AC_OUTPUT([Makefile])