# Magic debug
AC_ARG_ENABLE([magic-debug],
- [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure [default=enabled]])],
+ [AC_HELP_STRING([--disable-magic-debug], [disable magic debug of eina structure @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
have_magic_debug="yes"
# Safety checks (avoid crashes on wrong api usage)
AC_ARG_ENABLE(safety-checks,
- [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. [default=enabled]])],
+ [AC_HELP_STRING([--disable-safety-checks], [disable safety checks for NULL pointers and like. @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
have_safety_checks="yes"
# Choose best memory pool
AC_ARG_ENABLE([default-mempool],
- [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. [default=disabled]])],
+ [AC_HELP_STRING([--enable-default-mempool], [Default memory allocator could be faster for some computer. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes"; then
have_default_mempool="yes"
# Report stringshare usage
AC_ARG_ENABLE([stringshare-usage],
- [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. [default=disabled]])],
+ [AC_HELP_STRING([--enable-stringshare-usage], [Report stringshare usage on stringshare shutdown. @<:@default=disabled@:>@])],
[
if test "x${enableval}" = "xyes"; then
have_stringshare_usage="yes"
AC_DEFINE(EINA_STRINGSHARE_USAGE, 1, [Report Eina stringshare usage pattern])
fi
-# Ememoa memory pool
-
-AC_ARG_ENABLE([ememoa],
- [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
- [
- if test "x${enableval}" = "xyes" ; then
- enable_ememoa="yes"
- else
- enable_ememoa="no"
- fi
- ],
- [enable_ememoa="yes"]
-)
-AC_MSG_CHECKING([whether to use ememoa for memory pool])
-AC_MSG_RESULT([$enable_ememoa])
-
-# Static linking
-
-EINA_CHECK_STATIC([chained-pool], [chained pool])
-EINA_CHECK_STATIC([ememoa-fixed], [ememoa fixed])
-EINA_CHECK_STATIC([ememoa-unknown], [ememoa unknown])
-EINA_CHECK_STATIC([pass-through], [pass through])
-EINA_CHECK_STATIC([fixed-bitmap], [fixed bitmap])
-
### Checks for programs
AC_PROG_CC
# Check ememoa memory pool library
+AC_ARG_ENABLE([ememoa],
+ [AC_HELP_STRING([--enable-ememoa], [build ememoa memory pool module @<:@default=yes@:>@])],
+ [
+ if test "x${enableval}" = "xyes" ; then
+ enable_ememoa="yes"
+ else
+ enable_ememoa="no"
+ fi
+ ],
+ [enable_ememoa="yes"]
+)
+AC_MSG_CHECKING([whether to use ememoa for memory pool])
+AC_MSG_RESULT([$enable_ememoa])
+
if test "x${enable_ememoa}" = "xyes" ; then
PKG_CHECK_MODULES([EMEMOA],
[ememoa >= 0.0.26 ],
esac
AC_SUBST(dlopen_libs)
+### Modules
+
+EINA_CHECK_MODULE([chained-pool], [yes], [chained pool])
+EINA_CHECK_MODULE([ememoa-fixed], [${enable_ememoa}], [ememoa fixed])
+EINA_CHECK_MODULE([ememoa-unknown], [${enable_ememoa}], [ememoa unknown])
+EINA_CHECK_MODULE([fixed-bitmap], [yes], [fixed bitmap])
+EINA_CHECK_MODULE([pass-through], [yes], [pass through])
+
+
+### Make the debug preprocessor configurable
+
+### Unit tests, coverage and benchmarking
+
+EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
+EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
+EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
+
### Create the .pc.in file according to the major version
#cat > ${srcdir}/eina-${VMAJ}.pc.in << EOF
#Cflags: -I${includedir}/eina-@VMAJ@ -I${includedir}/eina-@VMAJ@/eina
#EOF
-
-### Make the debug preprocessor configurable
-
-### Unit tests, coverage and benchmarking
-
-EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
-EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
-EFL_CHECK_BENCHMARK([enable_benchmark="yes"], [enable_benchmark="no"])
-
AC_CONFIG_FILES([
Makefile
eina-0.pc
echo " SSE2.................: ${have_sse2}"
echo " ALTIVEC..............: ${have_altivec}"
echo
-echo " Memory pool:"
-echo " Ememoa.............: ${enable_ememoa}"
-echo
-echo " Static build of memory pools:"
-echo " Chained pool.......: ${enable_static_chained_pool}"
-echo " Ememoa fixed.......: ${enable_static_ememoa_fixed}"
-echo " Ememoa unknown.....: ${enable_static_ememoa_unknown}"
-echo " Pass through.......: ${enable_static_pass_through}"
+echo " Memory pools:"
+echo " Chained pool.......: ${enable_chained_pool}"
+echo " Ememoa fixed.......: ${enable_ememoa_fixed}"
+echo " Ememoa unknown.....: ${enable_ememoa_unknown}"
+echo " Fixed bitmap.......: ${enable_fixed_bitmap}"
+echo " Pass through.......: ${enable_pass_through}"
echo
echo " Installation.........: make install"
echo
-dnl use: EINA_CHECK_STATIC(foo-bar, description)
-AC_DEFUN([EINA_CHECK_STATIC],
+dnl use: EINA_CHECK_MODULE(foo-bar, have_dependency, description)
+AC_DEFUN([EINA_CHECK_MODULE],
[
-pushdef([UP], translit([$1], [-a-z], [_A-Z]))dnl
-pushdef([DOWN], translit([$1], [-A-Z], [_a-z]))dnl
+m4_pushdef([UP], m4_translit([$1], [-a-z], [_A-Z]))dnl
+m4_pushdef([DOWN], m4_translit([$1], [-A-Z], [_a-z]))dnl
-AC_ARG_ENABLE([static-$1],
- [AC_HELP_STRING([--enable-static-$1], [enable static build of $2 @<:@default=no@:>@])],
+want_module="$2"
+
+AC_ARG_ENABLE([$1],
+ [AC_HELP_STRING([--enable-$1@<:@=yes|static|no@:>@], [enable build of $3 @<:@default=yes@:>@])],
[
if test "x${enableval}" = "xyes" ; then
- enable_static_[]DOWN="yes"
+ enable_module="yes"
else
- enable_static_[]DOWN="no"
+ if test "x${enableval}" = "xstatic" ; then
+ enable_module="static"
+ else
+ enable_module="no"
+ fi
fi
],
- [enable_static_[]DOWN="no"]
+ [enable_module="yes"]
)
-AC_MSG_CHECKING([whether $2 is statically build])
-AC_MSG_RESULT([${enable_static_[]DOWN}])
-AM_CONDITIONAL(EINA_STATIC_BUILD_[]UP, test "x${enable_static_[]DOWN}" = "xyes")
+have_module="no"
+if test "x${enable_module}" = "xyes" -o "x${enable_module}" = "xstatic" ; then
+ have_module="yes"
+fi
+
+AC_MSG_CHECKING([whether to enable $3 built])
+AC_MSG_RESULT([${have_module}])
+
+build_module="no"
+if test "x${want_module}" = "xyes" -a "x${have_module}" = "xyes" ; then
+ build_module="yes"
+fi
+
+AC_MSG_CHECKING([whether to build $3])
+AC_MSG_RESULT([${build_module}])
-if test "x${enable_static_[]DOWN}" = "xyes" ; then
+static_module="no"
+if test "x${want_module}" = "xyes" -a "x${enable_module}" = "xstatic" ; then
+ static_module="yes"
+fi
+
+AC_MSG_CHECKING([whether to statically link $3])
+AC_MSG_RESULT([${static_module}])
+
+AM_CONDITIONAL(EINA_BUILD_[]UP, [test "x${build_module}" = "xyes"])
+AM_CONDITIONAL(EINA_STATIC_BUILD_[]UP, [test "x${static_module}" = "xyes"])
+
+if test "x${static_module}" = "xyes" ; then
AC_DEFINE(EINA_STATIC_BUILD_[]UP, 1, [Set to 1 if $2 is statically built])
fi
-popdef([UP])
-popdef([DOWN])
-])
\ No newline at end of file
+enable_[]DOWN="no"
+if test "x${want_module}" = "xyes" ; then
+ enable_[]DOWN=${enable_module}
+fi
+
+m4_popdef([UP])
+m4_popdef([DOWN])
+])