1 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
2 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
3 m4_define([v_maj], [0])
4 m4_define([v_min], [9])
5 m4_define([v_mic], [9])
6 m4_define([v_rev], m4_esyscmd([svnversion . | awk -F : '{printf("%s", $1);}' | tr 'A-z' ' ' | sed 's/ //g']))
7 m4_ifelse(m4_len[v_rev], [0], [m4_undefine([v_rev])])
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 m4_define([v_rel], [-release ver-pre-svn-05])
12 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
13 m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
14 [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])
22 release="ver-pre-svn-05"
24 AC_CONFIG_SRCDIR([configure.ac])
25 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 MODULE_ARCH="$host_os-$host_cpu-$release"
58 AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
60 ### Needed information
66 MODULE_ARCH="$host_os-$host_cpu"
69 MODULE_ARCH="$host_os-$host_cpu-$release"
73 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
75 AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "$shrext_cmds", [Suffix for shared objects])
77 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
78 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
79 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
80 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
82 EFL_CHECK_PTHREAD(["yes"],
85 [have_pthread_spinlock="yes"],
86 [have_pthread_spinlock="no"])
88 ### Additional options to configure
91 AC_ARG_ENABLE([magic-debug],
92 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
94 if test "x${enableval}" = "xyes" ; then
95 have_magic_debug="yes"
100 [have_magic_debug="yes"])
102 AC_MSG_CHECKING([whether magic debug is enable])
103 AC_MSG_RESULT([${have_magic_debug}])
105 if test "x${have_magic_debug}" = "xyes" ; then
106 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
108 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
110 # Safety checks (avoid crashes on wrong api usage)
111 AC_ARG_ENABLE(safety-checks,
112 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
114 if test "x${enableval}" = "xyes" ; then
115 have_safety_checks="yes"
117 have_safety_checks="no"
120 [have_safety_checks="yes"])
122 AC_MSG_CHECKING(whether to do safety checking on api parameters)
123 AC_MSG_RESULT($have_safety_checks)
125 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
126 if test "x$have_safety_checks" = "xyes"; then
127 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
128 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
130 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
132 with_max_log_level="<unset>"
133 AC_ARG_WITH(internal-maximum-log-level,
134 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
135 [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.])],
137 if test "x${withval}" != "xno"; then
138 if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
139 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
140 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
141 with_max_log_level="${withval}"
143 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
148 AC_ARG_ENABLE([amalgamation],
149 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
150 [if test "x${enableval}" = "xyes"; then
151 do_amalgamation="yes"
156 [do_amalgamation="no"]
158 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
160 # Choose best memory pool
161 AC_ARG_ENABLE([default-mempool],
162 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
164 if test "x${enableval}" = "xyes"; then
165 have_default_mempool="yes"
167 have_default_mempool="no"
170 [have_default_mempool="no"]
172 AC_MSG_CHECKING([whether to use default mempool allocator])
173 AC_MSG_RESULT([${have_default_mempool}])
175 if test "x${have_default_mempool}" = "xyes" ; then
176 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
178 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
180 # Report stringshare usage
181 AC_ARG_ENABLE([stringshare-usage],
182 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
184 if test "x${enableval}" = "xyes"; then
185 have_stringshare_usage="yes"
187 have_stringshare_usage="no"
190 [have_stringshare_usage="no"]
192 AC_MSG_CHECKING([whether to report stringshare usage])
193 AC_MSG_RESULT([${have_stringshare_usage}])
195 if test "x${have_stringshare_usage}" = "xyes"; then
196 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
199 # Check if we want to benchmark on real data
200 enable_benchmark_e17="no"
202 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
204 if test "x${enableval}" = "xyes" ; then
205 enable_benchmark_e17="yes"
207 enable_benchmark_e17="no"
210 [enable_benchmark_e17="no"])
212 AC_MSG_CHECKING([whether e17 real data benchmark are built])
213 AC_MSG_RESULT([${enable_benchmark_e17}])
215 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
218 ### Checks for programs
224 # Check whether pkg-config supports Requires.private
225 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
226 pkgconfig_requires_private="Requires.private"
228 pkgconfig_requires_private="Requires"
230 AC_SUBST(pkgconfig_requires_private)
232 # doxygen program for documentation building
234 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
237 ### Checks for libraries
239 # Evil library for compilation on Windows CE
244 PKG_CHECK_MODULES([EVIL], [evil])
245 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
246 requirement_eina="evil"
247 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
250 AC_SUBST(EFL_EINA_BUILD)
252 # Check ememoa memory pool library
254 AC_ARG_ENABLE([ememoa],
255 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
257 if test "x${enableval}" = "xyes" ; then
263 [enable_ememoa="yes"]
265 AC_MSG_CHECKING([whether to use ememoa for memory pool])
266 AC_MSG_RESULT([$enable_ememoa])
268 if test "x${enable_ememoa}" = "xyes" ; then
269 PKG_CHECK_MODULES([EMEMOA],
271 [enable_ememoa="yes"],
276 ### Checks for header files
284 ### Checks for structures
287 ### Checks for compiler characteristics
298 EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
299 EINA_CFLAGS="${EVIL_CFLAGS}"
302 EINA_CPPFLAGS="-D_WIN32_WINNT=0x0501"
303 EINA_CFLAGS="${EVIL_CFLAGS}"
307 if ! test "x${VMIC}" = "x" ; then
308 EFL_COMPILER_FLAG([-Wall])
309 EFL_COMPILER_FLAG([-W])
312 EFL_COMPILER_FLAG([-Wshadow])
314 AC_SUBST(EINA_CPPFLAGS)
315 AC_SUBST(EINA_CFLAGS)
318 ### Checks for linker characteristics
320 lt_enable_auto_import=""
323 EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
324 lt_enable_auto_import="-Wl,--enable-auto-import"
339 EINA_LIBS="-ldl -lrt -lm"
343 AC_SUBST(lt_enable_auto_import)
345 EFL_LINKER_FLAG([-fno-strict-aliasing])
348 ### Checks for library functions
350 AC_CHECK_FUNCS(strlcpy)
357 AC_DEFINE(HAVE_DLADDR)
360 AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
361 if test "x${res}" = "xyes" ; then
362 AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
364 AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
365 if test "x${res}" = "xyes" ; then
366 AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
369 AC_MSG_ERROR([Cannot find dlopen])
374 AC_SUBST(dlopen_libs)
376 EFL_CHECK_FNMATCH([], [AC_MSG_ERROR([Cannot find fnmatch()])])
380 AC_ARG_WITH([iconv-link],
381 AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
383 LIBS="$withval $LIBS"
387 AC_MSG_CHECKING(for explicit iconv link options)
388 if test "x${iconv_libs}" = "x" ; then
389 AC_MSG_RESULT([no explicit iconv link option])
391 AC_MSG_RESULT([$iconv_libs])
394 if test "x${have_iconv}" = "xno" ; then
395 AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])
397 if test "x${have_iconv}" = "xyes" ; then
398 AC_MSG_CHECKING([whether iconv() is in libc])
408 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
413 AC_MSG_RESULT([${have_iconv}])
416 if test "x${have_iconv}" = "xno" ; then
417 AC_MSG_CHECKING([whether iconv() is in libiconv.a])
430 count = iconv(ic, NULL, NULL, NULL, NULL);
438 AC_MSG_RESULT([${have_iconv}])
441 if test "x${have_iconv}" = "xno" ; then
442 AC_MSG_CHECKING([whether iconv() is in libiconv_plug.a])
445 LIBS="-liconv_plug $LIBS"
454 size_t count = iconv(ic, NULL, NULL, NULL, NULL);
462 AC_MSG_RESULT([${have_iconv}])
466 if test "x${have_iconv}" = "xyes" ; then
467 AC_DEFINE([HAVE_ICONV], [1], [Set to 1 if iconv library is installed])
473 if test "x${have_default_mempool}" = "xyes" ; then
474 enable_chained_pool="no"
475 enable_pass_through="static"
477 enable_chained_pool="static"
478 enable_pass_through="no"
481 EINA_CHECK_MODULE([chained-pool], [${enable_chained_pool}], [chained pool])
482 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
483 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
484 EINA_CHECK_MODULE([fixed-bitmap], [no], [fixed bitmap])
485 EINA_CHECK_MODULE([pass-through], [${enable_pass_through}], [pass through])
486 EINA_CHECK_MODULE([buddy], [no], [buddy])
489 ### Make the debug preprocessor configurable
491 ### Unit tests, coverage and benchmarking
493 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
495 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
496 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
497 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
498 if test "x$enable_coverage" = "xyes" ; then
499 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
502 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
503 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
505 AC_SUBST(requirement_eina)
507 ### Create the .pc.in file according to the major version
508 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
510 #exec_prefix=@exec_prefix@
512 #includedir=@includedir@
515 #Description: A Library that implements fast data types and miscellaneous tools
518 #Libs: -L${libdir} -leina
520 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
530 src/include/eina_config.h
533 src/modules/mp/Makefile
534 src/modules/mp/chained_pool/Makefile
535 src/modules/mp/ememoa_fixed/Makefile
536 src/modules/mp/ememoa_unknown/Makefile
537 src/modules/mp/pass_through/Makefile
538 src/modules/mp/fixed_bitmap/Makefile
539 src/modules/mp/buddy/Makefile
545 #####################################################################
551 echo "------------------------------------------------------------------------"
552 echo "$PACKAGE $VERSION"
553 echo "------------------------------------------------------------------------"
556 echo "Configuration Options Summary:"
558 echo " Magic debug..........: ${have_magic_debug}"
559 echo " Safety checks........: ${have_safety_checks}"
560 echo " Maximum log level....: ${with_max_log_level}"
561 echo " Report string usage..: ${have_stringshare_usage}"
562 echo " Default mempool......: ${have_default_mempool}"
563 echo " Thread Support.......: ${have_pthread} (spinlock: ${have_pthread_spinlock})"
564 echo " Amalgamation.........: ${do_amalgamation}"
565 echo " Iconv support........: ${have_iconv}"
567 echo " Documentation........: ${build_doc}"
568 echo " Tests................: ${enable_tests}"
569 echo " Coverage.............: ${enable_coverage}"
570 echo " Benchmark............: ${enable_benchmark}"
571 if test "x${enable_benchmark}" = "xyes" ; then
572 echo " Glib...............: ${enable_benchmark_glib}"
573 echo " E17 real data......: ${enable_benchmark_e17}"
576 echo " CPU Specific Extensions:"
577 echo " MMX................: ${have_mmx}"
578 echo " SSE................: ${have_sse}"
579 echo " SSE2...............: ${have_sse2}"
580 echo " ALTIVEC............: ${have_altivec}"
582 echo " Memory pools:"
583 echo " Chained pool.......: ${enable_chained_pool}"
584 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
585 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
586 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
587 echo " Pass through.......: ${enable_pass_through}"
588 echo " Buddy..............: ${enable_buddy}"
590 echo "Compilation............: make (or gmake)"
591 echo " CPPFLAGS.............: $CPPFLAGS"
592 echo " CFLAGS...............: $CFLAGS"
593 echo " LDFLAGS..............: $LDFLAGS"
595 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
596 echo " prefix...............: $prefix"