eina: fix typo in doc
[framework/uifw/eina.git] / configure.ac
1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [2])
5 m4_define([v_mic], [0])
6 m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7 m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8 ##--   When released, remove the dnl on the below line
9 m4_undefine([v_rev])
10 ##--   When doing snapshots - change soname. remove dnl on below line
11 dnl m4_define([relname], [ver-pre-svn-07])
12 dnl m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
15 m4_define([lt_cur], m4_eval(v_maj + v_min))
16 m4_define([lt_rev], v_mic)
17 m4_define([lt_age], v_min)
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
20
21 AC_INIT([eina], [v_ver]-beta, [enlightenment-devel@lists.sourceforge.net])
22 AC_PREREQ([2.59])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
25
26 AC_CONFIG_HEADERS([config.h])
27 AH_TOP([
28 #ifndef EFL_CONFIG_H__
29 #define EFL_CONFIG_H__
30 ])
31 AH_BOTTOM([
32 #endif /* EFL_CONFIG_H__ */
33 ])
34
35 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
37
38 AC_GNU_SOURCE
39 AC_SYS_LARGEFILE
40
41 AC_LIBTOOL_WIN32_DLL
42 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
43 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
44 AC_PROG_LIBTOOL
45
46 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
47 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
48 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
49 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
50 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
51 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
52 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
53 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
54 version_info="lt_cur:lt_rev:lt_age"
55 release_info="v_rel"
56 AC_SUBST(version_info)
57 AC_SUBST(release_info)
58 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
59 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
60 VMAJ=v_maj
61 AC_SUBST(VMAJ)
62
63
64 ### Needed information
65
66 AC_CANONICAL_BUILD
67 AC_CANONICAL_HOST
68
69 requirement_eina=""
70
71 case "$host_os" in
72    mingw32ce*)
73       MODULE_ARCH="$host_os-$host_cpu"
74       ;;
75    *)
76       MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
77       ;;
78 esac
79 AC_SUBST(MODULE_ARCH)
80 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
81
82 case "$host_os" in
83    mingw*)
84       MODULE_EXT=".dll"
85       ;;
86    *)
87       MODULE_EXT=".so"
88       ;;
89 esac
90
91 AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "${MODULE_EXT}", [Suffix for shared objects])
92
93 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
94 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
95 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
96 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
97
98 EFL_CHECK_THREADS(
99    [
100     if test "x${_efl_have_posix_threads}" = "xyes" ; then
101        have_threads="POSIX"
102     else
103        if test "x${_efl_have_win32_threads}" = "xyes" ; then
104           have_threads="Win32"
105        else
106           have_threads="no"
107        fi
108     fi
109    ],
110    [have_threads="no"])
111 EFL_CHECK_SPINLOCK([have_posix_threads_spinlock="yes"], [have_posix_threads_spinlock="no"])
112
113 if ! test "x${have_threads}" = "xno" ; then
114    EINA_CONFIGURE_HAVE_THREADS="#define EINA_HAVE_THREADS"
115 fi
116 AC_SUBST(EINA_CONFIGURE_HAVE_THREADS)
117 AM_CONDITIONAL([EINA_HAVE_THREADS], [! test "x${have_threads}" = "xno"])
118
119 if ! test "x${have_debug_threads}" = "xno"; then
120    EINA_CONFIGURE_HAVE_DEBUG_THREADS="#define EINA_HAVE_DEBUG_THREADS"
121 fi
122 AC_SUBST(EINA_CONFIGURE_HAVE_DEBUG_THREADS)
123 AM_CONDITIONAL([EINA_DEBUG_THREADS], [! test "x${have_debug_threads}" = "xno"])
124
125 if ! test "x${have_on_off_threads}" = "xno"; then
126    EINA_CONFIGURE_HAVE_ON_OFF_THREADS="#define EINA_HAVE_ON_OFF_THREADS"
127 fi
128 AC_SUBST(EINA_CONFIGURE_HAVE_ON_OFF_THREADS)
129 AM_CONDITIONAL([EINA_ON_OFF_THREADS], [! test "x${have_on_off_threads}" = "xno"])
130
131 ### Additional options to configure
132
133 # Magic debug
134 AC_ARG_ENABLE([magic-debug],
135    [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
136    [
137     if test "x${enableval}" = "xyes" ; then
138        have_magic_debug="yes"
139     else
140        have_magic_debug="no"
141     fi
142    ],
143    [have_magic_debug="yes"])
144
145 AC_MSG_CHECKING([whether magic debug is enable])
146 AC_MSG_RESULT([${have_magic_debug}])
147
148 if test "x${have_magic_debug}" = "xyes" ; then
149    EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
150 fi
151 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
152
153 # Safety checks (avoid crashes on wrong api usage)
154 AC_ARG_ENABLE(safety-checks,
155    [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
156    [
157     if test "x${enableval}" = "xyes" ; then
158        have_safety_checks="yes"
159     else
160        have_safety_checks="no"
161     fi
162    ],
163    [have_safety_checks="yes"])
164
165 AC_MSG_CHECKING(whether to do safety checking on api parameters)
166 AC_MSG_RESULT($have_safety_checks)
167
168 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
169 if test "x$have_safety_checks" = "xyes"; then
170   AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
171   EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
172 fi
173 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
174
175 with_max_log_level="<unset>"
176 AC_ARG_WITH(internal-maximum-log-level,
177    [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
178                    [limit eina 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.])],
179    [
180     if test "x${withval}" != "xno"; then
181        if echo "${withval}" | grep -E '^[[0-9]]+$' >/dev/null 2>/dev/null; then
182           AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
183           AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
184           with_max_log_level="${withval}"
185        else
186           AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
187        fi
188     fi
189     ], [:])
190
191 AC_ARG_ENABLE([amalgamation],
192    [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
193    [if test "x${enableval}" = "xyes"; then
194        do_amalgamation="yes"
195     else
196        do_amalgamation="no"
197     fi
198    ],
199    [do_amalgamation="no"]
200 )
201 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
202
203 # Choose best memory pool
204 AC_ARG_ENABLE([default-mempool],
205    [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
206    [
207     if test "x${enableval}" = "xyes"; then
208        have_default_mempool="yes"
209     else
210        have_default_mempool="no"
211     fi
212    ],
213    [have_default_mempool="no"]
214 )
215 AC_MSG_CHECKING([whether to use default mempool allocator])
216 AC_MSG_RESULT([${have_default_mempool}])
217
218 if test "x${have_default_mempool}" = "xyes" ; then
219    EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
220 fi
221 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
222
223 # Report stringshare usage
224 AC_ARG_ENABLE([stringshare-usage],
225    [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
226    [
227     if test "x${enableval}" = "xyes"; then
228        have_stringshare_usage="yes"
229     else
230        have_stringshare_usage="no"
231     fi
232    ],
233    [have_stringshare_usage="no"]
234 )
235 AC_MSG_CHECKING([whether to report stringshare usage])
236 AC_MSG_RESULT([${have_stringshare_usage}])
237
238 if test "x${have_stringshare_usage}" = "xyes"; then
239    AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
240 fi
241
242 # Check if we want to benchmark on real data
243 enable_benchmark_e17="no"
244 AC_ARG_ENABLE([e17],
245    [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
246    [
247     if test "x${enableval}" = "xyes" ; then
248        enable_benchmark_e17="yes"
249     else
250        enable_benchmark_e17="no"
251     fi
252    ],
253    [enable_benchmark_e17="no"])
254
255 AC_MSG_CHECKING([whether e17 real data benchmark are built])
256 AC_MSG_RESULT([${enable_benchmark_e17}])
257
258 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
259
260
261 ### Checks for programs
262 AC_PROG_CC
263 #for src/tests...
264 AC_PROG_CXX
265
266 # pkg-config
267 PKG_PROG_PKG_CONFIG
268
269 # Check whether pkg-config supports Requires.private
270 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
271    pkgconfig_requires_private="Requires.private"
272 else
273    pkgconfig_requires_private="Requires"
274 fi
275 AC_SUBST(pkgconfig_requires_private)
276
277 # doxygen program for documentation building
278
279 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
280
281
282 ### Checks for libraries
283
284 # Valgrind
285 want_valgrind="auto"
286 have_valgrind="no"
287
288 AC_ARG_ENABLE([valgrind],
289   [AC_HELP_STRING([--enable-valgrind], [improve valgrind support by hinting it of our memory usages, having it to report proper mempool leaks.])],
290   [want_valgrind=$enableval])
291
292 AC_MSG_CHECKING([whether to enable build with valgrind])
293 AC_MSG_RESULT([${want_valgrind}])
294
295 if test "x${want_valgrind}" = "xyes" || test "x${want_valgrind}" = "xauto"; then
296    PKG_CHECK_MODULES([VALGRIND],
297       [valgrind >= 2.4.0],
298       [
299        requirement_eina="valgrind ${requirement_eina}"
300        have_valgrind="yes"
301       ],
302       [
303        AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
304        if test "x${want_valgrind}" = "xyes"; then
305           AC_MSG_ERROR([Valgrind >= 2.4.0 is required])
306        fi
307       ])
308 else
309     AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
310 fi
311
312
313 # Evil library for compilation on Windows
314
315 EFL_EINA_BUILD=""
316 case "$host_os" in
317    mingw*)
318       PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0])
319       AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if evil package is installed])
320       requirement_eina="${requirement_eina} evil"
321       EFL_EINA_BUILD="-DEFL_EINA_BUILD"
322    ;;
323 esac
324 AC_SUBST([EFL_EINA_BUILD])
325
326 # Checks for portability layer
327
328 PKG_CHECK_MODULES([EXOTIC],
329    [exotic],
330    [enable_exotic="yes"],
331    [enable_exotic="no"])
332
333 if test "x${enable_exotic}" = "xyes"; then
334     requirement_eina="exotic ${requirement_eina}"
335     EINA_CFLAGS="${EINA_CFLAGS} ${EXOTIC_CFLAGS}"
336     EINA_LIBS="${EXOTIC_LIBS}"
337
338     EINA_CONFIGURE_HAVE_EXOTIC="#define EINA_HAVE_EXOTIC"
339     AC_DEFINE([HAVE_EXOTIC_H], [1], [Define to 1 if you have Exotic.])
340 fi
341 AM_CONDITIONAL([EINA_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"])
342 AC_SUBST([EINA_CONFIGURE_HAVE_EXOTIC])
343
344 case "$host_vendor" in
345   ps3*)
346       PKG_CHECK_MODULES([ESCAPE], [escape])
347       AC_DEFINE(HAVE_ESCAPE, 1, [Set to 1 if Escape package is installed])
348       requirement_eina="${requirement_eina} escape"
349       EINA_CFLAGS="${ESCAPE_CFLAGS} ${EINA_CFLAGS}"
350     ;;
351 esac
352
353 AC_SUBST([EINA_CFLAGS])
354
355 # Check ememoa memory pool library
356
357 AC_ARG_ENABLE([ememoa],
358    [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
359    [
360     if test "x${enableval}" = "xyes" ; then
361        enable_ememoa="yes"
362     else
363        enable_ememoa="no"
364     fi
365    ],
366    [enable_ememoa="yes"])
367
368 AC_MSG_CHECKING([whether to use ememoa for memory pool])
369 AC_MSG_RESULT([$enable_ememoa])
370
371 if test "x${enable_ememoa}" = "xyes" ; then
372    PKG_CHECK_MODULES([EMEMOA],
373       [ememoa >= 0.0.26 ],
374       [enable_ememoa="yes"],
375       [enable_ememoa="no"])
376 fi
377
378 PKG_CHECK_MODULES([ECORE_EVAS],
379    [ecore-evas ecore evas],
380    [build_tiler_example="yes"],
381    [build_tiler_example="no"])
382
383 AM_CONDITIONAL([BUILD_TILER_EXAMPLE], [test "x${build_tiler_example}" = "xyes"])
384
385 ### Checks for header files
386 AC_HEADER_ASSERT
387 AC_HEADER_TIME
388 AC_HEADER_DIRENT
389
390 AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h strings.h sys/mman.h execinfo.h mcheck.h])
391
392 if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then
393    EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"
394    AC_DEFINE([HAVE_INTTYPES_H], [1], [Define to 1 if you have the <inttypes.h> header file.])
395 fi
396 AC_SUBST([EINA_CONFIGURE_HAVE_INTTYPES_H])
397
398 if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then
399     EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"
400     AC_DEFINE([HAVE_STDINT_H], [1], [Define to 1 if you have the <stdint.h> header file.])
401 fi
402 AC_SUBST([EINA_CONFIGURE_HAVE_STDINT_H])
403
404 ### Checks for types
405
406 # wchar_t
407
408 AC_CHECK_SIZEOF([wchar_t])
409 EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
410 AC_SUBST([EINA_SIZEOF_WCHAR_T])
411 AC_CHECK_TYPES([siginfo_t], [], [],
412    [[
413 #include <signal.h>
414 #if HAVE_SIGINFO_H
415 # include <siginfo.h>
416 #endif
417    ]])
418
419 # struct dirent
420
421 AC_CHECK_TYPES([struct dirent], [have_dirent="yes"], [have_dirent="no"],
422    [[
423 #include <dirent.h>
424    ]])
425
426 if test "x${have_dirent}" = "xyes" ; then
427     EINA_CONFIGURE_HAVE_DIRENT_H="#define EINA_HAVE_DIRENT_H"
428     AC_DEFINE([HAVE_DIRENT_H], [1], [Define to 1 if you have a valid <dirent.h> header file.])
429 fi
430 AC_SUBST([EINA_CONFIGURE_HAVE_DIRENT_H])
431
432 ### Checks for structures
433
434 ### Checks for compiler characteristics
435 AC_C_BIGENDIAN
436 AC_C_INLINE
437 AC_PROG_CC_STDC
438 EFL_ATTRIBUTE_UNUSED
439
440 have_wince="no"
441 have_win32="no"
442 case "$host_os" in
443    mingw32ce*)
444       EINA_CFLAGS="${EVIL_CFLAGS}"
445       have_win32="yes"
446       have_wince="yes"
447       ;;
448    mingw*)
449       EINA_CFLAGS="${EVIL_CFLAGS}"
450       have_win32="yes"
451       ;;
452 esac
453 AM_CONDITIONAL([EINA_HAVE_WINCE], [test "x$have_wince" = "xyes"])
454 AM_CONDITIONAL([EINA_HAVE_WIN32], [test "x$have_win32" = "xyes"])
455
456 m4_ifdef([v_mic],
457    [
458     EFL_COMPILER_FLAG([-Wall])
459     EFL_COMPILER_FLAG([-W])
460    ])
461
462 EFL_COMPILER_FLAG([-Wshadow])
463
464 EFL_CHECK_PATH_MAX
465
466 ### Checks for linker characteristics
467 EINA_LIBS=
468 lt_enable_auto_import=""
469 case "${host_os}" in
470    mingw*)
471       EINA_LIBS="${EINA_LIBS} ${EVIL_LIBS}"
472       lt_enable_auto_import="-Wl,--enable-auto-import"
473    ;;
474 esac
475 case "$host_vendor" in
476   ps3*)
477       # Escape had already been checked to exist
478       EINA_LIBS="${ESCAPE_LIBS}"
479     ;;
480 esac
481 AC_SUBST([EINA_LIBS])
482 AC_SUBST([lt_enable_auto_import])
483
484 EFL_LINKER_FLAG([-fno-strict-aliasing])
485
486 ### Checks for library functions
487 AC_FUNC_ALLOCA
488 AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp backtrace backtrace_symbols malloc_usable_size mtrace])
489
490 AC_MSG_CHECKING([for dirfd])
491 AC_LINK_IFELSE(
492    [
493     AC_LANG_PROGRAM(
494        [[
495 #ifdef HAVE_DIRENT_H
496 # include <dirent.h>
497 #endif
498        ]],
499        [[
500 int main(void)
501 {
502   DIR *dirp;
503   return dirfd(dirp);
504 }
505        ]])
506    ],
507    [have_dirfd="yes"],
508    [have_dirfd="no"])
509
510 AC_MSG_RESULT([${have_dirfd}])
511
512 if test "x${have_dirfd}" = "xyes" ; then
513    AC_DEFINE([HAVE_DIRFD], [1], [ Define to 1 if you have the `dirfd' function or macro.])
514 fi
515
516 want_debug_malloc="no"
517 AC_ARG_ENABLE([debug-malloc],
518    [AC_HELP_STRING([--enable-debug-malloc], [enable debugging of malloc usage overhead in our allocator @<:@default=enabled@:>@])],
519    [
520      if test "x${enableval}" = "xyes" ; then
521         want_debug_malloc="yes"
522      else
523         want_debug_malloc="no"
524      fi
525    ], [want_debug_malloc="no"])
526
527 if test "x${ac_cv_func_malloc_usable_size}" = "xyes" && test "x${want_debug_malloc}" = "xyes"; then
528    AC_DEFINE([EINA_DEBUG_MALLOC], [1], [Turn on debugging overhead in mempool])
529 fi
530
531 # dlopen and dladdr
532 EFL_CHECK_DLOPEN
533 EFL_CHECK_DLADDR
534
535 have_log="yes"
536 EFL_CHECK_FNMATCH([have_log="yes"], [have_log="no"])
537
538 want_log="yes"
539 AC_ARG_ENABLE([log],
540    [AC_HELP_STRING([--disable-log], [disable Eina_Log infrastructure completly @<:@default=enabled@:>@])],
541    [
542     if test "x${enableval}" = "xyes" ; then
543        want_log="yes"
544     else
545        want_log="no"
546     fi
547    ],
548    [want_log="yes"])
549
550 enable_log="no"
551 if test "x${have_log}" = xyes -a "x${want_log}" = xyes; then
552    enable_log="yes"
553 fi
554
555 AC_MSG_CHECKING([wether to build Eina_Log infrastructure])
556 AC_MSG_RESULT([${enable_log}])
557
558 if test "x${enable_log}" = "xyes"; then
559     EINA_CONFIGURE_ENABLE_LOG="#define EINA_ENABLE_LOG"
560     AC_DEFINE([HAVE_LOG], [1], [Define to 1 if we log support is on])
561 fi
562 AC_SUBST([EINA_CONFIGURE_ENABLE_LOG])
563
564
565 # iconv library
566 have_iconv="no"
567 AC_ARG_WITH([iconv-link],
568    AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
569    [
570     LIBS="$withval $LIBS"
571     have_iconv="yes"
572     iconv_libs=$withval
573    ])
574
575 AC_MSG_CHECKING(for explicit iconv link options)
576 if test "x${iconv_libs}" = "x" ; then
577    AC_MSG_RESULT([no explicit iconv link option])
578 else
579    AC_MSG_RESULT([$iconv_libs])
580 fi
581
582 if test "x${have_iconv}" = "xno" ; then
583    AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])
584
585    if test "x${have_iconv}" = "xyes" ; then
586       AC_MSG_CHECKING([whether iconv() is in libc])
587
588       AC_LINK_IFELSE(
589          [AC_LANG_PROGRAM(
590              [[
591 #include <stdlib.h>
592 #include <iconv.h>
593              ]],
594              [[
595 iconv_t ic;
596 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
597              ]])],
598          [have_iconv="yes"],
599          [have_iconv="no"])
600
601       AC_MSG_RESULT([${have_iconv}])
602    fi
603
604    if test "x${have_iconv}" = "xno" ; then
605       AC_MSG_CHECKING([whether iconv() is in libiconv.a])
606
607       LIBS_save="${LIBS}"
608       LIBS="-liconv $LIBS"
609       AC_LINK_IFELSE(
610          [AC_LANG_PROGRAM(
611              [[
612 #include <stdlib.h>
613 #include <iconv.h>
614              ]],
615              [[
616 iconv_t ic;
617 size_t count;
618 count = iconv(ic, NULL, NULL, NULL, NULL);
619              ]])],
620          [
621           have_iconv="yes"
622           iconv_libs="-liconv"
623          ],
624          [
625           have_iconv="no"
626           LIBS=${LIBS_save}
627          ])
628
629       AC_MSG_RESULT([${have_iconv}])
630    fi
631
632    if test "x${have_iconv}" = "xno" ; then
633       AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a])
634
635       LIBS_save="${LIBS}"
636       LIBS="-liconv_plug $LIBS"
637       AC_LINK_IFELSE(
638          [AC_LANG_PROGRAM(
639              [[
640 #include <stdlib.h>
641 #include <iconv.h>
642              ]],
643              [[
644 iconv_t ic;
645 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
646              ]])],
647          [
648           have_iconv="yes"
649           iconv_libs="-liconv_plug"
650          ],
651          [
652           have_iconv="no"
653           LIBS=${LIBS_save}
654          ])
655
656       AC_MSG_RESULT([${have_iconv}])
657    fi
658 fi
659
660 AC_SUBST([iconv_libs])
661
662 if test "x${have_iconv}" = "xyes" ; then
663    AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
664 fi
665
666 # shm_open
667 EFL_CHECK_SHM_OPEN([have_shm_open="yes"], [have_shm_open="no"])
668
669 # extended attribute
670
671 AC_MSG_CHECKING([for extended attributes])
672
673 AC_COMPILE_IFELSE(
674    [AC_LANG_PROGRAM(
675        [[
676 #include <stdlib.h>
677 #include <sys/types.h>
678 #include <sys/xattr.h>
679        ]],
680        [[
681 size_t tmp = listxattr("/", NULL, 0);
682 tmp = getxattr("/", "user.ethumb.md5", NULL, 0);
683 setxattr("/", "user.ethumb.md5", NULL, 0, 0);
684        ]])],
685    [
686     AC_DEFINE([HAVE_XATTR], [1], [Define to 1 if you have the `listxattr', `setxattr' and `getxattr' functions.])
687     have_xattr="yes"
688    ],
689    [have_xattr="no"])
690
691 AC_MSG_RESULT([${have_xattr}])
692
693 ### Modules
694
695 if test "x${have_default_mempool}" = "xyes" ; then
696    enable_chained_pool="no"
697    enable_pass_through="static"
698 else
699    enable_chained_pool="static"
700    enable_pass_through="no"
701 fi
702
703 enable_one_big="static"
704
705 EINA_CHECK_MODULE([chained-pool],   [${enable_chained_pool}], [chained pool])
706 EINA_CHECK_MODULE([ememoa-fixed],   [${enable_ememoa}],       [ememoa fixed])
707 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}],       [ememoa unknown])
708 EINA_CHECK_MODULE([fixed-bitmap],   [no],                     [fixed bitmap])
709 EINA_CHECK_MODULE([pass-through],   [${enable_pass_through}], [pass through])
710 EINA_CHECK_MODULE([buddy],          [no],                     [buddy])
711 EINA_CHECK_MODULE([one-big],        [${enable_one_big}],      [one big])
712
713 ### Make the debug preprocessor configurable
714
715 ### Unit tests, coverage and benchmarking
716
717 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
718
719 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
720 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
721 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
722 if test "x$enable_coverage" = "xyes" ; then
723    EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
724 fi
725
726 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
727 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
728 if test -n "$CXX" && test "x$enable_benchmark" = "xyes" ; then
729    AC_DEFINE_UNQUOTED([CITYHASH_BENCH], [1], [enable bench tests for google hash method])
730 fi
731 AM_CONDITIONAL([CITYHASH_BENCH], [test -n "$CXX" && test "x$enable_benchmark" = "xyes"])
732
733 AC_SUBST([requirement_eina])
734
735 ### Build and install examples
736 EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
737 EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])
738
739 AC_CONFIG_FILES([
740 Makefile
741 eina.pc
742 eina.spec
743 doc/Makefile
744 doc/Doxyfile
745 src/Makefile
746 src/include/Makefile
747 src/include/eina_config.h
748 src/lib/Makefile
749 src/modules/Makefile
750 src/modules/mp/Makefile
751 src/modules/mp/chained_pool/Makefile
752 src/modules/mp/ememoa_fixed/Makefile
753 src/modules/mp/ememoa_unknown/Makefile
754 src/modules/mp/pass_through/Makefile
755 src/modules/mp/fixed_bitmap/Makefile
756 src/modules/mp/buddy/Makefile
757 src/modules/mp/one_big/Makefile
758 src/tests/Makefile
759 src/examples/Makefile
760 ])
761
762 AC_OUTPUT
763
764 #####################################################################
765 ## Info
766
767 echo
768 echo
769 echo
770 echo "------------------------------------------------------------------------"
771 echo "$PACKAGE $VERSION"
772 echo "------------------------------------------------------------------------"
773 echo
774 echo
775 echo "Configuration Options Summary:"
776 echo
777 echo "  Magic debug..........: ${have_magic_debug}"
778 echo "  Safety checks........: ${have_safety_checks}"
779 echo "  Maximum log level....: ${with_max_log_level}"
780 echo "  Report string usage..: ${have_stringshare_usage}"
781 echo "  Valgrind support.....: ${have_valgrind}"
782 echo "  Default mempool......: ${have_default_mempool}"
783 echo "  Log support..........: ${enable_log}"
784 echo "  Thread Support.......: ${have_threads}"
785 if test "${have_threads}" = "POSIX" ; then
786 echo "    spinlock...........: ${have_posix_threads_spinlock}"
787 echo "    debug usage........: ${have_debug_threads}"
788 echo "    on/off support.....: ${have_on_off_threads}"
789 fi
790 echo "  Amalgamation.........: ${do_amalgamation}"
791 echo "  Iconv support........: ${have_iconv}"
792 echo "  File dirfd...........: ${have_dirfd}"
793 echo "  File xattr...........: ${have_xattr}"
794 echo "  shm_open.............: ${have_shm_open}"
795 echo
796 echo "  Documentation........: ${build_doc}"
797 echo "  Tests................: ${enable_tests}"
798 echo "  Coverage.............: ${enable_coverage}"
799 echo "  Examples.............: ${enable_build_examples}"
800 echo "  Tiler Example........: ${build_tiler_example}"
801 echo "  Examples installed...: ${enable_install_examples}"
802 echo "  Benchmark............: ${enable_benchmark}"
803 if test "x${enable_benchmark}" = "xyes" ; then
804 echo "    Glib...............: ${enable_benchmark_glib}"
805 echo "    E17 real data......: ${enable_benchmark_e17}"
806 fi
807 echo
808 echo "  CPU Specific Extensions:"
809 echo "    MMX................: ${have_mmx}"
810 echo "    SSE................: ${have_sse}"
811 echo "    SSE2...............: ${have_sse2}"
812 echo "    ALTIVEC............: ${have_altivec}"
813 echo
814 echo "  Memory pools:"
815 echo "    Buddy..............: ${enable_buddy}"
816 echo "    Chained pool.......: ${enable_chained_pool}"
817 echo "    Ememoa fixed.......: ${enable_ememoa_fixed}"
818 echo "    Ememoa unknown.....: ${enable_ememoa_unknown}"
819 echo "    Fixed bitmap.......: ${enable_fixed_bitmap}"
820 echo "    One big............: ${enable_one_big}"
821 echo "    Pass through.......: ${enable_pass_through}"
822 echo
823 echo "Compilation............: make (or gmake)"
824 echo "  CPPFLAGS.............: $CPPFLAGS"
825 echo "  CFLAGS...............: $CFLAGS"
826 echo "  LDFLAGS..............: $LDFLAGS"
827 echo
828 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
829 echo "  prefix...............: $prefix"
830 echo
831 EFL_FORM_VOLTRON