1 # get rid of that stupid cache mechanism
4 AC_INIT([eina], [0.9.9.063], [enlightenment-devel@lists.sourceforge.net])
5 release="ver-pre-svn-05"
7 AC_CONFIG_SRCDIR([configure.ac])
8 AC_CONFIG_MACRO_DIR([m4])
13 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
14 AM_CONFIG_HEADER([config.h])
15 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
18 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
19 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
22 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
23 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
24 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
25 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
26 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
28 AC_SUBST(version_info)
31 ### Needed information
37 MODULE_ARCH="$host_os-$host_cpu"
40 release_info="-release $release"
41 MODULE_ARCH="$host_os-$host_cpu-$release"
44 AC_SUBST(release_info)
46 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
48 AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "$shrext_cmds", [Suffix for shared objects])
50 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
51 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
52 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
53 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
55 EFL_CHECK_PTHREAD(["yes"],
58 [have_pthread_spinlock="yes"],
59 [have_pthread_spinlock="no"])
61 ### Additional options to configure
64 AC_ARG_ENABLE([magic-debug],
65 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
67 if test "x${enableval}" = "xyes" ; then
68 have_magic_debug="yes"
73 [have_magic_debug="yes"])
75 AC_MSG_CHECKING([whether magic debug is enable])
76 AC_MSG_RESULT([${have_magic_debug}])
78 if test "x${have_magic_debug}" = "xyes" ; then
79 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
81 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
83 # Safety checks (avoid crashes on wrong api usage)
84 AC_ARG_ENABLE(safety-checks,
85 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
87 if test "x${enableval}" = "xyes" ; then
88 have_safety_checks="yes"
90 have_safety_checks="no"
93 [have_safety_checks="yes"])
95 AC_MSG_CHECKING(whether to do safety checking on api parameters)
96 AC_MSG_RESULT($have_safety_checks)
98 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
99 if test "x$have_safety_checks" = "xyes"; then
100 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
101 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
103 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
105 with_max_log_level="<unset>"
106 AC_ARG_WITH(internal-maximum-log-level,
107 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
108 [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.])],
110 if test "x${withval}" != "xno"; then
111 if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
112 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
113 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
114 with_max_log_level="${withval}"
116 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
121 AC_ARG_ENABLE([amalgamation],
122 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
123 [if test "x${enableval}" = "xyes"; then
124 do_amalgamation="yes"
129 [do_amalgamation="no"]
131 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
133 # Choose best memory pool
134 AC_ARG_ENABLE([default-mempool],
135 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
137 if test "x${enableval}" = "xyes"; then
138 have_default_mempool="yes"
140 have_default_mempool="no"
143 [have_default_mempool="no"]
145 AC_MSG_CHECKING([whether to use default mempool allocator])
146 AC_MSG_RESULT([${have_default_mempool}])
148 if test "x${have_default_mempool}" = "xyes" ; then
149 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
151 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
153 # Report stringshare usage
154 AC_ARG_ENABLE([stringshare-usage],
155 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
157 if test "x${enableval}" = "xyes"; then
158 have_stringshare_usage="yes"
160 have_stringshare_usage="no"
163 [have_stringshare_usage="no"]
165 AC_MSG_CHECKING([whether to report stringshare usage])
166 AC_MSG_RESULT([${have_stringshare_usage}])
168 if test "x${have_stringshare_usage}" = "xyes"; then
169 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
172 # Check if we want to benchmark on real data
173 enable_benchmark_e17="no"
175 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
177 if test "x${enableval}" = "xyes" ; then
178 enable_benchmark_e17="yes"
180 enable_benchmark_e17="no"
183 [enable_benchmark_e17="no"])
185 AC_MSG_CHECKING([whether e17 real data benchmark are built])
186 AC_MSG_RESULT([${enable_benchmark_e17}])
188 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
191 ### Checks for programs
197 # Check whether pkg-config supports Requires.private
198 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
199 pkgconfig_requires_private="Requires.private"
201 pkgconfig_requires_private="Requires"
203 AC_SUBST(pkgconfig_requires_private)
205 # doxygen program for documentation building
207 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
210 ### Checks for libraries
212 # Evil library for compilation on Windows CE
217 PKG_CHECK_MODULES([EVIL], [evil])
218 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
219 requirement_eina="evil"
220 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
223 AC_SUBST(EFL_EINA_BUILD)
225 # Check ememoa memory pool library
227 AC_ARG_ENABLE([ememoa],
228 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
230 if test "x${enableval}" = "xyes" ; then
236 [enable_ememoa="yes"]
238 AC_MSG_CHECKING([whether to use ememoa for memory pool])
239 AC_MSG_RESULT([$enable_ememoa])
241 if test "x${enable_ememoa}" = "xyes" ; then
242 PKG_CHECK_MODULES([EMEMOA],
244 [enable_ememoa="yes"],
249 AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes")
250 if test "x${enable_ememoa}" = "xyes"; then
251 AC_DEFINE(EINA_EMEMOA_SUPPORT, 1, [Use by the test suite to try ememoa mempool])
254 ### Checks for header files
259 AC_CHECK_HEADER([fnmatch.h],
261 [AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file])])
266 ### Checks for structures
269 ### Checks for compiler characteristics
279 EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
282 EINA_CPPFLAGS="-D_WIN32_WINNT=0x0500"
289 EINA_CFLAGS="${EVIL_CFLAGS} -mwin32"
292 EINA_CFLAGS="${EVIL_CFLAGS}"
296 if ! test "x${VMIC}" = "x" ; then
297 EFL_COMPILER_FLAG([-Wall])
298 EFL_COMPILER_FLAG([-W])
301 EFL_COMPILER_FLAG([-Wshadow])
302 EFL_COMPILER_FLAG([-fno-strict-aliasing])
304 AC_SUBST(EINA_CPPFLAGS)
305 AC_SUBST(EINA_CFLAGS)
308 ### Checks for linker characteristics
310 lt_enable_auto_import=""
313 EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
314 lt_enable_auto_import="-Wl,--enable-auto-import"
329 EINA_LIBS="-ldl -lrt -lm"
333 AC_SUBST(lt_enable_auto_import)
336 ### Checks for library functions
344 AC_DEFINE(HAVE_DLADDR)
347 AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
348 if test "x${res}" = "xyes" ; then
349 AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
351 AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
352 if test "x${res}" = "xyes" ; then
353 AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
356 AC_MSG_ERROR([Cannot find dlopen])
361 AC_SUBST(dlopen_libs)
364 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
365 if test "x$res" = "xno"; then
366 AC_SEARCH_LIBS([fnmatch],
367 [fnmatch evil iberty],
370 if test "x$res" = "xno"; then
371 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
373 fnmatch_libs="${ac_cv_search_fnmatch}"
375 AC_SUBST(fnmatch_libs)
379 EINA_CHECK_MODULE([chained-pool], [yes], [chained pool])
380 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
381 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
382 EINA_CHECK_MODULE([fixed-bitmap], [yes], [fixed bitmap])
383 EINA_CHECK_MODULE([pass-through], [yes], [pass through])
384 EINA_CHECK_MODULE([buddy], [yes], [buddy])
387 ### Make the debug preprocessor configurable
389 ### Unit tests, coverage and benchmarking
391 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
393 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
394 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
395 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
396 if test "x$enable_coverage" = "xyes" ; then
397 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
400 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
401 EINA_BENCH_MODULE([evas], [${enable_benchmark}], [evas], [enable_benchmark_evas="yes"], [enable_benchmark_evas="no"])
402 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
404 AC_SUBST(requirement_eina)
406 ### Create the .pc.in file according to the major version
407 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
409 #exec_prefix=@exec_prefix@
411 #includedir=@includedir@
414 #Description: A Library that implements fast data types and miscellaneous tools
417 #Libs: -L${libdir} -leina
419 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
429 src/include/eina_config.h
432 src/modules/mp/Makefile
433 src/modules/mp/chained_pool/Makefile
434 src/modules/mp/ememoa_fixed/Makefile
435 src/modules/mp/ememoa_unknown/Makefile
436 src/modules/mp/pass_through/Makefile
437 src/modules/mp/fixed_bitmap/Makefile
438 src/modules/mp/buddy/Makefile
444 #####################################################################
450 echo "------------------------------------------------------------------------"
451 echo "$PACKAGE $VERSION"
452 echo "------------------------------------------------------------------------"
455 echo "Configuration Options Summary:"
457 echo " Magic debug..........: ${have_magic_debug}"
458 echo " Safety checks........: ${have_safety_checks}"
459 echo " Maximum log level....: ${with_max_log_level}"
460 echo " Report string usage..: ${have_stringshare_usage}"
461 echo " Default mempool......: ${have_default_mempool}"
462 echo " Thread Support.......: ${have_pthread} (spinlock: ${have_pthread_spinlock})"
463 echo " Amalgamation.........: ${do_amalgamation}"
465 echo " Documentation........: ${build_doc}"
466 echo " Tests................: ${enable_tests}"
467 echo " Coverage.............: ${enable_coverage}"
468 echo " Benchmark............: ${enable_benchmark}"
469 if test "x${enable_benchmark}" = "xyes" ; then
470 echo " Glib...............: ${enable_benchmark_glib}"
471 echo " Evas...............: ${enable_benchmark_evas}"
472 echo " E17 real data......: ${enable_benchmark_e17}"
475 echo " CPU Specific Extensions:"
476 echo " MMX................: ${have_mmx}"
477 echo " SSE................: ${have_sse}"
478 echo " SSE2...............: ${have_sse2}"
479 echo " ALTIVEC............: ${have_altivec}"
481 echo " Memory pools:"
482 echo " Chained pool.......: ${enable_chained_pool}"
483 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
484 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
485 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
486 echo " Pass through.......: ${enable_pass_through}"
487 echo " Buddy..............: ${enable_buddy}"
489 echo "Compilation............: make (or gmake)"
490 echo " CPPFLAGS.............: $CPPFLAGS"
491 echo " CFLAGS...............: $CFLAGS"
492 echo " LDFLAGS..............: $LDFLAGS"
494 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
495 echo " prefix...............: $prefix"
497 if test "x${have_static_module}" = "xyes" ; then
498 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Eina."
499 echo " You must know what you are doing, or else you will have a lot of problems."
500 echo " And dolphins will disappear from the earth."
501 echo " Think about that."