summaryrefslogtreecommitdiff
path: root/m4/evas_check_engine.m4
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-18 08:12:44 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-18 08:12:53 +0200
commit4f8e15c16c4f68b6fae8708b177ce672daefc59c (patch)
tree8c1bf8d808e0939bbd83291855961512ee42e70c /m4/evas_check_engine.m4
parente8c69667b01e2795c1e4ead0536652f935ffa674 (diff)
Revert "autotools: REMOVAL!"
This reverts commit e8c69667b01e2795c1e4ead0536652f935ffa674. git push on a wrong branch, sorry. This will land today, but not now.
Diffstat (limited to '')
-rw-r--r--m4/evas_check_engine.m4629
1 files changed, 629 insertions, 0 deletions
diff --git a/m4/evas_check_engine.m4 b/m4/evas_check_engine.m4
new file mode 100644
index 0000000000..d15c8d5f01
--- /dev/null
+++ b/m4/evas_check_engine.m4
@@ -0,0 +1,629 @@
1AC_DEFUN([REQUIRED_WAYLAND_VERSION], [1.11.0])
2
3dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_XLIB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
4
5AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_XLIB],
6[
7
8EFL_FIND_X(evas_engine_[]$1,
9 [X11/X.h], [X11 XCreateImage Xext XShmCreateImage],
10 [
11 if test "x$3" = "xstatic"; then
12 requirements_libs_evas="$evas_engine_[]$1[]_libs $requirements_libs_evas"
13 fi
14 ifelse([$4], , :, [$4])
15 ],[
16 ifelse([$5], , :, [$5])
17 ])
18])
19
20dnl use: EVAS_CHECK_ENGINE_DEP_GL_XLIB(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
21
22AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_XLIB],
23[
24
25EFL_FIND_X(evas_engine_[]$1,
26 [X11/Xlib.h X11/Xatom.h X11/Xutil.h X11/extensions/Xrender.h X11/Xresource.h],
27 [X11 XCreateColormap Xrender XRenderCreatePicture],
28 [
29 CFLAGS_save="$CFLAGS"
30 CFLAGS="$evas_engine_[]$1[]_cflags $CFLAGS"
31 CPPFLAGS_save="$CPPFLAGS"
32 CPPFLAGS="$evas_engine_[]$1[]_cflags $CPPFLAGS"
33
34 AC_CHECK_HEADER([GL/gl.h],
35 [have_dep="yes"],
36 [have_dep="no"],
37 [
38#include <GL/gl.h>
39#include <GL/glext.h>
40#include <GL/glx.h>
41#include <X11/Xlib.h>
42#include <X11/Xatom.h>
43#include <X11/Xutil.h>
44#include <X11/extensions/Xrender.h>
45#include <X11/Xresource.h>
46 ])
47
48 gl_pt_lib=""
49 have_gl_pt="no"
50
51 AC_MSG_CHECKING([whether pthread_create() is supported])
52 CFLAGS_pt_save="$CFLAGS"
53 CFLAGS="$CFLAGS -pthread"
54 LIBS_pt_save="$LIBS"
55 LIBS="$LIBS -pthread"
56 AC_LINK_IFELSE(
57 [AC_LANG_PROGRAM([[
58#include <pthread.h>
59 ]],
60 [[
61pthread_create(NULL, NULL, NULL, NULL);
62 ]])],
63 [have_gl_pt="yes"],
64 [have_gl_pt="no"])
65 CFLAGS=$CFLAGS_pt_save
66 LIBS=$LIBS_pt_save
67 AC_MSG_RESULT([$have_gl_pt])
68
69 if test "x$have_gl_pt" = "xyes" ; then
70 gl_pt_lib=" -pthread"
71 fi
72
73 if test "x$have_dep" = "xyes"; then
74 LIBS_save="$LIBS"
75 LIBS="$LIBS $evas_engine_[]$1[]_libs"
76 AC_CHECK_LIB([GL], [glXCreateContext], [have_dep="yes"], [have_dep="no"], [-lm $gl_pt_lib])
77 LIBS="$LIBS_save"
78 fi
79
80 if test "x${with_opengl}" = "xes" ; then
81 have_dep=no
82 fi
83
84 if test "x$have_dep" = "xyes" ; then
85 evas_engine_[]$1[]_libs="$evas_engine_[]$1[]_libs -lGL $gl_pt_lib"
86 evas_engine_gl_common_libs="$evas_engine_[]$1[]_libdirs -lGL $gl_pt_lib"
87 else
88 AC_CHECK_HEADER([GLES2/gl2.h],
89 [have_egl="yes"],
90 [have_egl="no"],
91 [
92#include <GLES2/gl2.h>
93#include <GLES2/gl2ext.h>
94#include <EGL/egl.h>
95#include <X11/Xlib.h>
96#include <X11/Xatom.h>
97#include <X11/Xutil.h>
98#include <X11/extensions/Xrender.h>
99#include <X11/Xresource.h>
100 ])
101 if test "x${have_egl}" = "xyes" ; then
102 AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL -lm $gl_pt_lib)
103 if test "x${have_glesv2}" = "xyes" ; then
104 evas_engine_[]$1[]_libs="$evas_engine_[]$1[]_libs -lGLESv2 -lEGL -lm $gl_pt_lib"
105 evas_engine_gl_common_libs="$evas_engine_[]$1[]_libdirs -lGLESv2 -lm $gl_pt_lib"
106 have_dep="yes"
107 AC_DEFINE(GL_GLES, 1, [GLSL runtime shader GLES2 support])
108 gles_variety_sgx="yes"
109 fi
110 fi
111 fi
112
113 CPPFLAGS="$CPPFLAGS_save"
114 CFLAGS="$CFLAGS_save"
115
116 if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then
117 requirements_libs_evas="$evas_engine_[]$1[]_libs $requirements_libs_evas"
118 fi
119
120 AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
121 ],[
122 ifelse([$5], , :, [$5])
123 ])
124])
125
126dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_GDI(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
127
128AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_GDI],
129[
130
131have_dep="no"
132evas_engine_[]$1[]_cflags=""
133evas_engine_[]$1[]_libs=""
134
135AC_CHECK_HEADER([windows.h],
136 [
137 have_dep="yes"
138 evas_engine_[]$1[]_libs="-lgdi32"
139 ])
140
141if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then
142 requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}"
143fi
144
145AC_SUBST([evas_engine_$1_cflags])
146AC_SUBST([evas_engine_$1_libs])
147
148AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
149
150])
151
152dnl use: EVAS_CHECK_ENGINE_DEP_SOFTWARE_DDRAW(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
153
154AC_DEFUN([EVAS_CHECK_ENGINE_DEP_SOFTWARE_DDRAW],
155[
156
157have_dep="no"
158evas_engine_[]$1[]_cflags=""
159evas_engine_[]$1[]_libs=""
160
161AC_CHECK_HEADER([ddraw.h],
162 [
163 have_dep="yes"
164 evas_engine_[]$1[]_libs="-lddraw"
165 ])
166
167if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then
168 requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}"
169fi
170
171AC_SUBST([evas_engine_$1_cflags])
172AC_SUBST([evas_engine_$1_libs])
173
174AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
175
176])
177
178dnl use: EVAS_CHECK_ENGINE_DEP_GL_COCOA(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
179
180AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_COCOA],
181[
182
183evas_engine_[]$1[]_cflags=""
184evas_engine_[]$1[]_libs=""
185
186AC_LANG_PUSH([Objective C])
187
188LIBS_save="$LIBS"
189LIBS="$LIBS -framework Cocoa"
190AC_LINK_IFELSE(
191 [AC_LANG_PROGRAM(
192 [[
193#include <Cocoa/Cocoa.h>
194 ]],
195 [[
196NSWindow *window;
197window = [[NSWindow alloc]
198 initWithContentRect:NSMakeRect(0, 0, 1, 1)
199 styleMask:(NSTitledWindowMask)
200 backing:NSBackingStoreBuffered
201 defer:NO
202 screen:nil
203 ];
204 ]])],
205 [
206 have_dep="yes"
207 evas_engine_[]$1[]_libs="-framework Cocoa -framework OpenGL"
208 evas_engine_gl_common_libs="$evas_engine_[]$1[]_libdirs"
209 ],
210 [have_dep="no"])
211LIBS="$LIBS_save"
212
213AC_LANG_POP([Objective C])
214
215if test "x$3" = "xstatic" && test "x${have_dep}" = "xyes" ; then
216 requirements_libs_evas="${evas_engine_[]$1[]_libs} ${requirements_libs_evas}"
217fi
218
219AC_SUBST([evas_engine_$1_cflags])
220AC_SUBST([evas_engine_$1_libs])
221
222AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
223
224])
225
226dnl use: EVAS_CHECK_ENGINE_DEP_GL_SDL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
227
228AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_SDL],
229[
230
231requirement=""
232have_dep="no"
233evas_engine_[]$1[]_cflags=""
234evas_engine_[]$1[]_libs=""
235
236PKG_CHECK_EXISTS([sdl2 >= 2.0.0],
237 [
238 have_dep="yes"
239 requirement="sdl2 >= 2.0.0"
240 ],
241 [have_dep="no"])
242
243if test "x${have_dep}" = "xyes" ; then
244 if test "x$3" = "xstatic" ; then
245 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
246 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
247 else
248 PKG_CHECK_MODULES([SDL], [${requirement}])
249 evas_engine_[]$1[]_cflags="${SDL_CFLAGS}"
250 evas_engine_[]$1[]_libs="${SDL_LIBS}"
251 fi
252fi
253
254gl_pt_lib="";
255have_gl_pt="no"
256
257AC_MSG_CHECKING([whether pthread_create() is supported])
258CFLAGS_save="${CFLAGS}"
259CFLAGS="${CFLAGS} -pthread"
260LIBS_save="${LIBS}"
261LIBS="${LIBS} -pthread"
262AC_LINK_IFELSE(
263 [AC_LANG_PROGRAM([[
264#include <pthread.h>
265 ]],
266 [[
267pthread_create(NULL, NULL, NULL, NULL);
268 ]])],
269 [have_gl_pt="yes"],
270 [have_gl_pt="no"])
271CFLAGS=${CFLAGS_save}
272LIBS=${LIBS_save}
273AC_MSG_RESULT([${have_gl_pt}])
274
275if test "x$have_gl_pt" = "xyes" ; then
276 gl_pt_lib=" -pthread"
277fi
278
279AC_CHECK_HEADER([GL/gl.h],
280 [have_dep="yes"],
281 [have_dep="no"],
282 [
283#include <GL/gl.h>
284#include <GL/glext.h>
285 ])
286
287if test "x${with_opengl}" = "xes" ; then
288 have_dep=no
289fi
290
291if test "x${have_dep}" = "xyes" ; then
292 evas_engine_[]$1[]_libs="${evas_engine_[]$1[]_libs} -lGL -lm $gl_pt_lib"
293 evas_engine_gl_common_libs="-lGL -lm $gl_pt_lib"
294else
295 AC_CHECK_HEADER([SDL2/SDL_opengles.h],
296 [have_egl="yes"],
297 [have_egl="no"],
298 [
299#include <SDL2/SDL_opengles.h>
300#include <EGL/egl.h>
301 ])
302 if test "x${have_egl}" = "xyes" ; then
303 AC_CHECK_LIB(GLESv2, glTexImage2D, [have_glesv2="yes"], , -lEGL -lm $gl_pt_lib)
304 if test "x${have_glesv2}" = "xyes" ; then
305 evas_engine_[]$1[]_libs="${evas_engine_[]$1[]_libs} -lGLESv2 -lEGL -lm $gl_pt_lib"
306 evas_engine_gl_common_libs="-lGLESv2 -lm $gl_pt_lib"
307 have_dep="yes"
308 AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support])
309 gles_variety_sgx="yes"
310 fi
311 fi
312fi
313
314AC_SUBST([evas_engine_$1_cflags])
315AC_SUBST([evas_engine_$1_libs])
316
317if test "x$3" = "xstatic" ; then
318 requirement_evas="${requirement} ${requirement_evas}"
319fi
320
321AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
322
323])
324
325
326dnl use: EVAS_CHECK_ENGINE_DEP_WAYLAND_SHM(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
327
328AC_DEFUN([EVAS_CHECK_ENGINE_DEP_WAYLAND_SHM],
329[
330
331requirement=""
332have_dep="no"
333evas_engine_[]$1[]_cflags=""
334evas_engine_[]$1[]_libs=""
335
336PKG_CHECK_EXISTS([wayland-client >= REQUIRED_WAYLAND_VERSION],
337 [
338 have_dep="yes"
339 requirement="wayland-client"
340 ],
341 [have_dep="no"])
342
343if test "x${have_dep}" = "xyes" ; then
344 if test "x$3" = "xstatic" ; then
345 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
346 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
347 else
348 PKG_CHECK_MODULES([WAYLAND_SHM], [${requirement}])
349 evas_engine_[]$1[]_cflags="${WAYLAND_SHM_CFLAGS}"
350 evas_engine_[]$1[]_libs="${WAYLAND_SHM_LIBS}"
351 fi
352fi
353
354AC_SUBST([evas_engine_$1_cflags])
355AC_SUBST([evas_engine_$1_libs])
356
357AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
358
359])
360
361dnl use: EVAS_CHECK_ENGINE_DEP_WAYLAND_EGL(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
362
363AC_DEFUN([EVAS_CHECK_ENGINE_DEP_WAYLAND_EGL],
364[
365
366requirement=""
367have_dep="no"
368evas_engine_[]$1[]_cflags=""
369evas_engine_[]$1[]_libs=""
370
371if test "x${with_opengl}" = "xes" ; then
372 gl_library="glesv2"
373else
374 gl_library="gl"
375fi
376
377PKG_CHECK_EXISTS([egl ${gl_library} wayland-client >= REQUIRED_WAYLAND_VERSION wayland-egl],
378 [
379 have_dep="yes"
380 requirement="egl ${gl_library} wayland-client wayland-egl"
381 ],
382 [have_dep="no"])
383
384if test "x${have_dep}" = "xyes" ; then
385 if test "${gl_library}" != "gl" ; then
386 have_egl="yes"
387 fi
388 if test "x$3" = "xstatic" ; then
389 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
390 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
391 else
392 PKG_CHECK_MODULES([WAYLAND_EGL], [${requirement}])
393 evas_engine_[]$1[]_cflags="${WAYLAND_EGL_CFLAGS}"
394 evas_engine_[]$1[]_libs="${WAYLAND_EGL_LIBS}"
395 evas_engine_gl_common_libs="$evas_engine_[]$1[]_libdirs -lGLESv2 -lm -lEGL"
396 fi
397fi
398
399AC_SUBST([evas_engine_$1_cflags])
400AC_SUBST([evas_engine_$1_libs])
401
402AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
403
404])
405
406
407dnl use: EVAS_CHECK_ENGINE_DEP_DRM(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
408
409AC_DEFUN([EVAS_CHECK_ENGINE_DEP_DRM],
410[
411
412requirement=""
413have_dep="no"
414have_hw_dep="no"
415evas_engine_[]$1[]_cflags=""
416evas_engine_[]$1[]_libs=""
417
418PKG_CHECK_EXISTS([libdrm],
419 [
420 have_dep="yes"
421 requirement="libdrm"
422 ], [have_dep="no"])
423
424if test "x${have_dep}" = "xyes" ; then
425 if test "x$3" = "xstatic" ; then
426 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
427 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
428 else
429 PKG_CHECK_MODULES([DRM], [${requirement}])
430 evas_engine_[]$1[]_cflags="${DRM_CFLAGS}"
431 evas_engine_[]$1[]_libs="${DRM_LIBS}"
432 fi
433fi
434
435AC_SUBST([evas_engine_$1_cflags])
436AC_SUBST([evas_engine_$1_libs])
437
438AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
439
440])
441
442dnl use: EVAS_CHECK_ENGINE_DEP_GL_DRM(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
443
444AC_DEFUN([EVAS_CHECK_ENGINE_DEP_GL_DRM],
445[
446
447requirement=""
448have_dep="no"
449have_hw_dep="no"
450evas_engine_[]$1[]_cflags=""
451evas_engine_[]$1[]_libs=""
452
453if test "x${with_opengl}" = "xes" ; then
454 gl_library="glesv2"
455else
456 AC_MSG_ERROR([We currently do not support GL DRM without OpenGL ES. Please consider OpenGL ES if you want to use it.])
457fi
458
459PKG_CHECK_EXISTS([egl ${gl_library} libdrm gbm wayland-client >= REQUIRED_WAYLAND_VERSION],
460 [
461 have_dep="yes"
462 requirement="egl ${gl_library} libdrm gbm wayland-client >= REQUIRED_WAYLAND_VERSION"
463 ],
464 [have_dep="no"])
465
466if test "x${have_dep}" = "xyes" ; then
467 if test "x$3" = "xstatic" ; then
468 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
469 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
470 else
471 PKG_CHECK_MODULES([GL_DRM], [${requirement}])
472 evas_engine_[]$1[]_cflags="${GL_DRM_CFLAGS}"
473 evas_engine_[]$1[]_libs="${GL_DRM_LIBS}"
474 evas_engine_gl_common_libs="$evas_engine_[]$1[]_libdirs -lGLESv2 -lm -lEGL"
475 fi
476fi
477
478AC_SUBST([evas_engine_$1_cflags])
479AC_SUBST([evas_engine_$1_libs])
480
481AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
482
483])
484
485dnl use: EVAS_CHECK_ENGINE_DEP_EGLFS(engine, simple, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
486
487AC_DEFUN([EVAS_CHECK_ENGINE_DEP_EGLFS],
488[
489
490requirement=""
491have_dep="no"
492have_hw_dep="no"
493evas_engine_[]$1[]_cflags=""
494evas_engine_[]$1[]_libs=""
495
496if test "x${with_opengl}" = "xes" ; then
497 gl_library="glesv2"
498else
499 AC_MSG_ERROR([We do not support Eglfs without OpenGL ES. Please consider OpenGL ES if you want to use it.])
500fi
501
502PKG_CHECK_EXISTS([egl >= 7.10 ${gl_library}],
503 [
504 have_dep="yes"
505 requirement="egl >= 7.10 ${gl_library}"
506 ],
507 [have_dep="no"])
508
509if test "x${have_dep}" = "xyes" ; then
510 if test "x$3" = "xstatic" ; then
511 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
512 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
513 else
514 PKG_CHECK_MODULES([EGLFS], [${requirement}])
515 evas_engine_[]$1[]_cflags="${EGLFS_CFLAGS}"
516 evas_engine_[]$1[]_libs="${EGLFS_LIBS}"
517 evas_engine_gl_common_libs="$evas_engine_[]$1[]_libdirs -lGLESv2 -lm -lEGL"
518 fi
519fi
520
521AC_SUBST([evas_engine_$1_cflags])
522AC_SUBST([evas_engine_$1_libs])
523
524AS_IF([test "x${have_dep}" = "xyes"], [$4], [$5])
525
526])
527
528
529dnl use: EVAS_ENGINE(name, want_engine, [DEPENDENCY-CHECK-CODE])
530dnl
531dnl defines BUILD_ENGINE_NAME if it should be built
532dnl defines BUILD_STATIC_BUILD_NAME if should be built statically
533dnl
534dnl will call DEPENDENCY-CHECK-CODE if it should be built,
535dnl if some dependency fail just call AC_MSG_ERROR() to abort.
536
537AC_DEFUN([EVAS_ENGINE],
538[dnl
539m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
540m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
541
542want_engine="$2"
543want_static_engine="no"
544have_engine="no"
545have_evas_engine_[]DOWN="no"
546
547evas_engine_[]m4_defn([DOWN])[]_cflags=""
548evas_engine_[]m4_defn([DOWN])[]_libs=""
549
550if test "x${want_engine}" = "xyes" -o "x${want_engine}" = "xstatic"; then
551 $3
552
553 have_engine="yes"
554 if test "x${want_engine}" = "xstatic" ; then
555 have_evas_engine_[]DOWN="static"
556 want_static_engine="yes"
557 else
558 have_evas_engine_[]DOWN="yes"
559 fi
560fi
561
562AC_DEFINE_IF(BUILD_ENGINE_[]UP, [test "${have_engine}" = "yes"],
563 [1], [Build $1 Evas engine])
564AM_CONDITIONAL(BUILD_ENGINE_[]UP, [test "${have_engine}" = "yes"])
565
566AC_DEFINE_IF(EVAS_STATIC_BUILD_[]UP, [test "${want_static_engine}" = "yes"],
567 [1], [Build $1 Evas engine inside libevas])
568AM_CONDITIONAL(EVAS_STATIC_BUILD_[]UP, [test "${want_static_engine}" = "yes"])
569
570AC_SUBST([evas_engine_]m4_defn([DOWN])[_cflags])
571AC_SUBST([evas_engine_]m4_defn([DOWN])[_libs])
572
573EFL_ADD_FEATURE([EVAS_ENGINE], [$1], [${have_evas_engine_]DOWN[}])dnl
574m4_popdef([UP])dnl
575m4_popdef([DOWN])dnl
576])
577
578
579
580dnl use: EVAS_CHECK_ENGINE(engine, want_engine, simple, description)
581AC_DEFUN([EVAS_CHECK_ENGINE],
582[dnl
583m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
584m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
585
586want_engine="$2"
587want_static_engine="no"
588have_engine="no"
589have_evas_engine_[]DOWN="no"
590
591AC_MSG_CHECKING([whether to enable $4 rendering backend])
592AC_MSG_RESULT([${want_engine}])
593
594if test "x${want_engine}" = "xyes" -o "x${want_engine}" = "xstatic"; then
595 m4_default([EVAS_CHECK_ENGINE_DEP_]m4_defn([UP]))(DOWN, $3, ${want_engine}, [have_engine="yes"], [have_engine="no"])
596fi
597
598if test "x${have_engine}" = "xno" -a "x${want_engine}" = "xyes"; then
599 AC_MSG_ERROR([$4 dependencies not found])
600fi
601
602AC_MSG_CHECKING([whether $4 rendering backend will be built])
603AC_MSG_RESULT([${have_engine}])
604
605if test "x${have_engine}" = "xyes" ; then
606 if test "x${want_engine}" = "xstatic" ; then
607 have_evas_engine_[]DOWN="static"
608 want_static_engine="yes"
609 else
610 have_evas_engine_[]DOWN="yes"
611 fi
612fi
613
614if test "x${have_engine}" = "xyes" ; then
615 AC_DEFINE(BUILD_ENGINE_[]UP, [1], [$4 rendering backend])
616fi
617
618AM_CONDITIONAL(BUILD_ENGINE_[]UP, [test "x${have_engine}" = "xyes"])
619
620if test "x${want_static_engine}" = "xyes" ; then
621 AC_DEFINE(EVAS_STATIC_BUILD_[]UP, [1], [Build $1 engine inside libevas])
622 have_static_module="yes"
623fi
624
625EFL_ADD_FEATURE([EVAS_ENGINE], [$1], [${have_evas_engine_]DOWN[}])
626AM_CONDITIONAL(EVAS_STATIC_BUILD_[]UP, [test "x${want_static_engine}" = "xyes"])dnl
627m4_popdef([UP])dnl
628m4_popdef([DOWN])dnl
629])