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