summaryrefslogtreecommitdiff
path: root/m4/evas_check_loader.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_loader.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_loader.m4')
-rw-r--r--m4/evas_check_loader.m4534
1 files changed, 534 insertions, 0 deletions
diff --git a/m4/evas_check_loader.m4 b/m4/evas_check_loader.m4
new file mode 100644
index 0000000000..1b0831dcea
--- /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])