quick - evas scalecache put this in svn do i dont lose my patch. i'll revert
[framework/uifw/evas.git] / configure.ac
1 # get rid of that stupid cache mechanism
2 rm -f config.cache
3
4 AC_INIT(evas, 0.9.9.050, enlightenment-devel@lists.sourceforge.net)
5 AC_PREREQ(2.52)
6 AC_CONFIG_SRCDIR(configure.ac)
7 AC_CANONICAL_BUILD
8 AC_CANONICAL_HOST
9 AC_ISC_POSIX
10
11 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
12 AM_CONFIG_HEADER(config.h)
13
14 AC_PROG_CXX
15 AC_PROG_CC
16 AM_PROG_CC_STDC
17 AC_HEADER_STDC
18 AC_C_BIGENDIAN
19 AC_C_CONST
20
21 AC_LIBTOOL_WIN32_DLL
22 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
23 AC_PROG_LIBTOOL
24
25 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
26 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
27 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
28 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
29 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
30 AC_SUBST(version_info)
31
32
33 want_evas_engine_buffer="yes"
34 want_evas_engine_software_x11="no"
35 want_evas_engine_xrender_x11="no"
36 want_evas_engine_gl_x11="no"
37 want_evas_engine_glitz_x11="no"
38 want_evas_engine_cairo_x11="no"
39 want_evas_engine_software_xcb="no"
40 want_evas_engine_xrender_xcb="no"
41 want_evas_engine_software_ddraw="no"
42 want_evas_engine_direct3d="no"
43 want_evas_engine_quartz="no"
44 want_evas_engine_gl_glew="no"
45 want_evas_engine_software_sdl="no"
46 want_evas_engine_fb="no"
47 want_evas_engine_directfb="no"
48 want_evas_engine_software_qtopia="no"
49 want_evas_engine_software_16_x11="no"
50 want_evas_engine_software_16_ddraw="no"
51 want_evas_engine_software_16_wince="no"
52
53 want_evas_image_loader_edb="yes"
54 want_evas_image_loader_eet="yes"
55 want_evas_image_loader_gif="yes"
56 want_evas_image_loader_jpeg="yes"
57 want_evas_image_loader_pmaps="yes"
58 want_evas_image_loader_png="yes"
59 want_evas_image_loader_svg="yes"
60 want_evas_image_loader_tiff="yes"
61 want_evas_image_loader_xpm="yes"
62
63 want_evas_font_loader_eet="yes"
64
65 case "$host_os" in
66    mingw32ce* | cegcc*)
67       want_evas_engine_software_16_wince="yes"
68       want_evas_image_loader_edb="no"
69       want_evas_image_loader_gif="no"
70       want_evas_image_loader_svg="no"
71       want_evas_image_loader_tiff="no"
72       ;;
73    mingw*)
74       want_evas_engine_software_ddraw="yes"
75       want_evas_engine_direct3d="auto"
76       want_evas_engine_software_16_ddraw="yes"
77       want_evas_image_loader_edb="no"
78       want_evas_image_loader_svg="no"
79       ;;
80    *)
81       want_evas_engine_software_x11="auto"
82       want_evas_engine_xrender_x11="auto"
83       want_evas_engine_software_16_x11="auto"
84       ;;
85 esac
86
87 LT_PROG_RC
88 AC_FUNC_ALLOCA
89
90 MODULE_ARCH="$host_os-$host_cpu"
91 AC_SUBST(MODULE_ARCH)
92 AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
93
94 PKG_PROG_PKG_CONFIG
95
96 WIN32_CPPFLAGS=""
97 WIN32_CFLAGS=""
98 lt_enable_auto_import=""
99 case "$host_os" in
100         mingw*|cegcc*)
101                 PKG_CHECK_MODULES(EVIL, evil)
102                 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
103                 dnl needed for correct definition of EAPI
104                 AC_DEFINE(EFL_EVAS_BUILD, 1, [Define to mention that evas is built])
105                 if test "$host_os" = "cegcc" ; then
106                         WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
107                         WIN32_CFLAGS="-mwin32"
108                         lt_enable_auto_import="-Wl,--enable-auto-import"
109                 fi
110                 if test "$host_os" = "mingw32ce" ; then
111                         WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
112                 fi
113                 ;;
114 esac
115 AC_SUBST(WIN32_CPPFLAGS)
116 AC_SUBST(WIN32_CFLAGS)
117 AC_SUBST(lt_enable_auto_import)
118
119
120 dnl when used, that option makes configure script fails when
121 dnl a requirement is selected, but not met.
122 AC_ARG_ENABLE(strict,
123   AC_HELP_STRING(
124     [enable strict mode]),
125   [use_strict="yes"],
126   [use_strict="no"]
127 )
128
129 #####################################################################
130 # Check evas strong dependencie
131
132 PKG_CHECK_MODULES([EINA], [eina-0])
133
134 PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 9.3.0])
135
136 #######################################
137 ## Simple X11 build/link
138
139 AC_ARG_ENABLE(simple-x11,
140   AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking]),
141   [ want_evas_simple_x11=$enableval ]
142 )
143
144 #######################################
145 ## FontConfig
146
147 want_fontconfig="auto"
148 have_fontconfig="no"
149 AC_ARG_ENABLE(fontconfig,
150   AC_HELP_STRING(
151     [--disable-fontconfig],
152     [disable fontconfig for finding fonts. [[default=enabled]]]
153   ),
154   [ want_fontconfig=$enableval ]
155 )
156
157 if test "x$want_fontconfig" = "xyes" -o "x$want_fontconfig" = "xauto" ; then
158   # Check if really available
159   PKG_CHECK_MODULES(FONTCONFIG, fontconfig,
160     [
161       have_fontconfig="yes"
162       AC_DEFINE(HAVE_FONTCONFIG, 1, [have fontconfig searching capabilities])
163     ],
164     [
165       if test "x$want_fontconfig" = "xyes" -a "x$use_strict" = "xyes" ; then
166         AC_MSG_ERROR([Fontconfig not found (strict dependencies checking)])
167       fi
168     ])
169 fi
170
171 ###############
172 ## dlopen
173
174 dlopen_libs=""
175 case "$host_os" in
176   mingw32ce* | cegcc*)
177 dnl managed by evil
178     AC_DEFINE(HAVE_DLADDR)
179   ;;
180   mingw*)
181 dnl nothing on mingw platform
182   ;;
183   *)
184     AC_CHECK_FUNCS(dlopen, res=yes, res=no)
185     if test "x$res" = "xyes"; then
186       AC_CHECK_FUNCS(dladdr, AC_DEFINE(HAVE_DLADDR))
187     else
188       AC_CHECK_LIB(dl, dlopen, res=yes, res=no)
189       if test "x$res" = "xyes"; then
190         AC_CHECK_LIB(dl, dladdr, AC_DEFINE(HAVE_DLADDR))
191         dlopen_libs=-ldl
192       else
193         AC_MSG_ERROR(Cannot find dlopen)
194       fi
195     fi
196 esac
197 AC_SUBST(dlopen_libs)
198
199 AC_CHECK_HEADER([fnmatch.h],
200    [dummy="yes"],
201    [AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file])])
202
203 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
204 if test "x$res" = "xno"; then
205    AC_SEARCH_LIBS([fnmatch],
206       [fnmatch evil iberty],
207       [res="yes"],
208       [res="no"])
209    if test "x$res" = "xno"; then
210       AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
211    fi
212 fi
213
214 #####################################################################
215 ## Engines
216
217 EVAS_CHECK_ENGINE([buffer], [${want_evas_engine_buffer}], [no], [Buffer])
218
219 EVAS_CHECK_ENGINE([software-x11], [${want_evas_engine_software_x11}], [yes], [Software X11])
220
221 EVAS_CHECK_ENGINE([xrender-x11], [${want_evas_engine_xrender_x11}], [yes], [XRender X11])
222
223 EVAS_CHECK_ENGINE([gl-x11], [${want_evas_engine_gl_x11}], [yes], [OpenGL X11])
224
225 EVAS_CHECK_ENGINE([glitz-x11], [${want_evas_engine_glitz_x11}], [yes], [Glitz X11])
226
227 EVAS_CHECK_ENGINE([cairo-x11], [${want_evas_engine_cairo_x11}], [yes], [Cairo X11])
228
229 EVAS_CHECK_ENGINE([software-xcb], [${want_evas_engine_software_xcb}], [no], [Software XCB])
230
231 EVAS_CHECK_ENGINE([xrender-xcb], [${want_evas_engine_xrender_xcb}], [no], [XRender XCB])
232
233 EVAS_CHECK_ENGINE([software-ddraw], [${want_evas_engine_software_ddraw}], [no], [Software DirectDraw])
234
235 EVAS_CHECK_ENGINE([direct3d], [${want_evas_engine_direct3d}], [no], [Direct3D])
236
237 EVAS_CHECK_ENGINE([quartz], [${want_evas_engine_quartz}], [no], [Quartz])
238
239 EVAS_CHECK_ENGINE([gl-glew], [${want_evas_engine_gl_glew}], [no], [OpenGL Glew])
240
241 EVAS_CHECK_ENGINE([software-sdl], [${want_evas_engine_software_sdl}], [no], [Software SDL])
242
243 EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer])
244
245 EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB])
246
247 EVAS_CHECK_ENGINE([software-qtopia], [${want_evas_engine_software_qtopia}], [no], [Qtopia])
248
249 EVAS_CHECK_ENGINE([software-16-x11], [${want_evas_engine_software_16_x11}], [yes], [Software X11 16 bits])
250
251 EVAS_CHECK_ENGINE([software-16-ddraw], [${want_evas_engine_software_16_ddraw}], [no], [Software DirectDraw 16 bits])
252
253 EVAS_CHECK_ENGINE([software-16-wince], [${want_evas_engine_software_16_wince}], [no], [Software Windows CE 16 bits])
254
255 # common cairo
256 have_evas_engine_cairo_common="no"
257 if test "x${have_evas_engine_cairo_x11}" = "xyes" ; then
258    have_evas_engine_cairo_common="yes"
259    AC_DEFINE([BUILD_ENGINE_CAIRO_COMMON], [1], [Generic Cairo Rendering Support])
260 fi
261 AM_CONDITIONAL([BUILD_ENGINE_CAIRO_COMMON], [test "x$have_evas_engine_cairo_common" = "xyes"])
262
263 # common gl
264 have_evas_engine_gl_common="no"
265 if test "x$have_evas_engine_gl_x11" = "xyes" -o "x$have_evas_engine_gl_glew" = "xyes"; then
266    AC_DEFINE(BUILD_ENGINE_GL_COMMON, 1, [Generic OpenGL Rendering Support])
267    have_evas_engine_gl_common="yes"
268    evas_engine_gl_common_libs="-lglu32"
269 fi
270
271 if test "x$have_evas_engine_gl_x11" = "xyes" ; then
272    evas_engine_gl_common_libs="-lGL -lGLU -lpthread"
273 fi
274
275 if test "x$have_evas_engine_gl_glew" = "xyes" ; then
276    evas_engine_gl_common_libs="-lglu32"
277 fi
278 AC_SUBST([evas_engine_gl_common_libs])
279
280 AM_CONDITIONAL(BUILD_ENGINE_GL_COMMON, test "x$have_evas_engine_gl_common" = "xyes")
281
282 # SDL primitive
283 sdl_primitive="no"
284
285 AC_ARG_ENABLE([sdl-primitive],
286    [AC_HELP_STRING([--enable-sdl-primitive], [])],
287    [sdl_primitive=${enableval}]
288 )
289 AC_MSG_CHECKING([whether to use SDL primitive when possible])
290 AC_MSG_RESULT([${sdl_primitive}])
291
292 if test "x${sdl_primitive}" = "xyes" ; then
293    AC_DEFINE([ENGINE_SDL_PRIMITIVE], [1], [Use SDL primitive when possible])
294 fi
295
296 # if software 16 x11 is enabled - build software_16 (the generic 16bit
297 # engine). later enable it fb_16 or other "16" bit engines are enabled.
298 have_evas_engine_software_16="no"
299 if test "x$have_evas_engine_software_16_x11" = "xyes"; then
300    have_evas_engine_software_16="yes"
301 fi
302 if test "x$have_evas_engine_software_sdl" = "xyes"; then
303    have_evas_engine_software_16="yes"
304 fi
305 if test "x$have_evas_engine_software_16_ddraw" = "xyes"; then
306    have_evas_engine_software_16="yes"
307 fi
308 if test "x$have_evas_engine_software_16_wince" = "xyes"; then
309    have_evas_engine_software_16="yes"
310 fi
311 AM_CONDITIONAL(BUILD_ENGINE_SOFTWARE_16, test "x$have_evas_engine_software_16" = "xyes")
312
313
314 #####################################################################
315 ## Image loaders
316
317 EVAS_CHECK_IMAGE_LOADER([Edb], [${want_evas_image_loader_edb}])
318
319 EVAS_CHECK_IMAGE_LOADER([Eet], [${want_evas_image_loader_eet}])
320 EVAS_CHECK_FONT_LOADER([${want_evas_font_loader_eet}])
321
322 EVAS_CHECK_IMAGE_LOADER([Gif], [${want_evas_image_loader_gif}])
323
324 have_evas_image_saver_jpeg="no"
325 EVAS_CHECK_IMAGE_LOADER([Jpeg], [${want_evas_image_loader_jpeg}])
326
327 dnl Windows has no sigsetjmp function, nor equivalent.
328 dnl So we disable the jpeg saver.
329 dnl TODO: must find a workaround
330 case "$host_os" in
331    mingw* | cegcc*)
332       ;;
333    *)
334       if test "x${have_evas_image_loader_jpeg}" = "xyes" ; then
335          have_evas_image_saver_jpeg="yes"
336       fi
337       ;;
338 esac
339 AM_CONDITIONAL([BUILD_SAVER_JPEG], [test "x${have_evas_image_saver_jpeg}" = "xyes"])
340
341 EVAS_CHECK_IMAGE_LOADER([PMAPS], [${want_evas_image_loader_pmaps}])
342
343 EVAS_CHECK_IMAGE_LOADER([PNG], [${want_evas_image_loader_png}])
344
345 EVAS_CHECK_IMAGE_LOADER([SVG], [${want_evas_image_loader_svg}])
346
347 EVAS_CHECK_IMAGE_LOADER([Tiff], [${want_evas_image_loader_tiff}])
348
349 EVAS_CHECK_IMAGE_LOADER([XPM], [${want_evas_image_loader_xpm}])
350
351
352 #####################################################################
353 ## Cpu based optimizations
354
355 #######################################
356 ## PTHREADS
357 pthread_cflags=""
358 pthread_libs=""
359 build_pthreads="no"
360 has_pthreads="no"
361 need_pthreads="no"
362 # basic pthread support
363 AC_CHECK_HEADER(pthread.h,
364   [
365    has_pthreads="yes"
366   ],
367   [
368    has_pthreads="no"
369   ]
370 )
371
372 # sched_getaffinity pthread_attr_setaffinity_np
373 AC_CHECK_HEADERS(pthread.h sched.h,
374       [
375         AC_CHECK_LIB(pthread, pthread_attr_setaffinity_np,
376           [
377             AC_CHECK_LIB(pthread, pthread_barrier_wait,
378               [ build_pthreads="yes" ],
379               [ build_pthreads="no" ]
380             )
381           ],
382           [ build_pthreads="no" ]
383         )
384       ],
385       [ build_pthreads="no" ]
386 )
387 ### disable pthreads by default for now - some wierd deadlock issue with
388 # barriers (makes no sense)
389 # disable pthread code - messes with scalecache (whihc really is a much
390 # bigger general speedup
391 build_pthreads="no"
392 AC_MSG_CHECKING(whether to build pthread code)
393 AC_ARG_ENABLE(pthreads,
394   AC_HELP_STRING([--enable-pthreads], [enable threaded rendering]),
395   [
396       if test "x$enableval" = "xyes" ; then
397         if test "x$build_pthreads" = "xyes"; then
398           AC_MSG_RESULT(yes)
399           AC_DEFINE(BUILD_PTHREAD, 1, [Build Threaded Rendering])
400           build_pthreads="yes"
401           need_pthreads="yes"
402         else
403           if "x$use_strict" = "xyes"; then
404             AC_MSG_ERROR(pthreads headers or functions not found (strict dependencies checking))
405           else
406             AC_MSG_RESULT(no: pthread headers or functions not found)
407           fi
408         fi
409       else
410         AC_MSG_RESULT(no)
411         build_pthreads="no"
412       fi
413   ],
414   [
415     AC_MSG_RESULT($build_pthreads)
416     if test "x$build_pthreads" = "xyes" ; then
417       AC_DEFINE(BUILD_PTHREAD, 1, [Build Threaded Rendering])
418       need_pthreads="yes"
419     fi
420   ]
421 )
422
423 #######################################
424 ## Async events
425 build_async_events="auto"
426 AC_MSG_CHECKING(whether to build Async Events support)
427 AC_ARG_ENABLE(async-events,
428   AC_HELP_STRING([--enable-async-events], [enable async events support]),
429   [ build_async_events=$enableval ]
430 )
431 AC_MSG_RESULT($build_async_events)
432
433 AC_MSG_CHECKING(whether we can build Async Events support)
434 if test \( "x$build_async_events" = "xyes" -o "x$build_async_events" = "xauto" \) -a "x$has_pthreads" = "xyes"; then
435   AC_MSG_RESULT(yes)
436   AC_DEFINE(BUILD_ASYNC_EVENTS, 1, [Build async events support])
437   build_async_events="yes"
438   need_pthreads="yes"
439 else
440   AC_MSG_RESULT(no)
441   build_async_events="no"
442 fi
443
444 #######################################
445 ## Async image preload
446 build_async_preload="auto"
447 AC_MSG_CHECKING(whether to build Async Image Preload support)
448 AC_ARG_ENABLE(async-preload,
449   AC_HELP_STRING([--enable-async-preload], [enable async image preloading support]),
450   [ build_async_preload=$enableval ]
451 )
452 AC_MSG_RESULT($build_async_preload)
453
454 AC_MSG_CHECKING(whether we can build Async Image Preload support)
455 if test \( "x$build_async_preload" = "xyes" -o "x$build_async_preload" = "xauto" \) -a "x$build_async_events" = "xyes"; then
456   AC_MSG_RESULT(yes)
457   AC_DEFINE(BUILD_ASYNC_PRELOAD, 1, [Build async image preload support])
458   build_async_preload="yes"
459   need_pthreads="yes"
460 else
461   AC_MSG_RESULT(no)
462   build_async_preload="no"
463 fi
464
465 #######################################
466 ## Link with pthread if needed
467 AC_MSG_CHECKING(whether we should link with pthread)
468 if test "x$need_pthreads" = "xyes"; then
469   AC_MSG_RESULT(yes)
470   pthread_cflags=""
471   pthread_libs="-lpthread"
472 else
473   AC_MSG_RESULT(no)
474 fi
475
476 #######################################
477 ## MMX
478 build_cpu_mmx="no"
479 case $host_cpu in
480   i*86)
481     build_cpu_mmx="yes"
482     ;;
483   x86_64)
484     build_cpu_mmx="yes"
485     ;;
486 esac
487 AC_MSG_CHECKING(whether to build mmx code)
488 AC_ARG_ENABLE(cpu-mmx,
489   AC_HELP_STRING([--enable-cpu-mmx], [enable mmx code]),
490   [
491       if test "x$enableval" = "xyes" ; then
492         AC_MSG_RESULT(yes)
493         AC_DEFINE(BUILD_MMX, 1, [Build MMX Code])
494         build_cpu_mmx="yes"
495       else
496         AC_MSG_RESULT(no)
497         build_cpu_mmx="no"
498       fi
499   ],
500   [
501     AC_MSG_RESULT($build_cpu_mmx)
502     if test "x$build_cpu_mmx" = "xyes" ; then
503       AC_DEFINE(BUILD_MMX, 1, [Build MMX Code])
504     fi
505   ]
506 )
507
508 #######################################
509 ## SSE
510 build_cpu_sse="no"
511 case $host_cpu in
512   i*86)
513     build_cpu_sse="yes"
514     ;;
515   x86_64)
516     build_cpu_sse="yes"
517     ;;
518 esac
519 AC_MSG_CHECKING(whether to build sse code)
520 AC_ARG_ENABLE(cpu-sse,
521   AC_HELP_STRING([--enable-cpu-sse], [enable sse code]),
522   [
523       if test "x$enableval" = "xyes" ; then
524         AC_MSG_RESULT(yes)
525         AC_DEFINE(BUILD_SSE, 1, [Build SSE Code])
526         build_cpu_sse="yes"
527       else
528         AC_MSG_RESULT(no)
529         build_cpu_sse="no"
530       fi
531   ],
532   [
533     AC_MSG_RESULT($build_cpu_sse)
534     if test "x$build_cpu_sse" = "xyes" ; then
535       AC_DEFINE(BUILD_SSE, 1, [Build SSE Code])
536     fi
537   ]
538 )
539
540 #######################################
541 ## ALTIVEC
542 build_cpu_altivec="no"
543 case $host_cpu in
544   *power* | *ppc*)
545     build_cpu_altivec="auto"
546     ;;
547 esac
548 altivec_cflags=""
549 AC_MSG_CHECKING(whether to build altivec code)
550 AC_ARG_ENABLE(cpu-altivec,
551   AC_HELP_STRING([--enable-cpu-altivec], [enable altivec code]),
552   [ build_cpu_altivec=$enableval ],
553   [
554     if test ! "x$build_cpu_altivec" = "xauto"; then
555       build_cpu_altivec="no"
556     fi
557   ]
558 )
559 AC_MSG_RESULT($build_cpu_altivec)
560
561 if test "x$build_cpu_altivec" = "xyes"; then
562    AC_CHECK_HEADER(altivec.h,
563      [
564         AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
565         AC_DEFINE(HAVE_ALTIVEC_H, 1, [Have altivec.h header file])
566         build_cpu_altivec="yes"
567      ],
568      [
569        save_CFLAGS=$CFLAGS
570        save_CPPFLAGS=$CPPFLAGS
571        CFLAGS=$CFLAGS" -maltivec"
572        CPPFLAGS=$CPPFLAGS" -maltivec"
573        unset ac_cv_header_altivec_h
574        AC_CHECK_HEADER(altivec.h,
575          [
576             AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
577             AC_DEFINE(HAVE_ALTIVEC_H, 1, [Have altivec.h header file])
578             build_cpu_altivec="yes"
579          ],
580          [
581             if test "x$build_cpu_altivec" = "xyes" -a "x$use_strict" = "xyes" ; then
582               AC_MSG_ERROR(Altivec not found (strict dependencies checking))
583             fi
584             build_cpu_altivec="no"
585          ]
586        )
587        CFLAGS=$save_CFLAGS
588        CPPFLAGS=$save_CPPFLAGS
589      ]
590    )
591 fi
592
593 if test "x$build_cpu_altivec" = "xyes"; then
594    AC_MSG_CHECKING(whether to use altivec compiler flag)
595    if test "x$GCC" = "xyes"; then
596       if echo "int main(){return 0;}" | ${CPP} -faltivec - > /dev/null 2>&1; then
597          altivec_cflags="-faltivec"
598          AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
599       elif echo "int main(){return 0;}" | ${CPP} -maltivec - > /dev/null 2>&1; then
600          altivec_cflags="-maltivec"
601          AC_DEFINE(BUILD_ALTIVEC, 1, [Build Altivec Code])
602       fi
603    fi
604    AC_MSG_RESULT($altivec_cflags)
605    CFLAGS="$CFLAGS $altivec_cflags"
606 fi
607
608
609 #######################################
610 ## C
611 build_cpu_c="no"
612 build_cpu_c="yes"
613 AC_MSG_CHECKING(whether to build c code)
614 AC_ARG_ENABLE(cpu-c,
615   AC_HELP_STRING([--enable-cpu-c], [enable C code]),
616   [
617       if test "x$enableval" = "xyes" ; then
618         AC_MSG_RESULT(yes)
619         AC_DEFINE(BUILD_C, 1, [Build plain C code])
620         build_cpu_c="yes"
621       else
622         AC_MSG_RESULT(no)
623         build_cpu_c="no"
624       fi
625   ], [
626       AC_MSG_RESULT($build_cpu_c)
627       if test "x$build_cpu_c" = "xyes" ; then
628         AC_DEFINE(BUILD_C, 1, [Build plain C code])
629       fi
630   ]
631 )
632
633 #######################################
634 ## MAGIC_DEBUG
635 want_evas_magic_debug="yes"
636 AC_MSG_CHECKING(whether to check magic for evas object)
637 AC_ARG_ENABLE(evas-magic-debug,
638   AC_HELP_STRING(
639     [--disable-evas-magic-debug],
640     [disable MAGIC_DEBUG check when people pass in wrong object type. [[default=enabled]]]
641   ),
642   [ want_evas_magic_debug="$enableval" ]
643 )
644 AC_MSG_RESULT($want_evas_magic_debug)
645
646 AM_CONDITIONAL(EVAS_MAGIC_DEBUG, test "x$want_evas_magic_debug" = "xyes")
647 if test "x$want_evas_magic_debug" = "xyes"; then
648   AC_DEFINE(EVAS_MAGIC_DEBUG, 1, [complain when peole pass in wrong object types etc.])
649 fi
650
651 #####################################################################
652 ## ARGB engine options
653
654 #######################################
655 ## Nearest sampling scaler
656 scaler_sample="no"
657 scaler_sample="yes"
658 AC_MSG_CHECKING(whether to build sampling scaler)
659 AC_ARG_ENABLE(scale-sample,
660   AC_HELP_STRING([--enable-scale-sample], [enable sampling scaler code]),
661   [
662       if test "x$enableval" = "xyes" ; then
663         AC_MSG_RESULT(yes)
664         AC_DEFINE(BUILD_SCALE_SAMPLE, 1, [Sampling Scaler Support])
665         scaler_sample="yes"
666       else
667         AC_MSG_RESULT(no)
668         scaler_sample="no"
669       fi
670   ], [
671       AC_MSG_RESULT($scaler_sample)
672       if test "x$scaler_sample" = "xyes" ; then
673         AC_DEFINE(BUILD_SCALE_SAMPLE, 1, [Sampling Scaler Support])
674       fi
675   ]
676 )
677
678 #######################################
679 ## Smooth super and sub sampling scaler
680 scaler_smooth="no"
681 scaler_smooth="yes"
682 AC_MSG_CHECKING(whether to build smooth scaler)
683 AC_ARG_ENABLE(scale-smooth,
684   AC_HELP_STRING([--enable-scale-smooth], [enable smooth scaler code]),
685   [
686       if test "x$enableval" = "xyes" ; then
687         AC_MSG_RESULT(yes)
688         AC_DEFINE(BUILD_SCALE_SMOOTH, 1, [Smooth Scaler Support])
689         scaler_smooth="yes"
690       else
691         AC_MSG_RESULT(no)
692         scaler_smooth="no"
693       fi
694   ], [
695       AC_MSG_RESULT($scaler_smooth)
696       if test "x$scaler_smooth" = "xyes" ; then
697         AC_DEFINE(BUILD_SCALE_SMOOTH, 1, [Smooth Scaler Support])
698       fi
699   ]
700 )
701
702 #######################################
703 ## YUV -> ARGB converter
704 conv_yuv="no"
705 conv_yuv="yes"
706 AC_MSG_CHECKING(whether to build yuv converter code)
707 AC_ARG_ENABLE(convert-yuv,
708   AC_HELP_STRING([--enable-convert-yuv], [enable yuv converter code]),
709   [
710       if test "x$enableval" = "xyes" ; then
711         AC_MSG_RESULT(yes)
712         AC_DEFINE(BUILD_CONVERT_YUV, 1, [YUV Converter Support])
713         conv_yuv="yes"
714       else
715         AC_MSG_RESULT(no)
716         conv_yuv="no"
717       fi
718   ], [
719       AC_MSG_RESULT($conv_yuv)
720       if test "x$conv_yuv" = "xyes" ; then
721         AC_DEFINE(BUILD_CONVERT_YUV, 1, [YUV Converter Support])
722       fi
723   ]
724 )
725
726 #####################################################################
727 ## Output rendering features
728
729 #######################################
730 ## Small dither mask instead of big one (lower quality)
731 conv_small_dither="no"
732 AC_MSG_CHECKING(whether to build small dither mask code)
733 AC_ARG_ENABLE(small-dither-mask,
734   AC_HELP_STRING([--enable-small-dither-mask], [enable small dither mask code]),
735   [
736       if test "x$enableval" = "xyes" ; then
737         AC_MSG_RESULT(yes)
738         AC_DEFINE(BUILD_SMALL_DITHER_MASK, 1, [Small Dither Mask Support])
739         conv_small_dither="yes"
740       else
741         AC_MSG_RESULT(no)
742         conv_small_dither="no"
743       fi
744   ], [
745       AC_MSG_RESULT($conv_small_dither)
746       if test "x$conv_small_dither" = "xyes" ; then
747         AC_DEFINE(BUILD_SMALL_DITHER_MASK, 1, [Small Dither Mask Support])
748       fi
749   ]
750 )
751
752 #######################################
753 ## Alternate Line dither mask instead of big one (lower quality - but fastest)
754 conv_line_dither="no"
755 AC_MSG_CHECKING(whether to build line dither mask code)
756 AC_ARG_ENABLE(line-dither-mask,
757   AC_HELP_STRING([--enable-line-dither-mask], [enable line dither mask code]),
758   [
759       if test "x$enableval" = "xyes" ; then
760         AC_MSG_RESULT(yes)
761         AC_DEFINE(BUILD_LINE_DITHER_MASK, 1, [Line Dither Mask Support])
762         conv_line_dither="yes"
763       else
764         AC_MSG_RESULT(no)
765         conv_line_dither="no"
766       fi
767   ], [
768       AC_MSG_RESULT($conv_line_dither)
769       if test "x$conv_line_dither" = "xyes" ; then
770         AC_DEFINE(BUILD_LINE_DITHER_MASK, 1, [Line Dither Mask Support])
771       fi
772   ]
773 )
774
775 #######################################
776 ## No dither mask at all for 16bpp
777 conv_no_dither="no"
778 AC_MSG_CHECKING(whether to build without dither mask for 16bpp)
779 AC_ARG_ENABLE(no-dither-mask,
780   AC_HELP_STRING([--enable-no-dither-mask], [enable conversion to 16bpp without dither mask]),
781   [
782       if test "x$enableval" = "xyes" ; then
783         AC_MSG_RESULT(yes)
784         AC_DEFINE(BUILD_NO_DITHER_MASK, 1, [No Dither Mask Support])
785         conv_no_dither="yes"
786       else
787         AC_MSG_RESULT(no)
788         conv_no_dither="no"
789       fi
790   ], [
791       AC_MSG_RESULT($conv_no_dither)
792       if test "x$conv_no_dither" = "xyes" ; then
793         AC_DEFINE(BUILD_NO_DITHER_MASK, 1, [No Dither Mask Support])
794       fi
795   ]
796 )
797
798 #######################################
799 ## Convert to 8bpp RGB 332
800 EVAS_CONVERT_COLOR(8, RGB, 332, [yes])
801 ## Convert to 8bpp RGB 666
802 EVAS_CONVERT_COLOR(8, RGB, 666, [yes])
803 ## Convert to 8bpp RGB 232
804 EVAS_CONVERT_COLOR(8, RGB, 232, [yes])
805 ## Convert to 8bpp RGB 222
806 EVAS_CONVERT_COLOR(8, RGB, 222, [yes])
807 ## Convert to 8bpp RGB 221
808 EVAS_CONVERT_COLOR(8, RGB, 221, [yes])
809 ## Convert to 8bpp RGB 121
810 EVAS_CONVERT_COLOR(8, RGB, 121, [yes])
811 ## Convert to 8bpp RGB 111
812 EVAS_CONVERT_COLOR(8, RGB, 111, [yes])
813 ## Convert to 16bpp RGB 565
814 EVAS_CONVERT_COLOR(16, RGB, 565)
815 ## Convert to 16bpp BGR 565
816 EVAS_CONVERT_COLOR(16, BGR, 565)
817 ## Convert to 16bpp RGB 555
818 EVAS_CONVERT_COLOR(16, RGB, 555)
819 ## Convert to 16bpp RGB 444
820 EVAS_CONVERT_COLOR(16, RGB, 444)
821
822 #######################################
823 ## Convert to 16bpp RGB 565 (444 ipaq)
824 conv_16_rgb_ipq="yes"
825 AC_MSG_CHECKING(whether to build 16bpp 565 (444 ipaq) converter code)
826 AC_ARG_ENABLE(convert-16-rgb-ipq,
827   AC_HELP_STRING([--disable-convert-16-rgb-ipq], [disable 16bpp 565 (444 ipaq) converter code]),
828   [
829       if test "x$enableval" = "xyes" ; then
830         AC_DEFINE(BUILD_CONVERT_16_RGB_454645, 1, [16bpp 565 (444 ipaq) Converter Support])
831         conv_16_rgb_ipq="yes"
832       else
833         conv_16_rgb_ipq="no"
834       fi
835   ], [
836       if test "x$conv_16_rgb_ipq" = "xyes" ; then
837         AC_DEFINE(BUILD_CONVERT_16_RGB_454645, 1, [16bpp 565 (444 ipaq) Converter Support])
838       fi
839   ]
840 )
841 AC_MSG_RESULT($conv_16_rgb_ipq)
842
843 #######################################
844 ## Convert to 16bpp RGB with rotation of 0
845 EVAS_CONVERT_ROT(16, RGB, 0)
846 ## Convert to 16bpp RGB with rotation of 180
847 EVAS_CONVERT_ROT(16, RGB, 180)
848 ## Convert to 16bpp RGB with rotation of 270
849 EVAS_CONVERT_ROT(16, RGB, 270)
850 ## Convert to 16bpp RGB with rotation of 90
851 EVAS_CONVERT_ROT(16, RGB, 90)
852
853 #######################################
854 ## Convert to 24bpp RGB 888
855 EVAS_CONVERT_COLOR(24, RGB, 888)
856 ## Convert to 24bpp BGR 888
857 EVAS_CONVERT_COLOR(24, BGR, 888)
858 ## Convert to 32bpp RGB 8888
859 EVAS_CONVERT_COLOR(32, RGB, 8888)
860 ## Convert to 32bpp RGBX 8888
861 EVAS_CONVERT_COLOR(32, RGBX, 8888)
862 ## Convert to 32bpp BGR 8888
863 EVAS_CONVERT_COLOR(32, BGR, 8888)
864 ## Convert to 32bpp BGRX 8888
865 EVAS_CONVERT_COLOR(32, BGRX, 8888)
866
867 #######################################
868 ## Convert to 32bpp RGB with rotation of 0
869 EVAS_CONVERT_ROT(32, RGB, 0)
870 ## Convert to 32bpp RGB with rotation of 180
871 EVAS_CONVERT_ROT(32, RGB, 180)
872 ## Convert to 32bpp RGB with rotation of 270
873 EVAS_CONVERT_ROT(32, RGB, 270)
874 ## Convert to 32bpp RGB with rotation of 90
875 EVAS_CONVERT_ROT(32, RGB, 90)
876
877 ## valgrind
878 want_valgrind="no"
879 have_valgrind="no"
880
881 AC_MSG_CHECKING(whether to enable build with valgrind)
882 AC_ARG_ENABLE(valgrind,
883   AC_HELP_STRING([--enable-valgrind], [enable valgrind fixes to stop false reports]),
884   [ want_valgrind=$enableval ]
885 )
886 AC_MSG_RESULT($want_valgrind)
887
888 if test x$want_valgrind = "xyes"; then
889   PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
890     [
891       AC_DEFINE(HAVE_VALGRIND, 1, [Valgrind support])
892       have_valgrind=yes
893     ],
894     [
895       if test "x$want_valgrind" = "xyes" -a "x$use_strict" = "xyes" ; then
896         AC_MSG_ERROR([Valgrind not found (strict dependencies checking)])
897       fi
898     ]
899   )
900 fi
901
902 #####################################################################
903 ## Fill in flags
904
905 AC_SUBST(altivec_cflags)
906 AC_SUBST(pthread_cflags)
907 AC_SUBST(pthread_libs)
908
909
910 #####################################################################
911 ## Output
912
913 AC_OUTPUT([
914 Makefile
915 evas-cairo-x11.pc
916 evas-directfb.pc
917 evas-fb.pc
918 evas-glitz-x11.pc
919 evas-opengl-glew.pc
920 evas-opengl-x11.pc
921 evas-quartz.pc
922 evas-software-buffer.pc
923 evas-software-qtopia.pc
924 evas-software-x11.pc
925 evas-software-16-x11.pc
926 evas-software-xcb.pc
927 evas-xrender-x11.pc
928 evas-xrender-xcb.pc
929 evas-software-ddraw.pc
930 evas-software-16-ddraw.pc
931 evas-direct3d.pc
932 evas-software-16-wince.pc
933 evas-software-sdl.pc
934 evas.pc
935 src/Makefile
936 src/lib/Makefile
937 src/lib/canvas/Makefile
938 src/lib/data/Makefile
939 src/lib/file/Makefile
940 src/lib/imaging/Makefile
941 src/lib/cache/Makefile
942 src/lib/engines/Makefile
943 src/lib/engines/common/Makefile
944 src/lib/engines/common/evas_op_add/Makefile
945 src/lib/engines/common/evas_op_blend/Makefile
946 src/lib/engines/common/evas_op_copy/Makefile
947 src/lib/engines/common/evas_op_mask/Makefile
948 src/lib/engines/common/evas_op_mul/Makefile
949 src/lib/engines/common/evas_op_sub/Makefile
950 src/lib/engines/common_16/Makefile
951 src/modules/Makefile
952 src/modules/engines/Makefile
953 src/modules/engines/software_generic/Makefile
954 src/modules/engines/software_ddraw/Makefile
955 src/modules/engines/direct3d/Makefile
956 src/modules/engines/software_16_wince/Makefile
957 src/modules/engines/software_x11/Makefile
958 src/modules/engines/software_xcb/Makefile
959 src/modules/engines/fb/Makefile
960 src/modules/engines/buffer/Makefile
961 src/modules/engines/software_win32_gdi/Makefile
962 src/modules/engines/software_qtopia/Makefile
963 src/modules/engines/directfb/Makefile
964 src/modules/engines/gl_common/Makefile
965 src/modules/engines/gl_glew/Makefile
966 src/modules/engines/gl_x11/Makefile
967 src/modules/engines/quartz/Makefile
968 src/modules/engines/cairo_common/Makefile
969 src/modules/engines/cairo_x11/Makefile
970 src/modules/engines/xrender_x11/Makefile
971 src/modules/engines/xrender_xcb/Makefile
972 src/modules/engines/software_sdl/Makefile
973 src/modules/engines/glitz_x11/Makefile
974 src/modules/engines/software_16/Makefile
975 src/modules/engines/software_16_x11/Makefile
976 src/modules/engines/software_16_ddraw/Makefile
977 src/modules/engines/software_16_sdl/Makefile
978 src/modules/loaders/Makefile
979 src/modules/loaders/edb/Makefile
980 src/modules/loaders/eet/Makefile
981 src/modules/loaders/gif/Makefile
982 src/modules/loaders/jpeg/Makefile
983 src/modules/loaders/png/Makefile
984 src/modules/loaders/tiff/Makefile
985 src/modules/loaders/xpm/Makefile
986 src/modules/loaders/svg/Makefile
987 src/modules/loaders/pmaps/Makefile
988 src/modules/savers/Makefile
989 src/modules/savers/edb/Makefile
990 src/modules/savers/eet/Makefile
991 src/modules/savers/jpeg/Makefile
992 src/modules/savers/png/Makefile
993 src/modules/savers/tiff/Makefile
994 src/lib/include/Makefile
995 README
996 evas.spec
997 ])
998
999 #####################################################################
1000 ## Info
1001
1002 echo
1003 echo
1004 echo
1005 echo "------------------------------------------------------------------------"
1006 echo "$PACKAGE $VERSION"
1007 echo "------------------------------------------------------------------------"
1008 echo
1009 echo "Configuration Options Summary:"
1010 echo
1011 echo "Engines:"
1012 echo "  Software Memory Buffer.....: $have_evas_engine_buffer"
1013 echo "  Software X11...............: $have_evas_engine_software_x11"
1014 echo "  XRender X11................: $have_evas_engine_xrender_x11"
1015 echo "  OpenGL X11.................: $have_evas_engine_gl_x11"
1016 echo "  Glitz X11..................: $have_evas_engine_glitz_x11"
1017 echo "  Cairo X11..................: $have_evas_engine_cairo_x11"
1018 echo "  Software XCB...............: $have_evas_engine_software_xcb"
1019 echo "  XRender XCB................: $have_evas_engine_xrender_xcb"
1020 echo "  Software DirectDraw........: $have_evas_engine_software_ddraw"
1021 echo "  Direct3d...................: $have_evas_engine_direct3d"
1022 echo "  Quartz.....................: $have_evas_engine_quartz"
1023 echo "  OpenGL Glew................: $have_evas_engine_gl_glew"
1024 echo "  Software SDL...............: $have_evas_engine_software_sdl (primitive: $sdl_primitive)"
1025 echo "  Software Framebuffer.......: $have_evas_engine_fb"
1026 echo "  DirectFB...................: $have_evas_engine_directfb"
1027 echo "  Software Qtopia............: $have_evas_engine_software_qtopia"
1028 echo "  Software 16bit ............: $have_evas_engine_software_16"
1029 echo "  Software 16bit X11.........: $have_evas_engine_software_16_x11"
1030 echo "  Software 16bit Directdraw..: $have_evas_engine_software_16_ddraw"
1031 echo "  Software 16bit WinCE.......: $have_evas_engine_software_16_wince"
1032 echo "  Software 16bit SDL.........: $have_evas_engine_software_sdl (primitive: $sdl_primitive)"
1033 # FIXME: opengl engine needs to be fixed and tested lots for all drivers
1034 # FIXME: xrender engine to be written
1035 echo
1036 echo "Image Loaders:"
1037 echo "  EDB.....................: $have_evas_image_loader_edb"
1038 echo "  EET.....................: $have_evas_image_loader_eet"
1039 echo "  GIF.....................: $have_evas_image_loader_gif"
1040 echo "  JPEG....................: $have_evas_image_loader_jpeg"
1041 echo "  PMAPS...................: $have_evas_image_loader_pmaps"
1042 echo "  PNG.....................: $have_evas_image_loader_png"
1043 echo "  SVG.....................: $have_evas_image_loader_svg"
1044 echo "  TIFF....................: $have_evas_image_loader_tiff"
1045 echo "  XPM.....................: $have_evas_image_loader_xpm"
1046 # FIXME: need to add modular image loader system
1047 # FIXME: add more image loader modules
1048 echo
1049 echo "Font Sourcing Systems:"
1050 echo "  EET.....................: $have_evas_font_loader_eet"
1051 echo
1052 echo "Font Searching Systems:"
1053 echo "  Fontconfig..............: $have_fontconfig"
1054 # FIXME: add non freetype2 font engine support
1055 # FIXME: make freetype2 optional
1056 echo
1057 echo "CPU Specific Extensions:"
1058 echo "  Fallback C Code.........: $build_cpu_c"
1059 echo "  MMX.....................: $build_cpu_mmx"
1060 echo "  SSE.....................: $build_cpu_sse"
1061 echo "  ALTIVEC.................: $build_cpu_altivec"
1062 echo "  Thread Support..........: $build_pthreads"
1063 echo "  MAGIC_DEBUG.............: $want_evas_magic_debug"
1064 echo
1065 echo "Async Events..............: $build_async_events"
1066 echo "Async Image Preload.......: $build_async_preload"
1067 echo
1068 echo "ARGB Software Engine Options:"
1069 echo "  Sampling Scaler.........: $scaler_sample"
1070 echo "  Smooth Scaler...........: $scaler_smooth"
1071 # FIXME: add an mmx scaler routine
1072 echo "  YUV Converter...........: $conv_yuv"
1073 # FIXME: add more YUV format and colorvariant support
1074 echo
1075 echo "ARGB Conversion Options:"
1076 echo "  Smaller Dither Mask.....: $conv_small_dither"
1077 echo "  Line Dither Mask........: $conv_line_dither"
1078 echo "  No Dither Mask for 16bpp: $conv_no_dither"
1079 echo "  8bpp RGB 332............: $conv_8_rgb_332"
1080 echo "  8bpp RGB 666............: $conv_8_rgb_666"
1081 echo "  8bpp RGB 232............: $conv_8_rgb_232"
1082 echo "  8bpp RGB 222............: $conv_8_rgb_222"
1083 echo "  8bpp RGB 221............: $conv_8_rgb_221"
1084 echo "  8bpp RGB 121............: $conv_8_rgb_121"
1085 echo "  8bpp RGB 111............: $conv_8_rgb_111"
1086 # FIXME: add grayscale and B&W support
1087 echo "  16bpp RGB 565...........: $conv_16_rgb_565"
1088 echo "  16bpp BGR 565...........: $conv_16_bgr_565"
1089 echo "  16bpp RGB 555...........: $conv_16_rgb_555"
1090 echo "  16bpp RGB 444...........: $conv_16_rgb_444"
1091 echo "  16bpp RGB 565 (444 ipaq): $conv_16_rgb_ipq"
1092 # FIXME: add 555 (444 ipaq) support
1093 # FIXME: add 24bpp 666 support
1094 # FIXME: add 32bpp 666 support
1095 # FIXME: add 30bpp support
1096 # FIXME: add palletted support
1097 # FIXME: add 8bpp and below rotation
1098 echo "  16bpp Rotation 0........: $conv_16_rgb_rot_0"
1099 echo "  16bpp Rotation 90.......: $conv_16_rgb_rot_90"
1100 echo "  16bpp Rotation 180......: $conv_16_rgb_rot_180"
1101 echo "  16bpp Rotation 270......: $conv_16_rgb_rot_270"
1102 echo "  24bpp RGB 888...........: $conv_24_rgb_888"
1103 echo "  24bpp BGR 888...........: $conv_24_bgr_888"
1104 # FIXME: add 24bpp rotation
1105 echo "  32bpp RGB 8888..........: $conv_32_rgb_8888"
1106 echo "  32bpp RGBX 8888.........: $conv_32_rgbx_8888"
1107 echo "  32bpp BGR 8888..........: $conv_32_bgr_8888"
1108 echo "  32bpp BGRX 8888.........: $conv_32_bgrx_8888"
1109 echo "  32bpp Rotation 0........: $conv_32_rgb_rot_0"
1110 echo "  32bpp Rotation 90.......: $conv_32_rgb_rot_90"
1111 echo "  32bpp Rotation 180......: $conv_32_rgb_rot_180"
1112 echo "  32bpp Rotation 270......: $conv_32_rgb_rot_270"
1113 echo
1114 echo "------------------------------------------------------------------------"
1115 echo
1116 echo "Now type 'make' ('gmake' on some systems) to compile $PACKAGE,"
1117 echo "and then afterwards as root (or the user who will install this), type"
1118 echo "'make install'. Change users with 'su' or 'sudo' appropriately."
1119 echo