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