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])
14 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
17 define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
18 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
21 VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
22 VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
23 VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
24 SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
25 version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
27 AC_SUBST(version_info)
30 ### Needed information
34 release="ver-pre-svn-04"
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 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
49 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
50 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
51 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
53 EFL_CHECK_PTHREAD([have_pthread="yes"], [have_pthread="no"])
55 if test "x${have_pthread}" = "xyes"; then
56 AC_CHECK_LIB(pthread, pthread_spin_init,
58 AC_DEFINE(EINA_PTHREAD_SPIN, 1, [Build eina_log lock using pthread_spin])
62 ### Additional options to configure
65 AC_ARG_ENABLE([magic-debug],
66 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
68 if test "x${enableval}" = "xyes" ; then
69 have_magic_debug="yes"
74 [have_magic_debug="yes"])
76 AC_MSG_CHECKING([whether magic debug is enable])
77 AC_MSG_RESULT([${have_magic_debug}])
79 if test "x${have_magic_debug}" = "xyes" ; then
80 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
82 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
84 # Safety checks (avoid crashes on wrong api usage)
85 AC_ARG_ENABLE(safety-checks,
86 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
88 if test "x${enableval}" = "xyes" ; then
89 have_safety_checks="yes"
91 have_safety_checks="no"
94 [have_safety_checks="yes"])
96 AC_MSG_CHECKING(whether to do safety checking on api parameters)
97 AC_MSG_RESULT($have_safety_checks)
99 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
100 if test "x$have_safety_checks" = "xyes"; then
101 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
102 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
104 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
106 with_max_log_level="<unset>"
107 AC_ARG_WITH(internal-maximum-log-level,
108 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
109 [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.])],
111 if test "x${withval}" != "xno"; then
112 if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
113 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
114 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
115 with_max_log_level="${withval}"
117 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
122 AC_ARG_ENABLE([amalgamation],
123 [AC_HELP_STRING([--disable-amalgamation], [disable generation of one single file with all source code in it, helps compiler optimizations.])],
124 [if test "x${enableval}" = "xno"; then
127 do_amalgamation="yes"
130 [do_amalgamation="yes"]
132 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
134 # Choose best memory pool
135 AC_ARG_ENABLE([default-mempool],
136 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
138 if test "x${enableval}" = "xyes"; then
139 have_default_mempool="yes"
141 have_default_mempool="no"
144 [have_default_mempool="no"]
146 AC_MSG_CHECKING([whether to use default mempool allocator])
147 AC_MSG_RESULT([${have_default_mempool}])
149 if test "x${have_default_mempool}" = "xyes" ; then
150 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
152 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
154 # Report stringshare usage
155 AC_ARG_ENABLE([stringshare-usage],
156 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
158 if test "x${enableval}" = "xyes"; then
159 have_stringshare_usage="yes"
161 have_stringshare_usage="no"
164 [have_stringshare_usage="no"]
166 AC_MSG_CHECKING([whether to report stringshare usage])
167 AC_MSG_RESULT([${have_stringshare_usage}])
169 if test "x${have_stringshare_usage}" = "xyes"; then
170 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
173 # Check if we want to benchmark on real data
174 enable_benchmark_e17="no"
176 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
178 if test "x${enableval}" = "xyes" ; then
179 enable_benchmark_e17="yes"
181 enable_benchmark_e17="no"
184 [enable_benchmark_e17="no"])
186 AC_MSG_CHECKING([whether e17 real data benchmark are built])
187 AC_MSG_RESULT([${enable_benchmark_e17}])
189 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
192 ### Checks for programs
198 # Check whether pkg-config supports Requires.private
199 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
200 pkgconfig_requires_private="Requires.private"
202 pkgconfig_requires_private="Requires"
204 AC_SUBST(pkgconfig_requires_private)
206 # doxygen program for documentation building
208 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
211 ### Checks for libraries
213 # Evil library for compilation on Windows CE
218 PKG_CHECK_MODULES([EVIL], [evil])
219 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
220 requirement_eina="evil"
221 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
224 AC_SUBST(EFL_EINA_BUILD)
226 # Check ememoa memory pool library
228 AC_ARG_ENABLE([ememoa],
229 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
231 if test "x${enableval}" = "xyes" ; then
237 [enable_ememoa="yes"]
239 AC_MSG_CHECKING([whether to use ememoa for memory pool])
240 AC_MSG_RESULT([$enable_ememoa])
242 if test "x${enable_ememoa}" = "xyes" ; then
243 PKG_CHECK_MODULES([EMEMOA],
245 [enable_ememoa="yes"],
250 AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes")
251 if test "x${enable_ememoa}" = "xyes"; then
252 AC_DEFINE(EINA_EMEMOA_SUPPORT, 1, [Use by the test suite to try ememoa mempool])
255 ### Checks for header files
264 ### Checks for structures
267 ### Checks for compiler characteristics
277 EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
280 EINA_CPPFLAGS="-D_WIN32_WINNT=0x0500"
287 EINA_CFLAGS="${EVIL_CFLAGS} -mwin32"
290 EINA_CFLAGS="${EVIL_CFLAGS}"
294 if ! test "x${VMIC}" = "x" ; then
295 CFLAGS_save="${CFLAGS}"
296 CFLAGS="${CFLAGS} -Wall -W"
298 [AC_LANG_PROGRAM([[]])],
301 AC_MSG_CHECKING([whether the compiler supports -Wall])
302 AC_MSG_RESULT([${have_Wall}])
303 CFLAGS="${CFLAGS_save}"
304 if test "x${have_Wall}" = "xyes" ; then
305 EINA_CFLAGS="${EINA_CFLAGS} -Wall -W" # -Werror
309 CFLAGS_save="${CFLAGS}"
310 CFLAGS="${CFLAGS} -fno-strict-aliasing"
312 [AC_LANG_PROGRAM([[]])],
313 [have_no_strict_aliasing="yes"],
314 [have_no_strict_aliasing="no"])
315 AC_MSG_CHECKING([whether the compiler supports -fno-strict-aliasing])
316 AC_MSG_RESULT([${have_no_strict_aliasing}])
317 CFLAGS="${CFLAGS_save}"
318 if test "x${have_no_strict_aliasing}" = "xyes" ; then
319 EINA_CFLAGS="${EINA_CFLAGS} -fno-strict-aliasing"
322 AC_SUBST(EINA_CPPFLAGS)
323 AC_SUBST(EINA_CFLAGS)
326 ### Checks for linker characteristics
328 lt_enable_auto_import=""
331 EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
332 lt_enable_auto_import="-Wl,--enable-auto-import"
347 EINA_LIBS="-ldl -lrt -lm"
351 AC_SUBST(lt_enable_auto_import)
354 ### Checks for library functions
362 AC_DEFINE(HAVE_DLADDR)
365 AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
366 if test "x${res}" = "xyes" ; then
367 AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
369 AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
370 if test "x${res}" = "xyes" ; then
371 AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
374 AC_MSG_ERROR([Cannot find dlopen])
379 AC_SUBST(dlopen_libs)
383 EINA_CHECK_MODULE([chained-pool], [yes], [chained pool])
384 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
385 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
386 EINA_CHECK_MODULE([fixed-bitmap], [yes], [fixed bitmap])
387 EINA_CHECK_MODULE([pass-through], [yes], [pass through])
390 ### Make the debug preprocessor configurable
392 ### Unit tests, coverage and benchmarking
394 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
396 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
397 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
398 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
399 if test "x$enable_coverage" = "xyes" ; then
400 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
403 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
404 EINA_BENCH_MODULE([evas], [${enable_benchmark}], [evas], [enable_benchmark_evas="yes"], [enable_benchmark_evas="no"])
405 EINA_BENCH_MODULE([ecore], [${enable_benchmark}], [ecore], [enable_benchmark_ecore="yes"], [enable_benchmark_ecore="no"])
406 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
408 AC_SUBST(requirement_eina)
410 ### Create the .pc.in file according to the major version
411 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
413 #exec_prefix=@exec_prefix@
415 #includedir=@includedir@
418 #Description: A Library that implements fast data types and miscellaneous tools
421 #Libs: -L${libdir} -leina
423 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
433 src/include/eina_config.h
436 src/modules/mp/Makefile
437 src/modules/mp/chained_pool/Makefile
438 src/modules/mp/ememoa_fixed/Makefile
439 src/modules/mp/ememoa_unknown/Makefile
440 src/modules/mp/pass_through/Makefile
441 src/modules/mp/fixed_bitmap/Makefile
447 #####################################################################
453 echo "------------------------------------------------------------------------"
454 echo "$PACKAGE $VERSION"
455 echo "------------------------------------------------------------------------"
458 echo "Configuration Options Summary:"
460 echo " Magic debug..........: ${have_magic_debug}"
461 echo " Safety checks........: ${have_safety_checks}"
462 echo " Maximum log level....: ${with_max_log_level}"
463 echo " Report string usage..: ${have_stringshare_usage}"
464 echo " Default mempool......: ${have_default_mempool}"
465 echo " Thread Support.......: ${have_pthread}"
466 echo " Amalgamation.........: ${do_amalgamation}"
468 echo " Documentation........: ${build_doc}"
469 echo " Tests................: ${enable_tests}"
470 echo " Coverage.............: ${enable_coverage}"
471 echo " Benchmark............: ${enable_benchmark}"
472 if test "x${enable_benchmark}" = "xyes" ; then
473 echo " Glib...............: ${enable_benchmark_glib}"
474 echo " Evas...............: ${enable_benchmark_evas}"
475 echo " Ecore..............: ${enable_benchmark_ecore}"
476 echo " E17 real data......: ${enable_benchmark_e17}"
479 echo "CPU Specific Extensions:"
481 echo " MMX..................: ${have_mmx}"
482 echo " SSE..................: ${have_sse}"
483 echo " SSE2.................: ${have_sse2}"
484 echo " ALTIVEC..............: ${have_altivec}"
486 echo " Memory pools:"
487 echo " Chained pool.......: ${enable_chained_pool}"
488 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
489 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
490 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
491 echo " Pass through.......: ${enable_pass_through}"
493 echo " Installation.........: make install"
495 echo " prefix.............: $prefix"
497 echo "Now type 'make' ('gmake' on some systems) to compile $PACKAGE,"
498 echo "and then afterwards as root (or the user who will install this), type"
499 echo "'make install'. Change users with 'su' or 'sudo' appropriately."
501 if test "x${have_static_module}" = "xyes" ; then
502 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Eina."
503 echo " You must know what you are doing, or else you will have a lot of problems."
504 echo " And dolphins will disappear from the earth."
505 echo " Think about that."