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