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