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