diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/m4/evas_check_engine.m4 | 943 |
1 files changed, 943 insertions, 0 deletions
diff --git a/libraries/evas/m4/evas_check_engine.m4 b/libraries/evas/m4/evas_check_engine.m4 new file mode 100644 index 0000000..5294100 --- /dev/null +++ b/libraries/evas/m4/evas_check_engine.m4 | |||
@@ -0,0 +1,943 @@ | |||
1 | |||
2 | dnl use: EVAS_CHECK_ENGINE_DEP_BUFFER(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
3 | |||
4 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_BUFFER], | ||
5 | [ | ||
6 | |||
7 | have_dep="yes" | ||
8 | evas_engine_[]$1[]_cflags="" | ||
9 | evas_engine_[]$1[]_libs="" | ||
10 | |||
11 | AC_SUBST([evas_engine_$1_cflags]) | ||
12 | AC_SUBST([evas_engine_$1_libs]) | ||
13 | |||
14 | if test "x${have_dep}" = "xyes" ; then | ||
15 | m4_default([$4], [:]) | ||
16 | else | ||
17 | m4_default([$5], [:]) | ||
18 | fi | ||
19 | |||
20 | ]) | ||
21 | |||
22 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_XLIB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
23 | |||
24 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_XLIB], | ||
25 | [ | ||
26 | |||
27 | have_dep="no" | ||
28 | evas_engine_[]$1[]_cflags="" | ||
29 | evas_engine_[]$1[]_libs="" | ||
30 | |||
31 | AC_PATH_X | ||
32 | AC_PATH_XTRA | ||
33 | |||
34 | AC_CHECK_HEADER([X11/X.h], [have_dep="yes"]) | ||
35 | |||
36 | if test "x${have_dep}" = "xyes" ; then | ||
37 | AC_CHECK_LIB([X11], [XCreateImage], [have_dep="yes"], [have_dep="no"]) | ||
38 | fi | ||
39 | |||
40 | if test "x${have_dep}" = "xyes" ; then | ||
41 | AC_CHECK_LIB([Xext], [XShmCreateImage], [have_dep="yes"], [have_dep="no"]) | ||
42 | fi | ||
43 | |||
44 | if test "x${have_dep}" = "xyes" ; then | ||
45 | if test "x$2" = "xyes" ; then | ||
46 | x_libs="${x_libs} -lX11 -lXext" | ||
47 | else | ||
48 | x_dir=${x_dir:-/usr/X11R6} | ||
49 | x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} | ||
50 | x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext" | ||
51 | fi | ||
52 | evas_engine_[]$1[]_cflags="${x_cflags}" | ||
53 | evas_engine_[]$1[]_libs="${x_libs}" | ||
54 | fi | ||
55 | |||
56 | AC_SUBST([evas_engine_$1_cflags]) | ||
57 | AC_SUBST([evas_engine_$1_libs]) | ||
58 | |||
59 | if test "x${have_dep}" = "xyes" ; then | ||
60 | m4_default([$4], [:]) | ||
61 | else | ||
62 | m4_default([$5], [:]) | ||
63 | fi | ||
64 | |||
65 | ]) | ||
66 | |||
67 | dnl use: EVAS_CHECK_ENGINE_DEP_GL_XLIB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
68 | |||
69 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_XLIB], | ||
70 | [ | ||
71 | |||
72 | evas_engine_[]$1[]_cflags="" | ||
73 | evas_engine_[]$1[]_libs="" | ||
74 | |||
75 | AC_PATH_X | ||
76 | AC_PATH_XTRA | ||
77 | |||
78 | AC_CHECK_HEADER([GL/gl.h], | ||
79 | [have_dep="yes"], | ||
80 | [have_dep="no"], | ||
81 | [ | ||
82 | #include <GL/gl.h> | ||
83 | #include <GL/glext.h> | ||
84 | #include <GL/glx.h> | ||
85 | #include <X11/Xlib.h> | ||
86 | #include <X11/Xatom.h> | ||
87 | #include <X11/Xutil.h> | ||
88 | #include <X11/extensions/Xrender.h> | ||
89 | #include <X11/Xresource.h> | ||
90 | ]) | ||
91 | |||
92 | gl_pt_lib=""; | ||
93 | have_gl_pt="no" | ||
94 | |||
95 | AC_MSG_CHECKING([whether pthread_create() is supported]) | ||
96 | CFLAGS_save="${CFLAGS}" | ||
97 | CFLAGS="${CFLAGS} -pthread" | ||
98 | LIBS_save="${LIBS}" | ||
99 | LIBS="${LIBS} -pthread" | ||
100 | AC_LINK_IFELSE( | ||
101 | [AC_LANG_PROGRAM([[ | ||
102 | #include <pthread.h> | ||
103 | ]], | ||
104 | [[ | ||
105 | pthread_create(NULL, NULL, NULL, NULL); | ||
106 | ]])], | ||
107 | [have_gl_pt="yes"], | ||
108 | [have_gl_pt="no"]) | ||
109 | CFLAGS=${CFLAGS_save} | ||
110 | LIBS=${LIBS_save} | ||
111 | AC_MSG_RESULT([${have_gl_pt}]) | ||
112 | |||
113 | if test "x$have_gl_pt" = "xyes" ; then | ||
114 | gl_pt_lib=" -pthread" | ||
115 | fi | ||
116 | |||
117 | if test "x${have_dep}" = "xyes" ; then | ||
118 | AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"]) | ||
119 | fi | ||
120 | |||
121 | if test "x${have_dep}" = "xyes" ; then | ||
122 | AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"]) | ||
123 | fi | ||
124 | |||
125 | if test "x${have_dep}" = "xyes" ; then | ||
126 | AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], -lX11 -lXext -lXrender -lm $gl_pt_lib) | ||
127 | fi | ||
128 | |||
129 | if test "x$gl_flavor_gles" = "xyes" ; then | ||
130 | have_dep=no | ||
131 | fi | ||
132 | |||
133 | if test "x${have_dep}" = "xyes" ; then | ||
134 | PKG_CHECK_MODULES([GL_EET], [eet >= 1.5.0], [have_dep="yes"], [have_dep="no"]) | ||
135 | if test "x${have_dep}" = "xyes" ; then | ||
136 | if test "x$2" = "xyes" ; then | ||
137 | x_libs="${x_libs} -lX11 -lXext -lXrender" | ||
138 | else | ||
139 | x_dir=${x_dir:-/usr/X11R6} | ||
140 | x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} | ||
141 | x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" | ||
142 | fi | ||
143 | evas_engine_[]$1[]_cflags="-I/usr/include ${x_cflags}" | ||
144 | evas_engine_[]$1[]_libs="${x_libs} -lGL $gl_pt_lib" | ||
145 | evas_engine_gl_common_libs="-lGL $gl_pt_lib" | ||
146 | fi | ||
147 | else | ||
148 | if test "x$2" = "xyes" ; then | ||
149 | x_libs="${x_libs} -lX11 -lXext -lXrender" | ||
150 | else | ||
151 | x_dir=${x_dir:-/usr/X11R6} | ||
152 | x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} | ||
153 | x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" | ||
154 | fi | ||
155 | AC_CHECK_HEADER([GLES2/gl2.h], | ||
156 | [have_egl="yes"], | ||
157 | [have_egl="no"], | ||
158 | [ | ||
159 | #include <GLES2/gl2.h> | ||
160 | #include <GLES2/gl2ext.h> | ||
161 | #include <EGL/egl.h> | ||
162 | #include <X11/Xlib.h> | ||
163 | #include <X11/Xatom.h> | ||
164 | #include <X11/Xutil.h> | ||
165 | #include <X11/extensions/Xrender.h> | ||
166 | #include <X11/Xresource.h> | ||
167 | ]) | ||
168 | if test "x${have_egl}" = "xyes" ; then | ||
169 | AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib) | ||
170 | if test "x${have_glesv2}" = "xyes" ; then | ||
171 | PKG_CHECK_MODULES([GL_EET], [eet >= 1.5.0], [have_dep="yes"], [have_dep="no"]) | ||
172 | if test "x${have_dep}" = "xyes" ; then | ||
173 | evas_engine_[]$1[]_cflags="${x_cflags}" | ||
174 | evas_engine_[]$1[]_libs="${x_libs} -lGLESv2 -lEGL -lm $gl_pt_lib" | ||
175 | evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib" | ||
176 | have_dep="yes" | ||
177 | gl_flavor_gles="no" | ||
178 | AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support]) | ||
179 | gles_variety_sgx="yes" | ||
180 | fi | ||
181 | fi | ||
182 | fi | ||
183 | fi | ||
184 | |||
185 | AC_SUBST([evas_engine_$1_cflags]) | ||
186 | AC_SUBST([evas_engine_$1_libs]) | ||
187 | |||
188 | |||
189 | if test "x${have_dep}" = "xyes" ; then | ||
190 | m4_default([$4], [:]) | ||
191 | else | ||
192 | m4_default([$5], [:]) | ||
193 | fi | ||
194 | |||
195 | ]) | ||
196 | |||
197 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_XCB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
198 | |||
199 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_XCB], | ||
200 | [ | ||
201 | |||
202 | requirement="" | ||
203 | have_dep="no" | ||
204 | evas_engine_[]$1[]_cflags="" | ||
205 | evas_engine_[]$1[]_libs="" | ||
206 | |||
207 | PKG_CHECK_MODULES([XCB], | ||
208 | [xcb xcb-shm xcb-image >= 0.2.1 pixman-1], | ||
209 | [ | ||
210 | have_dep="yes" | ||
211 | requirement="xcb xcb-shm xcb-image pixman-1" | ||
212 | evas_engine_[]$1[]_cflags="${XCB_CFLAGS}" | ||
213 | evas_engine_[]$1[]_libs="${XCB_LIBS}" | ||
214 | ],[ | ||
215 | have_dep="no" | ||
216 | ] | ||
217 | ) | ||
218 | |||
219 | AC_SUBST([evas_engine_$1_cflags]) | ||
220 | AC_SUBST([evas_engine_$1_libs]) | ||
221 | |||
222 | if test "x$3" = "xstatic" ; then | ||
223 | requirement_evas="${requirement} ${requirement_evas}" | ||
224 | fi | ||
225 | |||
226 | if test "x${have_dep}" = "xyes" ; then | ||
227 | m4_default([$4], [:]) | ||
228 | else | ||
229 | m4_default([$5], [:]) | ||
230 | fi | ||
231 | |||
232 | ]) | ||
233 | |||
234 | |||
235 | dnl use: EVAS_CHECK_ENGINE_DEP_GL_XCB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
236 | |||
237 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_XCB], | ||
238 | [ | ||
239 | |||
240 | evas_engine_[]$1[]_cflags="" | ||
241 | evas_engine_[]$1[]_libs="" | ||
242 | |||
243 | AC_PATH_X | ||
244 | AC_PATH_XTRA | ||
245 | |||
246 | AC_CHECK_HEADER([GL/gl.h], | ||
247 | [have_dep="yes"], | ||
248 | [have_dep="no"], | ||
249 | [ | ||
250 | #include <GL/gl.h> | ||
251 | #include <GL/glext.h> | ||
252 | #include <GL/glx.h> | ||
253 | ]) | ||
254 | |||
255 | gl_pt_lib=""; | ||
256 | have_gl_pt="no" | ||
257 | |||
258 | AC_MSG_CHECKING([whether pthread_create() is supported]) | ||
259 | CFLAGS_save="${CFLAGS}" | ||
260 | CFLAGS="${CFLAGS} -pthread" | ||
261 | LIBS_save="${LIBS}" | ||
262 | LIBS="${LIBS} -pthread" | ||
263 | AC_LINK_IFELSE( | ||
264 | [AC_LANG_PROGRAM([[ | ||
265 | #include <pthread.h> | ||
266 | ]], | ||
267 | [[ | ||
268 | pthread_create(NULL, NULL, NULL, NULL); | ||
269 | ]])], | ||
270 | [have_gl_pt="yes"], | ||
271 | [have_gl_pt="no"]) | ||
272 | CFLAGS=${CFLAGS_save} | ||
273 | LIBS=${LIBS_save} | ||
274 | AC_MSG_RESULT([${have_gl_pt}]) | ||
275 | |||
276 | if test "x$have_gl_pt" = "xyes" ; then | ||
277 | gl_pt_lib=" -pthread" | ||
278 | fi | ||
279 | |||
280 | if test "x${have_dep}" = "xyes" ; then | ||
281 | AC_CHECK_LIB([X11], [XCreateColormap], [have_dep="yes"], [have_dep="no"]) | ||
282 | fi | ||
283 | |||
284 | if test "x${have_dep}" = "xyes" ; then | ||
285 | AC_CHECK_LIB([Xrender], [XRenderCreatePicture], [have_dep="yes"], [have_dep="no"]) | ||
286 | fi | ||
287 | |||
288 | if test "x${have_dep}" = "xyes" ; then | ||
289 | AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], -lX11 -lXext -lXrender -lm $gl_pt_lib) | ||
290 | fi | ||
291 | |||
292 | PKG_CHECK_MODULES([XCB_GL], | ||
293 | [x11-xcb xcb xcb-glx xcb-render xcb-renderutil], | ||
294 | [ | ||
295 | have_dep="yes" | ||
296 | requirement="x11-xcb xcb xcb-glx xcb-render xcb-renderutil" | ||
297 | evas_engine_[]$1[]_cflags="${XCB_GL_CFLAGS}" | ||
298 | evas_engine_[]$1[]_libs="${XCB_GL_LIBS}" | ||
299 | ],[ | ||
300 | have_dep="no" | ||
301 | ] | ||
302 | ) | ||
303 | |||
304 | if test "x$gl_flavor_gles" = "xyes" ; then | ||
305 | have_dep=no | ||
306 | fi | ||
307 | |||
308 | if test "x${have_dep}" = "xyes" ; then | ||
309 | PKG_CHECK_MODULES([GL_EET], [eet >= 1.5.0], [have_dep="yes"], [have_dep="no"]) | ||
310 | if test "x${have_dep}" = "xyes" ; then | ||
311 | if test "x$2" = "xyes" ; then | ||
312 | x_libs="${x_libs} -lX11 -lXext -lXrender" | ||
313 | else | ||
314 | x_dir=${x_dir:-/usr/X11R6} | ||
315 | x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} | ||
316 | x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" | ||
317 | fi | ||
318 | evas_engine_[]$1[]_cflags="-I/usr/include ${XCB_GL_CFLAGS} ${x_cflags}" | ||
319 | evas_engine_[]$1[]_libs="${XCB_GL_LIBS} ${x_libs} -lGL $gl_pt_lib" | ||
320 | evas_engine_gl_common_libs="-lGL $gl_pt_lib" | ||
321 | fi | ||
322 | else | ||
323 | if test "x$2" = "xyes" ; then | ||
324 | x_libs="${x_libs} -lX11 -lXext -lXrender" | ||
325 | else | ||
326 | x_dir=${x_dir:-/usr/X11R6} | ||
327 | x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} | ||
328 | x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext -lXrender" | ||
329 | fi | ||
330 | AC_CHECK_HEADER([GLES2/gl2.h], | ||
331 | [have_egl="yes"], | ||
332 | [have_egl="no"], | ||
333 | [ | ||
334 | #include <GLES2/gl2.h> | ||
335 | #include <GLES2/gl2ext.h> | ||
336 | #include <EGL/egl.h> | ||
337 | ]) | ||
338 | if test "x${have_egl}" = "xyes" ; then | ||
339 | AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL ${x_libs} -lm $gl_pt_lib) | ||
340 | if test "x${have_glesv2}" = "xyes" ; then | ||
341 | PKG_CHECK_MODULES([GL_EET], [eet >= 1.5.0], [have_dep="yes"], [have_dep="no"]) | ||
342 | if test "x${have_dep}" = "xyes" ; then | ||
343 | evas_engine_[]$1[]_cflags="${XCB_GL_CFLAGS} ${x_cflags}" | ||
344 | evas_engine_[]$1[]_libs="${XCB_GL_LIBS} ${x_libs} -lGLESv2 -lEGL -lm $gl_pt_lib" | ||
345 | evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib" | ||
346 | have_dep="yes" | ||
347 | gl_flavor_gles="no" | ||
348 | AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support]) | ||
349 | gles_variety_sgx="yes" | ||
350 | fi | ||
351 | fi | ||
352 | fi | ||
353 | fi | ||
354 | |||
355 | AC_SUBST([evas_engine_$1_cflags]) | ||
356 | AC_SUBST([evas_engine_$1_libs]) | ||
357 | |||
358 | if test "x${have_dep}" = "xyes" ; then | ||
359 | m4_default([$4], [:]) | ||
360 | else | ||
361 | m4_default([$5], [:]) | ||
362 | fi | ||
363 | |||
364 | ]) | ||
365 | |||
366 | |||
367 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_GDI(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
368 | |||
369 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_GDI], | ||
370 | [ | ||
371 | |||
372 | have_dep="no" | ||
373 | evas_engine_[]$1[]_cflags="" | ||
374 | evas_engine_[]$1[]_libs="" | ||
375 | |||
376 | AC_CHECK_HEADER([windows.h], | ||
377 | [ | ||
378 | have_dep="yes" | ||
379 | evas_engine_[]$1[]_libs="-lgdi32" | ||
380 | ] | ||
381 | ) | ||
382 | |||
383 | AC_SUBST([evas_engine_$1_cflags]) | ||
384 | AC_SUBST([evas_engine_$1_libs]) | ||
385 | |||
386 | if test "x${have_dep}" = "xyes" ; then | ||
387 | m4_default([$4], [:]) | ||
388 | else | ||
389 | m4_default([$5], [:]) | ||
390 | fi | ||
391 | |||
392 | ]) | ||
393 | |||
394 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_DDRAW(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
395 | |||
396 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_DDRAW], | ||
397 | [ | ||
398 | |||
399 | have_dep="no" | ||
400 | evas_engine_[]$1[]_cflags="" | ||
401 | evas_engine_[]$1[]_libs="" | ||
402 | |||
403 | AC_CHECK_HEADER([ddraw.h], | ||
404 | [ | ||
405 | have_dep="yes" | ||
406 | evas_engine_[]$1[]_libs="-lddraw" | ||
407 | ] | ||
408 | ) | ||
409 | |||
410 | AC_SUBST([evas_engine_$1_cflags]) | ||
411 | AC_SUBST([evas_engine_$1_libs]) | ||
412 | |||
413 | if test "x${have_dep}" = "xyes" ; then | ||
414 | m4_default([$4], [:]) | ||
415 | else | ||
416 | m4_default([$5], [:]) | ||
417 | fi | ||
418 | |||
419 | ]) | ||
420 | |||
421 | dnl use: EVAS_CHECK_ENGINE_DEP_DIRECT3D(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
422 | |||
423 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_DIRECT3D], | ||
424 | [ | ||
425 | |||
426 | evas_engine_[]$1[]_cflags="" | ||
427 | evas_engine_[]$1[]_libs="" | ||
428 | |||
429 | AC_CHECK_HEADERS([d3d9.h d3dx9.h], | ||
430 | [ | ||
431 | have_dep="yes" | ||
432 | evas_engine_[]$1[]_libs="-ld3d9 -ld3dx9 -lgdi32" | ||
433 | ], | ||
434 | [have_dep="no"; break] | ||
435 | ) | ||
436 | |||
437 | AC_SUBST([evas_engine_$1_cflags]) | ||
438 | AC_SUBST([evas_engine_$1_libs]) | ||
439 | |||
440 | if test "x${have_dep}" = "xyes" ; then | ||
441 | m4_default([$4], [:]) | ||
442 | else | ||
443 | m4_default([$5], [:]) | ||
444 | fi | ||
445 | |||
446 | ]) | ||
447 | |||
448 | |||
449 | dnl use: EVAS_CHECK_ENGINE_DEP_GL_COCOA(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
450 | |||
451 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_COCOA], | ||
452 | [ | ||
453 | |||
454 | evas_engine_[]$1[]_cflags="" | ||
455 | evas_engine_[]$1[]_libs="" | ||
456 | |||
457 | AC_LANG_PUSH([Objective C]) | ||
458 | |||
459 | LIBS_save="$LIBS" | ||
460 | LIBS="$LIBS -framework Cocoa" | ||
461 | AC_LINK_IFELSE( | ||
462 | [AC_LANG_PROGRAM( | ||
463 | [[ | ||
464 | #include <Cocoa/Cocoa.h> | ||
465 | ]], | ||
466 | [[ | ||
467 | NSWindow *window; | ||
468 | window = [[NSWindow alloc] | ||
469 | initWithContentRect:NSMakeRect(0, 0, 1, 1) | ||
470 | styleMask:(NSTitledWindowMask) | ||
471 | backing:NSBackingStoreBuffered | ||
472 | defer:NO | ||
473 | screen:nil | ||
474 | ]; | ||
475 | ]])], | ||
476 | [ | ||
477 | have_dep="yes" | ||
478 | evas_engine_[]$1[]_libs="-framework Cocoa" | ||
479 | ], | ||
480 | [have_dep="no"]) | ||
481 | LIBS="$LIBS_save" | ||
482 | |||
483 | AC_LANG_POP([Objective C]) | ||
484 | |||
485 | if test "x${have_dep}" = "xyes" ; then | ||
486 | PKG_CHECK_MODULES([GL_EET], [eet >= 1.5.0], [have_dep="yes"], [have_dep="no"]) | ||
487 | fi | ||
488 | |||
489 | AC_SUBST([evas_engine_$1_cflags]) | ||
490 | AC_SUBST([evas_engine_$1_libs]) | ||
491 | |||
492 | if test "x${have_dep}" = "xyes" ; then | ||
493 | m4_default([$4], [:]) | ||
494 | else | ||
495 | m4_default([$5], [:]) | ||
496 | fi | ||
497 | |||
498 | ]) | ||
499 | |||
500 | |||
501 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_SDL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
502 | |||
503 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_SDL], | ||
504 | [ | ||
505 | |||
506 | requirement="" | ||
507 | have_dep="no" | ||
508 | evas_engine_[]$1[]_cflags="" | ||
509 | evas_engine_[]$1[]_libs="" | ||
510 | |||
511 | PKG_CHECK_MODULES([SDL], | ||
512 | [sdl >= 1.2.0], | ||
513 | [ | ||
514 | have_dep="yes" | ||
515 | requirement="sdl" | ||
516 | evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" | ||
517 | evas_engine_[]$1[]_libs="${SDL_LIBS}" | ||
518 | ] | ||
519 | ) | ||
520 | |||
521 | AC_SUBST([evas_engine_$1_cflags]) | ||
522 | AC_SUBST([evas_engine_$1_libs]) | ||
523 | |||
524 | if test "x$3" = "xstatic" ; then | ||
525 | requirement_evas="${requirement} ${requirement_evas}" | ||
526 | fi | ||
527 | |||
528 | if test "x${have_dep}" = "xyes" ; then | ||
529 | m4_default([$4], [:]) | ||
530 | else | ||
531 | m4_default([$5], [:]) | ||
532 | fi | ||
533 | |||
534 | ]) | ||
535 | |||
536 | |||
537 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_SDL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
538 | |||
539 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_SDL], | ||
540 | [ | ||
541 | |||
542 | requirement="" | ||
543 | have_dep="no" | ||
544 | evas_engine_[]$1[]_cflags="" | ||
545 | evas_engine_[]$1[]_libs="" | ||
546 | |||
547 | PKG_CHECK_MODULES([SDL], | ||
548 | [sdl >= 1.2.0], | ||
549 | [ | ||
550 | have_dep="yes" | ||
551 | requirement="sdl" | ||
552 | evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" | ||
553 | evas_engine_[]$1[]_libs="${SDL_LIBS}" | ||
554 | ] | ||
555 | ) | ||
556 | |||
557 | AC_SUBST([evas_engine_$1_cflags]) | ||
558 | AC_SUBST([evas_engine_$1_libs]) | ||
559 | |||
560 | if test "x$3" = "xstatic" ; then | ||
561 | requirement_evas="${requirement} ${requirement_evas}" | ||
562 | fi | ||
563 | |||
564 | if test "x${have_dep}" = "xyes" ; then | ||
565 | m4_default([$4], [:]) | ||
566 | else | ||
567 | m4_default([$5], [:]) | ||
568 | fi | ||
569 | |||
570 | ]) | ||
571 | |||
572 | dnl use: EVAS_CHECK_ENGINE_DEP_GL_SDL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
573 | |||
574 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_SDL], | ||
575 | [ | ||
576 | |||
577 | requirement="" | ||
578 | have_dep="no" | ||
579 | evas_engine_[]$1[]_cflags="" | ||
580 | evas_engine_[]$1[]_libs="" | ||
581 | |||
582 | PKG_CHECK_MODULES([SDL], | ||
583 | [sdl >= 1.2.0], | ||
584 | [ | ||
585 | have_dep="yes" | ||
586 | requirement="sdl" | ||
587 | evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" | ||
588 | evas_engine_[]$1[]_libs="${SDL_LIBS}" | ||
589 | ] | ||
590 | ) | ||
591 | |||
592 | gl_pt_lib=""; | ||
593 | have_gl_pt="no" | ||
594 | |||
595 | AC_MSG_CHECKING([whether pthread_create() is supported]) | ||
596 | CFLAGS_save="${CFLAGS}" | ||
597 | CFLAGS="${CFLAGS} -pthread" | ||
598 | LIBS_save="${LIBS}" | ||
599 | LIBS="${LIBS} -pthread" | ||
600 | AC_LINK_IFELSE( | ||
601 | [AC_LANG_PROGRAM([[ | ||
602 | #include <pthread.h> | ||
603 | ]], | ||
604 | [[ | ||
605 | pthread_create(NULL, NULL, NULL, NULL); | ||
606 | ]])], | ||
607 | [have_gl_pt="yes"], | ||
608 | [have_gl_pt="no"]) | ||
609 | CFLAGS=${CFLAGS_save} | ||
610 | LIBS=${LIBS_save} | ||
611 | AC_MSG_RESULT([${have_gl_pt}]) | ||
612 | |||
613 | if test "x$have_gl_pt" = "xyes" ; then | ||
614 | gl_pt_lib=" -pthread" | ||
615 | fi | ||
616 | |||
617 | AC_CHECK_HEADER([GL/gl.h], | ||
618 | [have_dep="yes"], | ||
619 | [have_dep="no"], | ||
620 | [ | ||
621 | #include <GL/gl.h> | ||
622 | #include <GL/glext.h> | ||
623 | ]) | ||
624 | |||
625 | if test "x$gl_flavor_gles" = "xyes" ; then | ||
626 | have_dep=no | ||
627 | fi | ||
628 | |||
629 | if test "x${have_dep}" = "xyes" ; then | ||
630 | evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" | ||
631 | evas_engine_[]$1[]_libs="${SDL_LIBS} -lGL -lm $gl_pt_lib" | ||
632 | evas_engine_gl_common_libs="-lGL -lm $gl_pt_lib" | ||
633 | else | ||
634 | AC_CHECK_HEADER([SDL/SDL_opengles.h], | ||
635 | [have_egl="yes"], | ||
636 | [have_egl="no"], | ||
637 | [ | ||
638 | #include <SDL/SDL_opengles.h> | ||
639 | #include <EGL/egl.h> | ||
640 | ]) | ||
641 | if test "x${have_egl}" = "xyes" ; then | ||
642 | AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL -lm $gl_pt_lib) | ||
643 | if test "x${have_glesv2}" = "xyes" ; then | ||
644 | evas_engine_[]$1[]_cflags="${SDL_CFLAGS}" | ||
645 | evas_engine_[]$1[]_libs="${SDL_LIBS} -lGLESv2 -lEGL -lm $gl_pt_lib" | ||
646 | evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib" | ||
647 | have_dep="yes" | ||
648 | gl_flavor_gles="no" | ||
649 | AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support]) | ||
650 | gles_variety_sgx="yes" | ||
651 | fi | ||
652 | fi | ||
653 | fi | ||
654 | |||
655 | AC_SUBST([evas_engine_$1_cflags]) | ||
656 | AC_SUBST([evas_engine_$1_libs]) | ||
657 | |||
658 | if test "x$3" = "xstatic" ; then | ||
659 | requirement_evas="${requirement} ${requirement_evas}" | ||
660 | fi | ||
661 | |||
662 | if test "x${have_dep}" = "xyes" ; then | ||
663 | m4_default([$4], [:]) | ||
664 | else | ||
665 | m4_default([$5], [:]) | ||
666 | fi | ||
667 | |||
668 | ]) | ||
669 | |||
670 | dnl use: EVAS_CHECK_ENGINE_DEP_FB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
671 | |||
672 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_FB], | ||
673 | [ | ||
674 | |||
675 | have_dep="no" | ||
676 | evas_engine_[]$1[]_cflags="" | ||
677 | evas_engine_[]$1[]_libs="" | ||
678 | |||
679 | AC_CHECK_HEADER([linux/fb.h], [have_dep="yes"]) | ||
680 | |||
681 | AC_SUBST([evas_engine_$1_cflags]) | ||
682 | AC_SUBST([evas_engine_$1_libs]) | ||
683 | |||
684 | if test "x${have_dep}" = "xyes" ; then | ||
685 | m4_default([$4], [:]) | ||
686 | else | ||
687 | m4_default([$5], [:]) | ||
688 | fi | ||
689 | |||
690 | ]) | ||
691 | |||
692 | dnl use: EVAS_CHECK_ENGINE_DEP_DIRECTFB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
693 | |||
694 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_DIRECTFB], | ||
695 | [ | ||
696 | |||
697 | requirement="" | ||
698 | have_dep="no" | ||
699 | evas_engine_[]$1[]_cflags="" | ||
700 | evas_engine_[]$1[]_libs="" | ||
701 | |||
702 | PKG_CHECK_MODULES([DIRECTFB], | ||
703 | [directfb >= 0.9.16], | ||
704 | [ | ||
705 | have_dep="yes" | ||
706 | requirement="directfb" | ||
707 | evas_engine_[]$1[]_cflags="${DIRECTFB_CFLAGS}" | ||
708 | evas_engine_[]$1[]_libs="${DIRECTFB_LIBS}" | ||
709 | ] | ||
710 | ) | ||
711 | |||
712 | AC_SUBST([evas_engine_$1_cflags]) | ||
713 | AC_SUBST([evas_engine_$1_libs]) | ||
714 | |||
715 | if test "x$3" = "xstatic" ; then | ||
716 | requirement_evas="${requirement} ${requirement_evas}" | ||
717 | fi | ||
718 | |||
719 | if test "x${have_dep}" = "xyes" ; then | ||
720 | m4_default([$4], [:]) | ||
721 | else | ||
722 | m4_default([$5], [:]) | ||
723 | fi | ||
724 | |||
725 | ]) | ||
726 | |||
727 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_8_X11(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
728 | |||
729 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_8_X11], | ||
730 | [ | ||
731 | |||
732 | have_dep="no" | ||
733 | evas_engine_[]$1[]_cflags="" | ||
734 | evas_engine_[]$1[]_libs="" | ||
735 | |||
736 | PKG_CHECK_MODULES([XCB], | ||
737 | [xcb xcb-shm xcb-image >= 0.2.1 pixman-1], | ||
738 | [ | ||
739 | have_dep="yes" | ||
740 | requirement="xcb xcb-shm xcb-image pixman-1" | ||
741 | evas_engine_[]$1[]_cflags="${XCB_CFLAGS}" | ||
742 | evas_engine_[]$1[]_libs="${XCB_LIBS}" | ||
743 | ],[ | ||
744 | have_dep="no" | ||
745 | ] | ||
746 | ) | ||
747 | |||
748 | AC_SUBST([evas_engine_$1_cflags]) | ||
749 | AC_SUBST([evas_engine_$1_libs]) | ||
750 | |||
751 | if test "x$3" = "xstatic" ; then | ||
752 | requirement_evas="${requirement} ${requirement_evas}" | ||
753 | fi | ||
754 | |||
755 | if test "x${have_dep}" = "xyes" ; then | ||
756 | m4_default([$4], [:]) | ||
757 | else | ||
758 | m4_default([$5], [:]) | ||
759 | fi | ||
760 | |||
761 | ]) | ||
762 | |||
763 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_X11(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
764 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_X11], | ||
765 | [ | ||
766 | |||
767 | have_dep="no" | ||
768 | evas_engine_[]$1[]_cflags="" | ||
769 | evas_engine_[]$1[]_libs="" | ||
770 | |||
771 | AC_PATH_X | ||
772 | AC_PATH_XTRA | ||
773 | |||
774 | AC_CHECK_HEADER([X11/X.h], [have_dep="yes"]) | ||
775 | |||
776 | if test "x${have_dep}" = "xyes" ; then | ||
777 | AC_CHECK_LIB([X11], [XCreateImage], [have_dep="yes"], [have_dep="no"]) | ||
778 | fi | ||
779 | |||
780 | if test "x${have_dep}" = "xyes" ; then | ||
781 | AC_CHECK_LIB([Xext], [XShmCreateImage], [have_dep="yes"], [have_dep="no"]) | ||
782 | fi | ||
783 | |||
784 | if test "x${have_dep}" = "xyes" ; then | ||
785 | if test "x$2" = "xyes" ; then | ||
786 | x_libs="${x_libs} -lX11 -lXext" | ||
787 | else | ||
788 | x_dir=${x_dir:-/usr/X11R6} | ||
789 | x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} | ||
790 | x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext" | ||
791 | fi | ||
792 | evas_engine_[]$1[]_cflags="${x_cflags}" | ||
793 | evas_engine_[]$1[]_libs="${x_libs}" | ||
794 | fi | ||
795 | |||
796 | AC_SUBST([evas_engine_$1_cflags]) | ||
797 | AC_SUBST([evas_engine_$1_libs]) | ||
798 | |||
799 | if test "x${have_dep}" = "xyes" ; then | ||
800 | m4_default([$4], [:]) | ||
801 | else | ||
802 | m4_default([$5], [:]) | ||
803 | fi | ||
804 | |||
805 | ]) | ||
806 | |||
807 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_DDRAW(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
808 | |||
809 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_DDRAW], | ||
810 | [ | ||
811 | |||
812 | have_dep="no" | ||
813 | evas_engine_[]$1[]_cflags="" | ||
814 | evas_engine_[]$1[]_libs="" | ||
815 | |||
816 | AC_CHECK_HEADER([ddraw.h], | ||
817 | [ | ||
818 | have_dep="yes" | ||
819 | evas_engine_[]$1[]_libs="-lddraw -lgdi32" | ||
820 | ] | ||
821 | ) | ||
822 | |||
823 | AC_SUBST([evas_engine_$1_cflags]) | ||
824 | AC_SUBST([evas_engine_$1_libs]) | ||
825 | |||
826 | if test "x${have_dep}" = "xyes" ; then | ||
827 | m4_default([$4], [:]) | ||
828 | else | ||
829 | m4_default([$5], [:]) | ||
830 | fi | ||
831 | |||
832 | ]) | ||
833 | |||
834 | dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_WINCE(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
835 | |||
836 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_16_WINCE], | ||
837 | [ | ||
838 | |||
839 | have_dep="yes" | ||
840 | evas_engine_[]$1[]_cflags="" | ||
841 | evas_engine_[]$1[]_libs="" | ||
842 | |||
843 | AC_SUBST([evas_engine_$1_cflags]) | ||
844 | AC_SUBST([evas_engine_$1_libs]) | ||
845 | |||
846 | if test "x${have_dep}" = "xyes" ; then | ||
847 | m4_default([$4], [:]) | ||
848 | else | ||
849 | m4_default([$5], [:]) | ||
850 | fi | ||
851 | |||
852 | ]) | ||
853 | |||
854 | dnl use: EVAS_CHECK_ENGINE_DEP_PSL1GHT(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) | ||
855 | |||
856 | AC_DEFUN([EVAS_CHECK_ENGINE_DEP_PSL1GHT], | ||
857 | [ | ||
858 | |||
859 | have_dep="no" | ||
860 | evas_engine_[]$1[]_cflags="" | ||
861 | evas_engine_[]$1[]_libs="" | ||
862 | |||
863 | AC_CHECK_HEADER([rsx/rsx.h], [have_dep="yes"]) | ||
864 | |||
865 | AC_SUBST([evas_engine_$1_cflags]) | ||
866 | AC_SUBST([evas_engine_$1_libs]) | ||
867 | |||
868 | if test "x${have_dep}" = "xyes" ; then | ||
869 | m4_default([$4], [:]) | ||
870 | else | ||
871 | m4_default([$5], [:]) | ||
872 | fi | ||
873 | |||
874 | ]) | ||
875 | |||
876 | dnl use: EVAS_CHECK_ENGINE(engine, want_engine, simple, description) | ||
877 | |||
878 | |||
879 | AC_DEFUN([EVAS_CHECK_ENGINE], | ||
880 | [ | ||
881 | |||
882 | m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl | ||
883 | m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl | ||
884 | |||
885 | want_engine="$2" | ||
886 | want_static_engine="no" | ||
887 | have_engine="no" | ||
888 | have_evas_engine_[]DOWN="no" | ||
889 | |||
890 | AC_ARG_ENABLE([$1], | ||
891 | [AC_HELP_STRING([--enable-$1], [enable $4 rendering backend])], | ||
892 | [ | ||
893 | if test "x${enableval}" = "xyes" ; then | ||
894 | want_engine="yes" | ||
895 | else | ||
896 | if test "x${enableval}" = "xstatic" ; then | ||
897 | want_engine="static" | ||
898 | else | ||
899 | want_engine="no" | ||
900 | fi | ||
901 | fi | ||
902 | ]) | ||
903 | |||
904 | AC_MSG_CHECKING([whether to enable $4 rendering backend]) | ||
905 | AC_MSG_RESULT([${want_engine}]) | ||
906 | |||
907 | if test "x${want_engine}" = "xyes" -o "x${want_engine}" = "xstatic" -o "x${want_engine}" = "xauto" ; then | ||
908 | m4_default([EVAS_CHECK_ENGINE_DEP_]m4_defn([UP]))(DOWN, $3, ${want_engine}, [have_engine="yes"], [have_engine="no"]) | ||
909 | fi | ||
910 | |||
911 | if test "x${have_engine}" = "xno" -a "x${want_engine}" = "xyes" -a "x${use_strict}" = "xyes" ; then | ||
912 | AC_MSG_ERROR([$4 dependencies not found (strict dependencies checking)]) | ||
913 | fi | ||
914 | |||
915 | AC_MSG_CHECKING([whether $4 rendering backend will be built]) | ||
916 | AC_MSG_RESULT([${have_engine}]) | ||
917 | |||
918 | if test "x${have_engine}" = "xyes" ; then | ||
919 | if test "x${want_engine}" = "xstatic" ; then | ||
920 | have_evas_engine_[]DOWN="static" | ||
921 | want_static_engine="yes" | ||
922 | else | ||
923 | have_evas_engine_[]DOWN="yes" | ||
924 | fi | ||
925 | fi | ||
926 | |||
927 | if test "x${have_engine}" = "xyes" ; then | ||
928 | AC_DEFINE(BUILD_ENGINE_[]UP, [1], [$4 rendering backend]) | ||
929 | fi | ||
930 | |||
931 | AM_CONDITIONAL(BUILD_ENGINE_[]UP, [test "x${have_engine}" = "xyes"]) | ||
932 | |||
933 | if test "x${want_static_engine}" = "xyes" ; then | ||
934 | AC_DEFINE(EVAS_STATIC_BUILD_[]UP, [1], [Build $1 engine inside libevas]) | ||
935 | have_static_module="yes" | ||
936 | fi | ||
937 | |||
938 | AM_CONDITIONAL(EVAS_STATIC_BUILD_[]UP, [test "x${want_static_engine}" = "xyes"]) | ||
939 | |||
940 | m4_popdef([UP]) | ||
941 | m4_popdef([DOWN]) | ||
942 | |||
943 | ]) | ||