[changelog] repackaging
[framework/uifw/evas.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [0])
4 m4_define([v_min], [9])
5 m4_define([v_mic], [9])
6 m4_define([v_rev], m4_esyscmd([(svnversion . | grep -v exported || 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 m4_define([relname], [ver-pre-svn-06])
12 m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
15 [m4_define([v_ver], [v_maj.v_min.v_mic])])
16 m4_define([lt_rev], m4_eval(v_maj + v_min))
17 m4_define([lt_cur], v_mic)
18 m4_define([lt_age], v_min)
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21
22 # rw_PROG_OBJC_WORKS
23 # Check whether the Objective C compiler works.
24 AC_DEFUN([rw_PROG_OBJC_WORKS],
25 [AC_REQUIRE([AC_PROG_OBJC])dnl
26 AC_CACHE_CHECK([whether the Objective C compiler works],
27                [rw_cv_prog_objc_works],
28                [AC_LANG_PUSH([Objective C])
29                 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
30                                [rw_cv_prog_objc_works=yes],
31                                [rw_cv_prog_objc_works=no])
32                 AC_LANG_POP([Objective C])])
33 ])
34
35 AC_INIT([evas], [v_ver], [enlightenment-devel@lists.sourceforge.net])
36 AC_PREREQ([2.52])
37 AC_CONFIG_SRCDIR([configure.ac])
38 AC_CONFIG_MACRO_DIR([m4])
39 AC_CANONICAL_BUILD
40 AC_CANONICAL_HOST
41 AC_ISC_POSIX
42
43 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
44 AM_CONFIG_HEADER([config.h])
45 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
46
47 AC_LIBTOOL_WIN32_DLL
48 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
49 AC_PROG_LIBTOOL
50
51 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
52 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
53 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
54 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
55 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
56 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
57 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
58 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
59 version_info="lt_rev:lt_cur:lt_age"
60 release_info="v_rel"
61 AC_SUBST(version_info)
62 AC_SUBST(release_info)
63 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
64 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
65
66 EFL_CHECK_PATH_MAX
67
68 ### Needed information
69
70 case "$host_os" in
71    mingw32ce* | cegcc*)
72       MODULE_ARCH="$host_os-$host_cpu"
73       ;;
74    *)
75       MODULE_ARCH="$host_os-$host_cpu-relname"
76       ;;
77 esac
78 AC_SUBST(MODULE_ARCH)
79 AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
80
81 # weird debian etch bug where pthread_barrier doesn't work without adding
82 # this.
83 CFLAGS="${CFLAGS=} -D_GNU_SOURCE"
84 AC_SUBST(CFLAGS)
85
86 want_fontconfig="auto"
87 want_fribidi="auto"
88 want_evas_cserve="yes"
89
90 want_evas_engine_buffer="yes"
91 want_evas_engine_software_xlib="no"
92 want_evas_engine_xrender_x11="no"
93 want_evas_engine_gl_x11="no"
94 want_evas_engine_gl_sdl="no"
95 want_evas_engine_cairo_x11="no"
96 want_evas_engine_software_xcb="no"
97 want_evas_engine_xrender_xcb="no"
98 want_evas_engine_software_gdi="no"
99 want_evas_engine_software_ddraw="no"
100 want_evas_engine_direct3d="no"
101 want_evas_engine_quartz="no"
102 want_evas_engine_gl_glew="no"
103 want_evas_engine_software_sdl="no"
104 want_evas_engine_fb="no"
105 want_evas_engine_directfb="no"
106 want_evas_engine_software_qtopia="no"
107 want_evas_engine_software_16_x11="no"
108 want_evas_engine_software_16_ddraw="no"
109 want_evas_engine_software_16_wince="no"
110
111 want_evas_image_loader_edb="yes"
112 want_evas_image_loader_eet="yes"
113 want_evas_image_loader_gif="yes"
114 want_evas_image_loader_jpeg="yes"
115 want_evas_image_loader_pmaps="yes"
116 want_evas_image_loader_png="yes"
117 want_evas_image_loader_svg="yes"
118 want_evas_image_loader_tiff="yes"
119 want_evas_image_loader_xpm="yes"
120 want_evas_image_loader_bmp="yes"
121 want_evas_image_loader_wbmp="yes"
122 want_evas_image_loader_tga="yes"
123
124 want_evas_font_loader_eet="yes"
125
126 case "$host_os" in
127    mingw32ce* | cegcc*)
128       want_fontconfig="no"
129       want_evas_engine_software_16_wince="yes"
130       want_evas_image_loader_edb="no"
131       want_evas_image_loader_gif="no"
132       want_evas_image_loader_svg="no"
133       want_evas_image_loader_tiff="no"
134       ;;
135    mingw*)
136       want_evas_engine_software_gdi="yes"
137       want_evas_engine_software_ddraw="yes"
138       want_evas_engine_direct3d="yes"
139       want_evas_engine_software_16_ddraw="yes"
140       want_evas_image_loader_edb="no"
141       want_evas_image_loader_svg="no"
142       ;;
143    darwin*)
144       want_evas_engine_software_xlib="auto"
145       want_evas_engine_quartz="auto"
146       ;;
147    *)
148       want_evas_engine_software_xlib="auto"
149       want_evas_engine_xrender_x11="auto"
150       want_evas_engine_software_16_x11="auto"
151       ;;
152 esac
153
154 requirement_evas=""
155
156
157 ### Additional options to configure
158
159 # when used, that option makes configure script fails when
160 # a requirement is selected, but not met.
161 use_strict="no"
162 AC_ARG_ENABLE([strict],
163    AC_HELP_STRING([--enable-strict], [enable strict checking mode. @<:@default==disabled@:>@]),
164    [use_strict="yes"],
165    [use_strict="no"])
166
167 # Simple X11 build/link
168 AC_ARG_ENABLE([simple-x11],
169    AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking]),
170    [
171     if test "x${enableval}" = "xyes" ; then
172        want_evas_simple_x11="yes"
173     else
174        want_evas_simple_x11="no"
175     fi
176    ])
177
178
179 ### Checks for programs
180
181 m4_ifdef([AC_PROG_OBJC],
182    [
183     AC_PROG_OBJC
184     _AM_DEPENDENCIES(OBJC)
185    ],
186    [
187     AC_CHECK_TOOL([OBJC], [gcc])
188     AC_SUBST([OBJC])
189     AC_SUBST([OBJCFLAGS])
190    ])
191
192 rw_PROG_OBJC_WORKS
193
194 AC_PROG_CXX
195 AC_PROG_CC
196
197 # pkg-config
198 PKG_PROG_PKG_CONFIG
199
200 # Check whether pkg-config supports Requires.private
201 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
202    pkgconfig_requires_private="Requires.private"
203 else
204    pkgconfig_requires_private="Requires"
205 fi
206 AC_SUBST(pkgconfig_requires_private)
207
208 # doxygen program for documentation building
209 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
210
211
212 ### Checks for libraries
213
214 # Evil library for compilation on Windows CE
215
216 case "$host_os" in
217    mingw* | cegcc*)
218       PKG_CHECK_MODULES([EVIL], [evil])
219       AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
220       requirement_evas="evil ${requirement_evas}"
221    ;;
222 esac
223
224 ## strong dependencies
225
226 # Eina
227 PKG_CHECK_MODULES([EINA], [eina-0])
228
229 # Freetype
230 PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 9.3.0])
231
232 requirement_evas="freetype2 eina-0 ${requirement_evas}"
233
234 #WinkCodec
235 AC_ARG_ENABLE([winkcodec],
236                 AS_HELP_STRING([--enable-winkcodec],
237                         [enable/disable wink codec (default: no)]),
238                 [WINK=$enableval], [WINK=no])
239
240 #if test "x${WINK}" = "xyes" ; then
241 #       PKG_CHECK_MODULES([LIBWINK],[wink])
242 #       AC_DEFINE(USE_WINK_CODEC, 1, [use wink codec])
243 #       requirement_evas="wink ${requirement_evas}"
244 #fi
245
246 ## optional dependencies
247
248 # FontConfig
249 have_fontconfig="no"
250 AC_ARG_ENABLE([fontconfig],
251    AC_HELP_STRING([--disable-fontconfig],
252       [disable fontconfig for finding fonts. @<:@default=enabled@:>@]),
253    [
254     if test "x${enableval}" = "xyes" ; then
255        want_fontconfig="yes"
256     else
257        want_fontconfig="no"
258     fi
259    ])
260
261
262 if test "x${want_fontconfig}" = "xyes" -o "x${want_fontconfig}" = "xauto" ; then
263    PKG_CHECK_MODULES([FONTCONFIG],
264       [fontconfig],
265       [
266        have_fontconfig="yes"
267        AC_DEFINE(HAVE_FONTCONFIG, 1, [have fontconfig searching capabilities])
268        requirement_evas="fontconfig ${requirement_evas}"
269       ],
270       [
271        if test "x${want_fontconfig}" = "xyes" -a "x${use_strict}" = "xyes" ; then
272           AC_MSG_ERROR([Fontconfig not found (strict dependencies checking)])
273        fi
274       ])
275 fi
276
277 # fribidi support
278 have_fribidi="no"
279 AC_ARG_ENABLE([fribidi],
280    AC_HELP_STRING([--disable-fribidi],
281       [disable bidirectional text support. @<:@default=enabled@:>@]),
282    [
283     if test "x${enableval}" = "xyes" ; then
284        want_fribidi="yes"
285     else
286        want_fribidi="no"
287     fi
288    ])
289
290 if test "x${want_fribidi}" = "xyes" -o "x${want_fribidi}" = "xauto" ; then
291    PKG_CHECK_MODULES([FRIBIDI],
292       [fribidi],
293       [
294        have_fribidi="yes"
295        AC_DEFINE(HAVE_FRIBIDI, 1, [have fribidi support])
296        requirement_evas="fribidi ${requirement_evas}"
297       ],
298       [
299        if test "x$want_fribidi" = "xyes" -a "x$use_strict" = "xyes" ; then
300           AC_MSG_ERROR([Fribidi not found (strict dependencies checking)])
301        fi
302       ])
303 fi
304
305 if test "x${have_fribidi}" = "xno"; then
306   HAS_BIDI=0
307 fi
308
309 ### Checks for header files
310 AC_HEADER_STDC
311
312
313 ### Checks for types
314
315
316 ### Checks for structures
317
318
319 ### Checks for compiler characteristics
320 AC_C_CONST
321 AC_C_BIGENDIAN
322 AC_C___ATTRIBUTE__
323 AM_PROG_CC_STDC
324
325 WIN32_CPPFLAGS=""
326 case "$host_os" in
327    mingw32ce* | cegcc*)
328       WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
329       ;;
330    mingw*)
331       WIN32_CPPFLAGS="-D_WIN32_WINNT=0x0500"
332       ;;
333 esac
334 AC_SUBST(WIN32_CPPFLAGS)
335
336 WIN32_CFLAGS=""
337 case "${host_os}" in
338    cegcc*)
339       WIN32_CFLAGS="-mwin32"
340    ;;
341 esac
342 AC_SUBST(WIN32_CFLAGS)
343
344
345 ### Checks for linker characteristics
346 lt_enable_auto_import=""
347 case "${host_os}" in
348    mingw* | cegcc*)
349       AC_DEFINE(EFL_EVAS_BUILD, 1, [Define to mention that evas is built])
350       lt_enable_auto_import="-Wl,--enable-auto-import"
351    ;;
352 esac
353 AC_SUBST(lt_enable_auto_import)
354
355
356 ### Checks for library functions
357
358 # alloca
359 AC_FUNC_ALLOCA
360
361 # fnmatch
362 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
363
364 # dlopen
365 dlopen_libs=""
366 case "$host_os" in
367   mingw32ce* | cegcc*)
368 # managed by evil
369     AC_DEFINE(HAVE_DLADDR)
370   ;;
371   mingw*)
372 # nothing on mingw platform
373   ;;
374   *)
375     AC_CHECK_FUNCS(dlopen, res=yes, res=no)
376     if test "x$res" = "xyes"; then
377       AC_CHECK_FUNCS(dladdr, AC_DEFINE(HAVE_DLADDR))
378     else
379       AC_CHECK_LIB(dl, dlopen, res=yes, res=no)
380       if test "x$res" = "xyes"; then
381         AC_CHECK_LIB(dl, dladdr, AC_DEFINE(HAVE_DLADDR))
382         dlopen_libs=-ldl
383       else
384         AC_MSG_ERROR(Cannot find dlopen)
385       fi
386     fi
387 esac
388 AC_SUBST(dlopen_libs)
389
390 # (shm_open (for cache server)
391 AC_ARG_ENABLE([evas-cserve],
392    AC_HELP_STRING([--disable-evas-cserve],
393       [disable shared cache server support. @<:@default=enabled@:>@]),
394    [
395     if test "x${enableval}" = "xyes" ; then
396        want_evas_cserve="yes"
397     else
398        want_evas_cserve="no"
399     fi
400    ])
401 AC_MSG_CHECKING(whether to build shared cache server and support)
402 AC_MSG_RESULT(${want_evas_cserve})
403
404 if test "x${want_evas_cserve}" = "xyes" ; then
405    AC_MSG_CHECKING([whether shm_open() is present])
406    LIBS_save=${LIBS}
407    LIBS="${LIBS} -lrt"
408    AC_LINK_IFELSE(
409       [AC_LANG_PROGRAM(
410          [[
411 #include <sys/types.h>
412 #include <sys/mman.h>
413 #include <fcntl.h>
414          ]],
415          [[
416 int fd;
417 fd = shm_open("/", O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
418 shm_unlink("/");
419          ]])],
420       [want_evas_cserve="yes"],
421       [want_evas_cserve="no"])
422    LIBS=${LIBS_save}
423    AC_MSG_RESULT([${want_evas_cserve}])
424 fi
425
426 if test "x${want_evas_cserve}" = "xyes" ; then
427   AC_DEFINE(EVAS_CSERVE, 1, [Shared caceh server.])
428 fi
429
430 AM_CONDITIONAL([EVAS_CSERVE], [test "x${want_evas_cserve}" = "xyes"])
431
432
433
434 #######################################
435 ## GL force flavor gles
436 gl_flavor_gles="no"
437 AC_MSG_CHECKING(whether to build GLES flavor of GL)
438 AC_ARG_ENABLE(gl-flavor-gles,
439   AC_HELP_STRING([--enable-gl-flavor-gles], [enable gles falvor of gl instead of standard]),
440   [
441       if test "x$enableval" = "xyes" ; then
442         AC_MSG_RESULT(yes)
443         gl_flavor_gles="yes"
444       else
445         AC_MSG_RESULT(no)
446         gl_flavor_gles="no"
447       fi
448   ], [
449       AC_MSG_RESULT(no)
450       gl_flavor_gles="no"
451   ]
452 )
453
454 #######################################
455 ## GLES variety sgx
456 gles_variety_sgx="no"
457 AC_MSG_CHECKING(whether to build GLES variety for SGX)
458 AC_ARG_ENABLE(gles-variety-sgx,
459   AC_HELP_STRING([--enable-gles-variety-sgx], [GLES variety SGX 3D unit]),
460   [
461       if test "x$enableval" = "xyes" ; then
462         AC_MSG_RESULT(yes)
463         AC_DEFINE(GLES_VARIETY_SGX, 1, [Imagination SGX GLES2 support])
464         gles_variety_sgx="yes"
465       else
466         AC_MSG_RESULT(no)
467         gles_variety_sgx="no"
468       fi
469   ], [
470       AC_MSG_RESULT(no)
471       gles_variety_sgx="no"
472   ]
473 )
474
475 #######################################
476 ## GLES variety s3c6410
477 gles_variety_s3c6410="no"
478 AC_MSG_CHECKING(whether to build GLES variety for s3c6410)
479 AC_ARG_ENABLE(gles-variety-s3c6410,
480   AC_HELP_STRING([--enable-gles-variety-s3c6410], [GLES variety s3c6410 3D unit]),
481   [
482       if test "x$enableval" = "xyes" ; then
483         AC_MSG_RESULT(yes)
484         AC_DEFINE(GLES_VARIETY_S3C6410, 1, [Samsung S3c6410 GLES2 support])
485         gles_variety_s3c6410="yes"
486       else
487         AC_MSG_RESULT(no)
488         gles_variety_s3c6410="no"
489       fi
490   ], [
491       AC_MSG_RESULT(no)
492       gles_variety_s3c6410="no"
493   ]
494 )
495
496 #####################################################################
497 ## Engines
498
499 EVAS_CHECK_ENGINE([buffer], [${want_evas_engine_buffer}], [no], [Buffer])
500
501 EVAS_CHECK_ENGINE([software-xlib], [${want_evas_engine_software_xlib}], [yes], [Software Xlib])
502
503 EVAS_CHECK_ENGINE([xrender-x11], [${want_evas_engine_xrender_x11}], [yes], [XRender X11])
504
505 EVAS_CHECK_ENGINE([gl-x11], [${want_evas_engine_gl_x11}], [yes], [OpenGL X11])
506
507 # disable cairo engine for the release
508 #EVAS_CHECK_ENGINE([cairo-x11], [${want_evas_engine_cairo_x11}], [yes], [Cairo X11])
509
510 EVAS_CHECK_ENGINE([software-xcb], [${want_evas_engine_software_xcb}], [no], [Software XCB])
511
512 EVAS_CHECK_ENGINE([xrender-xcb], [${want_evas_engine_xrender_xcb}], [no], [XRender XCB])
513
514 EVAS_CHECK_ENGINE([software-gdi], [${want_evas_engine_software_gdi}], [no], [Software GDI])
515
516 EVAS_CHECK_ENGINE([software-ddraw], [${want_evas_engine_software_ddraw}], [no], [Software DirectDraw])
517
518 EVAS_CHECK_ENGINE([direct3d], [${want_evas_engine_direct3d}], [no], [Direct3D])
519
520 EVAS_CHECK_ENGINE([quartz], [${want_evas_engine_quartz}], [no], [Quartz])
521
522 EVAS_CHECK_ENGINE([gl-glew], [${want_evas_engine_gl_glew}], [no], [OpenGL Glew])
523
524 EVAS_CHECK_ENGINE([software-sdl], [${want_evas_engine_software_sdl}], [no], [Software SDL])
525
526 EVAS_CHECK_ENGINE([gl-sdl], [${want_evas_engine_gl_sdl}], [yes], [OpenGL SDL])
527
528 EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer])
529
530 EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB])
531
532 # disable cairo engine for the release
533 #EVAS_CHECK_ENGINE([software-qtopia], [${want_evas_engine_software_qtopia}], [no], [Qtopia])
534
535 EVAS_CHECK_ENGINE([software-16-x11], [${want_evas_engine_software_16_x11}], [yes], [Software X11 16 bits])
536
537 EVAS_CHECK_ENGINE([software-16-ddraw], [${want_evas_engine_software_16_ddraw}], [no], [Software DirectDraw 16 bits])
538
539 EVAS_CHECK_ENGINE([software-16-wince], [${want_evas_engine_software_16_wince}], [no], [Software Windows CE 16 bits])
540
541 # common cairo
542 #have_evas_engine_cairo_common="no"
543 #if test "x${have_evas_engine_cairo_x11}" = "xyes" ; then
544 #   have_evas_engine_cairo_common="yes"
545 #   AC_DEFINE([BUILD_ENGINE_CAIRO_COMMON], [1], [Generic Cairo Rendering Support])
546 #fi
547 #AM_CONDITIONAL([BUILD_ENGINE_CAIRO_COMMON], [test "x$have_evas_engine_cairo_common" = "xyes"])
548
549 # common gl
550 have_evas_engine_gl_common="no"
551 if test "x$have_evas_engine_gl_x11" = "xyes" \
552    || test "x$have_evas_engine_gl_x11" = "xstatic" \
553    || test "x$have_evas_engine_gl_glew" = "xyes" \
554    || test "x$have_evas_engine_gl_glew" = "xstatic" \
555    || test "x$have_evas_engine_gl_sdl" = "xyes" \
556    || test "x$have_evas_engine_gl_sdl" = "xstatic"; then
557    have_evas_engine_gl_common="yes"
558 fi
559
560 if test "x$have_evas_engine_gl_common" = "xyes"; then
561    evas_engine_gl_common_libs=""
562    AC_DEFINE(BUILD_ENGINE_GL_COMMON, [1], [Generic OpenGL Rendering Support])
563 fi
564
565 AC_SUBST([evas_engine_gl_common_libs])
566
567 AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, [test "x$have_evas_engine_gl_common" = "xyes"])
568
569 # gl_sdl
570 if test "x$have_evas_engine_gl_sdl" = "xyes" || test "x$have_evas_engine_gl_sdl" = "xstatic" ; then
571    AC_CHECK_DECL(SDL_GL_CONTEXT_MAJOR_VERSION,
572       [AC_DEFINE(HAVE_SDL_GL_CONTEXT_VERSION, [1], [SDL_GL version attributes present])],,
573       [#include <SDL/SDL_video.h>])
574 fi
575
576 if test "x$gl_flavor_gles" = "xyes"; then
577    AC_CHECK_DECL(SDL_OPENGLES,
578       [AC_DEFINE(HAVE_SDL_FLAG_OPENGLES, [1], [SDL_OPENGLES flag is present])],,
579       [#include <SDL/SDL_video.h>])
580 fi
581
582 # SDL primitive
583 sdl_primitive="no"
584
585 AC_ARG_ENABLE([sdl-primitive],
586    [AC_HELP_STRING([--enable-sdl-primitive], [])],
587    [sdl_primitive=${enableval}]
588 )
589 AC_MSG_CHECKING([whether to use SDL primitive when possible])
590 AC_MSG_RESULT([${sdl_primitive}])
591
592 if test "x${sdl_primitive}" = "xyes" ; then
593    AC_DEFINE([ENGINE_SDL_PRIMITIVE], [1], [Use SDL primitive when possible])
594 fi
595
596 # if software generic need to be build as part of libevas.so
597 have_static_software_generic="no"
598 AC_ARG_ENABLE([static-software-generic],
599    [AC_HELP_STRING([--enable-static-software-generic], [Build software generic engine as part of libevas])],
600    [have_static_software_generic=${enableval}]
601 )
602 AC_MSG_CHECKING([Whether to build software generic engine as part of libevas])
603 AC_MSG_RESULT([${have_static_software_generic}])
604
605 AM_CONDITIONAL(EVAS_STATIC_BUILD_SOFTWARE_GENERIC, test "x${have_static_software_generic}" = "xyes")
606 if test "x${have_static_software_generic}" = "xyes"; then
607    AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_GENERIC, [1], [Build software generic engine as part of libevas])
608 fi
609
610 # if software_xlib or software_xcb are available, define everything needed for X11
611 have_evas_engine_software_x11="no"
612 if test "x$have_evas_engine_software_xlib" = "xstatic" -o "x$have_evas_engine_software_xcb" = "xstatic" ; then
613    have_evas_engine_software_x11="static"
614 else
615    if test "x$have_evas_engine_software_xlib" = "xyes" -o "x$have_evas_engine_software_xcb" = "xyes" ; then
616       have_evas_engine_software_x11="yes"
617    fi
618 fi
619
620 if test "x$have_evas_engine_software_xlib" = "xstatic" ; then
621    have_evas_engine_software_xlib="yes"
622 fi
623
624 if test "x$have_evas_engine_software_xcb" = "xstatic" ; then
625    have_evas_engine_software_xcb="yes"
626 fi
627
628 if test "x$have_evas_engine_software_x11" = "xyes" -o "x$have_evas_engine_software_x11" = "xstatic" ; then
629    AC_DEFINE(BUILD_ENGINE_SOFTWARE_X11, [1], [Build software X11 engines])
630 fi
631
632 if test "x$have_evas_engine_software_x11" = "xstatic" ; then
633    AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_X11, [1], [Build software X11 engines as part of libevas])
634 fi
635
636 AM_CONDITIONAL([BUILD_ENGINE_SOFTWARE_X11], [test "x${have_evas_engine_software_x11}" = "xyes" -o "x${have_evas_engine_software_x11}" = "xstatic"])
637 AM_CONDITIONAL([EVAS_STATIC_BUILD_SOFTWARE_X11], [test "x${have_evas_engine_software_x11}" = "xstatic"])
638
639 AC_SUBST(have_evas_engine_software_xlib)
640 AC_SUBST(have_evas_engine_software_xcb)
641
642 # if software 16 x11 is enabled - build software_16 (the generic 16bit
643 # engine). later enable it fb_16 or other "16" bit engines are enabled.
644 have_evas_engine_software_16="no"
645 if test "x$have_evas_engine_software_16_x11" = "xyes" -o "x$have_evas_engine_software_16_x11" = "xstatic"; then
646    have_evas_engine_software_16="yes"
647 fi
648 if test "x$have_evas_engine_software_sdl" = "xyes" -o "x$have_evas_engine_software_sdl" = "xstatic"; then
649    have_evas_engine_software_16="yes"
650 fi
651 if test "x$have_evas_engine_software_16_ddraw" = "xyes" -o "x$have_evas_engine_software_16_ddraw" = "xstatic"; then
652    have_evas_engine_software_16="yes"
653 fi
654 if test "x$have_evas_engine_software_16_wince" = "xyes" -o "x$have_evas_engine_software_16_wince" = "xstatic"; then
655    have_evas_engine_software_16="yes"
656 fi
657 AM_CONDITIONAL(BUILD_ENGINE_SOFTWARE_16, test "x$have_evas_engine_software_16" = "xyes")
658
659 # if software 16 need to be build as part of libevas.so
660 have_static_software_16="no"
661 AC_ARG_ENABLE([static-software-16],
662    [AC_HELP_STRING([--enable-static-software-16], [Build software 16 engine as part of libevas])],
663    [have_static_software_16=${enableval}]
664 )
665 AC_MSG_CHECKING([Whether to build software 16 engine as part of libevas])
666 AC_MSG_RESULT([${have_static_software_16}])
667
668 AM_CONDITIONAL(EVAS_STATIC_BUILD_SOFTWARE_16, test "x${have_static_software_16}" = "xyes")
669 if test "x${have_static_software_16}" = "xyes"; then
670    AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_16, [1], [Build software 16 engine as part of libevas])
671 fi
672
673 #####################################################################
674 ## Image loaders
675
676 EVAS_CHECK_IMAGE_LOADER([Edb], [${want_evas_image_loader_edb}])
677
678 EVAS_CHECK_IMAGE_LOADER([Eet], [${want_evas_image_loader_eet}])
679 EVAS_CHECK_FONT_LOADER([${want_evas_font_loader_eet}])
680
681 EVAS_CHECK_IMAGE_LOADER([Gif], [${want_evas_image_loader_gif}])
682
683 have_evas_image_saver_jpeg="no"
684 EVAS_CHECK_IMAGE_LOADER([Jpeg], [${want_evas_image_loader_jpeg}])
685
686 dnl Windows has no sigsetjmp function, nor equivalent.
687 dnl So we disable the jpeg saver.
688 dnl TODO: must find a workaround
689 case "$host_os" in
690    mingw* | cegcc*)
691       ;;
692    *)
693       if test "x${have_evas_image_loader_jpeg}" = "xyes" ; then
694          have_evas_image_saver_jpeg="yes"
695       fi
696       ;;
697 esac
698 AM_CONDITIONAL([BUILD_SAVER_JPEG], [test "x${have_evas_image_saver_jpeg}" = "xyes"])
699
700 EVAS_CHECK_IMAGE_LOADER([PMAPS], [${want_evas_image_loader_pmaps}])
701
702 EVAS_CHECK_IMAGE_LOADER([PNG], [${want_evas_image_loader_png}])
703
704 EVAS_CHECK_IMAGE_LOADER([SVG], [${want_evas_image_loader_svg}])
705
706 EVAS_CHECK_IMAGE_LOADER([Tiff], [${want_evas_image_loader_tiff}])
707
708 EVAS_CHECK_IMAGE_LOADER([XPM], [${want_evas_image_loader_xpm}])
709
710 EVAS_CHECK_IMAGE_LOADER([BMP], [${want_evas_image_loader_bmp}])
711
712 EVAS_CHECK_IMAGE_LOADER([WBMP], [${want_evas_image_loader_wbmp}])
713
714 EVAS_CHECK_IMAGE_LOADER([TGA], [${want_evas_image_loader_tga}])
715
716
717 #####################################################################
718 ## Cpu based optimizations
719
720 #######################################
721 ## PTHREADS
722 pthread_cflags=""
723 pthread_libs=""
724 build_pthreads="no"
725 has_pthreads="no"
726 need_pthreads="no"
727 # basic pthread support
728 AC_CHECK_HEADER(pthread.h,
729   [
730    has_pthreads="yes"
731   ],
732   [
733    has_pthreads="no"
734   ]
735 )
736
737 # sched_getaffinity pthread_attr_setaffinity_np
738 AC_CHECK_HEADERS(pthread.h sched.h,
739       [
740         AC_CHECK_LIB(pthread, pthread_attr_setaffinity_np,
741           [
742             AC_CHECK_LIB(pthread, pthread_barrier_wait,
743               [ build_pthreads="yes" ],
744               [ build_pthreads="no" ]
745             )
746           ],
747           [ build_pthreads="no" ]
748         )
749       ],
750       [ build_pthreads="no" ]
751 )
752
753 #######################################
754 ## Pthread
755 AC_MSG_CHECKING(whether to build pthread code)
756 AC_ARG_ENABLE(pthreads,
757   AC_HELP_STRING([--enable-pthreads], [enable threaded rendering]),
758   [
759       if test "x$enableval" = "xyes" ; then
760         if test "x$build_pthreads" = "xyes"; then
761           AC_MSG_RESULT(yes)
762           AC_DEFINE(BUILD_PTHREAD, 1, [Build Threaded Rendering])
763           build_pthreads="yes"
764           need_pthreads="yes"
765         else
766           if "x$use_strict" = "xyes"; then
767             AC_MSG_ERROR(pthreads headers or functions not found (strict dependencies checking))
768           else
769             AC_MSG_RESULT(no: pthread headers or functions not found)
770           fi
771         fi
772       else
773         AC_MSG_RESULT(no)
774         build_pthreads="no"
775       fi
776   ],
777   [
778     AC_MSG_RESULT($build_pthreads)
779     if test "x$build_pthreads" = "xyes" ; then
780       AC_DEFINE(BUILD_PTHREAD, 1, [Build Threaded Rendering])
781       need_pthreads="yes"
782     fi
783   ]
784 )
785
786 #######################################
787 ## Pipe Renderer
788 build_pipe_render="no"
789 AC_MSG_CHECKING(whether to build Threaded Pipe Rendering support)
790 AC_ARG_ENABLE(pipe-render,
791   AC_HELP_STRING([--enable-pipe-render], [enable threaded pipe rendering support]),
792   [ build_pipe_render=$enableval ]
793 )
794 AC_MSG_RESULT($build_pipe_render)
795
796 AC_MSG_CHECKING(whether we can build Threaded Pipe Rendering support)
797 if test \( "x$build_pipe_render" = "xyes" -o "x$build_pipe_render" = "xauto" \); then
798   AC_MSG_RESULT(yes)
799   AC_DEFINE(BUILD_PIPE_RENDER, 1, [Build pipe render support])
800   build_pipe_render="yes"
801   need_pthreads="yes"
802 else
803   AC_MSG_RESULT(no)
804   build_pipe_render="no"
805 fi
806
807 #######################################
808 ## Async Renderer
809 build_async_render="no"
810 AC_MSG_CHECKING(whether to build Asynchronously Threaded Pipe Rendering support)
811 AC_ARG_ENABLE(async-render,
812   AC_HELP_STRING([--enable-async-render], [enable asynchronously threaded pipe rendering support]),
813   [ build_async_render=$enableval ]
814 )
815 AC_MSG_RESULT($build_async_render)
816
817 AC_MSG_CHECKING(whether we can build Asynchronously Threaded Pipe Rendering support)
818 if test \( "x$build_async_render" = "xyes" \); then
819   AC_MSG_RESULT(yes)
820   AC_DEFINE(EVAS_FRAME_QUEUING, 1, [Build async render support])
821   build_async_render="yes"
822   AC_DEFINE(BUILD_PIPE_RENDER, 1, [Build pipe render support])
823   build_pipe_render="yes"
824   need_pthreads="yes"
825
826   PKG_CHECK_MODULES([XEXT],
827      [xext < 1.1.1],
828      [ build_avoid_libXext_bug=yes ],
829      [ build_avoid_libXext_bug=no ]
830   )
831   if test \( "x$build_avoid_libXext_bug" = "xyes" \); then
832     AC_DEFINE(LIBXEXT_VERSION_LOW, 1, [To avoid bug on old libXext version])
833   fi
834 else
835   AC_MSG_RESULT(no)
836   build_async_render="no"
837 fi
838
839 #######################################
840 ## Async events
841 build_async_events="auto"
842 AC_MSG_CHECKING(whether to build Async Events support)
843 AC_ARG_ENABLE(async-events,
844   AC_HELP_STRING([--enable-async-events], [enable async events support]),
845   [ build_async_events=$enableval ]
846 )
847 AC_MSG_RESULT($build_async_events)
848
849 AC_MSG_CHECKING(whether we can build Async Events support)
850 if test "x$build_async_events" = "xyes" || test "x$build_async_events" = "xauto" ; then
851   AC_MSG_RESULT(yes)
852   AC_DEFINE(BUILD_ASYNC_EVENTS, 1, [Build async events support])
853   build_async_events="yes"
854 else
855   AC_MSG_RESULT(no)
856   build_async_events="no"
857 fi
858
859 #######################################
860 ## Async image preload
861 build_async_preload="auto"
862 AC_MSG_CHECKING(whether to build Async Image Preload support)
863 AC_ARG_ENABLE(async-preload,
864   AC_HELP_STRING([--enable-async-preload], [enable async image preloading support]),
865   [ build_async_preload=$enableval ]
866 )
867 AC_MSG_RESULT($build_async_preload)
868
869 AC_MSG_CHECKING(whether we can build Async Image Preload support)
870 if test \( "x$build_async_preload" = "xyes" -o "x$build_async_preload" = "xauto" \) -a "x$build_async_events" = "xyes"; then
871   AC_MSG_RESULT(yes)
872   AC_DEFINE(BUILD_ASYNC_PRELOAD, 1, [Build async image preload support])
873   build_async_preload="yes"
874   need_pthreads="yes"
875 else
876   AC_MSG_RESULT(no)
877   build_async_preload="no"
878 fi
879
880 #######################################
881 ## Link with pthread if needed
882 AC_MSG_CHECKING(whether we should link with pthread)
883 if test "x$need_pthreads" = "xyes"; then
884   AC_MSG_RESULT(yes)
885   pthread_cflags=""
886   pthread_libs="-lpthread"
887 else
888   AC_MSG_RESULT(no)
889 fi
890
891 #######################################
892 ## MMX
893 build_cpu_mmx="no"
894 case $host_cpu in
895   i*86)
896     build_cpu_mmx="yes"
897     ;;
898   x86_64)
899     build_cpu_mmx="yes"
900     ;;
901   amd64)
902     build_cpu_mmx="yes"
903     ;;
904 esac
905 AC_MSG_CHECKING(whether to build mmx code)
906 AC_ARG_ENABLE(cpu-mmx,
907   AC_HELP_STRING([--enable-cpu-mmx], [enable mmx code]),
908   [
909       if test "x$enableval" = "xyes" ; then
910         AC_MSG_RESULT(yes)
911         AC_DEFINE(BUILD_MMX, 1, [Build MMX Code])
912         build_cpu_mmx="yes"
913       else
914         AC_MSG_RESULT(no)
915         build_cpu_mmx="no"
916       fi
917   ],
918   [
919     AC_MSG_RESULT($build_cpu_mmx)
920     if test "x$build_cpu_mmx" = "xyes" ; then
921       AC_DEFINE(BUILD_MMX, 1, [Build MMX Code])
922     fi
923   ]
924 )
925
926 #######################################
927 ## SSE
928 build_cpu_sse="no"
929 case $host_cpu in
930   i*86)
931     build_cpu_sse="yes"
932     ;;
933   x86_64)
934     build_cpu_sse="yes"
935     ;;
936   amd64)
937     build_cpu_sse="yes"
938     ;;
939 esac
940 AC_MSG_CHECKING(whether to build sse code)
941 AC_ARG_ENABLE(cpu-sse,
942   AC_HELP_STRING([--enable-cpu-sse], [enable sse code]),
943   [
944       if test "x$enableval" = "xyes" ; then
945         AC_MSG_RESULT(yes)
946         AC_DEFINE(BUILD_SSE, 1, [Build SSE Code])
947         build_cpu_sse="yes"
948       else
949         AC_MSG_RESULT(no)
950         build_cpu_sse="no"
951       fi
952   ],
953   [
954     AC_MSG_RESULT($build_cpu_sse)
955     if test "x$build_cpu_sse" = "xyes" ; then
956       AC_DEFINE(BUILD_SSE, 1, [Build SSE Code])
957     fi
958   ]
959 )
960
961 #######################################
962 ## ALTIVEC
963 build_cpu_altivec="no"
964 case $host_cpu in
965   *power* | *ppc*)
966     build_cpu_altivec="auto"
967     ;;
968 esac
969 altivec_cflags=""
970 AC_MSG_CHECKING(whether to build altivec code)
971 AC_ARG_ENABLE(cpu-altivec,
972   AC_HELP_STRING([--enable-cpu-altivec], [enable altivec code]),
973   [ build_cpu_altivec=$enableval ],
974   [
975     if test ! "x$build_cpu_altivec" = "xauto"; then
976       build_cpu_altivec="no"
977     fi
978   ]
979 )
980 AC_MSG_RESULT($build_cpu_altivec)
981
982 if test "x$build_cpu_altivec" = "xyes"; then
983    AC_CHECK_HEADER(altivec.h,
984      [
985         AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
986         AC_DEFINE(HAVE_ALTIVEC_H, 1, [Have altivec.h header file])
987         build_cpu_altivec="yes"
988      ],
989      [
990        save_CFLAGS=$CFLAGS
991        save_CPPFLAGS=$CPPFLAGS
992        CFLAGS=$CFLAGS" -maltivec"
993        CPPFLAGS=$CPPFLAGS" -maltivec"
994        unset ac_cv_header_altivec_h
995        AC_CHECK_HEADER(altivec.h,
996          [
997             AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
998             AC_DEFINE(HAVE_ALTIVEC_H, 1, [Have altivec.h header file])
999             build_cpu_altivec="yes"
1000          ],
1001          [
1002             if test "x$build_cpu_altivec" = "xyes" -a "x$use_strict" = "xyes" ; then
1003               AC_MSG_ERROR(Altivec not found (strict dependencies checking))
1004             fi
1005             build_cpu_altivec="no"
1006          ]
1007        )
1008        CFLAGS=$save_CFLAGS
1009        CPPFLAGS=$save_CPPFLAGS
1010      ]
1011    )
1012 fi
1013
1014 if test "x$build_cpu_altivec" = "xyes"; then
1015    AC_MSG_CHECKING(whether to use altivec compiler flag)
1016    if test "x$GCC" = "xyes"; then
1017       if echo "int main(){return 0;}" | ${CPP} -faltivec - > /dev/null 2>&1; then
1018          altivec_cflags="-faltivec"
1019          AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
1020       elif echo "int main(){return 0;}" | ${CPP} -maltivec - > /dev/null 2>&1; then
1021          altivec_cflags="-maltivec"
1022          AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
1023       fi
1024    fi
1025   AC_MSG_RESULT($altivec_cflags)
1026    CFLAGS="$CFLAGS $altivec_cflags"
1027 fi
1028
1029 #######################################
1030 ## NEON
1031 build_cpu_neon="no"
1032 case $host_cpu in
1033   armv7*)
1034     build_cpu_neon="yes"
1035     ;;
1036 esac
1037 AC_MSG_CHECKING(whether to build neon code)
1038 AC_ARG_ENABLE(cpu-neon,
1039   AC_HELP_STRING([--enable-cpu-neon], [enable neon code]),
1040   [
1041       if test "x$enableval" = "xyes" ; then
1042         AC_MSG_RESULT(yes)
1043         AC_DEFINE(BUILD_NEON, 1, [Build NEON Code])
1044         build_cpu_neon="yes"
1045       else
1046         AC_MSG_RESULT(no)
1047         build_cpu_neon="no"
1048       fi
1049   ],
1050   [
1051     AC_MSG_RESULT($build_cpu_neon)
1052     if test "x$build_cpu_neon" = "xyes" ; then
1053       AC_DEFINE(BUILD_NEON, 1, [Build NEON Code])
1054     fi
1055   ]
1056 )
1057
1058 #######################################
1059 ## C
1060 build_cpu_c="yes"
1061 AC_MSG_CHECKING(whether to build c code)
1062 AC_ARG_ENABLE(cpu-c,
1063   AC_HELP_STRING([--enable-cpu-c], [enable C code]),
1064   [
1065       if test "x$enableval" = "xyes" ; then
1066         AC_MSG_RESULT(yes)
1067         AC_DEFINE(BUILD_C, 1, [Build plain C code])
1068         build_cpu_c="yes"
1069       else
1070         AC_MSG_RESULT(no)
1071         build_cpu_c="no"
1072       fi
1073   ], [
1074       AC_MSG_RESULT($build_cpu_c)
1075       if test "x$build_cpu_c" = "xyes" ; then
1076         AC_DEFINE(BUILD_C, 1, [Build plain C code])
1077       fi
1078   ]
1079 )
1080
1081 #######################################
1082 ## MAGIC_DEBUG
1083 want_evas_magic_debug="yes"
1084 AC_MSG_CHECKING(whether to check magic for evas object)
1085 AC_ARG_ENABLE(evas-magic-debug,
1086   AC_HELP_STRING(
1087     [--disable-evas-magic-debug],
1088     [disable MAGIC_DEBUG check when people pass in wrong object type. [[default=enabled]]]
1089   ),
1090   [ want_evas_magic_debug="$enableval" ]
1091 )
1092 AC_MSG_RESULT($want_evas_magic_debug)
1093
1094 AM_CONDITIONAL(EVAS_MAGIC_DEBUG, test "x$want_evas_magic_debug" = "xyes")
1095 if test "x$want_evas_magic_debug" = "xyes"; then
1096   AC_DEFINE(EVAS_MAGIC_DEBUG, 1, [complain when people pass in wrong object types etc.])
1097 fi
1098
1099
1100 #######################################
1101 ## Word Caching
1102 want_word_cache="no"
1103 AC_MSG_CHECKING(whether to enable caching of rendered words)
1104 AC_ARG_ENABLE(word-cache,
1105   AC_HELP_STRING(
1106     [--enable-word-cache],
1107     [Enable experimental word caching to speed up rendering [[default=disabled]]]
1108   ),
1109   [ want_word_cache="$enableval" ]
1110 )
1111 AC_MSG_RESULT($want_word_cache)
1112
1113 AM_CONDITIONAL(WORD_CACHE, test "x$want_word_cache" = "xyes")
1114 if test "x$want_word_cache" = "xyes"; then
1115   AC_DEFINE(WORD_CACHE, 1, [Experimental word caching to speed up text rendering.])
1116 fi
1117
1118 #######################################
1119 ## Metric Caching
1120 want_metric_cache="no"
1121 AC_MSG_CHECKING(whether to enable caching of rendered metrics)
1122 AC_ARG_ENABLE(metric-cache,
1123   AC_HELP_STRING(
1124     [--enable-metric-cache],
1125     [Enable experimental metric caching to speed up rendering [[default=disabled]]]
1126   ),
1127   [ want_metric_cache="$enableval" ]
1128 )
1129 AC_MSG_RESULT($want_metric_cache)
1130
1131 AM_CONDITIONAL(METRIC_CACHE, test "x$want_metric_cache" = "xyes")
1132 if test "x$want_metric_cache" = "xyes"; then
1133   AC_DEFINE(METRIC_CACHE, 1, [Experimental metric caching to speed up text rendering.])
1134 fi
1135
1136
1137
1138 #####################################################################
1139 ## ARGB engine options
1140
1141 #######################################
1142 ## Nearest sampling scaler
1143 EVAS_CHECK_SCALER([scale-sample], [sampling scaler], [scaler_sample="yes"], [scaler_sample="no"])
1144 ## Smooth super and sub sampling scaler
1145 EVAS_CHECK_SCALER([scale-smooth], [smooth scaler], [scaler_smooth="yes"], [scaler_smooth="no"])
1146
1147 #######################################
1148 ## YUV -> ARGB converter
1149 conv_yuv="no"
1150 conv_yuv="yes"
1151 AC_MSG_CHECKING(whether to build yuv converter code)
1152 AC_ARG_ENABLE(convert-yuv,
1153   AC_HELP_STRING([--enable-convert-yuv], [enable yuv converter code]),
1154   [
1155       if test "x$enableval" = "xyes" ; then
1156         AC_MSG_RESULT(yes)
1157         AC_DEFINE(BUILD_CONVERT_YUV, 1, [YUV Converter Support])
1158         conv_yuv="yes"
1159       else
1160         AC_MSG_RESULT(no)
1161         conv_yuv="no"
1162       fi
1163   ], [
1164       AC_MSG_RESULT($conv_yuv)
1165       if test "x$conv_yuv" = "xyes" ; then
1166         AC_DEFINE(BUILD_CONVERT_YUV, 1, [YUV Converter Support])
1167       fi
1168   ]
1169 )
1170
1171 #####################################################################
1172 ## Output rendering features
1173
1174 #######################################
1175 ## Small dither mask instead of big one (lower quality)
1176 EVAS_CHECK_DITHER([small-dither-mask], [small dither mask], [conv_small_dither="yes"], [conv_small_dither="no"])
1177 ## Alternate Line dither mask instead of big one (lower quality - but fastest)
1178 EVAS_CHECK_DITHER([line-dither-mask], [line dither mask], [conv_line_dither="yes"], [conv_line_dither="no"])
1179 ## No dither mask at all for 16bpp
1180 EVAS_CHECK_DITHER([no-dither-mask], [conversion to 16bpp without dither mask], [conv_no_dither="yes"], [conv_no_dither="no"])
1181
1182 #######################################
1183 ## Convert to 8bpp RGB 332
1184 EVAS_CONVERT_COLOR(8, RGB, 332, [yes])
1185 ## Convert to 8bpp RGB 666
1186 EVAS_CONVERT_COLOR(8, RGB, 666, [yes])
1187 ## Convert to 8bpp RGB 232
1188 EVAS_CONVERT_COLOR(8, RGB, 232, [yes])
1189 ## Convert to 8bpp RGB 222
1190 EVAS_CONVERT_COLOR(8, RGB, 222, [yes])
1191 ## Convert to 8bpp RGB 221
1192 EVAS_CONVERT_COLOR(8, RGB, 221, [yes])
1193 ## Convert to 8bpp RGB 121
1194 EVAS_CONVERT_COLOR(8, RGB, 121, [yes])
1195 ## Convert to 8bpp RGB 111
1196 EVAS_CONVERT_COLOR(8, RGB, 111, [yes])
1197 ## Convert to 16bpp RGB 565
1198 EVAS_CONVERT_COLOR(16, RGB, 565)
1199 ## Convert to 16bpp BGR 565
1200 EVAS_CONVERT_COLOR(16, BGR, 565)
1201 ## Convert to 16bpp RGB 555
1202 EVAS_CONVERT_COLOR(16, RGB, 555)
1203 ## Convert to 16bpp RGB 444
1204 EVAS_CONVERT_COLOR(16, RGB, 444)
1205
1206 #######################################
1207 ## Convert to 16bpp RGB 565 (444 ipaq)
1208 conv_16_rgb_ipq="yes"
1209 AC_MSG_CHECKING(whether to build 16bpp 565 (444 ipaq) converter code)
1210 AC_ARG_ENABLE(convert-16-rgb-ipq,
1211   AC_HELP_STRING([--disable-convert-16-rgb-ipq], [disable 16bpp 565 (444 ipaq) converter code]),
1212   [
1213       if test "x$enableval" = "xyes" ; then
1214         AC_DEFINE(BUILD_CONVERT_16_RGB_454645, 1, [16bpp 565 (444 ipaq) Converter Support])
1215         conv_16_rgb_ipq="yes"
1216       else
1217         conv_16_rgb_ipq="no"
1218       fi
1219   ], [
1220       if test "x$conv_16_rgb_ipq" = "xyes" ; then
1221         AC_DEFINE(BUILD_CONVERT_16_RGB_454645, 1, [16bpp 565 (444 ipaq) Converter Support])
1222       fi
1223   ]
1224 )
1225 AC_MSG_RESULT($conv_16_rgb_ipq)
1226
1227 #######################################
1228 ## Convert to 16bpp RGB with rotation of 0
1229 EVAS_CONVERT_ROT(16, RGB, 0)
1230 ## Convert to 16bpp RGB with rotation of 180
1231 EVAS_CONVERT_ROT(16, RGB, 180)
1232 ## Convert to 16bpp RGB with rotation of 270
1233 EVAS_CONVERT_ROT(16, RGB, 270)
1234 ## Convert to 16bpp RGB with rotation of 90
1235 EVAS_CONVERT_ROT(16, RGB, 90)
1236
1237 #######################################
1238 ## Convert to 24bpp RGB 888
1239 EVAS_CONVERT_COLOR(24, RGB, 888)
1240 ## Convert to 24bpp BGR 888
1241 EVAS_CONVERT_COLOR(24, BGR, 888)
1242 ## Convert to 32bpp RGB 8888
1243 EVAS_CONVERT_COLOR(32, RGB, 8888)
1244 ## Convert to 32bpp RGBX 8888
1245 EVAS_CONVERT_COLOR(32, RGBX, 8888)
1246 ## Convert to 32bpp BGR 8888
1247 EVAS_CONVERT_COLOR(32, BGR, 8888)
1248 ## Convert to 32bpp BGRX 8888
1249 EVAS_CONVERT_COLOR(32, BGRX, 8888)
1250
1251 #######################################
1252 ## Convert to 24bpp RGB 666 (666 ezx)
1253 conv_24_rgb_ezx="yes"
1254 AC_MSG_CHECKING(whether to build 24bpp 666 (666 ezx) converter code)
1255 AC_ARG_ENABLE(convert-24-rgb-ezx,
1256   AC_HELP_STRING([--disable-convert-24-rgb-ezx], [disable 24bpp 666 (666 ezx) converter code]),
1257   [
1258       if test "x$enableval" = "xyes" ; then
1259         AC_DEFINE(BUILD_CONVERT_24_RGB_666, 1, [24bpp 666 (666 ezx) Converter Support])
1260         conv_24_rgb_ezx="yes"
1261       else
1262         conv_24_rgb_ezx="no"
1263       fi
1264   ], [
1265       if test "x$conv_24_rgb_ezx" = "xyes" ; then
1266         AC_DEFINE(BUILD_CONVERT_24_RGB_666, 1, [24bpp 666 (666 ezx) Converter Support])
1267       fi
1268   ]
1269 )
1270 AC_MSG_RESULT($conv_24_rgb_ezx)
1271
1272 #######################################
1273 ## Convert to 32bpp RGB 666 (666 ezx)
1274 conv_32_rgb_ezx="yes"
1275 AC_MSG_CHECKING(whether to build 32bpp 666 (666 ezx) converter code)
1276 AC_ARG_ENABLE(convert-32-rgb-ezx,
1277   AC_HELP_STRING([--disable-convert-32-rgb-ezx], [disable 32bpp 666 (666 ezx) converter code]),
1278   [
1279       if test "x$enableval" = "xyes" ; then
1280         AC_DEFINE(BUILD_CONVERT_32_RGB_666, 1, [32bpp 666 (666 ezx) Converter Support])
1281         conv_32_rgb_ezx="yes"
1282       else
1283         conv_32_rgb_ezx="no"
1284       fi
1285   ], [
1286       if test "x$conv_32_rgb_ezx" = "xyes" ; then
1287         AC_DEFINE(BUILD_CONVERT_32_RGB_666, 1, [32bpp 666 (666 ezx) Converter Support])
1288       fi
1289   ]
1290 )
1291 AC_MSG_RESULT($conv_32_rgb_ezx)
1292
1293 #######################################
1294 ## Convert to 32bpp RGB with rotation of 0
1295 EVAS_CONVERT_ROT(32, RGB, 0)
1296 ## Convert to 32bpp RGB with rotation of 180
1297 EVAS_CONVERT_ROT(32, RGB, 180)
1298 ## Convert to 32bpp RGB with rotation of 270
1299 EVAS_CONVERT_ROT(32, RGB, 270)
1300 ## Convert to 32bpp RGB with rotation of 90
1301 EVAS_CONVERT_ROT(32, RGB, 90)
1302
1303 #######################################
1304 ## Convert to 8bpp grayscale with 256 value, no palette
1305 EVAS_CONVERT_COLOR(8, GRY, 1)
1306 ## Convert to 8bpp grayscale with 16 value, no palette
1307 EVAS_CONVERT_COLOR(8, GRY, 16)
1308
1309 #######################################
1310 ## Convert to 8bpp grayscale, 64-palette
1311 conv_8_grayscale_64="yes"
1312 AC_MSG_CHECKING(whether to build 8bpp grayscale 64-palette converter code)
1313 AC_ARG_ENABLE(convert-8-grayscale-64,
1314   AC_HELP_STRING([--disable-convert-8-grayscale-64], [disable 8bpp grayscale 64-palette converter code]),
1315   [
1316      if test "x$enableval" = "xyes"; then
1317        AC_DEFINE(BUILD_CONVERT_8_GRAYSCALE_64, 1, [8bpp Grayscale 64-palette Converter Support])
1318        conv_8_grayscale_64="yes"
1319      else
1320        conv_8_grayscale_64="no"
1321      fi
1322   ], [
1323      if test "x$conv_8_grayscale_64" = "xyes"; then
1324        AC_DEFINE(BUILD_CONVERT_8_GRAYSCALE_64, 1, [32bpp Grayscale 64-palette Converter Support])
1325      fi
1326   ]
1327 )
1328 AC_MSG_RESULT($conv_8_grayscale_64)
1329
1330 ## valgrind
1331 want_valgrind="no"
1332 have_valgrind="no"
1333
1334 AC_MSG_CHECKING(whether to enable build with valgrind)
1335 AC_ARG_ENABLE(valgrind,
1336   AC_HELP_STRING([--enable-valgrind], [enable valgrind fixes to stop false reports]),
1337   [ want_valgrind=$enableval ]
1338 )
1339 AC_MSG_RESULT($want_valgrind)
1340
1341 if test x$want_valgrind = "xyes"; then
1342   PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
1343     [
1344       AC_DEFINE(HAVE_VALGRIND, 1, [Valgrind support])
1345       have_valgrind=yes
1346       requirement_evas="valgrind ${requirement_evas}"
1347     ],
1348     [
1349       if test "x$want_valgrind" = "xyes" -a "x$use_strict" = "xyes" ; then
1350         AC_MSG_ERROR([Valgrind not found (strict dependencies checking)])
1351       fi
1352     ]
1353   )
1354 fi
1355
1356 ## Examples
1357
1358 install_examples="yes"
1359 AC_ARG_ENABLE([install-examples],
1360    AC_HELP_STRING([--disable-install-examples],
1361                   [disable installing examples (compiled or just source).
1362                    @<:@default==enabled@:>@]),
1363    [
1364     if test "x${enableval}" = "xyes" ; then
1365        install_examples="yes"
1366     else
1367        install_examples="no"
1368     fi
1369    ],
1370    [install_examples="yes"])
1371 AM_CONDITIONAL([INSTALL_EXAMPLES], [test "x${install_examples}" = "xyes"])
1372
1373 build_examples="no"
1374 AC_ARG_ENABLE([build-examples],
1375    AC_HELP_STRING([--enable-build-examples],
1376                   [enable building examples. @<:@default==disabled@:>@]),
1377    [
1378     if test "x${enableval}" = "xyes" ; then
1379        build_examples="yes"
1380     else
1381        build_examples="no"
1382     fi
1383    ],
1384    [build_examples="no"])
1385 AM_CONDITIONAL([BUILD_EXAMPLES], [test "x${build_examples}" = "xyes"])
1386
1387
1388 #####################################################################
1389 ## Fill in flags
1390
1391 AC_SUBST(altivec_cflags)
1392 AC_SUBST(pthread_cflags)
1393 AC_SUBST(pthread_libs)
1394 AC_SUBST(requirement_evas)
1395
1396
1397 #####################################################################
1398 ## Output
1399
1400 AC_OUTPUT([
1401 Makefile
1402 evas-directfb.pc
1403 evas-fb.pc
1404 evas-opengl-glew.pc
1405 evas-opengl-x11.pc
1406 evas-opengl-sdl.pc
1407 evas-quartz.pc
1408 evas-software-buffer.pc
1409 evas-software-x11.pc
1410 evas-software-16-x11.pc
1411 evas-xrender-x11.pc
1412 evas-xrender-xcb.pc
1413 evas-software-gdi.pc
1414 evas-software-ddraw.pc
1415 evas-software-16-ddraw.pc
1416 evas-direct3d.pc
1417 evas-software-16-wince.pc
1418 evas-software-sdl.pc
1419 evas.pc
1420 doc/evas.dox
1421 doc/Makefile
1422 src/Makefile
1423 src/bin/Makefile
1424 src/lib/Makefile
1425 src/lib/canvas/Makefile
1426 src/lib/file/Makefile
1427 src/lib/imaging/Makefile
1428 src/lib/cache/Makefile
1429 src/lib/cserve/Makefile
1430 src/lib/engines/Makefile
1431 src/lib/engines/common/Makefile
1432 src/lib/engines/common/evas_op_add/Makefile
1433 src/lib/engines/common/evas_op_blend/Makefile
1434 src/lib/engines/common/evas_op_copy/Makefile
1435 src/lib/engines/common/evas_op_mask/Makefile
1436 src/lib/engines/common/evas_op_mul/Makefile
1437 src/lib/engines/common/evas_op_sub/Makefile
1438 src/lib/engines/common_16/Makefile
1439 src/modules/Makefile
1440 src/modules/engines/Makefile
1441 src/modules/engines/software_generic/Makefile
1442 src/modules/engines/software_gdi/Makefile
1443 src/modules/engines/software_ddraw/Makefile
1444 src/modules/engines/direct3d/Makefile
1445 src/modules/engines/software_16_wince/Makefile
1446 src/modules/engines/software_x11/Makefile
1447 src/modules/engines/fb/Makefile
1448 src/modules/engines/buffer/Makefile
1449 src/modules/engines/directfb/Makefile
1450 src/modules/engines/gl_common/Makefile
1451 src/modules/engines/gl_glew/Makefile
1452 src/modules/engines/gl_x11/Makefile
1453 src/modules/engines/gl_sdl/Makefile
1454 src/modules/engines/quartz/Makefile
1455 src/modules/engines/xrender_x11/Makefile
1456 src/modules/engines/software_sdl/Makefile
1457 src/modules/engines/software_16/Makefile
1458 src/modules/engines/software_16_x11/Makefile
1459 src/modules/engines/software_16_ddraw/Makefile
1460 src/modules/engines/software_16_sdl/Makefile
1461 src/modules/loaders/Makefile
1462 src/modules/loaders/edb/Makefile
1463 src/modules/loaders/eet/Makefile
1464 src/modules/loaders/gif/Makefile
1465 src/modules/loaders/jpeg/Makefile
1466 src/modules/loaders/png/Makefile
1467 src/modules/loaders/tiff/Makefile
1468 src/modules/loaders/xpm/Makefile
1469 src/modules/loaders/bmp/Makefile
1470 src/modules/loaders/wbmp/Makefile
1471 src/modules/loaders/tga/Makefile
1472 src/modules/loaders/svg/Makefile
1473 src/modules/loaders/pmaps/Makefile
1474 src/modules/savers/Makefile
1475 src/modules/savers/edb/Makefile
1476 src/modules/savers/eet/Makefile
1477 src/modules/savers/jpeg/Makefile
1478 src/modules/savers/png/Makefile
1479 src/modules/savers/tiff/Makefile
1480 src/lib/include/Makefile
1481 src/examples/Makefile
1482 README
1483 evas.spec
1484 ])
1485
1486 #disabled for the release:
1487 # evas-cairo-x11.pc
1488 # evas-software-qtopia.pc
1489 # src/modules/engines/cairo_common/Makefile
1490 # src/modules/engines/cairo_x11/Makefile
1491 # src/modules/engines/software_qtopia/Makefile
1492
1493
1494 #####################################################################
1495 ## Info
1496
1497 echo
1498 echo
1499 echo
1500 echo "------------------------------------------------------------------------"
1501 echo "$PACKAGE $VERSION"
1502 echo "------------------------------------------------------------------------"
1503 echo
1504 echo "Configuration Options Summary:"
1505 echo
1506 echo "Engines:"
1507 echo "  Software Memory Buffer.....: $have_evas_engine_buffer"
1508 echo "  Software X11...............: $have_evas_engine_software_x11 (Xlib: $have_evas_engine_software_xlib) (XCB: $have_evas_engine_software_xcb)"
1509 echo "  XRender X11................: $have_evas_engine_xrender_x11 (XCB: $have_evas_engine_xrender_xcb)"
1510 echo $ECHO_N "  OpenGL X11.................: $have_evas_engine_gl_x11 $ECHO_C"
1511 if test "x$have_evas_engine_gl_x11" = "xyes"; then
1512    echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
1513 else
1514    echo
1515 fi
1516 #echo "  Cairo X11..................: $have_evas_engine_cairo_x11"
1517 echo "  Software GDI...............: $have_evas_engine_software_gdi"
1518 echo "  Software DirectDraw........: $have_evas_engine_software_ddraw"
1519 echo "  Direct3d...................: $have_evas_engine_direct3d"
1520 echo "  Quartz.....................: $have_evas_engine_quartz"
1521 echo "  OpenGL Glew................: $have_evas_engine_gl_glew"
1522 echo "  Software SDL...............: $have_evas_engine_software_sdl (primitive: $sdl_primitive)"
1523 echo $ECHO_N "  OpenGL SDL.................: $have_evas_engine_gl_sdl $ECHO_C"
1524 if test "x$have_evas_engine_gl_sdl" = "xyes"; then
1525    echo "(GLES: $gl_flavor_gles) (SGX: $gles_variety_sgx) (s3c6410: $gles_variety_s3c6410)"
1526 else
1527    echo
1528 fi
1529 echo "  Software Framebuffer.......: $have_evas_engine_fb"
1530 echo "  DirectFB...................: $have_evas_engine_directfb"
1531 #echo "  Software Qtopia............: $have_evas_engine_software_qtopia"
1532 echo "  Software 16bit ............: $have_evas_engine_software_16"
1533 echo "  Software 16bit X11.........: $have_evas_engine_software_16_x11"
1534 echo "  Software 16bit Directdraw..: $have_evas_engine_software_16_ddraw"
1535 echo "  Software 16bit WinCE.......: $have_evas_engine_software_16_wince"
1536 echo "  Software 16bit SDL.........: $have_evas_engine_software_sdl (primitive: $sdl_primitive)"
1537 # FIXME: opengl engine needs to be fixed and tested lots for all drivers
1538 echo
1539 echo "Image Loaders:"
1540 echo "  EDB.....................: $have_evas_image_loader_edb"
1541 echo "  EET.....................: $have_evas_image_loader_eet"
1542 echo "  GIF.....................: $have_evas_image_loader_gif"
1543 echo "  JPEG....................: $have_evas_image_loader_jpeg (region: $have_jpeg_region)"
1544 echo "  PMAPS...................: $have_evas_image_loader_pmaps"
1545 echo "  PNG.....................: $have_evas_image_loader_png"
1546 echo "  SVG.....................: $have_evas_image_loader_svg"
1547 echo "  TIFF....................: $have_evas_image_loader_tiff"
1548 echo "  XPM.....................: $have_evas_image_loader_xpm"
1549 echo "  BMP.....................: $have_evas_image_loader_bmp"
1550 echo "  WBMP....................: $have_evas_image_loader_wbmp"
1551 # FIXME: need to add modular image loader system
1552 # FIXME: add more image loader modules
1553 echo
1554 echo "Font Sourcing Systems:"
1555 echo "  EET.....................: $have_evas_font_loader_eet"
1556 echo
1557 echo "Font Searching Systems:"
1558 echo "  Fontconfig..............: $have_fontconfig"
1559 echo "  Fribidi.................: $have_fribidi"
1560 # FIXME: add non freetype2 font engine support
1561 # FIXME: make freetype2 optional
1562 echo
1563 echo "CPU Specific Extensions:"
1564 echo "  Fallback C Code.........: $build_cpu_c"
1565 echo "  MMX.....................: $build_cpu_mmx"
1566 echo "  SSE.....................: $build_cpu_sse"
1567 echo "  ALTIVEC.................: $build_cpu_altivec"
1568 echo "  NEON....................: $build_cpu_neon"
1569 echo "  Thread Support..........: $build_pthreads"
1570 echo
1571 echo "Features:"
1572 echo "  MAGIC_DEBUG.............: $want_evas_magic_debug"
1573 echo "  Cache Server............: $want_evas_cserve"
1574 echo
1575 echo "  Threaded Pipe Rendering.: $build_pipe_render"
1576 echo "  Async Pipe Rendering....: $build_async_render"
1577 echo "  Async Events............: $build_async_events"
1578 echo "  Async Image Preload.....: $build_async_preload"
1579 echo
1580 echo "  Word Cache..............: $want_word_cache"
1581 echo "  Metric Cache............: $want_metric_cache"
1582 echo
1583 echo "ARGB Software Engine Options:"
1584 echo "  Sampling Scaler.........: $scaler_sample"
1585 echo "  Smooth Scaler...........: $scaler_smooth"
1586 # FIXME: add an mmx scaler routine
1587 echo "  YUV Converter...........: $conv_yuv"
1588 # FIXME: add more YUV format and colorvariant support
1589 echo
1590 echo "ARGB Conversion Options:"
1591 echo "  Smaller Dither Mask.....: $conv_small_dither"
1592 echo "  Line Dither Mask........: $conv_line_dither"
1593 echo "  No Dither Mask for 16bpp: $conv_no_dither"
1594 echo "  8bpp RGB 332............: $conv_8_rgb_332"
1595 echo "  8bpp RGB 666............: $conv_8_rgb_666"
1596 echo "  8bpp RGB 232............: $conv_8_rgb_232"
1597 echo "  8bpp RGB 222............: $conv_8_rgb_222"
1598 echo "  8bpp RGB 221............: $conv_8_rgb_221"
1599 echo "  8bpp RGB 121............: $conv_8_rgb_121"
1600 echo "  8bpp RGB 111............: $conv_8_rgb_111"
1601 echo "  8bpp Grayscale (256)....: $conv_8_gry_1"
1602 echo "  8bpp Grayscale (16).....: $conv_8_gry_16"
1603 echo "  8bpp Grayscale 64-pal...: $conv_8_grayscale_64"
1604 # FIXME: add grayscale and B&W support
1605 echo "  16bpp RGB 565...........: $conv_16_rgb_565"
1606 echo "  16bpp BGR 565...........: $conv_16_bgr_565"
1607 echo "  16bpp RGB 555...........: $conv_16_rgb_555"
1608 echo "  16bpp RGB 444...........: $conv_16_rgb_444"
1609 echo "  16bpp RGB 565 (444 ipaq): $conv_16_rgb_ipq"
1610 # FIXME: add 555 (444 ipaq) support
1611 # FIXME: add 30bpp support
1612 # FIXME: add palletted support
1613 # FIXME: add 8bpp and below rotation
1614 echo "  16bpp Rotation 0........: $conv_16_rgb_rot_0"
1615 echo "  16bpp Rotation 90.......: $conv_16_rgb_rot_90"
1616 echo "  16bpp Rotation 180......: $conv_16_rgb_rot_180"
1617 echo "  16bpp Rotation 270......: $conv_16_rgb_rot_270"
1618 echo "  24bpp RGB 888...........: $conv_24_rgb_888"
1619 echo "  24bpp BGR 888...........: $conv_24_bgr_888"
1620 echo "  24bpp RGB 666 (666 ezx).: $conv_24_rgb_ezx"
1621 # FIXME: add 24bpp rotation
1622 echo "  32bpp RGB 8888..........: $conv_32_rgb_8888"
1623 echo "  32bpp RGBX 8888.........: $conv_32_rgbx_8888"
1624 echo "  32bpp BGR 8888..........: $conv_32_bgr_8888"
1625 echo "  32bpp BGRX 8888.........: $conv_32_bgrx_8888"
1626 echo "  32bpp RGB 666 (666 ezx).: $conv_32_rgb_ezx"
1627 echo "  32bpp Rotation 0........: $conv_32_rgb_rot_0"
1628 echo "  32bpp Rotation 90.......: $conv_32_rgb_rot_90"
1629 echo "  32bpp Rotation 180......: $conv_32_rgb_rot_180"
1630 echo "  32bpp Rotation 270......: $conv_32_rgb_rot_270"
1631 echo
1632 echo "Documentation.............: ${build_doc}"
1633 echo "Examples..................: install:${install_examples} build:${build_examples}"
1634 echo
1635 echo "Compilation............: make (or gmake)"
1636 echo "  CPPFLAGS.............: $CPPFLAGS"
1637 echo "  CFLAGS...............: $CFLAGS"
1638 echo "  CXXFLAGS.............: $CXXFLAGS"
1639 echo "  LDFLAGS..............: $LDFLAGS"
1640 echo
1641 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
1642 echo "  prefix...............: $prefix"
1643 echo
1644 if test "x${have_static_module}" = "xyes" ; then
1645 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Evas."
1646 echo "         You must know what you are doing, or else you will have a lot of problems."
1647 echo "         And Kenny will be killed."
1648 echo "         Think about that."
1649 echo
1650 fi