1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [6])
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 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21 AC_INIT([eina], [v_ver], [enlightenment-devel@lists.sourceforge.net])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
26 AC_CONFIG_HEADERS([config.h])
28 #ifndef EFL_CONFIG_H__
29 #define EFL_CONFIG_H__
32 #endif /* EFL_CONFIG_H__ */
35 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
36 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
42 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
43 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
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"
56 AC_SUBST(version_info)
57 AC_SUBST(release_info)
58 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
59 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
64 ### Needed information
69 requirements_pc_eina=""
77 MODULE_ARCH="$host_os-$host_cpu"
82 MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
86 MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
90 AM_CONDITIONAL([EINA_HAVE_WINCE], [test "x$have_wince" = "xyes"])
91 AM_CONDITIONAL([EINA_HAVE_WIN32], [test "x$have_win32" = "xyes"])
92 AC_SUBST([MODULE_ARCH])
93 AC_DEFINE_UNQUOTED([MODULE_ARCH], ["${MODULE_ARCH}"], ["Module architecture"])
94 AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["${MODULE_EXT}"], [Suffix for shared objects])
96 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
97 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
98 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
99 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
103 if ! test "x${efl_have_threads}" = "xno" ; then
104 EINA_CONFIGURE_HAVE_THREADS="#define EINA_HAVE_THREADS"
106 AC_SUBST(EINA_CONFIGURE_HAVE_THREADS)
107 AM_CONDITIONAL([EINA_HAVE_THREADS], [! test "x${efl_have_threads}" = "xno"])
109 if test "x${efl_have_debug_threads}" = "xyes"; then
110 EINA_CONFIGURE_HAVE_DEBUG_THREADS="#define EINA_HAVE_DEBUG_THREADS"
112 AC_SUBST(EINA_CONFIGURE_HAVE_DEBUG_THREADS)
113 AM_CONDITIONAL([EINA_DEBUG_THREADS], [test "x${efl_have_debug_threads}" = "xyes"])
115 if ! test "x${efl_have_on_off_threads}" = "xno"; then
116 EINA_CONFIGURE_HAVE_ON_OFF_THREADS="#define EINA_HAVE_ON_OFF_THREADS"
118 AC_SUBST(EINA_CONFIGURE_HAVE_ON_OFF_THREADS)
119 AM_CONDITIONAL([EINA_ON_OFF_THREADS], [! test "x${efl_have_on_off_threads}" = "xno"])
121 ### Additional options to configure
124 AC_ARG_ENABLE([magic-debug],
125 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
127 if test "x${enableval}" = "xyes" ; then
128 have_magic_debug="yes"
130 have_magic_debug="no"
133 [have_magic_debug="yes"])
135 AC_MSG_CHECKING([whether magic debug is enable])
136 AC_MSG_RESULT([${have_magic_debug}])
138 if test "x${have_magic_debug}" = "xyes" ; then
139 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
141 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
143 # Safety checks (avoid crashes on wrong api usage)
144 AC_ARG_ENABLE(safety-checks,
145 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
147 if test "x${enableval}" = "xyes" ; then
148 have_safety_checks="yes"
150 have_safety_checks="no"
153 [have_safety_checks="yes"])
155 AC_MSG_CHECKING(whether to do safety checking on api parameters)
156 AC_MSG_RESULT($have_safety_checks)
158 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
159 if test "x$have_safety_checks" = "xyes"; then
160 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
161 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
163 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
165 with_max_log_level="<unset>"
166 AC_ARG_WITH(internal-maximum-log-level,
167 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
168 [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.])],
170 if test "x${withval}" != "xno"; then
171 if echo "${withval}" | grep -E '^[[0-9]]+$' >/dev/null 2>/dev/null; then
172 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
173 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
174 with_max_log_level="${withval}"
176 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
181 AC_ARG_ENABLE([amalgamation],
182 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
183 [if test "x${enableval}" = "xyes"; then
184 do_amalgamation="yes"
189 [do_amalgamation="no"]
191 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
193 # Choose best memory pool
194 AC_ARG_ENABLE([default-mempool],
195 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
197 if test "x${enableval}" = "xyes"; then
198 have_default_mempool="yes"
200 have_default_mempool="no"
203 [have_default_mempool="no"]
205 AC_MSG_CHECKING([whether to use default mempool allocator])
206 AC_MSG_RESULT([${have_default_mempool}])
208 if test "x${have_default_mempool}" = "xyes" ; then
209 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
211 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
213 # Report stringshare usage
214 AC_ARG_ENABLE([stringshare-usage],
215 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
217 if test "x${enableval}" = "xyes"; then
218 have_stringshare_usage="yes"
220 have_stringshare_usage="no"
223 [have_stringshare_usage="no"]
225 AC_MSG_CHECKING([whether to report stringshare usage])
226 AC_MSG_RESULT([${have_stringshare_usage}])
228 if test "x${have_stringshare_usage}" = "xyes"; then
229 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
234 AC_ARG_ENABLE([assert],
235 [AC_HELP_STRING([--enable-assert], [enable assert, @<:@default=no@:>@])],
237 if test "x${enableval}" = "xyes" ; then
243 [prefer_assert="no"])
245 # Check if we want to benchmark on real data
246 enable_benchmark_e17="no"
248 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
250 if test "x${enableval}" = "xyes" ; then
251 enable_benchmark_e17="yes"
253 enable_benchmark_e17="no"
256 [enable_benchmark_e17="no"])
258 AC_MSG_CHECKING([whether e17 real data benchmark are built])
259 AC_MSG_RESULT([${enable_benchmark_e17}])
261 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
264 ### Checks for programs
272 # Check whether pkg-config supports Requires.private
273 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
274 pkgconfig_requires_private="Requires.private"
276 pkgconfig_requires_private="Requires"
278 AC_SUBST(pkgconfig_requires_private)
280 # doxygen program for documentation building
282 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
285 ### Checks for libraries
287 ## Compatibility layers
289 # Evil library for compilation on Windows
294 PKG_CHECK_EXISTS([evil >= 1.6.99])
295 AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil package is installed])
296 requirements_pc_eina="${requirements_pc_eina} evil"
297 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
300 AC_SUBST([EFL_EINA_BUILD])
302 # Escape library for compilation on Playstation 3
304 case "$host_vendor" in
306 PKG_CHECK_EXISTS([escape])
307 AC_DEFINE([HAVE_ESCAPE], [1], [Set to 1 if Escape package is installed])
308 requirements_pc_eina="${requirements_pc_eina} escape"
312 # Exotic library for copilation on Coyote
314 PKG_CHECK_EXISTS([exotic],
317 AC_DEFINE([HAVE_EXOTIC_H], [1], [Define to 1 if you have Exotic.])
318 EINA_CONFIGURE_HAVE_EXOTIC="#define EINA_HAVE_EXOTIC"
319 requirements_pc_eina="exotic ${requirements_pc_eina}"
321 [enable_exotic="no"])
323 AM_CONDITIONAL([EINA_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"])
324 AC_SUBST([EINA_CONFIGURE_HAVE_EXOTIC])
326 if ! test "x${requirements_pc_eina}" = "x" ; then
327 PKG_CHECK_MODULES([EINA], [${requirements_pc_eina}])
334 AC_ARG_ENABLE([valgrind],
335 [AC_HELP_STRING([--enable-valgrind], [improve valgrind support by hinting it of our memory usages, having it to report proper mempool leaks.])],
337 if test "x${enableval}" = "xyes" ; then
343 [want_valgrind="auto"])
345 AC_MSG_CHECKING([whether to enable build with valgrind])
346 AC_MSG_RESULT([${want_valgrind}])
348 if test "x${want_valgrind}" = "xyes" || test "x${want_valgrind}" = "xauto"; then
349 PKG_CHECK_MODULES([VALGRIND], [valgrind >= 2.4.0],
352 requirements_pc_eina="valgrind ${requirements_pc_eina}"
356 AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
357 if test "x${want_valgrind}" = "xyes"; then
358 AC_MSG_ERROR([Valgrind >= 2.4.0 is required])
362 AC_DEFINE([NVALGRIND], [1], [Valgrind support disabled])
367 # Check ememoa memory pool library
369 AC_ARG_ENABLE([ememoa],
370 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
372 if test "x${enableval}" = "xyes" ; then
378 [enable_ememoa="yes"])
380 AC_MSG_CHECKING([whether to use ememoa for memory pool])
381 AC_MSG_RESULT([${enable_ememoa}])
383 if test "x${enable_ememoa}" = "xyes" ; then
384 PKG_CHECK_MODULES([EMEMOA],
386 [enable_ememoa="yes"],
387 [enable_ememoa="no"])
392 PKG_CHECK_MODULES([ECORE_EVAS],
393 [ecore-evas ecore evas],
394 [build_tiler_example="yes"],
395 [build_tiler_example="no"])
397 AM_CONDITIONAL([BUILD_TILER_EXAMPLE], [test "x${build_tiler_example}" = "xyes"])
399 ### Checks for header files
404 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])
406 if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then
407 EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"
408 AC_DEFINE([HAVE_INTTYPES_H], [1], [Define to 1 if you have the <inttypes.h> header file.])
410 AC_SUBST([EINA_CONFIGURE_HAVE_INTTYPES_H])
412 if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then
413 EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"
414 AC_DEFINE([HAVE_STDINT_H], [1], [Define to 1 if you have the <stdint.h> header file.])
416 AC_SUBST([EINA_CONFIGURE_HAVE_STDINT_H])
422 AC_CHECK_SIZEOF([wchar_t])
423 EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
424 AC_SUBST([EINA_SIZEOF_WCHAR_T])
425 AC_CHECK_TYPES([siginfo_t], [], [],
429 # include <siginfo.h>
435 AC_CHECK_TYPES([struct dirent], [have_dirent="yes"], [have_dirent="no"],
440 if test "x${have_dirent}" = "xyes" ; then
441 EINA_CONFIGURE_HAVE_DIRENT_H="#define EINA_HAVE_DIRENT_H"
442 AC_DEFINE([HAVE_DIRENT_H], [1], [Define to 1 if you have a valid <dirent.h> header file.])
444 AC_SUBST([EINA_CONFIGURE_HAVE_DIRENT_H])
446 ### Checks for structures
448 ### Checks for compiler characteristics
456 EFL_COMPILER_FLAG([-Wall])
457 EFL_COMPILER_FLAG([-W])
460 EFL_COMPILER_FLAG([-Wshadow])
464 ### Checks for linker characteristics
465 lt_enable_auto_import=""
468 lt_enable_auto_import="-Wl,--enable-auto-import"
471 AC_SUBST([lt_enable_auto_import])
473 EFL_LINKER_FLAG([-fno-strict-aliasing])
475 ### Checks for library functions
478 AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp backtrace backtrace_symbols malloc_usable_size mtrace])
480 EFL_CHECK_FUNCS([eina], [dirfd dlopen dladdr fnmatch iconv shm_open setxattr])
482 want_debug_malloc="no"
483 AC_ARG_ENABLE([debug-malloc],
484 [AC_HELP_STRING([--enable-debug-malloc], [enable debugging of malloc usage overhead in our allocator @<:@default=enabled@:>@])],
486 if test "x${enableval}" = "xyes" ; then
487 want_debug_malloc="yes"
489 want_debug_malloc="no"
491 ], [want_debug_malloc="no"])
493 if test "x${ac_cv_func_malloc_usable_size}" = "xyes" && test "x${want_debug_malloc}" = "xyes"; then
494 AC_DEFINE([EINA_DEBUG_MALLOC], [1], [Turn on debugging overhead in mempool])
498 [AC_HELP_STRING([--disable-log], [disable Eina_Log infrastructure completly @<:@default=enabled@:>@])],
500 if test "x${enableval}" = "xyes" ; then
509 if test "x${efl_func_fnmatch}" = "xyes" && test "x${want_log}" = "xyes" ; then
513 AC_MSG_CHECKING([wether to build Eina_Log infrastructure])
514 AC_MSG_RESULT([${enable_log}])
516 if test "x${enable_log}" = "xyes"; then
517 EINA_CONFIGURE_ENABLE_LOG="#define EINA_ENABLE_LOG"
518 AC_DEFINE([HAVE_LOG], [1], [Define to 1 if we log support is on])
520 AC_SUBST([EINA_CONFIGURE_ENABLE_LOG])
525 if test "x${have_default_mempool}" = "xyes" ; then
526 enable_chained_pool="no"
527 enable_pass_through="static"
529 enable_chained_pool="static"
530 enable_pass_through="no"
533 enable_one_big="static"
535 EINA_CHECK_MODULE([chained-pool], [${enable_chained_pool}], [chained pool])
536 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
537 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
538 EINA_CHECK_MODULE([fixed-bitmap], [no], [fixed bitmap])
539 EINA_CHECK_MODULE([pass-through], [${enable_pass_through}], [pass through])
540 EINA_CHECK_MODULE([buddy], [no], [buddy])
541 EINA_CHECK_MODULE([one-big], [${enable_one_big}], [one big])
543 ### Make the debug preprocessor configurable
545 ### Unit tests, coverage and benchmarking
547 EFL_CHECK_TESTS([eina], [enable_tests="yes"], [enable_tests="no"])
549 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
550 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
551 if test -n "$CXX" && test "x$enable_benchmark" = "xyes" ; then
552 AC_DEFINE_UNQUOTED([CITYHASH_BENCH], [1], [enable bench tests for google hash method])
554 AM_CONDITIONAL([CITYHASH_BENCH], [test -n "$CXX" && test "x$enable_benchmark" = "xyes"])
556 AC_SUBST([requirements_pc_eina])
557 AC_SUBST([requirements_libs_eina])
559 ### Build and install examples
560 EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
561 EFL_CHECK_INSTALL_EXAMPLES([enable_install_examples="yes"], [enable_install_examples="no"])
571 src/include/eina_config.h
574 src/modules/mp/Makefile
575 src/modules/mp/chained_pool/Makefile
576 src/modules/mp/ememoa_fixed/Makefile
577 src/modules/mp/ememoa_unknown/Makefile
578 src/modules/mp/pass_through/Makefile
579 src/modules/mp/fixed_bitmap/Makefile
580 src/modules/mp/buddy/Makefile
581 src/modules/mp/one_big/Makefile
583 src/examples/Makefile
588 #####################################################################
594 echo "------------------------------------------------------------------------"
595 echo "$PACKAGE $VERSION"
596 echo "------------------------------------------------------------------------"
599 echo "Configuration Options Summary:"
601 echo " Magic debug..........: ${have_magic_debug}"
602 echo " Safety checks........: ${have_safety_checks}"
603 echo " Maximum log level....: ${with_max_log_level}"
604 echo " Report string usage..: ${have_stringshare_usage}"
605 echo " Valgrind support.....: ${have_valgrind}"
606 echo " Default mempool......: ${have_default_mempool}"
607 echo " Log support..........: ${enable_log}"
608 echo " Thread Support.......: ${efl_have_threads}"
609 if test "${efl_have_threads}" = "POSIX" ; then
610 echo " spinlock...........: ${efl_have_posix_threads_spinlock}"
611 echo " debug usage........: ${efl_have_debug_threads}"
612 echo " on/off support.....: ${efl_have_on_off_threads}"
614 echo " Amalgamation.........: ${do_amalgamation}"
615 echo " Iconv support........: ${efl_func_iconv}"
616 echo " File dirfd...........: ${efl_func_dirfd}"
617 echo " File xattr...........: ${efl_func_setxattr}"
618 echo " shm_open.............: ${efl_func_shm_open}"
620 echo " Documentation........: ${build_doc}"
621 echo " Tests................: ${enable_tests} (Coverage: ${efl_enable_coverage})"
622 echo " Examples.............: ${enable_build_examples}"
623 echo " Tiler Example........: ${build_tiler_example}"
624 echo " Examples installed...: ${enable_install_examples}"
625 echo " Benchmark............: ${enable_benchmark}"
626 if test "x${enable_benchmark}" = "xyes" ; then
627 echo " Glib...............: ${enable_benchmark_glib}"
628 echo " E17 real data......: ${enable_benchmark_e17}"
631 echo " CPU Specific Extensions:"
632 echo " MMX................: ${have_mmx}"
633 echo " SSE................: ${have_sse}"
634 echo " SSE2...............: ${have_sse2}"
635 echo " ALTIVEC............: ${have_altivec}"
637 echo " Memory pools:"
638 echo " Buddy..............: ${enable_buddy}"
639 echo " Chained pool.......: ${enable_chained_pool}"
640 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
641 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
642 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
643 echo " One big............: ${enable_one_big}"
644 echo " Pass through.......: ${enable_pass_through}"
646 echo "Compilation............: make (or gmake)"
647 echo " CPPFLAGS.............: $CPPFLAGS"
648 echo " CFLAGS...............: $CFLAGS"
649 echo " LDFLAGS..............: $LDFLAGS"
651 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
652 echo " prefix...............: $prefix"