1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [1])
4 m4_define([v_min], [0])
5 m4_define([v_mic], [0])
6 m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v export || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
7 m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
8 ##-- When released, remove the dnl on the below line
10 ##-- When doing snapshots - change soname. remove dnl on below line
11 dnl m4_define([relname], [ver-pre-svn-07])
12 dnl m4_define([v_rel], [-release relname])
13 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
14 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
15 m4_define([lt_rev], m4_eval(v_maj + v_min))
16 m4_define([lt_cur], v_mic)
17 m4_define([lt_age], v_min)
18 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
19 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
21 AC_INIT([eina], [v_ver.beta2], [enlightenment-devel@lists.sourceforge.net])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
30 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
31 AM_CONFIG_HEADER([config.h])
32 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
35 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
36 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
39 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
40 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
41 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
42 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
43 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
44 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
45 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
46 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
47 version_info="lt_rev:lt_cur:lt_age"
49 AC_SUBST(version_info)
50 AC_SUBST(release_info)
51 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
52 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
56 ### Needed information
62 MODULE_ARCH="$host_os-$host_cpu"
65 MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
69 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
80 AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "${MODULE_EXT}", [Suffix for shared objects])
82 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
83 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
84 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
85 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
89 if test "x${_efl_have_posix_threads}" = "xyes" ; then
92 if test "x${_efl_have_win32_threads}" = "xyes" ; then
100 EFL_CHECK_SPINLOCK([have_posix_threads_spinlock="yes"], [have_posix_threads_spinlock="no"])
102 ### Additional options to configure
105 AC_ARG_ENABLE([magic-debug],
106 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
108 if test "x${enableval}" = "xyes" ; then
109 have_magic_debug="yes"
111 have_magic_debug="no"
114 [have_magic_debug="yes"])
116 AC_MSG_CHECKING([whether magic debug is enable])
117 AC_MSG_RESULT([${have_magic_debug}])
119 if test "x${have_magic_debug}" = "xyes" ; then
120 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
122 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
128 AC_MSG_CHECKING(whether to enable build with valgrind)
129 AC_ARG_ENABLE(valgrind,
130 AC_HELP_STRING([--enable-valgrind], [improve valgrind support by hinting it of our memory usages, having it to report proper mempool leaks.]),
131 [want_valgrind=$enableval]
133 AC_MSG_RESULT($want_valgrind)
135 if test "x${want_valgrind}" = "xyes" -o "x${want_valgrind}" = "xauto"; then
136 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
138 requirement_eina="valgrind ${requirement_eina}"
142 AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
143 if test "x$want_valgrind" = "xyes"; then
144 AC_MSG_ERROR([Valgrind >= 2.4.0 is required)])
149 AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
152 # Safety checks (avoid crashes on wrong api usage)
153 AC_ARG_ENABLE(safety-checks,
154 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
156 if test "x${enableval}" = "xyes" ; then
157 have_safety_checks="yes"
159 have_safety_checks="no"
162 [have_safety_checks="yes"])
164 AC_MSG_CHECKING(whether to do safety checking on api parameters)
165 AC_MSG_RESULT($have_safety_checks)
167 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
168 if test "x$have_safety_checks" = "xyes"; then
169 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
170 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
172 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
174 with_max_log_level="<unset>"
175 AC_ARG_WITH(internal-maximum-log-level,
176 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
177 [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 if test "x${withval}" != "xno"; then
180 if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
181 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
182 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
183 with_max_log_level="${withval}"
185 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
190 AC_ARG_ENABLE([amalgamation],
191 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
192 [if test "x${enableval}" = "xyes"; then
193 do_amalgamation="yes"
198 [do_amalgamation="no"]
200 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
202 # Choose best memory pool
203 AC_ARG_ENABLE([default-mempool],
204 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
206 if test "x${enableval}" = "xyes"; then
207 have_default_mempool="yes"
209 have_default_mempool="no"
212 [have_default_mempool="no"]
214 AC_MSG_CHECKING([whether to use default mempool allocator])
215 AC_MSG_RESULT([${have_default_mempool}])
217 if test "x${have_default_mempool}" = "xyes" ; then
218 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
220 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
222 # Report stringshare usage
223 AC_ARG_ENABLE([stringshare-usage],
224 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
226 if test "x${enableval}" = "xyes"; then
227 have_stringshare_usage="yes"
229 have_stringshare_usage="no"
232 [have_stringshare_usage="no"]
234 AC_MSG_CHECKING([whether to report stringshare usage])
235 AC_MSG_RESULT([${have_stringshare_usage}])
237 if test "x${have_stringshare_usage}" = "xyes"; then
238 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
241 # Check if we want to benchmark on real data
242 enable_benchmark_e17="no"
244 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
246 if test "x${enableval}" = "xyes" ; then
247 enable_benchmark_e17="yes"
249 enable_benchmark_e17="no"
252 [enable_benchmark_e17="no"])
254 AC_MSG_CHECKING([whether e17 real data benchmark are built])
255 AC_MSG_RESULT([${enable_benchmark_e17}])
257 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
260 ### Checks for programs
266 # Check whether pkg-config supports Requires.private
267 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
268 pkgconfig_requires_private="Requires.private"
270 pkgconfig_requires_private="Requires"
272 AC_SUBST(pkgconfig_requires_private)
274 # doxygen program for documentation building
276 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
279 ### Checks for libraries
281 # Evil library for compilation on Windows CE
286 PKG_CHECK_MODULES([EVIL], [evil])
287 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
288 requirement_eina="evil"
289 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
292 AC_SUBST(EFL_EINA_BUILD)
294 # Check ememoa memory pool library
296 AC_ARG_ENABLE([ememoa],
297 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
299 if test "x${enableval}" = "xyes" ; then
305 [enable_ememoa="yes"]
307 AC_MSG_CHECKING([whether to use ememoa for memory pool])
308 AC_MSG_RESULT([$enable_ememoa])
310 if test "x${enable_ememoa}" = "xyes" ; then
311 PKG_CHECK_MODULES([EMEMOA],
313 [enable_ememoa="yes"],
319 ### Checks for header files
326 AC_CHECK_HEADER([inttypes.h],
327 [EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"])
328 AC_SUBST(EINA_CONFIGURE_HAVE_INTTYPES_H)
330 AC_CHECK_HEADER([stdint.h],
331 [EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"])
332 AC_SUBST(EINA_CONFIGURE_HAVE_STDINT_H)
334 AC_CHECK_SIZEOF(wchar_t)
335 EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
336 AC_SUBST(EINA_SIZEOF_WCHAR_T)
338 ### Checks for structures
341 ### Checks for compiler characteristics
353 EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
354 EINA_CFLAGS="${EVIL_CFLAGS}"
358 EINA_CPPFLAGS="-D_WIN32_WINNT=0x0501"
359 EINA_CFLAGS="${EVIL_CFLAGS}"
363 AM_CONDITIONAL([EINA_HAVE_WIN32], [test "x$have_win32" = "xyes"])
367 EFL_COMPILER_FLAG([-Wall])
368 EFL_COMPILER_FLAG([-W])
371 EFL_COMPILER_FLAG([-Wshadow])
373 AC_SUBST(EINA_CPPFLAGS)
374 AC_SUBST(EINA_CFLAGS)
377 ### Checks for linker characteristics
379 lt_enable_auto_import=""
382 EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
383 lt_enable_auto_import="-Wl,--enable-auto-import"
398 EINA_LIBS="-ldl -lrt -lm"
402 AC_SUBST(lt_enable_auto_import)
404 EFL_LINKER_FLAG([-fno-strict-aliasing])
407 ### Checks for library functions
409 AC_CHECK_FUNCS(strlcpy)
416 AC_DEFINE(HAVE_DLADDR)
419 AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
420 if test "x${res}" = "xyes" ; then
421 AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
423 AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
424 if test "x${res}" = "xyes" ; then
425 AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
428 AC_MSG_ERROR([Cannot find dlopen])
433 AC_SUBST(dlopen_libs)
435 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
439 AC_ARG_WITH([iconv-link],
440 AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
442 LIBS="$withval $LIBS"
446 AC_MSG_CHECKING(for explicit iconv link options)
447 if test "x${iconv_libs}" = "x" ; then
448 AC_MSG_RESULT([no explicit iconv link option])
450 AC_MSG_RESULT([$iconv_libs])
453 if test "x${have_iconv}" = "xno" ; then
454 AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])
456 if test "x${have_iconv}" = "xyes" ; then
457 AC_MSG_CHECKING([whether iconv() is in libc])
467 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
472 AC_MSG_RESULT([${have_iconv}])
475 if test "x${have_iconv}" = "xno" ; then
476 AC_MSG_CHECKING([whether iconv() is in libiconv.a])
489 count = iconv(ic, NULL, NULL, NULL, NULL);
497 AC_MSG_RESULT([${have_iconv}])
500 if test "x${have_iconv}" = "xno" ; then
501 AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a])
504 LIBS="-liconv_plug $LIBS"
513 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
521 AC_MSG_RESULT([${have_iconv}])
525 if test "x${have_iconv}" = "xyes" ; then
526 AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
529 #check for dirfd API presence
531 AC_CHECK_FUNCS([dirfd], [have_dirfd="yes"], [])
532 if test "x${dirfd}" = "xyes"; then
533 AC_DEFINE(HAVE_DIRFD)
535 AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], [])
536 AC_CHECK_FUNCS([statat], [AC_DEFINE(HAVE_STATAT)], [])
537 AC_CHECK_FUNCS([fpathconf], [AC_DEFINE(HAVE_FPATHCONF)], [])
541 if test "x${have_default_mempool}" = "xyes" ; then
542 enable_chained_pool="no"
543 enable_pass_through="static"
545 enable_chained_pool="static"
546 enable_pass_through="no"
549 enable_one_big="static"
551 EINA_CHECK_MODULE([chained-pool], [${enable_chained_pool}], [chained pool])
552 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
553 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
554 EINA_CHECK_MODULE([fixed-bitmap], [no], [fixed bitmap])
555 EINA_CHECK_MODULE([pass-through], [${enable_pass_through}], [pass through])
556 EINA_CHECK_MODULE([buddy], [no], [buddy])
557 EINA_CHECK_MODULE([one-big], [${enable_one_big}], [one big])
559 ### Make the debug preprocessor configurable
561 ### Unit tests, coverage and benchmarking
563 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
565 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
566 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
567 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
568 if test "x$enable_coverage" = "xyes" ; then
569 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
572 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
573 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
575 AC_SUBST(requirement_eina)
577 ### Create the .pc.in file according to the major version
578 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
580 #exec_prefix=@exec_prefix@
582 #includedir=@includedir@
585 #Description: A Library that implements fast data types and miscellaneous tools
588 #Libs: -L${libdir} -leina
590 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
600 src/include/eina_config.h
603 src/modules/mp/Makefile
604 src/modules/mp/chained_pool/Makefile
605 src/modules/mp/ememoa_fixed/Makefile
606 src/modules/mp/ememoa_unknown/Makefile
607 src/modules/mp/pass_through/Makefile
608 src/modules/mp/fixed_bitmap/Makefile
609 src/modules/mp/buddy/Makefile
610 src/modules/mp/one_big/Makefile
616 #####################################################################
622 echo "------------------------------------------------------------------------"
623 echo "$PACKAGE $VERSION"
624 echo "------------------------------------------------------------------------"
627 echo "Configuration Options Summary:"
629 echo " Magic debug..........: ${have_magic_debug}"
630 echo " Safety checks........: ${have_safety_checks}"
631 echo " Maximum log level....: ${with_max_log_level}"
632 echo " Report string usage..: ${have_stringshare_usage}"
633 echo " Valgrind support.....: ${have_valgrind}"
634 echo " Default mempool......: ${have_default_mempool}"
635 echo " Thread Support.......: ${have_threads}"
636 if test "${have_threads}" = "POSIX" ; then
637 echo " spinlock...........: ${have_posix_threads_spinlock}"
638 echo " debug usage........: ${have_debug_threads}"
640 echo " Amalgamation.........: ${do_amalgamation}"
641 echo " Iconv support........: ${have_iconv}"
642 echo " File dirfd...........: ${have_dirfd}"
644 echo " Documentation........: ${build_doc}"
645 echo " Tests................: ${enable_tests}"
646 echo " Coverage.............: ${enable_coverage}"
647 echo " Benchmark............: ${enable_benchmark}"
648 if test "x${enable_benchmark}" = "xyes" ; then
649 echo " Glib...............: ${enable_benchmark_glib}"
650 echo " E17 real data......: ${enable_benchmark_e17}"
653 echo " CPU Specific Extensions:"
654 echo " MMX................: ${have_mmx}"
655 echo " SSE................: ${have_sse}"
656 echo " SSE2...............: ${have_sse2}"
657 echo " ALTIVEC............: ${have_altivec}"
659 echo " Memory pools:"
660 echo " Chained pool.......: ${enable_chained_pool}"
661 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
662 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
663 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
664 echo " Pass through.......: ${enable_pass_through}"
665 echo " Buddy..............: ${enable_buddy}"
666 echo " One big............: ${enable_one_big}"
668 echo "Compilation............: make (or gmake)"
669 echo " CPPFLAGS.............: $CPPFLAGS"
670 echo " CFLAGS...............: $CFLAGS"
671 echo " LDFLAGS..............: $LDFLAGS"
673 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
674 echo " prefix...............: $prefix"