aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/m4/evas_check_loader.m4
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/m4/evas_check_loader.m4')
-rw-r--r--libraries/evas/m4/evas_check_loader.m4560
1 files changed, 560 insertions, 0 deletions
diff --git a/libraries/evas/m4/evas_check_loader.m4 b/libraries/evas/m4/evas_check_loader.m4
new file mode 100644
index 0000000..e1fb5a9
--- /dev/null
+++ b/libraries/evas/m4/evas_check_loader.m4
@@ -0,0 +1,560 @@
1dnl use: EVAS_CHECK_LOADER_DEP_EDB(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
2
3AC_DEFUN([EVAS_CHECK_LOADER_DEP_EDB],
4[
5
6requirement=""
7have_dep="no"
8evas_image_loader_[]$1[]_cflags=""
9evas_image_loader_[]$1[]_libs=""
10
11PKG_CHECK_MODULES([EDB], [edb], [have_dep="yes" requirement="edb"], [have_dep="no"])
12evas_image_loader_[]$1[]_cflags="${EDB_CFLAGS}"
13evas_image_loader_[]$1[]_libs="${EDB_LIBS}"
14
15AC_SUBST([evas_image_loader_$1_cflags])
16AC_SUBST([evas_image_loader_$1_libs])
17
18if test "x$2" = "xstatic" ; then
19 requirement_evas="${requirement} ${requirement_evas}"
20fi
21
22if test "x${have_dep}" = "xyes" ; then
23 m4_default([$3], [:])
24else
25 m4_default([$4], [:])
26fi
27
28])
29
30dnl use: EVAS_CHECK_LOADER_DEP_EET(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
31
32AC_DEFUN([EVAS_CHECK_LOADER_DEP_EET],
33[
34
35requirement=""
36have_dep="no"
37evas_image_loader_[]$1[]_cflags=""
38evas_image_loader_[]$1[]_libs=""
39
40PKG_CHECK_MODULES([EET], [eet >= 1.5.0], [have_dep="yes" requirement="eet >= 1.4.0"], [have_dep="no"])
41evas_image_loader_[]$1[]_cflags="${EET_CFLAGS}"
42evas_image_loader_[]$1[]_libs="${EET_LIBS}"
43
44AC_SUBST([evas_image_loader_$1_cflags])
45AC_SUBST([evas_image_loader_$1_libs])
46
47if test "x$2" = "xstatic" ; then
48 requirement_evas="${requirement} ${requirement_evas}"
49fi
50
51if test "x${have_dep}" = "xyes" ; then
52 m4_default([$3], [:])
53else
54 m4_default([$4], [:])
55fi
56
57])
58
59dnl use: EVAS_CHECK_LOADER_DEP_GIF(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
60
61AC_DEFUN([EVAS_CHECK_LOADER_DEP_GIF],
62[
63
64have_dep="no"
65evas_image_loader_[]$1[]_cflags=""
66evas_image_loader_[]$1[]_libs=""
67
68AC_CHECK_HEADER([gif_lib.h], [have_dep="yes"])
69
70if test "x${have_dep}" = "xyes" ; then
71 AC_CHECK_LIB([gif],
72 [DGifOpenFileName],
73 [
74 evas_image_loader_[]$1[]_libs="-lgif"
75 ],
76 [have_dep="no"]
77 )
78
79 if test "x${have_dep}" = "xno" ; then
80 AC_CHECK_LIB([ungif],
81 [DGifOpenFileName],
82 [
83 have_dep="yes"
84 evas_image_loader_[]$1[]_libs="-lungif"
85 ]
86 )
87 fi
88fi
89
90AC_SUBST([evas_image_loader_$1_cflags])
91AC_SUBST([evas_image_loader_$1_libs])
92
93if test "x${have_dep}" = "xyes" ; then
94 m4_default([$3], [:])
95else
96 m4_default([$4], [:])
97fi
98
99])
100
101dnl use: EVAS_CHECK_LOADER_DEP_JPEG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
102
103AC_DEFUN([EVAS_CHECK_LOADER_DEP_JPEG],
104[
105
106have_dep="no"
107evas_image_loader_[]$1[]_cflags=""
108evas_image_loader_[]$1[]_libs=""
109
110AC_CHECK_HEADER([jpeglib.h], [have_dep="yes"])
111
112if test "x${have_dep}" = "xyes" ; then
113 AC_CHECK_LIB([jpeg],
114 [jpeg_CreateDecompress],
115 [
116 evas_image_loader_[]$1[]_libs="-ljpeg"
117 AC_COMPILE_IFELSE(
118 [AC_LANG_PROGRAM(
119 [[
120#include <stdio.h>
121#include <jpeglib.h>
122#include <setjmp.h>
123 ]],
124 [[
125struct jpeg_decompress_struct decomp;
126decomp.region_x = 0;
127 ]])],
128 [have_jpeg_region="yes"],
129 [have_jpeg_region="no"])
130 ],
131 [have_dep="no"]
132 )
133 if test "x${have_jpeg_region}" = "xyes" ; then
134 AC_DEFINE(BUILD_LOADER_JPEG_REGION, [1], [JPEG Region Decode Support])
135 fi
136fi
137
138AC_SUBST([evas_image_loader_$1_cflags])
139AC_SUBST([evas_image_loader_$1_libs])
140
141if test "x${have_dep}" = "xyes" ; then
142 m4_default([$3], [:])
143else
144 m4_default([$4], [:])
145fi
146
147])
148
149dnl use: EVAS_CHECK_LOADER_DEP_PMAPS(loader, want_static[[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
150
151AC_DEFUN([EVAS_CHECK_LOADER_DEP_PMAPS],
152[
153
154have_dep="yes"
155evas_image_loader_[]$1[]_cflags=""
156evas_image_loader_[]$1[]_libs=""
157
158AC_SUBST([evas_image_loader_$1_cflags])
159AC_SUBST([evas_image_loader_$1_libs])
160
161if test "x${have_dep}" = "xyes" ; then
162 m4_default([$3], [:])
163else
164 m4_default([$4], [:])
165fi
166
167])
168
169dnl use: EVAS_CHECK_LOADER_DEP_PNG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
170
171AC_DEFUN([EVAS_CHECK_LOADER_DEP_PNG],
172[
173
174requirement=""
175have_dep="no"
176evas_image_loader_[]$1[]_cflags=""
177evas_image_loader_[]$1[]_libs=""
178
179dnl libpng.pc is the latest version of libpng that ahs been installed.
180dnl We check it first.
181PKG_CHECK_MODULES([PNG],
182 [libpng >= 1.2.10],
183 [have_dep="yes" requirement="libpng"],
184 [have_dep="no"])
185
186if test "x${have_dep}" = "xno" ; then
187 PKG_CHECK_MODULES([PNG],
188 [libpng15],
189 [have_dep="yes" requirement="libpng15"],
190 [have_dep="no"])
191fi
192
193if test "x${have_dep}" = "xno" ; then
194 PKG_CHECK_MODULES([PNG],
195 [libpng14],
196 [have_dep="yes" requirement="libpng14"],
197 [have_dep="no"])
198fi
199
200if test "x${have_dep}" = "xno" ; then
201 PKG_CHECK_MODULES([PNG],
202 [libpng12 >= 1.2.10],
203 [have_dep="yes" requirement="libpng12"],
204 [have_dep="no"])
205fi
206
207evas_image_loader_[]$1[]_cflags="${PNG_CFLAGS}"
208evas_image_loader_[]$1[]_libs="${PNG_LIBS}"
209
210AC_SUBST([evas_image_loader_$1_cflags])
211AC_SUBST([evas_image_loader_$1_libs])
212
213if test "x$2" = "xstatic" ; then
214 requirement_evas="${requirement} ${requirement_evas}"
215fi
216
217if test "x${have_dep}" = "xyes" ; then
218 m4_default([$3], [:])
219else
220 m4_default([$4], [:])
221fi
222
223])
224
225dnl use: EVAS_CHECK_LOADER_DEP_SVG(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
226
227AC_DEFUN([EVAS_CHECK_LOADER_DEP_SVG],
228[
229
230requirement=""
231have_dep="no"
232evas_image_loader_[]$1[]_cflags=""
233evas_image_loader_[]$1[]_libs=""
234
235PKG_CHECK_MODULES([SVG], [librsvg-2.0 >= 2.14.0
236 cairo >= 1.0.0],
237 [have_dep="yes" requirement="librsvg-2.0 cairo"],
238 [have_svg="no"]
239)
240
241if test "x${have_dep}" = "xyes" ; then
242 evas_image_loader_[]$1[]_cflags="${SVG_CFLAGS}"
243 evas_image_loader_[]$1[]_libs="${SVG_LIBS}"
244fi
245
246AC_SUBST([evas_image_loader_$1_cflags])
247AC_SUBST([evas_image_loader_$1_libs])
248
249if test "x$2" = "xstatic" ; then
250 requirement_evas="${requirement} ${requirement_evas}"
251fi
252
253if test "x${have_dep}" = "xyes" ; then
254 m4_default([$3], [:])
255else
256 m4_default([$4], [:])
257fi
258
259])
260
261dnl use: EVAS_CHECK_LOADER_DEP_TIFF(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
262
263AC_DEFUN([EVAS_CHECK_LOADER_DEP_TIFF],
264[
265
266have_dep="no"
267evas_image_loader_[]$1[]_cflags=""
268evas_image_loader_[]$1[]_libs=""
269
270AC_CHECK_HEADER([tiffio.h], [have_dep="yes"])
271
272if test "x${have_dep}" = "xyes" ; then
273 AC_CHECK_LIB([tiff],
274 [TIFFReadScanline],
275 [
276 evas_image_loader_[]$1[]_libs="-ltiff"
277 ],
278 [have_dep="no"]
279 )
280
281 if test "x${have_dep}" = "xno" ; then
282 AC_CHECK_LIB([tiff],
283 [TIFFReadScanline],
284 [
285 have_dep="yes"
286 evas_image_loader_[]$1[]_libs="-ltiff -ljpeg -lz -lm"
287 ]
288 )
289 fi
290
291 if test "x${have_dep}" = "xno" ; then
292 AC_CHECK_LIB([tiff34],
293 [TIFFReadScanline],
294 [
295 have_dep="yes"
296 evas_image_loader_[]$1[]_libs="-ltiff34 -ljpeg -lz -lm"
297 ]
298 )
299 fi
300fi
301
302AC_SUBST([evas_image_loader_$1_cflags])
303AC_SUBST([evas_image_loader_$1_libs])
304
305if test "x${have_dep}" = "xyes" ; then
306 m4_default([$3], [:])
307else
308 m4_default([$4], [:])
309fi
310
311])
312
313dnl use: EVAS_CHECK_LOADER_DEP_XPM(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
314
315AC_DEFUN([EVAS_CHECK_LOADER_DEP_XPM],
316[
317
318have_dep="yes"
319evas_image_loader_[]$1[]_cflags=""
320evas_image_loader_[]$1[]_libs=""
321
322AC_SUBST([evas_image_loader_$1_cflags])
323AC_SUBST([evas_image_loader_$1_libs])
324
325if test "x${have_dep}" = "xyes" ; then
326 m4_default([$3], [:])
327else
328 m4_default([$4], [:])
329fi
330
331])
332
333dnl use: EVAS_CHECK_LOADER_DEP_BMP(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
334
335AC_DEFUN([EVAS_CHECK_LOADER_DEP_BMP],
336[
337
338have_dep="yes"
339evas_image_loader_[]$1[]_cflags=""
340evas_image_loader_[]$1[]_libs=""
341
342AC_SUBST([evas_image_loader_$1_cflags])
343AC_SUBST([evas_image_loader_$1_libs])
344
345if test "x${have_dep}" = "xyes" ; then
346 m4_default([$3], [:])
347else
348 m4_default([$4], [:])
349fi
350
351])
352
353dnl use: EVAS_CHECK_LOADER_DEP_ICO(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
354
355AC_DEFUN([EVAS_CHECK_LOADER_DEP_ICO],
356[
357
358have_dep="yes"
359evas_image_loader_[]$1[]_cflags=""
360evas_image_loader_[]$1[]_libs=""
361
362AC_SUBST([evas_image_loader_$1_cflags])
363AC_SUBST([evas_image_loader_$1_libs])
364
365if test "x${have_dep}" = "xyes" ; then
366 m4_default([$3], [:])
367else
368 m4_default([$4], [:])
369fi
370
371])
372
373dnl use: EVAS_CHECK_LOADER_DEP_TGA(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
374
375AC_DEFUN([EVAS_CHECK_LOADER_DEP_TGA],
376[
377
378have_dep="yes"
379evas_image_loader_[]$1[]_cflags=""
380evas_image_loader_[]$1[]_libs=""
381
382AC_SUBST([evas_image_loader_$1_cflags])
383AC_SUBST([evas_image_loader_$1_libs])
384
385if test "x${have_dep}" = "xyes" ; then
386 m4_default([$3], [:])
387else
388 m4_default([$4], [:])
389fi
390
391])
392
393dnl use: EVAS_CHECK_LOADER_DEP_WBMP(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
394
395AC_DEFUN([EVAS_CHECK_LOADER_DEP_WBMP],
396[
397
398have_dep="yes"
399evas_image_loader_[]$1[]_cflags=""
400evas_image_loader_[]$1[]_libs=""
401
402AC_SUBST([evas_image_loader_$1_cflags])
403AC_SUBST([evas_image_loader_$1_libs])
404
405if test "x${have_dep}" = "xyes" ; then
406 m4_default([$3], [:])
407else
408 m4_default([$4], [:])
409fi
410
411])
412
413dnl use: EVAS_CHECK_LOADER_DEP_PSD(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
414
415AC_DEFUN([EVAS_CHECK_LOADER_DEP_PSD],
416[
417
418have_dep="yes"
419evas_image_loader_[]$1[]_cflags=""
420evas_image_loader_[]$1[]_libs=""
421
422AC_SUBST([evas_image_loader_$1_cflags])
423AC_SUBST([evas_image_loader_$1_libs])
424
425if test "x${have_dep}" = "xyes" ; then
426 m4_default([$3], [:])
427else
428 m4_default([$4], [:])
429fi
430
431])
432
433dnl use: EVAS_CHECK_LOADER_DEP_GENERIC(loader, want_static[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
434
435AC_DEFUN([EVAS_CHECK_LOADER_DEP_GENERIC],
436[
437
438have_dep="yes"
439evas_image_loader_[]$1[]_cflags=""
440evas_image_loader_[]$1[]_libs=""
441
442AC_SUBST([evas_image_loader_$1_cflags])
443AC_SUBST([evas_image_loader_$1_libs])
444
445if test "x${have_dep}" = "xyes" ; then
446 m4_default([$3], [:])
447else
448 m4_default([$4], [:])
449fi
450
451])
452
453dnl use: EVAS_CHECK_IMAGE_LOADER(loader, want_loader, macro)
454
455
456AC_DEFUN([EVAS_CHECK_IMAGE_LOADER],
457[
458
459m4_pushdef([UP], m4_toupper([$1]))
460m4_pushdef([DOWN], m4_tolower([$1]))
461
462want_loader="$2"
463want_static_loader="no"
464have_loader="no"
465have_evas_image_loader_[]DOWN="no"
466
467AC_ARG_ENABLE([image-loader-[]DOWN],
468 [AC_HELP_STRING([--enable-image-loader-[]DOWN], [enable $1 image loader])],
469 [
470 if test "x${enableval}" = "xyes" ; then
471 want_loader="yes"
472 else
473 if test "x${enableval}" = "xstatic" ; then
474 want_loader="static"
475 else
476 want_loader="no"
477 fi
478 fi
479 ]
480)
481
482AC_MSG_CHECKING([whether to enable $1 image loader])
483AC_MSG_RESULT([${want_loader}])
484
485if test "x${want_loader}" = "xyes" -o "x${want_loader}" = "xstatic" -o "x${want_loader}" = "xauto"; then
486 m4_default([EVAS_CHECK_LOADER_DEP_]m4_defn([UP]))(DOWN, ${want_loader}, [have_loader="yes"], [have_loader="no"])
487fi
488
489if test "x${have_loader}" = "xno" -a "x${want_loader}" = "xyes" -a "x${use_strict}" = "xyes" ; then
490 AC_MSG_ERROR([$1 dependencies not found (strict dependencies checking)])
491fi
492
493AC_MSG_CHECKING([whether $1 image loader will be built])
494AC_MSG_RESULT([${have_loader}])
495
496if test "x${have_loader}" = "xyes" ; then
497 if test "x${want_loader}" = "xstatic" ; then
498 have_evas_image_loader_[]DOWN="static"
499 want_static_loader="yes"
500 else
501 have_evas_image_loader_[]DOWN="yes"
502 fi
503fi
504
505if test "x${have_loader}" = "xyes" ; then
506 AC_DEFINE(BUILD_LOADER_[]UP, [1], [UP Image Loader Support])
507fi
508
509AM_CONDITIONAL(BUILD_LOADER_[]UP, [test "x${have_loader}" = "xyes"])
510
511if test "x${want_static_loader}" = "xyes" ; then
512 AC_DEFINE(EVAS_STATIC_BUILD_[]UP, [1], [Build $1 image loader inside libevas])
513 have_static_module="yes"
514fi
515
516AM_CONDITIONAL(EVAS_STATIC_BUILD_[]UP, [test "x${want_static_loader}" = "xyes"])
517
518m4_popdef([UP])
519m4_popdef([DOWN])
520
521])
522
523dnl use: EVAS_CHECK_FONT_LOADER(want)
524
525
526AC_DEFUN([EVAS_CHECK_FONT_LOADER],
527[
528
529pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
530pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
531
532want_loader="$1"
533have_evas_font_loader_eet="no"
534
535AC_ARG_ENABLE([font-loader-eet],
536 [AC_HELP_STRING([--disable-font-loader-eet],
537 [disable EET font loader. [[default=enabled]]])],
538 [want_loader=${enableval}]
539)
540
541AC_MSG_CHECKING([whether to enable Eet font loader])
542AC_MSG_RESULT([${want_loader}])
543
544if test "x$want_loader" = "xyes" -o "x$want_loader" = "xauto"; then
545 PKG_CHECK_MODULES([EET], [eet >= 1.5.0], [have_evas_font_loader_eet="yes"], [have_evas_font_loader_eet="no"])
546fi
547
548if test "x${have_evas_font_loader_eet}" = "xno" -a "x$want_loader" = "xyes" -a "x$use_strict" = "xyes" ; then
549 AC_MSG_ERROR([Eet dependencies not found (strict dependencies checking)])
550fi
551
552if test "x$have_evas_font_loader_eet" = "xyes" ; then
553 AC_DEFINE([BUILD_FONT_LOADER_EET], [1], [EET Font Loader Support])
554 requirement_evas="eet >= 1.5.0 ${requirement_evas}"
555fi
556
557popdef([UP])
558popdef([DOWN])
559
560])