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