test/configure.in
author Patrice Mandin <patmandin@gmail.com>
Sat, 20 Nov 2004 20:56:23 +0000
changeset 981 8ba1b9cf9f12
parent 978 3b1ba22f5a28
child 991 12b13601a544
permissions -rw-r--r--
sdl-config already provides needed libs for MiNT build
     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* | *-*-mint* )
    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     *)
    42         MATHLIB="-lm"
    43         AC_PATH_X
    44         AC_PATH_XTRA
    45         if test x$have_x = xyes; then
    46             CFLAGS="$CFLAGS $X_CFLAGS"
    47             SYS_GL_LIBS="$X_LIBS -lGL"
    48         else
    49             SYS_GL_LIBS="-lGL"
    50         fi
    51         ;;
    52 esac
    53 AC_SUBST(MATHLIB)
    54 
    55 dnl Check for SDL
    56 
    57 AM_PATH_SDL($SDL_VERSION,
    58             :,
    59 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    60 )
    61 CFLAGS="$CFLAGS $SDL_CFLAGS"
    62 LIBS="$LIBS $SDL_LIBS"
    63 
    64 dnl Check for OpenGL
    65 AC_MSG_CHECKING(for OpenGL support)
    66 have_opengl=no
    67 AC_TRY_COMPILE([
    68  #include "SDL_opengl.h"
    69 ],[
    70 ],[
    71 have_opengl=yes
    72 ])
    73 AC_MSG_RESULT($have_opengl)
    74 if test x$have_opengl = xyes; then
    75     CFLAGS="$CFLAGS -DHAVE_OPENGL"
    76     GL_LIBS="$SYS_GL_LIBS"
    77 else
    78     GL_LIBS=""
    79 fi
    80 AC_SUBST(GL_LIBS)
    81 
    82 # Finally create all the generated files
    83 AC_OUTPUT([Makefile])