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.beta3], [enlightenment-devel@lists.sourceforge.net])
23 AC_CONFIG_SRCDIR([configure.ac])
24 AC_CONFIG_MACRO_DIR([m4])
26 #ifndef EFL_CONFIG_H__
27 #define EFL_CONFIG_H__
30 #endif /* EFL_CONFIG_H__ */
33 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
34 AM_CONFIG_HEADER([config.h])
35 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
38 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
39 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
42 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
43 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
44 m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
45 m4_ifdef([v_rel], , [m4_define([v_rel], [])])
46 AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
47 AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
48 AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
49 AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
50 version_info="lt_rev:lt_cur:lt_age"
52 AC_SUBST(version_info)
53 AC_SUBST(release_info)
54 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
55 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
60 ### Needed information
69 MODULE_ARCH="$host_os-$host_cpu"
72 MODULE_ARCH="$host_os-$host_cpu-v_maj.v_min.v_mic"
76 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
87 AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "${MODULE_EXT}", [Suffix for shared objects])
89 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
90 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
91 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
92 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
96 if test "x${_efl_have_posix_threads}" = "xyes" ; then
99 if test "x${_efl_have_win32_threads}" = "xyes" ; then
107 EFL_CHECK_SPINLOCK([have_posix_threads_spinlock="yes"], [have_posix_threads_spinlock="no"])
109 ### Additional options to configure
112 AC_ARG_ENABLE([magic-debug],
113 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
115 if test "x${enableval}" = "xyes" ; then
116 have_magic_debug="yes"
118 have_magic_debug="no"
121 [have_magic_debug="yes"])
123 AC_MSG_CHECKING([whether magic debug is enable])
124 AC_MSG_RESULT([${have_magic_debug}])
126 if test "x${have_magic_debug}" = "xyes" ; then
127 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
129 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
135 AC_MSG_CHECKING(whether to enable build with valgrind)
136 AC_ARG_ENABLE(valgrind,
137 AC_HELP_STRING([--enable-valgrind], [improve valgrind support by hinting it of our memory usages, having it to report proper mempool leaks.]),
138 [want_valgrind=$enableval]
140 AC_MSG_RESULT($want_valgrind)
142 if test "x${want_valgrind}" = "xyes" -o "x${want_valgrind}" = "xauto"; then
143 PKG_CHECK_MODULES(VALGRIND, valgrind >= 2.4.0,
145 requirement_eina="valgrind ${requirement_eina}"
149 AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
150 if test "x$want_valgrind" = "xyes"; then
151 AC_MSG_ERROR([Valgrind >= 2.4.0 is required)])
156 AC_DEFINE(NVALGRIND, 1, [Valgrind support disabled])
159 # Safety checks (avoid crashes on wrong api usage)
160 AC_ARG_ENABLE(safety-checks,
161 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
163 if test "x${enableval}" = "xyes" ; then
164 have_safety_checks="yes"
166 have_safety_checks="no"
169 [have_safety_checks="yes"])
171 AC_MSG_CHECKING(whether to do safety checking on api parameters)
172 AC_MSG_RESULT($have_safety_checks)
174 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
175 if test "x$have_safety_checks" = "xyes"; then
176 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
177 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
179 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
181 with_max_log_level="<unset>"
182 AC_ARG_WITH(internal-maximum-log-level,
183 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
184 [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.])],
186 if test "x${withval}" != "xno"; then
187 if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
188 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
189 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
190 with_max_log_level="${withval}"
192 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
197 AC_ARG_ENABLE([amalgamation],
198 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
199 [if test "x${enableval}" = "xyes"; then
200 do_amalgamation="yes"
205 [do_amalgamation="no"]
207 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
209 # Choose best memory pool
210 AC_ARG_ENABLE([default-mempool],
211 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
213 if test "x${enableval}" = "xyes"; then
214 have_default_mempool="yes"
216 have_default_mempool="no"
219 [have_default_mempool="no"]
221 AC_MSG_CHECKING([whether to use default mempool allocator])
222 AC_MSG_RESULT([${have_default_mempool}])
224 if test "x${have_default_mempool}" = "xyes" ; then
225 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
227 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
229 # Report stringshare usage
230 AC_ARG_ENABLE([stringshare-usage],
231 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
233 if test "x${enableval}" = "xyes"; then
234 have_stringshare_usage="yes"
236 have_stringshare_usage="no"
239 [have_stringshare_usage="no"]
241 AC_MSG_CHECKING([whether to report stringshare usage])
242 AC_MSG_RESULT([${have_stringshare_usage}])
244 if test "x${have_stringshare_usage}" = "xyes"; then
245 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
248 # Check if we want to benchmark on real data
249 enable_benchmark_e17="no"
251 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
253 if test "x${enableval}" = "xyes" ; then
254 enable_benchmark_e17="yes"
256 enable_benchmark_e17="no"
259 [enable_benchmark_e17="no"])
261 AC_MSG_CHECKING([whether e17 real data benchmark are built])
262 AC_MSG_RESULT([${enable_benchmark_e17}])
264 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
267 ### Checks for programs
273 # Check whether pkg-config supports Requires.private
274 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
275 pkgconfig_requires_private="Requires.private"
277 pkgconfig_requires_private="Requires"
279 AC_SUBST(pkgconfig_requires_private)
281 # doxygen program for documentation building
283 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
286 ### Checks for libraries
288 # Evil library for compilation on Windows CE
293 PKG_CHECK_MODULES([EVIL], [evil])
294 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
295 requirement_eina="evil"
296 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
299 AC_SUBST(EFL_EINA_BUILD)
301 # Check ememoa memory pool library
303 AC_ARG_ENABLE([ememoa],
304 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
306 if test "x${enableval}" = "xyes" ; then
312 [enable_ememoa="yes"]
314 AC_MSG_CHECKING([whether to use ememoa for memory pool])
315 AC_MSG_RESULT([$enable_ememoa])
317 if test "x${enable_ememoa}" = "xyes" ; then
318 PKG_CHECK_MODULES([EMEMOA],
320 [enable_ememoa="yes"],
326 ### Checks for header files
333 AC_CHECK_HEADER([inttypes.h],
334 [EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"])
335 AC_SUBST(EINA_CONFIGURE_HAVE_INTTYPES_H)
337 AC_CHECK_HEADER([stdint.h],
338 [EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"])
339 AC_SUBST(EINA_CONFIGURE_HAVE_STDINT_H)
341 AC_CHECK_SIZEOF(wchar_t)
342 EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
343 AC_SUBST(EINA_SIZEOF_WCHAR_T)
345 ### Checks for structures
348 ### Checks for compiler characteristics
361 EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
362 EINA_CFLAGS="${EVIL_CFLAGS}"
366 EINA_CPPFLAGS="-D_WIN32_WINNT=0x0501"
367 EINA_CFLAGS="${EVIL_CFLAGS}"
371 AM_CONDITIONAL([EINA_HAVE_WIN32], [test "x$have_win32" = "xyes"])
375 EFL_COMPILER_FLAG([-Wall])
376 EFL_COMPILER_FLAG([-W])
379 EFL_COMPILER_FLAG([-Wshadow])
381 AC_SUBST(EINA_CPPFLAGS)
382 AC_SUBST(EINA_CFLAGS)
385 ### Checks for linker characteristics
387 lt_enable_auto_import=""
390 EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
391 lt_enable_auto_import="-Wl,--enable-auto-import"
406 EINA_LIBS="-ldl -lrt -lm"
410 AC_SUBST(lt_enable_auto_import)
412 EFL_LINKER_FLAG([-fno-strict-aliasing])
415 ### Checks for library functions
418 AC_CHECK_FUNCS(strlcpy)
425 AC_DEFINE(HAVE_DLADDR)
428 AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
429 if test "x${res}" = "xyes" ; then
430 AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
432 AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
433 if test "x${res}" = "xyes" ; then
434 AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
437 AC_MSG_ERROR([Cannot find dlopen])
442 AC_SUBST(dlopen_libs)
444 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
448 AC_ARG_WITH([iconv-link],
449 AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
451 LIBS="$withval $LIBS"
455 AC_MSG_CHECKING(for explicit iconv link options)
456 if test "x${iconv_libs}" = "x" ; then
457 AC_MSG_RESULT([no explicit iconv link option])
459 AC_MSG_RESULT([$iconv_libs])
462 if test "x${have_iconv}" = "xno" ; then
463 AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])
465 if test "x${have_iconv}" = "xyes" ; then
466 AC_MSG_CHECKING([whether iconv() is in libc])
476 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
481 AC_MSG_RESULT([${have_iconv}])
484 if test "x${have_iconv}" = "xno" ; then
485 AC_MSG_CHECKING([whether iconv() is in libiconv.a])
498 count = iconv(ic, NULL, NULL, NULL, NULL);
506 AC_MSG_RESULT([${have_iconv}])
509 if test "x${have_iconv}" = "xno" ; then
510 AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a])
513 LIBS="-liconv_plug $LIBS"
522 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
530 AC_MSG_RESULT([${have_iconv}])
534 if test "x${have_iconv}" = "xyes" ; then
535 AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
538 #check for dirfd API presence
540 AC_CHECK_FUNCS([dirfd], [have_dirfd="yes"], [])
541 if test "x${dirfd}" = "xyes"; then
542 AC_DEFINE(HAVE_DIRFD)
544 AC_CHECK_FUNCS([openat], [AC_DEFINE(HAVE_OPENAT)], [])
545 AC_CHECK_FUNCS([statat], [AC_DEFINE(HAVE_STATAT)], [])
546 AC_CHECK_FUNCS([fpathconf], [AC_DEFINE(HAVE_FPATHCONF)], [])
550 if test "x${have_default_mempool}" = "xyes" ; then
551 enable_chained_pool="no"
552 enable_pass_through="static"
554 enable_chained_pool="static"
555 enable_pass_through="no"
558 enable_one_big="static"
560 EINA_CHECK_MODULE([chained-pool], [${enable_chained_pool}], [chained pool])
561 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
562 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
563 EINA_CHECK_MODULE([fixed-bitmap], [no], [fixed bitmap])
564 EINA_CHECK_MODULE([pass-through], [${enable_pass_through}], [pass through])
565 EINA_CHECK_MODULE([buddy], [no], [buddy])
566 EINA_CHECK_MODULE([one-big], [${enable_one_big}], [one big])
568 ### Make the debug preprocessor configurable
570 AC_SUBST(requirement_eina)
572 ### Create the .pc.in file according to the major version
573 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
575 #exec_prefix=@exec_prefix@
577 #includedir=@includedir@
580 #Description: A Library that implements fast data types and miscellaneous tools
583 #Libs: -L${libdir} -leina
585 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
595 src/include/eina_config.h
598 src/modules/mp/Makefile
599 src/modules/mp/chained_pool/Makefile
600 src/modules/mp/ememoa_fixed/Makefile
601 src/modules/mp/ememoa_unknown/Makefile
602 src/modules/mp/pass_through/Makefile
603 src/modules/mp/fixed_bitmap/Makefile
604 src/modules/mp/buddy/Makefile
605 src/modules/mp/one_big/Makefile
610 #####################################################################
616 echo "------------------------------------------------------------------------"
617 echo "$PACKAGE $VERSION"
618 echo "------------------------------------------------------------------------"
621 echo "Configuration Options Summary:"
623 echo " Magic debug..........: ${have_magic_debug}"
624 echo " Safety checks........: ${have_safety_checks}"
625 echo " Maximum log level....: ${with_max_log_level}"
626 echo " Report string usage..: ${have_stringshare_usage}"
627 echo " Valgrind support.....: ${have_valgrind}"
628 echo " Default mempool......: ${have_default_mempool}"
629 echo " Thread Support.......: ${have_threads}"
630 if test "${have_threads}" = "POSIX" ; then
631 echo " spinlock...........: ${have_posix_threads_spinlock}"
632 echo " debug usage........: ${have_debug_threads}"
634 echo " Amalgamation.........: ${do_amalgamation}"
635 echo " Iconv support........: ${have_iconv}"
636 echo " File dirfd...........: ${have_dirfd}"
638 echo " Documentation........: ${build_doc}"
640 echo " CPU Specific Extensions:"
641 echo " MMX................: ${have_mmx}"
642 echo " SSE................: ${have_sse}"
643 echo " SSE2...............: ${have_sse2}"
644 echo " ALTIVEC............: ${have_altivec}"
646 echo " Memory pools:"
647 echo " Chained pool.......: ${enable_chained_pool}"
648 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
649 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
650 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
651 echo " Pass through.......: ${enable_pass_through}"
652 echo " Buddy..............: ${enable_buddy}"
653 echo " One big............: ${enable_one_big}"
655 echo "Compilation............: make (or gmake)"
656 echo " CPPFLAGS.............: $CPPFLAGS"
657 echo " CFLAGS...............: $CFLAGS"
658 echo " LDFLAGS..............: $LDFLAGS"
660 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
661 echo " prefix...............: $prefix"