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 We only care about this for building testnative at the moment, so these
17 dnl values shouldn't be considered absolute truth.
18 dnl (Haiku, for example, sets none of these.)
23 dnl Figure out which math library to use
25 *-*-cygwin* | *-*-mingw32*)
29 SYS_GL_LIBS="-lopengl32"
40 SYS_GL_LIBS="-Wl,-framework,OpenGL"
45 if test x$ac_cv_prog_gcc = xyes; then
53 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
54 if test "x$OSMESA_CONFIG" = "xyes"; then
55 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
56 OSMESA_LIBS=`$OSMESA_CONFIG --libs`
57 CFLAGS="$CFLAGS $OSMESA_CFLAGS"
58 SYS_GL_LIBS="$OSMESA_LIBS"
60 SYS_GL_LIBS="-lOSMesa"
66 SYS_GL_LIBS="-lGLES_CM"
69 dnl This should really be .js, but we need to specify extra flags when compiling to js
75 dnl Oh well, call it Unix...
90 AM_PATH_SDL2($SDL_VERSION,
92 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
94 CFLAGS="$CFLAGS $SDL_CFLAGS"
95 LIBS="$LIBS -lSDL2_test $SDL_LIBS"
97 dnl Check for X11 path, needed for OpenGL on some systems
99 if test x$have_x = xyes; then
100 if test x$ac_x_includes = xno || test "x$ac_x_includes" = xNone || test "x$ac_x_includes" = x; then
103 CFLAGS="$CFLAGS -I$ac_x_includes"
105 if test x$ac_x_libraries = xno || test "x$ac_x_libraries" = xNone; then
108 if test "x$ac_x_libraries" = x; then
112 XPATH="-L$ac_x_libraries"
113 XLIB="-L$ac_x_libraries -lX11"
119 AC_MSG_CHECKING(for OpenGL support)
122 #include "SDL_opengl.h"
127 AC_MSG_RESULT($have_opengl)
129 dnl Check for OpenGL ES
130 AC_MSG_CHECKING(for OpenGL ES support)
133 #if defined (__IPHONEOS__)
134 #include <OpenGLES/ES1/gl.h>
137 #endif /* __QNXNTO__ */
142 AC_MSG_RESULT($have_opengles)
144 dnl Check for OpenGL ES2
145 AC_MSG_CHECKING(for OpenGL ES2 support)
148 #if defined (__IPHONEOS__)
149 #include <OpenGLES/ES2/gl.h>
150 #include <OpenGLES/ES2/glext.h>
152 #include <GLES2/gl2.h>
153 #include <GLES2/gl2ext.h>
159 AC_MSG_RESULT($have_opengles2)
164 if test x$have_opengles = xyes; then
165 CFLAGS="$CFLAGS -DHAVE_OPENGLES"
166 GLESLIB="$XPATH -lGLESv1_CM"
168 if test x$have_opengles2 = xyes; then
169 CFLAGS="$CFLAGS -DHAVE_OPENGLES2"
170 #GLES2LIB="$XPATH -lGLESv2"
172 if test x$have_opengl = xyes; then
173 CFLAGS="$CFLAGS -DHAVE_OPENGL"
174 GLLIB="$XPATH $SYS_GL_LIBS"
182 dnl Check for SDL_ttf
183 AC_CHECK_LIB(SDL2_ttf, TTF_Init, have_SDL_ttf=yes)
184 if test x$have_SDL_ttf = xyes; then
185 CFLAGS="$CFLAGS -DHAVE_SDL_TTF"
186 SDL_TTF_LIB="-lSDL2_ttf"
188 AC_SUBST(SDL_TTF_LIB)
190 dnl Finally create all the generated files
191 AC_OUTPUT([Makefile])