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