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 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(["yes"],
56 [have_pthread_spinlock="yes"],
57 [have_pthread_spinlock="no"])
59 ### Additional options to configure
62 AC_ARG_ENABLE([magic-debug],
63 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
65 if test "x${enableval}" = "xyes" ; then
66 have_magic_debug="yes"
71 [have_magic_debug="yes"])
73 AC_MSG_CHECKING([whether magic debug is enable])
74 AC_MSG_RESULT([${have_magic_debug}])
76 if test "x${have_magic_debug}" = "xyes" ; then
77 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
79 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
81 # Safety checks (avoid crashes on wrong api usage)
82 AC_ARG_ENABLE(safety-checks,
83 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
85 if test "x${enableval}" = "xyes" ; then
86 have_safety_checks="yes"
88 have_safety_checks="no"
91 [have_safety_checks="yes"])
93 AC_MSG_CHECKING(whether to do safety checking on api parameters)
94 AC_MSG_RESULT($have_safety_checks)
96 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
97 if test "x$have_safety_checks" = "xyes"; then
98 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
99 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
101 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
103 with_max_log_level="<unset>"
104 AC_ARG_WITH(internal-maximum-log-level,
105 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
106 [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.])],
108 if test "x${withval}" != "xno"; then
109 if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
110 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
111 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
112 with_max_log_level="${withval}"
114 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
119 AC_ARG_ENABLE([amalgamation],
120 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
121 [if test "x${enableval}" = "xyes"; then
122 do_amalgamation="yes"
127 [do_amalgamation="no"]
129 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
131 # Choose best memory pool
132 AC_ARG_ENABLE([default-mempool],
133 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
135 if test "x${enableval}" = "xyes"; then
136 have_default_mempool="yes"
138 have_default_mempool="no"
141 [have_default_mempool="no"]
143 AC_MSG_CHECKING([whether to use default mempool allocator])
144 AC_MSG_RESULT([${have_default_mempool}])
146 if test "x${have_default_mempool}" = "xyes" ; then
147 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
149 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
151 # Report stringshare usage
152 AC_ARG_ENABLE([stringshare-usage],
153 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
155 if test "x${enableval}" = "xyes"; then
156 have_stringshare_usage="yes"
158 have_stringshare_usage="no"
161 [have_stringshare_usage="no"]
163 AC_MSG_CHECKING([whether to report stringshare usage])
164 AC_MSG_RESULT([${have_stringshare_usage}])
166 if test "x${have_stringshare_usage}" = "xyes"; then
167 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
170 # Check if we want to benchmark on real data
171 enable_benchmark_e17="no"
173 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
175 if test "x${enableval}" = "xyes" ; then
176 enable_benchmark_e17="yes"
178 enable_benchmark_e17="no"
181 [enable_benchmark_e17="no"])
183 AC_MSG_CHECKING([whether e17 real data benchmark are built])
184 AC_MSG_RESULT([${enable_benchmark_e17}])
186 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
189 ### Checks for programs
195 # Check whether pkg-config supports Requires.private
196 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
197 pkgconfig_requires_private="Requires.private"
199 pkgconfig_requires_private="Requires"
201 AC_SUBST(pkgconfig_requires_private)
203 # doxygen program for documentation building
205 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
208 ### Checks for libraries
210 # Evil library for compilation on Windows CE
215 PKG_CHECK_MODULES([EVIL], [evil])
216 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
217 requirement_eina="evil"
218 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
221 AC_SUBST(EFL_EINA_BUILD)
223 # Check ememoa memory pool library
225 AC_ARG_ENABLE([ememoa],
226 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
228 if test "x${enableval}" = "xyes" ; then
234 [enable_ememoa="yes"]
236 AC_MSG_CHECKING([whether to use ememoa for memory pool])
237 AC_MSG_RESULT([$enable_ememoa])
239 if test "x${enable_ememoa}" = "xyes" ; then
240 PKG_CHECK_MODULES([EMEMOA],
242 [enable_ememoa="yes"],
247 AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes")
248 if test "x${enable_ememoa}" = "xyes"; then
249 AC_DEFINE(EINA_EMEMOA_SUPPORT, 1, [Use by the test suite to try ememoa mempool])
252 ### Checks for header files
257 AC_CHECK_HEADER([fnmatch.h],
259 [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])])
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)
382 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
383 if test "x$res" = "xno"; then
384 AC_SEARCH_LIBS([fnmatch],
385 [fnmatch evil iberty],
388 if test "x$res" = "xno"; then
389 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
391 fnmatch_libs="${ac_cv_search_fnmatch}"
393 AC_SUBST(fnmatch_libs)
397 EINA_CHECK_MODULE([chained-pool], [yes], [chained pool])
398 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
399 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
400 EINA_CHECK_MODULE([fixed-bitmap], [yes], [fixed bitmap])
401 EINA_CHECK_MODULE([pass-through], [yes], [pass through])
404 ### Make the debug preprocessor configurable
406 ### Unit tests, coverage and benchmarking
408 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
410 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
411 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
412 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
413 if test "x$enable_coverage" = "xyes" ; then
414 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
417 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
418 EINA_BENCH_MODULE([evas], [${enable_benchmark}], [evas], [enable_benchmark_evas="yes"], [enable_benchmark_evas="no"])
419 EINA_BENCH_MODULE([ecore], [${enable_benchmark}], [ecore], [enable_benchmark_ecore="yes"], [enable_benchmark_ecore="no"])
420 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
422 AC_SUBST(requirement_eina)
424 ### Create the .pc.in file according to the major version
425 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
427 #exec_prefix=@exec_prefix@
429 #includedir=@includedir@
432 #Description: A Library that implements fast data types and miscellaneous tools
435 #Libs: -L${libdir} -leina
437 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
447 src/include/eina_config.h
450 src/modules/mp/Makefile
451 src/modules/mp/chained_pool/Makefile
452 src/modules/mp/ememoa_fixed/Makefile
453 src/modules/mp/ememoa_unknown/Makefile
454 src/modules/mp/pass_through/Makefile
455 src/modules/mp/fixed_bitmap/Makefile
461 #####################################################################
467 echo "------------------------------------------------------------------------"
468 echo "$PACKAGE $VERSION"
469 echo "------------------------------------------------------------------------"
472 echo "Configuration Options Summary:"
474 echo " Magic debug..........: ${have_magic_debug}"
475 echo " Safety checks........: ${have_safety_checks}"
476 echo " Maximum log level....: ${with_max_log_level}"
477 echo " Report string usage..: ${have_stringshare_usage}"
478 echo " Default mempool......: ${have_default_mempool}"
479 echo " Thread Support.......: ${have_pthread} (spinlock: ${have_pthread_spinlock})"
480 echo " Amalgamation.........: ${do_amalgamation}"
482 echo " Documentation........: ${build_doc}"
483 echo " Tests................: ${enable_tests}"
484 echo " Coverage.............: ${enable_coverage}"
485 echo " Benchmark............: ${enable_benchmark}"
486 if test "x${enable_benchmark}" = "xyes" ; then
487 echo " Glib...............: ${enable_benchmark_glib}"
488 echo " Evas...............: ${enable_benchmark_evas}"
489 echo " Ecore..............: ${enable_benchmark_ecore}"
490 echo " E17 real data......: ${enable_benchmark_e17}"
493 echo " CPU Specific Extensions:"
494 echo " MMX................: ${have_mmx}"
495 echo " SSE................: ${have_sse}"
496 echo " SSE2...............: ${have_sse2}"
497 echo " ALTIVEC............: ${have_altivec}"
499 echo " Memory pools:"
500 echo " Chained pool.......: ${enable_chained_pool}"
501 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
502 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
503 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
504 echo " Pass through.......: ${enable_pass_through}"
506 echo "Compilation............: make (or gmake)"
507 echo " CPPFLAGS.............: $CPPFLAGS"
508 echo " CFLAGS...............: $CFLAGS"
509 echo " LDFLAGS..............: $LDFLAGS"
511 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
512 echo " prefix...............: $prefix"
514 if test "x${have_static_module}" = "xyes" ; then
515 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Eina."
516 echo " You must know what you are doing, or else you will have a lot of problems."
517 echo " And dolphins will disappear from the earth."
518 echo " Think about that."