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"
27 AC_DEFINE_UNQUOTED(VMAJ, ["$VMAJ"], [Eina major version number])
29 AC_SUBST(version_info)
31 MODULE_ARCH="$host_os-$host_cpu-$release"
33 AC_DEFINE_UNQUOTED(MODULE_ARCH, "$MODULE_ARCH", "Module architecture")
35 ### Needed information
41 MODULE_ARCH="$host_os-$host_cpu"
44 release_info="-release $release"
45 MODULE_ARCH="$host_os-$host_cpu-$release"
48 AC_SUBST(release_info)
50 AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
52 AC_DEFINE_UNQUOTED(SHARED_LIB_SUFFIX, "$shrext_cmds", [Suffix for shared objects])
54 EFL_CHECK_CPU_MMX([have_mmx="yes"], [have_mmx="no"])
55 EFL_CHECK_CPU_SSE([have_sse="yes"], [have_sse="no"])
56 EFL_CHECK_CPU_SSE2([have_sse2="yes"], [have_sse2="no"])
57 EFL_CHECK_CPU_ALTIVEC([have_altivec="yes"], [have_altivec="no"])
59 EFL_CHECK_PTHREAD(["yes"],
62 [have_pthread_spinlock="yes"],
63 [have_pthread_spinlock="no"])
65 ### Additional options to configure
68 AC_ARG_ENABLE([magic-debug],
69 [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
71 if test "x${enableval}" = "xyes" ; then
72 have_magic_debug="yes"
77 [have_magic_debug="yes"])
79 AC_MSG_CHECKING([whether magic debug is enable])
80 AC_MSG_RESULT([${have_magic_debug}])
82 if test "x${have_magic_debug}" = "xyes" ; then
83 EINA_CONFIGURE_MAGIC_DEBUG="#define EINA_MAGIC_DEBUG"
85 AC_SUBST(EINA_CONFIGURE_MAGIC_DEBUG)
87 # Safety checks (avoid crashes on wrong api usage)
88 AC_ARG_ENABLE(safety-checks,
89 [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
91 if test "x${enableval}" = "xyes" ; then
92 have_safety_checks="yes"
94 have_safety_checks="no"
97 [have_safety_checks="yes"])
99 AC_MSG_CHECKING(whether to do safety checking on api parameters)
100 AC_MSG_RESULT($have_safety_checks)
102 AM_CONDITIONAL(SAFETY_CHECKS, test "x$have_safety_checks" = "xyes")
103 if test "x$have_safety_checks" = "xyes"; then
104 AC_DEFINE(EINA_SAFETY_CHECKS, 1, [disable safety checks for NULL pointers and like.])
105 EINA_CONFIGURE_SAFETY_CHECKS="#define EINA_SAFETY_CHECKS"
107 AC_SUBST(EINA_CONFIGURE_SAFETY_CHECKS)
109 with_max_log_level="<unset>"
110 AC_ARG_WITH(internal-maximum-log-level,
111 [AC_HELP_STRING([--with-internal-maximum-log-level=NUMBER],
112 [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.])],
114 if test "x${withval}" != "xno"; then
115 if echo "${withval}" | grep '^[[0-9]]\+$' >/dev/null 2>/dev/null; then
116 AC_MSG_NOTICE([ignoring any EINA_LOG() with level greater than ${withval}])
117 AC_DEFINE_UNQUOTED(EINA_LOG_LEVEL_MAXIMUM, ${withval}, [if set, logging is limited to this amount.])
118 with_max_log_level="${withval}"
120 AC_MSG_ERROR([--with-internal-maximum-log-level takes a decimal number, got "${withval}" instead.])
125 AC_ARG_ENABLE([amalgamation],
126 [AC_HELP_STRING([--enable-amalgamation], [enable generation of one single file with all source code in it, helps compiler optimizations.])],
127 [if test "x${enableval}" = "xyes"; then
128 do_amalgamation="yes"
133 [do_amalgamation="no"]
135 AM_CONDITIONAL(EINA_AMALGAMATION, test "x${do_amalgamation}" = "xyes")
137 # Choose best memory pool
138 AC_ARG_ENABLE([default-mempool],
139 [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
141 if test "x${enableval}" = "xyes"; then
142 have_default_mempool="yes"
144 have_default_mempool="no"
147 [have_default_mempool="no"]
149 AC_MSG_CHECKING([whether to use default mempool allocator])
150 AC_MSG_RESULT([${have_default_mempool}])
152 if test "x${have_default_mempool}" = "xyes" ; then
153 EINA_CONFIGURE_DEFAULT_MEMPOOL="#define EINA_DEFAULT_MEMPOOL"
155 AC_SUBST(EINA_CONFIGURE_DEFAULT_MEMPOOL)
157 # Report stringshare usage
158 AC_ARG_ENABLE([stringshare-usage],
159 [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
161 if test "x${enableval}" = "xyes"; then
162 have_stringshare_usage="yes"
164 have_stringshare_usage="no"
167 [have_stringshare_usage="no"]
169 AC_MSG_CHECKING([whether to report stringshare usage])
170 AC_MSG_RESULT([${have_stringshare_usage}])
172 if test "x${have_stringshare_usage}" = "xyes"; then
173 AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
176 # Check if we want to benchmark on real data
177 enable_benchmark_e17="no"
179 [AC_HELP_STRING([--enable-e17], [enable heavy benchmark @<:@default=no@:>@])],
181 if test "x${enableval}" = "xyes" ; then
182 enable_benchmark_e17="yes"
184 enable_benchmark_e17="no"
187 [enable_benchmark_e17="no"])
189 AC_MSG_CHECKING([whether e17 real data benchmark are built])
190 AC_MSG_RESULT([${enable_benchmark_e17}])
192 AM_CONDITIONAL(EINA_ENABLE_BENCHMARK_E17, test "x${enable_benchmark_e17}" = "xyes")
195 ### Checks for programs
201 # Check whether pkg-config supports Requires.private
202 if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
203 pkgconfig_requires_private="Requires.private"
205 pkgconfig_requires_private="Requires"
207 AC_SUBST(pkgconfig_requires_private)
209 # doxygen program for documentation building
211 EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
214 ### Checks for libraries
216 # Evil library for compilation on Windows CE
221 PKG_CHECK_MODULES([EVIL], [evil])
222 AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
223 requirement_eina="evil"
224 EFL_EINA_BUILD="-DEFL_EINA_BUILD"
227 AC_SUBST(EFL_EINA_BUILD)
229 # Check ememoa memory pool library
231 AC_ARG_ENABLE([ememoa],
232 [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
234 if test "x${enableval}" = "xyes" ; then
240 [enable_ememoa="yes"]
242 AC_MSG_CHECKING([whether to use ememoa for memory pool])
243 AC_MSG_RESULT([$enable_ememoa])
245 if test "x${enable_ememoa}" = "xyes" ; then
246 PKG_CHECK_MODULES([EMEMOA],
248 [enable_ememoa="yes"],
253 AM_CONDITIONAL(EINA_ENABLE_EMEMOA, test "x${enable_ememoa}" = "xyes")
254 if test "x${enable_ememoa}" = "xyes"; then
255 AC_DEFINE(EINA_EMEMOA_SUPPORT, 1, [Use by the test suite to try ememoa mempool])
258 ### Checks for header files
263 AC_CHECK_HEADER([fnmatch.h],
265 [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])])
270 ### Checks for structures
273 ### Checks for compiler characteristics
283 EINA_CPPFLAGS="-D_WIN32_WCE=0x0420"
286 EINA_CPPFLAGS="-D_WIN32_WINNT=0x0500"
293 EINA_CFLAGS="${EVIL_CFLAGS} -mwin32"
296 EINA_CFLAGS="${EVIL_CFLAGS}"
300 if ! test "x${VMIC}" = "x" ; then
301 EFL_COMPILER_FLAG([-Wall])
302 EFL_COMPILER_FLAG([-W])
305 EFL_COMPILER_FLAG([-Wshadow])
306 EFL_COMPILER_FLAG([-fno-strict-aliasing])
308 AC_SUBST(EINA_CPPFLAGS)
309 AC_SUBST(EINA_CFLAGS)
312 ### Checks for linker characteristics
314 lt_enable_auto_import=""
317 EINA_LIBS="-ldl ${EVIL_LIBS} -lm"
318 lt_enable_auto_import="-Wl,--enable-auto-import"
333 EINA_LIBS="-ldl -lrt -lm"
337 AC_SUBST(lt_enable_auto_import)
340 ### Checks for library functions
342 AC_CHECK_FUNCS(strlcpy)
349 AC_DEFINE(HAVE_DLADDR)
352 AC_CHECK_FUNCS([dlopen], [res="yes"], [res="no"])
353 if test "x${res}" = "xyes" ; then
354 AC_CHECK_FUNCS([dladdr], [AC_DEFINE(HAVE_DLADDR)])
356 AC_CHECK_LIB([dl], [dlopen], [res="yes"], [res="no"])
357 if test "x${res}" = "xyes" ; then
358 AC_CHECK_LIB([dl], [dladdr], [AC_DEFINE(HAVE_DLADDR)])
361 AC_MSG_ERROR([Cannot find dlopen])
366 AC_SUBST(dlopen_libs)
369 AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
370 if test "x$res" = "xno"; then
371 AC_SEARCH_LIBS([fnmatch],
372 [fnmatch evil iberty],
375 if test "x$res" = "xno"; then
376 AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty, nor libevil])
378 fnmatch_libs="${ac_cv_search_fnmatch}"
380 AC_SUBST(fnmatch_libs)
386 AC_ARG_WITH([iconv-link],
387 AC_HELP_STRING([--with-iconv-link=ICONV_LINK], [explicitly specify an iconv link option]),
393 AC_MSG_CHECKING(for explicit iconv link options)
394 if test "x${iconv_libs}" = "x" ; then
395 AC_MSG_RESULT([no explicit iconv link option])
397 AC_MSG_RESULT([$iconv_libs])
400 if test "x${have_iconv}" = "xno" ; then
401 AC_CHECK_HEADERS([iconv.h], [have_iconv="yes"])
403 if test "x${have_iconv}" = "xyes" ; then
404 AC_SEARCH_LIBS([iconv], [iconv iconv_plug], [], [have_iconv="no"])
408 AC_SUBST(iconv_cflags)
414 if test "x${have_default_mempool}" = "xyes" ; then
415 enable_chained_pool="no"
416 enable_pass_through="static"
418 enable_chained_pool="static"
419 enable_pass_through="no"
422 EINA_CHECK_MODULE([chained-pool], [${enable_chained_pool}], [chained pool])
423 EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
424 EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
425 EINA_CHECK_MODULE([fixed-bitmap], [no], [fixed bitmap])
426 EINA_CHECK_MODULE([pass-through], [${enable_pass_through}], [pass through])
427 EINA_CHECK_MODULE([buddy], [no], [buddy])
430 ### Make the debug preprocessor configurable
432 ### Unit tests, coverage and benchmarking
434 EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
436 EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
437 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_COVERAGE_CFLAGS}"
438 EINA_LIBS="${EINA_LIBS} ${EFL_COVERAGE_LIBS}"
439 if test "x$enable_coverage" = "xyes" ; then
440 EINA_CFLAGS="${EINA_CFLAGS} ${EFL_DEBUG_CFLAGS}"
443 EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
444 EINA_BENCH_MODULE([evas], [${enable_benchmark}], [evas], [enable_benchmark_evas="yes"], [enable_benchmark_evas="no"])
445 EINA_BENCH_MODULE([glib], [${enable_benchmark}], [glib-2.0], [enable_benchmark_glib="yes"], [enable_benchmark_glib="no"])
447 AC_SUBST(requirement_eina)
449 ### Create the .pc.in file according to the major version
450 #cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
452 #exec_prefix=@exec_prefix@
454 #includedir=@includedir@
457 #Description: A Library that implements fast data types and miscellaneous tools
460 #Libs: -L${libdir} -leina
462 #Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
472 src/include/eina_config.h
475 src/modules/mp/Makefile
476 src/modules/mp/chained_pool/Makefile
477 src/modules/mp/ememoa_fixed/Makefile
478 src/modules/mp/ememoa_unknown/Makefile
479 src/modules/mp/pass_through/Makefile
480 src/modules/mp/fixed_bitmap/Makefile
481 src/modules/mp/buddy/Makefile
487 #####################################################################
493 echo "------------------------------------------------------------------------"
494 echo "$PACKAGE $VERSION"
495 echo "------------------------------------------------------------------------"
498 echo "Configuration Options Summary:"
500 echo " Magic debug..........: ${have_magic_debug}"
501 echo " Safety checks........: ${have_safety_checks}"
502 echo " Maximum log level....: ${with_max_log_level}"
503 echo " Report string usage..: ${have_stringshare_usage}"
504 echo " Default mempool......: ${have_default_mempool}"
505 echo " Thread Support.......: ${have_pthread} (spinlock: ${have_pthread_spinlock})"
506 echo " Amalgamation.........: ${do_amalgamation}"
507 echo " Iconv support........: ${have_iconv}"
509 echo " Documentation........: ${build_doc}"
510 echo " Tests................: ${enable_tests}"
511 echo " Coverage.............: ${enable_coverage}"
512 echo " Benchmark............: ${enable_benchmark}"
513 if test "x${enable_benchmark}" = "xyes" ; then
514 echo " Glib...............: ${enable_benchmark_glib}"
515 echo " Evas...............: ${enable_benchmark_evas}"
516 echo " E17 real data......: ${enable_benchmark_e17}"
519 echo " CPU Specific Extensions:"
520 echo " MMX................: ${have_mmx}"
521 echo " SSE................: ${have_sse}"
522 echo " SSE2...............: ${have_sse2}"
523 echo " ALTIVEC............: ${have_altivec}"
525 echo " Memory pools:"
526 echo " Chained pool.......: ${enable_chained_pool}"
527 echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
528 echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
529 echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
530 echo " Pass through.......: ${enable_pass_through}"
531 echo " Buddy..............: ${enable_buddy}"
533 echo "Compilation............: make (or gmake)"
534 echo " CPPFLAGS.............: $CPPFLAGS"
535 echo " CFLAGS...............: $CFLAGS"
536 echo " LDFLAGS..............: $LDFLAGS"
538 echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
539 echo " prefix...............: $prefix"
541 if test "x${have_static_module}" = "xyes" ; then
542 echo -e "\0033\01331;31mWarning\0033\01331;0m: You are trying to link statically one or more modules to Eina."
543 echo " You must know what you are doing, or else you will have a lot of problems."
544 echo " And dolphins will disappear from the earth."
545 echo " Think about that."