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