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], [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])])
41 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
42 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
45 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
46 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
47 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
48 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
49 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
50 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
51 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
52 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
53 version_info="lt_rev:lt_cur:lt_age"
55 AC_SUBST(version_info)
56 AC_SUBST(release_info)
57 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
58 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
63 ### Needed information
72 MODULE_ARCH="$host_os-$host_cpu"
75 MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
79 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
90 AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "${MODULE_EXT}", [Suffix for shared objects])
92 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
93 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
94 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
95 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
99 if test "x${_efl_have_posix_threads}" = "xyes" ; then
102 if test "x${_efl_have_win32_threads}" = "xyes" ; then
110 EFL_CHECK_SPINLOCK([have_posix_threads_spinlock="yes"], [have_posix_threads_spinlock="no"])
112 ### Additional options to configure
115 AC_ARG_ENABLE([magic-debug],
116 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
118 if test "x${enableval}" = "xyes" ; then
119 have_magic_debug="yes"
121 have_magic_debug="no"
124 [have_magic_debug="yes"])
126 AC_MSG_CHECKING([whether magic debug is enable])
127 AC_MSG_RESULT([${have_magic_debug}])
129 if test "x${have_magic_debug}" = "xyes" ; then
130 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
132 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
138 AC_MSG_CHECKING(whether to enable build with valgrind)
139 AC_ARG_ENABLE(valgrind,
140 AC_HELP_STRING([--enable-valgrind], [improve valgrind support by hinting it of our memory usages, having it to report proper mempool leaks.]),
141 [want_valgrind=$enableval]
143 AC_MSG_RESULT($want_valgrind)
145 if test "x${want_valgrind}" = "xyes" -o "x${want_valgrind}" = "xauto"; then
146 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
148 requirement_eina="valgrind ${requirement_eina}"
152 AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
153 if test "x$want_valgrind" = "xyes"; then
154 AC_MSG_ERROR([Valgrind >= 2.4.0 is required)])
159 AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
162 # Safety checks (avoid crashes on wrong api usage)
163 AC_ARG_ENABLE(safety-checks,
164 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
166 if test "x${enableval}" = "xyes" ; then
167 have_safety_checks="yes"
169 have_safety_checks="no"
172 [have_safety_checks="yes"])
174 AC_MSG_CHECKING(whether to do safety checking on api parameters)
175 AC_MSG_RESULT($have_safety_checks)
177 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
178 if test "x$have_safety_checks" = "xyes"; then
179 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
180 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
182 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
184 with_max_log_level="<unset>"
185 AC_ARG_WITH(internal-maximum-log-level,
186 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
187 [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.])],
189 if test "x${withval}" != "xno"; then
190 if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
191 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
192 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
193 with_max_log_level="${withval}"
195 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
200 AC_ARG_ENABLE([amalgamation],
201 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
202 [if test "x${enableval}" = "xyes"; then
203 do_amalgamation="yes"
208 [do_amalgamation="no"]
210 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
212 # Choose best memory pool
213 AC_ARG_ENABLE([default-mempool],
214 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
216 if test "x${enableval}" = "xyes"; then
217 have_default_mempool="yes"
219 have_default_mempool="no"
222 [have_default_mempool="no"]
224 AC_MSG_CHECKING([whether to use default mempool allocator])
225 AC_MSG_RESULT([${have_default_mempool}])
227 if test "x${have_default_mempool}" = "xyes" ; then
228 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
230 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
232 # Report stringshare usage
233 AC_ARG_ENABLE([stringshare-usage],
234 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
236 if test "x${enableval}" = "xyes"; then
237 have_stringshare_usage="yes"
239 have_stringshare_usage="no"
242 [have_stringshare_usage="no"]
244 AC_MSG_CHECKING([whether to report stringshare usage])
245 AC_MSG_RESULT([${have_stringshare_usage}])
247 if test "x${have_stringshare_usage}" = "xyes"; then
248 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
251 # Check if we want to benchmark on real data
252 enable_benchmark_e17="no"
254 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
256 if test "x${enableval}" = "xyes" ; then
257 enable_benchmark_e17="yes"
259 enable_benchmark_e17="no"
262 [enable_benchmark_e17="no"])
264 AC_MSG_CHECKING([whether e17 real data benchmark are built])
265 AC_MSG_RESULT([${enable_benchmark_e17}])
267 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
270 ### Checks for programs
276 # Check whether pkg-config supports Requires.private
277 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
278 pkgconfig_requires_private="Requires.private"
280 pkgconfig_requires_private="Requires"
282 AC_SUBST(pkgconfig_requires_private)
284 # doxygen program for documentation building
286 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
289 ### Checks for libraries
291 # Evil library for compilation on Windows CE
296 PKG_CHECK_MODULES([EVIL], [evil])
297 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
298 requirement_eina="evil"
299 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
302 AC_SUBST(EFL_EINA_BUILD)
304 # Check ememoa memory pool library
306 AC_ARG_ENABLE([ememoa],
307 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
309 if test "x${enableval}" = "xyes" ; then
315 [enable_ememoa="yes"]
317 AC_MSG_CHECKING([whether to use ememoa for memory pool])
318 AC_MSG_RESULT([$enable_ememoa])
320 if test "x${enable_ememoa}" = "xyes" ; then
321 PKG_CHECK_MODULES([EMEMOA],
323 [enable_ememoa="yes"],
329 ### Checks for header files
336 AC_CHECK_HEADER([inttypes.h],
337 [EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"])
338 AC_SUBST(EINA_CONFIGURE_HAVE_INTTYPES_H)
340 AC_CHECK_HEADER([stdint.h],
341 [EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"])
342 AC_SUBST(EINA_CONFIGURE_HAVE_STDINT_H)
344 AC_CHECK_SIZEOF(wchar_t)
345 EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
346 AC_SUBST(EINA_SIZEOF_WCHAR_T)
348 ### Checks for structures
351 ### Checks for compiler characteristics
363 EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
364 EINA_CFLAGS="${EVIL_CFLAGS}"
368 EINA_CPPFLAGS="-D_WIN32_WINNT=0x0501"
369 EINA_CFLAGS="${EVIL_CFLAGS}"
373 AM_CONDITIONAL([EINA_HAVE_WIN32], [test "x$have_win32" = "xyes"])
377 EFL_COMPILER_FLAG([-Wall])
378 EFL_COMPILER_FLAG([-W])
381 EFL_COMPILER_FLAG([-Wshadow])
383 AC_SUBST(EINA_CPPFLAGS)
384 AC_SUBST(EINA_CFLAGS)
387 ### Checks for linker characteristics
389 lt_enable_auto_import=""
392 EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
393 lt_enable_auto_import="-Wl,--enable-auto-import"
408 EINA_LIBS="-ldl -lrt -lm"
412 AC_SUBST(lt_enable_auto_import)
414 EFL_LINKER_FLAG([-fno-strict-aliasing])
417 ### Checks for library functions
420 AC_CHECK_FUNCS(strlcpy)
427 AC_DEFINE(HAVE_DLADDR)
430 AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
431 if test "x${res}" = "xyes" ; then
432 AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
434 AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
435 if test "x${res}" = "xyes" ; then
436 AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
439 AC_MSG_ERROR([Cannot find dlopen])
444 AC_SUBST(dlopen_libs)
446 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
450 AC_ARG_WITH([iconv-link],
451 AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
453 LIBS="$withval $LIBS"
457 AC_MSG_CHECKING(for explicit iconv link options)
458 if test "x${iconv_libs}" = "x" ; then
459 AC_MSG_RESULT([no explicit iconv link option])
461 AC_MSG_RESULT([$iconv_libs])
464 if test "x${have_iconv}" = "xno" ; then
465 AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])
467 if test "x${have_iconv}" = "xyes" ; then
468 AC_MSG_CHECKING([whether iconv() is in libc])
478 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
483 AC_MSG_RESULT([${have_iconv}])
486 if test "x${have_iconv}" = "xno" ; then
487 AC_MSG_CHECKING([whether iconv() is in libiconv.a])
500 count = iconv(ic, NULL, NULL, NULL, NULL);
508 AC_MSG_RESULT([${have_iconv}])
511 if test "x${have_iconv}" = "xno" ; then
512 AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a])
515 LIBS="-liconv_plug $LIBS"
524 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
532 AC_MSG_RESULT([${have_iconv}])
536 if test "x${have_iconv}" = "xyes" ; then
537 AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
540 #check for dirfd API presence
542 AC_CHECK_FUNCS([dirfd], [have_dirfd="yes"], [])
543 if test "x${dirfd}" = "xyes"; then
544 AC_DEFINE(HAVE_DIRFD)
546 AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], [])
547 AC_CHECK_FUNCS([statat], [AC_DEFINE(HAVE_STATAT)], [])
548 AC_CHECK_FUNCS([fpathconf], [AC_DEFINE(HAVE_FPATHCONF)], [])
552 if test "x${have_default_mempool}" = "xyes" ; then
553 enable_chained_pool="no"
554 enable_pass_through="static"
556 enable_chained_pool="static"
557 enable_pass_through="no"
560 enable_one_big="static"
562 EINA_CHECK_MODULE([chained-pool], [${enable_chained_pool}], [chained pool])
563 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
564 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
565 EINA_CHECK_MODULE([fixed-bitmap], [no], [fixed bitmap])
566 EINA_CHECK_MODULE([pass-through], [${enable_pass_through}], [pass through])
567 EINA_CHECK_MODULE([buddy], [no], [buddy])
568 EINA_CHECK_MODULE([one-big], [${enable_one_big}], [one big])
570 ### Make the debug preprocessor configurable
572 ### Unit tests, coverage and benchmarking
574 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
576 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
577 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
578 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
579 if test "x$enable_coverage" = "xyes" ; then
580 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
583 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
584 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
586 AC_SUBST(requirement_eina)
588 ### Create the .pc.in file according to the major version
589 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
591 #exec_prefix=@exec_prefix@
593 #includedir=@includedir@
596 #Description: A Library that implements fast data types and miscellaneous tools
599 #Libs: -L${libdir} -leina
601 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
611 src/include/eina_config.h
614 src/modules/mp/Makefile
615 src/modules/mp/chained_pool/Makefile
616 src/modules/mp/ememoa_fixed/Makefile
617 src/modules/mp/ememoa_unknown/Makefile
618 src/modules/mp/pass_through/Makefile
619 src/modules/mp/fixed_bitmap/Makefile
620 src/modules/mp/buddy/Makefile
621 src/modules/mp/one_big/Makefile
627 #####################################################################
633 echo "------------------------------------------------------------------------"
634 echo "$PACKAGE $VERSION"
635 echo "------------------------------------------------------------------------"
638 echo "Configuration Options Summary:"
640 echo " Magic debug..........: ${have_magic_debug}"
641 echo " Safety checks........: ${have_safety_checks}"
642 echo " Maximum log level....: ${with_max_log_level}"
643 echo " Report string usage..: ${have_stringshare_usage}"
644 echo " Valgrind support.....: ${have_valgrind}"
645 echo " Default mempool......: ${have_default_mempool}"
646 echo " Thread Support.......: ${have_threads}"
647 if test "${have_threads}" = "POSIX" ; then
648 echo " spinlock...........: ${have_posix_threads_spinlock}"
649 echo " debug usage........: ${have_debug_threads}"
651 echo " Amalgamation.........: ${do_amalgamation}"
652 echo " Iconv support........: ${have_iconv}"
653 echo " File dirfd...........: ${have_dirfd}"
655 echo " Documentation........: ${build_doc}"
656 echo " Tests................: ${enable_tests}"
657 echo " Coverage.............: ${enable_coverage}"
658 echo " Benchmark............: ${enable_benchmark}"
659 if test "x${enable_benchmark}" = "xyes" ; then
660 echo " Glib...............: ${enable_benchmark_glib}"
661 echo " E17 real data......: ${enable_benchmark_e17}"
664 echo " CPU Specific Extensions:"
665 echo " MMX................: ${have_mmx}"
666 echo " SSE................: ${have_sse}"
667 echo " SSE2...............: ${have_sse2}"
668 echo " ALTIVEC............: ${have_altivec}"
670 echo " Memory pools:"
671 echo " Chained pool.......: ${enable_chained_pool}"
672 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
673 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
674 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
675 echo " Pass through.......: ${enable_pass_through}"
676 echo " Buddy..............: ${enable_buddy}"
677 echo " One big............: ${enable_one_big}"
679 echo "Compilation............: make (or gmake)"
680 echo " CPPFLAGS.............: $CPPFLAGS"
681 echo " CFLAGS...............: $CFLAGS"
682 echo " LDFLAGS..............: $LDFLAGS"
684 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
685 echo " prefix...............: $prefix"