summaryrefslogtreecommitdiff
path: root/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
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')
-rw-r--r--m4/efl_attribute.m451
-rw-r--r--m4/efl_check_funcs.m476
-rw-r--r--m4/eina_config.m42
-rw-r--r--m4/evas_check_engine.m4851
-rw-r--r--m4/evas_check_loader.m4534
-rw-r--r--m4/evas_dither.m444
6 files changed, 1555 insertions, 3 deletions
diff --git a/m4/efl_attribute.m4 b/m4/efl_attribute.m4
index cd42e9c..4f31d93 100644
--- a/m4/efl_attribute.m4
+++ b/m4/efl_attribute.m4
@@ -29,4 +29,55 @@ if test "x${have_attribute_vector}" = "xyes" ; then
29fi 29fi
30]) 30])
31 31
32dnl Usage: EFL_ATTRIBUTE_ALWAYS_INLINE
33dnl call AC_DEFINE for alway_inline if __attribute__((always_inline)) is available
34
35AC_DEFUN([EFL_ATTRIBUTE_ALWAYS_INLINE],
36[
37
38have_attribute_forceinline="no"
39
40AC_MSG_CHECKING([for __forceinline])
41
42AC_COMPILE_IFELSE(
43 [AC_LANG_PROGRAM(
44 [[
45#include <windows.h>
46static __forceinline void foo(void) {}
47 ]],
48 [[
49 ]])],
50 [
51 have_attribute_always_inline="yes"
52 have_attribute_forceinline="yes"
53 ],
54 [have_attribute_always_inline="no"])
55
56AC_MSG_RESULT([${have_attribute_always_inline}])
57
58if test "x${have_attribute_always_inline}" = "xno" ; then
59 AC_MSG_CHECKING([for __attribute__ ((__always_inline__))])
60 AC_COMPILE_IFELSE(
61 [AC_LANG_PROGRAM(
62 [[
63static __attribute__((__always_inline__)) inline void foo(void) {}
64 ]],
65 [[
66 ]])],
67 [have_attribute_always_inline="yes"],
68 [have_attribute_always_inline="no"])
69 AC_MSG_RESULT([${have_attribute_always_inline}])
70fi
71
72if test "x${have_attribute_always_inline}" = "xyes" ; then
73 if test "x${have_attribute_forceinline}" = "xyes" ; then
74 AC_DEFINE([EFL_ALWAYS_INLINE], [__forceinline], [Macro declaring a function to always be inlined.])
75 else
76 AC_DEFINE([EFL_ALWAYS_INLINE], [__attribute__ ((__always_inline__)) inline], [Macro declaring a function to always be inlined.])
77 fi
78else
79 AC_DEFINE([EFL_ALWAYS_INLINE], [static inline], [Macro declaring a function to always be inlined.])
80fi
81])
82
32dnl End of efl_attribute.m4 83dnl End of efl_attribute.m4
diff --git a/m4/efl_check_funcs.m4 b/m4/efl_check_funcs.m4
index 23712bc..109ad06 100644
--- a/m4/efl_check_funcs.m4
+++ b/m4/efl_check_funcs.m4
@@ -53,11 +53,14 @@ LIBS="${LIBS} $2"
53AC_LINK_IFELSE( 53AC_LINK_IFELSE(
54 [AC_LANG_PROGRAM( 54 [AC_LANG_PROGRAM(
55 [[ 55 [[
56#define _GNU_SOURCE 56#ifndef _GNU_SOURCE
57# define _GNU_SOURCE
58#endif
59#include <stdlib>
57#include <dlfcn.h> 60#include <dlfcn.h>
58 ]], 61 ]],
59 [[ 62 [[
60int res = dladdr(0, 0); 63int res = dladdr(NULL, NULL);
61 ]])], 64 ]])],
62 [ 65 [
63 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2" 66 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2"
@@ -171,6 +174,75 @@ m4_popdef([DOWNEFL])
171m4_popdef([UPEFL]) 174m4_popdef([UPEFL])
172]) 175])
173 176
177dnl _EFL_CHECK_FUNC_DLSYM_PRIV is for internal use
178dnl _EFL_CHECK_FUNC_DLSYM_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
179
180AC_DEFUN([_EFL_CHECK_FUNC_DLSYM_PRIV],
181[
182m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
183m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
184
185LIBS_save="${LIBS}"
186LIBS="${LIBS} $2"
187AC_LINK_IFELSE(
188 [AC_LANG_PROGRAM(
189 [[
190#ifndef _GNU_SOURCE
191# define _GNU_SOURCE
192#endif
193#include <stdlib.h>
194#include <dlfcn.h>
195 ]],
196 [[
197void *res = dlsym(NULL, NULL);
198 ]])],
199 [
200 m4_defn([UPEFL])[]_LIBS="${m4_defn([UPEFL])[]_LIBS} $2"
201 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} $2"
202 _efl_have_fct="yes"
203 ],
204 [_efl_have_fct="no"])
205
206LIBS="${LIBS_save}"
207
208AS_IF([test "x${_efl_have_fct}" = "xyes"], [$3], [$4])
209
210m4_popdef([DOWNEFL])
211m4_popdef([UPEFL])
212])
213
214dnl _EFL_CHECK_FUNC_DLSYM is for internal use
215dnl _EFL_CHECK_FUNC_DLSYM(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
216
217AC_DEFUN([_EFL_CHECK_FUNC_DLSYM],
218[
219m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
220m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
221
222case "$host_os" in
223 mingw*)
224 _efl_have_fct="yes"
225 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ldl"
226 ;;
227 *)
228 _efl_have_fct="no"
229
230dnl Check is dlsym is in libc
231 _EFL_CHECK_FUNC_DLSYM_PRIV([$1], [], [_efl_have_fct="yes"], [_efl_have_fct="no"])
232
233dnl Check is dlopen is in libdl
234 if test "x${_efl_have_fct}" = "xno" ; then
235 _EFL_CHECK_FUNC_DLSYM_PRIV([$1], [-ldl], [_efl_have_fct="yes"], [_efl_have_fct="no"])
236 fi
237 ;;
238esac
239
240AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
241
242m4_popdef([DOWNEFL])
243m4_popdef([UPEFL])
244])
245
174dnl _EFL_CHECK_FUNC_FNMATCH_PRIV is for internal use 246dnl _EFL_CHECK_FUNC_FNMATCH_PRIV is for internal use
175dnl _EFL_CHECK_FUNC_FNMATCH_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) 247dnl _EFL_CHECK_FUNC_FNMATCH_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
176 248
diff --git a/m4/eina_config.m4 b/m4/eina_config.m4
index 3a0e50b..609e4f9 100644
--- a/m4/eina_config.m4
+++ b/m4/eina_config.m4
@@ -4,5 +4,5 @@ AC_DEFUN([EINA_CONFIG],
4if $2; then 4if $2; then
5 EINA_CONFIGURE_$1="#define EINA_$1" 5 EINA_CONFIGURE_$1="#define EINA_$1"
6fi 6fi
7AC_SUBST(EINA_CONFIGURE_$1) 7AC_SUBST([EINA_CONFIGURE_$1])
8]) 8])
diff --git a/m4/evas_check_engine.m4 b/m4/evas_check_engine.m4
new file mode 100644
index 0000000..78c4acc
--- /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])
diff --git a/m4/evas_check_loader.m4 b/m4/evas_check_loader.m4
new file mode 100644
index 0000000..1b0831d
--- /dev/null
+++ b/m4/evas_check_loader.m4
@@ -0,0 +1,534 @@
1
2dnl use: EVAS_CHECK_LOADER_DEP_BMP(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
3
4AC_DEFUN([EVAS_CHECK_LOADER_DEP_BMP],
5[
6
7have_dep="yes"
8evas_image_loader_[]$1[]_cflags=""
9evas_image_loader_[]$1[]_libs=""
10
11AC_SUBST([evas_image_loader_$1_cflags])
12AC_SUBST([evas_image_loader_$1_libs])
13
14if test "x${have_dep}" = "xyes" ; then
15 m4_default([$3], [:])
16else
17 m4_default([$4], [:])
18fi
19
20])
21
22dnl use: EVAS_CHECK_LOADER_DEP_EET(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
23
24AC_DEFUN([EVAS_CHECK_LOADER_DEP_EET],
25[
26
27requirement=""
28have_dep="no"
29evas_image_loader_[]$1[]_cflags=""
30evas_image_loader_[]$1[]_libs=""
31
32PKG_CHECK_MODULES([EET], [eet >= ${PACKAGE_VERSION}], [have_dep="yes" requirement="eet >= ${PACKAGE_VERSION}"], [have_dep="no"])
33evas_image_loader_[]$1[]_cflags="${EET_CFLAGS}"
34evas_image_loader_[]$1[]_libs="${EET_LIBS}"
35
36AC_SUBST([evas_image_loader_$1_cflags])
37AC_SUBST([evas_image_loader_$1_libs])
38
39if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then
40 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
41 requirements_pc_deps_evas="${requirements_pc_deps_evas}"
42fi
43
44if test "x${have_dep}" = "xyes" ; then
45 m4_default([$3], [:])
46else
47 m4_default([$4], [:])
48fi
49
50])
51
52dnl use: EVAS_CHECK_LOADER_DEP_GENERIC(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
53
54AC_DEFUN([EVAS_CHECK_LOADER_DEP_GENERIC],
55[
56
57have_dep="yes"
58evas_image_loader_[]$1[]_cflags=""
59evas_image_loader_[]$1[]_libs=""
60
61AC_SUBST([evas_image_loader_$1_cflags])
62AC_SUBST([evas_image_loader_$1_libs])
63
64if test "x${have_dep}" = "xyes" ; then
65 m4_default([$3], [:])
66else
67 m4_default([$4], [:])
68fi
69
70])
71
72dnl use: EVAS_CHECK_LOADER_DEP_GIF(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
73
74AC_DEFUN([EVAS_CHECK_LOADER_DEP_GIF],
75[
76
77have_dep="no"
78evas_image_loader_[]$1[]_cflags=""
79evas_image_loader_[]$1[]_libs=""
80
81AC_CHECK_HEADER([gif_lib.h], [have_dep="yes"])
82
83if test "x${have_dep}" = "xyes" ; then
84 AC_CHECK_LIB([gif],
85 [DGifOpenFileName],
86 [
87 evas_image_loader_[]$1[]_libs="-lgif"
88 ],
89 [have_dep="no"]
90 )
91
92 if test "x${have_dep}" = "xno" ; then
93 AC_CHECK_LIB([ungif],
94 [DGifOpenFileName],
95 [
96 have_dep="yes"
97 evas_image_loader_[]$1[]_libs="-lungif"
98 ]
99 )
100 fi
101fi
102
103if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then
104 requirements_libs_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_evas}"
105 requirements_libs_deps_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_deps_evas}"
106fi
107
108AC_SUBST([evas_image_loader_$1_cflags])
109AC_SUBST([evas_image_loader_$1_libs])
110
111if test "x${have_dep}" = "xyes" ; then
112 m4_default([$3], [:])
113else
114 m4_default([$4], [:])
115fi
116
117])
118
119dnl use: EVAS_CHECK_LOADER_DEP_ICO(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
120
121AC_DEFUN([EVAS_CHECK_LOADER_DEP_ICO],
122[
123
124have_dep="yes"
125evas_image_loader_[]$1[]_cflags=""
126evas_image_loader_[]$1[]_libs=""
127
128AC_SUBST([evas_image_loader_$1_cflags])
129AC_SUBST([evas_image_loader_$1_libs])
130
131if test "x${have_dep}" = "xyes" ; then
132 m4_default([$3], [:])
133else
134 m4_default([$4], [:])
135fi
136
137])
138
139dnl use: EVAS_CHECK_LOADER_DEP_JPEG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
140
141AC_DEFUN([EVAS_CHECK_LOADER_DEP_JPEG],
142[
143
144have_dep="no"
145evas_image_loader_[]$1[]_cflags=""
146evas_image_loader_[]$1[]_libs=""
147
148AC_CHECK_HEADER([jpeglib.h], [have_dep="yes"])
149
150if test "x${have_dep}" = "xyes" ; then
151 AC_CHECK_LIB([jpeg],
152 [jpeg_CreateDecompress],
153 [
154 evas_image_loader_[]$1[]_libs="-ljpeg"
155 AC_COMPILE_IFELSE(
156 [AC_LANG_PROGRAM(
157 [[
158#include <stdio.h>
159#include <jpeglib.h>
160#include <setjmp.h>
161 ]],
162 [[
163struct jpeg_decompress_struct decomp;
164decomp.region_x = 0;
165 ]])],
166 [have_jpeg_region="yes"],
167 [have_jpeg_region="no"])
168 ],
169 [have_dep="no"]
170 )
171 if test "x${have_jpeg_region}" = "xyes" ; then
172 AC_DEFINE(BUILD_LOADER_JPEG_REGION, [1], [JPEG Region Decode Support])
173 fi
174fi
175
176if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then
177 requirements_libs_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_evas}"
178 requirements_libs_deps_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_deps_evas}"
179fi
180
181AC_SUBST([evas_image_loader_$1_cflags])
182AC_SUBST([evas_image_loader_$1_libs])
183
184if test "x${have_dep}" = "xyes" ; then
185 m4_default([$3], [:])
186else
187 m4_default([$4], [:])
188fi
189
190])
191
192dnl use: EVAS_CHECK_LOADER_DEP_PMAPS(loader, want_static[[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
193
194AC_DEFUN([EVAS_CHECK_LOADER_DEP_PMAPS],
195[
196
197have_dep="yes"
198evas_image_loader_[]$1[]_cflags=""
199evas_image_loader_[]$1[]_libs=""
200
201AC_SUBST([evas_image_loader_$1_cflags])
202AC_SUBST([evas_image_loader_$1_libs])
203
204if test "x${have_dep}" = "xyes" ; then
205 m4_default([$3], [:])
206else
207 m4_default([$4], [:])
208fi
209
210])
211
212dnl use: EVAS_CHECK_LOADER_DEP_PNG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
213
214AC_DEFUN([EVAS_CHECK_LOADER_DEP_PNG],
215[
216
217requirement=""
218have_dep="no"
219evas_image_loader_[]$1[]_cflags=""
220evas_image_loader_[]$1[]_libs=""
221
222dnl libpng.pc is the latest version of libpng that ahs been installed.
223dnl We check it first.
224PKG_CHECK_MODULES([PNG],
225 [libpng >= 1.2.10],
226 [have_dep="yes" requirement="libpng"],
227 [have_dep="no"])
228
229if test "x${have_dep}" = "xno" ; then
230 PKG_CHECK_MODULES([PNG],
231 [libpng15],
232 [have_dep="yes" requirement="libpng15"],
233 [have_dep="no"])
234fi
235
236if test "x${have_dep}" = "xno" ; then
237 PKG_CHECK_MODULES([PNG],
238 [libpng14],
239 [have_dep="yes" requirement="libpng14"],
240 [have_dep="no"])
241fi
242
243if test "x${have_dep}" = "xno" ; then
244 PKG_CHECK_MODULES([PNG],
245 [libpng12 >= 1.2.10],
246 [have_dep="yes" requirement="libpng12"],
247 [have_dep="no"])
248fi
249
250evas_image_loader_[]$1[]_cflags="${PNG_CFLAGS}"
251evas_image_loader_[]$1[]_libs="${PNG_LIBS}"
252
253AC_SUBST([evas_image_loader_$1_cflags])
254AC_SUBST([evas_image_loader_$1_libs])
255
256if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then
257 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
258 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
259fi
260
261if test "x${have_dep}" = "xyes" ; then
262 m4_default([$3], [:])
263else
264 m4_default([$4], [:])
265fi
266
267])
268
269dnl use: EVAS_CHECK_LOADER_DEP_PSD(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
270
271AC_DEFUN([EVAS_CHECK_LOADER_DEP_PSD],
272[
273
274have_dep="yes"
275evas_image_loader_[]$1[]_cflags=""
276evas_image_loader_[]$1[]_libs=""
277
278AC_SUBST([evas_image_loader_$1_cflags])
279AC_SUBST([evas_image_loader_$1_libs])
280
281if test "x${have_dep}" = "xyes" ; then
282 m4_default([$3], [:])
283else
284 m4_default([$4], [:])
285fi
286
287])
288
289dnl use: EVAS_CHECK_LOADER_DEP_SVG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
290
291AC_DEFUN([EVAS_CHECK_LOADER_DEP_SVG],
292[
293
294requirement=""
295have_esvg="no"
296evas_image_loader_[]$1[]_cflags=""
297evas_image_loader_[]$1[]_libs=""
298version_esvg="0.0.18"
299version_ender="0.0.6"
300
301PKG_CHECK_MODULES([SVG],
302 [esvg >= ${version_esvg} ender >= ${version_ender}],
303 [have_dep="yes" have_esvg="yes" requirement="esvg >= ${version_esvg} ender >= ${version_ender}"],
304 [have_dep="no"])
305
306if test "x${have_dep}" = "xyes" ; then
307 evas_image_loader_[]$1[]_cflags="${SVG_CFLAGS}"
308 evas_image_loader_[]$1[]_libs="${SVG_LIBS}"
309fi
310
311AC_SUBST([evas_image_loader_$1_cflags])
312AC_SUBST([evas_image_loader_$1_libs])
313
314if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then
315 requirements_pc_evas="${requirement} ${requirements_pc_evas}"
316 requirements_pc_deps_evas="${requirement} ${requirements_pc_deps_evas}"
317fi
318
319if test "x${have_dep}" = "xyes" ; then
320 m4_default([$3], [:])
321else
322 m4_default([$4], [:])
323fi
324
325])
326
327dnl use: EVAS_CHECK_LOADER_DEP_TGA(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
328
329AC_DEFUN([EVAS_CHECK_LOADER_DEP_TGA],
330[
331
332have_dep="yes"
333evas_image_loader_[]$1[]_cflags=""
334evas_image_loader_[]$1[]_libs=""
335
336AC_SUBST([evas_image_loader_$1_cflags])
337AC_SUBST([evas_image_loader_$1_libs])
338
339if test "x${have_dep}" = "xyes" ; then
340 m4_default([$3], [:])
341else
342 m4_default([$4], [:])
343fi
344
345])
346
347dnl use: EVAS_CHECK_LOADER_DEP_TIFF(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
348
349AC_DEFUN([EVAS_CHECK_LOADER_DEP_TIFF],
350[
351
352have_dep="no"
353evas_image_loader_[]$1[]_cflags=""
354evas_image_loader_[]$1[]_libs=""
355
356AC_CHECK_HEADER([tiffio.h], [have_dep="yes"])
357
358if test "x${have_dep}" = "xyes" ; then
359 AC_CHECK_LIB([tiff],
360 [TIFFReadScanline],
361 [
362 evas_image_loader_[]$1[]_libs="-ltiff"
363 ],
364 [have_dep="no"]
365 )
366
367 if test "x${have_dep}" = "xno" ; then
368 AC_CHECK_LIB([tiff],
369 [TIFFReadScanline],
370 [
371 have_dep="yes"
372 evas_image_loader_[]$1[]_libs="-ltiff -ljpeg -lz -lm"
373 ]
374 )
375 fi
376
377 if test "x${have_dep}" = "xno" ; then
378 AC_CHECK_LIB([tiff34],
379 [TIFFReadScanline],
380 [
381 have_dep="yes"
382 evas_image_loader_[]$1[]_libs="-ltiff34 -ljpeg -lz -lm"
383 ]
384 )
385 fi
386fi
387
388if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then
389 requirements_libs_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_evas}"
390 requirements_libs_deps_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_deps_evas}"
391fi
392
393AC_SUBST([evas_image_loader_$1_cflags])
394AC_SUBST([evas_image_loader_$1_libs])
395
396if test "x${have_dep}" = "xyes" ; then
397 m4_default([$3], [:])
398else
399 m4_default([$4], [:])
400fi
401
402])
403
404dnl use: EVAS_CHECK_LOADER_DEP_WBMP(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
405
406AC_DEFUN([EVAS_CHECK_LOADER_DEP_WBMP],
407[
408
409have_dep="yes"
410evas_image_loader_[]$1[]_cflags=""
411evas_image_loader_[]$1[]_libs=""
412
413AC_SUBST([evas_image_loader_$1_cflags])
414AC_SUBST([evas_image_loader_$1_libs])
415
416if test "x${have_dep}" = "xyes" ; then
417 m4_default([$3], [:])
418else
419 m4_default([$4], [:])
420fi
421
422])
423
424dnl use: EVAS_CHECK_LOADER_DEP_WEBP(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
425
426AC_DEFUN([EVAS_CHECK_LOADER_DEP_WEBP],
427[
428
429have_dep="no"
430evas_image_loader_[]$1[]_cflags=""
431evas_image_loader_[]$1[]_libs=""
432
433AC_CHECK_HEADER([webp/decode.h], [have_dep="yes"])
434
435if test "x${have_dep}" = "xyes" ; then
436 AC_CHECK_LIB([webp],
437 [WebPDecodeRGBA],
438 [
439 evas_image_loader_[]$1[]_libs="-lwebp"
440 ],
441 [have_dep="no"]
442 )
443fi
444
445if test "x$2" = "xstatic" && test "x${have_dep}" = "xyes" ; then
446 requirements_libs_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_evas}"
447 requirements_libs_deps_evas="${evas_image_loader_[]$1[]_libs} ${requirements_libs_deps_evas}"
448fi
449
450AC_SUBST([evas_image_loader_$1_cflags])
451AC_SUBST([evas_image_loader_$1_libs])
452
453if test "x${have_dep}" = "xyes" ; then
454 m4_default([$3], [:])
455else
456 m4_default([$4], [:])
457fi
458
459])
460
461dnl use: EVAS_CHECK_LOADER_DEP_XPM(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
462
463AC_DEFUN([EVAS_CHECK_LOADER_DEP_XPM],
464[
465
466have_dep="yes"
467evas_image_loader_[]$1[]_cflags=""
468evas_image_loader_[]$1[]_libs=""
469
470AC_SUBST([evas_image_loader_$1_cflags])
471AC_SUBST([evas_image_loader_$1_libs])
472
473if test "x${have_dep}" = "xyes" ; then
474 m4_default([$3], [:])
475else
476 m4_default([$4], [:])
477fi
478
479])
480
481dnl use: EVAS_CHECK_IMAGE_LOADER(loader, want_loader, macro)
482
483
484AC_DEFUN([EVAS_CHECK_IMAGE_LOADER],
485[
486
487m4_pushdef([UP], m4_toupper([$1]))
488m4_pushdef([DOWN], m4_tolower([$1]))
489
490want_loader="$2"
491want_static_loader="no"
492have_loader="no"
493have_evas_image_loader_[]DOWN="no"
494
495AC_MSG_CHECKING([whether to enable $1 image loader])
496AC_MSG_RESULT([${want_loader}])
497
498if test "x${want_loader}" = "xyes" -o "x${want_loader}" = "xstatic" -o "x${want_loader}" = "xauto"; then
499 m4_default([EVAS_CHECK_LOADER_DEP_]m4_defn([UP]))(DOWN, ${want_loader}, [have_loader="yes"], [have_loader="no"])
500fi
501
502if test "x${have_loader}" = "xno" -a "x${want_loader}" = "xyes" -a "x${use_strict}" = "xyes" ; then
503 AC_MSG_ERROR([$1 dependencies not found (strict dependencies checking)])
504fi
505
506AC_MSG_CHECKING([whether $1 image loader will be built])
507AC_MSG_RESULT([${have_loader}])
508
509if test "x${have_loader}" = "xyes" ; then
510 if test "x${want_loader}" = "xstatic" ; then
511 have_evas_image_loader_[]DOWN="static"
512 want_static_loader="yes"
513 else
514 have_evas_image_loader_[]DOWN="yes"
515 fi
516fi
517
518if test "x${have_loader}" = "xyes" ; then
519 AC_DEFINE(BUILD_LOADER_[]UP, [1], [UP Image Loader Support])
520fi
521
522AM_CONDITIONAL(BUILD_LOADER_[]UP, [test "x${have_loader}" = "xyes"])
523
524if test "x${want_static_loader}" = "xyes" ; then
525 AC_DEFINE(EVAS_STATIC_BUILD_[]UP, [1], [Build $1 image loader inside libevas])
526 have_static_module="yes"
527fi
528
529AM_CONDITIONAL(EVAS_STATIC_BUILD_[]UP, [test "x${want_static_loader}" = "xyes"])
530
531m4_popdef([UP])
532m4_popdef([DOWN])
533
534])
diff --git a/m4/evas_dither.m4 b/m4/evas_dither.m4
new file mode 100644
index 0000000..f8dcca3
--- /dev/null
+++ b/m4/evas_dither.m4
@@ -0,0 +1,44 @@
1dnl Copyright (C) 2009 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that enables dithering support is wanted.
5
6dnl Usage: EVAS_CHECK_DITHER(dither, description [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl The parameter 'dither' is the type of dithering.
8dnl The parameter 'description' is the description of the dithering.
9dnl Defines BUILD_[TYPEOFDITHERING]
10
11AC_DEFUN([EVAS_CHECK_DITHER],
12[
13m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
14m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
15
16AC_ARG_ENABLE([$1],
17 AC_HELP_STRING([--enable-$1], [enable $2 @<:@default=disabled@:>@]),
18 [
19 if test "x${enableval}" = "xyes" ; then
20 _efl_enable_dither_option_[]DOWN="yes"
21 else
22 _efl_enable_dither_option_[]DOWN="no"
23 fi
24 ],
25 [_efl_enable_dither_option_[]DOWN="no"])
26
27AC_MSG_CHECKING(whether to build $2)
28AC_MSG_RESULT([${_efl_enable_dither_option_[]DOWN}])
29
30if test "x${_efl_enable_dither_option_[]DOWN}" = "xyes" ; then
31 AC_DEFINE([BUILD_]UP[], [1], [define to 1 if you have the $2 support])
32fi
33
34if test "x${_efl_enable_dither_option_[]DOWN}" = "xyes" ; then
35 m4_default([$3], [:])
36else
37 m4_default([$4], [:])
38fi
39
40m4_popdef([UP])
41m4_popdef([DOWN])
42])
43
44dnl End of evas_dither.m4