* check if dlopen() is in libc first, then in libdl
[profile/ivi/ecore.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [0])
5 m4_define([v_mic], [0])
6 m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7 m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8 ##--   When released, remove the dnl on the below line
9 m4_undefine([v_rev])
10 ##--   When doing snapshots - change soname. remove dnl on below line
11 dnl m4_define([relname], [ver-pre-svn-07])
12 dnl m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
15 m4_define([lt_rev], m4_eval(v_maj + v_min))
16 m4_define([lt_cur], v_mic)
17 m4_define([lt_age], v_min)
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20
21 AC_INIT([ecore], [v_ver.beta3], [enlightenment-devel@lists.sourceforge.net])
22 AC_PREREQ([2.52])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
25 AC_CANONICAL_BUILD
26 AC_CANONICAL_HOST
27 AC_ISC_POSIX
28
29 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
30 AM_CONFIG_HEADER([config.h])
31 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
32
33 AC_GNU_SOURCE
34
35 AC_LIBTOOL_WIN32_DLL
36 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
37 AC_PROG_LIBTOOL
38
39 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
40 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
41 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
42 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
43 AC_DEFINE_UNQUOTED(VERS_MAJ, [v_maj], [Major version])
44 AC_DEFINE_UNQUOTED(VERS_MIN, [v_min], [Minor version])
45 AC_DEFINE_UNQUOTED(VERS_MIC, [v_mic], [Micro version])
46 AC_DEFINE_UNQUOTED(VERS_REV, [v_rev], [Revison])
47 version_info="lt_rev:lt_cur:lt_age"
48 release_info="v_rel"
49 AC_SUBST(version_info)
50 AC_SUBST(release_info)
51 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
52 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
53 VMAJ=v_maj
54 AC_SUBST(VMAJ)
55
56 m4_ifdef([AM_GNU_GETTEXT_VERSION], [
57 AM_GNU_GETTEXT_VERSION([0.12.1])
58 ])
59
60 m4_ifdef([AM_GNU_GETTEXT], [
61 AM_GNU_GETTEXT([external])
62 po_makefile_in=po/Makefile.in
63 AM_CONDITIONAL([HAVE_PO], [true])
64 ],[
65 AM_CONDITIONAL([HAVE_PO], [false])
66 ])
67 AC_SUBST(LTLIBINTL)
68
69 EFL_CHECK_PATH_MAX
70
71 with_max_log_level="<unset>"
72 AC_ARG_WITH(internal-maximum-log-level,
73    [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
74                    [limit ecore internal log level to the given number, any call to EINA_LOG() with values greater than this will be compiled out, ignoring runtime settings, but saving function calls.])],
75    [
76     if test "x${withval}" != "xno"; then
77        if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
78           AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
79           AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
80           with_max_log_level="${withval}"
81        else
82           AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
83        fi
84     fi
85     ], [:])
86
87
88 ### Default options with respect to host
89
90 # dependencies and options
91 want_curl="no"
92 want_abstract_sockets="no"
93 want_gnutls="no"
94 want_openssl="no"
95 want_cares="no"
96 want_cipher="no"
97 want_signature="no"
98 want_poll="yes"
99 want_inotify="no"
100 want_notify_win32="no"
101 want_tslib="no"
102 want_glib="no"
103
104 # core modules
105 want_ecore_con="yes"
106 want_ecore_ipc="no"
107 want_ecore_file="yes"
108 #want_ecore_config="no"
109 want_ecore_imf="no"
110 want_ecore_input="yes"
111
112 # graphic system modules
113 want_evas_simple_x11="no"
114 want_ecore_x_xcb="no"
115 want_ecore_x="no"
116 want_ecore_win32="no"
117 want_ecore_cocoa="no"
118 want_ecore_sdl="no"
119 want_ecore_fb="no"
120 want_ecore_directfb="no"
121 want_ecore_wince="no"
122
123 # ecore_x options (both xlib and xcb)
124 want_ecore_x_composite="yes"
125 want_ecore_x_damage="yes"
126 want_ecore_x_dpms="yes"
127 want_ecore_x_randr="yes"
128 want_ecore_x_render="yes"
129 want_ecore_x_screensaver="yes"
130 want_ecore_x_shape="yes"
131 want_ecore_x_sync="yes"
132 want_ecore_x_xfixes="yes"
133 want_ecore_x_xinerama="yes"
134 want_ecore_x_xprint="yes"
135 want_ecore_x_xtest="yes"
136 want_ecore_x_cursor="yes"
137 want_ecore_x_input="yes"
138
139 # ecore_evas modules
140 want_ecore_evas="yes"
141 want_ecore_evas_software_buffer="yes"
142 want_ecore_evas_software_x11="no"
143 want_ecore_evas_xrender_x11="no"
144 want_ecore_evas_opengl_x11="no"
145 want_ecore_evas_software_16_x11="no"
146 want_ecore_evas_software_8_x11="no"
147 want_ecore_evas_software_xcb="no"
148 want_ecore_evas_xrender_xcb="no"
149 want_ecore_evas_software_gdi="no"
150 want_ecore_evas_software_ddraw="no"
151 want_ecore_evas_direct3d="no"
152 want_ecore_evas_opengl_glew="no"
153 want_ecore_evas_software_16_ddraw="no"
154 want_ecore_evas_cocoa="no"
155 want_ecore_evas_software_sdl="no"
156 want_ecore_evas_gl_sdl="no"
157 want_ecore_evas_directfb="no"
158 want_ecore_evas_fb="no"
159 want_ecore_evas_software_16_wince="no"
160
161 case "$host_os" in
162    mingw32ce* | cegcc*)
163       want_ecore_con="no"
164       want_ecore_wince="yes"
165       want_ecore_evas_software_16_wince="yes"
166       ;;
167    mingw*)
168       want_notify_win32="yes"
169       want_curl="yes"
170       want_glib="auto"
171       want_ecore_con="no"
172       want_ecore_imf="yes"
173       want_ecore_win32="yes"
174       want_ecore_evas_software_gdi="yes"
175       want_ecore_evas_software_ddraw="yes"
176       want_ecore_evas_direct3d="yes"
177       want_ecore_evas_opengl_glew="yes"
178       want_ecore_evas_software_16_ddraw="auto"
179       want_ecore_evas_software_sdl="yes"
180       want_ecore_evas_gl_sdl="yes"
181       ;;
182    darwin*)
183       want_curl="yes"
184       want_glib="auto"
185       want_gnutls="auto"
186       want_openssl="auto"
187       want_ecore_ipc="yes"
188       want_ecore_imf="yes"
189       want_ecore_cocoa="yes"
190       want_ecore_evas_cocoa="yes"
191       want_ecore_evas_software_sdl="yes"
192       want_ecore_evas_gl_sdl="yes"
193       ;;
194    *)
195       want_curl="yes"
196       want_glib="auto"
197       want_abstract_sockets="yes"
198       want_gnutls="auto"
199       want_openssl="auto"
200       want_cipher="yes"
201       want_signature="yes"
202       want_inotify="yes"
203       want_tslib="yes"
204       want_ecore_fb="yes"
205       want_ecore_ipc="yes"
206       want_ecore_imf="yes"
207       want_ecore_x="yes"
208       want_ecore_evas_software_x11="yes"
209       want_ecore_evas_xrender_x11="yes"
210       want_ecore_evas_opengl_x11="yes"
211       want_ecore_evas_software_16_x11="yes"
212       want_ecore_evas_software_8_x11="yes"
213       want_ecore_evas_software_xcb="yes"
214       want_ecore_evas_xrender_xcb="yes"
215       want_ecore_evas_software_sdl="yes"
216       want_ecore_evas_gl_sdl="yes"
217       want_ecore_evas_directfb="yes"
218       want_ecore_evas_fb="yes"
219       ;;
220 esac
221
222 requirements_ecore=""
223 requirements_ecore_con=""
224 #requirements_ecore_config=""
225 requirements_ecore_directfb=""
226 requirements_ecore_evas=""
227 requirements_ecore_fb=""
228 requirements_ecore_file=""
229 requirements_ecore_imf=""
230 requirements_ecore_imf_evas=""
231 requirements_ecore_input=""
232 requirements_ecore_input_evas=""
233 requirements_ecore_ipc=""
234 requirements_ecore_cocoa=""
235 requirements_ecore_sdl=""
236 requirements_ecore_x=""
237 requirements_ecore_win32=""
238 requirements_ecore_wince=""
239
240 ### Additional options to configure
241
242 want_glib_integration_always=no
243 AC_ARG_ENABLE(glib-integration-always,
244   AC_HELP_STRING([--enable-glib-integration-always], [enable glib integration when ecore_init() is called always]),
245   [want_glib_integration_always=$enableval])
246
247 if test "x${want_glib_integration_always}" = "xyes" ; then
248   AC_DEFINE([GLIB_INTEGRATION_ALWAYS], [1], [Always integrate glib if support compiled])
249   want_glib=yes
250 fi
251
252 want_g_main_loop=no
253 AC_ARG_ENABLE(g-main-loop,
254   AC_HELP_STRING([--enable-g-main-loop], [ecore_main_loop based on g_main_loop]),
255   [want_g_main_loop=$enableval])
256
257 if test "x${want_g_main_loop}" = "xyes" ; then
258   AC_DEFINE([USE_G_MAIN_LOOP], [1], [Use g_main_loop in ecore])
259   want_glib=yes
260 fi
261
262 if test "x${want_glib_integration_always}" = "xyes" -a "x${want_g_main_loop}" = "xyes"; then
263   AC_MSG_ERROR([--enable-glib-integration-always and --enable-glib-main-loop are mutually exclusive])
264 fi
265
266 # abstract sockets (ecore_con.c)
267 AC_ARG_ENABLE([abstract-sockets],
268    [AC_HELP_STRING([--disable-abstract-sockets], [disable abstract sockets.])],
269    [
270     if test "x${enableval}" = "xyes" ; then
271        want_abstract_sockets="yes"
272     else
273        want_abstract_sockets="no"
274     fi
275    ],
276    [want_abstract_sockets="yes"])
277
278 if test "x${want_abstract_sockets}" = "xyes" ; then
279    AC_DEFINE([HAVE_ABSTRACT_SOCKETS], [1], [Have abstract sockets namespace])
280 fi
281
282 # Simple X11 build/link
283
284 AC_ARG_ENABLE(simple-x11,
285   AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking]),
286   [want_evas_simple_x11=$enableval])
287
288 # XIM
289 AC_ARG_ENABLE([xim],
290    [AC_HELP_STRING([--disable-xim], [disable X Input Method.])],
291    [
292     if test "x${enableval}" = "xyes" ; then
293        want_xim="yes"
294     else
295        want_xim="no"
296     fi
297    ],
298    [want_xim="yes"])
299
300 if test "x${want_xim}" = "xyes" ; then
301    AC_DEFINE([ENABLE_XIM], [1], [Enable X Input Method])
302 fi
303
304 ### Checks for programs
305
306 m4_ifdef([AC_PROG_OBJC],
307    [
308     AC_PROG_OBJC
309     _AM_DEPENDENCIES(OBJC)
310    ],
311    [
312     AC_CHECK_TOOL([OBJC], [gcc])
313     AC_SUBST([OBJC])
314     AC_SUBST([OBJCFLAGS])
315    ])
316 m4_ifndef([am__fastdepOBJC], [
317     AM_CONDITIONAL([am__fastdepOBJC], [false])
318     AC_SUBST([cocoa_ldflags])
319 ])
320
321 AC_PROG_CXX
322 AC_PROG_CC
323
324 have_gnu_objc=${ac_cv_objc_compiler_gnu}
325
326 # doxygen program for documentation building
327
328 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
329
330 # The first call to PKG_CHECK_MODULES is done conditionally,
331 # so we should include this here:
332 PKG_PROG_PKG_CONFIG
333
334 # Check whether pkg-config supports Requires.private
335 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
336    pkgconfig_requires_private="Requires.private"
337 else
338    pkgconfig_requires_private="Requires"
339 fi
340 AC_SUBST(pkgconfig_requires_private)
341
342
343 ### Checks for libraries
344
345 # Evil library for compilation on Windows
346
347 case "$host_os" in
348    mingw* | cegcc*)
349       PKG_CHECK_MODULES([EVIL], [evil])
350       AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
351       requirements_ecore="evil ${requirements_ecore}"
352       requirements_ecore_evas="evil ${requirements_ecore_evas}"
353       requirements_ecore_file="evil ${requirements_ecore_file}"
354       requirements_ecore_imf="evil ${requirements_ecore_imf}"
355       requirements_ecore_imf_evas="evil ${requirements_ecore_imf_evas}"
356       EFL_ECORE_BUILD="-DEFL_ECORE_BUILD"
357       EFL_ECORE_FILE_BUILD="-DEFL_ECORE_FILE_BUILD"
358       EFL_ECORE_EVAS_BUILD="-DEFL_ECORE_EVAS_BUILD"
359       EFL_ECORE_IMF_BUILD="-DEFL_ECORE_IMF_BUILD"
360       EFL_ECORE_IMF_EVAS_BUILD="-DEFL_ECORE_IMF_EVAS_BUILD"
361       EFL_ECORE_INPUT_BUILD="-DEFL_ECORE_INPUT_BUILD"
362       EFL_ECORE_INPUT_EVAS_BUILD="-DEFL_ECORE_INPUT_EVAS_BUILD"
363       ;;
364 esac
365
366 have_win32=""
367 have_wince=""
368 case "$host_os" in
369    mingw32ce* | cegcc*)
370       EFL_ECORE_WINCE_BUILD="-DEFL_ECORE_WINCE_BUILD"
371       requirements_ecore_wince="evil ${requirements_ecore_wince}"
372       have_wince="yes"
373       ;;
374    mingw*)
375       EFL_ECORE_WIN32_BUILD="-DEFL_ECORE_WIN32_BUILD"
376       EFL_ECORE_SDL_BUILD="-DEFL_ECORE_SDL_BUILD"
377       requirements_ecore_win32="evil ${requirements_ecore_win32}"
378       requirements_ecore_sdl="evil ${requirements_ecore_sdl}"
379       have_win32="yes"
380       ;;
381 esac
382
383 AC_SUBST(EFL_ECORE_BUILD)
384 AC_SUBST(EFL_ECORE_FILE_BUILD)
385 AC_SUBST(EFL_ECORE_EVAS_BUILD)
386 AC_SUBST(EFL_ECORE_IMF_BUILD)
387 AC_SUBST(EFL_ECORE_IMF_EVAS_BUILD)
388 AC_SUBST(EFL_ECORE_INPUT_BUILD)
389 AC_SUBST(EFL_ECORE_INPUT_EVAS_BUILD)
390 AC_SUBST(EFL_ECORE_WINCE_BUILD)
391 AC_SUBST(EFL_ECORE_WIN32_BUILD)
392 AC_SUBST(EFL_ECORE_SDL_BUILD)
393
394 AM_CONDITIONAL(ECORE_HAVE_WINCE, test "x${have_wince}" = "xyes")
395 AM_CONDITIONAL(ECORE_HAVE_WIN32, test "x${have_win32}" = "xyes")
396
397 WIN32_LIBS=""
398 case "$host_os" in
399    mingw32ce* | cegcc*)
400       WIN32_LIBS="-lws2"
401       dlopen_libs="-ldl"
402       ;;
403    mingw*)
404       WIN32_LIBS="-lws2_32"
405       dlopen_libs="-ldl"
406       ;;
407    *)
408       AC_CHECK_LIB([c], [dlopen],
409          [],
410          [AC_CHECK_LIB([dl], [dlopen],
411              [dlopen_libs=-ldl])
412          ])
413       AC_CHECK_LIB([c], [clock_gettime],
414          [AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])],
415          [AC_CHECK_LIB([rt], [clock_gettime],
416              [
417               rt_libs=-lrt
418               AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])
419              ])
420          ])
421       ;;
422 esac
423 AC_SUBST(WIN32_LIBS)
424 AC_SUBST(dlopen_libs)
425 AC_SUBST(rt_libs)
426
427 # Eina library
428
429 PKG_CHECK_MODULES(EINA, [eina >= 1.0.0])
430 #FIXME check all the requirements when the eina move will be finished
431 requirements_ecore="eina >= 1.0.0 ${requirements_ecore}"
432 requirements_ecore_con="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_con}"
433 #requirements_ecore_config="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_config}"
434 requirements_ecore_directfb="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_directfb}"
435 requirements_ecore_evas="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_evas}"
436 requirements_ecore_fb="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_fb}"
437 requirements_ecore_file="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_file}"
438 requirements_ecore_imf="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_imf}"
439 requirements_ecore_imf_evas="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_imf_evas}"
440 requirements_ecore_input="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_input}"
441 requirements_ecore_input_evas="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_input_evas}"
442 requirements_ecore_ipc="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_ipc}"
443 requirements_ecore_cocoa="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_cocoa}"
444 requirements_ecore_sdl="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_sdl}"
445 requirements_ecore_win32="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_win32}"
446 requirements_ecore_wince="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_wince}"
447 requirements_ecore_x="ecore >= 1.0.0 eina >= 1.0.0 ${requirements_ecore_x}"
448
449
450 # glib support (main loop integration)
451 AC_ARG_ENABLE([glib],
452    [AC_HELP_STRING([--disable-glib], [disable glib support. @<:@default=detect@:>@])],
453    [want_glib=$enableval], [])
454
455 if test "x$want_glib" != "xno"; then
456    PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib="yes"], [have_glib="no"])
457 else
458    have_glib="no"
459 fi
460 if test "x$want_glib" = "xyes" -a "x$have_glib" = "xno"; then
461    AC_MSG_ERROR([GLib support requested, but no GLib found by pkg-config.])
462 elif test "x$have_glib" = "xyes"; then
463    AC_DEFINE(HAVE_GLIB, [1], [Have GLib])
464    requirements_ecore="glib-2.0 ${requirements_ecore}"
465 fi
466
467
468 # SDL library (ecore_sdl)
469
470 have_sdl="no"
471 SDL_CONFIG="sdl-config"
472 AC_ARG_WITH([sdl-config],
473    [AC_HELP_STRING([--with-sdl-config=PATH], [use sdl-config specified])],
474    [
475     SDL_CONFIG=$withval
476     AC_MSG_NOTICE([using ${SDL_CONFIG} for sdl-config])
477    ])
478
479 AC_PATH_PROG([SDL_CONFIG], ["sdl-config"], [""], [$PATH])
480
481 if test -n "$SDL_CONFIG" ; then
482    SDL_CFLAGS=`$SDL_CONFIG --cflags`
483    SDL_LIBS=`$SDL_CONFIG --libs`
484    AC_SUBST(SDL_CFLAGS)
485    AC_SUBST(SDL_LIBS)
486    have_sdl="yes"
487 else
488    PKG_CHECK_MODULES([SDL], [sdl >= 1.2.0], [have_sdl="yes"], [have_sdl="no"])
489 fi
490
491 if test "x${have_sdl}" = "xyes" ; then
492    PKG_CHECK_EXISTS([sdl >= 1.3.0],
493       [AC_DEFINE(BUILD_ECORE_EVAS_SDL_130, 1, [Support for SVN SDL])])
494 fi
495
496
497 # DirectFB library (ecore_directfb)
498
499 PKG_CHECK_MODULES([DIRECTFB],
500    [directfb >= 0.9.16],
501    [have_directfb="yes"],
502    [have_directfb="no"])
503
504
505 # Eet library (ecore_config)
506
507 #PKG_CHECK_MODULES([EET],
508 #   [eet >= 1.4.0],
509 #   [have_eet="yes"],
510 #   [have_eet="no"])
511
512
513 # Xlib and XCB (ecore_x)
514
515 have_x="no"
516 have_ecore_x="no"
517 have_ecore_x_xlib="no"
518 have_ecore_x_xcb="no"
519
520 x_dir="";
521 x_includes="";
522 x_cflags="";
523 x_libs="";
524
525 ecore_x_libs_private=""
526
527 AC_ARG_ENABLE(ecore-x-composite,
528    [AC_HELP_STRING([--disable-ecore-x-composite],
529        [disable the ecore_x support for Xcomposite extension.
530         @<:@default=detect@:>@])],
531    [want_ecore_x_composite=$enableval])
532
533 AC_ARG_ENABLE(ecore-x-damage,
534    [AC_HELP_STRING([--disable-ecore-x-damage],
535        [disable the ecore_x support for Xdamage extension.
536         @<:@default=detect@:>@])],
537    [want_ecore_x_damage=$enableval])
538
539 AC_ARG_ENABLE(ecore-x-dpms,
540    [AC_HELP_STRING([--disable-ecore-x-dpms],
541        [disable the ecore_x support for Xdpms extension.
542         @<:@default=detect@:>@])],
543    [want_ecore_x_dpms=$enableval])
544
545 AC_ARG_ENABLE(ecore-x-randr,
546    [AC_HELP_STRING([--disable-ecore-x-randr],
547        [disable the ecore_x support for Xrandr extension.
548         @<:@default=detect@:>@])],
549    [want_ecore_x_randr=$enableval])
550
551 AC_ARG_ENABLE(ecore-x-render,
552    [AC_HELP_STRING([--disable-ecore-x-render],
553        [disable the ecore_x support for Xrender extension.
554         @<:@default=detect@:>@])],
555    [want_ecore_x_render=$enableval])
556
557 AC_ARG_ENABLE(ecore-x-screensaver,
558    [AC_HELP_STRING([--disable-ecore-x-screensaver],
559        [disable the ecore_x support for Xscreensaver extension.
560         @<:@default=detect@:>@])],
561    [want_ecore_x_screensaver=$enableval])
562
563 AC_ARG_ENABLE(ecore-x-shape,
564    [AC_HELP_STRING([--disable-ecore-x-shape],
565        [disable the ecore_x support for Xshape extension.
566         @<:@default=detect@:>@])],
567    [want_ecore_x_shape=$enableval])
568
569 AC_ARG_ENABLE(ecore-x-sync,
570    [AC_HELP_STRING([--disable-ecore-x-sync],
571        [disable the ecore_x support for Xsync extension.
572         @<:@default=detect@:>@])],
573    [want_ecore_x_sync=$enableval])
574
575 AC_ARG_ENABLE(ecore-x-xfixes,
576    [AC_HELP_STRING([--disable-ecore-x-xfixes],
577        [disable the ecore_x support for Xfixes extension.
578         @<:@default=detect@:>@])],
579    [want_ecore_x_xfixes=$enableval])
580
581 AC_ARG_ENABLE(ecore-x-xinerama,
582    [AC_HELP_STRING([--disable-ecore-x-xinerama],
583        [disable the ecore_x support for Xinerama extension.
584         @<:@default=detect@:>@])],
585    [want_ecore_x_xinerama=$enableval])
586
587 AC_ARG_ENABLE(ecore-x-xprint,
588    [AC_HELP_STRING([--disable-ecore-x-xprint],
589        [disable the ecore_x support for Xprint extension.
590         @<:@default=detect@:>@])],
591    [want_ecore_x_xprint=$enableval])
592
593 AC_ARG_ENABLE(ecore-x-xtest,
594    [AC_HELP_STRING([--disable-ecore-x-xtest],
595        [disable the ecore_x support for Xtest extension.
596         @<:@default=detect@:>@])],
597    [want_ecore_x_xtest=$enableval])
598
599 AC_ARG_ENABLE(ecore-x-cursor,
600    [AC_HELP_STRING([--disable-ecore-x-cursor],
601        [disable the ecore_x support for Xcursor extension.
602         @<:@default=detect@:>@])],
603    [want_ecore_x_cursor=$enableval])
604
605 AC_ARG_ENABLE(ecore-x-input,
606    [AC_HELP_STRING([--disable-ecore-x-input],
607        [disable the ecore_x support for Xinput/Xinput2 extension.
608         @<:@default=detect@:>@])],
609    [want_ecore_x_input=$enableval])
610
611
612 AC_ARG_ENABLE(ecore-x-xcb,
613    [AC_HELP_STRING([--enable-ecore-x-xcb],
614        [enable the ecore_x module with XCB backend. @<:@default=disabled@:>@])],
615    [want_ecore_x_xcb=$enableval],
616    [want_ecore_x_xcb="no"])
617
618 AC_MSG_CHECKING(whether ecore_x with XCB backend is to be built)
619 AC_MSG_RESULT($want_ecore_x_xcb)
620
621 if test "x$want_ecore_x_xcb" = "xyes" ; then
622   PKG_CHECK_MODULES(XCB, xcb xcb-icccm xcb-image xcb-keysyms pixman-1,
623     [ have_ecore_x_xcb="yes"
624       requirements_ecore_x="xcb xcb-icccm xcb-image xcb-keysyms pixman-1 ${requirements_ecore_x}" ],
625     [ have_ecore_x_xcb="no" ])
626
627   if test "x$have_ecore_x_xcb" = "xyes" ; then
628     if test "x$want_ecore_x_composite" != "xno"; then
629       PKG_CHECK_MODULES(XCB_COMPOSITE, xcb-composite,
630         [ have_ecore_x_xcb_composite="yes"
631           requirements_ecore_x="xcb-composite ${requirements_ecore_x}"
632           AC_DEFINE(ECORE_XCB_COMPOSITE, 1, [Build support for XCB composite]) ],
633         [ have_ecore_x_xcb_composite="no" ])
634     else
635       have_ecore_x_xcb_composite="no"
636       AC_MSG_NOTICE("composite extension explicitly disabled")
637     fi
638
639     if test "x$want_ecore_x_damage" != "xno"; then
640       PKG_CHECK_MODULES(XCB_DAMAGE, xcb-damage,
641         [ have_ecore_x_xcb_damage="yes"
642           requirements_ecore_x="xcb-damage ${requirements_ecore_x}"
643           AC_DEFINE(ECORE_XCB_DAMAGE, 1, [Build support for XCB damage]) ],
644         [ have_ecore_x_xcb_damage="no" ])
645     else
646       have_ecore_x_xcb_damage="no"
647       AC_MSG_NOTICE("damage extension explicitly disabled")
648     fi
649
650     if test "x$want_ecore_x_dpms" != "xno"; then
651       PKG_CHECK_MODULES(XCB_DPMS, xcb-dpms,
652         [ have_ecore_x_xcb_dpms="yes"
653           requirements_ecore_x="xcb-dpms ${requirements_ecore_x}"
654           AC_DEFINE(ECORE_XCB_DPMS, 1, [Build support for XCB dpms]) ],
655         [ have_ecore_x_xcb_dpms="no" ])
656     else
657       have_ecore_x_xcb_dpms="no"
658       AC_MSG_NOTICE("dpms extension explicitly disabled")
659     fi
660
661     if test "x$want_ecore_x_randr" != "xno"; then
662       PKG_CHECK_MODULES(XCB_RANDR, xcb-randr,
663         [ have_ecore_x_xcb_randr="yes"
664           requirements_ecore_x="xcb-randr ${requirements_ecore_x}"
665           AC_DEFINE(ECORE_XCB_RANDR, 1, [Build support for XCB randr]) ],
666         [ have_ecore_x_xcb_randr="no" ])
667     else
668       have_ecore_x_xcb_randr="no"
669       AC_MSG_NOTICE("randr extension explicitly disabled")
670     fi
671
672     if test "x$want_ecore_x_render" != "xno"; then
673       PKG_CHECK_MODULES(XCB_RENDER, xcb-render,
674         [ have_ecore_x_xcb_render="yes"
675           requirements_ecore_x="xcb-render ${requirements_ecore_x}"
676           AC_DEFINE(ECORE_XCB_RENDER, 1, [Build support for XCB render]) ],
677         [ have_ecore_x_xcb_render="no" ])
678     else
679       have_ecore_x_xcb_render="no"
680       AC_MSG_NOTICE("render extension explicitly disabled")
681     fi
682
683     if test "x$want_ecore_x_screensaver" != "xno"; then
684       PKG_CHECK_MODULES(XCB_SCREENSAVER, xcb-screensaver,
685         [ have_ecore_x_xcb_screensaver="yes"
686           requirements_ecore_x="xcb-screensaver ${requirements_ecore_x}"
687           AC_DEFINE(ECORE_XCB_SCREENSAVER, 1, [Build support for XCB screensaver]) ],
688         [ have_ecore_x_xcb_screensaver="no" ])
689     else
690       have_ecore_x_xcb_screensaver="no"
691       AC_MSG_NOTICE("screensaver extension explicitly disabled")
692     fi
693
694     if test "x$want_ecore_x_shape" != "xno"; then
695       PKG_CHECK_MODULES(XCB_SHAPE, xcb-shape,
696         [ have_ecore_x_xcb_shape="yes"
697           requirements_ecore_x="xcb-shape ${requirements_ecore_x}"
698           AC_DEFINE(ECORE_XCB_SHAPE, 1, [Build support for XCB shape]) ],
699         [ have_ecore_x_xcb_shape="no" ])
700     else
701       have_ecore_x_xcb_shape="no"
702       AC_MSG_NOTICE("shape extension explicitly disabled")
703     fi
704
705     if test "x$want_ecore_x_sync" != "xno"; then
706       PKG_CHECK_MODULES(XCB_SYNC, xcb-sync,
707         [ have_ecore_x_xcb_sync="yes"
708           requirements_ecore_x="xcb-sync ${requirements_ecore_x}"
709           AC_DEFINE(ECORE_XCB_SYNC, 1, [Build support for XCB sync]) ],
710         [ have_ecore_x_xcb_sync="no" ])
711     else
712       have_ecore_x_xcb_sync="no"
713       AC_MSG_NOTICE("sync extension explicitly disabled")
714     fi
715
716     if test "x$want_ecore_x_xfixes" != "xno"; then
717       PKG_CHECK_MODULES(XCB_XFIXES, xcb-xfixes,
718         [ have_ecore_x_xcb_xfixes="yes"
719           requirements_ecore_x="xcb-xfixes ${requirements_ecore_x}"
720           AC_DEFINE(ECORE_XCB_FIXES, 1, [Build support for XCB xfixes]) ],
721         [ have_ecore_x_xcb_xfixes="no" ])
722     else
723       have_ecore_x_xcb_xfixes="no"
724       AC_MSG_NOTICE("xfixes extension explicitly disabled")
725     fi
726
727     if test "x$want_ecore_x_xinerama" != "xno"; then
728       PKG_CHECK_MODULES(XCB_XINERAMA, xcb-xinerama,
729         [ have_ecore_x_xcb_xinerama="yes"
730           requirements_ecore_x="xcb-xinerama ${requirements_ecore_x}"
731           AC_DEFINE(ECORE_XCB_XINERAMA, 1, [Build support for XCB xinerama]) ],
732         [ have_ecore_x_xcb_xinerama="no" ])
733     else
734       have_ecore_x_xcb_xinerama="no"
735       AC_MSG_NOTICE("xinerama extension explicitly disabled")
736     fi
737
738     if test "x$want_ecore_x_xprint" != "xno"; then
739       PKG_CHECK_MODULES(XCB_XPRINT, xcb-xprint,
740         [ have_ecore_x_xcb_xprint="yes"
741           requirements_ecore_x="xcb-xprint ${requirements_ecore_x}"
742           AC_DEFINE(ECORE_XCB_XPRINT, 1, [Build support for XCB xprint]) ],
743         [ have_ecore_x_xcb_xprint="no" ])
744     else
745       have_ecore_x_xcb_xprint="no"
746       AC_MSG_NOTICE("xprint extension explicitly disabled")
747     fi
748
749     if test "x$want_ecore_x_xtest" != "xno"; then
750       PKG_CHECK_MODULES(XCB_XTEST, xcb-xtest,
751         [ have_ecore_x_xcb_xtest="yes"
752           requirements_ecore_x="xcb-xtest ${requirements_ecore_x}"
753           AC_DEFINE(ECORE_XCB_XTEST, 1, [Build support for XCB xtest]) ],
754         [ have_ecore_x_xcb_xtest="no" ])
755     else
756       have_ecore_x_xcb_xtest="no"
757       AC_MSG_NOTICE("xtest extension explicitly disabled")
758     fi
759
760     AC_DEFINE(HAVE_ECORE_X_XCB, 1, [Defined to 1 if XCB is enabled.])
761
762     x_cflags=$XCB_CFLAGS
763     x_libs=$XCB_LIBS
764     have_x="yes"
765
766     have_ecore_x_xcb_define="-DHAVE_ECORE_X_XCB"
767     AC_SUBST(have_ecore_x_xcb_define)
768   fi
769 fi
770
771 if ! test "x$have_ecore_x_xcb" = "xyes" ; then
772   AC_PATH_XTRA
773   AC_CHECK_HEADER(X11/X.h,
774     [
775      if test "x$want_evas_simple_x11" = "xyes"; then
776        x_libs="${x_libs} -lX11 -lXext"
777      else
778        x_dir=${x_dir:-/usr/X11R6}
779        x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}}
780        x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11 -lXext"
781      fi
782      have_ecore_x_xlib="yes"
783     ]
784   )
785
786   if test "x$have_ecore_x_xlib" = "xyes"; then
787     Xcursor_libs=""
788     Xcursor_cflags=""
789     use_Xcursor="no"
790     PCFLAGS=$CFLAGS
791     CFLAGS="$x_cflags $x_includes"
792
793     if test "x$want_ecore_x_cursor" = "xyes"; then
794       AC_CHECK_HEADER(X11/Xcursor/Xcursor.h,
795         [
796           AC_CHECK_LIB(Xcursor, XcursorImageLoadCursor,
797             [
798               AC_DEFINE(ECORE_XCURSOR, 1, [Build support for Xcursor])
799               Xcursor_cflags=""
800               Xcursor_libs="-lXcursor"
801               use_Xcursor="yes"
802             ], [
803               Xcursor_cflags=""
804               Xcursor_libs=""
805               use_Xcursor="no"
806             ], [
807               $x_libs -lXrender
808             ]
809           )
810         ], [
811           Xcursor_cflags=""
812           Xcursor_libs=""
813           use_Xcursor="no"
814         ], [
815           #include <X11/Xlib.h>
816         ]
817       )
818       CFLAGS=$PCFLAGS
819     else
820       Xcursor_cflags=""
821       Xcursor_libs=""
822       use_Xcursor="no"
823       AC_MSG_NOTICE("Xcursor explicitly disabled")
824     fi
825
826     AC_SUBST(Xcursor_cflags)
827     AC_SUBST(Xcursor_libs)
828
829     ECORE_CHECK_X_EXTENSION([Xkb], [XKB.h], [X11], [XkbSetDetectableAutoRepeat], [$want_ecore_x_xkb])
830     ECORE_CHECK_X_EXTENSION([Xcomposite], [Xcomposite.h], [Xcomposite], [XCompositeQueryExtension], [$want_ecore_x_composite])
831     ECORE_CHECK_X_EXTENSION([Xdamage], [Xdamage.h], [Xdamage], [XDamageSubtract], [$want_ecore_x_damage])
832     ECORE_CHECK_X_EXTENSION([Xdpms], [dpms.h], [Xdpms], [DPMSQueryExtension], [$want_ecore_x_dpms])
833     if test "x$use_xdpms" = "xno" ; then
834       ECORE_CHECK_X_EXTENSION([Xdpms], [dpms.h], [Xext], [DPMSQueryExtension], [$want_ecore_x_dpms])
835     fi
836     ECORE_CHECK_X_EXTENSION([Xfixes], [Xfixes.h], [Xfixes], [XFixesExpandRegion], [$want_ecore_x_xfixes])
837     ECORE_CHECK_X_EXTENSION([Xinerama], [Xinerama.h], [Xinerama], [XineramaQueryScreens], [$want_ecore_x_xinerama])
838     ECORE_CHECK_X_EXTENSION([Xprint], [Print.h], [Xp], [XpQueryScreens], [$want_ecore_x_xprint])
839     ECORE_CHECK_X_EXTENSION([Xrandr], [Xrandr.h], [Xrandr], [XRRGetScreenResourcesCurrent], [$want_ecore_x_randr])
840     ECORE_CHECK_X_EXTENSION([Xrender], [Xrender.h], [Xrender], [XRenderFindVisualFormat], [$want_ecore_x_render])
841     ECORE_CHECK_X_EXTENSION([Xtest], [XTest.h], [Xtst], [XTestFakeKeyEvent], [$want_ecore_x_xtest])
842     ECORE_CHECK_X_EXTENSION([Xss], [scrnsaver.h], [Xss], [XScreenSaverSelectInput], [$want_ecore_x_screensaver])
843     ECORE_CHECK_X_EXTENSION([Xi2], [XInput2.h], [Xi], [XIQueryDevice], [$want_ecore_x_input])
844
845     ecore_x_libs_private="${Xcursor_libs} ${XKB_LIBS} ${XCOMPOSITE_LIBS} ${XDAMAGE_LIBS} ${XDPMS_LIBS} ${XFIXES_LIBS} ${XINERAMA_LIBS} ${XPRINT_LIBS} ${XRANDR_LIBS} ${XRENDER_LIBS} ${XTEST_LIBS} ${XSS_LIBS} ${XI2_LIBS}"
846
847     AC_DEFINE(HAVE_ECORE_X_XLIB, 1, [Defined to 1 if Xlib is enabled.])
848     have_x="yes"
849
850     have_ecore_x_xlib="yes"
851   fi
852 fi
853
854 AC_SUBST(x_cflags)
855 AC_SUBST(x_includes)
856 AC_SUBST(x_libs)
857 AC_SUBST(ecore_x_libs_private)
858
859 AM_CONDITIONAL(BUILD_ECORE_X_XLIB, test $have_ecore_x_xlib = yes)
860 AM_CONDITIONAL(BUILD_ECORE_X_XCB, test $have_ecore_x_xcb = yes)
861
862
863 # Evas library (ecore_config, ecore_input_evas, ecore_imf_evas and ecore_evas)
864
865 PKG_CHECK_MODULES([EVAS], [evas >= 1.0.0],
866    [have_evas="yes"],
867    [have_evas="no"])
868
869
870 ### Checks for header files
871
872 AC_HEADER_SYS_WAIT
873
874 have_addrinfo="no"
875 case "$host_os" in
876    mingw* | cegcc*)
877       AC_DEFINE(HAVE_DLFCN_H, 1, [Define to 1 if you have the <dlfcn.h> header file.])
878       AC_DEFINE(HAVE_SYS_MMAN_H, 1, [Define to 1 if you have the <sys/mman.h> header file.])
879       AC_DEFINE(HAVE_SYS_TIME_H, 1, [Define to 1 if you have the <sys/time.h> header file.])
880       have_addrinfo="yes"
881       ;;
882    *)
883       AC_CHECK_HEADERS([dlfcn.h features.h langinfo.h locale.h sys/time.h sys/mman.h signal.h sys/resource.h])
884       ;;
885 esac
886
887 # ecore_con
888
889 AC_CHECK_HEADERS([arpa/inet.h arpa/nameser.h netinet/tcp.h netinet/in.h sys/socket.h sys/un.h ws2tcpip.h netdb.h])
890
891 if test "x${ac_cv_header_netdb_h}" = "xyes" ; then
892    have_addrinfo="yes"
893 fi
894
895 # Framebuffer (ecore_fb)
896 have_fb="no"
897 AC_CHECK_HEADER([linux/fb.h],
898    [AC_CHECK_HEADER([linux/input.h], [have_fb="yes"])])
899
900 # Cocoa header files (ecore_cocoa)
901
902 cocoa_ldflags="";
903 have_cocoa="no"
904 m4_ifdef([AC_PROG_OBJC], [
905     if test "x${have_gnu_objc}" = "xyes" ; then
906        AC_LANG_PUSH([Objective C])
907        AC_CHECK_HEADER([Cocoa/Cocoa.h],
908           [
909            have_cocoa="yes"
910            cocoa_ldflags="-framework Cocoa"
911           ])
912        AC_LANG_POP([Objective C])
913     fi
914 ])
915 AC_SUBST(cocoa_ldflags)
916
917 want_epoll=yes
918 AC_ARG_ENABLE(epoll,
919   AC_HELP_STRING([--enable-epoll], [enable or disable epoll support]),
920   [want_epoll=$enableval])
921
922 if test "x${want_epoll}" = "xyes" ; then
923   # check for epoll support
924   AC_CHECK_HEADERS([sys/epoll.h])
925 fi
926
927
928 # thread support
929
930 EFL_CHECK_THREADS(
931    [
932     if test "x${_efl_have_posix_threads}" = "xyes" ; then
933        have_threads="POSIX"
934     else
935        if test "x${_efl_have_win32_threads}" = "xyes" ; then
936           have_threads="Win32"
937        else
938           have_threads="no"
939        fi
940     fi
941    ],
942    [have_threads="no"])
943
944 ### Checks for types
945 AC_CHECK_SIZEOF(int, 4)
946 AC_CHECK_SIZEOF(long, 4)
947
948
949 ### Checks for structures
950
951
952 ### Checks for compiler characteristics
953 AM_PROG_CC_STDC
954 AC_C_CONST
955 AC_C_BIGENDIAN
956 AC_HEADER_STDC
957 AC_C___ATTRIBUTE__
958
959 WIN32_CPPFLAGS=""
960 WIN32_CFLAGS=""
961 case "$host_os" in
962    mingw32ce*)
963       WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
964       ;;
965    cegcc*)
966       WIN32_CPPFLAGS="-D_WIN32_WCE=0x0420"
967       WIN32_CFLAGS="-mwin32"
968       ;;
969    mingw*)
970       WIN32_CPPFLAGS="-D_WIN32_WINNT=0x0501"
971       ;;
972 esac
973 AC_SUBST(WIN32_CPPFLAGS)
974 AC_SUBST(WIN32_CFLAGS)
975
976
977 ### Checks for linker characteristics
978
979 # use --enable-auto-import on Windows
980
981 lt_enable_auto_import=""
982 case "$host_os" in
983    mingw* | cegcc*)
984       lt_enable_auto_import="-Wl,--enable-auto-import"
985       ;;
986 esac
987 AC_SUBST(lt_enable_auto_import)
988
989 ### Checks for library functions
990 AC_FUNC_ALLOCA
991 AC_CHECK_FUNCS(gettimeofday strlcpy)
992
993 have_atfile_source=auto
994 AC_ARG_ENABLE(atfile-source,
995         AC_HELP_STRING([--disable-atfile-source],
996                        [disable use of atfile source functions as openat and mkdirat @<:@default=detect@:>@]),
997         [have_atfile_source=$enableval], [have_atfile_source=auto])
998
999 if test "x$have_atfile_source" != "xno"; then
1000         AC_CHECK_FUNCS(mkdirat,
1001                 [
1002                 have_atfile_source=yes
1003                 AC_DEFINE(HAVE_ATFILE_SOURCE, 1, [mkdirat exists])
1004                 ],
1005                 [
1006                 if test "x$have_atfile_source" = "xyes"; then
1007                         AC_MSG_ERROR([required atfile-source but no mkdirat()])
1008                 fi
1009                 have_atfile_source=no
1010                 ])
1011 fi
1012
1013 ### Checks for optionnal feature
1014 AC_CHECK_FUNC(mallinfo,
1015         [
1016           have_mallinfo=yes
1017           AC_DEFINE(HAVE_MALLINFO, 1, [Gather memory statistic])
1018         ], [
1019           have_mallinfo=no
1020         ])
1021
1022 ### Ecore modules
1023
1024 ## Core modules
1025
1026 # ecore_con
1027 ECORE_CHECK_MODULE([con], [${want_ecore_con}], [Con], [${have_addrinfo}])
1028
1029 have_curl="no"
1030 have_gnutls="no"
1031 have_openssl="no"
1032 have_cares="no"
1033 if test "x${have_ecore_con}" = "xyes" ; then
1034
1035    ECORE_CHECK_CURL([${want_curl}],
1036       [
1037        have_curl="yes"
1038        requirements_ecore_con="libcurl ${requirements_ecore_con}"
1039       ],
1040       [have_curl="no"])
1041
1042    ECORE_CHECK_GNUTLS([${want_gnutls}],
1043       [have_gnutls="yes"],
1044       [have_gnutls="no"])
1045
1046    ECORE_CHECK_OPENSSL([${want_openssl}],
1047       [have_openssl="yes"],
1048       [have_openssl="no"])
1049
1050    if test "x${have_gnutls}" = "xyes" ; then
1051       requirements_ecore_con="gnutls ${requirements_ecore_con}"
1052       # no need to add it to req_ecore_ipc, since they
1053       # depends on ecore_con anyway.
1054    else
1055       if test "x${have_openssl}" = "xyes" ; then
1056          requirements_ecore_con="openssl ${requirements_ecore_con}"
1057          # no need to add it to req_ecore_ipc, since they
1058          # depends on ecore_con anyway.
1059       fi
1060    fi
1061
1062    ECORE_CHECK_CARES([${want_cares}],
1063       [
1064        have_cares="yes"
1065        requirements_ecore_con="libcares ${requirements_ecore_con}"
1066       ],
1067       [have_cares="no"])
1068
1069 fi
1070
1071 AM_CONDITIONAL([HAVE_CARES], [test "x${have_cares}" = "xyes"])
1072
1073 # ecore_ipc
1074 ECORE_CHECK_MODULE([ipc], [${want_ecore_ipc}], [Ipc], [${have_ecore_con}],
1075    [requirements_ecore_ipc="ecore-con >= 1.0.0 ${requirements_ecore_ipc}"])
1076
1077 # ecore_file
1078 ECORE_CHECK_MODULE([file], [${want_ecore_file}], [File])
1079
1080 have_poll="no"
1081 have_inotify="no"
1082 have_notify_win32="no"
1083 if test "x${have_ecore_file}" = "xyes" ; then
1084    ECORE_CHECK_POLL([${want_poll}], [have_poll="yes"], [have_poll="no"])
1085    ECORE_CHECK_INOTIFY([${want_inotify}], [have_inotify="yes"], [have_inotify="no"])
1086    ECORE_CHECK_NOTIFY_WIN32([${want_notify_win32}], [have_notify_win32="yes"], [have_notify_win32="no"])
1087
1088    if test "x${have_ecore_con}" = "xyes" ; then
1089       requirements_ecore_file="ecore-con >= 1.0.0 ${requirements_ecore_file}"
1090    fi
1091 fi
1092
1093 # ecore_config
1094 #ecore_config_deps="no"
1095 #if test "x${have_eet}" = "xyes" -a "x${have_evas}"  -a "x${have_ecore_ipc}" ; then
1096 #   ecore_config_deps="yes"
1097 #fi
1098
1099 #ECORE_CHECK_MODULE([config], [${want_ecore_config}], [Config], [${ecore_config_deps}],
1100 #   [requirements_ecore_config="ecore-ipc >= 1.0.0 evas >= 1.0.0 eet >= 1.4.0 ${requirements_ecore_config}"])
1101
1102 AM_CONDITIONAL(BUILD_ECORE_CONFIG, false)
1103
1104 # ecore_imf
1105
1106 ECORE_CHECK_MODULE([imf], [${want_ecore_imf}], [Imf])
1107
1108 # ecore_imf_evas
1109
1110 ecore_imf_evas_deps="no"
1111 if test "x${have_ecore_imf}" = "xyes" -a "x${have_evas}" = "xyes" ; then
1112    ecore_imf_evas_deps="yes"
1113 fi
1114
1115 ECORE_CHECK_MODULE([imf-evas], [${want_ecore_imf}], [Imf_Evas], [${ecore_imf_evas_deps}],
1116    [requirements_ecore_imf_evas="ecore-imf >= 1.0.0 evas >= 1.0.0 ${requirements_ecore_imf_evas}"])
1117
1118 # ecore_input{_evas}
1119 ECORE_CHECK_MODULE([input], [${want_ecore_input}], [Input])
1120 ECORE_CHECK_MODULE([input-evas], [${want_ecore_input}], [Input_Evas], [${have_evas}],
1121    [requirements_ecore_input_evas="ecore-input >= 1.0.0 evas >= 1.0.0 ${requirements_ecore_input}"])
1122
1123 ## Graphic systems
1124
1125 # ecore_x{cb}
1126
1127 ecore_x_deps="no"
1128 if test "x${have_x}" = "xyes" -a \
1129         "x${have_ecore_input}" = "xyes" ; then
1130    ecore_x_deps="yes"
1131 fi
1132
1133 ECORE_CHECK_MODULE([x], [${want_ecore_x}], [X], [${ecore_x_deps}],
1134   [
1135    ecore_x_libs="$ecore_x_libs $x_libs"
1136    requirements_ecore_x="ecore-input >= 1.0.0 ${requirements_ecore_x}"
1137   ])
1138
1139 # ecore_win32
1140
1141 ECORE_CHECK_MODULE([win32], [${want_ecore_win32}], [Win32], [${have_ecore_input}],
1142    [
1143     ecore_win32_libs="-lole32 -lgdi32"
1144     requirements_ecore_win32="ecore-input >= 1.0.0 ${requirements_ecore_win32}"
1145    ])
1146 AC_SUBST(ecore_win32_libs)
1147
1148 # ecore_cocoa
1149
1150 ecore_cocoa_deps="no"
1151 if test "x${have_ecore_input}" = "xyes" -a "x${have_cocoa}" = "xyes" ; then
1152    ecore_cocoa_deps="yes"
1153 fi
1154
1155 ECORE_CHECK_MODULE([cocoa], [${want_ecore_cocoa}], [Cocoa], [${ecore_cocoa_deps}],
1156    [requirements_ecore_cocoa="ecore-input >= 1.0.0 ${requirements_ecore_cocoa}"])
1157
1158 # ecore_sdl
1159
1160 ecore_sdl_deps="no"
1161 if test "x${have_sdl}" = "xyes" -a "x${have_ecore_input}" = "xyes" ; then
1162    ecore_sdl_deps="yes"
1163 fi
1164
1165 ECORE_CHECK_MODULE([sdl], [${want_ecore_sdl}], [Sdl], [${ecore_sdl_deps}],
1166    [requirements_ecore_sdl="ecore-input >= 1.0.0 ${requirements_ecore_sdl}"])
1167
1168 # ecore_fb
1169 ECORE_CHECK_MODULE([fb], [${want_ecore_fb}], [FB], [$have_fb])
1170
1171 if test "x${have_ecore_fb}" = "xyes" ; then
1172    ECORE_CHECK_TSLIB([${want_tslib}],
1173       [
1174        have_tslib="yes"
1175        requirements_ecore_fb="${_tslib_requirement} ${requirements_ecore_fb}"
1176       ],
1177       [have_tslib="no"])
1178 fi
1179
1180 # ecore_directfb
1181
1182 ECORE_CHECK_MODULE([directfb], [${want_ecore_directfb}], [DirectFB], [${have_directfb}],
1183    [requirements_ecore_directfb="directfb ${requirements_ecore_directfb}"])
1184
1185 # ecore_wince
1186
1187 ECORE_CHECK_MODULE([wince], [${want_ecore_wince}], [WinCE], [${have_ecore_input}],
1188    [requirements_ecore_win32="ecore-input >= 1.0.0 ${requirements_ecore_win32}"])
1189
1190 ## Ecore Evas
1191
1192 # ecore_evas
1193
1194 ecore_evas_deps="no"
1195 if test "x${have_evas}" = "xyes" -a "x${have_ecore_input}" = "xyes" -a "x${have_ecore_input_evas}" = "xyes" ; then
1196    ecore_evas_deps="yes"
1197 fi
1198
1199 ECORE_CHECK_MODULE([evas], [${want_ecore_evas}], [Evas], [${ecore_evas_deps}],
1200   [requirements_ecore_evas="ecore-input >= 1.0.0 ecore-input-evas >= 1.0.0 evas >= 1.0.0 ${requirements_ecore_evas}"])
1201
1202 # ecore_evas_buffer
1203
1204 ECORE_EVAS_CHECK_MODULE([software-buffer],
1205    [${want_ecore_evas_software_buffer}],
1206    [Software Buffer],
1207    [yes])
1208
1209 # ecore_evas_x11
1210
1211 # ecore_evas_software_x11
1212
1213 ECORE_EVAS_CHECK_MODULE([software-x11],
1214    [${want_ecore_evas_software_x11}],
1215    [Software X11],
1216    [${have_ecore_x}])
1217
1218 have_ecore_evas_software_xlib=no"
1219 have_ecore_evas_software_xcb=no"
1220 if test "x$have_ecore_evas_software_x11" = "xyes" ; then
1221    have_ecore_evas_software_xlib=`${PKG_CONFIG} --variable=Xlib evas-software-x11`
1222    if test "x${have_ecore_evas_software_xlib}" = "xyes" -a "x${have_ecore_x_xlib}" = "xyes" ; then
1223       AC_DEFINE(BUILD_ECORE_EVAS_SOFTWARE_XLIB, 1, [Evas Software Xlib Engine Support])
1224    fi
1225    have_ecore_evas_software_xcb=`${PKG_CONFIG} --variable=XCB evas-software-x11`
1226    if test "x$have_ecore_evas_software_xcb" = "xyes" -a "x${have_ecore_x_xcb}" = "xyes" ; then
1227       AC_DEFINE(BUILD_ECORE_EVAS_SOFTWARE_XCB, 1, [Evas Software XCB Engine Support])
1228    fi
1229 fi
1230
1231 # ecore_evas_xrender_x11
1232
1233 ECORE_EVAS_CHECK_MODULE([xrender-x11],
1234    [${want_ecore_evas_xrender_x11}],
1235    [XRender Xlib],
1236    [${have_ecore_x_xlib}])
1237
1238 # ecore_evas_opengl_x11
1239
1240 ECORE_EVAS_CHECK_MODULE([opengl-x11],
1241    [${want_ecore_evas_opengl_x11}],
1242    [OpenGL Xlib],
1243    [${have_ecore_x_xlib}])
1244
1245 # ecore_evas_software_x11 16 bits
1246
1247 ECORE_EVAS_CHECK_MODULE([software-16-x11],
1248    [${want_ecore_evas_software_16_x11}],
1249    [Software Xlib 16 bits],
1250    [${have_ecore_x_xlib}])
1251
1252 ECORE_EVAS_CHECK_MODULE([software-8-x11],
1253     [$want_ecore_evas_software_8_x11],
1254     [Software 8bit X11],
1255     $have_ecore_x_xcb)
1256
1257
1258 # ecore_evas_xrender_xcb
1259
1260 ECORE_EVAS_CHECK_MODULE([xrender-xcb],
1261    [${want_ecore_evas_xrender_xcb}],
1262    [XRender XCB],
1263    [${ecore_evas_xcb_deps}])
1264
1265 if test "x$have_ecore_evas_software_x11" = "xyes" -o \
1266         "x$have_ecore_evas_xrender_x11" = "xyes" -o \
1267         "x$have_ecore_evas_opengl_x11" = "xyes" -o \
1268         "x$have_ecore_evas_software_8_x11" = "xyes" -o \
1269         "x$have_ecore_evas_software_16_x11" = "xyes" -o \
1270         "x$have_ecore_evas_software_xcb" = "xyes" -o \
1271         "x$have_ecore_evas_xrender_xcb" = "xyes"; then
1272    AC_DEFINE(BUILD_ECORE_EVAS_X11, 1, [Support for X Window Engines in Ecore_Evas])
1273    requirements_ecore_evas="ecore-x >= 1.0.0 ${requirements_ecore_evas}"
1274 fi
1275
1276 # ecore_evas_win32
1277
1278 ECORE_EVAS_CHECK_MODULE([software-gdi],
1279    [${want_ecore_evas_software_gdi}],
1280    [Software GDI],
1281    [${have_ecore_win32}])
1282
1283 ECORE_EVAS_CHECK_MODULE([software-ddraw],
1284    [${want_ecore_evas_software_ddraw}],
1285    [Software DirectDraw],
1286    [${have_ecore_win32}])
1287
1288 ECORE_EVAS_CHECK_MODULE([direct3d],
1289    [${want_ecore_evas_direct3d}],
1290    [Direct3d],
1291    [${have_ecore_win32}])
1292
1293 ECORE_EVAS_CHECK_MODULE([opengl-glew],
1294    [${want_ecore_evas_opengl_glew}],
1295    [Glew OpenGL],
1296    [${have_ecore_win32}])
1297
1298 ECORE_EVAS_CHECK_MODULE([software-16-ddraw],
1299    [${want_ecore_evas_software_16_ddraw}],
1300    [16 bpp Software DirectDraw],
1301    [${have_ecore_win32}])
1302
1303 if test "x${have_ecore_evas_software_gdi}" = "xyes" -o \
1304         "x${have_ecore_evas_software_ddraw}" = "xyes" -o \
1305         "x${have_ecore_evas_direct3d}" = "xyes" -o \
1306         "x${have_ecore_evas_opengl_glew}" = "xyes" -o \
1307         "x${have_ecore_evas_software_16_ddraw}" = "xyes" ; then
1308    AC_DEFINE(BUILD_ECORE_EVAS_WIN32, 1, [Support for Win32 Engine in Ecore_Evas])
1309    requirements_ecore_evas="ecore-win32 >= 1.0.0 ${requirements_ecore_evas}"
1310 fi
1311
1312 # ecore_evas_cocoa
1313
1314 ECORE_EVAS_CHECK_MODULE([cocoa],
1315    [${want_ecore_evas_cocoa}],
1316    [Cocoa],
1317    [${have_ecore_cocoa}],
1318    [requirements_ecore_evas="ecore-cocoa >= 1.0.0 ${requirements_ecore_evas}"])
1319
1320 # ecore_evas_software_sdl
1321
1322 ECORE_EVAS_CHECK_MODULE([software-sdl],
1323    [${want_ecore_evas_software_sdl}],
1324    [Software SDL],
1325    [${have_ecore_sdl}],
1326    [requirements_ecore_evas="ecore-sdl >= 1.0.0 ${requirements_ecore_evas}"])
1327
1328 # ecore_evas_gl_sdl
1329
1330 ECORE_EVAS_CHECK_MODULE([opengl-sdl],
1331    [${want_ecore_evas_gl_sdl}],
1332    [OpenGL SDL],
1333    [${have_ecore_sdl}],
1334    [requirements_ecore_evas="ecore-sdl >= 1.0.0 ${requirements_ecore_evas}"])
1335
1336 # ecore_evas_directfb
1337
1338 ECORE_EVAS_CHECK_MODULE([directfb],
1339    [${want_ecore_evas_directfb}],
1340    [DirectFB],
1341    [${have_ecore_directfb}],
1342    [requirements_ecore_evas="ecore-directfb >= 1.0.0 ${requirements_ecore_evas}"])
1343
1344 # ecore_evas_fb
1345
1346 ECORE_EVAS_CHECK_MODULE([fb],
1347    [${want_ecore_evas_fb}],
1348    [Linux Framebuffer],
1349    [${have_ecore_fb}],
1350    [requirements_ecore_evas="ecore-fb >= 1.0.0 ${requirements_ecore_evas}"])
1351
1352 # ecore_evas_wince
1353
1354 ECORE_EVAS_CHECK_MODULE([software-16-wince],
1355    [${want_ecore_evas_software_16_wince}],
1356    [16 bpp Software Windows CE],
1357    [${have_ecore_wince}],
1358    [requirements_ecore_evas="ecore-wince >= 1.0.0 ${requirements_ecore_evas}"])
1359
1360
1361
1362 ### requirements
1363
1364 AC_SUBST(requirements_ecore)
1365 AC_SUBST(requirements_ecore_con)
1366 #AC_SUBST(requirements_ecore_config)
1367 AC_SUBST(requirements_ecore_directfb)
1368 AC_SUBST(requirements_ecore_evas)
1369 AC_SUBST(requirements_ecore_fb)
1370 AC_SUBST(requirements_ecore_file)
1371 AC_SUBST(requirements_ecore_imf)
1372 AC_SUBST(requirements_ecore_imf_evas)
1373 AC_SUBST(requirements_ecore_input)
1374 AC_SUBST(requirements_ecore_input_evas)
1375 AC_SUBST(requirements_ecore_ipc)
1376 AC_SUBST(requirements_ecore_cocoa)
1377 AC_SUBST(requirements_ecore_sdl)
1378 AC_SUBST(requirements_ecore_x)
1379 AC_SUBST(requirements_ecore_win32)
1380 AC_SUBST(requirements_ecore_wince)
1381
1382 AC_OUTPUT([
1383 Makefile
1384 ecore-con.pc
1385 ecore-config.pc
1386 ecore-directfb.pc
1387 ecore-evas.pc
1388 ecore-fb.pc
1389 ecore-file.pc
1390 ecore-cocoa.pc
1391 ecore-imf.pc
1392 ecore-imf-evas.pc
1393 ecore-ipc.pc
1394 ecore-x.pc
1395 ecore-input.pc
1396 ecore-input-evas.pc
1397 ecore-win32.pc
1398 ecore-sdl.pc
1399 ecore-wince.pc
1400 ecore.pc
1401 doc/ecore.dox
1402 doc/Makefile
1403 src/Makefile
1404 src/bin/Makefile
1405 src/lib/Makefile
1406 src/lib/ecore/Makefile
1407 src/lib/ecore_con/Makefile
1408 src/lib/ecore_config/Makefile
1409 src/lib/ecore_directfb/Makefile
1410 src/lib/ecore_evas/Makefile
1411 src/lib/ecore_fb/Makefile
1412 src/lib/ecore_file/Makefile
1413 src/lib/ecore_cocoa/Makefile
1414 src/lib/ecore_sdl/Makefile
1415 src/lib/ecore_imf/Makefile
1416 src/lib/ecore_imf_evas/Makefile
1417 src/lib/ecore_input/Makefile
1418 src/lib/ecore_input_evas/Makefile
1419 src/lib/ecore_ipc/Makefile
1420 src/lib/ecore_win32/Makefile
1421 src/lib/ecore_wince/Makefile
1422 src/lib/ecore_x/Makefile
1423 src/lib/ecore_x/xlib/Makefile
1424 src/lib/ecore_x/xcb/Makefile
1425 README
1426 ecore.spec
1427 $po_makefile_in
1428 ])
1429
1430 echo
1431 echo "$PACKAGE $VERSION"
1432 echo
1433 echo "Optional Modules:"
1434 echo
1435 echo " Core:"
1436 echo
1437 echo "  Ecore........................: always"
1438 echo "    Thread support.............: $have_threads"
1439 echo "    GLib support...............: $have_glib"
1440 echo "    Always integrate GLib......: $want_glib_integration_always"
1441 echo "    Use g_main_loop............: $want_g_main_loop"
1442 echo "    Gathering memory statistic.: $have_mallinfo"
1443 echo "  Ecore_Con....................: $have_ecore_con"
1444 if test "x$have_ecore_con" = "xyes" ; then
1445   echo $ECHO_N "    OpenSSL....................: $have_openssl $ECHO_C"
1446 if test "x$have_gnutls" = "xyes" ; then
1447   echo " (disabled)"
1448 else
1449   echo
1450 fi
1451   echo "    GnuTLS.....................: $have_gnutls"
1452   echo "    CURL.......................: $have_curl"
1453   echo "    Abstract Sockets...........: $want_abstract_sockets"
1454   echo "    c-ares.....................: $have_cares"
1455 fi
1456 echo "  Ecore_Ipc....................: $have_ecore_ipc"
1457 if test "x$have_ecore_ipc" = "xyes" ; then
1458   echo $ECHO_N "    OpenSSL....................: $have_openssl $ECHO_C"
1459 if test "x$have_gnutls" = "xyes" ; then
1460   echo " (disabled)"
1461 else
1462   echo
1463 fi
1464   echo "    GnuTLS.....................: $have_gnutls"
1465 fi
1466 echo "  Ecore_File...................: $have_ecore_file"
1467 if test "x$have_ecore_file" = "xyes" ; then
1468   echo "    Inotify....................: $have_inotify"
1469   echo "    Windows notification.......: $have_notify_win32"
1470   echo "    Poll.......................: $have_poll"
1471   echo "    CURL.......................: $have_curl"
1472 fi
1473 #echo "  Ecore_Config.................: $have_ecore_config (deprecated)"
1474 echo "  Ecore_IMF....................: $have_ecore_imf"
1475 echo "  Ecore_IMF_Evas...............: $have_ecore_imf_evas"
1476 echo "  Ecore_Input..................: $have_ecore_input"
1477 echo "  Ecore_Input_Evas.............: $have_ecore_input_evas"
1478
1479 echo
1480 echo " Graphic systems:"
1481 echo
1482
1483 if test "x$have_ecore_x" = "xyes" ; then
1484   if test "x$have_ecore_x_xcb" = "xyes" ; then
1485     echo "  Ecore_X (XCB backend)........: $have_ecore_x_xcb"
1486     echo "    Xprint.....................: $have_ecore_x_xcb_xprint"
1487     echo "    Xinerama...................: $have_ecore_x_xcb_xinerama"
1488     echo "    Xrandr.....................: $have_ecore_x_xcb_randr"
1489     echo "    Xscreensaver...............: $have_ecore_x_xcb_screensaver"
1490     echo "    Xshape.....................: $have_ecore_x_xcb_shape"
1491     echo "    Xsync......................: $have_ecore_x_xcb_sync"
1492     echo "    Xrender....................: $have_ecore_x_xcb_render"
1493     echo "    Xcomposite.................: $have_ecore_x_xcb_composite"
1494     echo "    Xfixes.....................: $have_ecore_x_xcb_xfixes"
1495     echo "    Xdamage....................: $have_ecore_x_xcb_damage"
1496     echo "    Xdpms......................: $have_ecore_x_xcb_dpms"
1497     echo "    Xtest......................: $have_ecore_x_xcb_xtest"
1498   else
1499     echo "  Ecore_X (Xlib backend).......: $have_ecore_x"
1500     echo "    Xcursor....................: $use_Xcursor"
1501     echo "    Xkb........................: $use_xkb"
1502     echo "    Xprint.....................: $use_xprint"
1503     echo "    Xinerama...................: $use_xinerama"
1504     echo "    Xrandr.....................: $use_xrandr"
1505     echo "    Xscreensaver...............: $use_xss"
1506     echo "    Xrender....................: $use_xrender"
1507     echo "    Xcomposite.................: $use_xcomposite"
1508     echo "    Xfixes.....................: $use_xfixes"
1509     echo "    Xdamage....................: $use_xdamage"
1510     echo "    Xdpms......................: $use_xdpms"
1511     echo "    Xtest......................: $use_xtest"
1512     echo "    XIM........................: $want_xim"
1513     echo "    Xi2........................: $use_xi2"
1514   fi
1515 else
1516   echo "  Ecore_X......................: $have_ecore_x"
1517 fi
1518 echo "  Ecore_Win32..................: $have_ecore_win32"
1519 echo "  Ecore_Cocoa..................: $have_ecore_cocoa"
1520 echo "  Ecore_SDL....................: $have_ecore_sdl"
1521 echo "  Ecore_FB.....................: $have_ecore_fb"
1522 if test "x${have_ecore_fb}" = "xyes" ; then
1523   echo "    Touchscreen................: $have_tslib"
1524 fi
1525 echo "  Ecore_DirectFB...............: $have_ecore_directfb"
1526 echo "  Ecore_WinCE..................: $have_ecore_wince"
1527
1528 echo
1529 echo " Ecore Evas:"
1530 echo
1531
1532 echo "  Ecore_Evas...................: $have_ecore_evas"
1533 if test "x${have_ecore_evas}" = "xyes" ; then
1534   echo "    Software Memory Buffer.....: $have_ecore_evas_software_buffer"
1535   if test "x${have_ecore_evas_software_x11}" = "xyes" ; then
1536     echo "    Software X11...............: $have_ecore_evas_software_x11 (Xlib=${have_ecore_evas_software_xlib}) (XCB=${have_ecore_evas_software_xcb})"
1537   else
1538     echo "    Software X11...............: $have_ecore_evas_software_x11"
1539   fi
1540   echo "    XRender X11................: $have_ecore_evas_xrender_x11"
1541   echo "    OpenGL X11.................: $have_ecore_evas_opengl_x11"
1542   echo "    XRender XCB................: $have_ecore_evas_xrender_xcb"
1543   echo "    Software GDI...............: $have_ecore_evas_software_gdi"
1544   echo "    Software DirectDraw........: $have_ecore_evas_software_ddraw"
1545   echo "    Direct3D...................: $have_ecore_evas_direct3d"
1546   echo "    OpenGL Glew................: $have_ecore_evas_opengl_glew"
1547   echo "    Cocoa......................: $have_ecore_evas_cocoa"
1548   echo "    Software SDL...............: $have_ecore_evas_software_sdl"
1549   echo "    OpenGL SDL.................: $have_ecore_evas_opengl_sdl"
1550   echo "    DirectFB...................: $have_ecore_evas_directfb"
1551   echo "    Software Framebuffer.......: $have_ecore_evas_fb"
1552   echo "    Software 8bit grayscale XCB: $have_ecore_evas_software_8_x11"
1553   echo "    Software 16bit X11.........: $have_ecore_evas_software_16_x11"
1554   echo "    Software 16bit DirectDraw..: $have_ecore_evas_software_16_ddraw"
1555   echo "    Software 16bit WinCE.......: $have_ecore_evas_software_16_wince"
1556 fi
1557 echo
1558 echo "  Maximum log level....: ${with_max_log_level}"
1559 echo "Documentation..........: ${build_doc}"
1560 echo
1561 echo "Compilation............: make (or gmake)"
1562 echo "  CPPFLAGS.............: $CPPFLAGS"
1563 echo "  CFLAGS...............: $CFLAGS"
1564 echo "  CXXFLAGS.............: $CXXFLAGS"
1565 echo "  LDFLAGS..............: $LDFLAGS"
1566 echo
1567 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
1568 echo "  prefix...............: $prefix"
1569 echo