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