Mercurial > sdl-ios-xcode
annotate test/configure.in @ 3089:0ea7b6bb4054
Fixed potential double-free crash
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 06 Mar 2009 05:53:33 +0000 |
parents | 0b6f51c29267 |
children | 37f9304df6a9 |
rev | line source |
---|---|
0 | 1 dnl Process this file with autoconf to produce a configure script. |
2 AC_INIT(README) | |
3 | |
1550 | 4 dnl Detect the canonical build and host environments |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
5 AC_CONFIG_AUX_DIRS($srcdir/../build-scripts) |
1550 | 6 AC_CANONICAL_HOST |
0 | 7 |
8 dnl Check for tools | |
9 | |
10 AC_PROG_CC | |
11 | |
12 dnl Check for compiler environment | |
13 | |
14 AC_C_CONST | |
15 | |
16 dnl Figure out which math library to use | |
1550 | 17 case "$host" in |
0 | 18 *-*-cygwin* | *-*-mingw32*) |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
19 EXE=".exe" |
0 | 20 MATHLIB="" |
21 SYS_GL_LIBS="-lopengl32" | |
22 ;; | |
23 *-*-beos*) | |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
24 EXE="" |
0 | 25 MATHLIB="" |
26 SYS_GL_LIBS="-lGL" | |
27 ;; | |
991
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
28 *-*-darwin* ) |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
29 EXE="" |
0 | 30 MATHLIB="" |
1813
a7cda692b681
sdl-config doesn't include the OpenGL library in --libs
Sam Lantinga <slouken@libsdl.org>
parents:
1550
diff
changeset
|
31 SYS_GL_LIBS="-Wl,-framework,OpenGL" |
0 | 32 ;; |
33 *-*-aix*) | |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
34 EXE="" |
0 | 35 if test x$ac_cv_prog_gcc = xyes; then |
36 CFLAGS="-mthreads" | |
978
3b1ba22f5a28
Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents:
796
diff
changeset
|
37 fi |
0 | 38 SYS_GL_LIBS="" |
39 ;; | |
991
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
40 *-*-mint*) |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
41 EXE="" |
991
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
42 MATHLIB="" |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
43 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no) |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
44 if test "x$OSMESA_CONFIG" = "xyes"; then |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
45 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags` |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
46 OSMESA_LIBS=`$OSMESA_CONFIG --libs` |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
47 CFLAGS="$CFLAGS $OSMESA_CFLAGS" |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
48 SYS_GL_LIBS="$OSMESA_LIBS" |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
49 else |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
50 SYS_GL_LIBS="-lOSMesa" |
12b13601a544
Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents:
981
diff
changeset
|
51 fi |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
52 ;; |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
53 *-*-qnx*) |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
54 EXE="" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
55 MATHLIB="" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
56 SYS_GL_LIBS="-lGLES_CM" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
57 ;; |
0 | 58 *) |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
59 EXE="" |
0 | 60 MATHLIB="-lm" |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
61 SYS_GL_LIBS="-lGL" |
0 | 62 ;; |
63 esac | |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
64 AC_SUBST(EXE) |
0 | 65 AC_SUBST(MATHLIB) |
66 | |
67 dnl Check for SDL | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1813
diff
changeset
|
68 SDL_VERSION=1.3.0 |
0 | 69 AM_PATH_SDL($SDL_VERSION, |
70 :, | |
71 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) | |
72 ) | |
73 CFLAGS="$CFLAGS $SDL_CFLAGS" | |
74 LIBS="$LIBS $SDL_LIBS" | |
75 | |
2138
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
76 dnl Check for X11 path, needed for OpenGL on some systems |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
77 AC_PATH_X |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
78 if test x$have_x = xyes; then |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
79 if test x$ac_x_includes = xno || test x$ac_x_includes = x; then |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
80 : |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
81 else |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
82 CFLAGS="$CFLAGS -I$ac_x_includes" |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
83 fi |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
84 if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
85 : |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
86 else |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
87 XPATH="-L$ac_x_libraries" |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
88 fi |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
89 fi |
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
90 |
0 | 91 dnl Check for OpenGL |
92 AC_MSG_CHECKING(for OpenGL support) | |
93 have_opengl=no | |
94 AC_TRY_COMPILE([ | |
292
eadc0746dfaf
Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents:
214
diff
changeset
|
95 #include "SDL_opengl.h" |
0 | 96 ],[ |
97 ],[ | |
98 have_opengl=yes | |
99 ]) | |
100 AC_MSG_RESULT($have_opengl) | |
101 if test x$have_opengl = xyes; then | |
102 CFLAGS="$CFLAGS -DHAVE_OPENGL" | |
2138
9af6717e676a
Merged change from 1.2 to add X11 path for OpenGL detection
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
103 GLLIB="$XPATH $SYS_GL_LIBS" |
0 | 104 else |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
105 GLLIB="" |
0 | 106 fi |
3087
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
107 |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
108 dnl Check for OpenGL ES |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
109 AC_MSG_CHECKING(for OpenGL ES support) |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
110 have_opengles=no |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
111 AC_TRY_COMPILE([ |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
112 #if defined (__QNXNTO__) |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
113 #include <GLES/gl.h> |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
114 #elif defined (__IPHONEOS__) |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
115 #include <OpenGLES/ES1/gl.h> |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
116 #else |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
117 #error "No OpenGL ES support" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
118 #endif /* __QNXNTO__ */ |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
119 ],[ |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
120 ],[ |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
121 have_opengles=yes |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
122 ]) |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
123 AC_MSG_RESULT($have_opengles) |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
124 if test x$have_opengles = xyes; then |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
125 CFLAGS="$CFLAGS -DHAVE_OPENGLES" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
126 GLLIB="$XPATH $SYS_GL_LIBS" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
127 else |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
128 GLLIB="" |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
129 fi |
0b6f51c29267
Date: Wed, 4 Mar 2009 15:38:22 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
2138
diff
changeset
|
130 |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
131 AC_SUBST(GLLIB) |
0 | 132 |
1380
d94b080ff6ce
Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents:
1367
diff
changeset
|
133 dnl Finally create all the generated files |
0 | 134 AC_OUTPUT([Makefile]) |