1 # get rid of that stupid cache mechanism
4 AC_INIT([eina], [0.0.2.062], [enlightenment-devel@lists.sourceforge.net])
6 AC_CONFIG_SRCDIR([configure.ac])
7 AC_CONFIG_MACRO_DIR([m4])
12 AM_INIT_AUTOMAKE(1.6 dist-bzip2)
13 AM_CONFIG_HEADER(config.h)
16 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
17 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
20 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
21 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
22 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
23 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
24 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
26 AC_SUBST(version_info)
29 ### Needed information
33 release="ver-pre-svn-04"
36 MODULE_ARCH="$host_os-$host_cpu"
39 release_info="-release $release"
40 MODULE_ARCH="$host_os-$host_cpu-$release"
43 AC_SUBST(release_info)
45 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
47 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
48 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
49 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
50 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
52 EFL_CHECK_PTHREAD([have_pthread="yes"], [have_pthread="no"])
54 if test "x${have_pthread}" = "xyes"; then
55 AC_CHECK_LIB(pthread, pthread_spin_init,
57 AC_DEFINE(EINA_PTHREAD_SPIN, 1, [Build eina_log lock using pthread_spin])
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([--disable-amalgamation], [disable generation of one single file with all source code in it, helps compiler optimizations.])],
123 [if test "x${enableval}" = "xno"; then
126 do_amalgamation="yes"
129 [do_amalgamation="yes"]
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
263 ### Checks for structures
266 ### Checks for compiler characteristics
276 EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
279 EINA_CPPFLAGS="-D_WIN32_WINNT=0x0500"
286 EINA_CFLAGS="${EVIL_CFLAGS} -mwin32"
289 EINA_CFLAGS="${EVIL_CFLAGS}"
293 if ! test "x${VMIC}" = "x" ; then
294 CFLAGS_save="${CFLAGS}"
295 CFLAGS="${CFLAGS} -Wall -W"
297 [AC_LANG_PROGRAM([[]])],
300 AC_MSG_CHECKING([whether the compiler supports -Wall])
301 AC_MSG_RESULT([${have_Wall}])
302 CFLAGS="${CFLAGS_save}"
303 if test "x${have_Wall}" = "xyes" ; then
304 EINA_CFLAGS="${EINA_CFLAGS} -Wall -W" # -Werror
308 CFLAGS_save="${CFLAGS}"
309 CFLAGS="${CFLAGS} -fno-strict-aliasing"
311 [AC_LANG_PROGRAM([[]])],
312 [have_no_strict_aliasing="yes"],
313 [have_no_strict_aliasing="no"])
314 AC_MSG_CHECKING([whether the compiler supports -fno-strict-aliasing])
315 AC_MSG_RESULT([${have_no_strict_aliasing}])
316 CFLAGS="${CFLAGS_save}"
317 if test "x${have_no_strict_aliasing}" = "xyes" ; then
318 EINA_CFLAGS="${EINA_CFLAGS} -fno-strict-aliasing"
321 AC_SUBST(EINA_CPPFLAGS)
322 AC_SUBST(EINA_CFLAGS)
325 ### Checks for linker characteristics
327 lt_enable_auto_import=""
330 EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
331 lt_enable_auto_import="-Wl,--enable-auto-import"
346 EINA_LIBS="-ldl -lrt -lm"
350 AC_SUBST(lt_enable_auto_import)
353 ### Checks for library functions
361 AC_DEFINE(HAVE_DLADDR)
364 AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
365 if test "x${res}" = "xyes" ; then
366 AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
368 AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
369 if test "x${res}" = "xyes" ; then
370 AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
373 AC_MSG_ERROR([Cannot find dlopen])
378 AC_SUBST(dlopen_libs)
382 EINA_CHECK_MODULE([chained-pool], [yes], [chained pool])
383 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
384 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
385 EINA_CHECK_MODULE([fixed-bitmap], [yes], [fixed bitmap])
386 EINA_CHECK_MODULE([pass-through], [yes], [pass through])
389 ### Make the debug preprocessor configurable
391 ### Unit tests, coverage and benchmarking
393 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
395 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
396 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
397 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
398 if test "x$enable_coverage" = "xyes" ; then
399 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
402 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
403 EINA_BENCH_MODULE([evas], [${enable_benchmark}], [evas], [enable_benchmark_evas="yes"], [enable_benchmark_evas="no"])
404 EINA_BENCH_MODULE([ecore], [${enable_benchmark}], [ecore], [enable_benchmark_ecore="yes"], [enable_benchmark_ecore="no"])
405 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
407 AC_SUBST(requirement_eina)
409 ### Create the .pc.in file according to the major version
410 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
412 #exec_prefix=@exec_prefix@
414 #includedir=@includedir@
417 #Description: A Library that implements fast data types and miscellaneous tools
420 #Libs: -L${libdir} -leina
422 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
432 src/include/eina_config.h
435 src/modules/mp/Makefile
436 src/modules/mp/chained_pool/Makefile
437 src/modules/mp/ememoa_fixed/Makefile
438 src/modules/mp/ememoa_unknown/Makefile
439 src/modules/mp/pass_through/Makefile
440 src/modules/mp/fixed_bitmap/Makefile
446 #####################################################################
452 echo "------------------------------------------------------------------------"
453 echo "$PACKAGE $VERSION"
454 echo "------------------------------------------------------------------------"
457 echo "Configuration Options Summary:"
459 echo " Magic debug..........: ${have_magic_debug}"
460 echo " Safety checks........: ${have_safety_checks}"
461 echo " Maximum log level....: ${with_max_log_level}"
462 echo " Report string usage..: ${have_stringshare_usage}"
463 echo " Default mempool......: ${have_default_mempool}"
464 echo " Thread Support.......: ${have_pthread}"
465 echo " Amalgamation.........: ${do_amalgamation}"
467 echo " Documentation........: ${build_doc}"
468 echo " Tests................: ${enable_tests}"
469 echo " Coverage.............: ${enable_coverage}"
470 echo " Benchmark............: ${enable_benchmark}"
471 if test "x${enable_benchmark}" = "xyes" ; then
472 echo " Glib...............: ${enable_benchmark_glib}"
473 echo " Evas...............: ${enable_benchmark_evas}"
474 echo " Ecore..............: ${enable_benchmark_ecore}"
475 echo " E17 real data......: ${enable_benchmark_e17}"
478 echo "CPU Specific Extensions:"
480 echo " MMX..................: ${have_mmx}"
481 echo " SSE..................: ${have_sse}"
482 echo " SSE2.................: ${have_sse2}"
483 echo " ALTIVEC..............: ${have_altivec}"
485 echo " Memory pools:"
486 echo " Chained pool.......: ${enable_chained_pool}"
487 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
488 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
489 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
490 echo " Pass through.......: ${enable_pass_through}"
492 echo " Installation.........: make install"
494 echo " prefix.............: $prefix"
496 echo "Now type 'make' ('gmake' on some systems) to compile $PACKAGE,"
497 echo "and then afterwards as root (or the user who will install this), type"
498 echo "'make install'. Change users with 'su' or 'sudo' appropriately."
500 if test "x${have_static_module}" = "xyes" ; then
501 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Eina."
502 echo " You must know what you are doing, or else you will have a lot of problems."
503 echo " And dolphins will disappear from the earth."
504 echo " Think about that."