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