wayland-egl: do not require 'gl' to build
[platform/upstream/evas.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [7])
5 m4_define([v_mic], [8])
6 m4_define([v_rev], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
7 ##--   When released, remove the dnl on the below line
8 m4_undefine([v_rev])
9 ##--   When doing snapshots - change soname. remove dnl on below line
10 dnl m4_define([relname], [ver-pre-svn-07])
11 dnl m4_define([v_rel], [-release relname])
12 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
13 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
14 m4_define([lt_cur], m4_eval(v_maj + v_min))
15 m4_define([lt_rev], v_mic)
16 m4_define([lt_age], v_min)
17 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19
20 # rw_PROG_OBJC_WORKS
21 # Check whether the Objective C compiler works.
22 AC_DEFUN([rw_PROG_OBJC_WORKS],
23 [m4_ifdef([AC_PROG_OBJC], [AC_REQUIRE([AC_PROG_OBJC])dnl
24 AC_CACHE_CHECK([whether the Objective C compiler works],
25                [rw_cv_prog_objc_works],
26                [AC_LANG_PUSH([Objective C])
27                 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
28                                [rw_cv_prog_objc_works=yes],
29                                [rw_cv_prog_objc_works=no])
30                 AC_LANG_POP([Objective C])])], [rw_cv_prog_objc_works=no])
31 ])
32
33 AC_INIT([evas], [v_ver], [enlightenment-devel@lists.sourceforge.net])
34 AC_PREREQ([2.52])
35 AC_CONFIG_SRCDIR([configure.ac])
36 AC_CONFIG_MACRO_DIR([m4])
37
38 AC_CONFIG_HEADERS([config.h])
39 AH_TOP([
40 #ifndef EFL_CONFIG_H__
41 #define EFL_CONFIG_H__
42 ])
43 AH_BOTTOM([
44 #endif /* EFL_CONFIG_H__ */
45 ])
46
47 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
48 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
49
50 AC_GNU_SOURCE
51
52 AC_LIBTOOL_WIN32_DLL
53 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
54 AC_PROG_LIBTOOL
55
56 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
57 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
58 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
59 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
60 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
61 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
62 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
63 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
64 version_info="lt_cur:lt_rev:lt_age"
65 release_info="v_rel"
66 AC_SUBST(version_info)
67 AC_SUBST(release_info)
68 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
69 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
70 VMAJ=v_maj
71 AC_SUBST(VMAJ)
72
73 ### Needed information
74
75 AC_CANONICAL_BUILD
76 AC_CANONICAL_HOST
77
78 case "$host_os" in
79    mingw32ce*)
80       MODULE_ARCH="$host_os-$host_cpu"
81       ;;
82    *)
83       MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
84       ;;
85 esac
86 AC_SUBST(MODULE_ARCH)
87 AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
88
89 want_fontconfig="auto"
90 want_fribidi="auto"
91 want_harfbuzz="auto"
92 want_pixman="no"
93 want_evas_cserve="yes"
94 want_evas_cserve2="yes"
95
96 want_evas_engine_buffer="yes"
97 want_evas_engine_software_xlib="no"
98 want_evas_engine_software_xcb="no"
99 want_evas_engine_software_gdi="no"
100 want_evas_engine_software_ddraw="no"
101 want_evas_engine_software_8_x11="no"
102 want_evas_engine_software_16_x11="no"
103 want_evas_engine_software_16_wince="no"
104 want_evas_engine_software_16_sdl="no"
105 want_evas_engine_gl_xlib="no"
106 want_evas_engine_gl_xcb="no"
107 want_evas_engine_gl_sdl="no"
108 want_evas_engine_gl_cocoa="no"
109 want_evas_engine_direct3d="no"
110 want_evas_engine_fb="no"
111 want_evas_engine_directfb="no"
112 want_evas_engine_psl1ght="no"
113 want_evas_engine_wayland_shm="no"
114 want_evas_engine_wayland_egl="no"
115
116 want_evas_image_loader_edb="yes"
117 want_evas_image_loader_eet="yes"
118 want_evas_image_loader_gif="yes"
119 want_evas_image_loader_jpeg="yes"
120 want_evas_image_loader_pmaps="yes"
121 want_evas_image_loader_png="yes"
122 want_evas_image_loader_svg="yes"
123 want_evas_image_loader_tiff="yes"
124 want_evas_image_loader_xpm="yes"
125 want_evas_image_loader_bmp="yes"
126 want_evas_image_loader_tga="yes"
127 want_evas_image_loader_wbmp="yes"
128 want_evas_image_loader_ico="yes"
129 want_evas_image_loader_psd="yes"
130 want_evas_image_loader_generic="yes"
131
132 want_evas_font_loader_eet="yes"
133
134 case "$host_os" in
135    mingw32ce*)
136       want_fontconfig="no"
137       want_evas_engine_software_16_wince="yes"
138       want_evas_image_loader_edb="no"
139       want_evas_image_loader_gif="no"
140       want_evas_image_loader_svg="no"
141       want_evas_image_loader_tiff="no"
142       ;;
143    mingw*)
144       want_evas_engine_software_gdi="yes"
145       want_evas_engine_software_ddraw="yes"
146       want_evas_engine_direct3d="yes"
147       want_evas_image_loader_edb="no"
148       want_evas_image_loader_svg="no"
149       ;;
150    darwin*)
151       want_evas_engine_software_xlib="auto"
152       want_evas_engine_gl_cocoa="auto"
153       ;;
154    *)
155       want_evas_engine_software_xlib="auto"
156       want_evas_engine_gl_xlib="auto"
157       want_evas_engine_software_xcb="no"
158       want_evas_engine_gl_xcb="no"
159       want_evas_engine_fb="auto"
160       want_evas_engine_wayland_shm="auto"
161       want_evas_engine_wayland_egl="auto"
162 ### no - not ready/usable/complete
163 #      want_evas_engine_software_8_x11="auto"
164 #      want_evas_engine_software_16_x11="auto"
165       ;;
166 esac
167
168 case "$host_vendor" in
169   ps3*)
170       want_evas_engine_psl1ght="static"
171       ;;
172 esac
173
174 requirement_evas=""
175
176
177 ### Additional options to configure
178
179 # when used, that option makes configure script fails when
180 # a requirement is selected, but not met.
181 use_strict="no"
182 AC_ARG_ENABLE([strict],
183    AC_HELP_STRING([--enable-strict], [enable strict checking mode. @<:@default==disabled@:>@]),
184    [use_strict="yes"],
185    [use_strict="no"])
186
187 # Simple X11 build/link
188 AC_ARG_ENABLE([simple-x11],
189    AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking]),
190    [
191     if test "x${enableval}" = "xyes" ; then
192        want_evas_simple_x11="yes"
193     else
194        want_evas_simple_x11="no"
195     fi
196    ])
197
198
199 ### Checks for programs
200
201 m4_ifdef([AC_PROG_OBJC],
202    [
203     AC_PROG_OBJC
204     _AM_DEPENDENCIES(OBJC)
205    ],
206    [
207     dnl#AC_CHECK_TOOL([OBJC], [gcc])
208     dnl#AC_SUBST([OBJC])
209     dnl#AC_SUBST([OBJCFLAGS])
210    ])
211
212 rw_PROG_OBJC_WORKS
213
214 AC_PROG_CXX
215 AC_PROG_CC
216
217 # pkg-config
218 PKG_PROG_PKG_CONFIG
219
220 # Check whether pkg-config supports Requires.private
221 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
222    pkgconfig_requires_private="Requires.private"
223 else
224    pkgconfig_requires_private="Requires"
225 fi
226 AC_SUBST(pkgconfig_requires_private)
227
228 # doxygen program for documentation building
229 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
230
231
232 ### Checks for libraries
233
234 # Evil library for compilation on Windows CE
235
236 case "$host_os" in
237    mingw*)
238       PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0])
239       AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
240       requirement_evas="evil ${requirement_evas}"
241    ;;
242 esac
243
244 ### Checks for portability layer
245
246 PKG_CHECK_MODULES([EXOTIC],
247    [exotic],
248    [enable_exotic="yes"],
249    [enable_exotic="no"])
250
251 if test "x${enable_exotic}" = "xyes"; then
252     requirement_evas="exotic ${requirement_evas}"
253
254     AC_DEFINE([HAVE_EXOTIC], [1], [Define to 1 if you have Exotic.])
255 fi
256 AM_CONDITIONAL([EVAS_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"])
257
258 ## strong dependencies
259
260 # Eina
261 PKG_CHECK_MODULES([EINA], [eina >= 1.7.8])
262 CPPFLAGS_SAVE="$CPPFLAGS"
263 CPPFLAGS="$CPPFLAGS $EINA_CFLAGS"
264 AC_CHECK_SIZEOF(Eina_Unicode,, [#include <Eina.h>])
265 CPPFLAGS="$CPPFLAGS_SAVE"
266
267 # Freetype
268 PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 9.3.0])
269
270 requirement_evas="freetype2 eina >= 1.7.8 ${requirement_evas}"
271
272 ## optional dependencies
273
274 # FontConfig
275 have_fontconfig="no"
276 AC_ARG_ENABLE([fontconfig],
277    AC_HELP_STRING([--disable-fontconfig],
278       [disable fontconfig for finding fonts. @<:@default=enabled@:>@]),
279    [
280     if test "x${enableval}" = "xyes" ; then
281        want_fontconfig="yes"
282     else
283        want_fontconfig="no"
284     fi
285    ])
286
287
288 if test "x${want_fontconfig}" = "xyes" -o "x${want_fontconfig}" = "xauto" ; then
289    PKG_CHECK_MODULES([FONTCONFIG],
290       [fontconfig >= 2.5.0],
291       [
292        have_fontconfig="yes"
293        AC_DEFINE(HAVE_FONTCONFIG, 1, [have fontconfig searching capabilities])
294        requirement_evas="fontconfig ${requirement_evas}"
295       ],
296       [
297        if test "x${want_fontconfig}" = "xyes" -a "x${use_strict}" = "xyes" ; then
298           AC_MSG_ERROR([Fontconfig not found (strict dependencies checking)])
299        fi
300       ])
301 fi
302
303 # linebreak
304 have_linebreak="no"
305 want_linebreak="yes"
306 AC_ARG_ENABLE([liblinebreak],
307    AC_HELP_STRING([--disable-liblinebreak],
308       [disable linking against liblinebreak. @<:@default=enabled@:>@]),
309    [
310     if test "x${enableval}" = "xyes" ; then
311        want_linebreak="yes"
312     else
313        want_linebreak="no"
314     fi
315    ])
316
317
318 AM_CONDITIONAL(EVAS_USE_LINEBREAK, test "x${want_linebreak}" = "xyes")
319 if test "x${want_linebreak}" = "xyes" ; then
320    have_linebreak="yes"
321    LINEBREAK_CFLAGS='-I$(top_srcdir)/src/static_deps/liblinebreak'
322    LINEBREAK_LIBS='$(top_builddir)/src/static_deps/liblinebreak/liblinebreak.la'
323    AC_SUBST(LINEBREAK_CFLAGS)
324    AC_SUBST(LINEBREAK_LIBS)
325    AC_DEFINE(HAVE_LINEBREAK, 1, [have liblinebreak support])
326 else
327    have_linebreak="no"
328 fi
329
330 # fribidi support
331 have_fribidi="no"
332 AC_ARG_ENABLE([fribidi],
333    AC_HELP_STRING([--disable-fribidi],
334       [disable bidirectional text support. @<:@default=enabled@:>@]),
335    [
336     if test "x${enableval}" = "xyes" ; then
337        want_fribidi="yes"
338     else
339        want_fribidi="no"
340     fi
341    ])
342
343 if test "x${want_fribidi}" = "xyes" -o "x${want_fribidi}" = "xauto" ; then
344    PKG_CHECK_MODULES([FRIBIDI],
345       [fribidi >= 0.19.2],
346       [
347        have_fribidi="yes"
348        AC_DEFINE(HAVE_FRIBIDI, 1, [have fribidi support])
349        requirement_evas="fribidi ${requirement_evas}"
350        CPPFLAGS_SAVE="$CPPFLAGS"
351        CPPFLAGS="$CPPFLAGS $FRIBIDI_CFLAGS"
352        AC_CHECK_SIZEOF(FriBidiChar,, [#include <fribidi.h>])
353        CPPFLAGS="$CPPFLAGS_SAVE"
354       ],
355       [
356        if test "x$want_fribidi" = "xyes" -a "x$use_strict" = "xyes" ; then
357           AC_MSG_ERROR([Fribidi not found (strict dependencies checking)])
358        fi
359       ])
360 fi
361
362 if test "x${have_fribidi}" = "xno"; then
363   HAS_BIDI=0
364 fi
365
366 # harfbuzz support
367 have_harfbuzz="no"
368 have_harfbuzz_ft="no"
369 AC_ARG_ENABLE([harfbuzz],
370    AC_HELP_STRING([--disable-harfbuzz],
371       [disable complex text shaping and layouting support. @<:@default=enabled@:>@]),
372    [
373     if test "x${enableval}" = "xyes" ; then
374        want_harfbuzz="yes"
375     else
376        want_harfbuzz="no"
377     fi
378    ])
379
380 if test "x${want_harfbuzz}" = "xyes" -o "x${want_harfbuzz}" = "xauto" ; then
381    PKG_CHECK_MODULES([HARFBUZZ],
382       [harfbuzz >= 0.9.0],
383       [
384        have_harfbuzz="yes"
385        requirement_evas="harfbuzz ${requirement_evas}"
386       ],
387       [
388        if test "x$want_harfbuzz" = "xyes" -a "x$use_strict" = "xyes" ; then
389           AC_MSG_ERROR([Harfbuzz not found (strict dependencies checking)])
390        fi
391       ])
392    if test "x$have_harfbuzz" = "xyes" ; then
393
394       CPPFLAGS_SAVE="$CPPFLAGS"
395       CPPFLAGS="$CPPFLAGS $HARFBUZZ_CFLAGS $FREETYPE_CFLAGS"
396 # must have for usage with harfbuzz although harfbuzz may not have it.
397
398       AC_CHECK_HEADER(hb-ft.h,
399           [
400            have_harfbuzz_ft="yes"
401            #Depend on harfbuzz ft for harfbuzz support
402            AC_DEFINE(HAVE_HARFBUZZ, 1, [have harfbuzz support])
403           ],
404           [
405            if test "x$want_harfbuzz" = "xyes" -a "x$use_strict" = "xyes" ; then
406               AC_MSG_ERROR([Harfbuzz-ft not found (strict dependencies checking)])
407            fi
408            have_harfbuzz="no"
409           ])
410       CPPFLAGS="$CPPFLAGS_SAVE"
411    fi
412 fi
413
414 if test "x${have_harfbuzz}" = "xno"; then
415   HAS_HARFBUZZ=0
416 fi
417
418 # Pixman
419 have_pixman="no"
420 AC_ARG_ENABLE([pixman],
421    AC_HELP_STRING([--enable-pixman],
422       [enable pixman for software rendering. @<:@default=enabled@:>@]),
423    [
424     if test "x${enableval}" = "xyes" ; then
425        want_pixman="yes"
426     else
427        want_pixman="no"
428     fi
429    ])
430
431
432 if test "x${want_pixman}" = "xyes" -o "x${want_pixman}" = "xauto" ; then
433    PKG_CHECK_MODULES([PIXMAN],
434       [pixman-1],
435       [
436        have_pixman="yes"
437        AC_DEFINE(HAVE_PIXMAN, 1, [have pixman for rendering])
438        requirement_evas="pixman-1 ${requirement_evas}"
439       ],
440       [
441        if test "x${want_pixman}" = "xyes" -a "x${use_strict}" = "xyes" ; then
442           AC_MSG_ERROR([Pixman not found (strict dependencies checking)])
443        fi
444       ])
445 fi
446
447 have_pixman_font="no"
448 AC_ARG_ENABLE(pixman-font,
449   AC_HELP_STRING([--enable-pixman-font], [Allow pixman to render fonts]),
450   [ 
451     have_pixman_font="yes"
452     AC_DEFINE(PIXMAN_FONT, 1, [Allow pixman to render fonts])
453   ]
454 )
455
456 have_pixman_rect="no"
457 AC_ARG_ENABLE(pixman-rect,
458   AC_HELP_STRING([--enable-pixman-rect], [Allow pixman to render rects]),
459   [ 
460     have_pixman_rect="yes"
461     AC_DEFINE(PIXMAN_RECT, 1, [Allow pixman to render rects])
462   ]
463 )
464
465 have_pixman_line="no"
466 AC_ARG_ENABLE(pixman-line,
467   AC_HELP_STRING([--enable-pixman-line], [Allow pixman to render lines]),
468   [ 
469     have_pixman_line="yes"
470     AC_DEFINE(PIXMAN_LINE, 1, [Allow pixman to render lines])
471   ]
472 )
473
474 have_pixman_poly="no"
475 AC_ARG_ENABLE(pixman-poly,
476   AC_HELP_STRING([--enable-pixman-poly], [Allow pixman to render polys]),
477   [ 
478     have_pixman_poly="yes"
479     AC_DEFINE(PIXMAN_POLY, 1, [Allow pixman to render polys])
480   ]
481 )
482
483 have_pixman_image="no"
484 AC_ARG_ENABLE(pixman-image,
485   AC_HELP_STRING([--enable-pixman-image], [Allow pixman to render images]),
486   [ 
487     have_pixman_image="yes"
488     AC_DEFINE(PIXMAN_IMAGE, 1, [Allow pixman to render images])
489   ]
490 )
491
492 have_pixman_image_scale_sample="no"
493 AC_ARG_ENABLE(pixman-image-scale-sample,
494   AC_HELP_STRING([--enable-pixman-image-scale-sample], [Allow pixman to render sampled scaled images]),
495   [ 
496     have_pixman_image_scale_sample="yes"
497     AC_DEFINE(PIXMAN_IMAGE_SCALE_SAMPLE, 1, [Allow pixman to render image sampled scaling])
498   ]
499 )
500
501 have_tile_rotate="no"
502 AC_ARG_ENABLE(tile-rotate,
503   AC_HELP_STRING([--enable-tile-rotate], [Enable tiled rotate algorithm]),
504   [ 
505     have_tile_rotate="yes"
506     AC_DEFINE(TILE_ROTATE, 1, [Enable tiled rotate algorithm])
507   ]
508 )
509
510 ### Checks for header files
511 AC_HEADER_STDC
512 AC_CHECK_HEADERS([unistd.h stdint.h sys/param.h netinet/in.h sys/mman.h])
513 EFL_CHECK_PATH_MAX
514
515 ### Checks for types
516 AC_CHECK_TYPES([struct sigaction], [], [],
517                [[#include <signal.h>]])
518
519
520 ### Checks for structures
521
522
523 ### Checks for compiler characteristics
524 AC_C_CONST
525 AC_C_BIGENDIAN
526 AC_PROG_CC_STDC
527 EFL_ATTRIBUTE_UNUSED
528 EFL_ATTRIBUTE_VECTOR
529 EFL_ATTRIBUTE_ALWAYS_INLINE
530
531
532 ### Checks for linker characteristics
533 lt_enable_auto_import=""
534 case "${host_os}" in
535    mingw*)
536       AC_DEFINE(EFL_EVAS_BUILD, 1, [Define to mention that evas is built])
537       lt_enable_auto_import="-Wl,--enable-auto-import"
538    ;;
539 esac
540 AC_SUBST(lt_enable_auto_import)
541
542
543 ### Checks for library functions
544
545 AC_ISC_POSIX
546 AC_CHECK_FUNCS([siglongjmp fcntl])
547
548 # alloca
549 AC_FUNC_ALLOCA
550
551 # fnmatch
552 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
553
554 # dlopen
555 dlopen_libs=""
556 case "$host_os" in
557   mingw32ce*)
558 # managed by evil
559     AC_DEFINE(HAVE_DLSYM)
560   ;;
561   mingw*)
562 # nothing on mingw platform
563   ;;
564   *)
565     AC_CHECK_FUNCS(dlsym, res=yes, res=no)
566     if test "x$res" = "xyes"; then
567       AC_DEFINE(HAVE_DLSYM)
568     else
569       AC_CHECK_LIB(dl, dlsym, res=yes, res=no)
570       if test "x$res" = "xyes"; then
571         dlopen_libs=-ldl
572         AC_DEFINE(HAVE_DLSYM)
573       else
574         want_evas_engine_gl_xlib="no"
575         want_evas_engine_gl_xcb="no"
576         want_evas_engine_gl_sdl="no"
577       fi
578     fi
579 esac
580 AC_SUBST(dlopen_libs)
581
582 res=no
583 AC_CHECK_LIB(m, lround, res=yes, res=no)
584 if test "x$res" = "xyes"; then
585   AC_DEFINE(HAVE_LROUND, 1, C99 lround function exists)
586 fi
587
588 if test "x${want_evas_image_loader_generic}" = "xyes" ; then
589    EFL_CHECK_SHM_OPEN
590 fi
591
592 # (shm_open (for cache server)
593 AC_ARG_ENABLE([evas-cserve],
594    AC_HELP_STRING([--disable-evas-cserve],
595       [disable shared cache server support. @<:@default=enabled@:>@]),
596    [
597     if test "x${enableval}" = "xyes" ; then
598        want_evas_cserve="yes"
599     else
600        want_evas_cserve="no"
601     fi
602    ])
603 AC_MSG_CHECKING(whether to build shared cache server and support)
604 AC_MSG_RESULT(${want_evas_cserve})
605
606 # (shm_open (for cache server)
607 AC_ARG_ENABLE([evas-cserve2],
608    AC_HELP_STRING([--disable-evas-cserve2],
609       [disable shared cache server 2 support. @<:@default=enabled@:>@]),
610    [
611     if test "x${enableval}" = "xyes" ; then
612        want_evas_cserve2="yes"
613     else
614        want_evas_cserve2="no"
615     fi
616    ])
617 AC_MSG_CHECKING(whether to build shared cache server 2 and support)
618 AC_MSG_RESULT(${want_evas_cserve2})
619
620 # cserve2 only works on Linux so far.
621 if test "x${want_evas_cserve2}" = "xyes" ; then
622    AC_CHECK_HEADERS(
623       [sys/epoll.h sys/inotify.h sys/signalfd.h],
624       [],
625       [
626        want_evas_cserve2="no"
627       ]
628    )
629 fi
630
631 if test "x${want_evas_cserve2}" = "xyes"; then
632    want_evas_cserve="no"
633 fi
634
635 shm_open_libs=""
636 if test "x${want_evas_cserve}" = "xyes" -o "x${want_evas_cserve2}" = "xyes" ; then
637    EFL_CHECK_SHM_OPEN(
638       [
639        shm_open_libs=${EFL_SHM_OPEN_LIBS}
640       ],
641       [
642        want_evas_cserve="no"
643        want_evas_cserve2="no"
644       ])
645 fi
646 AC_SUBST([shm_open_libs])
647
648 if test "x${want_evas_cserve}" = "xyes" ; then
649   AC_DEFINE(EVAS_CSERVE, 1, [Shared cache server.])
650 fi
651
652 AM_CONDITIONAL([EVAS_CSERVE], [test "x${want_evas_cserve}" = "xyes"])
653
654 if test "x${want_evas_cserve2}" = "xyes" ; then
655   AC_DEFINE(EVAS_CSERVE2, 1, [Shared cache server.])
656 fi
657
658 AM_CONDITIONAL([EVAS_CSERVE2], [test "x${want_evas_cserve2}" = "xyes"])
659
660
661
662 #######################################
663 ## GL force flavor gles
664 gl_flavor_gles="no"
665 AC_MSG_CHECKING(whether to build GLES flavor of GL)
666 AC_ARG_ENABLE(gl-flavor-gles,
667   AC_HELP_STRING([--enable-gl-flavor-gles], [enable gles flavor of gl instead of standard]),
668   [
669       if test "x$enableval" = "xyes" ; then
670         AC_MSG_RESULT(yes)
671         gl_flavor_gles="yes"
672       else
673         AC_MSG_RESULT(no)
674         gl_flavor_gles="no"
675       fi
676   ], [
677       AC_MSG_RESULT(no)
678       gl_flavor_gles="no"
679   ]
680 )
681
682 #######################################
683 ## GLES variety sgx
684 gles_variety_sgx="no"
685 AC_MSG_CHECKING(whether to build GLES variety for SGX)
686 AC_ARG_ENABLE(gles-variety-sgx,
687   AC_HELP_STRING([--enable-gles-variety-sgx], [GLES variety SGX 3D unit]),
688   [
689       if test "x$enableval" = "xyes" ; then
690         AC_MSG_RESULT(yes)
691         AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support])
692         gles_variety_sgx="yes"
693       else
694         AC_MSG_RESULT(no)
695         gles_variety_sgx="no"
696       fi
697   ], [
698       AC_MSG_RESULT(no)
699       gles_variety_sgx="no"
700   ]
701 )
702
703 #######################################
704 ## GLES variety s3c6410
705 gles_variety_s3c6410="no"
706 AC_MSG_CHECKING(whether to build GLES variety for s3c6410)
707 AC_ARG_ENABLE(gles-variety-s3c6410,
708   AC_HELP_STRING([--enable-gles-variety-s3c6410], [GLES variety s3c6410 3D unit]),
709   [
710       if test "x$enableval" = "xyes" ; then
711         AC_MSG_RESULT(yes)
712         AC_DEFINE(GLES_VARIETY_S3C6410, 1, [Samsung S3c6410 GLES2 support])
713         gles_variety_s3c6410="yes"
714       else
715         AC_MSG_RESULT(no)
716         gles_variety_s3c6410="no"
717       fi
718   ], [
719       AC_MSG_RESULT(no)
720       gles_variety_s3c6410="no"
721   ]
722 )
723
724 if test "x$gl_flavor_gles" = "xyes"; then
725   eng=""
726   if test "x$gles_variety_sgx" = "xyes"; then eng="x"$eng; fi
727   if test "x$gles_variety_s3c6410" = "xyes"; then eng="x"$eng; fi
728   if test "x$eng" = "xx"; then
729     eng=""
730   else
731      AC_MSG_ERROR(
732        [Please enable just 1 OpenGL-ES flavor. Choices are:
733           --enable-gles-variety-sgx (Most GL-ES2 GPUs with shader compiler)
734           --enable-gles-variety-s3c6410 (s3c6410 with offline shader compiler)
735         You will also need to enable the OpenGL engine for X11 with:
736           --enable-gl-xlib or --enable-gl-xcb
737        ])
738   fi
739 fi
740
741 #####################################################################
742 ## Engines
743
744 EVAS_CHECK_ENGINE([buffer], [${want_evas_engine_buffer}], [yes], [Buffer])
745
746 EVAS_CHECK_ENGINE([software-gdi], [${want_evas_engine_software_gdi}], [no], [Software GDI])
747
748 EVAS_CHECK_ENGINE([software-ddraw], [${want_evas_engine_software_ddraw}], [no], [Software DirectDraw])
749
750 EVAS_CHECK_ENGINE([direct3d], [${want_evas_engine_direct3d}], [no], [Direct3D])
751
752 EVAS_CHECK_ENGINE([psl1ght], [${want_evas_engine_psl1ght}], [no], [PSL1GHT])
753
754 EVAS_CHECK_ENGINE([gl-sdl], [${want_evas_engine_gl_sdl}], [no], [OpenGL SDL])
755
756 EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa])
757
758 EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer])
759
760 EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB])
761
762 EVAS_CHECK_ENGINE([software-8-x11], [${want_evas_engine_software_8_x11}], [no], [Software X11 8 bits grayscale])
763
764 EVAS_CHECK_ENGINE([software-16-x11], [${want_evas_engine_software_16_x11}], [no], [Software X11 16 bits])
765
766 EVAS_CHECK_ENGINE([software-16-wince], [${want_evas_engine_software_16_wince}], [no], [Software Windows CE 16 bits])
767
768 EVAS_CHECK_ENGINE([software-16-sdl], [${want_evas_engine_software_16_sdl}], [no], [Software SDL 16 bits])
769
770 EVAS_CHECK_ENGINE([wayland-shm], [${want_evas_engine_wayland_shm}], [no], [Wayland Shm])
771
772 EVAS_CHECK_ENGINE([wayland-egl], [${want_evas_engine_wayland_egl}], [no], [Wayland Egl])
773
774 # SDL primitive
775 sdl_primitive="no"
776
777 AC_ARG_ENABLE([sdl-primitive],
778    [AC_HELP_STRING([--enable-sdl-primitive], [])],
779    [sdl_primitive=${enableval}]
780 )
781 AC_MSG_CHECKING([whether to use SDL primitive when possible])
782 AC_MSG_RESULT([${sdl_primitive}])
783
784 if test "x${sdl_primitive}" = "xyes" ; then
785    AC_DEFINE([ENGINE_SDL_PRIMITIVE], [1], [Use SDL primitive when possible])
786 fi
787
788 # if software generic need to be build as part of libevas.so
789 have_static_software_generic="no"
790 AC_ARG_ENABLE([static-software-generic],
791    [AC_HELP_STRING([--enable-static-software-generic], [Build software generic engine as part of libevas])],
792    [have_static_software_generic=${enableval}]
793 )
794 AC_MSG_CHECKING([Whether to build software generic engine as part of libevas])
795 AC_MSG_RESULT([${have_static_software_generic}])
796
797 if test "x${have_static_module}" = "xyes" -a "x${have_static_software_generic}" = "xno"; then
798    AC_MSG_WARN([Forcing --enable-static-software-generic as engines must be compiled statically])
799    have_static_software_generic="yes"
800 fi
801
802 AM_CONDITIONAL(EVAS_STATIC_BUILD_SOFTWARE_GENERIC, test "x${have_static_software_generic}" = "xyes")
803 if test "x${have_static_software_generic}" = "xyes"; then
804    AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_GENERIC, [1], [Build software generic engine as part of libevas])
805 fi
806
807
808 ######## Software Engine ########
809 have_evas_engine_software_x11="no"
810 have_evas_engine_software_xcb="no"
811 have_evas_engine_software_xlib="no"
812 build_software_xcb=
813
814 ## XCB Checks ##
815 want_xcb="no"
816 AC_MSG_CHECKING(whether to build Software XCB Engine)
817 AC_ARG_ENABLE(software-xcb,
818   AC_HELP_STRING([--enable-software-xcb], [enable Software XCB Engine. @<:@default=disabled@:>@]), [want_xcb=$enableval]
819 )
820 if test "x$want_xcb" != "xno" ; then
821   EVAS_CHECK_ENGINE([software-xcb], [${want_evas_engine_software_xcb}], [no], [Software XCB])
822   if test "x$have_evas_engine_software_xcb" != "xno" ; then
823     build_software_xcb="yes"
824     have_evas_engine_software_x11="yes"
825     AC_DEFINE_UNQUOTED(BUILD_ENGINE_SOFTWARE_X11, [1], [Build software X11 engine])
826     AC_DEFINE_UNQUOTED(BUILD_ENGINE_SOFTWARE_XCB, [1], [Build software XCB backend])
827   fi
828 else
829   AC_MSG_RESULT(no)
830   build_software_xcb="no"
831 fi
832
833 ## If we are not building XCB, then we can build XLib ##
834
835 if test "x$build_software_xcb" = "xno" ; then
836   EVAS_CHECK_ENGINE([software-xlib], [${want_evas_engine_software_xlib}], [no], [Software Xlib])
837   # if software_x11 is available, define everything needed for X11
838   if test "x$have_evas_engine_software_xlib" != "xno" ; then
839     have_evas_engine_software_x11="yes"
840     AC_DEFINE_UNQUOTED(BUILD_ENGINE_SOFTWARE_X11, [1], [Build software X11 engine])
841     AC_DEFINE_UNQUOTED(BUILD_ENGINE_SOFTWARE_XLIB, [1], [Build software Xlib backend])
842   fi
843 else
844   have_evas_engine_software_xlib="no"
845 fi
846
847 if test "x$have_evas_engine_software_xlib" = "xstatic" -o "x$have_evas_engine_software_xcb" = "xstatic"; then
848    AC_DEFINE_UNQUOTED(EVAS_STATIC_BUILD_SOFTWARE_X11, [1], [Build software X11 engine as part of libevas])
849 fi
850
851 AC_SUBST(have_evas_engine_software_xcb)
852 AC_SUBST(have_evas_engine_software_xlib)
853
854 AM_CONDITIONAL([BUILD_ENGINE_SOFTWARE_XLIB], [test "x${have_evas_engine_software_xlib}" != "xno"])
855 AM_CONDITIONAL([BUILD_ENGINE_SOFTWARE_XCB], [test "x${have_evas_engine_software_xcb}" != "xno"])
856 AM_CONDITIONAL([BUILD_ENGINE_SOFTWARE_X11], [test "x${have_evas_engine_software_x11}" != "xno"])
857
858 AM_CONDITIONAL([EVAS_STATIC_BUILD_SOFTWARE_X11], [test "x${have_evas_engine_software_xcb}" = "xstatic" -o "x${have_evas_engine_software_xlib}" = "xstatic"])
859 AM_CONDITIONAL([EVAS_STATIC_BUILD_SOFTWARE_XLIB], [test "x${have_evas_engine_software_xlib}" = "xstatic"])
860 AM_CONDITIONAL([EVAS_STATIC_BUILD_SOFTWARE_XCB], [test "x${have_evas_engine_software_xcb}" = "xstatic"])
861
862 AC_SUBST(have_evas_engine_software_x11)
863
864
865 ######## OpenGL Engine ########
866 have_evas_engine_gl_x11="no"
867 have_evas_engine_gl_xcb="no"
868 build_gl_xcb="no"
869
870 ## XCB Checks ##
871 want_gl_xcb="no"
872 AC_MSG_CHECKING(whether to build OpenGL XCB Engine)
873 AC_ARG_ENABLE(gl-xcb,
874   AC_HELP_STRING([--enable-gl-xcb], [enable OpenGL XCB Engine. @<:@default=disabled@:>@]), [want_gl_xcb=$enableval]
875 )
876 if test "x$want_gl_xcb" = "xyes" ; then
877   EVAS_CHECK_ENGINE([gl-xcb], [${want_evas_engine_gl_xcb}], [no], [OpenGL XCB])
878   if test "x$have_evas_engine_gl_xcb" != "xno" ; then
879     build_gl_xcb="yes"
880     have_evas_engine_gl_x11="yes"
881    AC_DEFINE(BUILD_ENGINE_GL_X11, [1], [Build GL X11 engine])
882    AC_DEFINE(BUILD_ENGINE_GL_XCB, [1], [Build GL Xcb backend])
883     if test "x$have_evas_engine_gl_xcb" = "xstatic" ; then
884       AC_DEFINE(EVAS_STATIC_BUILD_GL_X11, [1], [Build GL X11 engine as part of libevas])
885     fi
886   fi
887   AC_SUBST(have_evas_engine_gl_xcb)
888 else
889   AC_MSG_RESULT(no)
890   build_gl_xcb="no"
891 fi
892
893 ## If we are not building XCB, then we can build XLib ##
894
895 if test "x$build_gl_xcb" = "xno" ; then
896   EVAS_CHECK_ENGINE([gl-xlib], [${want_evas_engine_gl_xlib}], [no], [OpenGL XLib])
897   if test "x$have_evas_engine_gl_xlib" != "xno" ; then
898     have_evas_engine_gl_x11="yes"
899     AC_DEFINE_UNQUOTED(BUILD_ENGINE_GL_X11, [1], [Build OpenGL X11 engine])
900     AC_DEFINE_UNQUOTED(BUILD_ENGINE_GL_XLIB, [1], [Build OpenGL Xlib backend])
901     if test "x$have_evas_engine_gl_xlib" = "xstatic" ; then
902       AC_DEFINE_UNQUOTED(EVAS_STATIC_BUILD_GL_X11, [1], [Build OpenGL X11 engine as part of libevas])
903     fi
904   fi
905 else
906   have_evas_engine_gl_xlib="no"
907 fi
908 AC_SUBST(have_evas_engine_gl_xlib)
909
910 AM_CONDITIONAL([BUILD_ENGINE_GL_XLIB], [test "x${have_evas_engine_gl_xlib}" != "xno"])
911 AM_CONDITIONAL([BUILD_ENGINE_GL_XCB], [test "x${have_evas_engine_gl_xcb}" != "xno"])
912 AM_CONDITIONAL([BUILD_ENGINE_GL_X11], [test "x${have_evas_engine_gl_x11}" != "xno"])
913
914 AM_CONDITIONAL([EVAS_STATIC_BUILD_GL_X11], [test "x${have_evas_engine_gl_xcb}" = "xstatic" -o "x${have_evas_engine_gl_xlib}" = "xstatic"])
915 AM_CONDITIONAL([EVAS_STATIC_BUILD_GL_XLIB], [test "x${have_evas_engine_gl_xlib}" = "xstatic"])
916 AM_CONDITIONAL([EVAS_STATIC_BUILD_GL_XCB], [test "x${have_evas_engine_gl_xcb}" = "xstatic"])
917
918 AC_SUBST(have_evas_engine_gl_x11)
919
920 # common gl
921 have_evas_engine_gl_common="no"
922 have_static_evas_engine_gl_common="no"
923 if test "x$have_evas_engine_gl_xlib" = "xyes" \
924    || test "x$have_evas_engine_gl_xcb" = "xyes" \
925    || test "x$have_evas_engine_gl_sdl" = "xyes" \
926    || test "x$have_evas_engine_gl_cocoa" = "xyes" \
927    || test "x$have_evas_engine_wayland_egl" = "xyes"; then
928    have_evas_engine_gl_common="yes"
929 fi
930 if test "x$have_evas_engine_gl_xlib" = "xstatic" \
931    || test "x$have_evas_engine_gl_xcb" = "xstatic" \
932    || test "x$have_evas_engine_gl_sdl" = "xstatic" \
933    || test "x$have_evas_engine_gl_cocoa" = "xstatic" \
934    || test "x$have_evas_engine_wayland_egl" = "xstatic"; then
935    have_evas_engine_gl_common="yes"
936    have_static_evas_engine_gl_common="yes"
937 fi
938
939 if test "x$have_evas_engine_gl_common" = "xyes"; then
940    evas_engine_gl_common_libs=""
941    AC_DEFINE(BUILD_ENGINE_GL_COMMON, [1], [Generic OpenGL Rendering Support])
942 fi
943
944 AC_SUBST([evas_engine_gl_common_libs])
945
946 AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, [test "x$have_evas_engine_gl_common" = "xyes"])
947
948 AM_CONDITIONAL(EVAS_STATIC_BUILD_GL_COMMON, test "x${have_static_evas_engine_gl_common}" = "xyes")
949 if test "x${have_static_evas_engine_gl_common}" = "xyes"; then
950    AC_DEFINE(EVAS_STATIC_BUILD_GL_COMMON, [1], [Build GL generic engine as part of libevas])
951 fi
952
953 # gl_sdl
954 if test "x$have_evas_engine_gl_sdl" = "xyes" || test "x$have_evas_engine_gl_sdl" = "xstatic" ; then
955    AC_CHECK_DECL(SDL_GL_CONTEXT_MAJOR_VERSION,
956       [AC_DEFINE(HAVE_SDL_GL_CONTEXT_VERSION, [1], [SDL_GL version attributes present])],,
957       [#include <SDL/SDL_video.h>])
958 fi
959
960 if test "x$gl_flavor_gles" = "xyes"; then
961    AC_CHECK_DECL(SDL_OPENGLES,
962       [AC_DEFINE(HAVE_SDL_FLAG_OPENGLES, [1], [SDL_OPENGLES flag is present])],,
963       [#include <SDL/SDL_video.h>])
964 fi
965
966 # if software 16 x11 is enabled - build software_16 (the generic 16bit
967 # engine). later enable it fb_16 or other "16" bit engines are enabled.
968 have_evas_engine_software_16="no"
969 if test "x$have_evas_engine_software_16_x11" = "xyes" -o "x$have_evas_engine_software_16_x11" = "xstatic"; then
970    have_evas_engine_software_16="yes"
971 fi
972 if test "x$have_evas_engine_software_16_sdl" = "xyes" -o "x$have_evas_engine_software_16_sdl" = "xstatic"; then
973    have_evas_engine_software_16="yes"
974 fi
975 if test "x$have_evas_engine_software_16_wince" = "xyes" -o "x$have_evas_engine_software_16_wince" = "xstatic"; then
976    have_evas_engine_software_16="yes"
977 fi
978 AM_CONDITIONAL(BUILD_ENGINE_SOFTWARE_16, test "x$have_evas_engine_software_16" = "xyes")
979
980 # if software 16 need to be build as part of libevas.so
981 have_static_software_16="no"
982 AC_ARG_ENABLE([static-software-16],
983    [AC_HELP_STRING([--enable-static-software-16], [Build software 16 engine as part of libevas])],
984    [have_static_software_16=${enableval}]
985 )
986 AC_MSG_CHECKING([Whether to build software 16 engine as part of libevas])
987 AC_MSG_RESULT([${have_static_software_16}])
988
989 AM_CONDITIONAL(EVAS_STATIC_BUILD_SOFTWARE_16, test "x${have_static_software_16}" = "xyes")
990 if test "x${have_static_software_16}" = "xyes"; then
991    AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_16, [1], [Build software 16 engine as part of libevas])
992 fi
993
994 # if software 8 x11 is enabled - build software_8 (the generic 8bit
995 # engine).
996 have_evas_engine_software_8="no"
997 if test "x$have_evas_engine_software_8_x11" = "xyes" -o "x$have_evas_engine_software_8_x11" = "xstatic"; then
998    have_evas_engine_software_8="yes"
999 fi
1000 AM_CONDITIONAL(BUILD_ENGINE_SOFTWARE_8, test "x$have_evas_engine_software_8" = "xyes")
1001
1002 # if software 8 need to be build as part of libevas.so
1003 have_static_software_8="no"
1004 AC_ARG_ENABLE([static-software-8],
1005    [AC_HELP_STRING([--enable-static-software-8], [Build software 8 engine as part of libevas])],
1006    [have_static_software_8=${enableval}]
1007 )
1008 AC_MSG_CHECKING([Whether to build software 8 engine as part of libevas])
1009 AC_MSG_RESULT([${have_static_software_8}])
1010
1011 AM_CONDITIONAL(EVAS_STATIC_BUILD_SOFTWARE_8, test "x${have_static_software_8}" = "xyes")
1012 if test "x${have_static_software_8}" = "xyes"; then
1013    AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_8, [1], [Build software 8 engine as part of libevas])
1014 fi
1015
1016 #####################################################################
1017 ## Image loaders
1018
1019 EVAS_CHECK_IMAGE_LOADER([Edb], [${want_evas_image_loader_edb}])
1020
1021 EVAS_CHECK_IMAGE_LOADER([Eet], [${want_evas_image_loader_eet}])
1022 EVAS_CHECK_FONT_LOADER([${want_evas_font_loader_eet}])
1023
1024 EVAS_CHECK_IMAGE_LOADER([Gif], [${want_evas_image_loader_gif}])
1025
1026 have_evas_image_saver_jpeg="no"
1027 EVAS_CHECK_IMAGE_LOADER([Jpeg], [${want_evas_image_loader_jpeg}])
1028
1029 dnl Windows has no sigsetjmp function, nor equivalent.
1030 dnl So we disable the jpeg saver.
1031 dnl TODO: must find a workaround
1032 case "$host_os" in
1033    mingw*)
1034       ;;
1035    *)
1036       if test "x${have_evas_image_loader_jpeg}" = "xyes" ; then
1037          AC_DEFINE(EVAS_BUILD_SAVER_JPEG, [1], [Build JPEG saver])
1038          have_evas_image_saver_jpeg="yes"
1039       fi
1040       ;;
1041 esac
1042 AM_CONDITIONAL([BUILD_SAVER_JPEG], [test "x${have_evas_image_saver_jpeg}" = "xyes"])
1043
1044 EVAS_CHECK_IMAGE_LOADER([PMAPS], [${want_evas_image_loader_pmaps}])
1045
1046 EVAS_CHECK_IMAGE_LOADER([PNG], [${want_evas_image_loader_png}])
1047
1048 EVAS_CHECK_IMAGE_LOADER([SVG], [${want_evas_image_loader_svg}])
1049
1050 EVAS_CHECK_IMAGE_LOADER([Tiff], [${want_evas_image_loader_tiff}])
1051
1052 EVAS_CHECK_IMAGE_LOADER([XPM], [${want_evas_image_loader_xpm}])
1053
1054 EVAS_CHECK_IMAGE_LOADER([BMP], [${want_evas_image_loader_bmp}])
1055
1056 EVAS_CHECK_IMAGE_LOADER([TGA], [${want_evas_image_loader_tga}])
1057
1058 EVAS_CHECK_IMAGE_LOADER([WBMP], [${want_evas_image_loader_wbmp}])
1059
1060 EVAS_CHECK_IMAGE_LOADER([ICO], [${want_evas_image_loader_ico}])
1061
1062 EVAS_CHECK_IMAGE_LOADER([PSD], [${want_evas_image_loader_psd}])
1063
1064 EVAS_CHECK_IMAGE_LOADER([GENERIC], [${want_evas_image_loader_generic}])
1065
1066 #####################################################################
1067 ## Cpu based optimizations
1068
1069 #######################################
1070 ## PTHREADS
1071 pthread_cflags=""
1072 pthread_libs=""
1073 build_pthreads="no"
1074 has_pthreads="no"
1075 need_pthreads="no"
1076 # basic pthread support
1077 AC_CHECK_HEADER(pthread.h,
1078   [
1079    has_pthreads="yes"
1080   ],
1081   [
1082    has_pthreads="no"
1083   ]
1084 )
1085
1086 # sched_getaffinity pthread_attr_setaffinity_np
1087 AC_CHECK_HEADERS([pthread.h sched.h],
1088    [
1089     CFLAGS_save="${CFLAGS}"
1090     CFLAGS="${CFLAGS} -pthread"
1091     LIBS_save="${LIBS}"
1092     LIBS="${LIBS} -pthread"
1093     AC_LINK_IFELSE(
1094       [AC_LANG_PROGRAM([[
1095 #include <pthread.h>
1096 #include <sched.h>
1097                        ]],
1098                        [[
1099 pthread_attr_setaffinity_np(NULL, 0, NULL);
1100 pthread_barrier_wait(NULL);
1101                        ]])],
1102       [build_pthreads="yes"],
1103       [build_pthreads="no"])
1104    CFLAGS=${CFLAGS_save}
1105    LIBS=${LIBS_save}
1106   ],
1107   [build_pthreads="no"])
1108
1109 AC_MSG_CHECKING([whether pthread_attr_setaffinity_np() and pthread_barrier_wait() are supported])
1110 AC_MSG_RESULT([${build_pthreads}])
1111
1112 #######################################
1113 ## Pthread
1114 AC_MSG_CHECKING(whether to build pthread code)
1115 AC_ARG_ENABLE(pthreads,
1116   AC_HELP_STRING([--enable-pthreads], [enable threaded rendering]),
1117   [
1118     if test "x$enableval" = "xyes" ; then
1119       if test "x$build_pthreads" = "xyes"; then
1120         AC_MSG_RESULT(yes)
1121         AC_DEFINE(BUILD_PTHREAD, 1, [Build Threaded Rendering])
1122         build_pthreads="yes"
1123         need_pthreads="yes"
1124       else
1125         if "x$use_strict" = "xyes"; then
1126           AC_MSG_ERROR(pthreads headers or functions not found (strict dependencies checking))
1127         else
1128           AC_MSG_RESULT(no: pthread headers or functions not found)
1129         fi
1130       fi
1131     else
1132       AC_MSG_RESULT(no)
1133       build_pthreads="no"
1134     fi
1135   ],
1136   [
1137     AC_MSG_RESULT($build_pthreads)
1138     if test "x$build_pthreads" = "xyes" ; then
1139       AC_DEFINE(BUILD_PTHREAD, 1, [Build Threaded Rendering])
1140       need_pthreads="yes"
1141     fi
1142   ]
1143 )
1144
1145 #######################################
1146 ## Pipe Renderer
1147 build_pipe_render="no"
1148
1149 # Let disable pipe render strongly as it doesn't massively improve performance, but
1150 # just hammer more watt for a few more percent. The code is kept as the understanding
1151 # is that with an async pipeline things will be better.
1152 #
1153 #AC_MSG_CHECKING(whether to build Threaded Pipe Rendering support)
1154 #AC_ARG_ENABLE(pipe-render,
1155 #  AC_HELP_STRING([--enable-pipe-render], [enable threaded pipe rendering support]),
1156 #  [ build_pipe_render=$enableval ]
1157 #)
1158 #AC_MSG_RESULT($build_pipe_render)
1159
1160 #AC_MSG_CHECKING(whether we can build Threaded Pipe Rendering support)
1161 #if test \( "x$build_pipe_render" = "xyes" -o "x$build_pipe_render" = "xauto" \); then
1162 #  AC_MSG_RESULT(yes)
1163 #  AC_DEFINE(BUILD_PIPE_RENDER, 1, [Build pipe render support])
1164 #  build_pipe_render="yes"
1165 #  need_pthreads="yes"
1166 #else
1167 #  AC_MSG_RESULT(no)
1168 #  build_pipe_render="no"
1169 #fi
1170
1171 #######################################
1172 ## Async events
1173 build_async_events="auto"
1174 AC_MSG_CHECKING(whether to build Async Events support)
1175 AC_ARG_ENABLE(async-events,
1176   AC_HELP_STRING([--enable-async-events], [enable async events support]),
1177   [ build_async_events=$enableval ]
1178 )
1179 AC_MSG_RESULT($build_async_events)
1180
1181 AC_MSG_CHECKING(whether we can build Async Events support)
1182 if test "x$build_async_events" = "xyes" || test "x$build_async_events" = "xauto" ; then
1183   AC_MSG_RESULT(yes)
1184   AC_DEFINE(BUILD_ASYNC_EVENTS, 1, [Build async events support])
1185   build_async_events="yes"
1186 else
1187   AC_MSG_RESULT(no)
1188   build_async_events="no"
1189 fi
1190
1191 #######################################
1192 ## Async image preload
1193 build_async_preload="auto"
1194 AC_MSG_CHECKING(whether to build Async Image Preload support)
1195 AC_ARG_ENABLE(async-preload,
1196   AC_HELP_STRING([--enable-async-preload], [enable async image preloading support]),
1197   [ build_async_preload=$enableval ]
1198 )
1199 AC_MSG_RESULT($build_async_preload)
1200
1201 AC_MSG_CHECKING(whether we can build Async Image Preload support)
1202 if test \( "x$build_async_preload" = "xyes" -o "x$build_async_preload" = "xauto" \) -a "x$build_async_events" = "xyes"; then
1203   AC_MSG_RESULT(yes)
1204   AC_DEFINE(BUILD_ASYNC_PRELOAD, 1, [Build async image preload support])
1205   build_async_preload="yes"
1206   need_pthreads="yes"
1207 else
1208   AC_MSG_RESULT(no)
1209   build_async_preload="no"
1210 fi
1211
1212 #######################################
1213 ## Link with pthread if needed
1214 AC_MSG_CHECKING(whether we should link with pthread)
1215 if test "x$need_pthreads" = "xyes"; then
1216   AC_MSG_RESULT(yes)
1217   pthread_cflags="-pthread"
1218   pthread_libs="-pthread"
1219 else
1220   AC_MSG_RESULT(no)
1221 fi
1222
1223 #######################################
1224 ## MMX
1225 build_cpu_mmx="no"
1226 case $host_cpu in
1227   i*86)
1228     build_cpu_mmx="yes"
1229     ;;
1230   x86_64)
1231     build_cpu_mmx="yes"
1232     ;;
1233   amd64)
1234     build_cpu_mmx="yes"
1235     ;;
1236 esac
1237 AC_MSG_CHECKING(whether to build mmx code)
1238 AC_ARG_ENABLE(cpu-mmx,
1239   AC_HELP_STRING([--enable-cpu-mmx], [enable mmx code]),
1240   [
1241       if test "x$enableval" = "xyes" ; then
1242         AC_MSG_RESULT(yes)
1243         AC_DEFINE(BUILD_MMX, 1, [Build MMX Code])
1244         build_cpu_mmx="yes"
1245       else
1246         AC_MSG_RESULT(no)
1247         build_cpu_mmx="no"
1248       fi
1249   ],
1250   [
1251     AC_MSG_RESULT($build_cpu_mmx)
1252     if test "x$build_cpu_mmx" = "xyes" ; then
1253       AC_DEFINE(BUILD_MMX, 1, [Build MMX Code])
1254     fi
1255   ]
1256 )
1257
1258 #######################################
1259 ## SSE
1260 build_cpu_sse="no"
1261 case $host_cpu in
1262   i*86)
1263     build_cpu_sse="yes"
1264     ;;
1265   x86_64)
1266     build_cpu_sse="yes"
1267     ;;
1268   amd64)
1269     build_cpu_sse="yes"
1270     ;;
1271 esac
1272 AC_MSG_CHECKING(whether to build sse code)
1273 AC_ARG_ENABLE(cpu-sse,
1274   AC_HELP_STRING([--enable-cpu-sse], [enable sse code]),
1275   [
1276       if test "x$enableval" = "xyes" ; then
1277         AC_MSG_RESULT(yes)
1278         AC_DEFINE(BUILD_SSE, 1, [Build SSE Code])
1279         build_cpu_sse="yes"
1280       else
1281         AC_MSG_RESULT(no)
1282         build_cpu_sse="no"
1283       fi
1284   ],
1285   [
1286     AC_MSG_RESULT($build_cpu_sse)
1287     if test "x$build_cpu_sse" = "xyes" ; then
1288       AC_DEFINE(BUILD_SSE, 1, [Build SSE Code])
1289     fi
1290   ]
1291 )
1292
1293 #######################################
1294 ## SSE3
1295 build_cpu_sse3="no"
1296 case $host_cpu in
1297   i*86)
1298     build_cpu_sse3="yes"
1299     ;;
1300   x86_64)
1301     build_cpu_sse3="yes"
1302     ;;
1303   amd64)
1304     build_cpu_sse3="yes"
1305     ;;
1306 esac
1307 AC_MSG_CHECKING(whether to build sse3 code)
1308 AC_ARG_ENABLE(cpu-sse3,
1309   AS_HELP_STRING([--enable-cpu-sse3], [enable sse3 code]),
1310   [
1311       if test "x$enableval" = "xyes" ; then
1312         AC_CHECK_HEADER(immintrin.h,
1313           [
1314             AC_MSG_RESULT(yes)
1315             AC_DEFINE(BUILD_SSE3, 1, [Build SSE3 Code])
1316             build_cpu_sse3="yes"
1317            ],
1318           [
1319             AC_MSG_RESULT(no)
1320             build_cpu_sse3="no"
1321           ])
1322       else
1323         AC_MSG_RESULT(no)
1324         build_cpu_sse3="no"
1325       fi
1326   ],
1327   [
1328     AC_MSG_RESULT($build_cpu_sse3)
1329     if test "x$build_cpu_sse3" = "xyes" ; then
1330       AC_CHECK_HEADER(immintrin.h,
1331         [
1332           AC_MSG_RESULT(yes)
1333           AC_DEFINE(BUILD_SSE3, 1, [Build SSE3 Code])
1334           build_cpu_sse3="yes"
1335          ],
1336         [
1337           AC_MSG_RESULT(no)
1338           build_cpu_sse3="no"
1339         ])
1340     fi
1341   ]
1342 )
1343
1344
1345 # as a big warning flag to anyone doing stuff like this...
1346 # NEVER EVER EVER EVER put **OPTIMIZATION** flags in
1347 # build flags in makefiles (from configure or anywhere else)
1348 # EVER as this screws your ability to build 1 binary and
1349 # cover ALL x86 arch's. This is the HEIGHT of WRONG. If the
1350 # person building choses to add optimization flags themselves
1351 # and decide the minimum baseline cpu arch is X then that's
1352 # their business, but NEVER should it be done here. NEVER.
1353 # I now have to do this due to the way this sse3 code was done - using
1354 # intrinsics and "functions" (opcodes) and types that only compile *IF*
1355 # you compile with -msse3. this ALSO tries to optimize REGULAR c code
1356 # with sse3 asm.. and this breaks things so badly. so... sse3 will be
1357 # off until further notice for 32bit x86.
1358 EVAS_SSE3_CFLAGS=" "
1359 if test "x$build_cpu_sse3" = "xyes" ; then
1360     EVAS_SSE3_CFLAGS="-msse3 "
1361 #   CFLAGS="${CFLAGS} ${EVAS_SSE3_CFLAGS}"
1362 fi
1363
1364 AC_SUBST(CFLAGS)
1365 AC_SUBST(EVAS_SSE3_CFLAGS)
1366
1367 #######################################
1368 ## ALTIVEC
1369 build_cpu_altivec="no"
1370 case $host_cpu in
1371   *power* | *ppc*)
1372     build_cpu_altivec="auto"
1373     ;;
1374 esac
1375 altivec_cflags=""
1376 AC_MSG_CHECKING(whether to build altivec code)
1377 AC_ARG_ENABLE(cpu-altivec,
1378   AC_HELP_STRING([--enable-cpu-altivec], [enable altivec code]),
1379   [ build_cpu_altivec=$enableval ],
1380   [
1381     if test ! "x$build_cpu_altivec" = "xauto"; then
1382       build_cpu_altivec="no"
1383     fi
1384   ]
1385 )
1386 AC_MSG_RESULT($build_cpu_altivec)
1387
1388 if test "x$build_cpu_altivec" = "xyes"; then
1389    AC_CHECK_HEADER(altivec.h,
1390      [
1391         AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
1392         AC_DEFINE(HAVE_ALTIVEC_H, 1, [Have altivec.h header file])
1393         build_cpu_altivec="yes"
1394      ],
1395      [
1396        save_CFLAGS=$CFLAGS
1397        save_CPPFLAGS=$CPPFLAGS
1398        CFLAGS=$CFLAGS" -maltivec"
1399        CPPFLAGS=$CPPFLAGS" -maltivec"
1400        unset ac_cv_header_altivec_h
1401        AC_CHECK_HEADER(altivec.h,
1402          [
1403             AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
1404             AC_DEFINE(HAVE_ALTIVEC_H, 1, [Have altivec.h header file])
1405             build_cpu_altivec="yes"
1406          ],
1407          [
1408             if test "x$build_cpu_altivec" = "xyes" -a "x$use_strict" = "xyes" ; then
1409               AC_MSG_ERROR(Altivec not found (strict dependencies checking))
1410             fi
1411             build_cpu_altivec="no"
1412          ]
1413        )
1414        CFLAGS=$save_CFLAGS
1415        CPPFLAGS=$save_CPPFLAGS
1416      ]
1417    )
1418 fi
1419
1420 if test "x$build_cpu_altivec" = "xyes"; then
1421    AC_MSG_CHECKING(whether to use altivec compiler flag)
1422    if test "x$GCC" = "xyes"; then
1423       if echo "int main(){return 0;}" | ${CPP} -faltivec - > /dev/null 2>&1; then
1424          altivec_cflags="-faltivec"
1425          AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
1426       elif echo "int main(){return 0;}" | ${CPP} -maltivec - > /dev/null 2>&1; then
1427          altivec_cflags="-maltivec"
1428          AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
1429       fi
1430    fi
1431   AC_MSG_RESULT($altivec_cflags)
1432    CFLAGS="$CFLAGS $altivec_cflags"
1433 fi
1434
1435 #######################################
1436 ## NEON
1437 build_cpu_neon="no"
1438 case $host_cpu in
1439   arm*)
1440     build_cpu_neon="yes"
1441     ;;
1442 esac
1443 AC_MSG_CHECKING(whether to build neon code)
1444 AC_ARG_ENABLE(cpu-neon,
1445   AC_HELP_STRING([--enable-cpu-neon], [build neon code, the code will be
1446           checked at run time to see if the CPU supports it]),
1447   [
1448      if test "x$enableval" = "xyes" ; then
1449        AC_TRY_COMPILE([],
1450         [asm volatile (".fpu neon\nvqadd.u8 d0, d1, d0\n")],
1451         [
1452           AC_MSG_RESULT(yes)
1453           AC_DEFINE(BUILD_NEON, 1, [Build NEON Code])
1454           build_cpu_neon="yes"
1455         ],[
1456           AC_MSG_RESULT(no)
1457           build_cpu_neon="no"
1458         ])
1459       else
1460         AC_MSG_RESULT(no)
1461         build_cpu_neon="no"
1462       fi
1463   ],
1464   [
1465     if test "x$build_cpu_neon" = "xyes" ; then
1466        AC_TRY_COMPILE([#include <arm_neon.h>],
1467         [asm volatile ("vqadd.u8 d0, d1, d0\n")],
1468         [
1469           AC_MSG_RESULT(yes)
1470           AC_DEFINE(BUILD_NEON, 1, [Build NEON Code])
1471           build_cpu_neon="yes"
1472         ],[
1473           AC_MSG_RESULT(no)
1474           build_cpu_neon="no"
1475         ])
1476     fi
1477   ]
1478 )
1479      
1480 #######################################
1481 ## C
1482 build_cpu_c="yes"
1483 AC_MSG_CHECKING(whether to build c code)
1484 AC_ARG_ENABLE(cpu-c,
1485   AC_HELP_STRING([--enable-cpu-c], [enable C code]),
1486   [
1487       if test "x$enableval" = "xyes" ; then
1488         AC_MSG_RESULT(yes)
1489         AC_DEFINE(BUILD_C, 1, [Build plain C code])
1490         build_cpu_c="yes"
1491       else
1492         AC_MSG_RESULT(no)
1493         build_cpu_c="no"
1494       fi
1495   ], [
1496       AC_MSG_RESULT($build_cpu_c)
1497       if test "x$build_cpu_c" = "xyes" ; then
1498         AC_DEFINE(BUILD_C, 1, [Build plain C code])
1499       fi
1500   ]
1501 )
1502
1503 #######################################
1504 ## MAGIC_DEBUG
1505 want_evas_magic_debug="yes"
1506 AC_MSG_CHECKING(whether to check magic for evas object)
1507 AC_ARG_ENABLE(evas-magic-debug,
1508   AC_HELP_STRING(
1509     [--disable-evas-magic-debug],
1510     [disable MAGIC_DEBUG check when people pass in wrong object type. [[default=enabled]]]
1511   ),
1512   [ want_evas_magic_debug="$enableval" ]
1513 )
1514 AC_MSG_RESULT($want_evas_magic_debug)
1515
1516 AM_CONDITIONAL(EVAS_MAGIC_DEBUG, test "x$want_evas_magic_debug" = "xyes")
1517 if test "x$want_evas_magic_debug" = "xyes"; then
1518   AC_DEFINE(EVAS_MAGIC_DEBUG, 1, [complain when people pass in wrong object types etc.])
1519 fi
1520
1521 #####################################################################
1522 ## ARGB engine options
1523
1524 #######################################
1525 ## Nearest sampling scaler
1526 EVAS_CHECK_SCALER([scale-sample], [sampling scaler], [scaler_sample="yes"], [scaler_sample="no"])
1527 ## Smooth super and sub sampling scaler
1528 EVAS_CHECK_SCALER([scale-smooth], [smooth scaler], [scaler_smooth="yes"], [scaler_smooth="no"])
1529
1530 #######################################
1531 ## YUV -> ARGB converter
1532 conv_yuv="no"
1533 conv_yuv="yes"
1534 AC_MSG_CHECKING(whether to build yuv converter code)
1535 AC_ARG_ENABLE(convert-yuv,
1536   AC_HELP_STRING([--enable-convert-yuv], [enable yuv converter code]),
1537   [
1538       if test "x$enableval" = "xyes" ; then
1539         AC_MSG_RESULT(yes)
1540         AC_DEFINE(BUILD_CONVERT_YUV, 1, [YUV Converter Support])
1541         conv_yuv="yes"
1542       else
1543         AC_MSG_RESULT(no)
1544         conv_yuv="no"
1545       fi
1546   ], [
1547       AC_MSG_RESULT($conv_yuv)
1548       if test "x$conv_yuv" = "xyes" ; then
1549         AC_DEFINE(BUILD_CONVERT_YUV, 1, [YUV Converter Support])
1550       fi
1551   ]
1552 )
1553
1554 #####################################################################
1555 ## Output rendering features
1556
1557 #######################################
1558 ## Small dither mask instead of big one (lower quality)
1559 EVAS_CHECK_DITHER([small-dither-mask], [small dither mask], [conv_small_dither="yes"], [conv_small_dither="no"])
1560 ## Alternate Line dither mask instead of big one (lower quality - but fastest)
1561 EVAS_CHECK_DITHER([line-dither-mask], [line dither mask], [conv_line_dither="yes"], [conv_line_dither="no"])
1562 ## No dither mask at all for 16bpp
1563 EVAS_CHECK_DITHER([no-dither-mask], [conversion to 16bpp without dither mask], [conv_no_dither="yes"], [conv_no_dither="no"])
1564
1565 #######################################
1566 ## Convert to 8bpp RGB 332
1567 EVAS_CONVERT_COLOR(8, RGB, 332, [yes])
1568 ## Convert to 8bpp RGB 666
1569 EVAS_CONVERT_COLOR(8, RGB, 666, [yes])
1570 ## Convert to 8bpp RGB 232
1571 EVAS_CONVERT_COLOR(8, RGB, 232, [yes])
1572 ## Convert to 8bpp RGB 222
1573 EVAS_CONVERT_COLOR(8, RGB, 222, [yes])
1574 ## Convert to 8bpp RGB 221
1575 EVAS_CONVERT_COLOR(8, RGB, 221, [yes])
1576 ## Convert to 8bpp RGB 121
1577 EVAS_CONVERT_COLOR(8, RGB, 121, [yes])
1578 ## Convert to 8bpp RGB 111
1579 EVAS_CONVERT_COLOR(8, RGB, 111, [yes])
1580 ## Convert to 16bpp RGB 565
1581 EVAS_CONVERT_COLOR(16, RGB, 565)
1582 ## Convert to 16bpp BGR 565
1583 EVAS_CONVERT_COLOR(16, BGR, 565)
1584 ## Convert to 16bpp RGB 555
1585 EVAS_CONVERT_COLOR(16, RGB, 555)
1586 ## Convert to 16bpp RGB 444
1587 EVAS_CONVERT_COLOR(16, RGB, 444)
1588
1589 #######################################
1590 ## Convert to 16bpp RGB 565 (444 ipaq)
1591 conv_16_rgb_ipq="yes"
1592 AC_MSG_CHECKING(whether to build 16bpp 565 (444 ipaq) converter code)
1593 AC_ARG_ENABLE(convert-16-rgb-ipq,
1594   AC_HELP_STRING([--disable-convert-16-rgb-ipq], [disable 16bpp 565 (444 ipaq) converter code]),
1595   [
1596       if test "x$enableval" = "xyes" ; then
1597         AC_DEFINE(BUILD_CONVERT_16_RGB_454645, 1, [16bpp 565 (444 ipaq) Converter Support])
1598         conv_16_rgb_ipq="yes"
1599       else
1600         conv_16_rgb_ipq="no"
1601       fi
1602   ], [
1603       if test "x$conv_16_rgb_ipq" = "xyes" ; then
1604         AC_DEFINE(BUILD_CONVERT_16_RGB_454645, 1, [16bpp 565 (444 ipaq) Converter Support])
1605       fi
1606   ]
1607 )
1608 AC_MSG_RESULT($conv_16_rgb_ipq)
1609
1610 #######################################
1611 ## Convert to 16bpp RGB with rotation of 0
1612 EVAS_CONVERT_ROT(16, RGB, 0)
1613 ## Convert to 16bpp RGB with rotation of 180
1614 EVAS_CONVERT_ROT(16, RGB, 180)
1615 ## Convert to 16bpp RGB with rotation of 270
1616 EVAS_CONVERT_ROT(16, RGB, 270)
1617 ## Convert to 16bpp RGB with rotation of 90
1618 EVAS_CONVERT_ROT(16, RGB, 90)
1619
1620 #######################################
1621 ## Convert to 24bpp RGB 888
1622 EVAS_CONVERT_COLOR(24, RGB, 888)
1623 ## Convert to 24bpp BGR 888
1624 EVAS_CONVERT_COLOR(24, BGR, 888)
1625 ## Convert to 32bpp RGB 8888
1626 EVAS_CONVERT_COLOR(32, RGB, 8888)
1627 ## Convert to 32bpp RGBX 8888
1628 EVAS_CONVERT_COLOR(32, RGBX, 8888)
1629 ## Convert to 32bpp BGR 8888
1630 EVAS_CONVERT_COLOR(32, BGR, 8888)
1631 ## Convert to 32bpp BGRX 8888
1632 EVAS_CONVERT_COLOR(32, BGRX, 8888)
1633
1634 #######################################
1635 ## Convert to 24bpp RGB 666 (666 ezx)
1636 conv_24_rgb_ezx="yes"
1637 AC_MSG_CHECKING(whether to build 24bpp 666 (666 ezx) converter code)
1638 AC_ARG_ENABLE(convert-24-rgb-ezx,
1639   AC_HELP_STRING([--disable-convert-24-rgb-ezx], [disable 24bpp 666 (666 ezx) converter code]),
1640   [
1641       if test "x$enableval" = "xyes" ; then
1642         AC_DEFINE(BUILD_CONVERT_24_RGB_666, 1, [24bpp 666 (666 ezx) Converter Support])
1643         conv_24_rgb_ezx="yes"
1644       else
1645         conv_24_rgb_ezx="no"
1646       fi
1647   ], [
1648       if test "x$conv_24_rgb_ezx" = "xyes" ; then
1649         AC_DEFINE(BUILD_CONVERT_24_RGB_666, 1, [24bpp 666 (666 ezx) Converter Support])
1650       fi
1651   ]
1652 )
1653 AC_MSG_RESULT($conv_24_rgb_ezx)
1654
1655 #######################################
1656 ## Convert to 32bpp RGB 666 (666 ezx)
1657 conv_32_rgb_ezx="yes"
1658 AC_MSG_CHECKING(whether to build 32bpp 666 (666 ezx) converter code)
1659 AC_ARG_ENABLE(convert-32-rgb-ezx,
1660   AC_HELP_STRING([--disable-convert-32-rgb-ezx], [disable 32bpp 666 (666 ezx) converter code]),
1661   [
1662       if test "x$enableval" = "xyes" ; then
1663         AC_DEFINE(BUILD_CONVERT_32_RGB_666, 1, [32bpp 666 (666 ezx) Converter Support])
1664         conv_32_rgb_ezx="yes"
1665       else
1666         conv_32_rgb_ezx="no"
1667       fi
1668   ], [
1669       if test "x$conv_32_rgb_ezx" = "xyes" ; then
1670         AC_DEFINE(BUILD_CONVERT_32_RGB_666, 1, [32bpp 666 (666 ezx) Converter Support])
1671       fi
1672   ]
1673 )
1674 AC_MSG_RESULT($conv_32_rgb_ezx)
1675
1676 #######################################
1677 ## Convert to 32bpp RGB with rotation of 0
1678 EVAS_CONVERT_ROT(32, RGB, 0)
1679 ## Convert to 32bpp RGB with rotation of 180
1680 EVAS_CONVERT_ROT(32, RGB, 180)
1681 ## Convert to 32bpp RGB with rotation of 270
1682 EVAS_CONVERT_ROT(32, RGB, 270)
1683 ## Convert to 32bpp RGB with rotation of 90
1684 EVAS_CONVERT_ROT(32, RGB, 90)
1685
1686 #######################################
1687 ## Convert to 8bpp grayscale with 256 value, no palette
1688 EVAS_CONVERT_COLOR(8, GRY, 1)
1689 ## Convert to 8bpp grayscale with 16 value, no palette
1690 EVAS_CONVERT_COLOR(8, GRY, 16)
1691
1692 #######################################
1693 ## Convert to 8bpp grayscale, 64-palette
1694 conv_8_grayscale_64="yes"
1695 AC_MSG_CHECKING(whether to build 8bpp grayscale 64-palette converter code)
1696 AC_ARG_ENABLE(convert-8-grayscale-64,
1697   AC_HELP_STRING([--disable-convert-8-grayscale-64], [disable 8bpp grayscale 64-palette converter code]),
1698   [
1699      if test "x$enableval" = "xyes"; then
1700        AC_DEFINE(BUILD_CONVERT_8_GRAYSCALE_64, 1, [8bpp Grayscale 64-palette Converter Support])
1701        conv_8_grayscale_64="yes"
1702      else
1703        conv_8_grayscale_64="no"
1704      fi
1705   ], [
1706      if test "x$conv_8_grayscale_64" = "xyes"; then
1707        AC_DEFINE(BUILD_CONVERT_8_GRAYSCALE_64, 1, [32bpp Grayscale 64-palette Converter Support])
1708      fi
1709   ]
1710 )
1711 AC_MSG_RESULT($conv_8_grayscale_64)
1712
1713 ## valgrind
1714 want_valgrind="no"
1715 have_valgrind="no"
1716
1717 AC_MSG_CHECKING(whether to enable build with valgrind)
1718 AC_ARG_ENABLE(valgrind,
1719   AC_HELP_STRING([--enable-valgrind], [enable valgrind fixes to stop false reports]),
1720   [ want_valgrind=$enableval ]
1721 )
1722 AC_MSG_RESULT($want_valgrind)
1723
1724 if test x$want_valgrind = "xyes"; then
1725   PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1726     [
1727       AC_DEFINE(HAVE_VALGRIND, 1, [Valgrind support])
1728       have_valgrind=yes
1729       requirement_evas="valgrind ${requirement_evas}"
1730     ],
1731     [
1732       if test "x$want_valgrind" = "xyes" -a "x$use_strict" = "xyes" ; then
1733         AC_MSG_ERROR([Valgrind not found (strict dependencies checking)])
1734       fi
1735     ]
1736   )
1737 fi
1738
1739 ## Examples
1740
1741 install_examples="yes"
1742 AC_ARG_ENABLE([install-examples],
1743    AC_HELP_STRING([--disable-install-examples],
1744                   [disable installing examples (compiled or just source).
1745                    @<:@default==enabled@:>@]),
1746    [
1747     if test "x${enableval}" = "xyes" ; then
1748        install_examples="yes"
1749     else
1750        install_examples="no"
1751     fi
1752    ],
1753    [install_examples="yes"])
1754 AM_CONDITIONAL([INSTALL_EXAMPLES], [test "x${install_examples}" = "xyes"])
1755
1756 build_examples="no"
1757 AC_ARG_ENABLE([build-examples],
1758    AC_HELP_STRING([--enable-build-examples],
1759                   [enable building examples (this requires extra denpendencies. if you don't have them installed yet, don't build with this option or it will fail. build again when you have it, overriding the previous installation). @<:@default==disabled@:>@]),
1760    [
1761     if test "x${enableval}" = "xyes" ; then
1762        build_examples="yes"
1763        # put in here the dependencies for Evas' examples. they are
1764        # meant to be 'real world' usage examples, thus one will be
1765        # using higher level libraries on these programs
1766        PKG_CHECK_MODULES([ECORE_EVAS], [ecore-evas ecore], [], [build_examples="no"])
1767        PKG_CHECK_MODULES([EDJE], [edje],
1768         [edje_cc=$($PKG_CONFIG --variable=prefix edje)/bin/edje_cc],
1769         [build_examples="no"])
1770        AC_SUBST(edje_cc)
1771     else
1772        build_examples="no"
1773     fi
1774    ],
1775    [build_examples="no"])
1776 AM_CONDITIONAL([BUILD_EXAMPLES], [test "x${build_examples}" = "xyes"])
1777
1778 ## Unit tests, coverage
1779
1780 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
1781
1782 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
1783 EVAS_CFLAGS="${EVAS_CFLAGS} ${EFL_COVERAGE_CFLAGS} ${EXOTIC_CFLAGS}"
1784 EVAS_LIBS="${EVAS_LIBS} ${EFL_COVERAGE_LIBS} ${EXOTIC_LIBS}"
1785 if test "x$enable_coverage" = "xyes" ; then
1786    EVAS_CFLAGS="${EVAS_CFLAGS} ${EFL_DEBUG_CFLAGS}"
1787 fi
1788
1789 AC_SUBST(EVAS_CFLAGS)
1790 AC_SUBST(EVAS_LIBS)
1791
1792 # General CFLAGS
1793
1794 EVAS_GENERAL_CFLAGS="${EINA_CFLAGS}"
1795 EVAS_GENERAL_LIBS="${EINA_LIBS}"
1796 AC_SUBST(EVAS_GENERAL_CFLAGS)
1797 AC_SUBST(EVAS_GENERAL_LIBS)
1798
1799 #####################################################################
1800 ## Fill in flags
1801
1802 AC_SUBST(altivec_cflags)
1803 AC_SUBST(pthread_cflags)
1804 AC_SUBST(pthread_libs)
1805 AC_SUBST(requirement_evas)
1806
1807
1808 #####################################################################
1809 ## Output
1810
1811 AC_OUTPUT([
1812 Makefile
1813 evas-directfb.pc
1814 evas-fb.pc
1815 evas-opengl-x11.pc
1816 evas-opengl-sdl.pc
1817 evas-opengl-cocoa.pc
1818 evas-software-buffer.pc
1819 evas-software-x11.pc
1820 evas-software-8-x11.pc
1821 evas-software-16-x11.pc
1822 evas-software-gdi.pc
1823 evas-software-ddraw.pc
1824 evas-direct3d.pc
1825 evas-software-16-wince.pc
1826 evas-software-sdl.pc
1827 evas-psl1ght.pc
1828 evas-wayland-shm.pc
1829 evas-wayland-egl.pc
1830 evas.pc
1831 doc/evas.dox
1832 doc/Makefile
1833 doc/Doxyfile
1834 src/Makefile
1835 src/bin/Makefile
1836 src/bin/loaders/Makefile
1837 src/bin/loaders/jpeg/Makefile
1838 src/bin/loaders/png/Makefile
1839 src/bin/loaders/eet/Makefile
1840 src/bin/loaders/tiff/Makefile
1841 src/bin/loaders/xpm/Makefile
1842 src/bin/loaders/bmp/Makefile
1843 src/bin/loaders/ico/Makefile
1844 src/bin/loaders/tga/Makefile
1845 src/bin/loaders/pmaps/Makefile
1846 src/bin/loaders/wbmp/Makefile
1847 src/bin/loaders/psd/Makefile
1848 src/lib/Makefile
1849 src/lib/canvas/Makefile
1850 src/lib/file/Makefile
1851 src/lib/cache/Makefile
1852 src/lib/cache2/Makefile
1853 src/lib/cserve/Makefile
1854 src/lib/cserve2/Makefile
1855 src/lib/engines/Makefile
1856 src/lib/engines/common/Makefile
1857 src/lib/engines/common/evas_op_add/Makefile
1858 src/lib/engines/common/evas_op_blend/Makefile
1859 src/lib/engines/common/evas_op_copy/Makefile
1860 src/lib/engines/common/evas_op_mask/Makefile
1861 src/lib/engines/common/evas_op_mul/Makefile
1862 src/lib/engines/common/evas_op_sub/Makefile
1863 src/lib/engines/common_8/Makefile
1864 src/lib/engines/common_16/Makefile
1865 src/modules/Makefile
1866 src/modules/engines/Makefile
1867 src/modules/engines/software_generic/Makefile
1868 src/modules/engines/software_gdi/Makefile
1869 src/modules/engines/software_ddraw/Makefile
1870 src/modules/engines/direct3d/Makefile
1871 src/modules/engines/software_16_wince/Makefile
1872 src/modules/engines/software_x11/Makefile
1873 src/modules/engines/fb/Makefile
1874 src/modules/engines/buffer/Makefile
1875 src/modules/engines/directfb/Makefile
1876 src/modules/engines/gl_common/Makefile
1877 src/modules/engines/gl_x11/Makefile
1878 src/modules/engines/gl_sdl/Makefile
1879 src/modules/engines/gl_cocoa/Makefile
1880 src/modules/engines/psl1ght/Makefile
1881 src/modules/engines/software_8/Makefile
1882 src/modules/engines/software_8_x11/Makefile
1883 src/modules/engines/software_16/Makefile
1884 src/modules/engines/software_16_x11/Makefile
1885 src/modules/engines/software_16_sdl/Makefile
1886 src/modules/engines/wayland_shm/Makefile
1887 src/modules/engines/wayland_egl/Makefile
1888 src/modules/loaders/Makefile
1889 src/modules/loaders/edb/Makefile
1890 src/modules/loaders/eet/Makefile
1891 src/modules/loaders/gif/Makefile
1892 src/modules/loaders/jpeg/Makefile
1893 src/modules/loaders/png/Makefile
1894 src/modules/loaders/tiff/Makefile
1895 src/modules/loaders/xpm/Makefile
1896 src/modules/loaders/bmp/Makefile
1897 src/modules/loaders/ico/Makefile
1898 src/modules/loaders/tga/Makefile
1899 src/modules/loaders/svg/Makefile
1900 src/modules/loaders/pmaps/Makefile
1901 src/modules/loaders/wbmp/Makefile
1902 src/modules/loaders/psd/Makefile
1903 src/modules/loaders/generic/Makefile
1904 src/modules/savers/Makefile
1905 src/modules/savers/edb/Makefile
1906 src/modules/savers/eet/Makefile
1907 src/modules/savers/jpeg/Makefile
1908 src/modules/savers/png/Makefile
1909 src/modules/savers/tiff/Makefile
1910 src/static_deps/Makefile
1911 src/static_deps/liblinebreak/Makefile
1912 src/lib/include/Makefile
1913 src/examples/Makefile
1914 src/tests/Makefile
1915 data/Makefile
1916 evas.spec
1917 ])
1918
1919 #####################################################################
1920 ## Sanity Checks
1921
1922 if test "x$build_pthreads" = "xno" ; then
1923   if test "x$build_pipe_render" = "xyes" ; then
1924     echo "ERROR: PThreads off, but pipe rendering on. Pipe rendering"
1925     echo "  needs thread support."
1926     exit 1
1927   fi
1928 fi
1929
1930 if test "x${has_pthreads}" = "xno" ; then
1931   if test "x$build_async_preload" = "xyes" ; then
1932     echo "ERROR: PThreads off, but Async Preload on. Async Preload"
1933     echo "  needs thread support."
1934     exit 1
1935   fi
1936 fi
1937
1938 #####################################################################
1939 ## Info
1940
1941 echo
1942 echo
1943 echo
1944 echo "------------------------------------------------------------------------"
1945 echo "$PACKAGE $VERSION"
1946 echo "------------------------------------------------------------------------"
1947 echo
1948 echo "Configuration Options Summary:"
1949 echo
1950 echo "Engines:"
1951 echo "  Software Memory Buffer.....: $have_evas_engine_buffer"
1952 echo "  Software X11...............: $have_evas_engine_software_x11 (Xlib: $have_evas_engine_software_xlib) (XCB: $have_evas_engine_software_xcb)"
1953 echo $ECHO_N "  OpenGL X11.................: $have_evas_engine_gl_x11 (Xlib: $have_evas_engine_gl_xlib) (XCB: $have_evas_engine_gl_xcb) $ECHO_C"
1954 if test "x$have_evas_engine_gl_x11" = "xyes"; then
1955   echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
1956 else
1957   echo
1958 fi
1959 echo "  Software GDI...............: $have_evas_engine_software_gdi"
1960 echo "  Software DirectDraw........: $have_evas_engine_software_ddraw"
1961 echo "  Direct3d...................: $have_evas_engine_direct3d"
1962 echo "  OpenGL SDL.................: $have_evas_engine_gl_sdl $ECHO_C"
1963 if test "x$have_evas_engine_gl_sdl" = "xyes"; then
1964   echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
1965 else
1966   echo
1967 fi
1968 echo "  OpenGL Cocoa...............: $have_evas_engine_gl_cocoa"
1969 echo "  Software Framebuffer.......: $have_evas_engine_fb"
1970 echo "  DirectFB...................: $have_evas_engine_directfb"
1971 echo "  PSL1GHT....................: $have_evas_engine_psl1ght"
1972 echo "  Software 8bit grayscale....: $have_evas_engine_software_8"
1973 # FIXME: kill software 16bit
1974 echo "  Software 16bit ............: $have_evas_engine_software_16"
1975 echo "  Software 16bit X11.........: $have_evas_engine_software_16_x11"
1976 echo "  Software 16bit WinCE.......: $have_evas_engine_software_16_wince"
1977 echo "  Software 16bit SDL.........: $have_evas_engine_software_16_sdl (primitive: $sdl_primitive)"
1978 echo "  Wayland Shm................: $have_evas_engine_wayland_shm"
1979 echo "  Wayland Egl................: $have_evas_engine_wayland_egl"
1980 echo
1981 echo "Image Loaders:"
1982 echo "  BMP.....................: $have_evas_image_loader_bmp"
1983 echo "  EDB.....................: $have_evas_image_loader_edb"
1984 echo "  EET.....................: $have_evas_image_loader_eet"
1985 echo "  GENERIC.................: $have_evas_image_loader_generic"
1986 echo "  GIF.....................: $have_evas_image_loader_gif"
1987 echo "  ICO.....................: $have_evas_image_loader_ico"
1988 echo "  JPEG....................: $have_evas_image_loader_jpeg (region: $have_jpeg_region)"
1989 echo "  PMAPS...................: $have_evas_image_loader_pmaps"
1990 echo "  PNG.....................: $have_evas_image_loader_png"
1991 echo "  PSD.....................: $have_evas_image_loader_psd"
1992 echo "  SVG.....................: $have_evas_image_loader_svg"
1993 echo "  TGA.....................: $have_evas_image_loader_tga"
1994 echo "  TIFF....................: $have_evas_image_loader_tiff"
1995 echo "  WBMP....................: $have_evas_image_loader_wbmp"
1996 echo "  XPM.....................: $have_evas_image_loader_xpm"
1997 echo
1998 echo "Font Sourcing Systems:"
1999 echo "  EET.....................: $have_evas_font_loader_eet"
2000 echo
2001 echo "Font Searching Systems:"
2002 echo "  Fontconfig..............: $have_fontconfig"
2003 echo
2004 echo "Font Rendering Helpers:"
2005 echo "  Fribidi.................: $have_fribidi"
2006 echo "  Harfbuzz................: $have_harfbuzz"
2007 echo "  liblinebreak............: $have_linebreak"
2008 # FIXME: add non freetype2 font engine support
2009 # FIXME: make freetype2 optional
2010 echo
2011 echo "CPU Specific Extensions:"
2012 echo "  Fallback C Code.........: $build_cpu_c"
2013 echo "  MMX.....................: $build_cpu_mmx"
2014 echo "  SSE.....................: $build_cpu_sse"
2015 echo "  SSE3....................: $build_cpu_sse3"
2016 echo "  ALTIVEC.................: $build_cpu_altivec"
2017 echo "  NEON....................: $build_cpu_neon"
2018 echo "  Thread Support..........: $build_pthreads"
2019 echo
2020 echo "Features:"
2021 echo "  MAGIC_DEBUG.............: $want_evas_magic_debug"
2022 echo "  Cache Server............: $want_evas_cserve"
2023 echo "  Cache Server 2..........: $want_evas_cserve2"
2024 echo
2025 dnl
2026 dnl ... DISABLED! some testing has shown that this seems to have some
2027 dnl nasty bugs on both x86 and arm (tegra2 dual core tested), so just
2028 dnl disabling this for now until it can be fixed
2029 dnl 
2030 echo "  Threaded Pipe Rendering.: $build_pipe_render"
2031 echo "  Async Events............: $build_async_events"
2032 echo "  Async Image Preload.....: $build_async_preload"
2033 echo
2034 echo "  Pixman..................: $have_pixman"
2035 echo "  Pixman Fonts............: $have_pixman_font"
2036 echo "  Pixman Rects............: $have_pixman_rect"
2037 echo "  Pixman Lines............: $have_pixman_line"
2038 echo "  Pixman Polygons.........: $have_pixman_poly"
2039 echo "  Pixman Images...........: $have_pixman_image"
2040 echo "  Pixman Image ScaleSample: $have_pixman_image_scale_sample"
2041 echo 
2042 echo "  Tiled 32BPP rotate......: $have_tile_rotate"
2043 echo
2044 echo "ARGB Software Engine Options:"
2045 echo "  Sampling Scaler.........: $scaler_sample"
2046 echo "  Smooth Scaler...........: $scaler_smooth"
2047 # FIXME: add an mmx scaler routine
2048 echo "  YUV Converter...........: $conv_yuv"
2049 # FIXME: add more YUV format and colorvariant support
2050 echo
2051 echo "ARGB Conversion Options:"
2052 echo "  Smaller Dither Mask.....: $conv_small_dither"
2053 echo "  Line Dither Mask........: $conv_line_dither"
2054 echo "  No Dither Mask for 16bpp: $conv_no_dither"
2055 echo "  8bpp RGB 332............: $conv_8_rgb_332"
2056 echo "  8bpp RGB 666............: $conv_8_rgb_666"
2057 echo "  8bpp RGB 232............: $conv_8_rgb_232"
2058 echo "  8bpp RGB 222............: $conv_8_rgb_222"
2059 echo "  8bpp RGB 221............: $conv_8_rgb_221"
2060 echo "  8bpp RGB 121............: $conv_8_rgb_121"
2061 echo "  8bpp RGB 111............: $conv_8_rgb_111"
2062 echo "  8bpp Grayscale (256)....: $conv_8_gry_1"
2063 echo "  8bpp Grayscale (16).....: $conv_8_gry_16"
2064 echo "  8bpp Grayscale 64-pal...: $conv_8_grayscale_64"
2065 # FIXME: add grayscale and B&W support to standard x converters
2066 echo "  16bpp RGB 565...........: $conv_16_rgb_565"
2067 echo "  16bpp BGR 565...........: $conv_16_bgr_565"
2068 echo "  16bpp RGB 555...........: $conv_16_rgb_555"
2069 echo "  16bpp RGB 444...........: $conv_16_rgb_444"
2070 echo "  16bpp RGB 565 (444 ipaq): $conv_16_rgb_ipq"
2071 # FIXME: add 555 (444 ipaq) support
2072 # FIXME: add 30bpp support
2073 # FIXME: add palletted support (ugh!)
2074 # FIXME: add 8bpp and below rotation
2075 echo "  16bpp Rotation 0........: $conv_16_rgb_rot_0"
2076 echo "  16bpp Rotation 90.......: $conv_16_rgb_rot_90"
2077 echo "  16bpp Rotation 180......: $conv_16_rgb_rot_180"
2078 echo "  16bpp Rotation 270......: $conv_16_rgb_rot_270"
2079 echo "  24bpp RGB 888...........: $conv_24_rgb_888"
2080 echo "  24bpp BGR 888...........: $conv_24_bgr_888"
2081 echo "  24bpp RGB 666 (666 ezx).: $conv_24_rgb_ezx"
2082 # FIXME: add 24bpp rotation
2083 echo "  32bpp RGB 8888..........: $conv_32_rgb_8888"
2084 echo "  32bpp RGBX 8888.........: $conv_32_rgbx_8888"
2085 echo "  32bpp BGR 8888..........: $conv_32_bgr_8888"
2086 echo "  32bpp BGRX 8888.........: $conv_32_bgrx_8888"
2087 echo "  32bpp RGB 666 (666 ezx).: $conv_32_rgb_ezx"
2088 echo "  32bpp Rotation 0........: $conv_32_rgb_rot_0"
2089 echo "  32bpp Rotation 90.......: $conv_32_rgb_rot_90"
2090 echo "  32bpp Rotation 180......: $conv_32_rgb_rot_180"
2091 echo "  32bpp Rotation 270......: $conv_32_rgb_rot_270"
2092 echo
2093 echo "Documentation.............: ${build_doc}"
2094 if test "x${build_doc}" = "xyes" ; then
2095 echo "    Installation..........: make install-doc"
2096 fi
2097 echo "Examples..................: install:${install_examples} build:${build_examples}"
2098 if test "x${enable_tests}" = "xyes" ; then
2099    echo "Tests.....................: ${enable_tests} (make check)"
2100 else
2101    echo "Tests.....................: ${enable_tests}"
2102 fi
2103 if test "x${enable_coverage}" = "xyes" ; then
2104    echo "Coverage..................: ${enable_coverage} (make coverage)"
2105 else
2106    echo "Coverage..................: ${enable_coverage}"
2107 fi
2108 echo
2109 echo "Compilation............: make (or gmake)"
2110 echo "  CPPFLAGS.............: $CPPFLAGS"
2111 echo "  CFLAGS...............: $CFLAGS"
2112 echo "  CXXFLAGS.............: $CXXFLAGS"
2113 echo "  LDFLAGS..............: $LDFLAGS"
2114 echo
2115 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
2116 echo "  prefix...............: $prefix"
2117 echo
2118 if test "x${have_static_module}" = "xyes" ; then
2119 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Evas."
2120 echo "         You must know what you are doing, or else you will have a lot of"
2121 echo "         problems. And Kenny will be killed."
2122 echo "         Think about that."
2123 echo
2124 fi