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