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