test/configure.in
author Sam Lantinga <slouken@libsdl.org>
Fri, 17 Feb 2006 08:43:23 +0000
changeset 1367 e440d5c488c1
parent 991 12b13601a544
child 1380 d94b080ff6ce
permissions -rw-r--r--
Fixes for BeOS and Solaris builds
     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 FIXME: add math library for testsprite
    22 
    23 dnl Figure out which math library to use
    24 case "$target" in
    25     *-*-cygwin* | *-*-mingw32*)
    26         MATHLIB=""
    27         SYS_GL_LIBS="-lopengl32"
    28         ;;
    29     *-*-beos*)
    30         MATHLIB=""
    31         SYS_GL_LIBS="-lGL"
    32         ;;
    33     *-*-darwin* )
    34         MATHLIB=""
    35         SYS_GL_LIBS=""
    36         ;;
    37     *-*-aix*)
    38         if test x$ac_cv_prog_gcc = xyes; then
    39             CFLAGS="-mthreads"
    40         fi
    41         SYS_GL_LIBS=""
    42         ;;
    43     *-*-mint*)
    44         MATHLIB=""
    45         AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
    46         if test "x$OSMESA_CONFIG" = "xyes"; then
    47             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
    48             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
    49             CFLAGS="$CFLAGS $OSMESA_CFLAGS"
    50             SYS_GL_LIBS="$OSMESA_LIBS"
    51         else
    52             SYS_GL_LIBS="-lOSMesa"
    53         fi
    54 		;;
    55     *)
    56         MATHLIB="-lm"
    57         AC_PATH_X
    58         AC_PATH_XTRA
    59         if test x$have_x = xyes; then
    60             CFLAGS="$CFLAGS $X_CFLAGS"
    61             SYS_GL_LIBS="$X_LIBS -lGL"
    62         else
    63             SYS_GL_LIBS="-lGL"
    64         fi
    65         ;;
    66 esac
    67 AC_SUBST(MATHLIB)
    68 
    69 dnl Check for SDL
    70 
    71 AM_PATH_SDL($SDL_VERSION,
    72             :,
    73 	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    74 )
    75 CFLAGS="$CFLAGS $SDL_CFLAGS"
    76 LIBS="$LIBS $SDL_LIBS"
    77 
    78 dnl Check for OpenGL
    79 AC_MSG_CHECKING(for OpenGL support)
    80 have_opengl=no
    81 AC_TRY_COMPILE([
    82  #include "SDL_opengl.h"
    83 ],[
    84 ],[
    85 have_opengl=yes
    86 ])
    87 AC_MSG_RESULT($have_opengl)
    88 if test x$have_opengl = xyes; then
    89     CFLAGS="$CFLAGS -DHAVE_OPENGL"
    90     GL_LIBS="$SYS_GL_LIBS"
    91 else
    92     GL_LIBS=""
    93 fi
    94 AC_SUBST(GL_LIBS)
    95 
    96 # Finally create all the generated files
    97 AC_OUTPUT([Makefile])