icculus@7924
|
1 |
dnl Process this file with autoconf to produce a configure script.
|
icculus@7924
|
2 |
AC_INIT([sdlvisualtest], [0.01], [apoorvupreti@gmail.com])
|
icculus@7924
|
3 |
|
icculus@7924
|
4 |
dnl Detect the canonical build and host environments
|
icculus@7924
|
5 |
AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
|
icculus@7924
|
6 |
AC_CANONICAL_HOST
|
icculus@7924
|
7 |
|
icculus@7924
|
8 |
dnl Check for tools
|
icculus@7924
|
9 |
|
icculus@7924
|
10 |
AC_PROG_CC
|
icculus@7924
|
11 |
|
icculus@7924
|
12 |
dnl Check for compiler environment
|
icculus@7924
|
13 |
|
icculus@7924
|
14 |
AC_C_CONST
|
icculus@7924
|
15 |
|
icculus@7924
|
16 |
dnl We only care about this for building testnative at the moment, so these
|
icculus@7924
|
17 |
dnl values shouldn't be considered absolute truth.
|
icculus@7981
|
18 |
dnl (Haiku, for example, sets none of these.)
|
icculus@7924
|
19 |
ISUNIX="false"
|
icculus@7924
|
20 |
ISWINDOWS="false"
|
icculus@7924
|
21 |
ISMACOSX="false"
|
icculus@7924
|
22 |
|
icculus@7924
|
23 |
dnl Figure out which math or extra library to use
|
icculus@7924
|
24 |
case "$host" in
|
icculus@7924
|
25 |
*-*-cygwin* | *-*-mingw32*)
|
icculus@7924
|
26 |
ISWINDOWS="true"
|
icculus@7924
|
27 |
EXE=".exe"
|
icculus@7924
|
28 |
MATHLIB=""
|
icculus@7924
|
29 |
EXTRALIB="-lshlwapi"
|
icculus@7924
|
30 |
SYS_GL_LIBS="-lopengl32"
|
icculus@7924
|
31 |
;;
|
icculus@7981
|
32 |
*-*-haiku*)
|
icculus@7924
|
33 |
EXE=""
|
icculus@7924
|
34 |
MATHLIB=""
|
icculus@7924
|
35 |
EXTRALIB=""
|
icculus@7924
|
36 |
SYS_GL_LIBS="-lGL"
|
icculus@7924
|
37 |
;;
|
icculus@7924
|
38 |
*-*-darwin* )
|
icculus@7924
|
39 |
ISMACOSX="true"
|
icculus@7924
|
40 |
EXE=""
|
icculus@7924
|
41 |
MATHLIB=""
|
icculus@7924
|
42 |
EXTRALIB=""
|
icculus@7924
|
43 |
|
icculus@7924
|
44 |
;;
|
icculus@7924
|
45 |
*-*-aix*)
|
icculus@7924
|
46 |
ISUNIX="true"
|
icculus@7924
|
47 |
EXE=""
|
icculus@7924
|
48 |
if test x$ac_cv_prog_gcc = xyes; then
|
icculus@7924
|
49 |
CFLAGS="-mthreads"
|
icculus@7924
|
50 |
fi
|
icculus@7924
|
51 |
MATHLIB=""
|
icculus@7924
|
52 |
EXTRALIB=""
|
icculus@7924
|
53 |
SYS_GL_LIBS=""
|
icculus@7924
|
54 |
;;
|
icculus@7924
|
55 |
*-*-mint*)
|
icculus@7924
|
56 |
EXE=""
|
icculus@7924
|
57 |
MATHLIB=""
|
icculus@7924
|
58 |
EXTRALIB=""
|
icculus@7924
|
59 |
AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
|
icculus@7924
|
60 |
if test "x$OSMESA_CONFIG" = "xyes"; then
|
icculus@7924
|
61 |
OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
|
icculus@7924
|
62 |
OSMESA_LIBS=`$OSMESA_CONFIG --libs`
|
icculus@7924
|
63 |
CFLAGS="$CFLAGS $OSMESA_CFLAGS"
|
icculus@7924
|
64 |
SYS_GL_LIBS="$OSMESA_LIBS"
|
icculus@7924
|
65 |
else
|
icculus@7924
|
66 |
SYS_GL_LIBS="-lOSMesa"
|
icculus@7924
|
67 |
fi
|
icculus@7924
|
68 |
;;
|
icculus@7924
|
69 |
*-*-qnx*)
|
icculus@7924
|
70 |
EXE=""
|
icculus@7924
|
71 |
MATHLIB=""
|
icculus@7924
|
72 |
EXTRALIB=""
|
icculus@7924
|
73 |
SYS_GL_LIBS="-lGLES_CM"
|
icculus@7924
|
74 |
;;
|
icculus@7924
|
75 |
*)
|
icculus@7924
|
76 |
dnl Oh well, call it Unix...
|
icculus@7924
|
77 |
ISUNIX="true"
|
icculus@7924
|
78 |
EXE=""
|
icculus@7924
|
79 |
MATHLIB="-lm"
|
icculus@7924
|
80 |
EXTRALIB=""
|
icculus@7924
|
81 |
SYS_GL_LIBS="-lGL"
|
icculus@7924
|
82 |
;;
|
icculus@7924
|
83 |
esac
|
icculus@7924
|
84 |
AC_SUBST(EXE)
|
icculus@7924
|
85 |
AC_SUBST(MATHLIB)
|
icculus@7924
|
86 |
AC_SUBST(EXTRALIB)
|
icculus@7924
|
87 |
AC_SUBST(ISMACOSX)
|
icculus@7924
|
88 |
AC_SUBST(ISWINDOWS)
|
icculus@7924
|
89 |
AC_SUBST(ISUNIX)
|
icculus@7924
|
90 |
|
icculus@7924
|
91 |
dnl Check for SDL
|
icculus@7924
|
92 |
SDL_VERSION=2.0.0
|
icculus@7924
|
93 |
AM_PATH_SDL2($SDL_VERSION,
|
icculus@7924
|
94 |
:,
|
icculus@7924
|
95 |
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
|
icculus@7924
|
96 |
)
|
icculus@7924
|
97 |
CFLAGS="$CFLAGS $SDL_CFLAGS"
|
icculus@7924
|
98 |
LIBS="$LIBS -lSDL2_test $SDL_LIBS $EXTRALIB"
|
icculus@7924
|
99 |
|
icculus@7924
|
100 |
dnl Check for X11 path, needed for OpenGL on some systems
|
icculus@7924
|
101 |
AC_PATH_X
|
icculus@7924
|
102 |
if test x$have_x = xyes; then
|
icculus@7924
|
103 |
if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
|
icculus@7924
|
104 |
:
|
icculus@7924
|
105 |
else
|
icculus@7924
|
106 |
CFLAGS="$CFLAGS -I$ac_x_includes"
|
icculus@7924
|
107 |
fi
|
icculus@7924
|
108 |
if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
|
icculus@7924
|
109 |
:
|
icculus@7924
|
110 |
else
|
icculus@7924
|
111 |
XPATH="-L$ac_x_libraries"
|
icculus@7924
|
112 |
fi
|
icculus@7924
|
113 |
fi
|
icculus@7924
|
114 |
|
icculus@7924
|
115 |
dnl Check for OpenGL
|
icculus@7924
|
116 |
AC_MSG_CHECKING(for OpenGL support)
|
icculus@7924
|
117 |
have_opengl=no
|
icculus@7924
|
118 |
AC_TRY_COMPILE([
|
icculus@7924
|
119 |
#include "SDL_opengl.h"
|
icculus@7924
|
120 |
],[
|
icculus@7924
|
121 |
],[
|
icculus@7924
|
122 |
have_opengl=yes
|
icculus@7924
|
123 |
])
|
icculus@7924
|
124 |
AC_MSG_RESULT($have_opengl)
|
icculus@7924
|
125 |
|
icculus@7924
|
126 |
dnl Check for OpenGL ES
|
icculus@7924
|
127 |
AC_MSG_CHECKING(for OpenGL ES support)
|
icculus@7924
|
128 |
have_opengles=no
|
icculus@7924
|
129 |
AC_TRY_COMPILE([
|
icculus@7924
|
130 |
#if defined (__IPHONEOS__)
|
icculus@7924
|
131 |
#include <OpenGLES/ES1/gl.h>
|
icculus@7924
|
132 |
#else
|
icculus@7924
|
133 |
#include <GLES/gl.h>
|
icculus@7924
|
134 |
#endif /* __QNXNTO__ */
|
icculus@7924
|
135 |
],[
|
icculus@7924
|
136 |
],[
|
icculus@7924
|
137 |
have_opengles=yes
|
icculus@7924
|
138 |
])
|
icculus@7924
|
139 |
AC_MSG_RESULT($have_opengles)
|
icculus@7924
|
140 |
|
icculus@7924
|
141 |
GLLIB=""
|
icculus@7924
|
142 |
if test x$have_opengles = xyes; then
|
icculus@7924
|
143 |
CFLAGS="$CFLAGS -DHAVE_OPENGLES"
|
icculus@7924
|
144 |
GLLIB="$XPATH -lGLESv1_CM"
|
icculus@7924
|
145 |
elif test x$have_opengl = xyes; then
|
icculus@7924
|
146 |
CFLAGS="$CFLAGS -DHAVE_OPENGL"
|
icculus@7924
|
147 |
GLLIB="$XPATH $SYS_GL_LIBS"
|
icculus@7924
|
148 |
else
|
icculus@7924
|
149 |
GLLIB=""
|
icculus@7924
|
150 |
fi
|
icculus@7924
|
151 |
|
icculus@7924
|
152 |
AC_SUBST(GLLIB)
|
icculus@7924
|
153 |
|
icculus@7924
|
154 |
dnl Check for SDL_ttf
|
icculus@7924
|
155 |
AC_CHECK_LIB(SDL2_ttf, TTF_Init, have_SDL_ttf=yes)
|
icculus@7924
|
156 |
if test x$have_SDL_ttf = xyes; then
|
icculus@7924
|
157 |
CFLAGS="$CFLAGS -DHAVE_SDL_TTF"
|
icculus@7924
|
158 |
SDL_TTF_LIB="-lSDL2_ttf"
|
icculus@7924
|
159 |
fi
|
icculus@7924
|
160 |
AC_SUBST(SDL_TTF_LIB)
|
icculus@7924
|
161 |
|
icculus@7924
|
162 |
dnl Finally create all the generated files
|
icculus@7924
|
163 |
dnl AC_OUTPUT([Makefile])
|
icculus@7924
|
164 |
AC_CONFIG_HEADERS([config.h])
|
icculus@7924
|
165 |
AC_CONFIG_FILES([Makefile])
|
icculus@7924
|
166 |
AC_OUTPUT()
|