1 dnl Process this file with autoconf to produce a configure script.
4 dnl Detect the canonical build and host environments
5 AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
12 dnl Check for compiler environment
16 dnl Figure out which math library to use
18 *-*-cygwin* | *-*-mingw32*)
21 SYS_GL_LIBS="-lopengl32"
23 *-*-beos* | *-*-haiku*)
31 SYS_GL_LIBS="-Wl,-framework,OpenGL"
35 if test x$ac_cv_prog_gcc = xyes; then
43 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
44 if test "x$OSMESA_CONFIG" = "xyes"; then
45 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
46 OSMESA_LIBS=`$OSMESA_CONFIG --libs`
47 CFLAGS="$CFLAGS $OSMESA_CFLAGS"
48 SYS_GL_LIBS="$OSMESA_LIBS"
50 SYS_GL_LIBS="-lOSMesa"
56 SYS_GL_LIBS="-lGLES_CM"
69 AM_PATH_SDL($SDL_VERSION,
71 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
73 CFLAGS="$CFLAGS $SDL_CFLAGS"
74 LIBS="$LIBS $SDL_LIBS"
76 dnl Check for X11 path, needed for OpenGL on some systems
78 if test x$have_x = xyes; then
79 if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
82 CFLAGS="$CFLAGS -I$ac_x_includes"
84 if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
87 XPATH="-L$ac_x_libraries"
92 AC_MSG_CHECKING(for OpenGL support)
95 #include "SDL_opengl.h"
100 AC_MSG_RESULT($have_opengl)
102 dnl Check for OpenGL ES
103 AC_MSG_CHECKING(for OpenGL ES support)
106 #if defined (__IPHONEOS__)
107 #include <OpenGLES/ES1/gl.h>
110 #endif /* __QNXNTO__ */
115 AC_MSG_RESULT($have_opengles)
118 if test x$have_opengles = xyes; then
119 CFLAGS="$CFLAGS -DHAVE_OPENGLES"
120 GLLIB="$XPATH -lGLESv1_CM"
121 elif test x$have_opengl = xyes; then
122 CFLAGS="$CFLAGS -DHAVE_OPENGL"
123 GLLIB="$XPATH $SYS_GL_LIBS"
130 dnl Check for SDL_ttf
131 AC_MSG_CHECKING(for SDL_ttf)
139 AC_MSG_RESULT($have_SDL_ttf)
141 if test x$have_SDL_ttf = xyes; then
142 CFLAGS="$CFLAGS -DHAVE_SDL_TTF"
143 SDL_TTF_LIB="-lSDL_ttf"
146 AC_SUBST(SDL_TTF_LIB)
148 dnl Finally create all the generated files
149 AC_OUTPUT([Makefile])