test/configure.in
changeset 0 74212992fb08
child 51 fba28d77901f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/configure.in	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,86 @@
     1.4 +dnl Process this file with autoconf to produce a configure script.
     1.5 +AC_INIT(README)
     1.6 +
     1.7 +dnl Setup for automake
     1.8 +SDL_VERSION=1.2.0
     1.9 +AM_INIT_AUTOMAKE(SDL_tests, $SDL_VERSION)
    1.10 +
    1.11 +dnl Detect the canonical host and target build environment
    1.12 +AC_CANONICAL_HOST
    1.13 +AC_CANONICAL_TARGET
    1.14 +
    1.15 +dnl Check for tools
    1.16 +
    1.17 +AC_PROG_CC
    1.18 +
    1.19 +dnl Check for compiler environment
    1.20 +
    1.21 +AC_C_CONST
    1.22 +
    1.23 +dnl Figure out which math library to use
    1.24 +case "$target" in
    1.25 +    *-*-cygwin* | *-*-mingw32*)
    1.26 +        MATHLIB=""
    1.27 +        SYS_GL_LIBS="-lopengl32"
    1.28 +        ;;
    1.29 +    *-*-beos*)
    1.30 +        MATHLIB=""
    1.31 +        SYS_GL_LIBS="-lGL"
    1.32 +        ;;
    1.33 +    *-*-darwin*)
    1.34 +        MATHLIB=""
    1.35 +        SYS_GL_LIBS=""
    1.36 +        ;;
    1.37 +    *-*-aix*)
    1.38 +        if test x$ac_cv_prog_gcc = xyes; then
    1.39 +            CFLAGS="-mthreads"
    1.40 +	fi
    1.41 +        SYS_GL_LIBS=""
    1.42 +        ;;
    1.43 +    *)
    1.44 +        MATHLIB="-lm"
    1.45 +        AC_PATH_X
    1.46 +        AC_PATH_XTRA
    1.47 +        if test x$have_x = xyes; then
    1.48 +            CFLAGS="$CFLAGS $X_CFLAGS"
    1.49 +            SYS_GL_LIBS="$X_LIBS -lGL"
    1.50 +        else
    1.51 +            SYS_GL_LIBS="-lGL"
    1.52 +        fi
    1.53 +        ;;
    1.54 +esac
    1.55 +AC_SUBST(MATHLIB)
    1.56 +
    1.57 +dnl Check for SDL
    1.58 +
    1.59 +AM_PATH_SDL($SDL_VERSION,
    1.60 +            :,
    1.61 +	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
    1.62 +)
    1.63 +CFLAGS="$CFLAGS $SDL_CFLAGS"
    1.64 +LIBS="$LIBS $SDL_LIBS"
    1.65 +
    1.66 +dnl Check for OpenGL
    1.67 +AC_MSG_CHECKING(for OpenGL support)
    1.68 +have_opengl=no
    1.69 +AC_TRY_COMPILE([
    1.70 + #if defined(__APPLE__) && defined(__MACH__)
    1.71 + #include <OpenGL/gl.h>
    1.72 + #else
    1.73 + #include <GL/gl.h>
    1.74 + #endif
    1.75 +],[
    1.76 +],[
    1.77 +have_opengl=yes
    1.78 +])
    1.79 +AC_MSG_RESULT($have_opengl)
    1.80 +if test x$have_opengl = xyes; then
    1.81 +    CFLAGS="$CFLAGS -DHAVE_OPENGL"
    1.82 +    GL_LIBS="$SYS_GL_LIBS"
    1.83 +else
    1.84 +    GL_LIBS=""
    1.85 +fi
    1.86 +AC_SUBST(GL_LIBS)
    1.87 +
    1.88 +# Finally create all the generated files
    1.89 +AC_OUTPUT([Makefile])